PageSourceSearch

https://video.envysion.com/ui/assets/index-11f08e5e.js

js envysion.com collected 2026-10-02 15:00:47 UTC 4,412 bytes, 2 lines download raw bytes

1import{a as i,r as d,aY as $,cG as B,t as F,v as L,j as e,x as q,D as R,y as E,cn as G,F as M,z as O,a2 as I,aC as z,aI as f,a1 as W,N as _,dl as b,aj as V,mx as k,my as j,M as Q,mz as Y}from"./index-06f33dcd.js";import{d as H}from"./PersonAddOutlined-25e1e075.js";import{P as J}from"./index-288a9f01.js";import{S as K}from"./index-ac753feb.js";import{S as X}from"./index-b9177dff.js";import"./index-ddb02c7b.js";const U=({open:s,onClose:r,onSubmit:l})=>{const[m,y]=d.useState(""),[h,x]=d.useState([]),u=$(a=>a.breakpoints.down("md"));d.useEffect(()=>{B().then(a=>x(a))},[]);const p=async a=>{try{return await l(a)}catch(c){throw y(c.response?c.response.data.error:"Failed to add user. Please try again or contact support if you continue to receive errors."),c}},g=[{name:"userId",label:"Users",component:"SelectList",placeholder:"Select User...",options:h,validation:F().required("User is required"),ComponentProps:{getOptionLabel:a=>`${a.firstName} ${a.lastName}`}},{name:"daysToExpire",label:"Access Days",helperText:"180 day maximum",validation:L().min(1,"1 day minimum").max(180,"180 day maximum").required("Access Days is required")}];return e.jsxs(q,{open:s,onClose:r,maxWidth:"sm",fullWidth:!0,children:[e.jsx(R,{children:"Grant Temporary Access"}),e.jsx(E,{variant:u&&"responsive",children:e.jsx(G,{action:p,final:!0,children:a=>e.jsx(M,{structure:g,onSubmit:a,onCancel:r,error:m,final:!0})})})]})};U.propTypes={onClose:i.func,onSubmit:i.func,open:i.bool};U.defaultProps={onClose:()=>{},onSubmit:()=>{},open:!1};const v=({user:s,onDelete:r})=>e.jsxs(X,{title:"Remove User Access",onSubmit:()=>r(s),submitButtonLabel:"Remove",actionButtonProps:{icon:e.jsx(O,{}),ButtonProps:{variant:"text",color:"secondary",name:"remove-access-button"}},children:["Are you sure you want to remove ",s.firstName," ",s.lastName,"'s access from your site?"]});v.propTypes={user:i.shape({}).isRequired,onDelete:i.func.isRequired};const Z=[{id:"userName",numeric:!1,label:"Username",style:{width:"25%"}},{id:"name",numeric:!1,label:"Name",style:{width:"25%"}},{id:"expires",numeric:!1,label:"Access Expiration",format:s=>s?b.fromISO(s).toLocaleString(b.DATE_FULL):"Never",style:{width:"25%"}},{id:"grantedByUsername",numeric:!1,label:"Added By",style:{width:"25%"}}],ee=V(s=>s.map(r=>({...r,id:r.userId,userName:`${r.username}@${r.domainName}`.trim(),name:`${r.firstName} ${r.lastName}`.trim()}))),A=({snackbar:s,users:r,siteId:l})=>{const[m,y]=d.useState(""),[h,x]=d.useState([]),[u,p]=d.useState(r),[g,a,c]=z(),D=async({userId:n,daysToExpire:o})=>{let t={};try{t=await k(l,n,o)}catch(S){t={error:S.response.data.error}}t.error||t.message?s.error(`Unable to add user. ${t.error.message} Please try again or contact support if you continue to receive errors.`):s.success("User was successfully added."),await j(l).then(S=>p(S)),c()},w=async({userId:n})=>{let o={};try{o=await Y(l,n)}catch(t){o={error:t.response.data.error}}if(o.error||o.message)s.error(`Unable to remove user. ${o.error.message} Please try again or contact support if you continue to receive errors.`);else{const t=await j(l);p(t),s.success("User was successfully removed.")}},N=[n=>e.jsx(v,{user:n,onDelete:w})],P=(n,o)=>{let t=null;o&&(t=n),y(o),x(t)},T=m?h:u,C=()=>e.jsx(Q,{dataSet:u,onDataSetUpdate:P,filterValue:m,fields:["domainName","username","firstName","lastName","grantedByUsername"],size:"small",variant:"outlined",margin:"none"});return e.jsxs(f,{children:[e.jsxs(f,{sx:{display:"flex",justifyContent:"flex-end",mb:2,flexDirection:{sm:"column",md:"row"}},marginTop:{sm:3,md:0},children:[C(),e.jsx(W,{"data-cy":"grant-user-access-button",endIcon:e.jsx(H,{}),variant:"outlined",onClick:a,sx:{whiteSpace:"nowrap",minWidth:"auto",height:n=>n.spacing(5),ml:{md:2,sm:0},mt:{md:0,sm:2}},children:"Grant Access"})]}),e.jsx(J,{introTextProps:{helpText:"<strong>Temporary Access</strong> provides site access to an Envysion user for a set period of time.",learnMorePath:"/administrative-user-setup/temporary-access/"},children:e.jsxs(f,{sx:{width:"100%"},children:[e.jsx(f,{children:e.jsx(_,{children:e.jsx(K,{paginate:!0,stayOnPageCountDiff:1,columns:Z,data:ee(T),rowActions:N,order:"asc",orderBy:"userId"})})}),e.jsx(U,{open:g,onClose:c,onSubmit:D})]})})]})};A.propTypes={snackbar:i.shape({}).isRequired,users:i.arrayOf(i.shape({})).isRequired,siteId:i.string.isRequired};const ie=I(A);export{ie as default};
2//# sourceMappingURL=index-11f08e5e.js.map

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.