-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path308.dd57067b.async.js
More file actions
1 lines (1 loc) · 30.4 KB
/
Copy path308.dd57067b.async.js
File metadata and controls
1 lines (1 loc) · 30.4 KB
1
"use strict";(self.webpackChunk_metro_docs=self.webpackChunk_metro_docs||[]).push([[308],{85308:function(xa,ke,z){z.r(ke),z.d(ke,{Avatar:function(){return je},Badge:function(){return we},Button:function(){return Ce},ButtonGroup:function(){return Ge},ConfigContext:function(){return J},ConfigProvider:function(){return ge},Divider:function(){return xe},Dropdown:function(){return He},Layout:function(){return he},Menu:function(){return ve},RuntimeConfigProvider:function(){return pt},Space:function(){return Ae},SpaceContext:function(){return Te},Tooltip:function(){return $e},TooltipText:function(){return nt},getRuntimeConfig:function(){return xt}});var ot=z(814),s=z.n(ot),lt=z(26290),P=z.n(lt),st=z(24923),K=z.n(st),ct=z(43681),ne=z.n(ct),dt=z(72779),D=z.n(dt),ut=z(84973),r=z(41398),vt=function(t,n){return!n||!Object.keys(n).length?t:r.cloneElement(t,{style:s()(s()({},t.props.style),n)})},ft=vt,mt=function(t,n){return n?r.cloneElement(t,{"data-theme":n}):t},ht=mt,l=z(46228),gt=["children","cssVars","primaryColor","theme"],Se={prefixCls:"metro",theme:"light",cssVars:{}},J=(0,r.createContext)(Se),me=Se,Ct=function(t){me=t},xt=function(){return me},ge=function(t){var n=t.children,a=t.cssVars,o=t.primaryColor,i=t.theme,c=K()(t,gt);Ct(t);var d=ft(n,a);return d=ht(d,i),(0,l.jsx)(J.Provider,{value:c,children:r.Children.only(d)})},pt=function(t){var n=t.children,a=(0,r.useRef)(me);return(0,r.useEffect)(function(){a.current=me},[me]),(0,l.jsx)(ge,s()(s()({},a==null?void 0:a.current),{},{children:n}))};ge.displayName="ConfigProvider",ge.defaultProps=Se;var Pe=r.createContext("s"),pa=function(t){var n=t.children,a=t.size,o=React.useContext(Pe);return _jsx(Pe.Provider,{value:a||o,children:n})},yt=Pe,Nt=["shape","size","src","srcSet","icon","className","rootClassName","alt","draggable","children","crossOrigin","noBorder"],St=function(t,n){var a,o=r.useContext(yt),i=r.useState(1),c=ne()(i,2),d=c[0],f=c[1],u=r.useState(!1),v=ne()(u,2),h=v[0],C=v[1],y=r.useState(!0),x=ne()(y,2),S=x[0],j=x[1],N=r.useRef(null),w=r.useRef(null),T=(0,ut.sQ)(n,N),b=function(){if(!(!w.current||!N.current)){var g=w.current.offsetWidth,m=N.current.offsetWidth;g!==0&&m!==0&&f(m-8<g?(m-8)/g:1)}};r.useEffect(function(){b()},[t.children]),r.useEffect(function(){C(!0)},[]),r.useEffect(function(){t.src&&(j(!0),f(1))},[t.src]);var R=function(){var g=t.onError,m=g?g():void 0;m!==!1&&j(!1)},M=t.shape,p=t.size,A=t.src,Y=t.srcSet,W=t.icon,V=t.className,X=t.rootClassName,Q=t.alt,Z=t.draggable,F=t.children,U=t.crossOrigin,q=t.noBorder,ie=K()(t,Nt),oe=p!=null?p:o,_=r.isValidElement(A),ae=r.useContext(J),B=ae.prefixCls+"-avatar",H=D()(B,"".concat(B,"-").concat(oe),(a={},P()(a,"".concat(B,"-").concat(M),!!M),P()(a,"".concat(B,"-image"),_||A&&S),P()(a,"".concat(B,"-icon"),!!W),P()(a,"".concat(B,"-no-border"),!!q),a),V,X),O;if(typeof A=="string"&&S)O=(0,l.jsx)("img",{src:A,draggable:Z,srcSet:Y,onError:R,alt:Q,crossOrigin:U});else if(_)O=A;else if(W)O=W;else if(h||d!==1){var I="scale(".concat(d,") translateX(-50%)"),L={msTransform:I,WebkitTransform:I,transform:I};O=(0,l.jsx)("span",{className:"".concat(B,"-string"),ref:w,style:L,children:F})}else O=(0,l.jsx)("span",{className:"".concat(B,"-string"),style:{opacity:0},ref:w,children:F});return(0,l.jsx)("span",s()(s()({},ie),{},{style:ie.style,className:H,ref:T,children:O}))},je=r.forwardRef(St);je.defaultProps={shape:"circle"},je.displayName="Avatar";var be=z(76635),Ve=z.n(be),Pt=["className","style","count","overflowCount","showZero","dot","status","offsetFromTopRight","badgeStyle","children","round"],we=r.forwardRef(function(e,t){var n=e.className,a=e.style,o=e.count,i=e.overflowCount,c=e.showZero,d=e.dot,f=e.status,u=e.offsetFromTopRight,v=e.badgeStyle,h=e.children,C=e.round,y=K()(e,Pt),x=r.useContext(J),S=i===void 0?o:o>i?"".concat(i,"+"):o,j=!Ve().isNumber(S)&&Ve().isEmpty(S)||S===0&&!c,N=x.prefixCls+"-badge",w=f==="default"?"":f,T=D()(N,n,P()({},"".concat(N,"-").concat(w),w)),b=D()("".concat(N,"-count"),P()({},"".concat(N,"-round"),C)),R=u?s()({right:-parseInt(u[0],10),marginTop:u[1]},v):v;return(0,l.jsxs)("div",s()(s()({},y),{},{style:a,className:T,ref:t,children:[h,!d&&!j&&(0,l.jsx)("span",{style:R,className:b,children:S}),d&&(0,l.jsx)("span",{style:R,className:"".concat(N,"-dot")})]}))});we.defaultProps={showZero:!1,dot:!1,round:!0,status:"error",overflowCount:99},we.displayName="Badge";var le=z(34373),Ze=z(77241),ze=r.createContext("middle"),ya=function(t){var n=t.children,a=t.size,o=React.useContext(ze);return _jsx(ze.Provider,{value:a||o,children:n})},jt=ze;function bt(e){var t=e.className,n=e.direction,a=e.index,o=e.children,i=e.split,c=e.wrap,d=r.useContext(Te),f=d.horizontalSize,u=d.verticalSize,v=d.latestIndex,h={};return n==="vertical"?a<v&&(h={marginBottom:f/(i?2:1)}):h=s()(s()({},a<v&&{marginRight:f/(i?2:1)}),c&&{paddingBottom:u}),o==null?null:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:t,style:h,children:o}),a<v&&i&&(0,l.jsx)("span",{className:"".concat(t,"-split"),style:h,children:i})]})}var wt=["size","align","className","rootClassName","children","direction","prefixCls","split","style","wrap"],Te=r.createContext({latestIndex:0,horizontalSize:0,verticalSize:0}),zt={small:8,middle:16,large:24};function Tt(e){return typeof e=="string"?zt[e]:e||0}var Fe=function(t){var n=r.useContext(jt),a=r.useContext(J),o=a.prefixCls+"-space",i=t.size,c=i===void 0?n||"small":i,d=t.align,f=t.className,u=t.rootClassName,v=t.children,h=t.direction,C=h===void 0?"horizontal":h,y=t.prefixCls,x=t.split,S=t.style,j=t.wrap,N=j===void 0?!1:j,w=K()(t,wt),T=r.useMemo(function(){return(Array.isArray(c)?c:[c,c]).map(function(F){return Tt(F)})},[c]),b=ne()(T,2),R=b[0],M=b[1],p=(0,Ze.Z)(v,{keepEmpty:!0}),A=d===void 0&&C==="horizontal"?"center":d,Y=D()(o,"".concat(o,"-").concat(C),P()({},"".concat(o,"-align-").concat(A),A),f,u),W="".concat(o,"-item"),V=0,X=p.map(function(F,U){F!=null&&(V=U);var q=F&&F.key||"".concat(W,"-").concat(U);return(0,l.jsx)(bt,{className:W,direction:C,index:U,split:x,wrap:N,children:F},q)}),Q=r.useMemo(function(){return{horizontalSize:R,verticalSize:M,latestIndex:V}},[R,M,V]);if(p.length===0)return null;var Z={};return N&&(Z.flexWrap="wrap",Z.marginBottom=-M),(0,l.jsx)("div",s()(s()({className:Y,style:s()(s()({},Z),S)},w),{},{children:(0,l.jsx)(Te.Provider,{value:Q,children:X})}))},Ae=Fe;Fe.displayName="Space";var At=["size","className","disabled","href","target","onClick","children","danger","primary","icon","iconDirection"],Re=r.forwardRef(function(e,t){var n,a=e.size,o=e.className,i=e.disabled,c=e.href,d=e.target,f=e.onClick,u=e.children,v=e.danger,h=e.primary,C=e.icon,y=e.iconDirection,x=K()(e,At),S=r.useContext(J),j=S.prefixCls+"-btn-link",N=D()(j,(n={},P()(n,"".concat(j,"-").concat(a),a),P()(n,"".concat(j,"-disabled"),i),P()(n,"".concat(j,"-status-danger"),!!v),P()(n,"".concat(j,"-status-primary"),!!h),n),o),w=c&&!i?["a",{href:c,target:d}]:["div",{}],T=ne()(w,2),b=T[0],R=T[1],M=(0,l.jsxs)(Ae,{size:6,children:[C&&y==="left"?C:null,u,C&&y==="right"?C:null]});return(0,l.jsx)(b,s()(s()(s()({},x),R),{},{className:N,onClick:i?void 0:f,ref:t,children:M}))});Re.displayName="Button",Re.defaultProps={iconDirection:"left"};var Rt=["type","size","className","disabled","loading","onlyLoading","block","style","onClick","children","icon","iconDirection","withoutBorder","primary","danger","success","htmlType"],Ot=function(t,n){var a,o=t.type,i=t.size,c=t.className,d=t.disabled,f=t.loading,u=t.onlyLoading,v=t.block,h=t.style,C=t.onClick,y=t.children,x=t.icon,S=t.iconDirection,j=t.withoutBorder,N=t.primary,w=t.danger,T=t.success,b=t.htmlType,R=K()(t,Rt),M=r.useContext(J),p=M.prefixCls+"-btn",A=d||f,Y=D()(p,(a={},P()(a,"".concat(p,"-").concat(o),o),P()(a,"".concat(p,"-status-danger"),!!w),P()(a,"".concat(p,"-status-success"),!!T),P()(a,"".concat(p,"-status-primary"),!!N),P()(a,"".concat(p,"-").concat(i),i),P()(a,"".concat(p,"-disabled"),A),P()(a,"".concat(p,"-block"),v),P()(a,"".concat(p,"-without-border"),j),a),c),W=D()("".concat(p,"-container"),P()({},"".concat(p,"-container-loading"),f)),V=f?u?(0,l.jsxs)(r.Fragment,{children:[(0,l.jsx)("span",{className:"".concat(p,"-context"),children:y}),(0,l.jsx)("div",{className:"".concat(p,"-icon-wrapper"),children:(0,l.jsx)(le.Loading,{className:"".concat(p,"-icon-loading")})})]}):(0,l.jsxs)(r.Fragment,{children:[(0,l.jsx)(le.Loading,{className:"".concat(p,"-icon-loading")}),y]}):(0,l.jsxs)(Ae,{size:6,children:[x&&S==="left"?x:null,y,x&&S==="right"?x:null]});return(0,l.jsxs)("button",s()(s()({},R),{},{type:b,ref:n,disabled:A,className:Y,onClick:A?void 0:C,style:h,children:[(0,l.jsx)("span",{className:W,children:V}),(0,l.jsx)("span",{className:"".concat(p,"-bg")})]}))},Ce=r.forwardRef(Ot);Ce.displayName="Button",Ce.defaultProps={htmlType:"button",iconDirection:"left"},Ce.Link=Re;var It=["prefixCls","type","orientation","orientationMargin","className","rootClassName","children","dashed"],xe=function(t){var n,a=r.useContext(J),o=a.prefixCls+"-divider",i=t.prefixCls,c=t.type,d=c===void 0?"horizontal":c,f=t.orientation,u=f===void 0?"center":f,v=t.orientationMargin,h=t.className,C=t.rootClassName,y=t.children,x=t.dashed,S=K()(t,It),j=u.length>0?"-".concat(u):u,N=!!y,w=u==="left"&&v!=null,T=u==="right"&&v!=null,b=D()(o,"".concat(o,"-").concat(d),(n={},P()(n,"".concat(o,"-with-text"),N),P()(n,"".concat(o,"-with-text").concat(j),N),P()(n,"".concat(o,"-dashed"),!!x),P()(n,"".concat(o,"-no-default-orientation-margin-left"),w),P()(n,"".concat(o,"-no-default-orientation-margin-right"),T),n),h,C),R=s()(s()({},w&&{marginLeft:v}),T&&{marginRight:v});return(0,l.jsx)("div",s()(s()({className:b},S),{},{role:"separator",children:y&&d!=="vertical"&&(0,l.jsx)("span",{className:"".concat(o,"-inner-text"),style:R,children:y})}))};xe.displayName="Divider",xe.defaultProps={type:"horizontal",orientation:"center"};var Et=["size","disabled","className","children"],Dt=function(t,n){var a=t.size,o=t.disabled,i=t.className,c=t.children,d=K()(t,Et),f=r.useContext(J),u=f.prefixCls+"-btn-group",v=D()(u,P()({},"".concat(u,"-").concat(a),a),i),h=(0,be.isArray)(c)?c:[c];return(0,l.jsx)("div",s()(s()({},d),{},{className:v,ref:n,role:"group",children:(0,be.map)(h,function(C,y){var x;return(0,l.jsxs)(l.Fragment,{children:[(0,r.isValidElement)(C)?(0,r.cloneElement)(C,{disabled:o,size:a,withoutBorder:!0,key:(x=C.key)!==null&&x!==void 0?x:y}):C,y!==h.length-1&&(0,l.jsx)(xe,{className:"".concat(u,"-divider"),type:"vertical",style:{height:a==="small"?"24px":"32px"}})]})})}))},Ge=r.forwardRef(Dt);Ge.displayName="ButtonGroup";var Lt=z(21274),Xe=z(13302),Oe=z(20822),fe=z(77027),ue=z(12373),Mt=z(80537),Bt=z.n(Mt),$t=z(73408),Wt=z.n($t),Ht=["prefixCls","suffixCls","className","tagName"],kt=["prefixCls","className","rootClassName","children","hasSider","tagName"],Ye=r.createContext({siderHook:{addSider:function(){return null},removeSider:function(){return null}}});function pe(e){var t=e.suffixCls,n=e.tagName,a=e.displayName;return function(o){var i=r.forwardRef(function(c,d){return(0,l.jsx)(o,s()({ref:d,suffixCls:t,tagName:n},c))});return i}}var Ie=r.forwardRef(function(e,t){var n=e.prefixCls,a=e.suffixCls,o=e.className,i=e.tagName,c=K()(e,Ht),d=r.useContext(J),f=(n||d.prefixCls)+"-layout",u=a?"".concat(f,"-").concat(a):f;return(0,l.jsx)(i,s()({className:D()(u,o),ref:t},c))}),Vt=r.forwardRef(function(e,t){var n=r.useState([]),a=ne()(n,2),o=a[0],i=a[1],c=e.prefixCls,d=e.className,f=e.rootClassName,u=e.children,v=e.hasSider,h=e.tagName,C=K()(e,kt),y=(0,fe.Z)(C,["suffixCls"]),x=r.useContext(J),S=(c||x.prefixCls)+"-layout",j=D()(S,P()({},"".concat(S,"-has-sider"),typeof v=="boolean"?v:o.length>0),d,f),N=r.useMemo(function(){return{siderHook:{addSider:function(T){i(function(b){return[].concat(Wt()(b),[T])})},removeSider:function(T){i(function(b){return b.filter(function(R){return R!==T})})}}}},[]);return(0,l.jsx)(Ye.Provider,{value:N,children:(0,l.jsx)(h,s()(s()({ref:t,className:j},y),{},{children:u}))})}),Zt=pe({tagName:"section",displayName:"Layout"})(Vt),Ft=pe({suffixCls:"header",tagName:"header",displayName:"Header"})(Ie),Gt=pe({suffixCls:"footer",tagName:"footer",displayName:"Footer"})(Ie),Xt=pe({suffixCls:"content",tagName:"main",displayName:"Content"})(Ie),Yt=["prefixCls","className","trigger","children","defaultCollapsed","theme","style","collapsible","reverseArrow","width","collapsedWidth","zeroWidthTriggerStyle","breakpoint","onCollapse","onBreakpoint"],Qe={xs:"479.98px",sm:"575.98px",md:"767.98px",lg:"991.98px",xl:"1199.98px",xxl:"1599.98px"},Ee=r.createContext({}),Qt=function(){var e=0;return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return e+=1,"".concat(t).concat(e)}}(),Je=r.forwardRef(function(e,t){var n=e.prefixCls,a=e.className,o=e.trigger,i=e.children,c=e.defaultCollapsed,d=c===void 0?!1:c,f=e.theme,u=f===void 0?"dark":f,v=e.style,h=v===void 0?{}:v,C=e.collapsible,y=C===void 0?!1:C,x=e.reverseArrow,S=x===void 0?!1:x,j=e.width,N=j===void 0?200:j,w=e.collapsedWidth,T=w===void 0?80:w,b=e.zeroWidthTriggerStyle,R=e.breakpoint,M=e.onCollapse,p=e.onBreakpoint,A=K()(e,Yt),Y=(0,r.useContext)(Ye),W=Y.siderHook,V=(0,r.useState)("collapsed"in A?A.collapsed:d),X=ne()(V,2),Q=X[0],Z=X[1],F=(0,r.useState)(!1),U=ne()(F,2),q=U[0],ie=U[1];(0,r.useEffect)(function(){"collapsed"in A&&Z(A.collapsed)},[A.collapsed]);var oe=function(L,E){"collapsed"in A||Z(L),M==null||M(L,E)},_=(0,r.useRef)();_.current=function(I){ie(I.matches),p==null||p(I.matches),Q!==I.matches&&oe(I.matches,"responsive")},(0,r.useEffect)(function(){function I(m){return _.current(m)}var L;if(typeof window!="undefined"){var E=window,g=E.matchMedia;if(g&&R&&R in Qe){L=g("(max-width: ".concat(Qe[R],")"));try{L.addEventListener("change",I)}catch(m){L.addListener(I)}I(L)}}return function(){try{var m;(m=L)===null||m===void 0||m.removeEventListener("change",I)}catch(k){var $;($=L)===null||$===void 0||$.removeListener(I)}}},[R]),(0,r.useEffect)(function(){var I=Qt("metro-sider-");return W.addSider(I),function(){return W.removeSider(I)}},[]);var ae=function(){oe(!Q,"clickTrigger")},B=(0,r.useContext)(J),H=function(){var L,E=(n||B.prefixCls)+"-layout-sider",g=(0,fe.Z)(A,["collapsed"]),m=Q?T:N,$=Bt()(m)?"".concat(m,"px"):String(m),k=parseFloat(String(T||0))===0?(0,l.jsx)("span",{onClick:ae,className:D()("".concat(E,"-zero-width-trigger"),"".concat(E,"-zero-width-trigger-").concat(S?"right":"left")),style:b,children:o||(0,l.jsx)(le.FormatListBulleted,{})}):null,re={expanded:S?(0,l.jsx)(le.ChevronRight,{}):(0,l.jsx)(le.ChevronLeft,{}),collapsed:S?(0,l.jsx)(le.ChevronLeft,{}):(0,l.jsx)(le.ChevronRight,{})},G=Q?"collapsed":"expanded",te=re[G],ee=o!==null?k||(0,l.jsx)("div",{className:"".concat(E,"-trigger"),onClick:ae,style:{width:$},children:o||te}):null,se=s()(s()({},h),{},{flex:"0 0 ".concat($),maxWidth:$,minWidth:$,width:$}),Ca=D()(E,"".concat(E,"-").concat(u),(L={},P()(L,"".concat(E,"-collapsed"),!!Q),P()(L,"".concat(E,"-has-trigger"),y&&o!==null&&!k),P()(L,"".concat(E,"-below"),!!q),P()(L,"".concat(E,"-zero-width"),parseFloat($)===0),L),a);return(0,l.jsxs)("aside",s()(s()({className:Ca},g),{},{style:se,ref:t,children:[(0,l.jsx)("div",{className:"".concat(E,"-children"),children:i}),y||q&&k?ee:null]}))},O=r.useMemo(function(){return{siderCollapsed:Q}},[Q]);return(0,l.jsx)(Ee.Provider,{value:O,children:H()})});Je.displayName="Sider";var De=function(){return{height:0,opacity:0}},Ue=function(t){var n=t.scrollHeight;return{height:n,opacity:1}},Jt=function(t){return{height:t?t.offsetHeight:0}},Le=function(t,n){return(n==null?void 0:n.deadline)===!0||n.propertyName==="height"},Ut=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"metro";return{motionName:"".concat(t,"-motion-collapse"),onAppearStart:De,onEnterStart:De,onAppearActive:Ue,onEnterActive:Ue,onLeaveStart:Jt,onLeaveActive:De,onAppearEnd:Le,onEnterEnd:Le,onLeaveEnd:Le,motionDeadline:500}},Na=null,Sa=function(t){return t!==void 0&&(t==="topLeft"||t==="topRight")?"slide-down":"slide-up"},Pa=function(t,n,a){return a!==void 0?a:"".concat(t,"-").concat(n)},Kt=Ut,ce=r.isValidElement;function Ke(e){return e&&ce(e)&&e.type===r.Fragment}function qt(e,t,n){return ce(e)?r.cloneElement(e,typeof n=="function"?n(e.props||{}):n):t}function de(e,t){return qt(e,e,t)}var _t=z(67425),Me=z.n(_t),ea=["prefixCls","className","dashed"],qe=function(t){var n=t.prefixCls,a=t.className,o=t.dashed,i=K()(t,ea),c=r.useContext(J),d=(n||c.prefixCls)+"-menu",f=D()(P()({},"".concat(d,"-item-divider-dashed"),!!o),a);return(0,l.jsx)(ue.iz,s()({className:f},i))},_e=z(73623),ta=z(42233),aa={adjustX:1,adjustY:1},et={adjustX:0,adjustY:0},na=[0,0],tt=function(t){return typeof t=="boolean"?t?aa:et:s()(s()({},et),t)},ra=function(t){var n=t.arrowWidth,a=n===void 0?8:n,o=t.horizontalArrowShift,i=o===void 0?16:o,c=t.verticalArrowShift,d=c===void 0?8:c,f=t.autoAdjustOverflow,u={left:{points:["cr","cl"],offset:[-4,0]},right:{points:["cl","cr"],offset:[4,0]},top:{points:["bc","tc"],offset:[0,-4]},bottom:{points:["tc","bc"],offset:[0,4]},topLeft:{points:["bl","tc"],offset:[-(i+a),-4]},leftTop:{points:["tr","cl"],offset:[-4,-(d+a)]},topRight:{points:["br","tc"],offset:[i+a,-4]},rightTop:{points:["tl","cr"],offset:[4,-(d+a)]},bottomRight:{points:["tr","bc"],offset:[i+a,4]},rightBottom:{points:["bl","cr"],offset:[4,d+a]},bottomLeft:{points:["tl","bc"],offset:[-(i+a),4]},leftBottom:{points:["br","cl"],offset:[-4,d+a]}};return Object.keys(u).forEach(function(v){u[v]=t.arrowPointAtCenter?s()(s()({},u[v]),{},{overflow:tt(f),targetOffset:na}):s()(s()({},ta.Ct[v]),{},{overflow:tt(f)}),u[v].ignoreShake=!0}),u},Be=ra,ia=["getPopupContainer","placement","mouseEnterDelay","mouseLeaveDelay","overlayStyle","rootClassName"],oa=function(t,n){var a={},o=s()({},t);return n.forEach(function(i){t&&i in t&&(a[i]=t[i],delete o[i])}),{picked:a,omitted:o}};function la(e,t){if(e.type==="button"&&e.props.disabled){var n=oa(e.props.style,["position","left","right","top","bottom","float","display","zIndex"]),a=n.picked,o=n.omitted,i=s()(s()({display:"inline-block"},a),{},{cursor:"not-allowed",width:e.props.block?"100%":void 0}),c=s()(s()({},o),{},{pointerEvents:"none"}),d=de(e,{style:c,className:null});return(0,l.jsx)("span",{style:i,className:D()(e.props.className,"".concat(t,"-disabled-compatible-wrapper")),children:d})}return e}var $e=r.forwardRef(function(e,t){var n=e.prefixCls,a=e.openClassName,o=e.getTooltipContainer,i=e.overlayClassName,c=e.overlayInnerStyle,d=e.children,f=e.afterOpenChange,u=e.destroyTooltipOnHide,v=e.arrow,h=v===void 0?!0:v,C=!!h,y=r.useContext(J),x=r.useRef(null),S=function(){var g;(g=x.current)===null||g===void 0||g.forceAlign()};r.useImperativeHandle(t,function(){return{forceAlign:S}});var j=(0,Oe.Z)(!1,{value:e.open,defaultValue:e.defaultOpen}),N=ne()(j,2),w=N[0],T=N[1],b=function(){var g=e.title,m=e.overlay;return!g&&!m&&g!==0},R=function(g){if(T(b()?!1:g),!b()){var m;(m=e.onOpenChange)===null||m===void 0||m.call(e,g)}},M=function(){var g=e.builtinPlacements,m=e.arrowPointAtCenter,$=m===void 0?!1:m,k=e.autoAdjustOverflow,re=k===void 0?!0:k,G=$;if(Me()(h)==="object"){var te,ee;G=(te=(ee=h.pointAtCenter)!==null&&ee!==void 0?ee:h.arrowPointAtCenter)!==null&&te!==void 0?te:$}return g||Be({arrowPointAtCenter:G,autoAdjustOverflow:re})},p=function(g,m){var $=M(),k=Object.keys($).find(function(te){var ee,se;return $[te].points[0]===((ee=m.points)===null||ee===void 0?void 0:ee[0])&&$[te].points[1]===((se=m.points)===null||se===void 0?void 0:se[1])});if(k){var re=g.getBoundingClientRect(),G={top:"50%",left:"50%"};/top|Bottom/.test(k)?G.top="".concat(re.height-m.offset[1],"px"):/Top|bottom/.test(k)&&(G.top="".concat(-m.offset[1],"px")),/left|Right/.test(k)?G.left="".concat(re.width-m.offset[0],"px"):/right|Left/.test(k)&&(G.left="".concat(-m.offset[0],"px")),g.style.transformOrigin="".concat(G.left," ").concat(G.top)}},A=function(){var g=e.title,m=e.overlay;return g===0?g:m||g||""},Y=e.getPopupContainer,W=e.placement,V=W===void 0?"top":W,X=e.mouseEnterDelay,Q=X===void 0?.1:X,Z=e.mouseLeaveDelay,F=Z===void 0?.1:Z,U=e.overlayStyle,q=e.rootClassName,ie=K()(e,ia),oe=n||y.prefixCls,_=oe+"-tooltip",ae=w;!("open"in e)&&b()&&(ae=!1);var B=la(ce(d)&&!Ke(d)?d:(0,l.jsx)("span",{children:d}),_),H=B.props,O=!H.className||typeof H.className=="string"?D()(H.className,P()({},a||"".concat(_,"-open"),!0)):H.className,I=s()({},c),L=D()(i,q);return(0,l.jsx)(_e.Z,s()(s()({},ie),{},{showArrow:C,placement:V,mouseEnterDelay:Q,mouseLeaveDelay:F,prefixCls:_,overlayClassName:L,overlayStyle:s()({},U),getTooltipContainer:Y||o,ref:x,builtinPlacements:M(),overlay:A(),visible:ae,onVisibleChange:R,afterVisibleChange:f,onPopupAlign:p,overlayInnerStyle:I,arrowContent:(0,l.jsx)("span",{className:"".concat(_,"-arrow-content")}),destroyTooltipOnHide:!!u,children:ae?de(B,{className:O}):B}))});$e.displayName="Tooltip";var sa=["getPopupContainer","placement","mouseEnterDelay","mouseLeaveDelay","overlayStyle","rootClassName"],ca=function(t,n){var a={},o=s()({},t);return n.forEach(function(i){t&&i in t&&(a[i]=t[i],delete o[i])}),{picked:a,omitted:o}};function da(e,t){if(e.type==="button"&&e.props.disabled){var n=ca(e.props.style,["position","left","right","top","bottom","float","display","zIndex"]),a=n.picked,o=n.omitted,i=s()(s()({display:"inline-block"},a),{},{cursor:"not-allowed",width:e.props.block?"100%":void 0}),c=s()(s()({},o),{},{pointerEvents:"none"}),d=de(e,{style:c,className:null});return(0,l.jsx)("span",{style:i,className:D()(e.props.className,"".concat(t,"-disabled-compatible-wrapper")),children:d})}return e}var at=r.forwardRef(function(e,t){var n=e.prefixCls,a=e.openClassName,o=e.getTooltipContainer,i=e.overlayClassName,c=e.overlayInnerStyle,d=e.children,f=e.afterOpenChange,u=e.destroyTooltipOnHide,v=e.arrow,h=v===void 0?!0:v,C=!!h,y=r.useContext(J),x=r.useRef(null),S=function(){var g;(g=x.current)===null||g===void 0||g.forceAlign()};r.useImperativeHandle(t,function(){return{forceAlign:S}});var j=(0,Oe.Z)(!1,{value:e.open,defaultValue:e.defaultOpen}),N=ne()(j,2),w=N[0],T=N[1],b=function(){var g=e.title,m=e.overlay;return!g&&!m&&g!==0},R=function(g){if(T(b()?!1:g),!b()){var m;(m=e.onOpenChange)===null||m===void 0||m.call(e,g)}},M=function(){var g=e.builtinPlacements,m=e.arrowPointAtCenter,$=m===void 0?!1:m,k=e.autoAdjustOverflow,re=k===void 0?!0:k,G=$;if(Me()(h)==="object"){var te,ee;G=(te=(ee=h.pointAtCenter)!==null&&ee!==void 0?ee:h.arrowPointAtCenter)!==null&&te!==void 0?te:$}return g||Be({arrowPointAtCenter:G,autoAdjustOverflow:re})},p=function(g,m){var $=M(),k=Object.keys($).find(function(te){var ee,se;return $[te].points[0]===((ee=m.points)===null||ee===void 0?void 0:ee[0])&&$[te].points[1]===((se=m.points)===null||se===void 0?void 0:se[1])});if(k){var re=g.getBoundingClientRect(),G={top:"50%",left:"50%"};/top|Bottom/.test(k)?G.top="".concat(re.height-m.offset[1],"px"):/Top|bottom/.test(k)&&(G.top="".concat(-m.offset[1],"px")),/left|Right/.test(k)?G.left="".concat(re.width-m.offset[0],"px"):/right|Left/.test(k)&&(G.left="".concat(-m.offset[0],"px")),g.style.transformOrigin="".concat(G.left," ").concat(G.top)}},A=function(){var g=e.title,m=e.overlay;return g===0?g:m||g||""},Y=e.getPopupContainer,W=e.placement,V=W===void 0?"top":W,X=e.mouseEnterDelay,Q=X===void 0?.1:X,Z=e.mouseLeaveDelay,F=Z===void 0?.1:Z,U=e.overlayStyle,q=e.rootClassName,ie=K()(e,sa),oe=n||y.prefixCls,_=oe+"-tooltip",ae=w;!("open"in e)&&b()&&(ae=!1);var B=da(ce(d)&&!Ke(d)?d:(0,l.jsx)("span",{children:d}),_),H=B.props,O=!H.className||typeof H.className=="string"?D()(H.className,P()({},a||"".concat(_,"-open"),!0)):H.className,I=s()({},c),L=D()(i,q);return(0,l.jsx)(_e.Z,s()(s()({},ie),{},{showArrow:C,placement:V,mouseEnterDelay:Q,mouseLeaveDelay:F,prefixCls:_,overlayClassName:L,overlayStyle:s()({},U),getTooltipContainer:Y||o,ref:x,builtinPlacements:M(),overlay:A(),visible:ae,onVisibleChange:R,afterVisibleChange:f,onPopupAlign:p,overlayInnerStyle:I,arrowContent:(0,l.jsx)("span",{className:"".concat(_,"-arrow-content")}),destroyTooltipOnHide:!!u,children:ae?de(B,{className:O}):B}))});at.displayName="Tooltip";var nt=function(t){var n=t.text,a=t.className,o=t.placement,i=(0,r.useContext)(J),c=i.prefixCls+"-tooltip-text",d=(0,r.useRef)(null),f=(0,r.useState)(!1),u=ne()(f,2),v=u[0],h=u[1];(0,r.useEffect)(function(){var y=d.current,x=y.parentElement.getBoundingClientRect().width,S=y.getBoundingClientRect().width;h(S>x)},[]);var C=(0,l.jsx)("div",{className:"".concat(c," ").concat(a||""),children:(0,l.jsx)("span",{ref:d,children:n})});return v?(0,l.jsx)(at,{title:n,placement:o,children:C}):C};nt.displayName="TooltipText";var ye=(0,r.createContext)({prefixCls:"",firstLevel:!0,inlineCollapsed:!1}),rt=function(t){var n,a,o=t.className,i=t.children,c=t.icon,d=t.title,f=t.danger,u=r.useContext(ye),v=u.prefixCls,h=u.firstLevel,C=u.disableMenuItemTitleTooltip,y=u.inlineCollapsed,x=function(M){var p=(0,l.jsx)("span",{className:"".concat(v,"-title-content"),children:i});return(!c||ce(i)&&i.type==="span")&&i&&M&&h&&typeof i=="string"?(0,l.jsx)("div",{className:"".concat(v,"-inline-collapsed-noicon"),children:i.charAt(0)}):p},S=r.useContext(Ee),j=S.siderCollapsed,N=d;typeof d=="undefined"?N=h?i:"":d===!1&&(N="");var w={title:N};!j&&!y&&(w.title=null,w.open=!1);var T=(0,Ze.Z)(i).length,b=(0,l.jsxs)(ue.ck,s()(s()({},(0,fe.Z)(t,["title","icon","danger"])),{},{className:D()((n={},P()(n,"".concat(v,"-item-danger"),f),P()(n,"".concat(v,"-item-only-child"),(c?T+1:T)===1),n),o),title:typeof d=="string"?d:void 0,children:[de(c,{className:D()(ce(c)?(a=c.props)===null||a===void 0?void 0:a.className:"","".concat(v,"-item-icon"))}),x(y)]}));return C||(b=(0,l.jsx)($e,s()(s()({},w),{},{overlayClassName:"".concat(v,"-inline-collapsed-tooltip"),children:b}))),b},it=function(t){var n=t.popupClassName,a=t.icon,o=t.title,i=r.useContext(ye),c=i.prefixCls,d=i.inlineCollapsed,f=i.mode,u=(0,ue.Xl)(),v;if(!a)v=d&&!u.length&&o&&typeof o=="string"?(0,l.jsx)("div",{className:"".concat(c,"-inline-collapsed-noicon"),children:o.charAt(0)}):(0,l.jsx)("span",{className:"".concat(c,"-title-content"),children:o});else{var h,C=ce(o)&&o.type==="span";v=(0,l.jsxs)(l.Fragment,{children:[de(a,{className:D()(ce(a)?(h=a.props)===null||h===void 0?void 0:h.className:"","".concat(c,"-item-icon"))}),C?o:(0,l.jsx)("span",{className:"".concat(c,"-title-content"),children:o})]})}var y=r.useMemo(function(){return s()(s()({},i),{},{firstLevel:!1})},[i]),x=f==="horizontal"?[0,8]:[10,0];return(0,l.jsx)(ye.Provider,{value:y,children:(0,l.jsx)(ue.Wd,s()(s()({popupOffset:x},(0,fe.Z)(t,["icon"])),{},{title:v,popupClassName:D()(c,n)}))})},ua=["label","children","key","type"];function We(e){return(e||[]).map(function(t,n){if(t&&Me()(t)==="object"){var a=t,o=a.label,i=a.children,c=a.key,d=a.type,f=K()(a,ua),u=c!=null?c:"tmp-".concat(n);return i||d==="group"?d==="group"?(0,l.jsx)(ue.BW,s()(s()({},f),{},{title:o,children:We(i)}),u):(0,l.jsx)(it,s()(s()({},f),{},{title:o,children:We(i)}),u):d==="divider"?(0,l.jsx)(qe,s()({},f),u):(0,l.jsx)(rt,s()(s()({},f),{},{children:o}),u)}return null}).filter(function(t){return t})}function va(e){return r.useMemo(function(){return e&&We(e)},[e])}var fa=["children"],Ne=r.createContext(null),ma=function(t){var n=t.children,a=K()(t,fa),o=r.useContext(Ne),i=r.useMemo(function(){return s()(s()({},o),a)},[o,a.prefixCls,a.mode,a.selectable]);return(0,l.jsx)(Ne.Provider,{value:i,children:n})},ha=["prefixCls","className","expandIcon","_internalDisableMenuItemTitleTooltip","inlineCollapsed","siderCollapsed","items","children","mode","selectable","onClick"],ga=(0,r.forwardRef)(function(e,t){var n=r.useContext(Ne),a=n||{},o=r.useContext(J),i=o.prefixCls,c=e.prefixCls,d=e.className,f=e.expandIcon,u=e._internalDisableMenuItemTitleTooltip,v=e.inlineCollapsed,h=e.siderCollapsed,C=e.items,y=e.children,x=e.mode,S=e.selectable,j=e.onClick,N=K()(e,ha),w=(0,fe.Z)(N,["collapsedWidth"]),T=va(C)||y,b=(0,Xe.default)(function(){for(var Z,F=arguments.length,U=new Array(F),q=0;q<F;q++)U[q]=arguments[q];j==null||j.apply(void 0,U),(Z=a.onClick)===null||Z===void 0||Z.call(a)}),R=a.mode||x,M=S!=null?S:a.selectable,p=r.useMemo(function(){return h!==void 0?h:v},[v,h]),A={horizontal:{motionName:"".concat(i,"-slide-up")},inline:Kt(i),other:{motionName:"".concat(i,"-zoom-big")}},Y=(c||a.prefixCls||i)+"-menu",W;if(typeof f=="function")W=f;else{var V,X=f||a.expandIcon;W=de(X,{className:D()("".concat(Y,"-submenu-expand-icon"),X==null||(V=X.props)===null||V===void 0?void 0:V.className)})}var Q=r.useMemo(function(){return{prefixCls:Y,inlineCollapsed:p||!1,firstLevel:!0,mode:R,disableMenuItemTitleTooltip:u}},[Y,p,u]);return(0,l.jsx)(Ne.Provider,{value:null,children:(0,l.jsx)(ye.Provider,{value:Q,children:(0,l.jsx)(ue.ZP,s()(s()({overflowedIndicator:(0,l.jsx)(le.MoreHorizontal,{}),mode:R,selectable:M,onClick:b},w),{},{inlineCollapsed:p,className:d,prefixCls:Y,defaultMotions:A,expandIcon:W,ref:t,children:T}))})})}),ve=(0,r.forwardRef)(function(e,t){var n=(0,r.useRef)(null),a=r.useContext(Ee);return(0,r.useImperativeHandle)(t,function(){return{menu:n.current,focus:function(i){var c;(c=n.current)===null||c===void 0||c.focus(i)}}}),(0,l.jsx)(ga,s()(s()({ref:n},e),a))});ve.Item=rt,ve.SubMenu=it,ve.Divider=qe,ve.ItemGroup=ue.BW,ve.displayName="Menu";var ja=null,He=function(t){var n=r.useContext(J),a=function(H){var O=t.placement,I=O===void 0?"":O,L=t.transitionName;return L!==void 0?L:I.includes("top")?"".concat(H,"-slide-down"):"".concat(H,"-slide-up")},o=function(){var H=t.placement,O=H===void 0?"bottomLeft":H;if(O.includes("Center")){var I=O.slice(0,O.indexOf("Center"));return I}return O},i=t.menu,c=t.arrow,d=t.prefixCls,f=t.children,u=t.trigger,v=t.disabled,h=t.dropdownRender,C=t.getPopupContainer,y=t.overlayClassName,x=t.rootClassName,S=t.open,j=t.onOpenChange,N=t.mouseEnterDelay,w=N===void 0?.15:N,T=t.mouseLeaveDelay,b=T===void 0?.1:T,R=t.autoAdjustOverflow,M=R===void 0?!0:R,p=d||n.prefixCls,A=p+"-dropdown",Y=r.Children.only(f),W=de(Y,{className:D()("".concat(A,"-trigger"),Y.props.className),disabled:v}),V=v?[]:u,X;V&&V.includes("contextMenu")&&(X=!0);var Q=(0,Oe.Z)(!1,{value:S}),Z=ne()(Q,2),F=Z[0],U=Z[1],q=(0,Xe.default)(function(B){j==null||j(B),U(B)}),ie=D()(y,x),oe=Be({autoAdjustOverflow:M,arrowWidth:c?16:0}),_=r.useCallback(function(){U(!1)},[]),ae=function(){var H=t.overlay,O;if(i!=null&&i.items){var I={};C&&(I.getPopupContainer=C);var L=s()(s()({},I),i);O=(0,l.jsx)(ve,s()({},L))}else typeof H=="function"?O=H():O=H;return h&&(O=h(O)),O=r.Children.only(typeof O=="string"?(0,l.jsx)("span",{children:O}):O),(0,l.jsx)(ma,{prefixCls:"".concat(A),expandIcon:(0,l.jsx)("span",{className:"".concat(A,"-menu-submenu-arrow"),children:(0,l.jsx)(le.ChevronRight,{className:"".concat(A,"-menu-submenu-arrow-icon")})}),mode:"vertical",selectable:!1,onClick:_,children:O})};return(0,l.jsx)(Lt.Z,s()(s()({alignPoint:X},(0,fe.Z)(t,["rootClassName"])),{},{mouseEnterDelay:w,mouseLeaveDelay:b,visible:F,builtinPlacements:oe,arrow:!!c,overlayClassName:ie,prefixCls:A,getPopupContainer:C,transitionName:a(p),trigger:V,overlay:ae,placement:o(),onVisibleChange:q,children:W}))};He.defaultProps={},He.displayName="Dropdown";var he=Zt;he.Header=Ft,he.Footer=Gt,he.Content=Xt,he.Sider=Je}}]);