1import{U as h,aa as C,ab as y,r as e,a8 as m,ac as u,a7 as E,c as v,W as L,w as S,a as b,ad as w}from"./index-BSt2sIrA.js";import{h as V}from"./access-BrW1VcMD.js";import{i as k,g as x,a as A,t as _,V as N}from"./role-Dd6a1een.js";import{g as T}from"./getCheckedByDefault-BJO2jfjD.js";import{t as M}from"./trimValues-9ODeiq0V.js";import{c as O}from"./Partner-CPPQP4zo.js";import"./TextareaInput-BoLa_kdj.js";import"./hasAllRequired-ZDFqBsdl.js";const j=()=>{const{t:a}=h(),o=C(),{isLoading:i,isVaioPartner:n}=y(),[t,c]=e.useState({name:"",description:"",permissions:[]}),[d,p]=e.useState([]),[f,r]=e.useState(!0),g=e.useMemo(()=>!k(t),[t]),l=e.useCallback(async()=>{r(!0);try{const s=await x({isPartner:!0,isVaioPartner:n});p(A(s)),c({name:"",description:"",permissions:T(s)})}catch(s){m(a(s.message,s.tOptions))}finally{r(!1)}},[n,a]),R=e.useCallback(async()=>{r(!0);try{await O({role:M(t,_)}),o(`/${u.roles}`),setTimeout(()=>{E("add-role__success--created")},1e3)}catch(s){m(a(s.message,s.tOptions))}finally{r(!1)}},[t,o,a]),P=e.useCallback(()=>{o(`/${u.roles}`)},[o]);return e.useEffect(()=>{i||l()},[i,l]),{title:a("roles__create-role-btn"),role:t,permissions:d,isLoading:f,isSaveButtonDisabled:g,hasRemove:!1,onRoleChange:c,onCancel:P,onSave:R}},B=()=>{const a=j();return L.jsx(N,{...a})},z=v(S(),b,w({checkAccess:()=>V}))(B);export{B as CreateRoleComponent,z as PartnerCreateRole};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.