module.exports=[94992,a=>{"use strict";let b=(0,a.i(70694).default)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);a.s(["Eye",()=>b],94992)},62606,a=>{"use strict";let b=(0,a.i(70694).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);a.s(["Check",()=>b],62606)},26943,a=>{"use strict";let b=(0,a.i(70694).default)("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);a.s(["ArrowRight",()=>b],26943)},26804,a=>{"use strict";var b=a.i(66807),c=a.i(40458),d=a.i(14220),e=a.i(86044);let f=process.env.NEXT_PUBLIC_API_URL||"http://localhost:3001";async function g(a,b){let c=await (0,e.gatedFetch)(`${f}${a}`);if(!c.ok)throw Error(await (0,e.readApiError)(c,b));return c.json()}async function h(a){let b=await (0,e.gatedFetch)(`${f}/api/xray/scan`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(!b.ok)throw Error(await (0,e.readApiError)(b,"Failed to run X-Ray scan"));return b.json()}async function i(a){let b=await (0,e.gatedFetch)(`${f}/api/xray/pick-target`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({kind:a})});if(!b.ok)throw Error(await (0,e.readApiError)(b,`Failed to open ${a} picker`));return b.json()}function j(a,b){return!(b instanceof e.FeatureLockedError)&&a<2}function k(a){let b=new URLSearchParams;for(let[c,d]of Object.entries(a))d&&"all"!==d&&"ALL"!==d&&b.set(c,d);let c=b.toString();return c?`?${c}`:""}function l(){return(0,c.useQuery)({queryKey:["xray-status"],queryFn:()=>g("/api/xray/status","Failed to fetch X-Ray status"),refetchInterval:3e4,retry:j})}function m(a={}){return(0,c.useQuery)({queryKey:["xray-history",a],queryFn:()=>g(`/api/xray/history${k({risk:a.risk,targetType:a.targetType,deep:a.deep,search:a.search?.trim()||void 0})}`,"Failed to fetch X-Ray history"),refetchInterval:3e4,retry:j})}function n(a){return(0,c.useQuery)({queryKey:["xray-history-entry",a],queryFn:()=>g(`/api/xray/history/${a}`,"Failed to fetch X-Ray scan detail"),enabled:!!a,retry:j})}function o(a=25,b={}){return(0,c.useQuery)({queryKey:["xray-activity",a,b],queryFn:()=>g(`/api/xray/activity${k({limit:String(a),kind:b.kind,status:b.status,risk:b.risk,targetType:b.targetType,search:b.search?.trim()||void 0})}`,"Failed to fetch X-Ray activity"),refetchInterval:15e3,retry:j})}function p(a=20,b={}){return(0,c.useQuery)({queryKey:["xray-watch-sessions",a,b],queryFn:()=>g(`/api/xray/watch-sessions${k({limit:String(a),state:b.state,deep:b.deep,search:b.search?.trim()||void 0})}`,"Failed to fetch X-Ray watch sessions"),refetchInterval:15e3,retry:j})}function q(){let a=(0,d.useQueryClient)();return(0,b.useMutation)({mutationFn:h,onSuccess:()=>{a.invalidateQueries({queryKey:["xray-history"]}),a.invalidateQueries({queryKey:["xray-activity"]}),a.invalidateQueries({queryKey:["xray-watch-sessions"]}),a.invalidateQueries({queryKey:["xray-status"]})}})}function r(){return(0,b.useMutation)({mutationFn:a=>i(a)})}async function s(a){let b=await (0,e.gatedFetch)(`${f}/api/xray/watch/start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(!b.ok)throw Error(await (0,e.readApiError)(b,"Failed to start watch"));return b.json()}async function t(a){let b=await (0,e.gatedFetch)(`${f}/api/xray/watch/stop`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({target:a})});if(!b.ok)throw Error(await (0,e.readApiError)(b,"Failed to stop watch"));return b.json()}function u(){return(0,c.useQuery)({queryKey:["xray-active-watchers"],queryFn:()=>g("/api/xray/watch/active","Failed to fetch active watchers"),refetchInterval:1e4})}function v(){let a=(0,d.useQueryClient)();return(0,b.useMutation)({mutationFn:s,onSuccess:()=>{a.invalidateQueries({queryKey:["xray-watch-sessions"]}),a.invalidateQueries({queryKey:["xray-active-watchers"]}),a.invalidateQueries({queryKey:["xray-status"]})}})}function w(){let a=(0,d.useQueryClient)();return(0,b.useMutation)({mutationFn:t,onSuccess:()=>{a.invalidateQueries({queryKey:["xray-watch-sessions"]}),a.invalidateQueries({queryKey:["xray-active-watchers"]}),a.invalidateQueries({queryKey:["xray-status"]})}})}a.s(["useActiveWatchers",()=>u,"usePickXRayTarget",()=>r,"useStartWatch",()=>v,"useStopWatch",()=>w,"useXRayActivity",()=>o,"useXRayHistory",()=>m,"useXRayHistoryEntry",()=>n,"useXRayScan",()=>q,"useXRayStatus",()=>l,"useXRayWatchSessions",()=>p])}];

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