1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3643],{79399:function(e,s,r){var o=r(57437),a=r(2265),l=r(25876);s.Z=()=>{let[e,s]=(0,a.useState)(0);return((0,a.useEffect)(()=>{let e=(0,l.Ld)(e=>s(e));return()=>e()},[]),e<=0)?null:(0,o.jsx)("div",{className:"admin-loader-overlay",role:"status","aria-live":"polite",children:(0,o.jsxs)("div",{className:"admin-loader-box",children:[(0,o.jsx)("div",{className:"admin-spinner"}),(0,o.jsx)("div",{className:"admin-loader-text",children:"Loading..."})]})})}},26550:function(e,s,r){r.d(s,{$:function(){return a}});var o=r(57437);r(2265);let a=e=>{let{size:s="medium",fullPage:r=!1}=e;return r?(0,o.jsx)("div",{className:"employee-spinner-fullpage",children:(0,o.jsx)("div",{className:`employee-spinner employee-spinner-${s}`})}):(0,o.jsx)("div",{className:`employee-spinner employee-spinner-${s}`})}},22551:function(e,s,r){r.d(s,{Z:function(){return v}});var o=r(57437),a=r(2265),l=r(28784),i=r(14573),t=r(79399),n=r(55605),d=r(22992),c=r(99001);let m=()=>{let{toasts:e,removeToast:s}=(0,c.p)();return(0,o.jsx)("div",{className:"employee-toast-container",children:e.map(e=>(0,o.jsxs)("div",{className:`employee-toast employee-toast-${e.type}`,role:"alert",children:[(0,o.jsxs)("div",{className:"employee-toast-content",children:[(0,o.jsxs)("span",{className:"employee-toast-icon",children:["success"===e.type&&"â","error"===e.type&&"â","warning"===e.type&&"!","info"===e.type&&"â¹"]}),(0,o.jsx)("span",{className:"employee-toast-message",children:e.message})]}),(0,o.jsx)("button",{className:"employee-toast-close",onClick:()=>s(e.id),"aria-label":"Close notification",children:"\xd7"})]},e.id))})},p=()=>(0,o.jsx)("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:(0,o.jsx)("path",{d:"M12 12a4 4 0 1 0-4-4 4 4 0 0 0 4 4Zm-7 8a7 7 0 0 1 14 0",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})}),h=()=>(0,o.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[(0,o.jsx)("rect",{x:"4",y:"4",width:"6",height:"6",rx:"1.2",stroke:"currentColor",strokeWidth:"1.8"}),(0,o.jsx)("rect",{x:"14",y:"4",width:"6",height:"6",rx:"1.2",stroke:"currentColor",strokeWidth:"1.8"}),(0,o.jsx)("rect",{x:"4",y:"14",width:"6",height:"6",rx:"1.2",stroke:"currentColor",strokeWidth:"1.8"}),(0,o.jsx)("rect",{x:"14",y:"14",width:"6",height:"6",rx:"1.2",stroke:"currentColor",strokeWidth:"1.8"})]}),u=()=>(0,o.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[(0,o.jsx)("path",{d:"M15 16l4-4-4-4",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"}),(0,o.jsx)("path",{d:"M9 12h10",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"}),(0,o.jsx)("path",{d:"M11 4H6a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h5",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})]}),x=()=>(0,o.jsx)("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:(0,o.jsx)("path",{d:"M12 2a4 4 0 1 0 0 8 4 4 0 0 0 0-8Zm-7 10a3 3 0 0 0-3 3v4a3 3 0 0 0 3 3h5v-3h2v3h5a3 3 0 0 0 3-3v-4a3 3 0 0 0-3-3h-9Z",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})}),y=()=>(0,o.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[(0,o.jsx)("rect",{x:"3",y:"11",width:"18",height:"10",rx:"2",stroke:"currentColor",strokeWidth:"1.8"}),(0,o.jsx)("path",{d:"M7 11V8a5 5 0 0 1 10 0v3",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})]}),j=(e,s,r)=>{if(!e)return r;for(let r of s){let s=e[r];if(null!=s&&""!==s)return String(s)}return r};var v=e=>{let{title:s,children:r}=e,c=(0,l.TH)(),v=(0,l.s0)(),{employeeUser:N,logout:f}=(0,d.T)(),[k,b]=(0,a.useState)(!1);(0,a.useEffect)(()=>{b("true"===localStorage.getItem("employeeSidebarCollapsed"))},[]);let g=async()=>{if(window.confirm("Are you sure you want to logout?")){try{await (0,n.ER)()}catch(e){console.warn("Employee logout API failed:",e)}f(),v("/employee/login",{replace:!0})}},C=j(N,["name","fullName","username","email"],"Employee"),w=j(N,["role","designation"],"Team Member");return(0,o.jsxs)("div",{className:`employee-dashboard-container employee-layout ${k?"collapsed":""}`,children:[(0,o.jsx)(t.Z,{}),(0,o.jsx)(m,{}),(0,o.jsxs)("div",{className:"employee-grid",children:[(0,o.jsxs)("aside",{className:"employee-sidebar",children:[(0,o.jsxs)("div",{className:"employee-sidebar-top",children:[(0,o.jsx)("div",{className:"employee-sidebar-brand",children:"Employee Panel"}),(0,o.jsxs)("div",{className:"employee-sidebar-profile",children:[(0,o.jsx)("div",{className:"employee-sidebar-avatar",children:(0,o.jsx)(p,{})}),(0,o.jsxs)("div",{children:[(0,o.jsx)("div",{className:"employee-sidebar-name",children:C}),(0,o.jsx)("div",{className:"employee-sidebar-role",children:w})]})]})]}),(0,o.jsxs)("nav",{className:"employee-sidebar-nav",children:[(0,o.jsxs)(i.rU,{to:"/employee/dashboard",className:`employee-nav-item ${"/employee/dashboard"===c.pathname?"active":""}`,children:[(0,o.jsx)(h,{})," ",(0,o.jsx)("span",{children:"Overview"})]}),(0,o.jsxs)(i.rU,{to:"/employee/employees",className:`employee-nav-item ${c.pathname.startsWith("/employee/employees")?"active":""}`,children:[(0,o.jsx)(p,{})," ",(0,o.jsx)("span",{children:"Employees"})]}),(0,o.jsxs)(i.rU,{to:"/employee/roles-permissions",className:`employee-nav-item ${"/employee/roles-permissions"===c.pathname?"active":""}`,children:[(0,o.jsx)(x,{})," ",(0,o.jsx)("span",{children:"Roles & Permissions"})]}),(0,o.jsxs)(i.rU,{to:"/employee/my-access",className:`employee-nav-item ${"/employee/my-access"===c.pathname?"active":""}`,children:[(0,o.jsx)(p,{}
1)," ",(0,o.jsx)("span",{children:"My Access"})]}),(0,o.jsxs)(i.rU,{to:"/employee/change-password",className:`employee-nav-item ${"/employee/change-password"===c.pathname?"active":""}`,children:[(0,o.jsx)(y,{})," ",(0,o.jsx)("span",{children:"Change Password"})]})]}),(0,o.jsxs)("button",{onClick:g,className:"employee-sidebar-logout",children:[(0,o.jsx)(u,{})," ",(0,o.jsx)("span",{children:"Logout"})]})]}),(0,o.jsxs)("main",{className:"employee-main-content",children:[(0,o.jsxs)("header",{className:"employee-dashboard-header",children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("p",{className:"employee-dashboard-eyebrow",children:"Internal Workspace"}),(0,o.jsx)("h1",{children:s})]}),(0,o.jsxs)("div",{className:"employee-dashboard-user-chip",children:["Signed in as ",(0,o.jsx)("strong",{children:C})]})]}),r]})]})]})}},63643:function(e,s,r){r.r(s);var o=r(57437),a=r(2265),l=r(28784),i=r(22551),t=r(55605),n=r(99001),d=r(26550);s.default=()=>{let{id:e}=(0,l.UO)(),s=(0,l.s0)(),{showToast:r}=(0,n.p)(),c=!!e,[m,p]=(0,a.useState)(c),[h,u]=(0,a.useState)(!1),[x,y]=(0,a.useState)({roleCode:"",roleName:"",description:"",isActive:!0});(0,a.useEffect)(()=>{(async()=>{if(!c||!e)return p(!1);try{let s=await (0,t.DG)(parseInt(e,10)),r=s?.responseObject||{};y({roleCode:r.role_code||r.roleCode||"",roleName:r.role_name||r.roleName||r.name||"",description:r.description||"",isActive:void 0===r.isActive||!!r.isActive})}catch(e){console.error("Failed to load role:",e),r("Failed to load role details","error")}finally{p(!1)}})()},[e,c,r]);let j=e=>{let{name:s,value:r,type:o,checked:a}=e.target;y(e=>({...e,[s]:"checkbox"===o?a:r}))},v=async o=>{o.preventDefault(),u(!0);try{let o={roleCode:x.roleCode,roleName:x.roleName,description:x.description};c&&e?(o.roleId=parseInt(e,10),await (0,t.ul)(o),r("Role updated successfully","success")):(await (0,t.fA)(o),r("Role created successfully","success")),s("/employee/roles-permissions")}catch(e){console.error("Failed to save role:",e),r(e instanceof Error?e.message:"Failed to save role","error")}finally{u(!1)}};return m?(0,o.jsx)(d.$,{fullPage:!0}):(0,o.jsx)(i.Z,{title:c?"Edit Role":"Create Role",children:(0,o.jsx)("section",{className:"employee-dashboard-section",children:(0,o.jsxs)("form",{onSubmit:v,className:"employee-form",noValidate:!0,children:[(0,o.jsxs)("div",{className:"employee-form-group",children:[(0,o.jsx)("label",{htmlFor:"roleCode",children:"Role Code"}),(0,o.jsx)("input",{id:"roleCode",name:"roleCode",value:x.roleCode||"",onChange:j,className:"employee-input"})]}),(0,o.jsxs)("div",{className:"employee-form-group",children:[(0,o.jsx)("label",{htmlFor:"roleName",children:"Role Name"}),(0,o.jsx)("input",{id:"roleName",name:"roleName",value:x.roleName||"",onChange:j,className:"employee-input"})]}),(0,o.jsxs)("div",{className:"employee-form-group",children:[(0,o.jsx)("label",{htmlFor:"description",children:"Description"}),(0,o.jsx)("textarea",{id:"description",name:"description",value:x.description||"",onChange:j,className:"employee-input"})]}),(0,o.jsxs)("div",{className:"employee-form-actions",children:[(0,o.jsx)("button",{type:"button",className:"employee-btn employee-btn-secondary",onClick:()=>s("/employee/roles-permissions"),children:"Cancel"}),(0,o.jsx)("button",{type:"submit",className:"employee-btn employee-btn-primary",disabled:h,children:h?"Saving...":c?"Update Role":"Create Role"})]})]})})})}}}]);
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.