@babylonlabs-io/core-ui 1.4.1 → 1.5.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.
Files changed (39) hide show
  1. package/dist/components/CounterButton/CounterButton.d.ts +8 -0
  2. package/dist/components/CounterButton/index.d.ts +1 -0
  3. package/dist/components/FinalityProviderItem/FinalityProviderItem.d.ts +17 -0
  4. package/dist/components/FinalityProviderItem/index.d.ts +1 -0
  5. package/dist/components/FinalityProviderLogo/FinalityProviderLogo.d.ts +9 -0
  6. package/dist/components/FinalityProviderLogo/index.d.ts +1 -0
  7. package/dist/components/Menu/Menu.d.ts +13 -0
  8. package/dist/components/Menu/MenuContext.d.ts +13 -0
  9. package/dist/components/Menu/MenuDrawer.d.ts +17 -0
  10. package/dist/components/Menu/MenuItem.d.ts +25 -0
  11. package/dist/components/Menu/SubMenu.d.ts +23 -0
  12. package/dist/components/Menu/SubMenuItem.d.ts +19 -0
  13. package/dist/components/Menu/index.d.ts +6 -0
  14. package/dist/components/ProvidersList/ProvidersList.d.ts +20 -0
  15. package/dist/components/ProvidersList/index.d.ts +1 -0
  16. package/dist/components/SubSection/SubSection.d.ts +6 -0
  17. package/dist/components/SubSection/index.d.ts +1 -0
  18. package/dist/hooks/useIsMobile.d.ts +7 -0
  19. package/dist/index.cjs.js +1 -20
  20. package/dist/index.cjs.js.map +1 -1
  21. package/dist/index.d.ts +8 -0
  22. package/dist/index.es.js +3765 -6163
  23. package/dist/index.es.js.map +1 -1
  24. package/dist/style.css +1 -1
  25. package/dist/utils/helpers.d.ts +31 -0
  26. package/dist/widgets/new-design/AmountSubsection/AmountSubsection.d.ts +20 -0
  27. package/dist/widgets/new-design/AmountSubsection/index.d.ts +1 -0
  28. package/dist/widgets/new-design/FeesSection/BBNFeeAmount.d.ts +10 -0
  29. package/dist/widgets/new-design/FeesSection/BTCFeeAmount.d.ts +10 -0
  30. package/dist/widgets/new-design/FeesSection/BTCFeeRate.d.ts +8 -0
  31. package/dist/widgets/new-design/FeesSection/FeeItem.d.ts +8 -0
  32. package/dist/widgets/new-design/FeesSection/FeesSection.d.ts +16 -0
  33. package/dist/widgets/new-design/FeesSection/Total.d.ts +10 -0
  34. package/dist/widgets/new-design/FeesSection/index.d.ts +6 -0
  35. package/dist/widgets/new-design/FinalityProviderSubsection/FinalityProviderSubsection.d.ts +9 -0
  36. package/dist/widgets/new-design/FinalityProviderSubsection/index.d.ts +1 -0
  37. package/dist/widgets/new-design/PreviewModal/PreviewModal.d.ts +28 -0
  38. package/dist/widgets/new-design/PreviewModal/index.d.ts +1 -0
  39. package/package.json +4 -2
