You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/11447.785de12f.async.js

1 line
23 KiB

"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[11447,79817],{680:function(e,t,o){o.d(t,{Z:function(){return s}});var n=o(5891),r=o(59301),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 688a48 48 0 1096 0 48 48 0 10-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z"}}]},name:"exclamation-circle",theme:"outlined"},l=o(22589),a=function(e,t){return r.createElement(l.Z,(0,n.Z)({},e,{ref:t,icon:i}))};var s=r.forwardRef(a)},37120:function(e,t,o){o.d(t,{Z:function(){return s}});var n=o(5891),r=o(59301),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M872 474H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h720c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}}]},name:"minus",theme:"outlined"},l=o(22589),a=function(e,t){return r.createElement(l.Z,(0,n.Z)({},e,{ref:t,icon:i}))};var s=r.forwardRef(a)},27666:function(e,t,o){var n=o(26390),r=o(71783);t.Z=function(e){let t;const o=o=>()=>{t=null,e.apply(void 0,(0,n.Z)(o))},i=function(){if(null==t){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];t=(0,r.Z)(o(n))}};return i.cancel=()=>{r.Z.cancel(t),t=null},i}},81228:function(e,t,o){o.d(t,{Z:function(){return E}});var n=o(79545),r=o(68550),i=o(17928),l=o(99487),a=o(59301),s=o(92310),c=o.n(s),d=o(28647),u=o(55405),p=o(27666),f=o(36355),g=o(83116),m=o(37613);const h=e=>{const{componentCls:t}=e;return{[t]:{position:"fixed",zIndex:e.zIndexPopup}}};var v=(0,g.Z)("Affix",(e=>{const t=(0,m.TS)(e,{zIndexPopup:e.zIndexBase+10});return[h(t)]}));function b(e){return e!==window?e.getBoundingClientRect():{top:0,bottom:window.innerHeight}}function C(e,t,o){if(void 0!==o&&t.top>e.top-o)return o+t.top}function y(e,t,o){if(void 0!==o&&t.bottom<e.bottom+o){return o+(window.innerHeight-t.bottom)}}const $=["resize","scroll","touchstart","touchmove","touchend","pageshow","load"];function k(){return"undefined"!=typeof window?window:null}var x;!function(e){e[e.None=0]="None",e[e.Prepare=1]="Prepare"}(x||(x={}));let S=function(e){(0,i.Z)(o,e);var t=(0,l.Z)(o);function o(){var e;return(0,n.Z)(this,o),(e=t.apply(this,arguments)).state={status:x.None,lastAffix:!1,prevTarget:null},e.placeholderNodeRef=(0,a.createRef)(),e.fixedNodeRef=(0,a.createRef)(),e.addListeners=()=>{const t=e.getTargetFunc(),o=null==t?void 0:t(),{prevTarget:n}=e.state;n!==o&&($.forEach((t=>{null==n||n.removeEventListener(t,e.lazyUpdatePosition),null==o||o.addEventListener(t,e.lazyUpdatePosition)})),e.updatePosition(),e.setState({prevTarget:o}))},e.removeListeners=()=>{e.timer&&(clearTimeout(e.timer),e.timer=null);const{prevTarget:t}=e.state,o=e.getTargetFunc(),n=null==o?void 0:o();$.forEach((o=>{null==n||n.removeEventListener(o,e.lazyUpdatePosition),null==t||t.removeEventListener(o,e.lazyUpdatePosition)})),e.updatePosition.cancel(),e.lazyUpdatePosition.cancel()},e.getOffsetTop=()=>{const{offsetBottom:t,offsetTop:o}=e.props;return void 0===t&&void 0===o?0:o},e.getOffsetBottom=()=>e.props.offsetBottom,e.measure=()=>{const{status:t,lastAffix:o}=e.state,{onChange:n}=e.props,r=e.getTargetFunc();if(t!==x.Prepare||!e.fixedNodeRef.current||!e.placeholderNodeRef.current||!r)return;const i=e.getOffsetTop(),l=e.getOffsetBottom(),a=r();if(a){const t={status:x.None},r=b(e.placeholderNodeRef.current);if(0===r.top&&0===r.left&&0===r.width&&0===r.height)return;const s=b(a),c=C(r,s,i),d=y(r,s,l);void 0!==c?(t.affixStyle={position:"fixed",top:c,width:r.width,height:r.height},t.placeholderStyle={width:r.width,height:r.height}):void 0!==d&&(t.affixStyle={position:"fixed",bottom:d,width:r.width,height:r.height},t.placeholderStyle={width:r.width,height:r.height}),t.lastAffix=!!t.affixStyle,n&&o!==t.lastAffix&&n(t.lastAffix),e.setState(t)}},e.prepareMeasure=()=>{e.setState({status:x.Prepare,affixStyle:void 0,placeholderStyle:void 0})},e.updatePosition=(0,p.Z)((()=>{e.prepareMeasure()})),e.lazyUpdatePosition=(0,p.Z)((()=>{const t=e.getTargetFunc(),{affixStyle:o}=e.state;if(t&&o){const n=e.getOffsetTop(),r=e.getOffsetBottom(),i=t();if(i&&e.placeholderNodeRef.current){const t=b(i),l=b(e.placeholderNodeRef.current),a=C(l,t,n),s=y(l,t,r);if(void 0!==a&&o.top===a||void 0!==s&&o.bottom===s)return}}e.prepareMeasure()})),e}return(0,r.Z)(o,[{key:"getTargetFunc",value:function(){const{getTargetContainer:e}=this.context,{target:t}=this.props;return void 0!==t?t:null!=e?e:k}},{key:"componentDidMount",value:function(){this.timer=setTimeout(this.addListeners)}},{key:"componentDidUpdate",value:function(e){this.addListeners(),e.offsetTop===this.props.offsetTop&&e.offsetBottom===this.props.offsetBottom||this.updatePosition(),this.measure()}},{key:"componentWillUnmount",value:function(){this.removeListeners()}},{key:"render",value:function(){const{affixStyle:e,placeholderStyle:t}=this.state,{affixPrefixCls:o,rootClassName:n,children:r}=this.props,i=c()(e&&n,{[o]:!!e});let l=(0,u.Z)(this.props,["prefixCls","offsetTop","offsetBottom","target","onChange","affixPrefixCls","rootClassName"]);return a.createElement(d.Z,{onResize:this.updatePosition},a.createElement("div",Object.assign({},l,{ref:this.placeholderNodeRef}),e&&a.createElement("div",{style:t,"aria-hidden":"true"}),a.createElement("div",{className:i,ref:this.fixedNodeRef,style:e},a.createElement(d.Z,{onResize:this.updatePosition},r))))}}]),o}(a.Component);S.contextType=f.E_;var E=(0,a.forwardRef)(((e,t)=>{const{prefixCls:o,rootClassName:n}=e,{getPrefixCls:r}=(0,a.useContext)(f.E_),i=r("affix",o),[l,s]=v(i),d=Object.assign(Object.assign({},e),{affixPrefixCls:i,rootClassName:c()(n,s)});return l(a.createElement(S,Object.assign({},d,{ref:t})))}))},46400:function(e,t,o){o.d(t,{Z:function(){return j}});var n=o(80559),r=o(58670),i=o(51638),l=o(54745),a=o(31855),s=o(92310),c=o.n(s),d=o(43167),u=o(47413),p=o(59301),f=o(92343),g=o(36355),m=o(17313),h=o(83116);const v=(e,t,o,n,r)=>({backgroundColor:e,border:`${n.lineWidth}px ${n.lineType} ${t}`,[`${r}-icon`]:{color:o}}),b=e=>{const{componentCls:t,motionDurationSlow:o,marginXS:n,marginSM:r,fontSize:i,fontSizeLG:l,lineHeight:a,borderRadiusLG:s,motionEaseInOutCirc:c,withDescriptionIconSize:d,colorText:u,colorTextHeading:p,withDescriptionPadding:f,defaultPadding:g}=e;return{[t]:Object.assign(Object.assign({},(0,m.Wf)(e)),{position:"relative",display:"flex",alignItems:"center",padding:g,wordWrap:"break-word",borderRadius:s,[`&${t}-rtl`]:{direction:"rtl"},[`${t}-content`]:{flex:1,minWidth:0},[`${t}-icon`]:{marginInlineEnd:n,lineHeight:0},"&-description":{display:"none",fontSize:i,lineHeight:a},"&-message":{color:p},[`&${t}-motion-leave`]:{overflow:"hidden",opacity:1,transition:`max-height ${o} ${c}, opacity ${o} ${c},\n padding-top ${o} ${c}, padding-bottom ${o} ${c},\n margin-bottom ${o} ${c}`},[`&${t}-motion-leave-active`]:{maxHeight:0,marginBottom:"0 !important",paddingTop:0,paddingBottom:0,opacity:0}}),[`${t}-with-description`]:{alignItems:"flex-start",padding:f,[`${t}-icon`]:{marginInlineEnd:r,fontSize:d,lineHeight:0},[`${t}-message`]:{display:"block",marginBottom:n,color:p,fontSize:l},[`${t}-description`]:{display:"block",color:u}},[`${t}-banner`]:{marginBottom:0,border:"0 !important",borderRadius:0}}},C=e=>{const{componentCls:t,colorSuccess:o,colorSuccessBorder:n,colorSuccessBg:r,colorWarning:i,colorWarningBorder:l,colorWarningBg:a,colorError:s,colorErrorBorder:c,colorErrorBg:d,colorInfo:u,colorInfoBorder:p,colorInfoBg:f}=e;return{[t]:{"&-success":v(r,n,o,e,t),"&-info":v(f,p,u,e,t),"&-warning":v(a,l,i,e,t),"&-error":Object.assign(Object.assign({},v(d,c,s,e,t)),{[`${t}-description > pre`]:{margin:0,padding:0}})}}},y=e=>{const{componentCls:t,iconCls:o,motionDurationMid:n,marginXS:r,fontSizeIcon:i,colorIcon:l,colorIconHover:a}=e;return{[t]:{"&-action":{marginInlineStart:r},[`${t}-close-icon`]:{marginInlineStart:r,padding:0,overflow:"hidden",fontSize:i,lineHeight:`${i}px`,backgroundColor:"transparent",border:"none",outline:"none",cursor:"pointer",[`${o}-close`]:{color:l,transition:`color ${n}`,"&:hover":{color:a}}},"&-close-text":{color:l,transition:`color ${n}`,"&:hover":{color:a}}}}},$=e=>[b(e),C(e),y(e)];var k=(0,h.Z)("Alert",(e=>[$(e)]),(e=>({withDescriptionIconSize:e.fontSizeHeading3,defaultPadding:`${e.paddingContentVerticalSM}px 12px`,withDescriptionPadding:`${e.paddingMD}px ${e.paddingContentHorizontalLG}px`}))),x=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(o[n[r]]=e[n[r]])}return o};const S={success:n.Z,info:a.Z,error:r.Z,warning:l.Z},E=e=>{const{icon:t,prefixCls:o,type:n}=e,r=S[n]||null;return t?(0,f.wm)(t,p.createElement("span",{className:`${o}-icon`},t),(()=>({className:c()(`${o}-icon`,{[t.props.className]:t.props.className})}))):p.createElement(r,{className:`${o}-icon`})},w=e=>{const{isClosable:t,prefixCls:o,closeIcon:n,handleClose:r}=e,l=!0===n||void 0===n?p.createElement(i.Z,null):n;return t?p.createElement("button",{type:"button",onClick:r,className:`${o}-close-icon`,tabIndex:0},l):null};var O=e=>{const{description:t,prefixCls:o,message:n,banner:r,className:i,rootClassName:l,style:a,onMouseEnter:s,onMouseLeave:f,onClick:m,afterClose:h,showIcon:v,closable:b,closeText:C,closeIcon:y,action:$}=e,S=x(e,["description","prefixCls","message","banner","className","rootClassName","style","onMouseEnter","onMouseLeave","onClick","afterClose","showIcon","closable","closeText","closeIcon","action"]),[O,N]=p.useState(!1);const P=p.useRef(null),{getPrefixCls:B,direction:T,alert:I}=p.useContext(g.E_),z=B("alert",o),[Z,j]=k(z),L=t=>{var o;N(!0),null===(o=e.onClose)||void 0===o||o.call(e,t)},R=p.useMemo((()=>void 0!==e.type?e.type:r?"warning":"info"),[e.type,r]),H=p.useMemo((()=>!!C||("boolean"==typeof b?b:!1!==y&&null!=y)),[C,y,b]),M=!(!r||void 0!==v)||v,D=c()(z,`${z}-${R}`,{[`${z}-with-description`]:!!t,[`${z}-no-icon`]:!M,[`${z}-banner`]:!!r,[`${z}-rtl`]:"rtl"===T},null==I?void 0:I.className,i,l,j),W=(0,u.Z)(S,{aria:!0,data:!0});return Z(p.createElement(d.default,{visible:!O,motionName:`${z}-motion`,motionAppear:!1,motionEnter:!1,onLeaveStart:e=>({maxHeight:e.offsetHeight}),onLeaveEnd:h},(o=>{let{className:r,style:i}=o;return p.createElement("div",Object.assign({ref:P,"data-show":!O,className:c()(D,r),style:Object.assign(Object.assign(Object.assign({},null==I?void 0:I.style),a),i),onMouseEnter:s,onMouseLeave:f,onClick:m,role:"alert"},W),M?p.createElement(E,{description:t,icon:e.icon,prefixCls:z,type:R}):null,p.createElement("div",{className:`${z}-content`},n?p.createElement("div",{className:`${z}-message`},n):null,t?p.createElement("div",{className:`${z}-description`},t):null),$?p.createElement("div",{className:`${z}-action`},$):null,p.createElement(w,{isClosable:H,prefixCls:z,closeIcon:C||y,handleClose:L}))})))},N=o(79545),P=o(68550),B=o(17928),T=o(99487);let I=function(e){(0,B.Z)(o,e);var t=(0,T.Z)(o);function o(){var e;return(0,N.Z)(this,o),(e=t.apply(this,arguments)).state={error:void 0,info:{componentStack:""}},e}return(0,P.Z)(o,[{key:"componentDidCatch",value:function(e,t){this.setState({error:e,info:t})}},{key:"render",value:function(){const{message:e,description:t,children:o}=this.props,{error:n,info:r}=this.state,i=r&&r.componentStack?r.componentStack:null,l=void 0===e?(n||"").toString():e,a=void 0===t?i:t;return n?p.createElement(O,{type:"error",message:l,description:p.createElement("pre",{style:{fontSize:"0.9em",overflowX:"auto"}},a)}):o}}]),o}(p.Component);var z=I;const Z=O;Z.ErrorBoundary=z;var j=Z},79817:function(e,t,o){o.d(t,{Z:function(){return w}});var n=o(26390),r=o(92310),i=o.n(r),l=o(83794),a=o(59301),s=o(6774),c=o(13845),d=o(68031),u=o(81228),p=o(36355);var f=a.createContext(void 0);var g=e=>{const{href:t,title:o,prefixCls:n,children:r,className:l,target:s,replace:c}=e,d=a.useContext(f),{registerLink:u,unregisterLink:g,scrollTo:m,onClick:h,activeLink:v,direction:b}=d||{};a.useEffect((()=>(null==u||u(t),()=>{null==g||g(t)})),[t]);const{getPrefixCls:C}=a.useContext(p.E_),y=C("anchor",n),$=v===t,k=i()(`${y}-link`,l,{[`${y}-link-active`]:$}),x=i()(`${y}-link-title`,{[`${y}-link-title-active`]:$});return a.createElement("div",{className:k},a.createElement("a",{className:x,href:t,title:"string"==typeof o?o:"",target:s,onClick:e=>{c&&(e.preventDefault(),window.location.replace(t)),null==h||h(e,{title:o,href:t}),null==m||m(t)}},o),"horizontal"!==b?r:null)},m=o(17313),h=o(83116),v=o(37613);const b=e=>{const{componentCls:t,holderOffsetBlock:o,motionDurationSlow:n,lineWidthBold:r,colorPrimary:i,lineType:l,colorSplit:a}=e;return{[`${t}-wrapper`]:{marginBlockStart:-o,paddingBlockStart:o,[t]:Object.assign(Object.assign({},(0,m.Wf)(e)),{position:"relative",paddingInlineStart:r,[`${t}-link`]:{paddingBlock:e.linkPaddingBlock,paddingInline:`${e.linkPaddingInlineStart}px 0`,"&-title":Object.assign(Object.assign({},m.vS),{position:"relative",display:"block",marginBlockEnd:e.anchorTitleBlock,color:e.colorText,transition:`all ${e.motionDurationSlow}`,"&:only-child":{marginBlockEnd:0}}),[`&-active > ${t}-link-title`]:{color:e.colorPrimary},[`${t}-link`]:{paddingBlock:e.anchorPaddingBlockSecondary}}}),[`&:not(${t}-wrapper-horizontal)`]:{[t]:{"&::before":{position:"absolute",insetInlineStart:0,top:0,height:"100%",borderInlineStart:`${r}px ${l} ${a}`,content:'" "'},[`${t}-ink`]:{position:"absolute",insetInlineStart:0,display:"none",transform:"translateY(-50%)",transition:`top ${n} ease-in-out`,width:r,backgroundColor:i,[`&${t}-ink-visible`]:{display:"inline-block"}}}},[`${t}-fixed ${t}-ink ${t}-ink`]:{display:"none"}}}},C=e=>{const{componentCls:t,motionDurationSlow:o,lineWidthBold:n,colorPrimary:r}=e;return{[`${t}-wrapper-horizontal`]:{position:"relative","&::before":{position:"absolute",left:{_skip_check_:!0,value:0},right:{_skip_check_:!0,value:0},bottom:0,borderBottom:`1px ${e.lineType} ${e.colorSplit}`,content:'" "'},[t]:{overflowX:"scroll",position:"relative",display:"flex",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"},[`${t}-link:first-of-type`]:{paddingInline:0},[`${t}-ink`]:{position:"absolute",bottom:0,transition:`left ${o} ease-in-out, width ${o} ease-in-out`,height:n,backgroundColor:r}}}}};var y=(0,h.Z)("Anchor",(e=>{const{fontSize:t,fontSizeLG:o,paddingXXS:n}=e,r=(0,v.TS)(e,{holderOffsetBlock:n,anchorPaddingBlockSecondary:n/2,anchorTitleBlock:t/14*3,anchorBallSize:o/2});return[b(r),C(r)]}),(e=>({linkPaddingBlock:e.paddingXXS,linkPaddingInlineStart:e.padding})));function $(){return window}function k(e,t){if(!e.getClientRects().length)return 0;const o=e.getBoundingClientRect();return o.width||o.height?t===window?(t=e.ownerDocument.documentElement,o.top-t.clientTop):o.top-t.getBoundingClientRect().top:o.top}const x=/#([\S ]+)$/,S=e=>{var t;const{rootClassName:o,anchorPrefixCls:r,className:m,style:h,offsetTop:v,affix:b=!0,showInkInFixed:C=!1,children:y,items:S,direction:E="vertical",bounds:w,targetOffset:O,onClick:N,onChange:P,getContainer:B,getCurrentAnchor:T,replace:I}=e;const[z,Z]=a.useState([]),[j,L]=a.useState(null),R=a.useRef(j),H=a.useRef(null),M=a.useRef(null),D=a.useRef(!1),{direction:W,getTargetContainer:A,anchor:_}=a.useContext(p.E_),F=null!==(t=null!=B?B:A)&&void 0!==t?t:$,X=JSON.stringify(z),U=(0,l.useEvent)((e=>{z.includes(e)||Z((t=>[].concat((0,n.Z)(t),[e])))})),G=(0,l.useEvent)((e=>{z.includes(e)&&Z((t=>t.filter((t=>t!==e))))})),V=(0,l.useEvent)((e=>{if(R.current===e)return;const t="function"==typeof T?T(e):e;L(t),R.current=t,null==P||P(e)})),q=a.useCallback((()=>{if(D.current)return;const e=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5;const n=[],r=F();if(e.forEach((e=>{const i=x.exec(null==e?void 0:e.toString());if(!i)return;const l=document.getElementById(i[1]);if(l){const i=k(l,r);i<t+o&&n.push({link:e,top:i})}})),n.length)return n.reduce(((e,t)=>t.top>e.top?t:e)).link;return""}(z,void 0!==O?O:v||0,w);V(e)}),[X,O,v]),J=a.useCallback((e=>{V(e);const t=x.exec(e);if(!t)return;const o=document.getElementById(t[1]);if(!o)return;const n=F();let r=(0,c.Z)(n,!0)+k(o,n);r-=void 0!==O?O:v||0,D.current=!0,(0,d.Z)(r,{getContainer:F,callback(){D.current=!1}})}),[O,v]),Q=i()(o,`${r}-wrapper`,{[`${r}-wrapper-horizontal`]:"horizontal"===E,[`${r}-rtl`]:"rtl"===W},m,null==_?void 0:_.className),Y=i()(r,{[`${r}-fixed`]:!b&&!C}),K=i()(`${r}-ink`,{[`${r}-ink-visible`]:j}),ee=Object.assign(Object.assign({maxHeight:v?`calc(100vh - ${v}px)`:"100vh"},null==_?void 0:_.style),h),te=e=>Array.isArray(e)?e.map((e=>a.createElement(g,Object.assign({replace:I},e,{key:e.key}),"vertical"===E&&te(e.children)))):null,oe=a.createElement("div",{ref:H,className:Q,style:ee},a.createElement("div",{className:Y},a.createElement("span",{className:K,ref:M}),"items"in e?te(S):y));a.useEffect((()=>{const e=F();return q(),null==e||e.addEventListener("scroll",q),()=>{null==e||e.removeEventListener("scroll",q)}}),[X]),a.useEffect((()=>{"function"==typeof T&&V(T(R.current||""))}),[T]),a.useEffect((()=>{(()=>{var e;const t=null===(e=H.current)||void 0===e?void 0:e.querySelector(`.${r}-link-title-active`);if(t&&M.current){const{style:e}=M.current,o="horizontal"===E;e.top=o?"":`${t.offsetTop+t.clientHeight/2}px`,e.height=o?"":`${t.clientHeight}px`,e.left=o?`${t.offsetLeft}px`:"",e.width=o?`${t.clientWidth}px`:"",o&&(0,s.Z)(t,{scrollMode:"if-needed",block:"nearest"})}})()}),[E,T,X,j]);const ne=a.useMemo((()=>({registerLink:U,unregisterLink:G,scrollTo:J,activeLink:j,onClick:N,direction:E})),[j,N,J,E]);return a.createElement(f.Provider,{value:ne},b?a.createElement(u.Z,{offsetTop:v,target:F},oe):oe)};const E=e=>{const{prefixCls:t,rootClassName:o}=e,{getPrefixCls:n}=a.useContext(p.E_),r=n("anchor",t),[l,s]=y(r);return l(a.createElement(S,Object.assign({},e,{rootClassName:i()(s,o),anchorPrefixCls:r})))};E.Link=g;var w=E},12563:function(e,t,o){o.d(t,{Z:function(){return w}});var n=o(59301),r=o(51638),i=o(92310),l=o.n(i),a=o(36785),s=o(47729),c=o(14088),d=o(36355),u=o(17313),p=o(37613),f=o(83116);const g=e=>{const{lineWidth:t,fontSizeIcon:o}=e,n=e.fontSizeSM,r=e.lineHeightSM*n+"px";return(0,p.TS)(e,{tagFontSize:n,tagLineHeight:r,tagIconSize:o-2*t,tagPaddingHorizontal:8,tagBorderlessBg:e.colorFillTertiary})},m=e=>({defaultBg:e.colorFillQuaternary,defaultColor:e.colorText});var h=(0,f.Z)("Tag",(e=>(e=>{const{paddingXXS:t,lineWidth:o,tagPaddingHorizontal:n,componentCls:r}=e,i=n-o,l=t-o;return{[r]:Object.assign(Object.assign({},(0,u.Wf)(e)),{display:"inline-block",height:"auto",marginInlineEnd:e.marginXS,paddingInline:i,fontSize:e.tagFontSize,lineHeight:e.tagLineHeight,whiteSpace:"nowrap",background:e.defaultBg,border:`${e.lineWidth}px ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadiusSM,opacity:1,transition:`all ${e.motionDurationMid}`,textAlign:"start",position:"relative",[`&${r}-rtl`]:{direction:"rtl"},"&, a, a:hover":{color:e.defaultColor},[`${r}-close-icon`]:{marginInlineStart:l,color:e.colorTextDescription,fontSize:e.tagIconSize,cursor:"pointer",transition:`all ${e.motionDurationMid}`,"&:hover":{color:e.colorTextHeading}},[`&${r}-has-color`]:{borderColor:"transparent",[`&, a, a:hover, ${e.iconCls}-close, ${e.iconCls}-close:hover`]:{color:e.colorTextLightSolid}},"&-checkable":{backgroundColor:"transparent",borderColor:"transparent",cursor:"pointer",[`&:not(${r}-checkable-checked):hover`]:{color:e.colorPrimary,backgroundColor:e.colorFillSecondary},"&:active, &-checked":{color:e.colorTextLightSolid},"&-checked":{backgroundColor:e.colorPrimary,"&:hover":{backgroundColor:e.colorPrimaryHover}},"&:active":{backgroundColor:e.colorPrimaryActive}},"&-hidden":{display:"none"},[`> ${e.iconCls} + span, > span + ${e.iconCls}`]:{marginInlineStart:i}}),[`${r}-borderless`]:{borderColor:"transparent",background:e.tagBorderlessBg}}})(g(e))),m),v=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(o[n[r]]=e[n[r]])}return o};var b=e=>{const{prefixCls:t,style:o,className:r,checked:i,onChange:a,onClick:s}=e,c=v(e,["prefixCls","style","className","checked","onChange","onClick"]),{getPrefixCls:u,tag:p}=n.useContext(d.E_),f=u("tag",t),[g,m]=h(f),b=l()(f,`${f}-checkable`,{[`${f}-checkable-checked`]:i},null==p?void 0:p.className,r,m);return g(n.createElement("span",Object.assign({},c,{style:Object.assign(Object.assign({},o),null==p?void 0:p.style),className:b,onClick:e=>{null==a||a(!i),null==s||s(e)}})))},C=o(45157);var y=(0,f.b)(["Tag","preset"],(e=>(e=>(0,C.Z)(e,((t,o)=>{let{textColor:n,lightBorderColor:r,lightColor:i,darkColor:l}=o;return{[`${e.componentCls}-${t}`]:{color:n,background:i,borderColor:r,"&-inverse":{color:e.colorTextLightSolid,background:l,borderColor:l},[`&${e.componentCls}-borderless`]:{borderColor:"transparent"}}}})))(g(e))),m);const $=(e,t,o)=>{const n="string"!=typeof(r=o)?r:r.charAt(0).toUpperCase()+r.slice(1);var r;return{[`${e.componentCls}-${t}`]:{color:e[`color${o}`],background:e[`color${n}Bg`],borderColor:e[`color${n}Border`],[`&${e.componentCls}-borderless`]:{borderColor:"transparent"}}}};var k=(0,f.b)(["Tag","status"],(e=>{const t=g(e);return[$(t,"success","Success"),$(t,"processing","Info"),$(t,"error","Error"),$(t,"warning","Warning")]}),m),x=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(o[n[r]]=e[n[r]])}return o};const S=(e,t)=>{const{prefixCls:o,className:i,rootClassName:u,style:p,children:f,icon:g,color:m,onClose:v,closeIcon:b,closable:C,bordered:$=!0}=e,S=x(e,["prefixCls","className","rootClassName","style","children","icon","color","onClose","closeIcon","closable","bordered"]),{getPrefixCls:E,direction:w,tag:O}=n.useContext(d.E_),[N,P]=n.useState(!0);n.useEffect((()=>{"visible"in S&&P(S.visible)}),[S.visible]);const B=(0,a.o2)(m),T=(0,a.yT)(m),I=B||T,z=Object.assign(Object.assign({backgroundColor:m&&!I?m:void 0},null==O?void 0:O.style),p),Z=E("tag",o),[j,L]=h(Z),R=l()(Z,null==O?void 0:O.className,{[`${Z}-${m}`]:I,[`${Z}-has-color`]:m&&!I,[`${Z}-hidden`]:!N,[`${Z}-rtl`]:"rtl"===w,[`${Z}-borderless`]:!$},i,u,L),H=e=>{e.stopPropagation(),null==v||v(e),e.defaultPrevented||P(!1)},[,M]=(0,s.Z)(C,b,(e=>null===e?n.createElement(r.Z,{className:`${Z}-close-icon`,onClick:H}):n.createElement("span",{className:`${Z}-close-icon`,onClick:H},e)),null,!1),D="function"==typeof S.onClick||f&&"a"===f.type,W=g||null,A=W?n.createElement(n.Fragment,null,W,f&&n.createElement("span",null,f)):f,_=n.createElement("span",Object.assign({},S,{ref:t,className:R,style:z}),A,M,B&&n.createElement(y,{key:"preset",prefixCls:Z}),T&&n.createElement(k,{key:"status",prefixCls:Z}));return j(D?n.createElement(c.Z,{component:"Tag"},_):_)},E=n.forwardRef(S);E.CheckableTag=b;var w=E}}]);