PageSourceSearch

https://hack2skill.com/assets/index-1024827a.js

js hack2skill.com collected 2026-10-01 14:44:46 UTC 15,255 bytes, 1 lines download raw bytes

1import{aK as pe,i as e,I as ee,D as xe,ds as U,dt as K,F as c,aL as Y,cD as M,bA as be,cM as ge,j as m,dn as X,dp as J,dq as Q,k as Se,cq as Ce,M as z,B as y,V as Ee,E as ve,S as ye,dx as Re,cu as Ne,du as Ae,cv as we,C as Me,cc as De,cz as Te,dm as ke,aO as _e}from"./index-81971edb.js";import{r as f}from"./vendor-4adab861.js";import{y as Fe,z as Le,A as Ie}from"./index-8f2b427c.js";import{d as Pe}from"./Edit-493d361f.js";import{A as Oe}from"./index-8ab0029c.js";import{u as Z}from"./redux-cd3a9116.js";import{b as Ve}from"./router-805badc2.js";import{H as Be}from"./index-3d24c7c6.js";import"./ui-86749c30.js";const je=()=>{async function a(r={}){try{return await Fe(r)}catch(o){console.log("Error: ",o)}}async function n(r){try{return await Le(r)}catch(o){console.log("Error: ",o)}}async function l({innovatorId:r="",role:o=""}){try{return await Ie({innovatorId:r,role:o})}catch(d){console.log("Error: ",d)}}return{getStaffMemberListDataStaff:a,addStaffMemberStatusStaffApi:n,updateStaffMemberStatusStaffRevokeApi:l}},Ue=[{label:"10",value:"10"},{label:"25",value:"25"},{label:"50",value:"50"},{label:"75",value:"75"},{label:"100",value:"100"}],Ke=()=>pe([{to:"/staff/manage-users/platform",icon:e(ee,{className:"text-slate-700 opacity-45",fontSize:17,icon:"heroicons:home-solid"})}]),ze=[{_id:"VERIFIED",label:"Verified"},{_id:"REVOKED",label:"Revoked"},{_id:"CREATED",label:"Created"}];function Ge({user:a,status:n},l=()=>{},r=[],o){const b=({REVOKED:[],VERIFIED:[{label:"Revoke",value:"REVOKED",className:"text-h2sError-600",icon:"mi:circle-error"}],CREATED:[{label:"Revoke",value:"REVOKED",className:"text-h2sError-600",icon:"mi:circle-error"}]}[n]||[]).map(t=>({label:t.label,icon:t.icon,customClass:t.className,onClick:()=>{l({user:a,status:t.value})}}));return[...U(r,K(o,r)?.STAFF.MANAGE_STAFF)?b:[]]}const $e=({columndata:a,setSortColumn:n,sortColumn:l,userRoles:r=[],eventId:o})=>{const d=s=>{n(u=>u.name===s?{name:s,order:u.order==="asc"?"desc":"asc"}:{name:s,order:"asc"})},b=[{label:"Created At",_id:"createdAt",type:M?.DATE,columnClass:"!pl-9",render:s=>e(c,{children:m("div",{className:"flex items-center justify-between text-grey2 w-full gap-1",children:[e("span",{className:"ellipsis-two-lines flex-grow",title:s?.label,children:s?.label}),l?.name===s?._id?l.order==="asc"?e(X,{onClick:()=>d(s?._id),className:"cursor-pointer text-h2sBrand-900",sx:{fontSize:19}}):e(J,{onClick:()=>d(s?._id),className:"cursor-pointer text-h2sBrand-900",sx:{fontSize:19}}):e(Q,{onClick:()=>d(s?._id),className:"cursor-pointer text-h2sGrey-500",sx:{fontSize:25}})]})})},{label:"Status",_id:"role",columnClass:"!pl-9",type:"STATUS",render:s=>e(c,{children:e("div",{className:"flex items-center justify-between text-grey2 w-full gap-1",children:e("span",{className:"ellipsis-two-lines flex-grow",title:s?.label,children:s?.label})})})},{label:"Email",_id:"email",type:M?.EMAIL,render:s=>e(c,{children:m("div",{className:"flex items-center justify-between text-grey2 w-full gap-1",children:[e("span",{className:"ellipsis-two-lines flex-grow",title:s?.label,children:s?.label}),l?.name===s?._id?l.order==="asc"?e(X,{onClick:()=>d(s?._id),className:"cursor-pointer text-h2sBrand-900",sx:{fontSize:19}}):e(J,{onClick:()=>d(s?._id),className:"cursor-pointer text-h2sBrand-900",sx:{fontSize:19}}):e(Q,{onClick:()=>d(s?._id),className:"cursor-pointer text-h2sGrey-500",sx:{fontSize:25}})]})})},{label:"User",_id:"user",type:"USER",render:s=>e(c,{children:e("div",{className:"flex items-center justify-between text-grey2 w-full gap-1",children:e("span",{className:"ellipsis-two-lines flex-grow",title:s?.label,children:s?.label})})})},{label:"Role",_id:"role",type:"ROLE",render:s=>e(c,{children:e("div",{className:"flex items-center justify-between text-grey2 w-full gap-1",children:e("span",{className:"ellipsis-two-lines flex-grow",title:s?.label,children:s?.label})})})}];return[...U(r,K(o,r)?.STAFF.MANAGE_STAFF)?[{label:"",type:"ACTION",_id:a?.some(s=>s.type==="USER")?a.find(s=>s.type==="USER")?._id:"",columnClass:"text-center !min-w-[0px] !max-w-[0px]",render:()=>e(c,{})}]:[],...b]},te={L9:["L8","L7A","L7B","L7C"],L8:["L7C","L7B","L7A"],L7C:["L7B"]};function qe(a,n){return!a||!Array.isArray(a)||a.length===0||!n?!1:a.filter(r=>r.status!=="REVOKED").map(r=>r.role).some(r=>{const o=te[r];return Array.isArray(o)&&o.includes(n)})}const He=a=>{const{rowData:n,newColumndata:l,handleConfirmation:r,currentUserRoles:o,eventId:d}=a;if(n?.length>0&&l?.length>0)return n?.map(t=>{const s=[];return l?.map(u=>{switch(u?.type){case"ACTION":s?.push({label:"ACTION",render:N=>{const E=Ge({user:t,status:t?.role?.status},r,o,d),g=t?.role?.status!=="REVOKED"&&qe(o,t?.role?.role)&&Array.isArray(E)&&E.length>0;return e(c,{children:e("div",{className:"relative flex !justify-center",children:t?.role?.status!=="REVOKED"?e(Oe,{disabled:!g,handleMenuClick:()=>{},customClass:`text-h2sSlate-600 ${g?"cursor-pointer":"!cursor-not-allowed !pointer-events-auto"}`,customIcon:e(Pe,{className:`${g?"text-h2sSlate-500":"text-h2sSlate-300"}`}),menuButtonsData:g?E:[],rowIndex:1,rowData:N?._id}):null})})}});break;case M?.USER:s?.push({label:t?.name,render:()=>e(c,{children:e(ge,{className:"!gap-2 mr-10 !max-w-60 ",data:{image:t?.picture?t?.picture?.length===1&&t?.picture?.includes("-")?"https://h2svision.github.io/publicAssets/vision/defaultUser.png":t?.picture:"https://h2svision.github.io/publicAssets/vision/defaultUser.png",title:t?.name??"-"}})})});break;case M?.EMAIL:s?.push({label:t?.email??"-",render:()=>e(c,{children:e("p",{className:"text-wrap text-h2sSlate-400 !block ellipsis-two-lines  text-sm",children:t?.email??"-"})})});break;case"STATUS":s?.push({label:t?.role?.status??"-",render:()=>e(c,{children:e("div",{className:`w-fit h-fit px-4 py-2 rounded-lg uppercase text-xs ${t?.status==="REVOKED"?"bg-h2sError-50 text-h2sError-600":t?.status==="VERIFIED"?"bg-h2sSuccess-50 text-h2sSuccess-600":t?.status==="CREATED"?"bg-h2sWarning-50 text-h2sWarning-600":""}  `,children:e("p",{children:t?.role?.status??"-"})})})});break;case"ROLE":s?.push({label:t?.role?.role??"-",render:()=>e(c,{children:e("div",{className:"w-fit h-fit px-4 py-2 rounded-lg uppercase text-xs  text-h2sSlate-400",children:e("p",{children:t?.role?.role??"-"})})})});break;case M?.DATE:s?.push({label:t?.createdAt??"-",render:()=>e(c,{children:e("div",{className:"w-fit h-fit px-4 py-2 rounded-lg uppercase text-xs  text-h2sSlate-400",children:e("p",{children:be(t?.createdAt)??"-"})})})});break;default:s?.push({label:t?.[u?._id]??"-",render:()=>e(c,{children:u?._id==="status"?e("div",{className:`w-fit h-fit px-4 py-2 rounded-lg uppercase text-xs ${t?.[u?._id]==="REVOKED"?"bg-h2sError-50 text-h2sError-600":t?.[u?._id]==="VERIFIED"?"bg-h2sSuccess-50 text-h2sSuccess-600":t?.[u?._id]==="CREATED"?"bg-h2sWarning-50 text-h2sWarning-600":""}  `,children:e("p",{children:t?.[u?._id]??"-"})}):e(c,{children:t?.[u?._id]&&e("p",{title:Y(t?.[u?._id]),className:" text-h2sSlate-400 !block !ellipsis-two-lines truncate max-w-[20rem] text-sm",children:Y(t?.[u?._id])??""})})})});break}}),s})};function We(a){if(!Array.isArray(a)||a.length===0)return[];for(const[n,l]of Object.entries(te))if(U(a,[n]))return l.map(r=>({label:r,value:r}));return[]}const Ye=a=>[{name:"name",title:"Full Name",type:"text",required:!0,validation:"LONG_TEXT",helperText:"Enter your legal full name"},{name:"email",title:"Email",type:"email",required:!0,validation:"EMAIL",helperText:"Enter a valid email address to Sign Up for your H2S account"},{name:"role",title:"Role",placeholder:"Select the role of the user",type:xe?.SELECT,pickList:We(a)||[],isMulti:!1,isCreatable:!1,isSearchable:!1,required:!0,className:"mb-4 mt-4 roleCheckBox"}],Xe=()=>{const{eventId:a}=Ve(),n=Se(),l=Z(i=>i?.user?.roles)||[],r=Z(i=>i?.forbidden?.isForbidden)??!1,o=Ke(),[d,b]=f.useState(""),t=Ce(d,800),{get
1StaffMemberListDataStaff:s,addStaffMemberStatusStaffApi:u,updateStaffMemberStatusStaffRevokeApi:N}=je(),[E,v]=f.useState(!1),[g,P]=f.useState(!1),[S,R]=f.useState(1),[D,T]=f.useState(1),[k,O]=f.useState(null),[x,V]=f.useState("10"),[_,F]=f.useState(!1),[C,A]=f.useState([]),[p,B]=f.useState({name:"updatedAt",order:"desc"}),[ae,se]=f.useState([]),[re,w]=f.useState(""),[G,j]=f.useState({}),[le,$]=f.useState(!1),q=Ye(l)||[];console.log({addStaffMemberForm:q});const[ne,L]=f.useState(!1),H=f.useRef();function oe(){I({page:S||"1",records:x,search:t,status:C||[]}),F(!1)}async function ie(){A([])}const W=()=>$e({columndata:[],setSortColumn:B,sortColumn:p,userRoles:l,eventId:a}),ce=()=>He({currentUserRoles:l,newColumndata:W(),rowData:ae,handleConfirmation:ue,eventId:a});async function de(){try{L(!0);const i={innovatorId:G?.user?._id??"",role:G?.user?.role?.role??""};(await N(i))?.success&&(w(""),j({}),I({page:S||"1",records:x,search:t,status:C||[]}))}catch(i){console.log("Error: ",i)}finally{L(!1)}}async function ue({user:i,status:h}){switch(h){case"REVOKED":w("REVOKED"),j({user:i,status:h});break;case"VERIFIED":w("REVOKED"),j({user:i,status:h});break}}function fe(){w("")}async function I(i){v(!0);try{const h=await s({page:i?.page||"1",records:i?.records?.toString(),search:i?.search,sortColumn:i?.sortColumn||p?.name||"",sortOrder:i?.sortOrder||p?.order||"",status:i?.status?.join(";")});h&&(v(!1),se(h?.data||[]),O(h?.count),T(h?.pages))}catch(h){v(!1),console.log("Error: ",h)}finally{v(!1)}}function me(i){d!=1&&R(1),b(i)}async function he(){try{const i=await H?.current?.getValues();L(!0),(await u(i))?.success&&(w(""),$(!1),I({page:S||"1",records:x,search:t,status:C||[]}))}catch(i){console.log("Error: ",i)}finally{L(!1)}}return f.useEffect(()=>{const i={search:t||"",page:S||1,records:x??"10",status:C||[],...p?.name?{sortColumn:p?.name}:{},...p?.order?{sortOrder:p?.order}:{}};I(i)},[x,t,S,p?.name,p?.order]),f.useEffect(()=>{R(1)},[x]),{t:n,isForbidden:r,breadCrumDataToSend:o,isLoading:E,totalPages:D,currentPage:S,rowPerPageCount:Ue,totalDataCount:k,setRowsPerPage:V,rowsPerPage:x,setCurrentPage:R,debouncedSearchRecord:t,handleSearch:me,setIsRowList:P,isRowList:g,generateColumnData:W,generateRowData:ce,handleCloseModal:fe,currentModal:re,handleRevokeConfirmation:de,showFilter:_,setShowFilter:F,handleClearFilters:ie,handleApplyColumn:oe,selectedColumns:C,setSelectedColumns:A,tableStaticColumns:ze,addStaffMemberForm:q,addStaffMemberRef:H,addModalData:le,setAddModalData:$,handleAddStaffMemberFormData:he,confirmationLoader:ne,userRoles:l,eventId:a}},Je=({t:a,confirmationModalOpen:n,setConfirmationModalOpen:l,handleConfirmModal:r,isLoading:o})=>e(c,{children:n?e(z,{isOpen:n,onClose:()=>{l()},customClass:"",children:m("div",{className:"mt-6 text-center",children:[e("h5",{className:"",children:"Are you sure you want to verify this user?"}),m("div",{className:"flex justify-center gap-5 my-5",children:[e(y,{variant:"outlined",color:"disabledv1",onClick:()=>{l()},customClass:"!w-fit",children:a("No")}),e(y,{isLoading:o,onClick:r,variant:"filled",color:"success",customClass:"!w-fit",children:a("Yes")})]})]})}):e(c,{})}),Qe=({t:a,confirmationModalOpen:n,setConfirmationModalOpen:l,handleConfirmModal:r=()=>{},isLoading:o=!1})=>e(c,{children:n?e(z,{isOpen:n,onClose:()=>{l()},customClass:"",children:m("div",{className:"mt-6 text-center",children:[e("h5",{className:"",children:"Are you sure you want to revoke access for this user?"}),m("div",{className:"flex justify-center gap-5 my-5",children:[e(y,{variant:"outlined",color:"disabledv1",onClick:()=>{l()},customClass:"!w-fit",children:a("No")}),e(y,{isLoading:o,onClick:r,variant:"filled",color:"error",customClass:"!w-fit",children:a("Yes")})]})]})}):e(c,{})});const Ze=({t:a,confirmationModalOpen:n,setConfirmationModalOpen:l,handleConfirmModal:r=()=>{},addStaffMemberForm:o=[],addStaffMemberRef:d=""})=>e(c,{children:n?e(z,{modalTitle:a("Add Staff Member"),isOpen:n,onClose:()=>{l()},customClass:"modal-border",children:m("div",{className:"mt-6 text-center",children:[e(Ee,{fields:o,ref:d}),m("div",{className:"mt-4 mb-4 flex justify-end gap-4",children:[e(y,{variant:"outlined",customClass:"!w-fit",onClick:()=>l(),children:a("cCancelButton")}),e(y,{customClass:"!w-fit",onClick:r,children:a("cSubmitButton")})]})]})}):e(c,{})}),ct=()=>{const{t:a,isForbidden:n,breadCrumDataToSend:l,isLoading:r,totalPages:o,currentPage:d,rowPerPageCount:b,totalDataCount:t,setRowsPerPage:s,rowsPerPage:u,setCurrentPage:N,debouncedSearchRecord:E,handleSearch:v,setIsRowList:g,isRowList:P,generateColumnData:S,generateRowData:R,handleCloseModal:D,currentModal:T,handleRevokeConfirmation:k,addStaffMemberForm:O,addStaffMemberRef:x,handleAddStaffMemberFormData:V,setAddModalData:_,addModalData:F,confirmationLoader:C,userRoles:A,eventId:p}=Xe();return n?e("div",{className:"mt-4",children:e(ke,{isForbidden:n})}):m(c,{children:[e(Ze,{t:a,handleConfirmModal:V,addStaffMemberForm:O,addStaffMemberRef:x,confirmationModalOpen:F,setConfirmationModalOpen:_}),e(Qe,{t:a,isLoading:C,handleConfirmModal:k,confirmationModalOpen:T==="REVOKED",setConfirmationModalOpen:D}),e(Je,{t:a,isLoading:C,handleConfirmModal:k,confirmationModalOpen:T==="VERIFIED",setConfirmationModalOpen:D}),m("div",{className:"font-sans",children:[e(ve,{metaData:{title:a("cManageUsersStaffText1")}}),m("div",{className:"w-full px-[24px] pb-20",children:[e("div",{className:"pt-8 pb-2 w-full md:sticky top-0 bg-h2sGrey-50 z-20",children:e(_e,{breadCrumData:l,className:""})}),e(Be,{title:a("cManageUsersStaffText1"),description:a("cManageUsersStaffDescrpition1")}),e("div",{className:"mt-4",children:e("div",{children:m("div",{className:"rounded-2xl bg-white shadow-soft-xl mt-[24px] pb-[12px] ",children:[e("div",{className:"flex-col  justify-between max-[640px]:flex-wrap max-[640px]:gap-3  gap-4 max-xl:flex-col p-5",children:m("div",{className:"flex justify-between gap-4",children:[m("div",{className:" flex gap-4",children:[e("div",{className:"flex max-[640px]:flex-wrap max-[640px]:gap-0  gap-2 ",children:e("div",{className:"max-[640px]:w-full max-[640px]:mb-3 w-64",children:e(ye,{value:E||"",onChange:B=>v(B),placeholder:"Search here...",customClass:"!px-[8px] !py-[3px]"})})}),e("div",{className:"flex gap-2"})]}),e(Re,{userRoles:A,requiredRoles:K(p,A)?.STAFF.MANAGE_STAFF,children:m(y,{customClass:"!w-fit",onClick:()=>_(!0),variant:"outlined",children:[e(ee,{icon:"ic:baseline-plus"}),a("Add Staff Member")]})})]})}),m("div",{className:"flex gap-4 px-5 justify-between items-center max-[640px]:flex-wrap max-[640px]:gap-3 border-y md:sticky bg-white z-10  top-[3.9rem]",children:[e("div",{children:e(Ne,{isRowList:P,setIsRowList:g,rowsPerPage:u,setRowsPerPage:s,rowPerPageCount:b})}),m("div",{className:"flex items-center max-[640px]:flex-wrap max-[640px]:gap-3 gap-4",children:[e(Ae,{rowsPerPage:u,totalDataCount:t,currentPage:d}),e(we,{t:a,isLoading:r,totalPages:o||1,currentPage:d,setCurrentPage:N})]})]}),e("div",{className:"",children:e(Me,{isLoading:r,children:R()?.length===0?m("div",{className:"!flex !flex-col mx-auto w-fit my-[1rem] font-openSans text-center",children:[e(De,{className:"w-[10rem] !h-[10rem] mx-auto"}),e("h5",{className:"text-h6 text-h2sSlate-600  mb-3",children:a("cRecordNotFound")}),e("p",{className:"text-sm text-h2sSlate-400 ",children:a("cTableNoRecordDescription")})]}):e(Te,{columns:S()||[],rows:R()||[]})})})]})})})]})]})]})};export{ct as default};

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.