package/dist/index.cjs.js CHANGED
@@ -1,21 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const F=require("react/jsx-runtime"),L=require("react"),Q=require("tailwind-merge"),Df=require("react-dom");function If(r){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const i in r)if(i!=="default"){const o=Object.getOwnPropertyDescriptor(r,i);Object.defineProperty(s,i,o.get?o:{enumerable:!0,get:()=>r[i]})}}return s.default=r,Object.freeze(s)}const Pn=If(L),t_=If(Df);function rr({value:r,defaultValue:s,onStateChange:i}={}){const[o,f]=L.useState(s),{current:c}=L.useRef(r!=null),v=c?r:o,p=L.useCallback(y=>{c||f(y),i==null||i(y)},[c,i,f]);return[v,p]}const hu=L.createContext({disabled:!1,expanded:!1});function n_({expanded:r,defaultExpanded:s,onChange:i,className:o,disabled:f=!1,children:c}){const[v=!1,p]=rr({value:r,defaultValue:s,onStateChange:i}),y=L.useCallback(()=>{p(!v)},[p,v]),O=L.useMemo(()=>({defaultExpanded:s,disabled:f,expanded:v&&!f,toggle:f?void 0:y}),[s,v,f,y]);return F.jsx(hu.Provider,{value:O,children:F.jsx("div",{className:Q.twJoin("bbn-accordion",f&&"bbn-accordion-disabled",o),children:c})})}const Nf=L.forwardRef(({variant:r="contained",size:s="large",color:i="primary",fluid:o=!1,className:f,disabled:c,...v},p)=>F.jsx("button",{...v,disabled:c,ref:p,className:Q.twJoin("bbn-btn",`bbn-btn-${r}`,`bbn-btn-${i}`,`bbn-btn-${s}`,o&&"bbn-btn-fluid",f)}));Nf.displayName="Button";const pu=({className:r,...s})=>F.jsx("button",{...s,className:Q.twJoin("bbn-btn-icon",r)});function r_({className:r,iconClassName:s,children:i,renderIcon:o=()=>null}){const{expanded:f,toggle:c}=L.useContext(hu),v=o(f);return F.jsxs("div",{className:Q.twJoin("bbn-accordion-summary",r),onClick:c,children:[i,v&&F.jsx(pu,{className:Q.twJoin("bbn-accordion-icon",s),children:v})]})}function vu(r,s){return typeof r!="number"?typeof s=="number"?vu(s):s:`${r}px`}function i_(r=!0){const[s,i]=L.useState("0px"),[o,f]=L.useState(),c=L.useRef(null);return L.useEffect(()=>{const v=new ResizeObserver(p=>{const[y]=p;i(vu(y.target.clientHeight)??"0px")});f(v)},[]),L.useEffect(function(){const{current:p}=c;if(!(!r||!p))return o==null||o.observe(p),()=>{o==null||o.unobserve(p)}},[r,o]),{height:s,ref:c}}function s_({unmountOnExit:r=!1,animationDuration:s=200,className:i,wrapperClassName:o,children:f}){const{expanded:c}=L.useContext(hu),[v,p]=L.useState(c),y=v||!r,{height:O,ref:w}=i_(y);return L.useEffect(function(){if(c===v)return;if(c){p(!0);return}const M=setTimeout(p,s,!1);return()=>{clearTimeout(M)}},[c,v,s]),F.jsx("div",{className:Q.twJoin("bbn-accordion-details",o),style:{height:c?O:"0px",visibility:v?"visible":"hidden",transitionDuration:`${s}ms`},children:y?F.jsx("div",{ref:w,className:Q.twJoin("bbn-accordion-content",i),children:f}):null})}const on=L.forwardRef(({variant:r="body1",as:s="p",children:i,className:o,...f},c)=>L.createElement(s,{...f,ref:c,className:Q.twJoin(`bbn-text-${r}`,o)},i));on.displayName="Text";const gu=L.forwardRef(({variant:r,as:s=r,children:i,className:o,...f},c)=>L.createElement(s,{...f,ref:c,className:Q.twJoin(`bbn-${r}`,o)},i));gu.displayName="Heading";function Pf({className:r,style:s,size:i="large",variant:o="circular",alt:f,url:c,children:v}){return F.jsx("div",{style:s,className:Q.twJoin("bbn-avatar",`bbn-avatar-${i}`,`bbn-avatar-${o}`,r),children:c?F.jsx("img",{className:"bbn-avatar-img",src:c,alt:f}):v})}const u_=({max:r=1/0,className:s,children:i,avatarClassName:o,variant:f,...c})=>{const v=L.Children.count(i);return F.jsxs("div",{className:Q.twJoin("bbn-avatar-group",s),children:[L.Children.map(i,(p,y)=>L.isValidElement(p)&&y+1<=r?L.cloneElement(p,{...c,className:Q.twMerge(o,p.props.className),variant:f}):null),v>r&&F.jsxs(Pf,{size:c.size,variant:f,className:o,children:["+",v-r]})]})},Bf=L.forwardRef(function({label:s,checked:i,defaultChecked:o=!1,inputProps:f,orientation:c="left",disabled:v=!1,className:p,inputType:y,labelClassName:O,renderIcon:w,onChange:C,...M},B){const[U=!1,Y]=rr({value:i,defaultValue:o,onStateChange:C});function V(k){var z;Y(k.currentTarget.checked),(z=f==null?void 0:f.onChange)==null||z.call(f,k)}const G=F.jsxs("span",{className:Q.twJoin("bbn-switcher",v&&"bbn-switcher-disabled",p),children:[w(U),F.jsx("input",{ref:B,type:y,disabled:v,className:"bbn-switcher-input",...M,...f,checked:U,onChange:V})]});return s?F.jsxs(on,{as:"label",variant:"body1",className:Q.twJoin("bbn-switcher-label",c==="left"?"bbn-switcher-left":"bbn-switcher-right",O),children:[G,s]}):G}),o_={false:F.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:F.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:F.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:F.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"})})},Mf=L.forwardRef(function(s,i){return F.jsx(Bf,{ref:i,...s,inputType:"checkbox",renderIcon:o=>o_[o.toString()]})}),a_={true:F.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:F.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:F.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:F.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"})})},Wf=L.forwardRef(function(s,i){return F.jsx(Bf,{ref:i,...s,inputType:"radio",renderIcon:o=>a_[o.toString()]})});var Vf={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},ff=L.createContext&&L.createContext(Vf),f_=["attr","size","title"];function l_(r,s){if(r==null)return{};var i=c_(r,s),o,f;if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);for(f=0;f<c.length;f++)o=c[f],!(s.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(r,o)&&(i[o]=r[o])}return i}function c_(r,s){if(r==null)return{};var i={};for(var o in r)if(Object.prototype.hasOwnProperty.call(r,o)){if(s.indexOf(o)>=0)continue;i[o]=r[o]}return i}function Pi(){return Pi=Object.assign?Object.assign.bind():function(r){for(var s=1;s<arguments.length;s++){var i=arguments[s];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])}return r},Pi.apply(this,arguments)}function lf(r,s){var i=Object.keys(r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);s&&(o=o.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),i.push.apply(i,o)}return i}function Bi(r){for(var s=1;s<arguments.length;s++){var i=arguments[s]!=null?arguments[s]:{};s%2?lf(Object(i),!0).forEach(function(o){d_(r,o,i[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):lf(Object(i)).forEach(function(o){Object.defineProperty(r,o,Object.getOwnPropertyDescriptor(i,o))})}return r}function d_(r,s,i){return s=h_(s),s in r?Object.defineProperty(r,s,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[s]=i,r}function h_(r){var s=p_(r,"string");return typeof s=="symbol"?s:s+""}function p_(r,s){if(typeof r!="object"||!r)return r;var i=r[Symbol.toPrimitive];if(i!==void 0){var o=i.call(r,s||"default");if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(s==="string"?String:Number)(r)}function Uf(r){return r&&r.map((s,i)=>L.createElement(s.tag,Bi({key:i},s.attr),Uf(s.child)))}function _u(r){return s=>L.createElement(v_,Pi({attr:Bi({},r.attr)},s),Uf(r.child))}function v_(r){var s=i=>{var{attr:o,size:f,title:c}=r,v=l_(r,f_),p=f||i.size||"1em",y;return i.className&&(y=i.className),r.className&&(y=(y?y+" ":"")+r.className),L.createElement("svg",Pi({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},i.attr,o,v,{className:y,style:Bi(Bi({color:r.color||i.color},i.style),r.style),height:p,width:p,xmlns:"http://www.w3.org/2000/svg"}),c&&L.createElement("title",null,c),r.children)};return ff!==void 0?L.createElement(ff.Consumer,null,i=>s(i)):s(Vf)}function g_(r){return _u({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M12 16L6 10H18L12 16Z"},child:[]}]})(r)}function __(r){return _u({tag:"svg",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:[]}]})(r)}function y_(r){return _u({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M12 8L18 14H6L12 8Z"},child:[]}]})(r)}var cf=function(s){return s.reduce(function(i,o){var f=o[0],c=o[1];return i[f]=c,i},{})},df=typeof window<"u"&&window.document&&window.document.createElement?Pn.useLayoutEffect:Pn.useEffect,ct="top",Dt="bottom",It="right",dt="left",yu="auto",Vr=[ct,Dt,It,dt],ir="start",Mr="end",m_="clippingParents",$f="viewport",Lr="popper",b_="reference",hf=Vr.reduce(function(r,s){return r.concat([s+"-"+ir,s+"-"+Mr])},[]),Hf=[].concat(Vr,[yu]).reduce(function(r,s){return r.concat([s,s+"-"+ir,s+"-"+Mr])},[]),w_="beforeRead",x_="read",A_="afterRead",O_="beforeMain",S_="main",C_="afterMain",E_="beforeWrite",R_="write",L_="afterWrite",T_=[w_,x_,A_,O_,S_,C_,E_,R_,L_];function Gt(r){return r?(r.nodeName||"").toLowerCase():null}function wt(r){if(r==null)return window;if(r.toString()!=="[object Window]"){var s=r.ownerDocument;return s&&s.defaultView||window}return r}function Wn(r){var s=wt(r).Element;return r instanceof s||r instanceof Element}function Ft(r){var s=wt(r).HTMLElement;return r instanceof s||r instanceof HTMLElement}function mu(r){if(typeof ShadowRoot>"u")return!1;var s=wt(r).ShadowRoot;return r instanceof s||r instanceof ShadowRoot}function F_(r){var s=r.state;Object.keys(s.elements).forEach(function(i){var o=s.styles[i]||{},f=s.attributes[i]||{},c=s.elements[i];!Ft(c)||!Gt(c)||(Object.assign(c.style,o),Object.keys(f).forEach(function(v){var p=f[v];p===!1?c.removeAttribute(v):c.setAttribute(v,p===!0?"":p)}))})}function D_(r){var s=r.state,i={popper:{position:s.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(s.elements.popper.style,i.popper),s.styles=i,s.elements.arrow&&Object.assign(s.elements.arrow.style,i.arrow),function(){Object.keys(s.elements).forEach(function(o){var f=s.elements[o],c=s.attributes[o]||{},v=Object.keys(s.styles.hasOwnProperty(o)?s.styles[o]:i[o]),p=v.reduce(function(y,O){return y[O]="",y},{});!Ft(f)||!Gt(f)||(Object.assign(f.style,p),Object.keys(c).forEach(function(y){f.removeAttribute(y)}))})}}const I_={name:"applyStyles",enabled:!0,phase:"write",fn:F_,effect:D_,requires:["computeStyles"]};function zt(r){return r.split("-")[0]}var Mn=Math.max,Mi=Math.min,sr=Math.round;function lu(){var r=navigator.userAgentData;return r!=null&&r.brands&&Array.isArray(r.brands)?r.brands.map(function(s){return s.brand+"/"+s.version}).join(" "):navigator.userAgent}function kf(){return!/^((?!chrome|android).)*safari/i.test(lu())}function ur(r,s,i){s===void 0&&(s=!1),i===void 0&&(i=!1);var o=r.getBoundingClientRect(),f=1,c=1;s&&Ft(r)&&(f=r.offsetWidth>0&&sr(o.width)/r.offsetWidth||1,c=r.offsetHeight>0&&sr(o.height)/r.offsetHeight||1);var v=Wn(r)?wt(r):window,p=v.visualViewport,y=!kf()&&i,O=(o.left+(y&&p?p.offsetLeft:0))/f,w=(o.top+(y&&p?p.offsetTop:0))/c,C=o.width/f,M=o.height/c;return{width:C,height:M,top:w,right:O+C,bottom:w+M,left:O,x:O,y:w}}function bu(r){var s=ur(r),i=r.offsetWidth,o=r.offsetHeight;return Math.abs(s.width-i)<=1&&(i=s.width),Math.abs(s.height-o)<=1&&(o=s.height),{x:r.offsetLeft,y:r.offsetTop,width:i,height:o}}function jf(r,s){var i=s.getRootNode&&s.getRootNode();if(r.contains(s))return!0;if(i&&mu(i)){var o=s;do{if(o&&r.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}function an(r){return wt(r).getComputedStyle(r)}function N_(r){return["table","td","th"].indexOf(Gt(r))>=0}function An(r){return((Wn(r)?r.ownerDocument:r.document)||window.document).documentElement}function ki(r){return Gt(r)==="html"?r:r.assignedSlot||r.parentNode||(mu(r)?r.host:null)||An(r)}function pf(r){return!Ft(r)||an(r).position==="fixed"?null:r.offsetParent}function P_(r){var s=/firefox/i.test(lu()),i=/Trident/i.test(lu());if(i&&Ft(r)){var o=an(r);if(o.position==="fixed")return null}var f=ki(r);for(mu(f)&&(f=f.host);Ft(f)&&["html","body"].indexOf(Gt(f))<0;){var c=an(f);if(c.transform!=="none"||c.perspective!=="none"||c.contain==="paint"||["transform","perspective"].indexOf(c.willChange)!==-1||s&&c.willChange==="filter"||s&&c.filter&&c.filter!=="none")return f;f=f.parentNode}return null}function Ur(r){for(var s=wt(r),i=pf(r);i&&N_(i)&&an(i).position==="static";)i=pf(i);return i&&(Gt(i)==="html"||Gt(i)==="body"&&an(i).position==="static")?s:i||P_(r)||s}function wu(r){return["top","bottom"].indexOf(r)>=0?"x":"y"}function Ir(r,s,i){return Mn(r,Mi(s,i))}function B_(r,s,i){var o=Ir(r,s,i);return o>i?i:o}function qf(){return{top:0,right:0,bottom:0,left:0}}function Jf(r){return Object.assign({},qf(),r)}function zf(r,s){return s.reduce(function(i,o){return i[o]=r,i},{})}var M_=function(s,i){return s=typeof s=="function"?s(Object.assign({},i.rects,{placement:i.placement})):s,Jf(typeof s!="number"?s:zf(s,Vr))};function W_(r){var s,i=r.state,o=r.name,f=r.options,c=i.elements.arrow,v=i.modifiersData.popperOffsets,p=zt(i.placement),y=wu(p),O=[dt,It].indexOf(p)>=0,w=O?"height":"width";if(!(!c||!v)){var C=M_(f.padding,i),M=bu(c),B=y==="y"?ct:dt,U=y==="y"?Dt:It,Y=i.rects.reference[w]+i.rects.reference[y]-v[y]-i.rects.popper[w],V=v[y]-i.rects.reference[y],G=Ur(c),k=G?y==="y"?G.clientHeight||0:G.clientWidth||0:0,z=Y/2-V/2,j=C[B],H=k-M[w]-C[U],X=k/2-M[w]/2+z,J=Ir(j,X,H),ae=y;i.modifiersData[o]=(s={},s[ae]=J,s.centerOffset=J-X,s)}}function V_(r){var s=r.state,i=r.options,o=i.element,f=o===void 0?"[data-popper-arrow]":o;f!=null&&(typeof f=="string"&&(f=s.elements.popper.querySelector(f),!f)||jf(s.elements.popper,f)&&(s.elements.arrow=f))}const U_={name:"arrow",enabled:!0,phase:"main",fn:W_,effect:V_,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function or(r){return r.split("-")[1]}var $_={top:"auto",right:"auto",bottom:"auto",left:"auto"};function H_(r,s){var i=r.x,o=r.y,f=s.devicePixelRatio||1;return{x:sr(i*f)/f||0,y:sr(o*f)/f||0}}function vf(r){var s,i=r.popper,o=r.popperRect,f=r.placement,c=r.variation,v=r.offsets,p=r.position,y=r.gpuAcceleration,O=r.adaptive,w=r.roundOffsets,C=r.isFixed,M=v.x,B=M===void 0?0:M,U=v.y,Y=U===void 0?0:U,V=typeof w=="function"?w({x:B,y:Y}):{x:B,y:Y};B=V.x,Y=V.y;var G=v.hasOwnProperty("x"),k=v.hasOwnProperty("y"),z=dt,j=ct,H=window;if(O){var X=Ur(i),J="clientHeight",ae="clientWidth";if(X===wt(i)&&(X=An(i),an(X).position!=="static"&&p==="absolute"&&(J="scrollHeight",ae="scrollWidth")),X=X,f===ct||(f===dt||f===It)&&c===Mr){j=Dt;var ve=C&&X===H&&H.visualViewport?H.visualViewport.height:X[J];Y-=ve-o.height,Y*=y?1:-1}if(f===dt||(f===ct||f===Dt)&&c===Mr){z=It;var fe=C&&X===H&&H.visualViewport?H.visualViewport.width:X[ae];B-=fe-o.width,B*=y?1:-1}}var he=Object.assign({position:p},O&&$_),ee=w===!0?H_({x:B,y:Y},wt(i)):{x:B,y:Y};if(B=ee.x,Y=ee.y,y){var ne;return Object.assign({},he,(ne={},ne[j]=k?"0":"",ne[z]=G?"0":"",ne.transform=(H.devicePixelRatio||1)<=1?"translate("+B+"px, "+Y+"px)":"translate3d("+B+"px, "+Y+"px, 0)",ne))}return Object.assign({},he,(s={},s[j]=k?Y+"px":"",s[z]=G?B+"px":"",s.transform="",s))}function k_(r){var s=r.state,i=r.options,o=i.gpuAcceleration,f=o===void 0?!0:o,c=i.adaptive,v=c===void 0?!0:c,p=i.roundOffsets,y=p===void 0?!0:p,O={placement:zt(s.placement),variation:or(s.placement),popper:s.elements.popper,popperRect:s.rects.popper,gpuAcceleration:f,isFixed:s.options.strategy==="fixed"};s.modifiersData.popperOffsets!=null&&(s.styles.popper=Object.assign({},s.styles.popper,vf(Object.assign({},O,{offsets:s.modifiersData.popperOffsets,position:s.options.strategy,adaptive:v,roundOffsets:y})))),s.modifiersData.arrow!=null&&(s.styles.arrow=Object.assign({},s.styles.arrow,vf(Object.assign({},O,{offsets:s.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:y})))),s.attributes.popper=Object.assign({},s.attributes.popper,{"data-popper-placement":s.placement})}const j_={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:k_,data:{}};var Fi={passive:!0};function q_(r){var s=r.state,i=r.instance,o=r.options,f=o.scroll,c=f===void 0?!0:f,v=o.resize,p=v===void 0?!0:v,y=wt(s.elements.popper),O=[].concat(s.scrollParents.reference,s.scrollParents.popper);return c&&O.forEach(function(w){w.addEventListener("scroll",i.update,Fi)}),p&&y.addEventListener("resize",i.update,Fi),function(){c&&O.forEach(function(w){w.removeEventListener("scroll",i.update,Fi)}),p&&y.removeEventListener("resize",i.update,Fi)}}const J_={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:q_,data:{}};var z_={left:"right",right:"left",bottom:"top",top:"bottom"};function Di(r){return r.replace(/left|right|bottom|top/g,function(s){return z_[s]})}var G_={start:"end",end:"start"};function gf(r){return r.replace(/start|end/g,function(s){return G_[s]})}function xu(r){var s=wt(r),i=s.pageXOffset,o=s.pageYOffset;return{scrollLeft:i,scrollTop:o}}function Au(r){return ur(An(r)).left+xu(r).scrollLeft}function Z_(r,s){var i=wt(r),o=An(r),f=i.visualViewport,c=o.clientWidth,v=o.clientHeight,p=0,y=0;if(f){c=f.width,v=f.height;var O=kf();(O||!O&&s==="fixed")&&(p=f.offsetLeft,y=f.offsetTop)}return{width:c,height:v,x:p+Au(r),y}}function Y_(r){var s,i=An(r),o=xu(r),f=(s=r.ownerDocument)==null?void 0:s.body,c=Mn(i.scrollWidth,i.clientWidth,f?f.scrollWidth:0,f?f.clientWidth:0),v=Mn(i.scrollHeight,i.clientHeight,f?f.scrollHeight:0,f?f.clientHeight:0),p=-o.scrollLeft+Au(r),y=-o.scrollTop;return an(f||i).direction==="rtl"&&(p+=Mn(i.clientWidth,f?f.clientWidth:0)-c),{width:c,height:v,x:p,y}}function Ou(r){var s=an(r),i=s.overflow,o=s.overflowX,f=s.overflowY;return/auto|scroll|overlay|hidden/.test(i+f+o)}function Gf(r){return["html","body","#document"].indexOf(Gt(r))>=0?r.ownerDocument.body:Ft(r)&&Ou(r)?r:Gf(ki(r))}function Nr(r,s){var i;s===void 0&&(s=[]);var o=Gf(r),f=o===((i=r.ownerDocument)==null?void 0:i.body),c=wt(o),v=f?[c].concat(c.visualViewport||[],Ou(o)?o:[]):o,p=s.concat(v);return f?p:p.concat(Nr(ki(v)))}function cu(r){return Object.assign({},r,{left:r.x,top:r.y,right:r.x+r.width,bottom:r.y+r.height})}function K_(r,s){var i=ur(r,!1,s==="fixed");return i.top=i.top+r.clientTop,i.left=i.left+r.clientLeft,i.bottom=i.top+r.clientHeight,i.right=i.left+r.clientWidth,i.width=r.clientWidth,i.height=r.clientHeight,i.x=i.left,i.y=i.top,i}function _f(r,s,i){return s===$f?cu(Z_(r,i)):Wn(s)?K_(s,i):cu(Y_(An(r)))}function X_(r){var s=Nr(ki(r)),i=["absolute","fixed"].indexOf(an(r).position)>=0,o=i&&Ft(r)?Ur(r):r;return Wn(o)?s.filter(function(f){return Wn(f)&&jf(f,o)&&Gt(f)!=="body"}):[]}function Q_(r,s,i,o){var f=s==="clippingParents"?X_(r):[].concat(s),c=[].concat(f,[i]),v=c[0],p=c.reduce(function(y,O){var w=_f(r,O,o);return y.top=Mn(w.top,y.top),y.right=Mi(w.right,y.right),y.bottom=Mi(w.bottom,y.bottom),y.left=Mn(w.left,y.left),y},_f(r,v,o));return p.width=p.right-p.left,p.height=p.bottom-p.top,p.x=p.left,p.y=p.top,p}function Zf(r){var s=r.reference,i=r.element,o=r.placement,f=o?zt(o):null,c=o?or(o):null,v=s.x+s.width/2-i.width/2,p=s.y+s.height/2-i.height/2,y;switch(f){case ct:y={x:v,y:s.y-i.height};break;case Dt:y={x:v,y:s.y+s.height};break;case It:y={x:s.x+s.width,y:p};break;case dt:y={x:s.x-i.width,y:p};break;default:y={x:s.x,y:s.y}}var O=f?wu(f):null;if(O!=null){var w=O==="y"?"height":"width";switch(c){case ir:y[O]=y[O]-(s[w]/2-i[w]/2);break;case Mr:y[O]=y[O]+(s[w]/2-i[w]/2);break}}return y}function Wr(r,s){s===void 0&&(s={});var i=s,o=i.placement,f=o===void 0?r.placement:o,c=i.strategy,v=c===void 0?r.strategy:c,p=i.boundary,y=p===void 0?m_:p,O=i.rootBoundary,w=O===void 0?$f:O,C=i.elementContext,M=C===void 0?Lr:C,B=i.altBoundary,U=B===void 0?!1:B,Y=i.padding,V=Y===void 0?0:Y,G=Jf(typeof V!="number"?V:zf(V,Vr)),k=M===Lr?b_:Lr,z=r.rects.popper,j=r.elements[U?k:M],H=Q_(Wn(j)?j:j.contextElement||An(r.elements.popper),y,w,v),X=ur(r.elements.reference),J=Zf({reference:X,element:z,strategy:"absolute",placement:f}),ae=cu(Object.assign({},z,J)),ve=M===Lr?ae:X,fe={top:H.top-ve.top+G.top,bottom:ve.bottom-H.bottom+G.bottom,left:H.left-ve.left+G.left,right:ve.right-H.right+G.right},he=r.modifiersData.offset;if(M===Lr&&he){var ee=he[f];Object.keys(fe).forEach(function(ne){var be=[It,Dt].indexOf(ne)>=0?1:-1,Ee=[ct,Dt].indexOf(ne)>=0?"y":"x";fe[ne]+=ee[Ee]*be})}return fe}function ey(r,s){s===void 0&&(s={});var i=s,o=i.placement,f=i.boundary,c=i.rootBoundary,v=i.padding,p=i.flipVariations,y=i.allowedAutoPlacements,O=y===void 0?Hf:y,w=or(o),C=w?p?hf:hf.filter(function(U){return or(U)===w}):Vr,M=C.filter(function(U){return O.indexOf(U)>=0});M.length===0&&(M=C);var B=M.reduce(function(U,Y){return U[Y]=Wr(r,{placement:Y,boundary:f,rootBoundary:c,padding:v})[zt(Y)],U},{});return Object.keys(B).sort(function(U,Y){return B[U]-B[Y]})}function ty(r){if(zt(r)===yu)return[];var s=Di(r);return[gf(r),s,gf(s)]}function ny(r){var s=r.state,i=r.options,o=r.name;if(!s.modifiersData[o]._skip){for(var f=i.mainAxis,c=f===void 0?!0:f,v=i.altAxis,p=v===void 0?!0:v,y=i.fallbackPlacements,O=i.padding,w=i.boundary,C=i.rootBoundary,M=i.altBoundary,B=i.flipVariations,U=B===void 0?!0:B,Y=i.allowedAutoPlacements,V=s.options.placement,G=zt(V),k=G===V,z=y||(k||!U?[Di(V)]:ty(V)),j=[V].concat(z).reduce(function(Nt,je){return Nt.concat(zt(je)===yu?ey(s,{placement:je,boundary:w,rootBoundary:C,padding:O,flipVariations:U,allowedAutoPlacements:Y}):je)},[]),H=s.rects.reference,X=s.rects.popper,J=new Map,ae=!0,ve=j[0],fe=0;fe<j.length;fe++){var he=j[fe],ee=zt(he),ne=or(he)===ir,be=[ct,Dt].indexOf(ee)>=0,Ee=be?"width":"height",Oe=Wr(s,{placement:he,boundary:w,rootBoundary:C,altBoundary:M,padding:O}),ye=be?ne?It:dt:ne?Dt:ct;H[Ee]>X[Ee]&&(ye=Di(ye));var We=Di(ye),Xe=[];if(c&&Xe.push(Oe[ee]<=0),p&&Xe.push(Oe[ye]<=0,Oe[We]<=0),Xe.every(function(Nt){return Nt})){ve=he,ae=!1;break}J.set(he,Xe)}if(ae)for(var Qe=U?3:1,ke=function(je){var it=j.find(function(Zt){var qe=J.get(Zt);if(qe)return qe.slice(0,je).every(function(xt){return xt})});if(it)return ve=it,"break"},$t=Qe;$t>0;$t--){var fn=ke($t);if(fn==="break")break}s.placement!==ve&&(s.modifiersData[o]._skip=!0,s.placement=ve,s.reset=!0)}}const ry={name:"flip",enabled:!0,phase:"main",fn:ny,requiresIfExists:["offset"],data:{_skip:!1}};function yf(r,s,i){return i===void 0&&(i={x:0,y:0}),{top:r.top-s.height-i.y,right:r.right-s.width+i.x,bottom:r.bottom-s.height+i.y,left:r.left-s.width-i.x}}function mf(r){return[ct,It,Dt,dt].some(function(s){return r[s]>=0})}function iy(r){var s=r.state,i=r.name,o=s.rects.reference,f=s.rects.popper,c=s.modifiersData.preventOverflow,v=Wr(s,{elementContext:"reference"}),p=Wr(s,{altBoundary:!0}),y=yf(v,o),O=yf(p,f,c),w=mf(y),C=mf(O);s.modifiersData[i]={referenceClippingOffsets:y,popperEscapeOffsets:O,isReferenceHidden:w,hasPopperEscaped:C},s.attributes.popper=Object.assign({},s.attributes.popper,{"data-popper-reference-hidden":w,"data-popper-escaped":C})}const sy={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:iy};function uy(r,s,i){var o=zt(r),f=[dt,ct].indexOf(o)>=0?-1:1,c=typeof i=="function"?i(Object.assign({},s,{placement:r})):i,v=c[0],p=c[1];return v=v||0,p=(p||0)*f,[dt,It].indexOf(o)>=0?{x:p,y:v}:{x:v,y:p}}function oy(r){var s=r.state,i=r.options,o=r.name,f=i.offset,c=f===void 0?[0,0]:f,v=Hf.reduce(function(w,C){return w[C]=uy(C,s.rects,c),w},{}),p=v[s.placement],y=p.x,O=p.y;s.modifiersData.popperOffsets!=null&&(s.modifiersData.popperOffsets.x+=y,s.modifiersData.popperOffsets.y+=O),s.modifiersData[o]=v}const ay={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:oy};function fy(r){var s=r.state,i=r.name;s.modifiersData[i]=Zf({reference:s.rects.reference,element:s.rects.popper,strategy:"absolute",placement:s.placement})}const ly={name:"popperOffsets",enabled:!0,phase:"read",fn:fy,data:{}};function cy(r){return r==="x"?"y":"x"}function dy(r){var s=r.state,i=r.options,o=r.name,f=i.mainAxis,c=f===void 0?!0:f,v=i.altAxis,p=v===void 0?!1:v,y=i.boundary,O=i.rootBoundary,w=i.altBoundary,C=i.padding,M=i.tether,B=M===void 0?!0:M,U=i.tetherOffset,Y=U===void 0?0:U,V=Wr(s,{boundary:y,rootBoundary:O,padding:C,altBoundary:w}),G=zt(s.placement),k=or(s.placement),z=!k,j=wu(G),H=cy(j),X=s.modifiersData.popperOffsets,J=s.rects.reference,ae=s.rects.popper,ve=typeof Y=="function"?Y(Object.assign({},s.rects,{placement:s.placement})):Y,fe=typeof ve=="number"?{mainAxis:ve,altAxis:ve}:Object.assign({mainAxis:0,altAxis:0},ve),he=s.modifiersData.offset?s.modifiersData.offset[s.placement]:null,ee={x:0,y:0};if(X){if(c){var ne,be=j==="y"?ct:dt,Ee=j==="y"?Dt:It,Oe=j==="y"?"height":"width",ye=X[j],We=ye+V[be],Xe=ye-V[Ee],Qe=B?-ae[Oe]/2:0,ke=k===ir?J[Oe]:ae[Oe],$t=k===ir?-ae[Oe]:-J[Oe],fn=s.elements.arrow,Nt=B&&fn?bu(fn):{width:0,height:0},je=s.modifiersData["arrow#persistent"]?s.modifiersData["arrow#persistent"].padding:qf(),it=je[be],Zt=je[Ee],qe=Ir(0,J[Oe],Nt[Oe]),xt=z?J[Oe]/2-Qe-qe-it-fe.mainAxis:ke-qe-it-fe.mainAxis,fr=z?-J[Oe]/2+Qe+qe+Zt+fe.mainAxis:$t+qe+Zt+fe.mainAxis,Pt=s.elements.arrow&&Ur(s.elements.arrow),ln=Pt?j==="y"?Pt.clientTop||0:Pt.clientLeft||0:0,cn=(ne=he==null?void 0:he[j])!=null?ne:0,Ze=ye+xt-cn-ln,dn=ye+fr-cn,lr=Ir(B?Mi(We,Ze):We,ye,B?Mn(Xe,dn):Xe);X[j]=lr,ee[j]=lr-ye}if(p){var ht,g=j==="x"?ct:dt,x=j==="x"?Dt:It,S=X[H],N=H==="y"?"height":"width",P=S+V[g],I=S-V[x],K=[ct,dt].indexOf(G)!==-1,se=(ht=he==null?void 0:he[H])!=null?ht:0,Fe=K?P:S-J[N]-ae[N]-se+fe.altAxis,Se=K?S+J[N]+ae[N]-se-fe.altAxis:I,Je=B&&K?B_(Fe,S,Se):Ir(B?Fe:P,S,B?Se:I);X[H]=Je,ee[H]=Je-S}s.modifiersData[o]=ee}}const hy={name:"preventOverflow",enabled:!0,phase:"main",fn:dy,requiresIfExists:["offset"]};function py(r){return{scrollLeft:r.scrollLeft,scrollTop:r.scrollTop}}function vy(r){return r===wt(r)||!Ft(r)?xu(r):py(r)}function gy(r){var s=r.getBoundingClientRect(),i=sr(s.width)/r.offsetWidth||1,o=sr(s.height)/r.offsetHeight||1;return i!==1||o!==1}function _y(r,s,i){i===void 0&&(i=!1);var o=Ft(s),f=Ft(s)&&gy(s),c=An(s),v=ur(r,f,i),p={scrollLeft:0,scrollTop:0},y={x:0,y:0};return(o||!o&&!i)&&((Gt(s)!=="body"||Ou(c))&&(p=vy(s)),Ft(s)?(y=ur(s,!0),y.x+=s.clientLeft,y.y+=s.clientTop):c&&(y.x=Au(c))),{x:v.left+p.scrollLeft-y.x,y:v.top+p.scrollTop-y.y,width:v.width,height:v.height}}function yy(r){var s=new Map,i=new Set,o=[];r.forEach(function(c){s.set(c.name,c)});function f(c){i.add(c.name);var v=[].concat(c.requires||[],c.requiresIfExists||[]);v.forEach(function(p){if(!i.has(p)){var y=s.get(p);y&&f(y)}}),o.push(c)}return r.forEach(function(c){i.has(c.name)||f(c)}),o}function my(r){var s=yy(r);return T_.reduce(function(i,o){return i.concat(s.filter(function(f){return f.phase===o}))},[])}function by(r){var s;return function(){return s||(s=new Promise(function(i){Promise.resolve().then(function(){s=void 0,i(r())})})),s}}function wy(r){var s=r.reduce(function(i,o){var f=i[o.name];return i[o.name]=f?Object.assign({},f,o,{options:Object.assign({},f.options,o.options),data:Object.assign({},f.data,o.data)}):o,i},{});return Object.keys(s).map(function(i){return s[i]})}var bf={placement:"bottom",modifiers:[],strategy:"absolute"};function wf(){for(var r=arguments.length,s=new Array(r),i=0;i<r;i++)s[i]=arguments[i];return!s.some(function(o){return!(o&&typeof o.getBoundingClientRect=="function")})}function xy(r){r===void 0&&(r={});var s=r,i=s.defaultModifiers,o=i===void 0?[]:i,f=s.defaultOptions,c=f===void 0?bf:f;return function(p,y,O){O===void 0&&(O=c);var w={placement:"bottom",orderedModifiers:[],options:Object.assign({},bf,c),modifiersData:{},elements:{reference:p,popper:y},attributes:{},styles:{}},C=[],M=!1,B={state:w,setOptions:function(G){var k=typeof G=="function"?G(w.options):G;Y(),w.options=Object.assign({},c,w.options,k),w.scrollParents={reference:Wn(p)?Nr(p):p.contextElement?Nr(p.contextElement):[],popper:Nr(y)};var z=my(wy([].concat(o,w.options.modifiers)));return w.orderedModifiers=z.filter(function(j){return j.enabled}),U(),B.update()},forceUpdate:function(){if(!M){var G=w.elements,k=G.reference,z=G.popper;if(wf(k,z)){w.rects={reference:_y(k,Ur(z),w.options.strategy==="fixed"),popper:bu(z)},w.reset=!1,w.placement=w.options.placement,w.orderedModifiers.forEach(function(fe){return w.modifiersData[fe.name]=Object.assign({},fe.data)});for(var j=0;j<w.orderedModifiers.length;j++){if(w.reset===!0){w.reset=!1,j=-1;continue}var H=w.orderedModifiers[j],X=H.fn,J=H.options,ae=J===void 0?{}:J,ve=H.name;typeof X=="function"&&(w=X({state:w,options:ae,name:ve,instance:B})||w)}}}},update:by(function(){return new Promise(function(V){B.forceUpdate(),V(w)})}),destroy:function(){Y(),M=!0}};if(!wf(p,y))return B;B.setOptions(O).then(function(V){!M&&O.onFirstUpdate&&O.onFirstUpdate(V)});function U(){w.orderedModifiers.forEach(function(V){var G=V.name,k=V.options,z=k===void 0?{}:k,j=V.effect;if(typeof j=="function"){var H=j({state:w,name:G,instance:B,options:z}),X=function(){};C.push(H||X)}})}function Y(){C.forEach(function(V){return V()}),C=[]}return B}}var Ay=[J_,ly,j_,I_,ay,ry,hy,U_,sy],Oy=xy({defaultModifiers:Ay}),Tr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Yf(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Sy=typeof Element<"u",Cy=typeof Map=="function",Ey=typeof Set=="function",Ry=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function Ii(r,s){if(r===s)return!0;if(r&&s&&typeof r=="object"&&typeof s=="object"){if(r.constructor!==s.constructor)return!1;var i,o,f;if(Array.isArray(r)){if(i=r.length,i!=s.length)return!1;for(o=i;o--!==0;)if(!Ii(r[o],s[o]))return!1;return!0}var c;if(Cy&&r instanceof Map&&s instanceof Map){if(r.size!==s.size)return!1;for(c=r.entries();!(o=c.next()).done;)if(!s.has(o.value[0]))return!1;for(c=r.entries();!(o=c.next()).done;)if(!Ii(o.value[1],s.get(o.value[0])))return!1;return!0}if(Ey&&r instanceof Set&&s instanceof Set){if(r.size!==s.size)return!1;for(c=r.entries();!(o=c.next()).done;)if(!s.has(o.value[0]))return!1;return!0}if(Ry&&ArrayBuffer.isView(r)&&ArrayBuffer.isView(s)){if(i=r.length,i!=s.length)return!1;for(o=i;o--!==0;)if(r[o]!==s[o])return!1;return!0}if(r.constructor===RegExp)return r.source===s.source&&r.flags===s.flags;if(r.valueOf!==Object.prototype.valueOf&&typeof r.valueOf=="function"&&typeof s.valueOf=="function")return r.valueOf()===s.valueOf();if(r.toString!==Object.prototype.toString&&typeof r.toString=="function"&&typeof s.toString=="function")return r.toString()===s.toString();if(f=Object.keys(r),i=f.length,i!==Object.keys(s).length)return!1;for(o=i;o--!==0;)if(!Object.prototype.hasOwnProperty.call(s,f[o]))return!1;if(Sy&&r instanceof Element)return!1;for(o=i;o--!==0;)if(!((f[o]==="_owner"||f[o]==="__v"||f[o]==="__o")&&r.$$typeof)&&!Ii(r[f[o]],s[f[o]]))return!1;return!0}return r!==r&&s!==s}var Ly=function(s,i){try{return Ii(s,i)}catch(o){if((o.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw o}};const Ty=Yf(Ly);var Fy=[],Dy=function(s,i,o){o===void 0&&(o={});var f=Pn.useRef(null),c={onFirstUpdate:o.onFirstUpdate,placement:o.placement||"bottom",strategy:o.strategy||"absolute",modifiers:o.modifiers||Fy},v=Pn.useState({styles:{popper:{position:c.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),p=v[0],y=v[1],O=Pn.useMemo(function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(B){var U=B.state,Y=Object.keys(U.elements);t_.flushSync(function(){y({styles:cf(Y.map(function(V){return[V,U.styles[V]||{}]})),attributes:cf(Y.map(function(V){return[V,U.attributes[V]]}))})})},requires:["computeStyles"]}},[]),w=Pn.useMemo(function(){var M={onFirstUpdate:c.onFirstUpdate,placement:c.placement,strategy:c.strategy,modifiers:[].concat(c.modifiers,[O,{name:"applyStyles",enabled:!1}])};return Ty(f.current,M)?f.current||M:(f.current=M,M)},[c.onFirstUpdate,c.placement,c.strategy,c.modifiers,O]),C=Pn.useRef();return df(function(){C.current&&C.current.setOptions(w)},[w]),df(function(){if(!(s==null||i==null)){var M=o.createPopper||Oy,B=M(s,i,w);return C.current=B,function(){B.destroy(),C.current=null}}},[s,i,o.createPopper]),{state:C.current?C.current.state:null,styles:p.styles,attributes:p.attributes,update:C.current?C.current.update:null,forceUpdate:C.current?C.current.forceUpdate:null}};function ji({children:r,mounted:s=!1,rootClassName:i="portal-root"}){const[o,f]=L.useState(null);return L.useEffect(()=>{if(!s){f(null);return}const c=document.createElement("div");return c.className=i,f(c),document.body.appendChild(c),()=>{document.body.removeChild(c)}},[s]),o?Df.createPortal(r,o):null}function Iy(r,s){if(r===s)return!0;if(r.length!==s.length)return!1;for(let i=0;i<r.length;i++)if(r[i]!==s[i])return!1;return!0}function Ny(r){const s=L.useRef(r);return Iy(s.current,r)||(s.current=r),s.current}function Py(r,s=()=>null,{enabled:i=!0}={}){const o=Array.isArray(r)?r:[r],f=Ny(o);L.useEffect(()=>{function c(v){i&&f.every(p=>!(p!=null&&p.contains(v.target)))&&s()}return document.addEventListener("mousedown",c),()=>{document.removeEventListener("mousedown",c)}},[f,i,s])}function Kf({open:r=!1,className:s,anchorEl:i,placement:o="bottom-start",offset:f=[0,0],children:c,style:v,onClickOutside:p}){const[y,O]=L.useState(null),{styles:w}=Dy(i,y,{placement:o,modifiers:[{name:"offset",options:{offset:f}}]});return Py([y,i],p,{enabled:r}),F.jsx(ji,{mounted:r,children:F.jsx("div",{ref:O,style:{...w.popper,...v},className:Q.twJoin("bbn-popover",s),children:c})})}function By(r){const[s,i]=L.useState({width:0,height:0});return L.useEffect(()=>{if(!r){i({width:0,height:0});return}const o=new ResizeObserver(([f])=>{i({width:f.target.clientWidth,height:f.target.clientHeight})});return o.observe(r),()=>{o.unobserve(r)}},[r]),s}const My=r=>r.label,Su=L.forwardRef(({disabled:r,className:s,value:i,defaultValue:o,placeholder:f="Select option",open:c,defaultOpen:v,options:p=[],optionClassName:y,popoverClassName:O,state:w="default",onOpen:C,onSelect:M,onClose:B,renderSelectedOption:U=My,...Y},V)=>{const G=L.useRef(null);L.useImperativeHandle(V,()=>G.current,[]);const{width:k}=By(G.current),[z,j]=rr({value:c,defaultValue:v,onStateChange:he=>void(he?C==null?void 0:C():B==null?void 0:B())}),[H,X]=rr({value:i,defaultValue:o,onStateChange:M}),J=L.useMemo(()=>p.find(he=>he.value===H),[p,H]),ae=L.useCallback(he=>{X(he.value),j(!1)},[X,j]),ve=L.useCallback(()=>{j(!1)},[j]),fe=L.useCallback(()=>{r||j(!z)},[z,r,j]);return F.jsxs(F.Fragment,{children:[F.jsxs("div",{ref:G,className:Q.twJoin("bbn-select",r&&"bbn-select-disabled",`bbn-select-${w}`,s),onClick:fe,tabIndex:r?-1:0,...Y,children:[F.jsx("span",{children:J?U(J):f}),F.jsx(__,{className:Q.twJoin("bbn-select-icon",z&&"bbn-select-icon-open"),size:20})]}),F.jsx(Kf,{anchorEl:G.current,className:Q.twJoin("bbn-select-menu custom-scrollbar",O),open:z&&!r,onClickOutside:ve,offset:[0,4],placement:"bottom-start",style:{width:k},children:p.map(he=>F.jsx("div",{className:Q.twJoin("bbn-select-option",(J==null?void 0:J.value)===he.value&&"bbn-select-option-selected",y),onClick:()=>ae(he),children:he.label},he.value))})]})});Su.displayName="Select";const qi=L.forwardRef(({className:r,prefix:s,suffix:i,disabled:o=!1,state:f="default",...c},v)=>F.jsxs("div",{className:Q.twJoin("bbn-input",o&&"bbn-input-disabled",`bbn-input-${f}`),children:[s&&F.jsx("div",{className:"bbn-input-prefix",children:s}),F.jsx("input",{ref:v,className:Q.twJoin("bbn-input-field",r),disabled:o,...c}),i&&F.jsx("div",{className:"bbn-input-suffix",children:i})]}));qi.displayName="Input";function $r({children:r,label:s,hint:i,state:o="default",className:f}){return F.jsxs("div",{className:Q.twJoin("bbn-form-control",f),children:[s?F.jsxs("label",{className:"bbn-form-control-label",children:[F.jsx("div",{className:"bbn-form-control-title",children:s}),r]}):r,i&&F.jsx("div",{className:Q.twJoin("bbn-form-control-hint",`bbn-form-control-hint-${o}`),children:i})]})}const Xf=L.createContext({removeDialog:()=>null,updateDialog:()=>null});function Wy({children:r}){const[s,i]=L.useState({}),o=L.useMemo(()=>Object.values(s).some(p=>p),[s]);L.useEffect(function(){if(o){const y=document.body.offsetWidth;document.body.style.overflow="hidden",document.body.style.paddingRight=document.body.offsetWidth-y>=1?vu(document.body.offsetWidth-y)??"":document.body.style.paddingRight}else document.body.style.overflow="",document.body.style.paddingRight=""},[o]);const f=L.useCallback(p=>{i(y=>Reflect.deleteProperty(y,p)?{...y}:y)},[]),c=L.useCallback((p,y)=>{i(O=>({...O,[p]:y}))},[]),v=L.useMemo(()=>({removeDialog:f,updateDialog:c}),[f,c]);return F.jsx(Xf.Provider,{value:v,children:r})}function Qf({open:r=!1}={}){const s=L.useId(),[i,o]=L.useState(r),{updateDialog:f,removeDialog:c}=L.useContext(Xf),v=r||i;L.useEffect(()=>()=>{c(s)},[s]),L.useEffect(()=>{f(s,v)},[s,v,f]),L.useEffect(()=>{r&&o(!0)},[r]);const p=L.useCallback(()=>{r||o(!1)},[r]);return{mounted:i,unmount:p}}const el=({open:r=!1,...s})=>F.jsx("div",{...s,className:Q.twJoin("bbn-backdrop",r?"animate-backdrop-in":"animate-backdrop-out",s.className)}),Vy=({children:r,open:s=!1,className:i,onClose:o,hasBackdrop:f=!0,backdropClassName:c,dialogClassName:v,...p})=>{const{mounted:y,unmount:O}=Qf({open:s});return F.jsxs(ji,{mounted:y,children:[F.jsx("div",{...p,className:Q.twJoin("bbn-dialog-wrapper",i),children:F.jsx("div",{className:Q.twJoin("bbn-dialog",s?"animate-modal-in":"animate-modal-out",v),onAnimationEnd:O,children:r})}),f&&F.jsx(el,{className:c,open:s,onClick:o})]})},Uy=({children:r,open:s=!1,className:i,onClose:o,...f})=>{const{mounted:c,unmount:v}=Qf({open:s});return F.jsxs(ji,{mounted:c,children:[F.jsx("div",{...f,className:Q.twJoin("bbn-dialog-mobile",s?"animate-mobile-modal-in":"animate-mobile-modal-out",i),onAnimationEnd:v,children:r}),F.jsx(el,{open:s,onClick:o})]})},$y=({className:r,children:s,title:i,onClose:o})=>F.jsxs("div",{className:Q.twJoin("bbn-dialog-header",r),children:[F.jsxs("div",{className:"bbn-dialog-title",children:[F.jsx(gu,{variant:"h5",children:i}),!!o&&F.jsx(pu,{className:"shrink-0",onClick:o,children:F.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:F.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"})})})]}),s]}),Hy=r=>F.jsx("div",{...r,className:Q.twJoin("bbn-dialog-body",r.className)}),ky=r=>F.jsx("div",{...r,className:Q.twJoin("bbn-dialog-footer",r.className)});function jy({className:r,...s}){return F.jsx("span",{...s,className:Q.twJoin("bbn-chip",r)})}function qy({size:r=40,className:s}){return F.jsx("span",{className:Q.twMerge("bbn-loader text-current",s),style:{width:r,height:r},children:F.jsx("svg",{viewBox:"22 22 44 44",children:F.jsx("circle",{cx:"44",cy:"44",r:"20.2",fill:"none",stroke:"currentColor",strokeWidth:"3.6"})})})}var Wi={exports:{}};Wi.exports;(function(r,s){(function(){var i,o="4.17.21",f=200,c="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",v="Expected a function",p="Invalid `variable` option passed into `_.template`",y="__lodash_hash_undefined__",O=500,w="__lodash_placeholder__",C=1,M=2,B=4,U=1,Y=2,V=1,G=2,k=4,z=8,j=16,H=32,X=64,J=128,ae=256,ve=512,fe=30,he="...",ee=800,ne=16,be=1,Ee=2,Oe=3,ye=1/0,We=9007199254740991,Xe=17976931348623157e292,Qe=NaN,ke=4294967295,$t=ke-1,fn=ke>>>1,Nt=[["ary",J],["bind",V],["bindKey",G],["curry",z],["curryRight",j],["flip",ve],["partial",H],["partialRight",X],["rearg",ae]],je="[object Arguments]",it="[object Array]",Zt="[object AsyncFunction]",qe="[object Boolean]",xt="[object Date]",fr="[object DOMException]",Pt="[object Error]",ln="[object Function]",cn="[object GeneratorFunction]",Ze="[object Map]",dn="[object Number]",lr="[object Null]",ht="[object Object]",g="[object Promise]",x="[object Proxy]",S="[object RegExp]",N="[object Set]",P="[object String]",I="[object Symbol]",K="[object Undefined]",se="[object WeakMap]",Fe="[object WeakSet]",Se="[object ArrayBuffer]",Je="[object DataView]",cr="[object Float32Array]",On="[object Float64Array]",Sn="[object Int8Array]",dr="[object Int16Array]",Un="[object Int32Array]",hr="[object Uint8Array]",$n="[object Uint8ClampedArray]",zi="[object Uint16Array]",Gi="[object Uint32Array]",xl=/\b__p \+= '';/g,Al=/\b(__p \+=) '' \+/g,Ol=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Du=/&(?:amp|lt|gt|quot|#39);/g,Iu=/[&<>"']/g,Sl=RegExp(Du.source),Cl=RegExp(Iu.source),El=/<%-([\s\S]+?)%>/g,Rl=/<%([\s\S]+?)%>/g,Nu=/<%=([\s\S]+?)%>/g,Ll=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Tl=/^\w*$/,Fl=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Zi=/[\\^$.*+?()[\]{}|]/g,Dl=RegExp(Zi.source),Yi=/^\s+/,Il=/\s/,Nl=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Pl=/\{\n\/\* \[wrapped with (.+)\] \*/,Bl=/,? & /,Ml=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Wl=/[()=,{}\[\]\/\s]/,Vl=/\\(\\)?/g,Ul=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Pu=/\w*$/,$l=/^[-+]0x[0-9a-f]+$/i,Hl=/^0b[01]+$/i,kl=/^\[object .+?Constructor\]$/,jl=/^0o[0-7]+$/i,ql=/^(?:0|[1-9]\d*)$/,Jl=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,kr=/($^)/,zl=/['\n\r\u2028\u2029\\]/g,jr="\\ud800-\\udfff",Gl="\\u0300-\\u036f",Zl="\\ufe20-\\ufe2f",Yl="\\u20d0-\\u20ff",Bu=Gl+Zl+Yl,Mu="\\u2700-\\u27bf",Wu="a-z\\xdf-\\xf6\\xf8-\\xff",Kl="\\xac\\xb1\\xd7\\xf7",Xl="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Ql="\\u2000-\\u206f",ec=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Vu="A-Z\\xc0-\\xd6\\xd8-\\xde",Uu="\\ufe0e\\ufe0f",$u=Kl+Xl+Ql+ec,Ki="['’]",tc="["+jr+"]",Hu="["+$u+"]",qr="["+Bu+"]",ku="\\d+",nc="["+Mu+"]",ju="["+Wu+"]",qu="[^"+jr+$u+ku+Mu+Wu+Vu+"]",Xi="\\ud83c[\\udffb-\\udfff]",rc="(?:"+qr+"|"+Xi+")",Ju="[^"+jr+"]",Qi="(?:\\ud83c[\\udde6-\\uddff]){2}",es="[\\ud800-\\udbff][\\udc00-\\udfff]",Hn="["+Vu+"]",zu="\\u200d",Gu="(?:"+ju+"|"+qu+")",ic="(?:"+Hn+"|"+qu+")",Zu="(?:"+Ki+"(?:d|ll|m|re|s|t|ve))?",Yu="(?:"+Ki+"(?:D|LL|M|RE|S|T|VE))?",Ku=rc+"?",Xu="["+Uu+"]?",sc="(?:"+zu+"(?:"+[Ju,Qi,es].join("|")+")"+Xu+Ku+")*",uc="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",oc="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Qu=Xu+Ku+sc,ac="(?:"+[nc,Qi,es].join("|")+")"+Qu,fc="(?:"+[Ju+qr+"?",qr,Qi,es,tc].join("|")+")",lc=RegExp(Ki,"g"),cc=RegExp(qr,"g"),ts=RegExp(Xi+"(?="+Xi+")|"+fc+Qu,"g"),dc=RegExp([Hn+"?"+ju+"+"+Zu+"(?="+[Hu,Hn,"$"].join("|")+")",ic+"+"+Yu+"(?="+[Hu,Hn+Gu,"$"].join("|")+")",Hn+"?"+Gu+"+"+Zu,Hn+"+"+Yu,oc,uc,ku,ac].join("|"),"g"),hc=RegExp("["+zu+jr+Bu+Uu+"]"),pc=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,vc=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],gc=-1,Le={};Le[cr]=Le[On]=Le[Sn]=Le[dr]=Le[Un]=Le[hr]=Le[$n]=Le[zi]=Le[Gi]=!0,Le[je]=Le[it]=Le[Se]=Le[qe]=Le[Je]=Le[xt]=Le[Pt]=Le[ln]=Le[Ze]=Le[dn]=Le[ht]=Le[S]=Le[N]=Le[P]=Le[se]=!1;var Re={};Re[je]=Re[it]=Re[Se]=Re[Je]=Re[qe]=Re[xt]=Re[cr]=Re[On]=Re[Sn]=Re[dr]=Re[Un]=Re[Ze]=Re[dn]=Re[ht]=Re[S]=Re[N]=Re[P]=Re[I]=Re[hr]=Re[$n]=Re[zi]=Re[Gi]=!0,Re[Pt]=Re[ln]=Re[se]=!1;var _c={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},yc={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},mc={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},bc={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},wc=parseFloat,xc=parseInt,eo=typeof Tr=="object"&&Tr&&Tr.Object===Object&&Tr,Ac=typeof self=="object"&&self&&self.Object===Object&&self,ze=eo||Ac||Function("return this")(),ns=s&&!s.nodeType&&s,Cn=ns&&!0&&r&&!r.nodeType&&r,to=Cn&&Cn.exports===ns,rs=to&&eo.process,At=function(){try{var m=Cn&&Cn.require&&Cn.require("util").types;return m||rs&&rs.binding&&rs.binding("util")}catch{}}(),no=At&&At.isArrayBuffer,ro=At&&At.isDate,io=At&&At.isMap,so=At&&At.isRegExp,uo=At&&At.isSet,oo=At&&At.isTypedArray;function pt(m,E,A){switch(A.length){case 0:return m.call(E);case 1:return m.call(E,A[0]);case 2:return m.call(E,A[0],A[1]);case 3:return m.call(E,A[0],A[1],A[2])}return m.apply(E,A)}function Oc(m,E,A,q){for(var ue=-1,me=m==null?0:m.length;++ue<me;){var Ve=m[ue];E(q,Ve,A(Ve),m)}return q}function Ot(m,E){for(var A=-1,q=m==null?0:m.length;++A<q&&E(m[A],A,m)!==!1;);return m}function Sc(m,E){for(var A=m==null?0:m.length;A--&&E(m[A],A,m)!==!1;);return m}function ao(m,E){for(var A=-1,q=m==null?0:m.length;++A<q;)if(!E(m[A],A,m))return!1;return!0}function hn(m,E){for(var A=-1,q=m==null?0:m.length,ue=0,me=[];++A<q;){var Ve=m[A];E(Ve,A,m)&&(me[ue++]=Ve)}return me}function Jr(m,E){var A=m==null?0:m.length;return!!A&&kn(m,E,0)>-1}function is(m,E,A){for(var q=-1,ue=m==null?0:m.length;++q<ue;)if(A(E,m[q]))return!0;return!1}function Te(m,E){for(var A=-1,q=m==null?0:m.length,ue=Array(q);++A<q;)ue[A]=E(m[A],A,m);return ue}function pn(m,E){for(var A=-1,q=E.length,ue=m.length;++A<q;)m[ue+A]=E[A];return m}function ss(m,E,A,q){var ue=-1,me=m==null?0:m.length;for(q&&me&&(A=m[++ue]);++ue<me;)A=E(A,m[ue],ue,m);return A}function Cc(m,E,A,q){var ue=m==null?0:m.length;for(q&&ue&&(A=m[--ue]);ue--;)A=E(A,m[ue],ue,m);return A}function us(m,E){for(var A=-1,q=m==null?0:m.length;++A<q;)if(E(m[A],A,m))return!0;return!1}var Ec=os("length");function Rc(m){return m.split("")}function Lc(m){return m.match(Ml)||[]}function fo(m,E,A){var q;return A(m,function(ue,me,Ve){if(E(ue,me,Ve))return q=me,!1}),q}function zr(m,E,A,q){for(var ue=m.length,me=A+(q?1:-1);q?me--:++me<ue;)if(E(m[me],me,m))return me;return-1}function kn(m,E,A){return E===E?$c(m,E,A):zr(m,lo,A)}function Tc(m,E,A,q){for(var ue=A-1,me=m.length;++ue<me;)if(q(m[ue],E))return ue;return-1}function lo(m){return m!==m}function co(m,E){var A=m==null?0:m.length;return A?fs(m,E)/A:Qe}function os(m){return function(E){return E==null?i:E[m]}}function as(m){return function(E){return m==null?i:m[E]}}function ho(m,E,A,q,ue){return ue(m,function(me,Ve,Ce){A=q?(q=!1,me):E(A,me,Ve,Ce)}),A}function Fc(m,E){var A=m.length;for(m.sort(E);A--;)m[A]=m[A].value;return m}function fs(m,E){for(var A,q=-1,ue=m.length;++q<ue;){var me=E(m[q]);me!==i&&(A=A===i?me:A+me)}return A}function ls(m,E){for(var A=-1,q=Array(m);++A<m;)q[A]=E(A);return q}function Dc(m,E){return Te(E,function(A){return[A,m[A]]})}function po(m){return m&&m.slice(0,yo(m)+1).replace(Yi,"")}function vt(m){return function(E){return m(E)}}function cs(m,E){return Te(E,function(A){return m[A]})}function pr(m,E){return m.has(E)}function vo(m,E){for(var A=-1,q=m.length;++A<q&&kn(E,m[A],0)>-1;);return A}function go(m,E){for(var A=m.length;A--&&kn(E,m[A],0)>-1;);return A}function Ic(m,E){for(var A=m.length,q=0;A--;)m[A]===E&&++q;return q}var Nc=as(_c),Pc=as(yc);function Bc(m){return"\\"+bc[m]}function Mc(m,E){return m==null?i:m[E]}function jn(m){return hc.test(m)}function Wc(m){return pc.test(m)}function Vc(m){for(var E,A=[];!(E=m.next()).done;)A.push(E.value);return A}function ds(m){var E=-1,A=Array(m.size);return m.forEach(function(q,ue){A[++E]=[ue,q]}),A}function _o(m,E){return function(A){return m(E(A))}}function vn(m,E){for(var A=-1,q=m.length,ue=0,me=[];++A<q;){var Ve=m[A];(Ve===E||Ve===w)&&(m[A]=w,me[ue++]=A)}return me}function Gr(m){var E=-1,A=Array(m.size);return m.forEach(function(q){A[++E]=q}),A}function Uc(m){var E=-1,A=Array(m.size);return m.forEach(function(q){A[++E]=[q,q]}),A}function $c(m,E,A){for(var q=A-1,ue=m.length;++q<ue;)if(m[q]===E)return q;return-1}function Hc(m,E,A){for(var q=A+1;q--;)if(m[q]===E)return q;return q}function qn(m){return jn(m)?jc(m):Ec(m)}function Bt(m){return jn(m)?qc(m):Rc(m)}function yo(m){for(var E=m.length;E--&&Il.test(m.charAt(E)););return E}var kc=as(mc);function jc(m){for(var E=ts.lastIndex=0;ts.test(m);)++E;return E}function qc(m){return m.match(ts)||[]}function Jc(m){return m.match(dc)||[]}var zc=function m(E){E=E==null?ze:Jn.defaults(ze.Object(),E,Jn.pick(ze,vc));var A=E.Array,q=E.Date,ue=E.Error,me=E.Function,Ve=E.Math,Ce=E.Object,hs=E.RegExp,Gc=E.String,St=E.TypeError,Zr=A.prototype,Zc=me.prototype,zn=Ce.prototype,Yr=E["__core-js_shared__"],Kr=Zc.toString,Ae=zn.hasOwnProperty,Yc=0,mo=function(){var e=/[^.]+$/.exec(Yr&&Yr.keys&&Yr.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Xr=zn.toString,Kc=Kr.call(Ce),Xc=ze._,Qc=hs("^"+Kr.call(Ae).replace(Zi,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Qr=to?E.Buffer:i,gn=E.Symbol,ei=E.Uint8Array,bo=Qr?Qr.allocUnsafe:i,ti=_o(Ce.getPrototypeOf,Ce),wo=Ce.create,xo=zn.propertyIsEnumerable,ni=Zr.splice,Ao=gn?gn.isConcatSpreadable:i,vr=gn?gn.iterator:i,En=gn?gn.toStringTag:i,ri=function(){try{var e=Dn(Ce,"defineProperty");return e({},"",{}),e}catch{}}(),ed=E.clearTimeout!==ze.clearTimeout&&E.clearTimeout,td=q&&q.now!==ze.Date.now&&q.now,nd=E.setTimeout!==ze.setTimeout&&E.setTimeout,ii=Ve.ceil,si=Ve.floor,ps=Ce.getOwnPropertySymbols,rd=Qr?Qr.isBuffer:i,Oo=E.isFinite,id=Zr.join,sd=_o(Ce.keys,Ce),Ue=Ve.max,Ye=Ve.min,ud=q.now,od=E.parseInt,So=Ve.random,ad=Zr.reverse,vs=Dn(E,"DataView"),gr=Dn(E,"Map"),gs=Dn(E,"Promise"),Gn=Dn(E,"Set"),_r=Dn(E,"WeakMap"),yr=Dn(Ce,"create"),ui=_r&&new _r,Zn={},fd=In(vs),ld=In(gr),cd=In(gs),dd=In(Gn),hd=In(_r),oi=gn?gn.prototype:i,mr=oi?oi.valueOf:i,Co=oi?oi.toString:i;function l(e){if(Ne(e)&&!oe(e)&&!(e instanceof ge)){if(e instanceof Ct)return e;if(Ae.call(e,"__wrapped__"))return Ea(e)}return new Ct(e)}var Yn=function(){function e(){}return function(t){if(!De(t))return{};if(wo)return wo(t);e.prototype=t;var n=new e;return e.prototype=i,n}}();function ai(){}function Ct(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}l.templateSettings={escape:El,evaluate:Rl,interpolate:Nu,variable:"",imports:{_:l}},l.prototype=ai.prototype,l.prototype.constructor=l,Ct.prototype=Yn(ai.prototype),Ct.prototype.constructor=Ct;function ge(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ke,this.__views__=[]}function pd(){var e=new ge(this.__wrapped__);return e.__actions__=st(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=st(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=st(this.__views__),e}function vd(){if(this.__filtered__){var e=new ge(this);e.__dir__=-1,e.__filtered__=!0}else e=this.clone(),e.__dir__*=-1;return e}function gd(){var e=this.__wrapped__.value(),t=this.__dir__,n=oe(e),u=t<0,a=n?e.length:0,d=Rh(0,a,this.__views__),h=d.start,_=d.end,b=_-h,R=u?_:h-1,T=this.__iteratees__,D=T.length,$=0,Z=Ye(b,this.__takeCount__);if(!n||!u&&a==b&&Z==b)return Yo(e,this.__actions__);var re=[];e:for(;b--&&$<Z;){R+=t;for(var ce=-1,ie=e[R];++ce<D;){var pe=T[ce],_e=pe.iteratee,yt=pe.type,nt=_e(ie);if(yt==Ee)ie=nt;else if(!nt){if(yt==be)continue e;break e}}re[$++]=ie}return re}ge.prototype=Yn(ai.prototype),ge.prototype.constructor=ge;function Rn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var u=e[t];this.set(u[0],u[1])}}function _d(){this.__data__=yr?yr(null):{},this.size=0}function yd(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}function md(e){var t=this.__data__;if(yr){var n=t[e];return n===y?i:n}return Ae.call(t,e)?t[e]:i}function bd(e){var t=this.__data__;return yr?t[e]!==i:Ae.call(t,e)}function wd(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=yr&&t===i?y:t,this}Rn.prototype.clear=_d,Rn.prototype.delete=yd,Rn.prototype.get=md,Rn.prototype.has=bd,Rn.prototype.set=wd;function Yt(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var u=e[t];this.set(u[0],u[1])}}function xd(){this.__data__=[],this.size=0}function Ad(e){var t=this.__data__,n=fi(t,e);if(n<0)return!1;var u=t.length-1;return n==u?t.pop():ni.call(t,n,1),--this.size,!0}function Od(e){var t=this.__data__,n=fi(t,e);return n<0?i:t[n][1]}function Sd(e){return fi(this.__data__,e)>-1}function Cd(e,t){var n=this.__data__,u=fi(n,e);return u<0?(++this.size,n.push([e,t])):n[u][1]=t,this}Yt.prototype.clear=xd,Yt.prototype.delete=Ad,Yt.prototype.get=Od,Yt.prototype.has=Sd,Yt.prototype.set=Cd;function Kt(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var u=e[t];this.set(u[0],u[1])}}function Ed(){this.size=0,this.__data__={hash:new Rn,map:new(gr||Yt),string:new Rn}}function Rd(e){var t=wi(this,e).delete(e);return this.size-=t?1:0,t}function Ld(e){return wi(this,e).get(e)}function Td(e){return wi(this,e).has(e)}function Fd(e,t){var n=wi(this,e),u=n.size;return n.set(e,t),this.size+=n.size==u?0:1,this}Kt.prototype.clear=Ed,Kt.prototype.delete=Rd,Kt.prototype.get=Ld,Kt.prototype.has=Td,Kt.prototype.set=Fd;function Ln(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new Kt;++t<n;)this.add(e[t])}function Dd(e){return this.__data__.set(e,y),this}function Id(e){return this.__data__.has(e)}Ln.prototype.add=Ln.prototype.push=Dd,Ln.prototype.has=Id;function Mt(e){var t=this.__data__=new Yt(e);this.size=t.size}function Nd(){this.__data__=new Yt,this.size=0}function Pd(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function Bd(e){return this.__data__.get(e)}function Md(e){return this.__data__.has(e)}function Wd(e,t){var n=this.__data__;if(n instanceof Yt){var u=n.__data__;if(!gr||u.length<f-1)return u.push([e,t]),this.size=++n.size,this;n=this.__data__=new Kt(u)}return n.set(e,t),this.size=n.size,this}Mt.prototype.clear=Nd,Mt.prototype.delete=Pd,Mt.prototype.get=Bd,Mt.prototype.has=Md,Mt.prototype.set=Wd;function Eo(e,t){var n=oe(e),u=!n&&Nn(e),a=!n&&!u&&wn(e),d=!n&&!u&&!a&&er(e),h=n||u||a||d,_=h?ls(e.length,Gc):[],b=_.length;for(var R in e)(t||Ae.call(e,R))&&!(h&&(R=="length"||a&&(R=="offset"||R=="parent")||d&&(R=="buffer"||R=="byteLength"||R=="byteOffset")||tn(R,b)))&&_.push(R);return _}function Ro(e){var t=e.length;return t?e[Es(0,t-1)]:i}function Vd(e,t){return xi(st(e),Tn(t,0,e.length))}function Ud(e){return xi(st(e))}function _s(e,t,n){(n!==i&&!Wt(e[t],n)||n===i&&!(t in e))&&Xt(e,t,n)}function br(e,t,n){var u=e[t];(!(Ae.call(e,t)&&Wt(u,n))||n===i&&!(t in e))&&Xt(e,t,n)}function fi(e,t){for(var n=e.length;n--;)if(Wt(e[n][0],t))return n;return-1}function $d(e,t,n,u){return _n(e,function(a,d,h){t(u,a,n(a),h)}),u}function Lo(e,t){return e&&kt(t,He(t),e)}function Hd(e,t){return e&&kt(t,ot(t),e)}function Xt(e,t,n){t=="__proto__"&&ri?ri(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function ys(e,t){for(var n=-1,u=t.length,a=A(u),d=e==null;++n<u;)a[n]=d?i:Xs(e,t[n]);return a}function Tn(e,t,n){return e===e&&(n!==i&&(e=e<=n?e:n),t!==i&&(e=e>=t?e:t)),e}function Et(e,t,n,u,a,d){var h,_=t&C,b=t&M,R=t&B;if(n&&(h=a?n(e,u,a,d):n(e)),h!==i)return h;if(!De(e))return e;var T=oe(e);if(T){if(h=Th(e),!_)return st(e,h)}else{var D=Ke(e),$=D==ln||D==cn;if(wn(e))return Qo(e,_);if(D==ht||D==je||$&&!a){if(h=b||$?{}:ya(e),!_)return b?mh(e,Hd(h,e)):yh(e,Lo(h,e))}else{if(!Re[D])return a?e:{};h=Fh(e,D,_)}}d||(d=new Mt);var Z=d.get(e);if(Z)return Z;d.set(e,h),za(e)?e.forEach(function(ie){h.add(Et(ie,t,n,ie,e,d))}):qa(e)&&e.forEach(function(ie,pe){h.set(pe,Et(ie,t,n,pe,e,d))});var re=R?b?Ws:Ms:b?ot:He,ce=T?i:re(e);return Ot(ce||e,function(ie,pe){ce&&(pe=ie,ie=e[pe]),br(h,pe,Et(ie,t,n,pe,e,d))}),h}function kd(e){var t=He(e);return function(n){return To(n,e,t)}}function To(e,t,n){var u=n.length;if(e==null)return!u;for(e=Ce(e);u--;){var a=n[u],d=t[a],h=e[a];if(h===i&&!(a in e)||!d(h))return!1}return!0}function Fo(e,t,n){if(typeof e!="function")throw new St(v);return Er(function(){e.apply(i,n)},t)}function wr(e,t,n,u){var a=-1,d=Jr,h=!0,_=e.length,b=[],R=t.length;if(!_)return b;n&&(t=Te(t,vt(n))),u?(d=is,h=!1):t.length>=f&&(d=pr,h=!1,t=new Ln(t));e:for(;++a<_;){var T=e[a],D=n==null?T:n(T);if(T=u||T!==0?T:0,h&&D===D){for(var $=R;$--;)if(t[$]===D)continue e;b.push(T)}else d(t,D,u)||b.push(T)}return b}var _n=ia(Ht),Do=ia(bs,!0);function jd(e,t){var n=!0;return _n(e,function(u,a,d){return n=!!t(u,a,d),n}),n}function li(e,t,n){for(var u=-1,a=e.length;++u<a;){var d=e[u],h=t(d);if(h!=null&&(_===i?h===h&&!_t(h):n(h,_)))var _=h,b=d}return b}function qd(e,t,n,u){var a=e.length;for(n=le(n),n<0&&(n=-n>a?0:a+n),u=u===i||u>a?a:le(u),u<0&&(u+=a),u=n>u?0:Za(u);n<u;)e[n++]=t;return e}function Io(e,t){var n=[];return _n(e,function(u,a,d){t(u,a,d)&&n.push(u)}),n}function Ge(e,t,n,u,a){var d=-1,h=e.length;for(n||(n=Ih),a||(a=[]);++d<h;){var _=e[d];t>0&&n(_)?t>1?Ge(_,t-1,n,u,a):pn(a,_):u||(a[a.length]=_)}return a}var ms=sa(),No=sa(!0);function Ht(e,t){return e&&ms(e,t,He)}function bs(e,t){return e&&No(e,t,He)}function ci(e,t){return hn(t,function(n){return nn(e[n])})}function Fn(e,t){t=mn(t,e);for(var n=0,u=t.length;e!=null&&n<u;)e=e[jt(t[n++])];return n&&n==u?e:i}function Po(e,t,n){var u=t(e);return oe(e)?u:pn(u,n(e))}function et(e){return e==null?e===i?K:lr:En&&En in Ce(e)?Eh(e):Uh(e)}function ws(e,t){return e>t}function Jd(e,t){return e!=null&&Ae.call(e,t)}function zd(e,t){return e!=null&&t in Ce(e)}function Gd(e,t,n){return e>=Ye(t,n)&&e<Ue(t,n)}function xs(e,t,n){for(var u=n?is:Jr,a=e[0].length,d=e.length,h=d,_=A(d),b=1/0,R=[];h--;){var T=e[h];h&&t&&(T=Te(T,vt(t))),b=Ye(T.length,b),_[h]=!n&&(t||a>=120&&T.length>=120)?new Ln(h&&T):i}T=e[0];var D=-1,$=_[0];e:for(;++D<a&&R.length<b;){var Z=T[D],re=t?t(Z):Z;if(Z=n||Z!==0?Z:0,!($?pr($,re):u(R,re,n))){for(h=d;--h;){var ce=_[h];if(!(ce?pr(ce,re):u(e[h],re,n)))continue e}$&&$.push(re),R.push(Z)}}return R}function Zd(e,t,n,u){return Ht(e,function(a,d,h){t(u,n(a),d,h)}),u}function xr(e,t,n){t=mn(t,e),e=xa(e,t);var u=e==null?e:e[jt(Lt(t))];return u==null?i:pt(u,e,n)}function Bo(e){return Ne(e)&&et(e)==je}function Yd(e){return Ne(e)&&et(e)==Se}function Kd(e){return Ne(e)&&et(e)==xt}function Ar(e,t,n,u,a){return e===t?!0:e==null||t==null||!Ne(e)&&!Ne(t)?e!==e&&t!==t:Xd(e,t,n,u,Ar,a)}function Xd(e,t,n,u,a,d){var h=oe(e),_=oe(t),b=h?it:Ke(e),R=_?it:Ke(t);b=b==je?ht:b,R=R==je?ht:R;var T=b==ht,D=R==ht,$=b==R;if($&&wn(e)){if(!wn(t))return!1;h=!0,T=!1}if($&&!T)return d||(d=new Mt),h||er(e)?va(e,t,n,u,a,d):Sh(e,t,b,n,u,a,d);if(!(n&U)){var Z=T&&Ae.call(e,"__wrapped__"),re=D&&Ae.call(t,"__wrapped__");if(Z||re){var ce=Z?e.value():e,ie=re?t.value():t;return d||(d=new Mt),a(ce,ie,n,u,d)}}return $?(d||(d=new Mt),Ch(e,t,n,u,a,d)):!1}function Qd(e){return Ne(e)&&Ke(e)==Ze}function As(e,t,n,u){var a=n.length,d=a,h=!u;if(e==null)return!d;for(e=Ce(e);a--;){var _=n[a];if(h&&_[2]?_[1]!==e[_[0]]:!(_[0]in e))return!1}for(;++a<d;){_=n[a];var b=_[0],R=e[b],T=_[1];if(h&&_[2]){if(R===i&&!(b in e))return!1}else{var D=new Mt;if(u)var $=u(R,T,b,e,t,D);if(!($===i?Ar(T,R,U|Y,u,D):$))return!1}}return!0}function Mo(e){if(!De(e)||Ph(e))return!1;var t=nn(e)?Qc:kl;return t.test(In(e))}function eh(e){return Ne(e)&&et(e)==S}function th(e){return Ne(e)&&Ke(e)==N}function nh(e){return Ne(e)&&Ri(e.length)&&!!Le[et(e)]}function Wo(e){return typeof e=="function"?e:e==null?at:typeof e=="object"?oe(e)?$o(e[0],e[1]):Uo(e):of(e)}function Os(e){if(!Cr(e))return sd(e);var t=[];for(var n in Ce(e))Ae.call(e,n)&&n!="constructor"&&t.push(n);return t}function rh(e){if(!De(e))return Vh(e);var t=Cr(e),n=[];for(var u in e)u=="constructor"&&(t||!Ae.call(e,u))||n.push(u);return n}function Ss(e,t){return e<t}function Vo(e,t){var n=-1,u=ut(e)?A(e.length):[];return _n(e,function(a,d,h){u[++n]=t(a,d,h)}),u}function Uo(e){var t=Us(e);return t.length==1&&t[0][2]?ba(t[0][0],t[0][1]):function(n){return n===e||As(n,e,t)}}function $o(e,t){return Hs(e)&&ma(t)?ba(jt(e),t):function(n){var u=Xs(n,e);return u===i&&u===t?Qs(n,e):Ar(t,u,U|Y)}}function di(e,t,n,u,a){e!==t&&ms(t,function(d,h){if(a||(a=new Mt),De(d))ih(e,t,h,n,di,u,a);else{var _=u?u(js(e,h),d,h+"",e,t,a):i;_===i&&(_=d),_s(e,h,_)}},ot)}function ih(e,t,n,u,a,d,h){var _=js(e,n),b=js(t,n),R=h.get(b);if(R){_s(e,n,R);return}var T=d?d(_,b,n+"",e,t,h):i,D=T===i;if(D){var $=oe(b),Z=!$&&wn(b),re=!$&&!Z&&er(b);T=b,$||Z||re?oe(_)?T=_:Pe(_)?T=st(_):Z?(D=!1,T=Qo(b,!0)):re?(D=!1,T=ea(b,!0)):T=[]:Rr(b)||Nn(b)?(T=_,Nn(_)?T=Ya(_):(!De(_)||nn(_))&&(T=ya(b))):D=!1}D&&(h.set(b,T),a(T,b,u,d,h),h.delete(b)),_s(e,n,T)}function Ho(e,t){var n=e.length;if(n)return t+=t<0?n:0,tn(t,n)?e[t]:i}function ko(e,t,n){t.length?t=Te(t,function(d){return oe(d)?function(h){return Fn(h,d.length===1?d[0]:d)}:d}):t=[at];var u=-1;t=Te(t,vt(te()));var a=Vo(e,function(d,h,_){var b=Te(t,function(R){return R(d)});return{criteria:b,index:++u,value:d}});return Fc(a,function(d,h){return _h(d,h,n)})}function sh(e,t){return jo(e,t,function(n,u){return Qs(e,u)})}function jo(e,t,n){for(var u=-1,a=t.length,d={};++u<a;){var h=t[u],_=Fn(e,h);n(_,h)&&Or(d,mn(h,e),_)}return d}function uh(e){return function(t){return Fn(t,e)}}function Cs(e,t,n,u){var a=u?Tc:kn,d=-1,h=t.length,_=e;for(e===t&&(t=st(t)),n&&(_=Te(e,vt(n)));++d<h;)for(var b=0,R=t[d],T=n?n(R):R;(b=a(_,T,b,u))>-1;)_!==e&&ni.call(_,b,1),ni.call(e,b,1);return e}function qo(e,t){for(var n=e?t.length:0,u=n-1;n--;){var a=t[n];if(n==u||a!==d){var d=a;tn(a)?ni.call(e,a,1):Ts(e,a)}}return e}function Es(e,t){return e+si(So()*(t-e+1))}function oh(e,t,n,u){for(var a=-1,d=Ue(ii((t-e)/(n||1)),0),h=A(d);d--;)h[u?d:++a]=e,e+=n;return h}function Rs(e,t){var n="";if(!e||t<1||t>We)return n;do t%2&&(n+=e),t=si(t/2),t&&(e+=e);while(t);return n}function de(e,t){return qs(wa(e,t,at),e+"")}function ah(e){return Ro(tr(e))}function fh(e,t){var n=tr(e);return xi(n,Tn(t,0,n.length))}function Or(e,t,n,u){if(!De(e))return e;t=mn(t,e);for(var a=-1,d=t.length,h=d-1,_=e;_!=null&&++a<d;){var b=jt(t[a]),R=n;if(b==="__proto__"||b==="constructor"||b==="prototype")return e;if(a!=h){var T=_[b];R=u?u(T,b,_):i,R===i&&(R=De(T)?T:tn(t[a+1])?[]:{})}br(_,b,R),_=_[b]}return e}var Jo=ui?function(e,t){return ui.set(e,t),e}:at,lh=ri?function(e,t){return ri(e,"toString",{configurable:!0,enumerable:!1,value:tu(t),writable:!0})}:at;function ch(e){return xi(tr(e))}function Rt(e,t,n){var u=-1,a=e.length;t<0&&(t=-t>a?0:a+t),n=n>a?a:n,n<0&&(n+=a),a=t>n?0:n-t>>>0,t>>>=0;for(var d=A(a);++u<a;)d[u]=e[u+t];return d}function dh(e,t){var n;return _n(e,function(u,a,d){return n=t(u,a,d),!n}),!!n}function hi(e,t,n){var u=0,a=e==null?u:e.length;if(typeof t=="number"&&t===t&&a<=fn){for(;u<a;){var d=u+a>>>1,h=e[d];h!==null&&!_t(h)&&(n?h<=t:h<t)?u=d+1:a=d}return a}return Ls(e,t,at,n)}function Ls(e,t,n,u){var a=0,d=e==null?0:e.length;if(d===0)return 0;t=n(t);for(var h=t!==t,_=t===null,b=_t(t),R=t===i;a<d;){var T=si((a+d)/2),D=n(e[T]),$=D!==i,Z=D===null,re=D===D,ce=_t(D);if(h)var ie=u||re;else R?ie=re&&(u||$):_?ie=re&&$&&(u||!Z):b?ie=re&&$&&!Z&&(u||!ce):Z||ce?ie=!1:ie=u?D<=t:D<t;ie?a=T+1:d=T}return Ye(d,$t)}function zo(e,t){for(var n=-1,u=e.length,a=0,d=[];++n<u;){var h=e[n],_=t?t(h):h;if(!n||!Wt(_,b)){var b=_;d[a++]=h===0?0:h}}return d}function Go(e){return typeof e=="number"?e:_t(e)?Qe:+e}function gt(e){if(typeof e=="string")return e;if(oe(e))return Te(e,gt)+"";if(_t(e))return Co?Co.call(e):"";var t=e+"";return t=="0"&&1/e==-ye?"-0":t}function yn(e,t,n){var u=-1,a=Jr,d=e.length,h=!0,_=[],b=_;if(n)h=!1,a=is;else if(d>=f){var R=t?null:Ah(e);if(R)return Gr(R);h=!1,a=pr,b=new Ln}else b=t?[]:_;e:for(;++u<d;){var T=e[u],D=t?t(T):T;if(T=n||T!==0?T:0,h&&D===D){for(var $=b.length;$--;)if(b[$]===D)continue e;t&&b.push(D),_.push(T)}else a(b,D,n)||(b!==_&&b.push(D),_.push(T))}return _}function Ts(e,t){return t=mn(t,e),e=xa(e,t),e==null||delete e[jt(Lt(t))]}function Zo(e,t,n,u){return Or(e,t,n(Fn(e,t)),u)}function pi(e,t,n,u){for(var a=e.length,d=u?a:-1;(u?d--:++d<a)&&t(e[d],d,e););return n?Rt(e,u?0:d,u?d+1:a):Rt(e,u?d+1:0,u?a:d)}function Yo(e,t){var n=e;return n instanceof ge&&(n=n.value()),ss(t,function(u,a){return a.func.apply(a.thisArg,pn([u],a.args))},n)}function Fs(e,t,n){var u=e.length;if(u<2)return u?yn(e[0]):[];for(var a=-1,d=A(u);++a<u;)for(var h=e[a],_=-1;++_<u;)_!=a&&(d[a]=wr(d[a]||h,e[_],t,n));return yn(Ge(d,1),t,n)}function Ko(e,t,n){for(var u=-1,a=e.length,d=t.length,h={};++u<a;){var _=u<d?t[u]:i;n(h,e[u],_)}return h}function Ds(e){return Pe(e)?e:[]}function Is(e){return typeof e=="function"?e:at}function mn(e,t){return oe(e)?e:Hs(e,t)?[e]:Ca(we(e))}var hh=de;function bn(e,t,n){var u=e.length;return n=n===i?u:n,!t&&n>=u?e:Rt(e,t,n)}var Xo=ed||function(e){return ze.clearTimeout(e)};function Qo(e,t){if(t)return e.slice();var n=e.length,u=bo?bo(n):new e.constructor(n);return e.copy(u),u}function Ns(e){var t=new e.constructor(e.byteLength);return new ei(t).set(new ei(e)),t}function ph(e,t){var n=t?Ns(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}function vh(e){var t=new e.constructor(e.source,Pu.exec(e));return t.lastIndex=e.lastIndex,t}function gh(e){return mr?Ce(mr.call(e)):{}}function ea(e,t){var n=t?Ns(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function ta(e,t){if(e!==t){var n=e!==i,u=e===null,a=e===e,d=_t(e),h=t!==i,_=t===null,b=t===t,R=_t(t);if(!_&&!R&&!d&&e>t||d&&h&&b&&!_&&!R||u&&h&&b||!n&&b||!a)return 1;if(!u&&!d&&!R&&e<t||R&&n&&a&&!u&&!d||_&&n&&a||!h&&a||!b)return-1}return 0}function _h(e,t,n){for(var u=-1,a=e.criteria,d=t.criteria,h=a.length,_=n.length;++u<h;){var b=ta(a[u],d[u]);if(b){if(u>=_)return b;var R=n[u];return b*(R=="desc"?-1:1)}}return e.index-t.index}function na(e,t,n,u){for(var a=-1,d=e.length,h=n.length,_=-1,b=t.length,R=Ue(d-h,0),T=A(b+R),D=!u;++_<b;)T[_]=t[_];for(;++a<h;)(D||a<d)&&(T[n[a]]=e[a]);for(;R--;)T[_++]=e[a++];return T}function ra(e,t,n,u){for(var a=-1,d=e.length,h=-1,_=n.length,b=-1,R=t.length,T=Ue(d-_,0),D=A(T+R),$=!u;++a<T;)D[a]=e[a];for(var Z=a;++b<R;)D[Z+b]=t[b];for(;++h<_;)($||a<d)&&(D[Z+n[h]]=e[a++]);return D}function st(e,t){var n=-1,u=e.length;for(t||(t=A(u));++n<u;)t[n]=e[n];return t}function kt(e,t,n,u){var a=!n;n||(n={});for(var d=-1,h=t.length;++d<h;){var _=t[d],b=u?u(n[_],e[_],_,n,e):i;b===i&&(b=e[_]),a?Xt(n,_,b):br(n,_,b)}return n}function yh(e,t){return kt(e,$s(e),t)}function mh(e,t){return kt(e,ga(e),t)}function vi(e,t){return function(n,u){var a=oe(n)?Oc:$d,d=t?t():{};return a(n,e,te(u,2),d)}}function Kn(e){return de(function(t,n){var u=-1,a=n.length,d=a>1?n[a-1]:i,h=a>2?n[2]:i;for(d=e.length>3&&typeof d=="function"?(a--,d):i,h&&tt(n[0],n[1],h)&&(d=a<3?i:d,a=1),t=Ce(t);++u<a;){var _=n[u];_&&e(t,_,u,d)}return t})}function ia(e,t){return function(n,u){if(n==null)return n;if(!ut(n))return e(n,u);for(var a=n.length,d=t?a:-1,h=Ce(n);(t?d--:++d<a)&&u(h[d],d,h)!==!1;);return n}}function sa(e){return function(t,n,u){for(var a=-1,d=Ce(t),h=u(t),_=h.length;_--;){var b=h[e?_:++a];if(n(d[b],b,d)===!1)break}return t}}function bh(e,t,n){var u=t&V,a=Sr(e);function d(){var h=this&&this!==ze&&this instanceof d?a:e;return h.apply(u?n:this,arguments)}return d}function ua(e){return function(t){t=we(t);var n=jn(t)?Bt(t):i,u=n?n[0]:t.charAt(0),a=n?bn(n,1).join(""):t.slice(1);return u[e]()+a}}function Xn(e){return function(t){return ss(sf(rf(t).replace(lc,"")),e,"")}}function Sr(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=Yn(e.prototype),u=e.apply(n,t);return De(u)?u:n}}function wh(e,t,n){var u=Sr(e);function a(){for(var d=arguments.length,h=A(d),_=d,b=Qn(a);_--;)h[_]=arguments[_];var R=d<3&&h[0]!==b&&h[d-1]!==b?[]:vn(h,b);if(d-=R.length,d<n)return ca(e,t,gi,a.placeholder,i,h,R,i,i,n-d);var T=this&&this!==ze&&this instanceof a?u:e;return pt(T,this,h)}return a}function oa(e){return function(t,n,u){var a=Ce(t);if(!ut(t)){var d=te(n,3);t=He(t),n=function(_){return d(a[_],_,a)}}var h=e(t,n,u);return h>-1?a[d?t[h]:h]:i}}function aa(e){return en(function(t){var n=t.length,u=n,a=Ct.prototype.thru;for(e&&t.reverse();u--;){var d=t[u];if(typeof d!="function")throw new St(v);if(a&&!h&&bi(d)=="wrapper")var h=new Ct([],!0)}for(u=h?u:n;++u<n;){d=t[u];var _=bi(d),b=_=="wrapper"?Vs(d):i;b&&ks(b[0])&&b[1]==(J|z|H|ae)&&!b[4].length&&b[9]==1?h=h[bi(b[0])].apply(h,b[3]):h=d.length==1&&ks(d)?h[_]():h.thru(d)}return function(){var R=arguments,T=R[0];if(h&&R.length==1&&oe(T))return h.plant(T).value();for(var D=0,$=n?t[D].apply(this,R):T;++D<n;)$=t[D].call(this,$);return $}})}function gi(e,t,n,u,a,d,h,_,b,R){var T=t&J,D=t&V,$=t&G,Z=t&(z|j),re=t&ve,ce=$?i:Sr(e);function ie(){for(var pe=arguments.length,_e=A(pe),yt=pe;yt--;)_e[yt]=arguments[yt];if(Z)var nt=Qn(ie),mt=Ic(_e,nt);if(u&&(_e=na(_e,u,a,Z)),d&&(_e=ra(_e,d,h,Z)),pe-=mt,Z&&pe<R){var Be=vn(_e,nt);return ca(e,t,gi,ie.placeholder,n,_e,Be,_,b,R-pe)}var Vt=D?n:this,sn=$?Vt[e]:e;return pe=_e.length,_?_e=$h(_e,_):re&&pe>1&&_e.reverse(),T&&b<pe&&(_e.length=b),this&&this!==ze&&this instanceof ie&&(sn=ce||Sr(sn)),sn.apply(Vt,_e)}return ie}function fa(e,t){return function(n,u){return Zd(n,e,t(u),{})}}function _i(e,t){return function(n,u){var a;if(n===i&&u===i)return t;if(n!==i&&(a=n),u!==i){if(a===i)return u;typeof n=="string"||typeof u=="string"?(n=gt(n),u=gt(u)):(n=Go(n),u=Go(u)),a=e(n,u)}return a}}function Ps(e){return en(function(t){return t=Te(t,vt(te())),de(function(n){var u=this;return e(t,function(a){return pt(a,u,n)})})})}function yi(e,t){t=t===i?" ":gt(t);var n=t.length;if(n<2)return n?Rs(t,e):t;var u=Rs(t,ii(e/qn(t)));return jn(t)?bn(Bt(u),0,e).join(""):u.slice(0,e)}function xh(e,t,n,u){var a=t&V,d=Sr(e);function h(){for(var _=-1,b=arguments.length,R=-1,T=u.length,D=A(T+b),$=this&&this!==ze&&this instanceof h?d:e;++R<T;)D[R]=u[R];for(;b--;)D[R++]=arguments[++_];return pt($,a?n:this,D)}return h}function la(e){return function(t,n,u){return u&&typeof u!="number"&&tt(t,n,u)&&(n=u=i),t=rn(t),n===i?(n=t,t=0):n=rn(n),u=u===i?t<n?1:-1:rn(u),oh(t,n,u,e)}}function mi(e){return function(t,n){return typeof t=="string"&&typeof n=="string"||(t=Tt(t),n=Tt(n)),e(t,n)}}function ca(e,t,n,u,a,d,h,_,b,R){var T=t&z,D=T?h:i,$=T?i:h,Z=T?d:i,re=T?i:d;t|=T?H:X,t&=~(T?X:H),t&k||(t&=~(V|G));var ce=[e,t,a,Z,D,re,$,_,b,R],ie=n.apply(i,ce);return ks(e)&&Aa(ie,ce),ie.placeholder=u,Oa(ie,e,t)}function Bs(e){var t=Ve[e];return function(n,u){if(n=Tt(n),u=u==null?0:Ye(le(u),292),u&&Oo(n)){var a=(we(n)+"e").split("e"),d=t(a[0]+"e"+(+a[1]+u));return a=(we(d)+"e").split("e"),+(a[0]+"e"+(+a[1]-u))}return t(n)}}var Ah=Gn&&1/Gr(new Gn([,-0]))[1]==ye?function(e){return new Gn(e)}:iu;function da(e){return function(t){var n=Ke(t);return n==Ze?ds(t):n==N?Uc(t):Dc(t,e(t))}}function Qt(e,t,n,u,a,d,h,_){var b=t&G;if(!b&&typeof e!="function")throw new St(v);var R=u?u.length:0;if(R||(t&=~(H|X),u=a=i),h=h===i?h:Ue(le(h),0),_=_===i?_:le(_),R-=a?a.length:0,t&X){var T=u,D=a;u=a=i}var $=b?i:Vs(e),Z=[e,t,n,u,a,T,D,d,h,_];if($&&Wh(Z,$),e=Z[0],t=Z[1],n=Z[2],u=Z[3],a=Z[4],_=Z[9]=Z[9]===i?b?0:e.length:Ue(Z[9]-R,0),!_&&t&(z|j)&&(t&=~(z|j)),!t||t==V)var re=bh(e,t,n);else t==z||t==j?re=wh(e,t,_):(t==H||t==(V|H))&&!a.length?re=xh(e,t,n,u):re=gi.apply(i,Z);var ce=$?Jo:Aa;return Oa(ce(re,Z),e,t)}function ha(e,t,n,u){return e===i||Wt(e,zn[n])&&!Ae.call(u,n)?t:e}function pa(e,t,n,u,a,d){return De(e)&&De(t)&&(d.set(t,e),di(e,t,i,pa,d),d.delete(t)),e}function Oh(e){return Rr(e)?i:e}function va(e,t,n,u,a,d){var h=n&U,_=e.length,b=t.length;if(_!=b&&!(h&&b>_))return!1;var R=d.get(e),T=d.get(t);if(R&&T)return R==t&&T==e;var D=-1,$=!0,Z=n&Y?new Ln:i;for(d.set(e,t),d.set(t,e);++D<_;){var re=e[D],ce=t[D];if(u)var ie=h?u(ce,re,D,t,e,d):u(re,ce,D,e,t,d);if(ie!==i){if(ie)continue;$=!1;break}if(Z){if(!us(t,function(pe,_e){if(!pr(Z,_e)&&(re===pe||a(re,pe,n,u,d)))return Z.push(_e)})){$=!1;break}}else if(!(re===ce||a(re,ce,n,u,d))){$=!1;break}}return d.delete(e),d.delete(t),$}function Sh(e,t,n,u,a,d,h){switch(n){case Je:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Se:return!(e.byteLength!=t.byteLength||!d(new ei(e),new ei(t)));case qe:case xt:case dn:return Wt(+e,+t);case Pt:return e.name==t.name&&e.message==t.message;case S:case P:return e==t+"";case Ze:var _=ds;case N:var b=u&U;if(_||(_=Gr),e.size!=t.size&&!b)return!1;var R=h.get(e);if(R)return R==t;u|=Y,h.set(e,t);var T=va(_(e),_(t),u,a,d,h);return h.delete(e),T;case I:if(mr)return mr.call(e)==mr.call(t)}return!1}function Ch(e,t,n,u,a,d){var h=n&U,_=Ms(e),b=_.length,R=Ms(t),T=R.length;if(b!=T&&!h)return!1;for(var D=b;D--;){var $=_[D];if(!(h?$ in t:Ae.call(t,$)))return!1}var Z=d.get(e),re=d.get(t);if(Z&&re)return Z==t&&re==e;var ce=!0;d.set(e,t),d.set(t,e);for(var ie=h;++D<b;){$=_[D];var pe=e[$],_e=t[$];if(u)var yt=h?u(_e,pe,$,t,e,d):u(pe,_e,$,e,t,d);if(!(yt===i?pe===_e||a(pe,_e,n,u,d):yt)){ce=!1;break}ie||(ie=$=="constructor")}if(ce&&!ie){var nt=e.constructor,mt=t.constructor;nt!=mt&&"constructor"in e&&"constructor"in t&&!(typeof nt=="function"&&nt instanceof nt&&typeof mt=="function"&&mt instanceof mt)&&(ce=!1)}return d.delete(e),d.delete(t),ce}function en(e){return qs(wa(e,i,Ta),e+"")}function Ms(e){return Po(e,He,$s)}function Ws(e){return Po(e,ot,ga)}var Vs=ui?function(e){return ui.get(e)}:iu;function bi(e){for(var t=e.name+"",n=Zn[t],u=Ae.call(Zn,t)?n.length:0;u--;){var a=n[u],d=a.func;if(d==null||d==e)return a.name}return t}function Qn(e){var t=Ae.call(l,"placeholder")?l:e;return t.placeholder}function te(){var e=l.iteratee||nu;return e=e===nu?Wo:e,arguments.length?e(arguments[0],arguments[1]):e}function wi(e,t){var n=e.__data__;return Nh(t)?n[typeof t=="string"?"string":"hash"]:n.map}function Us(e){for(var t=He(e),n=t.length;n--;){var u=t[n],a=e[u];t[n]=[u,a,ma(a)]}return t}function Dn(e,t){var n=Mc(e,t);return Mo(n)?n:i}function Eh(e){var t=Ae.call(e,En),n=e[En];try{e[En]=i;var u=!0}catch{}var a=Xr.call(e);return u&&(t?e[En]=n:delete e[En]),a}var $s=ps?function(e){return e==null?[]:(e=Ce(e),hn(ps(e),function(t){return xo.call(e,t)}))}:su,ga=ps?function(e){for(var t=[];e;)pn(t,$s(e)),e=ti(e);return t}:su,Ke=et;(vs&&Ke(new vs(new ArrayBuffer(1)))!=Je||gr&&Ke(new gr)!=Ze||gs&&Ke(gs.resolve())!=g||Gn&&Ke(new Gn)!=N||_r&&Ke(new _r)!=se)&&(Ke=function(e){var t=et(e),n=t==ht?e.constructor:i,u=n?In(n):"";if(u)switch(u){case fd:return Je;case ld:return Ze;case cd:return g;case dd:return N;case hd:return se}return t});function Rh(e,t,n){for(var u=-1,a=n.length;++u<a;){var d=n[u],h=d.size;switch(d.type){case"drop":e+=h;break;case"dropRight":t-=h;break;case"take":t=Ye(t,e+h);break;case"takeRight":e=Ue(e,t-h);break}}return{start:e,end:t}}function Lh(e){var t=e.match(Pl);return t?t[1].split(Bl):[]}function _a(e,t,n){t=mn(t,e);for(var u=-1,a=t.length,d=!1;++u<a;){var h=jt(t[u]);if(!(d=e!=null&&n(e,h)))break;e=e[h]}return d||++u!=a?d:(a=e==null?0:e.length,!!a&&Ri(a)&&tn(h,a)&&(oe(e)||Nn(e)))}function Th(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&Ae.call(e,"index")&&(n.index=e.index,n.input=e.input),n}function ya(e){return typeof e.constructor=="function"&&!Cr(e)?Yn(ti(e)):{}}function Fh(e,t,n){var u=e.constructor;switch(t){case Se:return Ns(e);case qe:case xt:return new u(+e);case Je:return ph(e,n);case cr:case On:case Sn:case dr:case Un:case hr:case $n:case zi:case Gi:return ea(e,n);case Ze:return new u;case dn:case P:return new u(e);case S:return vh(e);case N:return new u;case I:return gh(e)}}function Dh(e,t){var n=t.length;if(!n)return e;var u=n-1;return t[u]=(n>1?"& ":"")+t[u],t=t.join(n>2?", ":" "),e.replace(Nl,`{
2
- /* [wrapped with `+t+`] */
3
- `)}function Ih(e){return oe(e)||Nn(e)||!!(Ao&&e&&e[Ao])}function tn(e,t){var n=typeof e;return t=t??We,!!t&&(n=="number"||n!="symbol"&&ql.test(e))&&e>-1&&e%1==0&&e<t}function tt(e,t,n){if(!De(n))return!1;var u=typeof t;return(u=="number"?ut(n)&&tn(t,n.length):u=="string"&&t in n)?Wt(n[t],e):!1}function Hs(e,t){if(oe(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||_t(e)?!0:Tl.test(e)||!Ll.test(e)||t!=null&&e in Ce(t)}function Nh(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function ks(e){var t=bi(e),n=l[t];if(typeof n!="function"||!(t in ge.prototype))return!1;if(e===n)return!0;var u=Vs(n);return!!u&&e===u[0]}function Ph(e){return!!mo&&mo in e}var Bh=Yr?nn:uu;function Cr(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||zn;return e===n}function ma(e){return e===e&&!De(e)}function ba(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==i||e in Ce(n))}}function Mh(e){var t=Ci(e,function(u){return n.size===O&&n.clear(),u}),n=t.cache;return t}function Wh(e,t){var n=e[1],u=t[1],a=n|u,d=a<(V|G|J),h=u==J&&n==z||u==J&&n==ae&&e[7].length<=t[8]||u==(J|ae)&&t[7].length<=t[8]&&n==z;if(!(d||h))return e;u&V&&(e[2]=t[2],a|=n&V?0:k);var _=t[3];if(_){var b=e[3];e[3]=b?na(b,_,t[4]):_,e[4]=b?vn(e[3],w):t[4]}return _=t[5],_&&(b=e[5],e[5]=b?ra(b,_,t[6]):_,e[6]=b?vn(e[5],w):t[6]),_=t[7],_&&(e[7]=_),u&J&&(e[8]=e[8]==null?t[8]:Ye(e[8],t[8])),e[9]==null&&(e[9]=t[9]),e[0]=t[0],e[1]=a,e}function Vh(e){var t=[];if(e!=null)for(var n in Ce(e))t.push(n);return t}function Uh(e){return Xr.call(e)}function wa(e,t,n){return t=Ue(t===i?e.length-1:t,0),function(){for(var u=arguments,a=-1,d=Ue(u.length-t,0),h=A(d);++a<d;)h[a]=u[t+a];a=-1;for(var _=A(t+1);++a<t;)_[a]=u[a];return _[t]=n(h),pt(e,this,_)}}function xa(e,t){return t.length<2?e:Fn(e,Rt(t,0,-1))}function $h(e,t){for(var n=e.length,u=Ye(t.length,n),a=st(e);u--;){var d=t[u];e[u]=tn(d,n)?a[d]:i}return e}function js(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var Aa=Sa(Jo),Er=nd||function(e,t){return ze.setTimeout(e,t)},qs=Sa(lh);function Oa(e,t,n){var u=t+"";return qs(e,Dh(u,Hh(Lh(u),n)))}function Sa(e){var t=0,n=0;return function(){var u=ud(),a=ne-(u-n);if(n=u,a>0){if(++t>=ee)return arguments[0]}else t=0;return e.apply(i,arguments)}}function xi(e,t){var n=-1,u=e.length,a=u-1;for(t=t===i?u:t;++n<t;){var d=Es(n,a),h=e[d];e[d]=e[n],e[n]=h}return e.length=t,e}var Ca=Mh(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Fl,function(n,u,a,d){t.push(a?d.replace(Vl,"$1"):u||n)}),t});function jt(e){if(typeof e=="string"||_t(e))return e;var t=e+"";return t=="0"&&1/e==-ye?"-0":t}function In(e){if(e!=null){try{return Kr.call(e)}catch{}try{return e+""}catch{}}return""}function Hh(e,t){return Ot(Nt,function(n){var u="_."+n[0];t&n[1]&&!Jr(e,u)&&e.push(u)}),e.sort()}function Ea(e){if(e instanceof ge)return e.clone();var t=new Ct(e.__wrapped__,e.__chain__);return t.__actions__=st(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}function kh(e,t,n){(n?tt(e,t,n):t===i)?t=1:t=Ue(le(t),0);var u=e==null?0:e.length;if(!u||t<1)return[];for(var a=0,d=0,h=A(ii(u/t));a<u;)h[d++]=Rt(e,a,a+=t);return h}function jh(e){for(var t=-1,n=e==null?0:e.length,u=0,a=[];++t<n;){var d=e[t];d&&(a[u++]=d)}return a}function qh(){var e=arguments.length;if(!e)return[];for(var t=A(e-1),n=arguments[0],u=e;u--;)t[u-1]=arguments[u];return pn(oe(n)?st(n):[n],Ge(t,1))}var Jh=de(function(e,t){return Pe(e)?wr(e,Ge(t,1,Pe,!0)):[]}),zh=de(function(e,t){var n=Lt(t);return Pe(n)&&(n=i),Pe(e)?wr(e,Ge(t,1,Pe,!0),te(n,2)):[]}),Gh=de(function(e,t){var n=Lt(t);return Pe(n)&&(n=i),Pe(e)?wr(e,Ge(t,1,Pe,!0),i,n):[]});function Zh(e,t,n){var u=e==null?0:e.length;return u?(t=n||t===i?1:le(t),Rt(e,t<0?0:t,u)):[]}function Yh(e,t,n){var u=e==null?0:e.length;return u?(t=n||t===i?1:le(t),t=u-t,Rt(e,0,t<0?0:t)):[]}function Kh(e,t){return e&&e.length?pi(e,te(t,3),!0,!0):[]}function Xh(e,t){return e&&e.length?pi(e,te(t,3),!0):[]}function Qh(e,t,n,u){var a=e==null?0:e.length;return a?(n&&typeof n!="number"&&tt(e,t,n)&&(n=0,u=a),qd(e,t,n,u)):[]}function Ra(e,t,n){var u=e==null?0:e.length;if(!u)return-1;var a=n==null?0:le(n);return a<0&&(a=Ue(u+a,0)),zr(e,te(t,3),a)}function La(e,t,n){var u=e==null?0:e.length;if(!u)return-1;var a=u-1;return n!==i&&(a=le(n),a=n<0?Ue(u+a,0):Ye(a,u-1)),zr(e,te(t,3),a,!0)}function Ta(e){var t=e==null?0:e.length;return t?Ge(e,1):[]}function ep(e){var t=e==null?0:e.length;return t?Ge(e,ye):[]}function tp(e,t){var n=e==null?0:e.length;return n?(t=t===i?1:le(t),Ge(e,t)):[]}function np(e){for(var t=-1,n=e==null?0:e.length,u={};++t<n;){var a=e[t];u[a[0]]=a[1]}return u}function Fa(e){return e&&e.length?e[0]:i}function rp(e,t,n){var u=e==null?0:e.length;if(!u)return-1;var a=n==null?0:le(n);return a<0&&(a=Ue(u+a,0)),kn(e,t,a)}function ip(e){var t=e==null?0:e.length;return t?Rt(e,0,-1):[]}var sp=de(function(e){var t=Te(e,Ds);return t.length&&t[0]===e[0]?xs(t):[]}),up=de(function(e){var t=Lt(e),n=Te(e,Ds);return t===Lt(n)?t=i:n.pop(),n.length&&n[0]===e[0]?xs(n,te(t,2)):[]}),op=de(function(e){var t=Lt(e),n=Te(e,Ds);return t=typeof t=="function"?t:i,t&&n.pop(),n.length&&n[0]===e[0]?xs(n,i,t):[]});function ap(e,t){return e==null?"":id.call(e,t)}function Lt(e){var t=e==null?0:e.length;return t?e[t-1]:i}function fp(e,t,n){var u=e==null?0:e.length;if(!u)return-1;var a=u;return n!==i&&(a=le(n),a=a<0?Ue(u+a,0):Ye(a,u-1)),t===t?Hc(e,t,a):zr(e,lo,a,!0)}function lp(e,t){return e&&e.length?Ho(e,le(t)):i}var cp=de(Da);function Da(e,t){return e&&e.length&&t&&t.length?Cs(e,t):e}function dp(e,t,n){return e&&e.length&&t&&t.length?Cs(e,t,te(n,2)):e}function hp(e,t,n){return e&&e.length&&t&&t.length?Cs(e,t,i,n):e}var pp=en(function(e,t){var n=e==null?0:e.length,u=ys(e,t);return qo(e,Te(t,function(a){return tn(a,n)?+a:a}).sort(ta)),u});function vp(e,t){var n=[];if(!(e&&e.length))return n;var u=-1,a=[],d=e.length;for(t=te(t,3);++u<d;){var h=e[u];t(h,u,e)&&(n.push(h),a.push(u))}return qo(e,a),n}function Js(e){return e==null?e:ad.call(e)}function gp(e,t,n){var u=e==null?0:e.length;return u?(n&&typeof n!="number"&&tt(e,t,n)?(t=0,n=u):(t=t==null?0:le(t),n=n===i?u:le(n)),Rt(e,t,n)):[]}function _p(e,t){return hi(e,t)}function yp(e,t,n){return Ls(e,t,te(n,2))}function mp(e,t){var n=e==null?0:e.length;if(n){var u=hi(e,t);if(u<n&&Wt(e[u],t))return u}return-1}function bp(e,t){return hi(e,t,!0)}function wp(e,t,n){return Ls(e,t,te(n,2),!0)}function xp(e,t){var n=e==null?0:e.length;if(n){var u=hi(e,t,!0)-1;if(Wt(e[u],t))return u}return-1}function Ap(e){return e&&e.length?zo(e):[]}function Op(e,t){return e&&e.length?zo(e,te(t,2)):[]}function Sp(e){var t=e==null?0:e.length;return t?Rt(e,1,t):[]}function Cp(e,t,n){return e&&e.length?(t=n||t===i?1:le(t),Rt(e,0,t<0?0:t)):[]}function Ep(e,t,n){var u=e==null?0:e.length;return u?(t=n||t===i?1:le(t),t=u-t,Rt(e,t<0?0:t,u)):[]}function Rp(e,t){return e&&e.length?pi(e,te(t,3),!1,!0):[]}function Lp(e,t){return e&&e.length?pi(e,te(t,3)):[]}var Tp=de(function(e){return yn(Ge(e,1,Pe,!0))}),Fp=de(function(e){var t=Lt(e);return Pe(t)&&(t=i),yn(Ge(e,1,Pe,!0),te(t,2))}),Dp=de(function(e){var t=Lt(e);return t=typeof t=="function"?t:i,yn(Ge(e,1,Pe,!0),i,t)});function Ip(e){return e&&e.length?yn(e):[]}function Np(e,t){return e&&e.length?yn(e,te(t,2)):[]}function Pp(e,t){return t=typeof t=="function"?t:i,e&&e.length?yn(e,i,t):[]}function zs(e){if(!(e&&e.length))return[];var t=0;return e=hn(e,function(n){if(Pe(n))return t=Ue(n.length,t),!0}),ls(t,function(n){return Te(e,os(n))})}function Ia(e,t){if(!(e&&e.length))return[];var n=zs(e);return t==null?n:Te(n,function(u){return pt(t,i,u)})}var Bp=de(function(e,t){return Pe(e)?wr(e,t):[]}),Mp=de(function(e){return Fs(hn(e,Pe))}),Wp=de(function(e){var t=Lt(e);return Pe(t)&&(t=i),Fs(hn(e,Pe),te(t,2))}),Vp=de(function(e){var t=Lt(e);return t=typeof t=="function"?t:i,Fs(hn(e,Pe),i,t)}),Up=de(zs);function $p(e,t){return Ko(e||[],t||[],br)}function Hp(e,t){return Ko(e||[],t||[],Or)}var kp=de(function(e){var t=e.length,n=t>1?e[t-1]:i;return n=typeof n=="function"?(e.pop(),n):i,Ia(e,n)});function Na(e){var t=l(e);return t.__chain__=!0,t}function jp(e,t){return t(e),e}function Ai(e,t){return t(e)}var qp=en(function(e){var t=e.length,n=t?e[0]:0,u=this.__wrapped__,a=function(d){return ys(d,e)};return t>1||this.__actions__.length||!(u instanceof ge)||!tn(n)?this.thru(a):(u=u.slice(n,+n+(t?1:0)),u.__actions__.push({func:Ai,args:[a],thisArg:i}),new Ct(u,this.__chain__).thru(function(d){return t&&!d.length&&d.push(i),d}))});function Jp(){return Na(this)}function zp(){return new Ct(this.value(),this.__chain__)}function Gp(){this.__values__===i&&(this.__values__=Ga(this.value()));var e=this.__index__>=this.__values__.length,t=e?i:this.__values__[this.__index__++];return{done:e,value:t}}function Zp(){return this}function Yp(e){for(var t,n=this;n instanceof ai;){var u=Ea(n);u.__index__=0,u.__values__=i,t?a.__wrapped__=u:t=u;var a=u;n=n.__wrapped__}return a.__wrapped__=e,t}function Kp(){var e=this.__wrapped__;if(e instanceof ge){var t=e;return this.__actions__.length&&(t=new ge(this)),t=t.reverse(),t.__actions__.push({func:Ai,args:[Js],thisArg:i}),new Ct(t,this.__chain__)}return this.thru(Js)}function Xp(){return Yo(this.__wrapped__,this.__actions__)}var Qp=vi(function(e,t,n){Ae.call(e,n)?++e[n]:Xt(e,n,1)});function ev(e,t,n){var u=oe(e)?ao:jd;return n&&tt(e,t,n)&&(t=i),u(e,te(t,3))}function tv(e,t){var n=oe(e)?hn:Io;return n(e,te(t,3))}var nv=oa(Ra),rv=oa(La);function iv(e,t){return Ge(Oi(e,t),1)}function sv(e,t){return Ge(Oi(e,t),ye)}function uv(e,t,n){return n=n===i?1:le(n),Ge(Oi(e,t),n)}function Pa(e,t){var n=oe(e)?Ot:_n;return n(e,te(t,3))}function Ba(e,t){var n=oe(e)?Sc:Do;return n(e,te(t,3))}var ov=vi(function(e,t,n){Ae.call(e,n)?e[n].push(t):Xt(e,n,[t])});function av(e,t,n,u){e=ut(e)?e:tr(e),n=n&&!u?le(n):0;var a=e.length;return n<0&&(n=Ue(a+n,0)),Li(e)?n<=a&&e.indexOf(t,n)>-1:!!a&&kn(e,t,n)>-1}var fv=de(function(e,t,n){var u=-1,a=typeof t=="function",d=ut(e)?A(e.length):[];return _n(e,function(h){d[++u]=a?pt(t,h,n):xr(h,t,n)}),d}),lv=vi(function(e,t,n){Xt(e,n,t)});function Oi(e,t){var n=oe(e)?Te:Vo;return n(e,te(t,3))}function cv(e,t,n,u){return e==null?[]:(oe(t)||(t=t==null?[]:[t]),n=u?i:n,oe(n)||(n=n==null?[]:[n]),ko(e,t,n))}var dv=vi(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]});function hv(e,t,n){var u=oe(e)?ss:ho,a=arguments.length<3;return u(e,te(t,4),n,a,_n)}function pv(e,t,n){var u=oe(e)?Cc:ho,a=arguments.length<3;return u(e,te(t,4),n,a,Do)}function vv(e,t){var n=oe(e)?hn:Io;return n(e,Ei(te(t,3)))}function gv(e){var t=oe(e)?Ro:ah;return t(e)}function _v(e,t,n){(n?tt(e,t,n):t===i)?t=1:t=le(t);var u=oe(e)?Vd:fh;return u(e,t)}function yv(e){var t=oe(e)?Ud:ch;return t(e)}function mv(e){if(e==null)return 0;if(ut(e))return Li(e)?qn(e):e.length;var t=Ke(e);return t==Ze||t==N?e.size:Os(e).length}function bv(e,t,n){var u=oe(e)?us:dh;return n&&tt(e,t,n)&&(t=i),u(e,te(t,3))}var wv=de(function(e,t){if(e==null)return[];var n=t.length;return n>1&&tt(e,t[0],t[1])?t=[]:n>2&&tt(t[0],t[1],t[2])&&(t=[t[0]]),ko(e,Ge(t,1),[])}),Si=td||function(){return ze.Date.now()};function xv(e,t){if(typeof t!="function")throw new St(v);return e=le(e),function(){if(--e<1)return t.apply(this,arguments)}}function Ma(e,t,n){return t=n?i:t,t=e&&t==null?e.length:t,Qt(e,J,i,i,i,i,t)}function Wa(e,t){var n;if(typeof t!="function")throw new St(v);return e=le(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=i),n}}var Gs=de(function(e,t,n){var u=V;if(n.length){var a=vn(n,Qn(Gs));u|=H}return Qt(e,u,t,n,a)}),Va=de(function(e,t,n){var u=V|G;if(n.length){var a=vn(n,Qn(Va));u|=H}return Qt(t,u,e,n,a)});function Ua(e,t,n){t=n?i:t;var u=Qt(e,z,i,i,i,i,i,t);return u.placeholder=Ua.placeholder,u}function $a(e,t,n){t=n?i:t;var u=Qt(e,j,i,i,i,i,i,t);return u.placeholder=$a.placeholder,u}function Ha(e,t,n){var u,a,d,h,_,b,R=0,T=!1,D=!1,$=!0;if(typeof e!="function")throw new St(v);t=Tt(t)||0,De(n)&&(T=!!n.leading,D="maxWait"in n,d=D?Ue(Tt(n.maxWait)||0,t):d,$="trailing"in n?!!n.trailing:$);function Z(Be){var Vt=u,sn=a;return u=a=i,R=Be,h=e.apply(sn,Vt),h}function re(Be){return R=Be,_=Er(pe,t),T?Z(Be):h}function ce(Be){var Vt=Be-b,sn=Be-R,af=t-Vt;return D?Ye(af,d-sn):af}function ie(Be){var Vt=Be-b,sn=Be-R;return b===i||Vt>=t||Vt<0||D&&sn>=d}function pe(){var Be=Si();if(ie(Be))return _e(Be);_=Er(pe,ce(Be))}function _e(Be){return _=i,$&&u?Z(Be):(u=a=i,h)}function yt(){_!==i&&Xo(_),R=0,u=b=a=_=i}function nt(){return _===i?h:_e(Si())}function mt(){var Be=Si(),Vt=ie(Be);if(u=arguments,a=this,b=Be,Vt){if(_===i)return re(b);if(D)return Xo(_),_=Er(pe,t),Z(b)}return _===i&&(_=Er(pe,t)),h}return mt.cancel=yt,mt.flush=nt,mt}var Av=de(function(e,t){return Fo(e,1,t)}),Ov=de(function(e,t,n){return Fo(e,Tt(t)||0,n)});function Sv(e){return Qt(e,ve)}function Ci(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new St(v);var n=function(){var u=arguments,a=t?t.apply(this,u):u[0],d=n.cache;if(d.has(a))return d.get(a);var h=e.apply(this,u);return n.cache=d.set(a,h)||d,h};return n.cache=new(Ci.Cache||Kt),n}Ci.Cache=Kt;function Ei(e){if(typeof e!="function")throw new St(v);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}function Cv(e){return Wa(2,e)}var Ev=hh(function(e,t){t=t.length==1&&oe(t[0])?Te(t[0],vt(te())):Te(Ge(t,1),vt(te()));var n=t.length;return de(function(u){for(var a=-1,d=Ye(u.length,n);++a<d;)u[a]=t[a].call(this,u[a]);return pt(e,this,u)})}),Zs=de(function(e,t){var n=vn(t,Qn(Zs));return Qt(e,H,i,t,n)}),ka=de(function(e,t){var n=vn(t,Qn(ka));return Qt(e,X,i,t,n)}),Rv=en(function(e,t){return Qt(e,ae,i,i,i,t)});function Lv(e,t){if(typeof e!="function")throw new St(v);return t=t===i?t:le(t),de(e,t)}function Tv(e,t){if(typeof e!="function")throw new St(v);return t=t==null?0:Ue(le(t),0),de(function(n){var u=n[t],a=bn(n,0,t);return u&&pn(a,u),pt(e,this,a)})}function Fv(e,t,n){var u=!0,a=!0;if(typeof e!="function")throw new St(v);return De(n)&&(u="leading"in n?!!n.leading:u,a="trailing"in n?!!n.trailing:a),Ha(e,t,{leading:u,maxWait:t,trailing:a})}function Dv(e){return Ma(e,1)}function Iv(e,t){return Zs(Is(t),e)}function Nv(){if(!arguments.length)return[];var e=arguments[0];return oe(e)?e:[e]}function Pv(e){return Et(e,B)}function Bv(e,t){return t=typeof t=="function"?t:i,Et(e,B,t)}function Mv(e){return Et(e,C|B)}function Wv(e,t){return t=typeof t=="function"?t:i,Et(e,C|B,t)}function Vv(e,t){return t==null||To(e,t,He(t))}function Wt(e,t){return e===t||e!==e&&t!==t}var Uv=mi(ws),$v=mi(function(e,t){return e>=t}),Nn=Bo(function(){return arguments}())?Bo:function(e){return Ne(e)&&Ae.call(e,"callee")&&!xo.call(e,"callee")},oe=A.isArray,Hv=no?vt(no):Yd;function ut(e){return e!=null&&Ri(e.length)&&!nn(e)}function Pe(e){return Ne(e)&&ut(e)}function kv(e){return e===!0||e===!1||Ne(e)&&et(e)==qe}var wn=rd||uu,jv=ro?vt(ro):Kd;function qv(e){return Ne(e)&&e.nodeType===1&&!Rr(e)}function Jv(e){if(e==null)return!0;if(ut(e)&&(oe(e)||typeof e=="string"||typeof e.splice=="function"||wn(e)||er(e)||Nn(e)))return!e.length;var t=Ke(e);if(t==Ze||t==N)return!e.size;if(Cr(e))return!Os(e).length;for(var n in e)if(Ae.call(e,n))return!1;return!0}function zv(e,t){return Ar(e,t)}function Gv(e,t,n){n=typeof n=="function"?n:i;var u=n?n(e,t):i;return u===i?Ar(e,t,i,n):!!u}function Ys(e){if(!Ne(e))return!1;var t=et(e);return t==Pt||t==fr||typeof e.message=="string"&&typeof e.name=="string"&&!Rr(e)}function Zv(e){return typeof e=="number"&&Oo(e)}function nn(e){if(!De(e))return!1;var t=et(e);return t==ln||t==cn||t==Zt||t==x}function ja(e){return typeof e=="number"&&e==le(e)}function Ri(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=We}function De(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function Ne(e){return e!=null&&typeof e=="object"}var qa=io?vt(io):Qd;function Yv(e,t){return e===t||As(e,t,Us(t))}function Kv(e,t,n){return n=typeof n=="function"?n:i,As(e,t,Us(t),n)}function Xv(e){return Ja(e)&&e!=+e}function Qv(e){if(Bh(e))throw new ue(c);return Mo(e)}function eg(e){return e===null}function tg(e){return e==null}function Ja(e){return typeof e=="number"||Ne(e)&&et(e)==dn}function Rr(e){if(!Ne(e)||et(e)!=ht)return!1;var t=ti(e);if(t===null)return!0;var n=Ae.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Kr.call(n)==Kc}var Ks=so?vt(so):eh;function ng(e){return ja(e)&&e>=-We&&e<=We}var za=uo?vt(uo):th;function Li(e){return typeof e=="string"||!oe(e)&&Ne(e)&&et(e)==P}function _t(e){return typeof e=="symbol"||Ne(e)&&et(e)==I}var er=oo?vt(oo):nh;function rg(e){return e===i}function ig(e){return Ne(e)&&Ke(e)==se}function sg(e){return Ne(e)&&et(e)==Fe}var ug=mi(Ss),og=mi(function(e,t){return e<=t});function Ga(e){if(!e)return[];if(ut(e))return Li(e)?Bt(e):st(e);if(vr&&e[vr])return Vc(e[vr]());var t=Ke(e),n=t==Ze?ds:t==N?Gr:tr;return n(e)}function rn(e){if(!e)return e===0?e:0;if(e=Tt(e),e===ye||e===-ye){var t=e<0?-1:1;return t*Xe}return e===e?e:0}function le(e){var t=rn(e),n=t%1;return t===t?n?t-n:t:0}function Za(e){return e?Tn(le(e),0,ke):0}function Tt(e){if(typeof e=="number")return e;if(_t(e))return Qe;if(De(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=De(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=po(e);var n=Hl.test(e);return n||jl.test(e)?xc(e.slice(2),n?2:8):$l.test(e)?Qe:+e}function Ya(e){return kt(e,ot(e))}function ag(e){return e?Tn(le(e),-We,We):e===0?e:0}function we(e){return e==null?"":gt(e)}var fg=Kn(function(e,t){if(Cr(t)||ut(t)){kt(t,He(t),e);return}for(var n in t)Ae.call(t,n)&&br(e,n,t[n])}),Ka=Kn(function(e,t){kt(t,ot(t),e)}),Ti=Kn(function(e,t,n,u){kt(t,ot(t),e,u)}),lg=Kn(function(e,t,n,u){kt(t,He(t),e,u)}),cg=en(ys);function dg(e,t){var n=Yn(e);return t==null?n:Lo(n,t)}var hg=de(function(e,t){e=Ce(e);var n=-1,u=t.length,a=u>2?t[2]:i;for(a&&tt(t[0],t[1],a)&&(u=1);++n<u;)for(var d=t[n],h=ot(d),_=-1,b=h.length;++_<b;){var R=h[_],T=e[R];(T===i||Wt(T,zn[R])&&!Ae.call(e,R))&&(e[R]=d[R])}return e}),pg=de(function(e){return e.push(i,pa),pt(Xa,i,e)});function vg(e,t){return fo(e,te(t,3),Ht)}function gg(e,t){return fo(e,te(t,3),bs)}function _g(e,t){return e==null?e:ms(e,te(t,3),ot)}function yg(e,t){return e==null?e:No(e,te(t,3),ot)}function mg(e,t){return e&&Ht(e,te(t,3))}function bg(e,t){return e&&bs(e,te(t,3))}function wg(e){return e==null?[]:ci(e,He(e))}function xg(e){return e==null?[]:ci(e,ot(e))}function Xs(e,t,n){var u=e==null?i:Fn(e,t);return u===i?n:u}function Ag(e,t){return e!=null&&_a(e,t,Jd)}function Qs(e,t){return e!=null&&_a(e,t,zd)}var Og=fa(function(e,t,n){t!=null&&typeof t.toString!="function"&&(t=Xr.call(t)),e[t]=n},tu(at)),Sg=fa(function(e,t,n){t!=null&&typeof t.toString!="function"&&(t=Xr.call(t)),Ae.call(e,t)?e[t].push(n):e[t]=[n]},te),Cg=de(xr);function He(e){return ut(e)?Eo(e):Os(e)}function ot(e){return ut(e)?Eo(e,!0):rh(e)}function Eg(e,t){var n={};return t=te(t,3),Ht(e,function(u,a,d){Xt(n,t(u,a,d),u)}),n}function Rg(e,t){var n={};return t=te(t,3),Ht(e,function(u,a,d){Xt(n,a,t(u,a,d))}),n}var Lg=Kn(function(e,t,n){di(e,t,n)}),Xa=Kn(function(e,t,n,u){di(e,t,n,u)}),Tg=en(function(e,t){var n={};if(e==null)return n;var u=!1;t=Te(t,function(d){return d=mn(d,e),u||(u=d.length>1),d}),kt(e,Ws(e),n),u&&(n=Et(n,C|M|B,Oh));for(var a=t.length;a--;)Ts(n,t[a]);return n});function Fg(e,t){return Qa(e,Ei(te(t)))}var Dg=en(function(e,t){return e==null?{}:sh(e,t)});function Qa(e,t){if(e==null)return{};var n=Te(Ws(e),function(u){return[u]});return t=te(t),jo(e,n,function(u,a){return t(u,a[0])})}function Ig(e,t,n){t=mn(t,e);var u=-1,a=t.length;for(a||(a=1,e=i);++u<a;){var d=e==null?i:e[jt(t[u])];d===i&&(u=a,d=n),e=nn(d)?d.call(e):d}return e}function Ng(e,t,n){return e==null?e:Or(e,t,n)}function Pg(e,t,n,u){return u=typeof u=="function"?u:i,e==null?e:Or(e,t,n,u)}var ef=da(He),tf=da(ot);function Bg(e,t,n){var u=oe(e),a=u||wn(e)||er(e);if(t=te(t,4),n==null){var d=e&&e.constructor;a?n=u?new d:[]:De(e)?n=nn(d)?Yn(ti(e)):{}:n={}}return(a?Ot:Ht)(e,function(h,_,b){return t(n,h,_,b)}),n}function Mg(e,t){return e==null?!0:Ts(e,t)}function Wg(e,t,n){return e==null?e:Zo(e,t,Is(n))}function Vg(e,t,n,u){return u=typeof u=="function"?u:i,e==null?e:Zo(e,t,Is(n),u)}function tr(e){return e==null?[]:cs(e,He(e))}function Ug(e){return e==null?[]:cs(e,ot(e))}function $g(e,t,n){return n===i&&(n=t,t=i),n!==i&&(n=Tt(n),n=n===n?n:0),t!==i&&(t=Tt(t),t=t===t?t:0),Tn(Tt(e),t,n)}function Hg(e,t,n){return t=rn(t),n===i?(n=t,t=0):n=rn(n),e=Tt(e),Gd(e,t,n)}function kg(e,t,n){if(n&&typeof n!="boolean"&&tt(e,t,n)&&(t=n=i),n===i&&(typeof t=="boolean"?(n=t,t=i):typeof e=="boolean"&&(n=e,e=i)),e===i&&t===i?(e=0,t=1):(e=rn(e),t===i?(t=e,e=0):t=rn(t)),e>t){var u=e;e=t,t=u}if(n||e%1||t%1){var a=So();return Ye(e+a*(t-e+wc("1e-"+((a+"").length-1))),t)}return Es(e,t)}var jg=Xn(function(e,t,n){return t=t.toLowerCase(),e+(n?nf(t):t)});function nf(e){return eu(we(e).toLowerCase())}function rf(e){return e=we(e),e&&e.replace(Jl,Nc).replace(cc,"")}function qg(e,t,n){e=we(e),t=gt(t);var u=e.length;n=n===i?u:Tn(le(n),0,u);var a=n;return n-=t.length,n>=0&&e.slice(n,a)==t}function Jg(e){return e=we(e),e&&Cl.test(e)?e.replace(Iu,Pc):e}function zg(e){return e=we(e),e&&Dl.test(e)?e.replace(Zi,"\\$&"):e}var Gg=Xn(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),Zg=Xn(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),Yg=ua("toLowerCase");function Kg(e,t,n){e=we(e),t=le(t);var u=t?qn(e):0;if(!t||u>=t)return e;var a=(t-u)/2;return yi(si(a),n)+e+yi(ii(a),n)}function Xg(e,t,n){e=we(e),t=le(t);var u=t?qn(e):0;return t&&u<t?e+yi(t-u,n):e}function Qg(e,t,n){e=we(e),t=le(t);var u=t?qn(e):0;return t&&u<t?yi(t-u,n)+e:e}function e0(e,t,n){return n||t==null?t=0:t&&(t=+t),od(we(e).replace(Yi,""),t||0)}function t0(e,t,n){return(n?tt(e,t,n):t===i)?t=1:t=le(t),Rs(we(e),t)}function n0(){var e=arguments,t=we(e[0]);return e.length<3?t:t.replace(e[1],e[2])}var r0=Xn(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()});function i0(e,t,n){return n&&typeof n!="number"&&tt(e,t,n)&&(t=n=i),n=n===i?ke:n>>>0,n?(e=we(e),e&&(typeof t=="string"||t!=null&&!Ks(t))&&(t=gt(t),!t&&jn(e))?bn(Bt(e),0,n):e.split(t,n)):[]}var s0=Xn(function(e,t,n){return e+(n?" ":"")+eu(t)});function u0(e,t,n){return e=we(e),n=n==null?0:Tn(le(n),0,e.length),t=gt(t),e.slice(n,n+t.length)==t}function o0(e,t,n){var u=l.templateSettings;n&&tt(e,t,n)&&(t=i),e=we(e),t=Ti({},t,u,ha);var a=Ti({},t.imports,u.imports,ha),d=He(a),h=cs(a,d),_,b,R=0,T=t.interpolate||kr,D="__p += '",$=hs((t.escape||kr).source+"|"+T.source+"|"+(T===Nu?Ul:kr).source+"|"+(t.evaluate||kr).source+"|$","g"),Z="//# sourceURL="+(Ae.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++gc+"]")+`
4
- `;e.replace($,function(ie,pe,_e,yt,nt,mt){return _e||(_e=yt),D+=e.slice(R,mt).replace(zl,Bc),pe&&(_=!0,D+=`' +
5
- __e(`+pe+`) +
6
- '`),nt&&(b=!0,D+=`';
7
- `+nt+`;
8
- __p += '`),_e&&(D+=`' +
9
- ((__t = (`+_e+`)) == null ? '' : __t) +
10
- '`),R=mt+ie.length,ie}),D+=`';
11
- `;var re=Ae.call(t,"variable")&&t.variable;if(!re)D=`with (obj) {
12
- `+D+`
13
- }
14
- `;else if(Wl.test(re))throw new ue(p);D=(b?D.replace(xl,""):D).replace(Al,"$1").replace(Ol,"$1;"),D="function("+(re||"obj")+`) {
15
- `+(re?"":`obj || (obj = {});
16
- `)+"var __t, __p = ''"+(_?", __e = _.escape":"")+(b?`, __j = Array.prototype.join;
17
- function print() { __p += __j.call(arguments, '') }
18
- `:`;
19
- `)+D+`return __p
20
- }`;var ce=uf(function(){return me(d,Z+"return "+D).apply(i,h)});if(ce.source=D,Ys(ce))throw ce;return ce}function a0(e){return we(e).toLowerCase()}function f0(e){return we(e).toUpperCase()}function l0(e,t,n){if(e=we(e),e&&(n||t===i))return po(e);if(!e||!(t=gt(t)))return e;var u=Bt(e),a=Bt(t),d=vo(u,a),h=go(u,a)+1;return bn(u,d,h).join("")}function c0(e,t,n){if(e=we(e),e&&(n||t===i))return e.slice(0,yo(e)+1);if(!e||!(t=gt(t)))return e;var u=Bt(e),a=go(u,Bt(t))+1;return bn(u,0,a).join("")}function d0(e,t,n){if(e=we(e),e&&(n||t===i))return e.replace(Yi,"");if(!e||!(t=gt(t)))return e;var u=Bt(e),a=vo(u,Bt(t));return bn(u,a).join("")}function h0(e,t){var n=fe,u=he;if(De(t)){var a="separator"in t?t.separator:a;n="length"in t?le(t.length):n,u="omission"in t?gt(t.omission):u}e=we(e);var d=e.length;if(jn(e)){var h=Bt(e);d=h.length}if(n>=d)return e;var _=n-qn(u);if(_<1)return u;var b=h?bn(h,0,_).join(""):e.slice(0,_);if(a===i)return b+u;if(h&&(_+=b.length-_),Ks(a)){if(e.slice(_).search(a)){var R,T=b;for(a.global||(a=hs(a.source,we(Pu.exec(a))+"g")),a.lastIndex=0;R=a.exec(T);)var D=R.index;b=b.slice(0,D===i?_:D)}}else if(e.indexOf(gt(a),_)!=_){var $=b.lastIndexOf(a);$>-1&&(b=b.slice(0,$))}return b+u}function p0(e){return e=we(e),e&&Sl.test(e)?e.replace(Du,kc):e}var v0=Xn(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),eu=ua("toUpperCase");function sf(e,t,n){return e=we(e),t=n?i:t,t===i?Wc(e)?Jc(e):Lc(e):e.match(t)||[]}var uf=de(function(e,t){try{return pt(e,i,t)}catch(n){return Ys(n)?n:new ue(n)}}),g0=en(function(e,t){return Ot(t,function(n){n=jt(n),Xt(e,n,Gs(e[n],e))}),e});function _0(e){var t=e==null?0:e.length,n=te();return e=t?Te(e,function(u){if(typeof u[1]!="function")throw new St(v);return[n(u[0]),u[1]]}):[],de(function(u){for(var a=-1;++a<t;){var d=e[a];if(pt(d[0],this,u))return pt(d[1],this,u)}})}function y0(e){return kd(Et(e,C))}function tu(e){return function(){return e}}function m0(e,t){return e==null||e!==e?t:e}var b0=aa(),w0=aa(!0);function at(e){return e}function nu(e){return Wo(typeof e=="function"?e:Et(e,C))}function x0(e){return Uo(Et(e,C))}function A0(e,t){return $o(e,Et(t,C))}var O0=de(function(e,t){return function(n){return xr(n,e,t)}}),S0=de(function(e,t){return function(n){return xr(e,n,t)}});function ru(e,t,n){var u=He(t),a=ci(t,u);n==null&&!(De(t)&&(a.length||!u.length))&&(n=t,t=e,e=this,a=ci(t,He(t)));var d=!(De(n)&&"chain"in n)||!!n.chain,h=nn(e);return Ot(a,function(_){var b=t[_];e[_]=b,h&&(e.prototype[_]=function(){var R=this.__chain__;if(d||R){var T=e(this.__wrapped__),D=T.__actions__=st(this.__actions__);return D.push({func:b,args:arguments,thisArg:e}),T.__chain__=R,T}return b.apply(e,pn([this.value()],arguments))})}),e}function C0(){return ze._===this&&(ze._=Xc),this}function iu(){}function E0(e){return e=le(e),de(function(t){return Ho(t,e)})}var R0=Ps(Te),L0=Ps(ao),T0=Ps(us);function of(e){return Hs(e)?os(jt(e)):uh(e)}function F0(e){return function(t){return e==null?i:Fn(e,t)}}var D0=la(),I0=la(!0);function su(){return[]}function uu(){return!1}function N0(){return{}}function P0(){return""}function B0(){return!0}function M0(e,t){if(e=le(e),e<1||e>We)return[];var n=ke,u=Ye(e,ke);t=te(t),e-=ke;for(var a=ls(u,t);++n<e;)t(n);return a}function W0(e){return oe(e)?Te(e,jt):_t(e)?[e]:st(Ca(we(e)))}function V0(e){var t=++Yc;return we(e)+t}var U0=_i(function(e,t){return e+t},0),$0=Bs("ceil"),H0=_i(function(e,t){return e/t},1),k0=Bs("floor");function j0(e){return e&&e.length?li(e,at,ws):i}function q0(e,t){return e&&e.length?li(e,te(t,2),ws):i}function J0(e){return co(e,at)}function z0(e,t){return co(e,te(t,2))}function G0(e){return e&&e.length?li(e,at,Ss):i}function Z0(e,t){return e&&e.length?li(e,te(t,2),Ss):i}var Y0=_i(function(e,t){return e*t},1),K0=Bs("round"),X0=_i(function(e,t){return e-t},0);function Q0(e){return e&&e.length?fs(e,at):0}function e_(e,t){return e&&e.length?fs(e,te(t,2)):0}return l.after=xv,l.ary=Ma,l.assign=fg,l.assignIn=Ka,l.assignInWith=Ti,l.assignWith=lg,l.at=cg,l.before=Wa,l.bind=Gs,l.bindAll=g0,l.bindKey=Va,l.castArray=Nv,l.chain=Na,l.chunk=kh,l.compact=jh,l.concat=qh,l.cond=_0,l.conforms=y0,l.constant=tu,l.countBy=Qp,l.create=dg,l.curry=Ua,l.curryRight=$a,l.debounce=Ha,l.defaults=hg,l.defaultsDeep=pg,l.defer=Av,l.delay=Ov,l.difference=Jh,l.differenceBy=zh,l.differenceWith=Gh,l.drop=Zh,l.dropRight=Yh,l.dropRightWhile=Kh,l.dropWhile=Xh,l.fill=Qh,l.filter=tv,l.flatMap=iv,l.flatMapDeep=sv,l.flatMapDepth=uv,l.flatten=Ta,l.flattenDeep=ep,l.flattenDepth=tp,l.flip=Sv,l.flow=b0,l.flowRight=w0,l.fromPairs=np,l.functions=wg,l.functionsIn=xg,l.groupBy=ov,l.initial=ip,l.intersection=sp,l.intersectionBy=up,l.intersectionWith=op,l.invert=Og,l.invertBy=Sg,l.invokeMap=fv,l.iteratee=nu,l.keyBy=lv,l.keys=He,l.keysIn=ot,l.map=Oi,l.mapKeys=Eg,l.mapValues=Rg,l.matches=x0,l.matchesProperty=A0,l.memoize=Ci,l.merge=Lg,l.mergeWith=Xa,l.method=O0,l.methodOf=S0,l.mixin=ru,l.negate=Ei,l.nthArg=E0,l.omit=Tg,l.omitBy=Fg,l.once=Cv,l.orderBy=cv,l.over=R0,l.overArgs=Ev,l.overEvery=L0,l.overSome=T0,l.partial=Zs,l.partialRight=ka,l.partition=dv,l.pick=Dg,l.pickBy=Qa,l.property=of,l.propertyOf=F0,l.pull=cp,l.pullAll=Da,l.pullAllBy=dp,l.pullAllWith=hp,l.pullAt=pp,l.range=D0,l.rangeRight=I0,l.rearg=Rv,l.reject=vv,l.remove=vp,l.rest=Lv,l.reverse=Js,l.sampleSize=_v,l.set=Ng,l.setWith=Pg,l.shuffle=yv,l.slice=gp,l.sortBy=wv,l.sortedUniq=Ap,l.sortedUniqBy=Op,l.split=i0,l.spread=Tv,l.tail=Sp,l.take=Cp,l.takeRight=Ep,l.takeRightWhile=Rp,l.takeWhile=Lp,l.tap=jp,l.throttle=Fv,l.thru=Ai,l.toArray=Ga,l.toPairs=ef,l.toPairsIn=tf,l.toPath=W0,l.toPlainObject=Ya,l.transform=Bg,l.unary=Dv,l.union=Tp,l.unionBy=Fp,l.unionWith=Dp,l.uniq=Ip,l.uniqBy=Np,l.uniqWith=Pp,l.unset=Mg,l.unzip=zs,l.unzipWith=Ia,l.update=Wg,l.updateWith=Vg,l.values=tr,l.valuesIn=Ug,l.without=Bp,l.words=sf,l.wrap=Iv,l.xor=Mp,l.xorBy=Wp,l.xorWith=Vp,l.zip=Up,l.zipObject=$p,l.zipObjectDeep=Hp,l.zipWith=kp,l.entries=ef,l.entriesIn=tf,l.extend=Ka,l.extendWith=Ti,ru(l,l),l.add=U0,l.attempt=uf,l.camelCase=jg,l.capitalize=nf,l.ceil=$0,l.clamp=$g,l.clone=Pv,l.cloneDeep=Mv,l.cloneDeepWith=Wv,l.cloneWith=Bv,l.conformsTo=Vv,l.deburr=rf,l.defaultTo=m0,l.divide=H0,l.endsWith=qg,l.eq=Wt,l.escape=Jg,l.escapeRegExp=zg,l.every=ev,l.find=nv,l.findIndex=Ra,l.findKey=vg,l.findLast=rv,l.findLastIndex=La,l.findLastKey=gg,l.floor=k0,l.forEach=Pa,l.forEachRight=Ba,l.forIn=_g,l.forInRight=yg,l.forOwn=mg,l.forOwnRight=bg,l.get=Xs,l.gt=Uv,l.gte=$v,l.has=Ag,l.hasIn=Qs,l.head=Fa,l.identity=at,l.includes=av,l.indexOf=rp,l.inRange=Hg,l.invoke=Cg,l.isArguments=Nn,l.isArray=oe,l.isArrayBuffer=Hv,l.isArrayLike=ut,l.isArrayLikeObject=Pe,l.isBoolean=kv,l.isBuffer=wn,l.isDate=jv,l.isElement=qv,l.isEmpty=Jv,l.isEqual=zv,l.isEqualWith=Gv,l.isError=Ys,l.isFinite=Zv,l.isFunction=nn,l.isInteger=ja,l.isLength=Ri,l.isMap=qa,l.isMatch=Yv,l.isMatchWith=Kv,l.isNaN=Xv,l.isNative=Qv,l.isNil=tg,l.isNull=eg,l.isNumber=Ja,l.isObject=De,l.isObjectLike=Ne,l.isPlainObject=Rr,l.isRegExp=Ks,l.isSafeInteger=ng,l.isSet=za,l.isString=Li,l.isSymbol=_t,l.isTypedArray=er,l.isUndefined=rg,l.isWeakMap=ig,l.isWeakSet=sg,l.join=ap,l.kebabCase=Gg,l.last=Lt,l.lastIndexOf=fp,l.lowerCase=Zg,l.lowerFirst=Yg,l.lt=ug,l.lte=og,l.max=j0,l.maxBy=q0,l.mean=J0,l.meanBy=z0,l.min=G0,l.minBy=Z0,l.stubArray=su,l.stubFalse=uu,l.stubObject=N0,l.stubString=P0,l.stubTrue=B0,l.multiply=Y0,l.nth=lp,l.noConflict=C0,l.noop=iu,l.now=Si,l.pad=Kg,l.padEnd=Xg,l.padStart=Qg,l.parseInt=e0,l.random=kg,l.reduce=hv,l.reduceRight=pv,l.repeat=t0,l.replace=n0,l.result=Ig,l.round=K0,l.runInContext=m,l.sample=gv,l.size=mv,l.snakeCase=r0,l.some=bv,l.sortedIndex=_p,l.sortedIndexBy=yp,l.sortedIndexOf=mp,l.sortedLastIndex=bp,l.sortedLastIndexBy=wp,l.sortedLastIndexOf=xp,l.startCase=s0,l.startsWith=u0,l.subtract=X0,l.sum=Q0,l.sumBy=e_,l.template=o0,l.times=M0,l.toFinite=rn,l.toInteger=le,l.toLength=Za,l.toLower=a0,l.toNumber=Tt,l.toSafeInteger=ag,l.toString=we,l.toUpper=f0,l.trim=l0,l.trimEnd=c0,l.trimStart=d0,l.truncate=h0,l.unescape=p0,l.uniqueId=V0,l.upperCase=v0,l.upperFirst=eu,l.each=Pa,l.eachRight=Ba,l.first=Fa,ru(l,function(){var e={};return Ht(l,function(t,n){Ae.call(l.prototype,n)||(e[n]=t)}),e}(),{chain:!1}),l.VERSION=o,Ot(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){l[e].placeholder=l}),Ot(["drop","take"],function(e,t){ge.prototype[e]=function(n){n=n===i?1:Ue(le(n),0);var u=this.__filtered__&&!t?new ge(this):this.clone();return u.__filtered__?u.__takeCount__=Ye(n,u.__takeCount__):u.__views__.push({size:Ye(n,ke),type:e+(u.__dir__<0?"Right":"")}),u},ge.prototype[e+"Right"]=function(n){return this.reverse()[e](n).reverse()}}),Ot(["filter","map","takeWhile"],function(e,t){var n=t+1,u=n==be||n==Oe;ge.prototype[e]=function(a){var d=this.clone();return d.__iteratees__.push({iteratee:te(a,3),type:n}),d.__filtered__=d.__filtered__||u,d}}),Ot(["head","last"],function(e,t){var n="take"+(t?"Right":"");ge.prototype[e]=function(){return this[n](1).value()[0]}}),Ot(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");ge.prototype[e]=function(){return this.__filtered__?new ge(this):this[n](1)}}),ge.prototype.compact=function(){return this.filter(at)},ge.prototype.find=function(e){return this.filter(e).head()},ge.prototype.findLast=function(e){return this.reverse().find(e)},ge.prototype.invokeMap=de(function(e,t){return typeof e=="function"?new ge(this):this.map(function(n){return xr(n,e,t)})}),ge.prototype.reject=function(e){return this.filter(Ei(te(e)))},ge.prototype.slice=function(e,t){e=le(e);var n=this;return n.__filtered__&&(e>0||t<0)?new ge(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==i&&(t=le(t),n=t<0?n.dropRight(-t):n.take(t-e)),n)},ge.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},ge.prototype.toArray=function(){return this.take(ke)},Ht(ge.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),u=/^(?:head|last)$/.test(t),a=l[u?"take"+(t=="last"?"Right":""):t],d=u||/^find/.test(t);a&&(l.prototype[t]=function(){var h=this.__wrapped__,_=u?[1]:arguments,b=h instanceof ge,R=_[0],T=b||oe(h),D=function(pe){var _e=a.apply(l,pn([pe],_));return u&&$?_e[0]:_e};T&&n&&typeof R=="function"&&R.length!=1&&(b=T=!1);var $=this.__chain__,Z=!!this.__actions__.length,re=d&&!$,ce=b&&!Z;if(!d&&T){h=ce?h:new ge(this);var ie=e.apply(h,_);return ie.__actions__.push({func:Ai,args:[D],thisArg:i}),new Ct(ie,$)}return re&&ce?e.apply(this,_):(ie=this.thru(D),re?u?ie.value()[0]:ie.value():ie)})}),Ot(["pop","push","shift","sort","splice","unshift"],function(e){var t=Zr[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",u=/^(?:pop|shift)$/.test(e);l.prototype[e]=function(){var a=arguments;if(u&&!this.__chain__){var d=this.value();return t.apply(oe(d)?d:[],a)}return this[n](function(h){return t.apply(oe(h)?h:[],a)})}}),Ht(ge.prototype,function(e,t){var n=l[t];if(n){var u=n.name+"";Ae.call(Zn,u)||(Zn[u]=[]),Zn[u].push({name:t,func:n})}}),Zn[gi(i,G).name]=[{name:"wrapper",func:i}],ge.prototype.clone=pd,ge.prototype.reverse=vd,ge.prototype.value=gd,l.prototype.at=qp,l.prototype.chain=Jp,l.prototype.commit=zp,l.prototype.next=Gp,l.prototype.plant=Yp,l.prototype.reverse=Kp,l.prototype.toJSON=l.prototype.valueOf=l.prototype.value=Xp,l.prototype.first=l.prototype.head,vr&&(l.prototype[vr]=Zp),l},Jn=zc();Cn?((Cn.exports=Jn)._=Jn,ns._=Jn):ze._=Jn}).call(Tr)})(Wi,Wi.exports);var Jy=Wi.exports;const zy=Yf(Jy);function Gy(r,{onLoadMore:s,hasMore:i=!1,loading:o=!1}={}){const[f,c]=L.useState(!1);return L.useEffect(()=>{const v=zy.throttle(y=>{const O=y.target;c(O.scrollTop>0),!o&&i&&O.scrollHeight-O.scrollTop<=O.clientHeight+100&&(s==null||s())},100),p=r.current;if(p)return p.addEventListener("scroll",v),()=>p.removeEventListener("scroll",v)},[o,i,s,r]),{isScrolledTop:f}}const tl=L.createContext({data:[],columns:[],sortStates:{},onColumnSort:void 0,onRowSelect:void 0});function nl({name:r,className:s,children:i,sorter:o,...f}){const{columns:c,sortStates:v,onColumnSort:p}=L.useContext(tl),y=v[r??""],O=y==null?void 0:y.direction;return F.jsx(on,{variant:"caption",as:"th",className:Q.twJoin("bbn-cell-left",o&&"bbn-table-sortable",s),onClick:()=>{if(o&&r){const w=c.find(C=>C.key===r);p==null||p(r,w==null?void 0:w.sorter)}},"data-column":r,...f,children:F.jsxs("div",{className:"flex items-center justify-between gap-1",children:[F.jsx("span",{children:i}),o&&F.jsxs("span",{className:"bbn-table-sort-icons",children:[F.jsx(y_,{className:Q.twJoin("bbn-sort-icon bbn-sort-icon-up",O==="asc"?"bbn-sort-icon-active":"bbn-sort-icon-inactive")}),F.jsx(g_,{className:Q.twJoin("bbn-sort-icon bbn-sort-icon-down",O==="desc"?"bbn-sort-icon-active":"bbn-sort-icon-inactive")})]})]})})}function Zy(r,s){const[i,o]=L.useState({}),f=L.useCallback((v,p)=>{p&&o(y=>{var M;const O=((M=y[v])==null?void 0:M.direction)??null,w=O===null?"asc":O==="asc"?"desc":null;if(w===null)return Object.fromEntries(Object.entries(y).filter(([B])=>B!==v).map(([B,U])=>[B,{...U,priority:U.priority>y[v].priority?U.priority-1:U.priority}]));const C=Math.max(0,...Object.values(y).map(B=>B.priority));return{...y,[v]:{direction:w,priority:C+1}}})},[]),c=L.useMemo(()=>{const v=Object.entries(i).filter(([,p])=>p.direction!==null).toSorted((p,y)=>y[1].priority-p[1].priority).map(([p,y])=>({column:s.find(O=>O.key===p),direction:y.direction})).filter(({column:p})=>p==null?void 0:p.sorter);return v.length===0?r:r.toSorted((p,y)=>{for(const{column:O,direction:w}of v){const C=O.sorter(p,y);if(C!==0)return w==="asc"?C:-C}return 0})},[r,s,i]);return{sortStates:i,handleColumnSort:f,sortedData:c}}function rl({className:r,render:s,value:i,columnName:o,...f}){return F.jsx(on,{variant:"body2",as:"td",className:Q.twJoin("bbn-cell-left",r),"data-column":o,...f,children:s?s(i):i})}function Yy({row:r,columns:s,isSelected:i,isSelectable:o,onSelect:f}){return F.jsx("tr",{className:Q.twJoin(i&&"selected",!!f&&o&&"cursor-pointer",!o&&"opacity-50"),onClick:()=>f(r),children:s.map(c=>F.jsx(rl,{value:r[c.key],columnName:c.key,className:c.cellClassName,render:c.render?v=>c.render(v,r):void 0},c.key))})}function Ky({data:r,columns:s,className:i,wrapperClassName:o,hasMore:f=!1,loading:c=!1,onLoadMore:v,onRowSelect:p,isRowSelectable:y,selectedRow:O,defaultSelectedRow:w,onSelectedRowChange:C,...M},B){const U=L.useRef(null);L.useImperativeHandle(B,()=>U.current,[]);const{sortStates:Y,handleColumnSort:V,sortedData:G}=Zy(r,s),{isScrolledTop:k}=Gy(U,{onLoadMore:v,hasMore:f,loading:c}),[z,j]=rr({value:O,defaultValue:w??null,onStateChange:C}),H=L.useCallback(J=>{if(!p||y&&!y(J))return;const ae=z===J.id?null:J.id;j(ae),p(ae===null?null:J)},[p,y,z,j]),X=L.useMemo(()=>({data:G,columns:s,sortStates:Y,onColumnSort:V,onRowSelect:H}),[G,s,Y,V,H]);return F.jsx(tl.Provider,{value:X,children:F.jsx("div",{ref:U,className:Q.twJoin("bbn-table-wrapper",o),children:F.jsxs("table",{className:Q.twJoin("bbn-table",i),...M,children:[F.jsx("thead",{className:Q.twJoin("bbn-table-header",k&&"scrolled-top"),children:F.jsx("tr",{children:s.map(J=>F.jsx(nl,{className:J.headerClassName,name:J.key,sorter:J.sorter,children:J.header},J.key))})}),F.jsx("tbody",{className:"bbn-table-body",children:G.map(J=>F.jsx(Yy,{row:J,columns:s,isSelected:z===J.id,isSelectable:y?y(J):!0,onSelect:H},J.id))})]})})})}const Xy=L.forwardRef(Ky);function Qy({as:r="div",className:s,children:i}){return L.createElement(r,{className:Q.twJoin("bbn-card",s)},i)}function em(r){const[s=!1,i]=rr({value:r.value,defaultValue:r.defaultValue,onStateChange:r.onChange});return F.jsxs("div",{className:"bbn-toggle",onClick:()=>void i(!s),children:[F.jsx("span",{className:"bbn-toggle-bg",children:r.activeIcon}),F.jsx("span",{className:Q.twJoin("bbn-toggle-control",s&&"bbn-toggle-control-active")}),F.jsx("span",{className:"bbn-toggle-bg",children:r.inactiveIcon})]})}const tm={adaptive:"adaptive",horizontal:"vertical",vertical:"horizontal"};function nm({className:r,orientation:s="vertical",children:i}){return F.jsx("div",{className:Q.twMerge("bbn-list",`bbn-list-${s}`,r),children:L.Children.map(i,o=>L.isValidElement(o)?L.cloneElement(o,{orientation:tm[s]}):o)})}function rm({className:r,orientation:s="horizontal",title:i,value:o,suffix:f}){return F.jsxs("div",{className:Q.twJoin("bbn-list-item",`bbn-list-item-${s}`,r),children:[F.jsx(on,{as:"div",className:Q.twJoin("bbn-list-title",`bbn-list-title-${s}`),variant:s==="horizontal"?"body1":"body2",children:i}),F.jsxs(on,{as:"div",className:Q.twJoin("bbn-list-value",`bbn-list-value-${s}`),variant:"body1",children:[o,f]})]})}function im({children:r,count:s=0,max:i=99,position:o="bottom-right",color:f="error",className:c,badgeClassName:v,contentClassName:p}){const y=typeof s=="number"?s>0:s!=null,O=typeof s=="number"&&s>i?`${i}+`:s,w=`bbn-badge-${o}`,C=`bbn-badge-${f}`;return F.jsxs("div",{className:Q.twJoin("bbn-badge",c),children:[r,y&&F.jsx("span",{className:Q.twJoin("bbn-badge-indicator",w,C,v),children:F.jsx("span",{className:Q.twJoin("bbn-badge-content",p),children:O})})]})}var Hr=r=>r.type==="checkbox",Bn=r=>r instanceof Date,rt=r=>r==null;const il=r=>typeof r=="object";var Me=r=>!rt(r)&&!Array.isArray(r)&&il(r)&&!Bn(r),sl=r=>Me(r)&&r.target?Hr(r.target)?r.target.checked:r.target.value:r,sm=r=>r.substring(0,r.search(/\.\d+(\.|$)/))||r,ul=(r,s)=>r.has(sm(s)),um=r=>{const s=r.constructor&&r.constructor.prototype;return Me(s)&&s.hasOwnProperty("isPrototypeOf")},Cu=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function ft(r){let s;const i=Array.isArray(r),o=typeof FileList<"u"?r instanceof FileList:!1;if(r instanceof Date)s=new Date(r);else if(r instanceof Set)s=new Set(r);else if(!(Cu&&(r instanceof Blob||o))&&(i||Me(r)))if(s=i?[]:{},!i&&!um(r))s=r;else for(const f in r)r.hasOwnProperty(f)&&(s[f]=ft(r[f]));else return r;return s}var Ji=r=>Array.isArray(r)?r.filter(Boolean):[],Ie=r=>r===void 0,W=(r,s,i)=>{if(!s||!Me(r))return i;const o=Ji(s.split(/[,[\].]+?/)).reduce((f,c)=>rt(f)?f:f[c],r);return Ie(o)||o===r?Ie(r[s])?i:r[s]:o},bt=r=>typeof r=="boolean",Eu=r=>/^\w*$/.test(r),ol=r=>Ji(r.replace(/["|']|\]/g,"").split(/\.|\[/)),xe=(r,s,i)=>{let o=-1;const f=Eu(s)?[s]:ol(s),c=f.length,v=c-1;for(;++o<c;){const p=f[o];let y=i;if(o!==v){const O=r[p];y=Me(O)||Array.isArray(O)?O:isNaN(+f[o+1])?{}:[]}if(p==="__proto__"||p==="constructor"||p==="prototype")return;r[p]=y,r=r[p]}return r};const Vi={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Ut={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},un={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},al=L.createContext(null),ar=()=>L.useContext(al),om=r=>{const{children:s,...i}=r;return L.createElement(al.Provider,{value:i},s)};var fl=(r,s,i,o=!0)=>{const f={defaultValues:s._defaultValues};for(const c in r)Object.defineProperty(f,c,{get:()=>{const v=c;return s._proxyFormState[v]!==Ut.all&&(s._proxyFormState[v]=!o||Ut.all),i&&(i[v]=!0),r[v]}});return f},lt=r=>Me(r)&&!Object.keys(r).length,ll=(r,s,i,o)=>{i(r);const{name:f,...c}=r;return lt(c)||Object.keys(c).length>=Object.keys(s).length||Object.keys(c).find(v=>s[v]===(!o||Ut.all))},Pr=r=>Array.isArray(r)?r:[r],cl=(r,s,i)=>!r||!s||r===s||Pr(r).some(o=>o&&(i?o===s:o.startsWith(s)||s.startsWith(o)));function Ru(r){const s=L.useRef(r);s.current=r,L.useEffect(()=>{const i=!r.disabled&&s.current.subject&&s.current.subject.subscribe({next:s.current.next});return()=>{i&&i.unsubscribe()}},[r.disabled])}function Lu(r){const s=ar(),{control:i=s.control,disabled:o,name:f,exact:c}=r||{},[v,p]=L.useState(i._formState),y=L.useRef(!0),O=L.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),w=L.useRef(f);return w.current=f,Ru({disabled:o,next:C=>y.current&&cl(w.current,C.name,c)&&ll(C,O.current,i._updateFormState)&&p({...i._formState,...C}),subject:i._subjects.state}),L.useEffect(()=>(y.current=!0,O.current.isValid&&i._updateValid(!0),()=>{y.current=!1}),[i]),L.useMemo(()=>fl(v,i,O.current,!1),[v,i])}var Jt=r=>typeof r=="string",dl=(r,s,i,o,f)=>Jt(r)?(o&&s.watch.add(r),W(i,r,f)):Array.isArray(r)?r.map(c=>(o&&s.watch.add(c),W(i,c))):(o&&(s.watchAll=!0),i);function hl(r){const s=ar(),{control:i=s.control,name:o,defaultValue:f,disabled:c,exact:v}=r||{},p=L.useRef(o);p.current=o,Ru({disabled:c,subject:i._subjects.values,next:w=>{cl(p.current,w.name,v)&&O(ft(dl(p.current,i._names,w.values||i._formValues,!1,f)))}});const[y,O]=L.useState(i._getWatch(o,f));return L.useEffect(()=>i._removeUnmounted()),y}function am(r){const s=ar(),{name:i,disabled:o,control:f=s.control,shouldUnregister:c}=r,v=ul(f._names.array,i),p=hl({control:f,name:i,defaultValue:W(f._formValues,i,W(f._defaultValues,i,r.defaultValue)),exact:!0}),y=Lu({control:f,name:i,exact:!0}),O=L.useRef(f.register(i,{...r.rules,value:p,...bt(r.disabled)?{disabled:r.disabled}:{}})),w=L.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!W(y.errors,i)},isDirty:{enumerable:!0,get:()=>!!W(y.dirtyFields,i)},isTouched:{enumerable:!0,get:()=>!!W(y.touchedFields,i)},isValidating:{enumerable:!0,get:()=>!!W(y.validatingFields,i)},error:{enumerable:!0,get:()=>W(y.errors,i)}}),[y,i]),C=L.useMemo(()=>({name:i,value:p,...bt(o)||y.disabled?{disabled:y.disabled||o}:{},onChange:M=>O.current.onChange({target:{value:sl(M),name:i},type:Vi.CHANGE}),onBlur:()=>O.current.onBlur({target:{value:W(f._formValues,i),name:i},type:Vi.BLUR}),ref:M=>{const B=W(f._fields,i);B&&M&&(B._f.ref={focus:()=>M.focus(),select:()=>M.select(),setCustomValidity:U=>M.setCustomValidity(U),reportValidity:()=>M.reportValidity()})}}),[i,f._formValues,o,y.disabled,p,f._fields]);return L.useEffect(()=>{const M=f._options.shouldUnregister||c,B=(U,Y)=>{const V=W(f._fields,U);V&&V._f&&(V._f.mount=Y)};if(B(i,!0),M){const U=ft(W(f._options.defaultValues,i));xe(f._defaultValues,i,U),Ie(W(f._formValues,i))&&xe(f._formValues,i,U)}return()=>{(v?M&&!f._state.action:M)?f.unregister(i):B(i,!1)}},[i,f,v,c]),L.useEffect(()=>{bt(o)&&W(f._fields,i)&&f._updateDisabledField({disabled:o,fields:f._fields,name:i,value:W(f._fields,i)._f.value})},[o,i,f]),L.useMemo(()=>({field:C,formState:y,fieldState:w}),[C,y,w])}var pl=(r,s,i,o,f)=>s?{...i[r],types:{...i[r]&&i[r].types?i[r].types:{},[o]:f||!0}}:{},xf=r=>({isOnSubmit:!r||r===Ut.onSubmit,isOnBlur:r===Ut.onBlur,isOnChange:r===Ut.onChange,isOnAll:r===Ut.all,isOnTouch:r===Ut.onTouched}),Af=(r,s,i)=>!i&&(s.watchAll||s.watch.has(r)||[...s.watch].some(o=>r.startsWith(o)&&/^\.\w+/.test(r.slice(o.length))));const Br=(r,s,i,o)=>{for(const f of i||Object.keys(r)){const c=W(r,f);if(c){const{_f:v,...p}=c;if(v){if(v.refs&&v.refs[0]&&s(v.refs[0],f)&&!o)return!0;if(v.ref&&s(v.ref,v.name)&&!o)return!0;if(Br(p,s))break}else if(Me(p)&&Br(p,s))break}}};var fm=(r,s,i)=>{const o=Pr(W(r,i));return xe(o,"root",s[i]),xe(r,i,o),r},Tu=r=>r.type==="file",qt=r=>typeof r=="function",Ui=r=>{if(!Cu)return!1;const s=r?r.ownerDocument:0;return r instanceof(s&&s.defaultView?s.defaultView.HTMLElement:HTMLElement)},Ni=r=>Jt(r),Fu=r=>r.type==="radio",$i=r=>r instanceof RegExp;const Of={value:!1,isValid:!1},Sf={value:!0,isValid:!0};var vl=r=>{if(Array.isArray(r)){if(r.length>1){const s=r.filter(i=>i&&i.checked&&!i.disabled).map(i=>i.value);return{value:s,isValid:!!s.length}}return r[0].checked&&!r[0].disabled?r[0].attributes&&!Ie(r[0].attributes.value)?Ie(r[0].value)||r[0].value===""?Sf:{value:r[0].value,isValid:!0}:Sf:Of}return Of};const Cf={isValid:!1,value:null};var gl=r=>Array.isArray(r)?r.reduce((s,i)=>i&&i.checked&&!i.disabled?{isValid:!0,value:i.value}:s,Cf):Cf;function Ef(r,s,i="validate"){if(Ni(r)||Array.isArray(r)&&r.every(Ni)||bt(r)&&!r)return{type:i,message:Ni(r)?r:"",ref:s}}var nr=r=>Me(r)&&!$i(r)?r:{value:r,message:""},Rf=async(r,s,i,o,f)=>{const{ref:c,refs:v,required:p,maxLength:y,minLength:O,min:w,max:C,pattern:M,validate:B,name:U,valueAsNumber:Y,mount:V,disabled:G}=r._f,k=W(s,U);if(!V||G)return{};const z=v?v[0]:c,j=ee=>{o&&z.reportValidity&&(z.setCustomValidity(bt(ee)?"":ee||""),z.reportValidity())},H={},X=Fu(c),J=Hr(c),ae=X||J,ve=(Y||Tu(c))&&Ie(c.value)&&Ie(k)||Ui(c)&&c.value===""||k===""||Array.isArray(k)&&!k.length,fe=pl.bind(null,U,i,H),he=(ee,ne,be,Ee=un.maxLength,Oe=un.minLength)=>{const ye=ee?ne:be;H[U]={type:ee?Ee:Oe,message:ye,ref:c,...fe(ee?Ee:Oe,ye)}};if(f?!Array.isArray(k)||!k.length:p&&(!ae&&(ve||rt(k))||bt(k)&&!k||J&&!vl(v).isValid||X&&!gl(v).isValid)){const{value:ee,message:ne}=Ni(p)?{value:!!p,message:p}:nr(p);if(ee&&(H[U]={type:un.required,message:ne,ref:z,...fe(un.required,ne)},!i))return j(ne),H}if(!ve&&(!rt(w)||!rt(C))){let ee,ne;const be=nr(C),Ee=nr(w);if(!rt(k)&&!isNaN(k)){const Oe=c.valueAsNumber||k&&+k;rt(be.value)||(ee=Oe>be.value),rt(Ee.value)||(ne=Oe<Ee.value)}else{const Oe=c.valueAsDate||new Date(k),ye=Qe=>new Date(new Date().toDateString()+" "+Qe),We=c.type=="time",Xe=c.type=="week";Jt(be.value)&&k&&(ee=We?ye(k)>ye(be.value):Xe?k>be.value:Oe>new Date(be.value)),Jt(Ee.value)&&k&&(ne=We?ye(k)<ye(Ee.value):Xe?k<Ee.value:Oe<new Date(Ee.value))}if((ee||ne)&&(he(!!ee,be.message,Ee.message,un.max,un.min),!i))return j(H[U].message),H}if((y||O)&&!ve&&(Jt(k)||f&&Array.isArray(k))){const ee=nr(y),ne=nr(O),be=!rt(ee.value)&&k.length>+ee.value,Ee=!rt(ne.value)&&k.length<+ne.value;if((be||Ee)&&(he(be,ee.message,ne.message),!i))return j(H[U].message),H}if(M&&!ve&&Jt(k)){const{value:ee,message:ne}=nr(M);if($i(ee)&&!k.match(ee)&&(H[U]={type:un.pattern,message:ne,ref:c,...fe(un.pattern,ne)},!i))return j(ne),H}if(B){if(qt(B)){const ee=await B(k,s),ne=Ef(ee,z);if(ne&&(H[U]={...ne,...fe(un.validate,ne.message)},!i))return j(ne.message),H}else if(Me(B)){let ee={};for(const ne in B){if(!lt(ee)&&!i)break;const be=Ef(await B[ne](k,s),z,ne);be&&(ee={...be,...fe(ne,be.message)},j(be.message),i&&(H[U]=ee))}if(!lt(ee)&&(H[U]={ref:z,...ee},!i))return H}}return j(!0),H};function lm(r,s){const i=s.slice(0,-1).length;let o=0;for(;o<i;)r=Ie(r)?o++:r[s[o++]];return r}function cm(r){for(const s in r)if(r.hasOwnProperty(s)&&!Ie(r[s]))return!1;return!0}function $e(r,s){const i=Array.isArray(s)?s:Eu(s)?[s]:ol(s),o=i.length===1?r:lm(r,i),f=i.length-1,c=i[f];return o&&delete o[c],f!==0&&(Me(o)&&lt(o)||Array.isArray(o)&&cm(o))&&$e(r,i.slice(0,-1)),r}var ou=()=>{let r=[];return{get observers(){return r},next:f=>{for(const c of r)c.next&&c.next(f)},subscribe:f=>(r.push(f),{unsubscribe:()=>{r=r.filter(c=>c!==f)}}),unsubscribe:()=>{r=[]}}},du=r=>rt(r)||!il(r);function xn(r,s){if(du(r)||du(s))return r===s;if(Bn(r)&&Bn(s))return r.getTime()===s.getTime();const i=Object.keys(r),o=Object.keys(s);if(i.length!==o.length)return!1;for(const f of i){const c=r[f];if(!o.includes(f))return!1;if(f!=="ref"){const v=s[f];if(Bn(c)&&Bn(v)||Me(c)&&Me(v)||Array.isArray(c)&&Array.isArray(v)?!xn(c,v):c!==v)return!1}}return!0}var _l=r=>r.type==="select-multiple",dm=r=>Fu(r)||Hr(r),au=r=>Ui(r)&&r.isConnected,yl=r=>{for(const s in r)if(qt(r[s]))return!0;return!1};function Hi(r,s={}){const i=Array.isArray(r);if(Me(r)||i)for(const o in r)Array.isArray(r[o])||Me(r[o])&&!yl(r[o])?(s[o]=Array.isArray(r[o])?[]:{},Hi(r[o],s[o])):rt(r[o])||(s[o]=!0);return s}function ml(r,s,i){const o=Array.isArray(r);if(Me(r)||o)for(const f in r)Array.isArray(r[f])||Me(r[f])&&!yl(r[f])?Ie(s)||du(i[f])?i[f]=Array.isArray(r[f])?Hi(r[f],[]):{...Hi(r[f])}:ml(r[f],rt(s)?{}:s[f],i[f]):i[f]=!xn(r[f],s[f]);return i}var Fr=(r,s)=>ml(r,s,Hi(s)),bl=(r,{valueAsNumber:s,valueAsDate:i,setValueAs:o})=>Ie(r)?r:s?r===""?NaN:r&&+r:i&&Jt(r)?new Date(r):o?o(r):r;function fu(r){const s=r.ref;if(!(r.refs?r.refs.every(i=>i.disabled):s.disabled))return Tu(s)?s.files:Fu(s)?gl(r.refs).value:_l(s)?[...s.selectedOptions].map(({value:i})=>i):Hr(s)?vl(r.refs).value:bl(Ie(s.value)?r.ref.value:s.value,r)}var hm=(r,s,i,o)=>{const f={};for(const c of r){const v=W(s,c);v&&xe(f,c,v._f)}return{criteriaMode:i,names:[...r],fields:f,shouldUseNativeValidation:o}},Dr=r=>Ie(r)?r:$i(r)?r.source:Me(r)?$i(r.value)?r.value.source:r.value:r;const Lf="AsyncFunction";var pm=r=>!!r&&!!r.validate&&!!(qt(r.validate)&&r.validate.constructor.name===Lf||Me(r.validate)&&Object.values(r.validate).find(s=>s.constructor.name===Lf)),vm=r=>r.mount&&(r.required||r.min||r.max||r.maxLength||r.minLength||r.pattern||r.validate);function Tf(r,s,i){const o=W(r,i);if(o||Eu(i))return{error:o,name:i};const f=i.split(".");for(;f.length;){const c=f.join("."),v=W(s,c),p=W(r,c);if(v&&!Array.isArray(v)&&i!==c)return{name:i};if(p&&p.type)return{name:c,error:p};f.pop()}return{name:i}}var gm=(r,s,i,o,f)=>f.isOnAll?!1:!i&&f.isOnTouch?!(s||r):(i?o.isOnBlur:f.isOnBlur)?!r:(i?o.isOnChange:f.isOnChange)?r:!0,_m=(r,s)=>!Ji(W(r,s)).length&&$e(r,s);const ym={mode:Ut.onSubmit,reValidateMode:Ut.onChange,shouldFocusError:!0};function mm(r={}){let s={...ym,...r},i={submitCount:0,isDirty:!1,isLoading:qt(s.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:s.errors||{},disabled:s.disabled||!1},o={},f=Me(s.defaultValues)||Me(s.values)?ft(s.defaultValues||s.values)||{}:{},c=s.shouldUnregister?{}:ft(f),v={action:!1,mount:!1,watch:!1},p={mount:new Set,unMount:new Set,array:new Set,watch:new Set},y,O=0;const w={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},C={values:ou(),array:ou(),state:ou()},M=xf(s.mode),B=xf(s.reValidateMode),U=s.criteriaMode===Ut.all,Y=g=>x=>{clearTimeout(O),O=setTimeout(g,x)},V=async g=>{if(!s.disabled&&(w.isValid||g)){const x=s.resolver?lt((await ae()).errors):await fe(o,!0);x!==i.isValid&&C.state.next({isValid:x})}},G=(g,x)=>{!s.disabled&&(w.isValidating||w.validatingFields)&&((g||Array.from(p.mount)).forEach(S=>{S&&(x?xe(i.validatingFields,S,x):$e(i.validatingFields,S))}),C.state.next({validatingFields:i.validatingFields,isValidating:!lt(i.validatingFields)}))},k=(g,x=[],S,N,P=!0,I=!0)=>{if(N&&S&&!s.disabled){if(v.action=!0,I&&Array.isArray(W(o,g))){const K=S(W(o,g),N.argA,N.argB);P&&xe(o,g,K)}if(I&&Array.isArray(W(i.errors,g))){const K=S(W(i.errors,g),N.argA,N.argB);P&&xe(i.errors,g,K),_m(i.errors,g)}if(w.touchedFields&&I&&Array.isArray(W(i.touchedFields,g))){const K=S(W(i.touchedFields,g),N.argA,N.argB);P&&xe(i.touchedFields,g,K)}w.dirtyFields&&(i.dirtyFields=Fr(f,c)),C.state.next({name:g,isDirty:ee(g,x),dirtyFields:i.dirtyFields,errors:i.errors,isValid:i.isValid})}else xe(c,g,x)},z=(g,x)=>{xe(i.errors,g,x),C.state.next({errors:i.errors})},j=g=>{i.errors=g,C.state.next({errors:i.errors,isValid:!1})},H=(g,x,S,N)=>{const P=W(o,g);if(P){const I=W(c,g,Ie(S)?W(f,g):S);Ie(I)||N&&N.defaultChecked||x?xe(c,g,x?I:fu(P._f)):Ee(g,I),v.mount&&V()}},X=(g,x,S,N,P)=>{let I=!1,K=!1;const se={name:g};if(!s.disabled){const Fe=!!(W(o,g)&&W(o,g)._f&&W(o,g)._f.disabled);if(!S||N){w.isDirty&&(K=i.isDirty,i.isDirty=se.isDirty=ee(),I=K!==se.isDirty);const Se=Fe||xn(W(f,g),x);K=!!(!Fe&&W(i.dirtyFields,g)),Se||Fe?$e(i.dirtyFields,g):xe(i.dirtyFields,g,!0),se.dirtyFields=i.dirtyFields,I=I||w.dirtyFields&&K!==!Se}if(S){const Se=W(i.touchedFields,g);Se||(xe(i.touchedFields,g,S),se.touchedFields=i.touchedFields,I=I||w.touchedFields&&Se!==S)}I&&P&&C.state.next(se)}return I?se:{}},J=(g,x,S,N)=>{const P=W(i.errors,g),I=w.isValid&&bt(x)&&i.isValid!==x;if(s.delayError&&S?(y=Y(()=>z(g,S)),y(s.delayError)):(clearTimeout(O),y=null,S?xe(i.errors,g,S):$e(i.errors,g)),(S?!xn(P,S):P)||!lt(N)||I){const K={...N,...I&&bt(x)?{isValid:x}:{},errors:i.errors,name:g};i={...i,...K},C.state.next(K)}},ae=async g=>{G(g,!0);const x=await s.resolver(c,s.context,hm(g||p.mount,o,s.criteriaMode,s.shouldUseNativeValidation));return G(g),x},ve=async g=>{const{errors:x}=await ae(g);if(g)for(const S of g){const N=W(x,S);N?xe(i.errors,S,N):$e(i.errors,S)}else i.errors=x;return x},fe=async(g,x,S={valid:!0})=>{for(const N in g){const P=g[N];if(P){const{_f:I,...K}=P;if(I){const se=p.array.has(I.name),Fe=P._f&&pm(P._f);Fe&&w.validatingFields&&G([N],!0);const Se=await Rf(P,c,U,s.shouldUseNativeValidation&&!x,se);if(Fe&&w.validatingFields&&G([N]),Se[I.name]&&(S.valid=!1,x))break;!x&&(W(Se,I.name)?se?fm(i.errors,Se,I.name):xe(i.errors,I.name,Se[I.name]):$e(i.errors,I.name))}!lt(K)&&await fe(K,x,S)}}return S.valid},he=()=>{for(const g of p.unMount){const x=W(o,g);x&&(x._f.refs?x._f.refs.every(S=>!au(S)):!au(x._f.ref))&&it(g)}p.unMount=new Set},ee=(g,x)=>!s.disabled&&(g&&x&&xe(c,g,x),!xn(ke(),f)),ne=(g,x,S)=>dl(g,p,{...v.mount?c:Ie(x)?f:Jt(g)?{[g]:x}:x},S,x),be=g=>Ji(W(v.mount?c:f,g,s.shouldUnregister?W(f,g,[]):[])),Ee=(g,x,S={})=>{const N=W(o,g);let P=x;if(N){const I=N._f;I&&(!I.disabled&&xe(c,g,bl(x,I)),P=Ui(I.ref)&&rt(x)?"":x,_l(I.ref)?[...I.ref.options].forEach(K=>K.selected=P.includes(K.value)):I.refs?Hr(I.ref)?I.refs.length>1?I.refs.forEach(K=>(!K.defaultChecked||!K.disabled)&&(K.checked=Array.isArray(P)?!!P.find(se=>se===K.value):P===K.value)):I.refs[0]&&(I.refs[0].checked=!!P):I.refs.forEach(K=>K.checked=K.value===P):Tu(I.ref)?I.ref.value="":(I.ref.value=P,I.ref.type||C.values.next({name:g,values:{...c}})))}(S.shouldDirty||S.shouldTouch)&&X(g,P,S.shouldTouch,S.shouldDirty,!0),S.shouldValidate&&Qe(g)},Oe=(g,x,S)=>{for(const N in x){const P=x[N],I=`${g}.${N}`,K=W(o,I);(p.array.has(g)||Me(P)||K&&!K._f)&&!Bn(P)?Oe(I,P,S):Ee(I,P,S)}},ye=(g,x,S={})=>{const N=W(o,g),P=p.array.has(g),I=ft(x);xe(c,g,I),P?(C.array.next({name:g,values:{...c}}),(w.isDirty||w.dirtyFields)&&S.shouldDirty&&C.state.next({name:g,dirtyFields:Fr(f,c),isDirty:ee(g,I)})):N&&!N._f&&!rt(I)?Oe(g,I,S):Ee(g,I,S),Af(g,p)&&C.state.next({...i}),C.values.next({name:v.mount?g:void 0,values:{...c}})},We=async g=>{v.mount=!0;const x=g.target;let S=x.name,N=!0;const P=W(o,S),I=()=>x.type?fu(P._f):sl(g),K=se=>{N=Number.isNaN(se)||Bn(se)&&isNaN(se.getTime())||xn(se,W(c,S,se))};if(P){let se,Fe;const Se=I(),Je=g.type===Vi.BLUR||g.type===Vi.FOCUS_OUT,cr=!vm(P._f)&&!s.resolver&&!W(i.errors,S)&&!P._f.deps||gm(Je,W(i.touchedFields,S),i.isSubmitted,B,M),On=Af(S,p,Je);xe(c,S,Se),Je?(P._f.onBlur&&P._f.onBlur(g),y&&y(0)):P._f.onChange&&P._f.onChange(g);const Sn=X(S,Se,Je,!1),dr=!lt(Sn)||On;if(!Je&&C.values.next({name:S,type:g.type,values:{...c}}),cr)return w.isValid&&(s.mode==="onBlur"?Je&&V():V()),dr&&C.state.next({name:S,...On?{}:Sn});if(!Je&&On&&C.state.next({...i}),s.resolver){const{errors:Un}=await ae([S]);if(K(Se),N){const hr=Tf(i.errors,o,S),$n=Tf(Un,o,hr.name||S);se=$n.error,S=$n.name,Fe=lt(Un)}}else G([S],!0),se=(await Rf(P,c,U,s.shouldUseNativeValidation))[S],G([S]),K(Se),N&&(se?Fe=!1:w.isValid&&(Fe=await fe(o,!0)));N&&(P._f.deps&&Qe(P._f.deps),J(S,Fe,se,Sn))}},Xe=(g,x)=>{if(W(i.errors,x)&&g.focus)return g.focus(),1},Qe=async(g,x={})=>{let S,N;const P=Pr(g);if(s.resolver){const I=await ve(Ie(g)?g:P);S=lt(I),N=g?!P.some(K=>W(I,K)):S}else g?(N=(await Promise.all(P.map(async I=>{const K=W(o,I);return await fe(K&&K._f?{[I]:K}:K)}))).every(Boolean),!(!N&&!i.isValid)&&V()):N=S=await fe(o);return C.state.next({...!Jt(g)||w.isValid&&S!==i.isValid?{}:{name:g},...s.resolver||!g?{isValid:S}:{},errors:i.errors}),x.shouldFocus&&!N&&Br(o,Xe,g?P:p.mount),N},ke=g=>{const x={...v.mount?c:f};return Ie(g)?x:Jt(g)?W(x,g):g.map(S=>W(x,S))},$t=(g,x)=>({invalid:!!W((x||i).errors,g),isDirty:!!W((x||i).dirtyFields,g),error:W((x||i).errors,g),isValidating:!!W(i.validatingFields,g),isTouched:!!W((x||i).touchedFields,g)}),fn=g=>{g&&Pr(g).forEach(x=>$e(i.errors,x)),C.state.next({errors:g?i.errors:{}})},Nt=(g,x,S)=>{const N=(W(o,g,{_f:{}})._f||{}).ref,P=W(i.errors,g)||{},{ref:I,message:K,type:se,...Fe}=P;xe(i.errors,g,{...Fe,...x,ref:N}),C.state.next({name:g,errors:i.errors,isValid:!1}),S&&S.shouldFocus&&N&&N.focus&&N.focus()},je=(g,x)=>qt(g)?C.values.subscribe({next:S=>g(ne(void 0,x),S)}):ne(g,x,!0),it=(g,x={})=>{for(const S of g?Pr(g):p.mount)p.mount.delete(S),p.array.delete(S),x.keepValue||($e(o,S),$e(c,S)),!x.keepError&&$e(i.errors,S),!x.keepDirty&&$e(i.dirtyFields,S),!x.keepTouched&&$e(i.touchedFields,S),!x.keepIsValidating&&$e(i.validatingFields,S),!s.shouldUnregister&&!x.keepDefaultValue&&$e(f,S);C.values.next({values:{...c}}),C.state.next({...i,...x.keepDirty?{isDirty:ee()}:{}}),!x.keepIsValid&&V()},Zt=({disabled:g,name:x,field:S,fields:N,value:P})=>{if(bt(g)&&v.mount||g){const I=g?void 0:Ie(P)?fu(S?S._f:W(N,x)._f):P;(g||!g&&!Ie(I))&&xe(c,x,I),X(x,I,!1,!1,!0)}},qe=(g,x={})=>{let S=W(o,g);const N=bt(x.disabled)||bt(s.disabled);return xe(o,g,{...S||{},_f:{...S&&S._f?S._f:{ref:{name:g}},name:g,mount:!0,...x}}),p.mount.add(g),S?Zt({field:S,disabled:bt(x.disabled)?x.disabled:s.disabled,name:g,value:x.value}):H(g,!0,x.value),{...N?{disabled:x.disabled||s.disabled}:{},...s.progressive?{required:!!x.required,min:Dr(x.min),max:Dr(x.max),minLength:Dr(x.minLength),maxLength:Dr(x.maxLength),pattern:Dr(x.pattern)}:{},name:g,onChange:We,onBlur:We,ref:P=>{if(P){qe(g,x),S=W(o,g);const I=Ie(P.value)&&P.querySelectorAll&&P.querySelectorAll("input,select,textarea")[0]||P,K=dm(I),se=S._f.refs||[];if(K?se.find(Fe=>Fe===I):I===S._f.ref)return;xe(o,g,{_f:{...S._f,...K?{refs:[...se.filter(au),I,...Array.isArray(W(f,g))?[{}]:[]],ref:{type:I.type,name:g}}:{ref:I}}}),H(g,!1,void 0,I)}else S=W(o,g,{}),S._f&&(S._f.mount=!1),(s.shouldUnregister||x.shouldUnregister)&&!(ul(p.array,g)&&v.action)&&p.unMount.add(g)}}},xt=()=>s.shouldFocusError&&Br(o,Xe,p.mount),fr=g=>{bt(g)&&(C.state.next({disabled:g}),Br(o,(x,S)=>{const N=W(o,S);N&&(x.disabled=N._f.disabled||g,Array.isArray(N._f.refs)&&N._f.refs.forEach(P=>{P.disabled=N._f.disabled||g}))},0,!1))},Pt=(g,x)=>async S=>{let N;if(S&&(S.preventDefault&&S.preventDefault(),S.persist&&S.persist()),s.disabled){x&&await x({...i.errors},S);return}let P=ft(c);if(C.state.next({isSubmitting:!0}),s.resolver){const{errors:I,values:K}=await ae();i.errors=I,P=K}else await fe(o);if($e(i.errors,"root"),lt(i.errors)){C.state.next({errors:{}});try{await g(P,S)}catch(I){N=I}}else x&&await x({...i.errors},S),xt(),setTimeout(xt);if(C.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:lt(i.errors)&&!N,submitCount:i.submitCount+1,errors:i.errors}),N)throw N},ln=(g,x={})=>{W(o,g)&&(Ie(x.defaultValue)?ye(g,ft(W(f,g))):(ye(g,x.defaultValue),xe(f,g,ft(x.defaultValue))),x.keepTouched||$e(i.touchedFields,g),x.keepDirty||($e(i.dirtyFields,g),i.isDirty=x.defaultValue?ee(g,ft(W(f,g))):ee()),x.keepError||($e(i.errors,g),w.isValid&&V()),C.state.next({...i}))},cn=(g,x={})=>{const S=g?ft(g):f,N=ft(S),P=lt(g),I=P?f:N;if(x.keepDefaultValues||(f=S),!x.keepValues){if(x.keepDirtyValues){const K=new Set([...p.mount,...Object.keys(Fr(f,c))]);for(const se of Array.from(K))W(i.dirtyFields,se)?xe(I,se,W(c,se)):ye(se,W(I,se))}else{if(Cu&&Ie(g))for(const K of p.mount){const se=W(o,K);if(se&&se._f){const Fe=Array.isArray(se._f.refs)?se._f.refs[0]:se._f.ref;if(Ui(Fe)){const Se=Fe.closest("form");if(Se){Se.reset();break}}}}o={}}c=s.shouldUnregister?x.keepDefaultValues?ft(f):{}:ft(I),C.array.next({values:{...I}}),C.values.next({values:{...I}})}p={mount:x.keepDirtyValues?p.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},v.mount=!w.isValid||!!x.keepIsValid||!!x.keepDirtyValues,v.watch=!!s.shouldUnregister,C.state.next({submitCount:x.keepSubmitCount?i.submitCount:0,isDirty:P?!1:x.keepDirty?i.isDirty:!!(x.keepDefaultValues&&!xn(g,f)),isSubmitted:x.keepIsSubmitted?i.isSubmitted:!1,dirtyFields:P?{}:x.keepDirtyValues?x.keepDefaultValues&&c?Fr(f,c):i.dirtyFields:x.keepDefaultValues&&g?Fr(f,g):x.keepDirty?i.dirtyFields:{},touchedFields:x.keepTouched?i.touchedFields:{},errors:x.keepErrors?i.errors:{},isSubmitSuccessful:x.keepIsSubmitSuccessful?i.isSubmitSuccessful:!1,isSubmitting:!1})},Ze=(g,x)=>cn(qt(g)?g(c):g,x);return{control:{register:qe,unregister:it,getFieldState:$t,handleSubmit:Pt,setError:Nt,_executeSchema:ae,_getWatch:ne,_getDirty:ee,_updateValid:V,_removeUnmounted:he,_updateFieldArray:k,_updateDisabledField:Zt,_getFieldArray:be,_reset:cn,_resetDefaultValues:()=>qt(s.defaultValues)&&s.defaultValues().then(g=>{Ze(g,s.resetOptions),C.state.next({isLoading:!1})}),_updateFormState:g=>{i={...i,...g}},_disableForm:fr,_subjects:C,_proxyFormState:w,_setErrors:j,get _fields(){return o},get _formValues(){return c},get _state(){return v},set _state(g){v=g},get _defaultValues(){return f},get _names(){return p},set _names(g){p=g},get _formState(){return i},set _formState(g){i=g},get _options(){return s},set _options(g){s={...s,...g}}},trigger:Qe,register:qe,handleSubmit:Pt,watch:je,setValue:ye,getValues:ke,reset:Ze,resetField:ln,clearErrors:fn,unregister:it,setError:Nt,setFocus:(g,x={})=>{const S=W(o,g),N=S&&S._f;if(N){const P=N.refs?N.refs[0]:N.ref;P.focus&&(P.focus(),x.shouldSelect&&qt(P.select)&&P.select())}},getFieldState:$t}}function bm(r={}){const s=L.useRef(),i=L.useRef(),[o,f]=L.useState({isDirty:!1,isValidating:!1,isLoading:qt(r.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:r.errors||{},disabled:r.disabled||!1,defaultValues:qt(r.defaultValues)?void 0:r.defaultValues});s.current||(s.current={...mm(r),formState:o});const c=s.current.control;return c._options=r,Ru({subject:c._subjects.state,next:v=>{ll(v,c._proxyFormState,c._updateFormState,!0)&&f({...c._formState})}}),L.useEffect(()=>c._disableForm(r.disabled),[c,r.disabled]),L.useEffect(()=>{if(c._proxyFormState.isDirty){const v=c._getDirty();v!==o.isDirty&&c._subjects.state.next({isDirty:v})}},[c,o.isDirty]),L.useEffect(()=>{r.values&&!xn(r.values,i.current)?(c._reset(r.values,c._options.resetOptions),i.current=r.values,f(v=>({...v}))):c._resetDefaultValues()},[r.values,c]),L.useEffect(()=>{r.errors&&c._setErrors(r.errors)},[r.errors,c]),L.useEffect(()=>{c._state.mount||(c._updateValid(),c._state.mount=!0),c._state.watch&&(c._state.watch=!1,c._subjects.state.next({...c._formState})),c._removeUnmounted()}),L.useEffect(()=>{r.shouldUnregister&&c._subjects.values.next({values:c._getWatch()})},[r.shouldUnregister,c]),L.useMemo(()=>({...s.current,formState:fl(o,c)}),[o,c])}const Ff=(r,s,i)=>{if(r&&"reportValidity"in r){const o=W(i,s);r.setCustomValidity(o&&o.message||""),r.reportValidity()}},wl=(r,s)=>{for(const i in s.fields){const o=s.fields[i];o&&o.ref&&"reportValidity"in o.ref?Ff(o.ref,i,r):o.refs&&o.refs.forEach(f=>Ff(f,i,r))}},wm=(r,s)=>{s.shouldUseNativeValidation&&wl(r,s);const i={};for(const o in r){const f=W(s.fields,o),c=Object.assign(r[o]||{},{ref:f&&f.ref});if(xm(s.names||Object.keys(r),o)){const v=Object.assign({},W(i,o));xe(v,"root",c),xe(i,o,v)}else xe(i,o,c)}return i},xm=(r,s)=>r.some(i=>i.startsWith(s+"."));function Am(r,s,i){return s===void 0&&(s={}),i===void 0&&(i={}),function(o,f,c){try{return Promise.resolve(function(v,p){try{var y=(s.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(r[i.mode==="sync"?"validateSync":"validate"](o,Object.assign({abortEarly:!1},s,{context:f}))).then(function(O){return c.shouldUseNativeValidation&&wl({},c),{values:i.raw?o:O,errors:{}}}))}catch(O){return p(O)}return y&&y.then?y.then(void 0,p):y}(0,function(v){if(!v.inner)throw v;return{values:{},errors:wm((p=v,y=!c.shouldUseNativeValidation&&c.criteriaMode==="all",(p.inner||[]).reduce(function(O,w){if(O[w.path]||(O[w.path]={message:w.message,type:w.type}),y){var C=O[w.path].types,M=C&&C[w.type];O[w.path]=pl(w.path,y,O,w.type,M?[].concat(M,w.message):w.message)}return O},{})),c)};var p,y}))}catch(v){return Promise.reject(v)}}}function Om({className:r,name:s,children:i,mode:o="onBlur",reValidateMode:f="onBlur",defaultValues:c,schema:v,formProps:p,onSubmit:y=()=>null,onChange:O}){const w=bm({mode:o,reValidateMode:f,defaultValues:c,resolver:v?Am(v):void 0});return L.useEffect(()=>{if(!O)return;const{unsubscribe:C}=w.watch(O);return C},[O,w.watch]),F.jsx(om,{...w,children:F.jsx("form",{className:Q.twJoin("bbn-form",r),name:s,onSubmit:w.handleSubmit(y),...p,children:i})})}function Vn({name:r,defaultValue:s,disabled:i=!1,autoFocus:o=!1,shouldUnregister:f=!1,validateOnMount:c=!0}){const{setFocus:v,trigger:p}=ar(),{field:y,fieldState:O}=am({name:r,defaultValue:s,disabled:i,shouldUnregister:f}),{invalid:w,isTouched:C,error:M}=O;return L.useEffect(()=>{c?p(r,{shouldFocus:o}):o&&v(r)},[r,c]),{...y,value:y.value,invalid:w&&C,error:(M==null?void 0:M.message)??""}}function Sm(r){const{getFieldState:s}=ar(),i=Lu({name:r});return Array.isArray(r)?r.map(f=>s(f,i)):s(r,i)}const Cm=/^-?\d*\.?\d*$/;function Em({name:r,id:s=r,label:i,hint:o,className:f,controlClassName:c,disabled:v,autoFocus:p,defaultValue:y,placeholder:O,type:w,suffix:C,prefix:M,shouldUnregister:B,state:U,validateOnMount:Y}){const{ref:V,value:G="",error:k,invalid:z,onChange:j,onBlur:H}=Vn({name:r,defaultValue:y,autoFocus:p,shouldUnregister:B,validateOnMount:Y}),X=z?"error":U,J=z?k:o,ae=ve=>{Cm.test(ve.target.value)&&j(ve.target.value)};return F.jsx($r,{label:i,className:c,state:X,hint:J,children:F.jsx(qi,{inputMode:"decimal",pattern:"^-?\\d*\\.?\\d*$",ref:V,value:G,id:s,name:r,type:w,className:f,disabled:v,autoFocus:p,placeholder:O,suffix:C,prefix:M,state:X,onChange:ae,onBlur:H})})}function Rm({name:r,id:s=r,label:i,hint:o,className:f,controlClassName:c,disabled:v,autoFocus:p,defaultValue:y,placeholder:O,type:w,suffix:C,prefix:M,shouldUnregister:B,state:U,validateOnMount:Y}){const{ref:V,value:G="",error:k,invalid:z,onChange:j,onBlur:H}=Vn({name:r,defaultValue:y,autoFocus:p,shouldUnregister:B,validateOnMount:Y}),X=z?"error":U,J=z?k:o;return F.jsx($r,{label:i,className:c,state:X,hint:J,children:F.jsx(qi,{ref:V,value:G,id:s,name:r,type:w,className:f,disabled:v,autoFocus:p,placeholder:O,suffix:C,prefix:M,state:X,onChange:j,onBlur:H})})}function Lm({name:r,id:s=r,label:i,className:o,disabled:f,value:c,defaultChecked:v,labelClassName:p,orientation:y}){const{ref:O,value:w=!1,onChange:C,onBlur:M}=Vn({name:r});return F.jsx(Mf,{ref:O,name:r,checked:w,id:s,label:i,className:o,disabled:f,value:c,defaultChecked:v,labelClassName:p,orientation:y,inputProps:{onChange:C,onBlur:M}})}function Tm({name:r,id:s=r,label:i,className:o,disabled:f,value:c,defaultChecked:v,labelClassName:p,orientation:y}){const{ref:O,value:w,onChange:C,onBlur:M}=Vn({name:r,disabled:f,defaultValue:v?c:void 0});return F.jsx(Wf,{ref:O,name:r,id:s,label:i,className:o,disabled:f,checked:w===c,value:c,labelClassName:p,orientation:y,inputProps:{onChange:C,onBlur:M}})}function Fm({open:r,defaultOpen:s,options:i,optionClassName:o,popoverClassName:f,name:c,id:v=c,label:p,hint:y,className:O,controlClassName:w,disabled:C,autoFocus:M,defaultValue:B,placeholder:U,shouldUnregister:Y,state:V,validateOnMount:G,onOpen:k,onClose:z,renderSelectedOption:j}){const{ref:H,value:X="",error:J,invalid:ae,onChange:ve,onBlur:fe}=Vn({name:c,defaultValue:B,autoFocus:M,shouldUnregister:Y,validateOnMount:G}),he=ae?"error":V,ee=ae?J:y,ne=()=>{fe==null||fe(),z==null||z()};return F.jsx($r,{label:p,className:w,state:he,hint:ee,children:F.jsx(Su,{open:r,defaultOpen:s,options:i,ref:H,value:X,id:v,name:c,className:O,disabled:C,placeholder:U,state:he,optionClassName:o,popoverClassName:f,onSelect:ve,onBlur:fe,onOpen:k,onClose:ne,renderSelectedOption:j})})}function Dm({displayError:r=!1,...s}){const{error:i,value:o,onChange:f,onBlur:c,disabled:v,name:p,ref:y}=Vn(s),O=F.jsx("input",{ref:y,type:"hidden",name:p,disabled:v,value:o,onChange:f,onBlur:c});if(r){const w=r?"error":"default",C=r?i:"";return F.jsx($r,{hint:C,state:w,children:O})}return O}const Im={adaptive:"adaptive",horizontal:"vertical",vertical:"horizontal"};function Nm({className:r,orientation:s="vertical",children:i}){return F.jsx("div",{className:Q.twMerge("bbn-list-legacy",`bbn-list-legacy-${s}`,r),children:L.Children.map(i,o=>L.isValidElement(o)?L.cloneElement(o,{orientation:Im[s]}):o)})}function Pm({className:r,orientation:s="horizontal",title:i,value:o,suffix:f}){return F.jsxs("div",{className:Q.twJoin("bbn-list-item-legacy",`bbn-list-item-legacy-${s}`,r),children:[F.jsx(on,{as:"div",className:Q.twJoin("bbn-list-title-legacy",`bbn-list-title-legacy-${s}`),variant:s==="horizontal"?"body1":"body2",children:i}),F.jsxs(on,{as:"div",className:Q.twJoin("bbn-list-value-legacy",`bbn-list-value-legacy-${s}`),variant:"body1",children:[o,f]})]})}exports.Accordion=n_;exports.AccordionDetails=s_;exports.AccordionSummary=r_;exports.Avatar=Pf;exports.AvatarGroup=u_;exports.Badge=im;exports.Button=Nf;exports.Card=Qy;exports.Cell=rl;exports.Checkbox=Mf;exports.CheckboxField=Lm;exports.Chip=jy;exports.Column=nl;exports.Dialog=Vy;exports.DialogBody=Hy;exports.DialogFooter=ky;exports.DialogHeader=$y;exports.Form=Om;exports.FormControl=$r;exports.Heading=gu;exports.HiddenField=Dm;exports.IconButton=pu;exports.Input=qi;exports.List=nm;exports.ListItem=rm;exports.ListItemLegacy=Pm;exports.ListLegacy=Nm;exports.Loader=qy;exports.MobileDialog=Uy;exports.NumberField=Em;exports.Popover=Kf;exports.Portal=ji;exports.Radio=Wf;exports.RadioField=Tm;exports.ScrollLocker=Wy;exports.Select=Su;exports.SelectField=Fm;exports.Table=Xy;exports.Text=on;exports.TextField=Rm;exports.Toggle=em;exports.useField=Vn;exports.useFieldState=Sm;exports.useFormContext=ar;exports.useFormState=Lu;exports.useWatch=hl;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),m=require("react"),A=require("tailwind-merge"),an=require("react-dom");function ln(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 $e=ln(m),gi=ln(an);function et({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 or=m.createContext({disabled:!1,expanded:!1});function bi({expanded:e,defaultExpanded:t,onChange:r,className:n,disabled:i=!1,children:s}){const[a=!1,o]=et({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(or.Provider,{value:f,children:c.jsx("div",{className:A.twJoin("bbn-accordion",i&&"bbn-accordion-disabled",n),children:s})})}const pt=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:A.twJoin("bbn-btn",`bbn-btn-${e}`,`bbn-btn-${r}`,`bbn-btn-${t}`,n&&"bbn-btn-fluid",i)}));pt.displayName="Button";const ar=({className:e,...t})=>c.jsx("button",{...t,className:A.twJoin("bbn-btn-icon",e)});function yi({className:e,iconClassName:t,children:r,renderIcon:n=()=>null}){const{expanded:i,toggle:s}=m.useContext(or),a=n(i);return c.jsxs("div",{className:A.twJoin("bbn-accordion-summary",e),onClick:s,children:[r,a&&c.jsx(ar,{className:A.twJoin("bbn-accordion-icon",t),children:a})]})}function lr(e,t){return typeof e!="number"?typeof t=="number"?lr(t):t:`${e}px`}function xi(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(lr(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 wi({unmountOnExit:e=!1,animationDuration:t=200,className:r,wrapperClassName:n,children:i}){const{expanded:s}=m.useContext(or),[a,o]=m.useState(s),l=a||!e,{height:f,ref:u}=xi(l);return m.useEffect(function(){if(s===a)return;if(s){o(!0);return}const b=setTimeout(o,t,!1);return()=>{clearTimeout(b)}},[s,a,t]),c.jsx("div",{className:A.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:A.twJoin("bbn-accordion-content",r),children:i}):null})}const q=m.forwardRef(({variant:e="body1",as:t="p",children:r,className:n,...i},s)=>m.createElement(t,{...i,ref:s,className:A.twJoin(`bbn-text-${e}`,n)},r));q.displayName="Text";const Bt=m.forwardRef(({variant:e,as:t=e,children:r,className:n,...i},s)=>m.createElement(t,{...i,ref:s,className:A.twJoin(`bbn-${e}`,n)},r));Bt.displayName="Heading";function cr({className:e,style:t,size:r="large",variant:n="circular",alt:i,url:s,children:a}){return c.jsx("div",{style:t,className:A.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 ji=({max:e=1/0,className:t,children:r,avatarClassName:n,variant:i,...s})=>{const a=m.Children.count(r);return c.jsxs("div",{className:A.twJoin("bbn-avatar-group",t),children:[m.Children.map(r,(o,l)=>m.isValidElement(o)&&l+1<=e?m.cloneElement(o,{...s,className:A.twMerge(n,o.props.className),variant:i}):null),a>e&&c.jsxs(cr,{size:s.size,variant:i,className:n,children:["+",a-e]})]})},cn=m.forwardRef(function({label:t,checked:r,defaultChecked:n=!1,inputProps:i,orientation:s="left",disabled:a=!1,className:o,inputType:l,labelClassName:f,renderIcon:u,onChange:d,...b},g){const[j=!1,y]=et({value:r,defaultValue:n,onStateChange:d});function x(C){var M;y(C.currentTarget.checked),(M=i==null?void 0:i.onChange)==null||M.call(i,C)}const L=c.jsxs("span",{className:A.twJoin("bbn-switcher",a&&"bbn-switcher-disabled",o),children:[u(j),c.jsx("input",{ref:g,type:l,disabled:a,className:"bbn-switcher-input",...b,...i,checked:j,onChange:x})]});return t?c.jsxs(q,{as:"label",variant:"body1",className:A.twJoin("bbn-switcher-label",s==="left"?"bbn-switcher-left":"bbn-switcher-right",f),children:[L,t]}):L}),Ni={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"})})},un=m.forwardRef(function(t,r){return c.jsx(cn,{ref:r,...t,inputType:"checkbox",renderIcon:n=>Ni[n.toString()]})}),Oi={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"})})},fn=m.forwardRef(function(t,r){return c.jsx(cn,{ref:r,...t,inputType:"radio",renderIcon:n=>Oi[n.toString()]})});var dn={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Vr=m.createContext&&m.createContext(dn),Ci=["attr","size","title"];function Ei(e,t){if(e==null)return{};var r=Si(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 Si(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 At(){return At=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},At.apply(this,arguments)}function Lr(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 _t(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Lr(Object(r),!0).forEach(function(n){ki(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Lr(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ki(e,t,r){return t=Fi(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Fi(e){var t=Ai(e,"string");return typeof t=="symbol"?t:t+""}function Ai(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function hn(e){return e&&e.map((t,r)=>m.createElement(t.tag,_t({key:r},t.attr),hn(t.child)))}function yt(e){return t=>m.createElement(_i,At({attr:_t({},e.attr)},t),hn(e.child))}function _i(e){var t=r=>{var{attr:n,size:i,title:s}=e,a=Ei(e,Ci),o=i||r.size||"1em",l;return r.className&&(l=r.className),e.className&&(l=(l?l+" ":"")+e.className),m.createElement("svg",At({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,a,{className:l,style:_t(_t({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 Vr!==void 0?m.createElement(Vr.Consumer,null,r=>t(r)):t(dn)}function Di(e){return yt({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M12 16L6 10H18L12 16Z"},child:[]}]})(e)}function Vi(e){return yt({tag:"svg",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 Li(e){return yt({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M12 8L18 14H6L12 8Z"},child:[]}]})(e)}var Mr=function(t){return t.reduce(function(r,n){var i=n[0],s=n[1];return r[i]=s,r},{})},Rr=typeof window<"u"&&window.document&&window.document.createElement?$e.useLayoutEffect:$e.useEffect,le="top",pe="bottom",me="right",ce="left",ur="auto",xt=[le,pe,me,ce],tt="start",mt="end",Mi="clippingParents",vn="viewport",lt="popper",Ri="reference",Tr=xt.reduce(function(e,t){return e.concat([t+"-"+tt,t+"-"+mt])},[]),pn=[].concat(xt,[ur]).reduce(function(e,t){return e.concat([t,t+"-"+tt,t+"-"+mt])},[]),Ti="beforeRead",Pi="read",Bi="afterRead",Ii="beforeMain",$i="main",Ui="afterMain",Wi="beforeWrite",Hi="write",Ji="afterWrite",qi=[Ti,Pi,Bi,Ii,$i,Ui,Wi,Hi,Ji];function ke(e){return e?(e.nodeName||"").toLowerCase():null}function he(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Je(e){var t=he(e).Element;return e instanceof t||e instanceof Element}function ve(e){var t=he(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function fr(e){if(typeof ShadowRoot>"u")return!1;var t=he(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function zi(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)||!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 Zi(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)||!ke(i)||(Object.assign(i.style,o),Object.keys(s).forEach(function(l){i.removeAttribute(l)}))})}}const Xi={name:"applyStyles",enabled:!0,phase:"write",fn:zi,effect:Zi,requires:["computeStyles"]};function Se(e){return e.split("-")[0]}var We=Math.max,Dt=Math.min,rt=Math.round;function nr(){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 mn(){return!/^((?!chrome|android).)*safari/i.test(nr())}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=Je(e)?he(e):window,o=a.visualViewport,l=!mn()&&r,f=(n.left+(l&&o?o.offsetLeft:0))/i,u=(n.top+(l&&o?o.offsetTop:0))/s,d=n.width/i,b=n.height/s;return{width:d,height:b,top:u,right:f+d,bottom:u+b,left:f,x:f,y:u}}function dr(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 gn(e,t){var r=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(r&&fr(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 he(e).getComputedStyle(e)}function Yi(e){return["table","td","th"].indexOf(ke(e))>=0}function Pe(e){return((Je(e)?e.ownerDocument:e.document)||window.document).documentElement}function It(e){return ke(e)==="html"?e:e.assignedSlot||e.parentNode||(fr(e)?e.host:null)||Pe(e)}function Pr(e){return!ve(e)||Le(e).position==="fixed"?null:e.offsetParent}function Gi(e){var t=/firefox/i.test(nr()),r=/Trident/i.test(nr());if(r&&ve(e)){var n=Le(e);if(n.position==="fixed")return null}var i=It(e);for(fr(i)&&(i=i.host);ve(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=he(e),r=Pr(e);r&&Yi(r)&&Le(r).position==="static";)r=Pr(r);return r&&(ke(r)==="html"||ke(r)==="body"&&Le(r).position==="static")?t:r||Gi(e)||t}function hr(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function ft(e,t,r){return We(e,Dt(t,r))}function Ki(e,t,r){var n=ft(e,t,r);return n>r?r:n}function bn(){return{top:0,right:0,bottom:0,left:0}}function yn(e){return Object.assign({},bn(),e)}function xn(e,t){return t.reduce(function(r,n){return r[n]=e,r},{})}var Qi=function(t,r){return t=typeof t=="function"?t(Object.assign({},r.rects,{placement:r.placement})):t,yn(typeof t!="number"?t:xn(t,xt))};function es(e){var t,r=e.state,n=e.name,i=e.options,s=r.elements.arrow,a=r.modifiersData.popperOffsets,o=Se(r.placement),l=hr(o),f=[ce,me].indexOf(o)>=0,u=f?"height":"width";if(!(!s||!a)){var d=Qi(i.padding,r),b=dr(s),g=l==="y"?le:ce,j=l==="y"?pe:me,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),C=L?l==="y"?L.clientHeight||0:L.clientWidth||0:0,M=y/2-x/2,D=d[g],_=C-b[u]-d[j],k=C/2-b[u]/2+M,E=ft(D,k,_),P=l;r.modifiersData[n]=(t={},t[P]=E,t.centerOffset=E-k,t)}}function ts(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)||gn(t.elements.popper,i)&&(t.elements.arrow=i))}const rs={name:"arrow",enabled:!0,phase:"main",fn:es,effect:ts,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function it(e){return e.split("-")[1]}var ns={top:"auto",right:"auto",bottom:"auto",left:"auto"};function is(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 Br(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,b=a.x,g=b===void 0?0:b,j=a.y,y=j===void 0?0:j,x=typeof u=="function"?u({x:g,y}):{x:g,y};g=x.x,y=x.y;var L=a.hasOwnProperty("x"),C=a.hasOwnProperty("y"),M=ce,D=le,_=window;if(f){var k=wt(r),E="clientHeight",P="clientWidth";if(k===he(r)&&(k=Pe(r),Le(k).position!=="static"&&o==="absolute"&&(E="scrollHeight",P="scrollWidth")),k=k,i===le||(i===ce||i===me)&&s===mt){D=pe;var U=d&&k===_&&_.visualViewport?_.visualViewport.height:k[E];y-=U-n.height,y*=l?1:-1}if(i===ce||(i===le||i===pe)&&s===mt){M=me;var I=d&&k===_&&_.visualViewport?_.visualViewport.width:k[P];g-=I-n.width,g*=l?1:-1}}var B=Object.assign({position:o},f&&ns),F=u===!0?is({x:g,y},he(r)):{x:g,y};if(g=F.x,y=F.y,l){var T;return Object.assign({},B,(T={},T[D]=C?"0":"",T[M]=L?"0":"",T.transform=(_.devicePixelRatio||1)<=1?"translate("+g+"px, "+y+"px)":"translate3d("+g+"px, "+y+"px, 0)",T))}return Object.assign({},B,(t={},t[D]=C?y+"px":"",t[M]=L?g+"px":"",t.transform="",t))}function ss(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:Se(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,Br(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,Br(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 os={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:ss,data:{}};var Ct={passive:!0};function as(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=he(t.elements.popper),f=[].concat(t.scrollParents.reference,t.scrollParents.popper);return s&&f.forEach(function(u){u.addEventListener("scroll",r.update,Ct)}),o&&l.addEventListener("resize",r.update,Ct),function(){s&&f.forEach(function(u){u.removeEventListener("scroll",r.update,Ct)}),o&&l.removeEventListener("resize",r.update,Ct)}}const ls={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:as,data:{}};var cs={left:"right",right:"left",bottom:"top",top:"bottom"};function St(e){return e.replace(/left|right|bottom|top/g,function(t){return cs[t]})}var us={start:"end",end:"start"};function Ir(e){return e.replace(/start|end/g,function(t){return us[t]})}function vr(e){var t=he(e),r=t.pageXOffset,n=t.pageYOffset;return{scrollLeft:r,scrollTop:n}}function pr(e){return nt(Pe(e)).left+vr(e).scrollLeft}function fs(e,t){var r=he(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=mn();(f||!f&&t==="fixed")&&(o=i.offsetLeft,l=i.offsetTop)}return{width:s,height:a,x:o+pr(e),y:l}}function ds(e){var t,r=Pe(e),n=vr(e),i=(t=e.ownerDocument)==null?void 0:t.body,s=We(r.scrollWidth,r.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=We(r.scrollHeight,r.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),o=-n.scrollLeft+pr(e),l=-n.scrollTop;return Le(i||r).direction==="rtl"&&(o+=We(r.clientWidth,i?i.clientWidth:0)-s),{width:s,height:a,x:o,y:l}}function mr(e){var t=Le(e),r=t.overflow,n=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(r+i+n)}function wn(e){return["html","body","#document"].indexOf(ke(e))>=0?e.ownerDocument.body:ve(e)&&mr(e)?e:wn(It(e))}function dt(e,t){var r;t===void 0&&(t=[]);var n=wn(e),i=n===((r=e.ownerDocument)==null?void 0:r.body),s=he(n),a=i?[s].concat(s.visualViewport||[],mr(n)?n:[]):n,o=t.concat(a);return i?o:o.concat(dt(It(a)))}function ir(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function hs(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 $r(e,t,r){return t===vn?ir(fs(e,r)):Je(t)?hs(t,r):ir(ds(Pe(e)))}function vs(e){var t=dt(It(e)),r=["absolute","fixed"].indexOf(Le(e).position)>=0,n=r&&ve(e)?wt(e):e;return Je(n)?t.filter(function(i){return Je(i)&&gn(i,n)&&ke(i)!=="body"}):[]}function ps(e,t,r,n){var i=t==="clippingParents"?vs(e):[].concat(t),s=[].concat(i,[r]),a=s[0],o=s.reduce(function(l,f){var u=$r(e,f,n);return l.top=We(u.top,l.top),l.right=Dt(u.right,l.right),l.bottom=Dt(u.bottom,l.bottom),l.left=We(u.left,l.left),l},$r(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 jn(e){var t=e.reference,r=e.element,n=e.placement,i=n?Se(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 pe: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?hr(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?Mi:o,f=r.rootBoundary,u=f===void 0?vn:f,d=r.elementContext,b=d===void 0?lt:d,g=r.altBoundary,j=g===void 0?!1:g,y=r.padding,x=y===void 0?0:y,L=yn(typeof x!="number"?x:xn(x,xt)),C=b===lt?Ri:lt,M=e.rects.popper,D=e.elements[j?C:b],_=ps(Je(D)?D:D.contextElement||Pe(e.elements.popper),l,u,a),k=nt(e.elements.reference),E=jn({reference:k,element:M,strategy:"absolute",placement:i}),P=ir(Object.assign({},M,E)),U=b===lt?P:k,I={top:_.top-U.top+L.top,bottom:U.bottom-_.bottom+L.bottom,left:_.left-U.left+L.left,right:U.right-_.right+L.right},B=e.modifiersData.offset;if(b===lt&&B){var F=B[i];Object.keys(I).forEach(function(T){var H=[me,pe].indexOf(T)>=0?1:-1,X=[le,pe].indexOf(T)>=0?"y":"x";I[T]+=F[X]*H})}return I}function ms(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?pn:l,u=it(n),d=u?o?Tr:Tr.filter(function(j){return it(j)===u}):xt,b=d.filter(function(j){return f.indexOf(j)>=0});b.length===0&&(b=d);var g=b.reduce(function(j,y){return j[y]=gt(e,{placement:y,boundary:i,rootBoundary:s,padding:a})[Se(y)],j},{});return Object.keys(g).sort(function(j,y){return g[j]-g[y]})}function gs(e){if(Se(e)===ur)return[];var t=St(e);return[Ir(e),t,Ir(t)]}function bs(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,b=r.altBoundary,g=r.flipVariations,j=g===void 0?!0:g,y=r.allowedAutoPlacements,x=t.options.placement,L=Se(x),C=L===x,M=l||(C||!j?[St(x)]:gs(x)),D=[x].concat(M).reduce(function(Ae,je){return Ae.concat(Se(je)===ur?ms(t,{placement:je,boundary:u,rootBoundary:d,padding:f,flipVariations:j,allowedAutoPlacements:y}):je)},[]),_=t.rects.reference,k=t.rects.popper,E=new Map,P=!0,U=D[0],I=0;I<D.length;I++){var B=D[I],F=Se(B),T=it(B)===tt,H=[le,pe].indexOf(F)>=0,X=H?"width":"height",z=gt(t,{placement:B,boundary:u,rootBoundary:d,altBoundary:b,padding:f}),Y=H?T?me:ce:T?pe:le;_[X]>k[X]&&(Y=St(Y));var xe=St(Y),ue=[];if(s&&ue.push(z[F]<=0),o&&ue.push(z[Y]<=0,z[xe]<=0),ue.every(function(Ae){return Ae})){U=B,P=!1;break}E.set(B,ue)}if(P)for(var we=j?3:1,Xe=function(je){var _e=D.find(function(Be){var be=E.get(Be);if(be)return be.slice(0,je).every(function(Ge){return Ge})});if(_e)return U=_e,"break"},Me=we;Me>0;Me--){var Ye=Xe(Me);if(Ye==="break")break}t.placement!==U&&(t.modifiersData[n]._skip=!0,t.placement=U,t.reset=!0)}}const ys={name:"flip",enabled:!0,phase:"main",fn:bs,requiresIfExists:["offset"],data:{_skip:!1}};function Ur(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 Wr(e){return[le,me,pe,ce].some(function(t){return e[t]>=0})}function xs(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=Ur(a,n),f=Ur(o,i,s),u=Wr(l),d=Wr(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 ws={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:xs};function js(e,t,r){var n=Se(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 Ns(e){var t=e.state,r=e.options,n=e.name,i=r.offset,s=i===void 0?[0,0]:i,a=pn.reduce(function(u,d){return u[d]=js(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 Os={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Ns};function Cs(e){var t=e.state,r=e.name;t.modifiersData[r]=jn({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const Es={name:"popperOffsets",enabled:!0,phase:"read",fn:Cs,data:{}};function Ss(e){return e==="x"?"y":"x"}function ks(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,b=r.tether,g=b===void 0?!0:b,j=r.tetherOffset,y=j===void 0?0:j,x=gt(t,{boundary:l,rootBoundary:f,padding:d,altBoundary:u}),L=Se(t.placement),C=it(t.placement),M=!C,D=hr(L),_=Ss(D),k=t.modifiersData.popperOffsets,E=t.rects.reference,P=t.rects.popper,U=typeof y=="function"?y(Object.assign({},t.rects,{placement:t.placement})):y,I=typeof U=="number"?{mainAxis:U,altAxis:U}:Object.assign({mainAxis:0,altAxis:0},U),B=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,F={x:0,y:0};if(k){if(s){var T,H=D==="y"?le:ce,X=D==="y"?pe:me,z=D==="y"?"height":"width",Y=k[D],xe=Y+x[H],ue=Y-x[X],we=g?-P[z]/2:0,Xe=C===tt?E[z]:P[z],Me=C===tt?-P[z]:-E[z],Ye=t.elements.arrow,Ae=g&&Ye?dr(Ye):{width:0,height:0},je=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:bn(),_e=je[H],Be=je[X],be=ft(0,E[z],Ae[z]),Ge=M?E[z]/2-we-be-_e-I.mainAxis:Xe-be-_e-I.mainAxis,qt=M?-E[z]/2+we+be+Be+I.mainAxis:Me+be+Be+I.mainAxis,Ke=t.elements.arrow&&wt(t.elements.arrow),zt=Ke?D==="y"?Ke.clientTop||0:Ke.clientLeft||0:0,at=(T=B==null?void 0:B[D])!=null?T:0,Ot=Y+Ge-at-zt,Ar=Y+qt-at,Zt=ft(g?Dt(xe,Ot):xe,Y,g?We(ue,Ar):ue);k[D]=Zt,F[D]=Zt-Y}if(o){var Xt,h=D==="x"?le:ce,v=D==="x"?pe:me,p=k[_],S=_==="y"?"height":"width",N=p+x[h],w=p-x[v],R=[le,ce].indexOf(L)!==-1,$=(Xt=B==null?void 0:B[_])!=null?Xt:0,Q=R?N:p-E[S]-P[S]-$+I.altAxis,ee=R?p+E[S]+P[S]-$-I.altAxis:w,Ne=g&&R?Ki(Q,p,ee):ft(g?Q:N,p,g?ee:w);k[_]=Ne,F[_]=Ne-p}t.modifiersData[n]=F}}const Fs={name:"preventOverflow",enabled:!0,phase:"main",fn:ks,requiresIfExists:["offset"]};function As(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function _s(e){return e===he(e)||!ve(e)?vr(e):As(e)}function Ds(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 Vs(e,t,r){r===void 0&&(r=!1);var n=ve(t),i=ve(t)&&Ds(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"||mr(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 Ls(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 Ms(e){var t=Ls(e);return qi.reduce(function(r,n){return r.concat(t.filter(function(i){return i.phase===n}))},[])}function Rs(e){var t;return function(){return t||(t=new Promise(function(r){Promise.resolve().then(function(){t=void 0,r(e())})})),t}}function Ts(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 Hr={placement:"bottom",modifiers:[],strategy:"absolute"};function Jr(){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 Ps(e){e===void 0&&(e={});var t=e,r=t.defaultModifiers,n=r===void 0?[]:r,i=t.defaultOptions,s=i===void 0?Hr:i;return function(o,l,f){f===void 0&&(f=s);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},Hr,s),modifiersData:{},elements:{reference:o,popper:l},attributes:{},styles:{}},d=[],b=!1,g={state:u,setOptions:function(L){var C=typeof L=="function"?L(u.options):L;y(),u.options=Object.assign({},s,u.options,C),u.scrollParents={reference:Je(o)?dt(o):o.contextElement?dt(o.contextElement):[],popper:dt(l)};var M=Ms(Ts([].concat(n,u.options.modifiers)));return u.orderedModifiers=M.filter(function(D){return D.enabled}),j(),g.update()},forceUpdate:function(){if(!b){var L=u.elements,C=L.reference,M=L.popper;if(Jr(C,M)){u.rects={reference:Vs(C,wt(M),u.options.strategy==="fixed"),popper:dr(M)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(I){return u.modifiersData[I.name]=Object.assign({},I.data)});for(var D=0;D<u.orderedModifiers.length;D++){if(u.reset===!0){u.reset=!1,D=-1;continue}var _=u.orderedModifiers[D],k=_.fn,E=_.options,P=E===void 0?{}:E,U=_.name;typeof k=="function"&&(u=k({state:u,options:P,name:U,instance:g})||u)}}}},update:Rs(function(){return new Promise(function(x){g.forceUpdate(),x(u)})}),destroy:function(){y(),b=!0}};if(!Jr(o,l))return g;g.setOptions(f).then(function(x){!b&&f.onFirstUpdate&&f.onFirstUpdate(x)});function j(){u.orderedModifiers.forEach(function(x){var L=x.name,C=x.options,M=C===void 0?{}:C,D=x.effect;if(typeof D=="function"){var _=D({state:u,name:L,instance:g,options:M}),k=function(){};d.push(_||k)}})}function y(){d.forEach(function(x){return x()}),d=[]}return g}}var Bs=[ls,Es,os,Xi,Os,ys,Fs,rs,ws],Is=Ps({defaultModifiers:Bs}),Et=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Nn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var $s=typeof Element<"u",Us=typeof Map=="function",Ws=typeof Set=="function",Hs=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function kt(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(!kt(e[n],t[n]))return!1;return!0}var s;if(Us&&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(!kt(n.value[1],t.get(n.value[0])))return!1;return!0}if(Ws&&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(Hs&&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($s&&e instanceof Element)return!1;for(n=r;n--!==0;)if(!((i[n]==="_owner"||i[n]==="__v"||i[n]==="__o")&&e.$$typeof)&&!kt(e[i[n]],t[i[n]]))return!1;return!0}return e!==e&&t!==t}var Js=function(t,r){try{return kt(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 qs=Nn(Js);var zs=[],Zs=function(t,r,n){n===void 0&&(n={});var i=$e.useRef(null),s={onFirstUpdate:n.onFirstUpdate,placement:n.placement||"bottom",strategy:n.strategy||"absolute",modifiers:n.modifiers||zs},a=$e.useState({styles:{popper:{position:s.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),o=a[0],l=a[1],f=$e.useMemo(function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(g){var j=g.state,y=Object.keys(j.elements);gi.flushSync(function(){l({styles:Mr(y.map(function(x){return[x,j.styles[x]||{}]})),attributes:Mr(y.map(function(x){return[x,j.attributes[x]]}))})})},requires:["computeStyles"]}},[]),u=$e.useMemo(function(){var b={onFirstUpdate:s.onFirstUpdate,placement:s.placement,strategy:s.strategy,modifiers:[].concat(s.modifiers,[f,{name:"applyStyles",enabled:!1}])};return qs(i.current,b)?i.current||b:(i.current=b,b)},[s.onFirstUpdate,s.placement,s.strategy,s.modifiers,f]),d=$e.useRef();return Rr(function(){d.current&&d.current.setOptions(u)},[u]),Rr(function(){if(!(t==null||r==null)){var b=n.createPopper||Is,g=b(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 $t({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?an.createPortal(e,n):null}function Xs(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 Ys(e){const t=m.useRef(e);return Xs(t.current,e)||(t.current=e),t.current}function Gs(e,t=()=>null,{enabled:r=!0}={}){const n=Array.isArray(e)?e:[e],i=Ys(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 gr({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}=Zs(r,l,{placement:n,modifiers:[{name:"offset",options:{offset:i}}]});return Gs([l,r],o,{enabled:e}),c.jsx($t,{mounted:e,children:c.jsx("div",{ref:f,style:{...u.popper,...a},className:A.twJoin("bbn-popover",t),children:s})})}function Ks(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 Qs=e=>e.label,br=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:b,onClose:g,renderSelectedOption:j=Qs,...y},x)=>{const L=m.useRef(null);m.useImperativeHandle(x,()=>L.current,[]);const{width:C}=Ks(L.current),[M,D]=et({value:s,defaultValue:a,onStateChange:B=>void(B?d==null?void 0:d():g==null?void 0:g())}),[_,k]=et({value:r,defaultValue:n,onStateChange:b}),E=m.useMemo(()=>o.find(B=>B.value===_),[o,_]),P=m.useCallback(B=>{k(B.value),D(!1)},[k,D]),U=m.useCallback(()=>{D(!1)},[D]),I=m.useCallback(()=>{e||D(!M)},[M,e,D]);return c.jsxs(c.Fragment,{children:[c.jsxs("div",{ref:L,className:A.twJoin("bbn-select",e&&"bbn-select-disabled",`bbn-select-${u}`,t),onClick:I,tabIndex:e?-1:0,...y,children:[c.jsx("span",{children:E?j(E):i}),c.jsx(Vi,{className:A.twJoin("bbn-select-icon",M&&"bbn-select-icon-open"),size:20})]}),c.jsx(gr,{anchorEl:L.current,className:A.twJoin("bbn-select-menu custom-scrollbar",f),open:M&&!e,onClickOutside:U,offset:[0,4],placement:"bottom-start",style:{width:C},children:o.map(B=>c.jsx("div",{className:A.twJoin("bbn-select-option",(E==null?void 0:E.value)===B.value&&"bbn-select-option-selected",l),onClick:()=>P(B),children:B.label},B.value))})]})});br.displayName="Select";const Ut=m.forwardRef(({className:e,prefix:t,suffix:r,disabled:n=!1,state:i="default",...s},a)=>c.jsxs("div",{className:A.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:A.twJoin("bbn-input-field",e),disabled:n,...s}),r&&c.jsx("div",{className:"bbn-input-suffix",children:r})]}));Ut.displayName="Input";function jt({children:e,label:t,hint:r,state:n="default",className:i}){return c.jsxs("div",{className:A.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:A.twJoin("bbn-form-control-hint",`bbn-form-control-hint-${n}`),children:r})]})}const On=m.createContext({removeDialog:()=>null,updateDialog:()=>null});function eo({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?lr(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(On.Provider,{value:a,children:e})}function Cn({open:e=!1}={}){const t=m.useId(),[r,n]=m.useState(e),{updateDialog:i,removeDialog:s}=m.useContext(On),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 En=({open:e=!1,...t})=>c.jsx("div",{...t,className:A.twJoin("bbn-backdrop",e?"animate-backdrop-in":"animate-backdrop-out",t.className)}),Sn=({children:e,open:t=!1,className:r,onClose:n,hasBackdrop:i=!0,backdropClassName:s,dialogClassName:a,...o})=>{const{mounted:l,unmount:f}=Cn({open:t});return c.jsxs($t,{mounted:l,children:[c.jsx("div",{...o,className:A.twJoin("bbn-dialog-wrapper",r),children:c.jsx("div",{className:A.twJoin("bbn-dialog",t?"animate-modal-in":"animate-modal-out",a),onAnimationEnd:f,children:e})}),i&&c.jsx(En,{className:s,open:t,onClick:n})]})},kn=({children:e,open:t=!1,className:r,onClose:n,...i})=>{const{mounted:s,unmount:a}=Cn({open:t});return c.jsxs($t,{mounted:s,children:[c.jsx("div",{...i,className:A.twJoin("bbn-dialog-mobile",t?"animate-mobile-modal-in":"animate-mobile-modal-out",r),onAnimationEnd:a,children:e}),c.jsx(En,{open:t,onClick:n})]})},Fn=({className:e,children:t,title:r,onClose:n})=>c.jsxs("div",{className:A.twJoin("bbn-dialog-header",e),children:[c.jsxs("div",{className:"bbn-dialog-title",children:[c.jsx(Bt,{variant:"h5",children:r}),!!n&&c.jsx(ar,{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]}),An=e=>c.jsx("div",{...e,className:A.twJoin("bbn-dialog-body",e.className)}),_n=e=>c.jsx("div",{...e,className:A.twJoin("bbn-dialog-footer",e.className)});function to({className:e,...t}){return c.jsx("span",{...t,className:A.twJoin("bbn-chip",e)})}function ro({size:e=40,className:t}){return c.jsx("span",{className:A.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 Dn="Expected a function",qr=NaN,no="[object Symbol]",io=/^\s+|\s+$/g,so=/^[-+]0x[0-9a-f]+$/i,oo=/^0b[01]+$/i,ao=/^0o[0-7]+$/i,lo=parseInt,co=typeof Et=="object"&&Et&&Et.Object===Object&&Et,uo=typeof self=="object"&&self&&self.Object===Object&&self,fo=co||uo||Function("return this")(),ho=Object.prototype,vo=ho.toString,po=Math.max,mo=Math.min,Kt=function(){return fo.Date.now()};function go(e,t,r){var n,i,s,a,o,l,f=0,u=!1,d=!1,b=!0;if(typeof e!="function")throw new TypeError(Dn);t=zr(t)||0,Vt(r)&&(u=!!r.leading,d="maxWait"in r,s=d?po(zr(r.maxWait)||0,t):s,b="trailing"in r?!!r.trailing:b);function g(k){var E=n,P=i;return n=i=void 0,f=k,a=e.apply(P,E),a}function j(k){return f=k,o=setTimeout(L,t),u?g(k):a}function y(k){var E=k-l,P=k-f,U=t-E;return d?mo(U,s-P):U}function x(k){var E=k-l,P=k-f;return l===void 0||E>=t||E<0||d&&P>=s}function L(){var k=Kt();if(x(k))return C(k);o=setTimeout(L,y(k))}function C(k){return o=void 0,b&&n?g(k):(n=i=void 0,a)}function M(){o!==void 0&&clearTimeout(o),f=0,n=l=i=o=void 0}function D(){return o===void 0?a:C(Kt())}function _(){var k=Kt(),E=x(k);if(n=arguments,i=this,l=k,E){if(o===void 0)return j(l);if(d)return o=setTimeout(L,t),g(l)}return o===void 0&&(o=setTimeout(L,t)),a}return _.cancel=M,_.flush=D,_}function bo(e,t,r){var n=!0,i=!0;if(typeof e!="function")throw new TypeError(Dn);return Vt(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),go(e,t,{leading:n,maxWait:t,trailing:i})}function Vt(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function yo(e){return!!e&&typeof e=="object"}function xo(e){return typeof e=="symbol"||yo(e)&&vo.call(e)==no}function zr(e){if(typeof e=="number")return e;if(xo(e))return qr;if(Vt(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Vt(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(io,"");var r=oo.test(e);return r||ao.test(e)?lo(e.slice(2),r?2:8):so.test(e)?qr:+e}var wo=bo;const Vn=Nn(wo);function jo(e,{onLoadMore:t,hasMore:r=!1,loading:n=!1}={}){const[i,s]=m.useState(!1);return m.useEffect(()=>{const a=Vn(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 Ln=m.createContext({data:[],columns:[],sortStates:{},onColumnSort:void 0,onRowSelect:void 0});function Mn({name:e,className:t,children:r,sorter:n,...i}){const{columns:s,sortStates:a,onColumnSort:o}=m.useContext(Ln),l=a[e??""],f=l==null?void 0:l.direction;return c.jsx(q,{variant:"caption",as:"th",className:A.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(Li,{className:A.twJoin("bbn-sort-icon bbn-sort-icon-up",f==="asc"?"bbn-sort-icon-active":"bbn-sort-icon-inactive")}),c.jsx(Di,{className:A.twJoin("bbn-sort-icon bbn-sort-icon-down",f==="desc"?"bbn-sort-icon-active":"bbn-sort-icon-inactive")})]})]})})}function No(e,t){const[r,n]=m.useState({}),i=m.useCallback((a,o)=>{o&&n(l=>{var b;const f=((b=l[a])==null?void 0:b.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,j])=>[g,{...j,priority:j.priority>l[a].priority?j.priority-1:j.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 Rn({className:e,render:t,value:r,columnName:n,...i}){return c.jsx(q,{variant:"body2",as:"td",className:A.twJoin("bbn-cell-left",e),"data-column":n,...i,children:t?t(r):r})}function Oo({row:e,columns:t,isSelected:r,isSelectable:n,onSelect:i}){return c.jsx("tr",{className:A.twJoin(r&&"selected",!!i&&n&&"cursor-pointer",!n&&"opacity-50"),onClick:()=>i(e),children:t.map(s=>c.jsx(Rn,{value:e[s.key],columnName:s.key,className:s.cellClassName,render:s.render?a=>s.render(a,e):void 0},s.key))})}function Co({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,...b},g){const j=m.useRef(null);m.useImperativeHandle(g,()=>j.current,[]);const{sortStates:y,handleColumnSort:x,sortedData:L}=No(e,t),{isScrolledTop:C}=jo(j,{onLoadMore:a,hasMore:i,loading:s}),[M,D]=et({value:f,defaultValue:u??null,onStateChange:d}),_=m.useCallback(E=>{if(!o||l&&!l(E))return;const P=M===E.id?null:E.id;D(P),o(P===null?null:E)},[o,l,M,D]),k=m.useMemo(()=>({data:L,columns:t,sortStates:y,onColumnSort:x,onRowSelect:_}),[L,t,y,x,_]);return c.jsx(Ln.Provider,{value:k,children:c.jsx("div",{ref:j,className:A.twJoin("bbn-table-wrapper",n),children:c.jsxs("table",{className:A.twJoin("bbn-table",r),...b,children:[c.jsx("thead",{className:A.twJoin("bbn-table-header",C&&"scrolled-top"),children:c.jsx("tr",{children:t.map(E=>c.jsx(Mn,{className:E.headerClassName,name:E.key,sorter:E.sorter,children:E.header},E.key))})}),c.jsx("tbody",{className:"bbn-table-body",children:L.map(E=>c.jsx(Oo,{row:E,columns:t,isSelected:M===E.id,isSelectable:l?l(E):!0,onSelect:_},E.id))})]})})})}const Eo=m.forwardRef(Co);function Tn({as:e="div",className:t,children:r}){return m.createElement(e,{className:A.twJoin("bbn-card",t)},r)}function So(e){const[t=!1,r]=et({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:A.twJoin("bbn-toggle-control",t&&"bbn-toggle-control-active")}),c.jsx("span",{className:"bbn-toggle-bg",children:e.inactiveIcon})]})}const ko={adaptive:"adaptive",horizontal:"vertical",vertical:"horizontal"};function Fo({className:e,orientation:t="vertical",children:r}){return c.jsx("div",{className:A.twMerge("bbn-list",`bbn-list-${t}`,e),children:m.Children.map(r,n=>m.isValidElement(n)?m.cloneElement(n,{orientation:ko[t]}):n)})}function Ao({className:e,orientation:t="horizontal",title:r,value:n,suffix:i}){return c.jsxs("div",{className:A.twJoin("bbn-list-item",`bbn-list-item-${t}`,e),children:[c.jsx(q,{as:"div",className:A.twJoin("bbn-list-title",`bbn-list-title-${t}`),variant:t==="horizontal"?"body1":"body2",children:r}),c.jsxs(q,{as:"div",className:A.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}`,d=`bbn-badge-${i}`;return c.jsxs("div",{className:A.twJoin("bbn-badge",s),children:[e,l&&c.jsx("span",{className:A.twJoin("bbn-badge-indicator",u,d,a),children:c.jsx("span",{className:A.twJoin("bbn-badge-content",o),children:f})})]})}const Wt=({children:e,style:t,className:r})=>c.jsx("div",{className:A.twJoin("flex rounded bg-secondary-highlight p-4 text-accent-primary",r),style:t,children:e}),Do={lg:{logo:"size-10",subLogo:"text-[0.8rem]"},md:{logo:"size-6",subLogo:"text-[0.5rem]"},sm:{logo:"size-5",subLogo:"text-[0.4rem]"}},Pn=({logoUrl:e,rank:t,moniker:r,size:n="md",className:i})=>{const[s,a]=m.useState(!1),o=Do[n],l=(r==null?void 0:r.charAt(0).toUpperCase())??String(t);return c.jsx("span",{className:A.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(q,{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 Vo(e){return yt({tag:"svg",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 Bn({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:A.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(Vo,{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 In=m.createContext(void 0),yr=()=>{const e=m.useContext(In);return!e&&process.env.NODE_ENV==="development"&&console.warn("useMenuContext must be used within a Menu component"),e},Lo=({children:e,value:t})=>c.jsx(In.Provider,{value:t,children:e}),xr=({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 b={left:"text-left",center:"text-center",right:"text-right"};return 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:A.twJoin("transform transition-transform duration-300 ease-in-out","bg-[#FFFFFF] dark:bg-[#252525]",o?A.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:A.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:A.twJoin("flex-1 text-sm font-medium text-accent-primary",f?"ml-3":"",b[s]),children:r})]}),c.jsx("div",{className:"flex-1 overflow-y-auto",children:n})]})]})};function Mo(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=Vn(s,t),s(),window.addEventListener("resize",i.current),()=>{i.current&&(window.removeEventListener("resize",i.current),i.current.cancel())}),[s,t]),r}const Ro=({children:e,trigger:t,open:r,onOpenChange:n,placement:i="bottom-end",offset:s=[0,8],className:a})=>{const[o,l]=m.useState(!1),f=m.useRef(null),u=Mo(),d=r!==void 0?r:o,b=x=>{r===void 0&&l(x),n==null||n(x)},g=()=>b(!1),j=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:()=>b(!d),children:"Menu"});return c.jsxs(Lo,{value:{isOpen:d,setIsOpen:b,onClose:g,isMobile:u},children:[c.jsx("div",{ref:f,className:"inline-block",children:m.isValidElement(y)&&m.cloneElement(y,{onClick:()=>b(!d),"aria-haspopup":"true","aria-expanded":d})}),u?c.jsx(xr,{isOpen:d,onClose:g,onBackdropClick:g,fullHeight:!0,fullWidth:!0,showBackButton:!0,showDivider:!1,children:j}):c.jsx(gr,{anchorEl:f.current,open:d,offset:s,placement:i,onClickOutside:g,className:A.twJoin("rounded-lg border border-[#38708533] bg-[#FFFFFF] shadow-lg dark:border-[#404040] dark:bg-[#252525]","min-w-[294px]",a),children:j})]})},To=({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=yr(),d=()=>{i||!n||(n(),u&&!o&&u.onClose())};return a?c.jsx("button",{onClick:d,disabled:i,className:A.twJoin("w-full text-left",i&&"cursor-not-allowed opacity-50",s),children:a}):c.jsxs("button",{onClick:d,disabled:i,className:A.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]})},Po=({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=yr(),b=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:A.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(xr,{isOpen:f,onClose:()=>u(!1),title:t||"",titleAlign:l,backIcon:i||b,fullHeight:d==null?void 0:d.isMobile,fullWidth:d==null?void 0:d.isMobile,onBackdropClick:d!=null&&d.isMobile?void 0:()=>u(!1),className:A.twJoin(d!=null&&d.isMobile?"z-60":"z-50",o),children:e})]})},Bo=({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:A.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",Ue=e=>e instanceof Date,se=e=>e==null;const $n=e=>typeof e=="object";var te=e=>!se(e)&&!Array.isArray(e)&&$n(e)&&!Ue(e),Un=e=>te(e)&&e.target?Nt(e.target)?e.target.checked:e.target.value:e,Io=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,Wn=(e,t)=>e.has(Io(t)),$o=e=>{const t=e.constructor&&e.constructor.prototype;return te(t)&&t.hasOwnProperty("isPrototypeOf")},wr=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function oe(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(e instanceof Set)t=new Set(e);else if(!(wr&&(e instanceof Blob||n))&&(r||te(e)))if(t=r?[]:{},!r&&!$o(e))t=e;else for(const i in e)e.hasOwnProperty(i)&&(t[i]=oe(e[i]));else return e;return t}var Ht=e=>Array.isArray(e)?e.filter(Boolean):[],K=e=>e===void 0,O=(e,t,r)=>{if(!t||!te(e))return r;const n=Ht(t.split(/[,[\].]+?/)).reduce((i,s)=>se(i)?i:i[s],e);return K(n)||n===e?K(e[t])?r:e[t]:n},fe=e=>typeof e=="boolean",jr=e=>/^\w*$/.test(e),Hn=e=>Ht(e.replace(/["|']|\]/g,"").split(/\.|\[/)),W=(e,t,r)=>{let n=-1;const i=jr(t)?[t]:Hn(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=te(f)||Array.isArray(f)?f:isNaN(+i[n+1])?{}:[]}if(o==="__proto__"||o==="constructor"||o==="prototype")return;e[o]=l,e=e[o]}return e};const Lt={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},ye={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},De={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Jn=m.createContext(null),ze=()=>m.useContext(Jn),Uo=e=>{const{children:t,...r}=e;return m.createElement(Jn.Provider,{value:r},t)};var qn=(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},ae=e=>te(e)&&!Object.keys(e).length,zn=(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))},ht=e=>Array.isArray(e)?e:[e],Zn=(e,t,r)=>!e||!t||e===t||ht(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n)));function Nr(e){const t=m.useRef(e);t.current=e,m.useEffect(()=>{const r=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{r&&r.unsubscribe()}},[e.disabled])}function Or(e){const t=ze(),{control:r=t.control,disabled:n,name:i,exact:s}=e||{},[a,o]=m.useState(r._formState),l=m.useRef(!0),f=m.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),u=m.useRef(i);return u.current=i,Nr({disabled:n,next:d=>l.current&&Zn(u.current,d.name,s)&&zn(d,f.current,r._updateFormState)&&o({...r._formState,...d}),subject:r._subjects.state}),m.useEffect(()=>(l.current=!0,f.current.isValid&&r._updateValid(!0),()=>{l.current=!1}),[r]),m.useMemo(()=>qn(a,r,f.current,!1),[a,r])}var Ce=e=>typeof e=="string",Xn=(e,t,r,n,i)=>Ce(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 Cr(e){const t=ze(),{control:r=t.control,name:n,defaultValue:i,disabled:s,exact:a}=e||{},o=m.useRef(n);o.current=n,Nr({disabled:s,subject:r._subjects.values,next:u=>{Zn(o.current,u.name,a)&&f(oe(Xn(o.current,r._names,u.values||r._formValues,!1,i)))}});const[l,f]=m.useState(r._getWatch(n,i));return m.useEffect(()=>r._removeUnmounted()),l}function Wo(e){const t=ze(),{name:r,disabled:n,control:i=t.control,shouldUnregister:s}=e,a=Wn(i._names.array,r),o=Cr({control:i,name:r,defaultValue:O(i._formValues,r,O(i._defaultValues,r,e.defaultValue)),exact:!0}),l=Or({control:i,name:r,exact:!0}),f=m.useRef(i.register(r,{...e.rules,value:o,...fe(e.disabled)?{disabled:e.disabled}:{}})),u=m.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]),d=m.useMemo(()=>({name:r,value:o,...fe(n)||l.disabled?{disabled:l.disabled||n}:{},onChange:b=>f.current.onChange({target:{value:Un(b),name:r},type:Lt.CHANGE}),onBlur:()=>f.current.onBlur({target:{value:O(i._formValues,r),name:r},type:Lt.BLUR}),ref:b=>{const g=O(i._fields,r);g&&b&&(g._f.ref={focus:()=>b.focus(),select:()=>b.select(),setCustomValidity:j=>b.setCustomValidity(j),reportValidity:()=>b.reportValidity()})}}),[r,i._formValues,n,l.disabled,o,i._fields]);return m.useEffect(()=>{const b=i._options.shouldUnregister||s,g=(j,y)=>{const x=O(i._fields,j);x&&x._f&&(x._f.mount=y)};if(g(r,!0),b){const j=oe(O(i._options.defaultValues,r));W(i._defaultValues,r,j),K(O(i._formValues,r))&&W(i._formValues,r,j)}return()=>{(a?b&&!i._state.action:b)?i.unregister(r):g(r,!1)}},[r,i,a,s]),m.useEffect(()=>{fe(n)&&O(i._fields,r)&&i._updateDisabledField({disabled:n,fields:i._fields,name:r,value:O(i._fields,r)._f.value})},[n,r,i]),m.useMemo(()=>({field:d,formState:l,fieldState:u}),[d,l,u])}var Yn=(e,t,r,n,i)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:i||!0}}:{},Zr=e=>({isOnSubmit:!e||e===ye.onSubmit,isOnBlur:e===ye.onBlur,isOnChange:e===ye.onChange,isOnAll:e===ye.all,isOnTouch:e===ye.onTouched}),Xr=(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=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(vt(o,t))break}else if(te(o)&&vt(o,t))break}}};var Ho=(e,t,r)=>{const n=ht(O(e,r));return W(n,"root",t[r]),W(e,r,n),e},Er=e=>e.type==="file",Oe=e=>typeof e=="function",Mt=e=>{if(!wr)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Ft=e=>Ce(e),Sr=e=>e.type==="radio",Rt=e=>e instanceof RegExp;const Yr={value:!1,isValid:!1},Gr={value:!0,isValid:!0};var Gn=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&&!K(e[0].attributes.value)?K(e[0].value)||e[0].value===""?Gr:{value:e[0].value,isValid:!0}:Gr:Yr}return Yr};const Kr={isValid:!1,value:null};var Kn=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,Kr):Kr;function Qr(e,t,r="validate"){if(Ft(e)||Array.isArray(e)&&e.every(Ft)||fe(e)&&!e)return{type:r,message:Ft(e)?e:"",ref:t}}var Qe=e=>te(e)&&!Rt(e)?e:{value:e,message:""},en=async(e,t,r,n,i)=>{const{ref:s,refs:a,required:o,maxLength:l,minLength:f,min:u,max:d,pattern:b,validate:g,name:j,valueAsNumber:y,mount:x,disabled:L}=e._f,C=O(t,j);if(!x||L)return{};const M=a?a[0]:s,D=F=>{n&&M.reportValidity&&(M.setCustomValidity(fe(F)?"":F||""),M.reportValidity())},_={},k=Sr(s),E=Nt(s),P=k||E,U=(y||Er(s))&&K(s.value)&&K(C)||Mt(s)&&s.value===""||C===""||Array.isArray(C)&&!C.length,I=Yn.bind(null,j,r,_),B=(F,T,H,X=De.maxLength,z=De.minLength)=>{const Y=F?T:H;_[j]={type:F?X:z,message:Y,ref:s,...I(F?X:z,Y)}};if(i?!Array.isArray(C)||!C.length:o&&(!P&&(U||se(C))||fe(C)&&!C||E&&!Gn(a).isValid||k&&!Kn(a).isValid)){const{value:F,message:T}=Ft(o)?{value:!!o,message:o}:Qe(o);if(F&&(_[j]={type:De.required,message:T,ref:M,...I(De.required,T)},!r))return D(T),_}if(!U&&(!se(u)||!se(d))){let F,T;const H=Qe(d),X=Qe(u);if(!se(C)&&!isNaN(C)){const z=s.valueAsNumber||C&&+C;se(H.value)||(F=z>H.value),se(X.value)||(T=z<X.value)}else{const z=s.valueAsDate||new Date(C),Y=we=>new Date(new Date().toDateString()+" "+we),xe=s.type=="time",ue=s.type=="week";Ce(H.value)&&C&&(F=xe?Y(C)>Y(H.value):ue?C>H.value:z>new Date(H.value)),Ce(X.value)&&C&&(T=xe?Y(C)<Y(X.value):ue?C<X.value:z<new Date(X.value))}if((F||T)&&(B(!!F,H.message,X.message,De.max,De.min),!r))return D(_[j].message),_}if((l||f)&&!U&&(Ce(C)||i&&Array.isArray(C))){const F=Qe(l),T=Qe(f),H=!se(F.value)&&C.length>+F.value,X=!se(T.value)&&C.length<+T.value;if((H||X)&&(B(H,F.message,T.message),!r))return D(_[j].message),_}if(b&&!U&&Ce(C)){const{value:F,message:T}=Qe(b);if(Rt(F)&&!C.match(F)&&(_[j]={type:De.pattern,message:T,ref:s,...I(De.pattern,T)},!r))return D(T),_}if(g){if(Oe(g)){const F=await g(C,t),T=Qr(F,M);if(T&&(_[j]={...T,...I(De.validate,T.message)},!r))return D(T.message),_}else if(te(g)){let F={};for(const T in g){if(!ae(F)&&!r)break;const H=Qr(await g[T](C,t),M,T);H&&(F={...H,...I(T,H.message)},D(H.message),r&&(_[j]=F))}if(!ae(F)&&(_[j]={ref:M,...F},!r))return _}}return D(!0),_};function Jo(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=K(e)?n++:e[t[n++]];return e}function qo(e){for(const t in e)if(e.hasOwnProperty(t)&&!K(e[t]))return!1;return!0}function ne(e,t){const r=Array.isArray(t)?t:jr(t)?[t]:Hn(t),n=r.length===1?e:Jo(e,r),i=r.length-1,s=r[i];return n&&delete n[s],i!==0&&(te(n)&&ae(n)||Array.isArray(n)&&qo(n))&&ne(e,r.slice(0,-1)),e}var Qt=()=>{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=[]}}},sr=e=>se(e)||!$n(e);function Te(e,t){if(sr(e)||sr(t))return e===t;if(Ue(e)&&Ue(t))return e.getTime()===t.getTime();const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(const i of r){const s=e[i];if(!n.includes(i))return!1;if(i!=="ref"){const a=t[i];if(Ue(s)&&Ue(a)||te(s)&&te(a)||Array.isArray(s)&&Array.isArray(a)?!Te(s,a):s!==a)return!1}}return!0}var Qn=e=>e.type==="select-multiple",zo=e=>Sr(e)||Nt(e),er=e=>Mt(e)&&e.isConnected,ei=e=>{for(const t in e)if(Oe(e[t]))return!0;return!1};function Tt(e,t={}){const r=Array.isArray(e);if(te(e)||r)for(const n in e)Array.isArray(e[n])||te(e[n])&&!ei(e[n])?(t[n]=Array.isArray(e[n])?[]:{},Tt(e[n],t[n])):se(e[n])||(t[n]=!0);return t}function ti(e,t,r){const n=Array.isArray(e);if(te(e)||n)for(const i in e)Array.isArray(e[i])||te(e[i])&&!ei(e[i])?K(t)||sr(r[i])?r[i]=Array.isArray(e[i])?Tt(e[i],[]):{...Tt(e[i])}:ti(e[i],se(t)?{}:t[i],r[i]):r[i]=!Te(e[i],t[i]);return r}var ct=(e,t)=>ti(e,t,Tt(t)),ri=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>K(e)?e:t?e===""?NaN:e&&+e:r&&Ce(e)?new Date(e):n?n(e):e;function tr(e){const t=e.ref;if(!(e.refs?e.refs.every(r=>r.disabled):t.disabled))return Er(t)?t.files:Sr(t)?Kn(e.refs).value:Qn(t)?[...t.selectedOptions].map(({value:r})=>r):Nt(t)?Gn(e.refs).value:ri(K(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&&W(i,s,a._f)}return{criteriaMode:r,names:[...e],fields:i,shouldUseNativeValidation:n}},ut=e=>K(e)?e:Rt(e)?e.source:te(e)?Rt(e.value)?e.value.source:e.value:e;const tn="AsyncFunction";var Xo=e=>!!e&&!!e.validate&&!!(Oe(e.validate)&&e.validate.constructor.name===tn||te(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===tn)),Yo=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function rn(e,t,r){const n=O(e,r);if(n||jr(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};i.pop()}return{name:r}}var Go=(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,Ko=(e,t)=>!Ht(O(e,t)).length&&ne(e,t);const Qo={mode:ye.onSubmit,reValidateMode:ye.onChange,shouldFocusError:!0};function ea(e={}){let t={...Qo,...e},r={submitCount:0,isDirty:!1,isLoading:Oe(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},n={},i=te(t.defaultValues)||te(t.values)?oe(t.defaultValues||t.values)||{}:{},s=t.shouldUnregister?{}:oe(i),a={action:!1,mount:!1,watch:!1},o={mount: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},d={values:Qt(),array:Qt(),state:Qt()},b=Zr(t.mode),g=Zr(t.reValidateMode),j=t.criteriaMode===ye.all,y=h=>v=>{clearTimeout(f),f=setTimeout(h,v)},x=async h=>{if(!t.disabled&&(u.isValid||h)){const v=t.resolver?ae((await P()).errors):await I(n,!0);v!==r.isValid&&d.state.next({isValid:v})}},L=(h,v)=>{!t.disabled&&(u.isValidating||u.validatingFields)&&((h||Array.from(o.mount)).forEach(p=>{p&&(v?W(r.validatingFields,p,v):ne(r.validatingFields,p))}),d.state.next({validatingFields:r.validatingFields,isValidating:!ae(r.validatingFields)}))},C=(h,v=[],p,S,N=!0,w=!0)=>{if(S&&p&&!t.disabled){if(a.action=!0,w&&Array.isArray(O(n,h))){const R=p(O(n,h),S.argA,S.argB);N&&W(n,h,R)}if(w&&Array.isArray(O(r.errors,h))){const R=p(O(r.errors,h),S.argA,S.argB);N&&W(r.errors,h,R),Ko(r.errors,h)}if(u.touchedFields&&w&&Array.isArray(O(r.touchedFields,h))){const R=p(O(r.touchedFields,h),S.argA,S.argB);N&&W(r.touchedFields,h,R)}u.dirtyFields&&(r.dirtyFields=ct(i,s)),d.state.next({name:h,isDirty:F(h,v),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else W(s,h,v)},M=(h,v)=>{W(r.errors,h,v),d.state.next({errors:r.errors})},D=h=>{r.errors=h,d.state.next({errors:r.errors,isValid:!1})},_=(h,v,p,S)=>{const N=O(n,h);if(N){const w=O(s,h,K(p)?O(i,h):p);K(w)||S&&S.defaultChecked||v?W(s,h,v?w:tr(N._f)):X(h,w),a.mount&&x()}},k=(h,v,p,S,N)=>{let w=!1,R=!1;const $={name:h};if(!t.disabled){const Q=!!(O(n,h)&&O(n,h)._f&&O(n,h)._f.disabled);if(!p||S){u.isDirty&&(R=r.isDirty,r.isDirty=$.isDirty=F(),w=R!==$.isDirty);const ee=Q||Te(O(i,h),v);R=!!(!Q&&O(r.dirtyFields,h)),ee||Q?ne(r.dirtyFields,h):W(r.dirtyFields,h,!0),$.dirtyFields=r.dirtyFields,w=w||u.dirtyFields&&R!==!ee}if(p){const ee=O(r.touchedFields,h);ee||(W(r.touchedFields,h,p),$.touchedFields=r.touchedFields,w=w||u.touchedFields&&ee!==p)}w&&N&&d.state.next($)}return w?$:{}},E=(h,v,p,S)=>{const N=O(r.errors,h),w=u.isValid&&fe(v)&&r.isValid!==v;if(t.delayError&&p?(l=y(()=>M(h,p)),l(t.delayError)):(clearTimeout(f),l=null,p?W(r.errors,h,p):ne(r.errors,h)),(p?!Te(N,p):N)||!ae(S)||w){const R={...S,...w&&fe(v)?{isValid:v}:{},errors:r.errors,name:h};r={...r,...R},d.state.next(R)}},P=async h=>{L(h,!0);const v=await t.resolver(s,t.context,Zo(h||o.mount,n,t.criteriaMode,t.shouldUseNativeValidation));return L(h),v},U=async h=>{const{errors:v}=await P(h);if(h)for(const p of h){const S=O(v,p);S?W(r.errors,p,S):ne(r.errors,p)}else r.errors=v;return v},I=async(h,v,p={valid:!0})=>{for(const S in h){const N=h[S];if(N){const{_f:w,...R}=N;if(w){const $=o.array.has(w.name),Q=N._f&&Xo(N._f);Q&&u.validatingFields&&L([S],!0);const ee=await en(N,s,j,t.shouldUseNativeValidation&&!v,$);if(Q&&u.validatingFields&&L([S]),ee[w.name]&&(p.valid=!1,v))break;!v&&(O(ee,w.name)?$?Ho(r.errors,ee,w.name):W(r.errors,w.name,ee[w.name]):ne(r.errors,w.name))}!ae(R)&&await I(R,v,p)}}return p.valid},B=()=>{for(const h of o.unMount){const v=O(n,h);v&&(v._f.refs?v._f.refs.every(p=>!er(p)):!er(v._f.ref))&&_e(h)}o.unMount=new Set},F=(h,v)=>!t.disabled&&(h&&v&&W(s,h,v),!Te(Xe(),i)),T=(h,v,p)=>Xn(h,o,{...a.mount?s:K(v)?i:Ce(h)?{[h]:v}:v},p,v),H=h=>Ht(O(a.mount?s:i,h,t.shouldUnregister?O(i,h,[]):[])),X=(h,v,p={})=>{const S=O(n,h);let N=v;if(S){const w=S._f;w&&(!w.disabled&&W(s,h,ri(v,w)),N=Mt(w.ref)&&se(v)?"":v,Qn(w.ref)?[...w.ref.options].forEach(R=>R.selected=N.includes(R.value)):w.refs?Nt(w.ref)?w.refs.length>1?w.refs.forEach(R=>(!R.defaultChecked||!R.disabled)&&(R.checked=Array.isArray(N)?!!N.find($=>$===R.value):N===R.value)):w.refs[0]&&(w.refs[0].checked=!!N):w.refs.forEach(R=>R.checked=R.value===N):Er(w.ref)?w.ref.value="":(w.ref.value=N,w.ref.type||d.values.next({name:h,values:{...s}})))}(p.shouldDirty||p.shouldTouch)&&k(h,N,p.shouldTouch,p.shouldDirty,!0),p.shouldValidate&&we(h)},z=(h,v,p)=>{for(const S in v){const N=v[S],w=`${h}.${S}`,R=O(n,w);(o.array.has(h)||te(N)||R&&!R._f)&&!Ue(N)?z(w,N,p):X(w,N,p)}},Y=(h,v,p={})=>{const S=O(n,h),N=o.array.has(h),w=oe(v);W(s,h,w),N?(d.array.next({name:h,values:{...s}}),(u.isDirty||u.dirtyFields)&&p.shouldDirty&&d.state.next({name:h,dirtyFields:ct(i,s),isDirty:F(h,w)})):S&&!S._f&&!se(w)?z(h,w,p):X(h,w,p),Xr(h,o)&&d.state.next({...r}),d.values.next({name:a.mount?h:void 0,values:{...s}})},xe=async h=>{a.mount=!0;const v=h.target;let p=v.name,S=!0;const N=O(n,p),w=()=>v.type?tr(N._f):Un(h),R=$=>{S=Number.isNaN($)||Ue($)&&isNaN($.getTime())||Te($,O(s,p,$))};if(N){let $,Q;const ee=w(),Ne=h.type===Lt.BLUR||h.type===Lt.FOCUS_OUT,vi=!Yo(N._f)&&!t.resolver&&!O(r.errors,p)&&!N._f.deps||Go(Ne,O(r.touchedFields,p),r.isSubmitted,g,b),Yt=Xr(p,o,Ne);W(s,p,ee),Ne?(N._f.onBlur&&N._f.onBlur(h),l&&l(0)):N._f.onChange&&N._f.onChange(h);const Gt=k(p,ee,Ne,!1),pi=!ae(Gt)||Yt;if(!Ne&&d.values.next({name:p,type:h.type,values:{...s}}),vi)return u.isValid&&(t.mode==="onBlur"?Ne&&x():x()),pi&&d.state.next({name:p,...Yt?{}:Gt});if(!Ne&&Yt&&d.state.next({...r}),t.resolver){const{errors:_r}=await P([p]);if(R(ee),S){const mi=rn(r.errors,n,p),Dr=rn(_r,n,mi.name||p);$=Dr.error,p=Dr.name,Q=ae(_r)}}else L([p],!0),$=(await en(N,s,j,t.shouldUseNativeValidation))[p],L([p]),R(ee),S&&($?Q=!1:u.isValid&&(Q=await I(n,!0)));S&&(N._f.deps&&we(N._f.deps),E(p,Q,$,Gt))}},ue=(h,v)=>{if(O(r.errors,v)&&h.focus)return h.focus(),1},we=async(h,v={})=>{let p,S;const N=ht(h);if(t.resolver){const w=await U(K(h)?h:N);p=ae(w),S=h?!N.some(R=>O(w,R)):p}else h?(S=(await Promise.all(N.map(async w=>{const R=O(n,w);return await I(R&&R._f?{[w]:R}:R)}))).every(Boolean),!(!S&&!r.isValid)&&x()):S=p=await I(n);return d.state.next({...!Ce(h)||u.isValid&&p!==r.isValid?{}:{name:h},...t.resolver||!h?{isValid:p}:{},errors:r.errors}),v.shouldFocus&&!S&&vt(n,ue,h?N:o.mount),S},Xe=h=>{const v={...a.mount?s:i};return K(h)?v:Ce(h)?O(v,h):h.map(p=>O(v,p))},Me=(h,v)=>({invalid:!!O((v||r).errors,h),isDirty:!!O((v||r).dirtyFields,h),error:O((v||r).errors,h),isValidating:!!O(r.validatingFields,h),isTouched:!!O((v||r).touchedFields,h)}),Ye=h=>{h&&ht(h).forEach(v=>ne(r.errors,v)),d.state.next({errors:h?r.errors:{}})},Ae=(h,v,p)=>{const S=(O(n,h,{_f:{}})._f||{}).ref,N=O(r.errors,h)||{},{ref:w,message:R,type:$,...Q}=N;W(r.errors,h,{...Q,...v,ref:S}),d.state.next({name:h,errors:r.errors,isValid:!1}),p&&p.shouldFocus&&S&&S.focus&&S.focus()},je=(h,v)=>Oe(h)?d.values.subscribe({next:p=>h(T(void 0,v),p)}):T(h,v,!0),_e=(h,v={})=>{for(const p of h?ht(h):o.mount)o.mount.delete(p),o.array.delete(p),v.keepValue||(ne(n,p),ne(s,p)),!v.keepError&&ne(r.errors,p),!v.keepDirty&&ne(r.dirtyFields,p),!v.keepTouched&&ne(r.touchedFields,p),!v.keepIsValidating&&ne(r.validatingFields,p),!t.shouldUnregister&&!v.keepDefaultValue&&ne(i,p);d.values.next({values:{...s}}),d.state.next({...r,...v.keepDirty?{isDirty:F()}:{}}),!v.keepIsValid&&x()},Be=({disabled:h,name:v,field:p,fields:S,value:N})=>{if(fe(h)&&a.mount||h){const w=h?void 0:K(N)?tr(p?p._f:O(S,v)._f):N;(h||!h&&!K(w))&&W(s,v,w),k(v,w,!1,!1,!0)}},be=(h,v={})=>{let p=O(n,h);const S=fe(v.disabled)||fe(t.disabled);return W(n,h,{...p||{},_f:{...p&&p._f?p._f:{ref:{name:h}},name:h,mount:!0,...v}}),o.mount.add(h),p?Be({field:p,disabled:fe(v.disabled)?v.disabled:t.disabled,name:h,value:v.value}):_(h,!0,v.value),{...S?{disabled:v.disabled||t.disabled}:{},...t.progressive?{required:!!v.required,min:ut(v.min),max:ut(v.max),minLength:ut(v.minLength),maxLength:ut(v.maxLength),pattern:ut(v.pattern)}:{},name:h,onChange:xe,onBlur:xe,ref:N=>{if(N){be(h,v),p=O(n,h);const w=K(N.value)&&N.querySelectorAll&&N.querySelectorAll("input,select,textarea")[0]||N,R=zo(w),$=p._f.refs||[];if(R?$.find(Q=>Q===w):w===p._f.ref)return;W(n,h,{_f:{...p._f,...R?{refs:[...$.filter(er),w,...Array.isArray(O(i,h))?[{}]:[]],ref:{type:w.type,name:h}}:{ref:w}}}),_(h,!1,void 0,w)}else p=O(n,h,{}),p._f&&(p._f.mount=!1),(t.shouldUnregister||v.shouldUnregister)&&!(Wn(o.array,h)&&a.action)&&o.unMount.add(h)}}},Ge=()=>t.shouldFocusError&&vt(n,ue,o.mount),qt=h=>{fe(h)&&(d.state.next({disabled:h}),vt(n,(v,p)=>{const S=O(n,p);S&&(v.disabled=S._f.disabled||h,Array.isArray(S._f.refs)&&S._f.refs.forEach(N=>{N.disabled=S._f.disabled||h}))},0,!1))},Ke=(h,v)=>async p=>{let S;if(p&&(p.preventDefault&&p.preventDefault(),p.persist&&p.persist()),t.disabled){v&&await v({...r.errors},p);return}let N=oe(s);if(d.state.next({isSubmitting:!0}),t.resolver){const{errors:w,values:R}=await P();r.errors=w,N=R}else await I(n);if(ne(r.errors,"root"),ae(r.errors)){d.state.next({errors:{}});try{await h(N,p)}catch(w){S=w}}else v&&await v({...r.errors},p),Ge(),setTimeout(Ge);if(d.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:ae(r.errors)&&!S,submitCount:r.submitCount+1,errors:r.errors}),S)throw S},zt=(h,v={})=>{O(n,h)&&(K(v.defaultValue)?Y(h,oe(O(i,h))):(Y(h,v.defaultValue),W(i,h,oe(v.defaultValue))),v.keepTouched||ne(r.touchedFields,h),v.keepDirty||(ne(r.dirtyFields,h),r.isDirty=v.defaultValue?F(h,oe(O(i,h))):F()),v.keepError||(ne(r.errors,h),u.isValid&&x()),d.state.next({...r}))},at=(h,v={})=>{const p=h?oe(h):i,S=oe(p),N=ae(h),w=N?i:S;if(v.keepDefaultValues||(i=p),!v.keepValues){if(v.keepDirtyValues){const R=new Set([...o.mount,...Object.keys(ct(i,s))]);for(const $ of Array.from(R))O(r.dirtyFields,$)?W(w,$,O(s,$)):Y($,O(w,$))}else{if(wr&&K(h))for(const R of o.mount){const $=O(n,R);if($&&$._f){const Q=Array.isArray($._f.refs)?$._f.refs[0]:$._f.ref;if(Mt(Q)){const ee=Q.closest("form");if(ee){ee.reset();break}}}}n={}}s=t.shouldUnregister?v.keepDefaultValues?oe(i):{}:oe(w),d.array.next({values:{...w}}),d.values.next({values:{...w}})}o={mount:v.keepDirtyValues?o.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!u.isValid||!!v.keepIsValid||!!v.keepDirtyValues,a.watch=!!t.shouldUnregister,d.state.next({submitCount:v.keepSubmitCount?r.submitCount:0,isDirty:N?!1:v.keepDirty?r.isDirty:!!(v.keepDefaultValues&&!Te(h,i)),isSubmitted:v.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:N?{}:v.keepDirtyValues?v.keepDefaultValues&&s?ct(i,s):r.dirtyFields:v.keepDefaultValues&&h?ct(i,h):v.keepDirty?r.dirtyFields:{},touchedFields:v.keepTouched?r.touchedFields:{},errors:v.keepErrors?r.errors:{},isSubmitSuccessful:v.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},Ot=(h,v)=>at(Oe(h)?h(s):h,v);return{control:{register:be,unregister:_e,getFieldState:Me,handleSubmit:Ke,setError:Ae,_executeSchema:P,_getWatch:T,_getDirty:F,_updateValid:x,_removeUnmounted:B,_updateFieldArray:C,_updateDisabledField:Be,_getFieldArray:H,_reset:at,_resetDefaultValues:()=>Oe(t.defaultValues)&&t.defaultValues().then(h=>{Ot(h,t.resetOptions),d.state.next({isLoading:!1})}),_updateFormState:h=>{r={...r,...h}},_disableForm:qt,_subjects:d,_proxyFormState:u,_setErrors:D,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},set _formState(h){r=h},get _options(){return t},set _options(h){t={...t,...h}}},trigger:we,register:be,handleSubmit:Ke,watch:je,setValue:Y,getValues:Xe,reset:Ot,resetField:zt,clearErrors:Ye,unregister:_e,setError:Ae,setFocus:(h,v={})=>{const p=O(n,h),S=p&&p._f;if(S){const N=S.refs?S.refs[0]:S.ref;N.focus&&(N.focus(),v.shouldSelect&&Oe(N.select)&&N.select())}},getFieldState:Me}}function ta(e={}){const t=m.useRef(),r=m.useRef(),[n,i]=m.useState({isDirty:!1,isValidating:!1,isLoading:Oe(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:Oe(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...ea(e),formState:n});const s=t.current.control;return s._options=e,Nr({subject:s._subjects.state,next:a=>{zn(a,s._proxyFormState,s._updateFormState,!0)&&i({...s._formState})}}),m.useEffect(()=>s._disableForm(e.disabled),[s,e.disabled]),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&&!Te(e.values,r.current)?(s._reset(e.values,s._options.resetOptions),r.current=e.values,i(a=>({...a}))):s._resetDefaultValues()},[e.values,s]),m.useEffect(()=>{e.errors&&s._setErrors(e.errors)},[e.errors,s]),m.useEffect(()=>{s._state.mount||(s._updateValid(),s._state.mount=!0),s._state.watch&&(s._state.watch=!1,s._subjects.state.next({...s._formState})),s._removeUnmounted()}),m.useEffect(()=>{e.shouldUnregister&&s._subjects.values.next({values:s._getWatch()})},[e.shouldUnregister,s]),m.useMemo(()=>({...t.current,formState:qn(n,s)}),[n,s])}const nn=(e,t,r)=>{if(e&&"reportValidity"in e){const n=O(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},ni=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?nn(n.ref,r,e):n.refs&&n.refs.forEach(i=>nn(i,r,e))}},ra=(e,t)=>{t.shouldUseNativeValidation&&ni(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(na(t.names||Object.keys(e),n)){const a=Object.assign({},O(r,n));W(a,"root",s),W(r,n,a)}else W(r,n,s)}return r},na=(e,t)=>e.some(r=>r.startsWith(t+"."));function ia(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&&ni({},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:ra((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,b=d&&d[u.type];f[u.path]=Yn(u.path,l,f,u.type,b?[].concat(b,u.message):u.message)}return f},{})),s)};var o,l}))}catch(a){return Promise.reject(a)}}}function sa({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=ta({mode:n,reValidateMode:i,defaultValues:s,resolver:a?ia(a):void 0});return m.useEffect(()=>{if(!f)return;const{unsubscribe:d}=u.watch(f);return d},[f,u.watch]),c.jsx(Uo,{...u,children:c.jsx("form",{className:A.twJoin("bbn-form",e),name:t,onSubmit:u.handleSubmit(l),...o,children:r})})}function Ze({name:e,defaultValue:t,disabled:r=!1,autoFocus:n=!1,shouldUnregister:i=!1,validateOnMount:s=!0}){const{setFocus:a,trigger:o}=ze(),{field:l,fieldState:f}=Wo({name:e,defaultValue:t,disabled:r,shouldUnregister:i}),{invalid:u,isTouched:d,error:b}=f;return m.useEffect(()=>{s?o(e,{shouldFocus:n}):n&&a(e)},[e,s]),{...l,value:l.value,invalid:u&&d,error:(b==null?void 0:b.message)??""}}function oa(e){const{getFieldState:t}=ze(),r=Or({name:e});return Array.isArray(e)?e.map(i=>t(i,r)):t(e,r)}const aa=/^-?\d*\.?\d*$/;function la({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:b,shouldUnregister:g,state:j,validateOnMount:y}){const{ref:x,value:L="",error:C,invalid:M,onChange:D,onBlur:_}=Ze({name:e,defaultValue:l,autoFocus:o,shouldUnregister:g,validateOnMount:y}),k=M?"error":j,E=M?C:n,P=U=>{aa.test(U.target.value)&&D(U.target.value)};return c.jsx(jt,{label:r,className:s,state:k,hint:E,children:c.jsx(Ut,{inputMode:"decimal",pattern:"^-?\\d*\\.?\\d*$",ref:x,value:L,id:t,name:e,type:u,className:i,disabled:a,autoFocus:o,placeholder:f,suffix:d,prefix:b,state:k,onChange:P,onBlur:_})})}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:b,shouldUnregister:g,state:j,validateOnMount:y}){const{ref:x,value:L="",error:C,invalid:M,onChange:D,onBlur:_}=Ze({name:e,defaultValue:l,autoFocus:o,shouldUnregister:g,validateOnMount:y}),k=M?"error":j,E=M?C:n;return c.jsx(jt,{label:r,className:s,state:k,hint:E,children:c.jsx(Ut,{ref:x,value:L,id:t,name:e,type:u,className:i,disabled:a,autoFocus:o,placeholder:f,suffix:d,prefix:b,state:k,onChange:D,onBlur:_})})}function ua({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:b}=Ze({name:e});return c.jsx(un,{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:b}})}function fa({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:b}=Ze({name:e,disabled:i,defaultValue:a?s:void 0});return c.jsx(fn,{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:b}})}function da({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:b,defaultValue:g,placeholder:j,shouldUnregister:y,state:x,validateOnMount:L,onOpen:C,onClose:M,renderSelectedOption:D}){const{ref:_,value:k="",error:E,invalid:P,onChange:U,onBlur:I}=Ze({name:s,defaultValue:g,autoFocus:b,shouldUnregister:y,validateOnMount:L}),B=P?"error":x,F=P?E:l,T=()=>{I==null||I(),M==null||M()};return c.jsx(jt,{label:o,className:u,state:B,hint:F,children:c.jsx(br,{open:e,defaultOpen:t,options:r,ref:_,value:k,id:a,name:s,className:f,disabled:d,placeholder:j,state:B,optionClassName:n,popoverClassName:i,onSelect:U,onBlur:I,onOpen:C,onClose:T,renderSelectedOption:D})})}function ii({displayError:e=!1,...t}){const{error:r,value:n,onChange:i,onBlur:s,disabled:a,name:o,ref:l}=Ze(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(jt,{hint:d,state:u,children:f})}return f}var st=1e9,ha={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},Fr,G=!0,ge="[DecimalError] ",He=ge+"Invalid argument: ",kr=ge+"Exponent out of range: ",ot=Math.floor,Ie=Math.pow,va=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,de,ie=1e7,Z=7,si=9007199254740991,Pt=ot(si/Z),V={};V.absoluteValue=V.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};V.comparedTo=V.cmp=function(e){var t,r,n,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};V.decimalPlaces=V.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*Z;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};V.dividedBy=V.div=function(e){return Ve(this,new this.constructor(e))};V.dividedToIntegerBy=V.idiv=function(e){var t=this,r=t.constructor;return J(Ve(t,new r(e),0,1),r.precision)};V.equals=V.eq=function(e){return!this.cmp(e)};V.exponent=function(){return re(this)};V.greaterThan=V.gt=function(e){return this.cmp(e)>0};V.greaterThanOrEqualTo=V.gte=function(e){return this.cmp(e)>=0};V.isInteger=V.isint=function(){return this.e>this.d.length-2};V.isNegative=V.isneg=function(){return this.s<0};V.isPositive=V.ispos=function(){return this.s>0};V.isZero=function(){return this.s===0};V.lessThan=V.lt=function(e){return this.cmp(e)<0};V.lessThanOrEqualTo=V.lte=function(e){return this.cmp(e)<1};V.logarithm=V.log=function(e){var t,r=this,n=r.constructor,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(de))throw Error(ge+"NaN");if(r.s<1)throw Error(ge+(r.s?"NaN":"-Infinity"));return r.eq(de)?new n(0):(G=!1,t=Ve(bt(r,s),bt(e,s),s),G=!0,J(t,i))};V.minus=V.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?li(t,e):oi(t,(e.s=-e.s,e))};V.modulo=V.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?(G=!1,t=Ve(r,e,0,1).times(e),G=!0,r.minus(t)):J(new n(r),i)};V.naturalExponential=V.exp=function(){return ai(this)};V.naturalLogarithm=V.ln=function(){return bt(this)};V.negated=V.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};V.plus=V.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?oi(t,e):li(t,(e.s=-e.s,e))};V.precision=V.sd=function(e){var t,r,n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(He+e);if(t=re(i)+1,n=i.d.length-1,r=n*Z+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};V.squareRoot=V.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),G=!1,i=Math.sqrt(+o),i==0||i==1/0?(t=Ee(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),Ee(s.d).slice(0,a)===(t=Ee(n.d)).slice(0,a)){if(t=t.slice(a-3,a+1),i==a&&t=="4999"){if(J(s,r+1,0),s.times(s).eq(o)){n=s;break}}else if(t!="9999")break;a+=4}return G=!0,J(n,r)};V.times=V.mul=function(e){var t,r,n,i,s,a,o,l,f,u=this,d=u.constructor,b=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=b.length,f=g.length,l<f&&(s=b,b=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]*b[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,G?J(e,d.precision):e};V.toDecimalPlaces=V.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(Fe(e,0,st),t===void 0?t=n.rounding:Fe(t,0,8),J(r,e+re(r)+1,t))};V.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=qe(n,!0):(Fe(e,0,st),t===void 0?t=i.rounding:Fe(t,0,8),n=J(new i(n),e+1,t),r=qe(n,!0,e+1)),r};V.toFixed=function(e,t){var r,n,i=this,s=i.constructor;return e===void 0?qe(i):(Fe(e,0,st),t===void 0?t=s.rounding:Fe(t,0,8),n=J(new s(i),e+re(i)+1,t),r=qe(n.abs(),!1,e+re(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};V.toInteger=V.toint=function(){var e=this,t=e.constructor;return J(new t(e),re(e)+1,t.rounding)};V.toNumber=function(){return+this};V.toPower=V.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(de);if(o=new l(o),!o.s){if(e.s<1)throw Error(ge+"Infinity");return o}if(o.eq(de))return o;if(n=l.precision,e.eq(de))return J(o,n);if(t=e.e,r=e.d.length-1,a=t>=r,s=o.s,a){if((r=u<0?-u:u)<=si){for(i=new l(de),t=Math.ceil(n/Z+4),G=!1;r%2&&(i=i.times(o),on(i.d,t)),r=ot(r/2),r!==0;)o=o.times(o),on(o.d,t);return G=!0,e.s<0?new l(de).div(i):J(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,G=!1,i=e.times(bt(o,n+f)),G=!0,i=ai(i),i.s=s,i};V.toPrecision=function(e,t){var r,n,i=this,s=i.constructor;return e===void 0?(r=re(i),n=qe(i,r<=s.toExpNeg||r>=s.toExpPos)):(Fe(e,1,st),t===void 0?t=s.rounding:Fe(t,0,8),i=J(new s(i),e,t),r=re(i),n=qe(i,e<=r||r<=s.toExpNeg,e)),n};V.toSignificantDigits=V.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(Fe(e,1,st),t===void 0?t=n.rounding:Fe(t,0,8)),J(new n(r),e,t)};V.toString=V.valueOf=V.val=V.toJSON=V[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=re(e),r=e.constructor;return qe(e,t<=r.toExpNeg||t>=r.toExpPos)};function oi(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)),G?J(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/Z),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,G?J(t,d):t}function Fe(e,t,r){if(e!==~~e||e<t||e>r)throw Error(He+e)}function Ee(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=Z-n.length,r&&(s+=Re(r)),s+=n;a=e[t],n=a+"",r=Z-n.length,r&&(s+=Re(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,b,g,j,y,x,L,C,M,D,_,k,E,P,U=n.constructor,I=n.s==i.s?1:-1,B=n.d,F=i.d;if(!n.s)return new U(n);if(!i.s)throw Error(ge+"Division by zero");for(l=n.e-i.e,E=F.length,_=B.length,g=new U(I),j=g.d=[],f=0;F[f]==(B[f]||0);)++f;if(F[f]>(B[f]||0)&&--l,s==null?C=s=U.precision:a?C=s+(re(n)-re(i))+1:C=s,C<0)return new U(0);if(C=C/Z+2|0,f=0,E==1)for(u=0,F=F[0],C++;(f<_||u)&&C--;f++)M=u*ie+(B[f]||0),j[f]=M/F|0,u=M%F|0;else{for(u=ie/(F[0]+1)|0,u>1&&(F=e(F,u),B=e(B,u),E=F.length,_=B.length),D=E,y=B.slice(0,E),x=y.length;x<E;)y[x++]=0;P=F.slice(),P.unshift(0),k=F[0],F[1]>=ie/2&&++k;do u=0,o=t(F,y,E,x),o<0?(L=y[0],E!=x&&(L=L*ie+(y[1]||0)),u=L/k|0,u>1?(u>=ie&&(u=ie-1),d=e(F,u),b=d.length,x=y.length,o=t(d,y,b,x),o==1&&(u--,r(d,E<b?P:F,b))):(u==0&&(o=u=1),d=F.slice()),b=d.length,b<x&&d.unshift(0),r(y,d,x),o==-1&&(x=y.length,o=t(F,y,E,x),o<1&&(u++,r(y,E<x?P:F,x))),x=y.length):o===0&&(u++,y=[0]),j[f++]=u,o&&y[0]?y[x++]=B[D]||0:(y=[B[D]],x=1);while((D++<_||y[0]!==void 0)&&C--)}return j[0]||j.shift(),g.e=l,J(g,a?s+re(g)+1:s)}}();function ai(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(kr+re(e));if(!e.s)return new u(de);for(t==null?(G=!1,o=d):o=t,a=new u(.03125);e.abs().gte(.1);)e=e.times(a),f+=5;for(n=Math.log(Ie(2,f))/Math.LN10*2+5|0,o+=n,r=i=s=new u(de),u.precision=o;;){if(i=J(i.times(e),o),r=r.times(++l),a=s.plus(Ve(i,r,o)),Ee(a.d).slice(0,o)===Ee(s.d).slice(0,o)){for(;f--;)s=J(s.times(s),o);return u.precision=d,t==null?(G=!0,J(s,d)):s}s=a}}function re(e){for(var t=e.e*Z,r=e.d[0];r>=10;r/=10)t++;return t}function rr(e,t,r){if(t>e.LN10.sd())throw G=!0,r&&(e.precision=r),Error(ge+"LN10 precision limit exceeded");return J(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,d=1,b=10,g=e,j=g.d,y=g.constructor,x=y.precision;if(g.s<1)throw Error(ge+(g.s?"NaN":"-Infinity"));if(g.eq(de))return new y(0);if(t==null?(G=!1,f=x):f=t,g.eq(10))return t==null&&(G=!0),rr(y,f);if(f+=b,y.precision=f,r=Ee(j),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=Ee(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=rr(y,f+2,x).times(s+""),g=bt(new y(n+"."+r.slice(1)),f-b).plus(l),y.precision=x,t==null?(G=!0,J(g,x)):g;for(o=a=g=Ve(g.minus(de),g.plus(de),f),u=J(g.times(g),f),i=3;;){if(a=J(a.times(u),f),l=o.plus(Ve(a,new y(i),f)),Ee(l.d).slice(0,f)===Ee(o.d).slice(0,f))return o=o.times(2),s!==0&&(o=o.plus(rr(y,f+2,x).times(s+""))),o=Ve(o,new y(d),f),y.precision=x,t==null?(G=!0,J(o,x)):o;o=l,i+=2}}function sn(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/Z),e.d=[],n=(r+1)%Z,r<0&&(n+=Z),n<i){for(n&&e.d.push(+t.slice(0,n)),i-=Z;n<i;)e.d.push(+t.slice(n,n+=Z));t=t.slice(n),n=Z-t.length}else n-=i;for(;n--;)t+="0";if(e.d.push(+t),G&&(e.e>Pt||e.e<-Pt))throw Error(kr+r)}else e.s=0,e.e=0,e.d=[0];return e}function J(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+=Z,i=t,f=d[u=0];else{if(u=Math.ceil((n+1)/Z),s=d.length,u>=s)return e;for(f=s=d[u],a=1;s>=10;s/=10)a++;n%=Z,i=n-Z+a}if(r!==void 0&&(s=Ie(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/Ie(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]=Ie(10,(Z-t%Z)%Z),e.e=ot(-t/Z)||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=Ie(10,Z-n),d[u]=i>0?(f/Ie(10,a-i)%Ie(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(G&&(e.e>Pt||e.e<-Pt))throw Error(kr+re(e));return e}function li(e,t){var r,n,i,s,a,o,l,f,u,d,b=e.constructor,g=b.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new b(e),G?J(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/Z),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,G?J(t,g):t):new b(0)}function qe(e,t,r){var n,i=re(e),s=Ee(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 on(e,t){if(e.length>t)return e.length=t,!0}function ci(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(He+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 sn(a,s.toString())}else if(typeof s!="string")throw Error(He+s);if(s.charCodeAt(0)===45?(s=s.slice(1),a.s=-1):a.s=1,va.test(s))sn(a,s);else throw Error(He+s)}if(i.prototype=V,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=ci,i.config=i.set=pa,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 pa(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(He+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(He+r+": "+n);return this}var Fr=ci(ha);de=new Fr(1);const ma={prefix:"$",precision:2,zeroDisplay:"-",format:{minimumFractionDigits:2,maximumFractionDigits:2}};function ga(e,t={}){const{prefix:r,precision:n,zeroDisplay:i,format:s}={...ma,...t};if(e===0)return i;const a=e.toLocaleString("en",s??{maximumFractionDigits:n});return`${r}${a}`}function ba(e,t,r){const n=e*t;return ga(n,r)}const ya=(e,t,r)=>new Fr(e).toDecimalPlaces(t,r).toNumber(),xa=({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=Cr({name:e,defaultValue:""}),{setValue:u}=ze(),d=parseFloat(f||"0"),b=ba(d,(s==null?void 0:s.price)??0,{zeroDisplay:"$0.00"}),g=y=>{u(e,y.target.value,{shouldValidate:!0,shouldDirty:!0,shouldTouch:!0})},j=y=>{(y.key==="ArrowUp"||y.key==="ArrowDown")&&y.preventDefault()};return c.jsxs(Wt,{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:j,placeholder:i,autoFocus:l,className:"w-2/3 bg-transparent text-right text-lg outline-none"})]}),c.jsx(ii,{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:ya(Number(s.balance),s.decimals??8)})," ",s.symbol]}),s.displayUSD&&s.price!==void 0&&c.jsxs("div",{children:[b," USD"]})]}):null]})};function wa({bsnId:e,bsnName:t,bsnLogoUrl:r,provider:n,onRemove:i}){var a,o;if(!n)return null;const s=()=>r?c.jsx(cr,{url:r,alt:t,variant:"rounded",size:"tiny",className:"mr-1"}):null;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(Pn,{logoUrl:n.logo_url,rank:n.rank,moniker:(a=n.description)==null?void 0:a.moniker,size:"lg"}),c.jsxs("div",{className:"flex flex-col justify-center text-accent-primary",children:[c.jsxs("div",{className:"flex items-center text-xs text-accent-secondary",children:[s(),t]}),c.jsx(q,{as:"div",className:"text-base font-medium text-accent-primary",children:(o=n.description)==null?void 0:o.moniker})]})]}),c.jsx("button",{onClick:()=>i(e),className:"cursor-pointer rounded bg-accent-secondary/20 px-2 py-0.5 text-xs tracking-[0.4px] text-accent-primary",children:"Remove"})]})}function ja({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(wa,{bsnId:n,bsnName:i,bsnLogoUrl:s,provider:a,onRemove:t},`${n}-${a.rank}`))})}function Na({max:e,items:t=[],onAdd:r,onRemove:n}){const i=m.useMemo(()=>t.length,[t]),a=e>1?"Add BSN and Finality Provider":"Add Finality Provider";return c.jsx(Wt,{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:a}),c.jsx(Bn,{counter:i,max:e,onAdd:r})]})}),i>0&&c.jsx(ja,{items:t,onRemove:n})]})})}function Jt({title:e,children:t,className:r,hint:n}){return c.jsxs("div",{className:A.twMerge("flex flex-row items-center justify-between text-accent-primary",n&&"items-start",r),children:[c.jsx(q,{as:"div",variant:"body1",children:e}),n?c.jsxs("div",{className:"flex flex-col items-end",children:[c.jsx(q,{as:"div",className:"flex items-center gap-2",children:t}),c.jsx(q,{as:"div",variant:"body2",className:"text-accent-secondary",children:n})]}):c.jsx(q,{as:"div",className:"flex items-center gap-2",children:t})]})}function Oa(e){return yt({tag:"svg",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 ui({value:e,onEdit:t,title:r="Network Fee Rate",className:n}){return c.jsxs(Jt,{title:r,className:n,children:[c.jsxs("span",{children:[e," sats/vB"]}),t&&c.jsx(pt,{size:"small",variant:"outlined",className:"h-6 w-6 pl-1 text-secondary-strokeDark",onClick:t,children:c.jsx(Oa,{size:16,className:"text-secondary-strokeDark"})})]})}function fi({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(Jt,{title:n??`${t} Network Fee`,hint:r,className:i,children:[a," ",t]})}function di({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(Jt,{title:n??`${t} Network Fee`,hint:r,className:i,children:[a," ",t]})}function hi({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:A.twMerge("flex flex-row items-start justify-between text-accent-primary",i),children:[c.jsx(q,{variant:"body1",className:"font-bold",children:n}),c.jsxs("div",{className:"flex flex-col items-end justify-center",children:[c.jsxs(q,{variant:"body1",className:"font-bold",children:[a," ",t]}),r&&c.jsx(q,{variant:"body1",className:"text-sm text-accent-secondary",children:r})]})]})}function Ca({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(Wt,{className:A.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(ui,{value:t,onEdit:r}),c.jsx(fi,{amount:n,coinSymbol:i,hint:s}),l!==void 0&&f?c.jsx(di,{amount:l,coinSymbol:f,hint:u,decimals:d}):null,c.jsx("div",{className:"divider my-4"}),c.jsx(hi,{total:a,coinSymbol:i,hint:o})]})})}function Ea(){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 Sa({className:e,...t}){const n=Ea()?kn:Sn;return c.jsx(n,{...t,className:A.twMerge("w-[41.25rem] max-w-full",e)})}const ka=({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(Sa,{open:e,onClose:r,children:[c.jsx(Fn,{title:"Preview",onClose:r,className:"text-accent-primary"}),c.jsxs(An,{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(Tn,{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(q,{variant:"caption",className:"text-secondary text-center",children:"BSNs"}),c.jsx(q,{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(q,{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(q,{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(q,{variant:"body1",className:"text-secondary font-normal",children:l.label}),c.jsx(q,{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(Bt,{variant:"h6",className:"text-primary mb-2",children:"Attention!"}),c.jsxs(q,{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(q,{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(_n,{className:"flex gap-4 pb-8 pt-0",children:[c.jsx(pt,{variant:"outlined",color:"primary",onClick:r,className:"flex-1",children:"Cancel"}),c.jsx(pt,{variant:"contained",color:"primary",onClick:n,className:"flex-1",disabled:t,children:t?"Processing...":"Proceed to Signing"})]})]})},Fa={adaptive:"adaptive",horizontal:"vertical",vertical:"horizontal"};function Aa({className:e,orientation:t="vertical",children:r}){return c.jsx("div",{className:A.twMerge("bbn-list-legacy",`bbn-list-legacy-${t}`,e),children:m.Children.map(r,n=>m.isValidElement(n)?m.cloneElement(n,{orientation:Fa[t]}):n)})}function _a({className:e,orientation:t="horizontal",title:r,value:n,suffix:i}){return c.jsxs("div",{className:A.twJoin("bbn-list-item-legacy",`bbn-list-item-legacy-${t}`,e),children:[c.jsx(q,{as:"div",className:A.twJoin("bbn-list-title-legacy",`bbn-list-title-legacy-${t}`),variant:t==="horizontal"?"body1":"body2",children:r}),c.jsxs(q,{as:"div",className:A.twJoin("bbn-list-value-legacy",`bbn-list-value-legacy-${t}`),variant:"body1",children:[n,i]})]})}exports.Accordion=bi;exports.AccordionDetails=wi;exports.AccordionSummary=yi;exports.AmountSubsection=xa;exports.Avatar=cr;exports.AvatarGroup=ji;exports.BBNFeeAmount=di;exports.BTCFeeAmount=fi;exports.BTCFeeRate=ui;exports.Badge=_o;exports.Button=pt;exports.Card=Tn;exports.Cell=Rn;exports.Checkbox=un;exports.CheckboxField=ua;exports.Chip=to;exports.Column=Mn;exports.CounterButton=Bn;exports.Dialog=Sn;exports.DialogBody=An;exports.DialogFooter=_n;exports.DialogHeader=Fn;exports.FeeItem=Jt;exports.FeesSection=Ca;exports.FinalityProviderLogo=Pn;exports.FinalityProviderSubsection=Na;exports.Form=sa;exports.FormControl=jt;exports.Heading=Bt;exports.HiddenField=ii;exports.IconButton=ar;exports.Input=Ut;exports.List=Fo;exports.ListItem=Ao;exports.ListItemLegacy=_a;exports.ListLegacy=Aa;exports.Loader=ro;exports.Menu=Ro;exports.MenuDrawer=xr;exports.MenuItem=To;exports.MobileDialog=kn;exports.NumberField=la;exports.Popover=gr;exports.Portal=$t;exports.PreviewModal=ka;exports.Radio=fn;exports.RadioField=fa;exports.ScrollLocker=eo;exports.Select=br;exports.SelectField=da;exports.SubMenu=Po;exports.SubMenuItem=Bo;exports.SubSection=Wt;exports.Table=Eo;exports.Text=q;exports.TextField=ca;exports.Toggle=So;exports.Total=hi;exports.useField=Ze;exports.useFieldState=oa;exports.useFormContext=ze;exports.useFormState=Or;exports.useMenuContext=yr;exports.useWatch=Cr;
21
2
  //# sourceMappingURL=index.cjs.js.map