Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64
Your IP : 18.222.161.245
import{r as l,b as Ot,aD as Pt,aE as ge,d as Ne,_ as tt,a as ie,c as _,aF as Ae,j as rt,m as nt,U as ot,k as Z,aG as Me,aH as Dt,g as Ee,an as jt,ak as Rt,N as Ft,ai as Lt,J as Nt,w as At,aI as at,aJ as it,aK as st,e as X,aL as ee,Z as ue,aM as lt,aN as Te,p as Mt,aO as Tt,aP as We,aQ as ct,aR as dt,aS as kt,aT as He,I as ye,R as Ut,C as ut,Y as _t,$ as zt,au as Xe,al as qe,B as Ve,a2 as Bt,aU as Wt,ag as Ht,ah as Xt,aA as Ge}from"./index-uSLgVfkU.js";import{T as pt,g as qt,u as Vt}from"./index-DGKUD4BF.js";import{R as Gt}from"./DeleteOutlined-BtT8v5_D.js";var Kt={percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,trailColor:"#D9D9D9",trailWidth:1,gapPosition:"bottom"},Jt=function(){var t=l.useRef([]),r=l.useRef(null);return l.useEffect(function(){var n=Date.now(),i=!1;t.current.forEach(function(a){if(a){i=!0;var s=a.style;s.transitionDuration=".3s, .3s, .3s, .06s",r.current&&n-r.current<100&&(s.transitionDuration="0s, 0s")}}),i&&(r.current=Date.now())}),t.current},Ke=0,Yt=Pt();function Zt(){var e;return Yt?(e=Ke,Ke+=1):e="TEST_OR_SSR",e}const Qt=function(e){var t=l.useState(),r=Ot(t,2),n=r[0],i=r[1];return l.useEffect(function(){i("rc_progress_".concat(Zt()))},[]),e||n};var Je=function(t){var r=t.bg,n=t.children;return l.createElement("div",{style:{width:"100%",height:"100%",background:r}},n)};function Ye(e,t){return Object.keys(e).map(function(r){var n=parseFloat(r),i="".concat(Math.floor(n*t),"%");return"".concat(e[r]," ").concat(i)})}var er=l.forwardRef(function(e,t){var r=e.prefixCls,n=e.color,i=e.gradientId,a=e.radius,s=e.style,o=e.ptg,d=e.strokeLinecap,c=e.strokeWidth,u=e.size,p=e.gapDegree,g=n&&ge(n)==="object",v=g?"#FFF":void 0,y=u/2,E=l.createElement("circle",{className:"".concat(r,"-circle-path"),r:a,cx:y,cy:y,stroke:v,strokeLinecap:d,strokeWidth:c,opacity:o===0?0:1,style:s,ref:t});if(!g)return E;var C="".concat(i,"-conic"),$=p?"".concat(180+p/2,"deg"):"0deg",w=Ye(n,(360-p)/360),j=Ye(n,1),O="conic-gradient(from ".concat($,", ").concat(w.join(", "),")"),f="linear-gradient(to ".concat(p?"bottom":"top",", ").concat(j.join(", "),")");return l.createElement(l.Fragment,null,l.createElement("mask",{id:C},E),l.createElement("foreignObject",{x:0,y:0,width:u,height:u,mask:"url(#".concat(C,")")},l.createElement(Je,{bg:f},l.createElement(Je,{bg:O}))))}),ve=100,De=function(t,r,n,i,a,s,o,d,c,u){var p=arguments.length>10&&arguments[10]!==void 0?arguments[10]:0,g=n/100*360*((360-s)/360),v=s===0?0:{bottom:0,top:180,left:90,right:-90}[o],y=(100-i)/100*r;c==="round"&&i!==100&&(y+=u/2,y>=r&&(y=r-.01));var E=ve/2;return{stroke:typeof d=="string"?d:void 0,strokeDasharray:"".concat(r,"px ").concat(t),strokeDashoffset:y+p,transform:"rotate(".concat(a+g+v,"deg)"),transformOrigin:"".concat(E,"px ").concat(E,"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}},tr=["id","prefixCls","steps","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"];function Ze(e){var t=e??[];return Array.isArray(t)?t:[t]}var rr=function(t){var r=Ne(Ne({},Kt),t),n=r.id,i=r.prefixCls,a=r.steps,s=r.strokeWidth,o=r.trailWidth,d=r.gapDegree,c=d===void 0?0:d,u=r.gapPosition,p=r.trailColor,g=r.strokeLinecap,v=r.style,y=r.className,E=r.strokeColor,C=r.percent,$=tt(r,tr),w=ve/2,j=Qt(n),O="".concat(j,"-gradient"),f=w-s/2,x=Math.PI*2*f,I=c>0?90+c/2:-90,R=x*((360-c)/360),M=ge(a)==="object"?a:{count:a,gap:2},h=M.count,Q=M.gap,te=Ze(C),J=Ze(E),W=J.find(function(N){return N&&ge(N)==="object"}),q=W&&ge(W)==="object",T=q?"butt":g,F=De(x,R,0,100,I,c,u,p,T,s),ne=Jt(),V=function(){var G=0;return te.map(function(m,D){var H=J[D]||J[J.length-1],U=De(x,R,G,m,I,c,u,H,T,s);return G+=m,l.createElement(er,{key:D,color:H,ptg:m,radius:f,prefixCls:i,gradientId:O,style:U,strokeLinecap:T,strokeWidth:s,gapDegree:c,ref:function(re){ne[D]=re},size:ve})}).reverse()},z=function(){var G=Math.round(h*(te[0]/100)),m=100/h,D=0;return new Array(h).fill(null).map(function(H,U){var Y=U<=G-1?J[0]:p,re=Y&&ge(Y)==="object"?"url(#".concat(O,")"):void 0,oe=De(x,R,D,m,I,c,u,Y,"butt",s,Q);return D+=(R-oe.strokeDashoffset+Q)*100/R,l.createElement("circle",{key:U,className:"".concat(i,"-circle-path"),r:f,cx:w,cy:w,stroke:re,strokeWidth:s,opacity:1,style:oe,ref:function(ae){ne[U]=ae}})})};return l.createElement("svg",ie({className:_("".concat(i,"-circle"),y),viewBox:"0 0 ".concat(ve," ").concat(ve),style:v,id:n,role:"presentation"},$),!h&&l.createElement("circle",{className:"".concat(i,"-circle-trail"),r:f,cx:w,cy:w,stroke:p,strokeLinecap:T,strokeWidth:o||s,style:F}),h?z():V())};function le(e){return!e||e<0?0:e>100?100:e}function Ce(e){let{success:t,successPercent:r}=e,n=r;return t&&"progress"in t&&(n=t.progress),t&&"percent"in t&&(n=t.percent),n}const nr=e=>{let{percent:t,success:r,successPercent:n}=e;const i=le(Ce({success:r,successPercent:n}));return[i,le(le(t)-i)]},or=e=>{let{success:t={},strokeColor:r}=e;const{strokeColor:n}=t;return[n||Ae.green,r||null]},xe=(e,t,r)=>{var n,i,a,s;let o=-1,d=-1;if(t==="step"){const c=r.steps,u=r.strokeWidth;typeof e=="string"||typeof e>"u"?(o=e==="small"?2:14,d=u??8):typeof e=="number"?[o,d]=[e,e]:[o=14,d=8]=Array.isArray(e)?e:[e.width,e.height],o*=c}else if(t==="line"){const c=r==null?void 0:r.strokeWidth;typeof e=="string"||typeof e>"u"?d=c||(e==="small"?6:8):typeof e=="number"?[o,d]=[e,e]:[o=-1,d=8]=Array.isArray(e)?e:[e.width,e.height]}else(t==="circle"||t==="dashboard")&&(typeof e=="string"||typeof e>"u"?[o,d]=e==="small"?[60,60]:[120,120]:typeof e=="number"?[o,d]=[e,e]:Array.isArray(e)&&(o=(i=(n=e[0])!==null&&n!==void 0?n:e[1])!==null&&i!==void 0?i:120,d=(s=(a=e[0])!==null&&a!==void 0?a:e[1])!==null&&s!==void 0?s:120));return[o,d]},ar=3,ir=e=>ar/e*100,sr=e=>{const{prefixCls:t,trailColor:r=null,strokeLinecap:n="round",gapPosition:i,gapDegree:a,width:s=120,type:o,children:d,success:c,size:u=s,steps:p}=e,[g,v]=xe(u,"circle");let{strokeWidth:y}=e;y===void 0&&(y=Math.max(ir(g),6));const E={width:g,height:v,fontSize:g*.15+6},C=l.useMemo(()=>{if(a||a===0)return a;if(o==="dashboard")return 75},[a,o]),$=nr(e),w=i||o==="dashboard"&&"bottom"||void 0,j=Object.prototype.toString.call(e.strokeColor)==="[object Object]",O=or({success:c,strokeColor:e.strokeColor}),f=_(`${t}-inner`,{[`${t}-circle-gradient`]:j}),x=l.createElement(rr,{steps:p,percent:p?$[1]:$,strokeWidth:y,trailWidth:y,strokeColor:p?O[1]:O,strokeLinecap:n,trailColor:r,prefixCls:t,gapDegree:C,gapPosition:w}),I=g<=20,R=l.createElement("div",{className:f,style:E},x,!I&&d);return I?l.createElement(pt,{title:d},R):R},Se="--progress-line-stroke-color",ft="--progress-percent",Qe=e=>{const t=e?"100%":"-100%";return new Me(`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}})},lr=e=>{const{componentCls:t,iconCls:r}=e;return{[t]:Object.assign(Object.assign({},ot(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(${Se})`]},height:"100%",width:`calc(1 / var(${ft}) * 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",[r]:{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 ${Z(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:Qe(),animationDuration:e.progressActiveMotionDuration,animationTimingFunction:e.motionEaseOutQuint,animationIterationCount:"infinite",content:'""'}},[`&${t}-rtl${t}-status-active`]:{[`${t}-bg::before`]:{animationName:Qe(!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}}})}},cr=e=>{const{componentCls:t,iconCls:r}=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%)",[r]:{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"}}}},dr=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}}}}}},ur=e=>{const{componentCls:t,iconCls:r}=e;return{[t]:{[`${t}-small&-line, ${t}-small&-line ${t}-text ${r}`]:{fontSize:e.fontSizeSM}}}},pr=e=>({circleTextColor:e.colorText,defaultColor:e.colorInfo,remainingColor:e.colorFillSecondary,lineBorderRadius:100,circleTextFontSize:"1em",circleIconFontSize:`${e.fontSize/e.fontSizeSM}em`}),fr=rt("Progress",e=>{const t=e.calc(e.marginXXS).div(2).equal(),r=nt(e,{progressStepMarginInlineEnd:t,progressStepMinWidth:t,progressActiveMotionDuration:"2.4s"});return[lr(r),cr(r),dr(r),ur(r)]},pr);var mr=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r};const gr=e=>{let t=[];return Object.keys(e).forEach(r=>{const n=parseFloat(r.replace(/%/g,""));isNaN(n)||t.push({key:n,value:e[r]})}),t=t.sort((r,n)=>r.key-n.key),t.map(r=>{let{key:n,value:i}=r;return`${i} ${n}%`}).join(", ")},hr=(e,t)=>{const{from:r=Ae.blue,to:n=Ae.blue,direction:i=t==="rtl"?"to left":"to right"}=e,a=mr(e,["from","to","direction"]);if(Object.keys(a).length!==0){const o=gr(a),d=`linear-gradient(${i}, ${o})`;return{background:d,[Se]:d}}const s=`linear-gradient(${i}, ${r}, ${n})`;return{background:s,[Se]:s}},vr=e=>{const{prefixCls:t,direction:r,percent:n,size:i,strokeWidth:a,strokeColor:s,strokeLinecap:o="round",children:d,trailColor:c=null,percentPosition:u,success:p}=e,{align:g,type:v}=u,y=s&&typeof s!="string"?hr(s,r):{[Se]:s,background:s},E=o==="square"||o==="butt"?0:void 0,C=i??[-1,a||(i==="small"?6:8)],[$,w]=xe(C,"line",{strokeWidth:a}),j={backgroundColor:c||void 0,borderRadius:E},O=Object.assign(Object.assign({width:`${le(n)}%`,height:w,borderRadius:E},y),{[ft]:le(n)/100}),f=Ce(e),x={width:`${le(f)}%`,height:w,borderRadius:E,backgroundColor:p==null?void 0:p.strokeColor},I={width:$<0?"100%":$},R=l.createElement("div",{className:`${t}-inner`,style:j},l.createElement("div",{className:_(`${t}-bg`,`${t}-bg-${v}`),style:O},v==="inner"&&d),f!==void 0&&l.createElement("div",{className:`${t}-success-bg`,style:x})),M=v==="outer"&&g==="start",h=v==="outer"&&g==="end";return v==="outer"&&g==="center"?l.createElement("div",{className:`${t}-layout-bottom`},R,d):l.createElement("div",{className:`${t}-outer`,style:I},M&&d,R,h&&d)},br=e=>{const{size:t,steps:r,percent:n=0,strokeWidth:i=8,strokeColor:a,trailColor:s=null,prefixCls:o,children:d}=e,c=Math.round(r*(n/100)),p=t??[t==="small"?2:14,i],[g,v]=xe(p,"step",{steps:r,strokeWidth:i}),y=g/r,E=new Array(r);for(let C=0;C<r;C++){const $=Array.isArray(a)?a[C]:a;E[C]=l.createElement("div",{key:C,className:_(`${o}-steps-item`,{[`${o}-steps-item-active`]:C<=c-1}),style:{backgroundColor:C<=c-1?$:s,width:y,height:v}})}return l.createElement("div",{className:`${o}-steps-outer`},E,d)};var yr=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r};const $r=["normal","exception","active","success"],wr=l.forwardRef((e,t)=>{const{prefixCls:r,className:n,rootClassName:i,steps:a,strokeColor:s,percent:o=0,size:d="default",showInfo:c=!0,type:u="line",status:p,format:g,style:v,percentPosition:y={}}=e,E=yr(e,["prefixCls","className","rootClassName","steps","strokeColor","percent","size","showInfo","type","status","format","style","percentPosition"]),{align:C="end",type:$="outer"}=y,w=Array.isArray(s)?s[0]:s,j=typeof s=="string"||Array.isArray(s)?s:void 0,O=l.useMemo(()=>{if(w){const V=typeof w=="string"?w:Object.values(w)[0];return new Dt(V).isLight()}return!1},[s]),f=l.useMemo(()=>{var V,z;const N=Ce(e);return parseInt(N!==void 0?(V=N??0)===null||V===void 0?void 0:V.toString():(z=o??0)===null||z===void 0?void 0:z.toString(),10)},[o,e.success,e.successPercent]),x=l.useMemo(()=>!$r.includes(p)&&f>=100?"success":p||"normal",[p,f]),{getPrefixCls:I,direction:R,progress:M}=l.useContext(Ee),h=I("progress",r),[Q,te,J]=fr(h),W=u==="line",q=W&&!a,T=l.useMemo(()=>{if(!c)return null;const V=Ce(e);let z;const N=g||(m=>`${m}%`),G=W&&O&&$==="inner";return $==="inner"||g||x!=="exception"&&x!=="success"?z=N(le(o),le(V)):x==="exception"?z=W?l.createElement(Rt,null):l.createElement(Ft,null):x==="success"&&(z=W?l.createElement(Lt,null):l.createElement(Nt,null)),l.createElement("span",{className:_(`${h}-text`,{[`${h}-text-bright`]:G,[`${h}-text-${C}`]:q,[`${h}-text-${$}`]:q}),title:typeof z=="string"?z:void 0},z)},[c,o,f,x,u,h,g]);let F;u==="line"?F=a?l.createElement(br,Object.assign({},e,{strokeColor:j,prefixCls:h,steps:typeof a=="object"?a.count:a}),T):l.createElement(vr,Object.assign({},e,{strokeColor:w,prefixCls:h,direction:R,percentPosition:{align:C,type:$}}),T):(u==="circle"||u==="dashboard")&&(F=l.createElement(sr,Object.assign({},e,{strokeColor:w,prefixCls:h,progressStatus:x}),T));const ne=_(h,`${h}-status-${x}`,{[`${h}-${u==="dashboard"&&"circle"||u}`]:u!=="line",[`${h}-inline-circle`]:u==="circle"&&xe(d,"circle")[0]<=20,[`${h}-line`]:q,[`${h}-line-align-${C}`]:q,[`${h}-line-position-${$}`]:q,[`${h}-steps`]:a,[`${h}-show-info`]:c,[`${h}-${d}`]:typeof d=="string",[`${h}-rtl`]:R==="rtl"},M==null?void 0:M.className,n,i,te,J);return Q(l.createElement("div",Object.assign({ref:t,style:Object.assign(Object.assign({},M==null?void 0:M.style),v),className:ne,role:"progressbar","aria-valuenow":f,"aria-valuemin":0,"aria-valuemax":100},jt(E,["trailColor","strokeWidth","width","gapDegree","gapPosition","strokeLinecap","success","successPercent"])),F))}),je=function(e,t){if(e&&t){var r=Array.isArray(t)?t:t.split(","),n=e.name||"",i=e.type||"",a=i.replace(/\/.*$/,"");return r.some(function(s){var o=s.trim();if(/^\*(\/\*)?$/.test(s))return!0;if(o.charAt(0)==="."){var d=n.toLowerCase(),c=o.toLowerCase(),u=[c];return(c===".jpg"||c===".jpeg")&&(u=[".jpg",".jpeg"]),u.some(function(p){return d.endsWith(p)})}return/\/\*$/.test(o)?a===o.replace(/\/.*$/,""):i===o?!0:/^\w+$/.test(o)?(At(!1,"Upload takes an invalidate 'accept' type '".concat(o,"'.Skip for check.")),!0):!1})}return!0};function Cr(e,t){var r="cannot ".concat(e.method," ").concat(e.action," ").concat(t.status,"'"),n=new Error(r);return n.status=t.status,n.method=e.method,n.url=e.action,n}function et(e){var t=e.responseText||e.response;if(!t)return t;try{return JSON.parse(t)}catch{return t}}function Sr(e){var t=new XMLHttpRequest;e.onProgress&&t.upload&&(t.upload.onprogress=function(a){a.total>0&&(a.percent=a.loaded/a.total*100),e.onProgress(a)});var r=new FormData;e.data&&Object.keys(e.data).forEach(function(i){var a=e.data[i];if(Array.isArray(a)){a.forEach(function(s){r.append("".concat(i,"[]"),s)});return}r.append(i,a)}),e.file instanceof Blob?r.append(e.filename,e.file,e.file.name):r.append(e.filename,e.file),t.onerror=function(a){e.onError(a)},t.onload=function(){return t.status<200||t.status>=300?e.onError(Cr(e,t),et(t)):e.onSuccess(et(t),t)},t.open(e.method,e.action,!0),e.withCredentials&&"withCredentials"in t&&(t.withCredentials=!0);var n=e.headers||{};return n["X-Requested-With"]!==null&&t.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(n).forEach(function(i){n[i]!==null&&t.setRequestHeader(i,n[i])}),t.send(r),{abort:function(){t.abort()}}}function Er(e,t){var r=e.createReader(),n=[];function i(){r.readEntries(function(a){var s=Array.prototype.slice.apply(a);n=n.concat(s);var o=!s.length;o?t(n):i()})}i()}var xr=function(t,r,n){var i=function a(s,o){s&&(s.path=o||"",s.isFile?s.file(function(d){n(d)&&(s.fullPath&&!d.webkitRelativePath&&(Object.defineProperties(d,{webkitRelativePath:{writable:!0}}),d.webkitRelativePath=s.fullPath.replace(/^\//,""),Object.defineProperties(d,{webkitRelativePath:{writable:!1}})),r([d]))}):s.isDirectory&&Er(s,function(d){d.forEach(function(c){a(c,"".concat(o).concat(s.name,"/"))})}))};t.forEach(function(a){i(a.webkitGetAsEntry())})},Ir=+new Date,Or=0;function Re(){return"rc-upload-".concat(Ir,"-").concat(++Or)}var Pr=["component","prefixCls","className","classNames","disabled","id","style","styles","multiple","accept","capture","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave","hasControlInside"],Dr=function(e){at(r,e);var t=it(r);function r(){var n;st(this,r);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return n=t.call.apply(t,[this].concat(a)),X(ee(n),"state",{uid:Re()}),X(ee(n),"reqs",{}),X(ee(n),"fileInput",void 0),X(ee(n),"_isMounted",void 0),X(ee(n),"onChange",function(o){var d=n.props,c=d.accept,u=d.directory,p=o.target.files,g=ue(p).filter(function(v){return!u||je(v,c)});n.uploadFiles(g),n.reset()}),X(ee(n),"onClick",function(o){var d=n.fileInput;if(d){var c=o.target,u=n.props.onClick;if(c&&c.tagName==="BUTTON"){var p=d.parentNode;p.focus(),c.blur()}d.click(),u&&u(o)}}),X(ee(n),"onKeyDown",function(o){o.key==="Enter"&&n.onClick(o)}),X(ee(n),"onFileDrop",function(o){var d=n.props.multiple;if(o.preventDefault(),o.type!=="dragover")if(n.props.directory)xr(Array.prototype.slice.call(o.dataTransfer.items),n.uploadFiles,function(u){return je(u,n.props.accept)});else{var c=ue(o.dataTransfer.files).filter(function(u){return je(u,n.props.accept)});d===!1&&(c=c.slice(0,1)),n.uploadFiles(c)}}),X(ee(n),"uploadFiles",function(o){var d=ue(o),c=d.map(function(u){return u.uid=Re(),n.processFile(u,d)});Promise.all(c).then(function(u){var p=n.props.onBatchStart;p==null||p(u.map(function(g){var v=g.origin,y=g.parsedFile;return{file:v,parsedFile:y}})),u.filter(function(g){return g.parsedFile!==null}).forEach(function(g){n.post(g)})})}),X(ee(n),"processFile",function(){var o=Tt(We().mark(function d(c,u){var p,g,v,y,E,C,$,w,j;return We().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(p=n.props.beforeUpload,g=c,!p){f.next=14;break}return f.prev=3,f.next=6,p(c,u);case 6:g=f.sent,f.next=12;break;case 9:f.prev=9,f.t0=f.catch(3),g=!1;case 12:if(g!==!1){f.next=14;break}return f.abrupt("return",{origin:c,parsedFile:null,action:null,data:null});case 14:if(v=n.props.action,typeof v!="function"){f.next=21;break}return f.next=18,v(c);case 18:y=f.sent,f.next=22;break;case 21:y=v;case 22:if(E=n.props.data,typeof E!="function"){f.next=29;break}return f.next=26,E(c);case 26:C=f.sent,f.next=30;break;case 29:C=E;case 30:return $=(ge(g)==="object"||typeof g=="string")&&g?g:c,$ instanceof File?w=$:w=new File([$],c.name,{type:c.type}),j=w,j.uid=c.uid,f.abrupt("return",{origin:c,data:C,parsedFile:j,action:y});case 35:case"end":return f.stop()}},d,null,[[3,9]])}));return function(d,c){return o.apply(this,arguments)}}()),X(ee(n),"saveFileInput",function(o){n.fileInput=o}),n}return lt(r,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"post",value:function(i){var a=this,s=i.data,o=i.origin,d=i.action,c=i.parsedFile;if(this._isMounted){var u=this.props,p=u.onStart,g=u.customRequest,v=u.name,y=u.headers,E=u.withCredentials,C=u.method,$=o.uid,w=g||Sr,j={action:d,filename:v,data:s,file:c,headers:y,withCredentials:E,method:C||"post",onProgress:function(f){var x=a.props.onProgress;x==null||x(f,c)},onSuccess:function(f,x){var I=a.props.onSuccess;I==null||I(f,c,x),delete a.reqs[$]},onError:function(f,x){var I=a.props.onError;I==null||I(f,x,c),delete a.reqs[$]}};p(o),this.reqs[$]=w(j)}}},{key:"reset",value:function(){this.setState({uid:Re()})}},{key:"abort",value:function(i){var a=this.reqs;if(i){var s=i.uid?i.uid:i;a[s]&&a[s].abort&&a[s].abort(),delete a[s]}else Object.keys(a).forEach(function(o){a[o]&&a[o].abort&&a[o].abort(),delete a[o]})}},{key:"render",value:function(){var i,a=this.props,s=a.component,o=a.prefixCls,d=a.className,c=a.classNames,u=c===void 0?{}:c,p=a.disabled,g=a.id,v=a.style,y=a.styles,E=y===void 0?{}:y,C=a.multiple,$=a.accept,w=a.capture,j=a.children,O=a.directory,f=a.openFileDialogOnClick,x=a.onMouseEnter,I=a.onMouseLeave,R=a.hasControlInside,M=tt(a,Pr),h=_((i={},X(i,o,!0),X(i,"".concat(o,"-disabled"),p),X(i,d,d),i)),Q=O?{directory:"directory",webkitdirectory:"webkitdirectory"}:{},te=p?{}:{onClick:f?this.onClick:function(){},onKeyDown:f?this.onKeyDown:function(){},onMouseEnter:x,onMouseLeave:I,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:R?void 0:"0"};return Te.createElement(s,ie({},te,{className:h,role:R?void 0:"button",style:v}),Te.createElement("input",ie({},Mt(M,{aria:!0,data:!0}),{id:g,disabled:p,type:"file",ref:this.saveFileInput,onClick:function(W){return W.stopPropagation()},key:this.state.uid,style:Ne({display:"none"},E.input),className:u.input,accept:$},Q,{multiple:C,onChange:this.onChange},w!=null?{capture:w}:{})),j)}}]),r}(l.Component);function Fe(){}var ke=function(e){at(r,e);var t=it(r);function r(){var n;st(this,r);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return n=t.call.apply(t,[this].concat(a)),X(ee(n),"uploader",void 0),X(ee(n),"saveUploader",function(o){n.uploader=o}),n}return lt(r,[{key:"abort",value:function(i){this.uploader.abort(i)}},{key:"render",value:function(){return Te.createElement(Dr,ie({},this.props,{ref:this.saveUploader}))}}]),r}(l.Component);X(ke,"defaultProps",{component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:Fe,onError:Fe,onSuccess:Fe,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0,hasControlInside:!1});const jr=e=>{const{componentCls:t,iconCls:r}=e;return{[`${t}-wrapper`]:{[`${t}-drag`]:{position:"relative",width:"100%",height:"100%",textAlign:"center",background:e.colorFillAlter,border:`${Z(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:`${Z(e.lineWidthFocus)} solid ${e.colorPrimaryBorder}`}},[`${t}-drag-container`]:{display:"table-cell",verticalAlign:"middle"},[`
&:not(${t}-disabled):hover,
&-hover:not(${t}-disabled)
`]:{borderColor:e.colorPrimaryHover},[`p${t}-drag-icon`]:{marginBottom:e.margin,[r]:{color:e.colorPrimary,fontSize:e.uploadThumbnailSize}},[`p${t}-text`]:{margin:`0 0 ${Z(e.marginXXS)}`,color:e.colorTextHeading,fontSize:e.fontSizeLG},[`p${t}-hint`]:{color:e.colorTextDescription,fontSize:e.fontSize},[`&${t}-disabled`]:{[`p${t}-drag-icon ${r},
p${t}-text,
p${t}-hint
`]:{color:e.colorTextDisabled}}}}}},Rr=e=>{const{componentCls:t,antCls:r,iconCls:n,fontSize:i,lineHeight:a,calc:s}=e,o=`${t}-list-item`,d=`${o}-actions`,c=`${o}-action`,u=e.fontHeightSM;return{[`${t}-wrapper`]:{[`${t}-list`]:Object.assign(Object.assign({},ct()),{lineHeight:e.lineHeight,[o]:{position:"relative",height:s(e.lineHeight).mul(i).equal(),marginTop:e.marginXS,fontSize:i,display:"flex",alignItems:"center",transition:`background-color ${e.motionDurationSlow}`,"&:hover":{backgroundColor:e.controlItemBgHover},[`${o}-name`]:Object.assign(Object.assign({},dt),{padding:`0 ${Z(e.paddingXS)}`,lineHeight:a,flex:"auto",transition:`all ${e.motionDurationSlow}`}),[d]:{whiteSpace:"nowrap",[c]:{opacity:0},[n]:{color:e.actionsColor,transition:`all ${e.motionDurationSlow}`},[`
${c}:focus-visible,
&.picture ${c}
`]:{opacity:1},[`${c}${r}-btn`]:{height:u,border:0,lineHeight:1}},[`${t}-icon ${n}`]:{color:e.colorTextDescription,fontSize:i},[`${o}-progress`]:{position:"absolute",bottom:e.calc(e.uploadProgressOffset).mul(-1).equal(),width:"100%",paddingInlineStart:s(i).add(e.paddingXS).equal(),fontSize:i,lineHeight:0,pointerEvents:"none","> div":{margin:0}}},[`${o}:hover ${c}`]:{opacity:1},[`${o}-error`]:{color:e.colorError,[`${o}-name, ${t}-icon ${n}`]:{color:e.colorError},[d]:{[`${n}, ${n}:hover`]:{color:e.colorError},[c]:{opacity:1}}},[`${t}-list-item-container`]:{transition:`opacity ${e.motionDurationSlow}, height ${e.motionDurationSlow}`,"&::before":{display:"table",width:0,height:0,content:'""'}}})}}},Fr=e=>{const{componentCls:t}=e,r=new Me("uploadAnimateInlineIn",{from:{width:0,height:0,padding:0,opacity:0,margin:e.calc(e.marginXS).div(-2).equal()}}),n=new Me("uploadAnimateInlineOut",{to:{width:0,height:0,padding:0,opacity:0,margin:e.calc(e.marginXS).div(-2).equal()}}),i=`${t}-animate-inline`;return[{[`${t}-wrapper`]:{[`${i}-appear, ${i}-enter, ${i}-leave`]:{animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseInOutCirc,animationFillMode:"forwards"},[`${i}-appear, ${i}-enter`]:{animationName:r},[`${i}-leave`]:{animationName:n}}},{[`${t}-wrapper`]:kt(e)},r,n]},Lr=e=>{const{componentCls:t,iconCls:r,uploadThumbnailSize:n,uploadProgressOffset:i,calc:a}=e,s=`${t}-list`,o=`${s}-item`;return{[`${t}-wrapper`]:{[`
${s}${s}-picture,
${s}${s}-picture-card,
${s}${s}-picture-circle
`]:{[o]:{position:"relative",height:a(n).add(a(e.lineWidth).mul(2)).add(a(e.paddingXS).mul(2)).equal(),padding:e.paddingXS,border:`${Z(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadiusLG,"&:hover":{background:"transparent"},[`${o}-thumbnail`]:Object.assign(Object.assign({},dt),{width:n,height:n,lineHeight:Z(a(n).add(e.paddingSM).equal()),textAlign:"center",flex:"none",[r]:{fontSize:e.fontSizeHeading2,color:e.colorPrimary},img:{display:"block",width:"100%",height:"100%",overflow:"hidden"}}),[`${o}-progress`]:{bottom:i,width:`calc(100% - ${Z(a(e.paddingSM).mul(2).equal())})`,marginTop:0,paddingInlineStart:a(n).add(e.paddingXS).equal()}},[`${o}-error`]:{borderColor:e.colorError,[`${o}-thumbnail ${r}`]:{[`svg path[fill='${He[0]}']`]:{fill:e.colorErrorBg},[`svg path[fill='${He.primary}']`]:{fill:e.colorError}}},[`${o}-uploading`]:{borderStyle:"dashed",[`${o}-name`]:{marginBottom:i}}},[`${s}${s}-picture-circle ${o}`]:{[`&, &::before, ${o}-thumbnail`]:{borderRadius:"50%"}}}}},Nr=e=>{const{componentCls:t,iconCls:r,fontSizeLG:n,colorTextLightSolid:i,calc:a}=e,s=`${t}-list`,o=`${s}-item`,d=e.uploadPicCardSize;return{[`
${t}-wrapper${t}-picture-card-wrapper,
${t}-wrapper${t}-picture-circle-wrapper
`]:Object.assign(Object.assign({},ct()),{display:"block",[`${t}${t}-select`]:{width:d,height:d,textAlign:"center",verticalAlign:"top",backgroundColor:e.colorFillAlter,border:`${Z(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:d,height:d,verticalAlign:"top"},"&::after":{display:"none"},"&::before":{display:"none"},[o]:{height:"100%",margin:0,"&::before":{position:"absolute",zIndex:1,width:`calc(100% - ${Z(a(e.paddingXS).mul(2).equal())})`,height:`calc(100% - ${Z(a(e.paddingXS).mul(2).equal())})`,backgroundColor:e.colorBgMask,opacity:0,transition:`all ${e.motionDurationSlow}`,content:'" "'}},[`${o}:hover`]:{[`&::before, ${o}-actions`]:{opacity:1}},[`${o}-actions`]:{position:"absolute",insetInlineStart:0,zIndex:10,width:"100%",whiteSpace:"nowrap",textAlign:"center",opacity:0,transition:`all ${e.motionDurationSlow}`,[`
${r}-eye,
${r}-download,
${r}-delete
`]:{zIndex:10,width:n,margin:`0 ${Z(e.marginXXS)}`,fontSize:n,cursor:"pointer",transition:`all ${e.motionDurationSlow}`,color:i,"&:hover":{color:i},svg:{verticalAlign:"baseline"}}},[`${o}-thumbnail, ${o}-thumbnail img`]:{position:"static",display:"block",width:"100%",height:"100%",objectFit:"contain"},[`${o}-name`]:{display:"none",textAlign:"center"},[`${o}-file + ${o}-name`]:{position:"absolute",bottom:e.margin,display:"block",width:`calc(100% - ${Z(a(e.paddingXS).mul(2).equal())})`},[`${o}-uploading`]:{[`&${o}`]:{backgroundColor:e.colorFillAlter},[`&::before, ${r}-eye, ${r}-download, ${r}-delete`]:{display:"none"}},[`${o}-progress`]:{bottom:e.marginXL,width:`calc(100% - ${Z(a(e.paddingXS).mul(2).equal())})`,paddingInlineStart:0}}}),[`${t}-wrapper${t}-picture-circle-wrapper`]:{[`${t}${t}-select`]:{borderRadius:"50%"}}}},Ar=e=>{const{componentCls:t}=e;return{[`${t}-rtl`]:{direction:"rtl"}}},Mr=e=>{const{componentCls:t,colorTextDisabled:r}=e;return{[`${t}-wrapper`]:Object.assign(Object.assign({},ot(e)),{[t]:{outline:0,"input[type='file']":{cursor:"pointer"}},[`${t}-select`]:{display:"inline-block"},[`${t}-disabled`]:{color:r,cursor:"not-allowed"}})}},Tr=e=>({actionsColor:e.colorTextDescription}),kr=rt("Upload",e=>{const{fontSizeHeading3:t,fontHeight:r,lineWidth:n,controlHeightLG:i,calc:a}=e,s=nt(e,{uploadThumbnailSize:a(t).mul(2).equal(),uploadProgressOffset:a(a(r).div(2)).add(n).equal(),uploadPicCardSize:a(i).mul(2.55).equal()});return[Mr(s),jr(s),Lr(s),Nr(s),Rr(s),Fr(s),Ar(s),qt(s)]},Tr);var Ur={icon:function(t,r){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M534 352V136H232v752h560V394H576a42 42 0 01-42-42z",fill:r}},{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"},_r=function(t,r){return l.createElement(ye,ie({},t,{ref:r,icon:Ur}))},zr=l.forwardRef(_r),Br={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"},Wr=function(t,r){return l.createElement(ye,ie({},t,{ref:r,icon:Br}))},Hr=l.forwardRef(Wr),Xr={icon:function(t,r){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:r}},{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:r}},{tag:"path",attrs:{d:"M276 368a28 28 0 1056 0 28 28 0 10-56 0z",fill:r}},{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"},qr=function(t,r){return l.createElement(ye,ie({},t,{ref:r,icon:Xr}))},Vr=l.forwardRef(qr);function $e(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 we(e,t){const r=ue(t),n=r.findIndex(i=>{let{uid:a}=i;return a===e.uid});return n===-1?r.push(e):r[n]=e,r}function Le(e,t){const r=e.uid!==void 0?"uid":"name";return t.filter(n=>n[r]===e[r])[0]}function Gr(e,t){const r=e.uid!==void 0?"uid":"name",n=t.filter(i=>i[r]!==e[r]);return n.length===t.length?null:n}const Kr=function(){const t=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:"").split("/"),n=t[t.length-1].split(/#|\?/)[0];return(/\.[^./\\]*$/.exec(n)||[""])[0]},mt=e=>e.indexOf("image/")===0,Jr=e=>{if(e.type&&!e.thumbUrl)return mt(e.type);const t=e.thumbUrl||e.url||"",r=Kr(t);return/^data:image\//.test(t)||/(webp|svg|png|gif|jpg|jpeg|jfif|bmp|dpg|ico|heic|heif)$/i.test(r)?!0:!(/^data:/.test(t)||r)},se=200;function Yr(e){return new Promise(t=>{if(!e.type||!mt(e.type)){t("");return}const r=document.createElement("canvas");r.width=se,r.height=se,r.style.cssText=`position: fixed; left: 0; top: 0; width: ${se}px; height: ${se}px; z-index: 9999; display: none;`,document.body.appendChild(r);const n=r.getContext("2d"),i=new Image;if(i.onload=()=>{const{width:a,height:s}=i;let o=se,d=se,c=0,u=0;a>s?(d=s*(se/a),u=-(d-o)/2):(o=a*(se/s),c=-(o-d)/2),n.drawImage(i,c,u,o,d);const p=r.toDataURL();document.body.removeChild(r),window.URL.revokeObjectURL(i.src),t(p)},i.crossOrigin="anonymous",e.type.startsWith("image/svg+xml")){const a=new FileReader;a.onload=()=>{a.result&&typeof a.result=="string"&&(i.src=a.result)},a.readAsDataURL(e)}else if(e.type.startsWith("image/gif")){const a=new FileReader;a.onload=()=>{a.result&&t(a.result)},a.readAsDataURL(e)}else i.src=window.URL.createObjectURL(e)})}var Zr={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"},Qr=function(t,r){return l.createElement(ye,ie({},t,{ref:r,icon:Zr}))},en=l.forwardRef(Qr);const tn=l.forwardRef((e,t)=>{let{prefixCls:r,className:n,style:i,locale:a,listType:s,file:o,items:d,progress:c,iconRender:u,actionIconRender:p,itemRender:g,isImgUrl:v,showPreviewIcon:y,showRemoveIcon:E,showDownloadIcon:C,previewIcon:$,removeIcon:w,downloadIcon:j,onPreview:O,onDownload:f,onClose:x}=e;var I,R;const{status:M}=o,[h,Q]=l.useState(M);l.useEffect(()=>{M!=="removed"&&Q(M)},[M]);const[te,J]=l.useState(!1);l.useEffect(()=>{const A=setTimeout(()=>{J(!0)},300);return()=>{clearTimeout(A)}},[]);const W=u(o);let q=l.createElement("div",{className:`${r}-icon`},W);if(s==="picture"||s==="picture-card"||s==="picture-circle")if(h==="uploading"||!o.thumbUrl&&!o.url){const A=_(`${r}-list-item-thumbnail`,{[`${r}-list-item-file`]:h!=="uploading"});q=l.createElement("div",{className:A},W)}else{const A=v!=null&&v(o)?l.createElement("img",{src:o.thumbUrl||o.url,alt:o.name,className:`${r}-list-item-image`,crossOrigin:o.crossOrigin}):W,ae=_(`${r}-list-item-thumbnail`,{[`${r}-list-item-file`]:v&&!v(o)});q=l.createElement("a",{className:ae,onClick:pe=>O(o,pe),href:o.url||o.thumbUrl,target:"_blank",rel:"noopener noreferrer"},A)}const T=_(`${r}-list-item`,`${r}-list-item-${h}`),F=typeof o.linkProps=="string"?JSON.parse(o.linkProps):o.linkProps,ne=E?p((typeof w=="function"?w(o):w)||l.createElement(Gt,null),()=>x(o),r,a.removeFile,!0):null,V=C&&h==="done"?p((typeof j=="function"?j(o):j)||l.createElement(en,null),()=>f(o),r,a.downloadFile):null,z=s!=="picture-card"&&s!=="picture-circle"&&l.createElement("span",{key:"download-delete",className:_(`${r}-list-item-actions`,{picture:s==="picture"})},V,ne),N=_(`${r}-list-item-name`),G=o.url?[l.createElement("a",Object.assign({key:"view",target:"_blank",rel:"noopener noreferrer",className:N,title:o.name},F,{href:o.url,onClick:A=>O(o,A)}),o.name),z]:[l.createElement("span",{key:"view",className:N,onClick:A=>O(o,A),title:o.name},o.name),z],m=y&&(o.url||o.thumbUrl)?l.createElement("a",{href:o.url||o.thumbUrl,target:"_blank",rel:"noopener noreferrer",onClick:A=>O(o,A),title:a.previewFile},typeof $=="function"?$(o):$||l.createElement(Ut,null)):null,D=(s==="picture-card"||s==="picture-circle")&&h!=="uploading"&&l.createElement("span",{className:`${r}-list-item-actions`},m,h==="done"&&V,ne),{getPrefixCls:H}=l.useContext(Ee),U=H(),Y=l.createElement("div",{className:T},q,G,D,te&&l.createElement(ut,{motionName:`${U}-fade`,visible:h==="uploading",motionDeadline:2e3},A=>{let{className:ae}=A;const pe="percent"in o?l.createElement(wr,Object.assign({},c,{type:"line",percent:o.percent,"aria-label":o["aria-label"],"aria-labelledby":o["aria-labelledby"]})):null;return l.createElement("div",{className:_(`${r}-list-item-progress`,ae)},pe)})),re=o.response&&typeof o.response=="string"?o.response:((I=o.error)===null||I===void 0?void 0:I.statusText)||((R=o.error)===null||R===void 0?void 0:R.message)||a.uploadError,oe=h==="error"?l.createElement(pt,{title:re,getPopupContainer:A=>A.parentNode},Y):Y;return l.createElement("div",{className:_(`${r}-list-item-container`,n),style:i,ref:t},g?g(oe,o,d,{download:f.bind(null,o),preview:O.bind(null,o),remove:x.bind(null,o)}):oe)}),rn=(e,t)=>{const{listType:r="text",previewFile:n=Yr,onPreview:i,onDownload:a,onRemove:s,locale:o,iconRender:d,isImageUrl:c=Jr,prefixCls:u,items:p=[],showPreviewIcon:g=!0,showRemoveIcon:v=!0,showDownloadIcon:y=!1,removeIcon:E,previewIcon:C,downloadIcon:$,progress:w={size:[-1,2],showInfo:!1},appendAction:j,appendActionVisible:O=!0,itemRender:f,disabled:x}=e,I=Vt(),[R,M]=l.useState(!1);l.useEffect(()=>{r!=="picture"&&r!=="picture-card"&&r!=="picture-circle"||(p||[]).forEach(m=>{typeof document>"u"||typeof window>"u"||!window.FileReader||!window.File||!(m.originFileObj instanceof File||m.originFileObj instanceof Blob)||m.thumbUrl!==void 0||(m.thumbUrl="",n&&n(m.originFileObj).then(D=>{m.thumbUrl=D||"",I()}))})},[r,p,n]),l.useEffect(()=>{M(!0)},[]);const h=(m,D)=>{if(i)return D==null||D.preventDefault(),i(m)},Q=m=>{typeof a=="function"?a(m):m.url&&window.open(m.url)},te=m=>{s==null||s(m)},J=m=>{if(d)return d(m,r);const D=m.status==="uploading",H=c!=null&&c(m)?l.createElement(Vr,null):l.createElement(zr,null);let U=D?l.createElement(qe,null):l.createElement(Hr,null);return r==="picture"?U=D?l.createElement(qe,null):H:(r==="picture-card"||r==="picture-circle")&&(U=D?o.uploading:H),U},W=(m,D,H,U,Y)=>{const re={type:"text",size:"small",title:U,onClick:oe=>{var A,ae;D(),l.isValidElement(m)&&((ae=(A=m.props).onClick)===null||ae===void 0||ae.call(A,oe))},className:`${H}-list-item-action`};if(Y&&(re.disabled=x),l.isValidElement(m)){const oe=Xe(m,Object.assign(Object.assign({},m.props),{onClick:()=>{}}));return l.createElement(Ve,Object.assign({},re,{icon:oe}))}return l.createElement(Ve,Object.assign({},re),l.createElement("span",null,m))};l.useImperativeHandle(t,()=>({handlePreview:h,handleDownload:Q}));const{getPrefixCls:q}=l.useContext(Ee),T=q("upload",u),F=q(),ne=_(`${T}-list`,`${T}-list-${r}`),V=ue(p.map(m=>({key:m.uid,file:m})));let N={motionDeadline:2e3,motionName:`${T}-${r==="picture-card"||r==="picture-circle"?"animate-inline":"animate"}`,keys:V,motionAppear:R};const G=l.useMemo(()=>{const m=Object.assign({},_t(F));return delete m.onAppearEnd,delete m.onEnterEnd,delete m.onLeaveEnd,m},[F]);return r!=="picture-card"&&r!=="picture-circle"&&(N=Object.assign(Object.assign({},G),N)),l.createElement("div",{className:ne},l.createElement(zt,Object.assign({},N,{component:!1}),m=>{let{key:D,file:H,className:U,style:Y}=m;return l.createElement(tn,{key:D,locale:o,prefixCls:T,className:U,style:Y,file:H,items:p,progress:w,listType:r,isImgUrl:c,showPreviewIcon:g,showRemoveIcon:v,showDownloadIcon:y,removeIcon:E,previewIcon:C,downloadIcon:$,iconRender:J,actionIconRender:W,itemRender:f,onPreview:h,onDownload:Q,onClose:te})}),j&&l.createElement(ut,Object.assign({},N,{visible:O,forceRender:!0}),m=>{let{className:D,style:H}=m;return Xe(j,U=>({className:_(U.className,D),style:Object.assign(Object.assign(Object.assign({},H),{pointerEvents:D?"none":void 0}),U.style)}))}))},nn=l.forwardRef(rn);var on=function(e,t,r,n){function i(a){return a instanceof r?a:new r(function(s){s(a)})}return new(r||(r=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(p){s(p)}}function d(u){try{c(n.throw(u))}catch(p){s(p)}}function c(u){u.done?a(u.value):i(u.value).then(o,d)}c((n=n.apply(e,[])).next())})};const be=`__LIST_IGNORE_${Date.now()}__`,an=(e,t)=>{const{fileList:r,defaultFileList:n,onRemove:i,showUploadList:a=!0,listType:s="text",onPreview:o,onDownload:d,onChange:c,onDrop:u,previewFile:p,disabled:g,locale:v,iconRender:y,isImageUrl:E,progress:C,prefixCls:$,className:w,type:j="select",children:O,style:f,itemRender:x,maxCount:I,data:R={},multiple:M=!1,hasControlInside:h=!0,action:Q="",accept:te="",supportServerRender:J=!0,rootClassName:W}=e,q=l.useContext(Bt),T=g??q,[F,ne]=Wt(n||[],{value:r,postState:b=>b??[]}),[V,z]=l.useState("drop"),N=l.useRef(null),G=l.useRef(null);l.useMemo(()=>{const b=Date.now();(r||[]).forEach((P,k)=>{!P.uid&&!Object.isFrozen(P)&&(P.uid=`__AUTO__${b}_${k}__`)})},[r]);const m=(b,P,k)=>{let S=ue(P),L=!1;I===1?S=S.slice(-1):I&&(L=S.length>I,S=S.slice(0,I)),Ge.flushSync(()=>{ne(S)});const K={file:b,fileList:S};k&&(K.event=k),(!L||b.status==="removed"||S.some(ce=>ce.uid===b.uid))&&Ge.flushSync(()=>{c==null||c(K)})},D=(b,P)=>on(void 0,void 0,void 0,function*(){const{beforeUpload:k,transformFile:S}=e;let L=b;if(k){const K=yield k(b,P);if(K===!1)return!1;if(delete b[be],K===be)return Object.defineProperty(b,be,{value:!0,configurable:!0}),!1;typeof K=="object"&&K&&(L=K)}return S&&(L=yield S(L)),L}),H=b=>{const P=b.filter(L=>!L.file[be]);if(!P.length)return;const k=P.map(L=>$e(L.file));let S=ue(F);k.forEach(L=>{S=we(L,S)}),k.forEach((L,K)=>{let ce=L;if(P[K].parsedFile)L.status="uploading";else{const{originFileObj:me}=L;let de;try{de=new File([me],me.name,{type:me.type})}catch{de=new Blob([me],{type:me.type}),de.name=me.name,de.lastModifiedDate=new Date,de.lastModified=new Date().getTime()}de.uid=L.uid,ce=de}m(ce,S)})},U=(b,P,k)=>{try{typeof b=="string"&&(b=JSON.parse(b))}catch{}if(!Le(P,F))return;const S=$e(P);S.status="done",S.percent=100,S.response=b,S.xhr=k;const L=we(S,F);m(S,L)},Y=(b,P)=>{if(!Le(P,F))return;const k=$e(P);k.status="uploading",k.percent=b.percent;const S=we(k,F);m(k,S,b)},re=(b,P,k)=>{if(!Le(k,F))return;const S=$e(k);S.error=b,S.response=P,S.status="error";const L=we(S,F);m(S,L)},oe=b=>{let P;Promise.resolve(typeof i=="function"?i(b):i).then(k=>{var S;if(k===!1)return;const L=Gr(b,F);L&&(P=Object.assign(Object.assign({},b),{status:"removed"}),F==null||F.forEach(K=>{const ce=P.uid!==void 0?"uid":"name";K[ce]===P[ce]&&!Object.isFrozen(K)&&(K.status="removed")}),(S=N.current)===null||S===void 0||S.abort(P),m(P,L))})},A=b=>{z(b.type),b.type==="drop"&&(u==null||u(b))};l.useImperativeHandle(t,()=>({onBatchStart:H,onSuccess:U,onProgress:Y,onError:re,fileList:F,upload:N.current,nativeElement:G.current}));const{getPrefixCls:ae,direction:pe,upload:fe}=l.useContext(Ee),B=ae("upload",$),he=Object.assign(Object.assign({onBatchStart:H,onError:re,onProgress:Y,onSuccess:U},e),{data:R,multiple:M,action:Q,accept:te,supportServerRender:J,prefixCls:B,disabled:T,beforeUpload:D,onChange:void 0,hasControlInside:h});delete he.className,delete he.style,(!O||T)&&delete he.id;const Ue=`${B}-wrapper`,[Ie,_e,vt]=kr(B,Ue),[bt]=Ht("Upload",Xt.Upload),{showRemoveIcon:ze,showPreviewIcon:yt,showDownloadIcon:$t,removeIcon:wt,previewIcon:Ct,downloadIcon:St}=typeof a=="boolean"?{}:a,Et=typeof ze>"u"?!T:!!ze,Oe=(b,P)=>a?l.createElement(nn,{prefixCls:B,listType:s,items:F,previewFile:p,onPreview:o,onDownload:d,onRemove:oe,showRemoveIcon:Et,showPreviewIcon:yt,showDownloadIcon:$t,removeIcon:wt,previewIcon:Ct,downloadIcon:St,iconRender:y,locale:Object.assign(Object.assign({},bt),v),isImageUrl:E,progress:C,appendAction:b,appendActionVisible:P,itemRender:x,disabled:T}):b,Pe=_(Ue,w,W,_e,vt,fe==null?void 0:fe.className,{[`${B}-rtl`]:pe==="rtl",[`${B}-picture-card-wrapper`]:s==="picture-card",[`${B}-picture-circle-wrapper`]:s==="picture-circle"}),xt=Object.assign(Object.assign({},fe==null?void 0:fe.style),f);if(j==="drag"){const b=_(_e,B,`${B}-drag`,{[`${B}-drag-uploading`]:F.some(P=>P.status==="uploading"),[`${B}-drag-hover`]:V==="dragover",[`${B}-disabled`]:T,[`${B}-rtl`]:pe==="rtl"});return Ie(l.createElement("span",{className:Pe,ref:G},l.createElement("div",{className:b,style:xt,onDrop:A,onDragOver:A,onDragLeave:A},l.createElement(ke,Object.assign({},he,{ref:N,className:`${B}-btn`}),l.createElement("div",{className:`${B}-drag-container`},O))),Oe()))}const It=_(B,`${B}-select`,{[`${B}-disabled`]:T}),Be=l.createElement("div",{className:It,style:O?void 0:{display:"none"}},l.createElement(ke,Object.assign({},he,{ref:N})));return Ie(s==="picture-card"||s==="picture-circle"?l.createElement("span",{className:Pe,ref:G},Oe(Be,!!O)):l.createElement("span",{className:Pe,ref:G},Be,Oe()))},gt=l.forwardRef(an);var sn=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r};const ln=l.forwardRef((e,t)=>{var{style:r,height:n,hasControlInside:i=!1}=e,a=sn(e,["style","height","hasControlInside"]);return l.createElement(gt,Object.assign({ref:t,hasControlInside:i},a,{type:"drag",style:Object.assign(Object.assign({},r),{height:n})}))}),ht=gt;ht.Dragger=ln;ht.LIST_IGNORE=be;var cn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M400 317.7h73.9V656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V317.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 163a8 8 0 00-12.6 0l-112 141.7c-4.1 5.3-.4 13 6.3 13zM878 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:"upload",theme:"outlined"},dn=function(t,r){return l.createElement(ye,ie({},t,{ref:r,icon:cn}))},gn=l.forwardRef(dn);export{gn as R,ht as U};
|