import{L as u,e3 as F,ao as a,ck as x,bU as n,aI as f,b0 as y,bc as P,az as S,f7 as C,aF as j,o as w,p as b,W as g,r as k,E as R}from"./app-k0jcl5PQ.js";import{F as v}from"./C3DvQ1wU.chunk.js";import{u as L}from"./BCc8At9P.chunk.js";import{M as A}from"./BKH_iZiB.chunk.js";import{l as m}from"./DLmnDxSd.chunk.js";import{F as V}from"./DV1GpLCe.chunk.js";import"./CW7x8M-z.chunk.js";import"./Di9d6zcy.chunk.js";import"./CKctgafI.chunk.js";const q="myVideos.renameFolder",s=u.encloseNamespace(q),E=m.object().shape({name:m.string().required(()=>s("nameRequired")).max(255,()=>s("maxNameLength"))});function M(e){const t=F();return a.jsxs(x,{children:[a.jsx(V,{label:s("name"),type:"text",name:"name",id:"name",placeholder:s("placeholder"),autoFocus:!0,value:t.values.name,required:!0}),a.jsxs(n,{children:[a.jsx(n.Cancel,{onClick:e.onClickCancel}),a.jsx(n.Submit,{variant:"dark",showSpinner:e.showSpinner,text:s("renameFolder")})]})]})}const N="myVideos.renameFolder",r=u.encloseNamespace(N);function I(e){const[t,d]=f.useState(!1),p=y(),i=P(),o=S(C.folder(e.id));L(o.statusCode);async function h(l){d(!0);try{await p(A.updateFolder(o.data.id,l.name)),i.success(r("success")),e.closePopup(),w.logUserAction({id:o.data.id,name:l.name,oldName:o.data.name},{entity:R.Folder,actionType:k.Rename,workflowPhase:g.Complete,location:b.Popup})}catch{i.success(r("error")),e.closePopup()}}const c=o.hasCompleted;return a.jsx(j,{title:r("title"),closePopup:e.closePopup,showLoadingSpinner:!c,children:c&&a.jsx(v,{initialValues:{name:o.data.name},validationSchema:E,onSubmit:h,validateOnMount:!0,children:a.jsx(M,{onClickCancel:e.closePopup,showSpinner:t})})})}export{I as RenameFolderView};
//# sourceMappingURL=EL_PH6Ih.chunk.js.map
