import{i as Je,m as Ae,j as vt,k as ue,r as a,l as Be,p as Pe,aD as Ge,b as ge,g as ie,C as mt,c3 as gt,a as E,K as De,_ as D,ay as ht,c4 as pt,d as xe,R as we,f as he,c5 as wt,O as Ct,h as et,e as Ye,av as Ie,aw as ye,aV as Ce,c6 as bt,c7 as St,bD as xt,t as It,br as yt,c8 as Mt,T as Ot,ar as tt,c9 as nt,ca as Te,aX as Fe,Y as Rt}from"./index-c51caa49.js";import{E as $t}from"./MultiLineMarkdown-cd643b01.js";const Et=t=>{const{componentCls:e,sizePaddingEdgeHorizontal:n,colorSplit:o,lineWidth:r,textPaddingInline:i,orientationMargin:c,verticalMarginInline:l}=t;return{[e]:Object.assign(Object.assign({},vt(t)),{borderBlockStart:`${ue(r)} solid ${o}`,"&-vertical":{position:"relative",top:"-0.06em",display:"inline-block",height:"0.9em",marginInline:l,marginBlock:0,verticalAlign:"middle",borderTop:0,borderInlineStart:`${ue(r)} solid ${o}`},"&-horizontal":{display:"flex",clear:"both",width:"100%",minWidth:"100%",margin:`${ue(t.dividerHorizontalGutterMargin)} 0`},[`&-horizontal${e}-with-text`]:{display:"flex",alignItems:"center",margin:`${ue(t.dividerHorizontalWithTextGutterMargin)} 0`,color:t.colorTextHeading,fontWeight:500,fontSize:t.fontSizeLG,whiteSpace:"nowrap",textAlign:"center",borderBlockStart:`0 ${o}`,"&::before, &::after":{position:"relative",width:"50%",borderBlockStart:`${ue(r)} solid transparent`,borderBlockStartColor:"inherit",borderBlockEnd:0,transform:"translateY(50%)",content:"''"}},[`&-horizontal${e}-with-text-left`]:{"&::before":{width:`calc(${c} * 100%)`},"&::after":{width:`calc(100% - ${c} * 100%)`}},[`&-horizontal${e}-with-text-right`]:{"&::before":{width:`calc(100% - ${c} * 100%)`},"&::after":{width:`calc(${c} * 100%)`}},[`${e}-inner-text`]:{display:"inline-block",paddingBlock:0,paddingInline:i},"&-dashed":{background:"none",borderColor:o,borderStyle:"dashed",borderWidth:`${ue(r)} 0 0`},[`&-horizontal${e}-with-text${e}-dashed`]:{"&::before, &::after":{borderStyle:"dashed none none"}},[`&-vertical${e}-dashed`]:{borderInlineStartWidth:r,borderInlineEnd:0,borderBlockStart:0,borderBlockEnd:0},"&-dotted":{background:"none",borderColor:o,borderStyle:"dotted",borderWidth:`${ue(r)} 0 0`},[`&-horizontal${e}-with-text${e}-dotted`]:{"&::before, &::after":{borderStyle:"dotted none none"}},[`&-vertical${e}-dotted`]:{borderInlineStartWidth:r,borderInlineEnd:0,borderBlockStart:0,borderBlockEnd:0},[`&-plain${e}-with-text`]:{color:t.colorText,fontWeight:"normal",fontSize:t.fontSize},[`&-horizontal${e}-with-text-left${e}-no-default-orientation-margin-left`]:{"&::before":{width:0},"&::after":{width:"100%"},[`${e}-inner-text`]:{paddingInlineStart:n}},[`&-horizontal${e}-with-text-right${e}-no-default-orientation-margin-right`]:{"&::before":{width:"100%"},"&::after":{width:0},[`${e}-inner-text`]:{paddingInlineEnd:n}}})}},Nt=t=>({textPaddingInline:"1em",orientationMargin:.05,verticalMarginInline:t.marginXS}),Pt=Je("Divider",t=>{const e=Ae(t,{dividerHorizontalWithTextGutterMargin:t.margin,dividerHorizontalGutterMargin:t.marginLG,sizePaddingEdgeHorizontal:0});return[Et(e)]},Nt,{unitless:{orientationMargin:!0}});var Tt=globalThis&&globalThis.__rest||function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(n[o[r]]=t[o[r]]);return n};const Lt=t=>{const{getPrefixCls:e,direction:n,divider:o}=a.useContext(Be),{prefixCls:r,type:i="horizontal",orientation:c="center",orientationMargin:l,className:d,rootClassName:f,children:m,dashed:s,variant:b="solid",plain:g,style:h}=t,y=Tt(t,["prefixCls","type","orientation","orientationMargin","className","rootClassName","children","dashed","variant","plain","style"]),C=e("divider",r),[S,$,R]=Pt(C),O=!!m,u=c==="left"&&l!=null,x=c==="right"&&l!=null,p=Pe(C,o==null?void 0:o.className,$,R,`${C}-${i}`,{[`${C}-with-text`]:O,[`${C}-with-text-${c}`]:O,[`${C}-dashed`]:!!s,[`${C}-${b}`]:b!=="solid",[`${C}-plain`]:!!g,[`${C}-rtl`]:n==="rtl",[`${C}-no-default-orientation-margin-left`]:u,[`${C}-no-default-orientation-margin-right`]:x},d,f),v=a.useMemo(()=>typeof l=="number"?l:/^\d+$/.test(l)?Number(l):l,[l]),I=Object.assign(Object.assign({},u&&{marginLeft:v}),x&&{marginRight:v});return S(a.createElement("div",Object.assign({className:p,style:Object.assign(Object.assign({},o==null?void 0:o.style),h)},y,{role:"separator"}),m&&i!=="vertical"&&a.createElement("span",{className:`${C}-inner-text`,style:I},m)))},An=Lt;function ot(){var t=document.documentElement.clientWidth,e=window.innerHeight||document.documentElement.clientHeight;return{width:t,height:e}}function zt(t){var e=t.getBoundingClientRect(),n=document.documentElement;return{left:e.left+(window.pageXOffset||n.scrollLeft)-(n.clientLeft||document.body.clientLeft||0),top:e.top+(window.pageYOffset||n.scrollTop)-(n.clientTop||document.body.clientTop||0)}}function be(t,e,n,o){var r=Ge.unstable_batchedUpdates?function(c){Ge.unstable_batchedUpdates(n,c)}:n;return t!=null&&t.addEventListener&&t.addEventListener(e,r,o),{remove:function(){t!=null&&t.removeEventListener&&t.removeEventListener(e,r,o)}}}var Me=a.createContext(null),_t=function(e){var n=e.visible,o=e.maskTransitionName,r=e.getContainer,i=e.prefixCls,c=e.rootClassName,l=e.icons,d=e.countRender,f=e.showSwitch,m=e.showProgress,s=e.current,b=e.transform,g=e.count,h=e.scale,y=e.minScale,C=e.maxScale,S=e.closeIcon,$=e.onActive,R=e.onClose,O=e.onZoomIn,u=e.onZoomOut,x=e.onRotateRight,p=e.onRotateLeft,v=e.onFlipX,I=e.onFlipY,M=e.onReset,w=e.toolbarRender,N=e.zIndex,j=e.image,P=a.useContext(Me),Y=l.rotateLeft,H=l.rotateRight,W=l.zoomIn,V=l.zoomOut,Q=l.close,B=l.left,G=l.right,q=l.flipX,F=l.flipY,re="".concat(i,"-operations-operation");a.useEffect(function(){var L=function(_){_.keyCode===De.ESC&&R()};return n&&window.addEventListener("keydown",L),function(){window.removeEventListener("keydown",L)}},[n]);var J=function(z,_){z.preventDefault(),z.stopPropagation(),$(_)},k=a.useCallback(function(L){var z=L.type,_=L.disabled,Z=L.onClick,A=L.icon;return a.createElement("div",{key:z,className:ge(re,"".concat(i,"-operations-operation-").concat(z),ie({},"".concat(i,"-operations-operation-disabled"),!!_)),onClick:Z},A)},[re,i]),ae=f?k({icon:B,onClick:function(z){return J(z,-1)},type:"prev",disabled:s===0}):void 0,ee=f?k({icon:G,onClick:function(z){return J(z,1)},type:"next",disabled:s===g-1}):void 0,U=k({icon:F,onClick:I,type:"flipY"}),T=k({icon:q,onClick:v,type:"flipX"}),ne=k({icon:Y,onClick:p,type:"rotateLeft"}),X=k({icon:H,onClick:x,type:"rotateRight"}),K=k({icon:V,onClick:u,type:"zoomOut",disabled:h<=y}),oe=k({icon:W,onClick:O,type:"zoomIn",disabled:h===C}),le=a.createElement("div",{className:"".concat(i,"-operations")},U,T,ne,X,K,oe);return a.createElement(mt,{visible:n,motionName:o},function(L){var z=L.className,_=L.style;return a.createElement(gt,{open:!0,getContainer:r??document.body},a.createElement("div",{className:ge("".concat(i,"-operations-wrapper"),z,c),style:E(E({},_),{},{zIndex:N})},S===null?null:a.createElement("button",{className:"".concat(i,"-close"),onClick:R},S||Q),f&&a.createElement(a.Fragment,null,a.createElement("div",{className:ge("".concat(i,"-switch-left"),ie({},"".concat(i,"-switch-left-disabled"),s===0)),onClick:function(A){return J(A,-1)}},B),a.createElement("div",{className:ge("".concat(i,"-switch-right"),ie({},"".concat(i,"-switch-right-disabled"),s===g-1)),onClick:function(A){return J(A,1)}},G)),a.createElement("div",{className:"".concat(i,"-footer")},m&&a.createElement("div",{className:"".concat(i,"-progress")},d?d(s+1,g):"".concat(s+1," / ").concat(g)),w?w(le,E(E({icons:{prevIcon:ae,nextIcon:ee,flipYIcon:U,flipXIcon:T,rotateLeftIcon:ne,rotateRightIcon:X,zoomOutIcon:K,zoomInIcon:oe},actions:{onActive:$,onFlipY:I,onFlipX:v,onRotateLeft:p,onRotateRight:x,onZoomOut:u,onZoomIn:O,onReset:M,onClose:R},transform:b},P?{current:s,total:g}:{}),{},{image:j})):le)))})},Ne={x:0,y:0,rotate:0,scale:1,flipX:!1,flipY:!1};function kt(t,e,n,o){var r=a.useRef(null),i=a.useRef([]),c=a.useState(Ne),l=D(c,2),d=l[0],f=l[1],m=function(h){f(Ne),ht(Ne,d)||o==null||o({transform:Ne,action:h})},s=function(h,y){r.current===null&&(i.current=[],r.current=pt(function(){f(function(C){var S=C;return i.current.forEach(function($){S=E(E({},S),$)}),r.current=null,o==null||o({transform:S,action:y}),S})})),i.current.push(E(E({},d),h))},b=function(h,y,C,S,$){var R=t.current,O=R.width,u=R.height,x=R.offsetWidth,p=R.offsetHeight,v=R.offsetLeft,I=R.offsetTop,M=h,w=d.scale*h;w>n?(w=n,M=n/d.scale):w<e&&(w=$?w:e,M=w/d.scale);var N=C??innerWidth/2,j=S??innerHeight/2,P=M-1,Y=P*O*.5,H=P*u*.5,W=P*(N-d.x-v),V=P*(j-d.y-I),Q=d.x-(W-Y),B=d.y-(V-H);if(h<1&&w===1){var G=x*w,q=p*w,F=ot(),re=F.width,J=F.height;G<=re&&q<=J&&(Q=0,B=0)}s({x:Q,y:B,scale:w},y)};return{transform:d,resetTransform:m,updateTransform:s,dispatchZoomChange:b}}function Ue(t,e,n,o){var r=e+n,i=(n-o)/2;if(n>o){if(e>0)return ie({},t,i);if(e<0&&r<o)return ie({},t,-i)}else if(e<0||r>o)return ie({},t,e<0?i:-i);return{}}function rt(t,e,n,o){var r=ot(),i=r.width,c=r.height,l=null;return t<=i&&e<=c?l={x:0,y:0}:(t>i||e>c)&&(l=E(E({},Ue("x",n,t,i)),Ue("y",o,e,c))),l}var Se=1,jt=1;function At(t,e,n,o,r,i,c){var l=r.rotate,d=r.scale,f=r.x,m=r.y,s=a.useState(!1),b=D(s,2),g=b[0],h=b[1],y=a.useRef({diffX:0,diffY:0,transformX:0,transformY:0}),C=function(u){!e||u.button!==0||(u.preventDefault(),u.stopPropagation(),y.current={diffX:u.pageX-f,diffY:u.pageY-m,transformX:f,transformY:m},h(!0))},S=function(u){n&&g&&i({x:u.pageX-y.current.diffX,y:u.pageY-y.current.diffY},"move")},$=function(){if(n&&g){h(!1);var u=y.current,x=u.transformX,p=u.transformY,v=f!==x&&m!==p;if(!v)return;var I=t.current.offsetWidth*d,M=t.current.offsetHeight*d,w=t.current.getBoundingClientRect(),N=w.left,j=w.top,P=l%180!==0,Y=rt(P?M:I,P?I:M,N,j);Y&&i(E({},Y),"dragRebound")}},R=function(u){if(!(!n||u.deltaY==0)){var x=Math.abs(u.deltaY/100),p=Math.min(x,jt),v=Se+p*o;u.deltaY>0&&(v=Se/v),c(v,"wheel",u.clientX,u.clientY)}};return a.useEffect(function(){var O,u,x,p;if(e){x=be(window,"mouseup",$,!1),p=be(window,"mousemove",S,!1);try{window.top!==window.self&&(O=be(window.top,"mouseup",$,!1),u=be(window.top,"mousemove",S,!1))}catch{}}return function(){var v,I,M,w;(v=x)===null||v===void 0||v.remove(),(I=p)===null||I===void 0||I.remove(),(M=O)===null||M===void 0||M.remove(),(w=u)===null||w===void 0||w.remove()}},[n,g,f,m,l,e]),{isMoving:g,onMouseDown:C,onMouseMove:S,onMouseUp:$,onWheel:R}}function Dt(t){return new Promise(function(e){var n=document.createElement("img");n.onerror=function(){return e(!1)},n.onload=function(){return e(!0)},n.src=t})}function at(t){var e=t.src,n=t.isCustomPlaceholder,o=t.fallback,r=a.useState(n?"loading":"normal"),i=D(r,2),c=i[0],l=i[1],d=a.useRef(!1),f=c==="error";a.useEffect(function(){var g=!0;return Dt(e).then(function(h){!h&&g&&l("error")}),function(){g=!1}},[e]),a.useEffect(function(){n&&!d.current?l("loading"):f&&l("normal")},[e]);var m=function(){l("normal")},s=function(h){d.current=!1,c==="loading"&&h!==null&&h!==void 0&&h.complete&&(h.naturalWidth||h.naturalHeight)&&(d.current=!0,m())},b=f&&o?{src:o}:{onLoad:m,src:e};return[s,b,c]}function Le(t,e){var n=t.x-e.x,o=t.y-e.y;return Math.hypot(n,o)}function Yt(t,e,n,o){var r=Le(t,n),i=Le(e,o);if(r===0&&i===0)return[t.x,t.y];var c=r/(r+i),l=t.x+c*(e.x-t.x),d=t.y+c*(e.y-t.y);return[l,d]}function Xt(t,e,n,o,r,i,c){var l=r.rotate,d=r.scale,f=r.x,m=r.y,s=a.useState(!1),b=D(s,2),g=b[0],h=b[1],y=a.useRef({point1:{x:0,y:0},point2:{x:0,y:0},eventType:"none"}),C=function(u){y.current=E(E({},y.current),u)},S=function(u){if(e){u.stopPropagation(),h(!0);var x=u.touches,p=x===void 0?[]:x;p.length>1?C({point1:{x:p[0].clientX,y:p[0].clientY},point2:{x:p[1].clientX,y:p[1].clientY},eventType:"touchZoom"}):C({point1:{x:p[0].clientX-f,y:p[0].clientY-m},eventType:"move"})}},$=function(u){var x=u.touches,p=x===void 0?[]:x,v=y.current,I=v.point1,M=v.point2,w=v.eventType;if(p.length>1&&w==="touchZoom"){var N={x:p[0].clientX,y:p[0].clientY},j={x:p[1].clientX,y:p[1].clientY},P=Yt(I,M,N,j),Y=D(P,2),H=Y[0],W=Y[1],V=Le(N,j)/Le(I,M);c(V,"touchZoom",H,W,!0),C({point1:N,point2:j,eventType:"touchZoom"})}else w==="move"&&(i({x:p[0].clientX-I.x,y:p[0].clientY-I.y},"move"),C({eventType:"move"}))},R=function(){if(n){if(g&&h(!1),C({eventType:"none"}),o>d)return i({x:0,y:0,scale:o},"touchZoom");var u=t.current.offsetWidth*d,x=t.current.offsetHeight*d,p=t.current.getBoundingClientRect(),v=p.left,I=p.top,M=l%180!==0,w=rt(M?x:u,M?u:x,v,I);w&&i(E({},w),"dragRebound")}};return a.useEffect(function(){var O;return n&&e&&(O=be(window,"touchmove",function(u){return u.preventDefault()},{passive:!1})),function(){var u;(u=O)===null||u===void 0||u.remove()}},[n,e]),{isTouching:g,onTouchStart:S,onTouchMove:$,onTouchEnd:R}}var Zt=["fallback","src","imgRef"],Bt=["prefixCls","src","alt","imageInfo","fallback","movable","onClose","visible","icons","rootClassName","closeIcon","getContainer","current","count","countRender","scaleStep","minScale","maxScale","transitionName","maskTransitionName","imageRender","imgCommonProps","toolbarRender","onTransform","onChange"],Ht=function(e){var n=e.fallback,o=e.src,r=e.imgRef,i=xe(e,Zt),c=at({src:o,fallback:n}),l=D(c,2),d=l[0],f=l[1];return we.createElement("img",he({ref:function(s){r.current=s,d(s)}},i,f))},it=function(e){var n=e.prefixCls,o=e.src,r=e.alt,i=e.imageInfo,c=e.fallback,l=e.movable,d=l===void 0?!0:l,f=e.onClose,m=e.visible,s=e.icons,b=s===void 0?{}:s,g=e.rootClassName,h=e.closeIcon,y=e.getContainer,C=e.current,S=C===void 0?0:C,$=e.count,R=$===void 0?1:$,O=e.countRender,u=e.scaleStep,x=u===void 0?.5:u,p=e.minScale,v=p===void 0?1:p,I=e.maxScale,M=I===void 0?50:I,w=e.transitionName,N=w===void 0?"zoom":w,j=e.maskTransitionName,P=j===void 0?"fade":j,Y=e.imageRender,H=e.imgCommonProps,W=e.toolbarRender,V=e.onTransform,Q=e.onChange,B=xe(e,Bt),G=a.useRef(),q=a.useContext(Me),F=q&&R>1,re=q&&R>=1,J=a.useState(!0),k=D(J,2),ae=k[0],ee=k[1],U=kt(G,v,M,V),T=U.transform,ne=U.resetTransform,X=U.updateTransform,K=U.dispatchZoomChange,oe=At(G,d,m,x,T,X,K),le=oe.isMoving,L=oe.onMouseDown,z=oe.onWheel,_=Xt(G,d,m,v,T,X,K),Z=_.isTouching,A=_.onTouchStart,de=_.onTouchMove,pe=_.onTouchEnd,se=T.rotate,ce=T.scale,ze=ge(ie({},"".concat(n,"-moving"),le));a.useEffect(function(){ae||ee(!0)},[ae]);var _e=function(){ne("close")},ke=function(){K(Se+x,"zoomIn")},fe=function(){K(Se/(Se+x),"zoomOut")},ve=function(){X({rotate:se+90},"rotateRight")},Oe=function(){X({rotate:se-90},"rotateLeft")},Re=function(){X({flipX:!T.flipX},"flipX")},$e=function(){X({flipY:!T.flipY},"flipY")},ut=function(){ne("reset")},je=function(me){var Ee=S+me;!Number.isInteger(Ee)||Ee<0||Ee>R-1||(ee(!1),ne(me<0?"prev":"next"),Q==null||Q(Ee,S))},dt=function(me){!m||!F||(me.keyCode===De.LEFT?je(-1):me.keyCode===De.RIGHT&&je(1))},ft=function(me){m&&(ce!==1?X({x:0,y:0,scale:1},"doubleClick"):K(Se+x,"doubleClick",me.clientX,me.clientY))};a.useEffect(function(){var te=be(window,"keydown",dt,!1);return function(){te.remove()}},[m,F,S]);var We=we.createElement(Ht,he({},H,{width:e.width,height:e.height,imgRef:G,className:"".concat(n,"-img"),alt:r,style:{transform:"translate3d(".concat(T.x,"px, ").concat(T.y,"px, 0) scale3d(").concat(T.flipX?"-":"").concat(ce,", ").concat(T.flipY?"-":"").concat(ce,", 1) rotate(").concat(se,"deg)"),transitionDuration:(!ae||Z)&&"0s"},fallback:c,src:o,onWheel:z,onMouseDown:L,onDoubleClick:ft,onTouchStart:A,onTouchMove:de,onTouchEnd:pe,onTouchCancel:pe})),Ve=E({url:o,alt:r},i);return we.createElement(we.Fragment,null,we.createElement(wt,he({transitionName:N,maskTransitionName:P,closable:!1,keyboard:!0,prefixCls:n,onClose:f,visible:m,classNames:{wrapper:ze},rootClassName:g,getContainer:y},B,{afterClose:_e}),we.createElement("div",{className:"".concat(n,"-img-wrapper")},Y?Y(We,E({transform:T,image:Ve},q?{current:S}:{})):We)),we.createElement(_t,{visible:m,transform:T,maskTransitionName:P,closeIcon:h,getContainer:y,prefixCls:n,rootClassName:g,icons:b,countRender:O,showSwitch:F,showProgress:re,current:S,count:R,scale:ce,minScale:v,maxScale:M,toolbarRender:W,onActive:je,onZoomIn:ke,onZoomOut:fe,onRotateRight:ve,onRotateLeft:Oe,onFlipX:Re,onFlipY:$e,onClose:f,onReset:ut,zIndex:B.zIndex!==void 0?B.zIndex+1:void 0,image:Ve}))},Xe=["crossOrigin","decoding","draggable","loading","referrerPolicy","sizes","srcSet","useMap","alt"];function Wt(t){var e=a.useState({}),n=D(e,2),o=n[0],r=n[1],i=a.useCallback(function(l,d){return r(function(f){return E(E({},f),{},ie({},l,d))}),function(){r(function(f){var m=E({},f);return delete m[l],m})}},[]),c=a.useMemo(function(){return t?t.map(function(l){if(typeof l=="string")return{data:{src:l}};var d={};return Object.keys(l).forEach(function(f){["src"].concat(Ct(Xe)).includes(f)&&(d[f]=l[f])}),{data:d}}):Object.keys(o).reduce(function(l,d){var f=o[d],m=f.canPreview,s=f.data;return m&&l.push({data:s,id:d}),l},[])},[t,o]);return[c,i,!!t]}var Vt=["visible","onVisibleChange","getContainer","current","movable","minScale","maxScale","countRender","closeIcon","onChange","onTransform","toolbarRender","imageRender"],Gt=["src"],Ft=function(e){var n,o=e.previewPrefixCls,r=o===void 0?"rc-image-preview":o,i=e.children,c=e.icons,l=c===void 0?{}:c,d=e.items,f=e.preview,m=e.fallback,s=et(f)==="object"?f:{},b=s.visible,g=s.onVisibleChange,h=s.getContainer,y=s.current,C=s.movable,S=s.minScale,$=s.maxScale,R=s.countRender,O=s.closeIcon,u=s.onChange,x=s.onTransform,p=s.toolbarRender,v=s.imageRender,I=xe(s,Vt),M=Wt(d),w=D(M,3),N=w[0],j=w[1],P=w[2],Y=Ye(0,{value:y}),H=D(Y,2),W=H[0],V=H[1],Q=a.useState(!1),B=D(Q,2),G=B[0],q=B[1],F=((n=N[W])===null||n===void 0?void 0:n.data)||{},re=F.src,J=xe(F,Gt),k=Ye(!!b,{value:b,onChange:function(Z,A){g==null||g(Z,A,W)}}),ae=D(k,2),ee=ae[0],U=ae[1],T=a.useState(null),ne=D(T,2),X=ne[0],K=ne[1],oe=a.useCallback(function(_,Z,A,de){var pe=P?N.findIndex(function(se){return se.data.src===Z}):N.findIndex(function(se){return se.id===_});V(pe<0?0:pe),U(!0),K({x:A,y:de}),q(!0)},[N,P]);a.useEffect(function(){ee?G||V(0):q(!1)},[ee]);var le=function(Z,A){V(Z),u==null||u(Z,A)},L=function(){U(!1),K(null)},z=a.useMemo(function(){return{register:j,onPreview:oe}},[j,oe]);return a.createElement(Me.Provider,{value:z},i,a.createElement(it,he({"aria-hidden":!ee,movable:C,visible:ee,prefixCls:r,closeIcon:O,onClose:L,mousePosition:X,imgCommonProps:J,src:re,fallback:m,icons:l,minScale:S,maxScale:$,getContainer:h,current:W,count:N.length,countRender:R,onTransform:x,toolbarRender:p,imageRender:v,onChange:le},I)))},Ke=0;function Ut(t,e){var n=a.useState(function(){return Ke+=1,String(Ke)}),o=D(n,1),r=o[0],i=a.useContext(Me),c={data:e,canPreview:t};return a.useEffect(function(){if(i)return i.register(r,c)},[]),a.useEffect(function(){i&&i.register(r,c)},[t,e]),r}var Kt=["src","alt","onPreviewClose","prefixCls","previewPrefixCls","placeholder","fallback","width","height","style","preview","className","onClick","onError","wrapperClassName","wrapperStyle","rootClassName"],Qt=["src","visible","onVisibleChange","getContainer","mask","maskClassName","movable","icons","scaleStep","minScale","maxScale","imageRender","toolbarRender"],He=function(e){var n=e.src,o=e.alt,r=e.onPreviewClose,i=e.prefixCls,c=i===void 0?"rc-image":i,l=e.previewPrefixCls,d=l===void 0?"".concat(c,"-preview"):l,f=e.placeholder,m=e.fallback,s=e.width,b=e.height,g=e.style,h=e.preview,y=h===void 0?!0:h,C=e.className,S=e.onClick,$=e.onError,R=e.wrapperClassName,O=e.wrapperStyle,u=e.rootClassName,x=xe(e,Kt),p=f&&f!==!0,v=et(y)==="object"?y:{},I=v.src,M=v.visible,w=M===void 0?void 0:M,N=v.onVisibleChange,j=N===void 0?r:N,P=v.getContainer,Y=P===void 0?void 0:P,H=v.mask,W=v.maskClassName,V=v.movable,Q=v.icons,B=v.scaleStep,G=v.minScale,q=v.maxScale,F=v.imageRender,re=v.toolbarRender,J=xe(v,Qt),k=I??n,ae=Ye(!!w,{value:w,onChange:j}),ee=D(ae,2),U=ee[0],T=ee[1],ne=at({src:n,isCustomPlaceholder:p,fallback:m}),X=D(ne,3),K=X[0],oe=X[1],le=X[2],L=a.useState(null),z=D(L,2),_=z[0],Z=z[1],A=a.useContext(Me),de=!!y,pe=function(){T(!1),Z(null)},se=ge(c,R,u,ie({},"".concat(c,"-error"),le==="error")),ce=a.useMemo(function(){var fe={};return Xe.forEach(function(ve){e[ve]!==void 0&&(fe[ve]=e[ve])}),fe},Xe.map(function(fe){return e[fe]})),ze=a.useMemo(function(){return E(E({},ce),{},{src:k})},[k,ce]),_e=Ut(de,ze),ke=function(ve){var Oe=zt(ve.target),Re=Oe.left,$e=Oe.top;A?A.onPreview(_e,k,Re,$e):(Z({x:Re,y:$e}),T(!0)),S==null||S(ve)};return a.createElement(a.Fragment,null,a.createElement("div",he({},x,{className:se,onClick:de?ke:S,style:E({width:s,height:b},O)}),a.createElement("img",he({},ce,{className:ge("".concat(c,"-img"),ie({},"".concat(c,"-img-placeholder"),f===!0),C),style:E({height:b},g),ref:K},oe,{width:s,height:b,onError:$})),le==="loading"&&a.createElement("div",{"aria-hidden":"true",className:"".concat(c,"-placeholder")},f),H&&de&&a.createElement("div",{className:ge("".concat(c,"-mask"),W),style:{display:(g==null?void 0:g.display)==="none"?"none":void 0}},H)),!A&&de&&a.createElement(it,he({"aria-hidden":!U,visible:U,prefixCls:d,onClose:pe,mousePosition:_,src:k,alt:o,imageInfo:{width:s,height:b},fallback:m,getContainer:Y,icons:Q,movable:V,scaleStep:B,minScale:G,maxScale:q,rootClassName:u,imageRender:F,imgCommonProps:ce,toolbarRender:re},J)))};He.PreviewGroup=Ft;var qt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M672 418H144c-17.7 0-32 14.3-32 32v414c0 17.7 14.3 32 32 32h528c17.7 0 32-14.3 32-32V450c0-17.7-14.3-32-32-32zm-44 402H188V494h440v326z"}},{tag:"path",attrs:{d:"M819.3 328.5c-78.8-100.7-196-153.6-314.6-154.2l-.2-64c0-6.5-7.6-10.1-12.6-6.1l-128 101c-4 3.1-3.9 9.1 0 12.3L492 318.6c5.1 4 12.7.4 12.6-6.1v-63.9c12.9.1 25.9.9 38.8 2.5 42.1 5.2 82.1 18.2 119 38.7 38.1 21.2 71.2 49.7 98.4 84.3 27.1 34.7 46.7 73.7 58.1 115.8a325.95 325.95 0 016.5 140.9h74.9c14.8-103.6-11.3-213-81-302.3z"}}]},name:"rotate-left",theme:"outlined"};const Jt=qt;var en=function(e,n){return a.createElement(Ie,ye({},e,{ref:n,icon:Jt}))},tn=a.forwardRef(en);const nn=tn;var on={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M480.5 251.2c13-1.6 25.9-2.4 38.8-2.5v63.9c0 6.5 7.5 10.1 12.6 6.1L660 217.6c4-3.2 4-9.2 0-12.3l-128-101c-5.1-4-12.6-.4-12.6 6.1l-.2 64c-118.6.5-235.8 53.4-314.6 154.2A399.75 399.75 0 00123.5 631h74.9c-.9-5.3-1.7-10.7-2.4-16.1-5.1-42.1-2.1-84.1 8.9-124.8 11.4-42.2 31-81.1 58.1-115.8 27.2-34.7 60.3-63.2 98.4-84.3 37-20.6 76.9-33.6 119.1-38.8z"}},{tag:"path",attrs:{d:"M880 418H352c-17.7 0-32 14.3-32 32v414c0 17.7 14.3 32 32 32h528c17.7 0 32-14.3 32-32V450c0-17.7-14.3-32-32-32zm-44 402H396V494h440v326z"}}]},name:"rotate-right",theme:"outlined"};const rn=on;var an=function(e,n){return a.createElement(Ie,ye({},e,{ref:n,icon:rn}))},ln=a.forwardRef(an);const sn=ln;var cn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M847.9 592H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h605.2L612.9 851c-4.1 5.2-.4 13 6.3 13h72.5c4.9 0 9.5-2.2 12.6-6.1l168.8-214.1c16.5-21 1.6-51.8-25.2-51.8zM872 356H266.8l144.3-183c4.1-5.2.4-13-6.3-13h-72.5c-4.9 0-9.5 2.2-12.6 6.1L150.9 380.2c-16.5 21-1.6 51.8 25.1 51.8h696c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}}]},name:"swap",theme:"outlined"};const un=cn;var dn=function(e,n){return a.createElement(Ie,ye({},e,{ref:n,icon:un}))},fn=a.forwardRef(dn);const Qe=fn;var vn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M637 443H519V309c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v134H325c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h118v134c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V519h118c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zm284 424L775 721c122.1-148.9 113.6-369.5-26-509-148-148.1-388.4-148.1-537 0-148.1 148.6-148.1 389 0 537 139.5 139.6 360.1 148.1 509 26l146 146c3.2 2.8 8.3 2.8 11 0l43-43c2.8-2.7 2.8-7.8 0-11zM696 696c-118.8 118.7-311.2 118.7-430 0-118.7-118.8-118.7-311.2 0-430 118.8-118.7 311.2-118.7 430 0 118.7 118.8 118.7 311.2 0 430z"}}]},name:"zoom-in",theme:"outlined"};const mn=vn;var gn=function(e,n){return a.createElement(Ie,ye({},e,{ref:n,icon:mn}))},hn=a.forwardRef(gn);const pn=hn;var wn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M637 443H325c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h312c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zm284 424L775 721c122.1-148.9 113.6-369.5-26-509-148-148.1-388.4-148.1-537 0-148.1 148.6-148.1 389 0 537 139.5 139.6 360.1 148.1 509 26l146 146c3.2 2.8 8.3 2.8 11 0l43-43c2.8-2.7 2.8-7.8 0-11zM696 696c-118.8 118.7-311.2 118.7-430 0-118.7-118.8-118.7-311.2 0-430 118.8-118.7 311.2-118.7 430 0 118.7 118.8 118.7 311.2 0 430z"}}]},name:"zoom-out",theme:"outlined"};const Cn=wn;var bn=function(e,n){return a.createElement(Ie,ye({},e,{ref:n,icon:Cn}))},Sn=a.forwardRef(bn);const xn=Sn,Ze=t=>({position:t||"absolute",inset:0}),In=t=>{const{iconCls:e,motionDurationSlow:n,paddingXXS:o,marginXXS:r,prefixCls:i,colorTextLightSolid:c}=t;return{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",color:c,background:new Ce("#000").setAlpha(.5).toRgbString(),cursor:"pointer",opacity:0,transition:`opacity ${n}`,[`.${i}-mask-info`]:Object.assign(Object.assign({},It),{padding:`0 ${ue(o)}`,[e]:{marginInlineEnd:r,svg:{verticalAlign:"baseline"}}})}},yn=t=>{const{previewCls:e,modalMaskBg:n,paddingSM:o,marginXL:r,margin:i,paddingLG:c,previewOperationColorDisabled:l,previewOperationHoverColor:d,motionDurationSlow:f,iconCls:m,colorTextLightSolid:s}=t,b=new Ce(n).setAlpha(.1),g=b.clone().setAlpha(.2);return{[`${e}-footer`]:{position:"fixed",bottom:r,left:{_skip_check_:!0,value:"50%"},display:"flex",flexDirection:"column",alignItems:"center",color:t.previewOperationColor,transform:"translateX(-50%)"},[`${e}-progress`]:{marginBottom:i},[`${e}-close`]:{position:"fixed",top:r,right:{_skip_check_:!0,value:r},display:"flex",color:s,backgroundColor:b.toRgbString(),borderRadius:"50%",padding:o,outline:0,border:0,cursor:"pointer",transition:`all ${f}`,"&:hover":{backgroundColor:g.toRgbString()},[`& > ${m}`]:{fontSize:t.previewOperationSize}},[`${e}-operations`]:{display:"flex",alignItems:"center",padding:`0 ${ue(c)}`,backgroundColor:b.toRgbString(),borderRadius:100,"&-operation":{marginInlineStart:o,padding:o,cursor:"pointer",transition:`all ${f}`,userSelect:"none",[`&:not(${e}-operations-operation-disabled):hover > ${m}`]:{color:d},"&-disabled":{color:l,cursor:"not-allowed"},"&:first-of-type":{marginInlineStart:0},[`& > ${m}`]:{fontSize:t.previewOperationSize}}}}},Mn=t=>{const{modalMaskBg:e,iconCls:n,previewOperationColorDisabled:o,previewCls:r,zIndexPopup:i,motionDurationSlow:c}=t,l=new Ce(e).setAlpha(.1),d=l.clone().setAlpha(.2);return{[`${r}-switch-left, ${r}-switch-right`]:{position:"fixed",insetBlockStart:"50%",zIndex:t.calc(i).add(1).equal(),display:"flex",alignItems:"center",justifyContent:"center",width:t.imagePreviewSwitchSize,height:t.imagePreviewSwitchSize,marginTop:t.calc(t.imagePreviewSwitchSize).mul(-1).div(2).equal(),color:t.previewOperationColor,background:l.toRgbString(),borderRadius:"50%",transform:"translateY(-50%)",cursor:"pointer",transition:`all ${c}`,userSelect:"none","&:hover":{background:d.toRgbString()},"&-disabled":{"&, &:hover":{color:o,background:"transparent",cursor:"not-allowed",[`> ${n}`]:{cursor:"not-allowed"}}},[`> ${n}`]:{fontSize:t.previewOperationSize}},[`${r}-switch-left`]:{insetInlineStart:t.marginSM},[`${r}-switch-right`]:{insetInlineEnd:t.marginSM}}},On=t=>{const{motionEaseOut:e,previewCls:n,motionDurationSlow:o,componentCls:r}=t;return[{[`${r}-preview-root`]:{[n]:{height:"100%",textAlign:"center",pointerEvents:"none"},[`${n}-body`]:Object.assign(Object.assign({},Ze()),{overflow:"hidden"}),[`${n}-img`]:{maxWidth:"100%",maxHeight:"70%",verticalAlign:"middle",transform:"scale3d(1, 1, 1)",cursor:"grab",transition:`transform ${o} ${e} 0s`,userSelect:"none","&-wrapper":Object.assign(Object.assign({},Ze()),{transition:`transform ${o} ${e} 0s`,display:"flex",justifyContent:"center",alignItems:"center","& > *":{pointerEvents:"auto"},"&::before":{display:"inline-block",width:1,height:"50%",marginInlineEnd:-1,content:'""'}})},[`${n}-moving`]:{[`${n}-preview-img`]:{cursor:"grabbing","&-wrapper":{transitionDuration:"0s"}}}}},{[`${r}-preview-root`]:{[`${n}-wrap`]:{zIndex:t.zIndexPopup}}},{[`${r}-preview-operations-wrapper`]:{position:"fixed",zIndex:t.calc(t.zIndexPopup).add(1).equal()},"&":[yn(t),Mn(t)]}]},Rn=t=>{const{componentCls:e}=t;return{[e]:{position:"relative",display:"inline-block",[`${e}-img`]:{width:"100%",height:"auto",verticalAlign:"middle"},[`${e}-img-placeholder`]:{backgroundColor:t.colorBgContainerDisabled,backgroundImage:"url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMTQuNSAyLjVoLTEzQS41LjUgMCAwIDAgMSAzdjEwYS41LjUgMCAwIDAgLjUuNWgxM2EuNS41IDAgMCAwIC41LS41VjNhLjUuNSAwIDAgMC0uNS0uNXpNNS4yODEgNC43NWExIDEgMCAwIDEgMCAyIDEgMSAwIDAgMSAwLTJ6bTguMDMgNi44M2EuMTI3LjEyNyAwIDAgMS0uMDgxLjAzSDIuNzY5YS4xMjUuMTI1IDAgMCAxLS4wOTYtLjIwN2wyLjY2MS0zLjE1NmEuMTI2LjEyNiAwIDAgMSAuMTc3LS4wMTZsLjAxNi4wMTZMNy4wOCAxMC4wOWwyLjQ3LTIuOTNhLjEyNi4xMjYgMCAwIDEgLjE3Ny0uMDE2bC4wMTUuMDE2IDMuNTg4IDQuMjQ0YS4xMjcuMTI3IDAgMCAxLS4wMi4xNzV6IiBmaWxsPSIjOEM4QzhDIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L3N2Zz4=')",backgroundRepeat:"no-repeat",backgroundPosition:"center center",backgroundSize:"30%"},[`${e}-mask`]:Object.assign({},In(t)),[`${e}-mask:hover`]:{opacity:1},[`${e}-placeholder`]:Object.assign({},Ze())}}},$n=t=>{const{previewCls:e}=t;return{[`${e}-root`]:St(t,"zoom"),"&":xt(t,!0)}},En=t=>({zIndexPopup:t.zIndexPopupBase+80,previewOperationColor:new Ce(t.colorTextLightSolid).setAlpha(.65).toRgbString(),previewOperationHoverColor:new Ce(t.colorTextLightSolid).setAlpha(.85).toRgbString(),previewOperationColorDisabled:new Ce(t.colorTextLightSolid).setAlpha(.25).toRgbString(),previewOperationSize:t.fontSizeIcon*1.5}),lt=Je("Image",t=>{const e=`${t.componentCls}-preview`,n=Ae(t,{previewCls:e,modalMaskBg:new Ce("#000").setAlpha(.45).toRgbString(),imagePreviewSwitchSize:t.controlHeightLG});return[Rn(n),On(n),bt(Ae(n,{componentCls:e})),$n(n)]},En);var Nn=globalThis&&globalThis.__rest||function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(n[o[r]]=t[o[r]]);return n};const st={rotateLeft:a.createElement(nn,null),rotateRight:a.createElement(sn,null),zoomIn:a.createElement(pn,null),zoomOut:a.createElement(xn,null),close:a.createElement(yt,null),left:a.createElement(Mt,null),right:a.createElement(Ot,null),flipX:a.createElement(Qe,null),flipY:a.createElement(Qe,{rotate:90})},Pn=t=>{var{previewPrefixCls:e,preview:n}=t,o=Nn(t,["previewPrefixCls","preview"]);const{getPrefixCls:r}=a.useContext(Be),i=r("image",e),c=`${i}-preview`,l=r(),d=tt(i),[f,m,s]=lt(i,d),[b]=nt("ImagePreview",typeof n=="object"?n.zIndex:void 0),g=a.useMemo(()=>{var h;if(n===!1)return n;const y=typeof n=="object"?n:{},C=Pe(m,s,d,(h=y.rootClassName)!==null&&h!==void 0?h:"");return Object.assign(Object.assign({},y),{transitionName:Te(l,"zoom",y.transitionName),maskTransitionName:Te(l,"fade",y.maskTransitionName),rootClassName:C,zIndex:b})},[n]);return f(a.createElement(He.PreviewGroup,Object.assign({preview:g,previewPrefixCls:c,icons:st},o)))},Tn=Pn;var qe=globalThis&&globalThis.__rest||function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(n[o[r]]=t[o[r]]);return n};const ct=t=>{var e;const{prefixCls:n,preview:o,className:r,rootClassName:i,style:c}=t,l=qe(t,["prefixCls","preview","className","rootClassName","style"]),{getPrefixCls:d,locale:f=Fe,getPopupContainer:m,image:s}=a.useContext(Be),b=d("image",n),g=d(),h=f.Image||Fe.Image,y=tt(b),[C,S,$]=lt(b,y),R=Pe(i,S,$,y),O=Pe(r,S,s==null?void 0:s.className),[u]=nt("ImagePreview",typeof o=="object"?o.zIndex:void 0),x=a.useMemo(()=>{var v;if(o===!1)return o;const I=typeof o=="object"?o:{},{getContainer:M,closeIcon:w}=I,N=qe(I,["getContainer","closeIcon"]);return Object.assign(Object.assign({mask:a.createElement("div",{className:`${b}-mask-info`},a.createElement($t,null),h==null?void 0:h.preview),icons:st},N),{getContainer:M??m,transitionName:Te(g,"zoom",I.transitionName),maskTransitionName:Te(g,"fade",I.maskTransitionName),zIndex:u,closeIcon:w??((v=s==null?void 0:s.preview)===null||v===void 0?void 0:v.closeIcon)})},[o,h,(e=s==null?void 0:s.preview)===null||e===void 0?void 0:e.closeIcon]),p=Object.assign(Object.assign({},s==null?void 0:s.style),c);return C(a.createElement(He,Object.assign({prefixCls:b,preview:x,rootClassName:R,className:O,style:p},l)))};ct.PreviewGroup=Tn;const Dn=ct;var Ln={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"}}]},name:"loading",theme:"outlined"};const zn=Ln;var _n=function(e,n){return a.createElement(Rt,he({},e,{ref:n,icon:zn}))};const Yn=a.forwardRef(_n);export{An as D,Dn as I,Yn as L};