"use strict";(self.webpackChunkportal_ui=self.webpackChunkportal_ui||[]).push([[2185],{62185:function(e,t,n){n.r(t);var r=n(29439),a=n(1413),i=n(72791),o=n(16871),s=n(56028),l=n(61889),c=n(36151),d=n(21435),u=n(11135),h=n(25787),f=n(23814),m=n(60364),x=n(45248),p=n(38734),j=n(25469),Z=n(87995),v=n(80184),w=(0,m.$j)((function(e){return{simplePath:e.objectBrowser.simplePath}}));t.default=w((0,h.Z)((function(e){return(0,u.Z)((0,a.Z)((0,a.Z)({},f.ID),f.DF))}))((function(e){var t=e.modalOpen,n=(e.folderName,e.bucketName),a=e.onClose,u=e.classes,h=e.existingFiles,f=e.simplePath,m=(0,j.TL)(),w=(0,o.s0)(),P=(0,i.useState)(""),b=(0,r.Z)(P,2),C=b[0],g=b[1],k=(0,i.useState)(!1),F=(0,r.Z)(k,2),y=F[0],N=F[1],E=(0,i.useState)(n),S=(0,r.Z)(E,2),B=S[0],I=S[1];(0,i.useEffect)((function(){if(f){var e="".concat(n).concat(n.endsWith("/")||f.startsWith("/")?"":"/").concat(f);I(e)}}),[f,n]);var L=function(){var e="/";f&&(e=f.endsWith("/")?f:"".concat(f,"/"));if(-1===h.findIndex((function(t){return t.name===e+C}))){var t=C.split("/").filter((function(e){return""!==e.trim()})).join("/"),r="/buckets/".concat(n,"/browse/").concat((0,x.LL)("".concat(e).concat(t,"/")));w(r),a()}else m((0,Z.zb)({errorMessage:"Folder cannot have the same name as an existing file",detailedError:""}))};(0,i.useEffect)((function(){var e=!0;0===C.trim().length&&(e=!1),N(e)}),[C]);return(0,v.jsx)(i.Fragment,{children:(0,v.jsx)(s.Z,{modalOpen:t,title:"Choose or create a new path",onClose:a,titleIcon:(0,v.jsx)(p.Z9m,{}),children:(0,v.jsxs)(l.ZP,{container:!0,children:[(0,v.jsxs)(l.ZP,{item:!0,xs:12,className:u.formFieldRow,children:[(0,v.jsx)("strong",{children:"Current Path:"})," ",(0,v.jsx)("br",{}),(0,v.jsx)("div",{style:{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",fontSize:14,textAlign:"left"},dir:"rtl",children:B})]}),(0,v.jsx)(l.ZP,{item:!0,xs:12,className:u.formFieldRow,children:(0,v.jsx)(d.Z,{value:C,label:"New Folder Path",id:"folderPath",name:"folderPath",placeholder:"Enter the new Folder Path",onChange:function(e){g(e.target.value)},onKeyPress:function(e){"Enter"===e.code&&""!==C&&L()},required:!0})}),(0,v.jsxs)(l.ZP,{item:!0,xs:12,className:u.modalButtonBar,children:[(0,v.jsx)(c.Z,{type:"button",color:"primary",variant:"outlined",onClick:function(){g("")},children:"Clear"}),(0,v.jsx)(c.Z,{type:"submit",variant:"contained",color:"primary",disabled:!y,onClick:L,children:"Create"})]})]})})})})))}}]);
//# sourceMappingURL=2185.c6714d7f.chunk.js.map