@gientech/modual 2.2.21 → 2.2.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/assets/GientechStreamReader-Bmx4xCIT.js +151 -0
  2. package/assets/{circle-plus-P1B4Xn23.js → circle-plus-2ioHM-Sb.js} +1 -1
  3. package/assets/index-B2xoLI6Z.js +535 -0
  4. package/assets/index-BAXnOsup.js +157 -0
  5. package/assets/{x-cAgrXVQW.js → loader-circle-B52xZ7Tn.js} +2 -2
  6. package/assets/{plus-Dksaa79Q.js → plus-Cok3acFd.js} +1 -1
  7. package/assets/{search-DPX4n-TM.js → search-BfgWf2Me.js} +1 -1
  8. package/assets/style-_hD7QhoC.js +332 -0
  9. package/assets/{triangle-alert-DwIOmwma.js → triangle-alert-Dm0U8aST.js} +1 -1
  10. package/assets/x-CX-iE6EL.js +26 -0
  11. package/assistantConfig.js +1 -152
  12. package/chat.js +1 -1
  13. package/chatCompare.js +1 -1
  14. package/database.js +2 -2
  15. package/databaseId.js +16 -1
  16. package/databaseTable.js +2 -2
  17. package/index.js +1 -1
  18. package/modelManage.js +2 -2
  19. package/package.json +17 -1
  20. package/sensitive.js +30 -50
  21. package/sensitiveWords.js +1 -1
  22. package/streamFilesReader.js +1 -1
  23. package/assets/GientechStreamReader-CCAVgoU7.js +0 -449
  24. package/assets/LeftOutlined-6ZZOHHzZ.js +0 -1
  25. package/assets/index-AbRL5gZq.js +0 -27
  26. package/assets/index-BVGi9GLj.js +0 -6
  27. package/assets/index-CshF4ZrU.js +0 -1519
  28. package/assets/index-Cxdo0VA9.js +0 -16
  29. package/assets/index-DBBlFPQ7.js +0 -13
  30. package/assets/index-DBcQE2Ji.js +0 -1
  31. package/assets/index-DSsXFuyz.js +0 -943
  32. package/assets/index-DXFiVEll.js +0 -2177
  33. package/assets/index-D_Hj7QNz.js +0 -285
  34. package/assets/index-DgYjqte0.js +0 -745
  35. package/assets/index-VLFjDTvh.js +0 -1
  36. package/assets/style-403S9iLe.js +0 -196
