Files
Sillyv2/core/admin/p__Carry__index.4274a36e.async.js
T
cdle 643ecd0f9c x
2023-07-05 17:19:56 +08:00

2 lines
20 KiB
JavaScript

"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[274],{59419:function(ce,L,a){var E=a(75782),A=a(58733),w=a(18518),c=a(50959),B=a(60061),f=a(72961),V=a(11527),D=["fieldProps","children","params","proFieldProps","mode","valueEnum","request","showSearch","options"],I=["fieldProps","children","params","proFieldProps","mode","valueEnum","request","options"],Z=c.forwardRef(function(t,U){var te=t.fieldProps,ae=t.children,ue=t.params,re=t.proFieldProps,Q=t.mode,R=t.valueEnum,q=t.request,e=t.showSearch,v=t.options,s=(0,A.Z)(t,D),u=(0,c.useContext)(B.Z);return(0,V.jsx)(f.Z,(0,E.Z)((0,E.Z)({valueEnum:(0,w.h)(R),request:q,params:ue,valueType:"select",filedConfig:{customLightMode:!0},fieldProps:(0,E.Z)({options:v,mode:Q,showSearch:e,getPopupContainer:u.getPopupContainer},te),ref:U,proFieldProps:re},s),{},{children:ae}))}),M=c.forwardRef(function(t,U){var te=t.fieldProps,ae=t.children,ue=t.params,re=t.proFieldProps,Q=t.mode,R=t.valueEnum,q=t.request,e=t.options,v=(0,A.Z)(t,I),s=(0,E.Z)({options:e,mode:Q||"multiple",labelInValue:!0,showSearch:!0,showArrow:!1,autoClearSearchValue:!0,optionLabelProp:"label"},te),u=(0,c.useContext)(B.Z);return(0,V.jsx)(f.Z,(0,E.Z)((0,E.Z)({valueEnum:(0,w.h)(R),request:q,params:ue,valueType:"select",filedConfig:{customLightMode:!0},fieldProps:(0,E.Z)({getPopupContainer:u.getPopupContainer},s),ref:U,proFieldProps:re},v),{},{children:ae}))}),y=Z,m=M,o=y;o.SearchSelect=m,o.displayName="ProFormComponent",L.Z=o},40792:function(ce,L,a){var E=a(75782),A=a(58733),w=a(50959),c=a(72961),B=a(11527),f=["fieldProps","unCheckedChildren","checkedChildren","proFieldProps"],V=w.forwardRef(function(D,I){var Z=D.fieldProps,M=D.unCheckedChildren,y=D.checkedChildren,m=D.proFieldProps,o=(0,A.Z)(D,f);return(0,B.jsx)(c.Z,(0,E.Z)({valueType:"switch",fieldProps:(0,E.Z)({unCheckedChildren:M,checkedChildren:y},Z),ref:I,valuePropName:"checked",proFieldProps:m,filedConfig:{valuePropName:"checked",ignoreWidth:!0}},o))});L.Z=V},66732:function(ce,L,a){var E=a(75782),A=a(58733),w=a(50959),c=a(72961),B=a(11527),f=["fieldProps","proFieldProps"],V=["fieldProps","proFieldProps"],D="text",I=function(m){var o=m.fieldProps,t=m.proFieldProps,U=(0,A.Z)(m,f);return(0,B.jsx)(c.Z,(0,E.Z)({valueType:D,fieldProps:o,filedConfig:{valueType:D},proFieldProps:t},U))},Z=function(m){var o=m.fieldProps,t=m.proFieldProps,U=(0,A.Z)(m,V);return(0,B.jsx)(c.Z,(0,E.Z)({valueType:"password",fieldProps:o,proFieldProps:t,filedConfig:{valueType:D}},U))},M=I;M.Password=Z,M.displayName="ProFormComponent",L.Z=M},3176:function(ce,L,a){var E=a(75782),A=a(58733),w=a(50959),c=a(72961),B=a(11527),f=["fieldProps","proFieldProps"],V=function(I,Z){var M=I.fieldProps,y=I.proFieldProps,m=(0,A.Z)(I,f);return(0,B.jsx)(c.Z,(0,E.Z)({ref:Z,valueType:"textarea",fieldProps:M,proFieldProps:y},m))};L.Z=w.forwardRef(V)},7765:function(ce,L,a){a.r(L),a.d(L,{default:function(){return K}});var E=a(25359),A=a.n(E),w=a(49811),c=a.n(w),B=a(54306),f=a.n(B),V=a(93525),D=a.n(V),I=a(27693),Z=a(68243),M=a(28964),y=a(4050),m=a(31255),o=a(50959),t=a(11527);function U(r,W){var z=r.concat(W);return D()(new Set(z))}function te(r){var W,z=(0,o.useState)((W=r.data)!==null&&W!==void 0?W:[]),H=f()(z,2),T=H[0],G=H[1],F=(0,o.useState)(!1),d=f()(F,2),h=d[0],k=d[1],C=(0,o.useState)(""),_=f()(C,2),$=_[0],J=_[1],ee=(0,o.useState)(-1),oe=f()(ee,2),le=oe[0],Y=oe[1],xe=(0,o.useState)(""),pe=f()(xe,2),me=pe[0],fe=pe[1],Ce=(0,o.useRef)(null),ge=(0,o.useRef)(null);(0,o.useEffect)(function(){if(h){var p;(p=Ce.current)===null||p===void 0||p.focus()}},[h]),(0,o.useEffect)(function(){var p;(p=ge.current)===null||p===void 0||p.focus()},[$]);var Ae=function(P){var X=T.filter(function(de){return de!==P});console.log(X),G(X),r.setTags(X)},Ee=function(){k(!0)},be=function(P){J(P.target.value)},Fe=function(){if($&&T.indexOf($)===-1){var P=$.trim().split(/\s+/),X=U(T,P);G(X),r.setTags(X)}k(!1),J("")},ye=function(P){fe(P.target.value)},he=function(){var P=D()(T);P[le]=me,G(P),r.setTags(P),Y(-1),J("")},Pe={width:78,verticalAlign:"top"},ve={borderStyle:"dashed"};return(0,t.jsxs)(Z.Z,{size:[0,8],wrap:!0,children:[(0,t.jsx)(Z.Z,{size:[0,8],wrap:!0,children:T.map(function(p,P){if(le===P)return(0,t.jsx)(M.Z,{ref:ge,size:"small",style:Pe,value:me,onChange:ye,onBlur:he,onPressEnter:he},p);var X=p.length>20,de=(0,t.jsx)(y.Z,{closable:!0,style:{userSelect:"none"},onClose:function(){return Ae(p)},children:(0,t.jsx)("span",{onDoubleClick:function(De){P!==0&&(Y(P),fe(p),De.preventDefault())},children:X?"".concat(p.slice(0,20),"..."):p})},p);return X?(0,t.jsx)(m.Z,{title:p,children:de},p):de})}),h?(0,t.jsx)(M.Z,{ref:Ce,type:"text",size:"small",style:Pe,value:$,onChange:be,onBlur:Fe,onPressEnter:Fe}):(0,t.jsxs)(y.Z,{style:ve,onClick:Ee,children:[(0,t.jsx)(I.Z,{}),"\u589E\u52A0"]})]})}var ae=te,ue=a(12472),re=a(19646),Q=a(81308),R=a(59419),q=a(66732),e=a(24176),v=a(40792),s=a(3176),u=a(86195),i=a(833),j=a(26572),O=a(79112),ne=a(53315),K=function(){var r=(0,o.useRef)(),W=(0,o.useState)(b),z=f()(W,2),H=z[0],T=z[1],G=[{title:"\u7F16\u53F7",dataIndex:"id",key:"id"},{title:"\u7FA4\u7EC4ID",dataIndex:"chat_id",key:"chat_id"},{title:"\u7FA4\u540D",dataIndex:"chat_name",key:"chat_name"},{title:"\u5E73\u53F0",dataIndex:"platform",key:"platform",render:function(d,h){return(0,t.jsx)(y.Z,{color:"purple",children:d})}},{title:"\u6A21\u5F0F",dataIndex:"in",key:"in",render:function(d,h){return(0,t.jsxs)(Z.Z,{size:[0,8],wrap:!0,children:[h.in&&(0,t.jsx)(y.Z,{color:"blue",children:"\u91C7\u96C6"}),h.out&&(0,t.jsx)(y.Z,{color:"geekblue",children:"\u8F6C\u53D1"})]})}},{title:"\u5907\u6CE8",dataIndex:"remark",key:"remark"},{title:"\u521B\u5EFA\u65E5\u671F",dataIndex:"created_at",key:"created_at",render:function(d,h){return(0,t.jsx)("span",{children:new Date(d*1e3).toLocaleDateString()})}},{title:"\u542F\u7528",dataIndex:"enable",key:"enable",renderFormItem:function(){return(0,t.jsx)(i.Z,{disabled:!0,defaultChecked:!1})},render:function(d,h){return(0,t.jsx)(i.Z,{onChange:function(C){(0,u.request)("/api/carry/group",{method:"post",data:JSON.stringify({chat_id:h.chat_id,enable:C})})},defaultChecked:h==null?void 0:h.enable})}},{title:"\u64CD\u4F5C",valueType:"option",width:"10%",render:function(d,h){return[(0,t.jsx)("a",{onClick:function(){return T(h)},children:"\u7F16\u8F91"},"more"),(0,t.jsx)("a",{onClick:function(){var C,_;(0,u.request)("/api/carry/group",{method:"delete",data:JSON.stringify({chat_id:h.chat_id})}),(C=r.current)===null||C===void 0||(_=C.reloadAndRest)===null||_===void 0||_.call(C)},children:"\u5220\u9664"},"delete")]}}];return(0,t.jsxs)(ue._z,{content:"\u642C\u8FD0\u7FA4\u7EC4",children:[(0,t.jsx)(Z.Z,{style:{marginBottom:10},children:(0,t.jsx)(j.ZP,{type:"primary",onClick:function(){T(ie)},icon:(0,t.jsx)(I.Z,{}),children:"\u65B0\u5EFA\u4E00\u884C"})}),(0,t.jsx)(re.Z,{search:!1,actionRef:r,rowKey:function(d){return d.chat_id},columns:G,request:c()(A()().mark(function F(){var d,h=arguments;return A()().wrap(function(C){for(;;)switch(C.prev=C.next){case 0:return d=h.length>0&&h[0]!==void 0?h[0]:{},C.abrupt("return",(0,u.request)("/api/carry/groups",{params:d}));case 2:case"end":return C.stop()}},F)}))}),H.id!=-1&&(0,t.jsx)(N,{open:H.id!=-1,data:H,onCancel:function(){return T(b)},onFinish:function(){var F=c()(A()().mark(function d(h){return A()().wrap(function(C){for(;;)switch(C.prev=C.next){case 0:(0,u.request)("/api/carry/group",{method:"post",data:JSON.stringify(h)}).then(function(_){var $,J;($=r.current)===null||$===void 0||(J=$.reloadAndRest)===null||J===void 0||J.call($),T(b)});case 1:case"end":return C.stop()}},d)}));return function(d){return F.apply(this,arguments)}}()})]})};function N(r){var W,z,H,T=(0,o.useState)([]),G=f()(T,2),F=G[0],d=G[1],h=(0,o.useState)({}),k=f()(h,2),C=k[0],_=k[1],$=(0,o.useState)(!1),J=f()($,2),ee=J[0],oe=J[1],le=(0,o.useState)({}),Y=f()(le,2),xe=Y[0],pe=Y[1],me=(0,o.useState)([]),fe=f()(me,2),Ce=fe[0],ge=fe[1],Ae=(0,o.useState)(r.data.out),Ee=f()(Ae,2),be=Ee[0],Fe=Ee[1],ye=(0,o.useState)(r.data.allowed.length==0),he=f()(ye,2),Pe=he[0],ve=he[1],p=(0,o.useState)(se.allowed),P=f()(p,2),X=P[0],de=P[1],je=(0,o.useState)([]),De=f()(je,2),Se=De[0],Ve=De[1],We=(0,o.useState)([]),Ze=f()(We,2),Me=Ze[0],Oe=Ze[1],_e=(0,o.useState)([]),Re=f()(_e,2),Le=Re[0],we=Re[1],S=(0,o.useRef)(),Te=function(n){var l;return(l=S.current)===null||l===void 0?void 0:l.getFieldValue(n)},Be=function(n,l){var x;return(x=S.current)===null||x===void 0?void 0:x.setFieldValue(n,l)};return(0,o.useEffect)(function(){var g,n,l=(g=S.current)===null||g===void 0?void 0:g.getFieldValue("platform");return(0,u.request)((n="/api/carry/group_selects?chat_id="+r.data.chat_id+"&platform="+l)!==null&&n!==void 0?n:"").then(function(x){if(x.data){var Ie;d(x.data.bots_id),pe(x.data.group_names),ge(x.data.platforms),_(x.data.scripts),Oe(x.data.user_names);var $e=(Ie=S.current)===null||Ie===void 0?void 0:Ie.getFieldValue("bots_id");(!$e||!$e.length)&&x.data.bots_id.length&&Be("bots_id",[x.data.bots_id[0]])}}),function(){}},[ee]),(0,t.jsx)(O.Z,{title:r.data.id==0?"\u521B\u5EFA":"\u7F16\u8F91",open:!0,onCancel:r.onCancel,onOk:function(){var n;r.onFinish(S==null||(n=S.current)===null||n===void 0?void 0:n.getFieldsValue())},children:(0,t.jsxs)(Q.A,{formRef:S,onValuesChange:function(n){if(n.platform){var l;oe(!ee),S==null||(l=S.current)===null||l===void 0||l.setFieldsValue({bots_id:[]})}"out"in n&&Fe(n.out),n.allowed&&ve(n.allowed)},onFinish:r.onFinish,submitter:!1,children:[(0,t.jsx)(R.Z,{tooltip:"\u7CFB\u7EDF\u552F\u4E00\u4E0D\u53EF\u66F4\u6539\uFF0C\u53EA\u80FD\u5220\u9664\u3002",name:"chat_id",initialValue:r.data.chat_id,label:"\u7FA4\u7EC4ID",disabled:r.data.id!=0,required:!0,fieldProps:{showSearch:!0,onSearch:function(n){(0,u.request)("/api/nickname/labels?gkeyword="+n).then(function(l){l&&l.data&&Ve(l.data)})},onChange:function(n){if(Se)for(var l in Se){var x=Se[l];x.value==n&&(Be("chat_name",x.chat_name),x.platform!=!Te("platform")&&(Be("platform",x.platform),oe(!ee)))}},filterOption:!1,defaultActiveFirstOption:!1,showArrow:!1,notFoundContent:null},options:Se}),(0,t.jsxs)(Q.A.Group,{children:[(0,t.jsx)(q.Z,{name:"remark",initialValue:r.data.remark,label:"\u7FA4\u7EC4\u5907\u6CE8",rules:[{message:"\u8BF7\u586B\u5199\u7FA4\u5907\u6CE8"}]}),(0,t.jsx)(q.Z,{name:"chat_name",initialValue:r.data.chat_name,label:"\u7FA4\u540D\u79F0",disabled:!0})]}),(0,t.jsxs)(Q.A.Group,{children:[(0,t.jsx)(R.Z,{tooltip:"\u5E73\u53F0\u63A5\u5165\u7CFB\u7EDF\u540E\u5C06\u81EA\u52A8\u51FA\u73B0\u5728\u5217\u8868\u4E2D\u3002",initialValue:r.data.platform,valueEnum:Ce.reduce(function(g,n){return g[n]=n,g},{}),name:"platform",label:"\u901A\u4FE1\u5E73\u53F0",required:!0}),(0,t.jsxs)(e.UW,{children:[(0,t.jsx)(v.Z,{name:"in",tooltip:"\u5F00\u542F\u540E\u5C06\u5728\u6B64\u7FA4\u804A\u76D1\u542C\u6D88\u606F\uFF0C\u4F46\u673A\u5668\u4EBA\u540C\u65F6\u4E0D\u518D\u56DE\u590D\u8BE5\u7FA4\u804A\u6307\u4EE4\uFF0C\u4F46\u662F\u4E0D\u5F71\u54CD\u6D88\u606F\u63A8\u9001\u3002\u5F00\u542F\u6B64\u6A21\u5F0F\u7684\u4E00\u822C\u662F\u522B\u4EBA\u7684\u7FA4\u3002",label:"\u91C7\u96C6\u6A21\u5F0F",initialValue:r.data.in}),(0,t.jsx)(v.Z,{name:"out",tooltip:"\u5F00\u542F\u540E\u5C06\u5728\u6B64\u7FA4\u8F6C\u53D1\u6D88\u606F\u3002\u5F00\u542F\u6B64\u6A21\u5F0F\u7684\u7FA4\u4E00\u822C\u662F\u81EA\u5DF1\u7684\u7FA4\u3002",label:"\u8F6C\u53D1\u6A21\u5F0F",initialValue:r.data.out})]})]}),be&&(0,t.jsx)(R.Z,{name:"from",label:"\u91C7\u96C6\u6E90",tooltip:"\u6307\u5B9A\u8981\u8FDB\u884C\u6D88\u606F\u91C7\u96C6\u7684\u7FA4\u804A\u3002",valueEnum:xe,fieldProps:{mode:"multiple"},initialValue:(W=r.data.from)!==null&&W!==void 0?W:[]}),(0,t.jsx)(R.Z,{name:"bots_id",label:"\u5DE5\u4F5C\u673A\u5668\u4EBA",tooltip:"\u6307\u5B9A\u8981\u8FDB\u884C\u6D88\u606F\u91C7\u96C6\u548C\u8F6C\u53D1\u7684\u673A\u5668\u4EBA\uFF0C\u540C\u4E00\u6D88\u606F\u540C\u65F6\u53EA\u5141\u8BB8\u4E00\u4E2A\u673A\u5668\u4EBA\u5DE5\u4F5C\uFF0C\u5982\u679C\u6307\u5B9A\u7684\u673A\u5668\u4EBA\u79BB\u7EBF\u5219\u91C7\u7528\u5176\u4ED6\u673A\u5668\u4EBA\u9876\u4E0A\u3002\u6B64\u5916\uFF0C\u91C7\u96C6\u6A21\u5F0F\u4E2D\u53EA\u6709\u7B2C\u4E00\u4E2AID\u6709\u6548\u3002",valueEnum:F.reduce(function(g,n){return g[n]=n,g},{}),fieldProps:{mode:"multiple"},placeholder:"\u9ED8\u8BA4\u9009\u62E9\u4E00\u4E2A",initialValue:(z=r.data.bots_id)!==null&&z!==void 0?z:[]}),(0,t.jsx)(R.Z,{tooltip:"\u53EF\u4EE5\u987A\u5E8F\u901A\u8FC7\u811A\u672C\u5904\u7406\u53D1\u9001\u524D\u7684\u6D88\u606F\u3002",name:"scripts",label:"\u5904\u7406\u811A\u672C",fieldProps:{mode:"multiple"},valueEnum:C,initialValue:(H=r.data.scripts)!==null&&H!==void 0?H:[]}),(0,t.jsx)(R.Z,{name:"allowed",tooltip:"\u6B64\u5904\u586B\u767D\u540D\u5355\u7528\u6237ID\u3002\u91C7\u96C6\u7FA4\u53EA\u63A5\u6536\u6765\u81EA\u767D\u540D\u5355\u7528\u6237\u6D88\u606F\uFF0C\u8F6C\u53D1\u7FA4\u53EA\u8F6C\u53D1\u6765\u81EA\u767D\u540D\u5355\u7528\u6237\u6D88\u606F\u3002\u8BBE\u7F6E\u767D\u540D\u5355\u5C06\u5FFD\u7565\u9ED1\u540D\u5355\u3002",initialValue:r.data.allowed,label:"\u767D\u540D\u5355",fieldProps:{mode:"multiple",showSearch:!0,onSearch:function(n){(0,u.request)("/api/nickname/labels?ukeyword="+n+"&platform="+Te("platform")).then(function(l){l&&l.data&&Oe(l.data)})},filterOption:!1,defaultActiveFirstOption:!1,showArrow:!1,notFoundContent:null,onChange:function(n){n.length!=0?ve(!1):ve(!0)}},options:Me}),Pe&&(0,t.jsx)(R.Z,{name:"prohibited",initialValue:r.data.prohibited,tooltip:"\u6B64\u5904\u586B\u9ED1\u540D\u5355\u7528\u6237ID\u3002\u91C7\u96C6\u7FA4\u548C\u8F6C\u53D1\u7FA4\u5C06\u5FFD\u7565\u9ED1\u540D\u5355\u7528\u6237\u6240\u6709\u6D88\u606F\u3002",label:"\u9ED1\u540D\u5355",fieldProps:{mode:"multiple",showSearch:!0,onSearch:function(n){(0,u.request)("/api/nickname/labels?ukeyword="+n+"&platform="+Te("platform")).then(function(l){l&&l.data&&Oe(l.data)})},filterOption:!1,defaultActiveFirstOption:!1,showArrow:!1,notFoundContent:null},options:Me}),(0,t.jsx)(ne.Z,{tabBarExtraContent:(0,t.jsx)(m.Z,{placement:"top",title:X,children:(0,t.jsx)(j.ZP,{children:"\u63D0\u793A"})}),onTabClick:function(n,l){de(se[n])},items:[{label:"\u5305\u542B\u8BCD",key:"include",children:(0,t.jsx)(ae,{setTags:function(n){var l;S==null||(l=S.current)===null||l===void 0||l.setFieldsValue({include:n})},data:r.data.include})},{label:"\u6392\u9664\u8BCD",key:"exclude",children:(0,t.jsx)(ae,{setTags:function(n){var l;S==null||(l=S.current)===null||l===void 0||l.setFieldsValue({exclude:n})},data:r.data.exclude})}]}),(0,t.jsx)(s.Z,{hidden:!0,name:"allowed",initialValue:r.data.allowed,label:"\u767D\u540D\u5355"}),(0,t.jsx)(s.Z,{hidden:!0,name:"prohibited",initialValue:r.data.prohibited,label:"\u9ED1\u540D\u5355"}),(0,t.jsx)(s.Z,{hidden:!0,name:"include",initialValue:r.data.include,label:"\u5305\u542B\u5173\u952E\u8BCD"}),(0,t.jsx)(s.Z,{hidden:!0,name:"exclude",initialValue:r.data.exclude,label:"\u6392\u9664\u5173\u952E\u8BCD"})]})},r.data.chat_id)}var b={id:-1,in:!1,out:!1,allowed:[],from:[],prohibited:[],chat_id:"",chat_name:"",remark:"",platform:"",enable:!1,include:[],exclude:[],created_at:0,bots_id:[],scripts:[]},ie={id:0,in:!1,out:!1,allowed:[],from:[],prohibited:[],chat_id:"",chat_name:"",remark:"",platform:"",enable:!1,include:[],exclude:[],created_at:0,bots_id:[],scripts:[]},se={include:"\u6B64\u5904\u586B\u5199\u5305\u542B\u8BCD\u3002\u91C7\u96C6\u7FA4\u548C\u8F6C\u53D1\u7FA4\u5C06\u5FFD\u7565\u4E0D\u542B\u6709\u4EFB\u610F\u5305\u542B\u8BCD\u7684\u6D88\u606F\u3002\u652F\u6301\u6B63\u5219\uFF0C\u9700\u8981\u4F7F\u7528\u201C/\u201D\u5C06\u6B63\u5219\u8868\u8FBE\u5F0F\u5305\u8D77\u6765\u3002",exclude:"\u6B64\u5904\u586B\u5199\u6392\u9664\u8BCD\u3002\u91C7\u96C6\u7FA4\u548C\u8F6C\u53D1\u7FA4\u5C06\u5FFD\u7565\u4EFB\u4F55\u542B\u6709\u4EFB\u610F\u6392\u9664\u8BCD\u7684\u6D88\u606F\u3002\u652F\u6301\u6B63\u5219\uFF0C\u9700\u8981\u4F7F\u7528\u201C/\u201D\u5C06\u6B63\u5219\u8868\u8FBE\u5F0F\u5305\u8D77\u6765\u3002"}},4050:function(ce,L,a){a.d(L,{Z:function(){return q}});var E=a(96157),A=a(84875),w=a.n(A),c=a(50959),B=a(85548),f=a(78862),V=a(70458);function D(e){return typeof e!="string"?e:e.charAt(0).toUpperCase()+e.slice(1)}var I=a(49272),Z=a(42498),M=a(97624),y=a(74074);const m=(e,v,s)=>{const u=D(s);return{[`${e.componentCls}-${v}`]:{color:e[`color${s}`],background:e[`color${u}Bg`],borderColor:e[`color${u}Border`]}}},o=e=>(0,Z.Z)(e,(v,s)=>{let{textColor:u,lightBorderColor:i,lightColor:j,darkColor:O}=s;return{[`${e.componentCls}-${v}`]:{color:u,background:j,borderColor:i,"&-inverse":{color:e.colorTextLightSolid,background:O,borderColor:O},[`&${e.componentCls}-borderless`]:{borderColor:"transparent"}}}}),t=e=>{const{paddingXXS:v,lineWidth:s,tagPaddingHorizontal:u,componentCls:i}=e,j=u-s,O=v-s;return{[i]:Object.assign(Object.assign({},(0,I.Wf)(e)),{display:"inline-block",height:"auto",marginInlineEnd:e.marginXS,paddingInline:j,fontSize:e.tagFontSize,lineHeight:`${e.tagLineHeight}px`,whiteSpace:"nowrap",background:e.tagDefaultBg,border:`${e.lineWidth}px ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadiusSM,opacity:1,transition:`all ${e.motionDurationMid}`,textAlign:"start",[`&${i}-rtl`]:{direction:"rtl"},"&, a, a:hover":{color:e.tagDefaultColor},[`${i}-close-icon`]:{marginInlineStart:O,color:e.colorTextDescription,fontSize:e.tagIconSize,cursor:"pointer",transition:`all ${e.motionDurationMid}`,"&:hover":{color:e.colorTextHeading}},[`&${i}-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(${i}-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:j}}),[`${i}-borderless`]:{borderColor:"transparent",background:e.tagBorderlessBg}}};var U=(0,M.Z)("Tag",e=>{const{fontSize:v,lineHeight:s,lineWidth:u,fontSizeIcon:i}=e,j=Math.round(v*s),O=e.fontSizeSM,ne=j-u*2,K=e.colorFillQuaternary,N=e.colorText,b=(0,y.TS)(e,{tagFontSize:O,tagLineHeight:ne,tagDefaultBg:K,tagDefaultColor:N,tagIconSize:i-2*u,tagPaddingHorizontal:8,tagBorderlessBg:e.colorFillTertiary});return[t(b),o(b),m(b,"success","Success"),m(b,"processing","Info"),m(b,"error","Error"),m(b,"warning","Warning")]}),te=function(e,v){var s={};for(var u in e)Object.prototype.hasOwnProperty.call(e,u)&&v.indexOf(u)<0&&(s[u]=e[u]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,u=Object.getOwnPropertySymbols(e);i<u.length;i++)v.indexOf(u[i])<0&&Object.prototype.propertyIsEnumerable.call(e,u[i])&&(s[u[i]]=e[u[i]]);return s},ue=e=>{const{prefixCls:v,className:s,checked:u,onChange:i,onClick:j}=e,O=te(e,["prefixCls","className","checked","onChange","onClick"]),{getPrefixCls:ne}=c.useContext(V.E_),K=r=>{i==null||i(!u),j==null||j(r)},N=ne("tag",v),[b,ie]=U(N),se=w()(N,{[`${N}-checkable`]:!0,[`${N}-checkable-checked`]:u},s,ie);return b(c.createElement("span",Object.assign({},O,{className:se,onClick:K})))},re=function(e,v){var s={};for(var u in e)Object.prototype.hasOwnProperty.call(e,u)&&v.indexOf(u)<0&&(s[u]=e[u]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,u=Object.getOwnPropertySymbols(e);i<u.length;i++)v.indexOf(u[i])<0&&Object.prototype.propertyIsEnumerable.call(e,u[i])&&(s[u[i]]=e[u[i]]);return s};const Q=(e,v)=>{const{prefixCls:s,className:u,rootClassName:i,style:j,children:O,icon:ne,color:K,onClose:N,closeIcon:b,closable:ie=!1,bordered:se=!0}=e,r=re(e,["prefixCls","className","rootClassName","style","children","icon","color","onClose","closeIcon","closable","bordered"]),{getPrefixCls:W,direction:z}=c.useContext(V.E_),[H,T]=c.useState(!0);c.useEffect(()=>{"visible"in r&&T(r.visible)},[r.visible]);const G=(0,B.o2)(K)||(0,B.yT)(K),F=Object.assign({backgroundColor:K&&!G?K:void 0},j),d=W("tag",s),[h,k]=U(d),C=w()(d,{[`${d}-${K}`]:G,[`${d}-has-color`]:K&&!G,[`${d}-hidden`]:!H,[`${d}-rtl`]:z==="rtl",[`${d}-borderless`]:!se},u,i,k),_=Y=>{Y.stopPropagation(),N==null||N(Y),!Y.defaultPrevented&&T(!1)},$=c.useMemo(()=>ie?b?c.createElement("span",{className:`${d}-close-icon`,onClick:_},b):c.createElement(E.Z,{className:`${d}-close-icon`,onClick:_}):null,[ie,b,d,_]),J=typeof r.onClick=="function"||O&&O.type==="a",ee=ne||null,oe=ee?c.createElement(c.Fragment,null,ee,c.createElement("span",null,O)):O,le=c.createElement("span",Object.assign({},r,{ref:v,className:C,style:F}),oe,$);return h(J?c.createElement(f.Z,null,le):le)},R=c.forwardRef(Q);R.CheckableTag=ue;var q=R}}]);