1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[384],{7555:(e,s,a)=>{a.d(s,{N_:()=>m,Zp:()=>c,ok:()=>d,zy:()=>o});var r=a(37876),t=a(14232),i=a(14e3),l=a(48230),n=a.n(l);function c(){let e=(0,i.useRouter)();return(0,t.useCallback)((s,a)=>{if("number"==typeof s)return void(s<0?e.back():e.forward());(null==a?void 0:a.replace)?e.replace(s):e.push(s)},[e])}function o(){let e=(0,i.usePathname)(),s=(0,i.useSearchParams)();return{pathname:e,search:s.toString()?"?".concat(s.toString()):"",hash:"",state:null,key:"default"}}function d(){let e=(0,i.useSearchParams)(),s=(0,i.useRouter)(),a=(0,i.usePathname)();return[new URLSearchParams(e.toString()),(0,t.useCallback)((r,t)=>{let i,l=new URLSearchParams(e.toString());"function"==typeof r?i=r(l):r instanceof URLSearchParams?i=r:(Object.entries(r).forEach(e=>{let[s,a]=e;return l.set(s,a)}),i=l);let n="".concat(a,"?").concat(i.toString());(null==t?void 0:t.replace)?s.replace(n):s.push(n)},[e,s,a])]}function m(e){var s;let{to:a,href:t,children:i,...l}=e;return(0,r.jsx)(n(),{href:null!=(s=null!=a?a:t)?s:"",...l,children:i})}},14099:(e,s,a)=>{a.d(s,{J:()=>o});var r=a(37876),t=a(14232),i=a(59773),l=a(47137),n=a(56680);let c=(0,l.F)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),o=t.forwardRef((e,s)=>{let{className:a,...t}=e;return(0,r.jsx)(i.b,{ref:s,className:(0,n.cn)(c(),a),...t})});o.displayName=i.b.displayName},34859:(e,s,a)=>{a.d(s,{U:()=>z});var r=a(37876),t=a(14232),i=a(29972),l=a(83935),n=a(41276),c=a(26283),o=a(91725),d=a(23156),m=a(78539),x=a(89183),h=a(79039),u=a(39393),p=a(7934),f=a(15722),b=a(97842),g=a(87249),v=a(17734),j=a(45499),N=a(51165),y=a(72166);let w=()=>{let[e,s]=(0,t.useState)(new Date);return(0,t.useEffect)(()=>{let e=setInterval(()=>{s(new Date)},1e3);return()=>clearInterval(e)},[]),(0,r.jsxs)("div",{className:"text-right",children:[(0,r.jsx)("div",{children:e.toLocaleTimeString()}),(0,r.jsxs)("div",{className:"text-xs",children:["UTC ",e.toISOString().slice(0,10)]})]})};var k=a(40049),S=a(52417);let C=e=>{let{onConfirm:s,children:a}=e,[i,l]=(0,t.useState)(!1);return(0,r.jsxs)(r.Fragment,{children:[a?(0,r.jsx)("button",{type:"button",onClick:()=>l(!0),className:"appearance-none bg-transparent border-none p-0 m-0 cursor-pointer",children:a}):(0,r.jsx)(c.$,{variant:"ghost",size:"sm",onClick:()=>l(!0),"aria-label":"Sign out",className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",children:(0,r.jsx)(k.A,{className:"h-5 w-5"})}),i&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-[200]",onClick:()=>l(!1),"aria-hidden":"true"}),(0,r.jsxs)("div",{className:"fixed left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 z-[201
1] w-full max-w-sm bg-[hsl(220,13%,10%)] border border-white/10 rounded-xl shadow-2xl p-6",role:"alertdialog","aria-modal":"true","aria-labelledby":"signout-title","aria-describedby":"signout-desc",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,r.jsx)("div",{className:"w-10 h-10 rounded-full bg-red-500/10 flex items-center justify-center flex-shrink-0",children:(0,r.jsx)(S.A,{className:"h-5 w-5 text-red-400"})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",{id:"signout-title",className:"text-white font-semibold text-sm",children:"End Session?"}),(0,r.jsx)("p",{id:"signout-desc",className:"text-gray-400 text-xs mt-0.5",children:"You'll need to sign in again to access your dashboard and compliance data."})]})]}),(0,r.jsxs)("div",{className:"flex gap-2 justify-end",children:[(0,r.jsx)(c.$,{variant:"ghost",size:"sm",onClick:()=>l(!1),className:"text-gray-400 hover:text-white",children:"Cancel"}),(0,r.jsxs)(c.$,{variant:"destructive",size:"sm",onClick:()=>{l(!1),s()},className:"bg-red-600 hover:bg-red-700",children:[(0,r.jsx)(k.A,{className:"h-3.5 w-3.5 mr-1.5"}),"Sign Out"]})]})]})]})]})};var A=a(73090),_=a(7555),E=a(79164);let z=e=>{var s;let{children:a,currentSection:k="home",browserNav:S}=e,[z,T]=(0,t.useState)(!0),[I,D]=(0,t.useState)(""),R=(0,_.Zp)(),{user:F,signOut:P}=(0,i.As)(),{profile:L}=(0,l.s)(),{currentOrganization:U}=(0,n.W)(),G=[{id:"stig-dashboard",label:"STIG Dashboard",icon:m.A,path:"/stig-dashboard",symbol:"Eban"},{id:"asset-scanning",label:"Asset Scanning",icon:x.A,path:"/asset-scanning",symbol:"Sankofa"},{id:"compliance-reports",label:"Reports",icon:h.A,path:"/compliance-reports",symbol:"Duafe"},{id:"evidence-collection",label:"Evidence",icon:u.A,path:"/evidence-collection",symbol:"Nkyinkyim"},{id:"billing",label:"Billing",icon:p.A,path:"/billing",symbol:"Fawohodie"},{id:"help",label:"Help & Support",icon:f.A,path:"/vdp",symbol:"Akoma"}],M=I?G.filter(e=>e.label.toLowerCase().includes(I.toLowerCase())):G;return(0,r.jsxs)("div",{className:"min-h-screen bg-background text-foreground",children:[(0,r.jsxs)("header",{className:"h-16 bg-card border-b border-border flex items-center justify-between px-6 sticky top-0 z-50 backdrop-blur-sm",role:"banner",children:[(0,r.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,r.jsx)(c.$,{variant:"ghost",size:"sm",onClick:()=>T(!z),className:"lg:hidden","aria-label":z?"Close sidebar":"Open sidebar","aria-expanded":z,children:z?(0,r.jsx)(b.A,{className:"h-5 w-5"}):(0,r.jsx)(g.A,{className:"h-5 w-5"})}),(0,r.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("div",{className:"w-8 h-8 bg-gradient-primary rounded-lg flex items-center justify-center animate-pulse-glow",children:(0,r.jsx)("div",{className:"w-6 h-6 text-primary-foreground font-bold",children:"\uD835\uDD38"})}),(0,r.jsx)("div",{className:"absolute -top-1 -right-1 w-3 h-3 bg-success rounded-full animate-pulse"})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h1",{className:"text-lg font-bold bg-gradient-to-r from-primary to-accent bg-clip-text text-transparent",children:"STIG Compliance Console"}),(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,r.jsx)(d.E,{variant:"secondary",className:"text-xs",children:(null==U||null==(s=U.organization)?void 0:s.name)||"Default Organization"}),(0,r.jsx)(d.E,{variant:"outline",className:"text-xs text-primary",children:"STIG Compliance"})]})]})]})]}),(0,r.jsx)("div",{className:"hidden md:flex items-center flex-1 max-w-md mx-8",children:(0,r.jsxs)("div",{className:"relative w-full",children:[(0,r.jsx)(v.A,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground"}),(0,r.jsx)("input",{type:"text",placeholder:"Search services, resources...","aria-label":"Search services and resources",value:I,onChange:e=>D(e.target.value),className:"w-full pl-10 pr-4 py-2 bg-input border border-border rounded-lg focus:outline-none focus:ring-2 focus:ring-primary/50"})]})}),(0,r.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,r.jsxs)("div",{className:"hidden lg:flex items-center space-x-4 text-sm text-muted-foreground",children:[(0,r.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,r.jsx)(x.A,{className:"h-4 w-4 text-success"}),(0,r.jsx)("span",{children:"System: Operational"})]}),(0,r.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,r.jsx)(h.A,{className:"h-4 w-4 text-primary"}),(0,r.jsx)("span",{children:"Region: US-East-1"})]}),(0,r.jsx)(w,{})]}),(0,r.jsx)(c.$,{variant:"ghost",size:"sm",className:"relative","aria-label":"Notifications",children:(0,r.jsx)(j.A,{className:"h-5 w-5"})}),(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,r.jsx)("div",{className:"w-8 h-8 bg-gradient-to-br from-primary to-accent rounded-full flex items-center justify-center",children:(0,r.jsx)(N.A,{className:"h-4 w-4 text-primary-foreground"})}),(0,r.jsxs)("div",{className:"hidden sm:block text-sm",children:[(0,r.jsx)("div",{className:"font-medium",children:null==F?void 0:F.email}),(0,r.jsx)("div",{className:"text-xs text-muted-foreground",children:(null==L?void 0:L.role)||"user"})]})]}),(0,r.jsx)(C,{onConfirm:()=>P()})]})]}),(0,r.jsxs)("div",{className:"flex h-[calc(100vh-4rem)]",children:[(0,r.jsxs)("nav",{"aria-label":"Main navigation",className:"\n ".concat(z?"w-64":"w-16"," \n bg-card border-r border-border transition-all duration-300 overflow-hidden\n ").concat(z?"lg:w-64":"lg:w-16","\n "),children:[(0,r.jsx)("div",{className:"p-4 space-y-2",children:M.map(e=>{let s=e.icon,a=k===e.id;return(0,r.jsxs)("div",{className:"relative group",children:[(0,r.jsxs)(c.$,{variant:a?"secondary":"ghost",size:"sm",onClick:()=>R(e.path),className:"\n w-full justify-start relative overflow-hidden\n ".concat(a?"bg-primary/10 text-primary border border-primary/20":"","\n ").concat(z?"":"px-3","\n "),children:[(0,r.jsx)(s,{className:"h-5 w-5 mr-3 flex-shrink-0"}),z&&(0,r.jsx)("span",{className:"transition-opacity duration-200",children:e.label}),a&&(0,r.jsx)("div",{className:"absolute right-2 top-1/2 transform -translate-y-1/2 opacity-30",children:(0,r.jsx)("div",{className:"w-4 h-4 text-primary animate-float",children:(0,r.jsx)(y.h,{symbolName:e.symbol,showMatrix:!1,showMeaning:!1,
1className:"w-4 h-4"})})})]}),!z&&(0,r.jsx)("div",{className:"absolute left-full ml-2 top-1/2 transform -translate-y-1/2 bg-popover border border-border rounded-md px-2 py-1 text-sm opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none z-50",children:e.label})]},e.id)})}),z&&(0,r.jsx)("div",{className:"p-4 mt-8",children:(0,r.jsx)(o.Zp,{className:"bg-gradient-to-br from-primary/5 to-accent/5 border-primary/20",children:(0,r.jsx)(o.Wu,{className:"p-4",children:(0,r.jsxs)("div",{className:"text-center",children:[(0,r.jsx)("div",{className:"w-12 h-12 mx-auto mb-2 bg-gradient-primary rounded-lg flex items-center justify-center animate-pulse-glow",children:(0,r.jsx)(y.h,{symbolName:"Gye Nyame",showMatrix:!1,showMeaning:!1,className:"w-8 h-8 text-primary-foreground"})}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground italic",children:'"Success depends upon preparedness"'}),(0,r.jsx)("p",{className:"text-xs text-primary mt-1 font-medium",children:"STIG Compliance Through Preparation"})]})})})})]}),(0,r.jsxs)("main",{className:"flex-1 overflow-auto bg-gradient-to-br from-background to-muted/20",role:"main",children:[S&&(0,r.jsx)(E.f,{tabs:S.tabs,title:S.title,subtitle:S.subtitle,showAddTab:S.showAddTab,rightContent:S.rightContent}),(0,r.jsx)("div",{className:"bg-gradient-to-r from-primary/20 to-accent/20 border-b border-primary/30 backdrop-blur-sm",children:(0,r.jsx)("div",{className:"px-6 py-4",children:(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,r.jsx)("div",{className:"w-10 h-10 bg-gradient-to-r from-primary to-accent rounded-lg flex items-center justify-center animate-pulse-glow",children:(0,r.jsx)(m.A,{className:"h-6 w-6 text-white"})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",{className:"text-lg font-bold text-primary",children:"STIG-First Compliance Dashboard"}),(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:"AI-powered CMMC-to-STIG implementation monitoring and automation"})]})]}),(0,r.jsx)(d.E,{variant:"outline",className:"bg-primary/10 text-primary border-primary/30",children:"STIG Compliance"})]}),(0,r.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,r.jsxs)(c.$,{variant:"outline",size:"sm",onClick:()=>globalThis.location.reload(),children:[(0,r.jsx)(x.A,{className:"h-4 w-4 mr-2"}),"Refresh"]}),(0,r.jsxs)(c.$,{onClick:()=>R("/asset-scanning?runScan=true"),className:"bg-gradient-to-r from-primary to-accent hover:from-primary/80 hover:to-accent/80 text-white font-semibold",children:[(0,r.jsx)(m.A,{className:"h-4 w-4 mr-2"}),"Run Scan"]})]})]})})}),a]})]}),(0,r.jsx)(A.T,{position:"bottom-right"})]})}},74075:(e,s,a)=>{a.d(s,{d:()=>n});var r=a(37876),t=a(14232),i=a(98295),l=a(56680);let n=t.forwardRef((e,s)=>{let{className:a,...t}=e;return(0,r.jsx)(i.bL,{className:(0,l.cn)("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",a),...t,ref:s,children:(0,r.jsx)(i.zi,{className:(0,l.cn)("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})})});n.displayName=i.bL.displayName},83935:(e,s,a)=>{a.d(s,{s:()=>n});var r=a(14232),t=a(29972),i=a(50607),l=a(43579);let n=()=>{let{user:e}=(0,t.As)(),{toast:s}=(0,l.dj)(),[a,n]=(0,r.useState)(null),[c,o]=(0,r.useState)(!0);(0,r.useEffect)(()=>{e?d():(n(null),o(!1))},[e]);let d=async()=>{try{o(!0);let{data:s,error:a}=await i.N.from("profiles").select("*").eq("user_id",null==e?void 0:e.id).single();if(a){console.error("Error fetching profile:",a),o(!1);return}let{data:r,error:t}=await i.N.from("user_roles").select("role, security_clearance, is_master_admin").eq("user_id",null==e?void 0:e.id).maybeSingle();t&&console.error("Error fetching role:",t);let l={...s,role:(null==r?void 0:r.role)||"viewer",security_clearance:(null==r?void 0:r.security_clearance)||"UNCLASSIFIED",master_admin:(null==r?void 0:r.is_master_admin)||!1};n(l)}catch(e){console.error("Error in fetchProfile:",e)}finally{o(!1)}},m=async r=>{if(e&&a)try{let{error:t}=await i.N.from("profiles").update(r).eq("user_id",e.id);if(t)return void s({title:"Error",description:"Failed to update profile",variant:"destructive"});await i.N.rpc("log_user_action",{action_type:"profile_updated",resource_type:"profile",resource_id:a.id,details:r}),n({...a,...r}),s({title:"Success",description:"Profile updated successfully"})}catch(e){console.error("Error updating profile:",e),s({title:"Error",description:"Failed to update profile",variant:"destructive"})}},x=()=>(null==a?void 0:a.role)==="admin"||(null==a?void 0:a.master_admin)===!0;return{profile:a,loading:c,updateProfile:m,isAdmin:x,canViewAllUsers:()=>x(),canManageUsers:()=>x(),refetch:d}}},88606:(e,s,a)=>{a.d(s,{N:()=>o});var r=a(37876),t=a(74075),i=a(14099),l=a(24113),n=a(44001),c=a(88307);let o=e=>{let{className:s}=e,a=(0,c.Zp)(),o="/dod"===(0,c.zy)().pathname;return(0,r.jsxs)("div",{className:"flex items-center space-x-3 ".concat(s),children:[(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,r.jsx)(l.A,{className:"h-4 w-4 text-muted-foreground"}),(0,r.jsx)(i.J,{htmlFor:"dashboard-mode",className:"text-sm font-medium",children:"Console"})]}),(0,r.jsx)(t.d,{id:"dashboard-mode",checked:o,onCheckedChange:e=>{e?a("/dod"):a("/dashboard")},className:"data-[state=checked]:bg-primary"}),(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,r.jsx)(n.A,{className:"h-4 w-4 text-muted-foreground"}),(0,r.jsx)(i.J,{htmlFor:"dashboard-mode",className:"text-sm font-medium",children:"DOD"})]})]})}}}]);
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.