package/sensitive.js CHANGED
@@ -1,40 +1,20 @@
1
- import{jsxs as le,jsx as I,Fragment as ir}from"react/jsx-runtime";import*as l from"react";import Ee,{useRef as je,useEffect as ot,Component as Bt,useState as me,useCallback as pe,useMemo as Me}from"react";import{c as It,Q as sr,ay as lr,a6 as Ae,U as tt,L as Pt,_ as he,f as ee,aN as rt,T as kt,g as Lt,m as Ot,r as Tt,q as de,o as nt,aO as cr,C as Ue,az as Nt,as as ur,av as dr,at as pr,aP as mr,I as Oe,O as fr,aQ as Ce,aR as ie,A as ge,aS as _t,aT as Mt,aU as jt,V as Y,aV as oe,aW as Rt,N as gr,aG as zt,aX as Wt,aY as hr,aZ as gt,a_ as vr,a$ as br,t as Ut,b0 as yr,b1 as Cr,am as Fr,l as ht,H as vt,aq as bt,u as wr,b2 as $r,j as Er,ag as xr,aK as Sr,F as Dr,d as ce,p as it,G as st,J as Ke,x as Ar,v as yt}from"./assets/index-D_Hj7QNz.js";import{o as Br}from"./assets/index-DgYjqte0.js";import{$ as ye,z as Ir}from"./assets/index-CshF4ZrU.js";import{s as ne,M as lt}from"./assets/index-Cxdo0VA9.js";import{flushSync as Ct}from"react-dom";import{C as Pr}from"./assets/circle-plus-P1B4Xn23.js";import{S as Ht}from"./assets/search-DPX4n-TM.js";import{X as kr}from"./assets/x-cAgrXVQW.js";import{P as qt}from"./assets/plus-Dksaa79Q.js";import{D as Lr}from"./assets/index-AbRL5gZq.js";/* empty css */import"./assets/LeftOutlined-6ZZOHHzZ.js";/**
1
+ import{jsxs as B,jsx as s,Fragment as Ee}from"react/jsx-runtime";import ue,{useState as _,useRef as Ce,useEffect as be,useCallback as k,useMemo as ee}from"react";import v from"styled-components";import{message as b,Upload as Ae,Input as de,Modal as pe,Dropdown as we,Form as ce}from"antd";import{Xviwer as ye}from"@mxmweb/xviewer";import{defaultTheme as Fe,Button as z,useTheme as Se,deepMergeTheme as ge,DashboardContainer as ke}from"@mxmweb/zui";import _e from"axios";import{C as Te}from"./assets/circle-plus-2ioHM-Sb.js";import{c as De,X as Le}from"./assets/x-CX-iE6EL.js";import{S as xe}from"./assets/search-BfgWf2Me.js";import{P as Be}from"./assets/plus-Cok3acFd.js";/* empty css *//**
2
2
  * @license lucide-react v0.456.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
5
5
  * See the LICENSE file in the root directory of this source tree.
6
- */const Or=It("FileUp",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"m15 15-3-3-3 3",key:"15xj92"}]]);/**
6
+ */const Ie=De("FileUp",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"m15 15-3-3-3 3",key:"15xj92"}]]);/**
7
7
  * @license lucide-react v0.456.0 - ISC
8
8
  *
9
9
  * This source code is licensed under the ISC license.
10
10
  * See the LICENSE file in the root directory of this source tree.
11
- */const Ft=It("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);var Tr={percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,trailColor:"#D9D9D9",trailWidth:1,gapPosition:"bottom"},Nr=function(){var t=je([]),n=je(null);return ot(function(){var a=Date.now(),o=!1;t.current.forEach(function(r){if(r){o=!0;var s=r.style;s.transitionDuration=".3s, .3s, .3s, .06s",n.current&&a-n.current<100&&(s.transitionDuration="0s, 0s")}}),o&&(n.current=Date.now())}),t.current},wt=0,_r=lr();function Mr(){var e;return _r?(e=wt,wt+=1):e="TEST_OR_SSR",e}const jr=(function(e){var t=l.useState(),n=sr(t,2),a=n[0],o=n[1];return l.useEffect(function(){o("rc_progress_".concat(Mr()))},[]),e||a});var $t=function(t){var n=t.bg,a=t.children;return l.createElement("div",{style:{width:"100%",height:"100%",background:n}},a)};function Et(e,t){return Object.keys(e).map(function(n){var a=parseFloat(n),o="".concat(Math.floor(a*t),"%");return"".concat(e[n]," ").concat(o)})}var Rr=l.forwardRef(function(e,t){var n=e.prefixCls,a=e.color,o=e.gradientId,r=e.radius,s=e.style,i=e.ptg,u=e.strokeLinecap,d=e.strokeWidth,p=e.size,g=e.gapDegree,b=a&&Ae(a)==="object",y=b?"#FFF":void 0,c=p/2,m=l.createElement("circle",{className:"".concat(n,"-circle-path"),r,cx:c,cy:c,stroke:y,strokeLinecap:u,strokeWidth:d,opacity:i===0?0:1,style:s,ref:t});if(!b)return m;var f="".concat(o,"-conic"),v=g?"".concat(180+g/2,"deg"):"0deg",w=Et(a,(360-g)/360),x=Et(a,1),$="conic-gradient(from ".concat(v,", ").concat(w.join(", "),")"),h="linear-gradient(to ".concat(g?"bottom":"top",", ").concat(x.join(", "),")");return l.createElement(l.Fragment,null,l.createElement("mask",{id:f},m),l.createElement("foreignObject",{x:0,y:0,width:p,height:p,mask:"url(#".concat(f,")")},l.createElement($t,{bg:h},l.createElement($t,{bg:$}))))}),Pe=100,Je=function(t,n,a,o,r,s,i,u,d,p){var g=arguments.length>10&&arguments[10]!==void 0?arguments[10]:0,b=a/100*360*((360-s)/360),y=s===0?0:{bottom:0,top:180,left:90,right:-90}[i],c=(100-o)/100*n;d==="round"&&o!==100&&(c+=p/2,c>=n&&(c=n-.01));var m=Pe/2;return{stroke:typeof u=="string"?u:void 0,strokeDasharray:"".concat(n,"px ").concat(t),strokeDashoffset:c+g,transform:"rotate(".concat(r+b+y,"deg)"),transformOrigin:"".concat(m,"px ").concat(m,"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s",fillOpacity:0}},zr=["id","prefixCls","steps","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"];function xt(e){var t=e??[];return Array.isArray(t)?t:[t]}var Wr=function(t){var n=tt(tt({},Tr),t),a=n.id,o=n.prefixCls,r=n.steps,s=n.strokeWidth,i=n.trailWidth,u=n.gapDegree,d=u===void 0?0:u,p=n.gapPosition,g=n.trailColor,b=n.strokeLinecap,y=n.style,c=n.className,m=n.strokeColor,f=n.percent,v=Pt(n,zr),w=Pe/2,x=jr(a),$="".concat(x,"-gradient"),h=w-s/2,B=Math.PI*2*h,A=d>0?90+d/2:-90,L=B*((360-d)/360),W=Ae(r)==="object"?r:{count:r,gap:2},S=W.count,te=W.gap,ae=xt(f),K=xt(m),J=K.find(function(O){return O&&Ae(O)==="object"}),G=J&&Ae(J)==="object",q=G?"butt":b,H=Je(B,L,0,100,A,d,p,g,q,s),Z=Nr(),T=function(){var X=0;return ae.map(function(E,P){var z=K[P]||K[K.length-1],re=Je(B,L,X,E,A,d,p,z,q,s);return X+=E,l.createElement(Rr,{key:P,color:z,ptg:E,radius:h,prefixCls:o,gradientId:$,style:re,strokeLinecap:q,strokeWidth:s,gapDegree:d,ref:function(D){Z[P]=D},size:Pe})}).reverse()},F=function(){var X=Math.round(S*(ae[0]/100)),E=100/S,P=0;return new Array(S).fill(null).map(function(z,re){var ue=re<=X-1?K[0]:g,D=ue&&Ae(ue)==="object"?"url(#".concat($,")"):void 0,C=Je(B,L,P,E,A,d,p,ue,"butt",s,te);return P+=(L-C.strokeDashoffset+te)*100/L,l.createElement("circle",{key:re,className:"".concat(o,"-circle-path"),r:h,cx:w,cy:w,stroke:D,strokeWidth:s,opacity:1,style:C,ref:function(N){Z[re]=N}})})};return l.createElement("svg",he({className:ee("".concat(o,"-circle"),c),viewBox:"0 0 ".concat(Pe," ").concat(Pe),style:y,id:a,role:"presentation"},v),!S&&l.createElement("circle",{className:"".concat(o,"-circle-trail"),r:h,cx:w,cy:w,stroke:g,strokeLinecap:q,strokeWidth:i||s,style:H}),S?F():T())};function Fe(e){return!e||e<0?0:e>100?100:e}function Re({success:e,successPercent:t}){let n=t;return e&&"progress"in e&&(n=e.progress),e&&"percent"in e&&(n=e.percent),n}const Ur=({percent:e,success:t,successPercent:n})=>{const a=Fe(Re({success:t,successPercent:n}));return[a,Fe(Fe(e)-a)]},Hr=({success:e={},strokeColor:t})=>{const{strokeColor:n}=e;return[n||rt.green,t||null]},He=(e,t,n)=>{var a,o,r,s;let i=-1,u=-1;if(t==="step"){const d=n.steps,p=n.strokeWidth;typeof e=="string"||typeof e>"u"?(i=e==="small"?2:14,u=p??8):typeof e=="number"?[i,u]=[e,e]:[i=14,u=8]=Array.isArray(e)?e:[e.width,e.height],i*=d}else if(t==="line"){const d=n==null?void 0:n.strokeWidth;typeof e=="string"||typeof e>"u"?u=d||(e==="small"?6:8):typeof e=="number"?[i,u]=[e,e]:[i=-1,u=8]=Array.isArray(e)?e:[e.width,e.height]}else(t==="circle"||t==="dashboard")&&(typeof e=="string"||typeof e>"u"?[i,u]=e==="small"?[60,60]:[120,120]:typeof e=="number"?[i,u]=[e,e]:Array.isArray(e)&&(i=(o=(a=e[0])!==null&&a!==void 0?a:e[1])!==null&&o!==void 0?o:120,u=(s=(r=e[0])!==null&&r!==void 0?r:e[1])!==null&&s!==void 0?s:120));return[i,u]},qr=3,Xr=e=>qr/e*100,Vr=e=>{const{prefixCls:t,trailColor:n=null,strokeLinecap:a="round",gapPosition:o,gapDegree:r,width:s=120,type:i,children:u,success:d,size:p=s,steps:g}=e,[b,y]=He(p,"circle");let{strokeWidth:c}=e;c===void 0&&(c=Math.max(Xr(b),6));const m={width:b,height:y,fontSize:b*.15+6},f=l.useMemo(()=>{if(r||r===0)return r;if(i==="dashboard")return 75},[r,i]),v=Ur(e),w=o||i==="dashboard"&&"bottom"||void 0,x=Object.prototype.toString.call(e.strokeColor)==="[object Object]",$=Hr({success:d,strokeColor:e.strokeColor}),h=ee(`${t}-inner`,{[`${t}-circle-gradient`]:x}),B=l.createElement(Wr,{steps:g,percent:g?v[1]:v,strokeWidth:c,trailWidth:c,strokeColor:g?$[1]:$,strokeLinecap:a,trailColor:n,prefixCls:t,gapDegree:f,gapPosition:w}),A=b<=20,L=l.createElement("div",{className:h,style:m},B,!A&&u);return A?l.createElement(kt,{title:u},L):L},ze="--progress-line-stroke-color",Xt="--progress-percent",St=e=>{const t=e?"100%":"-100%";return new nt(`antProgress${e?"RTL":"LTR"}Active`,{"0%":{transform:`translateX(${t}) scaleX(0)`,opacity:.1},"20%":{transform:`translateX(${t}) scaleX(0)`,opacity:.5},to:{transform:"translateX(0) scaleX(1)",opacity:0}})},Gr=e=>{const{componentCls:t,iconCls:n}=e;return{[t]:Object.assign(Object.assign({},Tt(e)),{display:"inline-block","&-rtl":{direction:"rtl"},"&-line":{position:"relative",width:"100%",fontSize:e.fontSize},[`${t}-outer`]:{display:"inline-flex",alignItems:"center",width:"100%"},[`${t}-inner`]:{position:"relative",display:"inline-block",width:"100%",flex:1,overflow:"hidden",verticalAlign:"middle",backgroundColor:e.remainingColor,borderRadius:e.lineBorderRadius},[`${t}-inner:not(${t}-circle-gradient)`]:{[`${t}-circle-path`]:{stroke:e.defaultColor}},[`${t}-success-bg, ${t}-bg`]:{position:"relative",background:e.defaultColor,borderRadius:e.lineBorderRadius,transition:`all ${e.motionDurationSlow} ${e.motionEaseInOutCirc}`},[`${t}-layout-bottom`]:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",[`${t}-text`]:{width:"max-content",marginInlineStart:0,marginTop:e.marginXXS}},[`${t}-bg`]:{overflow:"hidden","&::after":{content:'""',background:{_multi_value_:!0,value:["inherit",`var(${ze})`]},height:"100%",width:`calc(1 / var(${Xt}) * 100%)`,display:"block"},[`&${t}-bg-inner`]:{minWidth:"max-content","&::after":{content:"none"},[`${t}-text-inner`]:{color:e.colorWhite,[`&${t}-text-bright`]:{color:"rgba(0, 0, 0, 0.45)"}}}},[`${t}-success-bg`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,backgroundColor:e.colorSuccess},[`${t}-text`]:{display:"inline-block",marginInlineStart:e.marginXS,color:e.colorText,lineHeight:1,width:"2em",whiteSpace:"nowrap",textAlign:"start",verticalAlign:"middle",wordBreak:"normal",[n]:{fontSize:e.fontSize},[`&${t}-text-outer`]:{width:"max-content"},[`&${t}-text-outer${t}-text-start`]:{width:"max-content",marginInlineStart:0,marginInlineEnd:e.marginXS}},[`${t}-text-inner`]:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%",marginInlineStart:0,padding:`0 ${de(e.paddingXXS)}`,[`&${t}-text-start`]:{justifyContent:"start"},[`&${t}-text-end`]:{justifyContent:"end"}},[`&${t}-status-active`]:{[`${t}-bg::before`]:{position:"absolute",inset:0,backgroundColor:e.colorBgContainer,borderRadius:e.lineBorderRadius,opacity:0,animationName:St(),animationDuration:e.progressActiveMotionDuration,animationTimingFunction:e.motionEaseOutQuint,animationIterationCount:"infinite",content:'""'}},[`&${t}-rtl${t}-status-active`]:{[`${t}-bg::before`]:{animationName:St(!0)}},[`&${t}-status-exception`]:{[`${t}-bg`]:{backgroundColor:e.colorError},[`${t}-text`]:{color:e.colorError}},[`&${t}-status-exception ${t}-inner:not(${t}-circle-gradient)`]:{[`${t}-circle-path`]:{stroke:e.colorError}},[`&${t}-status-success`]:{[`${t}-bg`]:{backgroundColor:e.colorSuccess},[`${t}-text`]:{color:e.colorSuccess}},[`&${t}-status-success ${t}-inner:not(${t}-circle-gradient)`]:{[`${t}-circle-path`]:{stroke:e.colorSuccess}}})}},Kr=e=>{const{componentCls:t,iconCls:n}=e;return{[t]:{[`${t}-circle-trail`]:{stroke:e.remainingColor},[`&${t}-circle ${t}-inner`]:{position:"relative",lineHeight:1,backgroundColor:"transparent"},[`&${t}-circle ${t}-text`]:{position:"absolute",insetBlockStart:"50%",insetInlineStart:0,width:"100%",margin:0,padding:0,color:e.circleTextColor,fontSize:e.circleTextFontSize,lineHeight:1,whiteSpace:"normal",textAlign:"center",transform:"translateY(-50%)",[n]:{fontSize:e.circleIconFontSize}},[`${t}-circle&-status-exception`]:{[`${t}-text`]:{color:e.colorError}},[`${t}-circle&-status-success`]:{[`${t}-text`]:{color:e.colorSuccess}}},[`${t}-inline-circle`]:{lineHeight:1,[`${t}-inner`]:{verticalAlign:"bottom"}}}},Jr=e=>{const{componentCls:t}=e;return{[t]:{[`${t}-steps`]:{display:"inline-block","&-outer":{display:"flex",flexDirection:"row",alignItems:"center"},"&-item":{flexShrink:0,minWidth:e.progressStepMinWidth,marginInlineEnd:e.progressStepMarginInlineEnd,backgroundColor:e.remainingColor,transition:`all ${e.motionDurationSlow}`,"&-active":{backgroundColor:e.defaultColor}}}}}},Yr=e=>{const{componentCls:t,iconCls:n}=e;return{[t]:{[`${t}-small&-line, ${t}-small&-line ${t}-text ${n}`]:{fontSize:e.fontSizeSM}}}},Zr=e=>({circleTextColor:e.colorText,defaultColor:e.colorInfo,remainingColor:e.colorFillSecondary,lineBorderRadius:100,circleTextFontSize:"1em",circleIconFontSize:`${e.fontSize/e.fontSizeSM}em`}),Qr=Lt("Progress",e=>{const t=e.calc(e.marginXXS).div(2).equal(),n=Ot(e,{progressStepMarginInlineEnd:t,progressStepMinWidth:t,progressActiveMotionDuration:"2.4s"});return[Gr(n),Kr(n),Jr(n),Yr(n)]},Zr);var en=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,a=Object.getOwnPropertySymbols(e);o<a.length;o++)t.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(e,a[o])&&(n[a[o]]=e[a[o]]);return n};const tn=e=>{let t=[];return Object.keys(e).forEach(n=>{const a=Number.parseFloat(n.replace(/%/g,""));Number.isNaN(a)||t.push({key:a,value:e[n]})}),t=t.sort((n,a)=>n.key-a.key),t.map(({key:n,value:a})=>`${a} ${n}%`).join(", ")},rn=(e,t)=>{const{from:n=rt.blue,to:a=rt.blue,direction:o=t==="rtl"?"to left":"to right"}=e,r=en(e,["from","to","direction"]);if(Object.keys(r).length!==0){const i=tn(r),u=`linear-gradient(${o}, ${i})`;return{background:u,[ze]:u}}const s=`linear-gradient(${o}, ${n}, ${a})`;return{background:s,[ze]:s}},nn=e=>{const{prefixCls:t,direction:n,percent:a,size:o,strokeWidth:r,strokeColor:s,strokeLinecap:i="round",children:u,trailColor:d=null,percentPosition:p,success:g}=e,{align:b,type:y}=p,c=s&&typeof s!="string"?rn(s,n):{[ze]:s,background:s},m=i==="square"||i==="butt"?0:void 0,f=o??[-1,r||(o==="small"?6:8)],[v,w]=He(f,"line",{strokeWidth:r}),x={backgroundColor:d||void 0,borderRadius:m},$=Object.assign(Object.assign({width:`${Fe(a)}%`,height:w,borderRadius:m},c),{[Xt]:Fe(a)/100}),h=Re(e),B={width:`${Fe(h)}%`,height:w,borderRadius:m,backgroundColor:g==null?void 0:g.strokeColor},A={width:v<0?"100%":v},L=l.createElement("div",{className:`${t}-inner`,style:x},l.createElement("div",{className:ee(`${t}-bg`,`${t}-bg-${y}`),style:$},y==="inner"&&u),h!==void 0&&l.createElement("div",{className:`${t}-success-bg`,style:B})),W=y==="outer"&&b==="start",S=y==="outer"&&b==="end";return y==="outer"&&b==="center"?l.createElement("div",{className:`${t}-layout-bottom`},L,u):l.createElement("div",{className:`${t}-outer`,style:A},W&&u,L,S&&u)},an=e=>{const{size:t,steps:n,rounding:a=Math.round,percent:o=0,strokeWidth:r=8,strokeColor:s,trailColor:i=null,prefixCls:u,children:d}=e,p=a(n*(o/100)),b=t??[t==="small"?2:14,r],[y,c]=He(b,"step",{steps:n,strokeWidth:r}),m=y/n,f=Array.from({length:n});for(let v=0;v<n;v++){const w=Array.isArray(s)?s[v]:s;f[v]=l.createElement("div",{key:v,className:ee(`${u}-steps-item`,{[`${u}-steps-item-active`]:v<=p-1}),style:{backgroundColor:v<=p-1?w:i,width:m,height:c}})}return l.createElement("div",{className:`${u}-steps-outer`},f,d)};var on=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,a=Object.getOwnPropertySymbols(e);o<a.length;o++)t.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(e,a[o])&&(n[a[o]]=e[a[o]]);return n};const sn=["normal","exception","active","success"],ln=l.forwardRef((e,t)=>{const{prefixCls:n,className:a,rootClassName:o,steps:r,strokeColor:s,percent:i=0,size:u="default",showInfo:d=!0,type:p="line",status:g,format:b,style:y,percentPosition:c={}}=e,m=on(e,["prefixCls","className","rootClassName","steps","strokeColor","percent","size","showInfo","type","status","format","style","percentPosition"]),{align:f="end",type:v="outer"}=c,w=Array.isArray(s)?s[0]:s,x=typeof s=="string"||Array.isArray(s)?s:void 0,$=l.useMemo(()=>{if(w){const T=typeof w=="string"?w:Object.values(w)[0];return new cr(T).isLight()}return!1},[s]),h=l.useMemo(()=>{var T,F;const O=Re(e);return Number.parseInt(O!==void 0?(T=O??0)===null||T===void 0?void 0:T.toString():(F=i??0)===null||F===void 0?void 0:F.toString(),10)},[i,e.success,e.successPercent]),B=l.useMemo(()=>!sn.includes(g)&&h>=100?"success":g||"normal",[g,h]),{getPrefixCls:A,direction:L,progress:W}=l.useContext(Ue),S=A("progress",n),[te,ae,K]=Qr(S),J=p==="line",G=J&&!r,q=l.useMemo(()=>{if(!d)return null;const T=Re(e);let F;const O=b||(E=>`${E}%`),X=J&&$&&v==="inner";return v==="inner"||b||B!=="exception"&&B!=="success"?F=O(Fe(i),Fe(T)):B==="exception"?F=J?l.createElement(ur,null):l.createElement(dr,null):B==="success"&&(F=J?l.createElement(pr,null):l.createElement(mr,null)),l.createElement("span",{className:ee(`${S}-text`,{[`${S}-text-bright`]:X,[`${S}-text-${f}`]:G,[`${S}-text-${v}`]:G}),title:typeof F=="string"?F:void 0},F)},[d,i,h,B,p,S,b]);let H;p==="line"?H=r?l.createElement(an,Object.assign({},e,{strokeColor:x,prefixCls:S,steps:typeof r=="object"?r.count:r}),q):l.createElement(nn,Object.assign({},e,{strokeColor:w,prefixCls:S,direction:L,percentPosition:{align:f,type:v}}),q):(p==="circle"||p==="dashboard")&&(H=l.createElement(Vr,Object.assign({},e,{strokeColor:w,prefixCls:S,progressStatus:B}),q));const Z=ee(S,`${S}-status-${B}`,{[`${S}-${p==="dashboard"&&"circle"||p}`]:p!=="line",[`${S}-inline-circle`]:p==="circle"&&He(u,"circle")[0]<=20,[`${S}-line`]:G,[`${S}-line-align-${f}`]:G,[`${S}-line-position-${v}`]:G,[`${S}-steps`]:r,[`${S}-show-info`]:d,[`${S}-${u}`]:typeof u=="string",[`${S}-rtl`]:L==="rtl"},W==null?void 0:W.className,a,o,ae,K);return te(l.createElement("div",Object.assign({ref:t,style:Object.assign(Object.assign({},W==null?void 0:W.style),y),className:Z,role:"progressbar","aria-valuenow":h,"aria-valuemin":0,"aria-valuemax":100},Nt(m,["trailColor","strokeWidth","width","gapDegree","gapPosition","strokeLinecap","success","successPercent"])),H))});var cn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}}]},name:"delete",theme:"outlined"},un=function(t,n){return l.createElement(Oe,he({},t,{ref:n,icon:cn}))},dn=l.forwardRef(un);const Ye=(function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(","),a=e.name||"",o=e.type||"",r=o.replace(/\/.*$/,"");return n.some(function(s){var i=s.trim();if(/^\*(\/\*)?$/.test(s))return!0;if(i.charAt(0)==="."){var u=a.toLowerCase(),d=i.toLowerCase(),p=[d];return(d===".jpg"||d===".jpeg")&&(p=[".jpg",".jpeg"]),p.some(function(g){return u.endsWith(g)})}return/\/\*$/.test(i)?r===i.replace(/\/.*$/,""):o===i?!0:/^\w+$/.test(i)?(fr(!1,"Upload takes an invalidate 'accept' type '".concat(i,"'.Skip for check.")),!0):!1})}return!0});function pn(e,t){var n="cannot ".concat(e.method," ").concat(e.action," ").concat(t.status,"'"),a=new Error(n);return a.status=t.status,a.method=e.method,a.url=e.action,a}function Dt(e){var t=e.responseText||e.response;if(!t)return t;try{return JSON.parse(t)}catch{return t}}function At(e){var t=new XMLHttpRequest;e.onProgress&&t.upload&&(t.upload.onprogress=function(r){r.total>0&&(r.percent=r.loaded/r.total*100),e.onProgress(r)});var n=new FormData;e.data&&Object.keys(e.data).forEach(function(o){var r=e.data[o];if(Array.isArray(r)){r.forEach(function(s){n.append("".concat(o,"[]"),s)});return}n.append(o,r)}),e.file instanceof Blob?n.append(e.filename,e.file,e.file.name):n.append(e.filename,e.file),t.onerror=function(r){e.onError(r)},t.onload=function(){return t.status<200||t.status>=300?e.onError(pn(e,t),Dt(t)):e.onSuccess(Dt(t),t)},t.open(e.method,e.action,!0),e.withCredentials&&"withCredentials"in t&&(t.withCredentials=!0);var a=e.headers||{};return a["X-Requested-With"]!==null&&t.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(a).forEach(function(o){a[o]!==null&&t.setRequestHeader(o,a[o])}),t.send(n),{abort:function(){t.abort()}}}var mn=(function(){var e=Ce(ie().mark(function t(n,a){var o,r,s,i,u,d,p,g;return ie().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:d=function(){return d=Ce(ie().mark(function m(f){return ie().wrap(function(w){for(;;)switch(w.prev=w.next){case 0:return w.abrupt("return",new Promise(function(x){f.file(function($){a($)?(f.fullPath&&!$.webkitRelativePath&&(Object.defineProperties($,{webkitRelativePath:{writable:!0}}),$.webkitRelativePath=f.fullPath.replace(/^\//,""),Object.defineProperties($,{webkitRelativePath:{writable:!1}})),x($)):x(null)})}));case 1:case"end":return w.stop()}},m)})),d.apply(this,arguments)},u=function(m){return d.apply(this,arguments)},i=function(){return i=Ce(ie().mark(function m(f){var v,w,x,$,h;return ie().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:v=f.createReader(),w=[];case 2:return A.next=5,new Promise(function(L){v.readEntries(L,function(){return L([])})});case 5:if(x=A.sent,$=x.length,$){A.next=9;break}return A.abrupt("break",12);case 9:for(h=0;h<$;h++)w.push(x[h]);A.next=2;break;case 12:return A.abrupt("return",w);case 13:case"end":return A.stop()}},m)})),i.apply(this,arguments)},s=function(m){return i.apply(this,arguments)},o=[],r=[],n.forEach(function(c){return r.push(c.webkitGetAsEntry())}),p=(function(){var c=Ce(ie().mark(function m(f,v){var w,x;return ie().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(f){h.next=2;break}return h.abrupt("return");case 2:if(f.path=v||"",!f.isFile){h.next=10;break}return h.next=6,u(f);case 6:w=h.sent,w&&o.push(w),h.next=15;break;case 10:if(!f.isDirectory){h.next=15;break}return h.next=13,s(f);case 13:x=h.sent,r.push.apply(r,ge(x));case 15:case"end":return h.stop()}},m)}));return function(f,v){return c.apply(this,arguments)}})(),g=0;case 9:if(!(g<r.length)){y.next=15;break}return y.next=12,p(r[g]);case 12:g++,y.next=9;break;case 15:return y.abrupt("return",o);case 16:case"end":return y.stop()}},t)}));return function(n,a){return e.apply(this,arguments)}})(),fn=+new Date,gn=0;function Ze(){return"rc-upload-".concat(fn,"-").concat(++gn)}var hn=["component","prefixCls","className","classNames","disabled","id","name","style","styles","multiple","accept","capture","children","directory","folder","openFileDialogOnClick","onMouseEnter","onMouseLeave","hasControlInside"],vn=(function(e){_t(n,e);var t=Mt(n);function n(){var a;jt(this,n);for(var o=arguments.length,r=new Array(o),s=0;s<o;s++)r[s]=arguments[s];return a=t.call.apply(t,[this].concat(r)),Y(oe(a),"state",{uid:Ze()}),Y(oe(a),"reqs",{}),Y(oe(a),"fileInput",void 0),Y(oe(a),"_isMounted",void 0),Y(oe(a),"onChange",function(i){var u=a.props,d=u.accept,p=u.directory,g=i.target.files,b=ge(g).filter(function(y){return!p||Ye(y,d)});a.uploadFiles(b),a.reset()}),Y(oe(a),"onClick",function(i){var u=a.fileInput;if(u){var d=i.target,p=a.props.onClick;if(d&&d.tagName==="BUTTON"){var g=u.parentNode;g.focus(),d.blur()}u.click(),p&&p(i)}}),Y(oe(a),"onKeyDown",function(i){i.key==="Enter"&&a.onClick(i)}),Y(oe(a),"onDataTransferFiles",(function(){var i=Ce(ie().mark(function u(d,p){var g,b,y,c,m,f,v;return ie().wrap(function(x){for(;;)switch(x.prev=x.next){case 0:if(g=a.props,b=g.multiple,y=g.accept,c=g.directory,m=ge(d.items||[]),f=ge(d.files||[]),(f.length>0||m.some(function($){return $.kind==="file"}))&&(p==null||p()),!c){x.next=11;break}return x.next=7,mn(Array.prototype.slice.call(m),function($){return Ye($,a.props.accept)});case 7:f=x.sent,a.uploadFiles(f),x.next=14;break;case 11:v=ge(f).filter(function($){return Ye($,y)}),b===!1&&(v=f.slice(0,1)),a.uploadFiles(v);case 14:case"end":return x.stop()}},u)}));return function(u,d){return i.apply(this,arguments)}})()),Y(oe(a),"onFilePaste",(function(){var i=Ce(ie().mark(function u(d){var p,g;return ie().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:if(p=a.props.pastable,p){y.next=3;break}return y.abrupt("return");case 3:if(d.type!=="paste"){y.next=6;break}return g=d.clipboardData,y.abrupt("return",a.onDataTransferFiles(g,function(){d.preventDefault()}));case 6:case"end":return y.stop()}},u)}));return function(u){return i.apply(this,arguments)}})()),Y(oe(a),"onFileDragOver",function(i){i.preventDefault()}),Y(oe(a),"onFileDrop",(function(){var i=Ce(ie().mark(function u(d){var p;return ie().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:if(d.preventDefault(),d.type!=="drop"){b.next=4;break}return p=d.dataTransfer,b.abrupt("return",a.onDataTransferFiles(p));case 4:case"end":return b.stop()}},u)}));return function(u){return i.apply(this,arguments)}})()),Y(oe(a),"uploadFiles",function(i){var u=ge(i),d=u.map(function(p){return p.uid=Ze(),a.processFile(p,u)});Promise.all(d).then(function(p){var g=a.props.onBatchStart;g==null||g(p.map(function(b){var y=b.origin,c=b.parsedFile;return{file:y,parsedFile:c}})),p.filter(function(b){return b.parsedFile!==null}).forEach(function(b){a.post(b)})})}),Y(oe(a),"processFile",(function(){var i=Ce(ie().mark(function u(d,p){var g,b,y,c,m,f,v,w,x;return ie().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(g=a.props.beforeUpload,b=d,!g){h.next=14;break}return h.prev=3,h.next=6,g(d,p);case 6:b=h.sent,h.next=12;break;case 9:h.prev=9,h.t0=h.catch(3),b=!1;case 12:if(b!==!1){h.next=14;break}return h.abrupt("return",{origin:d,parsedFile:null,action:null,data:null});case 14:if(y=a.props.action,typeof y!="function"){h.next=21;break}return h.next=18,y(d);case 18:c=h.sent,h.next=22;break;case 21:c=y;case 22:if(m=a.props.data,typeof m!="function"){h.next=29;break}return h.next=26,m(d);case 26:f=h.sent,h.next=30;break;case 29:f=m;case 30:return v=(Ae(b)==="object"||typeof b=="string")&&b?b:d,v instanceof File?w=v:w=new File([v],d.name,{type:d.type}),x=w,x.uid=d.uid,h.abrupt("return",{origin:d,data:f,parsedFile:x,action:c});case 35:case"end":return h.stop()}},u,null,[[3,9]])}));return function(u,d){return i.apply(this,arguments)}})()),Y(oe(a),"saveFileInput",function(i){a.fileInput=i}),a}return Rt(n,[{key:"componentDidMount",value:function(){this._isMounted=!0;var o=this.props.pastable;o&&document.addEventListener("paste",this.onFilePaste)}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort(),document.removeEventListener("paste",this.onFilePaste)}},{key:"componentDidUpdate",value:function(o){var r=this.props.pastable;r&&!o.pastable?document.addEventListener("paste",this.onFilePaste):!r&&o.pastable&&document.removeEventListener("paste",this.onFilePaste)}},{key:"post",value:function(o){var r=this,s=o.data,i=o.origin,u=o.action,d=o.parsedFile;if(this._isMounted){var p=this.props,g=p.onStart,b=p.customRequest,y=p.name,c=p.headers,m=p.withCredentials,f=p.method,v=i.uid,w=b||At,x={action:u,filename:y,data:s,file:d,headers:c,withCredentials:m,method:f||"post",onProgress:function(h){var B=r.props.onProgress;B==null||B(h,d)},onSuccess:function(h,B){var A=r.props.onSuccess;A==null||A(h,d,B),delete r.reqs[v]},onError:function(h,B){var A=r.props.onError;A==null||A(h,B,d),delete r.reqs[v]}};g(i),this.reqs[v]=w(x,{defaultRequest:At})}}},{key:"reset",value:function(){this.setState({uid:Ze()})}},{key:"abort",value:function(o){var r=this.reqs;if(o){var s=o.uid?o.uid:o;r[s]&&r[s].abort&&r[s].abort(),delete r[s]}else Object.keys(r).forEach(function(i){r[i]&&r[i].abort&&r[i].abort(),delete r[i]})}},{key:"render",value:function(){var o=this.props,r=o.component,s=o.prefixCls,i=o.className,u=o.classNames,d=u===void 0?{}:u,p=o.disabled,g=o.id,b=o.name,y=o.style,c=o.styles,m=c===void 0?{}:c,f=o.multiple,v=o.accept,w=o.capture,x=o.children,$=o.directory,h=o.folder,B=o.openFileDialogOnClick,A=o.onMouseEnter,L=o.onMouseLeave,W=o.hasControlInside,S=Pt(o,hn),te=ee(Y(Y(Y({},s,!0),"".concat(s,"-disabled"),p),i,i)),ae=$||h?{directory:"directory",webkitdirectory:"webkitdirectory"}:{},K=p?{}:{onClick:B?this.onClick:function(){},onKeyDown:B?this.onKeyDown:function(){},onMouseEnter:A,onMouseLeave:L,onDrop:this.onFileDrop,onDragOver:this.onFileDragOver,tabIndex:W?void 0:"0"};return Ee.createElement(r,he({},K,{className:te,role:W?void 0:"button",style:y}),Ee.createElement("input",he({},gr(S,{aria:!0,data:!0}),{id:g,name:b,disabled:p,type:"file",ref:this.saveFileInput,onClick:function(G){return G.stopPropagation()},key:this.state.uid,style:tt({display:"none"},m.input),className:d.input,accept:v},ae,{multiple:f,onChange:this.onChange},w!=null?{capture:w}:{})),x)}}]),n})(Bt);function Qe(){}var at=(function(e){_t(n,e);var t=Mt(n);function n(){var a;jt(this,n);for(var o=arguments.length,r=new Array(o),s=0;s<o;s++)r[s]=arguments[s];return a=t.call.apply(t,[this].concat(r)),Y(oe(a),"uploader",void 0),Y(oe(a),"saveUploader",function(i){a.uploader=i}),a}return Rt(n,[{key:"abort",value:function(o){this.uploader.abort(o)}},{key:"render",value:function(){return Ee.createElement(vn,he({},this.props,{ref:this.saveUploader}))}}]),n})(Bt);Y(at,"defaultProps",{component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:Qe,onError:Qe,onSuccess:Qe,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0,hasControlInside:!1});const bn=e=>{const{componentCls:t,iconCls:n}=e;return{[`${t}-wrapper`]:{[`${t}-drag`]:{position:"relative",width:"100%",height:"100%",textAlign:"center",background:e.colorFillAlter,border:`${de(e.lineWidth)} dashed ${e.colorBorder}`,borderRadius:e.borderRadiusLG,cursor:"pointer",transition:`border-color ${e.motionDurationSlow}`,[t]:{padding:e.padding},[`${t}-btn`]:{display:"table",width:"100%",height:"100%",outline:"none",borderRadius:e.borderRadiusLG,"&:focus-visible":{outline:`${de(e.lineWidthFocus)} solid ${e.colorPrimaryBorder}`}},[`${t}-drag-container`]:{display:"table-cell",verticalAlign:"middle"},[`
12
- &:not(${t}-disabled):hover,
13
- &-hover:not(${t}-disabled)
14
- `]:{borderColor:e.colorPrimaryHover},[`p${t}-drag-icon`]:{marginBottom:e.margin,[n]:{color:e.colorPrimary,fontSize:e.uploadThumbnailSize}},[`p${t}-text`]:{margin:`0 0 ${de(e.marginXXS)}`,color:e.colorTextHeading,fontSize:e.fontSizeLG},[`p${t}-hint`]:{color:e.colorTextDescription,fontSize:e.fontSize},[`&${t}-disabled`]:{[`p${t}-drag-icon ${n},
15
- p${t}-text,
16
- p${t}-hint
17
- `]:{color:e.colorTextDisabled}}}}}},yn=e=>{const{componentCls:t,iconCls:n,fontSize:a,lineHeight:o,calc:r}=e,s=`${t}-list-item`,i=`${s}-actions`,u=`${s}-action`;return{[`${t}-wrapper`]:{[`${t}-list`]:Object.assign(Object.assign({},zt()),{lineHeight:e.lineHeight,[s]:{position:"relative",height:r(e.lineHeight).mul(a).equal(),marginTop:e.marginXS,fontSize:a,display:"flex",alignItems:"center",transition:`background-color ${e.motionDurationSlow}`,borderRadius:e.borderRadiusSM,"&:hover":{backgroundColor:e.controlItemBgHover},[`${s}-name`]:Object.assign(Object.assign({},Wt),{padding:`0 ${de(e.paddingXS)}`,lineHeight:o,flex:"auto",transition:`all ${e.motionDurationSlow}`}),[i]:{whiteSpace:"nowrap",[u]:{opacity:0},[n]:{color:e.actionsColor,transition:`all ${e.motionDurationSlow}`},[`
18
- ${u}:focus-visible,
19
- &.picture ${u}
20
- `]:{opacity:1}},[`${t}-icon ${n}`]:{color:e.colorIcon,fontSize:a},[`${s}-progress`]:{position:"absolute",bottom:e.calc(e.uploadProgressOffset).mul(-1).equal(),width:"100%",paddingInlineStart:r(a).add(e.paddingXS).equal(),fontSize:a,lineHeight:0,pointerEvents:"none","> div":{margin:0}}},[`${s}:hover ${u}`]:{opacity:1},[`${s}-error`]:{color:e.colorError,[`${s}-name, ${t}-icon ${n}`]:{color:e.colorError},[i]:{[`${n}, ${n}:hover`]:{color:e.colorError},[u]:{opacity:1}}},[`${t}-list-item-container`]:{transition:`opacity ${e.motionDurationSlow}, height ${e.motionDurationSlow}`,"&::before":{display:"table",width:0,height:0,content:'""'}}})}}},Cn=e=>{const{componentCls:t}=e,n=new nt("uploadAnimateInlineIn",{from:{width:0,height:0,padding:0,opacity:0,margin:e.calc(e.marginXS).div(-2).equal()}}),a=new nt("uploadAnimateInlineOut",{to:{width:0,height:0,padding:0,opacity:0,margin:e.calc(e.marginXS).div(-2).equal()}}),o=`${t}-animate-inline`;return[{[`${t}-wrapper`]:{[`${o}-appear, ${o}-enter, ${o}-leave`]:{animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseInOutCirc,animationFillMode:"forwards"},[`${o}-appear, ${o}-enter`]:{animationName:n},[`${o}-leave`]:{animationName:a}}},{[`${t}-wrapper`]:hr(e)},n,a]},Fn=e=>{const{componentCls:t,iconCls:n,uploadThumbnailSize:a,uploadProgressOffset:o,calc:r}=e,s=`${t}-list`,i=`${s}-item`;return{[`${t}-wrapper`]:{[`
21
- ${s}${s}-picture,
22
- ${s}${s}-picture-card,
23
- ${s}${s}-picture-circle
24
- `]:{[i]:{position:"relative",height:r(a).add(r(e.lineWidth).mul(2)).add(r(e.paddingXS).mul(2)).equal(),padding:e.paddingXS,border:`${de(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadiusLG,"&:hover":{background:"transparent"},[`${i}-thumbnail`]:Object.assign(Object.assign({},Wt),{width:a,height:a,lineHeight:de(r(a).add(e.paddingSM).equal()),textAlign:"center",flex:"none",[n]:{fontSize:e.fontSizeHeading2,color:e.colorPrimary},img:{display:"block",width:"100%",height:"100%",overflow:"hidden"}}),[`${i}-progress`]:{bottom:o,width:`calc(100% - ${de(r(e.paddingSM).mul(2).equal())})`,marginTop:0,paddingInlineStart:r(a).add(e.paddingXS).equal()}},[`${i}-error`]:{borderColor:e.colorError,[`${i}-thumbnail ${n}`]:{[`svg path[fill='${gt[0]}']`]:{fill:e.colorErrorBg},[`svg path[fill='${gt.primary}']`]:{fill:e.colorError}}},[`${i}-uploading`]:{borderStyle:"dashed",[`${i}-name`]:{marginBottom:o}}},[`${s}${s}-picture-circle ${i}`]:{[`&, &::before, ${i}-thumbnail`]:{borderRadius:"50%"}}}}},wn=e=>{const{componentCls:t,iconCls:n,fontSizeLG:a,colorTextLightSolid:o,calc:r}=e,s=`${t}-list`,i=`${s}-item`,u=e.uploadPicCardSize;return{[`
25
- ${t}-wrapper${t}-picture-card-wrapper,
26
- ${t}-wrapper${t}-picture-circle-wrapper
27
- `]:Object.assign(Object.assign({},zt()),{display:"block",[`${t}${t}-select`]:{width:u,height:u,textAlign:"center",verticalAlign:"top",backgroundColor:e.colorFillAlter,border:`${de(e.lineWidth)} dashed ${e.colorBorder}`,borderRadius:e.borderRadiusLG,cursor:"pointer",transition:`border-color ${e.motionDurationSlow}`,[`> ${t}`]:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",textAlign:"center"},[`&:not(${t}-disabled):hover`]:{borderColor:e.colorPrimary}},[`${s}${s}-picture-card, ${s}${s}-picture-circle`]:{display:"flex",flexWrap:"wrap","@supports not (gap: 1px)":{"& > *":{marginBlockEnd:e.marginXS,marginInlineEnd:e.marginXS}},"@supports (gap: 1px)":{gap:e.marginXS},[`${s}-item-container`]:{display:"inline-block",width:u,height:u,verticalAlign:"top"},"&::after":{display:"none"},"&::before":{display:"none"},[i]:{height:"100%",margin:0,"&::before":{position:"absolute",zIndex:1,width:`calc(100% - ${de(r(e.paddingXS).mul(2).equal())})`,height:`calc(100% - ${de(r(e.paddingXS).mul(2).equal())})`,backgroundColor:e.colorBgMask,opacity:0,transition:`all ${e.motionDurationSlow}`,content:'" "'}},[`${i}:hover`]:{[`&::before, ${i}-actions`]:{opacity:1}},[`${i}-actions`]:{position:"absolute",insetInlineStart:0,zIndex:10,width:"100%",whiteSpace:"nowrap",textAlign:"center",opacity:0,transition:`all ${e.motionDurationSlow}`,[`
28
- ${n}-eye,
29
- ${n}-download,
30
- ${n}-delete
31
- `]:{zIndex:10,width:a,margin:`0 ${de(e.marginXXS)}`,fontSize:a,cursor:"pointer",transition:`all ${e.motionDurationSlow}`,color:o,"&:hover":{color:o},svg:{verticalAlign:"baseline"}}},[`${i}-thumbnail, ${i}-thumbnail img`]:{position:"static",display:"block",width:"100%",height:"100%",objectFit:"contain"},[`${i}-name`]:{display:"none",textAlign:"center"},[`${i}-file + ${i}-name`]:{position:"absolute",bottom:e.margin,display:"block",width:`calc(100% - ${de(r(e.paddingXS).mul(2).equal())})`},[`${i}-uploading`]:{[`&${i}`]:{backgroundColor:e.colorFillAlter},[`&::before, ${n}-eye, ${n}-download, ${n}-delete`]:{display:"none"}},[`${i}-progress`]:{bottom:e.marginXL,width:`calc(100% - ${de(r(e.paddingXS).mul(2).equal())})`,paddingInlineStart:0}}}),[`${t}-wrapper${t}-picture-circle-wrapper`]:{[`${t}${t}-select`]:{borderRadius:"50%"}}}},$n=e=>{const{componentCls:t}=e;return{[`${t}-rtl`]:{direction:"rtl"}}},En=e=>{const{componentCls:t,colorTextDisabled:n}=e;return{[`${t}-wrapper`]:Object.assign(Object.assign({},Tt(e)),{[t]:{outline:0,"input[type='file']":{cursor:"pointer"}},[`${t}-select`]:{display:"inline-block"},[`${t}-hidden`]:{display:"none"},[`${t}-disabled`]:{color:n,cursor:"not-allowed"}})}},xn=e=>({actionsColor:e.colorIcon,pictureCardSize:e.controlHeightLG*2.55}),Sn=Lt("Upload",e=>{const{fontSizeHeading3:t,fontHeight:n,lineWidth:a,pictureCardSize:o,calc:r}=e,s=Ot(e,{uploadThumbnailSize:r(t).mul(2).equal(),uploadProgressOffset:r(r(n).div(2)).add(a).equal(),uploadPicCardSize:o});return[En(s),bn(s),Fn(s),wn(s),yn(s),Cn(s),$n(s),vr(s)]},xn);var Dn={icon:function(t,n){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M534 352V136H232v752h560V394H576a42 42 0 01-42-42z",fill:n}},{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM602 137.8L790.2 326H602V137.8zM792 888H232V136h302v216a42 42 0 0042 42h216v494z",fill:t}}]}},name:"file",theme:"twotone"},An=function(t,n){return l.createElement(Oe,he({},t,{ref:n,icon:Dn}))},Bn=l.forwardRef(An),In={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M779.3 196.6c-94.2-94.2-247.6-94.2-341.7 0l-261 260.8c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l261-260.8c32.4-32.4 75.5-50.2 121.3-50.2s88.9 17.8 121.2 50.2c32.4 32.4 50.2 75.5 50.2 121.2 0 45.8-17.8 88.8-50.2 121.2l-266 265.9-43.1 43.1c-40.3 40.3-105.8 40.3-146.1 0-19.5-19.5-30.2-45.4-30.2-73s10.7-53.5 30.2-73l263.9-263.8c6.7-6.6 15.5-10.3 24.9-10.3h.1c9.4 0 18.1 3.7 24.7 10.3 6.7 6.7 10.3 15.5 10.3 24.9 0 9.3-3.7 18.1-10.3 24.7L372.4 653c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l215.6-215.6c19.9-19.9 30.8-46.3 30.8-74.4s-11-54.6-30.8-74.4c-41.1-41.1-107.9-41-149 0L463 364 224.8 602.1A172.22 172.22 0 00174 724.8c0 46.3 18.1 89.8 50.8 122.5 33.9 33.8 78.3 50.7 122.7 50.7 44.4 0 88.8-16.9 122.6-50.7l309.2-309C824.8 492.7 850 432 850 367.5c.1-64.6-25.1-125.3-70.7-170.9z"}}]},name:"paper-clip",theme:"outlined"},Pn=function(t,n){return l.createElement(Oe,he({},t,{ref:n,icon:In}))},kn=l.forwardRef(Pn),Ln={icon:function(t,n){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 632H136v-39.9l138.5-164.3 150.1 178L658.1 489 888 761.6V792zm0-129.8L664.2 396.8c-3.2-3.8-9-3.8-12.2 0L424.6 666.4l-144-170.7c-3.2-3.8-9-3.8-12.2 0L136 652.7V232h752v430.2z",fill:t}},{tag:"path",attrs:{d:"M424.6 765.8l-150.1-178L136 752.1V792h752v-30.4L658.1 489z",fill:n}},{tag:"path",attrs:{d:"M136 652.7l132.4-157c3.2-3.8 9-3.8 12.2 0l144 170.7L652 396.8c3.2-3.8 9-3.8 12.2 0L888 662.2V232H136v420.7zM304 280a88 88 0 110 176 88 88 0 010-176z",fill:n}},{tag:"path",attrs:{d:"M276 368a28 28 0 1056 0 28 28 0 10-56 0z",fill:n}},{tag:"path",attrs:{d:"M304 456a88 88 0 100-176 88 88 0 000 176zm0-116c15.5 0 28 12.5 28 28s-12.5 28-28 28-28-12.5-28-28 12.5-28 28-28z",fill:t}}]}},name:"picture",theme:"twotone"},On=function(t,n){return l.createElement(Oe,he({},t,{ref:n,icon:Ln}))},Tn=l.forwardRef(On);function Te(e){return Object.assign(Object.assign({},e),{lastModified:e.lastModified,lastModifiedDate:e.lastModifiedDate,name:e.name,size:e.size,type:e.type,uid:e.uid,percent:0,originFileObj:e})}function Ne(e,t){const n=ge(t),a=n.findIndex(({uid:o})=>o===e.uid);return a===-1?n.push(e):n[a]=e,n}function et(e,t){const n=e.uid!==void 0?"uid":"name";return t.filter(a=>a[n]===e[n])[0]}function Nn(e,t){const n=e.uid!==void 0?"uid":"name",a=t.filter(o=>o[n]!==e[n]);return a.length===t.length?null:a}const _n=(e="")=>{const t=e.split("/"),a=t[t.length-1].split(/#|\?/)[0];return(/\.[^./\\]*$/.exec(a)||[""])[0]},Vt=e=>e.indexOf("image/")===0,Mn=e=>{if(e.type&&!e.thumbUrl)return Vt(e.type);const t=e.thumbUrl||e.url||"",n=_n(t);return/^data:image\//.test(t)||/(webp|svg|png|gif|jpg|jpeg|jfif|bmp|dpg|ico|heic|heif)$/i.test(n)?!0:!(/^data:/.test(t)||n)},be=200;function jn(e){return new Promise(t=>{if(!e.type||!Vt(e.type)){t("");return}const n=document.createElement("canvas");n.width=be,n.height=be,n.style.cssText=`position: fixed; left: 0; top: 0; width: ${be}px; height: ${be}px; z-index: 9999; display: none;`,document.body.appendChild(n);const a=n.getContext("2d"),o=new Image;if(o.onload=()=>{const{width:r,height:s}=o;let i=be,u=be,d=0,p=0;r>s?(u=s*(be/r),p=-(u-i)/2):(i=r*(be/s),d=-(i-u)/2),a.drawImage(o,d,p,i,u);const g=n.toDataURL();document.body.removeChild(n),window.URL.revokeObjectURL(o.src),t(g)},o.crossOrigin="anonymous",e.type.startsWith("image/svg+xml")){const r=new FileReader;r.onload=()=>{r.result&&typeof r.result=="string"&&(o.src=r.result)},r.readAsDataURL(e)}else if(e.type.startsWith("image/gif")){const r=new FileReader;r.onload=()=>{r.result&&t(r.result)},r.readAsDataURL(e)}else o.src=window.URL.createObjectURL(e)})}var Rn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"download",theme:"outlined"},zn=function(t,n){return l.createElement(Oe,he({},t,{ref:n,icon:Rn}))},Wn=l.forwardRef(zn);const Un=l.forwardRef(({prefixCls:e,className:t,style:n,locale:a,listType:o,file:r,items:s,progress:i,iconRender:u,actionIconRender:d,itemRender:p,isImgUrl:g,showPreviewIcon:b,showRemoveIcon:y,showDownloadIcon:c,previewIcon:m,removeIcon:f,downloadIcon:v,extra:w,onPreview:x,onDownload:$,onClose:h},B)=>{var A,L;const{status:W}=r,[S,te]=l.useState(W);l.useEffect(()=>{W!=="removed"&&te(W)},[W]);const[ae,K]=l.useState(!1);l.useEffect(()=>{const M=setTimeout(()=>{K(!0)},300);return()=>{clearTimeout(M)}},[]);const J=u(r);let G=l.createElement("div",{className:`${e}-icon`},J);if(o==="picture"||o==="picture-card"||o==="picture-circle")if(S==="uploading"||!r.thumbUrl&&!r.url){const M=ee(`${e}-list-item-thumbnail`,{[`${e}-list-item-file`]:S!=="uploading"});G=l.createElement("div",{className:M},J)}else{const M=g!=null&&g(r)?l.createElement("img",{src:r.thumbUrl||r.url,alt:r.name,className:`${e}-list-item-image`,crossOrigin:r.crossOrigin}):J,fe=ee(`${e}-list-item-thumbnail`,{[`${e}-list-item-file`]:g&&!g(r)});G=l.createElement("a",{className:fe,onClick:ve=>x(r,ve),href:r.url||r.thumbUrl,target:"_blank",rel:"noopener noreferrer"},M)}const q=ee(`${e}-list-item`,`${e}-list-item-${S}`),H=typeof r.linkProps=="string"?JSON.parse(r.linkProps):r.linkProps,Z=(typeof y=="function"?y(r):y)?d((typeof f=="function"?f(r):f)||l.createElement(dn,null),()=>h(r),e,a.removeFile,!0):null,T=(typeof c=="function"?c(r):c)&&S==="done"?d((typeof v=="function"?v(r):v)||l.createElement(Wn,null),()=>$(r),e,a.downloadFile):null,F=o!=="picture-card"&&o!=="picture-circle"&&l.createElement("span",{key:"download-delete",className:ee(`${e}-list-item-actions`,{picture:o==="picture"})},T,Z),O=typeof w=="function"?w(r):w,X=O&&l.createElement("span",{className:`${e}-list-item-extra`},O),E=ee(`${e}-list-item-name`),P=r.url?l.createElement("a",Object.assign({key:"view",target:"_blank",rel:"noopener noreferrer",className:E,title:r.name},H,{href:r.url,onClick:M=>x(r,M)}),r.name,X):l.createElement("span",{key:"view",className:E,onClick:M=>x(r,M),title:r.name},r.name,X),z=(typeof b=="function"?b(r):b)&&(r.url||r.thumbUrl)?l.createElement("a",{href:r.url||r.thumbUrl,target:"_blank",rel:"noopener noreferrer",onClick:M=>x(r,M),title:a.previewFile},typeof m=="function"?m(r):m||l.createElement(br,null)):null,re=(o==="picture-card"||o==="picture-circle")&&S!=="uploading"&&l.createElement("span",{className:`${e}-list-item-actions`},z,S==="done"&&T,Z),{getPrefixCls:ue}=l.useContext(Ue),D=ue(),C=l.createElement("div",{className:q},G,P,F,re,ae&&l.createElement(Ut,{motionName:`${D}-fade`,visible:S==="uploading",motionDeadline:2e3},({className:M})=>{const fe="percent"in r?l.createElement(ln,Object.assign({type:"line",percent:r.percent,"aria-label":r["aria-label"],"aria-labelledby":r["aria-labelledby"]},i)):null;return l.createElement("div",{className:ee(`${e}-list-item-progress`,M)},fe)})),j=r.response&&typeof r.response=="string"?r.response:((A=r.error)===null||A===void 0?void 0:A.statusText)||((L=r.error)===null||L===void 0?void 0:L.message)||a.uploadError,N=S==="error"?l.createElement(kt,{title:j,getPopupContainer:M=>M.parentNode},C):C;return l.createElement("div",{className:ee(`${e}-list-item-container`,t),style:n,ref:B},p?p(N,r,s,{download:$.bind(null,r),preview:x.bind(null,r),remove:h.bind(null,r)}):N)}),Hn=(e,t)=>{const{listType:n="text",previewFile:a=jn,onPreview:o,onDownload:r,onRemove:s,locale:i,iconRender:u,isImageUrl:d=Mn,prefixCls:p,items:g=[],showPreviewIcon:b=!0,showRemoveIcon:y=!0,showDownloadIcon:c=!1,removeIcon:m,previewIcon:f,downloadIcon:v,extra:w,progress:x={size:[-1,2],showInfo:!1},appendAction:$,appendActionVisible:h=!0,itemRender:B,disabled:A}=e,[,L]=yr(),[W,S]=l.useState(!1),te=["picture-card","picture-circle"].includes(n);l.useEffect(()=>{n.startsWith("picture")&&(g||[]).forEach(E=>{!(E.originFileObj instanceof File||E.originFileObj instanceof Blob)||E.thumbUrl!==void 0||(E.thumbUrl="",a==null||a(E.originFileObj).then(P=>{E.thumbUrl=P||"",L()}))})},[n,g,a]),l.useEffect(()=>{S(!0)},[]);const ae=(E,P)=>{if(o)return P==null||P.preventDefault(),o(E)},K=E=>{typeof r=="function"?r(E):E.url&&window.open(E.url)},J=E=>{s==null||s(E)},G=E=>{if(u)return u(E,n);const P=E.status==="uploading";if(n.startsWith("picture")){const z=n==="picture"?l.createElement(bt,null):i.uploading,re=d!=null&&d(E)?l.createElement(Tn,null):l.createElement(Bn,null);return P?z:re}return P?l.createElement(bt,null):l.createElement(kn,null)},q=(E,P,z,re,ue)=>{const D={type:"text",size:"small",title:re,onClick:C=>{var j,N;P(),l.isValidElement(E)&&((N=(j=E.props).onClick)===null||N===void 0||N.call(j,C))},className:`${z}-list-item-action`,disabled:ue?A:!1};return l.isValidElement(E)?l.createElement(vt,Object.assign({},D,{icon:ht(E,Object.assign(Object.assign({},E.props),{onClick:()=>{}}))})):l.createElement(vt,Object.assign({},D),l.createElement("span",null,E))};l.useImperativeHandle(t,()=>({handlePreview:ae,handleDownload:K}));const{getPrefixCls:H}=l.useContext(Ue),Z=H("upload",p),T=H(),F=ee(`${Z}-list`,`${Z}-list-${n}`),O=l.useMemo(()=>Nt(Cr(T),["onAppearEnd","onEnterEnd","onLeaveEnd"]),[T]),X=Object.assign(Object.assign({},te?{}:O),{motionDeadline:2e3,motionName:`${Z}-${te?"animate-inline":"animate"}`,keys:ge(g.map(E=>({key:E.uid,file:E}))),motionAppear:W});return l.createElement("div",{className:F},l.createElement(Fr,Object.assign({},X,{component:!1}),({key:E,file:P,className:z,style:re})=>l.createElement(Un,{key:E,locale:i,prefixCls:Z,className:z,style:re,file:P,items:g,progress:x,listType:n,isImgUrl:d,showPreviewIcon:b,showRemoveIcon:y,showDownloadIcon:c,removeIcon:m,previewIcon:f,downloadIcon:v,extra:w,iconRender:G,actionIconRender:q,itemRender:B,onPreview:ae,onDownload:K,onClose:J})),$&&l.createElement(Ut,Object.assign({},X,{visible:h,forceRender:!0}),({className:E,style:P})=>ht($,z=>({className:ee(z.className,E),style:Object.assign(Object.assign(Object.assign({},P),{pointerEvents:E?"none":void 0}),z.style)}))))},qn=l.forwardRef(Hn);var Xn=function(e,t,n,a){function o(r){return r instanceof n?r:new n(function(s){s(r)})}return new(n||(n=Promise))(function(r,s){function i(p){try{d(a.next(p))}catch(g){s(g)}}function u(p){try{d(a.throw(p))}catch(g){s(g)}}function d(p){p.done?r(p.value):o(p.value).then(i,u)}d((a=a.apply(e,[])).next())})};const ke=`__LIST_IGNORE_${Date.now()}__`,Vn=(e,t)=>{const n=wr("upload"),{fileList:a,defaultFileList:o,onRemove:r,showUploadList:s=!0,listType:i="text",onPreview:u,onDownload:d,onChange:p,onDrop:g,previewFile:b,disabled:y,locale:c,iconRender:m,isImageUrl:f,progress:v,prefixCls:w,className:x,type:$="select",children:h,style:B,itemRender:A,maxCount:L,data:W={},multiple:S=!1,hasControlInside:te=!0,action:ae="",accept:K="",supportServerRender:J=!0,rootClassName:G}=e,q=l.useContext($r),H=y??q,Z=e.customRequest||n.customRequest,[T,F]=Er(o||[],{value:a,postState:k=>k??[]}),[O,X]=l.useState("drop"),E=l.useRef(null),P=l.useRef(null);l.useMemo(()=>{const k=Date.now();(a||[]).forEach((R,V)=>{!R.uid&&!Object.isFrozen(R)&&(R.uid=`__AUTO__${k}_${V}__`)})},[a]);const z=(k,R,V)=>{let _=ge(R),U=!1;L===1?_=_.slice(-1):L&&(U=_.length>L,_=_.slice(0,L)),Ct(()=>{F(_)});const se={file:k,fileList:_};V&&(se.event=V),(!U||k.status==="removed"||_.some(we=>we.uid===k.uid))&&Ct(()=>{p==null||p(se)})},re=(k,R)=>Xn(void 0,void 0,void 0,function*(){const{beforeUpload:V,transformFile:_}=e;let U=k;if(V){const se=yield V(k,R);if(se===!1)return!1;if(delete k[ke],se===ke)return Object.defineProperty(k,ke,{value:!0,configurable:!0}),!1;typeof se=="object"&&se&&(U=se)}return _&&(U=yield _(U)),U}),ue=k=>{const R=k.filter(U=>!U.file[ke]);if(!R.length)return;const V=R.map(U=>Te(U.file));let _=ge(T);V.forEach(U=>{_=Ne(U,_)}),V.forEach((U,se)=>{let we=U;if(R[se].parsedFile)U.status="uploading";else{const{originFileObj:Se}=U;let $e;try{$e=new File([Se],Se.name,{type:Se.type})}catch{$e=new Blob([Se],{type:Se.type}),$e.name=Se.name,$e.lastModifiedDate=new Date,$e.lastModified=new Date().getTime()}$e.uid=U.uid,we=$e}z(we,_)})},D=(k,R,V)=>{try{typeof k=="string"&&(k=JSON.parse(k))}catch{}if(!et(R,T))return;const _=Te(R);_.status="done",_.percent=100,_.response=k,_.xhr=V;const U=Ne(_,T);z(_,U)},C=(k,R)=>{if(!et(R,T))return;const V=Te(R);V.status="uploading",V.percent=k.percent;const _=Ne(V,T);z(V,_,k)},j=(k,R,V)=>{if(!et(V,T))return;const _=Te(V);_.error=k,_.response=R,_.status="error";const U=Ne(_,T);z(_,U)},N=k=>{let R;Promise.resolve(typeof r=="function"?r(k):r).then(V=>{var _;if(V===!1)return;const U=Nn(k,T);U&&(R=Object.assign(Object.assign({},k),{status:"removed"}),T==null||T.forEach(se=>{const we=R.uid!==void 0?"uid":"name";se[we]===R[we]&&!Object.isFrozen(se)&&(se.status="removed")}),(_=E.current)===null||_===void 0||_.abort(R),z(R,U))})},M=k=>{X(k.type),k.type==="drop"&&(g==null||g(k))};l.useImperativeHandle(t,()=>({onBatchStart:ue,onSuccess:D,onProgress:C,onError:j,fileList:T,upload:E.current,nativeElement:P.current}));const{getPrefixCls:fe,direction:ve,upload:xe}=l.useContext(Ue),Q=fe("upload",w),Ie=Object.assign(Object.assign({onBatchStart:ue,onError:j,onProgress:C,onSuccess:D},e),{customRequest:Z,data:W,multiple:S,action:ae,accept:K,supportServerRender:J,prefixCls:Q,disabled:H,beforeUpload:re,onChange:void 0,hasControlInside:te});delete Ie.className,delete Ie.style,(!h||H)&&delete Ie.id;const ut=`${Q}-wrapper`,[Xe,dt,Jt]=Sn(Q,ut),[Yt]=xr("Upload",Sr.Upload),{showRemoveIcon:pt,showPreviewIcon:Zt,showDownloadIcon:Qt,removeIcon:er,previewIcon:tr,downloadIcon:rr,extra:nr}=typeof s=="boolean"?{}:s,ar=typeof pt>"u"?!H:pt,Ve=(k,R)=>s?l.createElement(qn,{prefixCls:Q,listType:i,items:T,previewFile:b,onPreview:u,onDownload:d,onRemove:N,showRemoveIcon:ar,showPreviewIcon:Zt,showDownloadIcon:Qt,removeIcon:er,previewIcon:tr,downloadIcon:rr,iconRender:m,extra:nr,locale:Object.assign(Object.assign({},Yt),c),isImageUrl:f,progress:v,appendAction:k,appendActionVisible:R,itemRender:A,disabled:H}):k,Ge=ee(ut,x,G,dt,Jt,xe==null?void 0:xe.className,{[`${Q}-rtl`]:ve==="rtl",[`${Q}-picture-card-wrapper`]:i==="picture-card",[`${Q}-picture-circle-wrapper`]:i==="picture-circle"}),mt=Object.assign(Object.assign({},xe==null?void 0:xe.style),B);if($==="drag"){const k=ee(dt,Q,`${Q}-drag`,{[`${Q}-drag-uploading`]:T.some(R=>R.status==="uploading"),[`${Q}-drag-hover`]:O==="dragover",[`${Q}-disabled`]:H,[`${Q}-rtl`]:ve==="rtl"});return Xe(l.createElement("span",{className:Ge,ref:P},l.createElement("div",{className:k,style:mt,onDrop:M,onDragOver:M,onDragLeave:M},l.createElement(at,Object.assign({},Ie,{ref:E,className:`${Q}-btn`}),l.createElement("div",{className:`${Q}-drag-container`},h))),Ve()))}const or=ee(Q,`${Q}-select`,{[`${Q}-disabled`]:H,[`${Q}-hidden`]:!h}),ft=l.createElement("div",{className:or,style:mt},l.createElement(at,Object.assign({},Ie,{ref:E})));return Xe(i==="picture-card"||i==="picture-circle"?l.createElement("span",{className:Ge,ref:P},Ve(ft,!!h)):l.createElement("span",{className:Ge,ref:P},ft,Ve()))},Gt=l.forwardRef(Vn);var Gn=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,a=Object.getOwnPropertySymbols(e);o<a.length;o++)t.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(e,a[o])&&(n[a[o]]=e[a[o]]);return n};const Kn=l.forwardRef((e,t)=>{const{style:n,height:a,hasControlInside:o=!1,children:r}=e,s=Gn(e,["style","height","hasControlInside","children"]),i=Object.assign(Object.assign({},n),{height:a});return l.createElement(Gt,Object.assign({ref:t,hasControlInside:o},s,{style:i,type:"drag"}),r)}),ct=Gt;ct.Dragger=Kn;ct.LIST_IGNORE=ke;const Jn=["10014"],Yn=({url:e,token:t,role:n,getMessage:a})=>{const o=(c,m)=>a?a(c):m,r=Dr.create({baseURL:e,timeout:1e6});return r.interceptors.request.use(c=>{let m=t;if(!m&&!["user/login","user/kaptcha","user/regist"].some(v=>c.url.includes(v))){window.location.pathname="/login";return}return c.headers.Authorization=m||"",c.headers.userName=n==="\u672A\u767B\u5F55\u7528\u6237"?"":n,c}),r.interceptors.response.use(c=>{const m=["user/kaptcha"],f=c.data;if(m.some($=>c.config.url&&c.config.url.includes($))||f.size&&f.type)return f;const{success:v,errorMsg:w,errorCode:x}=f;return Jn.includes(x)||v?f:(ne.error(w||o("server.requestError","\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5")),!1)},c=>{var m,f,v,w,x,$,h,B,A,L;c.message!=="canceled"&&((((f=(m=c==null?void 0:c.response)==null?void 0:m.data)==null?void 0:f.errorCode)==="30013"||((w=(v=c==null?void 0:c.response)==null?void 0:v.data)==null?void 0:w.errorCode)==="30023")&&ne.error((((x=c==null?void 0:c.response)==null?void 0:x.data)||{}).errorMsg||o("server.requestError","\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5")),(($=c==null?void 0:c.response)==null?void 0:$.status)===401&&(console.log("Error url:",(h=c==null?void 0:c.request)==null?void 0:h.responseURL),ne.error((((B=c==null?void 0:c.response)==null?void 0:B.data)||{}).errorMsg||o("server.noPermission","\u6CA1\u6709\u8DB3\u591F\u6743\u9650"))),console.log("Error occurs",c),(((A=c==null?void 0:c.response)==null?void 0:A.data)||{}).errorMsg!="\u672A\u8BBE\u7F6E\u9ED8\u8BA4\u914D\u7F6E\uFF01"&&ne.error((((L=c==null?void 0:c.response)==null?void 0:L.data)||{}).errorMsg||o("server.requestError","\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5")))}),{getLibraryList:async c=>{try{const m=await r.get(`/sensitive/library?${new URLSearchParams(c).toString()}`),{success:f,data:v}=m;return f?v:!1}catch(m){return console.log("e",m),!1}},createLibrary:async c=>{try{const m=await r.post("/sensitive/library",c),{success:f,data:v}=m;return f?v:!1}catch(m){return console.log("e",m),!1}},deleteLibrary:async c=>{try{const m=await r.delete(`/sensitive/library/${c}`),{success:f,data:v}=m;return f?v:!1}catch(m){return console.log("e",m),!1}},updateLibrary:async(c,m)=>{try{const f=await r.put(`/sensitive/library/${c}`,m),{success:v,data:w}=f;return v?w:!1}catch(f){return console.log("e",f),!1}},downloadTemplate:async c=>{try{const m=await r.get("/sensitive/word/downloadTemplate",{params:{fileType:c},responseType:"blob"});return m&&typeof m.size=="number"?m:!1}catch(m){return console.log("e",m),!1}},importWords:async(c,m)=>{try{const f=new FormData;f.append("file",m);const v=await r.put(`/sensitive/word/${c}/import`,f);return v&&v.success!==!1?v:!1}catch(f){return console.log("e",f),!1}},getWords:async c=>{try{const m=await r.get(`/sensitive/library/${c}`),{success:f,data:v}=m;return f?v:!1}catch(m){return console.log("e",m),!1}},getLibraryData:async c=>{try{const m=await r.get(`/sensitive/library/${c}`),{success:f,data:v}=m;return f?v:!1}catch(m){return console.log("e",m),!1}}}},We={toolbar:{searchPlaceholder:"\u8BF7\u8F93\u5165\u5185\u5BB9"},tagCell:{viewAllTitle:"\u5171 {{total}} \u4E2A\uFF0C\u5F53\u524D\u4EC5\u5C55\u793A\u524D {{max}} \u4E2A",viewAllLink:"\u2026\u67E5\u770B\u5168\u90E8\uFF08+{{count}}\uFF09"},table:{label:"\u654F\u611F\u8BCD\u914D\u7F6E",viewLabel:"\u654F\u611F\u8BCD\u5E93\u5217\u8868",columns:{name:"\u540D\u79F0",sensitiveWords:"\u654F\u611F\u8BCD",createDate:"\u521B\u5EFA\u65E5\u671F",count:"\u6570\u91CF",actions:"\u64CD\u4F5C"},toolbar:{create:"\u65B0\u5EFA\u654F\u611F\u8BCD\u5E93",searchPlaceholder:"\u8BF7\u8F93\u5165\u5185\u5BB9"},actionEdit:"\u7F16\u8F91",actionDelete:"\u5220\u9664"},dashboard:{title:"\u654F\u611F\u8BCD\u5E93\u7BA1\u7406"},deleteConfirm:{title:"\u786E\u8BA4\u5220\u9664\u654F\u611F\u8BCD\u5E93\uFF1F",content:"\u5220\u9664\u540E\uFF0C\u8BE5\u654F\u611F\u8BCD\u5E93\u5C06\u65E0\u6CD5\u6062\u590D",okText:"\u5220\u9664",cancelText:"\u53D6\u6D88"},createModal:{title:"\u65B0\u5EFA\u654F\u611F\u8BCD\u5E93",cancel:"\u53D6\u6D88",confirm:"\u786E\u8BA4",nameRequired:"\u8BF7\u8F93\u5165\u654F\u611F\u8BCD\u5E93\u540D\u79F0!",namePlaceholder:"\u8BF7\u8F93\u5165"},message:{saveSuccess:"\u4FDD\u5B58\u6210\u529F",createSuccess:"\u65B0\u589E\u654F\u611F\u8BCD\u6210\u529F!",deleteSuccess:"\u5220\u9664\u6210\u529F",downloadTemplateFail:"\u6A21\u677F\u4E0B\u8F7D\u5931\u8D25",importSuccess:"\u5BFC\u5165\u6210\u529F",importFail:"\u5BFC\u5165\u5931\u8D25"},downloadTemplateFilename:"\u654F\u611F\u8BCD\u6A21\u677F",editor:{maxLengthHint:"\u654F\u611F\u8BCD\u6700\u591A\u53EF\u8F93\u5165{{max}}\u4E2A\u5B57\u7B26",maxLengthWarning:"\u654F\u611F\u8BCD\u6700\u591A\u53EF\u8F93\u5165{{max}}\u4E2A\u5B57\u7B26",duplicateWarning:"\u5DF2\u5B58\u5728\u76F8\u540C\u654F\u611F\u8BCD",configTemplateHint:"\u8BF7\u914D\u7F6E\u6A21\u677F\u4E0B\u8F7D\u5730\u5740",selectFileWarning:"\u8BF7\u5148\u9009\u62E9\u8981\u4E0A\u4F20\u7684\u6587\u4EF6",importFailRetry:"\u5BFC\u5165\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5",importCountSuccess:"\u5DF2\u5BFC\u5165 {{count}} \u4E2A\u654F\u611F\u8BCD",parseFail:"\u6587\u4EF6\u89E3\u6790\u5931\u8D25\uFF0C\u8BF7\u786E\u4FDD\u4E3A csv \u6216 txt \u683C\u5F0F",readFileFail:"\u6587\u4EF6\u8BFB\u53D6\u5931\u8D25",searchPlaceholder:"\u8BF7\u8F93\u5165\u654F\u611F\u8BCD\u641C\u7D22",inputPlaceholder:"\u8BF7\u8F93\u5165",add:"\u6DFB\u52A0",import:"\u5BFC\u5165",cancel:"\u53D6\u6D88",save:"\u4FDD\u5B58",confirm:"\u786E\u8BA4",downloadTemplate:"\u4E0B\u8F7D\u6A21\u677F",uploadModalTitle:"\u4E0A\u4F20\u6587\u4EF6",uploadModalHint:"\u5148\u4E0B\u8F7D\u6A21\u677F\u540E\u4E0A\u4F20",uploadDragText:"\u70B9\u51FB\u6216\u5C06\u6587\u4EF6\u62D6\u62FD\u5230\u6B64\u5904\u4E0A\u4F20",uploadDragHint:"\u652F\u6301\u5355\u6B21\u4E0A\u4F20\uFF0C\u652F\u6301 csv\u3001txt \u683C\u5F0F\u3002",formatCsv:"csv",formatTxt:"txt"},server:{requestError:"\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5",noPermission:"\u6CA1\u6709\u8DB3\u591F\u6743\u9650"}},Zn={toolbar:{searchPlaceholder:"Enter keyword"},tagCell:{viewAllTitle:"{{total}} total, showing first {{max}}",viewAllLink:"\u2026View all (+{{count}})"},table:{label:"Sensitive words",viewLabel:"Sensitive word libraries",columns:{name:"Name",sensitiveWords:"Sensitive words",createDate:"Created",count:"Count",actions:"Actions"},toolbar:{create:"New library",searchPlaceholder:"Enter keyword"},actionEdit:"Edit",actionDelete:"Delete"},dashboard:{title:"Sensitive word libraries"},deleteConfirm:{title:"Delete this library?",content:"This library cannot be recovered after deletion.",okText:"Delete",cancelText:"Cancel"},createModal:{title:"New sensitive word library",cancel:"Cancel",confirm:"Confirm",nameRequired:"Please enter the library name.",namePlaceholder:"Enter name"},message:{saveSuccess:"Saved",createSuccess:"Library created.",deleteSuccess:"Deleted",downloadTemplateFail:"Template download failed",importSuccess:"Import succeeded",importFail:"Import failed"},downloadTemplateFilename:"sensitive-words-template",editor:{maxLengthHint:"Max {{max}} characters per word",maxLengthWarning:"Max {{max}} characters per word",duplicateWarning:"Duplicate word",configTemplateHint:"Please configure template download URL",selectFileWarning:"Please select a file first",importFailRetry:"Import failed, please retry",importCountSuccess:"Imported {{count}} words",parseFail:"Parse failed. Use csv or txt format.",readFileFail:"File read failed",searchPlaceholder:"Search sensitive words",inputPlaceholder:"Enter",add:"Add",import:"Import",cancel:"Cancel",save:"Save",confirm:"Confirm",downloadTemplate:"Download template",uploadModalTitle:"Upload file",uploadModalHint:"Download template first, then upload",uploadDragText:"Click or drag file here to upload",uploadDragHint:"Single file. csv or txt.",formatCsv:"csv",formatTxt:"txt"},server:{requestError:"Request failed, please try again.",noPermission:"Insufficient permission"}},Qn={toolbar:{searchPlaceholder:"\u30AD\u30FC\u30EF\u30FC\u30C9\u3092\u5165\u529B"},tagCell:{viewAllTitle:"\u5168{{total}}\u4EF6\u3001\u5148\u982D{{max}}\u4EF6\u3092\u8868\u793A",viewAllLink:"\u2026\u3059\u3079\u3066\u8868\u793A\uFF08+{{count}}\uFF09"},table:{label:"\u30BB\u30F3\u30B7\u30C6\u30A3\u30D6\u30EF\u30FC\u30C9",viewLabel:"\u30BB\u30F3\u30B7\u30C6\u30A3\u30D6\u30EF\u30FC\u30C9\u30E9\u30A4\u30D6\u30E9\u30EA",columns:{name:"\u540D\u524D",sensitiveWords:"\u30BB\u30F3\u30B7\u30C6\u30A3\u30D6\u30EF\u30FC\u30C9",createDate:"\u4F5C\u6210\u65E5",count:"\u4EF6\u6570",actions:"\u64CD\u4F5C"},toolbar:{create:"\u65B0\u898F\u30E9\u30A4\u30D6\u30E9\u30EA",searchPlaceholder:"\u30AD\u30FC\u30EF\u30FC\u30C9\u3092\u5165\u529B"},actionEdit:"\u7DE8\u96C6",actionDelete:"\u524A\u9664"},dashboard:{title:"\u30BB\u30F3\u30B7\u30C6\u30A3\u30D6\u30EF\u30FC\u30C9\u7BA1\u7406"},deleteConfirm:{title:"\u3053\u306E\u30E9\u30A4\u30D6\u30E9\u30EA\u3092\u524A\u9664\u3057\u307E\u3059\u304B\uFF1F",content:"\u524A\u9664\u3059\u308B\u3068\u5FA9\u5143\u3067\u304D\u307E\u305B\u3093\u3002",okText:"\u524A\u9664",cancelText:"\u30AD\u30E3\u30F3\u30BB\u30EB"},createModal:{title:"\u65B0\u898F\u30BB\u30F3\u30B7\u30C6\u30A3\u30D6\u30EF\u30FC\u30C9\u30E9\u30A4\u30D6\u30E9\u30EA",cancel:"\u30AD\u30E3\u30F3\u30BB\u30EB",confirm:"\u78BA\u8A8D",nameRequired:"\u30E9\u30A4\u30D6\u30E9\u30EA\u540D\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\u3002",namePlaceholder:"\u5165\u529B"},message:{saveSuccess:"\u4FDD\u5B58\u3057\u307E\u3057\u305F",createSuccess:"\u30E9\u30A4\u30D6\u30E9\u30EA\u3092\u4F5C\u6210\u3057\u307E\u3057\u305F\u3002",deleteSuccess:"\u524A\u9664\u3057\u307E\u3057\u305F",downloadTemplateFail:"\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u306E\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u306B\u5931\u6557\u3057\u307E\u3057\u305F",importSuccess:"\u30A4\u30F3\u30DD\u30FC\u30C8\u3057\u307E\u3057\u305F",importFail:"\u30A4\u30F3\u30DD\u30FC\u30C8\u306B\u5931\u6557\u3057\u307E\u3057\u305F"},downloadTemplateFilename:"\u30BB\u30F3\u30B7\u30C6\u30A3\u30D6\u30EF\u30FC\u30C9\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8",editor:{maxLengthHint:"1\u8A9E\u3042\u305F\u308A{{max}}\u6587\u5B57\u307E\u3067",maxLengthWarning:"1\u8A9E\u3042\u305F\u308A{{max}}\u6587\u5B57\u307E\u3067",duplicateWarning:"\u540C\u3058\u8A9E\u304C\u65E2\u306B\u3042\u308A\u307E\u3059",configTemplateHint:"\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9URL\u3092\u8A2D\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044",selectFileWarning:"\u30D5\u30A1\u30A4\u30EB\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044",importFailRetry:"\u30A4\u30F3\u30DD\u30FC\u30C8\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002\u518D\u8A66\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002",importCountSuccess:"{{count}}\u8A9E\u3092\u30A4\u30F3\u30DD\u30FC\u30C8\u3057\u307E\u3057\u305F",parseFail:"\u89E3\u6790\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002csv \u307E\u305F\u306F txt \u5F62\u5F0F\u306B\u3057\u3066\u304F\u3060\u3055\u3044\u3002",readFileFail:"\u30D5\u30A1\u30A4\u30EB\u306E\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F",searchPlaceholder:"\u30BB\u30F3\u30B7\u30C6\u30A3\u30D6\u30EF\u30FC\u30C9\u3092\u691C\u7D22",inputPlaceholder:"\u5165\u529B",add:"\u8FFD\u52A0",import:"\u30A4\u30F3\u30DD\u30FC\u30C8",cancel:"\u30AD\u30E3\u30F3\u30BB\u30EB",save:"\u4FDD\u5B58",confirm:"\u78BA\u8A8D",downloadTemplate:"\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u3092\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9",uploadModalTitle:"\u30D5\u30A1\u30A4\u30EB\u3092\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9",uploadModalHint:"\u5148\u306B\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u3092\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u3057\u3066\u304B\u3089\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9",uploadDragText:"\u30AF\u30EA\u30C3\u30AF\u307E\u305F\u306F\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9",uploadDragHint:"1\u30D5\u30A1\u30A4\u30EB\u3002csv \u307E\u305F\u306F txt\u3002",formatCsv:"csv",formatTxt:"txt"},server:{requestError:"\u30EA\u30AF\u30A8\u30B9\u30C8\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002\u3057\u3070\u3089\u304F\u3057\u3066\u304B\u3089\u304A\u8A66\u3057\u304F\u3060\u3055\u3044\u3002",noPermission:"\u6A29\u9650\u304C\u3042\u308A\u307E\u305B\u3093"}},ea={zh:We,en:Zn,ja:Qn};function ta(e){return ea[e]??We}function Le(e,t){return e.replace(/\{\{(\w+)\}\}/g,(n,a)=>String(t[a]??""))}const Kt=Ee.createContext({locale:"zh",messages:We,getMessage:e=>{const t=e.split(".");let n=We;for(const a of t)n=n==null?void 0:n[a];return typeof n=="string"?n:e}});function qe(){return Ee.useContext(Kt)}function ra({locale:e,messages:t,children:n}){const a=Ee.useMemo(()=>{const o=ta(e),r=t?{...o,...t}:o;return{locale:e,messages:r,getMessage:i=>{const u=i.split(".");let d=r;for(const p of u)d=d==null?void 0:d[p];return typeof d=="string"?d:i}}},[e,t]);return Ee.createElement(Kt.Provider,{value:a},n)}const{Dragger:na}=ct,De=16,aa=ce.div.attrs({className:"sensitive-edit-page"})`
11
+ */const he=De("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),$e=["10014"],Me=({url:e,token:r,role:F,getMessage:f})=>{const c=(t,o)=>f?f(t):o,i=_e.create({baseURL:e,timeout:1e6});return i.interceptors.request.use(t=>{let o=r;if(!o&&!["user/login","user/kaptcha","user/regist"].some(p=>t.url.includes(p))){window.location.pathname="/login";return}return t.headers.Authorization=o||"",t.headers.userName=F==="\u672A\u767B\u5F55\u7528\u6237"?"":F,t}),i.interceptors.response.use(t=>{const o=["user/kaptcha"],l=t.data;if(o.some(g=>t.config.url&&t.config.url.includes(g))||l.size&&l.type)return l;const{success:p,errorMsg:E,errorCode:M}=l;return $e.includes(M)||p?l:(b.error(E||c("server.requestError","\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5")),!1)},t=>{var o,l,p,E,M,g,y,N,R,q;t.message!=="canceled"&&((((l=(o=t==null?void 0:t.response)==null?void 0:o.data)==null?void 0:l.errorCode)==="30013"||((E=(p=t==null?void 0:t.response)==null?void 0:p.data)==null?void 0:E.errorCode)==="30023")&&b.error((((M=t==null?void 0:t.response)==null?void 0:M.data)||{}).errorMsg||c("server.requestError","\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5")),((g=t==null?void 0:t.response)==null?void 0:g.status)===401&&(console.log("Error url:",(y=t==null?void 0:t.request)==null?void 0:y.responseURL),b.error((((N=t==null?void 0:t.response)==null?void 0:N.data)||{}).errorMsg||c("server.noPermission","\u6CA1\u6709\u8DB3\u591F\u6743\u9650"))),console.log("Error occurs",t),(((R=t==null?void 0:t.response)==null?void 0:R.data)||{}).errorMsg!="\u672A\u8BBE\u7F6E\u9ED8\u8BA4\u914D\u7F6E\uFF01"&&b.error((((q=t==null?void 0:t.response)==null?void 0:q.data)||{}).errorMsg||c("server.requestError","\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5")))}),{getLibraryList:async t=>{try{const o=await i.get(`/sensitive/library?${new URLSearchParams(t).toString()}`),{success:l,data:p}=o;return l?p:!1}catch(o){return console.log("e",o),!1}},createLibrary:async t=>{try{const o=await i.post("/sensitive/library",t),{success:l,data:p}=o;return l?p:!1}catch(o){return console.log("e",o),!1}},deleteLibrary:async t=>{try{const o=await i.delete(`/sensitive/library/${t}`),{success:l,data:p}=o;return l?p:!1}catch(o){return console.log("e",o),!1}},updateLibrary:async(t,o)=>{try{const l=await i.put(`/sensitive/library/${t}`,o),{success:p,data:E}=l;return p?E:!1}catch(l){return console.log("e",l),!1}},downloadTemplate:async t=>{try{const o=await i.get("/sensitive/word/downloadTemplate",{params:{fileType:t},responseType:"blob"});return o&&typeof o.size=="number"?o:!1}catch(o){return console.log("e",o),!1}},importWords:async(t,o)=>{try{const l=new FormData;l.append("file",o);const p=await i.put(`/sensitive/word/${t}/import`,l);return p&&p.success!==!1?p:!1}catch(l){return console.log("e",l),!1}},getWords:async t=>{try{const o=await i.get(`/sensitive/library/${t}`),{success:l,data:p}=o;return l?p:!1}catch(o){return console.log("e",o),!1}},getLibraryData:async t=>{try{const o=await i.get(`/sensitive/library/${t}`),{success:l,data:p}=o;return l?p:!1}catch(o){return console.log("e",o),!1}}}},te={toolbar:{searchPlaceholder:"\u8BF7\u8F93\u5165\u5185\u5BB9"},tagCell:{viewAllTitle:"\u5171 {{total}} \u4E2A\uFF0C\u5F53\u524D\u4EC5\u5C55\u793A\u524D {{max}} \u4E2A",viewAllLink:"\u2026\u67E5\u770B\u5168\u90E8\uFF08+{{count}}\uFF09"},table:{label:"\u654F\u611F\u8BCD\u914D\u7F6E",viewLabel:"\u654F\u611F\u8BCD\u5E93\u5217\u8868",columns:{name:"\u540D\u79F0",sensitiveWords:"\u654F\u611F\u8BCD",createDate:"\u521B\u5EFA\u65E5\u671F",count:"\u6570\u91CF",actions:"\u64CD\u4F5C"},toolbar:{create:"\u65B0\u5EFA\u654F\u611F\u8BCD\u5E93",searchPlaceholder:"\u8BF7\u8F93\u5165\u5185\u5BB9"},actionEdit:"\u7F16\u8F91",actionDelete:"\u5220\u9664"},dashboard:{title:"\u654F\u611F\u8BCD\u5E93\u7BA1\u7406"},deleteConfirm:{title:"\u786E\u8BA4\u5220\u9664\u654F\u611F\u8BCD\u5E93\uFF1F",content:"\u5220\u9664\u540E\uFF0C\u8BE5\u654F\u611F\u8BCD\u5E93\u5C06\u65E0\u6CD5\u6062\u590D",okText:"\u5220\u9664",cancelText:"\u53D6\u6D88"},createModal:{title:"\u65B0\u5EFA\u654F\u611F\u8BCD\u5E93",cancel:"\u53D6\u6D88",confirm:"\u786E\u8BA4",nameRequired:"\u8BF7\u8F93\u5165\u654F\u611F\u8BCD\u5E93\u540D\u79F0!",namePlaceholder:"\u8BF7\u8F93\u5165"},message:{saveSuccess:"\u4FDD\u5B58\u6210\u529F",createSuccess:"\u65B0\u589E\u654F\u611F\u8BCD\u6210\u529F!",deleteSuccess:"\u5220\u9664\u6210\u529F",downloadTemplateFail:"\u6A21\u677F\u4E0B\u8F7D\u5931\u8D25",importSuccess:"\u5BFC\u5165\u6210\u529F",importFail:"\u5BFC\u5165\u5931\u8D25"},downloadTemplateFilename:"\u654F\u611F\u8BCD\u6A21\u677F",editor:{maxLengthHint:"\u654F\u611F\u8BCD\u6700\u591A\u53EF\u8F93\u5165{{max}}\u4E2A\u5B57\u7B26",maxLengthWarning:"\u654F\u611F\u8BCD\u6700\u591A\u53EF\u8F93\u5165{{max}}\u4E2A\u5B57\u7B26",duplicateWarning:"\u5DF2\u5B58\u5728\u76F8\u540C\u654F\u611F\u8BCD",configTemplateHint:"\u8BF7\u914D\u7F6E\u6A21\u677F\u4E0B\u8F7D\u5730\u5740",selectFileWarning:"\u8BF7\u5148\u9009\u62E9\u8981\u4E0A\u4F20\u7684\u6587\u4EF6",importFailRetry:"\u5BFC\u5165\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5",importCountSuccess:"\u5DF2\u5BFC\u5165 {{count}} \u4E2A\u654F\u611F\u8BCD",parseFail:"\u6587\u4EF6\u89E3\u6790\u5931\u8D25\uFF0C\u8BF7\u786E\u4FDD\u4E3A csv \u6216 txt \u683C\u5F0F",readFileFail:"\u6587\u4EF6\u8BFB\u53D6\u5931\u8D25",searchPlaceholder:"\u8BF7\u8F93\u5165\u654F\u611F\u8BCD\u641C\u7D22",inputPlaceholder:"\u8BF7\u8F93\u5165",add:"\u6DFB\u52A0",import:"\u5BFC\u5165",cancel:"\u53D6\u6D88",save:"\u4FDD\u5B58",confirm:"\u786E\u8BA4",downloadTemplate:"\u4E0B\u8F7D\u6A21\u677F",uploadModalTitle:"\u4E0A\u4F20\u6587\u4EF6",uploadModalHint:"\u5148\u4E0B\u8F7D\u6A21\u677F\u540E\u4E0A\u4F20",uploadDragText:"\u70B9\u51FB\u6216\u5C06\u6587\u4EF6\u62D6\u62FD\u5230\u6B64\u5904\u4E0A\u4F20",uploadDragHint:"\u652F\u6301\u5355\u6B21\u4E0A\u4F20\uFF0C\u652F\u6301 csv\u3001txt \u683C\u5F0F\u3002",formatCsv:"csv",formatTxt:"txt"},server:{requestError:"\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5",noPermission:"\u6CA1\u6709\u8DB3\u591F\u6743\u9650"}},Pe={toolbar:{searchPlaceholder:"Enter keyword"},tagCell:{viewAllTitle:"{{total}} total, showing first {{max}}",viewAllLink:"\u2026View all (+{{count}})"},table:{label:"Sensitive words",viewLabel:"Sensitive word libraries",columns:{name:"Name",sensitiveWords:"Sensitive words",createDate:"Created",count:"Count",actions:"Actions"},toolbar:{create:"New library",searchPlaceholder:"Enter keyword"},actionEdit:"Edit",actionDelete:"Delete"},dashboard:{title:"Sensitive word libraries"},deleteConfirm:{title:"Delete this library?",content:"This library cannot be recovered after deletion.",okText:"Delete",cancelText:"Cancel"},createModal:{title:"New sensitive word library",cancel:"Cancel",confirm:"Confirm",nameRequired:"Please enter the library name.",namePlaceholder:"Enter name"},message:{saveSuccess:"Saved",createSuccess:"Library created.",deleteSuccess:"Deleted",downloadTemplateFail:"Template download failed",importSuccess:"Import succeeded",importFail:"Import failed"},downloadTemplateFilename:"sensitive-words-template",editor:{maxLengthHint:"Max {{max}} characters per word",maxLengthWarning:"Max {{max}} characters per word",duplicateWarning:"Duplicate word",configTemplateHint:"Please configure template download URL",selectFileWarning:"Please select a file first",importFailRetry:"Import failed, please retry",importCountSuccess:"Imported {{count}} words",parseFail:"Parse failed. Use csv or txt format.",readFileFail:"File read failed",searchPlaceholder:"Search sensitive words",inputPlaceholder:"Enter",add:"Add",import:"Import",cancel:"Cancel",save:"Save",confirm:"Confirm",downloadTemplate:"Download template",uploadModalTitle:"Upload file",uploadModalHint:"Download template first, then upload",uploadDragText:"Click or drag file here to upload",uploadDragHint:"Single file. csv or txt.",formatCsv:"csv",formatTxt:"txt"},server:{requestError:"Request failed, please try again.",noPermission:"Insufficient permission"}},ze={toolbar:{searchPlaceholder:"\u30AD\u30FC\u30EF\u30FC\u30C9\u3092\u5165\u529B"},tagCell:{viewAllTitle:"\u5168{{total}}\u4EF6\u3001\u5148\u982D{{max}}\u4EF6\u3092\u8868\u793A",viewAllLink:"\u2026\u3059\u3079\u3066\u8868\u793A\uFF08+{{count}}\uFF09"},table:{label:"\u30BB\u30F3\u30B7\u30C6\u30A3\u30D6\u30EF\u30FC\u30C9",viewLabel:"\u30BB\u30F3\u30B7\u30C6\u30A3\u30D6\u30EF\u30FC\u30C9\u30E9\u30A4\u30D6\u30E9\u30EA",columns:{name:"\u540D\u524D",sensitiveWords:"\u30BB\u30F3\u30B7\u30C6\u30A3\u30D6\u30EF\u30FC\u30C9",createDate:"\u4F5C\u6210\u65E5",count:"\u4EF6\u6570",actions:"\u64CD\u4F5C"},toolbar:{create:"\u65B0\u898F\u30E9\u30A4\u30D6\u30E9\u30EA",searchPlaceholder:"\u30AD\u30FC\u30EF\u30FC\u30C9\u3092\u5165\u529B"},actionEdit:"\u7DE8\u96C6",actionDelete:"\u524A\u9664"},dashboard:{title:"\u30BB\u30F3\u30B7\u30C6\u30A3\u30D6\u30EF\u30FC\u30C9\u7BA1\u7406"},deleteConfirm:{title:"\u3053\u306E\u30E9\u30A4\u30D6\u30E9\u30EA\u3092\u524A\u9664\u3057\u307E\u3059\u304B\uFF1F",content:"\u524A\u9664\u3059\u308B\u3068\u5FA9\u5143\u3067\u304D\u307E\u305B\u3093\u3002",okText:"\u524A\u9664",cancelText:"\u30AD\u30E3\u30F3\u30BB\u30EB"},createModal:{title:"\u65B0\u898F\u30BB\u30F3\u30B7\u30C6\u30A3\u30D6\u30EF\u30FC\u30C9\u30E9\u30A4\u30D6\u30E9\u30EA",cancel:"\u30AD\u30E3\u30F3\u30BB\u30EB",confirm:"\u78BA\u8A8D",nameRequired:"\u30E9\u30A4\u30D6\u30E9\u30EA\u540D\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\u3002",namePlaceholder:"\u5165\u529B"},message:{saveSuccess:"\u4FDD\u5B58\u3057\u307E\u3057\u305F",createSuccess:"\u30E9\u30A4\u30D6\u30E9\u30EA\u3092\u4F5C\u6210\u3057\u307E\u3057\u305F\u3002",deleteSuccess:"\u524A\u9664\u3057\u307E\u3057\u305F",downloadTemplateFail:"\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u306E\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u306B\u5931\u6557\u3057\u307E\u3057\u305F",importSuccess:"\u30A4\u30F3\u30DD\u30FC\u30C8\u3057\u307E\u3057\u305F",importFail:"\u30A4\u30F3\u30DD\u30FC\u30C8\u306B\u5931\u6557\u3057\u307E\u3057\u305F"},downloadTemplateFilename:"\u30BB\u30F3\u30B7\u30C6\u30A3\u30D6\u30EF\u30FC\u30C9\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8",editor:{maxLengthHint:"1\u8A9E\u3042\u305F\u308A{{max}}\u6587\u5B57\u307E\u3067",maxLengthWarning:"1\u8A9E\u3042\u305F\u308A{{max}}\u6587\u5B57\u307E\u3067",duplicateWarning:"\u540C\u3058\u8A9E\u304C\u65E2\u306B\u3042\u308A\u307E\u3059",configTemplateHint:"\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9URL\u3092\u8A2D\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044",selectFileWarning:"\u30D5\u30A1\u30A4\u30EB\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044",importFailRetry:"\u30A4\u30F3\u30DD\u30FC\u30C8\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002\u518D\u8A66\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002",importCountSuccess:"{{count}}\u8A9E\u3092\u30A4\u30F3\u30DD\u30FC\u30C8\u3057\u307E\u3057\u305F",parseFail:"\u89E3\u6790\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002csv \u307E\u305F\u306F txt \u5F62\u5F0F\u306B\u3057\u3066\u304F\u3060\u3055\u3044\u3002",readFileFail:"\u30D5\u30A1\u30A4\u30EB\u306E\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F",searchPlaceholder:"\u30BB\u30F3\u30B7\u30C6\u30A3\u30D6\u30EF\u30FC\u30C9\u3092\u691C\u7D22",inputPlaceholder:"\u5165\u529B",add:"\u8FFD\u52A0",import:"\u30A4\u30F3\u30DD\u30FC\u30C8",cancel:"\u30AD\u30E3\u30F3\u30BB\u30EB",save:"\u4FDD\u5B58",confirm:"\u78BA\u8A8D",downloadTemplate:"\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u3092\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9",uploadModalTitle:"\u30D5\u30A1\u30A4\u30EB\u3092\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9",uploadModalHint:"\u5148\u306B\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u3092\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u3057\u3066\u304B\u3089\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9",uploadDragText:"\u30AF\u30EA\u30C3\u30AF\u307E\u305F\u306F\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9",uploadDragHint:"1\u30D5\u30A1\u30A4\u30EB\u3002csv \u307E\u305F\u306F txt\u3002",formatCsv:"csv",formatTxt:"txt"},server:{requestError:"\u30EA\u30AF\u30A8\u30B9\u30C8\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002\u3057\u3070\u3089\u304F\u3057\u3066\u304B\u3089\u304A\u8A66\u3057\u304F\u3060\u3055\u3044\u3002",noPermission:"\u6A29\u9650\u304C\u3042\u308A\u307E\u305B\u3093"}},Ne={zh:te,en:Pe,ja:ze};function We(e){return Ne[e]??te}function J(e,r){return e.replace(/\{\{(\w+)\}\}/g,(F,f)=>String(r[f]??""))}const ve=ue.createContext({locale:"zh",messages:te,getMessage:e=>{const r=e.split(".");let F=te;for(const f of r)F=F==null?void 0:F[f];return typeof F=="string"?F:e}});function ae(){return ue.useContext(ve)}function He({locale:e,messages:r,children:F}){const f=ue.useMemo(()=>{const c=We(e),i=r?{...c,...r}:c;return{locale:e,messages:i,getMessage:u=>{const A=u.split(".");let D=i;for(const I of A)D=D==null?void 0:D[I];return typeof D=="string"?D:u}}},[e,r]);return ue.createElement(ve.Provider,{value:f},F)}const{Dragger:Ue}=Ae,j=16,Re=v.div.attrs({className:"sensitive-edit-page"})`
32
12
  display: flex;
33
13
  flex-direction: column;
34
14
  width: 100%;
35
15
  height: 100%;
36
- background: ${({theme:e})=>{var t;return((t=e==null?void 0:e.colors)==null?void 0:t.background)??"#FFFFFF"}};
37
- `,oa=ce.div.attrs({className:"sensitive-edit-toolbar"})`
16
+ background: ${({theme:e})=>{var r;return((r=e==null?void 0:e.colors)==null?void 0:r.background)??"#FFFFFF"}};
17
+ `,qe=v.div.attrs({className:"sensitive-edit-toolbar"})`
38
18
  flex-shrink: 0;
39
19
  display: flex;
40
20
  align-items: center;
@@ -42,27 +22,27 @@ import{jsxs as le,jsx as I,Fragment as ir}from"react/jsx-runtime";import*as l fr
42
22
  flex-wrap: wrap;
43
23
  padding: 12px 20px;
44
24
 
45
- `,ia=ce.div.attrs({className:"sensitive-edit-content-box"})`
25
+ `,je=v.div.attrs({className:"sensitive-edit-content-box"})`
46
26
  flex: 1;
47
27
  min-height: 0;
48
28
  overflow: auto;
49
- border: 1px solid ${({theme:e})=>{var t;return((t=e==null?void 0:e.colors)==null?void 0:t.border)??"#E5E7EB"}};
50
- background: ${({theme:e})=>{var t;return((t=e==null?void 0:e.colors)==null?void 0:t.listBackground)??"#f5f5f5"}};
29
+ border: 1px solid ${({theme:e})=>{var r;return((r=e==null?void 0:e.colors)==null?void 0:r.border)??"#E5E7EB"}};
30
+ background: ${({theme:e})=>{var r;return((r=e==null?void 0:e.colors)==null?void 0:r.listBackground)??"#f5f5f5"}};
51
31
  border-radius: 8px;
52
32
  padding: 16px;
53
33
  margin: 0 20px;
54
- `,sa=ce.div.attrs({className:"sensitive-edit-tag-list"})`
34
+ `,Ve=v.div.attrs({className:"sensitive-edit-tag-list"})`
55
35
  display: flex;
56
36
  flex-wrap: wrap;
57
37
  gap: 12px;
58
38
  min-height: 30px;
59
- `,Be=28,la=ce.span.attrs({className:"sensitive-edit-tag"})`
39
+ `,V=28,Oe=v.span.attrs({className:"sensitive-edit-tag"})`
60
40
  box-sizing: border-box;
61
41
  display: inline-flex;
62
42
  align-items: center;
63
43
  gap: 6px;
64
- height: ${Be}px;
65
- min-height: ${Be}px;
44
+ height: ${V}px;
45
+ min-height: ${V}px;
66
46
  color: ${e=>e.$color};
67
47
  background: ${e=>e.$bg};
68
48
  border: ${e=>e.$border==="none"?"none":`1px solid ${e.$border}`};
@@ -82,13 +62,13 @@ import{jsxs as le,jsx as I,Fragment as ir}from"react/jsx-runtime";import*as l fr
82
62
  opacity: 1;
83
63
  }
84
64
  }
85
- `,ca=ce.span.attrs({className:"sensitive-edit-add-trigger"})`
65
+ `,Ke=v.span.attrs({className:"sensitive-edit-add-trigger"})`
86
66
  box-sizing: border-box;
87
67
  display: inline-flex;
88
68
  align-items: center;
89
69
  gap: 6px;
90
- height: ${Be}px;
91
- min-height: ${Be}px;
70
+ height: ${V}px;
71
+ min-height: ${V}px;
92
72
  padding: 0 12px;
93
73
  border: 1px dashed ${e=>e.$color};
94
74
  border-radius: 4px;
@@ -104,13 +84,13 @@ import{jsxs as le,jsx as I,Fragment as ir}from"react/jsx-runtime";import*as l fr
104
84
  border-style: solid;
105
85
  opacity: 0.9;
106
86
  }
107
- `,ua=ce.span.attrs({className:"sensitive-edit-add-input-wrap"})`
87
+ `,Ge=v.span.attrs({className:"sensitive-edit-add-input-wrap"})`
108
88
  box-sizing: border-box;
109
89
  display: inline-flex;
110
90
  align-items: center;
111
91
 
112
- height: ${Be}px;
113
- min-height: ${Be}px;
92
+ height: ${V}px;
93
+ min-height: ${V}px;
114
94
  padding: 0 8px 0 12px;
115
95
  border: 1px solid ${e=>e.$focused?e.$color:"#E5E7EB"};
116
96
  border-radius: 4px;
@@ -131,25 +111,25 @@ import{jsxs as le,jsx as I,Fragment as ir}from"react/jsx-runtime";import*as l fr
131
111
  .sensitive-edit-add-input::placeholder {
132
112
  color: #9ca3af;
133
113
  }
134
- `,da=ce.div.attrs({className:"sensitive-edit-footer"})`
114
+ `,Xe=v.div.attrs({className:"sensitive-edit-footer"})`
135
115
  flex-shrink: 0;
136
116
  display: flex;
137
117
  justify-content: flex-end;
138
118
  gap: 10px;
139
119
  padding: 16px 20px;
140
120
 
141
- `,pa=ce.div.attrs({className:"sensitive-upload-modal-alert"})`
121
+ `,Je=v.div.attrs({className:"sensitive-upload-modal-alert"})`
142
122
  display: flex;
143
123
  align-items: center;
144
124
  justify-content: space-between;
145
125
  gap: 12px;
146
126
  padding: 4px 14px;
147
127
  margin-bottom: 16px;
148
- background: ${({theme:e})=>{var t;return((t=e==null?void 0:e.colors)==null?void 0:t.tagBackground)??"#eff6ff"}};
128
+ background: ${({theme:e})=>{var r;return((r=e==null?void 0:e.colors)==null?void 0:r.tagBackground)??"#eff6ff"}};
149
129
  border-radius: 6px;
150
130
  font-size: 14px;
151
- color: ${({theme:e})=>{var t;return((t=e==null?void 0:e.colors)==null?void 0:t.text)??"#1f2937"}};
152
- `,ma=ce.div.attrs({className:"sensitive-upload-modal-dragger-wrap"})`
131
+ color: ${({theme:e})=>{var r;return((r=e==null?void 0:e.colors)==null?void 0:r.text)??"#1f2937"}};
132
+ `,Ye=v.div.attrs({className:"sensitive-upload-modal-dragger-wrap"})`
153
133
  .ant-upload-drag {
154
134
  border-radius: 8px;
155
135
  border: 1px dashed #d1d5db;
@@ -159,25 +139,25 @@ import{jsxs as le,jsx as I,Fragment as ir}from"react/jsx-runtime";import*as l fr
159
139
  border-color: #1d70f5;
160
140
  background: #f0f7ff;
161
141
  }
162
- `,fa=({words:e,onWordsChange:t,onSave:n,onCancel:a,styles:o,onDownloadTemplate:r,onImportFile:s})=>{var T;const{messages:i}=qe(),[u,d]=me(""),[p,g]=me(!1),[b,y]=me(""),c=je(null),[m,f]=me(!1),[v,w]=me([]),[x,$]=me(!1),h=((T=o==null?void 0:o.theme)==null?void 0:T.colors)||it.colors||{},B=h.tagColor??"#1d70f5",A=h.tagAddColor??"#1d70f5",L=h.tagBackground??"#ebf6ff",W="none";ot(()=>{p&&(y(""),setTimeout(()=>{var F;return(F=c.current)==null?void 0:F.focus()},0))},[p]);const S=pe(()=>{const F=b.trim();if(F){if(F.length>De){ne.warning(Le(i.editor.maxLengthWarning,{max:String(De)}));return}if(e.includes(F)){ne.warning(i.editor.duplicateWarning);return}t([...e,F])}y(""),g(!1)},[b,e,t,i]),te=pe(F=>{t(e.filter(O=>O!==F))},[e,t]),ae=Me(()=>{const F=u.trim().toLowerCase();return F?e.filter(O=>O.toLowerCase().includes(F)):e},[e,u]),K=pe(()=>{w([]),f(!0)},[]),J=pe(F=>{r?r(F):ne.info(i.editor.configTemplateHint)},[r,i]),G={items:[{key:"csv",label:i.editor.formatCsv},{key:"txt",label:i.editor.formatTxt}],onClick:({key:F})=>J(F)},q=pe(F=>{const O=F.replace(/\r\n/g,`
142
+ `,Ze=({words:e,onWordsChange:r,onSave:F,onCancel:f,styles:c,onDownloadTemplate:i,onImportFile:L})=>{var G;const{messages:u}=ae(),[A,D]=_(""),[I,w]=_(!1),[x,T]=_(""),t=Ce(null),[o,l]=_(!1),[p,E]=_([]),[M,g]=_(!1),y=((G=c==null?void 0:c.theme)==null?void 0:G.colors)||Fe.colors||{},N=y.tagColor??"#1d70f5",R=y.tagAddColor??"#1d70f5",q=y.tagBackground??"#ebf6ff",oe="none";be(()=>{I&&(T(""),setTimeout(()=>{var n;return(n=t.current)==null?void 0:n.focus()},0))},[I]);const O=k(()=>{const n=x.trim();if(n){if(n.length>j){b.warning(J(u.editor.maxLengthWarning,{max:String(j)}));return}if(e.includes(n)){b.warning(u.editor.duplicateWarning);return}r([...e,n])}T(""),w(!1)},[x,e,r,u]),Y=k(n=>{r(e.filter(C=>C!==n))},[e,r]),ne=ee(()=>{const n=A.trim().toLowerCase();return n?e.filter(C=>C.toLowerCase().includes(n)):e},[e,A]),ie=k(()=>{E([]),l(!0)},[]),re=k(n=>{i?i(n):b.info(u.editor.configTemplateHint)},[i,u]),se={items:[{key:"csv",label:u.editor.formatCsv},{key:"txt",label:u.editor.formatTxt}],onClick:({key:n})=>re(n)},W=k(n=>{const C=n.replace(/\r\n/g,`
163
143
  `).replace(/\r/g,`
164
- `).split(/[\n,\t]/).map(P=>P.trim()).filter(Boolean),X=new Set,E=[];for(const P of O){const z=P.length>De?P.slice(0,De):P;X.has(z)||(X.add(z),E.push(z))}return E},[]),H=pe(async()=>{var X;const F=(X=v[0])==null?void 0:X.originFileObj;if(!F){ne.warning(i.editor.selectFileWarning);return}if(s){$(!0);try{await s(F),f(!1),w([])}catch{ne.error(i.editor.importFailRetry)}finally{$(!1)}return}const O=new FileReader;O.onload=()=>{try{const E=O.result||"",P=q(E),z=Array.from(new Set([...e,...P]));t(z),ne.success(Le(i.editor.importCountSuccess,{count:String(P.length)})),f(!1),w([])}catch{ne.error(i.editor.parseFail)}},O.onerror=()=>ne.error(i.editor.readFileFail),O.readAsText(F,"UTF-8")},[v,e,t,q,s,i]),Z=pe(()=>{f(!1),w([])},[]);return le(aa,{theme:o==null?void 0:o.theme,children:[le(oa,{theme:o==null?void 0:o.theme,children:[I(ye,{mode:"primary",label:i.editor.import,icon:I(Pr,{size:16}),onClick:K,styles:o}),le("span",{style:{display:"flex",alignItems:"center",gap:6,color:h.textSecondary??"#6b7280",fontSize:12},children:[I(Ft,{size:14}),Le(i.editor.maxLengthHint,{max:String(De)})]}),I("div",{style:{flex:1,marginLeft:"auto",minWidth:200,maxWidth:320,display:"flex",alignItems:"center",gap:8},children:I(st,{placeholder:i.editor.searchPlaceholder,value:u,allowClear:!0,onChange:F=>d(F.target.value),suffix:I(Ht,{size:16,style:{color:"#9ca3af"}}),style:{flex:1}})})]}),I(ia,{theme:o==null?void 0:o.theme,children:le(sa,{children:[ae.map(F=>le(la,{$color:B,$bg:L,$border:W,children:[F,I("span",{className:"sensitive-edit-tag-remove",onClick:()=>te(F),role:"button",tabIndex:0,onKeyDown:O=>O.key==="Enter"&&te(F),children:I(kr,{size:14})})]},F)),p?I(ua,{$focused:!0,$color:B,children:I("input",{ref:c,type:"text",className:"sensitive-edit-add-input",placeholder:i.editor.inputPlaceholder,value:b,onChange:F=>y(F.target.value),onBlur:S,onKeyDown:F=>{F.key==="Enter"&&S(),F.key==="Escape"&&(y(""),g(!1))},maxLength:De})}):le(ca,{$color:A,onClick:()=>g(!0),role:"button",tabIndex:0,onKeyDown:F=>F.key==="Enter"&&g(!0),children:[I(qt,{size:14}),i.editor.add]})]})}),le(da,{theme:o==null?void 0:o.theme,children:[I(ye,{mode:"default",label:i.editor.cancel,onClick:a,styles:o,style:{width:76}}),I(ye,{mode:"primary",label:i.editor.save,onClick:n,styles:o,style:{width:76}})]}),le(lt,{title:i.editor.uploadModalTitle,open:m,onCancel:Z,footer:le("div",{style:{display:"flex",justifyContent:"flex-end",gap:20},children:[I(ye,{mode:"default",label:i.editor.cancel,onClick:Z,styles:o,disabled:x,style:{width:76}}),I(ye,{mode:"primary",label:i.editor.confirm,onClick:H,styles:o,disabled:x,style:{width:76}})]}),destroyOnClose:!0,width:650,children:[le(pa,{theme:o==null?void 0:o.theme,children:[le("span",{style:{display:"flex",alignItems:"center",gap:8},children:[I(Ft,{size:18,style:{color:"#1d70f5",flexShrink:0}}),i.editor.uploadModalHint]}),I(Lr,{menu:G,trigger:["click"],children:I("div",{style:{display:"inline-block"},children:I(ye,{mode:"default",label:i.editor.downloadTemplate,styles:o})})})]}),I(ma,{children:le(na,{accept:".csv,.txt",maxCount:1,fileList:v,beforeUpload:()=>!1,onChange:({fileList:F})=>w(F.slice(-1)),showUploadList:{showPreviewIcon:!1},children:[I("p",{className:"ant-upload-drag-icon",style:{marginBottom:8},children:I(Or,{size:48,style:{color:"#1d70f5"}})}),I("p",{className:"ant-upload-text",children:i.editor.uploadDragText}),I("p",{className:"ant-upload-hint",children:i.editor.uploadDragHint})]})})]})]})},{confirm:ga}=lt,ha={pageNo:1,pageSize:999},va=ce.div.attrs({className:"sensitive-modal-footer"})`
144
+ `).split(/[\n,\t]/).map($=>$.trim()).filter(Boolean),H=new Set,P=[];for(const $ of C){const U=$.length>j?$.slice(0,j):$;H.has(U)||(H.add(U),P.push(U))}return P},[]),K=k(async()=>{var H;const n=(H=p[0])==null?void 0:H.originFileObj;if(!n){b.warning(u.editor.selectFileWarning);return}if(L){g(!0);try{await L(n),l(!1),E([])}catch{b.error(u.editor.importFailRetry)}finally{g(!1)}return}const C=new FileReader;C.onload=()=>{try{const P=C.result||"",$=W(P),U=Array.from(new Set([...e,...$]));r(U),b.success(J(u.editor.importCountSuccess,{count:String($.length)})),l(!1),E([])}catch{b.error(u.editor.parseFail)}},C.onerror=()=>b.error(u.editor.readFileFail),C.readAsText(n,"UTF-8")},[p,e,r,W,L,u]),Z=k(()=>{l(!1),E([])},[]);return B(Re,{theme:c==null?void 0:c.theme,children:[B(qe,{theme:c==null?void 0:c.theme,children:[s(z,{mode:"primary",label:u.editor.import,icon:s(Te,{size:16}),onClick:ie,styles:c}),B("span",{style:{display:"flex",alignItems:"center",gap:6,color:y.textSecondary??"#6b7280",fontSize:12},children:[s(he,{size:14}),J(u.editor.maxLengthHint,{max:String(j)})]}),s("div",{style:{flex:1,marginLeft:"auto",minWidth:200,maxWidth:320,display:"flex",alignItems:"center",gap:8},children:s(de,{placeholder:u.editor.searchPlaceholder,value:A,allowClear:!0,onChange:n=>D(n.target.value),suffix:s(xe,{size:16,style:{color:"#9ca3af"}}),style:{flex:1}})})]}),s(je,{theme:c==null?void 0:c.theme,children:B(Ve,{children:[ne.map(n=>B(Oe,{$color:N,$bg:q,$border:oe,children:[n,s("span",{className:"sensitive-edit-tag-remove",onClick:()=>Y(n),role:"button",tabIndex:0,onKeyDown:C=>C.key==="Enter"&&Y(n),children:s(Le,{size:14})})]},n)),I?s(Ge,{$focused:!0,$color:N,children:s("input",{ref:t,type:"text",className:"sensitive-edit-add-input",placeholder:u.editor.inputPlaceholder,value:x,onChange:n=>T(n.target.value),onBlur:O,onKeyDown:n=>{n.key==="Enter"&&O(),n.key==="Escape"&&(T(""),w(!1))},maxLength:j})}):B(Ke,{$color:R,onClick:()=>w(!0),role:"button",tabIndex:0,onKeyDown:n=>n.key==="Enter"&&w(!0),children:[s(Be,{size:14}),u.editor.add]})]})}),B(Xe,{theme:c==null?void 0:c.theme,children:[s(z,{mode:"default",label:u.editor.cancel,onClick:f,styles:c,style:{width:76}}),s(z,{mode:"primary",label:u.editor.save,onClick:F,styles:c,style:{width:76}})]}),B(pe,{title:u.editor.uploadModalTitle,open:o,onCancel:Z,footer:B("div",{style:{display:"flex",justifyContent:"flex-end",gap:20},children:[s(z,{mode:"default",label:u.editor.cancel,onClick:Z,styles:c,disabled:M,style:{width:76}}),s(z,{mode:"primary",label:u.editor.confirm,onClick:K,styles:c,disabled:M,style:{width:76}})]}),destroyOnClose:!0,width:650,children:[B(Je,{theme:c==null?void 0:c.theme,children:[B("span",{style:{display:"flex",alignItems:"center",gap:8},children:[s(he,{size:18,style:{color:"#1d70f5",flexShrink:0}}),u.editor.uploadModalHint]}),s(we,{menu:se,trigger:["click"],children:s("div",{style:{display:"inline-block"},children:s(z,{mode:"default",label:u.editor.downloadTemplate,styles:c})})})]}),s(Ye,{children:B(Ue,{accept:".csv,.txt",maxCount:1,fileList:p,beforeUpload:()=>!1,onChange:({fileList:n})=>E(n.slice(-1)),showUploadList:{showPreviewIcon:!1},children:[s("p",{className:"ant-upload-drag-icon",style:{marginBottom:8},children:s(Ie,{size:48,style:{color:"#1d70f5"}})}),s("p",{className:"ant-upload-text",children:u.editor.uploadDragText}),s("p",{className:"ant-upload-hint",children:u.editor.uploadDragHint})]})})]})]})},{confirm:Qe}=pe,eu={pageNo:1,pageSize:999},uu=v.div.attrs({className:"sensitive-modal-footer"})`
165
145
  width: 100%;
166
146
  display: flex;
167
147
  flex-direction: row;
168
148
  justify-content: flex-end;
169
149
  gap: 10px;
170
- `,ba=ce.div.attrs({className:"sensitive-toolbar-search-wrap"})`
150
+ `,tu=v.div.attrs({className:"sensitive-toolbar-search-wrap"})`
171
151
  display: flex;
172
152
  align-items: center;
173
153
  min-width: 220px;
174
- `,ya=({onAction:e})=>{const[t,n]=me(""),{messages:a}=qe(),o=pe(()=>{const r=t.trim();e("search",{keyword:r})},[t,e]);return I(ba,{children:I(st,{placeholder:a.toolbar.searchPlaceholder,allowClear:!0,value:t,onChange:r=>n(r.target.value),onPressEnter:o,suffix:I(Ht,{size:16,style:{color:"#9ca3af"}})})})},Ca=ce.div.attrs({className:"sensitive-tag-cell-wrap"})`
154
+ `,au=({onAction:e})=>{const[r,F]=_(""),{messages:f}=ae(),c=k(()=>{const i=r.trim();e("search",{keyword:i})},[r,e]);return s(tu,{children:s(de,{placeholder:f.toolbar.searchPlaceholder,allowClear:!0,value:r,onChange:i=>F(i.target.value),onPressEnter:c,suffix:s(xe,{size:16,style:{color:"#9ca3af"}})})})},ou=v.div.attrs({className:"sensitive-tag-cell-wrap"})`
175
155
  display: flex;
176
156
  flex-wrap: wrap;
177
157
  gap: 12px;
178
158
  min-width: 200px;
179
159
  max-width: 100%;
180
- `,Fa=ce.span.attrs({className:"sensitive-tag-item"})`
160
+ `,nu=v.span.attrs({className:"sensitive-tag-item"})`
181
161
  box-sizing: border-box;
182
162
  display: inline-block;
183
163
  color: ${e=>e.$color};
@@ -190,7 +170,7 @@ import{jsxs as le,jsx as I,Fragment as ir}from"react/jsx-runtime";import*as l fr
190
170
  white-space: nowrap;
191
171
  flex-shrink: 0;
192
172
  font-family: PingFangSC, 微软雅黑, Helvetic, sans-serif;
193
- `,_e=8,wa=ce.span.attrs({className:"sensitive-tag-more"})`
173
+ `,Q=8,iu=v.span.attrs({className:"sensitive-tag-more"})`
194
174
  display: inline-block;
195
175
  color: ${e=>e.$color};
196
176
  font-size: 12px;
@@ -202,4 +182,4 @@ import{jsxs as le,jsx as I,Fragment as ir}from"react/jsx-runtime";import*as l fr
202
182
  &:hover {
203
183
  text-decoration: underline;
204
184
  }
205
- `;function $a({value:e,theme:t,onViewAll:n,row:a}){var m;const{messages:o}=qe(),r=(t==null?void 0:t.colors)||it.colors||{},s=r.tagColor??"#1d70f5",i=r.tagBackground??"#ebf6ff",u=Array.isArray(e)?e:[];if(u.length===0)return null;const d=((m=((a==null?void 0:a.data)||[]).find(f=>f.columnId==="count"))==null?void 0:m.value)||0,p=u.slice(0,_e),g=d>_e,b=g?d-_e:0,y=Le(o.tagCell.viewAllTitle,{total:String(d),max:String(_e)}),c=Le(o.tagCell.viewAllLink,{count:String(b)});return le(Ca,{children:[p.map((f,v)=>I(Fa,{$color:s,$bg:i,$border:"none",children:f},v)),g&&I(wa,{$color:s,title:y,onClick:()=>n==null?void 0:n(),children:c})]})}const Ea=({url:e,token:t,role:n,server:a,styles:o,eventsEmit:r,CustomComponents:s})=>{const{messages:i,locale:u,getMessage:d}=qe(),[p,g]=me({container:"ready",content:"ready"}),b=je(null),[y,c]=me(),[m]=Ke.useForm(),[f,v]=me(!1),[w,x]=me(""),[$,h]=me({active:!1,libraryId:null,libraryName:"",words:[]}),B=Me(()=>a||Yn({url:e,token:t,role:n,getMessage:d}),[a,e,t,n,d]),{getLibraryList:A,deleteLibrary:L,createLibrary:W,updateLibrary:S,downloadTemplate:te,importWords:ae,getWords:K,getLibraryData:J}=B,G=pe(D=>{const C=(D==null?void 0:D.data)??[],j=C.find(ve=>ve.columnId==="name"),N=C.find(ve=>ve.columnId==="sensitiveWords"),M=(j==null?void 0:j.value)??"",fe=Array.isArray(N==null?void 0:N.value)?[...N.value]:[];return{name:M,words:fe}},[]),q=pe(async D=>{const{id:C,name:j,words:N}=await J(D.id);h({active:!0,libraryId:C,libraryName:j,words:N})},[G]),H=pe(()=>{h({active:!1,libraryId:null,libraryName:"",words:[]}),O(),r==null||r("sensitive_edit_closed",{})},[r]),Z=pe(async()=>{if($.libraryId)try{await S($.libraryId,{name:$.libraryName,words:$.words})&&(ne.success(i.message.saveSuccess),H(),g(C=>({...C,content:"loading"})),O())}catch(D){console.error("[SensitiveView] \u4FDD\u5B58\u654F\u611F\u8BCD\u5931\u8D25:",D)}},[$.libraryId,$.words,S,H]),T=Ar(),F=Me(()=>yt(yt({theme:it,mode:"light"},T||{}),o||{}),[T,o]);ot(()=>{g(D=>({...D,content:"loading"})),O()},[]);const O=async D=>{try{const C={...ha},j=D??w;j&&(C.name=j);const N=await A(C);if(N){const M=X(N.records);c(M||[]),g(fe=>({...fe,content:"ready"}))}}catch(C){console.log("[SensitiveView] getSensitiveList error:",C)}};function X(D){return(D||[]).map(C=>({id:C.id,data:[{columnId:"name",value:C.name,type:"label"},{columnId:"sensitiveWords",value:C.words,type:"customized"},{columnId:"createDate",value:C.gmtCreate,type:"date"},{columnId:"count",value:C.count,type:"text"},{columnId:"actions",value:"edit",label:i.table.actionEdit,type:"action"},{columnId:"actions",value:"delete",label:i.table.actionDelete,type:"action"}]}))}const E=u==="zh"?"zh-CN":u==="ja"?"ja-JP":"en-US",P=Me(()=>({label:i.table.label,model:null,defaultActiveId:"sensitive-table",views:[{id:"sensitive-table",label:i.table.viewLabel,type:"table",viewBehavior:"pagination",allowMultiSelect:!1,viewPageSize:10,paginationLocale:u,columns:[{title:i.table.columns.name,id:"name",type:"label"},{title:i.table.columns.sensitiveWords,id:"sensitiveWords",type:"customized",component:$a,componentProps:({value:D,row:C})=>({value:D,theme:F==null?void 0:F.theme,row:C,onViewAll:C?()=>q(C):void 0}),fallback:null},{title:i.table.columns.createDate,id:"createDate",type:"date"},{title:i.table.columns.count,id:"count",type:"text"},{title:i.table.columns.actions,id:"actions",type:"action"}],toolbar:[{type:"button",key:"create",label:i.table.toolbar.create,btnType:"primary",icon:I(qt,{size:16})},{type:"customized",key:"search",label:i.table.toolbar.searchPlaceholder,position:"right",component:ya}]}]}),[F,q,i]),z=async()=>{try{const D=await m.validateFields();if(!D)return;const C=await W({...D,words:[]});if(C&&(b!=null&&b.current)){console.log("+++++",new Date().toLocaleString(E,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).replace(/\//g,"-"));const j={id:C,data:[{columnId:"name",value:D.name,type:"label"},{columnId:"sensitiveWords",value:[],type:"customized"},{columnId:"createDate",value:new Date().toLocaleString(E,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).replace(/\//g,"-"),type:"date"},{columnId:"count",value:0,type:"text"},{columnId:"actions",value:"edit",label:i.table.actionEdit,type:"action"},{columnId:"actions",value:"delete",label:i.table.actionDelete,type:"action"}]};ne.success(i.message.createSuccess),re("table_action_edit",{id:C},()=>{}),r==null||r("sensitive_library_created",{id:C,name:D.name})}}catch(D){console.error("[SensitiveView] \u65B0\u589E\u654F\u611F\u8BCD\u5931\u8D25:",D)}finally{v(!1),m.resetFields()}};function re(D,C,j){switch(console.log("name",D),D){case"toolbar_create":v(!0),r==null||r("sensitive_toolbar_create",C);break;case"table_action_edit":{const N=C==null?void 0:C.id,M=N&&Array.isArray(y)?y.find(fe=>fe.id===N):C!=null&&C.data?C:null;M&&M.data?q(M):C!=null&&C.id&&q(C),r==null||r("sensitive_table_action_edit",C);break}case"table_action_delete":{ga({title:i.deleteConfirm.title,content:i.deleteConfirm.content,okText:i.deleteConfirm.okText,cancelText:i.deleteConfirm.cancelText,async onOk(){var N;try{await L(C.id)&&(b!=null&&b.current)&&((N=b.current.appFn)==null||N.removeItem(C.id),ne.success(i.message.deleteSuccess),O(),r==null||r("sensitive_table_action_delete",C))}catch(M){console.error("[SensitiveView] \u5220\u9664\u654F\u611F\u8BCD\u5E93\u5931\u8D25",M)}}});break}case"toolbar_search_search":{const N=(C==null?void 0:C.keyword)||"";x(N),g(M=>({...M,content:"loading"})),O(N),r==null||r("sensitive_toolbar_search",C);break}default:r==null||r("sensitive_"+D,C);break}}const ue=()=>{v(!1),m.resetFields()};return I(Ir,{styles:F,children:$.active?I(fa,{libraryName:$.libraryName,words:$.words,onWordsChange:D=>h(C=>({...C,words:D})),onSave:Z,onCancel:H,styles:F,onDownloadTemplate:async D=>{const C=await te(D);if(!C){ne.error(i.message.downloadTemplateFail);return}const j=URL.createObjectURL(C),N=document.createElement("a");N.href=j,N.download=`${i.downloadTemplateFilename}.${D}`,N.click(),URL.revokeObjectURL(j)},onImportFile:async D=>{if(!$.libraryId)return;const C=await ae($.libraryId,D);if(C&&C.success!==!1){ne.success(i.message.importSuccess);const j=await K($.libraryId);(j==null?void 0:j.words)!=null&&h(N=>({...N,words:j==null?void 0:j.words}))}else throw ne.error((C==null?void 0:C.errorMsg)||i.message.importFail),new Error("import failed")}}):le(ir,{children:[I(Br,{dataSource:y,ref:b,eventsEmit:re,status:p,styles:F,CustomComponents:{...s},...P}),I(lt,{title:i.createModal.title,open:f,width:650,destroyOnClose:!0,onCancel:ue,footer:le(va,{theme:F==null?void 0:F.theme,children:[I(ye,{mode:"default",label:i.createModal.cancel,onClick:ue}),I(ye,{mode:"primary",label:i.createModal.confirm,onClick:z})]}),children:I(Ke,{form:m,children:I(Ke.Item,{label:null,name:"name",rules:[{required:!0,message:i.createModal.nameRequired}],children:I(st,{placeholder:i.createModal.namePlaceholder})})})})]})})},Ra=e=>{const{locale:t="zh",messages:n,...a}=e;return I(ra,{locale:t,messages:n,children:I(Ea,{...a})})};export{Kt as SensitiveI18nContext,ra as SensitiveI18nProvider,Ra as default,ta as getSensitiveMessages,Le as interpolate,qe as useSensitiveI18n};
185
+ `;function ru({value:e,theme:r,onViewAll:F,row:f}){var o;const{messages:c}=ae(),i=(r==null?void 0:r.colors)||Fe.colors||{},L=i.tagColor??"#1d70f5",u=i.tagBackground??"#ebf6ff",A=Array.isArray(e)?e:[];if(A.length===0)return null;const D=((o=((f==null?void 0:f.data)||[]).find(l=>l.columnId==="count"))==null?void 0:o.value)||0,I=A.slice(0,Q),w=D>Q,x=w?D-Q:0,T=J(c.tagCell.viewAllTitle,{total:String(D),max:String(Q)}),t=J(c.tagCell.viewAllLink,{count:String(x)});return B(ou,{children:[I.map((l,p)=>s(nu,{$color:L,$bg:u,$border:"none",children:l},p)),w&&s(iu,{$color:L,title:T,onClick:()=>F==null?void 0:F(),children:t})]})}const su=({url:e,token:r,role:F,server:f,styles:c,eventsEmit:i,CustomComponents:L})=>{const{messages:u,locale:A,getMessage:D}=ae(),[I,w]=_({container:"ready",content:"ready"}),x=Ce(null),[T,t]=_(),[o]=ce.useForm(),[l,p]=_(!1),[E,M]=_(""),[g,y]=_({active:!1,libraryId:null,libraryName:"",words:[]}),N=ee(()=>f||Me({url:e,token:r,role:F,getMessage:D}),[f,e,r,F,D]),{getLibraryList:R,deleteLibrary:q,createLibrary:oe,updateLibrary:O,downloadTemplate:Y,importWords:ne,getWords:ie,getLibraryData:re}=N,se=k(d=>{const a=(d==null?void 0:d.data)??[],h=a.find(le=>le.columnId==="name"),m=a.find(le=>le.columnId==="sensitiveWords"),S=(h==null?void 0:h.value)??"",X=Array.isArray(m==null?void 0:m.value)?[...m.value]:[];return{name:S,words:X}},[]),W=k(async d=>{const{id:a,name:h,words:m}=await re(d.id);y({active:!0,libraryId:a,libraryName:h,words:m})},[se]),K=k(()=>{y({active:!1,libraryId:null,libraryName:"",words:[]}),C(),i==null||i("sensitive_edit_closed",{})},[i]),Z=k(async()=>{if(g.libraryId)try{await O(g.libraryId,{name:g.libraryName,words:g.words})&&(b.success(u.message.saveSuccess),K(),w(a=>({...a,content:"loading"})),C())}catch(d){console.error("[SensitiveView] \u4FDD\u5B58\u654F\u611F\u8BCD\u5931\u8D25:",d)}},[g.libraryId,g.words,O,K]),G=Se(),n=ee(()=>ge(ge({theme:Fe,mode:"light"},G||{}),c||{}),[G,c]);be(()=>{w(d=>({...d,content:"loading"})),C()},[]);const C=async d=>{try{const a={...eu},h=d??E;h&&(a.name=h);const m=await R(a);if(m){const S=H(m.records);t(S||[]),w(X=>({...X,content:"ready"}))}}catch(a){console.log("[SensitiveView] getSensitiveList error:",a)}};function H(d){return(d||[]).map(a=>({id:a.id,data:[{columnId:"name",value:a.name,type:"label"},{columnId:"sensitiveWords",value:a.words,type:"customized"},{columnId:"createDate",value:a.gmtCreate,type:"date"},{columnId:"count",value:a.count,type:"text"},{columnId:"actions",value:"edit",label:u.table.actionEdit,type:"action"},{columnId:"actions",value:"delete",label:u.table.actionDelete,type:"action"}]}))}const P=A==="zh"?"zh-CN":A==="ja"?"ja-JP":"en-US",$=ee(()=>({label:u.table.label,model:null,defaultActiveId:"sensitive-table",views:[{id:"sensitive-table",label:u.table.viewLabel,type:"table",viewBehavior:"pagination",allowMultiSelect:!1,viewPageSize:10,paginationLocale:A,columns:[{title:u.table.columns.name,id:"name",type:"label"},{title:u.table.columns.sensitiveWords,id:"sensitiveWords",type:"customized",component:ru,componentProps:({value:d,row:a})=>({value:d,theme:n==null?void 0:n.theme,row:a,onViewAll:a?()=>W(a):void 0}),fallback:null},{title:u.table.columns.createDate,id:"createDate",type:"date"},{title:u.table.columns.count,id:"count",type:"text"},{title:u.table.columns.actions,id:"actions",type:"action"}],toolbar:[{type:"button",key:"create",label:u.table.toolbar.create,btnType:"primary",icon:s(Be,{size:16})},{type:"customized",key:"search",label:u.table.toolbar.searchPlaceholder,position:"right",component:au}]}]}),[n,W,u]),U=async()=>{try{const d=await o.validateFields();if(!d)return;const a=await oe({...d,words:[]});if(a&&(x!=null&&x.current)){console.log("+++++",new Date().toLocaleString(P,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).replace(/\//g,"-"));const h={id:a,data:[{columnId:"name",value:d.name,type:"label"},{columnId:"sensitiveWords",value:[],type:"customized"},{columnId:"createDate",value:new Date().toLocaleString(P,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).replace(/\//g,"-"),type:"date"},{columnId:"count",value:0,type:"text"},{columnId:"actions",value:"edit",label:u.table.actionEdit,type:"action"},{columnId:"actions",value:"delete",label:u.table.actionDelete,type:"action"}]};b.success(u.message.createSuccess),me("table_action_edit",{id:a},()=>{}),i==null||i("sensitive_library_created",{id:a,name:d.name})}}catch(d){console.error("[SensitiveView] \u65B0\u589E\u654F\u611F\u8BCD\u5931\u8D25:",d)}finally{p(!1),o.resetFields()}};function me(d,a,h){switch(console.log("name",d),d){case"toolbar_create":p(!0),i==null||i("sensitive_toolbar_create",a);break;case"table_action_edit":{const m=a==null?void 0:a.id,S=m&&Array.isArray(T)?T.find(X=>X.id===m):a!=null&&a.data?a:null;S&&S.data?W(S):a!=null&&a.id&&W(a),i==null||i("sensitive_table_action_edit",a);break}case"table_action_delete":{Qe({title:u.deleteConfirm.title,content:u.deleteConfirm.content,okText:u.deleteConfirm.okText,cancelText:u.deleteConfirm.cancelText,async onOk(){var m;try{await q(a.id)&&(x!=null&&x.current)&&((m=x.current.appFn)==null||m.removeItem(a.id),b.success(u.message.deleteSuccess),C(),i==null||i("sensitive_table_action_delete",a))}catch(S){console.error("[SensitiveView] \u5220\u9664\u654F\u611F\u8BCD\u5E93\u5931\u8D25",S)}}});break}case"toolbar_search_search":{const m=(a==null?void 0:a.keyword)||"";M(m),w(S=>({...S,content:"loading"})),C(m),i==null||i("sensitive_toolbar_search",a);break}default:i==null||i("sensitive_"+d,a);break}}const fe=()=>{p(!1),o.resetFields()};return s(ke,{styles:n,children:g.active?s(Ze,{libraryName:g.libraryName,words:g.words,onWordsChange:d=>y(a=>({...a,words:d})),onSave:Z,onCancel:K,styles:n,onDownloadTemplate:async d=>{const a=await Y(d);if(!a){b.error(u.message.downloadTemplateFail);return}const h=URL.createObjectURL(a),m=document.createElement("a");m.href=h,m.download=`${u.downloadTemplateFilename}.${d}`,m.click(),URL.revokeObjectURL(h)},onImportFile:async d=>{if(!g.libraryId)return;const a=await ne(g.libraryId,d);if(a&&a.success!==!1){b.success(u.message.importSuccess);const h=await ie(g.libraryId);(h==null?void 0:h.words)!=null&&y(m=>({...m,words:h==null?void 0:h.words}))}else throw b.error((a==null?void 0:a.errorMsg)||u.message.importFail),new Error("import failed")}}):B(Ee,{children:[s(ye,{dataSource:T,ref:x,eventsEmit:me,status:I,styles:n,CustomComponents:{...L},...$}),s(pe,{title:u.createModal.title,open:l,width:650,destroyOnClose:!0,onCancel:fe,footer:B(uu,{theme:n==null?void 0:n.theme,children:[s(z,{mode:"default",label:u.createModal.cancel,onClick:fe}),s(z,{mode:"primary",label:u.createModal.confirm,onClick:U})]}),children:s(ce,{form:o,children:s(ce.Item,{label:null,name:"name",rules:[{required:!0,message:u.createModal.nameRequired}],children:s(de,{placeholder:u.createModal.namePlaceholder})})})})]})})},xu=e=>{const{locale:r="zh",messages:F,...f}=e;return s(He,{locale:r,messages:F,children:s(su,{...f})})};export{ve as SensitiveI18nContext,He as SensitiveI18nProvider,xu as default,We as getSensitiveMessages,J as interpolate,ae as useSensitiveI18n};
package/sensitiveWords.js CHANGED
@@ -1 +1 @@
1
- import"react/jsx-runtime";import"react";import"./assets/index-D_Hj7QNz.js";import"./assets/index-DgYjqte0.js";import"./assets/index-CshF4ZrU.js";import{SensitiveI18nContext as l,SensitiveI18nProvider as u,default as x,getSensitiveMessages as C,interpolate as M,useSensitiveI18n as P}from"./sensitive.js";/* empty css */import"./assets/index-Cxdo0VA9.js";import"./assets/plus-Dksaa79Q.js";import"./assets/search-DPX4n-TM.js";import"react-dom";import"./assets/circle-plus-P1B4Xn23.js";import"./assets/x-cAgrXVQW.js";import"./assets/index-AbRL5gZq.js";import"./assets/LeftOutlined-6ZZOHHzZ.js";export{l as SensitiveI18nContext,u as SensitiveI18nProvider,x as default,C as getSensitiveMessages,M as interpolate,P as useSensitiveI18n};
1
+ import"react/jsx-runtime";import"react";import"styled-components";import"antd";import"@mxmweb/xviewer";import"@mxmweb/zui";import{SensitiveI18nContext as f,SensitiveI18nProvider as g,default as l,getSensitiveMessages as u,interpolate as x,useSensitiveI18n as C}from"./sensitive.js";/* empty css */import"./assets/plus-Cok3acFd.js";import"./assets/search-BfgWf2Me.js";import"axios";import"./assets/circle-plus-2ioHM-Sb.js";import"./assets/x-CX-iE6EL.js";export{f as SensitiveI18nContext,g as SensitiveI18nProvider,l as default,u as getSensitiveMessages,x as interpolate,C as useSensitiveI18n};
@@ -1 +1 @@
1
- import{G as f,B as g}from"./assets/GientechStreamReader-CCAVgoU7.js";import"react/jsx-runtime";import"react";import"./assets/index-D_Hj7QNz.js";import"react-dom";import"./assets/index-DXFiVEll.js";import"./assets/index-CshF4ZrU.js";import"./assets/index-DBBlFPQ7.js";import"./assets/LeftOutlined-6ZZOHHzZ.js";import"./assets/index-AbRL5gZq.js";import"./assets/x-cAgrXVQW.js";export{f as GientechStreamReader,g as registerPDFWorker};
1
+ import{G as a}from"./assets/GientechStreamReader-Bmx4xCIT.js";import{registerPDFWorker as s}from"@mxmweb/fviewer";import"react/jsx-runtime";import"react";import"styled-components";import"axios";import"./assets/x-CX-iE6EL.js";export{a as GientechStreamReader,s as registerPDFWorker};