hackagent-webui 0.6.5.dev72__py3-none-any.whl → 0.6.7.dev74__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. hackagent_webui/__init__.py +1 -1
  2. hackagent_webui/static/404.html +2 -2
  3. hackagent_webui/static/VERSION +1 -1
  4. hackagent_webui/static/_next/static/chunks/432-da1349ca9d0dbf5d.js +25 -0
  5. hackagent_webui/static/_next/static/chunks/{493-34228dd02f768bba.js → 493-92a293a4bf432fc7.js} +1 -1
  6. hackagent_webui/static/_next/static/chunks/583-78ba13009c3dc8f0.js +1 -0
  7. hackagent_webui/static/_next/static/chunks/666-5ee4182c3065fd65.js +1 -0
  8. hackagent_webui/static/_next/static/chunks/870-fd9b5a5e5bb99ffa.js +1 -0
  9. hackagent_webui/static/_next/static/chunks/980-cc9c16cc6103edbb.js +1 -0
  10. hackagent_webui/static/_next/static/chunks/app/agents/{page-ea6fa46f56918ab5.js → page-e8929149bce2396f.js} +1 -1
  11. hackagent_webui/static/_next/static/chunks/app/attacks/{page-9d0f6a4e82057892.js → page-4594b3d8af3cef5c.js} +1 -1
  12. hackagent_webui/static/_next/static/chunks/app/{layout-bb2a869293131472.js → layout-68a42544a2efc863.js} +1 -1
  13. hackagent_webui/static/_next/static/chunks/app/{page-e1303435339f9e4f.js → page-92fb04233e8db6e2.js} +1 -1
  14. hackagent_webui/static/_next/static/chunks/app/profile/{page-4ddc195a9862fb6f.js → page-ace2f6335f41a96a.js} +1 -1
  15. hackagent_webui/static/_next/static/chunks/app/stats/page-742d6876a3e207d9.js +1 -0
  16. hackagent_webui/static/_next/static/chunks/{main-b2abf26ddb8313ad.js → main-c5ae269c07d252e7.js} +1 -1
  17. hackagent_webui/static/_next/static/css/920420339ac947aa.css +1 -0
  18. hackagent_webui/static/agents.html +2 -2
  19. hackagent_webui/static/agents.txt +6 -6
  20. hackagent_webui/static/api-keys.html +2 -2
  21. hackagent_webui/static/api-keys.txt +5 -5
  22. hackagent_webui/static/attacks.html +2 -2
  23. hackagent_webui/static/attacks.txt +6 -6
  24. hackagent_webui/static/campaign-export/runtime.js +96 -128
  25. hackagent_webui/static/campaign-export/styles.css +1 -1
  26. hackagent_webui/static/credentials.html +2 -2
  27. hackagent_webui/static/credentials.txt +5 -5
  28. hackagent_webui/static/index.html +2 -2
  29. hackagent_webui/static/index.txt +6 -6
  30. hackagent_webui/static/profile.html +2 -2
  31. hackagent_webui/static/profile.txt +6 -6
  32. hackagent_webui/static/secrets.html +2 -2
  33. hackagent_webui/static/secrets.txt +5 -5
  34. hackagent_webui/static/stats.html +2 -2
  35. hackagent_webui/static/stats.txt +6 -6
  36. hackagent_webui/static/usage.html +2 -2
  37. hackagent_webui/static/usage.txt +5 -5
  38. {hackagent_webui-0.6.5.dev72.dist-info → hackagent_webui-0.6.7.dev74.dist-info}/METADATA +1 -1
  39. {hackagent_webui-0.6.5.dev72.dist-info → hackagent_webui-0.6.7.dev74.dist-info}/RECORD +42 -41
  40. hackagent_webui/static/_next/static/chunks/21-9b527eba32db4357.js +0 -1
  41. hackagent_webui/static/_next/static/chunks/381-b738bb0d835db190.js +0 -1
  42. hackagent_webui/static/_next/static/chunks/583-f38a7bb278cdb7b1.js +0 -1
  43. hackagent_webui/static/_next/static/chunks/874-f9e3658d3feed699.js +0 -25
  44. hackagent_webui/static/_next/static/chunks/app/stats/page-9b75118409cfc976.js +0 -1
  45. hackagent_webui/static/_next/static/css/cf5d013e1e316b2f.css +0 -1
  46. /hackagent_webui/static/_next/static/{jaJDfi8Dn3oTclRwdpEnk → v2pPXL_Ag49bJj1nZwGOt}/_buildManifest.js +0 -0
  47. /hackagent_webui/static/_next/static/{jaJDfi8Dn3oTclRwdpEnk → v2pPXL_Ag49bJj1nZwGOt}/_ssgManifest.js +0 -0
  48. {hackagent_webui-0.6.5.dev72.dist-info → hackagent_webui-0.6.7.dev74.dist-info}/WHEEL +0 -0
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[583],{53583:(e,t,r)=>{r.d(t,{i3:()=>ej,UC:()=>eP,ZL:()=>eT,Kq:()=>eb,bL:()=>eE,l9:()=>eC});var n,o=r(12115),i=r(92556),l=r(94446),a=r(3468),s=r(88142),u=r(70222),d=r(59584),c=r(95155),p="dismissableLayer.update",f=o.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),v=o.forwardRef((e,t)=>{var r,a;let{disableOutsidePointerEvents:v=!1,onEscapeKeyDown:m,onPointerDownOutside:x,onFocusOutside:g,onInteractOutside:w,onDismiss:b,...E}=e,C=o.useContext(f),[T,P]=o.useState(null),j=null!=(a=null==T?void 0:T.ownerDocument)?a:null==(r=globalThis)?void 0:r.document,[,L]=o.useState({}),R=(0,l.s)(t,e=>P(e)),k=Array.from(C.layers),[O]=[...C.layersWithOutsidePointerEventsDisabled].slice(-1),D=k.indexOf(O),A=T?k.indexOf(T):-1,N=C.layersWithOutsidePointerEventsDisabled.size>0,S=A>=D,_=function(e){var t;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null==(t=globalThis)?void 0:t.document,n=(0,u.c)(e),i=o.useRef(!1),l=o.useRef(()=>{});return o.useEffect(()=>{let e=e=>{if(e.target&&!i.current){let t=function(){y("dismissableLayer.pointerDownOutside",n,o,{discrete:!0})},o={originalEvent:e};"touch"===e.pointerType?(r.removeEventListener("click",l.current),l.current=t,r.addEventListener("click",l.current,{once:!0})):t()}else r.removeEventListener("click",l.current);i.current=!1},t=window.setTimeout(()=>{r.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(t),r.removeEventListener("pointerdown",e),r.removeEventListener("click",l.current)}},[r,n]),{onPointerDownCapture:()=>i.current=!0}}(e=>{let t=e.target,r=[...C.branches].some(e=>e.contains(t));S&&!r&&(null==x||x(e),null==w||w(e),e.defaultPrevented||null==b||b())},j),B=function(e){var t;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null==(t=globalThis)?void 0:t.document,n=(0,u.c)(e),i=o.useRef(!1);return o.useEffect(()=>{let e=e=>{e.target&&!i.current&&y("dismissableLayer.focusOutside",n,{originalEvent:e},{discrete:!1})};return r.addEventListener("focusin",e),()=>r.removeEventListener("focusin",e)},[r,n]),{onFocusCapture:()=>i.current=!0,onBlurCapture:()=>i.current=!1}}(e=>{let t=e.target;![...C.branches].some(e=>e.contains(t))&&(null==g||g(e),null==w||w(e),e.defaultPrevented||null==b||b())},j);return(0,d.U)(e=>{A===C.layers.size-1&&(null==m||m(e),!e.defaultPrevented&&b&&(e.preventDefault(),b()))},j),o.useEffect(()=>{if(T)return v&&(0===C.layersWithOutsidePointerEventsDisabled.size&&(n=j.body.style.pointerEvents,j.body.style.pointerEvents="none"),C.layersWithOutsidePointerEventsDisabled.add(T)),C.layers.add(T),h(),()=>{v&&1===C.layersWithOutsidePointerEventsDisabled.size&&(j.body.style.pointerEvents=n)}},[T,j,v,C]),o.useEffect(()=>()=>{T&&(C.layers.delete(T),C.layersWithOutsidePointerEventsDisabled.delete(T),h())},[T,C]),o.useEffect(()=>{let e=()=>L({});return document.addEventListener(p,e),()=>document.removeEventListener(p,e)},[]),(0,c.jsx)(s.sG.div,{...E,ref:R,style:{pointerEvents:N?S?"auto":"none":void 0,...e.style},onFocusCapture:(0,i.m)(e.onFocusCapture,B.onFocusCapture),onBlurCapture:(0,i.m)(e.onBlurCapture,B.onBlurCapture),onPointerDownCapture:(0,i.m)(e.onPointerDownCapture,_.onPointerDownCapture)})});function h(){let e=new CustomEvent(p);document.dispatchEvent(e)}function y(e,t,r,n){let{discrete:o}=n,i=r.originalEvent.target,l=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&i.addEventListener(e,t,{once:!0}),o?(0,s.hO)(i,l):i.dispatchEvent(l)}v.displayName="DismissableLayer",o.forwardRef((e,t)=>{let r=o.useContext(f),n=o.useRef(null),i=(0,l.s)(t,n);return o.useEffect(()=>{let e=n.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}},[r.branches]),(0,c.jsx)(s.sG.div,{...e,ref:i})}).displayName="DismissableLayerBranch";var m=r(68946),x=r(88334),g=r(58146),w=o.forwardRef((e,t)=>{let{children:r,width:n=10,height:o=5,...i}=e;return(0,c.jsx)(s.sG.svg,{...i,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:(0,c.jsx)("polygon",{points:"0,0 30,0 15,10"})})});w.displayName="Arrow";var b=r(4129),E=r(84288),C="Popper",[T,P]=(0,a.A)(C),[j,L]=T(C),R=e=>{let{__scopePopper:t,children:r}=e,[n,i]=o.useState(null);return(0,c.jsx)(j,{scope:t,anchor:n,onAnchorChange:i,children:r})};R.displayName=C;var k="PopperAnchor",O=o.forwardRef((e,t)=>{let{__scopePopper:r,virtualRef:n,...i}=e,a=L(k,r),u=o.useRef(null),d=(0,l.s)(t,u);return o.useEffect(()=>{a.onAnchorChange((null==n?void 0:n.current)||u.current)}),n?null:(0,c.jsx)(s.sG.div,{...i,ref:d})});O.displayName=k;var D="PopperContent",[A,N]=T(D),S=o.forwardRef((e,t)=>{var r,n,i,a,d,p,f,v;let{__scopePopper:h,side:y="bottom",sideOffset:m=0,align:w="center",alignOffset:C=0,arrowPadding:T=0,avoidCollisions:P=!0,collisionBoundary:j=[],collisionPadding:R=0,sticky:k="partial",hideWhenDetached:O=!1,updatePositionStrategy:N="optimized",onPlaced:S,..._}=e,B=L(D,h),[M,H]=o.useState(null),z=(0,l.s)(t,e=>H(e)),[G,Y]=o.useState(null),X=(0,E.X)(G),U=null!=(f=null==X?void 0:X.width)?f:0,q=null!=(v=null==X?void 0:X.height)?v:0,K="number"==typeof R?R:{top:0,right:0,bottom:0,left:0,...R},V=Array.isArray(j)?j:[j],Z=V.length>0,$={padding:K,boundary:V.filter(F),altBoundary:Z},{refs:J,floatingStyles:Q,placement:ee,isPositioned:et,middlewareData:er}=(0,x.we)({strategy:"fixed",placement:y+("center"!==w?"-"+w:""),whileElementsMounted:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,g.ll)(...t,{animationFrame:"always"===N})},elements:{reference:B.anchor},middleware:[(0,x.cY)({mainAxis:m+q,alignmentAxis:C}),P&&(0,x.BN)({mainAxis:!0,crossAxis:!1,limiter:"partial"===k?(0,x.ER)():void 0,...$}),P&&(0,x.UU)({...$}),(0,x.Ej)({...$,apply:e=>{let{elements:t,rects:r,availableWidth:n,availableHeight:o}=e,{width:i,height:l}=r.reference,a=t.floating.style;a.setProperty("--radix-popper-available-width","".concat(n,"px")),a.setProperty("--radix-popper-available-height","".concat(o,"px")),a.setProperty("--radix-popper-anchor-width","".concat(i,"px")),a.setProperty("--radix-popper-anchor-height","".concat(l,"px"))}}),G&&(0,x.UE)({element:G,padding:T}),I({arrowWidth:U,arrowHeight:q}),O&&(0,x.jD)({strategy:"referenceHidden",...$})]}),[en,eo]=W(ee),ei=(0,u.c)(S);(0,b.N)(()=>{et&&(null==ei||ei())},[et,ei]);let el=null==(r=er.arrow)?void 0:r.x,ea=null==(n=er.arrow)?void 0:n.y,es=(null==(i=er.arrow)?void 0:i.centerOffset)!==0,[eu,ed]=o.useState();return(0,b.N)(()=>{M&&ed(window.getComputedStyle(M).zIndex)},[M]),(0,c.jsx)("div",{ref:J.setFloating,"data-radix-popper-content-wrapper":"",style:{...Q,transform:et?Q.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:eu,"--radix-popper-transform-origin":[null==(a=er.transformOrigin)?void 0:a.x,null==(d=er.transformOrigin)?void 0:d.y].join(" "),...(null==(p=er.hide)?void 0:p.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:(0,c.jsx)(A,{scope:h,placedSide:en,onArrowChange:Y,arrowX:el,arrowY:ea,shouldHideArrow:es,children:(0,c.jsx)(s.sG.div,{"data-side":en,"data-align":eo,..._,ref:z,style:{..._.style,animation:et?void 0:"none"}})})})});S.displayName=D;var _="PopperArrow",B={top:"bottom",right:"left",bottom:"top",left:"right"},M=o.forwardRef(function(e,t){let{__scopePopper:r,...n}=e,o=N(_,r),i=B[o.placedSide];return(0,c.jsx)("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:(0,c.jsx)(w,{...n,ref:t,style:{...n.style,display:"block"}})})});function F(e){return null!==e}M.displayName=_;var I=e=>({name:"transformOrigin",options:e,fn(t){var r,n,o,i,l;let{placement:a,rects:s,middlewareData:u}=t,d=(null==(r=u.arrow)?void 0:r.centerOffset)!==0,c=d?0:e.arrowWidth,p=d?0:e.arrowHeight,[f,v]=W(a),h={start:"0%",center:"50%",end:"100%"}[v],y=(null!=(i=null==(n=u.arrow)?void 0:n.x)?i:0)+c/2,m=(null!=(l=null==(o=u.arrow)?void 0:o.y)?l:0)+p/2,x="",g="";return"bottom"===f?(x=d?h:"".concat(y,"px"),g="".concat(-p,"px")):"top"===f?(x=d?h:"".concat(y,"px"),g="".concat(s.floating.height+p,"px")):"right"===f?(x="".concat(-p,"px"),g=d?h:"".concat(m,"px")):"left"===f&&(x="".concat(s.floating.width+p,"px"),g=d?h:"".concat(m,"px")),{data:{x,y:g}}}});function W(e){let[t,r="center"]=e.split("-");return[t,r]}var H=r(47650),z=o.forwardRef((e,t)=>{var r,n;let{container:i,...l}=e,[a,u]=o.useState(!1);(0,b.N)(()=>u(!0),[]);let d=i||a&&(null==(n=globalThis)||null==(r=n.document)?void 0:r.body);return d?H.createPortal((0,c.jsx)(s.sG.div,{...l,ref:t}),d):null});z.displayName="Portal";var G=r(76842),Y=Symbol("radix.slottable"),X=r(23558),U=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),q=o.forwardRef((e,t)=>(0,c.jsx)(s.sG.span,{...e,ref:t,style:{...U,...e.style}}));q.displayName="VisuallyHidden";var[K,V]=(0,a.A)("Tooltip",[P]),Z=P(),$="TooltipProvider",J="tooltip.open",[Q,ee]=K($),et=e=>{let{__scopeTooltip:t,delayDuration:r=700,skipDelayDuration:n=300,disableHoverableContent:i=!1,children:l}=e,a=o.useRef(!0),s=o.useRef(!1),u=o.useRef(0);return o.useEffect(()=>{let e=u.current;return()=>window.clearTimeout(e)},[]),(0,c.jsx)(Q,{scope:t,isOpenDelayedRef:a,delayDuration:r,onOpen:o.useCallback(()=>{window.clearTimeout(u.current),a.current=!1},[]),onClose:o.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>a.current=!0,n)},[n]),isPointerInTransitRef:s,onPointerInTransitChange:o.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:l})};et.displayName=$;var er="Tooltip",[en,eo]=K(er),ei=e=>{let{__scopeTooltip:t,children:r,open:n,defaultOpen:i,onOpenChange:l,disableHoverableContent:a,delayDuration:s}=e,u=ee(er,e.__scopeTooltip),d=Z(t),[p,f]=o.useState(null),v=(0,m.B)(),h=o.useRef(0),y=null!=a?a:u.disableHoverableContent,x=null!=s?s:u.delayDuration,g=o.useRef(!1),[w,b]=(0,X.i)({prop:n,defaultProp:null!=i&&i,onChange:e=>{e?(u.onOpen(),document.dispatchEvent(new CustomEvent(J))):u.onClose(),null==l||l(e)},caller:er}),E=o.useMemo(()=>w?g.current?"delayed-open":"instant-open":"closed",[w]),C=o.useCallback(()=>{window.clearTimeout(h.current),h.current=0,g.current=!1,b(!0)},[b]),T=o.useCallback(()=>{window.clearTimeout(h.current),h.current=0,b(!1)},[b]),P=o.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{g.current=!0,b(!0),h.current=0},x)},[x,b]);return o.useEffect(()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)},[]),(0,c.jsx)(R,{...d,children:(0,c.jsx)(en,{scope:t,contentId:v,open:w,stateAttribute:E,trigger:p,onTriggerChange:f,onTriggerEnter:o.useCallback(()=>{u.isOpenDelayedRef.current?P():C()},[u.isOpenDelayedRef,P,C]),onTriggerLeave:o.useCallback(()=>{y?T():(window.clearTimeout(h.current),h.current=0)},[T,y]),onOpen:C,onClose:T,disableHoverableContent:y,children:r})})};ei.displayName=er;var el="TooltipTrigger",ea=o.forwardRef((e,t)=>{let{__scopeTooltip:r,...n}=e,a=eo(el,r),u=ee(el,r),d=Z(r),p=o.useRef(null),f=(0,l.s)(t,p,a.onTriggerChange),v=o.useRef(!1),h=o.useRef(!1),y=o.useCallback(()=>v.current=!1,[]);return o.useEffect(()=>()=>document.removeEventListener("pointerup",y),[y]),(0,c.jsx)(O,{asChild:!0,...d,children:(0,c.jsx)(s.sG.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...n,ref:f,onPointerMove:(0,i.m)(e.onPointerMove,e=>{"touch"!==e.pointerType&&(h.current||u.isPointerInTransitRef.current||(a.onTriggerEnter(),h.current=!0))}),onPointerLeave:(0,i.m)(e.onPointerLeave,()=>{a.onTriggerLeave(),h.current=!1}),onPointerDown:(0,i.m)(e.onPointerDown,()=>{a.open&&a.onClose(),v.current=!0,document.addEventListener("pointerup",y,{once:!0})}),onFocus:(0,i.m)(e.onFocus,()=>{v.current||a.onOpen()}),onBlur:(0,i.m)(e.onBlur,a.onClose),onClick:(0,i.m)(e.onClick,a.onClose)})})});ea.displayName=el;var es="TooltipPortal",[eu,ed]=K(es,{forceMount:void 0}),ec=e=>{let{__scopeTooltip:t,forceMount:r,children:n,container:o}=e,i=eo(es,t);return(0,c.jsx)(eu,{scope:t,forceMount:r,children:(0,c.jsx)(G.C,{present:r||i.open,children:(0,c.jsx)(z,{asChild:!0,container:o,children:n})})})};ec.displayName=es;var ep="TooltipContent",ef=o.forwardRef((e,t)=>{let r=ed(ep,e.__scopeTooltip),{forceMount:n=r.forceMount,side:o="top",...i}=e,l=eo(ep,e.__scopeTooltip);return(0,c.jsx)(G.C,{present:n||l.open,children:l.disableHoverableContent?(0,c.jsx)(ex,{side:o,...i,ref:t}):(0,c.jsx)(ev,{side:o,...i,ref:t})})}),ev=o.forwardRef((e,t)=>{let r=eo(ep,e.__scopeTooltip),n=ee(ep,e.__scopeTooltip),i=o.useRef(null),a=(0,l.s)(t,i),[s,u]=o.useState(null),{trigger:d,onClose:p}=r,f=i.current,{onPointerInTransitChange:v}=n,h=o.useCallback(()=>{u(null),v(!1)},[v]),y=o.useCallback((e,t)=>{let r=e.currentTarget,n={x:e.clientX,y:e.clientY},o=function(e,t){let r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(r,n,o,i)){case i:return"left";case o:return"right";case r:return"top";case n:return"bottom";default:throw Error("unreachable")}}(n,r.getBoundingClientRect());u(function(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:1*!!(e.y>t.y)),function(e){if(e.length<=1)return e.slice();let t=[];for(let r=0;r<e.length;r++){let n=e[r];for(;t.length>=2;){let e=t[t.length-1],r=t[t.length-2];if((e.x-r.x)*(n.y-r.y)>=(e.y-r.y)*(n.x-r.x))t.pop();else break}t.push(n)}t.pop();let r=[];for(let t=e.length-1;t>=0;t--){let n=e[t];for(;r.length>=2;){let e=r[r.length-1],t=r[r.length-2];if((e.x-t.x)*(n.y-t.y)>=(e.y-t.y)*(n.x-t.x))r.pop();else break}r.push(n)}return(r.pop(),1===t.length&&1===r.length&&t[0].x===r[0].x&&t[0].y===r[0].y)?t:t.concat(r)}(t)}([...function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5,n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r})}return n}(n,o),...function(e){let{top:t,right:r,bottom:n,left:o}=e;return[{x:o,y:t},{x:r,y:t},{x:r,y:n},{x:o,y:n}]}(t.getBoundingClientRect())])),v(!0)},[v]);return o.useEffect(()=>()=>h(),[h]),o.useEffect(()=>{if(d&&f){let e=e=>y(e,f),t=e=>y(e,d);return d.addEventListener("pointerleave",e),f.addEventListener("pointerleave",t),()=>{d.removeEventListener("pointerleave",e),f.removeEventListener("pointerleave",t)}}},[d,f,y,h]),o.useEffect(()=>{if(s){let e=e=>{let t=e.target,r={x:e.clientX,y:e.clientY},n=(null==d?void 0:d.contains(t))||(null==f?void 0:f.contains(t)),o=!function(e,t){let{x:r,y:n}=e,o=!1;for(let e=0,i=t.length-1;e<t.length;i=e++){let l=t[e],a=t[i],s=l.x,u=l.y,d=a.x,c=a.y;u>n!=c>n&&r<(d-s)*(n-u)/(c-u)+s&&(o=!o)}return o}(r,s);n?h():o&&(h(),p())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}},[d,f,s,p,h]),(0,c.jsx)(ex,{...e,ref:a})}),[eh,ey]=K(er,{isInside:!1}),em=function(e){let t=({children:e})=>(0,c.jsx)(c.Fragment,{children:e});return t.displayName=`${e}.Slottable`,t.__radixId=Y,t}("TooltipContent"),ex=o.forwardRef((e,t)=>{let{__scopeTooltip:r,children:n,"aria-label":i,onEscapeKeyDown:l,onPointerDownOutside:a,...s}=e,u=eo(ep,r),d=Z(r),{onClose:p}=u;return o.useEffect(()=>(document.addEventListener(J,p),()=>document.removeEventListener(J,p)),[p]),o.useEffect(()=>{if(u.trigger){let e=e=>{let t=e.target;(null==t?void 0:t.contains(u.trigger))&&p()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}},[u.trigger,p]),(0,c.jsx)(v,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:a,onFocusOutside:e=>e.preventDefault(),onDismiss:p,children:(0,c.jsxs)(S,{"data-state":u.stateAttribute,...d,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[(0,c.jsx)(em,{children:n}),(0,c.jsx)(eh,{scope:r,isInside:!0,children:(0,c.jsx)(q,{id:u.contentId,role:"tooltip",children:i||n})})]})})});ef.displayName=ep;var eg="TooltipArrow",ew=o.forwardRef((e,t)=>{let{__scopeTooltip:r,...n}=e,o=Z(r);return ey(eg,r).isInside?null:(0,c.jsx)(M,{...o,...n,ref:t})});ew.displayName=eg;var eb=et,eE=ei,eC=ea,eT=ec,eP=ef,ej=ew}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[666],{8803:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]])},20562:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]])},20639:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]])},21786:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]])},37772:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]])},38392:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]])},40887:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("laptop",[["path",{d:"M20 16V7a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v9m16 0H4m16 0 1.28 2.55a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45L4 16",key:"tarvll"}]])},41808:(e,t,r)=>{r.d(t,{uB:()=>D});var n=/[\\\/_+.#"@\[\(\{&]/,l=/[\\\/_+.#"@\[\(\{&]/g,a=/[\s-]/,i=/[\s-]/g;function u(e){return e.toLowerCase().replace(i," ")}var o=r(88292),c=r(12115),d=r(88142),s=r(68946),f=r(94446),m='[cmdk-group=""]',v='[cmdk-group-items=""]',p='[cmdk-item=""]',h="".concat(p,':not([aria-disabled="true"])'),g="cmdk-item-select",y="data-value",b=(e,t,r)=>(function(e,t,r){return function e(t,r,u,o,c,d,s){if(d===r.length)return c===t.length?1:.99;var f=`${c},${d}`;if(void 0!==s[f])return s[f];for(var m,v,p,h,g=o.charAt(d),y=u.indexOf(g,c),b=0;y>=0;)(m=e(t,r,u,o,y+1,d+1,s))>b&&(y===c?m*=1:n.test(t.charAt(y-1))?(m*=.8,(p=t.slice(c,y-1).match(l))&&c>0&&(m*=Math.pow(.999,p.length))):a.test(t.charAt(y-1))?(m*=.9,(h=t.slice(c,y-1).match(i))&&c>0&&(m*=Math.pow(.999,h.length))):(m*=.17,c>0&&(m*=Math.pow(.999,y-c))),t.charAt(y)!==r.charAt(d)&&(m*=.9999)),(m<.1&&u.charAt(y-1)===o.charAt(d+1)||o.charAt(d+1)===o.charAt(d)&&u.charAt(y-1)!==o.charAt(d))&&.1*(v=e(t,r,u,o,y+1,d+2,s))>m&&(m=.1*v),m>b&&(b=m),y=u.indexOf(g,y+1);return s[f]=b,b}(e=r&&r.length>0?`${e+" "+r.join(" ")}`:e,t,u(e),u(t),0,0,{})})(e,t,r),w=c.createContext(void 0),k=()=>c.useContext(w),E=c.createContext(void 0),A=()=>c.useContext(E),x=c.createContext(void 0),C=c.forwardRef((e,t)=>{let r=T(()=>{var t,r;return{search:"",value:null!=(r=null!=(t=e.value)?t:e.defaultValue)?r:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),n=T(()=>new Set),l=T(()=>new Map),a=T(()=>new Map),i=T(()=>new Set),u=j(e),{label:o,children:f,value:k,onValueChange:A,filter:x,shouldFilter:C,loop:M,disablePointerSelection:S=!1,vimBindings:R=!0,...N}=e,I=(0,s.B)(),O=(0,s.B)(),D=(0,s.B)(),L=c.useRef(null),F=U();P(()=>{if(void 0!==k){let e=k.trim();r.current.value=e,B.emit()}},[k]),P(()=>{F(6,W)},[]);let B=c.useMemo(()=>({subscribe:e=>(i.current.add(e),()=>i.current.delete(e)),snapshot:()=>r.current,setState:(e,t,n)=>{var l,a,i,o;if(!Object.is(r.current[e],t)){if(r.current[e]=t,"search"===e)K(),z(),F(1,G);else if("value"===e){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let e=document.getElementById(D);e?e.focus():null==(l=document.getElementById(I))||l.focus()}if(F(7,()=>{var e;r.current.selectedItemId=null==(e=$())?void 0:e.id,B.emit()}),n||F(5,W),(null==(a=u.current)?void 0:a.value)!==void 0){null==(o=(i=u.current).onValueChange)||o.call(i,null!=t?t:"");return}}B.emit()}},emit:()=>{i.current.forEach(e=>e())}}),[]),q=c.useMemo(()=>({value:(e,t,n)=>{var l;t!==(null==(l=a.current.get(e))?void 0:l.value)&&(a.current.set(e,{value:t,keywords:n}),r.current.filtered.items.set(e,H(t,n)),F(2,()=>{z(),B.emit()}))},item:(e,t)=>(n.current.add(e),t&&(l.current.has(t)?l.current.get(t).add(e):l.current.set(t,new Set([e]))),F(3,()=>{K(),z(),r.current.value||G(),B.emit()}),()=>{a.current.delete(e),n.current.delete(e),r.current.filtered.items.delete(e);let t=$();F(4,()=>{K(),(null==t?void 0:t.getAttribute("id"))===e&&G(),B.emit()})}),group:e=>(l.current.has(e)||l.current.set(e,new Set),()=>{a.current.delete(e),l.current.delete(e)}),filter:()=>u.current.shouldFilter,label:o||e["aria-label"],getDisablePointerSelection:()=>u.current.disablePointerSelection,listId:I,inputId:D,labelId:O,listInnerRef:L}),[]);function H(e,t){var n,l;let a=null!=(l=null==(n=u.current)?void 0:n.filter)?l:b;return e?a(e,r.current.search,t):0}function z(){if(!r.current.search||!1===u.current.shouldFilter)return;let e=r.current.filtered.items,t=[];r.current.filtered.groups.forEach(r=>{let n=l.current.get(r),a=0;n.forEach(t=>{a=Math.max(e.get(t),a)}),t.push([r,a])});let n=L.current;J().sort((t,r)=>{var n,l;let a=t.getAttribute("id"),i=r.getAttribute("id");return(null!=(n=e.get(i))?n:0)-(null!=(l=e.get(a))?l:0)}).forEach(e=>{let t=e.closest(v);t?t.appendChild(e.parentElement===t?e:e.closest("".concat(v," > *"))):n.appendChild(e.parentElement===n?e:e.closest("".concat(v," > *")))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{var t;let r=null==(t=L.current)?void 0:t.querySelector("".concat(m,"[").concat(y,'="').concat(encodeURIComponent(e[0]),'"]'));null==r||r.parentElement.appendChild(r)})}function G(){let e=J().find(e=>"true"!==e.getAttribute("aria-disabled")),t=null==e?void 0:e.getAttribute(y);B.setState("value",t||void 0)}function K(){var e,t,i,o;if(!r.current.search||!1===u.current.shouldFilter){r.current.filtered.count=n.current.size;return}r.current.filtered.groups=new Set;let c=0;for(let l of n.current){let n=H(null!=(t=null==(e=a.current.get(l))?void 0:e.value)?t:"",null!=(o=null==(i=a.current.get(l))?void 0:i.keywords)?o:[]);r.current.filtered.items.set(l,n),n>0&&c++}for(let[e,t]of l.current)for(let n of t)if(r.current.filtered.items.get(n)>0){r.current.filtered.groups.add(e);break}r.current.filtered.count=c}function W(){var e,t,r;let n=$();n&&((null==(e=n.parentElement)?void 0:e.firstChild)===n&&(null==(r=null==(t=n.closest(m))?void 0:t.querySelector('[cmdk-group-heading=""]'))||r.scrollIntoView({block:"nearest"})),n.scrollIntoView({block:"nearest"}))}function $(){var e;return null==(e=L.current)?void 0:e.querySelector("".concat(p,'[aria-selected="true"]'))}function J(){var e;return Array.from((null==(e=L.current)?void 0:e.querySelectorAll(h))||[])}function Z(e){let t=J()[e];t&&B.setState("value",t.getAttribute(y))}function Q(e){var t;let r=$(),n=J(),l=n.findIndex(e=>e===r),a=n[l+e];null!=(t=u.current)&&t.loop&&(a=l+e<0?n[n.length-1]:l+e===n.length?n[0]:n[l+e]),a&&B.setState("value",a.getAttribute(y))}function X(e){let t=$(),r=null==t?void 0:t.closest(m),n;for(;r&&!n;)n=null==(r=e>0?function(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}(r,m):function(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}(r,m))?void 0:r.querySelector(h);n?B.setState("value",n.getAttribute(y)):Q(e)}let Y=()=>Z(J().length-1),ee=e=>{e.preventDefault(),e.metaKey?Y():e.altKey?X(1):Q(1)},et=e=>{e.preventDefault(),e.metaKey?Z(0):e.altKey?X(-1):Q(-1)};return c.createElement(d.sG.div,{ref:t,tabIndex:-1,...N,"cmdk-root":"",onKeyDown:e=>{var t;null==(t=N.onKeyDown)||t.call(N,e);let r=e.nativeEvent.isComposing||229===e.keyCode;if(!(e.defaultPrevented||r))switch(e.key){case"n":case"j":R&&e.ctrlKey&&ee(e);break;case"ArrowDown":ee(e);break;case"p":case"k":R&&e.ctrlKey&&et(e);break;case"ArrowUp":et(e);break;case"Home":e.preventDefault(),Z(0);break;case"End":e.preventDefault(),Y();break;case"Enter":{e.preventDefault();let t=$();if(t){let e=new Event(g);t.dispatchEvent(e)}}}}},c.createElement("label",{"cmdk-label":"",htmlFor:q.inputId,id:q.labelId,style:_},o),V(e,e=>c.createElement(E.Provider,{value:B},c.createElement(w.Provider,{value:q},e))))}),M=c.forwardRef((e,t)=>{var r,n;let l=(0,s.B)(),a=c.useRef(null),i=c.useContext(x),u=k(),o=j(e),m=null!=(n=null==(r=o.current)?void 0:r.forceMount)?n:null==i?void 0:i.forceMount;P(()=>{if(!m)return u.item(l,null==i?void 0:i.id)},[m]);let v=F(l,a,[e.value,e.children,a],e.keywords),p=A(),h=L(e=>e.value&&e.value===v.current),y=L(e=>!!m||!1===u.filter()||!e.search||e.filtered.items.get(l)>0);function b(){var e,t;w(),null==(t=(e=o.current).onSelect)||t.call(e,v.current)}function w(){p.setState("value",v.current,!0)}if(c.useEffect(()=>{let t=a.current;if(!(!t||e.disabled))return t.addEventListener(g,b),()=>t.removeEventListener(g,b)},[y,e.onSelect,e.disabled]),!y)return null;let{disabled:E,value:C,onSelect:M,forceMount:S,keywords:R,...N}=e;return c.createElement(d.sG.div,{ref:(0,f.t)(a,t),...N,id:l,"cmdk-item":"",role:"option","aria-disabled":!!E,"aria-selected":!!h,"data-disabled":!!E,"data-selected":!!h,onPointerMove:E||u.getDisablePointerSelection()?void 0:w,onClick:E?void 0:b},e.children)}),S=c.forwardRef((e,t)=>{let{heading:r,children:n,forceMount:l,...a}=e,i=(0,s.B)(),u=c.useRef(null),o=c.useRef(null),m=(0,s.B)(),v=k(),p=L(e=>!!l||!1===v.filter()||!e.search||e.filtered.groups.has(i));P(()=>v.group(i),[]),F(i,u,[e.value,e.heading,o]);let h=c.useMemo(()=>({id:i,forceMount:l}),[l]);return c.createElement(d.sG.div,{ref:(0,f.t)(u,t),...a,"cmdk-group":"",role:"presentation",hidden:!p||void 0},r&&c.createElement("div",{ref:o,"cmdk-group-heading":"","aria-hidden":!0,id:m},r),V(e,e=>c.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?m:void 0},c.createElement(x.Provider,{value:h},e))))}),R=c.forwardRef((e,t)=>{let{alwaysRender:r,...n}=e,l=c.useRef(null),a=L(e=>!e.search);return r||a?c.createElement(d.sG.div,{ref:(0,f.t)(l,t),...n,"cmdk-separator":"",role:"separator"}):null}),N=c.forwardRef((e,t)=>{let{onValueChange:r,...n}=e,l=null!=e.value,a=A(),i=L(e=>e.search),u=L(e=>e.selectedItemId),o=k();return c.useEffect(()=>{null!=e.value&&a.setState("search",e.value)},[e.value]),c.createElement(d.sG.input,{ref:t,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":o.listId,"aria-labelledby":o.labelId,"aria-activedescendant":u,id:o.inputId,type:"text",value:l?e.value:i,onChange:e=>{l||a.setState("search",e.target.value),null==r||r(e.target.value)}})}),I=c.forwardRef((e,t)=>{let{children:r,label:n="Suggestions",...l}=e,a=c.useRef(null),i=c.useRef(null),u=L(e=>e.selectedItemId),o=k();return c.useEffect(()=>{if(i.current&&a.current){let e=i.current,t=a.current,r,n=new ResizeObserver(()=>{r=requestAnimationFrame(()=>{let r=e.offsetHeight;t.style.setProperty("--cmdk-list-height",r.toFixed(1)+"px")})});return n.observe(e),()=>{cancelAnimationFrame(r),n.unobserve(e)}}},[]),c.createElement(d.sG.div,{ref:(0,f.t)(a,t),...l,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":u,"aria-label":n,id:o.listId},V(e,e=>c.createElement("div",{ref:(0,f.t)(i,o.listInnerRef),"cmdk-list-sizer":""},e)))}),O=c.forwardRef((e,t)=>{let{open:r,onOpenChange:n,overlayClassName:l,contentClassName:a,container:i,...u}=e;return c.createElement(o.bL,{open:r,onOpenChange:n},c.createElement(o.ZL,{container:i},c.createElement(o.hJ,{"cmdk-overlay":"",className:l}),c.createElement(o.UC,{"aria-label":e.label,"cmdk-dialog":"",className:a},c.createElement(C,{ref:t,...u}))))}),D=Object.assign(C,{List:I,Item:M,Input:N,Group:S,Separator:R,Dialog:O,Empty:c.forwardRef((e,t)=>L(e=>0===e.filtered.count)?c.createElement(d.sG.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Loading:c.forwardRef((e,t)=>{let{progress:r,children:n,label:l="Loading...",...a}=e;return c.createElement(d.sG.div,{ref:t,...a,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":l},V(e,e=>c.createElement("div",{"aria-hidden":!0},e)))})});function j(e){let t=c.useRef(e);return P(()=>{t.current=e}),t}var P="undefined"==typeof window?c.useEffect:c.useLayoutEffect;function T(e){let t=c.useRef();return void 0===t.current&&(t.current=e()),t}function L(e){let t=A(),r=()=>e(t.snapshot());return c.useSyncExternalStore(t.subscribe,r,r)}function F(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],l=c.useRef(),a=k();return P(()=>{var i;let u=(()=>{var e;for(let t of r){if("string"==typeof t)return t.trim();if("object"==typeof t&&"current"in t)return t.current?null==(e=t.current.textContent)?void 0:e.trim():l.current}})(),o=n.map(e=>e.trim());a.value(e,u,o),null==(i=t.current)||i.setAttribute(y,u),l.current=u}),l}var U=()=>{let[e,t]=c.useState(),r=T(()=>new Map);return P(()=>{r.current.forEach(e=>e()),r.current=new Map},[e]),(e,n)=>{r.current.set(e,n),t({})}};function V(e,t){let r,{asChild:n,children:l}=e;return n&&c.isValidElement(l)?c.cloneElement("function"==typeof(r=l.type)?r(l.props):"render"in r?r.render(l.props):l,{ref:l.ref},t(l.props.children)):t(l)}var _={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"}},46046:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]])},49578:(e,t,r)=>{r.d(t,{Ke:()=>A,R6:()=>k,bL:()=>M});var n=r(12115);"undefined"!=typeof window&&window.document&&window.document.createElement;var l=r(3468),a=r(23558),i=r(4129),u=r(94446);r(47650);var o=r(32467),c=r(95155),d=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let r=(0,o.TL)(`Primitive.${t}`),l=n.forwardRef((e,n)=>{let{asChild:l,...a}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,c.jsx)(l?r:t,{...a,ref:n})});return l.displayName=`Primitive.${t}`,{...e,[t]:l}},{}),s=e=>{let{present:t,children:r}=e,l=function(e){var t,r;let[l,a]=n.useState(),u=n.useRef(null),o=n.useRef(e),c=n.useRef("none"),[d,s]=(t=e?"mounted":"unmounted",r={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},n.useReducer((e,t)=>{let n=r[e][t];return null!=n?n:e},t));return n.useEffect(()=>{let e=f(u.current);c.current="mounted"===d?e:"none"},[d]),(0,i.N)(()=>{let t=u.current,r=o.current;if(r!==e){let n=c.current,l=f(t);e?s("MOUNT"):"none"===l||(null==t?void 0:t.display)==="none"?s("UNMOUNT"):r&&n!==l?s("ANIMATION_OUT"):s("UNMOUNT"),o.current=e}},[e,s]),(0,i.N)(()=>{if(l){var e;let t,r=null!=(e=l.ownerDocument.defaultView)?e:window,n=e=>{let n=f(u.current).includes(CSS.escape(e.animationName));if(e.target===l&&n&&(s("ANIMATION_END"),!o.current)){let e=l.style.animationFillMode;l.style.animationFillMode="forwards",t=r.setTimeout(()=>{"forwards"===l.style.animationFillMode&&(l.style.animationFillMode=e)})}},a=e=>{e.target===l&&(c.current=f(u.current))};return l.addEventListener("animationstart",a),l.addEventListener("animationcancel",n),l.addEventListener("animationend",n),()=>{r.clearTimeout(t),l.removeEventListener("animationstart",a),l.removeEventListener("animationcancel",n),l.removeEventListener("animationend",n)}}s("ANIMATION_END")},[l,s]),{isPresent:["mounted","unmountSuspended"].includes(d),ref:n.useCallback(e=>{u.current=e?getComputedStyle(e):null,a(e)},[])}}(t),a="function"==typeof r?r({present:l.isPresent}):n.Children.only(r),o=(0,u.s)(l.ref,function(e){var t,r;let n=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,l=n&&"isReactWarning"in n&&n.isReactWarning;return l?e.ref:(l=(n=null==(r=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:r.get)&&"isReactWarning"in n&&n.isReactWarning)?e.props.ref:e.props.ref||e.ref}(a));return"function"==typeof r||l.isPresent?n.cloneElement(a,{ref:o}):null};function f(e){return(null==e?void 0:e.animationName)||"none"}s.displayName="Presence";var m=r(68946),v="Collapsible",[p,h]=(0,l.A)(v),[g,y]=p(v),b=n.forwardRef((e,t)=>{let{__scopeCollapsible:r,open:l,defaultOpen:i,disabled:u,onOpenChange:o,...s}=e,[f,p]=(0,a.i)({prop:l,defaultProp:null!=i&&i,onChange:o,caller:v});return(0,c.jsx)(g,{scope:r,disabled:u,contentId:(0,m.B)(),open:f,onOpenToggle:n.useCallback(()=>p(e=>!e),[p]),children:(0,c.jsx)(d.div,{"data-state":C(f),"data-disabled":u?"":void 0,...s,ref:t})})});b.displayName=v;var w="CollapsibleTrigger",k=n.forwardRef((e,t)=>{let{__scopeCollapsible:r,...n}=e,l=y(w,r);return(0,c.jsx)(d.button,{type:"button","aria-controls":l.contentId,"aria-expanded":l.open||!1,"data-state":C(l.open),"data-disabled":l.disabled?"":void 0,disabled:l.disabled,...n,ref:t,onClick:function(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(e?.(n),!1===r||!n.defaultPrevented)return t?.(n)}}(e.onClick,l.onOpenToggle)})});k.displayName=w;var E="CollapsibleContent",A=n.forwardRef((e,t)=>{let{forceMount:r,...n}=e,l=y(E,e.__scopeCollapsible);return(0,c.jsx)(s,{present:r||l.open,children:e=>{let{present:r}=e;return(0,c.jsx)(x,{...n,ref:t,present:r})}})});A.displayName=E;var x=n.forwardRef((e,t)=>{let{__scopeCollapsible:r,present:l,children:a,...o}=e,s=y(E,r),[f,m]=n.useState(l),v=n.useRef(null),p=(0,u.s)(t,v),h=n.useRef(0),g=h.current,b=n.useRef(0),w=b.current,k=s.open||f,A=n.useRef(k),x=n.useRef(void 0);return n.useEffect(()=>{let e=requestAnimationFrame(()=>A.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,i.N)(()=>{let e=v.current;if(e){x.current=x.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration="0s",e.style.animationName="none";let t=e.getBoundingClientRect();h.current=t.height,b.current=t.width,A.current||(e.style.transitionDuration=x.current.transitionDuration,e.style.animationName=x.current.animationName),m(l)}},[s.open,l]),(0,c.jsx)(d.div,{"data-state":C(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!k,...o,ref:p,style:{"--radix-collapsible-content-height":g?"".concat(g,"px"):void 0,"--radix-collapsible-content-width":w?"".concat(w,"px"):void 0,...e.style},children:k&&a})});function C(e){return e?"open":"closed"}var M=b},86651:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]])},93779:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]])}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[870],{58146:(e,t,n)=>{let r;n.d(t,{UE:()=>ex,ll:()=>ep,rD:()=>eR,UU:()=>ey,jD:()=>ev,ER:()=>eb,cY:()=>em,BN:()=>eg,Ej:()=>ew});let i=["top","right","bottom","left"],o=Math.min,l=Math.max,f=Math.round,a=Math.floor,u=e=>({x:e,y:e}),c={left:"right",right:"left",bottom:"top",top:"bottom"};function s(e,t){return"function"==typeof e?e(t):e}function d(e){return e.split("-")[0]}function h(e){return e.split("-")[1]}function p(e){return"x"===e?"y":"x"}function m(e){return"y"===e?"height":"width"}function g(e){let t=e[0];return"t"===t||"b"===t?"y":"x"}function y(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}let w=["left","right"],v=["right","left"],x=["top","bottom"],b=["bottom","top"];function R(e){let t=d(e);return c[t]+e.slice(t.length)}function E(e){return"number"!=typeof e?{top:0,right:0,bottom:0,left:0,...e}:{top:e,right:e,bottom:e,left:e}}function A(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function O(e,t,n){let r,{reference:i,floating:o}=e,l=g(t),f=p(g(t)),a=m(f),u=d(t),c="y"===l,s=i.x+i.width/2-o.width/2,y=i.y+i.height/2-o.height/2,w=i[a]/2-o[a]/2;switch(u){case"top":r={x:s,y:i.y-o.height};break;case"bottom":r={x:s,y:i.y+i.height};break;case"right":r={x:i.x+i.width,y:y};break;case"left":r={x:i.x-o.width,y:y};break;default:r={x:i.x,y:i.y}}switch(h(t)){case"start":r[f]-=w*(n&&c?-1:1);break;case"end":r[f]+=w*(n&&c?-1:1)}return r}async function L(e,t){var n;void 0===t&&(t={});let{x:r,y:i,platform:o,rects:l,elements:f,strategy:a}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:h=!1,padding:p=0}=s(t,e),m=E(p),g=f[h?"floating"===d?"reference":"floating":d],y=A(await o.getClippingRect({element:null==(n=await (null==o.isElement?void 0:o.isElement(g)))||n?g:g.contextElement||await (null==o.getDocumentElement?void 0:o.getDocumentElement(f.floating)),boundary:u,rootBoundary:c,strategy:a})),w="floating"===d?{x:r,y:i,width:l.floating.width,height:l.floating.height}:l.reference,v=await (null==o.getOffsetParent?void 0:o.getOffsetParent(f.floating)),x=await (null==o.isElement?void 0:o.isElement(v))&&await (null==o.getScale?void 0:o.getScale(v))||{x:1,y:1},b=A(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:w,offsetParent:v,strategy:a}):w);return{top:(y.top-b.top+m.top)/x.y,bottom:(b.bottom-y.bottom+m.bottom)/x.y,left:(y.left-b.left+m.left)/x.x,right:(b.right-y.right+m.right)/x.x}}let S=async(e,t,n)=>{let{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:l}=n,f=l.detectOverflow?l:{...l,detectOverflow:L},a=await (null==l.isRTL?void 0:l.isRTL(t)),u=await l.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:s}=O(u,r,a),d=r,h=0,p={};for(let n=0;n<o.length;n++){let m=o[n];if(!m)continue;let{name:g,fn:y}=m,{x:w,y:v,data:x,reset:b}=await y({x:c,y:s,initialPlacement:r,placement:d,strategy:i,middlewareData:p,rects:u,platform:f,elements:{reference:e,floating:t}});c=null!=w?w:c,s=null!=v?v:s,p[g]={...p[g],...x},b&&h<50&&(h++,"object"==typeof b&&(b.placement&&(d=b.placement),b.rects&&(u=!0===b.rects?await l.getElementRects({reference:e,floating:t,strategy:i}):b.rects),{x:c,y:s}=O(u,d,a)),n=-1)}return{x:c,y:s,placement:d,strategy:i,middlewareData:p}};function C(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function T(e){return i.some(t=>e[t]>=0)}let D=new Set(["left","top"]);async function P(e,t){let{placement:n,platform:r,elements:i}=e,o=await (null==r.isRTL?void 0:r.isRTL(i.floating)),l=d(n),f=h(n),a="y"===g(n),u=D.has(l)?-1:1,c=o&&a?-1:1,p=s(t,e),{mainAxis:m,crossAxis:y,alignmentAxis:w}="number"==typeof p?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return f&&"number"==typeof w&&(y="end"===f?-1*w:w),a?{x:y*c,y:m*u}:{x:m*u,y:y*c}}function k(){return"undefined"!=typeof window}function W(e){return F(e)?(e.nodeName||"").toLowerCase():"#document"}function j(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function H(e){var t;return null==(t=(F(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function F(e){return!!k()&&(e instanceof Node||e instanceof j(e).Node)}function N(e){return!!k()&&(e instanceof Element||e instanceof j(e).Element)}function M(e){return!!k()&&(e instanceof HTMLElement||e instanceof j(e).HTMLElement)}function V(e){return!!k()&&"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof j(e).ShadowRoot)}function _(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=X(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&"inline"!==i&&"contents"!==i}function B(e){try{if(e.matches(":popover-open"))return!0}catch(e){}try{return e.matches(":modal")}catch(e){return!1}}let z=/transform|translate|scale|rotate|perspective|filter/,U=/paint|layout|strict|content/,$=e=>!!e&&"none"!==e;function I(e){let t=N(e)?X(e):e;return $(t.transform)||$(t.translate)||$(t.scale)||$(t.rotate)||$(t.perspective)||!Y()&&($(t.backdropFilter)||$(t.filter))||z.test(t.willChange||"")||U.test(t.contain||"")}function Y(){return null==r&&(r="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),r}function q(e){return/^(html|body|#document)$/.test(W(e))}function X(e){return j(e).getComputedStyle(e)}function G(e){return N(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Z(e){if("html"===W(e))return e;let t=e.assignedSlot||e.parentNode||V(e)&&e.host||H(e);return V(t)?t.host:t}function J(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);let i=function e(t){let n=Z(t);return q(n)?t.ownerDocument?t.ownerDocument.body:t.body:M(n)&&_(n)?n:e(n)}(e),o=i===(null==(r=e.ownerDocument)?void 0:r.body),l=j(i);if(!o)return t.concat(i,J(i,[],n));{let e=K(l);return t.concat(l,l.visualViewport||[],_(i)?i:[],e&&n?J(e):[])}}function K(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Q(e){let t=X(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=M(e),o=i?e.offsetWidth:n,l=i?e.offsetHeight:r,a=f(n)!==o||f(r)!==l;return a&&(n=o,r=l),{width:n,height:r,$:a}}function ee(e){return N(e)?e:e.contextElement}function et(e){let t=ee(e);if(!M(t))return u(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:o}=Q(t),l=(o?f(n.width):n.width)/r,a=(o?f(n.height):n.height)/i;return l&&Number.isFinite(l)||(l=1),a&&Number.isFinite(a)||(a=1),{x:l,y:a}}let en=u(0);function er(e){let t=j(e);return Y()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:en}function ei(e,t,n,r){var i;void 0===t&&(t=!1),void 0===n&&(n=!1);let o=e.getBoundingClientRect(),l=ee(e),f=u(1);t&&(r?N(r)&&(f=et(r)):f=et(e));let a=(void 0===(i=n)&&(i=!1),r&&(!i||r===j(l))&&i)?er(l):u(0),c=(o.left+a.x)/f.x,s=(o.top+a.y)/f.y,d=o.width/f.x,h=o.height/f.y;if(l){let e=j(l),t=r&&N(r)?j(r):r,n=e,i=K(n);for(;i&&r&&t!==n;){let e=et(i),t=i.getBoundingClientRect(),r=X(i),o=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,l=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,s*=e.y,d*=e.x,h*=e.y,c+=o,s+=l,i=K(n=j(i))}}return A({width:d,height:h,x:c,y:s})}function eo(e,t){let n=G(e).scrollLeft;return t?t.left+n:ei(H(e)).left+n}function el(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-eo(e,n),y:n.top+t.scrollTop}}function ef(e,t,n){let r;if("viewport"===t)r=function(e,t){let n=j(e),r=H(e),i=n.visualViewport,o=r.clientWidth,l=r.clientHeight,f=0,a=0;if(i){o=i.width,l=i.height;let e=Y();(!e||e&&"fixed"===t)&&(f=i.offsetLeft,a=i.offsetTop)}let u=eo(r);if(u<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,l=Math.abs(r.clientWidth-t.clientWidth-i);l<=25&&(o-=l)}else u<=25&&(o+=u);return{width:o,height:l,x:f,y:a}}(e,n);else if("document"===t)r=function(e){let t=H(e),n=G(e),r=e.ownerDocument.body,i=l(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=l(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),f=-n.scrollLeft+eo(e),a=-n.scrollTop;return"rtl"===X(r).direction&&(f+=l(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:f,y:a}}(H(e));else if(N(t))r=function(e,t){let n=ei(e,!0,"fixed"===t),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=M(e)?et(e):u(1),l=e.clientWidth*o.x,f=e.clientHeight*o.y;return{width:l,height:f,x:i*o.x,y:r*o.y}}(t,n);else{let n=er(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return A(r)}function ea(e){return"static"===X(e).position}function eu(e,t){if(!M(e)||"fixed"===X(e).position)return null;if(t)return t(e);let n=e.offsetParent;return H(e)===n&&(n=n.ownerDocument.body),n}function ec(e,t){var n;let r=j(e);if(B(e))return r;if(!M(e)){let t=Z(e);for(;t&&!q(t);){if(N(t)&&!ea(t))return t;t=Z(t)}return r}let i=eu(e,t);for(;i&&(n=i,/^(table|td|th)$/.test(W(n)))&&ea(i);)i=eu(i,t);return i&&q(i)&&ea(i)&&!I(i)?r:i||function(e){let t=Z(e);for(;M(t)&&!q(t);){if(I(t))return t;if(B(t))break;t=Z(t)}return null}(e)||r}let es=async function(e){let t=this.getOffsetParent||ec,n=this.getDimensions,r=await n(e.floating);return{reference:function(e,t,n){let r=M(t),i=H(t),o="fixed"===n,l=ei(e,!0,o,t),f={scrollLeft:0,scrollTop:0},a=u(0);if(r||!r&&!o)if(("body"!==W(t)||_(i))&&(f=G(t)),r){let e=ei(t,!0,o,t);a.x=e.x+t.clientLeft,a.y=e.y+t.clientTop}else i&&(a.x=eo(i));o&&!r&&i&&(a.x=eo(i));let c=!i||r||o?u(0):el(i,f);return{x:l.left+f.scrollLeft-a.x-c.x,y:l.top+f.scrollTop-a.y-c.y,width:l.width,height:l.height}}(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},ed={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,o="fixed"===i,l=H(r),f=!!t&&B(t.floating);if(r===l||f&&o)return n;let a={scrollLeft:0,scrollTop:0},c=u(1),s=u(0),d=M(r);if((d||!d&&!o)&&(("body"!==W(r)||_(l))&&(a=G(r)),d)){let e=ei(r);c=et(r),s.x=e.x+r.clientLeft,s.y=e.y+r.clientTop}let h=!l||d||o?u(0):el(l,a);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-a.scrollLeft*c.x+s.x+h.x,y:n.y*c.y-a.scrollTop*c.y+s.y+h.y}},getDocumentElement:H,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,f=[..."clippingAncestors"===n?B(t)?[]:function(e,t){let n=t.get(e);if(n)return n;let r=J(e,[],!1).filter(e=>N(e)&&"body"!==W(e)),i=null,o="fixed"===X(e).position,l=o?Z(e):e;for(;N(l)&&!q(l);){let t=X(l),n=I(l);n||"fixed"!==t.position||(i=null),(o?n||i:!(!n&&"static"===t.position&&i&&("absolute"===i.position||"fixed"===i.position)||_(l)&&!n&&function e(t,n){let r=Z(t);return!(r===n||!N(r)||q(r))&&("fixed"===X(r).position||e(r,n))}(e,l)))?i=t:r=r.filter(e=>e!==l),l=Z(l)}return t.set(e,r),r}(t,this._c):[].concat(n),r],a=ef(t,f[0],i),u=a.top,c=a.right,s=a.bottom,d=a.left;for(let e=1;e<f.length;e++){let n=ef(t,f[e],i);u=l(n.top,u),c=o(n.right,c),s=o(n.bottom,s),d=l(n.left,d)}return{width:c-d,height:s-u,x:d,y:u}},getOffsetParent:ec,getElementRects:es,getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){let{width:t,height:n}=Q(e);return{width:t,height:n}},getScale:et,isElement:N,isRTL:function(e){return"rtl"===X(e).direction}};function eh(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ep(e,t,n,r){let i;void 0===r&&(r={});let{ancestorScroll:f=!0,ancestorResize:u=!0,elementResize:c="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:d=!1}=r,h=ee(e),p=f||u?[...h?J(h):[],...t?J(t):[]]:[];p.forEach(e=>{f&&e.addEventListener("scroll",n,{passive:!0}),u&&e.addEventListener("resize",n)});let m=h&&s?function(e,t){let n,r=null,i=H(e);function f(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return!function u(c,s){void 0===c&&(c=!1),void 0===s&&(s=1),f();let d=e.getBoundingClientRect(),{left:h,top:p,width:m,height:g}=d;if(c||t(),!m||!g)return;let y=a(p),w=a(i.clientWidth-(h+m)),v={rootMargin:-y+"px "+-w+"px "+-a(i.clientHeight-(p+g))+"px "+-a(h)+"px",threshold:l(0,o(1,s))||1},x=!0;function b(t){let r=t[0].intersectionRatio;if(r!==s){if(!x)return u();r?u(!1,r):n=setTimeout(()=>{u(!1,1e-7)},1e3)}1!==r||eh(d,e.getBoundingClientRect())||u(),x=!1}try{r=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch(e){r=new IntersectionObserver(b,v)}r.observe(e)}(!0),f}(h,n):null,g=-1,y=null;c&&(y=new ResizeObserver(e=>{let[r]=e;r&&r.target===h&&y&&t&&(y.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var e;null==(e=y)||e.observe(t)})),n()}),h&&!d&&y.observe(h),t&&y.observe(t));let w=d?ei(e):null;return d&&function t(){let r=ei(e);w&&!eh(w,r)&&n(),w=r,i=requestAnimationFrame(t)}(),n(),()=>{var e;p.forEach(e=>{f&&e.removeEventListener("scroll",n),u&&e.removeEventListener("resize",n)}),null==m||m(),null==(e=y)||e.disconnect(),y=null,d&&cancelAnimationFrame(i)}}let em=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;let{x:i,y:o,placement:l,middlewareData:f}=t,a=await P(t,e);return l===(null==(n=f.offset)?void 0:n.placement)&&null!=(r=f.arrow)&&r.alignmentOffset?{}:{x:i+a.x,y:o+a.y,data:{...a,placement:l}}}}},eg=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){let{x:n,y:r,placement:i,platform:f}=t,{mainAxis:a=!0,crossAxis:u=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...h}=s(e,t),m={x:n,y:r},y=await f.detectOverflow(t,h),w=g(d(i)),v=p(w),x=m[v],b=m[w];if(a){let e="y"===v?"top":"left",t="y"===v?"bottom":"right",n=x+y[e],r=x-y[t];x=l(n,o(x,r))}if(u){let e="y"===w?"top":"left",t="y"===w?"bottom":"right",n=b+y[e],r=b-y[t];b=l(n,o(b,r))}let R=c.fn({...t,[v]:x,[w]:b});return{...R,data:{x:R.x-n,y:R.y-r,enabled:{[v]:a,[w]:u}}}}}},ey=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r,i,o,l;let{placement:f,middlewareData:a,rects:u,initialPlacement:c,platform:E,elements:A}=t,{mainAxis:O=!0,crossAxis:L=!0,fallbackPlacements:S,fallbackStrategy:C="bestFit",fallbackAxisSideDirection:T="none",flipAlignment:D=!0,...P}=s(e,t);if(null!=(n=a.arrow)&&n.alignmentOffset)return{};let k=d(f),W=g(c),j=d(c)===c,H=await (null==E.isRTL?void 0:E.isRTL(A.floating)),F=S||(j||!D?[R(c)]:function(e){let t=R(e);return[y(e),t,y(t)]}(c)),N="none"!==T;!S&&N&&F.push(...function(e,t,n,r){let i=h(e),o=function(e,t,n){switch(e){case"top":case"bottom":if(n)return t?v:w;return t?w:v;case"left":case"right":return t?x:b;default:return[]}}(d(e),"start"===n,r);return i&&(o=o.map(e=>e+"-"+i),t&&(o=o.concat(o.map(y)))),o}(c,D,T,H));let M=[c,...F],V=await E.detectOverflow(t,P),_=[],B=(null==(r=a.flip)?void 0:r.overflows)||[];if(O&&_.push(V[k]),L){let e=function(e,t,n){void 0===n&&(n=!1);let r=h(e),i=p(g(e)),o=m(i),l="x"===i?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[o]>t.floating[o]&&(l=R(l)),[l,R(l)]}(f,u,H);_.push(V[e[0]],V[e[1]])}if(B=[...B,{placement:f,overflows:_}],!_.every(e=>e<=0)){let e=((null==(i=a.flip)?void 0:i.index)||0)+1,t=M[e];if(t&&("alignment"!==L||W===g(t)||B.every(e=>g(e.placement)!==W||e.overflows[0]>0)))return{data:{index:e,overflows:B},reset:{placement:t}};let n=null==(o=B.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:o.placement;if(!n)switch(C){case"bestFit":{let e=null==(l=B.filter(e=>{if(N){let t=g(e.placement);return t===W||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:l[0];e&&(n=e);break}case"initialPlacement":n=c}if(f!==n)return{reset:{placement:n}}}return{}}}},ew=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;let i,f,{placement:a,rects:u,platform:c,elements:p}=t,{apply:m=()=>{},...y}=s(e,t),w=await c.detectOverflow(t,y),v=d(a),x=h(a),b="y"===g(a),{width:R,height:E}=u.floating;"top"===v||"bottom"===v?(i=v,f=x===(await (null==c.isRTL?void 0:c.isRTL(p.floating))?"start":"end")?"left":"right"):(f=v,i="end"===x?"top":"bottom");let A=E-w.top-w.bottom,O=R-w.left-w.right,L=o(E-w[i],A),S=o(R-w[f],O),C=!t.middlewareData.shift,T=L,D=S;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(D=O),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(T=A),C&&!x){let e=l(w.left,0),t=l(w.right,0),n=l(w.top,0),r=l(w.bottom,0);b?D=R-2*(0!==e||0!==t?e+t:l(w.left,w.right)):T=E-2*(0!==n||0!==r?n+r:l(w.top,w.bottom))}await m({...t,availableWidth:D,availableHeight:T});let P=await c.getDimensions(p.floating);return R!==P.width||E!==P.height?{reset:{rects:!0}}:{}}}},ev=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i="referenceHidden",...o}=s(e,t);switch(i){case"referenceHidden":{let e=C(await r.detectOverflow(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:T(e)}}}case"escaped":{let e=C(await r.detectOverflow(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:T(e)}}}default:return{}}}}},ex=e=>({name:"arrow",options:e,async fn(t){let{x:n,y:r,placement:i,rects:f,platform:a,elements:u,middlewareData:c}=t,{element:d,padding:y=0}=s(e,t)||{};if(null==d)return{};let w=E(y),v={x:n,y:r},x=p(g(i)),b=m(x),R=await a.getDimensions(d),A="y"===x,O=A?"clientHeight":"clientWidth",L=f.reference[b]+f.reference[x]-v[x]-f.floating[b],S=v[x]-f.reference[x],C=await (null==a.getOffsetParent?void 0:a.getOffsetParent(d)),T=C?C[O]:0;T&&await (null==a.isElement?void 0:a.isElement(C))||(T=u.floating[O]||f.floating[b]);let D=T/2-R[b]/2-1,P=o(w[A?"top":"left"],D),k=o(w[A?"bottom":"right"],D),W=T-R[b]-k,j=T/2-R[b]/2+(L/2-S/2),H=l(P,o(j,W)),F=!c.arrow&&null!=h(i)&&j!==H&&f.reference[b]/2-(j<P?P:k)-R[b]/2<0,N=F?j<P?j-P:j-W:0;return{[x]:v[x]+N,data:{[x]:H,centerOffset:j-H-N,...F&&{alignmentOffset:N}},reset:F}}}),eb=function(e){return void 0===e&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:o,middlewareData:l}=t,{offset:f=0,mainAxis:a=!0,crossAxis:u=!0}=s(e,t),c={x:n,y:r},h=g(i),m=p(h),y=c[m],w=c[h],v=s(f,t),x="number"==typeof v?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(a){let e="y"===m?"height":"width",t=o.reference[m]-o.floating[e]+x.mainAxis,n=o.reference[m]+o.reference[e]-x.mainAxis;y<t?y=t:y>n&&(y=n)}if(u){var b,R;let e="y"===m?"width":"height",t=D.has(d(i)),n=o.reference[h]-o.floating[e]+(t&&(null==(b=l.offset)?void 0:b[h])||0)+(t?0:x.crossAxis),r=o.reference[h]+o.reference[e]+(t?0:(null==(R=l.offset)?void 0:R[h])||0)-(t?x.crossAxis:0);w<n?w=n:w>r&&(w=r)}return{[m]:y,[h]:w}}}},eR=(e,t,n)=>{let r=new Map,i={platform:ed,...n},o={...i.platform,_c:r};return S(e,t,{...i,platform:o})}},84288:(e,t,n)=>{n.d(t,{X:()=>o});var r=n(12115),i=n(4129);function o(e){let[t,n]=r.useState(void 0);return(0,i.N)(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let r,i;if(!Array.isArray(t)||!t.length)return;let o=t[0];if("borderBoxSize"in o){let e=o.borderBoxSize,t=Array.isArray(e)?e[0]:e;r=t.inlineSize,i=t.blockSize}else r=e.offsetWidth,i=e.offsetHeight;n({width:r,height:i})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)},[e]),t}},88142:(e,t,n)=>{n.d(t,{sG:()=>u,hO:()=>c});var r=n(12115),i=n(47650),o=n(94446),l=n(95155),f=Symbol("radix.slottable");function a(e){return r.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===f}var u=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let n=function(e){let t=function(e){let t=r.forwardRef((e,t)=>{let{children:n,...i}=e;if(r.isValidElement(n)){var l;let e,f,a=(l=n,(f=(e=Object.getOwnPropertyDescriptor(l.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?l.ref:(f=(e=Object.getOwnPropertyDescriptor(l,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?l.props.ref:l.props.ref||l.ref),u=function(e,t){let n={...t};for(let r in t){let i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...e)=>{o(...e),i(...e)}:i&&(n[r]=i):"style"===r?n[r]={...i,...o}:"className"===r&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}(i,n.props);return n.type!==r.Fragment&&(u.ref=t?(0,o.t)(t,a):a),r.cloneElement(n,u)}return r.Children.count(n)>1?r.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}(e),n=r.forwardRef((e,n)=>{let{children:i,...o}=e,f=r.Children.toArray(i),u=f.find(a);if(u){let e=u.props.children,i=f.map(t=>t!==u?t:r.Children.count(e)>1?r.Children.only(null):r.isValidElement(e)?e.props.children:null);return(0,l.jsx)(t,{...o,ref:n,children:r.isValidElement(e)?r.cloneElement(e,void 0,i):null})}return(0,l.jsx)(t,{...o,ref:n,children:i})});return n.displayName=`${e}.Slot`,n}(`Primitive.${t}`),i=r.forwardRef((e,r)=>{let{asChild:i,...o}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,l.jsx)(i?n:t,{...o,ref:r})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{});function c(e,t){e&&i.flushSync(()=>e.dispatchEvent(t))}},88334:(e,t,n)=>{n.d(t,{BN:()=>h,ER:()=>p,Ej:()=>g,UE:()=>w,UU:()=>m,cY:()=>d,jD:()=>y,we:()=>s});var r=n(58146),i=n(12115),o=n(47650),l="undefined"!=typeof document?i.useLayoutEffect:function(){};function f(e,t){let n,r,i;if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if((n=e.length)!==t.length)return!1;for(r=n;0!=r--;)if(!f(e[r],t[r]))return!1;return!0}if((n=(i=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!({}).hasOwnProperty.call(t,i[r]))return!1;for(r=n;0!=r--;){let n=i[r];if(("_owner"!==n||!e.$$typeof)&&!f(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function a(e){return"undefined"==typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function u(e,t){let n=a(e);return Math.round(t*n)/n}function c(e){let t=i.useRef(e);return l(()=>{t.current=e}),t}function s(e){void 0===e&&(e={});let{placement:t="bottom",strategy:n="absolute",middleware:s=[],platform:d,elements:{reference:h,floating:p}={},transform:m=!0,whileElementsMounted:g,open:y}=e,[w,v]=i.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[x,b]=i.useState(s);f(x,s)||b(s);let[R,E]=i.useState(null),[A,O]=i.useState(null),L=i.useCallback(e=>{e!==D.current&&(D.current=e,E(e))},[]),S=i.useCallback(e=>{e!==P.current&&(P.current=e,O(e))},[]),C=h||R,T=p||A,D=i.useRef(null),P=i.useRef(null),k=i.useRef(w),W=null!=g,j=c(g),H=c(d),F=c(y),N=i.useCallback(()=>{if(!D.current||!P.current)return;let e={placement:t,strategy:n,middleware:x};H.current&&(e.platform=H.current),(0,r.rD)(D.current,P.current,e).then(e=>{let t={...e,isPositioned:!1!==F.current};M.current&&!f(k.current,t)&&(k.current=t,o.flushSync(()=>{v(t)}))})},[x,t,n,H,F]);l(()=>{!1===y&&k.current.isPositioned&&(k.current.isPositioned=!1,v(e=>({...e,isPositioned:!1})))},[y]);let M=i.useRef(!1);l(()=>(M.current=!0,()=>{M.current=!1}),[]),l(()=>{if(C&&(D.current=C),T&&(P.current=T),C&&T){if(j.current)return j.current(C,T,N);N()}},[C,T,N,j,W]);let V=i.useMemo(()=>({reference:D,floating:P,setReference:L,setFloating:S}),[L,S]),_=i.useMemo(()=>({reference:C,floating:T}),[C,T]),B=i.useMemo(()=>{let e={position:n,left:0,top:0};if(!_.floating)return e;let t=u(_.floating,w.x),r=u(_.floating,w.y);return m?{...e,transform:"translate("+t+"px, "+r+"px)",...a(_.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}},[n,m,_.floating,w.x,w.y]);return i.useMemo(()=>({...w,update:N,refs:V,elements:_,floatingStyles:B}),[w,N,V,_,B])}let d=(e,t)=>{let n=(0,r.cY)(e);return{name:n.name,fn:n.fn,options:[e,t]}},h=(e,t)=>{let n=(0,r.BN)(e);return{name:n.name,fn:n.fn,options:[e,t]}},p=(e,t)=>({fn:(0,r.ER)(e).fn,options:[e,t]}),m=(e,t)=>{let n=(0,r.UU)(e);return{name:n.name,fn:n.fn,options:[e,t]}},g=(e,t)=>{let n=(0,r.Ej)(e);return{name:n.name,fn:n.fn,options:[e,t]}},y=(e,t)=>{let n=(0,r.jD)(e);return{name:n.name,fn:n.fn,options:[e,t]}},w=(e,t)=>{let n=(e=>({name:"arrow",options:e,fn(t){let{element:n,padding:i}="function"==typeof e?e(t):e;return n&&({}).hasOwnProperty.call(n,"current")?null!=n.current?(0,r.UE)({element:n.current,padding:i}).fn(t):{}:n?(0,r.UE)({element:n,padding:i}).fn(t):{}}}))(e);return{name:n.name,fn:n.fn,options:[e,t]}}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[980],{11186:(e,t,n)=>{n.d(t,{bq:()=>u,eb:()=>m,gC:()=>p,l6:()=>c,yv:()=>d});var a=n(95155);n(12115);var r=n(76412),l=n(24033),s=n(5917),o=n(12108),i=n(64269);function c(e){let{...t}=e;return(0,a.jsx)(r.bL,{"data-slot":"select",...t})}function d(e){let{...t}=e;return(0,a.jsx)(r.WT,{"data-slot":"select-value",...t})}function u(e){let{className:t,size:n="default",children:s,...o}=e;return(0,a.jsxs)(r.l9,{"data-slot":"select-trigger","data-size":n,className:(0,i.cn)("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...o,children:[s,(0,a.jsx)(r.In,{asChild:!0,children:(0,a.jsx)(l.A,{className:"size-4 opacity-50"})})]})}function p(e){let{className:t,children:n,position:l="popper",...s}=e;return(0,a.jsx)(r.ZL,{children:(0,a.jsxs)(r.UC,{"data-slot":"select-content",className:(0,i.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md","popper"===l&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:l,...s,children:[(0,a.jsx)(v,{}),(0,a.jsx)(r.LM,{className:(0,i.cn)("p-1","popper"===l&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:n}),(0,a.jsx)(f,{})]})})}function m(e){let{className:t,children:n,...l}=e;return(0,a.jsxs)(r.q7,{"data-slot":"select-item",className:(0,i.cn)("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...l,children:[(0,a.jsx)("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:(0,a.jsx)(r.VF,{children:(0,a.jsx)(s.A,{className:"size-4"})})}),(0,a.jsx)(r.p4,{children:n})]})}function v(e){let{className:t,...n}=e;return(0,a.jsx)(r.PP,{"data-slot":"select-scroll-up-button",className:(0,i.cn)("flex cursor-default items-center justify-center py-1",t),...n,children:(0,a.jsx)(o.A,{className:"size-4"})})}function f(e){let{className:t,...n}=e;return(0,a.jsx)(r.wn,{"data-slot":"select-scroll-down-button",className:(0,i.cn)("flex cursor-default items-center justify-center py-1",t),...n,children:(0,a.jsx)(l.A,{className:"size-4"})})}},16257:(e,t,n)=>{n.d(t,{R:()=>a}),n(95155),n(12115),n(68600),n(32886);let a=e=>e&&e.recorded_goals>0?100*e.jailbroken/e.recorded_goals:null},26333:(e,t,n)=>{n.d(t,{AM:()=>s,Wv:()=>o,hl:()=>i});var a=n(95155);n(12115);var r=n(90067),l=n(64269);function s(e){let{...t}=e;return(0,a.jsx)(r.bL,{"data-slot":"popover",...t})}function o(e){let{...t}=e;return(0,a.jsx)(r.l9,{"data-slot":"popover-trigger",...t})}function i(e){let{className:t,align:n="center",sideOffset:s=4,...o}=e;return(0,a.jsx)(r.ZL,{children:(0,a.jsx)(r.UC,{"data-slot":"popover-content",align:n,sideOffset:s,className:(0,l.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",t),...o})})}},32886:(e,t,n)=>{n.d(t,{B4:()=>m,DN:()=>c,Md:()=>s,OW:()=>d,_t:()=>f,a3:()=>v,lV:()=>u,nO:()=>p,s$:()=>g,uc:()=>l,uq:()=>i});var a=n(95155),r=n(12115);function l(e){let t=r.useRef(null),[n,a]=r.useState(e);return r.useEffect(()=>{let e=t.current;if(!e||"undefined"==typeof ResizeObserver)return;let n=()=>{e.clientWidth>0&&a(e.clientWidth)};n();let r=new ResizeObserver(n);return r.observe(e),()=>r.disconnect()},[]),[t,n]}let s={jailbroken:"var(--viz-jailbroken)",mitigated:"var(--viz-mitigated)",unresolved:"var(--viz-unresolved)",error:"var(--viz-error)"},o={static:"Static",adaptive:"Adaptive",multi_turn:"Multi-turn",indirect:"Indirect"},i=e=>"var(--viz-family-".concat(e&&o[e]?e:"other",")"),c=e=>[{name:"Jailbroken",value:e.jailbroken,color:s.jailbroken},{name:"Mitigated",value:e.mitigated,color:s.mitigated},{name:"Unresolved",value:e.unresolved,color:s.unresolved}];function d(e){let{label:t,values:n,max:r,color:l="currentColor",bars:s=!1}=e,o=null!=r?r:Math.max(1,...n.map(e=>null!=e?e:0)),i=e=>+(3+(1-e/o)*24).toFixed(2),c=n.flatMap((e,t)=>null===e?[]:["".concat(n.length>1?+(100*t/(n.length-1)).toFixed(2):50,",").concat(i(e))]);return(0,a.jsx)("svg",{role:"img","aria-label":t,viewBox:"0 0 100 30",preserveAspectRatio:"none",className:"h-8 w-full overflow-visible",style:{color:l},children:s?n.map((e,t)=>null===e?null:(0,a.jsx)("rect",{x:100*t/n.length+.6,width:Math.max(.8,100/n.length-1.2),y:i(e),height:27-i(e),fill:"currentColor",opacity:"0.75"},t)):(0,a.jsxs)(a.Fragment,{children:[c.length>1&&(0,a.jsx)("polygon",{points:"".concat(c[0].split(",")[0],",27 ").concat(c.join(" ")," ").concat(c[c.length-1].split(",")[0],",27"),fill:"currentColor",opacity:"0.12"}),(0,a.jsx)("polyline",{points:c.join(" "),fill:"none",stroke:"currentColor",strokeWidth:"1.75",vectorEffect:"non-scaling-stroke",strokeLinejoin:"round"})]})})}function u(e){let{label:t,segments:n,className:r="h-2"}=e,l=n.reduce((e,t)=>e+t.value,0);return(0,a.jsx)("div",{role:"img","aria-label":"".concat(t,": ").concat(n.map(e=>"".concat(e.name," ").concat(e.value)).join(", ")),className:"flex w-full overflow-hidden rounded-full bg-muted ".concat(r),children:l>0&&n.map(e=>(0,a.jsx)("span",{title:"".concat(e.name,": ").concat(e.value),className:"h-full",style:{width:"".concat(+(100*e.value/l).toFixed(2),"%"),backgroundColor:e.color}},e.name))})}function p(e){let{label:t,value:n,detail:r,children:l}=e;return(0,a.jsxs)("div",{className:"kpi-card",children:[(0,a.jsx)("p",{className:"kpi-label truncate",children:t}),(0,a.jsx)("p",{className:"kpi-value truncate",children:n}),(0,a.jsx)("p",{className:"min-h-8 text-xs leading-4 text-muted-foreground line-clamp-2",children:r}),(0,a.jsx)("div",{className:"flex h-8 items-end",children:l})]})}function m(e){if(null==e||!Number.isFinite(e))return"—";let t=Math.abs(e);return t>=1e6?"".concat((e/1e6).toFixed(t>=1e7?0:1),"M"):t>=1e4?"".concat((e/1e3).toFixed(0),"k"):t>=1e3?"".concat((e/1e3).toFixed(1),"k"):t>=10||Number.isInteger(e)?e.toFixed(0):e.toFixed(1)}function v(e){if(null==e||!Number.isFinite(e))return"—";if(e<1)return"".concat(Math.round(1e3*e)," ms");if(e<60)return"".concat(e.toFixed(+(e<10))," s");let t=Math.round(e/60);if(t<60)return"".concat(t," min");let n=Math.floor(t/60);return"".concat(n," h ").concat(t%60," min")}let f={target:"var(--viz-role-target)",attacker:"var(--viz-role-attacker)",judge:"var(--viz-role-judge)"};function g(e){let{items:t}=e;return(0,a.jsx)("ul",{className:"flex flex-wrap gap-x-4 gap-y-1 text-xs text-muted-foreground","aria-label":"Legend",children:t.map(e=>(0,a.jsxs)("li",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("span",{"aria-hidden":"true",className:"h-2.5 w-2.5 rounded-sm",style:{backgroundColor:e.color}}),e.name]},e.name))})}},37272:(e,t,n)=>{n.d(t,{T:()=>i,y:()=>o});var a=n(81701);function r(e){return Array.isArray(e)?e.filter(e=>"object"==typeof e&&null!==e&&"string"==typeof e.role&&"content"in e):[]}function l(e){return"object"!=typeof e||null===e||Array.isArray(e)?null:e}let s=e=>JSON.stringify(e);function o(e){var t;let n=new Map((null!=(t=e.results)?t:[]).map(e=>[e.id,e])),o=[],i=new Map,c=new Map,d=new Map;return e.attempts.map(t=>{var u,p,m,v,f,g,h,x,b,y,j,w,N,k;let _=n.get(t.id),A=e.traces.filter(e=>e.result===t.id).sort((e,t)=>e.sequence-t.sequence),C=A.find(e=>{var t;return(0,a.HK)(e.content)&&"call"===e.content.node&&(null==(t=e.content.data)?void 0:t.role)==="target"}),E=C&&(0,a.HK)(C.content)?C.content.data:void 0,S=A.find(e=>{let t=l(e.content);return t&&!("v"in t)&&l(t.request)&&l(t.response)}),z=l(null==S?void 0:S.content),P=l(null==z?void 0:z.request),T=l(null==z?void 0:z.response),R=r(null==_||null==(u=_.request_payload)?void 0:u.messages),F=r(null==E?void 0:E.request),M=null==_||null==(p=_.request_payload)?void 0:p.prompt,L=R.length?R:"string"==typeof M?[{role:"user",content:M}]:F.length?F:r(null==P?void 0:P.messages),O=null!=(x=null!=(h=null!=(g=null!=(f=null==_||null==(m=_.agent_specific_data)?void 0:m.response)?f:null==_||null==(v=_.agent_specific_data)?void 0:v.decoded_response)?g:null==E?void 0:E.response)?h:null==T?void 0:T.text)?x:null,I=L.at(-1),q=(null==I?void 0:I.role)==="assistant"&&"string"==typeof I.content&&L.length>1?I.content:null,H=null===q?L:L.slice(0,-1),U=null!==q&&"string"==typeof O&&O.startsWith(q)?O.slice(q.length):O,J=o.filter(e=>{var t;return(t=e.messages).length>0&&t.length<=H.length&&t.every((e,t)=>{let n;return n=H[t],e.role===n.role&&s(e.content)===s(n.content)})}).reduce((e,t)=>!e||t.messages.length>=e.messages.length?t:e,null),D=H.slice(null!=(b=null==J?void 0:J.messages.length)?b:0).map(e=>{if("user"!==e.role)return e;let n=i.get(s(e.content));return void 0===n&&i.set(s(e.content),t.ordinal),void 0===n?e:{...e,repeatOf:n}}),W=null===q?null:null!=(y=c.get(q))?y:null;null!==q&&null===W&&c.set(q,t.ordinal);let K=s([q,U]),B=null===U||""===U?null:null!=(j=d.get(K))?j:null;return null!==U&&null===B&&d.set(K,t.ordinal),o.push({ordinal:t.ordinal,messages:[...L.slice(0,null===q?void 0:-1),...null!==O?[{role:"assistant",content:O}]:[]]}),{attempt:t,messages:D,prefill:q,prefillRepeatOf:W,reply:U,replyRepeatOf:B,notes:null!=(N=null!=(w=t.notes)?w:null==_?void 0:_.evaluation_notes)?N:null,continues:null!==J,continuesFrom:null!=(k=null==J?void 0:J.ordinal)?k:null}})}function i(e,t){var n;let a=null!=(n=e.attempt.metadata)?n:{};if("number"==typeof a.turn)return["Turn ".concat(a.turn+1),!0===a.refused?"target refused":null,!0===a.backtracked?"will be rephrased":null].filter(Boolean).join(" \xb7 ");if("number"==typeof a.prefix_index){let n=t.filter(e=>{var t;return(null==(t=e.attempt.metadata)?void 0:t.prefix_index)===a.prefix_index}),r=new Set(t.map(e=>{var t;return null==(t=e.attempt.metadata)?void 0:t.prefix_index})).size;return"Opening ".concat(a.prefix_index+1," of ").concat(r," \xb7 sample ").concat(n.indexOf(e)+1," of ").concat(n.length)}return null}},40998:(e,t,n)=>{n.d(t,{aA:()=>s,hS:()=>o,x9:()=>i});var a=n(95155);n(12115);var r=n(68448),l=n(16257);function s(e){return e.runs.map(e=>{var t;return{run:e,value:(0,l.R)(null!=(t=e.outcomes)?t:void 0)}}).sort((e,t)=>{var n,a;return(null!=(n=t.value)?n:-1)-(null!=(a=e.value)?a:-1)}).map(e=>e.run)}function o(e){let{role:t,content:n,label:l}=e;return(0,a.jsxs)("div",{className:"conversation-message ".concat("assistant"===t?"conversation-response":"system"===t?"conversation-context":"conversation-prompt"),children:[(0,a.jsx)("p",{className:"mb-2 text-xs font-semibold text-muted-foreground",children:null!=l?l:"assistant"===t?"Target response":"user"===t?"Attack prompt":"system"===t?"System context":t}),(0,a.jsx)(r.P,{content:n})]})}let i={advprefix:"AdvPrefix writes the opening of a compliant answer and makes the target continue it. Each opening is sampled several times; only the text the target added is shown as its response.",crescendo:"Crescendo starts with a harmless question and escalates over several turns, building on the target’s own answers. Refused turns are rephrased from the last accepted turn."}},68448:(e,t,n)=>{n.d(t,{P:()=>l});var a=n(95155);n(12115);var r=n(81701);let l=e=>{let{content:t,className:n=""}=e,l=(0,r.Ae)(t);return 0===l.length?(0,a.jsx)("span",{className:"italic text-muted-foreground",children:"(empty)"}):(0,a.jsx)("div",{className:"space-y-2 ".concat(n),children:l.map((e,t)=>"text"===e.type?(0,a.jsx)("p",{className:"whitespace-pre-wrap break-words",children:e.text},t):(0,a.jsx)("img",{src:e.url,alt:"Image part ".concat(t+1),className:"max-h-48 rounded border object-contain"},t))})}},68600:(e,t,n)=>{n.d(t,{Kn:()=>x,LI:()=>w,Ld:()=>f,Oy:()=>o,T9:()=>h,UK:()=>d,VP:()=>g,_F:()=>y,aN:()=>i,dI:()=>p,gj:()=>N,on:()=>u,t$:()=>b});var a=n(12115),r=n(72903),l=n(41444);let s=new Set(["PENDING","RUNNING"]),o=e=>s.has(e.status);function i(e,t){return(function(e,t){let n=t.filter(t=>t.technique===e.technique).sort((e,t)=>e.created_at.localeCompare(t.created_at)||e.id.localeCompare(t.id));return"".concat(e.technique.toUpperCase()).concat(n.length>1?" (".concat(n.findIndex(t=>t.id===e.id)+1,")"):"")})(e,t).replace("STATIC_TEMPLATE","Static template").replace("BASELINE","Baseline").replace("FLIPATTACK","FlipAttack").replace("CIPHERCHAT","CipherChat").replace("CRESCENDO","Crescendo").replace("ADVPREFIX","AdvPrefix")}let c=["unresolved","mitigated","error","jailbroken"];function d(e){let t=void 0!==e.reviewed;return e.goals.map((n,a)=>{let r=[];e.runs.forEach((n,l)=>{var s,o,i,d,u,p,m,v,f,g,h,x;let b=null==(s=e.cells[a])?void 0:s[l];if(null==b)return;let y=c[b];if(!y)throw Error("Unknown outcome code ".concat(b," in the goal matrix."));r.push({run_id:n,verdict:y,attempts:null!=(f=null==(o=e.attempts[a])?void 0:o[l])?f:0,...t?{reviewed_attempts:null!=(g=null==(d=e.reviewed)||null==(i=d[a])?void 0:i[l])?g:0,inconclusive_attempts:null!=(h=null==(p=e.inconclusive)||null==(u=p[a])?void 0:u[l])?h:0,overridden_attempts:null!=(x=null==(v=e.overridden)||null==(m=v[a])?void 0:m[l])?x:0}:{}})});let l=e=>r.reduce((t,n)=>{var a;return t+(null!=(a=n[e])?a:0)},0);return{...n,run_ids:r.map(e=>e.run_id),attack_outcomes:r,...t?{reviewed_attempts:l("reviewed_attempts"),inconclusive_attempts:l("inconclusive_attempts"),overridden_attempts:l("overridden_attempts")}:{}}})}let u=["regressed","fixed","new","dropped","unchanged"],p="/api/proxy/run";async function m(e,t){let n=null;try{let t=await e.json();n=t&&"object"==typeof t&&"detail"in t?t.detail:null}catch(e){}return Error("".concat(t," (HTTP ").concat(e.status,")").concat("string"==typeof n&&n?": ".concat(n):"."))}async function v(e,t,n){let a=await fetch(e,{...t,headers:{...(0,r.b)(),...t.headers}});if(!a.ok)throw await m(a,n);return a}async function f(e,t){var n;let a=await v(e,{signal:t},"Could not load campaign runs");if(!(null==(n=a.headers.get("content-type"))?void 0:n.includes("application/json")))throw Error("The server returned campaign run data in an unexpected format.");return a.json()}let g=e=>"/api/proxy/result/".concat(encodeURIComponent(e),"/reviews"),h="hackagent-attempt-review-saved";async function x(e,t,n,a){let r=await v(g(e),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({outcome:t,explanation:n,expected_review_id:a})},"Could not save the review"),l=await r.json();return window.dispatchEvent(new CustomEvent(h,{detail:l})),l}async function b(e,t){let n=new URL(e,window.location.origin);n.searchParams.set("page_size","100"),n.searchParams.set("page","1");let a=await f("".concat(n.pathname).concat(n.search),t),r=[...a.results];for(let e=2;r.length<a.count;e+=1){n.searchParams.set("page",String(e));let a=await f("".concat(n.pathname).concat(n.search),t);if(!a.results.length)throw Error("The attempts changed while loading. Refresh to load them all.");r.push(...a.results)}return{...a,results:r,next:null,previous:null}}async function y(e){await ("ids"in e?v("".concat(p,"/delete"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:e.ids})},"Deletion failed"):v("".concat(p,"/").concat(e.id),{method:"DELETE"},"Deletion failed"))}let j=(0,l.h)("CampaignRuns");function w(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:f,{pollWhile:r,version:l,versionOf:s}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},[o,i]=(0,a.useState)({url:null,data:null,error:null,version:void 0}),c=o.url===e&&null!==o.data,d=c&&!!(null==r?void 0:r(o.data)),u=(0,a.useRef)({poll:d,version:l,versionOf:s}),p=(0,a.useRef)(void 0),m=(0,a.useRef)(null);return(0,a.useEffect)(()=>{u.current={poll:d,version:l,versionOf:s}}),(0,a.useEffect)(()=>{let t;if(!e)return;let a=new AbortController,r=!1,l=!1,s=()=>{clearTimeout(t),t=void 0,!r&&u.current.poll&&"hidden"!==document.visibilityState&&(t=setTimeout(()=>o(!1),5e3))},o=c=>{clearTimeout(t),t=void 0,r=!0;let d=u.current.version;p.current=d,n(e,a.signal).then(t=>{var n,r,l;a.signal.aborted||i({url:e,data:t,error:null,version:null!=(l=null==(n=(r=u.current).versionOf)?void 0:n.call(r,t))?l:d})}).catch(t=>{!a.signal.aborted&&(j.error({err:t,url:e},"Failed to load campaign run data"),c&&i({url:e,data:null,error:t instanceof Error?t.message:"Failed to load campaign runs.",version:void 0}))}).finally(()=>{r=!1,a.signal.aborted||(l?(l=!1,o(!1)):s())})},c=()=>{"hidden"===document.visibilityState?(clearTimeout(t),t=void 0):!u.current.poll||r||t||o(!1)};return m.current={refresh:()=>{r?l=!0:o(!1)},schedule:s},i({url:e,data:null,error:null,version:void 0}),o(!0),document.addEventListener("visibilitychange",c),()=>{a.abort(),clearTimeout(t),document.removeEventListener("visibilitychange",c),m.current=null}},[e,t,n]),(0,a.useEffect)(()=>{var e;null==(e=m.current)||e.schedule()},[d]),(0,a.useEffect)(()=>{var e;c&&void 0!==l&&l!==o.version&&l!==p.current&&(null==(e=m.current)||e.refresh())},[c,l,o.version]),o.url===e?o:{url:e,data:null,error:null,version:void 0}}function N(e){let t=new URL(window.location.href);for(let[n,a]of Object.entries(e))if(Array.isArray(a))for(let e of(t.searchParams.delete(n),a))t.searchParams.append(n,e);else null===a||""===a?t.searchParams.delete(n):t.searchParams.set(n,a);window.history.replaceState(null,"","".concat(t.pathname).concat(t.search))}},77148:(e,t,n)=>{n.d(t,{C:()=>s});var a=n(95155);n(12115);var r=n(68448),l=n(40998);function s(e){let{entry:t}=e;return(0,a.jsxs)("div",{role:"log","aria-label":"Attempt ".concat(t.attempt.ordinal," conversation"),className:"space-y-4",children:[t.messages.map((e,t)=>{var n,s;return"system"===e.role?(0,a.jsxs)("details",{className:"conversation-message conversation-context",children:[(0,a.jsxs)("summary",{className:"cursor-pointer text-xs font-semibold",children:["System context \xb7 ",("string"==typeof(n=e.content)?n:null!=(s=JSON.stringify(n))?s:"").length.toLocaleString()," characters"]}),(0,a.jsx)("div",{className:"pt-2",children:(0,a.jsx)(r.P,{content:e.content})})]},t):(0,a.jsx)(l.hS,{role:e.role,content:e.content},t)}),!t.messages.length&&(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:"The prompt was not recorded."}),null!==t.prefill&&(0,a.jsxs)("div",{className:"conversation-message conversation-prefill",children:[(0,a.jsxs)("p",{className:"mb-2 text-xs font-semibold text-muted-foreground",children:["Prefilled opening ",(0,a.jsx)("span",{className:"font-normal",children:"\xb7 written by the attacker, presented as the target's own words"})]}),(0,a.jsx)(r.P,{content:t.prefill})]}),null===t.reply?(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:"No target response was recorded."}):(0,a.jsx)(l.hS,{role:"assistant",label:null!==t.prefill?"Target continuation":void 0,content:t.reply})]})}},77274:(e,t,n)=>{n.d(t,{c:()=>c});var a=n(95155);n(12115);var r=n(78874),l=n(61362),s=n(42024),o=n(52056),i=n(80021);function c(e){let{value:t}=e,n="jailbroken"===t||"jailbreak"===t,c="mitigated"===t,d="pruned"===t||"skipped"===t,u="error"===t,p=n?r.A:c?l.A:d?s.A:u?o.A:i.A,m=n?"Jailbroken":c?"Mitigated":d?"pruned"===t?"Pruned":"Skipped":u?"Error":"pending"===t?"Pending":"inconclusive"===t?"Inconclusive":"Unresolved";return(0,a.jsxs)("span",{className:"inline-flex shrink-0 items-center gap-1 rounded-full border px-2 py-0.5 text-xs font-medium ".concat(n?"border-rose-200 bg-rose-50 text-rose-800 dark:border-rose-700 dark:bg-rose-950 dark:text-rose-200":c?"border-teal-200 bg-teal-50 text-teal-800 dark:border-teal-700 dark:bg-teal-950 dark:text-teal-200":d?"border-slate-300 bg-slate-100 text-slate-700 dark:border-slate-500 dark:bg-slate-700 dark:text-slate-100":"border-amber-200 bg-amber-50 text-amber-900 dark:border-amber-600 dark:bg-amber-950 dark:text-amber-200"),children:[(0,a.jsx)(p,{className:"h-3 w-3","aria-hidden":"true"}),m]})}},81701:(e,t,n)=>{n.d(t,{Ae:()=>l,HK:()=>r});let a=e=>"object"==typeof e&&null!==e&&!Array.isArray(e),r=e=>a(e)&&1===e.v&&"string"==typeof e.node&&Array.isArray(e.path),l=e=>null==e?[]:"string"==typeof e?[{type:"text",text:e}]:Array.isArray(e)?e.flatMap(e=>{if("string"==typeof e)return[{type:"text",text:e}];if(a(e)&&"string"==typeof e.text)return[{type:"text",text:e.text}];if(a(e)&&void 0!==e.image_url){let t=a(e.image_url)?e.image_url.url:e.image_url;if("string"==typeof t)return[{type:"image",url:t}]}return[{type:"text",text:JSON.stringify(e)}]}):[{type:"text",text:JSON.stringify(e)}]},98487:(e,t,n)=>{n.d(t,{H:()=>d});var a=n(95155);n(12115);var r=n(3998),l=n(11186),s=n(90368),o=n(27937),i=n(4882);n(7831),(0,n(41444).h)("useRunResults");let c=[25,50,100];i.v3H.SuccessfulJailbreak,i.v3H.FailedJailbreak,i.v3H.ErrorAgentResponse,i.v3H.ErrorTestFramework,i.v3H.NotEvaluated;let d=e=>{let{page:t,pageSize:n,count:i,isLoading:d,onPageChange:u,onPageSizeChange:p}=e,m=i?Math.ceil(i/n):0,v=i?(t-1)*n+1:0,f=i?Math.min(t*n,i):0;return(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-end gap-3 px-3 py-2 border-t text-xs text-muted-foreground",children:[p&&(0,a.jsxs)("div",{className:"flex items-center gap-2 mr-auto",children:[(0,a.jsx)("span",{className:"whitespace-nowrap",children:"Per page:"}),(0,a.jsxs)(l.l6,{value:n.toString(),onValueChange:e=>p(parseInt(e,10)),children:[(0,a.jsx)(l.bq,{className:"w-[70px] h-7 text-xs","aria-label":"Results per page",children:(0,a.jsx)(l.yv,{placeholder:n.toString()})}),(0,a.jsx)(l.gC,{children:c.map(e=>(0,a.jsx)(l.eb,{value:e.toString(),children:e},e))})]})]}),(0,a.jsx)("span",{className:"tabular-nums whitespace-nowrap",children:null===i?"—":"".concat(v.toLocaleString(),"–").concat(f.toLocaleString()," of ").concat(i.toLocaleString())}),(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(r.$,{variant:"ghost",size:"icon",className:"h-6 w-6","aria-label":"Previous page",onClick:()=>u(t-1),disabled:d||t<=1,children:(0,a.jsx)(s.A,{className:"h-3.5 w-3.5"})}),(0,a.jsx)(r.$,{variant:"ghost",size:"icon",className:"h-6 w-6","aria-label":"Next page",onClick:()=>u(t+1),disabled:d||t>=m,children:(0,a.jsx)(o.A,{className:"h-3.5 w-3.5"})})]})]})}}}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[165],{3730:(e,t,n)=>{"use strict";n.d(t,{Ke:()=>l,Nt:()=>s,R6:()=>r});var a=n(49578);let s=a.bL,r=a.R6,l=a.Ke},34105:(e,t,n)=>{"use strict";n.d(t,{c:()=>a});let a=(0,n(12115).createContext)(void 0)},39166:(e,t,n)=>{"use strict";n.d(t,{j:()=>l,w:()=>a});let a=["OPENAI","LITELLM","OLLAMA"],s={kind:"anywhere",label:"Launchable"},r="Endpoint is a local address";function l(e){var t;let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],l=function(e){let t=e.config;if("object"!=typeof t||null===t)return null;let n=t.connection;return"object"==typeof n&&null!==n?n:null}(e);if(!l)return{kind:"unsupported",label:"Not launchable from the dashboard yet",reason:"This agent has no model configuration yet. Edit and save it on the Targets page."};let i=String(null!=(t=l.type)?t:"");if(!a.includes(i))return{kind:"unsupported",label:"Not launchable from the dashboard yet",reason:"Only OpenAI, LiteLLM and Ollama agents can be launched from the dashboard."};let o="string"==typeof l.endpoint?l.endpoint.trim():"";if(!o)return"OLLAMA"!==i||n?s:{kind:"local",label:"Local network",reason:"".concat(r," (defaults to localhost)")};let d=function(e){try{return new URL(e.includes("://")?e:"http://".concat(e)).hostname.toLowerCase().replace(/\.$/,"").replace(/^\[(.*)\]$/,"$1")}catch(e){return null}}(o);if(!d)return{kind:"local",label:"Local network",reason:"Endpoint is not a valid URL"};let c=n?null:function(e){if("localhost"===e||e.endsWith(".localhost")||e.endsWith(".local")||"::1"===e)return r;let t=function(e){let t=e.split(".");if(4!==t.length||!t.every(e=>/^\d{1,3}$/.test(e)))return null;let n=t.map(Number);return n.every(e=>e<=255)?n:null}(e);if(!t)return null;let[n,a]=t;return 127===n?r:10===n||172===n&&a>=16&&a<=31||192===n&&168===a?"Endpoint is a private network address":null}(d);return c?{kind:"local",label:"Local network",reason:c}:s}},46056:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>X});var a=n(95155),s=n(12115),r=n(80230),l=n(7831),i=n(41444),o=n(22470),d=n(56419),c=n(35835),u=n(24033),m=n(71360),h=n(6191),x=n(35299),p=n(4882),g=n(74672),f=n(3998),j=n(3730),v=n(51834),b=n(65142),y=n(76444),N=n(39166),A=n(1088),k=n(25733);let w={OPENAI:"OpenAI",LITELLM:"LiteLLM",OLLAMA:"Ollama",GOOGLE_ADK:"Google ADK",CLAUDE_CODE:"Claude Code",CODEX:"Codex",HERMES:"Hermes",WEB:"Web",LANGCHAIN:"LangChain",MCP:"MCP",A2A:"A2A",UNKNOWN:"Unknown"},C=[...N.w.map(e=>({value:e,label:w[e],launchable:!0})),...["GOOGLE_ADK","CLAUDE_CODE","CODEX","HERMES","WEB","LANGCHAIN","MCP","A2A","UNKNOWN"].map(e=>({value:e,label:"".concat(w[e]," ").concat("(dashboard launch not available yet)"),launchable:!1}))],E="__add_secret__",L="flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring";function O(e){return"object"!=typeof e||null===e||Array.isArray(e)?{}:e}function T(e){return"string"==typeof e?e:""}function S(e){return Array.isArray(e)?e.join(" "):String(e)}let _=/(?:^|[^a-z])(?:[a-z]*key|token|secret|password|passwd|auth|authorization|cookie|credentials?|signature|session)(?:$|[^a-z])/;function I(e){var t,n,a,s;let r=O(null==e?void 0:e.config),l=O(r.connection),i=O(r.generation),o=Object.entries(O(l.headers)).filter(e=>{let[,t]=e;return"string"==typeof t}).map(e=>{let[t,n]=e;return{key:t,value:n}});return{name:null!=(t=null==e?void 0:e.name)?t:"",description:null!=(n=null==e?void 0:e.description)?n:"",type:"OPENAI_SDK"===(s=T(l.type)||(null==e?void 0:e.agentType)||"OPENAI")?"OPENAI":s,model:T(r.name),endpoint:T(l.endpoint)||((null==e?void 0:e.config)?"":null!=(a=null==e?void 0:e.endpoint)?a:""),secret:(0,A.rR)(l.api_key),timeout:null==l.timeout?"":String(l.timeout),maxTokens:null==i.max_tokens?"":String(i.max_tokens),headers:o}}async function D(e){if(!(e instanceof p.o3e))return{status:null,body:null};let t=null;try{t=await e.response.json()}catch(e){}return{status:e.response.status,body:t}}function P(e){let{message:t}=e;return t?(0,a.jsx)("p",{className:"text-xs text-destructive",children:t}):null}function z(e){var t;let{open:n,onOpenChange:r,agent:i,onSaved:o}=e,[d,c]=(0,s.useState)(()=>I(i)),[p,N]=(0,s.useState)(!1),[w,T]=(0,s.useState)({}),[z,M]=(0,s.useState)(null),[F,$]=(0,s.useState)(!1),[U,H]=(0,s.useState)([]),[K,R]=(0,s.useState)(null),[W,G]=(0,s.useState)(!1),[J,q]=(0,s.useState)(!1);(0,s.useEffect)(()=>{if(!n)return;let e=I(i);c(e),N(!!e.secret),T({}),M(null),R(null),q(!1)},[n,i]),(0,s.useEffect)(()=>{if(!n)return;let e=!0;return(0,k.i)(e=>l.Ft.secretList({page:e})).then(t=>e&&H(t.map(e=>e.name))).catch(()=>e&&R("Could not load secrets.")),()=>{e=!1}},[n]);let X=(e,t)=>c(n=>({...n,[e]:t})),B="OLLAMA"===d.type,Z=d.secret&&!U.includes(d.secret)?[...U,d.secret]:U,Q=e=>{T(e),(e.timeout||e.maxTokens||e.headers)&&q(!0)},V=async()=>{let e=(()=>{let e={};d.name.trim()||(e.name="Name is required."),d.model.trim()||(e.model="Model is required."),B&&!d.endpoint.trim()&&(e.endpoint="Endpoint is required for Ollama."),p&&!d.secret&&(e.auth="Select a secret or choose None."),d.timeout.trim()&&!(Number(d.timeout)>0)&&(e.timeout="Timeout must be a positive number."),d.maxTokens.trim()&&!(Number.isInteger(Number(d.maxTokens))&&Number(d.maxTokens)>0)&&(e.maxTokens="Max tokens must be a positive whole number.");let t=d.headers.find(e=>e.key.trim()&&function(e){let t=e.trim().toLowerCase();return!t.endsWith("_env")&&_.test(t)}(e.key));return t&&(e.headers="Header ".concat(t.key.trim()," looks like a credential. Store it as a secret and use Authentication → Secret instead.")),e})();if(Q(e),M(null),Object.keys(e).length)return;$(!0);let t={name:d.name.trim(),description:d.description,config:function(e,t){let n={...O(t)},a={...O(n.connection)},s=a.type===e.type;n.name=e.model.trim(),a.type=e.type,s&&a.provider||(a.provider=e.type.toLowerCase());let r=e.endpoint.trim();r?a.endpoint=r:delete a.endpoint,e.secret?a.api_key=(0,A.QO)(e.secret):delete a.api_key;let l=e.headers.filter(e=>e.key.trim()),i={...Object.fromEntries(Object.entries(O(O(n.connection).headers)).filter(e=>{let[,t]=e;return"string"!=typeof t})),...Object.fromEntries(l.map(e=>[e.key.trim(),e.value]))};Object.keys(i).length?a.headers=i:delete a.headers,e.timeout.trim()?a.timeout=Number(e.timeout):delete a.timeout,n.connection=a;let o={...O(n.generation)};return e.maxTokens.trim()?o.max_tokens=Number(e.maxTokens):delete o.max_tokens,Object.keys(o).length?n.generation=o:delete n.generation,n}({...d,secret:p?d.secret:null},null==i?void 0:i.config)};try{(null==i?void 0:i.id)?await l.in.agentUpdate({id:i.id,agentRequest:t}):await l.in.agentCreate({agentRequest:t}),o()}catch(a){let{status:e,body:t}=await D(a);if(400===e&&t){var n;let e=function(e){let t={},n=[];for(let[a,s]of Object.entries(O(e)))if("name"===a||"description"===a)t[a]=S(s);else if("config"!==a||"object"!=typeof s||null===s||Array.isArray(s))n.push("".concat(a,": ").concat(S(s)));else for(let[e,a]of Object.entries(s)){let s="name"===e?"model":"connection.endpoint"===e?"endpoint":"connection.api_key"===e?"auth":"connection.timeout"===e?"timeout":"generation.max_tokens"===e?"maxTokens":e.startsWith("connection.headers")?"headers":null;s?t[s]=S(a):n.push("".concat(e,": ").concat(S(a)))}return{fields:t,general:n.length?n.join("; "):null}}(t);Q(e.fields);let a=Object.keys(e.fields).length>0;M(null!=(n=e.general)?n:a?null:"Could not save the agent (HTTP 400).")}else M(e?"Could not save the agent (HTTP ".concat(e,")."):"Could not save the agent.")}finally{$(!1)}},Y=(e,t)=>X("headers",d.headers.map((n,a)=>a===e?{...n,...t}:n));return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(v.lG,{open:n,onOpenChange:r,children:(0,a.jsxs)(v.Cf,{className:"sm:max-w-[520px] max-h-[90vh] overflow-y-auto",children:[(0,a.jsxs)(v.c7,{children:[(0,a.jsx)(v.L3,{children:i?"Edit target":"Add target"}),(0,a.jsx)(v.rr,{children:i?(0,a.jsxs)(a.Fragment,{children:["Update the details for ",(0,a.jsx)("strong",{children:i.name}),"."]}):"Connect a model or agent for security evaluation."})]}),(0,a.jsxs)("div",{className:"grid gap-4 py-2",children:[(0,a.jsxs)("div",{className:"grid gap-1.5",children:[(0,a.jsxs)(y.J,{htmlFor:"agent-name",children:["Name ",(0,a.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,a.jsx)(b.p,{id:"agent-name",value:d.name,onChange:e=>X("name",e.target.value)}),(0,a.jsx)(P,{message:w.name})]}),(0,a.jsxs)("div",{className:"grid gap-1.5",children:[(0,a.jsx)(y.J,{htmlFor:"agent-description",children:"Description"}),(0,a.jsx)("textarea",{id:"agent-description",value:d.description,onChange:e=>X("description",e.target.value),rows:2,className:"flex w-full rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring resize-none"}),(0,a.jsx)(P,{message:w.description})]}),(0,a.jsxs)("div",{className:"grid gap-1.5",children:[(0,a.jsx)(y.J,{htmlFor:"agent-type",children:"Type"}),(0,a.jsx)("select",{id:"agent-type",className:L,value:d.type,onChange:e=>X("type",e.target.value),children:C.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},e.value))})]}),(0,a.jsxs)("div",{className:"grid gap-1.5",children:[(0,a.jsxs)(y.J,{htmlFor:"agent-model",children:["Model ",(0,a.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,a.jsx)(b.p,{id:"agent-model",value:d.model,onChange:e=>X("model",e.target.value),placeholder:"gpt-4o-mini",className:"font-mono text-sm"}),(0,a.jsx)(P,{message:w.model})]}),(0,a.jsxs)("div",{className:"grid gap-1.5",children:[(0,a.jsxs)(y.J,{htmlFor:"agent-endpoint",children:["Endpoint ",B&&(0,a.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,a.jsx)(b.p,{id:"agent-endpoint",value:d.endpoint,onChange:e=>X("endpoint",e.target.value),placeholder:"OLLAMA"===d.type?"http://localhost:11434":"https://api.example.com/v1",className:"font-mono text-sm"}),"OPENAI"===d.type&&(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"Leave empty to use the OpenAI API"}),(0,a.jsx)(P,{message:w.endpoint})]}),(0,a.jsxs)("div",{className:"grid gap-1.5",children:[(0,a.jsx)(y.J,{htmlFor:"agent-auth",children:"Authentication"}),(0,a.jsxs)("select",{id:"agent-auth",className:L,value:p?"secret":"none",onChange:e=>{N("secret"===e.target.value),"secret"!==e.target.value&&X("secret",null)},children:[(0,a.jsx)("option",{value:"none",children:"None"}),(0,a.jsx)("option",{value:"secret",children:"Secret"})]}),p&&(0,a.jsxs)("select",{"aria-label":"Secret",className:L,value:null!=(t=d.secret)?t:"",onChange:e=>e.target.value===E?G(!0):X("secret",e.target.value),children:[(0,a.jsx)("option",{value:"",disabled:!0,children:"Select a secret"}),Z.map(e=>(0,a.jsx)("option",{value:e,children:e},e)),(0,a.jsx)("option",{value:E,children:"Add secret…"})]}),K&&(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:K}),(0,a.jsx)(P,{message:w.auth})]}),(0,a.jsxs)(j.Nt,{open:J,onOpenChange:q,children:[(0,a.jsxs)(j.R6,{className:"flex items-center gap-1 text-sm font-medium",children:[(0,a.jsx)(u.A,{className:"h-4 w-4"})," Advanced"]}),(0,a.jsxs)(j.Ke,{className:"grid gap-4 pt-3",children:[(0,a.jsxs)("div",{className:"grid gap-1.5",children:[(0,a.jsx)(y.J,{htmlFor:"agent-timeout",children:"Timeout (seconds)"}),(0,a.jsx)(b.p,{id:"agent-timeout",type:"number",min:1,value:d.timeout,onChange:e=>X("timeout",e.target.value)}),(0,a.jsx)(P,{message:w.timeout})]}),(0,a.jsxs)("div",{className:"grid gap-1.5",children:[(0,a.jsx)(y.J,{htmlFor:"agent-max-tokens",children:"Max tokens"}),(0,a.jsx)(b.p,{id:"agent-max-tokens",type:"number",inputMode:"numeric",min:1,step:1,placeholder:"Model maximum","aria-describedby":"agent-max-tokens-help",value:d.maxTokens,onChange:e=>X("maxTokens",e.target.value)}),(0,a.jsx)("p",{id:"agent-max-tokens-help",className:"text-xs text-muted-foreground",children:"Longest reply the target may write. Leave empty to use the model's maximum."}),(0,a.jsx)(P,{message:w.maxTokens})]}),(0,a.jsxs)("div",{className:"grid gap-1.5",children:[(0,a.jsx)(y.J,{children:"Headers"}),d.headers.map((e,t)=>(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(b.p,{"aria-label":"Header name ".concat(t+1),value:e.key,onChange:e=>Y(t,{key:e.target.value}),placeholder:"Name"}),(0,a.jsx)(b.p,{"aria-label":"Header value ".concat(t+1),value:e.value,onChange:e=>Y(t,{value:e.target.value}),placeholder:"Value"}),(0,a.jsx)(f.$,{type:"button",variant:"ghost",size:"icon","aria-label":"Remove header ".concat(t+1),onClick:()=>X("headers",d.headers.filter((e,n)=>n!==t)),children:(0,a.jsx)(m.A,{className:"h-4 w-4"})})]},t)),(0,a.jsxs)(f.$,{type:"button",variant:"outline",size:"sm",className:"w-fit",onClick:()=>X("headers",[...d.headers,{key:"",value:""}]),children:[(0,a.jsx)(h.A,{className:"mr-1 h-4 w-4"})," Add header"]}),(0,a.jsx)(P,{message:w.headers})]})]})]}),z&&(0,a.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:z})]}),(0,a.jsxs)(v.Es,{children:[(0,a.jsx)(f.$,{variant:"outline",disabled:F,onClick:()=>r(!1),children:"Cancel"}),(0,a.jsxs)(f.$,{onClick:V,disabled:F,children:[F&&(0,a.jsx)(x.A,{className:"mr-2 h-4 w-4 animate-spin"}),i?"Save changes":"Add target"]})]})]})}),(0,a.jsx)(g.q,{open:W,onOpenChange:G,onSaved:e=>{H(t=>t.includes(e)?t:[...t,e]),X("secret",e),G(!1)}})]})}var M=n(87270),F=n(20243),$=n(18332),U=n(98053),H=n(50803),K=n(78192),R=n(46826),W=n(18514),G=n(46767);let J={LITELLM:"bg-purple-100 text-purple-800 dark:bg-purple-900/30 dark:text-purple-300",OPENAI:"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-300",OLLAMA:"bg-orange-100 text-orange-800 dark:bg-orange-900/30 dark:text-orange-300",GOOGLE_ADK:"bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-300",UNKNOWN:"bg-zinc-100 text-zinc-600 dark:bg-zinc-800 dark:text-zinc-400"},q=(0,i.h)("AgentsPage");function X(){var e;let{isAuthenticated:t,isLoading:n}=(0,r.h)(),[i,u]=(0,s.useState)([]),[h,p]=(0,s.useState)(!0),[g,j]=(0,s.useState)(null),[v,b]=(0,s.useState)(null),[y,N]=(0,s.useState)({open:!1,title:"",description:""}),[A,k]=(0,s.useState)({open:!1,agent:null}),[C,E]=(0,s.useState)(null),[L,O]=(0,s.useState)(!0),[T,S]=(0,s.useState)(null),[_,I]=(0,s.useState)(!1),[D,P]=(0,s.useState)(null),X=(0,s.useCallback)(async()=>{p(!0),j(null),q.debug("Fetching agents...");try{var e;let t=await l.in.agentList();q.info({count:null==(e=t.results)?void 0:e.length},"Agents fetched successfully"),u(t.results||[])}catch(t){q.error({err:t},"Error fetching agents");let e=t.message||"Failed to load agents. Please try again later.";if(t.response){let n=t.response.status,a="Could not read error body";try{a=await t.response.text()}catch(e){}q.error({status:n,responseBody:a},"API Error"),e=403===n?"Forbidden: Check your permissions.":401===n?"Unauthorized: Please log in again.":"API Error (".concat(n,"): ").concat(a||e)}j(e),u([])}finally{p(!1)}},[]);(0,s.useEffect)(()=>{(async()=>{if(!n&&t){O(!0),S(null);try{q.debug("Fetching user profile via /user/me...");let e=await l.userApi.userMeRetrieve();E(e),q.debug({org:e.organization},"User profile fetched")}catch(t){q.error({err:t},"Error fetching user profile");let e=t.message||"Failed to load user profile.";if(t.response){let n=t.response.status,a="Could not read error body";try{a=await t.response.text()}catch(e){}e="Profile API Error (".concat(n,"): ").concat(a||e)}S(e)}finally{O(!1)}}})()},[n,t]);let B=()=>L?void N({open:!0,title:"Please Wait",description:"User profile is still loading. Please wait a moment."}):!T&&(null==C?void 0:C.organization)?void(P(null),I(!0)):void N({open:!0,title:"Organization Error",description:"Cannot create agent: Organization ID not found. ".concat(T||"Organization ID missing from profile.")}),Z=e=>{if(!e.id)return void N({open:!0,title:"Invalid Agent",description:"Cannot edit agent: ID is missing."});P(e),I(!0)},Q=async()=>{let e=A.agent;if(!(null==e?void 0:e.id))return;let t=e.id;k({open:!1,agent:null}),b(t);try{await l.in.agentDestroy({id:t}),q.info({agentId:t},"Agent deleted successfully"),u(e=>e.filter(e=>e.id!==t))}catch(n){q.error({err:n},"Error deleting agent");let t=n.message||'Failed to delete agent "'.concat(e.name,'". Please try again.');if(n.response){let e=n.response.status,a="Could not read error body";try{a=await n.response.text()}catch(e){}q.error({status:e,responseBody:a},"Delete API Error"),t="Delete API Error (".concat(e,"): ").concat(a||t)}N({open:!0,title:"Error Deleting Agent",description:t})}finally{b(null)}};return((0,s.useEffect)(()=>{!n&&t?X():n||t||(p(!1),u([]),j(null),b(null))},[n,t,X]),n||h&&0===i.length&&!g||L)?(0,a.jsx)(o.M,{title:"Targets",description:"Connect models and AI agents to evaluate their security.",children:(0,a.jsx)("div",{className:"px-6 space-y-3",children:[void 0,void 0,void 0].map((e,t)=>(0,a.jsxs)("div",{className:"border rounded-lg p-4 flex items-start gap-4",children:[(0,a.jsx)(F.E,{className:"h-10 w-10 rounded-md flex-shrink-0"}),(0,a.jsxs)("div",{className:"flex-1 space-y-2",children:[(0,a.jsx)(F.E,{className:"h-4 w-1/4"}),(0,a.jsx)(F.E,{className:"h-3 w-1/2"})]}),(0,a.jsx)(F.E,{className:"h-6 w-20 rounded-full"}),(0,a.jsx)(F.E,{className:"h-8 w-8 rounded"}),(0,a.jsx)(F.E,{className:"h-8 w-8 rounded"})]},"skeleton-".concat(t)))})}):(0,a.jsxs)(o.M,{title:"Targets",description:"Connect models and AI agents to evaluate their security.",action:t&&(0,a.jsxs)(f.$,{onClick:B,children:[(0,a.jsx)(R.A,{className:"mr-2 h-4 w-4"})," Add target"]}),children:[(0,a.jsxs)("div",{className:"px-6 space-y-4",children:[!t&&!n&&(0,a.jsxs)($.Fc,{children:[(0,a.jsx)(H.A,{className:"h-4 w-4"}),(0,a.jsx)($.XL,{children:"Authentication Required"}),(0,a.jsx)($.TN,{children:"Please log in to manage targets."})]}),t&&g&&(0,a.jsxs)($.Fc,{variant:"destructive",children:[(0,a.jsx)(H.A,{className:"h-4 w-4"}),(0,a.jsx)($.XL,{children:"Error loading targets"}),(0,a.jsx)($.TN,{children:g})]}),t&&T&&(0,a.jsxs)($.Fc,{variant:"destructive",children:[(0,a.jsx)(H.A,{className:"h-4 w-4"}),(0,a.jsx)($.XL,{children:"Profile Error"}),(0,a.jsxs)($.TN,{children:[T," — Agent creation may not be available."]})]}),t&&!h&&0===i.length&&!g&&(0,a.jsx)(d.p,{icon:K.A,title:"No targets configured",description:"Connect your first model or AI agent to use it in a campaign.",action:(0,a.jsxs)(f.$,{onClick:B,children:[(0,a.jsx)(R.A,{className:"mr-2 h-4 w-4"})," Add target"]})}),t&&i.length>0&&(0,a.jsx)(G.Bc,{children:(0,a.jsx)("div",{className:"rounded-lg border overflow-hidden",children:(0,a.jsxs)(M.XI,{children:[(0,a.jsx)(M.A0,{children:(0,a.jsxs)(M.Hj,{className:"bg-muted/50 hover:bg-muted/50",children:[(0,a.jsx)(M.nd,{className:"w-[25%] pl-4",children:"Target"}),(0,a.jsx)(M.nd,{className:"w-[15%]",children:"Model"}),(0,a.jsx)(M.nd,{className:"w-[20%]",children:"Endpoint"}),(0,a.jsx)(M.nd,{className:"w-[15%]",children:"Type"}),(0,a.jsx)(M.nd,{className:"w-[12%]",children:"Created"}),(0,a.jsx)(M.nd,{className:"w-[13%] text-right pr-4",children:"Actions"})]})}),(0,a.jsx)(M.BF,{children:i.map(e=>{var t,n,s,r;return(0,a.jsxs)(M.Hj,{className:"group",children:[(0,a.jsx)(M.nA,{className:"pl-4",children:(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("div",{className:"mt-0.5 h-8 w-8 rounded-md bg-muted flex items-center justify-center flex-shrink-0",children:(0,a.jsx)(K.A,{className:"h-4 w-4 text-muted-foreground"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:"font-medium text-sm leading-tight",children:e.name}),e.description&&(0,a.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5 line-clamp-1",children:e.description}),(null==(t=e.organizationDetail)?void 0:t.name)&&(0,a.jsx)("p",{className:"text-xs text-muted-foreground/70 mt-0.5",children:e.organizationDetail.name})]})]})}),(0,a.jsx)(M.nA,{children:e.config?(0,a.jsx)("span",{className:"text-sm font-mono",children:function(e){let t=null==e?void 0:e.name;return"string"==typeof t&&t?t:"—"}(e.config)}):(0,a.jsx)("button",{type:"button",onClick:()=>Z(e),className:"text-xs font-medium text-amber-700 dark:text-amber-400 underline-offset-2 hover:underline",children:"Needs configuration"})}),(0,a.jsx)(M.nA,{children:(0,a.jsxs)(G.m_,{children:[(0,a.jsx)(G.k$,{asChild:!0,children:(0,a.jsx)("span",{className:"text-sm text-muted-foreground font-mono truncate block max-w-[200px] cursor-default",children:e.endpoint||"—"})}),(0,a.jsx)(G.ZI,{side:"bottom",className:"max-w-sm break-all",children:e.endpoint||"No endpoint"})]})}),(0,a.jsx)(M.nA,{children:e.agentType?(0,a.jsx)("span",{className:"inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ".concat(null!=(n=J[e.agentType])?n:J.UNKNOWN),children:null!=(r=w[s=e.agentType])?r:s}):(0,a.jsx)("span",{className:"text-xs text-muted-foreground/50",children:"—"})}),(0,a.jsx)(M.nA,{children:(0,a.jsx)("span",{className:"text-sm text-muted-foreground",children:e.createdAt?new Date(e.createdAt).toLocaleDateString():"—"})}),(0,a.jsx)(M.nA,{className:"text-right pr-4",children:(0,a.jsxs)("div",{className:"flex items-center justify-end gap-1",children:[(0,a.jsxs)(G.m_,{children:[(0,a.jsx)(G.k$,{asChild:!0,children:(0,a.jsx)(f.$,{variant:"ghost",size:"icon",onClick:()=>Z(e),disabled:!!v,className:"h-8 w-8 opacity-0 group-hover:opacity-100 transition-opacity",children:(0,a.jsx)(W.A,{className:"h-3.5 w-3.5"})})}),(0,a.jsx)(G.ZI,{children:"Edit target"})]}),(0,a.jsxs)(G.m_,{children:[(0,a.jsx)(G.k$,{asChild:!0,children:(0,a.jsx)(f.$,{variant:"ghost",size:"icon",onClick:()=>(e=>{if(!e.id)return void N({open:!0,title:"Invalid Agent",description:"Cannot delete agent: ID missing or invalid."});k({open:!0,agent:e})})(e),disabled:!!v,className:"h-8 w-8 opacity-0 group-hover:opacity-100 transition-opacity ".concat(v===e.id?"text-destructive opacity-100":"hover:text-destructive"),children:v===e.id?(0,a.jsx)(x.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,a.jsx)(m.A,{className:"h-3.5 w-3.5"})})}),(0,a.jsx)(G.ZI,{children:"Delete target"})]})]})})]},e.id)})})]})})})]}),(0,a.jsx)(z,{open:_,onOpenChange:I,agent:D,onSaved:()=>{I(!1),P(null),X()}}),(0,a.jsx)(U.Lt,{open:y.open,onOpenChange:e=>N(t=>({...t,open:e})),children:(0,a.jsxs)(U.EO,{children:[(0,a.jsxs)(U.wd,{children:[(0,a.jsx)(U.r7,{children:y.title}),(0,a.jsx)(U.$v,{children:y.description})]}),(0,a.jsx)(U.ck,{children:(0,a.jsx)(U.Rx,{onClick:()=>N(e=>({...e,open:!1})),children:"OK"})})]})}),(0,a.jsx)(c.T,{open:A.open,onOpenChange:e=>k(t=>({...t,open:e})),title:"Delete target",description:'Are you sure you want to delete "'.concat(null==(e=A.agent)?void 0:e.name,'"? This action cannot be undone.'),onConfirm:Q,confirmText:"Delete",variant:"destructive"})]})}},46767:(e,t,n)=>{"use strict";n.d(t,{Bc:()=>l,ZI:()=>d,k$:()=>o,m_:()=>i});var a=n(95155);n(12115);var s=n(53583),r=n(64269);function l(e){let{delayDuration:t=0,...n}=e;return(0,a.jsx)(s.Kq,{"data-slot":"tooltip-provider",delayDuration:t,...n})}function i(e){let{...t}=e;return(0,a.jsx)(l,{children:(0,a.jsx)(s.bL,{"data-slot":"tooltip",...t})})}function o(e){let{...t}=e;return(0,a.jsx)(s.l9,{"data-slot":"tooltip-trigger",...t})}function d(e){let{className:t,sideOffset:n=0,children:l,...i}=e;return(0,a.jsx)(s.ZL,{children:(0,a.jsxs)(s.UC,{"data-slot":"tooltip-content",sideOffset:n,className:(0,r.cn)("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",t),...i,children:[l,(0,a.jsx)(s.i3,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}},50952:(e,t,n)=>{Promise.resolve().then(n.bind(n,46056))},80230:(e,t,n)=>{"use strict";n.d(t,{h:()=>l});var a=n(12115),s=n(34105);let r=async()=>"";function l(){let e=(0,a.useContext)(s.c);return e||{provider:"disabled",user:void 0,isAuthenticated:!1,isLoading:!0,login:void 0,logout:void 0,getAccessTokenSilently:r}}},87270:(e,t,n)=>{"use strict";n.d(t,{A0:()=>l,BF:()=>i,Hj:()=>o,XI:()=>r,nA:()=>c,nd:()=>d});var a=n(95155);n(12115);var s=n(64269);function r(e){let{className:t,...n}=e;return(0,a.jsx)("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:(0,a.jsx)("table",{"data-slot":"table",className:(0,s.cn)("w-full caption-bottom text-sm",t),...n})})}function l(e){let{className:t,...n}=e;return(0,a.jsx)("thead",{"data-slot":"table-header",className:(0,s.cn)("[&_tr]:border-b",t),...n})}function i(e){let{className:t,...n}=e;return(0,a.jsx)("tbody",{"data-slot":"table-body",className:(0,s.cn)("[&_tr:last-child]:border-0",t),...n})}function o(e){let{className:t,...n}=e;return(0,a.jsx)("tr",{"data-slot":"table-row",className:(0,s.cn)("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",t),...n})}function d(e){let{className:t,...n}=e;return(0,a.jsx)("th",{"data-slot":"table-head",className:(0,s.cn)("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...n})}function c(e){let{className:t,...n}=e;return(0,a.jsx)("td",{"data-slot":"table-cell",className:(0,s.cn)("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...n})}}},e=>{e.O(0,[187,272,583,8,924,97,441,493,358],()=>e(e.s=50952)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[165],{3730:(e,t,n)=>{"use strict";n.d(t,{Ke:()=>l,Nt:()=>s,R6:()=>r});var a=n(49578);let s=a.bL,r=a.R6,l=a.Ke},34105:(e,t,n)=>{"use strict";n.d(t,{c:()=>a});let a=(0,n(12115).createContext)(void 0)},39166:(e,t,n)=>{"use strict";n.d(t,{j:()=>l,w:()=>a});let a=["OPENAI","LITELLM","OLLAMA"],s={kind:"anywhere",label:"Launchable"},r="Endpoint is a local address";function l(e){var t;let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],l=function(e){let t=e.config;if("object"!=typeof t||null===t)return null;let n=t.connection;return"object"==typeof n&&null!==n?n:null}(e);if(!l)return{kind:"unsupported",label:"Not launchable from the dashboard yet",reason:"This agent has no model configuration yet. Edit and save it on the Targets page."};let i=String(null!=(t=l.type)?t:"");if(!a.includes(i))return{kind:"unsupported",label:"Not launchable from the dashboard yet",reason:"Only OpenAI, LiteLLM and Ollama agents can be launched from the dashboard."};let o="string"==typeof l.endpoint?l.endpoint.trim():"";if(!o)return"OLLAMA"!==i||n?s:{kind:"local",label:"Local network",reason:"".concat(r," (defaults to localhost)")};let d=function(e){try{return new URL(e.includes("://")?e:"http://".concat(e)).hostname.toLowerCase().replace(/\.$/,"").replace(/^\[(.*)\]$/,"$1")}catch(e){return null}}(o);if(!d)return{kind:"local",label:"Local network",reason:"Endpoint is not a valid URL"};let c=n?null:function(e){if("localhost"===e||e.endsWith(".localhost")||e.endsWith(".local")||"::1"===e)return r;let t=function(e){let t=e.split(".");if(4!==t.length||!t.every(e=>/^\d{1,3}$/.test(e)))return null;let n=t.map(Number);return n.every(e=>e<=255)?n:null}(e);if(!t)return null;let[n,a]=t;return 127===n?r:10===n||172===n&&a>=16&&a<=31||192===n&&168===a?"Endpoint is a private network address":null}(d);return c?{kind:"local",label:"Local network",reason:c}:s}},46056:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>X});var a=n(95155),s=n(12115),r=n(80230),l=n(7831),i=n(41444),o=n(22470),d=n(56419),c=n(35835),u=n(24033),m=n(71360),h=n(6191),x=n(35299),p=n(4882),g=n(74672),f=n(3998),j=n(3730),v=n(51834),b=n(65142),y=n(76444),N=n(39166),A=n(1088),k=n(25733);let w={OPENAI:"OpenAI",LITELLM:"LiteLLM",OLLAMA:"Ollama",GOOGLE_ADK:"Google ADK",CLAUDE_CODE:"Claude Code",CODEX:"Codex",HERMES:"Hermes",WEB:"Web",LANGCHAIN:"LangChain",MCP:"MCP",A2A:"A2A",UNKNOWN:"Unknown"},C=[...N.w.map(e=>({value:e,label:w[e],launchable:!0})),...["GOOGLE_ADK","CLAUDE_CODE","CODEX","HERMES","WEB","LANGCHAIN","MCP","A2A","UNKNOWN"].map(e=>({value:e,label:"".concat(w[e]," ").concat("(dashboard launch not available yet)"),launchable:!1}))],E="__add_secret__",L="flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring";function O(e){return"object"!=typeof e||null===e||Array.isArray(e)?{}:e}function T(e){return"string"==typeof e?e:""}function S(e){return Array.isArray(e)?e.join(" "):String(e)}let _=/(?:^|[^a-z])(?:[a-z]*key|token|secret|password|passwd|auth|authorization|cookie|credentials?|signature|session)(?:$|[^a-z])/;function I(e){var t,n,a,s;let r=O(null==e?void 0:e.config),l=O(r.connection),i=O(r.generation),o=Object.entries(O(l.headers)).filter(e=>{let[,t]=e;return"string"==typeof t}).map(e=>{let[t,n]=e;return{key:t,value:n}});return{name:null!=(t=null==e?void 0:e.name)?t:"",description:null!=(n=null==e?void 0:e.description)?n:"",type:"OPENAI_SDK"===(s=T(l.type)||(null==e?void 0:e.agentType)||"OPENAI")?"OPENAI":s,model:T(r.name),endpoint:T(l.endpoint)||((null==e?void 0:e.config)?"":null!=(a=null==e?void 0:e.endpoint)?a:""),secret:(0,A.rR)(l.api_key),timeout:null==l.timeout?"":String(l.timeout),maxTokens:null==i.max_tokens?"":String(i.max_tokens),headers:o}}async function D(e){if(!(e instanceof p.o3e))return{status:null,body:null};let t=null;try{t=await e.response.json()}catch(e){}return{status:e.response.status,body:t}}function P(e){let{message:t}=e;return t?(0,a.jsx)("p",{className:"text-xs text-destructive",children:t}):null}function z(e){var t;let{open:n,onOpenChange:r,agent:i,onSaved:o}=e,[d,c]=(0,s.useState)(()=>I(i)),[p,N]=(0,s.useState)(!1),[w,T]=(0,s.useState)({}),[z,M]=(0,s.useState)(null),[F,$]=(0,s.useState)(!1),[U,H]=(0,s.useState)([]),[K,R]=(0,s.useState)(null),[W,G]=(0,s.useState)(!1),[J,q]=(0,s.useState)(!1);(0,s.useEffect)(()=>{if(!n)return;let e=I(i);c(e),N(!!e.secret),T({}),M(null),R(null),q(!1)},[n,i]),(0,s.useEffect)(()=>{if(!n)return;let e=!0;return(0,k.i)(e=>l.Ft.secretList({page:e})).then(t=>e&&H(t.map(e=>e.name))).catch(()=>e&&R("Could not load secrets.")),()=>{e=!1}},[n]);let X=(e,t)=>c(n=>({...n,[e]:t})),B="OLLAMA"===d.type,Z=d.secret&&!U.includes(d.secret)?[...U,d.secret]:U,Q=e=>{T(e),(e.timeout||e.maxTokens||e.headers)&&q(!0)},V=async()=>{let e=(()=>{let e={};d.name.trim()||(e.name="Name is required."),d.model.trim()||(e.model="Model is required."),B&&!d.endpoint.trim()&&(e.endpoint="Endpoint is required for Ollama."),p&&!d.secret&&(e.auth="Select a secret or choose None."),d.timeout.trim()&&!(Number(d.timeout)>0)&&(e.timeout="Timeout must be a positive number."),d.maxTokens.trim()&&!(Number.isInteger(Number(d.maxTokens))&&Number(d.maxTokens)>0)&&(e.maxTokens="Max tokens must be a positive whole number.");let t=d.headers.find(e=>e.key.trim()&&function(e){let t=e.trim().toLowerCase();return!t.endsWith("_env")&&_.test(t)}(e.key));return t&&(e.headers="Header ".concat(t.key.trim()," looks like a credential. Store it as a secret and use Authentication → Secret instead.")),e})();if(Q(e),M(null),Object.keys(e).length)return;$(!0);let t={name:d.name.trim(),description:d.description,config:function(e,t){let n={...O(t)},a={...O(n.connection)},s=a.type===e.type;n.name=e.model.trim(),a.type=e.type,s&&a.provider||(a.provider=e.type.toLowerCase());let r=e.endpoint.trim();r?a.endpoint=r:delete a.endpoint,e.secret?a.api_key=(0,A.QO)(e.secret):delete a.api_key;let l=e.headers.filter(e=>e.key.trim()),i={...Object.fromEntries(Object.entries(O(O(n.connection).headers)).filter(e=>{let[,t]=e;return"string"!=typeof t})),...Object.fromEntries(l.map(e=>[e.key.trim(),e.value]))};Object.keys(i).length?a.headers=i:delete a.headers,e.timeout.trim()?a.timeout=Number(e.timeout):delete a.timeout,n.connection=a;let o={...O(n.generation)};return e.maxTokens.trim()?o.max_tokens=Number(e.maxTokens):delete o.max_tokens,Object.keys(o).length?n.generation=o:delete n.generation,n}({...d,secret:p?d.secret:null},null==i?void 0:i.config)};try{(null==i?void 0:i.id)?await l.in.agentUpdate({id:i.id,agentRequest:t}):await l.in.agentCreate({agentRequest:t}),o()}catch(a){let{status:e,body:t}=await D(a);if(400===e&&t){var n;let e=function(e){let t={},n=[];for(let[a,s]of Object.entries(O(e)))if("name"===a||"description"===a)t[a]=S(s);else if("config"!==a||"object"!=typeof s||null===s||Array.isArray(s))n.push("".concat(a,": ").concat(S(s)));else for(let[e,a]of Object.entries(s)){let s="name"===e?"model":"connection.endpoint"===e?"endpoint":"connection.api_key"===e?"auth":"connection.timeout"===e?"timeout":"generation.max_tokens"===e?"maxTokens":e.startsWith("connection.headers")?"headers":null;s?t[s]=S(a):n.push("".concat(e,": ").concat(S(a)))}return{fields:t,general:n.length?n.join("; "):null}}(t);Q(e.fields);let a=Object.keys(e.fields).length>0;M(null!=(n=e.general)?n:a?null:"Could not save the agent (HTTP 400).")}else M(e?"Could not save the agent (HTTP ".concat(e,")."):"Could not save the agent.")}finally{$(!1)}},Y=(e,t)=>X("headers",d.headers.map((n,a)=>a===e?{...n,...t}:n));return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(v.lG,{open:n,onOpenChange:r,children:(0,a.jsxs)(v.Cf,{className:"sm:max-w-[520px] max-h-[90vh] overflow-y-auto",children:[(0,a.jsxs)(v.c7,{children:[(0,a.jsx)(v.L3,{children:i?"Edit target":"Add target"}),(0,a.jsx)(v.rr,{children:i?(0,a.jsxs)(a.Fragment,{children:["Update the details for ",(0,a.jsx)("strong",{children:i.name}),"."]}):"Connect a model or agent for security evaluation."})]}),(0,a.jsxs)("div",{className:"grid gap-4 py-2",children:[(0,a.jsxs)("div",{className:"grid gap-1.5",children:[(0,a.jsxs)(y.J,{htmlFor:"agent-name",children:["Name ",(0,a.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,a.jsx)(b.p,{id:"agent-name",value:d.name,onChange:e=>X("name",e.target.value)}),(0,a.jsx)(P,{message:w.name})]}),(0,a.jsxs)("div",{className:"grid gap-1.5",children:[(0,a.jsx)(y.J,{htmlFor:"agent-description",children:"Description"}),(0,a.jsx)("textarea",{id:"agent-description",value:d.description,onChange:e=>X("description",e.target.value),rows:2,className:"flex w-full rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring resize-none"}),(0,a.jsx)(P,{message:w.description})]}),(0,a.jsxs)("div",{className:"grid gap-1.5",children:[(0,a.jsx)(y.J,{htmlFor:"agent-type",children:"Type"}),(0,a.jsx)("select",{id:"agent-type",className:L,value:d.type,onChange:e=>X("type",e.target.value),children:C.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},e.value))})]}),(0,a.jsxs)("div",{className:"grid gap-1.5",children:[(0,a.jsxs)(y.J,{htmlFor:"agent-model",children:["Model ",(0,a.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,a.jsx)(b.p,{id:"agent-model",value:d.model,onChange:e=>X("model",e.target.value),placeholder:"gpt-4o-mini",className:"font-mono text-sm"}),(0,a.jsx)(P,{message:w.model})]}),(0,a.jsxs)("div",{className:"grid gap-1.5",children:[(0,a.jsxs)(y.J,{htmlFor:"agent-endpoint",children:["Endpoint ",B&&(0,a.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,a.jsx)(b.p,{id:"agent-endpoint",value:d.endpoint,onChange:e=>X("endpoint",e.target.value),placeholder:"OLLAMA"===d.type?"http://localhost:11434":"https://api.example.com/v1",className:"font-mono text-sm"}),"OPENAI"===d.type&&(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"Leave empty to use the OpenAI API"}),(0,a.jsx)(P,{message:w.endpoint})]}),(0,a.jsxs)("div",{className:"grid gap-1.5",children:[(0,a.jsx)(y.J,{htmlFor:"agent-auth",children:"Authentication"}),(0,a.jsxs)("select",{id:"agent-auth",className:L,value:p?"secret":"none",onChange:e=>{N("secret"===e.target.value),"secret"!==e.target.value&&X("secret",null)},children:[(0,a.jsx)("option",{value:"none",children:"None"}),(0,a.jsx)("option",{value:"secret",children:"Secret"})]}),p&&(0,a.jsxs)("select",{"aria-label":"Secret",className:L,value:null!=(t=d.secret)?t:"",onChange:e=>e.target.value===E?G(!0):X("secret",e.target.value),children:[(0,a.jsx)("option",{value:"",disabled:!0,children:"Select a secret"}),Z.map(e=>(0,a.jsx)("option",{value:e,children:e},e)),(0,a.jsx)("option",{value:E,children:"Add secret…"})]}),K&&(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:K}),(0,a.jsx)(P,{message:w.auth})]}),(0,a.jsxs)(j.Nt,{open:J,onOpenChange:q,children:[(0,a.jsxs)(j.R6,{className:"flex items-center gap-1 text-sm font-medium",children:[(0,a.jsx)(u.A,{className:"h-4 w-4"})," Advanced"]}),(0,a.jsxs)(j.Ke,{className:"grid gap-4 pt-3",children:[(0,a.jsxs)("div",{className:"grid gap-1.5",children:[(0,a.jsx)(y.J,{htmlFor:"agent-timeout",children:"Timeout (seconds)"}),(0,a.jsx)(b.p,{id:"agent-timeout",type:"number",min:1,value:d.timeout,onChange:e=>X("timeout",e.target.value)}),(0,a.jsx)(P,{message:w.timeout})]}),(0,a.jsxs)("div",{className:"grid gap-1.5",children:[(0,a.jsx)(y.J,{htmlFor:"agent-max-tokens",children:"Max tokens"}),(0,a.jsx)(b.p,{id:"agent-max-tokens",type:"number",inputMode:"numeric",min:1,step:1,placeholder:"Model maximum","aria-describedby":"agent-max-tokens-help",value:d.maxTokens,onChange:e=>X("maxTokens",e.target.value)}),(0,a.jsx)("p",{id:"agent-max-tokens-help",className:"text-xs text-muted-foreground",children:"Longest reply the target may write. Leave empty to use the model's maximum."}),(0,a.jsx)(P,{message:w.maxTokens})]}),(0,a.jsxs)("div",{className:"grid gap-1.5",children:[(0,a.jsx)(y.J,{children:"Headers"}),d.headers.map((e,t)=>(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(b.p,{"aria-label":"Header name ".concat(t+1),value:e.key,onChange:e=>Y(t,{key:e.target.value}),placeholder:"Name"}),(0,a.jsx)(b.p,{"aria-label":"Header value ".concat(t+1),value:e.value,onChange:e=>Y(t,{value:e.target.value}),placeholder:"Value"}),(0,a.jsx)(f.$,{type:"button",variant:"ghost",size:"icon","aria-label":"Remove header ".concat(t+1),onClick:()=>X("headers",d.headers.filter((e,n)=>n!==t)),children:(0,a.jsx)(m.A,{className:"h-4 w-4"})})]},t)),(0,a.jsxs)(f.$,{type:"button",variant:"outline",size:"sm",className:"w-fit",onClick:()=>X("headers",[...d.headers,{key:"",value:""}]),children:[(0,a.jsx)(h.A,{className:"mr-1 h-4 w-4"})," Add header"]}),(0,a.jsx)(P,{message:w.headers})]})]})]}),z&&(0,a.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:z})]}),(0,a.jsxs)(v.Es,{children:[(0,a.jsx)(f.$,{variant:"outline",disabled:F,onClick:()=>r(!1),children:"Cancel"}),(0,a.jsxs)(f.$,{onClick:V,disabled:F,children:[F&&(0,a.jsx)(x.A,{className:"mr-2 h-4 w-4 animate-spin"}),i?"Save changes":"Add target"]})]})]})}),(0,a.jsx)(g.q,{open:W,onOpenChange:G,onSaved:e=>{H(t=>t.includes(e)?t:[...t,e]),X("secret",e),G(!1)}})]})}var M=n(87270),F=n(20243),$=n(18332),U=n(98053),H=n(50803),K=n(78192),R=n(46826),W=n(18514),G=n(46767);let J={LITELLM:"bg-purple-100 text-purple-800 dark:bg-purple-900/30 dark:text-purple-300",OPENAI:"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-300",OLLAMA:"bg-orange-100 text-orange-800 dark:bg-orange-900/30 dark:text-orange-300",GOOGLE_ADK:"bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-300",UNKNOWN:"bg-zinc-100 text-zinc-600 dark:bg-zinc-800 dark:text-zinc-400"},q=(0,i.h)("AgentsPage");function X(){var e;let{isAuthenticated:t,isLoading:n}=(0,r.h)(),[i,u]=(0,s.useState)([]),[h,p]=(0,s.useState)(!0),[g,j]=(0,s.useState)(null),[v,b]=(0,s.useState)(null),[y,N]=(0,s.useState)({open:!1,title:"",description:""}),[A,k]=(0,s.useState)({open:!1,agent:null}),[C,E]=(0,s.useState)(null),[L,O]=(0,s.useState)(!0),[T,S]=(0,s.useState)(null),[_,I]=(0,s.useState)(!1),[D,P]=(0,s.useState)(null),X=(0,s.useCallback)(async()=>{p(!0),j(null),q.debug("Fetching agents...");try{var e;let t=await l.in.agentList();q.info({count:null==(e=t.results)?void 0:e.length},"Agents fetched successfully"),u(t.results||[])}catch(t){q.error({err:t},"Error fetching agents");let e=t.message||"Failed to load agents. Please try again later.";if(t.response){let n=t.response.status,a="Could not read error body";try{a=await t.response.text()}catch(e){}q.error({status:n,responseBody:a},"API Error"),e=403===n?"Forbidden: Check your permissions.":401===n?"Unauthorized: Please log in again.":"API Error (".concat(n,"): ").concat(a||e)}j(e),u([])}finally{p(!1)}},[]);(0,s.useEffect)(()=>{(async()=>{if(!n&&t){O(!0),S(null);try{q.debug("Fetching user profile via /user/me...");let e=await l.userApi.userMeRetrieve();E(e),q.debug({org:e.organization},"User profile fetched")}catch(t){q.error({err:t},"Error fetching user profile");let e=t.message||"Failed to load user profile.";if(t.response){let n=t.response.status,a="Could not read error body";try{a=await t.response.text()}catch(e){}e="Profile API Error (".concat(n,"): ").concat(a||e)}S(e)}finally{O(!1)}}})()},[n,t]);let B=()=>L?void N({open:!0,title:"Please Wait",description:"User profile is still loading. Please wait a moment."}):!T&&(null==C?void 0:C.organization)?void(P(null),I(!0)):void N({open:!0,title:"Organization Error",description:"Cannot create agent: Organization ID not found. ".concat(T||"Organization ID missing from profile.")}),Z=e=>{if(!e.id)return void N({open:!0,title:"Invalid Agent",description:"Cannot edit agent: ID is missing."});P(e),I(!0)},Q=async()=>{let e=A.agent;if(!(null==e?void 0:e.id))return;let t=e.id;k({open:!1,agent:null}),b(t);try{await l.in.agentDestroy({id:t}),q.info({agentId:t},"Agent deleted successfully"),u(e=>e.filter(e=>e.id!==t))}catch(n){q.error({err:n},"Error deleting agent");let t=n.message||'Failed to delete agent "'.concat(e.name,'". Please try again.');if(n.response){let e=n.response.status,a="Could not read error body";try{a=await n.response.text()}catch(e){}q.error({status:e,responseBody:a},"Delete API Error"),t="Delete API Error (".concat(e,"): ").concat(a||t)}N({open:!0,title:"Error Deleting Agent",description:t})}finally{b(null)}};return((0,s.useEffect)(()=>{!n&&t?X():n||t||(p(!1),u([]),j(null),b(null))},[n,t,X]),n||h&&0===i.length&&!g||L)?(0,a.jsx)(o.M,{title:"Targets",description:"Connect models and AI agents to evaluate their security.",children:(0,a.jsx)("div",{className:"px-6 space-y-3",children:[void 0,void 0,void 0].map((e,t)=>(0,a.jsxs)("div",{className:"border rounded-lg p-4 flex items-start gap-4",children:[(0,a.jsx)(F.E,{className:"h-10 w-10 rounded-md flex-shrink-0"}),(0,a.jsxs)("div",{className:"flex-1 space-y-2",children:[(0,a.jsx)(F.E,{className:"h-4 w-1/4"}),(0,a.jsx)(F.E,{className:"h-3 w-1/2"})]}),(0,a.jsx)(F.E,{className:"h-6 w-20 rounded-full"}),(0,a.jsx)(F.E,{className:"h-8 w-8 rounded"}),(0,a.jsx)(F.E,{className:"h-8 w-8 rounded"})]},"skeleton-".concat(t)))})}):(0,a.jsxs)(o.M,{title:"Targets",description:"Connect models and AI agents to evaluate their security.",action:t&&(0,a.jsxs)(f.$,{onClick:B,children:[(0,a.jsx)(R.A,{className:"mr-2 h-4 w-4"})," Add target"]}),children:[(0,a.jsxs)("div",{className:"px-6 space-y-4",children:[!t&&!n&&(0,a.jsxs)($.Fc,{children:[(0,a.jsx)(H.A,{className:"h-4 w-4"}),(0,a.jsx)($.XL,{children:"Authentication Required"}),(0,a.jsx)($.TN,{children:"Please log in to manage targets."})]}),t&&g&&(0,a.jsxs)($.Fc,{variant:"destructive",children:[(0,a.jsx)(H.A,{className:"h-4 w-4"}),(0,a.jsx)($.XL,{children:"Error loading targets"}),(0,a.jsx)($.TN,{children:g})]}),t&&T&&(0,a.jsxs)($.Fc,{variant:"destructive",children:[(0,a.jsx)(H.A,{className:"h-4 w-4"}),(0,a.jsx)($.XL,{children:"Profile Error"}),(0,a.jsxs)($.TN,{children:[T," — Agent creation may not be available."]})]}),t&&!h&&0===i.length&&!g&&(0,a.jsx)(d.p,{icon:K.A,title:"No targets configured",description:"Connect your first model or AI agent to use it in a campaign.",action:(0,a.jsxs)(f.$,{onClick:B,children:[(0,a.jsx)(R.A,{className:"mr-2 h-4 w-4"})," Add target"]})}),t&&i.length>0&&(0,a.jsx)(G.Bc,{children:(0,a.jsx)("div",{className:"rounded-lg border overflow-hidden",children:(0,a.jsxs)(M.XI,{children:[(0,a.jsx)(M.A0,{children:(0,a.jsxs)(M.Hj,{className:"bg-muted/50 hover:bg-muted/50",children:[(0,a.jsx)(M.nd,{className:"w-[25%] pl-4",children:"Target"}),(0,a.jsx)(M.nd,{className:"w-[15%]",children:"Model"}),(0,a.jsx)(M.nd,{className:"w-[20%]",children:"Endpoint"}),(0,a.jsx)(M.nd,{className:"w-[15%]",children:"Type"}),(0,a.jsx)(M.nd,{className:"w-[12%]",children:"Created"}),(0,a.jsx)(M.nd,{className:"w-[13%] text-right pr-4",children:"Actions"})]})}),(0,a.jsx)(M.BF,{children:i.map(e=>{var t,n,s,r;return(0,a.jsxs)(M.Hj,{className:"group",children:[(0,a.jsx)(M.nA,{className:"pl-4",children:(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("div",{className:"mt-0.5 h-8 w-8 rounded-md bg-muted flex items-center justify-center flex-shrink-0",children:(0,a.jsx)(K.A,{className:"h-4 w-4 text-muted-foreground"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:"font-medium text-sm leading-tight",children:e.name}),e.description&&(0,a.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5 line-clamp-1",children:e.description}),(null==(t=e.organizationDetail)?void 0:t.name)&&(0,a.jsx)("p",{className:"text-xs text-muted-foreground/70 mt-0.5",children:e.organizationDetail.name})]})]})}),(0,a.jsx)(M.nA,{children:e.config?(0,a.jsx)("span",{className:"text-sm font-mono",children:function(e){let t=null==e?void 0:e.name;return"string"==typeof t&&t?t:"—"}(e.config)}):(0,a.jsx)("button",{type:"button",onClick:()=>Z(e),className:"text-xs font-medium text-amber-700 dark:text-amber-400 underline-offset-2 hover:underline",children:"Needs configuration"})}),(0,a.jsx)(M.nA,{children:(0,a.jsxs)(G.m_,{children:[(0,a.jsx)(G.k$,{asChild:!0,children:(0,a.jsx)("span",{className:"text-sm text-muted-foreground font-mono truncate block max-w-[200px] cursor-default",children:e.endpoint||"—"})}),(0,a.jsx)(G.ZI,{side:"bottom",className:"max-w-sm break-all",children:e.endpoint||"No endpoint"})]})}),(0,a.jsx)(M.nA,{children:e.agentType?(0,a.jsx)("span",{className:"inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ".concat(null!=(n=J[e.agentType])?n:J.UNKNOWN),children:null!=(r=w[s=e.agentType])?r:s}):(0,a.jsx)("span",{className:"text-xs text-muted-foreground/50",children:"—"})}),(0,a.jsx)(M.nA,{children:(0,a.jsx)("span",{className:"text-sm text-muted-foreground",children:e.createdAt?new Date(e.createdAt).toLocaleDateString():"—"})}),(0,a.jsx)(M.nA,{className:"text-right pr-4",children:(0,a.jsxs)("div",{className:"flex items-center justify-end gap-1",children:[(0,a.jsxs)(G.m_,{children:[(0,a.jsx)(G.k$,{asChild:!0,children:(0,a.jsx)(f.$,{variant:"ghost",size:"icon",onClick:()=>Z(e),disabled:!!v,className:"h-8 w-8 opacity-0 group-hover:opacity-100 transition-opacity",children:(0,a.jsx)(W.A,{className:"h-3.5 w-3.5"})})}),(0,a.jsx)(G.ZI,{children:"Edit target"})]}),(0,a.jsxs)(G.m_,{children:[(0,a.jsx)(G.k$,{asChild:!0,children:(0,a.jsx)(f.$,{variant:"ghost",size:"icon",onClick:()=>(e=>{if(!e.id)return void N({open:!0,title:"Invalid Agent",description:"Cannot delete agent: ID missing or invalid."});k({open:!0,agent:e})})(e),disabled:!!v,className:"h-8 w-8 opacity-0 group-hover:opacity-100 transition-opacity ".concat(v===e.id?"text-destructive opacity-100":"hover:text-destructive"),children:v===e.id?(0,a.jsx)(x.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,a.jsx)(m.A,{className:"h-3.5 w-3.5"})})}),(0,a.jsx)(G.ZI,{children:"Delete target"})]})]})})]},e.id)})})]})})})]}),(0,a.jsx)(z,{open:_,onOpenChange:I,agent:D,onSaved:()=>{I(!1),P(null),X()}}),(0,a.jsx)(U.Lt,{open:y.open,onOpenChange:e=>N(t=>({...t,open:e})),children:(0,a.jsxs)(U.EO,{children:[(0,a.jsxs)(U.wd,{children:[(0,a.jsx)(U.r7,{children:y.title}),(0,a.jsx)(U.$v,{children:y.description})]}),(0,a.jsx)(U.ck,{children:(0,a.jsx)(U.Rx,{onClick:()=>N(e=>({...e,open:!1})),children:"OK"})})]})}),(0,a.jsx)(c.T,{open:A.open,onOpenChange:e=>k(t=>({...t,open:e})),title:"Delete target",description:'Are you sure you want to delete "'.concat(null==(e=A.agent)?void 0:e.name,'"? This action cannot be undone.'),onConfirm:Q,confirmText:"Delete",variant:"destructive"})]})}},46767:(e,t,n)=>{"use strict";n.d(t,{Bc:()=>l,ZI:()=>d,k$:()=>o,m_:()=>i});var a=n(95155);n(12115);var s=n(53583),r=n(64269);function l(e){let{delayDuration:t=0,...n}=e;return(0,a.jsx)(s.Kq,{"data-slot":"tooltip-provider",delayDuration:t,...n})}function i(e){let{...t}=e;return(0,a.jsx)(l,{children:(0,a.jsx)(s.bL,{"data-slot":"tooltip",...t})})}function o(e){let{...t}=e;return(0,a.jsx)(s.l9,{"data-slot":"tooltip-trigger",...t})}function d(e){let{className:t,sideOffset:n=0,children:l,...i}=e;return(0,a.jsx)(s.ZL,{children:(0,a.jsxs)(s.UC,{"data-slot":"tooltip-content",sideOffset:n,className:(0,r.cn)("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",t),...i,children:[l,(0,a.jsx)(s.i3,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}},50952:(e,t,n)=>{Promise.resolve().then(n.bind(n,46056))},80230:(e,t,n)=>{"use strict";n.d(t,{h:()=>l});var a=n(12115),s=n(34105);let r=async()=>"";function l(){let e=(0,a.useContext)(s.c);return e||{provider:"disabled",user:void 0,isAuthenticated:!1,isLoading:!0,login:void 0,logout:void 0,getAccessTokenSilently:r}}},87270:(e,t,n)=>{"use strict";n.d(t,{A0:()=>l,BF:()=>i,Hj:()=>o,XI:()=>r,nA:()=>c,nd:()=>d});var a=n(95155);n(12115);var s=n(64269);function r(e){let{className:t,...n}=e;return(0,a.jsx)("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:(0,a.jsx)("table",{"data-slot":"table",className:(0,s.cn)("w-full caption-bottom text-sm",t),...n})})}function l(e){let{className:t,...n}=e;return(0,a.jsx)("thead",{"data-slot":"table-header",className:(0,s.cn)("[&_tr]:border-b",t),...n})}function i(e){let{className:t,...n}=e;return(0,a.jsx)("tbody",{"data-slot":"table-body",className:(0,s.cn)("[&_tr:last-child]:border-0",t),...n})}function o(e){let{className:t,...n}=e;return(0,a.jsx)("tr",{"data-slot":"table-row",className:(0,s.cn)("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",t),...n})}function d(e){let{className:t,...n}=e;return(0,a.jsx)("th",{"data-slot":"table-head",className:(0,s.cn)("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...n})}function c(e){let{className:t,...n}=e;return(0,a.jsx)("td",{"data-slot":"table-cell",className:(0,s.cn)("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...n})}}},e=>{e.O(0,[187,272,870,583,8,924,97,441,493,358],()=>e(e.s=50952)),_N_E=e.O()}]);