"use strict";(self.webpackChunkportal_ui=self.webpackChunkportal_ui||[]).push([[711],{50711:function(e,n,s){s.r(n);var t=s(29439),r=s(72791),o=s(9505),i=s(23508),l=s(29945),a=s(87995),c=s(81551),u=s(38442),d=s(56087),v=s(78687),b=s(80184);n.default=function(e){var n=e.closeDeleteModalAndRefresh,s=e.deleteOpen,h=e.selectedBucket,p=e.selectedObjects,f=e.versioning,j=(0,c.TL)(),g=(0,o.Z)((function(){return n(!0)}),(function(e){return j((0,a.Ih)(e))})),x=(0,t.Z)(g,2),m=x[0],y=x[1],C=(0,r.useState)(!1),T=(0,t.Z)(C,2),_=T[0],k=T[1],w=(0,r.useState)(!1),N=(0,t.Z)(w,2),O=N[0],S=N[1],A=(0,v.v9)((function(e){return e.objectBrowser.retentionConfig})),D=(0,u.F)([h],[d.Ft.S3_BYPASS_GOVERNANCE_RETENTION])&&"governance"===(null===A||void 0===A?void 0:A.mode);if(!p)return null;var F="Enabled"===(null===f||void 0===f?void 0:f.status)||"Suspended"===(null===f||void 0===f?void 0:f.status);return(0,b.jsx)(i.Z,{title:"Delete Objects",confirmText:"Delete",isOpen:s,titleIcon:(0,b.jsx)(l.NvT,{}),isLoading:m,onConfirm:function(){for(var e=[],n=0;n<p.length;n++)p[n].endsWith("/")?e.push({path:p[n],versionID:"",recursive:!0}):e.push({path:p[n],versionID:"",recursive:!1});e&&y("POST","/api/v1/buckets/".concat(h,"/delete-objects?all_versions=").concat(_).concat(O?"&bypass=true":""),e)},onClose:function(){return n(!1)},confirmationContent:(0,b.jsxs)(r.Fragment,{children:["Are you sure you want to delete the selected ",p.length," ","objects?"," ",F&&(0,b.jsxs)(r.Fragment,{children:[(0,b.jsx)("br",{}),(0,b.jsx)("br",{}),(0,b.jsx)(l.rsf,{label:"Delete All Versions",indicatorLabels:["Yes","No"],checked:_,value:"delete_versions",id:"delete-versions",name:"delete-versions",onChange:function(e){k(!_)},description:""}),D&&_&&(0,b.jsx)(r.Fragment,{children:(0,b.jsx)("div",{style:{marginTop:10},children:(0,b.jsx)(l.rsf,{label:"Bypass Governance Mode",indicatorLabels:["Yes","No"],checked:O,value:"bypass_governance",id:"bypass_governance",name:"bypass_governance",onChange:function(e){S(!O)},description:""})})}),_&&(0,b.jsxs)(r.Fragment,{children:[(0,b.jsxs)("div",{style:{marginTop:10,border:"#c83b51 1px solid",borderRadius:3,padding:5,backgroundColor:"#c83b5120",color:"#c83b51"},children:["This will remove the objects as well as all of their versions, ",(0,b.jsx)("br",{}),"This action is irreversible."]}),(0,b.jsx)("br",{}),"Are you sure you want to continue?"]})]})]})})}}}]);
//# sourceMappingURL=711.aec34a54.chunk.js.map