"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7040],{66303:function(e,n,t){t.d(n,{j:function(){return c}});var r=t(36953),u=t(15900),l=t(35059),i=t(54232),o=t(25432),a=t(85893),s=(0,l.G)((e,n)=>{let t=(0,r.x)();return(0,a.jsx)(i.m.button,{ref:n,...e,__css:{display:"inline-flex",appearance:"none",alignItems:"center",outline:0,...t.button}})}),c=(0,l.G)((e,n)=>{let{children:t,as:r,...l}=e,c=(0,u.zZ)(l,n),d=r||s;return(0,a.jsx)(d,{...c,className:(0,o.cx)("chakra-menu__menu-button",e.className),children:(0,a.jsx)(i.m.span,{__css:{pointerEvents:"none",flex:"1 1 auto",minW:0},children:e.children})})});c.displayName="MenuButton"},80610:function(e,n,t){t.d(n,{O:function(){return o}});var r=t(54232),u=t(25432),l=t(67294),i=t(85893),o=e=>{let{className:n,children:t,...o}=e,a=l.Children.only(t),s=(0,l.isValidElement)(a)?(0,l.cloneElement)(a,{focusable:"false","aria-hidden":!0,className:(0,u.cx)("chakra-menu__icon",a.props.className)}):null,c=(0,u.cx)("chakra-menu__icon-wrapper",n);return(0,i.jsx)(r.m.span,{className:c,...o,__css:{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:s})};o.displayName="MenuIcon"},15900:function(e,n,t){t.d(n,{wN:function(){return y},Kb:function(){return _},H9:function(){return N},zZ:function(){return j},Xh:function(){return g},iX:function(){return I},_l:function(){return L},gO:function(){return A},Vg:function(){return P},Qh:function(){return O}});var r=t(67294),u=t(67562),l=t(73614),i=t(32654),o=t(31054),a=t(85075),s=t(35155);function c(e,n){var t;let r=e.target;return(!r||!!d(r).contains(r))&&!(null==(t=n.current)?void 0:t.contains(r))}function d(e){var n;return null!=(n=null==e?void 0:e.ownerDocument)?n:document}var f=t(93694),m=t(55227),p=t(92495),v=t(61942),h=t(52366),x=t(81103),b=t(25432),E=t(92625),[y,C,k,w]=(0,l.n)(),[_,g]=(0,m.k)({strict:!1,name:"MenuContext"});function M(e){var n;return null!=(n=null==e?void 0:e.ownerDocument)?n:document}function D(e){return M(e).activeElement===e}function N(e={}){let{id:n,closeOnSelect:t=!0,closeOnBlur:u=!0,initialFocusRef:l,autoSelect:m=!0,isLazy:p,isOpen:v,defaultIsOpen:x,onClose:b,onOpen:E,placement:y="bottom-start",lazyBehavior:C="unmount",direction:w,computePositionOnMount:_=!1,...g}=e,D=(0,r.useRef)(null),N=(0,r.useRef)(null),j=k(),S=(0,r.useCallback)(()=>{requestAnimationFrame(()=>{var e;null==(e=D.current)||e.focus({preventScroll:!1})})},[]),L=(0,r.useCallback)(()=>{let e=setTimeout(()=>{var e;if(l)null==(e=l.current)||e.focus();else{let e=j.firstEnabled();e&&F(e.index)}});$.current.add(e)},[j,l]),O=(0,r.useCallback)(()=>{let e=setTimeout(()=>{let e=j.lastEnabled();e&&F(e.index)});$.current.add(e)},[j]),I=(0,r.useCallback)(()=>{null==E||E(),m?L():S()},[m,L,S,E]),{isOpen:A,onOpen:P,onClose:T,onToggle:R}=(0,a.q)({isOpen:v,defaultIsOpen:x,onClose:b,onOpen:I});!function(e){let{ref:n,handler:t,enabled:u=!0}=e,l=(0,s.W)(t),i=(0,r.useRef)({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}).current;(0,r.useEffect)(()=>{if(!u)return;let e=e=>{c(e,n)&&(i.isPointerDown=!0)},r=e=>{if(i.ignoreEmulatedMouseEvents){i.ignoreEmulatedMouseEvents=!1;return}i.isPointerDown&&t&&c(e,n)&&(i.isPointerDown=!1,l(e))},o=e=>{i.ignoreEmulatedMouseEvents=!0,t&&i.isPointerDown&&c(e,n)&&(i.isPointerDown=!1,l(e))},a=d(n.current);return a.addEventListener("mousedown",e,!0),a.addEventListener("mouseup",r,!0),a.addEventListener("touchstart",e,!0),a.addEventListener("touchend",o,!0),()=>{a.removeEventListener("mousedown",e,!0),a.removeEventListener("mouseup",r,!0),a.removeEventListener("touchstart",e,!0),a.removeEventListener("touchend",o,!0)}},[t,n,l,i,u])}({enabled:A&&u,ref:D,handler:e=>{var n;(null==(n=N.current)?void 0:n.contains(e.target))||T()}});let q=(0,o.D)({...g,enabled:A||_,placement:y,direction:w}),[z,F]=(0,r.useState)(-1);(0,h.r)(()=>{A||F(-1)},[A]),(0,i.C)(D,{focusRef:N,visible:A,shouldFocus:!0});let G=(0,f.h)({isOpen:A,ref:D}),[K,W]=function(e,...n){let t=(0,r.useId)(),u=e||t;return(0,r.useMemo)(()=>n.map(e=>`${e}-${u}`),[u,n])}(n,"menu-button","menu-list"),U=(0,r.useCallback)(()=>{P(),S()},[P,S]),$=(0,r.useRef)(new Set([]));!function(e,n=[]){(0,r.useEffect)(()=>()=>e(),n)}(()=>{$.current.forEach(e=>clearTimeout(e)),$.current.clear()});let V=(0,r.useCallback)(()=>{P(),L()},[L,P]),X=(0,r.useCallback)(()=>{P(),O()},[P,O]),B=(0,r.useCallback)(()=>{var e,n;let t=M(D.current),r=null==(e=D.current)?void 0:e.contains(t.activeElement);if(!(A&&!r))return;let u=null==(n=j.item(z))?void 0:n.node;null==u||u.focus()},[A,z,j]),H=(0,r.useRef)(null);return{openAndFocusMenu:U,openAndFocusFirstItem:V,openAndFocusLastItem:X,onTransitionEnd:B,unstable__animationState:G,descendants:j,popper:q,buttonId:K,menuId:W,forceUpdate:q.forceUpdate,orientation:"vertical",isOpen:A,onToggle:R,onOpen:P,onClose:T,menuRef:D,buttonRef:N,focusedIndex:z,closeOnSelect:t,closeOnBlur:u,autoSelect:m,setFocusedIndex:F,isLazy:p,lazyBehavior:C,initialFocusRef:l,rafId:H}}function j(e={},n=null){let t=g(),{onToggle:u,popper:l,openAndFocusFirstItem:i,openAndFocusLastItem:o}=t,a=(0,r.useCallback)(e=>{let n={Enter:i,ArrowDown:i,ArrowUp:o}[e.key];n&&(e.preventDefault(),e.stopPropagation(),n(e))},[i,o]);return{...e,ref:(0,x.lq)(t.buttonRef,n,l.referenceRef),id:t.buttonId,"data-active":(0,b.PB)(t.isOpen),"aria-expanded":t.isOpen,"aria-haspopup":"menu","aria-controls":t.menuId,onClick:(0,b.v0)(e.onClick,u),onKeyDown:(0,b.v0)(e.onKeyDown,a)}}function S(e){var n;return function(e){var n;if(!(null!=e&&"object"==typeof e&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE))return!1;let t=null!=(n=e.ownerDocument.defaultView)?n:window;return e instanceof t.HTMLElement}(e)&&!!(null==(n=null==e?void 0:e.getAttribute("role"))?void 0:n.startsWith("menuitem"))}function L(e={},n=null){let t=g();if(!t)throw Error("useMenuContext: context is undefined. Seems you forgot to wrap component within <Menu>");let{focusedIndex:u,setFocusedIndex:l,menuRef:i,isOpen:o,onClose:a,menuId:s,isLazy:c,lazyBehavior:d,unstable__animationState:f}=t,m=C(),p=function(e={}){let{timeout:n=300,preventDefault:t=()=>!0}=e,[u,l]=(0,r.useState)([]),i=(0,r.useRef)(),o=()=>{i.current&&(clearTimeout(i.current),i.current=null)},a=()=>{o(),i.current=setTimeout(()=>{l([]),i.current=null},n)};return(0,r.useEffect)(()=>o,[]),function(e){return n=>{if("Backspace"===n.key){let e=[...u];e.pop(),l(e);return}if(function(e){let{key:n}=e;return 1===n.length||n.length>1&&/[^a-zA-Z0-9]/.test(n)}(n)){let r=u.concat(n.key);t(n)&&(n.preventDefault(),n.stopPropagation()),l(r),e(r.join("")),a()}}}}({preventDefault:e=>" "!==e.key&&S(e.target)}),v=(0,r.useCallback)(e=>{if(!e.currentTarget.contains(e.target))return;let n={Tab:e=>e.preventDefault(),Escape:a,ArrowDown:()=>{let e=m.nextEnabled(u);e&&l(e.index)},ArrowUp:()=>{let e=m.prevEnabled(u);e&&l(e.index)}}[e.key];if(n){e.preventDefault(),n(e);return}let t=p(e=>{let n=function(e,n,t,r){if(null==n)return r;if(!r)return e.find(e=>t(e).toLowerCase().startsWith(n.toLowerCase()));let u=e.filter(e=>t(e).toLowerCase().startsWith(n.toLowerCase()));if(u.length>0){let n;return u.includes(r)?((n=u.indexOf(r)+1)===u.length&&(n=0),u[n]):(n=e.indexOf(u[0]),e[n])}return r}(m.values(),e,e=>{var n,t;return null!=(t=null==(n=null==e?void 0:e.node)?void 0:n.textContent)?t:""},m.item(u));n&&l(m.indexOf(n.node))});S(e.target)&&t(e)},[m,u,p,a,l]),h=(0,r.useRef)(!1);o&&(h.current=!0);let y=(0,E.k)({wasSelected:h.current,enabled:c,mode:d,isSelected:f.present});return{...e,ref:(0,x.lq)(i,n),children:y?e.children:null,tabIndex:-1,role:"menu",id:s,style:{...e.style,transformOrigin:"var(--popper-transform-origin)"},"aria-orientation":"vertical",onKeyDown:(0,b.v0)(e.onKeyDown,v)}}function O(e={}){let{popper:n,isOpen:t}=g();return n.getPopperProps({...e,style:{visibility:t?"visible":"hidden",...e.style}})}function I(e={},n=null){let{onMouseEnter:t,onMouseMove:l,onMouseLeave:i,onClick:o,onFocus:a,isDisabled:s,isFocusable:c,closeOnSelect:d,type:f,...m}=e,{setFocusedIndex:p,focusedIndex:v,closeOnSelect:b,onClose:E,menuRef:y,isOpen:C,menuId:k,rafId:_}=g(),M=(0,r.useRef)(null),N=`${k}-menuitem-${(0,r.useId)()}`,{index:j,register:L}=w({disabled:s&&!c}),O=(0,r.useCallback)(e=>{null==t||t(e),s||p(j)},[p,j,s,t]),I=(0,r.useCallback)(e=>{null==l||l(e),M.current&&!D(M.current)&&O(e)},[O,l]),A=(0,r.useCallback)(e=>{null==i||i(e),s||p(-1)},[p,s,i]),P=(0,r.useCallback)(e=>{null==o||o(e),S(e.currentTarget)&&(null!=d?d:b)&&E()},[E,o,b,d]),T=(0,r.useCallback)(e=>{null==a||a(e),p(j)},[p,a,j]),R=j===v,q=s&&!c;(0,h.r)(()=>{C&&(R&&!q&&M.current?(_.current&&cancelAnimationFrame(_.current),_.current=requestAnimationFrame(()=>{var e;null==(e=M.current)||e.focus(),_.current=null})):y.current&&!D(y.current)&&y.current.focus({preventScroll:!0}))},[R,q,y,C]);let z=(0,u.h)({onClick:P,onFocus:T,onMouseEnter:O,onMouseMove:I,onMouseLeave:A,ref:(0,x.lq)(L,M,n),isDisabled:s,isFocusable:c});return{...m,...z,type:null!=f?f:z.type,id:N,role:"menuitem",tabIndex:R?0:-1}}function A(e={},n=null){let{type:t="radio",isChecked:r,...u}=e;return{...I(u,n),role:`menuitem${t}`,"aria-checked":r}}function P(e={}){let{children:n,type:t="radio",value:u,defaultValue:l,onChange:i,...o}=e,a="radio"===t,[s,c]=(0,v.T)({defaultValue:null!=l?l:a?"":[],value:u,onChange:i}),d=(0,r.useCallback)(e=>{"radio"===t&&"string"==typeof s&&c(e),"checkbox"===t&&Array.isArray(s)&&c(s.includes(e)?s.filter(n=>n!==e):s.concat(e))},[s,c,t]),f=(0,p.W)(n).map(e=>{if("MenuItemOption"!==e.type.id)return e;let n="radio"===t?e.props.value===s:s.includes(e.props.value);return(0,r.cloneElement)(e,{type:t,onClick:n=>{var t,r;d(e.props.value),null==(r=(t=e.props).onClick)||r.call(t,n)},isChecked:n})});return{...o,children:f}}},46887:function(e,n,t){t.d(n,{q:function(){return f}});var r=t(36953),u=t(15900),l=t(25432),i=t(54232),o=t(35059),a=t(24262),s=t(85893),c={enter:{visibility:"visible",opacity:1,scale:1,transition:{duration:.2,ease:[.4,0,.2,1]}},exit:{transitionEnd:{visibility:"hidden"},opacity:0,scale:.8,transition:{duration:.1,easings:"easeOut"}}},d=(0,i.m)(a.E.div),f=(0,o.G)(function(e,n){var t,o;let{rootProps:a,motionProps:f,...m}=e,{isOpen:p,onTransitionEnd:v,unstable__animationState:h}=(0,u.Xh)(),x=(0,u._l)(m,n),b=(0,u.Qh)(a),E=(0,r.x)();return(0,s.jsx)(i.m.div,{...b,__css:{zIndex:null!=(o=e.zIndex)?o:null==(t=E.list)?void 0:t.zIndex},children:(0,s.jsx)(d,{variants:c,initial:!1,animate:p?"enter":"exit",__css:{outline:0,...E.list},...f,className:(0,l.cx)("chakra-menu__menu-list",x.className),...x,onUpdate:v,onAnimationComplete:(0,l.PP)(h.onComplete,x.onAnimationComplete)})})});f.displayName="MenuList"},36953:function(e,n,t){t.d(n,{v:function(){return m},x:function(){return f}});var r=t(15900),u=t(55227),l=t(91639),i=t(33179),o=t(75119),a=t(25432),s=t(67294),c=t(85893),[d,f]=(0,u.k)({name:"MenuStylesContext",errorMessage:"useMenuStyles returned is 'undefined'. Seems you forgot to wrap the components in \"<Menu />\" "}),m=e=>{let{children:n}=e,t=(0,l.jC)("Menu",e),u=(0,i.Lr)(e),{direction:f}=(0,o.F)(),{descendants:m,...p}=(0,r.H9)({...u,direction:f}),v=(0,s.useMemo)(()=>p,[p]),{isOpen:h,onClose:x,forceUpdate:b}=v;return(0,c.jsx)(r.wN,{value:m,children:(0,c.jsx)(r.Kb,{value:v,children:(0,c.jsx)(d,{value:t,children:(0,a.Pu)(n,{isOpen:h,onClose:x,forceUpdate:b})})})})};m.displayName="Menu"},23428:function(e,n,t){t.d(n,{s:function(){return f}});var r=t(36953),u=t(35059),l=t(54232),i=t(85893),o=(0,u.G)((e,n)=>{let t=(0,r.x)();return(0,i.jsx)(l.m.span,{ref:n,...e,__css:t.command,className:"chakra-menu__command"})});o.displayName="MenuCommand";var a=t(13589),s=t(15900),c=t(80610),d=t(25432),f=(0,u.G)((e,n)=>{let{icon:t,iconSpacing:r="0.75rem",command:u,commandSpacing:l="0.75rem",children:f,...m}=e,p=(0,s.iX)(m,n),v=t||u?(0,i.jsx)("span",{style:{pointerEvents:"none",flex:1},children:f}):f;return(0,i.jsxs)(a.C,{...p,className:(0,d.cx)("chakra-menu__menuitem",p.className),children:[t&&(0,i.jsx)(c.O,{fontSize:"0.8em",marginEnd:r,children:t}),v,u&&(0,i.jsx)(o,{marginStart:l,children:u})]})});f.displayName="MenuItem"},13589:function(e,n,t){t.d(n,{C:function(){return a}});var r=t(36953),u=t(35059),l=t(54232),i=t(67294),o=t(85893),a=(0,u.G)((e,n)=>{let{type:t,...u}=e,a=(0,r.x)(),s=u.as||t?null!=t?t:void 0:"button",c=(0,i.useMemo)(()=>({textDecoration:"none",color:"inherit",userSelect:"none",display:"flex",width:"100%",alignItems:"center",textAlign:"start",flex:"0 0 auto",outline:0,...a.item}),[a.item]);return(0,o.jsx)(l.m.button,{ref:n,type:s,...u,__css:c})})}}]);
//# sourceMappingURL=7040-d0661a296b9c7652.js.map