module.exports=[451569,a=>{"use strict";let b={"products.view":["SUPER_ADMIN","MODERATOR"],"products.create":["SUPER_ADMIN"],"products.edit":["SUPER_ADMIN","MODERATOR"],"products.delete":["SUPER_ADMIN"],"blog.view":["SUPER_ADMIN","BLOG_EDITOR","MODERATOR"],"blog.create":["SUPER_ADMIN","BLOG_EDITOR"],"blog.edit":["SUPER_ADMIN","BLOG_EDITOR","MODERATOR"],"blog.publish":["SUPER_ADMIN","BLOG_EDITOR"],"blog.delete":["SUPER_ADMIN"],"team.view":["SUPER_ADMIN"],"team.manage":["SUPER_ADMIN"],"jobs.view":["SUPER_ADMIN","HR_MANAGER"],"jobs.manage":["SUPER_ADMIN","HR_MANAGER"],"inquiries.view":["SUPER_ADMIN","SUPPORT_AGENT","MODERATOR"],"inquiries.manage":["SUPER_ADMIN","SUPPORT_AGENT"],"tickets.view":["SUPER_ADMIN","SUPPORT_AGENT"],"tickets.manage":["SUPER_ADMIN","SUPPORT_AGENT"],"tickets.assign":["SUPER_ADMIN"],"leads.view":["SUPER_ADMIN","SUPPORT_AGENT"],"leads.manage":["SUPER_ADMIN","SUPPORT_AGENT"],"users.view":["SUPER_ADMIN"],"users.manage":["SUPER_ADMIN"],"services.view":["SUPER_ADMIN","MODERATOR"],"services.create":["SUPER_ADMIN"],"services.edit":["SUPER_ADMIN","MODERATOR"],"services.delete":["SUPER_ADMIN"],"pages.view":["SUPER_ADMIN","MODERATOR"],"pages.create":["SUPER_ADMIN"],"pages.edit":["SUPER_ADMIN","MODERATOR"],"pages.delete":["SUPER_ADMIN"],"publications.view":["SUPER_ADMIN","BLOG_EDITOR","MODERATOR"],"publications.create":["SUPER_ADMIN","BLOG_EDITOR"],"publications.edit":["SUPER_ADMIN","BLOG_EDITOR","MODERATOR"],"publications.delete":["SUPER_ADMIN"],"outlets.view":["SUPER_ADMIN","MODERATOR"],"outlets.create":["SUPER_ADMIN"],"outlets.edit":["SUPER_ADMIN","MODERATOR"],"outlets.delete":["SUPER_ADMIN"],"settings.view":["SUPER_ADMIN"],"settings.edit":["SUPER_ADMIN"],"sops.view":["SUPER_ADMIN","BLOG_EDITOR","HR_MANAGER","MODERATOR","SUPPORT_AGENT"],"sops.create":["SUPER_ADMIN","MODERATOR"],"sops.edit":["SUPER_ADMIN","MODERATOR"],"sops.approve":["SUPER_ADMIN"],"sops.delete":["SUPER_ADMIN"],"sop-categories.view":["SUPER_ADMIN","MODERATOR"],"sop-categories.manage":["SUPER_ADMIN"],"media.view":["SUPER_ADMIN","MODERATOR"],"media.upload":["SUPER_ADMIN","MODERATOR"],"media.delete":["SUPER_ADMIN"]};function c(a,c){return b[c].includes(a)}a.s(["hasPermission",()=>c])},141465,a=>{"use strict";var b=a.i(53112);let c=b.z.object({name:b.z.string().min(1,"Name is required"),role:b.z.string().min(1,"Role is required"),department:b.z.string().min(1,"Department is required"),bio:b.z.string().min(1,"Bio is required"),initials:b.z.string().min(1).max(3,"Max 3 characters"),imageUrl:b.z.string().optional().nullable(),linkedinUrl:b.z.string().url().optional().nullable().or(b.z.literal("")),email:b.z.string().email().optional().nullable().or(b.z.literal("")),isActive:b.z.boolean()});a.s(["teamMemberSchema",0,c])},658320,a=>a.a(async(b,c)=>{try{var d=a.i(137936),e=a.i(118558),f=a.i(766518),g=a.i(705949),h=a.i(141465),i=a.i(713095),j=b([f,g]);async function k(a){await (0,g.requirePermission)("team.manage");let b=h.teamMemberSchema.safeParse(a);if(!b.success)return{error:b.error.issues[0].message};let c=await f.prisma.teamMember.count();return await f.prisma.teamMember.create({data:{...b.data,imageUrl:b.data.imageUrl??null,linkedinUrl:b.data.linkedinUrl||null,email:b.data.email||null,sortOrder:c}}),(0,e.revalidatePath)("/admin/team"),{success:!0}}async function l(a,b){await (0,g.requirePermission)("team.manage");let c=h.teamMemberSchema.safeParse(b);return c.success?(await f.prisma.teamMember.update({where:{id:a},data:{...c.data,imageUrl:c.data.imageUrl??null,linkedinUrl:c.data.linkedinUrl||null,email:c.data.email||null}}),(0,e.revalidatePath)("/admin/team"),{success:!0}):{error:c.error.issues[0].message}}async function m(a){await (0,g.requirePermission)("team.manage"),await f.prisma.teamMember.delete({where:{id:a}}),(0,e.revalidatePath)("/admin/team")}async function n(a){await (0,g.requirePermission)("team.manage");let b=await f.prisma.teamMember.findUnique({where:{id:a},select:{isActive:!0}});b&&(await f.prisma.teamMember.update({where:{id:a},data:{isActive:!b.isActive}}),(0,e.revalidatePath)("/admin/team"))}[f,g]=j.then?(await j)():j,(0,i.ensureServerEntryExports)([k,l,m,n]),(0,d.registerServerReference)(k,"40ee811944f3f565cbb98b51a8d075992a067f8627",null),(0,d.registerServerReference)(l,"606370f649c7efcd2e58cdd9ffa526852595d3c123",null),(0,d.registerServerReference)(m,"40a2132be4632e92686495f6b38194ba6a0e626387",null),(0,d.registerServerReference)(n,"40868f545694c7c6a69399463f9c6759123f09b7a5",null),a.s(["createTeamMember",()=>k,"deleteTeamMember",()=>m,"toggleTeamMemberActive",()=>n,"updateTeamMember",()=>l]),c()}catch(a){c(a)}},!1),455191,a=>a.a(async(b,c)=>{try{var d=a.i(658320),e=b([d]);[d]=e.then?(await e)():e,a.s([]),c()}catch(a){c(a)}},!1),721060,a=>a.a(async(b,c)=>{try{var d=a.i(455191),e=a.i(658320),f=b([d,e]);[d,e]=f.then?(await f)():f,a.s(["606370f649c7efcd2e58cdd9ffa526852595d3c123",()=>e.updateTeamMember]),c()}catch(a){c(a)}},!1)];

//# sourceMappingURL=_b97bf86c._.js.map