|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/shallowequal/index.js (<- Module is not an ECMAScript module) */function(e,t,n){"use strict";n.d(t,"a",(function(){return Ut}));var a=n("rePB"),o=n("ODXe"),i=n("Ff2n"),r=n("VTBJ"),c=n("q1tI"),s=n("TSYQ"),l=n.n(s),u=n("Zm9Q"),p=n("6cGi"),d=n("KQm4"),f=n("xEkU"),m=n.n(f),v=n("t23M");function h(e){var t=Object(c.useRef)(),n=Object(c.useRef)(!1);return Object(c.useEffect)((function(){return function(){n.current=!0,m.a.cancel(t.current)}}),[]),function(){for(var a=arguments.length,o=new Array(a),i=0;i<a;i++)o[i]=arguments[i];n.current||(m.a.cancel(t.current),t.current=m()((function(){e.apply(void 0,o)})))}}var b=n("4IlW");var g=c.forwardRef((function(e,t){var n,o=e.prefixCls,i=e.id,r=e.active,s=e.rtl,u=e.tab,p=u.key,d=u.tab,f=u.disabled,m=u.closeIcon,v=e.tabBarGutter,h=e.tabPosition,g=e.closable,y=e.renderWrapper,O=e.removeAriaLabel,j=e.editable,C=e.onClick,k=e.onRemove,E=e.onFocus,x="".concat(o,"-tab");c.useEffect((function(){return k}),[]);var w={};"top"===h||"bottom"===h?w[s?"marginLeft":"marginRight"]=v:w.marginBottom=v;var S=j&&!1!==g&&!f;function N(e){f||C(e)}var M=c.createElement("div",{key:p,ref:t,className:l()(x,(n={},Object(a.a)(n,"".concat(x,"-with-remove"),S),Object(a.a)(n,"".concat(x,"-active"),r),Object(a.a)(n,"".concat(x,"-disabled"),f),n)),style:w,onClick:N},c.createElement("div",{role:"tab","aria-selected":r,id:i&&"".concat(i,"-tab-").concat(p),className:"".concat(x,"-btn"),"aria-controls":i&&"".concat(i,"-panel-").concat(p),"aria-disabled":f,tabIndex:f?null:0,onClick:function(e){e.stopPropagation(),N(e)},onKeyDown:function(e){[b.a.SPACE,b.a.ENTER].includes(e.which)&&(e.preventDefault(),N(e))},onFocus:E},d),S&&c.createElement("button",{type:"button","aria-label":O||"remove",tabIndex:0,className:"".concat(x,"-remove"),onClick:function(e){var t;e.stopPropagation(),(t=e).preventDefault(),t.stopPropagation(),j.onEdit("remove",{key:p,event:t})}},m||j.removeIcon||"×"));return y&&(M=y(M)),M})),y={width:0,height:0,left:0,top:0};var O={width:0,height:0,left:0,top:0,right:0};var j=n("wx14"),C=n("1OyB"),k=n("vuIU"),E=n("JX7q"),x=n("Ji7U"),w=n("LK+K"),S=n("I8Z2"),N=n("bT9E"),M=n("2GS6"),_=n("Gytx"),I=n.n(_),T=n("U8pU"),P=/iPhone/i,D=/iPod/i,R=/iPad/i,K=/\bAndroid(?:.+)Mobile\b/i,A=/Android/i,z=/\bAndroid(?:.+)SD4930UR\b/i,V=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,L=/Windows Phone/i,W=/\bWindows(?:.+)ARM\b/i,F=/BlackBerry/i,B=/BB10/i,H=/Opera Mini/i,U=/\b(CriOS|Chrome)(?:.+)Mobile/i,q=/Mobile(?:.+)Firefox\b/i;function J(e,t){return e.test(t)}function G(e){var t=e||("undefined"!=typeof navigator?navigator.userAgent:""),n=(t||"").split("[FBAN");if(void 0!==n[1]){var a=n;t=Object(o.a)(a,1)[0]}if(void 0!==(n=t.split("Twitter"))[1]){var i=n;t=Object(o.a)(i,1)[0]}var r={apple:{phone:J(P,t)&&!J(L,t),ipod:J(D,t),tablet:!J(P,t)&&J(R,t)&&!J(L,t),device:(J(P,t)||J(D,t)||J(R,t))&&!J(L,t)},amazon:{phone:J(z,t),tablet:!J(z,t)&&J(V,t),device:J(z,t)||J(V,t)},android:{phone:!J(L,t)&&J(z,t)||!J(L,t)&&J(K,t),tablet:!J(L,t)&&!J(z,t)&&!J(K,t)&&(J(V,t)||J(A,t)),device:!J(L,t)&&(J(z,t)||J(V,t)||J(K,t)||J(A,t))||J(/\bokhttp\b/i,t)},windows:{phone:J(L,t),tablet:J(W,t),device:J(L,t)||J(W,t)},other:{blackberry:J(F,t),blackberry10:J(B,t),opera:J(H,t),firefox:J(q,t),chrome:J(U,t),device:J(F,t)||J(B,t)||J(H,t)||J(q,t)||J(U,t)},any:null,phone:null,tablet:null};return r.any=r.apple.device||r.android.device||r.windows.device||r.other.device,r.phone=r.apple.phone||r.android.phone||r.windows.phone,r.tablet=r.apple.tablet||r.android.tablet||r.windows.tablet,r}var Y=Object(r.a)(Object(r.a)({},G()),{},{isMobile:G});function X(){}function Q(e,t,n){var a=t||"";return e.key||"".concat(a,"item_").concat(n)}function Z(e){return"".concat(e,"-menu-")}function $(e,t){var n=-1;c.Children.forEach(e,(function(e){n+=1,e&&e.type&&e.type.isMenuItemGroup?c.Children.forEach(e.props.children,(function(e){t(e,n+=1)})):t(e,n)}))}var ee=["defaultSelectedKeys","selectedKeys","defaultOpenKeys","openKeys","mode","getPopupContainer","onSelect","onDeselect","onDestroy","openTransitionName","openAnimation","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","triggerSubMenuAction","level","selectable","multiple","onOpenChange","visible","focusable","defaultActiveFirst","prefixCls","inlineIndent","parentMenu","title","rootPrefixCls","eventKey","active","onItemHover","onTitleMouseEnter","onTitleMouseLeave","onTitleClick","popupAlign","popupOffset","isOpen","renderMenuItem","manualRef","subMenuKey","disabled","index","isSelected","store","activeKey","builtinPlacements","overflowedIndicator","motion","attribute","value","popupClassName","inlineCollapsed","menu","theme","itemIcon","expandIcon"],te=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e&&"function"==typeof e.getBoundingClientRect&&e.getBoundingClientRect().width;if(n){if(t){var a=getComputedStyle(e),o=a.marginLeft,i=a.marginRight;n+=+o.replace("px","")+ +i.replace("px","")}n=+n.toFixed(6)}return n||0},ne=function(e,t,n){e&&"object"===Object(T.a)(e.style)&&(e.style[t]=n)},ae=n("bdgK"),oe=n("i8i4"),ie=n.n(oe),re=n("wgJM"),ce=n("l4aY"),se=n("m+aA"),le=n("c+Xe"),ue=n("zT1h"),pe=n("QC+M");function de(e,t,n){return n?e[0]===t[0]:e[0]===t[0]&&e[1]===t[1]}var fe=n("MNnm");function me(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit".concat(e)]="webkit".concat(t),n["Moz".concat(e)]="moz".concat(t),n["ms".concat(e)]="MS".concat(t),n["O".concat(e)]="o".concat(t.toLowerCase()),n}var ve,he,be,ge=(ve=Object(fe.a)(),he="undefined"!=typeof window?window:{},be={animationend:me("Animation","AnimationEnd"),transitionend:me("Transition","TransitionEnd")},ve&&("AnimationEvent"in he||delete be.animationend.animation,"TransitionEvent"in he||delete be.transitionend.transition),be),ye={};if(Object(fe.a)()){var Oe=document.createElement("div");ye=Oe.style}var je={};function Ce(e){if(je[e])return je[e];var t=ge[e];if(t)for(var n=Object.keys(t),a=n.length,o=0;o<a;o+=1){var i=n[o];if(Object.prototype.hasOwnProperty.call(t,i)&&i in ye)return je[e]=t[i],je[e]}return""}var ke=Ce("animationend"),Ee=Ce("transitionend"),xe=!(!ke||!Ee),we=ke||"animationend",Se=Ee||"transitionend";function Ne(e,t){return e?"object"===Object(T.a)(e)?e[t.replace(/-\w/g,(function(e){return e[1].toUpperCase()}))]:"".concat(e,"-").concat(t):null}function Me(e){var t=Object(c.useRef)(!1),n=Object(c.useState)(e),a=Object(o.a)(n,2),i=a[0],r=a[1];return Object(c.useEffect)((function(){return function(){t.current=!0}}),[]),[i,function(e){t.current||r(e)}]}var _e=Object(fe.a)()?c.useLayoutEffect:c.useEffect,Ie=["prepare","start","active","end"];function Te(e){return"active"===e||"end"===e}var Pe=function(e,t){var n=c.useState("none"),a=Object(o.a)(n,2),i=a[0],r=a[1],s=function(){var e=c.useRef(null);function t(){re.a.cancel(e.current)}return c.useEffect((function(){return function(){t()}}),[]),[function n(a){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;t();var i=Object(re.a)((function(){o<=1?a({isCanceled:function(){return i!==e.current}}):n(a,o-1)}));e.current=i},t]}(),l=Object(o.a)(s,2),u=l[0],p=l[1];return _e((function(){if("none"!==i&&"end"!==i){var e=Ie.indexOf(i),n=Ie[e+1],a=t(i);!1===a?r(n):u((function(e){function t(){e.isCanceled()||r(n)}!0===a?t():Promise.resolve(a).then(t)}))}}),[e,i]),c.useEffect((function(){return function(){p()}}),[]),[function(){r("prepare")},i]};function De(e,t,n,i){var s=i.motionEnter,l=void 0===s||s,u=i.motionAppear,p=void 0===u||u,d=i.motionLeave,f=void 0===d||d,m=i.motionDeadline,v=i.motionLeaveImmediately,h=i.onAppearPrepare,b=i.onEnterPrepare,g=i.onLeavePrepare,y=i.onAppearStart,O=i.onEnterStart,j=i.onLeaveStart,C=i.onAppearActive,k=i.onEnterActive,E=i.onLeaveActive,x=i.onAppearEnd,w=i.onEnterEnd,S=i.onLeaveEnd,N=i.onVisibleChanged,M=Me(),_=Object(o.a)(M,2),I=_[0],T=_[1],P=Me("none"),D=Object(o.a)(P,2),R=D[0],K=D[1],A=Me(null),z=Object(o.a)(A,2),V=z[0],L=z[1],W=Object(c.useRef)(!1),F=Object(c.useRef)(null),B=Object(c.useRef)(!1),H=Object(c.useRef)(null);function U(){return n()||H.current}var q=Object(c.useRef)(!1);function J(e){var t,n=U();e&&!e.deadline&&e.target!==n||("appear"===R&&q.current?t=null==x?void 0:x(n,e):"enter"===R&&q.current?t=null==w?void 0:w(n,e):"leave"===R&&q.current&&(t=null==S?void 0:S(n,e)),!1===t||B.current||(K("none"),L(null)))}var G=function(e){var t=Object(c.useRef)(),n=Object(c.useRef)(e);n.current=e;var a=c.useCallback((function(e){n.current(e)}),[]);function o(e){e&&(e.removeEventListener(Se,a),e.removeEventListener(we,a))}return c.useEffect((function(){return function(){o(t.current)}}),[]),[function(e){t.current&&t.current!==e&&o(t.current),e&&e!==t.current&&(e.addEventListener(Se,a),e.addEventListener(we,a),t.current=e)},o]}(J),Y=Object(o.a)(G,1)[0],X=c.useMemo((function(){var e,t,n;switch(R){case"appear":return e={},Object(a.a)(e,"prepare",h),Object(a.a)(e,"start",y),Object(a.a)(e,"active",C),e;case"enter":return t={},Object(a.a)(t,"prepare",b),Object(a.a)(t,"start",O),Object(a.a)(t,"active",k),t;case"leave":return n={},Object(a.a)(n,"prepare",g),Object(a.a)(n,"start",j),Object(a.a)(n,"active",E),n;default:return{}}}),[R]),Q=Pe(R,(function(e){if("prepare"===e){var t=X.prepare;return!!t&&t(U())}var n;ee in X&&L((null===(n=X[ee])||void 0===n?void 0:n.call(X,U(),null))||null);return"active"===ee&&(Y(U()),m>0&&(clearTimeout(F.current),F.current=setTimeout((function(){J({deadline:!0})}),m))),!0})),Z=Object(o.a)(Q,2),$=Z[0],ee=Z[1],te=Te(ee);q.current=te,_e((function(){T(t);var n,a=W.current;(W.current=!0,e)&&(!a&&t&&p&&(n="appear"),a&&t&&l&&(n="enter"),(a&&!t&&f||!a&&v&&!t&&f)&&(n="leave"),n&&(K(n),$()))}),[t]),Object(c.useEffect)((function(){("appear"===R&&!p||"enter"===R&&!l||"leave"===R&&!f)&&K("none")}),[p,l,f]),Object(c.useEffect)((function(){return function(){clearTimeout(F.current),B.current=!0}}),[]),Object(c.useEffect)((function(){void 0!==I&&"none"===R&&(null==N||N(I))}),[I,R]);var ne=V;return X.prepare&&"start"===ee&&(ne=Object(r.a)({transition:"none"},ne)),[R,ee,ne,null!=I?I:t]}var Re=function(e){Object(x.a)(n,e);var t=Object(w.a)(n);function n(){return Object(C.a)(this,n),t.apply(this,arguments)}return Object(k.a)(n,[{key:"render",value:function(){return this.props.children}}]),n}(c.Component);var Ke=function(e){var t=e;function n(e){return!(!e.motionName||!t)}"object"===Object(T.a)(e)&&(t=e.transitionSupport);var i=c.forwardRef((function(e,t){var i=e.visible,s=void 0===i||i,u=e.removeOnLeave,p=void 0===u||u,d=e.forceRender,f=e.children,m=e.motionName,v=e.leavedClassName,h=e.eventProps,b=n(e),g=Object(c.useRef)(),y=Object(c.useRef)();var O=De(b,s,(function(){try{return Object(se.a)(g.current||y.current)}catch(e){return null}}),e),j=Object(o.a)(O,4),C=j[0],k=j[1],E=j[2],x=j[3],w=c.useRef(x);x&&(w.current=!0);var S=Object(c.useRef)(t);S.current=t;var N,M=c.useCallback((function(e){g.current=e,Object(le.b)(S.current,e)}),[]),_=Object(r.a)(Object(r.a)({},h),{},{visible:s});if(f)if("none"!==C&&n(e)){var I,T;"prepare"===k?T="prepare":Te(k)?T="active":"start"===k&&(T="start"),N=f(Object(r.a)(Object(r.a)({},_),{},{className:l()(Ne(m,C),(I={},Object(a.a)(I,Ne(m,"".concat(C,"-").concat(T)),T),Object(a.a)(I,m,"string"==typeof m),I)),style:E}),M)}else N=x?f(Object(r.a)({},_),M):!p&&w.current?f(Object(r.a)(Object(r.a)({},_),{},{className:v}),M):d?f(Object(r.a)(Object(r.a)({},_),{},{style:{display:"none"}}),M):null;else N=null;return c.createElement(Re,{ref:y},N)}));return i.displayName="CSSMotion",i}(xe);function Ae(e){var t;return t=e&&"object"===Object(T.a)(e)&&"key"in e?e:{key:e},Object(r.a)(Object(r.a)({},t),{},{key:String(t.key)})}function ze(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map(Ae)}function Ve(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=[],a=0,o=t.length,i=ze(e),c=ze(t);i.forEach((function(e){for(var t=!1,i=a;i<o;i+=1){var s=c[i];if(s.key===e.key){a<i&&(n=n.concat(c.slice(a,i).map((function(e){return Object(r.a)(Object(r.a)({},e),{},{status:"add"})}))),a=i),n.push(Object(r.a)(Object(r.a)({},s),{},{status:"keep"})),a+=1,t=!0;break}}t||n.push(Object(r.a)(Object(r.a)({},e),{},{status:"remove"}))})),a<o&&(n=n.concat(c.slice(a).map((function(e){return Object(r.a)(Object(r.a)({},e),{},{status:"add"})}))));var s={};n.forEach((function(e){var t=e.key;s[t]=(s[t]||0)+1}));var l=Object.keys(s).filter((function(e){return s[e]>1}));return l.forEach((function(e){(n=n.filter((function(t){var n=t.key,a=t.status;return n!==e||"remove"!==a}))).forEach((function(t){t.key===e&&(t.status="keep")}))})),n}var Le=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];!function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ke,n=function(e){Object(x.a)(a,e);var n=Object(w.a)(a);function a(){var e;return Object(C.a)(this,a),(e=n.apply(this,arguments)).state={keyEntities:[]},e.removeKey=function(t){e.setState((function(e){return{keyEntities:e.keyEntities.map((function(e){return e.key!==t?e:Object(r.a)(Object(r.a)({},e),{},{status:"removed"})}))}}))},e}return Object(k.a)(a,[{key:"render",value:function(){var e=this,n=this.state.keyEntities,a=this.props,o=a.component,r=a.children,s=a.onVisibleChanged,l=Object(i.a)(a,["component","children","onVisibleChanged"]),u=o||c.Fragment,p={};return Le.forEach((function(e){p[e]=l[e],delete l[e]})),delete l.keys,c.createElement(u,l,n.map((function(n){var a=n.status,o=Object(i.a)(n,["status"]),l="add"===a||"keep"===a;return c.createElement(t,Object(j.a)({},p,{key:o.key,visible:l,eventProps:o,onVisibleChanged:function(t){null==s||s(t,{key:o.key}),t||e.removeKey(o.key)}}),r)})))}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=e.keys,a=t.keyEntities,o=ze(n);return{keyEntities:Ve(a,o).filter((function(e){var t=a.find((function(t){var n=t.key;return e.key===n}));return!t||"removed"!==t.status||"remove"!==e.status}))}}}]),a}(c.Component);n.defaultProps={component:"div"}}(xe);var We=Ke;function Fe(e){var t=e.prefixCls,n=e.motion,a=e.animation,o=e.transitionName;return n||(a?{motionName:"".concat(t,"-").concat(a)}:o?{motionName:o}:null)}function Be(e){var t=e.prefixCls,n=e.visible,a=e.zIndex,o=e.mask,i=e.maskMotion,s=e.maskAnimation,u=e.maskTransitionName;if(!o)return null;var p={};return(i||u||s)&&(p=Object(r.a)({motionAppear:!0},Fe({motion:i,prefixCls:t,transitionName:u,animation:s}))),c.createElement(We,Object(j.a)({},p,{visible:n,removeOnLeave:!0}),(function(e){var n=e.className;return c.createElement("div",{style:{zIndex:a},className:l()("".concat(t,"-mask"),n)})}))}var He=n("9mu1"),Ue=n("o0o1"),qe=n.n(Ue),Je=n("HaE+"),Ge=["measure","align",null,"motion"],Ye=c.forwardRef((function(e,t){var n=e.visible,a=e.prefixCls,i=e.className,s=e.style,u=e.children,p=e.zIndex,d=e.stretch,f=e.destroyPopupOnHide,m=e.forceRender,v=e.align,h=e.point,b=e.getRootDomNode,g=e.getClassNameFromAlign,y=e.onAlign,O=e.onMouseEnter,C=e.onMouseLeave,k=e.onMouseDown,E=e.onTouchStart,x=Object(c.useRef)(),w=Object(c.useRef)(),S=Object(c.useState)(),N=Object(o.a)(S,2),M=N[0],_=N[1],I=function(e){var t=c.useState({width:0,height:0}),n=Object(o.a)(t,2),a=n[0],i=n[1];return[c.useMemo((function(){var t={};if(e){var n=a.width,o=a.height;-1!==e.indexOf("height")&&o?t.height=o:-1!==e.indexOf("minHeight")&&o&&(t.minHeight=o),-1!==e.indexOf("width")&&n?t.width=n:-1!==e.indexOf("minWidth")&&n&&(t.minWidth=n)}return t}),[e,a]),function(e){i({width:e.offsetWidth,height:e.offsetHeight})}]}(d),T=Object(o.a)(I,2),P=T[0],D=T[1];var R=function(e,t){var n=Object(c.useState)(null),a=Object(o.a)(n,2),i=a[0],r=a[1],s=Object(c.useRef)(),l=Object(c.useRef)(!1);function u(e){l.current||r(e)}function p(){re.a.cancel(s.current)}return Object(c.useEffect)((function(){u("measure")}),[e]),Object(c.useEffect)((function(){switch(i){case"measure":t()}i&&(s.current=Object(re.a)(Object(Je.a)(qe.a.mark((function e(){var t,n;return qe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=Ge.indexOf(i),(n=Ge[t+1])&&-1!==t&&u(n);case 3:case"end":return e.stop()}}),e)})))))}),[i]),Object(c.useEffect)((function(){return function(){l.current=!0,p()}}),[]),[i,function(e){p(),s.current=Object(re.a)((function(){u((function(e){switch(i){case"align":return"motion";case"motion":return"stable"}return e})),null==e||e()}))}]}(n,(function(){d&&D(b())})),K=Object(o.a)(R,2),A=K[0],z=K[1],V=Object(c.useRef)();function L(){var e;null===(e=x.current)||void 0===e||e.forceAlign()}function W(e,t){var n=g(t);M!==n&&_(n),"align"===A&&(M!==n?Promise.resolve().then((function(){L()})):z((function(){var e;null===(e=V.current)||void 0===e||e.call(V)})),null==y||y(e,t))}var F=Object(r.a)({},Fe(e));function B(){return new Promise((function(e){V.current=e}))}["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach((function(e){var t=F[e];F[e]=function(e,n){return z(),null==t?void 0:t(e,n)}})),c.useEffect((function(){F.motionName||"motion"!==A||z()}),[F.motionName,A]),c.useImperativeHandle(t,(function(){return{forceAlign:L,getElement:function(){return w.current}}}));var H=Object(r.a)(Object(r.a)({},P),{},{zIndex:p,opacity:"motion"!==A&&"stable"!==A&&n?0:void 0,pointerEvents:"stable"===A?void 0:"none"},s),U=!0;!(null==v?void 0:v.points)||"align"!==A&&"stable"!==A||(U=!1);var q=u;return c.Children.count(u)>1&&(q=c.createElement("div",{className:"".concat(a,"-content")},u)),c.createElement(We,Object(j.a)({visible:n,ref:w,leavedClassName:"".concat(a,"-hidden")},F,{onAppearPrepare:B,onEnterPrepare:B,removeOnLeave:f,forceRender:m}),(function(e,t){var n=e.className,o=e.style,s=l()(a,i,M,n);return c.createElement(He.a,{target:h||b,key:"popup",ref:x,monitorWindowResize:!0,disabled:U,align:v,onAlign:W},c.createElement("div",{ref:t,className:s,onMouseEnter:O,onMouseLeave:C,onMouseDownCapture:k,onTouchStartCapture:E,style:Object(r.a)(Object(r.a)({},o),H)},q))}))}));Ye.displayName="PopupInner";var Xe=Ye,Qe=c.forwardRef((function(e,t){var n=e.prefixCls,a=e.visible,o=e.zIndex,i=e.children,s=e.mobile,u=(s=void 0===s?{}:s).popupClassName,p=s.popupStyle,d=s.popupMotion,f=void 0===d?{}:d,m=s.popupRender,v=c.useRef();c.useImperativeHandle(t,(function(){return{forceAlign:function(){},getElement:function(){return v.current}}}));var h=Object(r.a)({zIndex:o},p),b=i;return c.Children.count(i)>1&&(b=c.createElement("div",{className:"".concat(n,"-content")},i)),m&&(b=m(b)),c.createElement(We,Object(j.a)({visible:a,ref:v,removeOnLeave:!0},f),(function(e,t){var a=e.className,o=e.style,i=l()(n,u,a);return c.createElement("div",{ref:t,className:i,style:Object(r.a)(Object(r.a)({},o),h)},b)}))}));Qe.displayName="MobilePopupInner";var Ze=Qe,$e=["visible","mobile"],et=c.forwardRef((function(e,t){var n=e.visible,a=e.mobile,s=Object(i.a)(e,$e),l=Object(c.useState)(n),u=Object(o.a)(l,2),p=u[0],d=u[1],f=Object(c.useState)(!1),m=Object(o.a)(f,2),v=m[0],h=m[1],b=Object(r.a)(Object(r.a)({},s),{},{visible:p});Object(c.useEffect)((function(){d(n),n&&a&&h(function(){if("undefined"==typeof navigator||"undefined"==typeof window)return!1;var e=navigator.userAgent||navigator.vendor||window.opera;return!(!/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)&&!/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(null==e?void 0:e.substr(0,4)))}())}),[n,a]);var g=v?c.createElement(Ze,Object(j.a)({},b,{mobile:a,ref:t})):c.createElement(Xe,Object(j.a)({},b,{ref:t}));return c.createElement("div",null,c.createElement(Be,b),g)}));et.displayName="Popup";var tt=et,nt=c.createContext(null);function at(){}function ot(){return""}function it(e){return e?e.ownerDocument:window.document}var rt=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];var ct,st,lt=(ct=pe.a,(st=function(e){Object(x.a)(n,e);var t=Object(w.a)(n);function n(e){var a,o;return Object(C.a)(this,n),(a=t.call(this,e)).popupRef=c.createRef(),a.triggerRef=c.createRef(),a.attachId=void 0,a.clickOutsideHandler=void 0,a.touchOutsideHandler=void 0,a.contextMenuOutsideHandler1=void 0,a.contextMenuOutsideHandler2=void 0,a.mouseDownTimeout=void 0,a.focusTime=void 0,a.preClickTime=void 0,a.preTouchTime=void 0,a.delayTimer=void 0,a.hasPopupMouseDown=void 0,a.onMouseEnter=function(e){var t=a.props.mouseEnterDelay;a.fireEvents("onMouseEnter",e),a.delaySetPopupVisible(!0,t,t?null:e)},a.onMouseMove=function(e){a.fireEvents("onMouseMove",e),a.setPoint(e)},a.onMouseLeave=function(e){a.fireEvents("onMouseLeave",e),a.delaySetPopupVisible(!1,a.props.mouseLeaveDelay)},a.onPopupMouseEnter=function(){a.clearDelayTimer()},a.onPopupMouseLeave=function(e){var t;e.relatedTarget&&!e.relatedTarget.setTimeout&&Object(ce.a)(null===(t=a.popupRef.current)||void 0===t?void 0:t.getElement(),e.relatedTarget)||a.delaySetPopupVisible(!1,a.props.mouseLeaveDelay)},a.onFocus=function(e){a.fireEvents("onFocus",e),a.clearDelayTimer(),a.isFocusToShow()&&(a.focusTime=Date.now(),a.delaySetPopupVisible(!0,a.props.focusDelay))},a.onMouseDown=function(e){a.fireEvents("onMouseDown",e),a.preClickTime=Date.now()},a.onTouchStart=function(e){a.fireEvents("onTouchStart",e),a.preTouchTime=Date.now()},a.onBlur=function(e){a.fireEvents("onBlur",e),a.clearDelayTimer(),a.isBlurToHide()&&a.delaySetPopupVisible(!1,a.props.blurDelay)},a.onContextMenu=function(e){e.preventDefault(),a.fireEvents("onContextMenu",e),a.setPopupVisible(!0,e)},a.onContextMenuClose=function(){a.isContextMenuToShow()&&a.close()},a.onClick=function(e){if(a.fireEvents("onClick",e),a.focusTime){var t;if(a.preClickTime&&a.preTouchTime?t=Math.min(a.preClickTime,a.preTouchTime):a.preClickTime?t=a.preClickTime:a.preTouchTime&&(t=a.preTouchTime),Math.abs(t-a.focusTime)<20)return;a.focusTime=0}a.preClickTime=0,a.preTouchTime=0,a.isClickToShow()&&(a.isClickToHide()||a.isBlurToHide())&&e&&e.preventDefault&&e.preventDefault();var n=!a.state.popupVisible;(a.isClickToHide()&&!n||n&&a.isClickToShow())&&a.setPopupVisible(!a.state.popupVisible,e)},a.onPopupMouseDown=function(){var e;a.hasPopupMouseDown=!0,clearTimeout(a.mouseDownTimeout),a.mouseDownTimeout=window.setTimeout((function(){a.hasPopupMouseDown=!1}),0),a.context&&(e=a.context).onPopupMouseDown.apply(e,arguments)},a.onDocumentClick=function(e){if(!a.props.mask||a.props.maskClosable){var t=e.target,n=a.getRootDomNode(),o=a.getPopupDomNode();Object(ce.a)(n,t)&&!a.isContextMenuOnly()||Object(ce.a)(o,t)||a.hasPopupMouseDown||a.close()}},a.getRootDomNode=function(){var e=a.props.getTriggerDOMNode;if(e)return e(a.triggerRef.current);try{var t=Object(se.a)(a.triggerRef.current);if(t)return t}catch(e){}return ie.a.findDOMNode(Object(E.a)(a))},a.getPopupClassNameFromAlign=function(e){var t=[],n=a.props,o=n.popupPlacement,i=n.builtinPlacements,r=n.prefixCls,c=n.alignPoint,s=n.getPopupClassNameFromAlign;return o&&i&&t.push(function(e,t,n,a){for(var o=n.points,i=Object.keys(e),r=0;r<i.length;r+=1){var c=i[r];if(de(e[c].points,o,a))return"".concat(t,"-placement-").concat(c)}return""}(i,r,e,c)),s&&t.push(s(e)),t.join(" ")},a.getComponent=function(){var e=a.props,t=e.prefixCls,n=e.destroyPopupOnHide,o=e.popupClassName,i=e.onPopupAlign,r=e.popupMotion,s=e.popupAnimation,l=e.popupTransitionName,u=e.popupStyle,p=e.mask,d=e.maskAnimation,f=e.maskTransitionName,m=e.maskMotion,v=e.zIndex,h=e.popup,b=e.stretch,g=e.alignPoint,y=e.mobile,O=e.forceRender,C=a.state,k=C.popupVisible,E=C.point,x=a.getPopupAlign(),w={};return a.isMouseEnterToShow()&&(w.onMouseEnter=a.onPopupMouseEnter),a.isMouseLeaveToHide()&&(w.onMouseLeave=a.onPopupMouseLeave),w.onMouseDown=a.onPopupMouseDown,w.onTouchStart=a.onPopupMouseDown,c.createElement(tt,Object(j.a)({prefixCls:t,destroyPopupOnHide:n,visible:k,point:g&&E,className:o,align:x,onAlign:i,animation:s,getClassNameFromAlign:a.getPopupClassNameFromAlign},w,{stretch:b,getRootDomNode:a.getRootDomNode,style:u,mask:p,zIndex:v,transitionName:l,maskAnimation:d,maskTransitionName:f,maskMotion:m,ref:a.popupRef,motion:r,mobile:y,forceRender:O}),"function"==typeof h?h():h)},a.attachParent=function(e){re.a.cancel(a.attachId);var t,n=a.props,o=n.getPopupContainer,i=n.getDocument,r=a.getRootDomNode();o?(r||0===o.length)&&(t=o(r)):t=i(a.getRootDomNode()).body,t?t.appendChild(e):a.attachId=Object(re.a)((function(){a.attachParent(e)}))},a.getContainer=function(){var e=(0,a.props.getDocument)(a.getRootDomNode()).createElement("div");return e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.width="100%",a.attachParent(e),e},a.setPoint=function(e){a.props.alignPoint&&e&&a.setState({point:{pageX:e.pageX,pageY:e.pageY}})},a.handlePortalUpdate=function(){a.state.prevPopupVisible!==a.state.popupVisible&&a.props.afterPopupVisibleChange(a.state.popupVisible)},a.triggerContextValue={onPopupMouseDown:a.onPopupMouseDown},o="popupVisible"in e?!!e.popupVisible:!!e.defaultPopupVisible,a.state={prevPopupVisible:o,popupVisible:o},rt.forEach((function(e){a["fire".concat(e)]=function(t){a.fireEvents(e,t)}})),a}return Object(k.a)(n,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var e,t=this.props;if(this.state.popupVisible)return this.clickOutsideHandler||!this.isClickToHide()&&!this.isContextMenuToShow()||(e=t.getDocument(this.getRootDomNode()),this.clickOutsideHandler=Object(ue.a)(e,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(e=e||t.getDocument(this.getRootDomNode()),this.touchOutsideHandler=Object(ue.a)(e,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(e=e||t.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=Object(ue.a)(e,"scroll",this.onContextMenuClose)),void(!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=Object(ue.a)(window,"blur",this.onContextMenuClose)));this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),re.a.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var e;return(null===(e=this.popupRef.current)||void 0===e?void 0:e.getElement())||null}},{key:"getPopupAlign",value:function(){var e=this.props,t=e.popupPlacement,n=e.popupAlign,a=e.builtinPlacements;return t&&a?function(e,t,n){var a=e[t]||{};return Object(r.a)(Object(r.a)({},a),n)}(a,t,n):n}},{key:"setPopupVisible",value:function(e,t){var n=this.props.alignPoint,a=this.state.popupVisible;this.clearDelayTimer(),a!==e&&("popupVisible"in this.props||this.setState({popupVisible:e,prevPopupVisible:a}),this.props.onPopupVisibleChange(e)),n&&t&&e&&this.setPoint(t)}},{key:"delaySetPopupVisible",value:function(e,t,n){var a=this,o=1e3*t;if(this.clearDelayTimer(),o){var i=n?{pageX:n.pageX,pageY:n.pageY}:null;this.delayTimer=window.setTimeout((function(){a.setPopupVisible(e,i),a.clearDelayTimer()}),o)}else this.setPopupVisible(e,n)}},{key:"clearDelayTimer",value:function(){this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null)}},{key:"clearOutsideHandler",value:function(){this.clickOutsideHandler&&(this.clickOutsideHandler.remove(),this.clickOutsideHandler=null),this.contextMenuOutsideHandler1&&(this.contextMenuOutsideHandler1.remove(),this.contextMenuOutsideHandler1=null),this.contextMenuOutsideHandler2&&(this.contextMenuOutsideHandler2.remove(),this.contextMenuOutsideHandler2=null),this.touchOutsideHandler&&(this.touchOutsideHandler.remove(),this.touchOutsideHandler=null)}},{key:"createTwoChains",value:function(e){var t=this.props.children.props,n=this.props;return t[e]&&n[e]?this["fire".concat(e)]:t[e]||n[e]}},{key:"isClickToShow",value:function(){var e=this.props,t=e.action,n=e.showAction;return-1!==t.indexOf("click")||-1!==n.indexOf("click")}},{key:"isContextMenuOnly",value:function(){var e=this.props.action;return"contextMenu"===e||1===e.length&&"contextMenu"===e[0]}},{key:"isContextMenuToShow",value:function(){var e=this.props,t=e.action,n=e.showAction;return-1!==t.indexOf("contextMenu")||-1!==n.indexOf("contextMenu")}},{key:"isClickToHide",value:function(){var e=this.props,t=e.action,n=e.hideAction;return-1!==t.indexOf("click")||-1!==n.indexOf("click")}},{key:"isMouseEnterToShow",value:function(){var e=this.props,t=e.action,n=e.showAction;return-1!==t.indexOf("hover")||-1!==n.indexOf("mouseEnter")}},{key:"isMouseLeaveToHide",value:function(){var e=this.props,t=e.action,n=e.hideAction;return-1!==t.indexOf("hover")||-1!==n.indexOf("mouseLeave")}},{key:"isFocusToShow",value:function(){var e=this.props,t=e.action,n=e.showAction;return-1!==t.indexOf("focus")||-1!==n.indexOf("focus")}},{key:"isBlurToHide",value:function(){var e=this.props,t=e.action,n=e.hideAction;return-1!==t.indexOf("focus")||-1!==n.indexOf("blur")}},{key:"forcePopupAlign",value:function(){var e;this.state.popupVisible&&(null===(e=this.popupRef.current)||void 0===e||e.forceAlign())}},{key:"fireEvents",value:function(e,t){var n=this.props.children.props[e];n&&n(t);var a=this.props[e];a&&a(t)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var e=this.state.popupVisible,t=this.props,n=t.children,a=t.forceRender,o=t.alignPoint,i=t.className,s=t.autoDestroy,u=c.Children.only(n),p={key:"trigger"};this.isContextMenuToShow()?p.onContextMenu=this.onContextMenu:p.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(p.onClick=this.onClick,p.onMouseDown=this.onMouseDown,p.onTouchStart=this.onTouchStart):(p.onClick=this.createTwoChains("onClick"),p.onMouseDown=this.createTwoChains("onMouseDown"),p.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(p.onMouseEnter=this.onMouseEnter,o&&(p.onMouseMove=this.onMouseMove)):p.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?p.onMouseLeave=this.onMouseLeave:p.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(p.onFocus=this.onFocus,p.onBlur=this.onBlur):(p.onFocus=this.createTwoChains("onFocus"),p.onBlur=this.createTwoChains("onBlur"));var d=l()(u&&u.props&&u.props.className,i);d&&(p.className=d);var f=Object(r.a)({},p);Object(le.c)(u)&&(f.ref=Object(le.a)(this.triggerRef,u.ref));var m,v=c.cloneElement(u,f);return(e||this.popupRef.current||a)&&(m=c.createElement(ct,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!e&&s&&(m=null),c.createElement(nt.Provider,{value:this.triggerContextValue},v,m)}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=e.popupVisible,a={};return void 0!==n&&t.popupVisible!==n&&(a.popupVisible=n,a.prevPopupVisible=t.popupVisible),a}}]),n}(c.Component)).contextType=nt,st.defaultProps={prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:ot,getDocument:it,onPopupVisibleChange:at,afterPopupVisibleChange:at,onPopupAlign:at,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1},st),ut={adjustX:1,adjustY:1},pt={topLeft:{points:["bl","tl"],overflow:ut,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:ut,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:ut,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:ut,offset:[4,0]}},dt={topLeft:{points:["bl","tl"],overflow:ut,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:ut,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:ut,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:ut,offset:[4,0]}},ft=0,mt={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},vt=function(e,t,n){var o=Z(t),i=e.getState();e.setState({defaultActiveFirst:Object(r.a)(Object(r.a)({},i.defaultActiveFirst),{},Object(a.a)({},o,n))})},ht=function(e){Object(x.a)(n,e);var t=Object(w.a)(n);function n(e){var a;Object(C.a)(this,n),(a=t.call(this,e)).onDestroy=function(e){a.props.onDestroy(e)},a.onKeyDown=function(e){var t=e.keyCode,n=a.menuInstance,o=a.props.store,i=a.getVisible();if(t===b.a.ENTER)return a.onTitleClick(e),vt(o,a.props.eventKey,!0),!0;if(t===b.a.RIGHT)return i?n.onKeyDown(e):(a.triggerOpenChange(!0),vt(o,a.props.eventKey,!0)),!0;if(t===b.a.LEFT){var r;if(!i)return;return(r=n.onKeyDown(e))||(a.triggerOpenChange(!1),r=!0),r}return!i||t!==b.a.UP&&t!==b.a.DOWN?void 0:n.onKeyDown(e)},a.onOpenChange=function(e){a.props.onOpenChange(e)},a.onPopupVisibleChange=function(e){a.triggerOpenChange(e,e?"mouseenter":"mouseleave")},a.onMouseEnter=function(e){var t=a.props,n=t.eventKey,o=t.onMouseEnter,i=t.store;vt(i,a.props.eventKey,!1),o({key:n,domEvent:e})},a.onMouseLeave=function(e){var t=a.props,n=t.parentMenu,o=t.eventKey,i=t.onMouseLeave;n.subMenuInstance=Object(E.a)(a),i({key:o,domEvent:e})},a.onTitleMouseEnter=function(e){var t=a.props,n=t.eventKey,o=t.onItemHover,i=t.onTitleMouseEnter;o({key:n,hover:!0}),i({key:n,domEvent:e})},a.onTitleMouseLeave=function(e){var t=a.props,n=t.parentMenu,o=t.eventKey,i=t.onItemHover,r=t.onTitleMouseLeave;n.subMenuInstance=Object(E.a)(a),i({key:o,hover:!1}),r({key:o,domEvent:e})},a.onTitleClick=function(e){var t=Object(E.a)(a).props;t.onTitleClick({key:t.eventKey,domEvent:e}),"hover"!==t.triggerSubMenuAction&&(a.triggerOpenChange(!a.getVisible(),"click"),vt(t.store,a.props.eventKey,!1))},a.onSubMenuClick=function(e){"function"==typeof a.props.onClick&&a.props.onClick(a.addKeyPath(e))},a.onSelect=function(e){a.props.onSelect(e)},a.onDeselect=function(e){a.props.onDeselect(e)},a.getPrefixCls=function(){return"".concat(a.props.rootPrefixCls,"-submenu")},a.getActiveClassName=function(){return"".concat(a.getPrefixCls(),"-active")},a.getDisabledClassName=function(){return"".concat(a.getPrefixCls(),"-disabled")},a.getSelectedClassName=function(){return"".concat(a.getPrefixCls(),"-selected")},a.getOpenClassName=function(){return"".concat(a.props.rootPrefixCls,"-submenu-open")},a.getVisible=function(){return a.state.isOpen},a.getMode=function(){return a.state.mode},a.saveMenuInstance=function(e){a.menuInstance=e},a.addKeyPath=function(e){return Object(r.a)(Object(r.a)({},e),{},{keyPath:(e.keyPath||[]).concat(a.props.eventKey)})},a.triggerOpenChange=function(e,t){var n=a.props.eventKey,o=function(){a.onOpenChange({key:n,item:Object(E.a)(a),trigger:t,open:e})};"mouseenter"===t?a.mouseenterTimeout=setTimeout((function(){o()}),0):o()},a.isChildrenSelected=function(){var e={find:!1};return function e(t,n,a){t&&!a.find&&c.Children.forEach(t,(function(t){if(t){var o=t.type;if(!o||!(o.isSubMenu||o.isMenuItem||o.isMenuItemGroup))return;-1!==n.indexOf(t.key)?a.find=!0:t.props.children&&e(t.props.children,n,a)}}))}(a.props.children,a.props.selectedKeys,e),e.find},a.isInlineMode=function(){return"inline"===a.getMode()},a.adjustWidth=function(){if(a.subMenuTitle&&a.menuInstance){var e=oe.findDOMNode(a.menuInstance);e.offsetWidth>=a.subMenuTitle.offsetWidth||(e.style.minWidth="".concat(a.subMenuTitle.offsetWidth,"px"))}},a.saveSubMenuTitle=function(e){a.subMenuTitle=e},a.getBaseProps=function(){var e=Object(E.a)(a).props,t=a.getMode();return{mode:"horizontal"===t?"vertical":t,visible:a.getVisible(),level:e.level+1,inlineIndent:e.inlineIndent,focusable:!1,onClick:a.onSubMenuClick,onSelect:a.onSelect,onDeselect:a.onDeselect,onDestroy:a.onDestroy,selectedKeys:e.selectedKeys,eventKey:"".concat(e.eventKey,"-menu-"),openKeys:e.openKeys,motion:e.motion,onOpenChange:a.onOpenChange,subMenuOpenDelay:e.subMenuOpenDelay,parentMenu:Object(E.a)(a),subMenuCloseDelay:e.subMenuCloseDelay,forceSubMenuRender:e.forceSubMenuRender,triggerSubMenuAction:e.triggerSubMenuAction,builtinPlacements:e.builtinPlacements,defaultActiveFirst:e.store.getState().defaultActiveFirst[Z(e.eventKey)],multiple:e.multiple,prefixCls:e.rootPrefixCls,id:a.internalMenuId,manualRef:a.saveMenuInstance,itemIcon:e.itemIcon,expandIcon:e.expandIcon,direction:e.direction}},a.getMotion=function(e,t){var n=Object(E.a)(a).haveRendered,o=a.props,i=o.motion,c=o.rootPrefixCls;return Object(r.a)(Object(r.a)({},i),{},{leavedClassName:"".concat(c,"-hidden"),removeOnLeave:!1,motionAppear:n||!t||"inline"!==e})};var o=e.store,i=e.eventKey,s=o.getState().defaultActiveFirst;a.isRootMenu=!1;var l=!1;return s&&(l=s[i]),vt(o,i,l),a.state={mode:e.mode,isOpen:e.isOpen},a}return Object(k.a)(n,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var e=this,t=this.props,n=t.mode,a=t.parentMenu,o=t.manualRef,i=t.isOpen,r=function(){e.setState({mode:n,isOpen:i})},c=i!==this.state.isOpen,s=n!==this.state.mode;(s||c)&&(re.a.cancel(this.updateStateRaf),s?this.updateStateRaf=Object(re.a)(r):r()),o&&o(this),"horizontal"===n&&(null==a?void 0:a.isRootMenu)&&i&&(this.minWidthTimeout=setTimeout((function(){return e.adjustWidth()}),0))}},{key:"componentWillUnmount",value:function(){var e=this.props,t=e.onDestroy,n=e.eventKey;t&&t(n),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout),re.a.cancel(this.updateStateRaf)}},{key:"renderPopupMenu",value:function(e,t){var n=this.getBaseProps();return c.createElement(wt,Object(j.a)({},n,{id:this.internalMenuId,className:e,style:t}),this.props.children)}},{key:"renderChildren",value:function(){var e=this,t=this.getBaseProps(),n=t.mode,o=t.visible,i=t.forceSubMenuRender,r=t.direction,s=this.getMotion(n,o);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||o||i,!this.haveOpened)return c.createElement("div",null);var u=l()("".concat(t.prefixCls,"-sub"),Object(a.a)({},"".concat(t.prefixCls,"-rtl"),"rtl"===r));return this.isInlineMode()?c.createElement(We,Object(j.a)({visible:t.visible,forceRender:i},s),(function(t){var n=t.className,a=t.style,o=l()(u,n);return e.renderPopupMenu(o,a)})):this.renderPopupMenu(u)}},{key:"render",value:function(){var e,t,n,o=Object(r.a)({},this.props),i=this.getVisible(),s=this.getPrefixCls(),u=this.isInlineMode(),p=this.getMode(),d=l()(s,"".concat(s,"-").concat(p),(e={},Object(a.a)(e,o.className,!!o.className),Object(a.a)(e,this.getOpenClassName(),i),Object(a.a)(e,this.getActiveClassName(),o.active||i&&!u),Object(a.a)(e,this.getDisabledClassName(),o.disabled),Object(a.a)(e,this.getSelectedClassName(),this.isChildrenSelected()),e));this.internalMenuId||(o.eventKey?this.internalMenuId="".concat(o.eventKey,"$Menu"):(ft+=1,this.internalMenuId="$__$".concat(ft,"$Menu")));var f={},m={},v={};o.disabled||(f={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},m={onClick:this.onTitleClick},v={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var h={},b="rtl"===o.direction;u&&(b?h.paddingRight=o.inlineIndent*o.level:h.paddingLeft=o.inlineIndent*o.level);var g={};this.getVisible()&&(g={"aria-owns":this.internalMenuId});var y=null;"horizontal"!==p&&(y=this.props.expandIcon,"function"==typeof this.props.expandIcon&&(y=c.createElement(this.props.expandIcon,Object(r.a)({},this.props))));var O=c.createElement("div",Object(j.a)({ref:this.saveSubMenuTitle,style:h,className:"".concat(s,"-title"),role:"button"},v,m,{"aria-expanded":i},g,{"aria-haspopup":"true",title:"string"==typeof o.title?o.title:void 0}),o.title,y||c.createElement("i",{className:"".concat(s,"-arrow")})),C=this.renderChildren(),k=(null===(t=o.parentMenu)||void 0===t?void 0:t.isRootMenu)?o.parentMenu.props.getPopupContainer:function(e){return e.parentNode},E=mt[p],x=o.popupOffset?{offset:o.popupOffset}:{},w=l()((n={},Object(a.a)(n,o.popupClassName,o.popupClassName&&!u),Object(a.a)(n,"".concat(s,"-rtl"),b),n)),S=o.disabled,N=o.triggerSubMenuAction,M=o.subMenuOpenDelay,_=o.forceSubMenuRender,I=o.subMenuCloseDelay,T=o.builtinPlacements;ee.forEach((function(e){return delete o[e]})),delete o.onClick;var P=b?Object(r.a)(Object(r.a)({},dt),T):Object(r.a)(Object(r.a)({},pt),T);delete o.direction;var D=this.getBaseProps(),R=u?null:this.getMotion(D.mode,D.visible);return c.createElement("li",Object(j.a)({},o,f,{className:d,role:"menuitem"}),c.createElement(lt,{prefixCls:s,popupClassName:l()("".concat(s,"-popup"),w),getPopupContainer:k,builtinPlacements:P,popupPlacement:E,popupVisible:!u&&i,popupAlign:x,popup:u?null:C,action:S||u?[]:[N],mouseEnterDelay:M,mouseLeaveDelay:I,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:_,popupMotion:R},O),u?C:null)}}]),n}(c.Component);ht.defaultProps={onMouseEnter:X,onMouseLeave:X,onTitleMouseEnter:X,onTitleMouseLeave:X,onTitleClick:X,manualRef:X,mode:"vertical",title:""};var bt=Object(S.b)((function(e,t){var n=e.openKeys,a=e.activeKey,o=e.selectedKeys,i=t.eventKey,r=t.subMenuKey;return{isOpen:n.indexOf(i)>-1,active:a[r]===i,selectedKeys:o}}))(ht);bt.isSubMenu=!0;var gt=bt,yt=function(e){Object(x.a)(n,e);var t=Object(w.a)(n);function n(){var e;return Object(C.a)(this,n),(e=t.apply(this,arguments)).resizeObserver=null,e.mutationObserver=null,e.originalTotalWidth=0,e.overflowedItems=[],e.menuItemSizes=[],e.cancelFrameId=null,e.state={lastVisibleIndex:void 0},e.childRef=c.createRef(),e.getMenuItemNodes=function(){var t=e.props.prefixCls,n=e.childRef.current;return n?[].slice.call(n.children).filter((function(e){return e.className.split(" ").indexOf("".concat(t,"-overflowed-submenu"))<0})):[]},e.getOverflowedSubMenuItem=function(t,n,a){var o=e.props,s=o.overflowedIndicator,l=o.level,u=o.mode,p=o.prefixCls,d=o.theme;if(1!==l||"horizontal"!==u)return null;var f=e.props.children[0].props,m=(f.children,f.title,f.style),v=Object(i.a)(f,["children","title","style"]),h=Object(r.a)({},m),b="".concat(t,"-overflowed-indicator"),g="".concat(t,"-overflowed-indicator");0===n.length&&!0!==a?h=Object(r.a)(Object(r.a)({},h),{},{display:"none"}):a&&(h=Object(r.a)(Object(r.a)({},h),{},{visibility:"hidden",position:"absolute"}),b="".concat(b,"-placeholder"),g="".concat(g,"-placeholder"));var y=d?"".concat(p,"-").concat(d):"",O={};return ee.forEach((function(e){void 0!==v[e]&&(O[e]=v[e])})),c.createElement(gt,Object(j.a)({title:s,className:"".concat(p,"-overflowed-submenu"),popupClassName:y},O,{key:b,eventKey:g,disabled:!1,style:h}),n)},e.setChildrenWidthAndResize=function(){if("horizontal"===e.props.mode){var t=e.childRef.current;if(t){var n=t.children;if(n&&0!==n.length){var a=t.children[n.length-1];ne(a,"display","inline-block");var o=e.getMenuItemNodes(),i=o.filter((function(e){return e.className.split(" ").indexOf("menuitem-overflowed")>=0}));i.forEach((function(e){ne(e,"display","inline-block")})),e.menuItemSizes=o.map((function(e){return te(e,!0)})),i.forEach((function(e){ne(e,"display","none")})),e.overflowedIndicatorWidth=te(t.children[t.children.length-1],!0),e.originalTotalWidth=e.menuItemSizes.reduce((function(e,t){return e+t}),0),e.handleResize(),ne(a,"display","none")}}}},e.handleResize=function(){if("horizontal"===e.props.mode){var t=e.childRef.current;if(t){var n=te(t);e.overflowedItems=[];var a,o=0;e.originalTotalWidth>n+.5&&(a=-1,e.menuItemSizes.forEach((function(t){(o+=t)+e.overflowedIndicatorWidth<=n&&(a+=1)}))),e.setState({lastVisibleIndex:a})}}},e}return Object(k.a)(n,[{key:"componentDidMount",value:function(){var e=this;if(this.setChildrenWidthAndResize(),1===this.props.level&&"horizontal"===this.props.mode){var t=this.childRef.current;if(!t)return;this.resizeObserver=new ae.default((function(t){t.forEach((function(){var t=e.cancelFrameId;cancelAnimationFrame(t),e.cancelFrameId=requestAnimationFrame(e.setChildrenWidthAndResize)}))})),[].slice.call(t.children).concat(t).forEach((function(t){e.resizeObserver.observe(t)})),"undefined"!=typeof MutationObserver&&(this.mutationObserver=new MutationObserver((function(){e.resizeObserver.disconnect(),[].slice.call(t.children).concat(t).forEach((function(t){e.resizeObserver.observe(t)})),e.setChildrenWidthAndResize()})),this.mutationObserver.observe(t,{attributes:!1,childList:!0,subTree:!1}))}}},{key:"componentWillUnmount",value:function(){this.resizeObserver&&this.resizeObserver.disconnect(),this.mutationObserver&&this.mutationObserver.disconnect(),cancelAnimationFrame(this.cancelFrameId)}},{key:"renderChildren",value:function(e){var t=this,n=this.state.lastVisibleIndex;return(e||[]).reduce((function(a,o,i){var r=o;if("horizontal"===t.props.mode){var s=t.getOverflowedSubMenuItem(o.props.eventKey,[]);void 0!==n&&-1!==t.props.className.indexOf("".concat(t.props.prefixCls,"-root"))&&(i>n&&(r=c.cloneElement(o,{style:{display:"none"},eventKey:"".concat(o.props.eventKey,"-hidden"),className:"".concat("menuitem-overflowed")})),i===n+1&&(t.overflowedItems=e.slice(n+1).map((function(e){return c.cloneElement(e,{key:e.props.eventKey,mode:"vertical-left"})})),s=t.getOverflowedSubMenuItem(o.props.eventKey,t.overflowedItems)));var l=[].concat(Object(d.a)(a),[s,r]);return i===e.length-1&&l.push(t.getOverflowedSubMenuItem(o.props.eventKey,[],!0)),l}return[].concat(Object(d.a)(a),[r])}),[])}},{key:"render",value:function(){var e=this.props,t=(e.visible,e.prefixCls,e.overflowedIndicator,e.mode,e.level,e.tag),n=e.children,a=(e.theme,Object(i.a)(e,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"])),o=t;return c.createElement(o,Object(j.a)({ref:this.childRef},a),this.renderChildren(n))}}]),n}(c.Component);yt.defaultProps={tag:"div",className:""};var Ot=yt;function jt(e,t,n){var o=e.getState();e.setState({activeKey:Object(r.a)(Object(r.a)({},o.activeKey),{},Object(a.a)({},t,n))})}function Ct(e){return e.eventKey||"0-menu-"}function kt(e,t){var n,a=t,o=e.children,i=e.eventKey;if(a&&($(o,(function(e,t){e&&e.props&&!e.props.disabled&&a===Q(e,i,t)&&(n=!0)})),n))return a;return a=null,e.defaultActiveFirst?($(o,(function(e,t){a||!e||e.props.disabled||(a=Q(e,i,t))})),a):a}function Et(e){if(e){var t=this.instanceArray.indexOf(e);-1!==t?this.instanceArray[t]=e:this.instanceArray.push(e)}}var xt=function(e){Object(x.a)(n,e);var t=Object(w.a)(n);function n(e){var o;return Object(C.a)(this,n),(o=t.call(this,e)).onKeyDown=function(e,t){var n,a=e.keyCode;if(o.getFlatInstanceArray().forEach((function(t){t&&t.props.active&&t.onKeyDown&&(n=t.onKeyDown(e))})),n)return 1;var i=null;return a!==b.a.UP&&a!==b.a.DOWN||(i=o.step(a===b.a.UP?-1:1)),i?(e.preventDefault(),jt(o.props.store,Ct(o.props),i.props.eventKey),"function"==typeof t&&t(i),1):void 0},o.onItemHover=function(e){var t=e.key,n=e.hover;jt(o.props.store,Ct(o.props),n?t:null)},o.onDeselect=function(e){o.props.onDeselect(e)},o.onSelect=function(e){o.props.onSelect(e)},o.onClick=function(e){o.props.onClick(e)},o.onOpenChange=function(e){o.props.onOpenChange(e)},o.onDestroy=function(e){o.props.onDestroy(e)},o.getFlatInstanceArray=function(){return o.instanceArray},o.step=function(e){var t=o.getFlatInstanceArray(),n=o.props.store.getState().activeKey[Ct(o.props)],a=t.length;if(!a)return null;e<0&&(t=t.concat().reverse());var i=-1;if(t.every((function(e,t){return!e||e.props.eventKey!==n||(i=t,!1)})),o.props.defaultActiveFirst||-1===i||(r=t.slice(i,a-1)).length&&!r.every((function(e){return!!e.props.disabled}))){var r,c=(i+1)%a,s=c;do{var l=t[s];if(l&&!l.props.disabled)return l;s=(s+1)%a}while(s!==c);return null}},o.renderCommonMenuItem=function(e,t,n){var a=o.props.store.getState(),i=Object(E.a)(o).props,s=Q(e,i.eventKey,t),l=e.props;if(!l||"string"==typeof e.type)return e;var u=s===a.activeKey,p=Object(r.a)(Object(r.a)({mode:l.mode||i.mode,level:i.level,inlineIndent:i.inlineIndent,renderMenuItem:o.renderMenuItem,rootPrefixCls:i.prefixCls,index:t,parentMenu:i.parentMenu,manualRef:l.disabled?void 0:Object(M.a)(e.ref,Et.bind(Object(E.a)(o))),eventKey:s,active:!l.disabled&&u,multiple:i.multiple,onClick:function(e){(l.onClick||X)(e),o.onClick(e)},onItemHover:o.onItemHover,motion:i.motion,subMenuOpenDelay:i.subMenuOpenDelay,subMenuCloseDelay:i.subMenuCloseDelay,forceSubMenuRender:i.forceSubMenuRender,onOpenChange:o.onOpenChange,onDeselect:o.onDeselect,onSelect:o.onSelect,builtinPlacements:i.builtinPlacements,itemIcon:l.itemIcon||o.props.itemIcon,expandIcon:l.expandIcon||o.props.expandIcon},n),{},{direction:i.direction});return("inline"===i.mode||Y.any)&&(p.triggerSubMenuAction="click"),c.cloneElement(e,Object(r.a)(Object(r.a)({},p),{},{key:s||t}))},o.renderMenuItem=function(e,t,n){if(!e)return null;var a=o.props.store.getState(),i={openKeys:a.openKeys,selectedKeys:a.selectedKeys,triggerSubMenuAction:o.props.triggerSubMenuAction,subMenuKey:n};return o.renderCommonMenuItem(e,t,i)},e.store.setState({activeKey:Object(r.a)(Object(r.a)({},e.store.getState().activeKey),{},Object(a.a)({},e.eventKey,kt(e,e.activeKey)))}),o.instanceArray=[],o}return Object(k.a)(n,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(e){return this.props.visible||e.visible||this.props.className!==e.className||!I()(this.props.style,e.style)}},{key:"componentDidUpdate",value:function(e){var t=this.props,n="activeKey"in t?t.activeKey:t.store.getState().activeKey[Ct(t)],a=kt(t,n);if(a!==n)jt(t.store,Ct(t),a);else if("activeKey"in e){a!==kt(e,e.activeKey)&&jt(t.store,Ct(t),a)}}},{key:"render",value:function(){var e=this,t=Object(j.a)({},this.props);this.instanceArray=[];var n={className:l()(t.prefixCls,t.className,"".concat(t.prefixCls,"-").concat(t.mode)),role:t.role||"menu"};t.id&&(n.id=t.id),t.focusable&&(n.tabIndex=0,n.onKeyDown=this.onKeyDown);var a=t.prefixCls,o=t.eventKey,i=t.visible,r=t.level,s=t.mode,p=t.overflowedIndicator,d=t.theme;return ee.forEach((function(e){return delete t[e]})),delete t.onClick,c.createElement(Ot,Object(j.a)({},t,{prefixCls:a,mode:s,tag:"ul",level:r,theme:d,visible:i,overflowedIndicator:p},n),Object(u.a)(t.children).map((function(t,n){return e.renderMenuItem(t,n,o||"0-menu-")})))}}]),n}(c.Component);xt.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:X};var wt=Object(S.b)()(xt),St=n("Kwbf");function Nt(e,t,n){var a=e.prefixCls,o=e.motion,i=e.defaultMotions,r=void 0===i?{}:i,c=e.openAnimation,s=e.openTransitionName,l=t.switchingModeFromInline;if(o)return o;if("object"===Object(T.a)(c)&&c)Object(St.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if("string"==typeof c)return{motionName:"".concat(a,"-open-").concat(c)};if(s)return{motionName:s};var u=r[n];return u||(l?null:r.other)}var Mt=function(e){Object(x.a)(n,e);var t=Object(w.a)(n);function n(e){var a;Object(C.a)(this,n),(a=t.call(this,e)).onSelect=function(e){var t=Object(E.a)(a).props;if(t.selectable){var n=a.store.getState().selectedKeys,o=e.key;n=t.multiple?n.concat([o]):[o],"selectedKeys"in t||a.store.setState({selectedKeys:n}),t.onSelect(Object(r.a)(Object(r.a)({},e),{},{selectedKeys:n}))}},a.onClick=function(e){var t=a.getRealMenuMode(),n=Object(E.a)(a),o=n.store,i=n.props.onOpenChange;"inline"===t||"openKeys"in a.props||(o.setState({openKeys:[]}),i([])),a.props.onClick(e)},a.onKeyDown=function(e,t){a.innerMenu.getWrappedInstance().onKeyDown(e,t)},a.onOpenChange=function(e){var t=Object(E.a)(a).props,n=a.store.getState().openKeys.concat(),o=!1,i=function(e){var t=!1;if(e.open)(t=-1===n.indexOf(e.key))&&n.push(e.key);else{var a=n.indexOf(e.key);(t=-1!==a)&&n.splice(a,1)}o=o||t};Array.isArray(e)?e.forEach(i):i(e),o&&("openKeys"in a.props||a.store.setState({openKeys:n}),t.onOpenChange(n))},a.onDeselect=function(e){var t=Object(E.a)(a).props;if(t.selectable){var n=a.store.getState().selectedKeys.concat(),o=e.key,i=n.indexOf(o);-1!==i&&n.splice(i,1),"selectedKeys"in t||a.store.setState({selectedKeys:n}),t.onDeselect(Object(r.a)(Object(r.a)({},e),{},{selectedKeys:n}))}},a.onMouseEnter=function(e){a.restoreModeVerticalFromInline();var t=a.props.onMouseEnter;t&&t(e)},a.onTransitionEnd=function(e){var t="width"===e.propertyName&&e.target===e.currentTarget,n=e.target.className,o="[object SVGAnimatedString]"===Object.prototype.toString.call(n)?n.animVal:n,i="font-size"===e.propertyName&&o.indexOf("anticon")>=0;(t||i)&&a.restoreModeVerticalFromInline()},a.setInnerMenu=function(e){a.innerMenu=e},a.isRootMenu=!0;var o=e.defaultSelectedKeys,i=e.defaultOpenKeys;return"selectedKeys"in e&&(o=e.selectedKeys||[]),"openKeys"in e&&(i=e.openKeys||[]),a.store=Object(S.c)({selectedKeys:o,openKeys:i,activeKey:{"0-menu-":kt(e,e.activeKey)}}),a.state={switchingModeFromInline:!1,prevProps:e,inlineOpenKeys:[],store:a.store},a}return Object(k.a)(n,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.siderCollapsed,a=t.inlineCollapsed,o=t.onOpenChange;(!e.inlineCollapsed&&a||!e.siderCollapsed&&n)&&o([]),this.updateMiniStore(),this.updateMenuDisplay()}},{key:"updateMenuDisplay",value:function(){var e=this.props.collapsedWidth,t=this.store,n=this.prevOpenKeys;this.getInlineCollapsed()&&(0===e||"0"===e||"0px"===e)?(this.prevOpenKeys=t.getState().openKeys.concat(),this.store.setState({openKeys:[]})):n&&(this.store.setState({openKeys:n}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var e=this.props.mode,t=this.state.switchingModeFromInline,n=this.getInlineCollapsed();return t&&n?"inline":n?"vertical":e}},{key:"getInlineCollapsed",value:function(){var e=this.props,t=e.inlineCollapsed,n=e.siderCollapsed;return void 0!==n?n:t}},{key:"restoreModeVerticalFromInline",value:function(){this.state.switchingModeFromInline&&this.setState({switchingModeFromInline:!1})}},{key:"updateMiniStore",value:function(){"selectedKeys"in this.props&&this.store.setState({selectedKeys:this.props.selectedKeys||[]}),"openKeys"in this.props&&this.store.setState({openKeys:this.props.openKeys||[]})}},{key:"render",value:function(){var e=Object(r.a)({},Object(N.a)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),t=this.getRealMenuMode();return e.className+=" ".concat(e.prefixCls,"-root"),"rtl"===e.direction&&(e.className+=" ".concat(e.prefixCls,"-rtl")),delete(e=Object(r.a)(Object(r.a)({},e),{},{mode:t,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:Nt(this.props,this.state,t)})).openAnimation,delete e.openTransitionName,c.createElement(S.a,{store:this.store},c.createElement(wt,Object(j.a)({},e,{ref:this.setInnerMenu}),this.props.children))}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=t.prevProps,a=t.store,o=a.getState(),i={},r={prevProps:e};return"inline"===n.mode&&"inline"!==e.mode&&(r.switchingModeFromInline=!0),"openKeys"in e?i.openKeys=e.openKeys||[]:((e.inlineCollapsed&&!n.inlineCollapsed||e.siderCollapsed&&!n.siderCollapsed)&&(r.switchingModeFromInline=!0,r.inlineOpenKeys=o.openKeys,i.openKeys=[]),(!e.inlineCollapsed&&n.inlineCollapsed||!e.siderCollapsed&&n.siderCollapsed)&&(i.openKeys=t.inlineOpenKeys,r.inlineOpenKeys=[])),Object.keys(i).length&&a.setState(i),r}}]),n}(c.Component);Mt.defaultProps={selectable:!0,onClick:X,onSelect:X,onOpenChange:X,onDeselect:X,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:c.createElement("span",null,"···")};var _t=Mt,It=function(e){Object(x.a)(n,e);var t=Object(w.a)(n);function n(){var e;return Object(C.a)(this,n),(e=t.apply(this,arguments)).onKeyDown=function(t){if(t.keyCode===b.a.ENTER)return e.onClick(t),!0},e.onMouseLeave=function(t){var n=e.props,a=n.eventKey,o=n.onItemHover,i=n.onMouseLeave;o({key:a,hover:!1}),i({key:a,domEvent:t})},e.onMouseEnter=function(t){var n=e.props,a=n.eventKey,o=n.onItemHover,i=n.onMouseEnter;o({key:a,hover:!0}),i({key:a,domEvent:t})},e.onClick=function(t){var n=e.props,a=n.eventKey,o=n.multiple,i=n.onClick,r=n.onSelect,c=n.onDeselect,s=n.isSelected,l={key:a,keyPath:[a],item:Object(E.a)(e),domEvent:t};i(l),o?s?c(l):r(l):s||r(l)},e.saveNode=function(t){e.node=t},e}return Object(k.a)(n,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var e=this.props;e.onDestroy&&e.onDestroy(e.eventKey)}},{key:"getPrefixCls",value:function(){return"".concat(this.props.rootPrefixCls,"-item")}},{key:"getActiveClassName",value:function(){return"".concat(this.getPrefixCls(),"-active")}},{key:"getSelectedClassName",value:function(){return"".concat(this.getPrefixCls(),"-selected")}},{key:"getDisabledClassName",value:function(){return"".concat(this.getPrefixCls(),"-disabled")}},{key:"callRef",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"render",value:function(){var e,t=Object(r.a)({},this.props),n=l()(this.getPrefixCls(),t.className,(e={},Object(a.a)(e,this.getActiveClassName(),!t.disabled&&t.active),Object(a.a)(e,this.getSelectedClassName(),t.isSelected),Object(a.a)(e,this.getDisabledClassName(),t.disabled),e)),o=Object(r.a)(Object(r.a)({},t.attribute),{},{title:"string"==typeof t.title?t.title:void 0,className:n,role:t.role||"menuitem","aria-disabled":t.disabled});"option"===t.role?o=Object(r.a)(Object(r.a)({},o),{},{role:"option","aria-selected":t.isSelected}):null!==t.role&&"none"!==t.role||(o.role="none");var i={onClick:t.disabled?null:this.onClick,onMouseLeave:t.disabled?null:this.onMouseLeave,onMouseEnter:t.disabled?null:this.onMouseEnter},s=Object(r.a)({},t.style);"inline"===t.mode&&("rtl"===t.direction?s.paddingRight=t.inlineIndent*t.level:s.paddingLeft=t.inlineIndent*t.level),ee.forEach((function(e){return delete t[e]})),delete t.direction;var u=this.props.itemIcon;return"function"==typeof this.props.itemIcon&&(u=c.createElement(this.props.itemIcon,this.props)),c.createElement("li",Object(j.a)({},Object(N.a)(t,["onClick","onMouseEnter","onMouseLeave","onSelect"]),o,i,{style:s,ref:this.saveNode}),t.children,u)}}]),n}(c.Component);It.isMenuItem=!0,It.defaultProps={onSelect:X,onMouseEnter:X,onMouseLeave:X,manualRef:X};var Tt=Object(S.b)((function(e,t){var n=e.activeKey,a=e.selectedKeys,o=t.eventKey;return{active:n[t.subMenuKey]===o,isSelected:Array.isArray(a)?-1!==a.indexOf(o):a===o}}))(It),Pt=function(e){Object(x.a)(n,e);var t=Object(w.a)(n);function n(){var e;return Object(C.a)(this,n),(e=t.apply(this,arguments)).renderInnerMenuItem=function(t){var n=e.props;return(0,n.renderMenuItem)(t,n.index,e.props.subMenuKey)},e}return Object(k.a)(n,[{key:"render",value:function(){var e=Object(j.a)({},this.props),t=e.className,n=void 0===t?"":t,a=e.rootPrefixCls,o="".concat(a,"-item-group-title"),i="".concat(a,"-item-group-list"),r=e.title,s=e.children;return ee.forEach((function(t){return delete e[t]})),delete e.direction,c.createElement("li",Object(j.a)({},e,{onClick:function(e){return e.stopPropagation()},className:"".concat(n," ").concat(a,"-item-group")}),c.createElement("div",{className:o,title:"string"==typeof r?r:void 0},r),c.createElement("ul",{className:i},c.Children.map(s,this.renderInnerMenuItem)))}}]),n}(c.Component);Pt.isMenuItemGroup=!0,Pt.defaultProps={disabled:!0};var Dt=function(e){var t=e.className,n=e.rootPrefixCls,a=e.style;return c.createElement("li",{className:"".concat(t," ").concat(n,"-item-divider"),style:a})};Dt.defaultProps={disabled:!0,className:"",style:{}};var Rt=_t,Kt=n("eDIo");var At=c.forwardRef((function(e,t){var n=e.prefixCls,a=e.editable,o=e.locale,i=e.style;return a&&!1!==a.showAdd?c.createElement("button",{ref:t,type:"button",className:"".concat(n,"-nav-add"),style:i,"aria-label":(null==o?void 0:o.addAriaLabel)||"Add tab",onClick:function(e){a.onEdit("add",{event:e})}},a.addIcon||"+"):null}));var zt=c.forwardRef((function(e,t){var n=e.prefixCls,i=e.id,r=e.tabs,s=e.locale,u=e.mobile,p=e.moreIcon,d=void 0===p?"More":p,f=e.moreTransitionName,m=e.style,v=e.className,h=e.editable,g=e.tabBarGutter,y=e.rtl,O=e.onTabClick,j=Object(c.useState)(!1),C=Object(o.a)(j,2),k=C[0],E=C[1],x=Object(c.useState)(null),w=Object(o.a)(x,2),S=w[0],N=w[1],M="".concat(i,"-more-popup"),_="".concat(n,"-dropdown"),I=null!==S?"".concat(M,"-").concat(S):null,T=null==s?void 0:s.dropdownAriaLabel,P=c.createElement(Rt,{onClick:function(e){var t=e.key,n=e.domEvent;O(t,n),E(!1)},id:M,tabIndex:-1,role:"listbox","aria-activedescendant":I,selectedKeys:[S],"aria-label":void 0!==T?T:"expanded dropdown"},r.map((function(e){return c.createElement(Tt,{key:e.key,id:"".concat(M,"-").concat(e.key),role:"option","aria-controls":i&&"".concat(i,"-panel-").concat(e.key),disabled:e.disabled},e.tab)})));function D(e){for(var t=r.filter((function(e){return!e.disabled})),n=t.findIndex((function(e){return e.key===S}))||0,a=t.length,o=0;o<a;o+=1){var i=t[n=(n+e+a)%a];if(!i.disabled)return void N(i.key)}}Object(c.useEffect)((function(){var e=document.getElementById(I);e&&e.scrollIntoView&&e.scrollIntoView(!1)}),[S]),Object(c.useEffect)((function(){k||N(null)}),[k]);var R=Object(a.a)({},y?"marginLeft":"marginRight",g);r.length||(R.visibility="hidden",R.order=1);var K=l()(Object(a.a)({},"".concat(_,"-rtl"),y)),A=u?null:c.createElement(Kt.a,{prefixCls:_,overlay:P,trigger:["hover"],visible:k,transitionName:f,onVisibleChange:E,overlayClassName:K,mouseEnterDelay:.1,mouseLeaveDelay:.1},c.createElement("button",{type:"button",className:"".concat(n,"-nav-more"),style:R,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":M,id:"".concat(i,"-more"),"aria-expanded":k,onKeyDown:function(e){var t=e.which;if(k)switch(t){case b.a.UP:D(-1),e.preventDefault();break;case b.a.DOWN:D(1),e.preventDefault();break;case b.a.ESC:E(!1);break;case b.a.SPACE:case b.a.ENTER:null!==S&&O(S,e)}else[b.a.DOWN,b.a.SPACE,b.a.ENTER].includes(t)&&(E(!0),e.preventDefault())}},d));return c.createElement("div",{className:l()("".concat(n,"-nav-operations"),v),style:m,ref:t},A,c.createElement(At,{prefixCls:n,locale:s,editable:h}))})),Vt=Object(c.createContext)(null),Lt=Math.pow(.995,20);function Wt(e,t){var n=c.useRef(e),a=c.useState({}),i=Object(o.a)(a,2)[1];return[n.current,function(e){var a="function"==typeof e?e(n.current):e;a!==n.current&&t(a,n.current),n.current=a,i({})}]}var Ft=function(e){var t,n=e.position,a=e.prefixCls,o=e.extra;if(!o)return null;var i=o;return"right"===n&&(t=i.right||!i.left&&i||null),"left"===n&&(t=i.left||null),t?c.createElement("div",{className:"".concat(a,"-extra-content")},t):null};var Bt=c.forwardRef((function(e,t){var n,i,s=c.useContext(Vt),u=s.prefixCls,p=s.tabs,f=e.className,b=e.style,j=e.id,C=e.animated,k=e.activeKey,E=e.rtl,x=e.extra,w=e.editable,S=e.locale,N=e.tabPosition,M=e.tabBarGutter,_=e.children,I=e.onTabClick,T=e.onTabScroll,P=Object(c.useRef)(),D=Object(c.useRef)(),R=Object(c.useRef)(),K=Object(c.useRef)(),A=(i=Object(c.useRef)(new Map),[function(e){return i.current.has(e)||i.current.set(e,c.createRef()),i.current.get(e)},function(e){i.current.delete(e)}]),z=Object(o.a)(A,2),V=z[0],L=z[1],W="top"===N||"bottom"===N,F=Wt(0,(function(e,t){W&&T&&T({direction:e>t?"left":"right"})})),B=Object(o.a)(F,2),H=B[0],U=B[1],q=Wt(0,(function(e,t){!W&&T&&T({direction:e>t?"top":"bottom"})})),J=Object(o.a)(q,2),G=J[0],Y=J[1],X=Object(c.useState)(0),Q=Object(o.a)(X,2),Z=Q[0],$=Q[1],ee=Object(c.useState)(0),te=Object(o.a)(ee,2),ne=te[0],ae=te[1],oe=Object(c.useState)(0),ie=Object(o.a)(oe,2),re=ie[0],ce=ie[1],se=Object(c.useState)(0),le=Object(o.a)(se,2),ue=le[0],pe=le[1],de=Object(c.useState)(null),fe=Object(o.a)(de,2),me=fe[0],ve=fe[1],he=Object(c.useState)(null),be=Object(o.a)(he,2),ge=be[0],ye=be[1],Oe=Object(c.useState)(0),je=Object(o.a)(Oe,2),Ce=je[0],ke=je[1],Ee=Object(c.useState)(0),xe=Object(o.a)(Ee,2),we=xe[0],Se=xe[1],Ne=function(e){var t=Object(c.useRef)([]),n=Object(c.useState)({}),a=Object(o.a)(n,2)[1],i=Object(c.useRef)("function"==typeof e?e():e),r=h((function(){var e=i.current;t.current.forEach((function(t){e=t(e)})),t.current=[],i.current=e,a({})}));return[i.current,function(e){t.current.push(e),r()}]}(new Map),Me=Object(o.a)(Ne,2),_e=Me[0],Ie=Me[1],Te=function(e,t,n){return Object(c.useMemo)((function(){for(var n,a=new Map,o=t.get(null===(n=e[0])||void 0===n?void 0:n.key)||y,i=o.left+o.width,c=0;c<e.length;c+=1){var s,l=e[c].key,u=t.get(l);if(!u)u=t.get(null===(s=e[c-1])||void 0===s?void 0:s.key)||y;var p=a.get(l)||Object(r.a)({},u);p.right=i-p.left-p.width,a.set(l,p)}return a}),[e.map((function(e){return e.key})).join("_"),t,n])}(p,_e,Z),Pe="".concat(u,"-nav-operations-hidden"),De=0,Re=0;function Ke(e){return e<De?[De,!1]:e>Re?[Re,!1]:[e,!0]}W?E?(De=0,Re=Math.max(0,Z-me)):(De=Math.min(0,me-Z),Re=0):(De=Math.min(0,ge-ne),Re=0);var Ae=Object(c.useRef)(),ze=Object(c.useState)(),Ve=Object(o.a)(ze,2),Le=Ve[0],We=Ve[1];function Fe(){We(Date.now())}function Be(){window.clearTimeout(Ae.current)}function He(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:k,t=Te.get(e);if(t)if(W){var n=H;E?t.right<H?n=t.right:t.right+t.width>H+me&&(n=t.right+t.width-me):t.left<-H?n=-t.left:t.left+t.width>-H+me&&(n=-(t.left+t.width-me)),Y(0),U(Ke(n)[0])}else{var a=G;t.top<-G?a=-t.top:t.top+t.height>-G+ge&&(a=-(t.top+t.height-ge)),U(0),Y(Ke(a)[0])}}!function(e,t){var n=Object(c.useState)(),a=Object(o.a)(n,2),i=a[0],r=a[1],s=Object(c.useState)(0),l=Object(o.a)(s,2),u=l[0],p=l[1],d=Object(c.useState)(0),f=Object(o.a)(d,2),m=f[0],v=f[1],h=Object(c.useState)(),b=Object(o.a)(h,2),g=b[0],y=b[1],O=Object(c.useRef)(),j=Object(c.useRef)(0),C=Object(c.useRef)(!1),k=Object(c.useRef)(),E=Object(c.useRef)(null);E.current={onTouchStart:function(e){var t=e.touches[0],n=t.screenX,a=t.screenY;r({x:n,y:a}),window.clearInterval(O.current)},onTouchMove:function(e){if(i){e.preventDefault();var n=e.touches[0],a=n.screenX,o=n.screenY;r({x:a,y:o});var c=a-i.x,s=o-i.y;t(c,s);var l=Date.now();p(l),v(l-u),y({x:c,y:s})}},onTouchEnd:function(){if(i&&(r(null),y(null),g)){var e=g.x/m,n=g.y/m,a=Math.abs(e),o=Math.abs(n);if(Math.max(a,o)<.1)return;var c=e,s=n;O.current=window.setInterval((function(){Math.abs(c)<.01&&Math.abs(s)<.01?window.clearInterval(O.current):t(20*(c*=Lt),20*(s*=Lt))}),20)}},onWheel:function(e){var n=e.deltaX,a=e.deltaY,o=0,i=Math.abs(n),r=Math.abs(a);i===r?o="x"===k.current?n:a:i>r?(o=n,k.current="x"):(o=a,k.current="y");var c=Date.now();c-j.current>100&&(C.current=!1),(t(-o,-o)||C.current)&&(e.preventDefault(),C.current=!0),j.current=c}},c.useEffect((function(){function t(e){E.current.onTouchMove(e)}function n(e){E.current.onTouchEnd(e)}return document.addEventListener("touchmove",t,{passive:!1}),document.addEventListener("touchend",n,{passive:!1}),e.current.addEventListener("touchstart",(function(e){E.current.onTouchStart(e)}),{passive:!1}),e.current.addEventListener("wheel",(function(e){E.current.onWheel(e)})),function(){document.removeEventListener("touchmove",t),document.removeEventListener("touchend",n)}}),[])}(P,(function(e,t){var n=!1;function a(e,t){e((function(e){var a=Ke(e+t),i=Object(o.a)(a,2),r=i[0],c=i[1];return n=c,r}))}if(W){if(me>=Z)return n;a(U,e)}else{if(ge>=ne)return n;a(Y,t)}return Be(),Fe(),n})),Object(c.useEffect)((function(){return Be(),Le&&(Ae.current=window.setTimeout((function(){We(0)}),100)),Be}),[Le]);var Ue=function(e,t,n,a,o){var i,r,s,l=o.tabs,u=o.tabPosition,p=o.rtl;["top","bottom"].includes(u)?(i="width",r=p?"right":"left",s=Math.abs(t.left)):(i="height",r="top",s=-t.top);var d=t[i],f=n[i],m=a[i],v=d;return f+m>d&&(v=d-m),Object(c.useMemo)((function(){if(!l.length)return[0,0];for(var t=l.length,n=t,a=0;a<t;a+=1){var o=e.get(l[a].key)||O;if(o[r]+o[i]>s+v){n=a-1;break}}for(var c=0,u=t-1;u>=0;u-=1){if((e.get(l[u].key)||O)[r]<s){c=u+1;break}}return[c,n]}),[e,s,v,u,l.map((function(e){return e.key})).join("_"),p])}(Te,{width:me,height:ge,left:H,top:G},{width:re,height:ue},{width:Ce,height:we},Object(r.a)(Object(r.a)({},e),{},{tabs:p})),qe=Object(o.a)(Ue,2),Je=qe[0],Ge=qe[1],Ye=p.map((function(e){var t=e.key;return c.createElement(g,{id:j,prefixCls:u,key:t,rtl:E,tab:e,closable:e.closable,editable:w,active:t===k,tabPosition:N,tabBarGutter:M,renderWrapper:_,removeAriaLabel:null==S?void 0:S.removeAriaLabel,ref:V(t),onClick:function(e){I(t,e)},onRemove:function(){L(t)},onFocus:function(){He(t),Fe(),E||(P.current.scrollLeft=0),P.current.scrollTop=0}})})),Xe=h((function(){var e,t,n,a,o,i,r,c,s,l=(null===(e=P.current)||void 0===e?void 0:e.offsetWidth)||0,u=(null===(t=P.current)||void 0===t?void 0:t.offsetHeight)||0,d=(null===(n=K.current)||void 0===n?void 0:n.offsetWidth)||0,f=(null===(a=K.current)||void 0===a?void 0:a.offsetHeight)||0,m=(null===(o=R.current)||void 0===o?void 0:o.offsetWidth)||0,v=(null===(i=R.current)||void 0===i?void 0:i.offsetHeight)||0;ve(l),ye(u),ke(d),Se(f);var h=((null===(r=D.current)||void 0===r?void 0:r.offsetWidth)||0)-d,b=((null===(c=D.current)||void 0===c?void 0:c.offsetHeight)||0)-f;$(h),ae(b);var g=null===(s=R.current)||void 0===s?void 0:s.className.includes(Pe);ce(h-(g?0:m)),pe(b-(g?0:v)),Ie((function(){var e=new Map;return p.forEach((function(t){var n=t.key,a=V(n).current;a&&e.set(n,{width:a.offsetWidth,height:a.offsetHeight,left:a.offsetLeft,top:a.offsetTop})})),e}))})),Qe=p.slice(0,Je),Ze=p.slice(Ge+1),$e=[].concat(Object(d.a)(Qe),Object(d.a)(Ze)),et=Object(c.useState)(),tt=Object(o.a)(et,2),nt=tt[0],at=tt[1],ot=Te.get(k),it=Object(c.useRef)();function rt(){m.a.cancel(it.current)}Object(c.useEffect)((function(){var e={};return ot&&(W?(E?e.right=ot.right:e.left=ot.left,e.width=ot.width):(e.top=ot.top,e.height=ot.height)),rt(),it.current=m()((function(){at(e)})),rt}),[ot,W,E]),Object(c.useEffect)((function(){He()}),[k,ot,Te,W]),Object(c.useEffect)((function(){Xe()}),[E,M,k,p.map((function(e){return e.key})).join("_")]);var ct,st,lt,ut,pt=!!$e.length,dt="".concat(u,"-nav-wrap");return W?E?(st=H>0,ct=H+me<Z):(ct=H<0,st=-H+me<Z):(lt=G<0,ut=-G+ge<ne),c.createElement("div",{ref:t,role:"tablist",className:l()("".concat(u,"-nav"),f),style:b,onKeyDown:function(){Fe()}},c.createElement(Ft,{position:"left",extra:x,prefixCls:u}),c.createElement(v.a,{onResize:Xe},c.createElement("div",{className:l()(dt,(n={},Object(a.a)(n,"".concat(dt,"-ping-left"),ct),Object(a.a)(n,"".concat(dt,"-ping-right"),st),Object(a.a)(n,"".concat(dt,"-ping-top"),lt),Object(a.a)(n,"".concat(dt,"-ping-bottom"),ut),n)),ref:P},c.createElement(v.a,{onResize:Xe},c.createElement("div",{ref:D,className:"".concat(u,"-nav-list"),style:{transform:"translate(".concat(H,"px, ").concat(G,"px)"),transition:Le?"none":void 0}},Ye,c.createElement(At,{ref:K,prefixCls:u,locale:S,editable:w,style:{visibility:pt?"hidden":null}}),c.createElement("div",{className:l()("".concat(u,"-ink-bar"),Object(a.a)({},"".concat(u,"-ink-bar-animated"),C.inkBar)),style:nt}))))),c.createElement(zt,Object.assign({},e,{ref:R,prefixCls:u,tabs:$e,className:!pt&&Pe})),c.createElement(Ft,{position:"right",extra:x,prefixCls:u}))}));function Ht(e){var t=e.id,n=e.activeKey,o=e.animated,i=e.tabPosition,r=e.rtl,s=e.destroyInactiveTabPane,u=c.useContext(Vt),p=u.prefixCls,d=u.tabs,f=o.tabPane,m=d.findIndex((function(e){return e.key===n}));return c.createElement("div",{className:l()("".concat(p,"-content-holder"))},c.createElement("div",{className:l()("".concat(p,"-content"),"".concat(p,"-content-").concat(i),Object(a.a)({},"".concat(p,"-content-animated"),f)),style:m&&f?Object(a.a)({},r?"marginRight":"marginLeft","-".concat(m,"00%")):null},d.map((function(e){return c.cloneElement(e.node,{key:e.key,prefixCls:p,tabKey:e.key,id:t,animated:f,active:e.key===n,destroyInactiveTabPane:s})}))))}function Ut(e){var t=e.prefixCls,n=e.forceRender,a=e.className,i=e.style,s=e.id,u=e.active,p=e.animated,d=e.destroyInactiveTabPane,f=e.tabKey,m=e.children,v=c.useState(n),h=Object(o.a)(v,2),b=h[0],g=h[1];c.useEffect((function(){u?g(!0):d&&g(!1)}),[u,d]);var y={};return u||(p?(y.visibility="hidden",y.height=0,y.overflowY="hidden"):y.display="none"),c.createElement("div",{id:s&&"".concat(s,"-panel-").concat(f),role:"tabpanel",tabIndex:u?0:-1,"aria-labelledby":s&&"".concat(s,"-tab-").concat(f),"aria-hidden":!u,style:Object(r.a)(Object(r.a)({},y),i),className:l()("".concat(t,"-tabpane"),u&&"".concat(t,"-tabpane-active"),a)},(u||b||n)&&m)}var qt=0;var Jt=c.forwardRef((function(e,t){var n,s,d=e.id,f=e.prefixCls,m=void 0===f?"rc-tabs":f,v=e.className,h=e.children,b=e.direction,g=e.activeKey,y=e.defaultActiveKey,O=e.editable,j=e.animated,C=e.tabPosition,k=void 0===C?"top":C,E=e.tabBarGutter,x=e.tabBarStyle,w=e.tabBarExtraContent,S=e.locale,N=e.moreIcon,M=e.moreTransitionName,_=e.destroyInactiveTabPane,I=e.renderTabBar,T=e.onChange,P=e.onTabClick,D=e.onTabScroll,R=Object(i.a)(e,["id","prefixCls","className","children","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll"]),K=function(e){return Object(u.a)(e).map((function(e){if(c.isValidElement(e)){var t=void 0!==e.key?String(e.key):void 0;return Object(r.a)(Object(r.a)({key:t},e.props),{},{node:e})}return null})).filter((function(e){return e}))}(h),A="rtl"===b;s=!1===j?{inkBar:!1,tabPane:!1}:Object(r.a)({inkBar:!0,tabPane:!1},!0!==j?j:null);var z=Object(c.useState)(!1),V=Object(o.a)(z,2),L=V[0],W=V[1];Object(c.useEffect)((function(){var e;W((e=navigator.userAgent||navigator.vendor||window.opera,!(!/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)&&!/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(e.substr(0,4)))))}),[]);var F=Object(p.a)((function(){var e;return null===(e=K[0])||void 0===e?void 0:e.key}),{value:g,defaultValue:y}),B=Object(o.a)(F,2),H=B[0],U=B[1],q=Object(c.useState)((function(){return K.findIndex((function(e){return e.key===H}))})),J=Object(o.a)(q,2),G=J[0],Y=J[1];Object(c.useEffect)((function(){var e,t=K.findIndex((function(e){return e.key===H}));-1===t&&(t=Math.max(0,Math.min(G,K.length-1)),U(null===(e=K[t])||void 0===e?void 0:e.key));Y(t)}),[K.map((function(e){return e.key})).join("_"),H,G]);var X=Object(p.a)(null,{value:d}),Q=Object(o.a)(X,2),Z=Q[0],$=Q[1],ee=k;L&&!["left","right"].includes(k)&&(ee="top"),Object(c.useEffect)((function(){d||($("rc-tabs-".concat(qt)),qt+=1)}),[]);var te,ne={id:Z,activeKey:H,animated:s,tabPosition:ee,rtl:A,mobile:L},ae=Object(r.a)(Object(r.a)({},ne),{},{editable:O,locale:S,moreIcon:N,moreTransitionName:M,tabBarGutter:E,onTabClick:function(e,t){null==P||P(e,t),U(e),null==T||T(e)},onTabScroll:D,extra:w,style:x,panes:h});return te=I?I(ae,Bt):c.createElement(Bt,Object.assign({},ae)),c.createElement(Vt.Provider,{value:{tabs:K,prefixCls:m}},c.createElement("div",Object.assign({ref:t,id:d,className:l()(m,"".concat(m,"-").concat(ee),(n={},Object(a.a)(n,"".concat(m,"-mobile"),L),Object(a.a)(n,"".concat(m,"-editable"),O),Object(a.a)(n,"".concat(m,"-rtl"),A),n),v)},R),te,c.createElement(Ht,Object.assign({destroyInactiveTabPane:_},ne,{animated:s}))))}));Jt.TabPane=Ut;var Gt=Jt;t.b=Gt},sWpE:
|