@saleor/macaw-ui 1.1.15 → 1.1.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -99,5 +99,5 @@ Valid keys: `+JSON.stringify(Object.keys($),null," "));var W=as(G,es,D,L,F+"."+
99
99
  `)},t_=function(s){var e=s.noRelative,t=s.noImportant,o=s.gapMode,i=o===void 0?"margin":o,n=os.useMemo(function(){return Qu(i)},[i]);return os.createElement(s_,{styles:e_(n,!e,i,t?"":"!important")})},Xo=!1;if(typeof window<"u")try{var kt=Object.defineProperty({},"passive",{get:function(){return Xo=!0,!0}});window.addEventListener("test",kt,kt),window.removeEventListener("test",kt,kt)}catch{Xo=!1}var Oe=Xo?{passive:!1}:!1,o_=function(s){return s.tagName==="TEXTAREA"},Ql=function(s,e){var t=window.getComputedStyle(s);return t[e]!=="hidden"&&!(t.overflowY===t.overflowX&&!o_(s)&&t[e]==="visible")},n_=function(s){return Ql(s,"overflowY")},i_=function(s){return Ql(s,"overflowX")},ji=function(s,e){var t=e;do{typeof ShadowRoot<"u"&&t instanceof ShadowRoot&&(t=t.host);var o=sa(s,t);if(o){var i=ea(s,t),n=i[1],f=i[2];if(n>f)return!0}t=t.parentNode}while(t&&t!==document.body);return!1},f_=function(s){var e=s.scrollTop,t=s.scrollHeight,o=s.clientHeight;return[e,t,o]},l_=function(s){var e=s.scrollLeft,t=s.scrollWidth,o=s.clientWidth;return[e,t,o]},sa=function(s,e){return s==="v"?n_(e):i_(e)},ea=function(s,e){return s==="v"?f_(e):l_(e)},a_=function(s,e){return s==="h"&&e==="rtl"?-1:1},r_=function(s,e,t,o,i){var n=a_(s,window.getComputedStyle(e).direction),f=n*o,l=t.target,r=e.contains(l),p=!1,c=f>0,d=0,b=0;do{var _=ea(s,l),y=_[0],v=_[1],m=_[2],k=v-m-n*y;(y||k)&&sa(s,l)&&(d+=k,b+=y),l=l.parentNode}while(!r&&l!==document.body||r&&(e.contains(l)||e===l));return(c&&(i&&d===0||!i&&f>d)||!c&&(i&&b===0||!i&&-f>b))&&(p=!0),p},wt=function(s){return"changedTouches"in s?[s.changedTouches[0].clientX,s.changedTouches[0].clientY]:[0,0]},Ti=function(s){return[s.deltaX,s.deltaY]},Mi=function(s){return s&&"current"in s?s.current:s},p_=function(s,e){return s[0]===e[0]&&s[1]===e[1]},d_=function(s){return`
100
100
  .block-interactivity-`.concat(s,` {pointer-events: none;}
101
101
  .allow-interactivity-`).concat(s,` {pointer-events: all;}
102
- `)},c_=0,je=[];function u_(s){var e=os.useRef([]),t=os.useRef([0,0]),o=os.useRef(),i=os.useState(c_++)[0],n=os.useState(function(){return Jl()})[0],f=os.useRef(s);os.useEffect(function(){f.current=s},[s]),os.useEffect(function(){if(s.inert){document.body.classList.add("block-interactivity-".concat(i));var v=$c([s.lockRef.current],(s.shards||[]).map(Mi),!0).filter(Boolean);return v.forEach(function(m){return m.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),v.forEach(function(m){return m.classList.remove("allow-interactivity-".concat(i))})}}},[s.inert,s.lockRef.current,s.shards]);var l=os.useCallback(function(v,m){if("touches"in v&&v.touches.length===2)return!f.current.allowPinchZoom;var k=wt(v),h=t.current,C="deltaX"in v?v.deltaX:h[0]-k[0],x="deltaY"in v?v.deltaY:h[1]-k[1],g,I=v.target,E=Math.abs(C)>Math.abs(x)?"h":"v";if("touches"in v&&E==="h"&&I.type==="range")return!1;var P=ji(E,I);if(!P)return!0;if(P?g=E:(g=E==="v"?"h":"v",P=ji(E,I)),!P)return!1;if(!o.current&&"changedTouches"in v&&(C||x)&&(o.current=g),!g)return!0;var R=o.current||g;return r_(R,m,v,R==="h"?C:x,!0)},[]),r=os.useCallback(function(v){var m=v;if(!(!je.length||je[je.length-1]!==n)){var k="deltaY"in m?Ti(m):wt(m),h=e.current.filter(function(g){return g.name===m.type&&g.target===m.target&&p_(g.delta,k)})[0];if(h&&h.should){m.cancelable&&m.preventDefault();return}if(!h){var C=(f.current.shards||[]).map(Mi).filter(Boolean).filter(function(g){return g.contains(m.target)}),x=C.length>0?l(m,C[0]):!f.current.noIsolation;x&&m.cancelable&&m.preventDefault()}}},[]),p=os.useCallback(function(v,m,k,h){var C={name:v,delta:m,target:k,should:h};e.current.push(C),setTimeout(function(){e.current=e.current.filter(function(x){return x!==C})},1)},[]),c=os.useCallback(function(v){t.current=wt(v),o.current=void 0},[]),d=os.useCallback(function(v){p(v.type,Ti(v),v.target,l(v,s.lockRef.current))},[]),b=os.useCallback(function(v){p(v.type,wt(v),v.target,l(v,s.lockRef.current))},[]);os.useEffect(function(){return je.push(n),s.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:b}),document.addEventListener("wheel",r,Oe),document.addEventListener("touchmove",r,Oe),document.addEventListener("touchstart",c,Oe),function(){je=je.filter(function(v){return v!==n}),document.removeEventListener("wheel",r,Oe),document.removeEventListener("touchmove",r,Oe),document.removeEventListener("touchstart",c,Oe)}},[]);var _=s.removeScrollBar,y=s.inert;return os.createElement(os.Fragment,null,y?os.createElement(n,{styles:d_(i)}):null,_?os.createElement(t_,{gapMode:"margin"}):null)}const __=Fu(Xl,u_);var ta=os.forwardRef(function(s,e){return os.createElement(ro,Ns({},s,{ref:e,sideCar:__}))});ta.classNames=ro.classNames;const h8=ta;var h_=function(s){if(typeof document>"u")return null;var e=Array.isArray(s)?s[0]:s;return e.ownerDocument.body},Te=new WeakMap,$t=new WeakMap,It={},Mo=0,oa=function(s){return s&&(s.host||oa(s.parentNode))},b_=function(s,e){return e.map(function(t){if(s.contains(t))return t;var o=oa(t);return o&&s.contains(o)?o:(console.error("aria-hidden",t,"in not contained inside",s,". Doing nothing"),null)}).filter(function(t){return!!t})},m_=function(s,e,t,o){var i=b_(e,Array.isArray(s)?s:[s]);It[t]||(It[t]=new WeakMap);var n=It[t],f=[],l=new Set,r=new Set(i),p=function(d){!d||l.has(d)||(l.add(d),p(d.parentNode))};i.forEach(p);var c=function(d){!d||r.has(d)||Array.prototype.forEach.call(d.children,function(b){if(l.has(b))c(b);else{var _=b.getAttribute(o),y=_!==null&&_!=="false",v=(Te.get(b)||0)+1,m=(n.get(b)||0)+1;Te.set(b,v),n.set(b,m),f.push(b),v===1&&y&&$t.set(b,!0),m===1&&b.setAttribute(t,"true"),y||b.setAttribute(o,"true")}})};return c(e),l.clear(),Mo++,function(){f.forEach(function(d){var b=Te.get(d)-1,_=n.get(d)-1;Te.set(d,b),n.set(d,_),b||($t.has(d)||d.removeAttribute(o),$t.delete(d)),_||d.removeAttribute(t)}),Mo--,Mo||(Te=new WeakMap,Te=new WeakMap,$t=new WeakMap,It={})}},b8=function(s,e,t){t===void 0&&(t="data-aria-hidden");var o=Array.from(Array.isArray(s)?s:[s]),i=e||h_(s);return i?(o.push.apply(o,Array.from(i.querySelectorAll("[aria-live]"))),m_(o,i,t,"aria-hidden")):function(){return null}};const na="Dialog",[ia,cm]=qs(na),[v_,pe]=ia(na),C_=s=>{const{__scopeDialog:e,children:t,open:o,defaultOpen:i,onOpenChange:n,modal:f=!0}=s,l=a.useRef(null),r=a.useRef(null),[p=!1,c]=Xs({prop:o,defaultProp:i,onChange:n});return a.createElement(v_,{scope:e,triggerRef:l,contentRef:r,contentId:se(),titleId:se(),descriptionId:se(),open:p,onOpenChange:c,onOpenToggle:a.useCallback(()=>c(d=>!d),[c]),modal:f},t)},g_="DialogTrigger",y_=a.forwardRef((s,e)=>{const{__scopeDialog:t,...o}=s,i=pe(g_,t),n=ws(e,i.triggerRef);return a.createElement(xs.button,ts({type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":m8(i.open)},o,{ref:n,onClick:fs(s.onClick,i.onOpenToggle)}))}),fa="DialogPortal",[x_,la]=ia(fa,{forceMount:void 0}),k_=s=>{const{__scopeDialog:e,forceMount:t,children:o,container:i}=s,n=pe(fa,e);return a.createElement(x_,{scope:e,forceMount:t},a.Children.map(o,f=>a.createElement(Fs,{present:t||n.open},a.createElement(ao,{asChild:!0,container:i},f))))},Jo="DialogOverlay",w_=a.forwardRef((s,e)=>{const t=la(Jo,s.__scopeDialog),{forceMount:o=t.forceMount,...i}=s,n=pe(Jo,s.__scopeDialog);return n.modal?a.createElement(Fs,{present:o||n.open},a.createElement($_,ts({},i,{ref:e}))):null}),$_=a.forwardRef((s,e)=>{const{__scopeDialog:t,...o}=s,i=pe(Jo,t);return a.createElement(h8,{as:$e,allowPinchZoom:!0,shards:[i.contentRef]},a.createElement(xs.div,ts({"data-state":m8(i.open)},o,{ref:e,style:{pointerEvents:"auto",...o.style}})))}),Xe="DialogContent",I_=a.forwardRef((s,e)=>{const t=la(Xe,s.__scopeDialog),{forceMount:o=t.forceMount,...i}=s,n=pe(Xe,s.__scopeDialog);return a.createElement(Fs,{present:o||n.open},n.modal?a.createElement(E_,ts({},i,{ref:e})):a.createElement(R_,ts({},i,{ref:e})))}),E_=a.forwardRef((s,e)=>{const t=pe(Xe,s.__scopeDialog),o=a.useRef(null),i=ws(e,t.contentRef,o);return a.useEffect(()=>{const n=o.current;if(n)return b8(n)},[]),a.createElement(aa,ts({},s,{ref:i,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:fs(s.onCloseAutoFocus,n=>{var f;n.preventDefault(),(f=t.triggerRef.current)===null||f===void 0||f.focus()}),onPointerDownOutside:fs(s.onPointerDownOutside,n=>{const f=n.detail.originalEvent,l=f.button===0&&f.ctrlKey===!0;(f.button===2||l)&&n.preventDefault()}),onFocusOutside:fs(s.onFocusOutside,n=>n.preventDefault())}))}),R_=a.forwardRef((s,e)=>{const t=pe(Xe,s.__scopeDialog),o=a.useRef(!1),i=a.useRef(!1);return a.createElement(aa,ts({},s,{ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:n=>{var f;if((f=s.onCloseAutoFocus)===null||f===void 0||f.call(s,n),!n.defaultPrevented){var l;o.current||(l=t.triggerRef.current)===null||l===void 0||l.focus(),n.preventDefault()}o.current=!1,i.current=!1},onInteractOutside:n=>{var f,l;(f=s.onInteractOutside)===null||f===void 0||f.call(s,n),n.defaultPrevented||(o.current=!0,n.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const r=n.target;((l=t.triggerRef.current)===null||l===void 0?void 0:l.contains(r))&&n.preventDefault(),n.detail.originalEvent.type==="focusin"&&i.current&&n.preventDefault()}}))}),aa=a.forwardRef((s,e)=>{const{__scopeDialog:t,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:n,...f}=s,l=pe(Xe,t),r=a.useRef(null),p=ws(e,r);return _8(),a.createElement(a.Fragment,null,a.createElement(u8,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:i,onUnmountAutoFocus:n},a.createElement(lo,ts({role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":m8(l.open)},f,{ref:p,onDismiss:()=>l.onOpenChange(!1)}))),!1)});const P_="DialogClose",S_=a.forwardRef((s,e)=>{const{__scopeDialog:t,...o}=s,i=pe(P_,t);return a.createElement(xs.button,ts({type:"button"},o,{ref:e,onClick:fs(s.onClick,()=>i.onOpenChange(!1))}))});function m8(s){return s?"open":"closed"}const ra=C_,pa=y_,da=k_,ca=w_,ua=I_,_a=S_;var Vi="_68ye811";const ha=({children:s,...e})=>u.jsxs(da,{children:[u.jsx(ca,{asChild:!0,className:Vi,children:u.jsx(Xt,{})}),u.jsx(ua,{asChild:!0,className:Vi,children:u.jsxs(Y,{backgroundColor:"default1",boxShadow:"defaultModal",top:0,left:0,height:"100%",borderTopRightRadius:3,borderBottomRightRadius:3,position:"fixed",paddingTop:7,"data-macaw-ui-component":"Drawer.Content",...e,children:[s,u.jsx(_a,{asChild:!0,children:u.jsx(et,{variant:"tertiary",icon:u.jsx(mf,{}),size:"small",className:Js({position:"absolute",top:1,right:1})})})]})})]});ha.displayName="Drawer.Content";const ba=({children:s})=>u.jsx(ra,{"data-macaw-ui-component":"Drawer",children:s});ba.displayName="Drawer";const ma=({children:s})=>u.jsx(pa,{asChild:!0,"data-macaw-ui-component":"Drawer.Trigger",children:s});ma.displayName="Drawer.Trigger";const D_=Object.assign(ba,{Content:ha,Trigger:ma}),O_=a.forwardRef((s,e)=>{const{children:t,width:o=10,height:i=5,...n}=s;return a.createElement(xs.svg,gs({},n,{ref:e,width:o,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none"}),s.asChild?t:a.createElement("polygon",{points:"0,0 30,0 15,10"}))}),j_=O_,va="Popper",[Ca,qe]=qs(va),[T_,ga]=Ca(va),M_=s=>{const{__scopePopper:e,children:t}=s,[o,i]=a.useState(null);return a.createElement(T_,{scope:e,anchor:o,onAnchorChange:i},t)},V_="PopperAnchor",A_=a.forwardRef((s,e)=>{const{__scopePopper:t,virtualRef:o,...i}=s,n=ga(V_,t),f=a.useRef(null),l=ws(e,f);return a.useEffect(()=>{n.onAnchorChange((o==null?void 0:o.current)||f.current)}),o?null:a.createElement(xs.div,gs({},i,{ref:l}))}),ya="PopperContent",[N_,W_]=Ca(ya),L_=a.forwardRef((s,e)=>{var t,o,i,n,f,l,r,p;const{__scopePopper:c,side:d="bottom",sideOffset:b=0,align:_="center",alignOffset:y=0,arrowPadding:v=0,avoidCollisions:m=!0,collisionBoundary:k=[],collisionPadding:h=0,sticky:C="partial",hideWhenDetached:x=!1,updatePositionStrategy:g="optimized",onPlaced:I,...E}=s,P=ga(ya,c),[R,O]=a.useState(null),V=ws(e,ys=>O(ys)),[A,Z]=a.useState(null),N=_n(A),B=(t=N==null?void 0:N.width)!==null&&t!==void 0?t:0,H=(o=N==null?void 0:N.height)!==null&&o!==void 0?o:0,U=d+(_!=="center"?"-"+_:""),K=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},M=Array.isArray(k)?k:[k],$=M.length>0,S={padding:K,boundary:M.filter(F_),altBoundary:$},{refs:j,floatingStyles:T,placement:D,isPositioned:L,middlewareData:F}=qf({strategy:"fixed",placement:U,whileElementsMounted:(...ys)=>Wf(...ys,{animationFrame:g==="always"}),elements:{reference:P.anchor},middleware:[Wd({mainAxis:b+H,alignmentAxis:y}),m&&fc({mainAxis:!0,crossAxis:!1,limiter:C==="partial"?ac():void 0,...S}),m&&Lf({...S}),zf({...S,apply:({elements:ys,rects:cs,availableWidth:Is,availableHeight:Ds})=>{const{width:Os,height:ne}=cs.reference,Es=ys.floating.style;Es.setProperty("--radix-popper-available-width",`${Is}px`),Es.setProperty("--radix-popper-available-height",`${Ds}px`),Es.setProperty("--radix-popper-anchor-width",`${Os}px`),Es.setProperty("--radix-popper-anchor-height",`${ne}px`)}}),A&&pc({element:A,padding:v}),K_({arrowWidth:B,arrowHeight:H}),x&&lc({strategy:"referenceHidden",...S})]}),[G,X]=xa(D),Q=te(I);Ie(()=>{L&&(Q==null||Q())},[L,Q]);const es=(i=F.arrow)===null||i===void 0?void 0:i.x,as=(n=F.arrow)===null||n===void 0?void 0:n.y,W=((f=F.arrow)===null||f===void 0?void 0:f.centerOffset)!==0,[us,J]=a.useState();return Ie(()=>{R&&J(window.getComputedStyle(R).zIndex)},[R]),a.createElement("div",{ref:j.setFloating,"data-radix-popper-content-wrapper":"",style:{...T,transform:L?T.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:us,"--radix-popper-transform-origin":[(l=F.transformOrigin)===null||l===void 0?void 0:l.x,(r=F.transformOrigin)===null||r===void 0?void 0:r.y].join(" ")},dir:s.dir},a.createElement(N_,{scope:c,placedSide:G,onArrowChange:Z,arrowX:es,arrowY:as,shouldHideArrow:W},a.createElement(xs.div,gs({"data-side":G,"data-align":X},E,{ref:V,style:{...E.style,animation:L?void 0:"none",opacity:(p=F.hide)!==null&&p!==void 0&&p.referenceHidden?0:void 0}}))))}),z_="PopperArrow",H_={top:"bottom",right:"left",bottom:"top",left:"right"},q_=a.forwardRef(function(e,t){const{__scopePopper:o,...i}=e,n=W_(z_,o),f=H_[n.placedSide];return a.createElement("span",{ref:n.onArrowChange,style:{position:"absolute",left:n.arrowX,top:n.arrowY,[f]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[n.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[n.placedSide],visibility:n.shouldHideArrow?"hidden":void 0}},a.createElement(j_,gs({},i,{ref:t,style:{...i.style,display:"block"}})))});function F_(s){return s!==null}const K_=s=>({name:"transformOrigin",options:s,fn(e){var t,o,i,n,f;const{placement:l,rects:r,middlewareData:p}=e,d=((t=p.arrow)===null||t===void 0?void 0:t.centerOffset)!==0,b=d?0:s.arrowWidth,_=d?0:s.arrowHeight,[y,v]=xa(l),m={start:"0%",center:"50%",end:"100%"}[v],k=((o=(i=p.arrow)===null||i===void 0?void 0:i.x)!==null&&o!==void 0?o:0)+b/2,h=((n=(f=p.arrow)===null||f===void 0?void 0:f.y)!==null&&n!==void 0?n:0)+_/2;let C="",x="";return y==="bottom"?(C=d?m:`${k}px`,x=`${-_}px`):y==="top"?(C=d?m:`${k}px`,x=`${r.floating.height+_}px`):y==="right"?(C=`${-_}px`,x=d?m:`${h}px`):y==="left"&&(C=`${r.floating.width+_}px`,x=d?m:`${h}px`),{data:{x:C,y:x}}}});function xa(s){const[e,t="center"]=s.split("-");return[e,t]}const v8=M_,po=A_,C8=L_,ka=q_,Vo="rovingFocusGroup.onEntryFocus",B_={bubbles:!1,cancelable:!0},g8="RovingFocusGroup",[Qo,wa,Z_]=fn(g8),[U_,co]=qs(g8,[Z_]),[Y_,G_]=U_(g8),X_=a.forwardRef((s,e)=>a.createElement(Qo.Provider,{scope:s.__scopeRovingFocusGroup},a.createElement(Qo.Slot,{scope:s.__scopeRovingFocusGroup},a.createElement(J_,gs({},s,{ref:e}))))),J_=a.forwardRef((s,e)=>{const{__scopeRovingFocusGroup:t,orientation:o,loop:i=!1,dir:n,currentTabStopId:f,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:r,onEntryFocus:p,...c}=s,d=a.useRef(null),b=ws(e,d),_=Ut(n),[y=null,v]=Xs({prop:f,defaultProp:l,onChange:r}),[m,k]=a.useState(!1),h=te(p),C=wa(t),x=a.useRef(!1),[g,I]=a.useState(0);return a.useEffect(()=>{const E=d.current;if(E)return E.addEventListener(Vo,h),()=>E.removeEventListener(Vo,h)},[h]),a.createElement(Y_,{scope:t,orientation:o,dir:_,loop:i,currentTabStopId:y,onItemFocus:a.useCallback(E=>v(E),[v]),onItemShiftTab:a.useCallback(()=>k(!0),[]),onFocusableItemAdd:a.useCallback(()=>I(E=>E+1),[]),onFocusableItemRemove:a.useCallback(()=>I(E=>E-1),[])},a.createElement(xs.div,gs({tabIndex:m||g===0?-1:0,"data-orientation":o},c,{ref:b,style:{outline:"none",...s.style},onMouseDown:fs(s.onMouseDown,()=>{x.current=!0}),onFocus:fs(s.onFocus,E=>{const P=!x.current;if(E.target===E.currentTarget&&P&&!m){const R=new CustomEvent(Vo,B_);if(E.currentTarget.dispatchEvent(R),!R.defaultPrevented){const O=C().filter(B=>B.focusable),V=O.find(B=>B.active),A=O.find(B=>B.id===y),N=[V,A,...O].filter(Boolean).map(B=>B.ref.current);$a(N)}}x.current=!1}),onBlur:fs(s.onBlur,()=>k(!1))})))}),Q_="RovingFocusGroupItem",sh=a.forwardRef((s,e)=>{const{__scopeRovingFocusGroup:t,focusable:o=!0,active:i=!1,tabStopId:n,...f}=s,l=se(),r=n||l,p=G_(Q_,t),c=p.currentTabStopId===r,d=wa(t),{onFocusableItemAdd:b,onFocusableItemRemove:_}=p;return a.useEffect(()=>{if(o)return b(),()=>_()},[o,b,_]),a.createElement(Qo.ItemSlot,{scope:t,id:r,focusable:o,active:i},a.createElement(xs.span,gs({tabIndex:c?0:-1,"data-orientation":p.orientation},f,{ref:e,onMouseDown:fs(s.onMouseDown,y=>{o?p.onItemFocus(r):y.preventDefault()}),onFocus:fs(s.onFocus,()=>p.onItemFocus(r)),onKeyDown:fs(s.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){p.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const v=oh(y,p.orientation,p.dir);if(v!==void 0){y.preventDefault();let k=d().filter(h=>h.focusable).map(h=>h.ref.current);if(v==="last")k.reverse();else if(v==="prev"||v==="next"){v==="prev"&&k.reverse();const h=k.indexOf(y.currentTarget);k=p.loop?nh(k,h+1):k.slice(h+1)}setTimeout(()=>$a(k))}})})))}),eh={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function th(s,e){return e!=="rtl"?s:s==="ArrowLeft"?"ArrowRight":s==="ArrowRight"?"ArrowLeft":s}function oh(s,e,t){const o=th(s.key,t);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return eh[o]}function $a(s){const e=document.activeElement;for(const t of s)if(t===e||(t.focus(),document.activeElement!==e))return}function nh(s,e){return s.map((t,o)=>s[(e+o)%s.length])}const Ia=X_,Ea=sh,ih=["Enter"," "],fh=["ArrowDown","PageUp","Home"],Ra=["ArrowUp","PageDown","End"],lh=[...fh,...Ra],uo="Menu",[sn,ah,rh]=fn(uo),[Re,Pa]=qs(uo,[rh,qe,co]),y8=qe(),Sa=co(),[ph,ut]=Re(uo),[dh,x8]=Re(uo),ch=s=>{const{__scopeMenu:e,open:t=!1,children:o,dir:i,onOpenChange:n,modal:f=!0}=s,l=y8(e),[r,p]=a.useState(null),c=a.useRef(!1),d=te(n),b=Ut(i);return a.useEffect(()=>{const _=()=>{c.current=!0,document.addEventListener("pointerdown",y,{capture:!0,once:!0}),document.addEventListener("pointermove",y,{capture:!0,once:!0})},y=()=>c.current=!1;return document.addEventListener("keydown",_,{capture:!0}),()=>{document.removeEventListener("keydown",_,{capture:!0}),document.removeEventListener("pointerdown",y,{capture:!0}),document.removeEventListener("pointermove",y,{capture:!0})}},[]),a.createElement(v8,l,a.createElement(ph,{scope:e,open:t,onOpenChange:d,content:r,onContentChange:p},a.createElement(dh,{scope:e,onClose:a.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:c,dir:b,modal:f},o)))},uh=a.forwardRef((s,e)=>{const{__scopeMenu:t,...o}=s,i=y8(t);return a.createElement(po,gs({},i,o,{ref:e}))}),Da="MenuPortal",[_h,hh]=Re(Da,{forceMount:void 0}),bh=s=>{const{__scopeMenu:e,forceMount:t,children:o,container:i}=s,n=ut(Da,e);return a.createElement(_h,{scope:e,forceMount:t},a.createElement(Fs,{present:t||n.open},a.createElement(ao,{asChild:!0,container:i},o)))},ce="MenuContent",[mh,Oa]=Re(ce),vh=a.forwardRef((s,e)=>{const t=hh(ce,s.__scopeMenu),{forceMount:o=t.forceMount,...i}=s,n=ut(ce,s.__scopeMenu),f=x8(ce,s.__scopeMenu);return a.createElement(sn.Provider,{scope:s.__scopeMenu},a.createElement(Fs,{present:o||n.open},a.createElement(sn.Slot,{scope:s.__scopeMenu},f.modal?a.createElement(Ch,gs({},i,{ref:e})):a.createElement(gh,gs({},i,{ref:e})))))}),Ch=a.forwardRef((s,e)=>{const t=ut(ce,s.__scopeMenu),o=a.useRef(null),i=ws(e,o);return a.useEffect(()=>{const n=o.current;if(n)return b8(n)},[]),a.createElement(ja,gs({},s,{ref:i,trapFocus:t.open,disableOutsidePointerEvents:t.open,disableOutsideScroll:!0,onFocusOutside:fs(s.onFocusOutside,n=>n.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>t.onOpenChange(!1)}))}),gh=a.forwardRef((s,e)=>{const t=ut(ce,s.__scopeMenu);return a.createElement(ja,gs({},s,{ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>t.onOpenChange(!1)}))}),ja=a.forwardRef((s,e)=>{const{__scopeMenu:t,loop:o=!1,trapFocus:i,onOpenAutoFocus:n,onCloseAutoFocus:f,disableOutsidePointerEvents:l,onEntryFocus:r,onEscapeKeyDown:p,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:b,onDismiss:_,disableOutsideScroll:y,...v}=s,m=ut(ce,t),k=x8(ce,t),h=y8(t),C=Sa(t),x=ah(t),[g,I]=a.useState(null),E=a.useRef(null),P=ws(e,E,m.onContentChange),R=a.useRef(0),O=a.useRef(""),V=a.useRef(0),A=a.useRef(null),Z=a.useRef("right"),N=a.useRef(0),B=y?h8:a.Fragment,H=y?{as:$e,allowPinchZoom:!0}:void 0,U=M=>{var $,S;const j=O.current+M,T=x().filter(Q=>!Q.disabled),D=document.activeElement,L=($=T.find(Q=>Q.ref.current===D))===null||$===void 0?void 0:$.textValue,F=T.map(Q=>Q.textValue),G=Ph(F,j,L),X=(S=T.find(Q=>Q.textValue===G))===null||S===void 0?void 0:S.ref.current;(function Q(es){O.current=es,window.clearTimeout(R.current),es!==""&&(R.current=window.setTimeout(()=>Q(""),1e3))})(j),X&&setTimeout(()=>X.focus())};a.useEffect(()=>()=>window.clearTimeout(R.current),[]),_8();const K=a.useCallback(M=>{var $,S;return Z.current===(($=A.current)===null||$===void 0?void 0:$.side)&&Dh(M,(S=A.current)===null||S===void 0?void 0:S.area)},[]);return a.createElement(mh,{scope:t,searchRef:O,onItemEnter:a.useCallback(M=>{K(M)&&M.preventDefault()},[K]),onItemLeave:a.useCallback(M=>{var $;K(M)||(($=E.current)===null||$===void 0||$.focus(),I(null))},[K]),onTriggerLeave:a.useCallback(M=>{K(M)&&M.preventDefault()},[K]),pointerGraceTimerRef:V,onPointerGraceIntentChange:a.useCallback(M=>{A.current=M},[])},a.createElement(B,H,a.createElement(u8,{asChild:!0,trapped:i,onMountAutoFocus:fs(n,M=>{var $;M.preventDefault(),($=E.current)===null||$===void 0||$.focus()}),onUnmountAutoFocus:f},a.createElement(lo,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:p,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:b,onDismiss:_},a.createElement(Ia,gs({asChild:!0},C,{dir:k.dir,orientation:"vertical",loop:o,currentTabStopId:g,onCurrentTabStopIdChange:I,onEntryFocus:fs(r,M=>{k.isUsingKeyboardRef.current||M.preventDefault()})}),a.createElement(C8,gs({role:"menu","aria-orientation":"vertical","data-state":Ih(m.open),"data-radix-menu-content":"",dir:k.dir},h,v,{ref:P,style:{outline:"none",...v.style},onKeyDown:fs(v.onKeyDown,M=>{const S=M.target.closest("[data-radix-menu-content]")===M.currentTarget,j=M.ctrlKey||M.altKey||M.metaKey,T=M.key.length===1;S&&(M.key==="Tab"&&M.preventDefault(),!j&&T&&U(M.key));const D=E.current;if(M.target!==D||!lh.includes(M.key))return;M.preventDefault();const F=x().filter(G=>!G.disabled).map(G=>G.ref.current);Ra.includes(M.key)&&F.reverse(),Eh(F)}),onBlur:fs(s.onBlur,M=>{M.currentTarget.contains(M.target)||(window.clearTimeout(R.current),O.current="")}),onPointerMove:fs(s.onPointerMove,tn(M=>{const $=M.target,S=N.current!==M.clientX;if(M.currentTarget.contains($)&&S){const j=M.clientX>N.current?"right":"left";Z.current=j,N.current=M.clientX}}))})))))))}),en="MenuItem",Ai="menu.itemSelect",yh=a.forwardRef((s,e)=>{const{disabled:t=!1,onSelect:o,...i}=s,n=a.useRef(null),f=x8(en,s.__scopeMenu),l=Oa(en,s.__scopeMenu),r=ws(e,n),p=a.useRef(!1),c=()=>{const d=n.current;if(!t&&d){const b=new CustomEvent(Ai,{bubbles:!0,cancelable:!0});d.addEventListener(Ai,_=>o==null?void 0:o(_),{once:!0}),qi(d,b),b.defaultPrevented?p.current=!1:f.onClose()}};return a.createElement(xh,gs({},i,{ref:r,disabled:t,onClick:fs(s.onClick,c),onPointerDown:d=>{var b;(b=s.onPointerDown)===null||b===void 0||b.call(s,d),p.current=!0},onPointerUp:fs(s.onPointerUp,d=>{var b;p.current||(b=d.currentTarget)===null||b===void 0||b.click()}),onKeyDown:fs(s.onKeyDown,d=>{const b=l.searchRef.current!=="";t||b&&d.key===" "||ih.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})}))}),xh=a.forwardRef((s,e)=>{const{__scopeMenu:t,disabled:o=!1,textValue:i,...n}=s,f=Oa(en,t),l=Sa(t),r=a.useRef(null),p=ws(e,r),[c,d]=a.useState(!1),[b,_]=a.useState("");return a.useEffect(()=>{const y=r.current;if(y){var v;_(((v=y.textContent)!==null&&v!==void 0?v:"").trim())}},[n.children]),a.createElement(sn.ItemSlot,{scope:t,disabled:o,textValue:i??b},a.createElement(Ea,gs({asChild:!0},l,{focusable:!o}),a.createElement(xs.div,gs({role:"menuitem","data-highlighted":c?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0},n,{ref:p,onPointerMove:fs(s.onPointerMove,tn(y=>{o?f.onItemLeave(y):(f.onItemEnter(y),y.defaultPrevented||y.currentTarget.focus())})),onPointerLeave:fs(s.onPointerLeave,tn(y=>f.onItemLeave(y))),onFocus:fs(s.onFocus,()=>d(!0)),onBlur:fs(s.onBlur,()=>d(!1))}))))}),kh="MenuRadioGroup";Re(kh,{value:void 0,onValueChange:()=>{}});const wh="MenuItemIndicator";Re(wh,{checked:!1});const $h="MenuSub";Re($h);function Ih(s){return s?"open":"closed"}function Eh(s){const e=document.activeElement;for(const t of s)if(t===e||(t.focus(),document.activeElement!==e))return}function Rh(s,e){return s.map((t,o)=>s[(e+o)%s.length])}function Ph(s,e,t){const i=e.length>1&&Array.from(e).every(p=>p===e[0])?e[0]:e,n=t?s.indexOf(t):-1;let f=Rh(s,Math.max(n,0));i.length===1&&(f=f.filter(p=>p!==t));const r=f.find(p=>p.toLowerCase().startsWith(i.toLowerCase()));return r!==t?r:void 0}function Sh(s,e){const{x:t,y:o}=s;let i=!1;for(let n=0,f=e.length-1;n<e.length;f=n++){const l=e[n].x,r=e[n].y,p=e[f].x,c=e[f].y;r>o!=c>o&&t<(p-l)*(o-r)/(c-r)+l&&(i=!i)}return i}function Dh(s,e){if(!e)return!1;const t={x:s.clientX,y:s.clientY};return Sh(t,e)}function tn(s){return e=>e.pointerType==="mouse"?s(e):void 0}const Oh=ch,jh=uh,Th=bh,Mh=vh,Vh=yh,Ta="DropdownMenu",[Ah,um]=qs(Ta,[Pa]),_t=Pa(),[Nh,Ma]=Ah(Ta),Wh=s=>{const{__scopeDropdownMenu:e,children:t,dir:o,open:i,defaultOpen:n,onOpenChange:f,modal:l=!0}=s,r=_t(e),p=a.useRef(null),[c=!1,d]=Xs({prop:i,defaultProp:n,onChange:f});return a.createElement(Nh,{scope:e,triggerId:se(),triggerRef:p,contentId:se(),open:c,onOpenChange:d,onOpenToggle:a.useCallback(()=>d(b=>!b),[d]),modal:l},a.createElement(Oh,ts({},r,{open:c,onOpenChange:d,dir:o,modal:l}),t))},Lh="DropdownMenuTrigger",zh=a.forwardRef((s,e)=>{const{__scopeDropdownMenu:t,disabled:o=!1,...i}=s,n=Ma(Lh,t),f=_t(t);return a.createElement(jh,ts({asChild:!0},f),a.createElement(xs.button,ts({type:"button",id:n.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":n.open?n.contentId:void 0,"data-state":n.open?"open":"closed","data-disabled":o?"":void 0,disabled:o},i,{ref:nn(e,n.triggerRef),onPointerDown:fs(s.onPointerDown,l=>{!o&&l.button===0&&l.ctrlKey===!1&&(n.onOpenToggle(),n.open||l.preventDefault())}),onKeyDown:fs(s.onKeyDown,l=>{o||(["Enter"," "].includes(l.key)&&n.onOpenToggle(),l.key==="ArrowDown"&&n.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})))}),Hh=s=>{const{__scopeDropdownMenu:e,...t}=s,o=_t(e);return a.createElement(Th,ts({},o,t))},qh="DropdownMenuContent",Fh=a.forwardRef((s,e)=>{const{__scopeDropdownMenu:t,...o}=s,i=Ma(qh,t),n=_t(t),f=a.useRef(!1);return a.createElement(Mh,ts({id:i.contentId,"aria-labelledby":i.triggerId},n,o,{ref:e,onCloseAutoFocus:fs(s.onCloseAutoFocus,l=>{var r;f.current||(r=i.triggerRef.current)===null||r===void 0||r.focus(),f.current=!1,l.preventDefault()}),onInteractOutside:fs(s.onInteractOutside,l=>{const r=l.detail.originalEvent,p=r.button===0&&r.ctrlKey===!0,c=r.button===2||p;(!i.modal||c)&&(f.current=!0)}),style:{...s.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))}),Kh=a.forwardRef((s,e)=>{const{__scopeDropdownMenu:t,...o}=s,i=_t(t);return a.createElement(Vh,ts({},i,o,{ref:e}))}),Bh=Wh,Zh=zh,Uh=Hh,Yh=Fh,Gh=Kh;var Xh="_6vehm81",Jh="_6vehm82";const Va=({children:s,...e})=>u.jsx(Uh,{children:u.jsx(Yh,{asChild:!0,className:Xh,"data-macaw-ui-component":"Dropdown.Content",...e,children:s})});Va.displayName="Dropdown.Content";const Aa=({children:s})=>u.jsx(Gh,{asChild:!0,className:Jh,"data-macaw-ui-component":"Dropdown.Item",children:s});Aa.displayName="Dropdown.Item";const Na=({children:s,onOpenChange:e,open:t})=>u.jsx(Bh,{open:t,onOpenChange:e,"data-macaw-ui-component":"Dropdown",children:s});Na.displayName="Dropdown";const Wa=({children:s})=>u.jsx(Zh,{asChild:!0,"data-macaw-ui-component":"Dropdown.Trigger",children:s});Wa.displayName="Dropdown.Trigger";const Qh=Object.assign(Na,{Trigger:Wa,Content:Va,Item:Aa});var sb=$s({defaultClassName:"_18fs8ps2rc _18fs8ps310 _18fs8ps280 _18fs8ps2ho _18fs8ps10 _18fs8ps1r _18fs8ps1lu _18fs8ps1m0 _18fs8ps1li _18fs8ps1lo _18fs8ps1mr _18fs8ps3 _18fs8ps3t0 _18fs8ps3ti _18fs8ps24c _18fs8ps212 _18fs8ps215 _18fs8ps250 _18fs8ps3dc _18fs8ps3e6",variantClassNames:{variant:{contained:"_18fs8ps3q0 _18fs8ps3pd _18fs8ps3p4 _18fs8ps3pt _18fs8ps3qu",text:"_18fs8ps3q0 _18fs8ps3pd _18fs8ps3p4 _18fs8ps3pt _18fs8ps3qu"},size:{small:"_18fs8ps28o _18fs8ps2ic _18fs8ps2ro _18fs8ps31c _18fs8ps1gc _18fs8ps1ff _18fs8ps1i6 _18fs8ps1h9 _18fs8ps1j0 _18fs8ps1k9 _18fs8ps1mx _18fs8ps1zr _18fs8psdr",medium:"_18fs8ps28o _18fs8ps2ic _18fs8ps300 _18fs8ps39o _18fs8ps1gf _18fs8ps1fi _18fs8ps1i9 _18fs8ps1hc _18fs8ps17o _18fs8ps1j3 _18fs8ps1k9 _18fs8ps1n0 _18fs8ps1zr _18fs8psdl",large:"_18fs8ps290 _18fs8ps2io _18fs8ps2s0 _18fs8ps31o _18fs8ps1gf _18fs8ps1fi _18fs8ps1i9 _18fs8ps1hc _18fs8ps17u _18fs8ps1j6 _18fs8ps1kc _18fs8ps1n3 _18fs8ps1zr _18fs8psdo"}},defaultVariants:{size:"medium"},compoundVariants:[]});const La=a.forwardRef(({children:s,size:e,variant:t="contained",disabled:o,className:i,...n},f)=>u.jsxs(Y,{as:"button",className:ps(sb({size:e,variant:t}),i),disabled:o,ref:f,"data-macaw-ui-component":"DropdownButton",...n,children:[s,u.jsx(tt,{size:"small",className:Js({color:"default2"})})]}));La.displayName="DropdownButton";const eb=s=>{const e=/^[\d.,]*$|(Backspace|Tab|Delete|ArrowLeft|ArrowRight|ArrowDown|ArrowUp)/;return!s.key.match(e)&&s.preventDefault()},tb=(s,e,t)=>ob(s)||e!==""&&e!==void 0?!0:t,ob=s=>["date","time","datetime-local"].includes(s??""),nb=(s,e,t)=>{const[o,i]=a.useState(!1),n=tb(e,s,o);return{handlers:{onFocus:()=>i(!0),onBlur:()=>i(!1),onChange:p=>{t&&t(p)}},value:s,active:o,typed:n}},za=({children:s,id:e,typed:t,active:o,disabled:i,size:n,label:f,error:l,className:r,endAdornment:p})=>u.jsxs(Y,{as:"label",htmlFor:e,className:ps(nt({typed:t,active:o,disabled:i,size:n,error:l}),r),alignItems:"center",gap:1,"data-macaw-ui-component":"Input",children:[u.jsxs(Y,{display:"flex",flexDirection:"column",width:"100%",children:[u.jsx(Y,{as:"span",className:ps(it({typed:t,size:n,disabled:i,error:l})),children:f}),s]}),p]});za.displayName="InputWrapper";const Zt=a.forwardRef(({size:s,disabled:e=!1,className:t,value:o,label:i,id:n,type:f,error:l=!1,onChange:r,helperText:p,onBlur:c,onFocus:d,flex:b,flexBasis:_,flexGrow:y,flexShrink:v,width:m,endAdornment:k,...h},C)=>{const{handlers:x,value:g,active:I,typed:E}=nb(o,f,r);return u.jsxs(Y,{display:"flex",flexDirection:"column",flex:b,flexBasis:_,flexGrow:y,flexShrink:v,width:m,children:[u.jsx(za,{id:n,typed:E,active:I,disabled:e,size:s,label:i,error:l,className:t,endAdornment:k,children:u.jsx(Y,{id:n,as:"input",type:f,className:ps(Jt({size:s,error:l})),disabled:e,value:g,ref:C,onBlur:P=>{x.onBlur(),c==null||c(P)},onFocus:P=>{x.onFocus(),d==null||d(P)},onChange:x.onChange,onKeyDown:P=>{f==="number"&&eb(P)},role:"input",...h})}),p&&u.jsx(Y,{className:hn({size:s}),children:u.jsx(Ps,{size:ve(s),color:l?"critical1":"default2",children:p})})]})});Zt.displayName="Input";const Ha=({children:s,...e})=>u.jsx(Y,{as:"li",...e,"data-macaw-ui-component":"List.Divider",children:s});Ha.displayName="List.Divider";const qa=a.forwardRef(({children:s,disabled:e,onClick:t,className:o,active:i,...n},f)=>u.jsx(Y,{as:"li",display:"flex",alignItems:"center",cursor:{default:"pointer",disabled:"not-allowed"},disabled:e,backgroundColor:{default:i?"default1Focused":"transparent",active:"default1Pressed",hover:"default1Hovered",focus:"default1Focused"},onClick:t,className:o,ref:f,"data-macaw-ui-component":"List.Item",...n,children:s}));qa.displayName="List.Item";const Fa=({children:s})=>u.jsx(Ji,{asChild:!0,"data-macaw-ui-component":"ListItem.Content",children:s});Fa.displayName="ListItem.Content";const k8=a.forwardRef(({children:s,as:e="ul",className:t,...o},i)=>u.jsx(Y,{as:e,ref:i,className:t,margin:0,"data-macaw-ui-component":"List",...o,children:s}));k8.displayName="List";const Ka=a.createContext(null),ib=()=>{const s=a.useContext(Ka);if(s===null)throw new Error("You are outside of context");return s},fb=Ka.Provider;var lb="_16tmpu02",ab="_16tmpu01",rb="_16tmpu00";const Ao="list-item-group-value",Ba=({children:s,defaultExpanded:e=!1,as:t="ul",...o})=>{const[i,n]=a.useState(e?Ao:"");return u.jsx(sf,{asChild:!0,type:"single",collapsible:!0,value:i,onValueChange:n,children:u.jsx(fb,{value:{triggerOpen:()=>n(Ao)},children:u.jsx(k8,{as:t,...o,"data-macaw-ui-component":"ListItem",children:u.jsx(ef,{value:Ao,className:rb,children:s})})})})};Ba.displayName="ListItem";const Za=({children:s,size:e,...t})=>{const{triggerOpen:o}=ib();return u.jsxs(Hs.Item,{"data-macaw-ui-component":"ItemGroup.Trigger",...t,children:[u.jsx(Y,{width:"100%",height:"100%",onClick:o,children:s}),u.jsx(Xi,{asChild:!0,children:u.jsx(et,{icon:u.jsx(un,{className:ab,color:"default1",size:e}),variant:"tertiary",size:e,className:lb})})]})};Za.displayName="ListItem.Trigger";const pb=Object.assign(Ba,{Trigger:Za,Content:Fa}),Hs=Object.assign(k8,{Item:qa,ItemGroup:pb,Divider:Ha}),Ua=({children:s})=>u.jsx(_a,{asChild:!0,"data-macaw-ui-component":"Modal.Close",children:s});Ua.displayName="Modal.Close";var Ni="w2pmqx1";const db=s=>s?{onOpenAutoFocus:e=>{e.preventDefault()}}:{},Ya=({children:s,disableAutofocus:e})=>u.jsx(da,{children:u.jsx(ca,{asChild:!0,className:Ni,children:u.jsx(Xt,{children:u.jsx(ua,{asChild:!0,className:Ni,...db(e),children:s})})})});Ya.displayName="Modal.Content";const Ga=({children:s,open:e,onChange:t})=>u.jsx(ra,{"data-macaw-ui-component":"Modal",open:e,onOpenChange:t,children:s});Ga.displayName="Modal";const Xa=({children:s})=>u.jsx(pa,{asChild:!0,"data-macaw-ui-component":"Modal.Trigger",children:s});Xa.displayName="Modal.Trigger";const cb=Object.assign(Ga,{Content:Ya,Trigger:Xa,Close:Ua});var Ja=$s({defaultClassName:"_1g8t8xp8 _18fs8ps2rc _18fs8ps310 _18fs8ps280 _18fs8ps2ho _18fs8ps1lr _18fs8ps1lx _18fs8ps1lf _18fs8ps1ll _18fs8ps16u _18fs8ps3s0 _18fs8ps1j6 _18fs8ps1kc _18fs8ps1mr _18fs8ps3dc _18fs8ps3e6",variantClassNames:{size:{small:"_18fs8ps1j0 _18fs8ps1k6 _18fs8ps1mx",medium:"_18fs8ps1j3 _18fs8ps1k9 _18fs8ps1n0",large:"_18fs8ps1j3 _18fs8ps1k9 _18fs8ps1n0"},error:{true:"_18fs8ps3co"}},defaultVariants:{size:"medium"},compoundVariants:[]}),ub=$s({defaultClassName:"_1g8t8xp0",variantClassNames:{typed:{true:"_1g8t8xp2"}},defaultVariants:{},compoundVariants:[]});const _b=({size:s,getToggleButtonProps:e,renderEndAdornment:t,disabled:o})=>t?u.jsx(u.Fragment,{children:t(e())}):u.jsx(tt,{className:ps(bn,Js({cursor:"pointer"})),size:s,...e({disabled:o})}),w8=a.forwardRef(({id:s,label:e,className:t,error:o,children:i,getLabelProps:n,typed:f,active:l,disabled:r,size:p,getToggleButtonProps:c,renderEndAdornment:d,hasItemsToSelect:b},_)=>u.jsxs(Y,{ref:_,as:"label",className:ps(nt({typed:f,active:l,disabled:r,size:p,error:o}),t),alignItems:"center",justifyContent:"space-between",disabled:r,flexWrap:"nowrap",gap:3,"data-macaw-ui-component":"Multiselect",...n({htmlFor:s}),cursor:r?"not-allowed":"text",children:[u.jsxs(Y,{display:"flex",flexDirection:"column",width:"100%",children:[u.jsx(Y,{as:"span",className:ps(ub({typed:f}),it({typed:f,size:p,disabled:r,error:o})),children:e}),u.jsx(Y,{display:"flex",flexDirection:"row",gap:1,alignItems:"center",flexWrap:"wrap",children:i})]}),b?u.jsx(_b,{size:p,getToggleButtonProps:c,renderEndAdornment:d,disabled:r}):u.jsx(Y,{width:5,height:5})]}));w8.displayName="MultiselectWrapper";const hb=(s,e,t)=>{const o=e==null?void 0:e.toLowerCase();return t.filter(i=>!s.find(n=>n.value===i.value)&&i.label.toLowerCase().includes(o??""))},Qa=({selectedValues:s,showEmptyState:e=!1,options:t,onChange:o,onInputValueChange:i,onFocus:n,onBlur:f})=>{const[l,r]=a.useState(""),[p,c]=a.useState(!1),d=yo(s)?s.reduce((R,O)=>{const V=t.find(A=>A.value===O);return V&&R.push(V),R},[]):s,b=hb(d,l,t),_=i||e?!0:d.length!==t.length,y=!!(d.length||p),{getSelectedItemProps:v,getDropdownProps:m,removeSelectedItem:k}=ye({selectedItems:d,onStateChange({selectedItems:R,type:O}){switch(O){case ye.stateChangeTypes.SelectedItemKeyDownBackspace:case ye.stateChangeTypes.SelectedItemKeyDownDelete:case ye.stateChangeTypes.DropdownKeyDownBackspace:case ye.stateChangeTypes.FunctionRemoveSelectedItem:{const V=yo(s)?R==null?void 0:R.map(A=>A.value):R;o==null||o(V);break}}}}),{isOpen:h,getLabelProps:C,getMenuProps:x,getInputProps:g,highlightedIndex:I,getItemProps:E,getToggleButtonProps:P}=Us({items:b,itemToString:R=>(R==null?void 0:R.label)??"",defaultHighlightedIndex:0,isItemDisabled:R=>(R==null?void 0:R.disabled)??!1,selectedItem:null,stateReducer(R,O){const{changes:V,type:A}=O;switch(A){case Us.stateChangeTypes.InputKeyDownEnter:case Us.stateChangeTypes.ItemClick:return r(""),{...V,...V.selectedItem&&{isOpen:!0,highlightedIndex:0}};default:return V}},onStateChange({inputValue:R,type:O,selectedItem:V}){switch(O){case Us.stateChangeTypes.InputKeyDownEnter:case Us.stateChangeTypes.ItemClick:case Us.stateChangeTypes.InputBlur:if(V){const A=yo(s)?[...d.map(Z=>Z.value),V.value]:[...d,V];o==null||o(A)}else r("");break;case Us.stateChangeTypes.InputChange:i==null||i(R??""),r(R??"");break}}});return{active:p,itemsToSelect:b,typed:y,isOpen:h,getLabelProps:C,getMenuProps:x,getInputProps:(R,O)=>g(m({onFocus:V=>{c(!0),n==null||n(V)},onBlur:V=>{c(!1),f==null||f(V)},preventKeyAction:h,...R}),O),highlightedIndex:I,getItemProps:E,getSelectedItemProps:v,removeSelectedItem:k,selectedItems:d,inputValue:l,showInput:_,getToggleButtonProps:R=>P({onClick:O=>{O.preventDefault()},...R}),hasItemsToSelect:b.length>0}},bb=({size:s,disabled:e=!1,className:t,label:o,id:i,error:n=!1,helperText:f,options:l,onChange:r,renderEndAdornment:p,value:c=[],onFocus:d,onBlur:b,children:_,locale:y={inputText:"Add item"},...v},m)=>{const{active:k,typed:h,isOpen:C,getLabelProps:x,getMenuProps:g,getInputProps:I,highlightedIndex:E,getItemProps:P,itemsToSelect:R,selectedItems:O,getSelectedItemProps:V,inputValue:A,removeSelectedItem:Z,getToggleButtonProps:N,hasItemsToSelect:B,showInput:H}=Qa({selectedValues:c,showEmptyState:Ve(_),options:l,onChange:r,onFocus:d,onBlur:b}),{refs:U,floatingStyles:K}=dt(),M=I({id:i,ref:m,value:A});return u.jsxs(Y,{display:"flex",flexDirection:"column",children:[u.jsxs(w8,{ref:U.setReference,id:i,typed:h,active:k,disabled:e,size:s,label:o,error:n,className:t,getLabelProps:x,getToggleButtonProps:N,renderEndAdornment:p,hasItemsToSelect:B,children:[O.map(($,S)=>u.jsxs(Y,{"data-test-id":`selected-option-${$.value}-${S}`,paddingX:1.5,paddingY:"px",backgroundColor:"default1",borderColor:"default1",borderWidth:1,borderStyle:"solid",borderRadius:3,display:"flex",gap:1,alignItems:"center",...V({selectedItem:$,index:S}),children:[u.jsx(Ps,{size:1,children:$.label}),!e&&u.jsx(Ps,{cursor:"pointer",size:1,onClick:j=>{j.stopPropagation(),j.preventDefault(),Z($)},children:"✕"})]},`selected-option-${$.value}-${S}`)),u.jsx(Y,{as:"input",className:Ja({size:s,error:n}),placeholder:y.inputText,disabled:e,width:0,__flex:1,minWidth:7,visibility:H?"visible":"hidden",...M,...v,onChange:M.onChange&&to(M.onChange)})]}),u.jsx(ot,{asChild:!0,ref:U.setFloating,style:K,children:u.jsx(Y,{position:"relative",display:C?"block":"none",className:at({size:s}),children:u.jsxs(Hs,{as:"ul",className:lt,...g({},{suppressRefError:!0}),children:[C&&(R==null?void 0:R.map(($,S)=>u.jsx(Hs.Item,{"data-test-id":"select-option",disabled:$.disabled,className:We,active:E===S,...P({item:$,index:S}),children:u.jsx(Ps,{color:$.disabled?"defaultDisabled":void 0,size:rt(s),children:$.label})},`to-select-${i}-${$.value}-${S}`))),C&&!B&&_]})})}),f&&u.jsx(ft,{size:s,error:n,children:f})]})},sr=a.forwardRef(bb),mb=Object.assign(sr,{NoOptions:Le}),vb=({size:s,disabled:e=!1,className:t,label:o,id:i,error:n=!1,helperText:f,options:l,onChange:r,renderEndAdornment:p,value:c=[],onInputValueChange:d,loading:b,onFocus:_,onBlur:y,locale:v,children:m,onScrollEnd:k,...h},C)=>{const{active:x,typed:g,isOpen:I,getLabelProps:E,getMenuProps:P,getInputProps:R,highlightedIndex:O,getItemProps:V,itemsToSelect:A,selectedItems:Z,getSelectedItemProps:N,inputValue:B,removeSelectedItem:H,getToggleButtonProps:U,hasItemsToSelect:K,showInput:M}=Qa({selectedValues:c,showEmptyState:Ve(m),onInputValueChange:d,options:l,onChange:r,onFocus:_,onBlur:y}),{refs:$,floatingStyles:S}=dt(),j=Bl(k),T=R({id:i,ref:C,value:B});return u.jsxs(Y,{display:"flex",flexDirection:"column",children:[u.jsxs(w8,{ref:$.setReference,id:i,typed:g,active:x,disabled:e,size:s,label:o,error:n,className:t,getLabelProps:E,getToggleButtonProps:U,renderEndAdornment:p,hasItemsToSelect:K,children:[Z.map((D,L)=>u.jsxs(Y,{"data-test-id":`selected-option-${D.value}-${L}`,paddingX:1.5,paddingY:"px",backgroundColor:"default1",borderColor:"default1",borderWidth:1,borderStyle:"solid",borderRadius:3,display:"flex",gap:1,alignItems:"center",...N({selectedItem:D,index:L}),children:[u.jsx(Ps,{size:1,children:D.label}),!e&&u.jsx(Ps,{cursor:"pointer",size:1,onClick:F=>{F.stopPropagation(),F.preventDefault(),H(D)},children:"✕"})]},`selected-option-${D.value}-${L}`)),u.jsx(Y,{as:"input",className:Ja({size:s,error:n}),placeholder:(v==null?void 0:v.placeholderText)||"Add item",disabled:e,width:0,__flex:1,minWidth:7,visibility:M?"visible":"hidden",...T,...h,onChange:T.onChange&&to(T.onChange)})]}),u.jsx(ot,{asChild:!0,ref:$.setFloating,style:S,children:u.jsx(Y,{position:"relative",display:Qt({isOpen:I,loading:b,hasItemsToSelect:K,disabled:e,showEmptyState:Ve(m)}),className:at({size:s}),children:u.jsxs(Hs,{as:"ul",className:lt,...P({},{suppressRefError:!0}),children:[I&&(A==null?void 0:A.map((D,L)=>u.jsx(Hs.Item,{"data-test-id":"select-option",className:We,active:O===L,...V({item:D,index:L,disabled:D.disabled}),children:u.jsx(Ps,{color:D.disabled?"defaultDisabled":void 0,size:rt(s),children:D.label})},`to-select-${i}-${D.value}-${L}`))),I&&!b&&!K&&m,b&&u.jsx(Pf,{size:s,children:(v==null?void 0:v.loadingText)||"Loading"}),u.jsx("div",{ref:D=>{j.current=D}})]})})}),f&&u.jsx(ft,{size:s,error:n,children:f})]})},Cb=a.forwardRef(vb),gb=Object.assign(Cb,{NoOptions:Le}),er=a.forwardRef(({...s},e)=>u.jsx(Ps,{ref:e,display:"block",as:"p",...s}));er.displayName="Paragraph";const tr="Popover",[or,_m]=qs(tr,[qe]),ht=qe(),[yb,Ce]=or(tr),xb=s=>{const{__scopePopover:e,children:t,open:o,defaultOpen:i,onOpenChange:n,modal:f=!1}=s,l=ht(e),r=a.useRef(null),[p,c]=a.useState(!1),[d=!1,b]=Xs({prop:o,defaultProp:i,onChange:n});return a.createElement(v8,l,a.createElement(yb,{scope:e,contentId:se(),triggerRef:r,open:d,onOpenChange:b,onOpenToggle:a.useCallback(()=>b(_=>!_),[b]),hasCustomAnchor:p,onCustomAnchorAdd:a.useCallback(()=>c(!0),[]),onCustomAnchorRemove:a.useCallback(()=>c(!1),[]),modal:f},t))},kb="PopoverAnchor",wb=a.forwardRef((s,e)=>{const{__scopePopover:t,...o}=s,i=Ce(kb,t),n=ht(t),{onCustomAnchorAdd:f,onCustomAnchorRemove:l}=i;return a.useEffect(()=>(f(),()=>l()),[f,l]),a.createElement(po,ts({},n,o,{ref:e}))}),$b="PopoverTrigger",Ib=a.forwardRef((s,e)=>{const{__scopePopover:t,...o}=s,i=Ce($b,t),n=ht(t),f=ws(e,i.triggerRef),l=a.createElement(xs.button,ts({type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":fr(i.open)},o,{ref:f,onClick:fs(s.onClick,i.onOpenToggle)}));return i.hasCustomAnchor?l:a.createElement(po,ts({asChild:!0},n),l)}),nr="PopoverPortal",[Eb,Rb]=or(nr,{forceMount:void 0}),Pb=s=>{const{__scopePopover:e,forceMount:t,children:o,container:i}=s,n=Ce(nr,e);return a.createElement(Eb,{scope:e,forceMount:t},a.createElement(Fs,{present:t||n.open},a.createElement(ao,{asChild:!0,container:i},o)))},Je="PopoverContent",Sb=a.forwardRef((s,e)=>{const t=Rb(Je,s.__scopePopover),{forceMount:o=t.forceMount,...i}=s,n=Ce(Je,s.__scopePopover);return a.createElement(Fs,{present:o||n.open},n.modal?a.createElement(Db,ts({},i,{ref:e})):a.createElement(Ob,ts({},i,{ref:e})))}),Db=a.forwardRef((s,e)=>{const t=Ce(Je,s.__scopePopover),o=a.useRef(null),i=ws(e,o),n=a.useRef(!1);return a.useEffect(()=>{const f=o.current;if(f)return b8(f)},[]),a.createElement(h8,{as:$e,allowPinchZoom:!0},a.createElement(ir,ts({},s,{ref:i,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:fs(s.onCloseAutoFocus,f=>{var l;f.preventDefault(),n.current||(l=t.triggerRef.current)===null||l===void 0||l.focus()}),onPointerDownOutside:fs(s.onPointerDownOutside,f=>{const l=f.detail.originalEvent,r=l.button===0&&l.ctrlKey===!0,p=l.button===2||r;n.current=p},{checkForDefaultPrevented:!1}),onFocusOutside:fs(s.onFocusOutside,f=>f.preventDefault(),{checkForDefaultPrevented:!1})})))}),Ob=a.forwardRef((s,e)=>{const t=Ce(Je,s.__scopePopover),o=a.useRef(!1),i=a.useRef(!1);return a.createElement(ir,ts({},s,{ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:n=>{var f;if((f=s.onCloseAutoFocus)===null||f===void 0||f.call(s,n),!n.defaultPrevented){var l;o.current||(l=t.triggerRef.current)===null||l===void 0||l.focus(),n.preventDefault()}o.current=!1,i.current=!1},onInteractOutside:n=>{var f,l;(f=s.onInteractOutside)===null||f===void 0||f.call(s,n),n.defaultPrevented||(o.current=!0,n.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const r=n.target;((l=t.triggerRef.current)===null||l===void 0?void 0:l.contains(r))&&n.preventDefault(),n.detail.originalEvent.type==="focusin"&&i.current&&n.preventDefault()}}))}),ir=a.forwardRef((s,e)=>{const{__scopePopover:t,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:n,disableOutsidePointerEvents:f,onEscapeKeyDown:l,onPointerDownOutside:r,onFocusOutside:p,onInteractOutside:c,...d}=s,b=Ce(Je,t),_=ht(t);return _8(),a.createElement(u8,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:i,onUnmountAutoFocus:n},a.createElement(lo,{asChild:!0,disableOutsidePointerEvents:f,onInteractOutside:c,onEscapeKeyDown:l,onPointerDownOutside:r,onFocusOutside:p,onDismiss:()=>b.onOpenChange(!1)},a.createElement(C8,ts({"data-state":fr(b.open),role:"dialog",id:b.contentId},_,d,{ref:e,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}}))))}),jb="PopoverClose",Tb=a.forwardRef((s,e)=>{const{__scopePopover:t,...o}=s,i=Ce(jb,t);return a.createElement(xs.button,ts({type:"button"},o,{ref:e,onClick:fs(s.onClick,()=>i.onOpenChange(!1))}))}),Mb=a.forwardRef((s,e)=>{const{__scopePopover:t,...o}=s,i=ht(t);return a.createElement(ka,ts({},i,o,{ref:e}))});function fr(s){return s?"open":"closed"}const Vb=xb,Ab=wb,Nb=Ib,Wb=Pb,Lb=Sb,zb=Tb,Hb=Mb;var qb="_1t0scx21",Fb="_18fs8ps1lu _18fs8ps1m0 _18fs8ps1li _18fs8ps1lo _18fs8ps1gf _18fs8ps1fi _18fs8ps1i9 _18fs8ps1hc _18fs8ps250 _18fs8ps21o _18fs8ps3v0 _18fs8ps3q0";const lr=({children:s,className:e,onInteractOutside:t,...o})=>u.jsx(Wb,{children:u.jsx(Lb,{asChild:!0,className:ps(Fb,e),"data-macaw-ui-component":"Popover.Content",onInteractOutside:t,...o,children:s})});lr.displayName="Popover.Content";const ar=({children:s})=>u.jsx(Ab,{asChild:!0,"data-macaw-ui-component":"Popover.Anchor",children:s});ar.displayName="Popover.Anchor";const rr=({children:s})=>u.jsx(Nb,{asChild:!0,"data-macaw-ui-component":"Popover.Trigger",children:s});rr.displayName="Popover.Trigger";const pr=({className:s,fill:e="default2",stroke:t="default1"})=>u.jsx(Hb,{className:ps(qb,s),asChild:!0,children:u.jsx("svg",{width:"20",height:"9",viewBox:"0 0 20 9",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-macaw-ui-component":"Popover.Arrow",children:u.jsx("path",{d:"M8.08579 7.08579L0.5 -0.5H18.5L10.9142 7.08579C10.1332 7.86683 8.86684 7.86684 8.08579 7.08579Z",strokeLinejoin:"round",className:Js({fill:e,stroke:t})})})});pr.displayName="Popover.Arrow";const dr=({children:s,...e})=>u.jsx(Vb,{...e,"data-macaw-ui-component":"Popover",children:s});dr.displayName="Popover";const cr=({children:s})=>u.jsx(zb,{asChild:!0,"data-macaw-ui-component":"Popover.Close",children:s});cr.displayName="Popover.Close";const Kb=Object.assign(dr,{Trigger:rr,Content:lr,Anchor:ar,Arrow:pr,Close:cr}),ur="Radio",[Bb,_r]=qs(ur),[Zb,Ub]=Bb(ur),Yb=a.forwardRef((s,e)=>{const{__scopeRadio:t,name:o,checked:i=!1,required:n,disabled:f,value:l="on",onCheck:r,...p}=s,[c,d]=a.useState(null),b=ws(e,v=>d(v)),_=a.useRef(!1),y=c?!!c.closest("form"):!0;return a.createElement(Zb,{scope:t,checked:i,disabled:f},a.createElement(xs.button,ts({type:"button",role:"radio","aria-checked":i,"data-state":hr(i),"data-disabled":f?"":void 0,disabled:f,value:l},p,{ref:b,onClick:fs(s.onClick,v=>{i||r==null||r(),y&&(_.current=v.isPropagationStopped(),_.current||v.stopPropagation())})})),y&&a.createElement(Jb,{control:c,bubbles:!_.current,name:o,value:l,checked:i,required:n,disabled:f,style:{transform:"translateX(-100%)"}}))}),Gb="RadioIndicator",Xb=a.forwardRef((s,e)=>{const{__scopeRadio:t,forceMount:o,...i}=s,n=Ub(Gb,t);return a.createElement(Fs,{present:o||n.checked},a.createElement(xs.span,ts({"data-state":hr(n.checked),"data-disabled":n.disabled?"":void 0},i,{ref:e})))}),Jb=s=>{const{control:e,checked:t,bubbles:o=!0,...i}=s,n=a.useRef(null),f=xf(t),l=_n(e);return a.useEffect(()=>{const r=n.current,p=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(p,"checked").set;if(f!==t&&d){const b=new Event("click",{bubbles:o});d.call(r,t),r.dispatchEvent(b)}},[f,t,o]),a.createElement("input",ts({type:"radio","aria-hidden":!0,defaultChecked:t},i,{tabIndex:-1,ref:n,style:{...s.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function hr(s){return s?"checked":"unchecked"}const Qb=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],br="RadioGroup",[s2,hm]=qs(br,[co,_r]),mr=co(),vr=_r(),[e2,t2]=s2(br),o2=a.forwardRef((s,e)=>{const{__scopeRadioGroup:t,name:o,defaultValue:i,value:n,required:f=!1,disabled:l=!1,orientation:r,dir:p,loop:c=!0,onValueChange:d,...b}=s,_=mr(t),y=Ut(p),[v,m]=Xs({prop:n,defaultProp:i,onChange:d});return a.createElement(e2,{scope:t,name:o,required:f,disabled:l,value:v,onValueChange:m},a.createElement(Ia,ts({asChild:!0},_,{orientation:r,dir:y,loop:c}),a.createElement(xs.div,ts({role:"radiogroup","aria-required":f,"aria-orientation":r,"data-disabled":l?"":void 0,dir:y},b,{ref:e}))))}),n2="RadioGroupItem",i2=a.forwardRef((s,e)=>{const{__scopeRadioGroup:t,disabled:o,...i}=s,n=t2(n2,t),f=n.disabled||o,l=mr(t),r=vr(t),p=a.useRef(null),c=ws(e,p),d=n.value===i.value,b=a.useRef(!1);return a.useEffect(()=>{const _=v=>{Qb.includes(v.key)&&(b.current=!0)},y=()=>b.current=!1;return document.addEventListener("keydown",_),document.addEventListener("keyup",y),()=>{document.removeEventListener("keydown",_),document.removeEventListener("keyup",y)}},[]),a.createElement(Ea,ts({asChild:!0},l,{focusable:!f,active:d}),a.createElement(Yb,ts({disabled:f,required:n.required,checked:d},r,i,{name:n.name,ref:c,onCheck:()=>n.onValueChange(i.value),onKeyDown:fs(_=>{_.key==="Enter"&&_.preventDefault()}),onFocus:fs(i.onFocus,()=>{var _;b.current&&((_=p.current)===null||_===void 0||_.click())})})))}),f2=a.forwardRef((s,e)=>{const{__scopeRadioGroup:t,...o}=s,i=vr(t);return a.createElement(Xb,ts({},i,o,{ref:e}))}),Cr=o2,gr=i2,l2=f2;var a2="_18fs8ps2rc _18fs8ps310 _18fs8ps280 _18fs8ps2ho _18fs8psuf _18fs8pswx _18fs8pszf _18fs8ps11x _18fs8ps1lr _18fs8ps1lx _18fs8ps1lf _18fs8ps1ll",r2=$s({defaultClassName:"_18fs8ps2rc _18fs8ps310 _18fs8ps280 _18fs8ps2ho _18fs8psuf _18fs8pswx _18fs8pszf _18fs8ps11x",variantClassNames:{size:{small:"_18fs8ps1j0 _18fs8ps1mx _18fs8ps1k6",medium:"_18fs8ps1j3 _18fs8ps1n0 _18fs8ps1k9",large:"_18fs8ps1j6 _18fs8ps1n3 _18fs8ps1kc"},disabled:{true:"_18fs8ps3e0"},error:{true:"_18fs8ps3d0",false:"_18fs8ps3do"}},defaultVariants:{size:"medium"},compoundVariants:[]});const yr=a.forwardRef(({children:s,className:e,value:t,label:o,onValueChange:i,size:n,disabled:f=!1,error:l=!1,...r},p)=>u.jsx(Cr,{asChild:!0,value:t,onValueChange:i,children:u.jsxs(Y,{...r,className:ps(a2,e),ref:p,as:"fieldset","data-macaw-ui-component":"RadioGroup",children:[o&&u.jsx("legend",{className:ps(r2({disabled:f,error:l,size:n}),e),children:o}),s]})}));yr.displayName="RadioGroup";var p2=$s({defaultClassName:"_18fs8ps1px _18fs8ps1sc _18fs8ps1ur _18fs8ps1x6 _18fs8ps2o _18fs8psf _18fs8ps1yu",variantClassNames:{disabled:{true:"_18fs8ps3e0",false:"_18fs8ps3bo"}},defaultVariants:{disabled:!1},compoundVariants:[]}),d2=$s({defaultClassName:"_1ru9wzg7 _18fs8ps2rc _18fs8ps310 _18fs8ps280 _18fs8ps2ho _18fs8ps1lu _18fs8ps1m0 _18fs8ps1li _18fs8ps1lo _18fs8ps1h3 _18fs8ps1g6 _18fs8ps1ix _18fs8ps1i0 _18fs8ps2l _18fs8ps3uo _18fs8ps21o _18fs8ps3t0 _18fs8ps250 _18fs8ps14o _18fs8ps179 _18fs8ps3oo",variantClassNames:{error:{true:"_1ru9wzg8"},disabled:{true:"_1ru9wzg9"}},defaultVariants:{error:!1,disabled:!1},compoundVariants:[]});const $8=a.forwardRef(({disabled:s,asChild:e},t)=>u.jsx(l2,{className:p2({disabled:s}),asChild:e,ref:t,children:u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"6",height:"6",fill:"currentColor",children:u.jsx("circle",{cx:"3",cy:"3",r:"3",fill:"currentColor"})})}));$8.displayName="RadioGroupIndicator";const xr=a.forwardRef(({value:s,id:e,disabled:t,children:o,className:i,error:n,...f},l)=>u.jsxs(Y,{display:"flex",alignItems:"center",gap:1.5,position:"relative",...f,className:i,ref:l,"data-macaw-ui-component":"RadioGroup.Item",children:[u.jsx(gr,{className:d2({error:n,disabled:t}),value:s,id:e,disabled:t,children:u.jsx($8,{disabled:t,asChild:!0})}),u.jsx(Y,{as:"label",htmlFor:e,cursor:t?"not-allowed":"pointer",children:o})]}));xr.displayName="RadioGroup.Item";const c2=Object.assign(yr,{Item:xr,Indicator:$8}),kr=a.forwardRef(({value:s=["",""],onChange:e,children:t,type:o="number",...i},n)=>{const[f,l]=s;return u.jsxs(u.Fragment,{children:[u.jsx(Zt,{value:f,onChange:r=>e==null?void 0:e([r.target.value,l]),type:o,ref:n,...i}),t,u.jsx(Zt,{value:l,onChange:r=>e==null?void 0:e([f,r.target.value]),type:o,ref:n,...i})]})});kr.displayName="RangeInput";var u2=$s({defaultClassName:"_18fs8ps2rc _18fs8ps310 _18fs8ps280 _18fs8ps2ho _18fs8ps1lr _18fs8ps1lx _18fs8ps1lf _18fs8ps1ll _18fs8ps16u _18fs8ps3s0 _18fs8ps1mr _18fs8ps3dc _18fs8ps3du _18fs8ps3dv",variantClassNames:{},defaultVariants:{},compoundVariants:[]}),_2=$s({defaultClassName:"_18fs8ps1gf _18fs8ps1fi _18fs8ps1i9 _18fs8ps1hc _18fs8ps2l _18fs8ps3 _18fs8ps10 _18fs8ps3dc _18fs8ps16u _18fs8ps3wo _18fs8ps3oo _18fs8ps3pd _18fs8ps3p3",variantClassNames:{size:{small:"_18fs8ps28o _18fs8ps2ic _18fs8ps300 _18fs8ps39o",medium:"_18fs8ps28o _18fs8ps2ic _18fs8ps2s0 _18fs8ps31o",large:"_18fs8ps290 _18fs8ps2io _18fs8ps2sc _18fs8ps320"}},defaultVariants:{},compoundVariants:[]}),h2=$s({defaultClassName:"_18fs8ps3do _18fs8ps123",variantClassNames:{},defaultVariants:{},compoundVariants:[]});const wr=a.forwardRef(({id:s,className:e,size:t,...o},i)=>u.jsxs(Y,{id:s,className:ps(_2({size:t}),e),"data-macaw-ui-component":"SearchInput",children:[u.jsx(vf,{size:"medium",className:h2()}),u.jsx(Y,{as:"input",className:u2(),ref:i,type:"text",...o})]}));wr.displayName="SearchInput";const $r=a.forwardRef(({id:s,label:e,className:t,error:o,children:i,getToggleButtonProps:n,getLabelProps:f,typed:l,active:r,disabled:p,size:c},d)=>u.jsx(Y,{ref:d,children:u.jsxs(Y,{as:"label",className:ps(nt({typed:l,active:r,disabled:p,size:c,error:o}),t),alignItems:"center",justifyContent:"space-between",disabled:p,flexWrap:"nowrap",gap:3,...n(),"data-macaw-ui-component":"Select",cursor:p?"not-allowed":"pointer",children:[u.jsxs(Y,{display:"flex",flexDirection:"column",__width:"calc(100% - 30px)",children:[u.jsx(Y,{as:"span",className:ps(it({typed:l,size:c,disabled:p,error:o})),...f({htmlFor:s}),children:e}),i]}),u.jsx(tt,{className:ps(bn,Js({cursor:"pointer"})),size:c})]})}));$r.displayName="SelectWrapper";const b2=({value:s,isValuePassedAsString:e,options:t,onChange:o,onFocus:i,onBlur:n})=>{const[f,l]=a.useState(!1),r=!!(s||f),{highlightedIndex:p,onHighlightedIndexChange:c}=Sf(t,s),{isOpen:d,getToggleButtonProps:b,getLabelProps:_,getMenuProps:y,getItemProps:v,selectedItem:m}=Ln({items:t,selectedItem:s??null,isItemDisabled:k=>(k==null?void 0:k.disabled)??!1,highlightedIndex:p,onHighlightedIndexChange(k){c(k)},itemToString:k=>(k==null?void 0:k.value)??"",onSelectedItemChange:({selectedItem:k})=>{if(k){const h=e?k.value:k;o==null||o(h)}}});return{active:f,typed:r,isOpen:d,getToggleButtonProps:(k,h)=>b({onFocus:C=>{l(!0),i==null||i(C)},onBlur:C=>{l(!1),n==null||n(C)},...k},h),getLabelProps:_,getMenuProps:y,highlightedIndex:p,getItemProps:v,selectedItem:m,hasItemsToSelect:t.length>0}},m2=s=>{switch(s){case"small":return 4;case"medium":return 5;case"large":return 6}},v2=({size:s="medium",disabled:e=!1,className:t,value:o,label:i,id:n,error:f=!1,helperText:l,options:r,onChange:p,onFocus:c,onBlur:d,startAdornment:b,endAdornment:_,children:y,...v},m)=>{const k=Mt(o),{active:h,typed:C,isOpen:x,getItemProps:g,getLabelProps:I,getToggleButtonProps:E,selectedItem:P,getMenuProps:R,highlightedIndex:O,hasItemsToSelect:V}=b2({value:k?r.find(B=>B.value===o):o,isValuePassedAsString:k,options:r,onChange:p,onFocus:c,onBlur:d}),{refs:A,floatingStyles:Z}=dt(),N=a.useMemo(()=>f?"critical1":e?"defaultDisabled":"default1",[e,f]);return u.jsxs(Y,{display:"flex",flexDirection:"column",children:[u.jsx($r,{ref:A.setReference,id:n,typed:C,active:h,disabled:e,size:s,label:i,error:f,className:t,getLabelProps:I,getToggleButtonProps:E,children:u.jsxs(Y,{height:m2(s),...v,ref:m,display:"flex",children:[b&&C&&b(o),u.jsx(Ps,{size:ve(s),color:N,title:P==null?void 0:P.label,width:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",children:P==null?void 0:P.label}),_&&C&&_(o)]})}),u.jsx(ot,{asChild:!0,ref:A.setFloating,style:Z,children:u.jsx(Y,{position:"relative",display:Qt({isOpen:x,disabled:e,hasItemsToSelect:V,showEmptyState:Ve(y)}),className:at({size:s}),children:u.jsxs(Hs,{as:"ul",className:lt,...R({},{suppressRefError:!0}),children:[x&&(r==null?void 0:r.map((B,H)=>u.jsxs(Hs.Item,{"data-test-id":"select-option",className:We,disabled:B.disabled,...g({item:B,index:H}),active:O===H,children:[B==null?void 0:B.startAdornment,u.jsx(Ps,{color:B.disabled?"defaultDisabled":void 0,size:rt(s),width:"100%",children:B.label}),B==null?void 0:B.endAdornment]},`${n}-${B.value}-${H}`))),x&&!V&&y]})})}),l&&u.jsx(ft,{size:s,error:f,children:l})]})},C2=a.forwardRef(v2),g2=Object.assign(C2,{NoOptions:Le});var y2="_1ucx6ny1";const x2=({className:s,...e})=>u.jsx(Y,{className:ps(y2,s),backgroundColor:"default3",width:"100%",height:3,borderRadius:2,...e});var k2="u64rbw1";const I8=a.forwardRef(({className:s},e)=>u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",className:ps(k2,s),ref:e,children:u.jsx("g",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.333",children:u.jsx("path",{d:"M8 1.332v2.667M8 12v2.667M3.285 3.285l1.887 1.887M10.826 10.826l1.887 1.887M1.332 8h2.667M12 8h2.667M3.285 12.713l1.887-1.887M10.826 5.172l1.887-1.887"})})}));I8.displayName="Spinner";var w2=$s({defaultClassName:"edj57v3 _18fs8ps2ro _18fs8ps31c _18fs8ps28c _18fs8ps2i0 _18fs8ps1gc _18fs8ps1ff _18fs8ps1i6 _18fs8ps1h9 _18fs8ps19f _18fs8ps3t0",variantClassNames:{},defaultVariants:{},compoundVariants:[]}),$2=$s({defaultClassName:"_18fs8ps2zo _18fs8ps39c _18fs8ps2gc _18fs8ps2q0 _18fs8ps1gf _18fs8ps1fi _18fs8ps1i9 _18fs8ps1hc _18fs8ps3 _18fs8psfl _18fs8ps3qc _18fs8ps21o _18fs8ps17o",variantClassNames:{},defaultVariants:{},compoundVariants:[]});const Ir=a.forwardRef(({children:s,className:e,defaultValue:t,onValueChange:o,value:i,...n},f)=>u.jsx(Cr,{asChild:!0,defaultValue:t,value:i,onValueChange:o,children:u.jsx(Y,{className:ps($2(),e),ref:f,...n,"data-macaw-ui-component":"Switch",children:s})}));Ir.displayName="Switch";const Er=({value:s,id:e,disabled:t=!1,children:o,...i})=>u.jsx(gr,{asChild:!0,value:s,id:e,disabled:t,className:w2(),"data-macaw-ui-component":"SwitchItem",children:u.jsx(Y,{...i,children:o})});Er.displayName="Switch.Item";const I2=Object.assign(Ir,{Item:Er}),E2=(s,e,t,o)=>{const i=Wi(s,t),n=Wi(s,o);a.useEffect(()=>{if(s){s.style.height="0px";const f=Math.max(i,s.scrollHeight),l=Math.min(f,n);s.style.height=`${l}px`}},[i,n,s,e])};function Wi(s,e){return s?parseFloat(getComputedStyle(s).lineHeight)*e:0}const R2=(s,e)=>{const[t,o]=a.useState(!1);return{handlers:{onFocus:()=>o(!0),onBlur:()=>o(!1),onChange:r=>{e&&e(r)}},value:s,active:t,typed:!!(s||t)}},Rr=({children:s,id:e,typed:t,active:o,disabled:i,size:n,label:f,error:l,className:r,endAdornment:p})=>u.jsxs(Y,{as:"label",htmlFor:e,className:ps(nt({typed:t,active:o,disabled:i,size:n,error:l}),r),alignItems:"center",gap:1,"data-macaw-ui-component":"Textarea",children:[u.jsxs(Y,{display:"flex",flexDirection:"column",width:"100%",children:[u.jsx(Y,{as:"span",className:ps(it({typed:t,size:n,disabled:i,error:l})),children:f}),s]}),p]});Rr.displayName="TextareaWrapper";const Pr=a.forwardRef(({size:s,disabled:e=!1,className:t,value:o,label:i,id:n,error:f=!1,onChange:l,helperText:r,onBlur:p,onFocus:c,flex:d,flexBasis:b,flexGrow:_,flexShrink:y,width:v,endAdornment:m,rows:k=10,maxRows:h=20,...C},x)=>{const{handlers:g,value:I,active:E,typed:P}=R2(o,l),R=a.useRef(null);return E2(R.current,o,k,h),a.useImperativeHandle(x,()=>R.current),u.jsxs(Y,{display:"flex",flexDirection:"column",flex:d,flexBasis:b,flexGrow:_,flexShrink:y,width:v,children:[u.jsx(Rr,{id:n,typed:P,active:E,disabled:e,size:s,label:i,error:f,className:t,endAdornment:m,children:u.jsx(Y,{id:n,as:"textarea",className:ps(Jt({size:s,error:f})),style:{resize:"none"},disabled:e,value:I,ref:R,onBlur:O=>{g.onBlur(),p==null||p(O)},onFocus:O=>{g.onFocus(),c==null||c(O)},onChange:g.onChange,rows:k,...C})}),r&&u.jsx(Y,{className:hn({size:s}),children:u.jsx(Ps,{size:ve(s),color:f?"critical1":"default2",children:r})})]})});Pr.displayName="Textarea";const P2=a.forwardRef((s,e)=>{const{pressed:t,defaultPressed:o=!1,onPressedChange:i,...n}=s,[f=!1,l]=Xs({prop:t,onChange:i,defaultProp:o});return a.createElement(xs.button,ts({type:"button","aria-pressed":f,"data-state":f?"on":"off","data-disabled":s.disabled?"":void 0},n,{ref:e,onClick:fs(s.onClick,()=>{s.disabled||l(!f)})}))}),S2=P2;var D2=$s({defaultClassName:"agkfzb1 _18fs8ps2zc _18fs8ps390 _18fs8ps2g0 _18fs8ps2po _18fs8ps1lu _18fs8ps1m0 _18fs8ps1li _18fs8ps1lo _18fs8ps1gx _18fs8ps1g0 _18fs8ps1ir _18fs8ps1hu _18fs8ps3 _18fs8ps10 _18fs8ps2l _18fs8ps1mr _18fs8ps3t0",variantClassNames:{},defaultVariants:{},compoundVariants:[]});const Sr=a.forwardRef(({disabled:s=!1,pressed:e,onPressedChange:t,children:o,...i},n)=>u.jsxs(Y,{as:"label",display:"flex",alignItems:"center",gap:1.5,cursor:s?"not-allowed":"pointer","data-macaw-ui-component":"Toggle",children:[u.jsx(S2,{ref:n,className:D2(),pressed:e,onPressedChange:t,disabled:s,...i}),o]}));Sr.displayName="Toggle";const O2=a.forwardRef((s,e)=>a.createElement(xs.span,gs({},s,{ref:e,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...s.style}}))),j2=O2,[_o,bm]=qs("Tooltip",[qe]),ho=qe(),T2="TooltipProvider",M2=700,on="tooltip.open",[V2,E8]=_o(T2),A2=s=>{const{__scopeTooltip:e,delayDuration:t=M2,skipDelayDuration:o=300,disableHoverableContent:i=!1,children:n}=s,[f,l]=a.useState(!0),r=a.useRef(!1),p=a.useRef(0);return a.useEffect(()=>{const c=p.current;return()=>window.clearTimeout(c)},[]),a.createElement(V2,{scope:e,isOpenDelayed:f,delayDuration:t,onOpen:a.useCallback(()=>{window.clearTimeout(p.current),l(!1)},[]),onClose:a.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>l(!0),o)},[o]),isPointerInTransitRef:r,onPointerInTransitChange:a.useCallback(c=>{r.current=c},[]),disableHoverableContent:i},n)},R8="Tooltip",[N2,bt]=_o(R8),W2=s=>{const{__scopeTooltip:e,children:t,open:o,defaultOpen:i=!1,onOpenChange:n,disableHoverableContent:f,delayDuration:l}=s,r=E8(R8,s.__scopeTooltip),p=ho(e),[c,d]=a.useState(null),b=se(),_=a.useRef(0),y=f??r.disableHoverableContent,v=l??r.delayDuration,m=a.useRef(!1),[k=!1,h]=Xs({prop:o,defaultProp:i,onChange:E=>{E?(r.onOpen(),document.dispatchEvent(new CustomEvent(on))):r.onClose(),n==null||n(E)}}),C=a.useMemo(()=>k?m.current?"delayed-open":"instant-open":"closed",[k]),x=a.useCallback(()=>{window.clearTimeout(_.current),m.current=!1,h(!0)},[h]),g=a.useCallback(()=>{window.clearTimeout(_.current),h(!1)},[h]),I=a.useCallback(()=>{window.clearTimeout(_.current),_.current=window.setTimeout(()=>{m.current=!0,h(!0)},v)},[v,h]);return a.useEffect(()=>()=>window.clearTimeout(_.current),[]),a.createElement(v8,p,a.createElement(N2,{scope:e,contentId:b,open:k,stateAttribute:C,trigger:c,onTriggerChange:d,onTriggerEnter:a.useCallback(()=>{r.isOpenDelayed?I():x()},[r.isOpenDelayed,I,x]),onTriggerLeave:a.useCallback(()=>{y?g():window.clearTimeout(_.current)},[g,y]),onOpen:x,onClose:g,disableHoverableContent:y},t))},Li="TooltipTrigger",L2=a.forwardRef((s,e)=>{const{__scopeTooltip:t,...o}=s,i=bt(Li,t),n=E8(Li,t),f=ho(t),l=a.useRef(null),r=ws(e,l,i.onTriggerChange),p=a.useRef(!1),c=a.useRef(!1),d=a.useCallback(()=>p.current=!1,[]);return a.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),a.createElement(po,ts({asChild:!0},f),a.createElement(xs.button,ts({"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute},o,{ref:r,onPointerMove:fs(s.onPointerMove,b=>{b.pointerType!=="touch"&&!c.current&&!n.isPointerInTransitRef.current&&(i.onTriggerEnter(),c.current=!0)}),onPointerLeave:fs(s.onPointerLeave,()=>{i.onTriggerLeave(),c.current=!1}),onPointerDown:fs(s.onPointerDown,()=>{p.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:fs(s.onFocus,()=>{p.current||i.onOpen()}),onBlur:fs(s.onBlur,i.onClose),onClick:fs(s.onClick,i.onClose)})))}),Dr="TooltipPortal",[z2,H2]=_o(Dr,{forceMount:void 0}),q2=s=>{const{__scopeTooltip:e,forceMount:t,children:o,container:i}=s,n=bt(Dr,e);return a.createElement(z2,{scope:e,forceMount:t},a.createElement(Fs,{present:t||n.open},a.createElement(ao,{asChild:!0,container:i},o)))},Qe="TooltipContent",F2=a.forwardRef((s,e)=>{const t=H2(Qe,s.__scopeTooltip),{forceMount:o=t.forceMount,side:i="top",...n}=s,f=bt(Qe,s.__scopeTooltip);return a.createElement(Fs,{present:o||f.open},f.disableHoverableContent?a.createElement(Or,ts({side:i},n,{ref:e})):a.createElement(K2,ts({side:i},n,{ref:e})))}),K2=a.forwardRef((s,e)=>{const t=bt(Qe,s.__scopeTooltip),o=E8(Qe,s.__scopeTooltip),i=a.useRef(null),n=ws(e,i),[f,l]=a.useState(null),{trigger:r,onClose:p}=t,c=i.current,{onPointerInTransitChange:d}=o,b=a.useCallback(()=>{l(null),d(!1)},[d]),_=a.useCallback((y,v)=>{const m=y.currentTarget,k={x:y.clientX,y:y.clientY},h=G2(k,m.getBoundingClientRect()),C=X2(k,h),x=J2(v.getBoundingClientRect()),g=sm([...C,...x]);l(g),d(!0)},[d]);return a.useEffect(()=>()=>b(),[b]),a.useEffect(()=>{if(r&&c){const y=m=>_(m,c),v=m=>_(m,r);return r.addEventListener("pointerleave",y),c.addEventListener("pointerleave",v),()=>{r.removeEventListener("pointerleave",y),c.removeEventListener("pointerleave",v)}}},[r,c,_,b]),a.useEffect(()=>{if(f){const y=v=>{const m=v.target,k={x:v.clientX,y:v.clientY},h=(r==null?void 0:r.contains(m))||(c==null?void 0:c.contains(m)),C=!Q2(k,f);h?b():C&&(b(),p())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[r,c,f,p,b]),a.createElement(Or,ts({},s,{ref:n}))}),[B2,Z2]=_o(R8,{isInside:!1}),Or=a.forwardRef((s,e)=>{const{__scopeTooltip:t,children:o,"aria-label":i,onEscapeKeyDown:n,onPointerDownOutside:f,...l}=s,r=bt(Qe,t),p=ho(t),{onClose:c}=r;return a.useEffect(()=>(document.addEventListener(on,c),()=>document.removeEventListener(on,c)),[c]),a.useEffect(()=>{if(r.trigger){const d=b=>{const _=b.target;_!=null&&_.contains(r.trigger)&&c()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[r.trigger,c]),a.createElement(lo,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:n,onPointerDownOutside:f,onFocusOutside:d=>d.preventDefault(),onDismiss:c},a.createElement(C8,ts({"data-state":r.stateAttribute},p,l,{ref:e,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"}}),a.createElement(Hi,null,o),a.createElement(B2,{scope:t,isInside:!0},a.createElement(j2,{id:r.contentId,role:"tooltip"},i||o))))}),U2="TooltipArrow",Y2=a.forwardRef((s,e)=>{const{__scopeTooltip:t,...o}=s,i=ho(t);return Z2(U2,t).isInside?null:a.createElement(ka,ts({},i,o,{ref:e}))});function G2(s,e){const t=Math.abs(e.top-s.y),o=Math.abs(e.bottom-s.y),i=Math.abs(e.right-s.x),n=Math.abs(e.left-s.x);switch(Math.min(t,o,i,n)){case n:return"left";case i:return"right";case t:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function X2(s,e,t=5){const o=[];switch(e){case"top":o.push({x:s.x-t,y:s.y+t},{x:s.x+t,y:s.y+t});break;case"bottom":o.push({x:s.x-t,y:s.y-t},{x:s.x+t,y:s.y-t});break;case"left":o.push({x:s.x+t,y:s.y-t},{x:s.x+t,y:s.y+t});break;case"right":o.push({x:s.x-t,y:s.y-t},{x:s.x-t,y:s.y+t});break}return o}function J2(s){const{top:e,right:t,bottom:o,left:i}=s;return[{x:i,y:e},{x:t,y:e},{x:t,y:o},{x:i,y:o}]}function Q2(s,e){const{x:t,y:o}=s;let i=!1;for(let n=0,f=e.length-1;n<e.length;f=n++){const l=e[n].x,r=e[n].y,p=e[f].x,c=e[f].y;r>o!=c>o&&t<(p-l)*(o-r)/(c-r)+l&&(i=!i)}return i}function sm(s){const e=s.slice();return e.sort((t,o)=>t.x<o.x?-1:t.x>o.x?1:t.y<o.y?-1:t.y>o.y?1:0),em(e)}function em(s){if(s.length<=1)return s.slice();const e=[];for(let o=0;o<s.length;o++){const i=s[o];for(;e.length>=2;){const n=e[e.length-1],f=e[e.length-2];if((n.x-f.x)*(i.y-f.y)>=(n.y-f.y)*(i.x-f.x))e.pop();else break}e.push(i)}e.pop();const t=[];for(let o=s.length-1;o>=0;o--){const i=s[o];for(;t.length>=2;){const n=t[t.length-1],f=t[t.length-2];if((n.x-f.x)*(i.y-f.y)>=(n.y-f.y)*(i.x-f.x))t.pop();else break}t.push(i)}return t.pop(),e.length===1&&t.length===1&&e[0].x===t[0].x&&e[0].y===t[0].y?e:e.concat(t)}const tm=A2,om=W2,nm=L2,im=q2,fm=F2,lm=Y2,jr=({children:s,delayDuration:e=250,...t})=>u.jsx(tm,{children:u.jsx(om,{delayDuration:e,...t,"data-macaw-ui-component":"Tooltip",children:s})});jr.displayName="Tooltip";const Tr=a.forwardRef(({children:s},e)=>u.jsx(nm,{asChild:!0,ref:e,"data-macaw-ui-component":"Tooltip.Trigger",children:s}));Tr.displayName="Tooltip.Trigger";var am="_14kl90y0";const Mr=({className:s,backgroundColor:e=Ze.colors.background.default1,borderColor:t=Ze.colors.border.default1})=>u.jsx(lm,{asChild:!0,className:ps(am,s),children:u.jsx("svg",{width:"20",height:"9",viewBox:"0 0 20 9",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-macaw-ui-component":"Tooltip.Arrow",children:u.jsx("path",{fill:e,stroke:t,d:"M8.086 7.086.5-.5h18l-7.586 7.586a2 2 0 0 1-2.828 0Z"})})});Mr.displayName="Tooltip.Arrow";const Vr=({children:s,className:e,sideOffset:t=2,avoidCollisions:o=!0,...i})=>u.jsx(im,{children:u.jsx(fm,{asChild:!0,className:e,sideOffset:t,avoidCollisions:o,"data-macaw-ui-component":"Tooltip.Content",...i,children:u.jsx(Y,{borderStyle:s?"solid":"none",borderWidth:1,borderRadius:3,borderColor:"default1",padding:s?2:0,fontSize:1,lineHeight:1,color:"default1",backgroundColor:"default1",boxShadow:"defaultOverlay",children:s})})});Vr.displayName="Tooltip.Content";const Ar=({children:s})=>u.jsx(Ps,{display:"block",size:1,color:"default2",marginBottom:.5,"data-macaw-ui-component":"Tooltip.ContentHeading",children:s});Ar.displayName="Tooltip.ContentHeading";const rm=Object.assign(jr,{Trigger:Tr,Arrow:Mr,Content:Vr,ContentHeading:Ar});exports.Accordion=rd;exports.ArrowDownIcon=tt;exports.ArrowLeftIcon=hp;exports.ArrowRightIcon=bp;exports.ArrowUpIcon=mp;exports.Avatar=dd;exports.Backdrop=Xt;exports.Box=Y;exports.Button=et;exports.CatalogIcon=vp;exports.Checkbox=Ef;exports.CheckboxIcon=Cp;exports.ChervonDoubleIcon=gp;exports.ChervonDownIcon=un;exports.ChervonUpIcon=yp;exports.ChevronLeftIcon=xp;exports.ChevronRightIcon=kp;exports.Chip=Rf;exports.CloseIcon=mf;exports.Combobox=yu;exports.ConfigurationIcon=wp;exports.CopyIcon=$p;exports.CustomersIcon=Ip;exports.DarkModeIcon=Ep;exports.DashboardIcon=Rp;exports.Divider=Zl;exports.Drawer=D_;exports.Dropdown=Qh;exports.DropdownButton=La;exports.DynamicCombobox=wu;exports.DynamicMultiselect=gb;exports.EditIcon=Pp;exports.EnvironmentIcon=Sp;exports.ExportIcon=Dp;exports.ExternalLinkIcon=Op;exports.FileExportIcon=jp;exports.FloppyDiscIcon=Tp;exports.FullscreenOffIcon=Mp;exports.FullscreenOnIcon=Vp;exports.GenericAppIcon=Ap;exports.GraphQLIcon=Np;exports.GripIcon=Wp;exports.HelpIcon=Lp;exports.HomeIcon=zp;exports.InfoIcon=Hp;exports.Input=Zt;exports.LightModeIcon=qp;exports.List=Hs;exports.MailIcon=Fp;exports.MarketplaceIcon=Kp;exports.MenuIcon=Bp;exports.Modal=cb;exports.MoreOptionsIcon=Zp;exports.Multiselect=mb;exports.MultiselectRoot=sr;exports.OrdersIcon=Up;exports.Paragraph=er;exports.PlusIcon=Yp;exports.Popover=Kb;exports.ProductsIcons=Gp;exports.RadioGroup=c2;exports.RangeInput=kr;exports.RemoveIcon=Xp;exports.SearchIcon=vf;exports.SearchInput=wr;exports.Select=g2;exports.SellsIcon=Jp;exports.Skeleton=x2;exports.Spinner=I8;exports.StorefrontIcon=Qp;exports.Switch=I2;exports.TableEditIcon=sd;exports.Text=Ps;exports.Textarea=Pr;exports.ThemeProvider=Y1;exports.Toggle=Sr;exports.Tooltip=rm;exports.TranslationsIcon=ed;exports.TrashBinIcon=td;exports.ViewListIcon=od;exports.ViewTableIcon=nd;exports.ViewTilesIcon=id;exports.ViewWideTilesIcon=fd;exports.VouchersIcon=ld;exports.WarningIcon=ad;exports.convertSizeToScale=ve;exports.desktopMediaQuery=op;exports.getCSSVariables=np;exports.sprinkles=Js;exports.tabletMediaQuery=tp;exports.themes=Tt;exports.useTheme=U1;exports.vars=Ze;
102
+ `)},c_=0,je=[];function u_(s){var e=os.useRef([]),t=os.useRef([0,0]),o=os.useRef(),i=os.useState(c_++)[0],n=os.useState(function(){return Jl()})[0],f=os.useRef(s);os.useEffect(function(){f.current=s},[s]),os.useEffect(function(){if(s.inert){document.body.classList.add("block-interactivity-".concat(i));var v=$c([s.lockRef.current],(s.shards||[]).map(Mi),!0).filter(Boolean);return v.forEach(function(m){return m.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),v.forEach(function(m){return m.classList.remove("allow-interactivity-".concat(i))})}}},[s.inert,s.lockRef.current,s.shards]);var l=os.useCallback(function(v,m){if("touches"in v&&v.touches.length===2)return!f.current.allowPinchZoom;var k=wt(v),h=t.current,C="deltaX"in v?v.deltaX:h[0]-k[0],x="deltaY"in v?v.deltaY:h[1]-k[1],g,I=v.target,E=Math.abs(C)>Math.abs(x)?"h":"v";if("touches"in v&&E==="h"&&I.type==="range")return!1;var P=ji(E,I);if(!P)return!0;if(P?g=E:(g=E==="v"?"h":"v",P=ji(E,I)),!P)return!1;if(!o.current&&"changedTouches"in v&&(C||x)&&(o.current=g),!g)return!0;var R=o.current||g;return r_(R,m,v,R==="h"?C:x,!0)},[]),r=os.useCallback(function(v){var m=v;if(!(!je.length||je[je.length-1]!==n)){var k="deltaY"in m?Ti(m):wt(m),h=e.current.filter(function(g){return g.name===m.type&&g.target===m.target&&p_(g.delta,k)})[0];if(h&&h.should){m.cancelable&&m.preventDefault();return}if(!h){var C=(f.current.shards||[]).map(Mi).filter(Boolean).filter(function(g){return g.contains(m.target)}),x=C.length>0?l(m,C[0]):!f.current.noIsolation;x&&m.cancelable&&m.preventDefault()}}},[]),p=os.useCallback(function(v,m,k,h){var C={name:v,delta:m,target:k,should:h};e.current.push(C),setTimeout(function(){e.current=e.current.filter(function(x){return x!==C})},1)},[]),c=os.useCallback(function(v){t.current=wt(v),o.current=void 0},[]),d=os.useCallback(function(v){p(v.type,Ti(v),v.target,l(v,s.lockRef.current))},[]),b=os.useCallback(function(v){p(v.type,wt(v),v.target,l(v,s.lockRef.current))},[]);os.useEffect(function(){return je.push(n),s.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:b}),document.addEventListener("wheel",r,Oe),document.addEventListener("touchmove",r,Oe),document.addEventListener("touchstart",c,Oe),function(){je=je.filter(function(v){return v!==n}),document.removeEventListener("wheel",r,Oe),document.removeEventListener("touchmove",r,Oe),document.removeEventListener("touchstart",c,Oe)}},[]);var _=s.removeScrollBar,y=s.inert;return os.createElement(os.Fragment,null,y?os.createElement(n,{styles:d_(i)}):null,_?os.createElement(t_,{gapMode:"margin"}):null)}const __=Fu(Xl,u_);var ta=os.forwardRef(function(s,e){return os.createElement(ro,Ns({},s,{ref:e,sideCar:__}))});ta.classNames=ro.classNames;const h8=ta;var h_=function(s){if(typeof document>"u")return null;var e=Array.isArray(s)?s[0]:s;return e.ownerDocument.body},Te=new WeakMap,$t=new WeakMap,It={},Mo=0,oa=function(s){return s&&(s.host||oa(s.parentNode))},b_=function(s,e){return e.map(function(t){if(s.contains(t))return t;var o=oa(t);return o&&s.contains(o)?o:(console.error("aria-hidden",t,"in not contained inside",s,". Doing nothing"),null)}).filter(function(t){return!!t})},m_=function(s,e,t,o){var i=b_(e,Array.isArray(s)?s:[s]);It[t]||(It[t]=new WeakMap);var n=It[t],f=[],l=new Set,r=new Set(i),p=function(d){!d||l.has(d)||(l.add(d),p(d.parentNode))};i.forEach(p);var c=function(d){!d||r.has(d)||Array.prototype.forEach.call(d.children,function(b){if(l.has(b))c(b);else{var _=b.getAttribute(o),y=_!==null&&_!=="false",v=(Te.get(b)||0)+1,m=(n.get(b)||0)+1;Te.set(b,v),n.set(b,m),f.push(b),v===1&&y&&$t.set(b,!0),m===1&&b.setAttribute(t,"true"),y||b.setAttribute(o,"true")}})};return c(e),l.clear(),Mo++,function(){f.forEach(function(d){var b=Te.get(d)-1,_=n.get(d)-1;Te.set(d,b),n.set(d,_),b||($t.has(d)||d.removeAttribute(o),$t.delete(d)),_||d.removeAttribute(t)}),Mo--,Mo||(Te=new WeakMap,Te=new WeakMap,$t=new WeakMap,It={})}},b8=function(s,e,t){t===void 0&&(t="data-aria-hidden");var o=Array.from(Array.isArray(s)?s:[s]),i=e||h_(s);return i?(o.push.apply(o,Array.from(i.querySelectorAll("[aria-live]"))),m_(o,i,t,"aria-hidden")):function(){return null}};const na="Dialog",[ia,cm]=qs(na),[v_,pe]=ia(na),C_=s=>{const{__scopeDialog:e,children:t,open:o,defaultOpen:i,onOpenChange:n,modal:f=!0}=s,l=a.useRef(null),r=a.useRef(null),[p=!1,c]=Xs({prop:o,defaultProp:i,onChange:n});return a.createElement(v_,{scope:e,triggerRef:l,contentRef:r,contentId:se(),titleId:se(),descriptionId:se(),open:p,onOpenChange:c,onOpenToggle:a.useCallback(()=>c(d=>!d),[c]),modal:f},t)},g_="DialogTrigger",y_=a.forwardRef((s,e)=>{const{__scopeDialog:t,...o}=s,i=pe(g_,t),n=ws(e,i.triggerRef);return a.createElement(xs.button,ts({type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":m8(i.open)},o,{ref:n,onClick:fs(s.onClick,i.onOpenToggle)}))}),fa="DialogPortal",[x_,la]=ia(fa,{forceMount:void 0}),k_=s=>{const{__scopeDialog:e,forceMount:t,children:o,container:i}=s,n=pe(fa,e);return a.createElement(x_,{scope:e,forceMount:t},a.Children.map(o,f=>a.createElement(Fs,{present:t||n.open},a.createElement(ao,{asChild:!0,container:i},f))))},Jo="DialogOverlay",w_=a.forwardRef((s,e)=>{const t=la(Jo,s.__scopeDialog),{forceMount:o=t.forceMount,...i}=s,n=pe(Jo,s.__scopeDialog);return n.modal?a.createElement(Fs,{present:o||n.open},a.createElement($_,ts({},i,{ref:e}))):null}),$_=a.forwardRef((s,e)=>{const{__scopeDialog:t,...o}=s,i=pe(Jo,t);return a.createElement(h8,{as:$e,allowPinchZoom:!0,shards:[i.contentRef]},a.createElement(xs.div,ts({"data-state":m8(i.open)},o,{ref:e,style:{pointerEvents:"auto",...o.style}})))}),Xe="DialogContent",I_=a.forwardRef((s,e)=>{const t=la(Xe,s.__scopeDialog),{forceMount:o=t.forceMount,...i}=s,n=pe(Xe,s.__scopeDialog);return a.createElement(Fs,{present:o||n.open},n.modal?a.createElement(E_,ts({},i,{ref:e})):a.createElement(R_,ts({},i,{ref:e})))}),E_=a.forwardRef((s,e)=>{const t=pe(Xe,s.__scopeDialog),o=a.useRef(null),i=ws(e,t.contentRef,o);return a.useEffect(()=>{const n=o.current;if(n)return b8(n)},[]),a.createElement(aa,ts({},s,{ref:i,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:fs(s.onCloseAutoFocus,n=>{var f;n.preventDefault(),(f=t.triggerRef.current)===null||f===void 0||f.focus()}),onPointerDownOutside:fs(s.onPointerDownOutside,n=>{const f=n.detail.originalEvent,l=f.button===0&&f.ctrlKey===!0;(f.button===2||l)&&n.preventDefault()}),onFocusOutside:fs(s.onFocusOutside,n=>n.preventDefault())}))}),R_=a.forwardRef((s,e)=>{const t=pe(Xe,s.__scopeDialog),o=a.useRef(!1),i=a.useRef(!1);return a.createElement(aa,ts({},s,{ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:n=>{var f;if((f=s.onCloseAutoFocus)===null||f===void 0||f.call(s,n),!n.defaultPrevented){var l;o.current||(l=t.triggerRef.current)===null||l===void 0||l.focus(),n.preventDefault()}o.current=!1,i.current=!1},onInteractOutside:n=>{var f,l;(f=s.onInteractOutside)===null||f===void 0||f.call(s,n),n.defaultPrevented||(o.current=!0,n.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const r=n.target;((l=t.triggerRef.current)===null||l===void 0?void 0:l.contains(r))&&n.preventDefault(),n.detail.originalEvent.type==="focusin"&&i.current&&n.preventDefault()}}))}),aa=a.forwardRef((s,e)=>{const{__scopeDialog:t,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:n,...f}=s,l=pe(Xe,t),r=a.useRef(null),p=ws(e,r);return _8(),a.createElement(a.Fragment,null,a.createElement(u8,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:i,onUnmountAutoFocus:n},a.createElement(lo,ts({role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":m8(l.open)},f,{ref:p,onDismiss:()=>l.onOpenChange(!1)}))),!1)});const P_="DialogClose",S_=a.forwardRef((s,e)=>{const{__scopeDialog:t,...o}=s,i=pe(P_,t);return a.createElement(xs.button,ts({type:"button"},o,{ref:e,onClick:fs(s.onClick,()=>i.onOpenChange(!1))}))});function m8(s){return s?"open":"closed"}const ra=C_,pa=y_,da=k_,ca=w_,ua=I_,_a=S_;var Vi="_68ye811";const ha=({children:s,...e})=>u.jsxs(da,{children:[u.jsx(ca,{asChild:!0,className:Vi,children:u.jsx(Xt,{})}),u.jsx(ua,{asChild:!0,className:Vi,children:u.jsxs(Y,{backgroundColor:"default1",boxShadow:"defaultModal",top:0,left:0,height:"100%",borderTopRightRadius:3,borderBottomRightRadius:3,position:"fixed",paddingTop:7,"data-macaw-ui-component":"Drawer.Content",...e,children:[s,u.jsx(_a,{asChild:!0,children:u.jsx(et,{variant:"tertiary",icon:u.jsx(mf,{}),size:"small",className:Js({position:"absolute",top:1,right:1})})})]})})]});ha.displayName="Drawer.Content";const ba=({children:s})=>u.jsx(ra,{"data-macaw-ui-component":"Drawer",children:s});ba.displayName="Drawer";const ma=({children:s})=>u.jsx(pa,{asChild:!0,"data-macaw-ui-component":"Drawer.Trigger",children:s});ma.displayName="Drawer.Trigger";const D_=Object.assign(ba,{Content:ha,Trigger:ma}),O_=a.forwardRef((s,e)=>{const{children:t,width:o=10,height:i=5,...n}=s;return a.createElement(xs.svg,gs({},n,{ref:e,width:o,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none"}),s.asChild?t:a.createElement("polygon",{points:"0,0 30,0 15,10"}))}),j_=O_,va="Popper",[Ca,qe]=qs(va),[T_,ga]=Ca(va),M_=s=>{const{__scopePopper:e,children:t}=s,[o,i]=a.useState(null);return a.createElement(T_,{scope:e,anchor:o,onAnchorChange:i},t)},V_="PopperAnchor",A_=a.forwardRef((s,e)=>{const{__scopePopper:t,virtualRef:o,...i}=s,n=ga(V_,t),f=a.useRef(null),l=ws(e,f);return a.useEffect(()=>{n.onAnchorChange((o==null?void 0:o.current)||f.current)}),o?null:a.createElement(xs.div,gs({},i,{ref:l}))}),ya="PopperContent",[N_,W_]=Ca(ya),L_=a.forwardRef((s,e)=>{var t,o,i,n,f,l,r,p;const{__scopePopper:c,side:d="bottom",sideOffset:b=0,align:_="center",alignOffset:y=0,arrowPadding:v=0,avoidCollisions:m=!0,collisionBoundary:k=[],collisionPadding:h=0,sticky:C="partial",hideWhenDetached:x=!1,updatePositionStrategy:g="optimized",onPlaced:I,...E}=s,P=ga(ya,c),[R,O]=a.useState(null),V=ws(e,ys=>O(ys)),[A,Z]=a.useState(null),N=_n(A),B=(t=N==null?void 0:N.width)!==null&&t!==void 0?t:0,H=(o=N==null?void 0:N.height)!==null&&o!==void 0?o:0,U=d+(_!=="center"?"-"+_:""),K=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},M=Array.isArray(k)?k:[k],$=M.length>0,S={padding:K,boundary:M.filter(F_),altBoundary:$},{refs:j,floatingStyles:T,placement:D,isPositioned:L,middlewareData:F}=qf({strategy:"fixed",placement:U,whileElementsMounted:(...ys)=>Wf(...ys,{animationFrame:g==="always"}),elements:{reference:P.anchor},middleware:[Wd({mainAxis:b+H,alignmentAxis:y}),m&&fc({mainAxis:!0,crossAxis:!1,limiter:C==="partial"?ac():void 0,...S}),m&&Lf({...S}),zf({...S,apply:({elements:ys,rects:cs,availableWidth:Is,availableHeight:Ds})=>{const{width:Os,height:ne}=cs.reference,Es=ys.floating.style;Es.setProperty("--radix-popper-available-width",`${Is}px`),Es.setProperty("--radix-popper-available-height",`${Ds}px`),Es.setProperty("--radix-popper-anchor-width",`${Os}px`),Es.setProperty("--radix-popper-anchor-height",`${ne}px`)}}),A&&pc({element:A,padding:v}),K_({arrowWidth:B,arrowHeight:H}),x&&lc({strategy:"referenceHidden",...S})]}),[G,X]=xa(D),Q=te(I);Ie(()=>{L&&(Q==null||Q())},[L,Q]);const es=(i=F.arrow)===null||i===void 0?void 0:i.x,as=(n=F.arrow)===null||n===void 0?void 0:n.y,W=((f=F.arrow)===null||f===void 0?void 0:f.centerOffset)!==0,[us,J]=a.useState();return Ie(()=>{R&&J(window.getComputedStyle(R).zIndex)},[R]),a.createElement("div",{ref:j.setFloating,"data-radix-popper-content-wrapper":"",style:{...T,transform:L?T.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:us,"--radix-popper-transform-origin":[(l=F.transformOrigin)===null||l===void 0?void 0:l.x,(r=F.transformOrigin)===null||r===void 0?void 0:r.y].join(" ")},dir:s.dir},a.createElement(N_,{scope:c,placedSide:G,onArrowChange:Z,arrowX:es,arrowY:as,shouldHideArrow:W},a.createElement(xs.div,gs({"data-side":G,"data-align":X},E,{ref:V,style:{...E.style,animation:L?void 0:"none",opacity:(p=F.hide)!==null&&p!==void 0&&p.referenceHidden?0:void 0}}))))}),z_="PopperArrow",H_={top:"bottom",right:"left",bottom:"top",left:"right"},q_=a.forwardRef(function(e,t){const{__scopePopper:o,...i}=e,n=W_(z_,o),f=H_[n.placedSide];return a.createElement("span",{ref:n.onArrowChange,style:{position:"absolute",left:n.arrowX,top:n.arrowY,[f]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[n.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[n.placedSide],visibility:n.shouldHideArrow?"hidden":void 0}},a.createElement(j_,gs({},i,{ref:t,style:{...i.style,display:"block"}})))});function F_(s){return s!==null}const K_=s=>({name:"transformOrigin",options:s,fn(e){var t,o,i,n,f;const{placement:l,rects:r,middlewareData:p}=e,d=((t=p.arrow)===null||t===void 0?void 0:t.centerOffset)!==0,b=d?0:s.arrowWidth,_=d?0:s.arrowHeight,[y,v]=xa(l),m={start:"0%",center:"50%",end:"100%"}[v],k=((o=(i=p.arrow)===null||i===void 0?void 0:i.x)!==null&&o!==void 0?o:0)+b/2,h=((n=(f=p.arrow)===null||f===void 0?void 0:f.y)!==null&&n!==void 0?n:0)+_/2;let C="",x="";return y==="bottom"?(C=d?m:`${k}px`,x=`${-_}px`):y==="top"?(C=d?m:`${k}px`,x=`${r.floating.height+_}px`):y==="right"?(C=`${-_}px`,x=d?m:`${h}px`):y==="left"&&(C=`${r.floating.width+_}px`,x=d?m:`${h}px`),{data:{x:C,y:x}}}});function xa(s){const[e,t="center"]=s.split("-");return[e,t]}const v8=M_,po=A_,C8=L_,ka=q_,Vo="rovingFocusGroup.onEntryFocus",B_={bubbles:!1,cancelable:!0},g8="RovingFocusGroup",[Qo,wa,Z_]=fn(g8),[U_,co]=qs(g8,[Z_]),[Y_,G_]=U_(g8),X_=a.forwardRef((s,e)=>a.createElement(Qo.Provider,{scope:s.__scopeRovingFocusGroup},a.createElement(Qo.Slot,{scope:s.__scopeRovingFocusGroup},a.createElement(J_,gs({},s,{ref:e}))))),J_=a.forwardRef((s,e)=>{const{__scopeRovingFocusGroup:t,orientation:o,loop:i=!1,dir:n,currentTabStopId:f,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:r,onEntryFocus:p,...c}=s,d=a.useRef(null),b=ws(e,d),_=Ut(n),[y=null,v]=Xs({prop:f,defaultProp:l,onChange:r}),[m,k]=a.useState(!1),h=te(p),C=wa(t),x=a.useRef(!1),[g,I]=a.useState(0);return a.useEffect(()=>{const E=d.current;if(E)return E.addEventListener(Vo,h),()=>E.removeEventListener(Vo,h)},[h]),a.createElement(Y_,{scope:t,orientation:o,dir:_,loop:i,currentTabStopId:y,onItemFocus:a.useCallback(E=>v(E),[v]),onItemShiftTab:a.useCallback(()=>k(!0),[]),onFocusableItemAdd:a.useCallback(()=>I(E=>E+1),[]),onFocusableItemRemove:a.useCallback(()=>I(E=>E-1),[])},a.createElement(xs.div,gs({tabIndex:m||g===0?-1:0,"data-orientation":o},c,{ref:b,style:{outline:"none",...s.style},onMouseDown:fs(s.onMouseDown,()=>{x.current=!0}),onFocus:fs(s.onFocus,E=>{const P=!x.current;if(E.target===E.currentTarget&&P&&!m){const R=new CustomEvent(Vo,B_);if(E.currentTarget.dispatchEvent(R),!R.defaultPrevented){const O=C().filter(B=>B.focusable),V=O.find(B=>B.active),A=O.find(B=>B.id===y),N=[V,A,...O].filter(Boolean).map(B=>B.ref.current);$a(N)}}x.current=!1}),onBlur:fs(s.onBlur,()=>k(!1))})))}),Q_="RovingFocusGroupItem",sh=a.forwardRef((s,e)=>{const{__scopeRovingFocusGroup:t,focusable:o=!0,active:i=!1,tabStopId:n,...f}=s,l=se(),r=n||l,p=G_(Q_,t),c=p.currentTabStopId===r,d=wa(t),{onFocusableItemAdd:b,onFocusableItemRemove:_}=p;return a.useEffect(()=>{if(o)return b(),()=>_()},[o,b,_]),a.createElement(Qo.ItemSlot,{scope:t,id:r,focusable:o,active:i},a.createElement(xs.span,gs({tabIndex:c?0:-1,"data-orientation":p.orientation},f,{ref:e,onMouseDown:fs(s.onMouseDown,y=>{o?p.onItemFocus(r):y.preventDefault()}),onFocus:fs(s.onFocus,()=>p.onItemFocus(r)),onKeyDown:fs(s.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){p.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const v=oh(y,p.orientation,p.dir);if(v!==void 0){y.preventDefault();let k=d().filter(h=>h.focusable).map(h=>h.ref.current);if(v==="last")k.reverse();else if(v==="prev"||v==="next"){v==="prev"&&k.reverse();const h=k.indexOf(y.currentTarget);k=p.loop?nh(k,h+1):k.slice(h+1)}setTimeout(()=>$a(k))}})})))}),eh={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function th(s,e){return e!=="rtl"?s:s==="ArrowLeft"?"ArrowRight":s==="ArrowRight"?"ArrowLeft":s}function oh(s,e,t){const o=th(s.key,t);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return eh[o]}function $a(s){const e=document.activeElement;for(const t of s)if(t===e||(t.focus(),document.activeElement!==e))return}function nh(s,e){return s.map((t,o)=>s[(e+o)%s.length])}const Ia=X_,Ea=sh,ih=["Enter"," "],fh=["ArrowDown","PageUp","Home"],Ra=["ArrowUp","PageDown","End"],lh=[...fh,...Ra],uo="Menu",[sn,ah,rh]=fn(uo),[Re,Pa]=qs(uo,[rh,qe,co]),y8=qe(),Sa=co(),[ph,ut]=Re(uo),[dh,x8]=Re(uo),ch=s=>{const{__scopeMenu:e,open:t=!1,children:o,dir:i,onOpenChange:n,modal:f=!0}=s,l=y8(e),[r,p]=a.useState(null),c=a.useRef(!1),d=te(n),b=Ut(i);return a.useEffect(()=>{const _=()=>{c.current=!0,document.addEventListener("pointerdown",y,{capture:!0,once:!0}),document.addEventListener("pointermove",y,{capture:!0,once:!0})},y=()=>c.current=!1;return document.addEventListener("keydown",_,{capture:!0}),()=>{document.removeEventListener("keydown",_,{capture:!0}),document.removeEventListener("pointerdown",y,{capture:!0}),document.removeEventListener("pointermove",y,{capture:!0})}},[]),a.createElement(v8,l,a.createElement(ph,{scope:e,open:t,onOpenChange:d,content:r,onContentChange:p},a.createElement(dh,{scope:e,onClose:a.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:c,dir:b,modal:f},o)))},uh=a.forwardRef((s,e)=>{const{__scopeMenu:t,...o}=s,i=y8(t);return a.createElement(po,gs({},i,o,{ref:e}))}),Da="MenuPortal",[_h,hh]=Re(Da,{forceMount:void 0}),bh=s=>{const{__scopeMenu:e,forceMount:t,children:o,container:i}=s,n=ut(Da,e);return a.createElement(_h,{scope:e,forceMount:t},a.createElement(Fs,{present:t||n.open},a.createElement(ao,{asChild:!0,container:i},o)))},ce="MenuContent",[mh,Oa]=Re(ce),vh=a.forwardRef((s,e)=>{const t=hh(ce,s.__scopeMenu),{forceMount:o=t.forceMount,...i}=s,n=ut(ce,s.__scopeMenu),f=x8(ce,s.__scopeMenu);return a.createElement(sn.Provider,{scope:s.__scopeMenu},a.createElement(Fs,{present:o||n.open},a.createElement(sn.Slot,{scope:s.__scopeMenu},f.modal?a.createElement(Ch,gs({},i,{ref:e})):a.createElement(gh,gs({},i,{ref:e})))))}),Ch=a.forwardRef((s,e)=>{const t=ut(ce,s.__scopeMenu),o=a.useRef(null),i=ws(e,o);return a.useEffect(()=>{const n=o.current;if(n)return b8(n)},[]),a.createElement(ja,gs({},s,{ref:i,trapFocus:t.open,disableOutsidePointerEvents:t.open,disableOutsideScroll:!0,onFocusOutside:fs(s.onFocusOutside,n=>n.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>t.onOpenChange(!1)}))}),gh=a.forwardRef((s,e)=>{const t=ut(ce,s.__scopeMenu);return a.createElement(ja,gs({},s,{ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>t.onOpenChange(!1)}))}),ja=a.forwardRef((s,e)=>{const{__scopeMenu:t,loop:o=!1,trapFocus:i,onOpenAutoFocus:n,onCloseAutoFocus:f,disableOutsidePointerEvents:l,onEntryFocus:r,onEscapeKeyDown:p,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:b,onDismiss:_,disableOutsideScroll:y,...v}=s,m=ut(ce,t),k=x8(ce,t),h=y8(t),C=Sa(t),x=ah(t),[g,I]=a.useState(null),E=a.useRef(null),P=ws(e,E,m.onContentChange),R=a.useRef(0),O=a.useRef(""),V=a.useRef(0),A=a.useRef(null),Z=a.useRef("right"),N=a.useRef(0),B=y?h8:a.Fragment,H=y?{as:$e,allowPinchZoom:!0}:void 0,U=M=>{var $,S;const j=O.current+M,T=x().filter(Q=>!Q.disabled),D=document.activeElement,L=($=T.find(Q=>Q.ref.current===D))===null||$===void 0?void 0:$.textValue,F=T.map(Q=>Q.textValue),G=Ph(F,j,L),X=(S=T.find(Q=>Q.textValue===G))===null||S===void 0?void 0:S.ref.current;(function Q(es){O.current=es,window.clearTimeout(R.current),es!==""&&(R.current=window.setTimeout(()=>Q(""),1e3))})(j),X&&setTimeout(()=>X.focus())};a.useEffect(()=>()=>window.clearTimeout(R.current),[]),_8();const K=a.useCallback(M=>{var $,S;return Z.current===(($=A.current)===null||$===void 0?void 0:$.side)&&Dh(M,(S=A.current)===null||S===void 0?void 0:S.area)},[]);return a.createElement(mh,{scope:t,searchRef:O,onItemEnter:a.useCallback(M=>{K(M)&&M.preventDefault()},[K]),onItemLeave:a.useCallback(M=>{var $;K(M)||(($=E.current)===null||$===void 0||$.focus(),I(null))},[K]),onTriggerLeave:a.useCallback(M=>{K(M)&&M.preventDefault()},[K]),pointerGraceTimerRef:V,onPointerGraceIntentChange:a.useCallback(M=>{A.current=M},[])},a.createElement(B,H,a.createElement(u8,{asChild:!0,trapped:i,onMountAutoFocus:fs(n,M=>{var $;M.preventDefault(),($=E.current)===null||$===void 0||$.focus()}),onUnmountAutoFocus:f},a.createElement(lo,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:p,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:b,onDismiss:_},a.createElement(Ia,gs({asChild:!0},C,{dir:k.dir,orientation:"vertical",loop:o,currentTabStopId:g,onCurrentTabStopIdChange:I,onEntryFocus:fs(r,M=>{k.isUsingKeyboardRef.current||M.preventDefault()})}),a.createElement(C8,gs({role:"menu","aria-orientation":"vertical","data-state":Ih(m.open),"data-radix-menu-content":"",dir:k.dir},h,v,{ref:P,style:{outline:"none",...v.style},onKeyDown:fs(v.onKeyDown,M=>{const S=M.target.closest("[data-radix-menu-content]")===M.currentTarget,j=M.ctrlKey||M.altKey||M.metaKey,T=M.key.length===1;S&&(M.key==="Tab"&&M.preventDefault(),!j&&T&&U(M.key));const D=E.current;if(M.target!==D||!lh.includes(M.key))return;M.preventDefault();const F=x().filter(G=>!G.disabled).map(G=>G.ref.current);Ra.includes(M.key)&&F.reverse(),Eh(F)}),onBlur:fs(s.onBlur,M=>{M.currentTarget.contains(M.target)||(window.clearTimeout(R.current),O.current="")}),onPointerMove:fs(s.onPointerMove,tn(M=>{const $=M.target,S=N.current!==M.clientX;if(M.currentTarget.contains($)&&S){const j=M.clientX>N.current?"right":"left";Z.current=j,N.current=M.clientX}}))})))))))}),en="MenuItem",Ai="menu.itemSelect",yh=a.forwardRef((s,e)=>{const{disabled:t=!1,onSelect:o,...i}=s,n=a.useRef(null),f=x8(en,s.__scopeMenu),l=Oa(en,s.__scopeMenu),r=ws(e,n),p=a.useRef(!1),c=()=>{const d=n.current;if(!t&&d){const b=new CustomEvent(Ai,{bubbles:!0,cancelable:!0});d.addEventListener(Ai,_=>o==null?void 0:o(_),{once:!0}),qi(d,b),b.defaultPrevented?p.current=!1:f.onClose()}};return a.createElement(xh,gs({},i,{ref:r,disabled:t,onClick:fs(s.onClick,c),onPointerDown:d=>{var b;(b=s.onPointerDown)===null||b===void 0||b.call(s,d),p.current=!0},onPointerUp:fs(s.onPointerUp,d=>{var b;p.current||(b=d.currentTarget)===null||b===void 0||b.click()}),onKeyDown:fs(s.onKeyDown,d=>{const b=l.searchRef.current!=="";t||b&&d.key===" "||ih.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})}))}),xh=a.forwardRef((s,e)=>{const{__scopeMenu:t,disabled:o=!1,textValue:i,...n}=s,f=Oa(en,t),l=Sa(t),r=a.useRef(null),p=ws(e,r),[c,d]=a.useState(!1),[b,_]=a.useState("");return a.useEffect(()=>{const y=r.current;if(y){var v;_(((v=y.textContent)!==null&&v!==void 0?v:"").trim())}},[n.children]),a.createElement(sn.ItemSlot,{scope:t,disabled:o,textValue:i??b},a.createElement(Ea,gs({asChild:!0},l,{focusable:!o}),a.createElement(xs.div,gs({role:"menuitem","data-highlighted":c?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0},n,{ref:p,onPointerMove:fs(s.onPointerMove,tn(y=>{o?f.onItemLeave(y):(f.onItemEnter(y),y.defaultPrevented||y.currentTarget.focus())})),onPointerLeave:fs(s.onPointerLeave,tn(y=>f.onItemLeave(y))),onFocus:fs(s.onFocus,()=>d(!0)),onBlur:fs(s.onBlur,()=>d(!1))}))))}),kh="MenuRadioGroup";Re(kh,{value:void 0,onValueChange:()=>{}});const wh="MenuItemIndicator";Re(wh,{checked:!1});const $h="MenuSub";Re($h);function Ih(s){return s?"open":"closed"}function Eh(s){const e=document.activeElement;for(const t of s)if(t===e||(t.focus(),document.activeElement!==e))return}function Rh(s,e){return s.map((t,o)=>s[(e+o)%s.length])}function Ph(s,e,t){const i=e.length>1&&Array.from(e).every(p=>p===e[0])?e[0]:e,n=t?s.indexOf(t):-1;let f=Rh(s,Math.max(n,0));i.length===1&&(f=f.filter(p=>p!==t));const r=f.find(p=>p.toLowerCase().startsWith(i.toLowerCase()));return r!==t?r:void 0}function Sh(s,e){const{x:t,y:o}=s;let i=!1;for(let n=0,f=e.length-1;n<e.length;f=n++){const l=e[n].x,r=e[n].y,p=e[f].x,c=e[f].y;r>o!=c>o&&t<(p-l)*(o-r)/(c-r)+l&&(i=!i)}return i}function Dh(s,e){if(!e)return!1;const t={x:s.clientX,y:s.clientY};return Sh(t,e)}function tn(s){return e=>e.pointerType==="mouse"?s(e):void 0}const Oh=ch,jh=uh,Th=bh,Mh=vh,Vh=yh,Ta="DropdownMenu",[Ah,um]=qs(Ta,[Pa]),_t=Pa(),[Nh,Ma]=Ah(Ta),Wh=s=>{const{__scopeDropdownMenu:e,children:t,dir:o,open:i,defaultOpen:n,onOpenChange:f,modal:l=!0}=s,r=_t(e),p=a.useRef(null),[c=!1,d]=Xs({prop:i,defaultProp:n,onChange:f});return a.createElement(Nh,{scope:e,triggerId:se(),triggerRef:p,contentId:se(),open:c,onOpenChange:d,onOpenToggle:a.useCallback(()=>d(b=>!b),[d]),modal:l},a.createElement(Oh,ts({},r,{open:c,onOpenChange:d,dir:o,modal:l}),t))},Lh="DropdownMenuTrigger",zh=a.forwardRef((s,e)=>{const{__scopeDropdownMenu:t,disabled:o=!1,...i}=s,n=Ma(Lh,t),f=_t(t);return a.createElement(jh,ts({asChild:!0},f),a.createElement(xs.button,ts({type:"button",id:n.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":n.open?n.contentId:void 0,"data-state":n.open?"open":"closed","data-disabled":o?"":void 0,disabled:o},i,{ref:nn(e,n.triggerRef),onPointerDown:fs(s.onPointerDown,l=>{!o&&l.button===0&&l.ctrlKey===!1&&(n.onOpenToggle(),n.open||l.preventDefault())}),onKeyDown:fs(s.onKeyDown,l=>{o||(["Enter"," "].includes(l.key)&&n.onOpenToggle(),l.key==="ArrowDown"&&n.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})))}),Hh=s=>{const{__scopeDropdownMenu:e,...t}=s,o=_t(e);return a.createElement(Th,ts({},o,t))},qh="DropdownMenuContent",Fh=a.forwardRef((s,e)=>{const{__scopeDropdownMenu:t,...o}=s,i=Ma(qh,t),n=_t(t),f=a.useRef(!1);return a.createElement(Mh,ts({id:i.contentId,"aria-labelledby":i.triggerId},n,o,{ref:e,onCloseAutoFocus:fs(s.onCloseAutoFocus,l=>{var r;f.current||(r=i.triggerRef.current)===null||r===void 0||r.focus(),f.current=!1,l.preventDefault()}),onInteractOutside:fs(s.onInteractOutside,l=>{const r=l.detail.originalEvent,p=r.button===0&&r.ctrlKey===!0,c=r.button===2||p;(!i.modal||c)&&(f.current=!0)}),style:{...s.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))}),Kh=a.forwardRef((s,e)=>{const{__scopeDropdownMenu:t,...o}=s,i=_t(t);return a.createElement(Vh,ts({},i,o,{ref:e}))}),Bh=Wh,Zh=zh,Uh=Hh,Yh=Fh,Gh=Kh;var Xh="_6vehm81",Jh="_6vehm82";const Va=({children:s,...e})=>u.jsx(Uh,{children:u.jsx(Yh,{asChild:!0,className:Xh,"data-macaw-ui-component":"Dropdown.Content",...e,children:s})});Va.displayName="Dropdown.Content";const Aa=({children:s})=>u.jsx(Gh,{asChild:!0,className:Jh,"data-macaw-ui-component":"Dropdown.Item",children:s});Aa.displayName="Dropdown.Item";const Na=({children:s,onOpenChange:e,open:t})=>u.jsx(Bh,{open:t,onOpenChange:e,"data-macaw-ui-component":"Dropdown",children:s});Na.displayName="Dropdown";const Wa=({children:s})=>u.jsx(Zh,{asChild:!0,"data-macaw-ui-component":"Dropdown.Trigger",children:s});Wa.displayName="Dropdown.Trigger";const Qh=Object.assign(Na,{Trigger:Wa,Content:Va,Item:Aa});var sb=$s({defaultClassName:"_18fs8ps2rc _18fs8ps310 _18fs8ps280 _18fs8ps2ho _18fs8ps10 _18fs8ps1r _18fs8ps1lu _18fs8ps1m0 _18fs8ps1li _18fs8ps1lo _18fs8ps1mr _18fs8ps3 _18fs8ps3t0 _18fs8ps3ti _18fs8ps24c _18fs8ps212 _18fs8ps215 _18fs8ps250 _18fs8ps3dc _18fs8ps3e6",variantClassNames:{variant:{contained:"_18fs8ps3q0 _18fs8ps3pd _18fs8ps3p4 _18fs8ps3pt _18fs8ps3qu",text:"_18fs8ps3q0 _18fs8ps3pd _18fs8ps3p4 _18fs8ps3pt _18fs8ps3qu"},size:{small:"_18fs8ps28o _18fs8ps2ic _18fs8ps2ro _18fs8ps31c _18fs8ps1gc _18fs8ps1ff _18fs8ps1i6 _18fs8ps1h9 _18fs8ps1j0 _18fs8ps1k9 _18fs8ps1mx _18fs8ps1zr _18fs8psdr",medium:"_18fs8ps28o _18fs8ps2ic _18fs8ps300 _18fs8ps39o _18fs8ps1gf _18fs8ps1fi _18fs8ps1i9 _18fs8ps1hc _18fs8ps17o _18fs8ps1j3 _18fs8ps1k9 _18fs8ps1n0 _18fs8ps1zr _18fs8psdl",large:"_18fs8ps290 _18fs8ps2io _18fs8ps2s0 _18fs8ps31o _18fs8ps1gf _18fs8ps1fi _18fs8ps1i9 _18fs8ps1hc _18fs8ps17u _18fs8ps1j6 _18fs8ps1kc _18fs8ps1n3 _18fs8ps1zr _18fs8psdo"}},defaultVariants:{size:"medium"},compoundVariants:[]});const La=a.forwardRef(({children:s,size:e,variant:t="contained",disabled:o,className:i,...n},f)=>u.jsxs(Y,{as:"button",className:ps(sb({size:e,variant:t}),i),disabled:o,ref:f,"data-macaw-ui-component":"DropdownButton",...n,children:[s,u.jsx(tt,{size:"small",className:Js({color:"default2"})})]}));La.displayName="DropdownButton";const eb=s=>{const e=/^[\d.,]*$|(Backspace|Tab|Delete|ArrowLeft|ArrowRight|ArrowDown|ArrowUp)/;return!s.key.match(e)&&s.preventDefault()},tb=(s,e,t)=>ob(s)||e!==""&&e!==void 0?!0:t,ob=s=>["date","time","datetime-local"].includes(s??""),nb=(s,e,t)=>{const[o,i]=a.useState(!1),n=tb(e,s,o);return{handlers:{onFocus:()=>i(!0),onBlur:()=>i(!1),onChange:p=>{t&&t(p)}},value:s,active:o,typed:n}},za=({children:s,id:e,typed:t,active:o,disabled:i,size:n,label:f,error:l,className:r,endAdornment:p})=>u.jsxs(Y,{as:"label",htmlFor:e,className:ps(nt({typed:t,active:o,disabled:i,size:n,error:l}),r),alignItems:"center",gap:1,"data-macaw-ui-component":"Input",children:[u.jsxs(Y,{display:"flex",flexDirection:"column",width:"100%",children:[u.jsx(Y,{as:"span",className:ps(it({typed:t,size:n,disabled:i,error:l})),children:f}),s]}),p]});za.displayName="InputWrapper";const Zt=a.forwardRef(({size:s,disabled:e=!1,className:t,value:o,label:i,id:n,type:f,error:l=!1,onChange:r,helperText:p,onBlur:c,onFocus:d,flex:b,flexBasis:_,flexGrow:y,flexShrink:v,width:m,endAdornment:k,...h},C)=>{const{handlers:x,value:g,active:I,typed:E}=nb(o,f,r);return u.jsxs(Y,{display:"flex",flexDirection:"column",flex:b,flexBasis:_,flexGrow:y,flexShrink:v,width:m,children:[u.jsx(za,{id:n,typed:E,active:I,disabled:e,size:s,label:i,error:l,className:t,endAdornment:k,children:u.jsx(Y,{id:n,as:"input",type:f,className:ps(Jt({size:s,error:l})),disabled:e,value:g,ref:C,onBlur:P=>{x.onBlur(),c==null||c(P)},onFocus:P=>{x.onFocus(),d==null||d(P)},onChange:x.onChange,onKeyDown:P=>{f==="number"&&eb(P)},role:"input",...h})}),p&&u.jsx(Y,{className:hn({size:s}),children:u.jsx(Ps,{size:ve(s),color:l?"critical1":"default2",children:p})})]})});Zt.displayName="Input";const Ha=({children:s,...e})=>u.jsx(Y,{as:"li",...e,"data-macaw-ui-component":"List.Divider",children:s});Ha.displayName="List.Divider";const qa=a.forwardRef(({children:s,disabled:e,onClick:t,className:o,active:i,...n},f)=>u.jsx(Y,{as:"li",display:"flex",alignItems:"center",cursor:{default:"pointer",disabled:"not-allowed"},disabled:e,backgroundColor:{default:i?"default1Focused":"transparent",active:"default1Pressed",hover:"default1Hovered",focus:"default1Focused"},onClick:t,className:o,ref:f,"data-macaw-ui-component":"List.Item",...n,children:s}));qa.displayName="List.Item";const Fa=({children:s})=>u.jsx(Ji,{asChild:!0,"data-macaw-ui-component":"ListItem.Content",children:s});Fa.displayName="ListItem.Content";const k8=a.forwardRef(({children:s,as:e="ul",className:t,...o},i)=>u.jsx(Y,{as:e,ref:i,className:t,margin:0,"data-macaw-ui-component":"List",...o,children:s}));k8.displayName="List";const Ka=a.createContext(null),ib=()=>{const s=a.useContext(Ka);if(s===null)throw new Error("You are outside of context");return s},fb=Ka.Provider;var lb="_16tmpu02",ab="_16tmpu01",rb="_16tmpu00";const Ao="list-item-group-value",Ba=({children:s,defaultExpanded:e=!1,as:t="ul",...o})=>{const[i,n]=a.useState(e?Ao:"");return u.jsx(sf,{asChild:!0,type:"single",collapsible:!0,value:i,onValueChange:n,children:u.jsx(fb,{value:{triggerOpen:()=>n(Ao)},children:u.jsx(k8,{as:t,...o,"data-macaw-ui-component":"ListItem",children:u.jsx(ef,{value:Ao,className:rb,children:s})})})})};Ba.displayName="ListItem";const Za=({children:s,size:e,...t})=>{const{triggerOpen:o}=ib();return u.jsxs(Hs.Item,{"data-macaw-ui-component":"ItemGroup.Trigger",...t,children:[u.jsx(Y,{width:"100%",height:"100%",onClick:o,children:s}),u.jsx(Xi,{asChild:!0,children:u.jsx(et,{icon:u.jsx(un,{className:ab,color:"default1",size:e}),variant:"tertiary",size:e,className:lb})})]})};Za.displayName="ListItem.Trigger";const pb=Object.assign(Ba,{Trigger:Za,Content:Fa}),Hs=Object.assign(k8,{Item:qa,ItemGroup:pb,Divider:Ha}),Ua=({children:s})=>u.jsx(_a,{asChild:!0,"data-macaw-ui-component":"Modal.Close",children:s});Ua.displayName="Modal.Close";var Ni="w2pmqx1";const db=s=>s?{onOpenAutoFocus:e=>{e.preventDefault()}}:{},Ya=({children:s,disableAutofocus:e,container:t,dialogContentProps:o})=>u.jsx(da,{container:t,children:u.jsx(ca,{asChild:!0,className:Ni,children:u.jsx(Xt,{children:u.jsx(ua,{asChild:!0,className:Ni,...db(e),...o,children:s})})})});Ya.displayName="Modal.Content";const Ga=({children:s,open:e,onChange:t})=>u.jsx(ra,{"data-macaw-ui-component":"Modal",open:e,onOpenChange:t,children:s});Ga.displayName="Modal";const Xa=({children:s})=>u.jsx(pa,{asChild:!0,"data-macaw-ui-component":"Modal.Trigger",children:s});Xa.displayName="Modal.Trigger";const cb=Object.assign(Ga,{Content:Ya,Trigger:Xa,Close:Ua});var Ja=$s({defaultClassName:"_1g8t8xp8 _18fs8ps2rc _18fs8ps310 _18fs8ps280 _18fs8ps2ho _18fs8ps1lr _18fs8ps1lx _18fs8ps1lf _18fs8ps1ll _18fs8ps16u _18fs8ps3s0 _18fs8ps1j6 _18fs8ps1kc _18fs8ps1mr _18fs8ps3dc _18fs8ps3e6",variantClassNames:{size:{small:"_18fs8ps1j0 _18fs8ps1k6 _18fs8ps1mx",medium:"_18fs8ps1j3 _18fs8ps1k9 _18fs8ps1n0",large:"_18fs8ps1j3 _18fs8ps1k9 _18fs8ps1n0"},error:{true:"_18fs8ps3co"}},defaultVariants:{size:"medium"},compoundVariants:[]}),ub=$s({defaultClassName:"_1g8t8xp0",variantClassNames:{typed:{true:"_1g8t8xp2"}},defaultVariants:{},compoundVariants:[]});const _b=({size:s,getToggleButtonProps:e,renderEndAdornment:t,disabled:o})=>t?u.jsx(u.Fragment,{children:t(e())}):u.jsx(tt,{className:ps(bn,Js({cursor:"pointer"})),size:s,...e({disabled:o})}),w8=a.forwardRef(({id:s,label:e,className:t,error:o,children:i,getLabelProps:n,typed:f,active:l,disabled:r,size:p,getToggleButtonProps:c,renderEndAdornment:d,hasItemsToSelect:b},_)=>u.jsxs(Y,{ref:_,as:"label",className:ps(nt({typed:f,active:l,disabled:r,size:p,error:o}),t),alignItems:"center",justifyContent:"space-between",disabled:r,flexWrap:"nowrap",gap:3,"data-macaw-ui-component":"Multiselect",...n({htmlFor:s}),cursor:r?"not-allowed":"text",children:[u.jsxs(Y,{display:"flex",flexDirection:"column",width:"100%",children:[u.jsx(Y,{as:"span",className:ps(ub({typed:f}),it({typed:f,size:p,disabled:r,error:o})),children:e}),u.jsx(Y,{display:"flex",flexDirection:"row",gap:1,alignItems:"center",flexWrap:"wrap",children:i})]}),b?u.jsx(_b,{size:p,getToggleButtonProps:c,renderEndAdornment:d,disabled:r}):u.jsx(Y,{width:5,height:5})]}));w8.displayName="MultiselectWrapper";const hb=(s,e,t)=>{const o=e==null?void 0:e.toLowerCase();return t.filter(i=>!s.find(n=>n.value===i.value)&&i.label.toLowerCase().includes(o??""))},Qa=({selectedValues:s,showEmptyState:e=!1,options:t,onChange:o,onInputValueChange:i,onFocus:n,onBlur:f})=>{const[l,r]=a.useState(""),[p,c]=a.useState(!1),d=yo(s)?s.reduce((R,O)=>{const V=t.find(A=>A.value===O);return V&&R.push(V),R},[]):s,b=hb(d,l,t),_=i||e?!0:d.length!==t.length,y=!!(d.length||p),{getSelectedItemProps:v,getDropdownProps:m,removeSelectedItem:k}=ye({selectedItems:d,onStateChange({selectedItems:R,type:O}){switch(O){case ye.stateChangeTypes.SelectedItemKeyDownBackspace:case ye.stateChangeTypes.SelectedItemKeyDownDelete:case ye.stateChangeTypes.DropdownKeyDownBackspace:case ye.stateChangeTypes.FunctionRemoveSelectedItem:{const V=yo(s)?R==null?void 0:R.map(A=>A.value):R;o==null||o(V);break}}}}),{isOpen:h,getLabelProps:C,getMenuProps:x,getInputProps:g,highlightedIndex:I,getItemProps:E,getToggleButtonProps:P}=Us({items:b,itemToString:R=>(R==null?void 0:R.label)??"",defaultHighlightedIndex:0,isItemDisabled:R=>(R==null?void 0:R.disabled)??!1,selectedItem:null,stateReducer(R,O){const{changes:V,type:A}=O;switch(A){case Us.stateChangeTypes.InputKeyDownEnter:case Us.stateChangeTypes.ItemClick:return r(""),{...V,...V.selectedItem&&{isOpen:!0,highlightedIndex:0}};default:return V}},onStateChange({inputValue:R,type:O,selectedItem:V}){switch(O){case Us.stateChangeTypes.InputKeyDownEnter:case Us.stateChangeTypes.ItemClick:case Us.stateChangeTypes.InputBlur:if(V){const A=yo(s)?[...d.map(Z=>Z.value),V.value]:[...d,V];o==null||o(A)}else r("");break;case Us.stateChangeTypes.InputChange:i==null||i(R??""),r(R??"");break}}});return{active:p,itemsToSelect:b,typed:y,isOpen:h,getLabelProps:C,getMenuProps:x,getInputProps:(R,O)=>g(m({onFocus:V=>{c(!0),n==null||n(V)},onBlur:V=>{c(!1),f==null||f(V)},preventKeyAction:h,...R}),O),highlightedIndex:I,getItemProps:E,getSelectedItemProps:v,removeSelectedItem:k,selectedItems:d,inputValue:l,showInput:_,getToggleButtonProps:R=>P({onClick:O=>{O.preventDefault()},...R}),hasItemsToSelect:b.length>0}},bb=({size:s,disabled:e=!1,className:t,label:o,id:i,error:n=!1,helperText:f,options:l,onChange:r,renderEndAdornment:p,value:c=[],onFocus:d,onBlur:b,children:_,locale:y={inputText:"Add item"},...v},m)=>{const{active:k,typed:h,isOpen:C,getLabelProps:x,getMenuProps:g,getInputProps:I,highlightedIndex:E,getItemProps:P,itemsToSelect:R,selectedItems:O,getSelectedItemProps:V,inputValue:A,removeSelectedItem:Z,getToggleButtonProps:N,hasItemsToSelect:B,showInput:H}=Qa({selectedValues:c,showEmptyState:Ve(_),options:l,onChange:r,onFocus:d,onBlur:b}),{refs:U,floatingStyles:K}=dt(),M=I({id:i,ref:m,value:A});return u.jsxs(Y,{display:"flex",flexDirection:"column",children:[u.jsxs(w8,{ref:U.setReference,id:i,typed:h,active:k,disabled:e,size:s,label:o,error:n,className:t,getLabelProps:x,getToggleButtonProps:N,renderEndAdornment:p,hasItemsToSelect:B,children:[O.map(($,S)=>u.jsxs(Y,{"data-test-id":`selected-option-${$.value}-${S}`,paddingX:1.5,paddingY:"px",backgroundColor:"default1",borderColor:"default1",borderWidth:1,borderStyle:"solid",borderRadius:3,display:"flex",gap:1,alignItems:"center",...V({selectedItem:$,index:S}),children:[u.jsx(Ps,{size:1,children:$.label}),!e&&u.jsx(Ps,{cursor:"pointer",size:1,onClick:j=>{j.stopPropagation(),j.preventDefault(),Z($)},children:"✕"})]},`selected-option-${$.value}-${S}`)),u.jsx(Y,{as:"input",className:Ja({size:s,error:n}),placeholder:y.inputText,disabled:e,width:0,__flex:1,minWidth:7,visibility:H?"visible":"hidden",...M,...v,onChange:M.onChange&&to(M.onChange)})]}),u.jsx(ot,{asChild:!0,ref:U.setFloating,style:K,children:u.jsx(Y,{position:"relative",display:C?"block":"none",className:at({size:s}),children:u.jsxs(Hs,{as:"ul",className:lt,...g({},{suppressRefError:!0}),children:[C&&(R==null?void 0:R.map(($,S)=>u.jsx(Hs.Item,{"data-test-id":"select-option",disabled:$.disabled,className:We,active:E===S,...P({item:$,index:S}),children:u.jsx(Ps,{color:$.disabled?"defaultDisabled":void 0,size:rt(s),children:$.label})},`to-select-${i}-${$.value}-${S}`))),C&&!B&&_]})})}),f&&u.jsx(ft,{size:s,error:n,children:f})]})},sr=a.forwardRef(bb),mb=Object.assign(sr,{NoOptions:Le}),vb=({size:s,disabled:e=!1,className:t,label:o,id:i,error:n=!1,helperText:f,options:l,onChange:r,renderEndAdornment:p,value:c=[],onInputValueChange:d,loading:b,onFocus:_,onBlur:y,locale:v,children:m,onScrollEnd:k,...h},C)=>{const{active:x,typed:g,isOpen:I,getLabelProps:E,getMenuProps:P,getInputProps:R,highlightedIndex:O,getItemProps:V,itemsToSelect:A,selectedItems:Z,getSelectedItemProps:N,inputValue:B,removeSelectedItem:H,getToggleButtonProps:U,hasItemsToSelect:K,showInput:M}=Qa({selectedValues:c,showEmptyState:Ve(m),onInputValueChange:d,options:l,onChange:r,onFocus:_,onBlur:y}),{refs:$,floatingStyles:S}=dt(),j=Bl(k),T=R({id:i,ref:C,value:B});return u.jsxs(Y,{display:"flex",flexDirection:"column",children:[u.jsxs(w8,{ref:$.setReference,id:i,typed:g,active:x,disabled:e,size:s,label:o,error:n,className:t,getLabelProps:E,getToggleButtonProps:U,renderEndAdornment:p,hasItemsToSelect:K,children:[Z.map((D,L)=>u.jsxs(Y,{"data-test-id":`selected-option-${D.value}-${L}`,paddingX:1.5,paddingY:"px",backgroundColor:"default1",borderColor:"default1",borderWidth:1,borderStyle:"solid",borderRadius:3,display:"flex",gap:1,alignItems:"center",...N({selectedItem:D,index:L}),children:[u.jsx(Ps,{size:1,children:D.label}),!e&&u.jsx(Ps,{cursor:"pointer",size:1,onClick:F=>{F.stopPropagation(),F.preventDefault(),H(D)},children:"✕"})]},`selected-option-${D.value}-${L}`)),u.jsx(Y,{as:"input",className:Ja({size:s,error:n}),placeholder:(v==null?void 0:v.placeholderText)||"Add item",disabled:e,width:0,__flex:1,minWidth:7,visibility:M?"visible":"hidden",...T,...h,onChange:T.onChange&&to(T.onChange)})]}),u.jsx(ot,{asChild:!0,ref:$.setFloating,style:S,children:u.jsx(Y,{position:"relative",display:Qt({isOpen:I,loading:b,hasItemsToSelect:K,disabled:e,showEmptyState:Ve(m)}),className:at({size:s}),children:u.jsxs(Hs,{as:"ul",className:lt,...P({},{suppressRefError:!0}),children:[I&&(A==null?void 0:A.map((D,L)=>u.jsx(Hs.Item,{"data-test-id":"select-option",className:We,active:O===L,...V({item:D,index:L,disabled:D.disabled}),children:u.jsx(Ps,{color:D.disabled?"defaultDisabled":void 0,size:rt(s),children:D.label})},`to-select-${i}-${D.value}-${L}`))),I&&!b&&!K&&m,b&&u.jsx(Pf,{size:s,children:(v==null?void 0:v.loadingText)||"Loading"}),u.jsx("div",{ref:D=>{j.current=D}})]})})}),f&&u.jsx(ft,{size:s,error:n,children:f})]})},Cb=a.forwardRef(vb),gb=Object.assign(Cb,{NoOptions:Le}),er=a.forwardRef(({...s},e)=>u.jsx(Ps,{ref:e,display:"block",as:"p",...s}));er.displayName="Paragraph";const tr="Popover",[or,_m]=qs(tr,[qe]),ht=qe(),[yb,Ce]=or(tr),xb=s=>{const{__scopePopover:e,children:t,open:o,defaultOpen:i,onOpenChange:n,modal:f=!1}=s,l=ht(e),r=a.useRef(null),[p,c]=a.useState(!1),[d=!1,b]=Xs({prop:o,defaultProp:i,onChange:n});return a.createElement(v8,l,a.createElement(yb,{scope:e,contentId:se(),triggerRef:r,open:d,onOpenChange:b,onOpenToggle:a.useCallback(()=>b(_=>!_),[b]),hasCustomAnchor:p,onCustomAnchorAdd:a.useCallback(()=>c(!0),[]),onCustomAnchorRemove:a.useCallback(()=>c(!1),[]),modal:f},t))},kb="PopoverAnchor",wb=a.forwardRef((s,e)=>{const{__scopePopover:t,...o}=s,i=Ce(kb,t),n=ht(t),{onCustomAnchorAdd:f,onCustomAnchorRemove:l}=i;return a.useEffect(()=>(f(),()=>l()),[f,l]),a.createElement(po,ts({},n,o,{ref:e}))}),$b="PopoverTrigger",Ib=a.forwardRef((s,e)=>{const{__scopePopover:t,...o}=s,i=Ce($b,t),n=ht(t),f=ws(e,i.triggerRef),l=a.createElement(xs.button,ts({type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":fr(i.open)},o,{ref:f,onClick:fs(s.onClick,i.onOpenToggle)}));return i.hasCustomAnchor?l:a.createElement(po,ts({asChild:!0},n),l)}),nr="PopoverPortal",[Eb,Rb]=or(nr,{forceMount:void 0}),Pb=s=>{const{__scopePopover:e,forceMount:t,children:o,container:i}=s,n=Ce(nr,e);return a.createElement(Eb,{scope:e,forceMount:t},a.createElement(Fs,{present:t||n.open},a.createElement(ao,{asChild:!0,container:i},o)))},Je="PopoverContent",Sb=a.forwardRef((s,e)=>{const t=Rb(Je,s.__scopePopover),{forceMount:o=t.forceMount,...i}=s,n=Ce(Je,s.__scopePopover);return a.createElement(Fs,{present:o||n.open},n.modal?a.createElement(Db,ts({},i,{ref:e})):a.createElement(Ob,ts({},i,{ref:e})))}),Db=a.forwardRef((s,e)=>{const t=Ce(Je,s.__scopePopover),o=a.useRef(null),i=ws(e,o),n=a.useRef(!1);return a.useEffect(()=>{const f=o.current;if(f)return b8(f)},[]),a.createElement(h8,{as:$e,allowPinchZoom:!0},a.createElement(ir,ts({},s,{ref:i,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:fs(s.onCloseAutoFocus,f=>{var l;f.preventDefault(),n.current||(l=t.triggerRef.current)===null||l===void 0||l.focus()}),onPointerDownOutside:fs(s.onPointerDownOutside,f=>{const l=f.detail.originalEvent,r=l.button===0&&l.ctrlKey===!0,p=l.button===2||r;n.current=p},{checkForDefaultPrevented:!1}),onFocusOutside:fs(s.onFocusOutside,f=>f.preventDefault(),{checkForDefaultPrevented:!1})})))}),Ob=a.forwardRef((s,e)=>{const t=Ce(Je,s.__scopePopover),o=a.useRef(!1),i=a.useRef(!1);return a.createElement(ir,ts({},s,{ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:n=>{var f;if((f=s.onCloseAutoFocus)===null||f===void 0||f.call(s,n),!n.defaultPrevented){var l;o.current||(l=t.triggerRef.current)===null||l===void 0||l.focus(),n.preventDefault()}o.current=!1,i.current=!1},onInteractOutside:n=>{var f,l;(f=s.onInteractOutside)===null||f===void 0||f.call(s,n),n.defaultPrevented||(o.current=!0,n.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const r=n.target;((l=t.triggerRef.current)===null||l===void 0?void 0:l.contains(r))&&n.preventDefault(),n.detail.originalEvent.type==="focusin"&&i.current&&n.preventDefault()}}))}),ir=a.forwardRef((s,e)=>{const{__scopePopover:t,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:n,disableOutsidePointerEvents:f,onEscapeKeyDown:l,onPointerDownOutside:r,onFocusOutside:p,onInteractOutside:c,...d}=s,b=Ce(Je,t),_=ht(t);return _8(),a.createElement(u8,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:i,onUnmountAutoFocus:n},a.createElement(lo,{asChild:!0,disableOutsidePointerEvents:f,onInteractOutside:c,onEscapeKeyDown:l,onPointerDownOutside:r,onFocusOutside:p,onDismiss:()=>b.onOpenChange(!1)},a.createElement(C8,ts({"data-state":fr(b.open),role:"dialog",id:b.contentId},_,d,{ref:e,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}}))))}),jb="PopoverClose",Tb=a.forwardRef((s,e)=>{const{__scopePopover:t,...o}=s,i=Ce(jb,t);return a.createElement(xs.button,ts({type:"button"},o,{ref:e,onClick:fs(s.onClick,()=>i.onOpenChange(!1))}))}),Mb=a.forwardRef((s,e)=>{const{__scopePopover:t,...o}=s,i=ht(t);return a.createElement(ka,ts({},i,o,{ref:e}))});function fr(s){return s?"open":"closed"}const Vb=xb,Ab=wb,Nb=Ib,Wb=Pb,Lb=Sb,zb=Tb,Hb=Mb;var qb="_1t0scx21",Fb="_18fs8ps1lu _18fs8ps1m0 _18fs8ps1li _18fs8ps1lo _18fs8ps1gf _18fs8ps1fi _18fs8ps1i9 _18fs8ps1hc _18fs8ps250 _18fs8ps21o _18fs8ps3v0 _18fs8ps3q0";const lr=({children:s,className:e,onInteractOutside:t,...o})=>u.jsx(Wb,{children:u.jsx(Lb,{asChild:!0,className:ps(Fb,e),"data-macaw-ui-component":"Popover.Content",onInteractOutside:t,...o,children:s})});lr.displayName="Popover.Content";const ar=({children:s})=>u.jsx(Ab,{asChild:!0,"data-macaw-ui-component":"Popover.Anchor",children:s});ar.displayName="Popover.Anchor";const rr=({children:s})=>u.jsx(Nb,{asChild:!0,"data-macaw-ui-component":"Popover.Trigger",children:s});rr.displayName="Popover.Trigger";const pr=({className:s,fill:e="default2",stroke:t="default1"})=>u.jsx(Hb,{className:ps(qb,s),asChild:!0,children:u.jsx("svg",{width:"20",height:"9",viewBox:"0 0 20 9",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-macaw-ui-component":"Popover.Arrow",children:u.jsx("path",{d:"M8.08579 7.08579L0.5 -0.5H18.5L10.9142 7.08579C10.1332 7.86683 8.86684 7.86684 8.08579 7.08579Z",strokeLinejoin:"round",className:Js({fill:e,stroke:t})})})});pr.displayName="Popover.Arrow";const dr=({children:s,...e})=>u.jsx(Vb,{...e,"data-macaw-ui-component":"Popover",children:s});dr.displayName="Popover";const cr=({children:s})=>u.jsx(zb,{asChild:!0,"data-macaw-ui-component":"Popover.Close",children:s});cr.displayName="Popover.Close";const Kb=Object.assign(dr,{Trigger:rr,Content:lr,Anchor:ar,Arrow:pr,Close:cr}),ur="Radio",[Bb,_r]=qs(ur),[Zb,Ub]=Bb(ur),Yb=a.forwardRef((s,e)=>{const{__scopeRadio:t,name:o,checked:i=!1,required:n,disabled:f,value:l="on",onCheck:r,...p}=s,[c,d]=a.useState(null),b=ws(e,v=>d(v)),_=a.useRef(!1),y=c?!!c.closest("form"):!0;return a.createElement(Zb,{scope:t,checked:i,disabled:f},a.createElement(xs.button,ts({type:"button",role:"radio","aria-checked":i,"data-state":hr(i),"data-disabled":f?"":void 0,disabled:f,value:l},p,{ref:b,onClick:fs(s.onClick,v=>{i||r==null||r(),y&&(_.current=v.isPropagationStopped(),_.current||v.stopPropagation())})})),y&&a.createElement(Jb,{control:c,bubbles:!_.current,name:o,value:l,checked:i,required:n,disabled:f,style:{transform:"translateX(-100%)"}}))}),Gb="RadioIndicator",Xb=a.forwardRef((s,e)=>{const{__scopeRadio:t,forceMount:o,...i}=s,n=Ub(Gb,t);return a.createElement(Fs,{present:o||n.checked},a.createElement(xs.span,ts({"data-state":hr(n.checked),"data-disabled":n.disabled?"":void 0},i,{ref:e})))}),Jb=s=>{const{control:e,checked:t,bubbles:o=!0,...i}=s,n=a.useRef(null),f=xf(t),l=_n(e);return a.useEffect(()=>{const r=n.current,p=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(p,"checked").set;if(f!==t&&d){const b=new Event("click",{bubbles:o});d.call(r,t),r.dispatchEvent(b)}},[f,t,o]),a.createElement("input",ts({type:"radio","aria-hidden":!0,defaultChecked:t},i,{tabIndex:-1,ref:n,style:{...s.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function hr(s){return s?"checked":"unchecked"}const Qb=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],br="RadioGroup",[s2,hm]=qs(br,[co,_r]),mr=co(),vr=_r(),[e2,t2]=s2(br),o2=a.forwardRef((s,e)=>{const{__scopeRadioGroup:t,name:o,defaultValue:i,value:n,required:f=!1,disabled:l=!1,orientation:r,dir:p,loop:c=!0,onValueChange:d,...b}=s,_=mr(t),y=Ut(p),[v,m]=Xs({prop:n,defaultProp:i,onChange:d});return a.createElement(e2,{scope:t,name:o,required:f,disabled:l,value:v,onValueChange:m},a.createElement(Ia,ts({asChild:!0},_,{orientation:r,dir:y,loop:c}),a.createElement(xs.div,ts({role:"radiogroup","aria-required":f,"aria-orientation":r,"data-disabled":l?"":void 0,dir:y},b,{ref:e}))))}),n2="RadioGroupItem",i2=a.forwardRef((s,e)=>{const{__scopeRadioGroup:t,disabled:o,...i}=s,n=t2(n2,t),f=n.disabled||o,l=mr(t),r=vr(t),p=a.useRef(null),c=ws(e,p),d=n.value===i.value,b=a.useRef(!1);return a.useEffect(()=>{const _=v=>{Qb.includes(v.key)&&(b.current=!0)},y=()=>b.current=!1;return document.addEventListener("keydown",_),document.addEventListener("keyup",y),()=>{document.removeEventListener("keydown",_),document.removeEventListener("keyup",y)}},[]),a.createElement(Ea,ts({asChild:!0},l,{focusable:!f,active:d}),a.createElement(Yb,ts({disabled:f,required:n.required,checked:d},r,i,{name:n.name,ref:c,onCheck:()=>n.onValueChange(i.value),onKeyDown:fs(_=>{_.key==="Enter"&&_.preventDefault()}),onFocus:fs(i.onFocus,()=>{var _;b.current&&((_=p.current)===null||_===void 0||_.click())})})))}),f2=a.forwardRef((s,e)=>{const{__scopeRadioGroup:t,...o}=s,i=vr(t);return a.createElement(Xb,ts({},i,o,{ref:e}))}),Cr=o2,gr=i2,l2=f2;var a2="_18fs8ps2rc _18fs8ps310 _18fs8ps280 _18fs8ps2ho _18fs8psuf _18fs8pswx _18fs8pszf _18fs8ps11x _18fs8ps1lr _18fs8ps1lx _18fs8ps1lf _18fs8ps1ll",r2=$s({defaultClassName:"_18fs8ps2rc _18fs8ps310 _18fs8ps280 _18fs8ps2ho _18fs8psuf _18fs8pswx _18fs8pszf _18fs8ps11x",variantClassNames:{size:{small:"_18fs8ps1j0 _18fs8ps1mx _18fs8ps1k6",medium:"_18fs8ps1j3 _18fs8ps1n0 _18fs8ps1k9",large:"_18fs8ps1j6 _18fs8ps1n3 _18fs8ps1kc"},disabled:{true:"_18fs8ps3e0"},error:{true:"_18fs8ps3d0",false:"_18fs8ps3do"}},defaultVariants:{size:"medium"},compoundVariants:[]});const yr=a.forwardRef(({children:s,className:e,value:t,label:o,onValueChange:i,size:n,disabled:f=!1,error:l=!1,...r},p)=>u.jsx(Cr,{asChild:!0,value:t,onValueChange:i,children:u.jsxs(Y,{...r,className:ps(a2,e),ref:p,as:"fieldset","data-macaw-ui-component":"RadioGroup",children:[o&&u.jsx("legend",{className:ps(r2({disabled:f,error:l,size:n}),e),children:o}),s]})}));yr.displayName="RadioGroup";var p2=$s({defaultClassName:"_18fs8ps1px _18fs8ps1sc _18fs8ps1ur _18fs8ps1x6 _18fs8ps2o _18fs8psf _18fs8ps1yu",variantClassNames:{disabled:{true:"_18fs8ps3e0",false:"_18fs8ps3bo"}},defaultVariants:{disabled:!1},compoundVariants:[]}),d2=$s({defaultClassName:"_1ru9wzg7 _18fs8ps2rc _18fs8ps310 _18fs8ps280 _18fs8ps2ho _18fs8ps1lu _18fs8ps1m0 _18fs8ps1li _18fs8ps1lo _18fs8ps1h3 _18fs8ps1g6 _18fs8ps1ix _18fs8ps1i0 _18fs8ps2l _18fs8ps3uo _18fs8ps21o _18fs8ps3t0 _18fs8ps250 _18fs8ps14o _18fs8ps179 _18fs8ps3oo",variantClassNames:{error:{true:"_1ru9wzg8"},disabled:{true:"_1ru9wzg9"}},defaultVariants:{error:!1,disabled:!1},compoundVariants:[]});const $8=a.forwardRef(({disabled:s,asChild:e},t)=>u.jsx(l2,{className:p2({disabled:s}),asChild:e,ref:t,children:u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"6",height:"6",fill:"currentColor",children:u.jsx("circle",{cx:"3",cy:"3",r:"3",fill:"currentColor"})})}));$8.displayName="RadioGroupIndicator";const xr=a.forwardRef(({value:s,id:e,disabled:t,children:o,className:i,error:n,...f},l)=>u.jsxs(Y,{display:"flex",alignItems:"center",gap:1.5,position:"relative",...f,className:i,ref:l,"data-macaw-ui-component":"RadioGroup.Item",children:[u.jsx(gr,{className:d2({error:n,disabled:t}),value:s,id:e,disabled:t,children:u.jsx($8,{disabled:t,asChild:!0})}),u.jsx(Y,{as:"label",htmlFor:e,cursor:t?"not-allowed":"pointer",children:o})]}));xr.displayName="RadioGroup.Item";const c2=Object.assign(yr,{Item:xr,Indicator:$8}),kr=a.forwardRef(({value:s=["",""],onChange:e,children:t,type:o="number",...i},n)=>{const[f,l]=s;return u.jsxs(u.Fragment,{children:[u.jsx(Zt,{value:f,onChange:r=>e==null?void 0:e([r.target.value,l]),type:o,ref:n,...i}),t,u.jsx(Zt,{value:l,onChange:r=>e==null?void 0:e([f,r.target.value]),type:o,ref:n,...i})]})});kr.displayName="RangeInput";var u2=$s({defaultClassName:"_18fs8ps2rc _18fs8ps310 _18fs8ps280 _18fs8ps2ho _18fs8ps1lr _18fs8ps1lx _18fs8ps1lf _18fs8ps1ll _18fs8ps16u _18fs8ps3s0 _18fs8ps1mr _18fs8ps3dc _18fs8ps3du _18fs8ps3dv",variantClassNames:{},defaultVariants:{},compoundVariants:[]}),_2=$s({defaultClassName:"_18fs8ps1gf _18fs8ps1fi _18fs8ps1i9 _18fs8ps1hc _18fs8ps2l _18fs8ps3 _18fs8ps10 _18fs8ps3dc _18fs8ps16u _18fs8ps3wo _18fs8ps3oo _18fs8ps3pd _18fs8ps3p3",variantClassNames:{size:{small:"_18fs8ps28o _18fs8ps2ic _18fs8ps300 _18fs8ps39o",medium:"_18fs8ps28o _18fs8ps2ic _18fs8ps2s0 _18fs8ps31o",large:"_18fs8ps290 _18fs8ps2io _18fs8ps2sc _18fs8ps320"}},defaultVariants:{},compoundVariants:[]}),h2=$s({defaultClassName:"_18fs8ps3do _18fs8ps123",variantClassNames:{},defaultVariants:{},compoundVariants:[]});const wr=a.forwardRef(({id:s,className:e,size:t,...o},i)=>u.jsxs(Y,{id:s,className:ps(_2({size:t}),e),"data-macaw-ui-component":"SearchInput",children:[u.jsx(vf,{size:"medium",className:h2()}),u.jsx(Y,{as:"input",className:u2(),ref:i,type:"text",...o})]}));wr.displayName="SearchInput";const $r=a.forwardRef(({id:s,label:e,className:t,error:o,children:i,getToggleButtonProps:n,getLabelProps:f,typed:l,active:r,disabled:p,size:c},d)=>u.jsx(Y,{ref:d,children:u.jsxs(Y,{as:"label",className:ps(nt({typed:l,active:r,disabled:p,size:c,error:o}),t),alignItems:"center",justifyContent:"space-between",disabled:p,flexWrap:"nowrap",gap:3,...n(),"data-macaw-ui-component":"Select",cursor:p?"not-allowed":"pointer",children:[u.jsxs(Y,{display:"flex",flexDirection:"column",__width:"calc(100% - 30px)",children:[u.jsx(Y,{as:"span",className:ps(it({typed:l,size:c,disabled:p,error:o})),...f({htmlFor:s}),children:e}),i]}),u.jsx(tt,{className:ps(bn,Js({cursor:"pointer"})),size:c})]})}));$r.displayName="SelectWrapper";const b2=({value:s,isValuePassedAsString:e,options:t,onChange:o,onFocus:i,onBlur:n})=>{const[f,l]=a.useState(!1),r=!!(s||f),{highlightedIndex:p,onHighlightedIndexChange:c}=Sf(t,s),{isOpen:d,getToggleButtonProps:b,getLabelProps:_,getMenuProps:y,getItemProps:v,selectedItem:m}=Ln({items:t,selectedItem:s??null,isItemDisabled:k=>(k==null?void 0:k.disabled)??!1,highlightedIndex:p,onHighlightedIndexChange(k){c(k)},itemToString:k=>(k==null?void 0:k.value)??"",onSelectedItemChange:({selectedItem:k})=>{if(k){const h=e?k.value:k;o==null||o(h)}}});return{active:f,typed:r,isOpen:d,getToggleButtonProps:(k,h)=>b({onFocus:C=>{l(!0),i==null||i(C)},onBlur:C=>{l(!1),n==null||n(C)},...k},h),getLabelProps:_,getMenuProps:y,highlightedIndex:p,getItemProps:v,selectedItem:m,hasItemsToSelect:t.length>0}},m2=s=>{switch(s){case"small":return 4;case"medium":return 5;case"large":return 6}},v2=({size:s="medium",disabled:e=!1,className:t,value:o,label:i,id:n,error:f=!1,helperText:l,options:r,onChange:p,onFocus:c,onBlur:d,startAdornment:b,endAdornment:_,children:y,...v},m)=>{const k=Mt(o),{active:h,typed:C,isOpen:x,getItemProps:g,getLabelProps:I,getToggleButtonProps:E,selectedItem:P,getMenuProps:R,highlightedIndex:O,hasItemsToSelect:V}=b2({value:k?r.find(B=>B.value===o):o,isValuePassedAsString:k,options:r,onChange:p,onFocus:c,onBlur:d}),{refs:A,floatingStyles:Z}=dt(),N=a.useMemo(()=>f?"critical1":e?"defaultDisabled":"default1",[e,f]);return u.jsxs(Y,{display:"flex",flexDirection:"column",children:[u.jsx($r,{ref:A.setReference,id:n,typed:C,active:h,disabled:e,size:s,label:i,error:f,className:t,getLabelProps:I,getToggleButtonProps:E,children:u.jsxs(Y,{height:m2(s),...v,ref:m,display:"flex",children:[b&&C&&b(o),u.jsx(Ps,{size:ve(s),color:N,title:P==null?void 0:P.label,width:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",children:P==null?void 0:P.label}),_&&C&&_(o)]})}),u.jsx(ot,{asChild:!0,ref:A.setFloating,style:Z,children:u.jsx(Y,{position:"relative",display:Qt({isOpen:x,disabled:e,hasItemsToSelect:V,showEmptyState:Ve(y)}),className:at({size:s}),children:u.jsxs(Hs,{as:"ul",className:lt,...R({},{suppressRefError:!0}),children:[x&&(r==null?void 0:r.map((B,H)=>u.jsxs(Hs.Item,{"data-test-id":"select-option",className:We,disabled:B.disabled,...g({item:B,index:H}),active:O===H,children:[B==null?void 0:B.startAdornment,u.jsx(Ps,{color:B.disabled?"defaultDisabled":void 0,size:rt(s),width:"100%",children:B.label}),B==null?void 0:B.endAdornment]},`${n}-${B.value}-${H}`))),x&&!V&&y]})})}),l&&u.jsx(ft,{size:s,error:f,children:l})]})},C2=a.forwardRef(v2),g2=Object.assign(C2,{NoOptions:Le});var y2="_1ucx6ny1";const x2=({className:s,...e})=>u.jsx(Y,{className:ps(y2,s),backgroundColor:"default3",width:"100%",height:3,borderRadius:2,...e});var k2="u64rbw1";const I8=a.forwardRef(({className:s},e)=>u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",className:ps(k2,s),ref:e,children:u.jsx("g",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.333",children:u.jsx("path",{d:"M8 1.332v2.667M8 12v2.667M3.285 3.285l1.887 1.887M10.826 10.826l1.887 1.887M1.332 8h2.667M12 8h2.667M3.285 12.713l1.887-1.887M10.826 5.172l1.887-1.887"})})}));I8.displayName="Spinner";var w2=$s({defaultClassName:"edj57v3 _18fs8ps2ro _18fs8ps31c _18fs8ps28c _18fs8ps2i0 _18fs8ps1gc _18fs8ps1ff _18fs8ps1i6 _18fs8ps1h9 _18fs8ps19f _18fs8ps3t0",variantClassNames:{},defaultVariants:{},compoundVariants:[]}),$2=$s({defaultClassName:"_18fs8ps2zo _18fs8ps39c _18fs8ps2gc _18fs8ps2q0 _18fs8ps1gf _18fs8ps1fi _18fs8ps1i9 _18fs8ps1hc _18fs8ps3 _18fs8psfl _18fs8ps3qc _18fs8ps21o _18fs8ps17o",variantClassNames:{},defaultVariants:{},compoundVariants:[]});const Ir=a.forwardRef(({children:s,className:e,defaultValue:t,onValueChange:o,value:i,...n},f)=>u.jsx(Cr,{asChild:!0,defaultValue:t,value:i,onValueChange:o,children:u.jsx(Y,{className:ps($2(),e),ref:f,...n,"data-macaw-ui-component":"Switch",children:s})}));Ir.displayName="Switch";const Er=({value:s,id:e,disabled:t=!1,children:o,...i})=>u.jsx(gr,{asChild:!0,value:s,id:e,disabled:t,className:w2(),"data-macaw-ui-component":"SwitchItem",children:u.jsx(Y,{...i,children:o})});Er.displayName="Switch.Item";const I2=Object.assign(Ir,{Item:Er}),E2=(s,e,t,o)=>{const i=Wi(s,t),n=Wi(s,o);a.useEffect(()=>{if(s){s.style.height="0px";const f=Math.max(i,s.scrollHeight),l=Math.min(f,n);s.style.height=`${l}px`}},[i,n,s,e])};function Wi(s,e){return s?parseFloat(getComputedStyle(s).lineHeight)*e:0}const R2=(s,e)=>{const[t,o]=a.useState(!1);return{handlers:{onFocus:()=>o(!0),onBlur:()=>o(!1),onChange:r=>{e&&e(r)}},value:s,active:t,typed:!!(s||t)}},Rr=({children:s,id:e,typed:t,active:o,disabled:i,size:n,label:f,error:l,className:r,endAdornment:p})=>u.jsxs(Y,{as:"label",htmlFor:e,className:ps(nt({typed:t,active:o,disabled:i,size:n,error:l}),r),alignItems:"center",gap:1,"data-macaw-ui-component":"Textarea",children:[u.jsxs(Y,{display:"flex",flexDirection:"column",width:"100%",children:[u.jsx(Y,{as:"span",className:ps(it({typed:t,size:n,disabled:i,error:l})),children:f}),s]}),p]});Rr.displayName="TextareaWrapper";const Pr=a.forwardRef(({size:s,disabled:e=!1,className:t,value:o,label:i,id:n,error:f=!1,onChange:l,helperText:r,onBlur:p,onFocus:c,flex:d,flexBasis:b,flexGrow:_,flexShrink:y,width:v,endAdornment:m,rows:k=10,maxRows:h=20,...C},x)=>{const{handlers:g,value:I,active:E,typed:P}=R2(o,l),R=a.useRef(null);return E2(R.current,o,k,h),a.useImperativeHandle(x,()=>R.current),u.jsxs(Y,{display:"flex",flexDirection:"column",flex:d,flexBasis:b,flexGrow:_,flexShrink:y,width:v,children:[u.jsx(Rr,{id:n,typed:P,active:E,disabled:e,size:s,label:i,error:f,className:t,endAdornment:m,children:u.jsx(Y,{id:n,as:"textarea",className:ps(Jt({size:s,error:f})),style:{resize:"none"},disabled:e,value:I,ref:R,onBlur:O=>{g.onBlur(),p==null||p(O)},onFocus:O=>{g.onFocus(),c==null||c(O)},onChange:g.onChange,rows:k,...C})}),r&&u.jsx(Y,{className:hn({size:s}),children:u.jsx(Ps,{size:ve(s),color:f?"critical1":"default2",children:r})})]})});Pr.displayName="Textarea";const P2=a.forwardRef((s,e)=>{const{pressed:t,defaultPressed:o=!1,onPressedChange:i,...n}=s,[f=!1,l]=Xs({prop:t,onChange:i,defaultProp:o});return a.createElement(xs.button,ts({type:"button","aria-pressed":f,"data-state":f?"on":"off","data-disabled":s.disabled?"":void 0},n,{ref:e,onClick:fs(s.onClick,()=>{s.disabled||l(!f)})}))}),S2=P2;var D2=$s({defaultClassName:"agkfzb1 _18fs8ps2zc _18fs8ps390 _18fs8ps2g0 _18fs8ps2po _18fs8ps1lu _18fs8ps1m0 _18fs8ps1li _18fs8ps1lo _18fs8ps1gx _18fs8ps1g0 _18fs8ps1ir _18fs8ps1hu _18fs8ps3 _18fs8ps10 _18fs8ps2l _18fs8ps1mr _18fs8ps3t0",variantClassNames:{},defaultVariants:{},compoundVariants:[]});const Sr=a.forwardRef(({disabled:s=!1,pressed:e,onPressedChange:t,children:o,...i},n)=>u.jsxs(Y,{as:"label",display:"flex",alignItems:"center",gap:1.5,cursor:s?"not-allowed":"pointer","data-macaw-ui-component":"Toggle",children:[u.jsx(S2,{ref:n,className:D2(),pressed:e,onPressedChange:t,disabled:s,...i}),o]}));Sr.displayName="Toggle";const O2=a.forwardRef((s,e)=>a.createElement(xs.span,gs({},s,{ref:e,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...s.style}}))),j2=O2,[_o,bm]=qs("Tooltip",[qe]),ho=qe(),T2="TooltipProvider",M2=700,on="tooltip.open",[V2,E8]=_o(T2),A2=s=>{const{__scopeTooltip:e,delayDuration:t=M2,skipDelayDuration:o=300,disableHoverableContent:i=!1,children:n}=s,[f,l]=a.useState(!0),r=a.useRef(!1),p=a.useRef(0);return a.useEffect(()=>{const c=p.current;return()=>window.clearTimeout(c)},[]),a.createElement(V2,{scope:e,isOpenDelayed:f,delayDuration:t,onOpen:a.useCallback(()=>{window.clearTimeout(p.current),l(!1)},[]),onClose:a.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>l(!0),o)},[o]),isPointerInTransitRef:r,onPointerInTransitChange:a.useCallback(c=>{r.current=c},[]),disableHoverableContent:i},n)},R8="Tooltip",[N2,bt]=_o(R8),W2=s=>{const{__scopeTooltip:e,children:t,open:o,defaultOpen:i=!1,onOpenChange:n,disableHoverableContent:f,delayDuration:l}=s,r=E8(R8,s.__scopeTooltip),p=ho(e),[c,d]=a.useState(null),b=se(),_=a.useRef(0),y=f??r.disableHoverableContent,v=l??r.delayDuration,m=a.useRef(!1),[k=!1,h]=Xs({prop:o,defaultProp:i,onChange:E=>{E?(r.onOpen(),document.dispatchEvent(new CustomEvent(on))):r.onClose(),n==null||n(E)}}),C=a.useMemo(()=>k?m.current?"delayed-open":"instant-open":"closed",[k]),x=a.useCallback(()=>{window.clearTimeout(_.current),m.current=!1,h(!0)},[h]),g=a.useCallback(()=>{window.clearTimeout(_.current),h(!1)},[h]),I=a.useCallback(()=>{window.clearTimeout(_.current),_.current=window.setTimeout(()=>{m.current=!0,h(!0)},v)},[v,h]);return a.useEffect(()=>()=>window.clearTimeout(_.current),[]),a.createElement(v8,p,a.createElement(N2,{scope:e,contentId:b,open:k,stateAttribute:C,trigger:c,onTriggerChange:d,onTriggerEnter:a.useCallback(()=>{r.isOpenDelayed?I():x()},[r.isOpenDelayed,I,x]),onTriggerLeave:a.useCallback(()=>{y?g():window.clearTimeout(_.current)},[g,y]),onOpen:x,onClose:g,disableHoverableContent:y},t))},Li="TooltipTrigger",L2=a.forwardRef((s,e)=>{const{__scopeTooltip:t,...o}=s,i=bt(Li,t),n=E8(Li,t),f=ho(t),l=a.useRef(null),r=ws(e,l,i.onTriggerChange),p=a.useRef(!1),c=a.useRef(!1),d=a.useCallback(()=>p.current=!1,[]);return a.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),a.createElement(po,ts({asChild:!0},f),a.createElement(xs.button,ts({"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute},o,{ref:r,onPointerMove:fs(s.onPointerMove,b=>{b.pointerType!=="touch"&&!c.current&&!n.isPointerInTransitRef.current&&(i.onTriggerEnter(),c.current=!0)}),onPointerLeave:fs(s.onPointerLeave,()=>{i.onTriggerLeave(),c.current=!1}),onPointerDown:fs(s.onPointerDown,()=>{p.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:fs(s.onFocus,()=>{p.current||i.onOpen()}),onBlur:fs(s.onBlur,i.onClose),onClick:fs(s.onClick,i.onClose)})))}),Dr="TooltipPortal",[z2,H2]=_o(Dr,{forceMount:void 0}),q2=s=>{const{__scopeTooltip:e,forceMount:t,children:o,container:i}=s,n=bt(Dr,e);return a.createElement(z2,{scope:e,forceMount:t},a.createElement(Fs,{present:t||n.open},a.createElement(ao,{asChild:!0,container:i},o)))},Qe="TooltipContent",F2=a.forwardRef((s,e)=>{const t=H2(Qe,s.__scopeTooltip),{forceMount:o=t.forceMount,side:i="top",...n}=s,f=bt(Qe,s.__scopeTooltip);return a.createElement(Fs,{present:o||f.open},f.disableHoverableContent?a.createElement(Or,ts({side:i},n,{ref:e})):a.createElement(K2,ts({side:i},n,{ref:e})))}),K2=a.forwardRef((s,e)=>{const t=bt(Qe,s.__scopeTooltip),o=E8(Qe,s.__scopeTooltip),i=a.useRef(null),n=ws(e,i),[f,l]=a.useState(null),{trigger:r,onClose:p}=t,c=i.current,{onPointerInTransitChange:d}=o,b=a.useCallback(()=>{l(null),d(!1)},[d]),_=a.useCallback((y,v)=>{const m=y.currentTarget,k={x:y.clientX,y:y.clientY},h=G2(k,m.getBoundingClientRect()),C=X2(k,h),x=J2(v.getBoundingClientRect()),g=sm([...C,...x]);l(g),d(!0)},[d]);return a.useEffect(()=>()=>b(),[b]),a.useEffect(()=>{if(r&&c){const y=m=>_(m,c),v=m=>_(m,r);return r.addEventListener("pointerleave",y),c.addEventListener("pointerleave",v),()=>{r.removeEventListener("pointerleave",y),c.removeEventListener("pointerleave",v)}}},[r,c,_,b]),a.useEffect(()=>{if(f){const y=v=>{const m=v.target,k={x:v.clientX,y:v.clientY},h=(r==null?void 0:r.contains(m))||(c==null?void 0:c.contains(m)),C=!Q2(k,f);h?b():C&&(b(),p())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[r,c,f,p,b]),a.createElement(Or,ts({},s,{ref:n}))}),[B2,Z2]=_o(R8,{isInside:!1}),Or=a.forwardRef((s,e)=>{const{__scopeTooltip:t,children:o,"aria-label":i,onEscapeKeyDown:n,onPointerDownOutside:f,...l}=s,r=bt(Qe,t),p=ho(t),{onClose:c}=r;return a.useEffect(()=>(document.addEventListener(on,c),()=>document.removeEventListener(on,c)),[c]),a.useEffect(()=>{if(r.trigger){const d=b=>{const _=b.target;_!=null&&_.contains(r.trigger)&&c()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[r.trigger,c]),a.createElement(lo,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:n,onPointerDownOutside:f,onFocusOutside:d=>d.preventDefault(),onDismiss:c},a.createElement(C8,ts({"data-state":r.stateAttribute},p,l,{ref:e,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"}}),a.createElement(Hi,null,o),a.createElement(B2,{scope:t,isInside:!0},a.createElement(j2,{id:r.contentId,role:"tooltip"},i||o))))}),U2="TooltipArrow",Y2=a.forwardRef((s,e)=>{const{__scopeTooltip:t,...o}=s,i=ho(t);return Z2(U2,t).isInside?null:a.createElement(ka,ts({},i,o,{ref:e}))});function G2(s,e){const t=Math.abs(e.top-s.y),o=Math.abs(e.bottom-s.y),i=Math.abs(e.right-s.x),n=Math.abs(e.left-s.x);switch(Math.min(t,o,i,n)){case n:return"left";case i:return"right";case t:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function X2(s,e,t=5){const o=[];switch(e){case"top":o.push({x:s.x-t,y:s.y+t},{x:s.x+t,y:s.y+t});break;case"bottom":o.push({x:s.x-t,y:s.y-t},{x:s.x+t,y:s.y-t});break;case"left":o.push({x:s.x+t,y:s.y-t},{x:s.x+t,y:s.y+t});break;case"right":o.push({x:s.x-t,y:s.y-t},{x:s.x-t,y:s.y+t});break}return o}function J2(s){const{top:e,right:t,bottom:o,left:i}=s;return[{x:i,y:e},{x:t,y:e},{x:t,y:o},{x:i,y:o}]}function Q2(s,e){const{x:t,y:o}=s;let i=!1;for(let n=0,f=e.length-1;n<e.length;f=n++){const l=e[n].x,r=e[n].y,p=e[f].x,c=e[f].y;r>o!=c>o&&t<(p-l)*(o-r)/(c-r)+l&&(i=!i)}return i}function sm(s){const e=s.slice();return e.sort((t,o)=>t.x<o.x?-1:t.x>o.x?1:t.y<o.y?-1:t.y>o.y?1:0),em(e)}function em(s){if(s.length<=1)return s.slice();const e=[];for(let o=0;o<s.length;o++){const i=s[o];for(;e.length>=2;){const n=e[e.length-1],f=e[e.length-2];if((n.x-f.x)*(i.y-f.y)>=(n.y-f.y)*(i.x-f.x))e.pop();else break}e.push(i)}e.pop();const t=[];for(let o=s.length-1;o>=0;o--){const i=s[o];for(;t.length>=2;){const n=t[t.length-1],f=t[t.length-2];if((n.x-f.x)*(i.y-f.y)>=(n.y-f.y)*(i.x-f.x))t.pop();else break}t.push(i)}return t.pop(),e.length===1&&t.length===1&&e[0].x===t[0].x&&e[0].y===t[0].y?e:e.concat(t)}const tm=A2,om=W2,nm=L2,im=q2,fm=F2,lm=Y2,jr=({children:s,delayDuration:e=250,...t})=>u.jsx(tm,{children:u.jsx(om,{delayDuration:e,...t,"data-macaw-ui-component":"Tooltip",children:s})});jr.displayName="Tooltip";const Tr=a.forwardRef(({children:s},e)=>u.jsx(nm,{asChild:!0,ref:e,"data-macaw-ui-component":"Tooltip.Trigger",children:s}));Tr.displayName="Tooltip.Trigger";var am="_14kl90y0";const Mr=({className:s,backgroundColor:e=Ze.colors.background.default1,borderColor:t=Ze.colors.border.default1})=>u.jsx(lm,{asChild:!0,className:ps(am,s),children:u.jsx("svg",{width:"20",height:"9",viewBox:"0 0 20 9",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-macaw-ui-component":"Tooltip.Arrow",children:u.jsx("path",{fill:e,stroke:t,d:"M8.086 7.086.5-.5h18l-7.586 7.586a2 2 0 0 1-2.828 0Z"})})});Mr.displayName="Tooltip.Arrow";const Vr=({children:s,className:e,sideOffset:t=2,avoidCollisions:o=!0,...i})=>u.jsx(im,{children:u.jsx(fm,{asChild:!0,className:e,sideOffset:t,avoidCollisions:o,"data-macaw-ui-component":"Tooltip.Content",...i,children:u.jsx(Y,{borderStyle:s?"solid":"none",borderWidth:1,borderRadius:3,borderColor:"default1",padding:s?2:0,fontSize:1,lineHeight:1,color:"default1",backgroundColor:"default1",boxShadow:"defaultOverlay",children:s})})});Vr.displayName="Tooltip.Content";const Ar=({children:s})=>u.jsx(Ps,{display:"block",size:1,color:"default2",marginBottom:.5,"data-macaw-ui-component":"Tooltip.ContentHeading",children:s});Ar.displayName="Tooltip.ContentHeading";const rm=Object.assign(jr,{Trigger:Tr,Arrow:Mr,Content:Vr,ContentHeading:Ar});exports.Accordion=rd;exports.ArrowDownIcon=tt;exports.ArrowLeftIcon=hp;exports.ArrowRightIcon=bp;exports.ArrowUpIcon=mp;exports.Avatar=dd;exports.Backdrop=Xt;exports.Box=Y;exports.Button=et;exports.CatalogIcon=vp;exports.Checkbox=Ef;exports.CheckboxIcon=Cp;exports.ChervonDoubleIcon=gp;exports.ChervonDownIcon=un;exports.ChervonUpIcon=yp;exports.ChevronLeftIcon=xp;exports.ChevronRightIcon=kp;exports.Chip=Rf;exports.CloseIcon=mf;exports.Combobox=yu;exports.ConfigurationIcon=wp;exports.CopyIcon=$p;exports.CustomersIcon=Ip;exports.DarkModeIcon=Ep;exports.DashboardIcon=Rp;exports.Divider=Zl;exports.Drawer=D_;exports.Dropdown=Qh;exports.DropdownButton=La;exports.DynamicCombobox=wu;exports.DynamicMultiselect=gb;exports.EditIcon=Pp;exports.EnvironmentIcon=Sp;exports.ExportIcon=Dp;exports.ExternalLinkIcon=Op;exports.FileExportIcon=jp;exports.FloppyDiscIcon=Tp;exports.FullscreenOffIcon=Mp;exports.FullscreenOnIcon=Vp;exports.GenericAppIcon=Ap;exports.GraphQLIcon=Np;exports.GripIcon=Wp;exports.HelpIcon=Lp;exports.HomeIcon=zp;exports.InfoIcon=Hp;exports.Input=Zt;exports.LightModeIcon=qp;exports.List=Hs;exports.MailIcon=Fp;exports.MarketplaceIcon=Kp;exports.MenuIcon=Bp;exports.Modal=cb;exports.MoreOptionsIcon=Zp;exports.Multiselect=mb;exports.MultiselectRoot=sr;exports.OrdersIcon=Up;exports.Paragraph=er;exports.PlusIcon=Yp;exports.Popover=Kb;exports.ProductsIcons=Gp;exports.RadioGroup=c2;exports.RangeInput=kr;exports.RemoveIcon=Xp;exports.SearchIcon=vf;exports.SearchInput=wr;exports.Select=g2;exports.SellsIcon=Jp;exports.Skeleton=x2;exports.Spinner=I8;exports.StorefrontIcon=Qp;exports.Switch=I2;exports.TableEditIcon=sd;exports.Text=Ps;exports.Textarea=Pr;exports.ThemeProvider=Y1;exports.Toggle=Sr;exports.Tooltip=rm;exports.TranslationsIcon=ed;exports.TrashBinIcon=td;exports.ViewListIcon=od;exports.ViewTableIcon=nd;exports.ViewTilesIcon=id;exports.ViewWideTilesIcon=fd;exports.VouchersIcon=ld;exports.WarningIcon=ad;exports.convertSizeToScale=ve;exports.desktopMediaQuery=op;exports.getCSSVariables=np;exports.sprinkles=Js;exports.tabletMediaQuery=tp;exports.themes=Tt;exports.useTheme=U1;exports.vars=Ze;
103
103
  //# sourceMappingURL=index.js.map