Files
Sillyv2/core/admin/p__Proxy__index.414b0326.async.js
T
cdle 2f38b8393e x
2023-07-06 09:22:52 +08:00

2 lines
18 KiB
JavaScript

"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[583],{96642:function(ae,w,r){var E=r(75782),T=r(58733),K=r(50959),u=r(72961),B=r(11527),j=["fieldProps","min","proFieldProps","max"],U=function(y,W){var G=y.fieldProps,o=y.min,O=y.proFieldProps,d=y.max,L=(0,T.Z)(y,j);return(0,B.jsx)(u.Z,(0,E.Z)({valueType:"digit",fieldProps:(0,E.Z)({min:o,max:d},G),ref:W,filedConfig:{defaultProps:{width:"100%"}},proFieldProps:O},L))},A=K.forwardRef(U);w.Z=A},59419:function(ae,w,r){var E=r(75782),T=r(58733),K=r(18518),u=r(50959),B=r(60061),j=r(72961),U=r(11527),A=["fieldProps","children","params","proFieldProps","mode","valueEnum","request","showSearch","options"],z=["fieldProps","children","params","proFieldProps","mode","valueEnum","request","options"],y=u.forwardRef(function(d,L){var Y=d.fieldProps,ne=d.children,_=d.params,q=d.proFieldProps,R=d.mode,S=d.valueEnum,V=d.request,e=d.showSearch,c=d.options,l=(0,T.Z)(d,A),a=(0,u.useContext)(B.Z);return(0,U.jsx)(j.Z,(0,E.Z)((0,E.Z)({valueEnum:(0,K.h)(S),request:V,params:_,valueType:"select",filedConfig:{customLightMode:!0},fieldProps:(0,E.Z)({options:c,mode:R,showSearch:e,getPopupContainer:a.getPopupContainer},Y),ref:L,proFieldProps:q},l),{},{children:ne}))}),W=u.forwardRef(function(d,L){var Y=d.fieldProps,ne=d.children,_=d.params,q=d.proFieldProps,R=d.mode,S=d.valueEnum,V=d.request,e=d.options,c=(0,T.Z)(d,z),l=(0,E.Z)({options:e,mode:R||"multiple",labelInValue:!0,showSearch:!0,showArrow:!1,autoClearSearchValue:!0,optionLabelProp:"label"},Y),a=(0,u.useContext)(B.Z);return(0,U.jsx)(j.Z,(0,E.Z)((0,E.Z)({valueEnum:(0,K.h)(S),request:V,params:_,valueType:"select",filedConfig:{customLightMode:!0},fieldProps:(0,E.Z)({getPopupContainer:a.getPopupContainer},l),ref:L,proFieldProps:q},c),{},{children:ne}))}),G=y,o=W,O=G;O.SearchSelect=o,O.displayName="ProFormComponent",w.Z=O},40792:function(ae,w,r){var E=r(75782),T=r(58733),K=r(50959),u=r(72961),B=r(11527),j=["fieldProps","unCheckedChildren","checkedChildren","proFieldProps"],U=K.forwardRef(function(A,z){var y=A.fieldProps,W=A.unCheckedChildren,G=A.checkedChildren,o=A.proFieldProps,O=(0,T.Z)(A,j);return(0,B.jsx)(u.Z,(0,E.Z)({valueType:"switch",fieldProps:(0,E.Z)({unCheckedChildren:W,checkedChildren:G},y),ref:z,valuePropName:"checked",proFieldProps:o,filedConfig:{valuePropName:"checked",ignoreWidth:!0}},O))});w.Z=U},66732:function(ae,w,r){var E=r(75782),T=r(58733),K=r(50959),u=r(72961),B=r(11527),j=["fieldProps","proFieldProps"],U=["fieldProps","proFieldProps"],A="text",z=function(o){var O=o.fieldProps,d=o.proFieldProps,L=(0,T.Z)(o,j);return(0,B.jsx)(u.Z,(0,E.Z)({valueType:A,fieldProps:O,filedConfig:{valueType:A},proFieldProps:d},L))},y=function(o){var O=o.fieldProps,d=o.proFieldProps,L=(0,T.Z)(o,U);return(0,B.jsx)(u.Z,(0,E.Z)({valueType:"password",fieldProps:O,proFieldProps:d,filedConfig:{valueType:A}},L))},W=z;W.Password=y,W.displayName="ProFormComponent",w.Z=W},82730:function(ae,w,r){r.r(w),r.d(w,{default:function(){return oe}});var E=r(25359),T=r.n(E),K=r(49811),u=r.n(K),B=r(54306),j=r.n(B),U=r(27693),z={randomUUID:typeof crypto!="undefined"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let y;const W=new Uint8Array(16);function G(){if(!y&&(y=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!y))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return y(W)}const o=[];for(let n=0;n<256;++n)o.push((n+256).toString(16).slice(1));function O(n,s=0){return(o[n[s+0]]+o[n[s+1]]+o[n[s+2]]+o[n[s+3]]+"-"+o[n[s+4]]+o[n[s+5]]+"-"+o[n[s+6]]+o[n[s+7]]+"-"+o[n[s+8]]+o[n[s+9]]+"-"+o[n[s+10]]+o[n[s+11]]+o[n[s+12]]+o[n[s+13]]+o[n[s+14]]+o[n[s+15]]).toLowerCase()}function d(n,s=0){const b=O(n,s);if(!validate(b))throw TypeError("Stringified UUID is invalid");return b}var L=null;function Y(n,s,b){if(z.randomUUID&&!s&&!n)return z.randomUUID();n=n||{};const x=n.random||(n.rng||G)();if(x[6]=x[6]&15|64,x[8]=x[8]&63|128,s){b=b||0;for(let m=0;m<16;++m)s[b+m]=x[m];return s}return O(x)}var ne=Y,_=r(12472),q=r(19646),R=r(81308),S=r(66732),V=r(59419),e=r(24176),c=r(96642),l=r(40792),a=r(86195),i=r(4050),M=r(833),v=r(21362),ee=r(68243),N=r(26572),H=r(79112),g=r(50959),t=r(11527),oe=function(){var n=(0,g.useRef)(),s=(0,g.useState)(le),b=j()(s,2),x=b[0],m=b[1],te=[{title:"\u7F16\u53F7",dataIndex:"index",key:"index"},{title:"\u540D\u79F0",dataIndex:"name",key:"name"},{title:"\u7C7B\u578B",dataIndex:"type",key:"type",render:function(Z,p){return(0,t.jsx)(i.Z,{color:"purple",children:Z})}},{title:"\u670D\u52A1\u5668",dataIndex:"server",key:"server"},{title:"\u7AEF\u53E3",dataIndex:"port",key:"port"},{title:"\u5907\u6CE8",dataIndex:"remark",key:"remark"},{title:"\u521B\u5EFA\u65E5\u671F",dataIndex:"created_at",key:"created_at",render:function(Z,p){return(0,t.jsx)("span",{children:new Date(Z*1e3).toLocaleDateString()})}},{title:"\u542F\u7528",dataIndex:"enable",key:"enable",renderFormItem:function(){return(0,t.jsx)(M.Z,{disabled:!0,defaultChecked:!1})},render:function(Z,p){return(0,t.jsx)(M.Z,{onChange:function($){p.enable=$;var h={};h[p.id]=p,(0,a.request)("/api/storage",{method:"put",data:h}).then(function(C){var f,P,Q=!1;for(var J in C.errors)Q=!0,v.ZP.warning(C.errors[J],10);var F=!0;for(var ie in C.messages)F=!0,v.ZP.info(C.messages[ie],10);!Q&&!F&&v.ZP.success("\u63D0\u4EA4\u6210\u529F\uFF01",1),(f=n.current)===null||f===void 0||(P=f.reloadAndRest)===null||P===void 0||P.call(f)})},defaultChecked:p==null?void 0:p.enable})}},{title:"\u64CD\u4F5C",valueType:"option",width:"10%",render:function(Z,p){return[(0,t.jsx)("a",{onClick:function(){return m(p)},children:"\u7F16\u8F91"},"more"),(0,t.jsx)("a",{onClick:function(){var $={};$[p.id]="",(0,a.request)("/api/storage",{method:"put",data:$}).then(function(h){var C,f,P=!1;for(var Q in h.errors)P=!0,v.ZP.warning(h.errors[Q],10);var J=!0;for(var F in h.messages)J=!0,v.ZP.info(h.messages[F],10);!P&&!J&&v.ZP.success("\u63D0\u4EA4\u6210\u529F\uFF01",1),(C=n.current)===null||C===void 0||(f=C.reloadAndRest)===null||f===void 0||f.call(C)})},children:"\u5220\u9664"},"delete")]}}];return(0,t.jsxs)(_._z,{content:"\u4EE3\u7406\u5217\u8868",children:[(0,t.jsx)(ee.Z,{style:{marginBottom:10},children:(0,t.jsx)(N.ZP,{type:"primary",onClick:function(){m(de)},icon:(0,t.jsx)(U.Z,{}),children:"\u65B0\u5EFA\u4E00\u884C"})}),(0,t.jsx)(q.Z,{search:!1,actionRef:n,rowKey:function(Z){return Z.id},columns:te,request:u()(T()().mark(function D(){var Z,p=arguments;return T()().wrap(function($){for(;;)switch($.prev=$.next){case 0:return Z=p.length>0&&p[0]!==void 0?p[0]:{},$.abrupt("return",(0,a.request)("/api/storage?keys=proxies",{params:Z}).then(function(h){var C=[],f=0;for(var P in h.data)f++,h.data[P].id=P,h.data[P].index=f,C.push(h.data[P]);return h.data=C,h}));case 2:case"end":return $.stop()}},D)}))}),x.id!="-1"&&(0,t.jsx)(X,{open:x.id!="-1",data:x,onCancel:function(){return m(le)},onFinish:function(){var D=u()(T()().mark(function Z(p){var k;return T()().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:k={},x.id==""&&(x.id="proxies."+ne()),k[x.id]=p,(0,a.request)("/api/storage",{method:"put",data:k}).then(function(C){var f,P,Q=!1;for(var J in C.errors)Q=!0,v.ZP.warning(C.errors[J],4);var F=!0;for(var ie in C.messages)F=!0,v.ZP.info(C.messages[ie],4);!Q&&!F&&v.ZP.success("\u63D0\u4EA4\u6210\u529F\uFF01",1),m(le),(f=n.current)===null||f===void 0||(P=f.reloadAndRest)===null||P===void 0||P.call(f)});case 4:case"end":return h.stop()}},Z)}));return function(Z){return D.apply(this,arguments)}}()})]})};function X(n){var s,b,x,m,te,D,Z=(0,g.useState)({}),p=j()(Z,2),k=p[0],$=p[1],h=(0,g.useState)({}),C=j()(h,2),f=C[0],P=C[1],Q=(0,g.useState)(n.data.type),J=j()(Q,2),F=J[0],ie=J[1],se=(0,g.useRef)(),fe=(0,g.useState)((s=(b=n.data)===null||b===void 0?void 0:b.plugin)!==null&&s!==void 0?s:""),ve=j()(fe,2),Pe=ve[0],Ee=ve[1],xe=(0,g.useState)((x=n.data["plugin-opts"])===null||x===void 0?void 0:x.mode),he=j()(xe,2),ge=he[0],Ce=he[1];return(0,g.useEffect)(function(){return(0,a.request)("/api/proxy/scripts").then(function(ue){ue.data&&$(ue.data)}),function(){}},[]),(0,t.jsx)(H.Z,{title:n.data.id==0?"\u521B\u5EFA":"\u7F16\u8F91",open:!0,onCancel:n.onCancel,onOk:function(){var I;n.onFinish(se==null||(I=se.current)===null||I===void 0?void 0:I.getFieldsValue())},children:(0,t.jsxs)(R.A,{formRef:se,onValuesChange:function(I){if("type"in I&&ie(I.type),"plugin"in I){var re,ce,Fe=(re=I==null?void 0:I.plugin)!==null&&re!==void 0?re:"";Ee(Fe),(ce=se.current)===null||ce===void 0||ce.setFieldValue("plugin-opts",{}),Ce("")}if(console.log(I),"plugin-opts"in I&&"mode"in I["plugin-opts"]){var me,pe,ye=(me=(pe=I["plugin-opts"])===null||pe===void 0?void 0:pe.mode)!==null&&me!==void 0?me:"";Ce(ye)}},onFinish:n.onFinish,submitter:!1,children:[(0,t.jsxs)(R.A.Group,{title:"\u63CF\u8FF0",children:[(0,t.jsx)(S.Z,{tooltip:"\u7CFB\u7EDF\u552F\u4E00\u4E0D\u53EF\u66F4\u6539\uFF0C\u53EA\u80FD\u5220\u9664\u3002",name:"id",initialValue:n.data.id,label:"\u7FA4\u7EC4ID",hidden:!0}),(0,t.jsx)(S.Z,{name:"name",initialValue:n.data.name,label:"\u540D\u79F0",required:!0}),(0,t.jsx)(S.Z,{name:"remark",initialValue:n.data.remark,label:"\u5907\u6CE8",rules:[{message:"\u8BF7\u586B\u5199\u7FA4\u5907\u6CE8"}]})]}),(0,t.jsx)(R.A.Group,{children:(0,t.jsx)(V.Z,{tooltip:"\u5E73\u53F0\u63A5\u5165\u7CFB\u7EDF\u540E\u5C06\u81EA\u52A8\u51FA\u73B0\u5728\u5217\u8868\u4E2D\u3002",initialValue:n.data.type,valueEnum:{http:"Http",socks5:"Socks5",trojan:"Trojan",vmess:"Vmess",ss:"Shadowsocks",ssr:"ShadowSocksR",snell:"Snell"},width:"md",name:"type",label:"\u7C7B\u578B",required:!0})}),(0,t.jsxs)(e.UW,{title:"\u4EE3\u7406\u53C2\u6570",children:[(0,t.jsx)(S.Z,{name:"server",initialValue:n.data.server,label:"\u5730\u5740",required:!0}),(0,t.jsx)(c.Z,{name:"port",initialValue:n.data.port,label:"\u7AEF\u53E3",required:!0}),["http","socks5"].includes(F)&&(0,t.jsx)(S.Z,{name:"username",initialValue:n.data.username,label:"\u7528\u6237"}),["snell"].includes(F)&&(0,t.jsx)(S.Z,{name:"psk",initialValue:n.data.psk,label:"\u9884\u5171\u4EAB\u5BC6\u94A5"}),["http","ss","socks5","trojan"].includes(F)&&(0,t.jsx)(S.Z,{name:"password",initialValue:n.data.password,label:"\u5BC6\u7801"}),["vmess"].includes(F)&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(c.Z,{name:"uuid",initialValue:n.data.uuid,label:"UUID"}),(0,t.jsx)(c.Z,{name:"alterId",initialValue:n.data.alterId,label:"AlterId"})]}),["vmess","trojan"].includes(F)&&(0,t.jsx)(l.Z,{name:"skip-cert-verify",initialValue:n.data["skip-cert-verify"],label:"\u8DF3\u8FC7\u8BC1\u4E66\u9A8C\u8BC1"}),["http","ss","vmess","socks5"].includes(F)&&(0,t.jsx)(l.Z,{name:"tls",initialValue:n.data.tls,label:"TLS"}),["vmess","trojan"].includes(F)&&(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(V.Z,{name:"network",initialValue:n.data.network,label:"\u4F20\u8F93\u65B9\u5F0F",width:"sm",valueEnum:Object.assign({ws:"WebSocket"},F=="vmess"?{h2:"HTTP/2"}:{http:"Http"})})}),["ss","vmess","ssr"].includes(F)&&(0,t.jsx)(V.Z,{name:"cipher",initialValue:n.data.tls?n.data.tls:"none",label:"\u52A0\u5BC6\u65B9\u5F0F",width:"md",valueEnum:F=="vmess"?{none:"none",auto:"Auto","chacha20-poly1305":"ChaCha20-Poly1305","aes-128-gcm":"AES-128-GCM"}:{"aes-128-gcm":"AES-128-GCM","aes-192-gcm":"AES-192-GCM","aes-256-gcm":"AES-256-GCM","aes-128-cfb":"AES-128-CFB","aes-192-cfb":"AES-192-CFB","aes-256-cfb":"AES-256-CFB","aes-128-ctr":"AES-128-CTR","aes-192-ctr":"AES-192-CTR","aes-256-ctr":"AES-256-CTR","rc4-md5":"RC4-MD5","chacha20-ietf":"ChaCha20-IETF",xchacha20:"XChaCha20","chacha20-ietf-poly1305":"ChaCha20-IETF-Poly1305","xchacha20-ietf-poly1305":"XChaCha20-IETF-Poly1305"}}),["ss"].includes(F)&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(V.Z,{name:"plugin",initialValue:(m=n.data.plugin)!==null&&m!==void 0?m:"",label:"\u63D2\u4EF6",width:"md",valueEnum:{"":"none",obfs:"obfs","v2ray-plugin":"v2ray-plugin"}}),Pe!=""&&(0,t.jsxs)(e.UW,{title:"\u63D2\u4EF6\u53C2\u6570",children:[(0,t.jsx)(R.A.Group,{children:(0,t.jsx)(V.Z,{name:["plugin-opts","mode"],label:"\u6A21\u5F0F",width:"md",valueEnum:{"":"none",tls:"TLS",http:"Http",websocket:"Websocket"}})}),["websocket"].includes(ge)&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(R.A.Group,{children:[(0,t.jsx)(l.Z,{label:"TLS",name:["plugin-opts","tls"]}),(0,t.jsx)(l.Z,{label:"\u8DF3\u8FC7\u8BC1\u4E66\u9A8C\u8BC1",name:["plugin-opts","skip-cert-verify"]})]}),(0,t.jsxs)(R.A.Group,{children:[(0,t.jsx)(l.Z,{label:"WebSocket",name:["plugin-opts","wss"]}),(0,t.jsx)(S.Z,{label:"\u4E3B\u673A(Host)",name:["plugin-opts","host"]}),(0,t.jsx)(S.Z,{label:"\u8DEF\u5F84(Path)",name:["plugin-opts","path"]}),(0,t.jsx)(l.Z,{label:"\u591A\u8DEF\u590D\u7528(Mux)",name:["plugin-opts","mux"]})]}),(0,t.jsx)(R.A.Group,{children:(0,t.jsx)(S.Z,{label:"\u81EA\u5B9A\u4E49\u8BF7\u6C42\u5934(Headers)",name:["plugin-opts","headers","custom"]})})]}),["http","tls"].includes(ge)&&(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(R.A.Group,{children:(0,t.jsx)(S.Z,{label:"\u4E3B\u673A(Host)",name:["plugin-opts","host"]})})})]})]})]}),(0,t.jsxs)(e.UW,{title:"\u652F\u63F4\u65B9\u5F0F",children:[(0,t.jsx)(V.Z,{initialValue:(te=n.data.rules)!==null&&te!==void 0?te:[],tooltip:"\u8F93\u5165\uFF0C\u56DE\u8F66\u6216\u70B9\u51FB\u9009\u62E9\u4EE5\u6DFB\u52A0\u6570\u636E",name:"rules",label:"\u57DF\u540D&IP",fieldProps:{mode:"multiple",showSearch:!0,onSearch:function(I){(0,a.request)("/api/proxy/rules?keyword="+I).then(function(re){re&&re.data&&P(re.data)})}},width:"lg",valueEnum:f}),(0,t.jsx)(V.Z,{initialValue:(D=n.data.plugins)!==null&&D!==void 0?D:[],name:"plugins",label:"\u811A\u672C",width:"lg",fieldProps:{mode:"multiple"},valueEnum:k})]})]})},n.data.chat_id)}var le={id:"-1",index:0,type:"",server:"",port:0,name:""},de={id:"",index:0,type:"",server:"",port:0,name:"",enable:!0}},4050:function(ae,w,r){r.d(w,{Z:function(){return V}});var E=r(96157),T=r(84875),K=r.n(T),u=r(50959),B=r(85548),j=r(78862),U=r(70458);function A(e){return typeof e!="string"?e:e.charAt(0).toUpperCase()+e.slice(1)}var z=r(49272),y=r(42498),W=r(97624),G=r(74074);const o=(e,c,l)=>{const a=A(l);return{[`${e.componentCls}-${c}`]:{color:e[`color${l}`],background:e[`color${a}Bg`],borderColor:e[`color${a}Border`]}}},O=e=>(0,y.Z)(e,(c,l)=>{let{textColor:a,lightBorderColor:i,lightColor:M,darkColor:v}=l;return{[`${e.componentCls}-${c}`]:{color:a,background:M,borderColor:i,"&-inverse":{color:e.colorTextLightSolid,background:v,borderColor:v},[`&${e.componentCls}-borderless`]:{borderColor:"transparent"}}}}),d=e=>{const{paddingXXS:c,lineWidth:l,tagPaddingHorizontal:a,componentCls:i}=e,M=a-l,v=c-l;return{[i]:Object.assign(Object.assign({},(0,z.Wf)(e)),{display:"inline-block",height:"auto",marginInlineEnd:e.marginXS,paddingInline:M,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:v,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:M}}),[`${i}-borderless`]:{borderColor:"transparent",background:e.tagBorderlessBg}}};var L=(0,W.Z)("Tag",e=>{const{fontSize:c,lineHeight:l,lineWidth:a,fontSizeIcon:i}=e,M=Math.round(c*l),v=e.fontSizeSM,ee=M-a*2,N=e.colorFillQuaternary,H=e.colorText,g=(0,G.TS)(e,{tagFontSize:v,tagLineHeight:ee,tagDefaultBg:N,tagDefaultColor:H,tagIconSize:i-2*a,tagPaddingHorizontal:8,tagBorderlessBg:e.colorFillTertiary});return[d(g),O(g),o(g,"success","Success"),o(g,"processing","Info"),o(g,"error","Error"),o(g,"warning","Warning")]}),Y=function(e,c){var l={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&c.indexOf(a)<0&&(l[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,a=Object.getOwnPropertySymbols(e);i<a.length;i++)c.indexOf(a[i])<0&&Object.prototype.propertyIsEnumerable.call(e,a[i])&&(l[a[i]]=e[a[i]]);return l},_=e=>{const{prefixCls:c,className:l,checked:a,onChange:i,onClick:M}=e,v=Y(e,["prefixCls","className","checked","onChange","onClick"]),{getPrefixCls:ee}=u.useContext(U.E_),N=X=>{i==null||i(!a),M==null||M(X)},H=ee("tag",c),[g,t]=L(H),oe=K()(H,{[`${H}-checkable`]:!0,[`${H}-checkable-checked`]:a},l,t);return g(u.createElement("span",Object.assign({},v,{className:oe,onClick:N})))},q=function(e,c){var l={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&c.indexOf(a)<0&&(l[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,a=Object.getOwnPropertySymbols(e);i<a.length;i++)c.indexOf(a[i])<0&&Object.prototype.propertyIsEnumerable.call(e,a[i])&&(l[a[i]]=e[a[i]]);return l};const R=(e,c)=>{const{prefixCls:l,className:a,rootClassName:i,style:M,children:v,icon:ee,color:N,onClose:H,closeIcon:g,closable:t=!1,bordered:oe=!0}=e,X=q(e,["prefixCls","className","rootClassName","style","children","icon","color","onClose","closeIcon","closable","bordered"]),{getPrefixCls:le,direction:de}=u.useContext(U.E_),[n,s]=u.useState(!0);u.useEffect(()=>{"visible"in X&&s(X.visible)},[X.visible]);const b=(0,B.o2)(N)||(0,B.yT)(N),x=Object.assign({backgroundColor:N&&!b?N:void 0},M),m=le("tag",l),[te,D]=L(m),Z=K()(m,{[`${m}-${N}`]:b,[`${m}-has-color`]:N&&!b,[`${m}-hidden`]:!n,[`${m}-rtl`]:de==="rtl",[`${m}-borderless`]:!oe},a,i,D),p=P=>{P.stopPropagation(),H==null||H(P),!P.defaultPrevented&&s(!1)},k=u.useMemo(()=>t?g?u.createElement("span",{className:`${m}-close-icon`,onClick:p},g):u.createElement(E.Z,{className:`${m}-close-icon`,onClick:p}):null,[t,g,m,p]),$=typeof X.onClick=="function"||v&&v.type==="a",h=ee||null,C=h?u.createElement(u.Fragment,null,h,u.createElement("span",null,v)):v,f=u.createElement("span",Object.assign({},X,{ref:c,className:Z,style:x}),C,k);return te($?u.createElement(j.Z,null,f):f)},S=u.forwardRef(R);S.CheckableTag=_;var V=S}}]);