"use strict";(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[459],{10459:(e,t,a)=>{a.r(t),a.d(t,{default:()=>y});var n=a(65043),l=a(33097),r=a.n(l),s=a(89923),i=a(56629),o=a(53518),c=a(77403),d=a(56483),u=a(64159),h=a(21383),g=a(94141),p=a(96512),x=a(23758),m=a(70579);const y=e=>{let{open:t,closeModalAndRefresh:a,bucketName:l,setReplicationRules:y}=e;const v=(0,h.jL)(),[b,S]=(0,n.useState)(!1),[j,f]=(0,n.useState)("1"),[C,k]=(0,n.useState)(""),[A,R]=(0,n.useState)(""),[_,B]=(0,n.useState)(""),[D,w]=(0,n.useState)(""),[E,I]=(0,n.useState)(""),[M,L]=(0,n.useState)(""),[T,N]=(0,n.useState)(""),[O,K]=(0,n.useState)(!0),[U,P]=(0,n.useState)(!0),[F,q]=(0,n.useState)(!0),[z,G]=(0,n.useState)(!0),[V,H]=(0,n.useState)(""),[J,Y]=(0,n.useState)("async"),[W,$]=(0,n.useState)("100"),[X,Q]=(0,n.useState)("Gi"),[Z,ee]=(0,n.useState)("60");(0,n.useEffect)((()=>{if(0===y.length)return void f("1");const e=y.reduce(((e,t)=>t.priority>e?t.priority:e),0);f((e+1).toString())}),[y]);return(0,m.jsx)(g.A,{modalOpen:t,onClose:()=>{a()},title:"Set Bucket Replication",titleIcon:(0,m.jsx)(s.WBh,{}),children:(0,m.jsx)("form",{noValidate:!0,autoComplete:"off",onSubmit:e=>{e.preventDefault(),S(!0),(()=>{const e=[{originBucket:l,destinationBucket:M}],t=parseInt(Z),n="".concat(O?"https://":"http://").concat(_),s={accessKey:C,secretKey:A,targetURL:n,region:T,bucketsRelation:e,syncMode:J,bandwidth:"async"===J?parseInt((0,d.q5)(W,X,!0)):0,healthCheckPeriod:t,prefix:E,tags:V,replicateDeleteMarkers:U,replicateDeletes:F,priority:parseInt(j),storageClass:D,replicateMetadata:z};i.F.bucketsReplication.setMultiBucketReplication(s).then((e=>{S(!1);const t=r()(e.data,"replicationState",[]);if(t.length>0){const e=t[0];return S(!1),e.errorString&&""!==e.errorString?void v((0,u.Dy)({errorMessage:e.errorString,detailedError:""})):void a()}v((0,u.Dy)({errorMessage:"No changes applied",detailedError:""}))})).catch((e=>{S(!1),v((0,u.Dy)((0,o.S)(e.error)))}))})()},children:(0,m.jsxs)(s.Hbc,{withBorders:!1,containerPadding:!1,children:[(0,m.jsx)(s.cl_,{id:"priority",name:"priority",onChange:e=>{e.target.validity.valid&&f(e.target.value)},label:"Priority",value:j,pattern:"[0-9]*"}),(0,m.jsx)(s.cl_,{id:"targetURL",name:"targetURL",onChange:e=>{B(e.target.value)},placeholder:"play.min.io",label:"Target URL",value:_}),(0,m.jsx)(s.dOG,{checked:O,id:"useTLS",name:"useTLS",label:"Use TLS",onChange:e=>{K(e.target.checked)},value:"yes"}),(0,m.jsx)(s.cl_,{id:"accessKey",name:"accessKey",onChange:e=>{k(e.target.value)},label:"Access Key",value:C}),(0,m.jsx)(s.cl_,{id:"secretKey",name:"secretKey",onChange:e=>{R(e.target.value)},label:"Secret Key",value:A}),(0,m.jsx)(s.cl_,{id:"targetBucket",name:"targetBucket",onChange:e=>{L(e.target.value)},label:"Target Bucket",value:M}),(0,m.jsx)(s.cl_,{id:"region",name:"region",onChange:e=>{N(e.target.value)},label:"Region",value:T}),(0,m.jsx)(s.l6P,{id:"replication_mode",name:"replication_mode",onChange:e=>{Y(e)},label:"Replication Mode",value:J,options:[{label:"Asynchronous",value:"async"},{label:"Synchronous",value:"sync"}]}),"async"===J&&(0,m.jsx)(s.azJ,{className:"inputItem",children:(0,m.jsx)(s.cl_,{type:"number",id:"bandwidth_scalar",name:"bandwidth_scalar",onChange:e=>{e.target.validity.valid&&$(e.target.value)},label:"Bandwidth",value:W,min:"0",pattern:"[0-9]*",overlayObject:(0,m.jsx)(x.A,{id:"quota_unit",onUnitChange:e=>{Q(e)},unitSelected:X,unitsList:(0,d.l9)(["Ki"]),disabled:!1})})}),(0,m.jsx)(s.cl_,{id:"healthCheck",name:"healthCheck",onChange:e=>{ee(e.target.value)},label:"Health Check Duration",value:Z}),(0,m.jsx)(s.cl_,{id:"storageClass",name:"storageClass",onChange:e=>{w(e.target.value)},placeholder:"STANDARD_IA,REDUCED_REDUNDANCY etc",label:"Storage Class",value:D}),(0,m.jsxs)("fieldset",{className:"inputItem",children:[(0,m.jsx)("legend",{children:"Object Filters"}),(0,m.jsx)(s.cl_,{id:"prefix",name:"prefix",onChange:e=>{I(e.target.value)},placeholder:"prefix",label:"Prefix",value:E}),(0,m.jsx)(p.A,{name:"tags",label:"Tags",elements:"",onChange:e=>{H(e)},keyPlaceholder:"Tag Key",valuePlaceholder:"Tag Value",withBorder:!0})]}),(0,m.jsxs)("fieldset",{className:"inputItem",children:[(0,m.jsx)("legend",{children:"Replication Options"}),(0,m.jsx)(s.dOG,{checked:z,id:"metadatataSync",name:"metadatataSync",label:"Metadata Sync",onChange:e=>{G(e.target.checked)},description:"Metadata Sync"}),(0,m.jsx)(s.dOG,{checked:U,id:"deleteMarker",name:"deleteMarker",label:"Delete Marker",onChange:e=>{P(e.target.checked)},description:"Replicate soft deletes"}),(0,m.jsx)(s.dOG,{checked:F,id:"repDelete",name:"repDelete",label:"Deletes",onChange:e=>{q(e.target.checked)},description:"Replicate versioned deletes"})]}),(0,m.jsxs)(s.xA9,{item:!0,xs:12,sx:c.Uz.modalButtonBar,children:[(0,m.jsx)(s.$nd,{id:"cancel",type:"button",variant:"regular",disabled:b,onClick:()=>{a()},label:"Cancel"}),(0,m.jsx)(s.$nd,{id:"submit",type:"submit",variant:"callAction",color:"primary",disabled:b,label:"Save"})]})]})})})}},23758:(e,t,a)=>{a.d(t,{A:()=>d});var n=a(65043),l=a(89923),r=a(94574),s=a(33097),i=a.n(s),o=a(70579);const c=r.Ay.button((e=>{let{theme:t}=e;return{border:"1px solid ".concat(i()(t,"borderColor","#E2E2E2")),borderRadius:3,color:i()(t,"secondaryText","#5B5C5C"),backgroundColor:i()(t,"boxBackground","#FBFAFA"),fontSize:12}})),d=e=>{let{id:t,unitSelected:a,unitsList:r,disabled:s=!1,onUnitChange:i}=e;const[d,u]=n.useState(null),h=Boolean(d),g=e=>{u(null),""!==e&&i&&i(e)};return(0,o.jsxs)(n.Fragment,{children:[(0,o.jsx)(c,{id:"".concat(t,"-button"),"aria-controls":"".concat(t,"-menu"),"aria-haspopup":"true","aria-expanded":h?"true":void 0,onClick:e=>{u(e.currentTarget)},disabled:s,type:"button",children:a}),(0,o.jsx)(l.Vey,{id:"upload-main-menu",options:r,selectedOption:"",onSelect:e=>g(e),hideTriggerAction:()=>{g("")},open:h,anchorEl:d,anchorOrigin:"end"})]})}},96512:(e,t,a)=>{a.d(t,{A:()=>d});var n=a(65043),l=a(33097),r=a.n(l),s=a(93950),i=a.n(s),o=a(89923),c=a(70579);const d=e=>{let{elements:t,name:a,label:l,tooltip:s="",keyPlaceholder:d="",valuePlaceholder:u="",onChange:h,withBorder:g=!1}=e;const[p,x]=(0,n.useState)([""]),[m,y]=(0,n.useState)([""]),v=(0,n.createRef)();(0,n.useEffect)((()=>{if(1===p.length&&""===p[0]&&1===m.length&&""===m[0]&&t&&""!==t){const e=t.split("&");let a=[],n=[];e.forEach((e=>{const t=e.split("=");2===t.length&&(a.push(t[0]),n.push(t[1]))})),a.push(""),n.push(""),x(a),y(n)}}),[p,m,t]),(0,n.useEffect)((()=>{const e=v.current;e&&p.length>1&&e.scrollIntoView(!1)}),[p]);const b=(0,n.useRef)(!0);(0,n.useLayoutEffect)((()=>{b.current?b.current=!1:f()}),[p,m]);const S=e=>{e.persist();let t=[...p];const a=r()(e.target,"dataset.index","0");t[parseInt(a)]=e.target.value,x(t)},j=e=>{e.persist();let t=[...m];const a=r()(e.target,"dataset.index","0");t[parseInt(a)]=e.target.value,y(t)},f=i()((()=>{let e="";p.forEach(((t,a)=>{if(p[a]&&m[a]){let n="".concat(t,"=").concat(m[a]);0!==a&&(n="&".concat(n)),e="".concat(e).concat(n)}})),h(e)}),500),C=m.map(((e,t)=>(0,c.jsxs)(o.xA9,{item:!0,xs:12,className:"lineInputBoxes inputItem",children:[(0,c.jsx)(o.cl_,{id:"".concat(a,"-key-").concat(t.toString()),label:"",name:"".concat(a,"-").concat(t.toString()),value:p[t],onChange:S,index:t,placeholder:d}),(0,c.jsx)("span",{className:"queryDiv",children:":"}),(0,c.jsx)(o.cl_,{id:"".concat(a,"-value-").concat(t.toString()),label:"",name:"".concat(a,"-").concat(t.toString()),value:m[t],onChange:j,index:t,placeholder:u,overlayIcon:t===m.length-1?(0,c.jsx)(o.REV,{}):null,overlayAction:()=>{(()=>{if(""!==p[p.length-1].trim()&&""!==m[m.length-1].trim()){const e=[...p],t=[...m];e.push(""),t.push(""),x(e),y(t)}})()}})]},"query-pair-".concat(a,"-").concat(t.toString()))));return(0,c.jsx)(n.Fragment,{children:(0,c.jsxs)(o.xA9,{item:!0,xs:12,sx:{"& .lineInputBoxes":{display:"flex"},"& .queryDiv":{alignSelf:"center",margin:"-15px 4px 0",fontWeight:600}},className:"inputItem",children:[(0,c.jsxs)(o.l1Y,{children:[l,""!==s&&(0,c.jsx)(o.azJ,{sx:{marginLeft:5,display:"flex",alignItems:"center","& .min-icon":{width:13}},children:(0,c.jsx)(o.m_M,{tooltip:s,placement:"top",children:(0,c.jsx)(o.NTw,{style:{width:13,height:13}})})})]}),(0,c.jsxs)(o.azJ,{withBorders:g,sx:{padding:15,height:150,overflowY:"auto",position:"relative",marginTop:15},children:[C,(0,c.jsx)("div",{ref:v})]})]})})}},94141:(e,t,a)=>{a.d(t,{A:()=>d});var n=a(65043),l=a(22166),r=a(89923),s=a(21383),i=a(64159),o=a(49555),c=a(70579);const d=e=>{let{onClose:t,modalOpen:a,title:d,children:u,wideLimit:h=!0,titleIcon:g=null,iconColor:p="default",sx:x}=e;const m=(0,s.jL)(),[y,v]=(0,n.useState)(!1),b=(0,l.d4)((e=>e.system.modalSnackBar));(0,n.useEffect)((()=>{m((0,i.h0)(""))}),[m]),(0,n.useEffect)((()=>{if(b){if(""===b.message)return void v(!1);"error"!==b.type&&v(!0)}}),[b]);let S="";return b&&(S=b.detailedErrorMsg,(""===S||S&&S.length<5)&&(S=b.message)),(0,c.jsxs)(r.ngX,{onClose:t,open:a,title:d,titleIcon:g,widthLimit:h,sx:x,iconColor:p,children:[(0,c.jsx)(o.A,{isModal:!0}),(0,c.jsx)(r.qb_,{onClose:()=>{v(!1),m((0,i.h0)(""))},open:y,message:S,mode:"inline",variant:"error"===b.type?"error":"default",autoHideDuration:"error"===b.type?10:5,condensed:!0}),u]})}}}]); //# sourceMappingURL=459.f3b23f09.chunk.js.map