"use strict";(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[6844],{34463:(e,t,a)=>{a.r(t),a.d(t,{default:()=>u});var r=a(69060),s=a(51560),n=a(19536),l=a(66152),o=a(4836),i=a(61628),c=a(61060),d=a(66156),h=a(95705),p=a(82496);const u=(0,n.Ul)((e=>{let{objectBrowser:t}=e;return{simplePath:t.simplePath}}))((e=>{let{modalOpen:t,folderName:a,bucketName:u,onClose:m,simplePath:f,limitedSubPath:w}=e;const x=(0,d.Ab)(),b=(0,s.i6)(),[j,y]=(0,r.useState)(""),[v,C]=(0,r.useState)(!1),[P,g]=(0,r.useState)(u),k=(0,n.w1)((e=>e.objectBrowser.records));(0,r.useEffect)((()=>{if(f){const e="".concat(u).concat(u.endsWith("/")||f.startsWith("/")?"":"/").concat(f);g(e)}}),[f,u]);const q=()=>{let e="/";f&&(e=f.endsWith("/")?f:"".concat(f,"/"));if(-1!==k.findIndex((t=>t.name===e+j)))return void x((0,h.op)({errorMessage:"Folder cannot have the same name as an existing file",detailedError:""}));const t=j.split("/").filter((e=>""!==e.trim())).join("/");"/"===e.slice(0,1)&&(e=e.slice(1));const a="/browser/".concat(u,"/").concat((0,c.CO)("".concat(e).concat(t,"/")));b(a),m()};(0,r.useEffect)((()=>{let e=!0;0===j.trim().length&&(e=!1),C(e)}),[j]);return(0,p.jsx)(r.Fragment,{children:(0,p.jsx)(o.c,{modalOpen:t,title:"Choose or create a new path",onClose:m,titleIcon:(0,p.jsx)(l.Oy,{}),children:(0,p.jsxs)(l.yE_,{withBorders:!1,containerPadding:!1,children:[(0,p.jsxs)(l.kvh,{className:"inputItem",sx:{display:"flex",gap:8},children:[(0,p.jsx)("strong",{children:"Current Path:"})," ",(0,p.jsx)("br",{}),(0,p.jsx)(l.kvh,{sx:{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",fontSize:14,textAlign:"left"},dir:"rtl",children:P})]}),(0,p.jsx)(l.q22,{value:j,label:"New Folder Path",id:"folderPath",name:"folderPath",placeholder:"Enter the new Folder Path",onChange:e=>{y(e.target.value)},onKeyPress:e=>{"Enter"===e.code&&""!==j&&q()},required:!0,tooltip:w?"You may only have write access on a limited set of subpaths within this path. Please carefully review your User permissions to understand the paths to which you may write.":""}),(0,p.jsxs)(l.yeN,{item:!0,xs:12,sx:i.W2.modalButtonBar,children:[(0,p.jsx)(l.qaq,{id:"clear",type:"button",color:"primary",variant:"regular",onClick:()=>{y("")},label:"Clear"}),(0,p.jsx)(l.qaq,{id:"create",type:"submit",variant:"callAction",disabled:!v,onClick:q,label:"Create"})]})]})})})}))}}]);
//# sourceMappingURL=6844.fa78bce4.chunk.js.map