@vostride/agent-qa-dashboard-ui 0.1.12 → 0.1.13
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.
- package/dist/assets/{arrow-up-down-CN-uHgX9.js → arrow-up-down-DD6yziGv.js} +1 -1
- package/dist/assets/{badge-DrW2vGVJ.js → badge-CC1v3nk4.js} +1 -1
- package/dist/assets/{batch-action-bar-uEhHVDds.js → batch-action-bar-D1IfTx55.js} +1 -1
- package/dist/assets/{circle-alert-BKX0IIz1.js → circle-alert-CULfrrqE.js} +1 -1
- package/dist/assets/{circle-x-yPIxYoz1.js → circle-x-B7AOkLOS.js} +1 -1
- package/dist/assets/{config-TRu3J-E7.js → config-a9DxCBoP.js} +1 -1
- package/dist/assets/{copy-Clw3wvSn.js → copy-CEZJVgtu.js} +1 -1
- package/dist/assets/{display-step-NqsJgW_B.js → display-step-CO4k5dQA.js} +1 -1
- package/dist/assets/{dist-BPJgj1d0.js → dist-BJdB11cl.js} +1 -1
- package/dist/assets/{dist-BPheZrD6.js → dist-DzF0KPMF.js} +1 -1
- package/dist/assets/{dist-m_OM4Je_.js → dist-wK15YRiu.js} +1 -1
- package/dist/assets/{empty-state-BTvOA5lp.js → empty-state-BfgY0UGA.js} +1 -1
- package/dist/assets/{external-link-C_uggQOc.js → external-link-DC-KkLmq.js} +1 -1
- package/dist/assets/{eye-CZrufbYE.js → eye-YQHiLgt4.js} +1 -1
- package/dist/assets/{file-code-B3iDpJRP.js → file-code-BpwHxsqo.js} +1 -1
- package/dist/assets/{file-search-DHHwYVza.js → file-search-LR6NeRNh.js} +1 -1
- package/dist/assets/{filename-validation-4sTTEagx.js → filename-validation-S8QXnNdt.js} +1 -1
- package/dist/assets/{grip-vertical-A-AANrBM.js → grip-vertical-KfzS75WH.js} +1 -1
- package/dist/assets/{hook-editor-yhQoi-Ky.js → hook-editor-tcKRn_gP.js} +1 -1
- package/dist/assets/{hook-runtime-JF-0oZpz.js → hook-runtime-CTRviwQE.js} +1 -1
- package/dist/assets/{hook-viewer-DIkxp9uJ.js → hook-viewer-eGadGjA0.js} +1 -1
- package/dist/assets/{hooks-CDRbjPKv.js → hooks-BM--ZgFe.js} +1 -1
- package/dist/assets/{id-badge-NwZYoNfB.js → id-badge-BmmZdbHv.js} +1 -1
- package/dist/assets/{index-Bvtm2F6f.js → index-B4FdO6Vk.js} +2 -2
- package/dist/assets/index-DzWZqTlZ.css +2 -0
- package/dist/assets/{insights-DuYBsUzB.js → insights-C_tn8W_Q.js} +1 -1
- package/dist/assets/{insights-line-grid-BKOqA-1W.js → insights-line-grid-DKZyKGcI.js} +1 -1
- package/dist/assets/{lib-58FyJI_k.js → lib-B9z0w3j9.js} +1 -1
- package/dist/assets/{live-run-ucgeJa3o.js → live-run-EmcKA5cK.js} +1 -1
- package/dist/assets/{memory-B7nfWNTH.js → memory-CdMqWelO.js} +1 -1
- package/dist/assets/{memory-product-D1u5V75o.js → memory-product-f5AfXXJn.js} +1 -1
- package/dist/assets/{monaco-editor-DNT0Mzki.js → monaco-editor-DF4W-NC-.js} +2 -2
- package/dist/assets/{monaco-editor-inner-DuCqlGei.js → monaco-editor-inner-I81tD0qz.js} +1 -1
- package/dist/assets/{monaco.contribution-LYJB_lCm.js → monaco.contribution-CEeipeu9.js} +2 -2
- package/dist/assets/{observation-block-4AqYhL1h.js → observation-block-DC5e2IE9.js} +1 -1
- package/dist/assets/{observation-markdown-Dx_5-T0t.js → observation-markdown-DyWjt-yP.js} +1 -1
- package/dist/assets/{pencil-DdRoBrsh.js → pencil-CZF_NGi6.js} +1 -1
- package/dist/assets/plus-Qf7V331e.js +1 -0
- package/dist/assets/{popover-DGZi688D.js → popover-DwYq4QYF.js} +1 -1
- package/dist/assets/{refresh-cw-C_0AkMuu.js → refresh-cw-RAow1kax.js} +1 -1
- package/dist/assets/{resizable-BGEcNRZO.js → resizable-B2X6KlcC.js} +1 -1
- package/dist/assets/run-detail-DZ-1orHT.js +1 -0
- package/dist/assets/{runs-CywxkFZ6.js → runs-CTOIdEAQ.js} +1 -1
- package/dist/assets/{scroll-area-CnATfQoe.js → scroll-area-BmkJ1y7Q.js} +1 -1
- package/dist/assets/{select-CeVjgiKI.js → select-D5oFJNaq.js} +1 -1
- package/dist/assets/{shortcut-hints-Bs5o743i.js → shortcut-hints-CtwepXR1.js} +1 -1
- package/dist/assets/{split-button-DcY8ames.js → split-button-wGcE-JDx.js} +1 -1
- package/dist/assets/square-CgFZz_zK.js +1 -0
- package/dist/assets/{step-name-pills-Dta5ZGMZ.js → step-name-pills-VuIw2nNC.js} +1 -1
- package/dist/assets/{suite-editor-Bnf6KMna.js → suite-editor-DLu7OCZy.js} +1 -1
- package/dist/assets/{suite-navbar-PStktQ6j.js → suite-navbar-B8gZoPMT.js} +1 -1
- package/dist/assets/{suite-viewer-BD74MY_X.js → suite-viewer-CPBPmJdG.js} +1 -1
- package/dist/assets/{suites-BvfwzFEd.js → suites-wRKqOnN6.js} +1 -1
- package/dist/assets/{switch-ByV5GV5L.js → switch-CPd0R3ri.js} +1 -1
- package/dist/assets/{tab-console-BQFkZJG_.js → tab-console-BORDNFzI.js} +1 -1
- package/dist/assets/{table-D08QBBt4.js → table-QG2rKYu8.js} +1 -1
- package/dist/assets/{tabs-DrB_Acb3.js → tabs-DzjvuMEX.js} +1 -1
- package/dist/assets/{test-editor-w7ZQPYgH.js → test-editor-BoaHOuai.js} +1 -1
- package/dist/assets/{test-navbar-DoHKAy1p.js → test-navbar-C6-h4kbc.js} +1 -1
- package/dist/assets/{test-viewer-BwUQNVa4.js → test-viewer-0SziRmsW.js} +1 -1
- package/dist/assets/{tests-B5ELKDH2.js → tests-OLyMTO9C.js} +1 -1
- package/dist/assets/{tests-suites-table-widths-DNWnkAjA.js → tests-suites-table-widths-D49Zcf1r.js} +1 -1
- package/dist/assets/{textarea-DChEVvwQ.js → textarea-CVB6Do1_.js} +1 -1
- package/dist/assets/{trash-2-7P1Dp87k.js → trash-2-BhJSaMLG.js} +1 -1
- package/dist/assets/{tsMode-DEhRZlmT.js → tsMode-TiV3uQ0t.js} +1 -1
- package/dist/assets/{use-hook-run-session-x-d_iodT.js → use-hook-run-session-DH_86Jtn.js} +1 -1
- package/dist/assets/{use-keyboard-shortcuts-EAppuiKO.js → use-keyboard-shortcuts-Bal_Cx9w.js} +1 -1
- package/dist/assets/{use-page-title-B1t9-5_U.js → use-page-title-B4YPyIzc.js} +1 -1
- package/dist/assets/{use-run-status-favicon-D69P46yH.js → use-run-status-favicon-Rjqwuxhd.js} +1 -1
- package/dist/assets/{use-selection-queue-BboTDies.js → use-selection-queue-O7K3NZNK.js} +1 -1
- package/dist/assets/{viewer-url-state-6mOK5_sY.js → viewer-url-state-ClEUZJMl.js} +1 -1
- package/dist/assets/{zap-KFJmkY3Y.js → zap-BYpQfhU4.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +2 -2
- package/dist/assets/index-CW7tbJhs.css +0 -2
- package/dist/assets/plus-pXO98OAE.js +0 -1
- package/dist/assets/run-detail-3tlB8sew.js +0 -1
- package/dist/assets/square-D71GHEET.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Jn as e}from"./index-
|
|
1
|
+
import{Jn as e}from"./index-B4FdO6Vk.js";var t=e(`arrow-up-down`,[[`path`,{d:`m21 16-4 4-4-4`,key:`f6ql7i`}],[`path`,{d:`M17 20V4`,key:`1ejh1v`}],[`path`,{d:`m3 8 4-4 4 4`,key:`11wl7u`}],[`path`,{d:`M7 4v16`,key:`1glfcx`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk-CilyBKbf.js";import{On as e,Qn as t,Wt as n,Yn as r,pr as i}from"./index-
|
|
1
|
+
import"./chunk-CilyBKbf.js";import{On as e,Qn as t,Wt as n,Yn as r,pr as i}from"./index-B4FdO6Vk.js";i();var a=t(),o=r(`inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-sm border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3`,{variants:{variant:{default:`bg-primary text-primary-foreground [a&]:hover:bg-primary/90`,secondary:`bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90`,destructive:`bg-destructive text-white focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90`,outline:`border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground`,ghost:`[a&]:hover:bg-accent [a&]:hover:text-accent-foreground`,link:`text-primary underline-offset-4 [a&]:hover:underline`}},defaultVariants:{variant:`default`}});function s({className:t,variant:r=`default`,asChild:i=!1,...s}){return(0,a.jsx)(i?e:`span`,{"data-slot":`badge`,"data-variant":r,className:n(o({variant:r}),t),...s})}export{s as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./chunk-CilyBKbf.js";import{c as t,u as n}from"./select-
|
|
1
|
+
import{r as e}from"./chunk-CilyBKbf.js";import{c as t,u as n}from"./select-D5oFJNaq.js";import{t as r}from"./split-button-wGcE-JDx.js";import{t as i}from"./trash-2-BhJSaMLG.js";import{Cn as a,En as o,Mn as s,Qn as c,Ut as l,Wt as u,bn as d,fr as f,pr as p,tn as m,wn as h,xn as g}from"./index-B4FdO6Vk.js";var _=e(p(),1),v=c(),y=`Checkbox`,[b,x]=h(y),[S,C]=b(y);function w(e){let{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:d}=e,[f,p]=g({prop:n,defaultProp:i??!1,onChange:c,caller:y}),[m,h]=_.useState(null),[b,x]=_.useState(null),C=_.useRef(!1),w=m?!!o||!!m.closest(`form`):!0,T={checked:f,disabled:a,setChecked:p,control:m,setControl:h,name:s,form:o,value:u,hasConsumerStoppedPropagationRef:C,required:l,defaultChecked:N(i)?!1:i,isFormControl:w,bubbleInput:b,setBubbleInput:x};return(0,v.jsx)(S,{scope:t,...T,children:M(d)?d(T):r})}var T=`CheckboxTrigger`,E=_.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},i)=>{let{control:c,value:l,disabled:u,checked:d,required:f,setControl:p,setChecked:m,hasConsumerStoppedPropagationRef:h,isFormControl:g,bubbleInput:y}=C(T,e),b=s(i,p),x=_.useRef(d);return _.useEffect(()=>{let e=c?.form;if(e){let t=()=>m(x.current);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[c,m]),(0,v.jsx)(o.button,{type:`button`,role:`checkbox`,"aria-checked":N(d)?`mixed`:d,"aria-required":f,"data-state":P(d),"data-disabled":u?``:void 0,disabled:u,value:l,...r,ref:b,onKeyDown:a(t,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:a(n,e=>{m(e=>N(e)?!0:!e),y&&g&&(h.current=e.isPropagationStopped(),h.current||e.stopPropagation())})})});E.displayName=T;var D=_.forwardRef((e,t)=>{let{__scopeCheckbox:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,v.jsx)(w,{__scopeCheckbox:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(E,{...d,ref:t,__scopeCheckbox:n}),e&&(0,v.jsx)(j,{__scopeCheckbox:n})]})})});D.displayName=y;var O=`CheckboxIndicator`,k=_.forwardRef((e,t)=>{let{__scopeCheckbox:n,forceMount:r,...i}=e,a=C(O,n);return(0,v.jsx)(d,{present:r||N(a.checked)||a.checked===!0,children:(0,v.jsx)(o.span,{"data-state":P(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t,style:{pointerEvents:`none`,...e.style}})})});k.displayName=O;var A=`CheckboxBubbleInput`,j=_.forwardRef(({__scopeCheckbox:e,...n},r)=>{let{control:i,hasConsumerStoppedPropagationRef:a,checked:c,defaultChecked:l,required:u,disabled:d,name:f,value:p,form:h,bubbleInput:g,setBubbleInput:y}=C(A,e),b=s(r,y),x=t(c),S=m(i);_.useEffect(()=>{let e=g;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=!a.current;if(x!==c&&n){let t=new Event(`click`,{bubbles:r});e.indeterminate=N(c),n.call(e,N(c)?!1:c),e.dispatchEvent(t)}},[g,x,c,a]);let w=_.useRef(N(c)?!1:c);return(0,v.jsx)(o.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:l??w.current,required:u,disabled:d,name:f,value:p,form:h,...n,tabIndex:-1,ref:b,style:{...n.style,...S,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})});j.displayName=A;function M(e){return typeof e==`function`}function N(e){return e===`indeterminate`}function P(e){return N(e)?`indeterminate`:e?`checked`:`unchecked`}function F({className:e,...t}){return(0,v.jsx)(D,{"data-slot":`checkbox`,className:u(`peer size-4 shrink-0 rounded-[4px] border border-input shadow-xs`,`data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=checked]:border-primary`,`focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:border-ring`,`disabled:cursor-not-allowed disabled:opacity-50`,e),...t,children:(0,v.jsx)(k,{className:`flex items-center justify-center text-current`,children:(0,v.jsx)(n,{className:`size-3.5`})})})}var I=e(f(),1);function L({selectedCount:e,onRun:t,onRunNoCache:n,onPurgeCache:a,onCancel:o,isRunning:s=!1,summaryMeta:c,secondaryLabel:u,secondaryIcon:d,secondaryAriaLabel:f,actionSlot:p,onDelete:m}){if(e===0)return null;let h=!u&&!!d;return(0,I.createPortal)((0,v.jsxs)(`div`,{className:`fixed bottom-6 left-1/2 z-50 flex w-max max-w-[calc(100vw-1rem)] -translate-x-1/2 flex-wrap items-center gap-3 rounded-md border bg-background px-4 py-3 shadow-lg sm:flex-nowrap`,children:[(0,v.jsxs)(`div`,{className:`min-w-[6.5rem] shrink-0`,children:[(0,v.jsxs)(`span`,{className:`text-sm font-medium`,children:[e,` selected`]}),c?(0,v.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:c}):null]}),p??(t&&n?(0,v.jsx)(r,{onRun:t,onRunNoCache:n,onPurgeCache:a,disabled:s,size:`sm`}):null),m?(0,v.jsxs)(l,{variant:`destructive`,size:`sm`,onClick:m,disabled:s,children:[(0,v.jsx)(i,{className:`size-4`}),`Delete`]}):null,(0,v.jsx)(l,{variant:h?`ghost`:`outline`,size:h?`icon-sm`:`sm`,"aria-label":f,title:f,onClick:o,disabled:s,children:d??u??`Cancel`})]}),document.body)}export{F as n,L as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Jn as e}from"./index-
|
|
1
|
+
import{Jn as e}from"./index-B4FdO6Vk.js";var t=e(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Jn as e}from"./index-
|
|
1
|
+
import{Jn as e}from"./index-B4FdO6Vk.js";var t=e(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]);export{t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as e}from"./chunk-CilyBKbf.js";import{a as t,i as n,n as r,o as i,r as a,s as o,t as s}from"./select-CeVjgiKI.js";import{t as c}from"./circle-x-yPIxYoz1.js";import{t as l}from"./external-link-C_uggQOc.js";import{t as u}from"./eye-CZrufbYE.js";import{t as d}from"./pencil-DdRoBrsh.js";import{t as f}from"./plus-pXO98OAE.js";import{n as p,t as m}from"./textarea-DChEVvwQ.js";import{t as h}from"./trash-2-7P1Dp87k.js";import{t as g}from"./use-page-title-B1t9-5_U.js";import{a as _,i as v}from"./dist-m_OM4Je_.js";import{t as y}from"./switch-ByV5GV5L.js";import{i as b,n as x,r as S,t as C}from"./tabs-DrB_Acb3.js";import{$n as w,At as T,Bn as E,Ct as D,F as ee,Ft as O,Ht as k,Jn as te,Mt as ne,Nt as re,Pt as ie,Qn as ae,R as oe,Tt as A,Un as se,Ut as j,V as ce,Vn as M,Vt as le,Wt as ue,_ as N,b as de,cr as fe,f as pe,g as me,h as P,ht as he,i as ge,jt as _e,k as ve,m as ye,p as be,pr as xe,q as Se,ur as Ce,v as we,vt as Te,w as Ee,x as F,xt as De,y as Oe,yt as ke,z as Ae,zn as I}from"./index-Bvtm2F6f.js";import{t as L}from"./badge-DrW2vGVJ.js";import{n as je,r as Me,t as R}from"./lib-58FyJI_k.js";import{a as Ne,i as z,n as Pe,o as Fe,r as Ie,t as Le}from"./table-D08QBBt4.js";import{t as Re}from"./marked.esm-Ba5AUJng.js";var ze=te(`book-open-text`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M16 12h2`,key:`7q9ll5`}],[`path`,{d:`M16 8h2`,key:`msurwy`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}],[`path`,{d:`M6 12h2`,key:`32wvfc`}],[`path`,{d:`M6 8h2`,key:`30oboj`}]]),Be=te(`file-plus`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M9 15h6`,key:`cctwl0`}],[`path`,{d:`M12 18v-6`,key:`17g6i2`}]]),B=e(xe(),1),V=ae();function H({className:e,...t}){return(0,V.jsx)(`section`,{"data-config-section-shell":!0,className:ue(`border border-border bg-transparent rounded-none shadow-none`,e),...t})}function U({className:e,...t}){return(0,V.jsx)(`header`,{className:ue(`border-b border-border px-5 py-4`,e),...t})}function W({className:e,...t}){return(0,V.jsx)(`div`,{"data-config-section-body":!0,className:ue(`space-y-6 px-5 py-5`,e),...t})}function Ve({className:e,...t}){return(0,V.jsx)(`div`,{"data-config-line-notice":!0,className:ue(`border border-border bg-transparent rounded-none px-4 py-3 text-sm text-muted-foreground`,e),...t})}function G(e,t){let n=e.trim(),r=t.errorMessage??He(t);if(n===``)return t.allowEmpty?{value:void 0,error:null}:{value:void 0,error:r};if(!(t.integer?/^-?\d+$/:/^-?(?:\d+|\d*\.\d+)$/).test(n))return{value:void 0,error:r};let i=Number(n);return!Number.isFinite(i)||t.integer&&!Number.isSafeInteger(i)||t.min!==void 0&&i<t.min||t.max!==void 0&&i>t.max?{value:void 0,error:r}:{value:i,error:null}}function He(e){let t=e.integer?`an integer`:`a number`;return e.min!==void 0&&e.max!==void 0?`${e.label} must be ${t} between ${e.min} and ${e.max}`:e.min===void 0?e.max===void 0?`${e.label} must be ${t}`:`${e.label} must be ${t} less than or equal to ${e.max}`:`${e.label} must be ${t} greater than or equal to ${e.min}`}var Ue=Object.fromEntries([{value:`openai-compatible`,label:`OpenAI-compatible`},{value:`anthropic-compatible`,label:`Anthropic-compatible`},{value:`gemini`,label:`Gemini`}].map(e=>[e.value,e.label])),We=new Set([`openai-compatible`,`anthropic-compatible`]),Ge=`Enter the exact endpoint base URL. agent-qa will not append paths.`,Ke=`Testing without a saved credential.`,qe=`Save a Gemini API key for this config before testing.`;function Je(){return[{id:`openai-compatible`,label:`OpenAI-compatible`,auth:{kind:`api-key`,credentialTypes:[`api-key`],optional:!0},modelAdapter:`openai-responses`},{id:`anthropic-compatible`,label:`Anthropic-compatible`,auth:{kind:`api-key`,credentialTypes:[`api-key`,`bearer-token`],optional:!0},modelAdapter:`anthropic-messages`},{id:`gemini`,label:`Gemini`,auth:{kind:`api-key`,credentialTypes:[`api-key`]}}]}function K(e=``,t=``){return{id:crypto.randomUUID(),key:e,value:t}}function Ye(e,t=[]){return t.find(t=>t.id===e)?.label??Ue[e]??e}function Xe(e){if(e===null)return null;let t=Date.now();if(e<t)return`Expired`;let n=e-t,r=Math.floor(n/(1e3*60*60)),i=Math.floor(n%(1e3*60*60)/(1e3*60));return r>24?`Expires in ${Math.floor(r/24)}d`:r>0?`Expires in ${r}h ${i}m`:`Expires in ${i}m`}function Ze(e){return e.type===`oauth`?`OAuth connected`:e.type===`bearer`||e.type===`bearer-token`?`Saved bearer token`:`Saved API key`}function Qe(e,t,n){return e.configName===t?e.type===`oauth`?e.provider===n:e.type===`bearer`||e.type===`bearer-token`?n===`anthropic-compatible`&&e.provider===`anthropic-compatible`:e.provider===n:!1}function $e(e,t){return e.find(e=>Qe(e,t.name,t.provider))}function et(e){return We.has(e.provider)?`No credential`:`Missing credential`}function tt(e){let t={};for(let n of e){let e=n.key.trim(),r=n.value.trim();!e&&!r||e&&(t[e]=r)}return Object.keys(t).length>0?t:void 0}function nt(e){let t=new Map;for(let n of e){let e=n.key.trim().toLowerCase();e&&t.set(e,(t.get(e)??0)+1)}return new Set([...t.entries()].filter(([,e])=>e>1).map(([e])=>e))}function rt(e){return e.error===`missing_credential`&&e.message?e.message:e.error===`auth_error`?`Authentication failed. Check the saved credential for this config.`:e.error===`model_not_found`?`Model not found. Check the model name.`:e.error===`network_error`?`Network error. Check the exact base URL and try again.`:e.error===`invalid_request`&&e.message?`Connection failed. ${e.message}`:e.message?e.message.startsWith(`Connection failed.`)?e.message:`Connection failed. ${e.message}`:`Connection failed. Provider returned an error.`}function it({config:e,onConfigChange:t}){let n=e.use?.llm??null,[r,i]=(0,B.useState)([]),[a,o]=(0,B.useState)([]),[s,c]=(0,B.useState)(Je()),[l,u]=(0,B.useState)(!0),[m,g]=(0,B.useState)(!1),[_,v]=(0,B.useState)(null),[y,b]=(0,B.useState)(null);(0,B.useEffect)(()=>{async function t(){try{u(!0),i((e?.registry??{}).llms??[]);let[t,n]=await Promise.all([Ae(),Se().catch(()=>({providers:Je()}))]);o(t.credentials??[]),c(n.providers.length?n.providers:Je())}catch{T.error(`Failed to load LLM configuration. Refresh and try again.`)}finally{u(!1)}}t()},[e]);async function x(){o((await Ae()).credentials??[])}async function S(e){if(e===n){T.error(`Cannot delete the active default configuration. Switch the default in Execution Defaults first.`);return}let a=r.filter(t=>t.name!==e),o=r;i(a);try{await A({"registry.llms":a}),T.success(`Configuration ${e} deleted`),t()}catch{i(o),T.error(`Failed to delete configuration`)}}async function C(e){let n=_===null?[...r,e]:r.map(t=>t.name===e.name?e:t);try{await A({"registry.llms":n}),i(n),T.success(`Changes saved`),g(!1),v(null),t(),await x()}catch{T.error(`Failed to save configuration. Check the fields and try again.`)}}function w(e){let t=$e(a,e);if(!t)return(0,V.jsx)(L,{variant:`secondary`,children:et(e)});let n=Xe(t.expires),r=t.expires!==null&&t.expires<Date.now();return(0,V.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-1.5`,children:[(0,V.jsx)(L,{variant:`secondary`,children:Ze(t)}),n&&(0,V.jsx)(L,{variant:r?`destructive`:`outline`,className:`text-xs`,children:n})]})}let E=je({data:r,columns:(0,B.useMemo)(()=>[{accessorKey:`name`,header:`Name`,size:140,cell:({row:e})=>(0,V.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`max-w-[220px] truncate font-mono`,children:e.original.name}),e.original.name===n?(0,V.jsx)(L,{variant:`outline`,className:`text-[11px]`,children:`Default`}):null]})},{accessorKey:`provider`,header:`Provider`,size:160,cell:({row:e})=>(0,V.jsx)(`span`,{className:`block min-w-0 max-w-[220px] truncate`,children:Ye(e.original.provider,s)})},{accessorKey:`model`,header:`Model`,cell:({row:e})=>(0,V.jsx)(`span`,{className:`block min-w-0 max-w-[280px] truncate`,children:e.original.model})},{id:`credential`,header:`Credential`,cell:({row:e})=>w(e.original)},{id:`actions`,header:``,size:80,cell:({row:e})=>(0,V.jsxs)(`div`,{className:`flex items-center justify-end gap-1`,children:[(0,V.jsx)(j,{variant:`ghost`,size:`sm`,className:`h-8 w-8 p-0 text-muted-foreground hover:text-foreground`,onClick:t=>{t.stopPropagation(),v(e.original),g(!0)},title:`Edit configuration`,"aria-label":`Edit configuration`,children:(0,V.jsx)(d,{className:`size-4`})}),(0,V.jsx)(j,{variant:`ghost`,size:`sm`,className:`h-8 w-8 p-0 text-muted-foreground hover:text-destructive`,onClick:t=>{t.stopPropagation(),e.original.name!==n&&b(e.original.name)},title:e.original.name===n?`Switch the default in Execution Defaults before deleting`:`Delete configuration`,"aria-label":`Delete configuration`,disabled:e.original.name===n,children:(0,V.jsx)(h,{className:`size-4`})})]})}],[n,a,s]),getCoreRowModel:Me()});return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(H,{children:[(0,V.jsxs)(U,{children:[(0,V.jsx)(`h2`,{className:`text-base font-semibold`,children:`LLM Configurations`}),(0,V.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Named model configurations for test runs. Choose the active default in Use / Execution Defaults.`})]}),(0,V.jsx)(W,{children:l?(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsx)(O,{className:`h-10 w-full rounded-none bg-muted`}),(0,V.jsx)(O,{className:`h-10 w-full rounded-none bg-muted`}),(0,V.jsx)(O,{className:`h-10 w-full rounded-none bg-muted`})]}):r.length===0?(0,V.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-12 text-center`,children:[(0,V.jsx)(p,{className:`size-10 text-muted-foreground`}),(0,V.jsx)(`h3`,{className:`mt-4 text-lg font-semibold`,children:`No LLM configurations`}),(0,V.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:`Add an LLM configuration to start running tests.`}),(0,V.jsxs)(j,{className:`mt-4`,onClick:()=>{v(null),g(!0)},children:[(0,V.jsx)(f,{className:`size-4`}),`Add Configuration`]})]}):(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsx)(`div`,{className:`flex justify-end`,children:(0,V.jsxs)(j,{size:`sm`,onClick:()=>{v(null),g(!0)},children:[(0,V.jsx)(f,{className:`size-4`}),`Add Configuration`]})}),(0,V.jsxs)(Le,{children:[(0,V.jsx)(Ne,{children:E.getHeaderGroups().map(e=>(0,V.jsx)(Fe,{children:e.headers.map(e=>(0,V.jsx)(z,{style:e.column.getSize()===150?void 0:{width:e.column.getSize()},className:`min-w-0`,children:e.isPlaceholder?null:R(e.column.columnDef.header,e.getContext())},e.id))},e.id))}),(0,V.jsx)(Pe,{children:E.getRowModel().rows.map(e=>(0,V.jsx)(Fe,{children:e.getVisibleCells().map(e=>(0,V.jsx)(Ie,{className:`min-w-0`,children:R(e.column.columnDef.cell,e.getContext())},e.id))},e.id))})]})]})})]}),(0,V.jsx)(at,{open:m,onOpenChange:e=>{g(e),e||v(null)},config:_,existingNames:r.map(e=>e.name),onSave:C,onAuthChange:x,authCredentials:a,providerMetadata:s}),(0,V.jsx)(pe,{open:y!==null,onOpenChange:e=>{e||b(null)},children:(0,V.jsxs)(be,{children:[(0,V.jsxs)(me,{children:[(0,V.jsx)(N,{children:`Delete Configuration`}),(0,V.jsxs)(ye,{children:[`Delete `,(0,V.jsx)(`span`,{className:`font-mono font-semibold`,children:y}),`? This action cannot be undone.`]})]}),(0,V.jsxs)(P,{children:[(0,V.jsx)(j,{variant:`outline`,onClick:()=>b(null),children:`Keep Configuration`}),(0,V.jsx)(j,{variant:`destructive`,onClick:()=>{y&&(S(y),b(null))},children:`Delete Configuration`})]})]})})]})}function at({open:e,onOpenChange:t,config:a,existingNames:u,onSave:d,onAuthChange:p,authCredentials:m,providerMetadata:g}){let v=a!==null,[y,b]=(0,B.useState)(``),[x,S]=(0,B.useState)(`openai-compatible`),[C,w]=(0,B.useState)(``),[D,O]=(0,B.useState)(``),[te,ae]=(0,B.useState)([]),[oe,A]=(0,B.useState)(`api-key`),[ce,M]=(0,B.useState)(``),[ue,de]=(0,B.useState)(``),[fe,ge]=(0,B.useState)(``),[xe,Se]=(0,B.useState)(``),[Ce,we]=(0,B.useState)(!1),[Ee,F]=(0,B.useState)(!1),[Oe,Ae]=(0,B.useState)(null),[je,Me]=(0,B.useState)(!1),[R,Ne]=(0,B.useState)(!1),[z,Pe]=(0,B.useState)(null),[Fe,Ie]=(0,B.useState)(``),[Le,Re]=(0,B.useState)(``),[ze,Be]=(0,B.useState)(!1),[H,U]=(0,B.useState)(null),W=g.length?g:Je(),Ve=(0,B.useMemo)(()=>{let e=W.map(e=>({value:e.id,label:e.label}));return x&&!e.some(e=>e.value===x)&&e.push({value:x,label:Ye(x,W)}),e},[W,x]),He=W.find(e=>e.id===x),Ue=m.some(e=>Qe(e,y,x)),$e=We.has(x),et=x===`anthropic-compatible`,it=$e,at=He?.auth.kind===`api-key`,ot=nt(te),st=ot.size>0;(0,B.useEffect)(()=>{if(e)if(Pe(null),Ie(``),Re(``),M(``),Se(``),Ae(null),U(null),a){let e=a.provider||`openai-compatible`;b(a.name),S(e),w(a.model),O(a.baseURL??``),ae(e===`anthropic-compatible`?Object.entries(a.providerHeaders??{}).map(([e,t])=>K(e,t)).concat(Object.keys(a.providerHeaders??{}).length===0?[K()]:[]):[]),A(e===`anthropic-compatible`?`bearer-token`:`api-key`),de(a.screenshotSize??``),ge(a.effectiveResolution==null?``:String(a.effectiveResolution))}else{let e=g.find(e=>e.id===`openai-compatible`)?.id??g[0]?.id??`openai-compatible`;b(``),S(e),w(``),O(``),ae([]),A(`api-key`),de(``),ge(``)}},[e,a,g]);function ct(e){return e?/^[a-z0-9][a-z0-9-]*$/.test(e)?u.filter(e=>e!==a?.name).includes(e)?`A configuration with this name already exists`:``:`Name must be lowercase letters, numbers, and hyphens, starting with a letter or number`:``}function lt(e){S(e),Pe(null),Re(``),Ae(null),M(``),Se(``),A(e===`anthropic-compatible`?`bearer-token`:`api-key`),O(``),ae(e===`anthropic-compatible`?[K()]:[])}function ut(e,t,n){ae(r=>r.map(r=>r.id===e?{...r,[t]:n}:r))}async function dt(){if(st){T.error(`Duplicate provider header names are not allowed`);return}Ne(!0),Pe(null);try{let e=et?tt(te):void 0;Pe(await De({provider:x,model:C,...D.trim()?{baseURL:D.trim()}:{},...e?{providerHeaders:e}:{},configName:y||void 0}))}catch{Pe({success:!1,error:`network_error`,message:`Network error. Check the exact base URL and try again.`})}finally{Ne(!1)}}async function ft(){let e=ct(y);if(e){Ie(e);return}if(!y||!x||!C)return;if(it&&D.trim()===``){Re(`Base URL is required for compatible providers.`);return}if(st){T.error(`Duplicate provider header names are not allowed`);return}let t=G(fe,{label:`Effective resolution`,min:1,integer:!0,allowEmpty:!0,errorMessage:`Effective resolution must be a positive integer`});if(t.error){T.error(t.error);return}Me(!0);try{let e=et?tt(te):void 0;await d({name:y,provider:x,model:C,baseURL:D.trim()||void 0,...e?{providerHeaders:e}:{},screenshotSize:ue||void 0,effectiveResolution:t.value})}catch(e){T.error(e instanceof Error?e.message:`Failed to save configuration`)}finally{Me(!1)}}async function pt(){if(!(!ce.trim()||!y||!at)){Be(!0);try{let e=et?oe:`api-key`;await Te(y,x,e,ce.trim()),T.success(e===`bearer-token`?`Bearer token saved`:`API key saved`),M(``),await p()}catch{T.error(`Failed to save credential`)}finally{Be(!1)}}}async function mt(){if(H)try{await ve(H),await p(),T.success(`Credential deleted`)}catch{T.error(`Failed to delete credential`)}finally{U(null)}}let ht=y.trim()!==``&&C.trim()!==``&&!Fe;function gt(){return at?(0,V.jsxs)(`div`,{className:`space-y-3`,children:[$e&&(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Credentials are optional for this config. Unauthenticated endpoints can still be tested.`}),x===`gemini`&&(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:qe}),et&&(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(_,{children:`Credential Type`}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Save an API key or Bearer token for this config.`}),(0,V.jsxs)(s,{value:oe,onValueChange:e=>A(e),children:[(0,V.jsx)(i,{className:`w-full`,children:(0,V.jsx)(o,{})}),(0,V.jsxs)(r,{children:[(0,V.jsx)(n,{value:`api-key`,children:`API key`}),(0,V.jsx)(n,{value:`bearer-token`,children:`Bearer token`})]})]})]}),(0,V.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,V.jsx)(k,{type:`password`,placeholder:`secret-value`,value:ce,onChange:e=>M(e.target.value),className:`min-w-[180px] flex-1`}),(0,V.jsxs)(j,{size:`sm`,onClick:pt,disabled:ze||!ce.trim()||!y||!!Fe,children:[ze?(0,V.jsx)(I,{className:`size-4 animate-spin`}):null,`Save Credential`]})]})]}):null}function _t(){if(He?.auth.kind!==`oauth-plugin`)return null;let e=Oe?.provider===x?Oe:null,t=He.label,n=He.auth.buttonLabel??`Login with ${t}`;async function r(){F(!0),Se(``);try{let e=await ke(x,y);if(Ae({provider:x,sessionId:e.sessionId,mode:e.mode}),window.open(e.authorizeUrl,`_blank`),e.mode===`browser-poll`){let n=window.setInterval(async()=>{try{let r=await he(x,e.sessionId);r.status===`completed`?(window.clearInterval(n),T.success(`${t} authenticated`),F(!1),Ae(null),await p()):r.status===`error`&&(window.clearInterval(n),T.error(r.error||`${t} authentication failed`),F(!1))}catch{}},2e3);window.setTimeout(()=>{window.clearInterval(n),F(!1)},300*1e3)}else F(!1)}catch{T.error(`Failed to start ${t} authentication`),F(!1)}}return(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Login with `,t,` for this config before testing.`]}),He.auth.mode===`manual-code`?(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,V.jsx)(_,{className:`text-sm`,children:`Open authorization page`}),(0,V.jsxs)(j,{variant:`outline`,size:`sm`,disabled:Ee||!y||!!Fe,onClick:r,children:[(0,V.jsx)(l,{className:`size-4`}),n]})]}),(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,V.jsx)(_,{className:`text-sm`,children:`Paste authorization code`}),(0,V.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,V.jsx)(k,{type:`password`,placeholder:`authorization-code`,value:xe,onChange:e=>Se(e.target.value),disabled:!e,className:`min-w-[180px] flex-1`}),(0,V.jsxs)(j,{size:`sm`,disabled:!xe.trim()||!e||Ce,onClick:async()=>{if(e){we(!0);try{await ee(x,e.sessionId,xe.trim()),T.success(`${t} authenticated`),Se(``),Ae(null),await p()}catch{T.error(`Failed to exchange code`)}finally{we(!1)}}},children:[Ce?(0,V.jsx)(I,{className:`size-4 animate-spin`}):null,`Connect`]})]})]})]}):(0,V.jsx)(`div`,{className:`space-y-3`,children:(0,V.jsxs)(j,{variant:`outline`,size:`sm`,disabled:Ee||!y||!!Fe,onClick:r,children:[Ee?(0,V.jsx)(I,{className:`size-4 animate-spin`}):(0,V.jsx)(l,{className:`size-4`}),Ee?`Authenticating...`:n]})})]})}function vt(){let e=m.filter(e=>e.configName===y);return e.length===0?null:(0,V.jsx)(`div`,{className:`space-y-2`,children:e.map(e=>{let t=Xe(e.expires),n=e.expires!==null&&e.expires<Date.now();return(0,V.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-3 rounded-none border border-border bg-transparent p-3 text-sm`,children:[(0,V.jsx)(L,{variant:`secondary`,className:`text-xs`,children:Ze(e)}),(0,V.jsx)(`span`,{className:`min-w-0 break-words font-medium`,children:Ye(e.provider,W)}),t&&(0,V.jsx)(L,{variant:n?`destructive`:`outline`,className:`text-xs`,children:t}),(0,V.jsx)(j,{variant:`ghost`,size:`sm`,className:`ml-auto h-8 w-8 p-0 text-destructive hover:text-destructive`,onClick:()=>U(e.configName),"aria-label":`Delete credential`,title:`Delete credential`,children:(0,V.jsx)(h,{className:`size-4`})})]},`${e.configName}-${e.type}-${e.provider}`)})})}function q(){return R?(0,V.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,role:`status`,children:[(0,V.jsx)(I,{className:`size-4 animate-spin`}),(0,V.jsx)(`span`,{children:`Testing connection...`})]}):z?z.success?z.unauthenticated?(0,V.jsx)(`div`,{className:`text-sm text-muted-foreground`,role:`status`,children:z.authMessage||z.message||Ke}):(0,V.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-success`,role:`status`,children:[(0,V.jsx)(se,{className:`size-4`}),(0,V.jsx)(`span`,{children:`Connection successful`}),z.responseTime!=null&&(0,V.jsxs)(`span`,{className:`text-muted-foreground`,children:[z.responseTime,`ms`]})]}):(0,V.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-destructive`,role:`alert`,children:[(0,V.jsx)(c,{className:`size-4`}),(0,V.jsx)(`span`,{children:rt(z)})]}):null}return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(pe,{open:e,onOpenChange:t,children:(0,V.jsxs)(be,{className:`sm:max-w-2xl max-h-[85vh] overflow-y-auto`,children:[(0,V.jsxs)(me,{children:[(0,V.jsx)(N,{children:v?`Edit ${a.name}`:`Add Configuration`}),(0,V.jsx)(ye,{children:v?`Update provider, model, and credentials for this configuration.`:`Create a named LLM configuration with its own provider, model, and credentials.`})]}),(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(_,{htmlFor:`config-name`,children:`Name`}),(0,V.jsx)(k,{id:`config-name`,placeholder:`e.g., claude-fast, gpt-cheap`,value:y,onChange:e=>{b(e.target.value),Fe&&Ie(``)},onBlur:()=>{y&&Ie(ct(y))},disabled:v,className:v?`bg-muted`:``,"aria-describedby":Fe?`name-error`:void 0}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Lowercase alphanumeric and hyphens (e.g., claude-fast, gpt-cheap)`}),Fe&&(0,V.jsx)(`p`,{id:`name-error`,className:`text-sm text-destructive`,children:Fe})]}),(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(_,{children:`Provider`}),(0,V.jsxs)(s,{value:x,onValueChange:lt,children:[(0,V.jsx)(i,{className:`w-full`,children:(0,V.jsx)(o,{})}),(0,V.jsx)(r,{children:Ve.map(e=>(0,V.jsx)(n,{value:e.value,children:e.label},e.value))})]})]}),(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(_,{htmlFor:`config-model`,children:`Model`}),(0,V.jsx)(k,{id:`config-model`,placeholder:`model-name`,value:C,onChange:e=>w(e.target.value)})]}),it&&(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,V.jsx)(_,{htmlFor:`config-base-url`,children:`Base URL`}),(0,V.jsx)(re,{children:(0,V.jsxs)(_e,{children:[(0,V.jsx)(ie,{asChild:!0,children:(0,V.jsx)(`button`,{type:`button`,"aria-label":`Compatible endpoint help`,className:`inline-flex size-5 items-center justify-center text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring cursor-help`,children:(0,V.jsx)(E,{className:`size-3.5`})})}),(0,V.jsx)(ne,{className:`max-w-[250px]`,children:Ge})]})})]}),(0,V.jsx)(k,{id:`config-base-url`,placeholder:x===`openai-compatible`?`https://openrouter.ai/api/v1`:`https://anthropic-proxy.example/messages`,value:D,onChange:e=>{O(e.target.value),Le&&Re(``)},"aria-invalid":Le?!0:void 0,"aria-describedby":Le?`base-url-error`:void 0}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:Ge}),Le&&(0,V.jsx)(`p`,{id:`base-url-error`,className:`text-sm text-destructive`,children:Le})]}),et&&(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(_,{children:`Provider Headers`}),(0,V.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Optional non-secret headers sent with this Anthropic-compatible endpoint.`})]}),(0,V.jsx)(`div`,{className:`space-y-2`,children:te.map(e=>{let t=e.key.trim().toLowerCase(),n=t!==``&&ot.has(t);return(0,V.jsxs)(`div`,{className:`space-y-1`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,V.jsx)(k,{placeholder:`header-name`,value:e.key,onChange:t=>ut(e.id,`key`,t.target.value),className:`min-w-[160px] flex-1`}),(0,V.jsx)(k,{placeholder:`header-value`,value:e.value,onChange:t=>ut(e.id,`value`,t.target.value),className:`min-w-[180px] flex-1`}),(0,V.jsx)(j,{type:`button`,variant:`ghost`,size:`sm`,className:`h-8 w-8 p-0 text-muted-foreground hover:text-destructive`,"aria-label":`Remove header`,title:`Remove header`,onClick:()=>ae(t=>t.filter(t=>t.id!==e.id)),disabled:te.length===1&&!e.key&&!e.value,children:(0,V.jsx)(h,{className:`size-4`})})]}),n&&(0,V.jsx)(`p`,{className:`text-xs text-destructive`,children:`Duplicate header names are not allowed.`})]},e.id)})}),(0,V.jsxs)(j,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>ae(e=>[...e,K()]),children:[(0,V.jsx)(f,{className:`size-4`}),`Add Header`]})]}),(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(_,{children:`Screenshot Size`}),(0,V.jsx)(k,{placeholder:`e.g., "1m", "512k" (empty = no compression)`,value:ue,onChange:e=>de(e.target.value)}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Maximum screenshot size for this model (e.g., "1m", "512k"). Empty = no compression.`})]}),(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(_,{htmlFor:`config-effective-resolution`,children:`Effective Resolution`}),(0,V.jsx)(k,{id:`config-effective-resolution`,type:`number`,min:1,step:1,placeholder:`e.g., 1568`,value:fe,onChange:e=>ge(e.target.value)}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Maximum effective screenshot edge sent to the model. Use this with screenshot compression to control token cost.`})]}),(0,V.jsx)(le,{}),(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h3`,{className:`text-base font-semibold`,children:`Credentials`}),(0,V.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Saved credentials are keyed by this named configuration.`})]}),gt(),_t(),vt()]})]}),(0,V.jsxs)(P,{children:[(0,V.jsx)(j,{variant:`outline`,onClick:dt,disabled:R||!x||!C||st,children:`Test Connection`}),(0,V.jsxs)(j,{onClick:ft,disabled:je||!ht||st,children:[je&&(0,V.jsx)(I,{className:`size-4 animate-spin`}),`Save Changes`]})]}),$e&&!Ue&&!R&&!z&&(0,V.jsx)(`div`,{className:`text-sm text-muted-foreground`,role:`status`,children:Ke}),q()]})}),(0,V.jsx)(pe,{open:H!==null,onOpenChange:e=>{e||U(null)},children:(0,V.jsxs)(be,{children:[(0,V.jsxs)(me,{children:[(0,V.jsx)(N,{children:`Delete Credential`}),(0,V.jsxs)(ye,{children:[`Delete saved credential for `,H,`? Tests using this config may fail until a new credential is saved.`]})]}),(0,V.jsxs)(P,{children:[(0,V.jsx)(j,{variant:`outline`,onClick:()=>U(null),children:`Keep Credential`}),(0,V.jsx)(j,{variant:`destructive`,onClick:mt,children:`Delete Credential`})]})]})})]})}function ot({config:e,onConfigChange:t}){let n=e.use?.timeout??{},[r,i]=(0,B.useState)(n.step??`30s`),[a,o]=(0,B.useState)(n.test??`10m`),[s,c]=(0,B.useState)(n.navigation??`10s`),[l,u]=(0,B.useState)(!1);async function d(){u(!0);try{await A({"use.timeout":{step:r,test:a,navigation:s}}),t(),T.success(`Configuration saved`)}catch{T.error(`Failed to save configuration`)}finally{u(!1)}}return(0,V.jsxs)(H,{children:[(0,V.jsxs)(U,{children:[(0,V.jsx)(`h2`,{className:`text-base font-semibold`,children:`Timeout`}),(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Configure timeout limits for test execution`})]}),(0,V.jsxs)(W,{children:[(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(_,{htmlFor:`timeout-step`,children:`Step Timeout`}),(0,V.jsx)(k,{id:`timeout-step`,type:`text`,placeholder:`e.g., "30s", "5m"`,value:r,onChange:e=>i(e.target.value)}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Max time for a single test step (e.g., "30s", "5m")`})]}),(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(_,{htmlFor:`timeout-test`,children:`Test Timeout`}),(0,V.jsx)(k,{id:`timeout-test`,type:`text`,placeholder:`e.g., "10m", "1h"`,value:a,onChange:e=>o(e.target.value)}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Max time for an entire test (e.g., "10m", "1h")`})]}),(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(_,{htmlFor:`timeout-navigation`,children:`Navigation Timeout`}),(0,V.jsx)(k,{id:`timeout-navigation`,type:`text`,placeholder:`e.g., "10s", "30s"`,value:s,onChange:e=>c(e.target.value)}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Max time for page navigation (e.g., "10s", "30s")`})]}),(0,V.jsx)(j,{size:`sm`,onClick:d,disabled:l,children:l?(0,V.jsx)(I,{className:`size-4 animate-spin`}):`Save Changes`})]})]})}function st({config:e,onConfigChange:t}){let n=e.use?.healing??{},[r,i]=(0,B.useState)(String(n.maxAttempts??3)),[a,o]=(0,B.useState)(!1);async function s(){let e=G(r,{label:`Max healing attempts`,min:1,integer:!0});if(e.error){T.error(e.error);return}o(!0);try{await A({"use.healing":{maxAttempts:e.value}}),t(),T.success(`Configuration saved`)}catch{T.error(`Failed to save configuration`)}finally{o(!1)}}return(0,V.jsxs)(H,{children:[(0,V.jsxs)(U,{children:[(0,V.jsx)(`h2`,{className:`text-base font-semibold`,children:`Healing`}),(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Configure self-healing behavior for failing test steps`})]}),(0,V.jsxs)(W,{children:[(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(_,{htmlFor:`healing-max-attempts`,children:`Max Healing Attempts`}),(0,V.jsx)(k,{id:`healing-max-attempts`,type:`number`,min:1,step:1,value:r,onChange:e=>i(e.target.value)})]}),(0,V.jsx)(j,{size:`sm`,onClick:s,disabled:a,children:a?(0,V.jsx)(I,{className:`size-4 animate-spin`}):`Save Changes`})]})]})}function ct({config:e,onConfigChange:t}){let n=e.services?.cache??{},[r,i]=(0,B.useState)(n.dir??``),[a,o]=(0,B.useState)(n.ttl??``),[s,c]=(0,B.useState)(!1);async function l(){c(!0);try{await A({"services.cache":{dir:r,ttl:a}}),t(),T.success(`Configuration saved`)}catch{T.error(`Failed to save configuration`)}finally{c(!1)}}return(0,V.jsxs)(H,{children:[(0,V.jsxs)(U,{children:[(0,V.jsx)(`h2`,{className:`text-base font-semibold`,children:`Cache`}),(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Configure action cache directory and expiration`})]}),(0,V.jsxs)(W,{children:[(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(_,{htmlFor:`cache-dir`,children:`Cache Directory`}),(0,V.jsx)(k,{id:`cache-dir`,placeholder:`.agent-qa/cache`,value:r,onChange:e=>i(e.target.value)})]}),(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(_,{htmlFor:`cache-ttl`,children:`TTL`}),(0,V.jsx)(k,{id:`cache-ttl`,placeholder:`7d`,value:a,onChange:e=>o(e.target.value)}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Cache time-to-live — human-readable duration (e.g., "7d", "24h", "30m")`})]}),(0,V.jsx)(j,{size:`sm`,onClick:l,disabled:s,children:s?(0,V.jsx)(I,{className:`size-4 animate-spin`}):`Save Changes`})]})]})}function lt({config:e,onConfigChange:t}){let[a,c]=(0,B.useState)((e.services?.logging??{}).level??`info`),[l,u]=(0,B.useState)(!1);async function d(){u(!0);try{await A({"services.logging":{level:a}}),t(),T.success(`Changes saved`)}catch{T.error(`Failed to save configuration`)}finally{u(!1)}}return(0,V.jsxs)(H,{children:[(0,V.jsxs)(U,{children:[(0,V.jsx)(`h2`,{className:`text-base font-semibold`,children:`Logging`}),(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Configure service log verbosity.`})]}),(0,V.jsxs)(W,{children:[(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(_,{htmlFor:`logging-level`,children:`Log Level`}),(0,V.jsxs)(s,{value:a,onValueChange:c,children:[(0,V.jsx)(i,{id:`logging-level`,children:(0,V.jsx)(o,{})}),(0,V.jsxs)(r,{children:[(0,V.jsx)(n,{value:`silent`,children:`Silent`}),(0,V.jsx)(n,{value:`error`,children:`Error`}),(0,V.jsx)(n,{value:`warn`,children:`Warn`}),(0,V.jsx)(n,{value:`info`,children:`Info`}),(0,V.jsx)(n,{value:`debug`,children:`Debug`})]})]})]}),(0,V.jsx)(j,{size:`sm`,onClick:d,disabled:l,children:l?(0,V.jsx)(I,{className:`size-4 animate-spin`}):`Save Changes`})]})]})}function ut({config:e,onConfigChange:t}){let a=e.use?.browser??{},[c,l]=(0,B.useState)(a.name??`chromium`),[u,d]=(0,B.useState)(a.headless??!0),f=a.viewport??{width:1280,height:720},[p,m]=(0,B.useState)(String(f.width)),[h,g]=(0,B.useState)(String(f.height)),[v,b]=(0,B.useState)(!1);async function x(){let e=G(p,{label:`Viewport width`,min:1,integer:!0});if(e.error){T.error(e.error);return}let n=G(h,{label:`Viewport height`,min:1,integer:!0});if(n.error){T.error(n.error);return}b(!0);try{await A({"use.browser":{name:c,headless:u,viewport:{width:e.value,height:n.value}}}),t(),T.success(`Configuration saved`)}catch{T.error(`Failed to save configuration`)}finally{b(!1)}}return(0,V.jsxs)(H,{children:[(0,V.jsxs)(U,{children:[(0,V.jsx)(`h2`,{className:`text-base font-semibold`,children:`Browser`}),(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Configure default browser settings for web test execution`})]}),(0,V.jsxs)(W,{children:[(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(_,{htmlFor:`browser-name`,children:`Browser`}),(0,V.jsxs)(s,{value:c,onValueChange:l,children:[(0,V.jsx)(i,{id:`browser-name`,children:(0,V.jsx)(o,{})}),(0,V.jsxs)(r,{children:[(0,V.jsx)(n,{value:`chromium`,children:`Chromium`}),(0,V.jsx)(n,{value:`firefox`,children:`Firefox`}),(0,V.jsx)(n,{value:`webkit`,children:`WebKit`})]})]})]}),(0,V.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,V.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,V.jsx)(_,{htmlFor:`browser-headless`,children:`Headless`}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Run web browsers without a visible window.`})]}),(0,V.jsx)(y,{id:`browser-headless`,checked:u,onCheckedChange:d})]}),(0,V.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(_,{htmlFor:`browser-vw`,children:`Viewport Width`}),(0,V.jsx)(k,{id:`browser-vw`,type:`number`,min:1,step:1,value:p,onChange:e=>m(e.target.value)})]}),(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(_,{htmlFor:`browser-vh`,children:`Viewport Height`}),(0,V.jsx)(k,{id:`browser-vh`,type:`number`,min:1,step:1,value:h,onChange:e=>g(e.target.value)})]})]}),(0,V.jsx)(j,{size:`sm`,onClick:x,disabled:v,children:v?(0,V.jsx)(I,{className:`size-4 animate-spin`}):`Save Changes`})]})]})}function dt({config:e,onConfigChange:t}){let[n,r]=(0,B.useState)((e.services?.recording??{}).enabled??!1),[i,a]=(0,B.useState)(!1);async function o(){a(!0);try{await A({"services.recording":{enabled:n}}),t(),T.success(`Changes saved`)}catch{T.error(`Failed to save configuration`)}finally{a(!1)}}return(0,V.jsxs)(H,{children:[(0,V.jsxs)(U,{children:[(0,V.jsx)(`h2`,{className:`text-base font-semibold`,children:`Recording`}),(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Configure whether runtime recording is enabled by default.`})]}),(0,V.jsxs)(W,{children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,V.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,V.jsx)(_,{htmlFor:`recording-enabled`,children:`Enabled`}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Record video of test execution`})]}),(0,V.jsx)(y,{id:`recording-enabled`,checked:n,onCheckedChange:r})]}),(0,V.jsx)(j,{size:`sm`,onClick:o,disabled:i,children:i?(0,V.jsx)(I,{className:`size-4 animate-spin`}):`Save Changes`})]})]})}function ft({config:e,onConfigChange:t}){let a=e.services?.accessibility??{},[c,l]=(0,B.useState)(a.enabled??!1),[u,d]=(0,B.useState)(a.standard??`wcag2aa`),[f,p]=(0,B.useState)(a.runAfter??`test-end`),[m,h]=(0,B.useState)(a.failOnViolation??!1),[g,v]=(0,B.useState)(!1);async function b(){v(!0);try{await A({"services.accessibility":{enabled:c,standard:u,runAfter:f,failOnViolation:m}}),t(),T.success(`Configuration saved`)}catch{T.error(`Failed to save configuration`)}finally{v(!1)}}return(0,V.jsxs)(H,{children:[(0,V.jsxs)(U,{children:[(0,V.jsx)(`h2`,{className:`text-base font-semibold`,children:`Accessibility`}),(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Configure accessibility audit settings`})]}),(0,V.jsxs)(W,{children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,V.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,V.jsx)(_,{htmlFor:`a11y-enabled`,children:`Enabled`}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Run accessibility checks during tests`})]}),(0,V.jsx)(y,{id:`a11y-enabled`,checked:c,onCheckedChange:l})]}),(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(_,{htmlFor:`a11y-standard`,children:`Standard`}),(0,V.jsxs)(s,{value:u,onValueChange:d,children:[(0,V.jsx)(i,{id:`a11y-standard`,children:(0,V.jsx)(o,{})}),(0,V.jsxs)(r,{children:[(0,V.jsx)(n,{value:`wcag2a`,children:`WCAG 2.0 A`}),(0,V.jsx)(n,{value:`wcag2aa`,children:`WCAG 2.0 AA`}),(0,V.jsx)(n,{value:`wcag2aaa`,children:`WCAG 2.0 AAA`})]})]})]}),(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(_,{htmlFor:`a11y-run-after`,children:`Run After`}),(0,V.jsxs)(s,{value:f,onValueChange:p,children:[(0,V.jsx)(i,{id:`a11y-run-after`,children:(0,V.jsx)(o,{})}),(0,V.jsxs)(r,{children:[(0,V.jsx)(n,{value:`every-step`,children:`Every Step`}),(0,V.jsx)(n,{value:`navigation`,children:`Navigation`}),(0,V.jsx)(n,{value:`test-end`,children:`Test End`})]})]})]}),(0,V.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,V.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,V.jsx)(_,{htmlFor:`a11y-fail`,children:`Fail on Violation`}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Fail the test if violations are found`})]}),(0,V.jsx)(y,{id:`a11y-fail`,checked:m,onCheckedChange:h})]}),(0,V.jsx)(j,{size:`sm`,onClick:b,disabled:g,children:g?(0,V.jsx)(I,{className:`size-4 animate-spin`}):`Save Changes`})]})]})}function pt({config:e,onConfigChange:t}){let n=e.use?.planner??{},[r,i]=(0,B.useState)(String(n.maxSubActions??20)),[a,o]=(0,B.useState)(String(n.previousStepCount??5)),[s,c]=(0,B.useState)(!1);async function l(){let e=G(r,{label:`Max sub-actions`,min:1,integer:!0});if(e.error){T.error(e.error);return}let n=G(a,{label:`Previous step count`,min:0,integer:!0});if(n.error){T.error(n.error);return}c(!0);try{await A({"use.planner":{maxSubActions:e.value,previousStepCount:n.value}}),t(),T.success(`Configuration saved`)}catch{T.error(`Failed to save configuration`)}finally{c(!1)}}return(0,V.jsxs)(H,{children:[(0,V.jsxs)(U,{children:[(0,V.jsx)(`h2`,{className:`text-base font-semibold`,children:`Planner`}),(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Configure the AI planner observation and planning settings`})]}),(0,V.jsxs)(W,{children:[(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(_,{htmlFor:`planner-max-sub-actions`,children:`Max Sub-Actions`}),(0,V.jsx)(k,{id:`planner-max-sub-actions`,type:`number`,min:1,step:1,value:r,onChange:e=>i(e.target.value)}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Maximum sub-actions per step`})]}),(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(_,{htmlFor:`planner-prev-steps`,children:`Previous Step Count`}),(0,V.jsx)(k,{id:`planner-prev-steps`,type:`number`,min:0,step:1,value:a,onChange:e=>o(e.target.value)}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Number of previous steps included in planner context`})]}),(0,V.jsx)(j,{size:`sm`,onClick:l,disabled:s,children:s?(0,V.jsx)(I,{className:`size-4 animate-spin`}):`Save Changes`})]})]})}var{entries:mt,setPrototypeOf:ht,isFrozen:gt,getPrototypeOf:_t,getOwnPropertyDescriptor:vt}=Object,{freeze:q,seal:yt,create:bt}=Object,{apply:xt,construct:St}=typeof Reflect<`u`&&Reflect;q||=function(e){return e},yt||=function(e){return e},xt||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},St||=function(e){return new e(...[...arguments].slice(1))};var Ct=Z(Array.prototype.forEach),wt=Z(Array.prototype.lastIndexOf),Tt=Z(Array.prototype.pop),Et=Z(Array.prototype.push),Dt=Z(Array.prototype.splice),J=Array.isArray,Ot=Z(String.prototype.toLowerCase),kt=Z(String.prototype.toString),At=Z(String.prototype.match),jt=Z(String.prototype.replace),Mt=Z(String.prototype.indexOf),Nt=Z(String.prototype.trim),Pt=Z(Number.prototype.toString),Ft=Z(Boolean.prototype.toString),It=typeof BigInt>`u`?null:Z(BigInt.prototype.toString),Lt=typeof Symbol>`u`?null:Z(Symbol.prototype.toString),Y=Z(Object.prototype.hasOwnProperty),Rt=Z(Object.prototype.toString),X=Z(RegExp.prototype.test),zt=Bt(TypeError);function Z(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return xt(e,t,n)}}function Bt(e){return function(){return St(e,[...arguments])}}function Q(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ot;if(ht&&ht(e,null),!J(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(gt(t)||(t[r]=e),i=e)}e[i]=!0}return e}function Vt(e){for(let t=0;t<e.length;t++)Y(e,t)||(e[t]=null);return e}function $(e){let t=bt(null);for(let[n,r]of mt(e))Y(e,n)&&(J(r)?t[n]=Vt(r):r&&typeof r==`object`&&r.constructor===Object?t[n]=$(r):t[n]=r);return t}function Ht(e){switch(typeof e){case`string`:return e;case`number`:return Pt(e);case`boolean`:return Ft(e);case`bigint`:return It?It(e):`0`;case`symbol`:return Lt?Lt(e):`Symbol()`;case`undefined`:return Rt(e);case`function`:case`object`:{if(e===null)return Rt(e);let t=e,n=Ut(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:Rt(e)}return Rt(e)}default:return Rt(e)}}function Ut(e,t){for(;e!==null;){let n=vt(e,t);if(n){if(n.get)return Z(n.get);if(typeof n.value==`function`)return Z(n.value)}e=_t(e)}function n(){return null}return n}function Wt(e){try{return X(e,``),!0}catch{return!1}}var Gt=q(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),Kt=q(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),qt=q([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),Jt=q([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),Yt=q(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),Xt=q([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),Zt=q([`#text`]),Qt=q(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),$t=q(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),en=q(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),tn=q([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),nn=yt(/\{\{[\w\W]*|[\w\W]*\}\}/gm),rn=yt(/<%[\w\W]*|[\w\W]*%>/gm),an=yt(/\$\{[\w\W]*/gm),on=yt(/^data-[\-\w.\u00B7-\uFFFF]+$/),sn=yt(/^aria-[\-\w]+$/),cn=yt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ln=yt(/^(?:\w+script|data):/i),un=yt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),dn=yt(/^html$/i),fn=yt(/^[a-z][.\w]*(-[.\w]+)+$/i),pn=Object.freeze({__proto__:null,ARIA_ATTR:sn,ATTR_WHITESPACE:un,CUSTOM_ELEMENT:fn,DATA_ATTR:on,DOCTYPE_NAME:dn,ERB_EXPR:rn,IS_ALLOWED_URI:cn,IS_SCRIPT_OR_DATA:ln,MUSTACHE_EXPR:nn,TMPLIT_EXPR:an}),mn={element:1,text:3,progressingInstruction:7,comment:8,document:9},hn=function(){return typeof window>`u`?null:window},gn=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},_n=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function vn(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:hn(),t=e=>vn(e);if(t.version=`3.4.2`,t.removed=[],!e||!e.document||e.document.nodeType!==mn.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e,r=n,i=r.currentScript,{DocumentFragment:a,HTMLTemplateElement:o,Node:s,Element:c,NodeFilter:l,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:d,DOMParser:f,trustedTypes:p}=e,m=c.prototype,h=Ut(m,`cloneNode`),g=Ut(m,`remove`),_=Ut(m,`nextSibling`),v=Ut(m,`childNodes`),y=Ut(m,`parentNode`);if(typeof o==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let b,x=``,{implementation:S,createNodeIterator:C,createDocumentFragment:w,getElementsByTagName:T}=n,{importNode:E}=r,D=_n();t.isSupported=typeof mt==`function`&&typeof y==`function`&&S&&S.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:ee,ERB_EXPR:O,TMPLIT_EXPR:k,DATA_ATTR:te,ARIA_ATTR:ne,IS_SCRIPT_OR_DATA:re,ATTR_WHITESPACE:ie,CUSTOM_ELEMENT:ae}=pn,{IS_ALLOWED_URI:oe}=pn,A=null,se=Q({},[...Gt,...Kt,...qt,...Yt,...Zt]),j=null,ce=Q({},[...Qt,...$t,...en,...tn]),M=Object.seal(bt(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),le=null,ue=null,N=Object.seal(bt(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),de=!0,fe=!0,pe=!1,me=!0,P=!1,he=!0,ge=!1,_e=!1,ve=!1,ye=!1,be=!1,xe=!1,Se=!0,Ce=!1,we=`user-content-`,Te=!0,Ee=!1,F={},De=null,Oe=Q({},[`annotation-xml`,`audio`,`colgroup`,`desc`,`foreignobject`,`head`,`iframe`,`math`,`mi`,`mn`,`mo`,`ms`,`mtext`,`noembed`,`noframes`,`noscript`,`plaintext`,`script`,`style`,`svg`,`template`,`thead`,`title`,`video`,`xmp`]),ke=null,Ae=Q({},[`audio`,`video`,`img`,`source`,`image`,`track`]),I=null,L=Q({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),je=`http://www.w3.org/1998/Math/MathML`,Me=`http://www.w3.org/2000/svg`,R=`http://www.w3.org/1999/xhtml`,Ne=R,z=!1,Pe=null,Fe=Q({},[je,Me,R],kt),Ie=Q({},[`mi`,`mo`,`mn`,`ms`,`mtext`]),Le=Q({},[`annotation-xml`]),Re=Q({},[`title`,`style`,`font`,`a`,`script`]),ze=null,Be=[`application/xhtml+xml`,`text/html`],B=null,V=null,H=n.createElement(`form`),U=function(e){return e instanceof RegExp||e instanceof Function},W=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(V&&V===e)return;(!e||typeof e!=`object`)&&(e={}),e=$(e),ze=Be.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,B=ze===`application/xhtml+xml`?kt:Ot,A=Y(e,`ALLOWED_TAGS`)&&J(e.ALLOWED_TAGS)?Q({},e.ALLOWED_TAGS,B):se,j=Y(e,`ALLOWED_ATTR`)&&J(e.ALLOWED_ATTR)?Q({},e.ALLOWED_ATTR,B):ce,Pe=Y(e,`ALLOWED_NAMESPACES`)&&J(e.ALLOWED_NAMESPACES)?Q({},e.ALLOWED_NAMESPACES,kt):Fe,I=Y(e,`ADD_URI_SAFE_ATTR`)&&J(e.ADD_URI_SAFE_ATTR)?Q($(L),e.ADD_URI_SAFE_ATTR,B):L,ke=Y(e,`ADD_DATA_URI_TAGS`)&&J(e.ADD_DATA_URI_TAGS)?Q($(Ae),e.ADD_DATA_URI_TAGS,B):Ae,De=Y(e,`FORBID_CONTENTS`)&&J(e.FORBID_CONTENTS)?Q({},e.FORBID_CONTENTS,B):Oe,le=Y(e,`FORBID_TAGS`)&&J(e.FORBID_TAGS)?Q({},e.FORBID_TAGS,B):$({}),ue=Y(e,`FORBID_ATTR`)&&J(e.FORBID_ATTR)?Q({},e.FORBID_ATTR,B):$({}),F=Y(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?$(e.USE_PROFILES):e.USE_PROFILES:!1,de=e.ALLOW_ARIA_ATTR!==!1,fe=e.ALLOW_DATA_ATTR!==!1,pe=e.ALLOW_UNKNOWN_PROTOCOLS||!1,me=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,P=e.SAFE_FOR_TEMPLATES||!1,he=e.SAFE_FOR_XML!==!1,ge=e.WHOLE_DOCUMENT||!1,ye=e.RETURN_DOM||!1,be=e.RETURN_DOM_FRAGMENT||!1,xe=e.RETURN_TRUSTED_TYPE||!1,ve=e.FORCE_BODY||!1,Se=e.SANITIZE_DOM!==!1,Ce=e.SANITIZE_NAMED_PROPS||!1,Te=e.KEEP_CONTENT!==!1,Ee=e.IN_PLACE||!1,oe=Wt(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:cn,Ne=typeof e.NAMESPACE==`string`?e.NAMESPACE:R,Ie=Y(e,`MATHML_TEXT_INTEGRATION_POINTS`)&&e.MATHML_TEXT_INTEGRATION_POINTS&&typeof e.MATHML_TEXT_INTEGRATION_POINTS==`object`?$(e.MATHML_TEXT_INTEGRATION_POINTS):Q({},[`mi`,`mo`,`mn`,`ms`,`mtext`]),Le=Y(e,`HTML_INTEGRATION_POINTS`)&&e.HTML_INTEGRATION_POINTS&&typeof e.HTML_INTEGRATION_POINTS==`object`?$(e.HTML_INTEGRATION_POINTS):Q({},[`annotation-xml`]);let t=Y(e,`CUSTOM_ELEMENT_HANDLING`)&&e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING==`object`?$(e.CUSTOM_ELEMENT_HANDLING):bt(null);if(M=bt(null),Y(t,`tagNameCheck`)&&U(t.tagNameCheck)&&(M.tagNameCheck=t.tagNameCheck),Y(t,`attributeNameCheck`)&&U(t.attributeNameCheck)&&(M.attributeNameCheck=t.attributeNameCheck),Y(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(M.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),P&&(fe=!1),be&&(ye=!0),F&&(A=Q({},Zt),j=bt(null),F.html===!0&&(Q(A,Gt),Q(j,Qt)),F.svg===!0&&(Q(A,Kt),Q(j,$t),Q(j,tn)),F.svgFilters===!0&&(Q(A,qt),Q(j,$t),Q(j,tn)),F.mathMl===!0&&(Q(A,Yt),Q(j,en),Q(j,tn))),N.tagCheck=null,N.attributeCheck=null,Y(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?N.tagCheck=e.ADD_TAGS:J(e.ADD_TAGS)&&(A===se&&(A=$(A)),Q(A,e.ADD_TAGS,B))),Y(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?N.attributeCheck=e.ADD_ATTR:J(e.ADD_ATTR)&&(j===ce&&(j=$(j)),Q(j,e.ADD_ATTR,B))),Y(e,`ADD_URI_SAFE_ATTR`)&&J(e.ADD_URI_SAFE_ATTR)&&Q(I,e.ADD_URI_SAFE_ATTR,B),Y(e,`FORBID_CONTENTS`)&&J(e.FORBID_CONTENTS)&&(De===Oe&&(De=$(De)),Q(De,e.FORBID_CONTENTS,B)),Y(e,`ADD_FORBID_CONTENTS`)&&J(e.ADD_FORBID_CONTENTS)&&(De===Oe&&(De=$(De)),Q(De,e.ADD_FORBID_CONTENTS,B)),Te&&(A[`#text`]=!0),ge&&Q(A,[`html`,`head`,`body`]),A.table&&(Q(A,[`tbody`]),delete le.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw zt(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw zt(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);b=e.TRUSTED_TYPES_POLICY,x=b.createHTML(``)}else b===void 0&&(b=gn(p,i)),b!==null&&typeof x==`string`&&(x=b.createHTML(``));q&&q(e),V=e},Ve=Q({},[...Kt,...qt,...Jt]),G=Q({},[...Yt,...Xt]),He=function(e){let t=y(e);(!t||!t.tagName)&&(t={namespaceURI:Ne,tagName:`template`});let n=Ot(e.tagName),r=Ot(t.tagName);return Pe[e.namespaceURI]?e.namespaceURI===Me?t.namespaceURI===R?n===`svg`:t.namespaceURI===je?n===`svg`&&(r===`annotation-xml`||Ie[r]):!!Ve[n]:e.namespaceURI===je?t.namespaceURI===R?n===`math`:t.namespaceURI===Me?n===`math`&&Le[r]:!!G[n]:e.namespaceURI===R?t.namespaceURI===Me&&!Le[r]||t.namespaceURI===je&&!Ie[r]?!1:!G[n]&&(Re[n]||!Ve[n]):!!(ze===`application/xhtml+xml`&&Pe[e.namespaceURI]):!1},Ue=function(e){Et(t.removed,{element:e});try{y(e).removeChild(e)}catch{g(e)}},We=function(e,n){try{Et(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch{Et(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e===`is`)if(ye||be)try{Ue(n)}catch{}else try{n.setAttribute(e,``)}catch{}},Ge=function(e){let t=null,r=null;if(ve)e=`<remove></remove>`+e;else{let t=At(e,/^[\r\n\t ]+/);r=t&&t[0]}ze===`application/xhtml+xml`&&Ne===R&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=b?b.createHTML(e):e;if(Ne===R)try{t=new f().parseFromString(i,ze)}catch{}if(!t||!t.documentElement){t=S.createDocument(Ne,`template`,null);try{t.documentElement.innerHTML=z?x:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Ne===R?T.call(t,ge?`html`:`body`)[0]:ge?t.documentElement:a},Ke=function(e){return C.call(e.ownerDocument||e,e,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},qe=function(e){return e instanceof d&&(typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||!(e.attributes instanceof u)||typeof e.removeAttribute!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`)},Je=function(e){return typeof s==`function`&&e instanceof s};function K(e,n,r){Ct(e,e=>{e.call(t,n,r,V)})}let Ye=function(e){let n=null;if(K(D.beforeSanitizeElements,e,null),qe(e))return Ue(e),!0;let r=B(e.nodeName);if(K(D.uponSanitizeElement,e,{tagName:r,allowedTags:A}),he&&e.hasChildNodes()&&!Je(e.firstElementChild)&&X(/<[/\w!]/g,e.innerHTML)&&X(/<[/\w!]/g,e.textContent)||he&&e.namespaceURI===R&&r===`style`&&Je(e.firstElementChild)||e.nodeType===mn.progressingInstruction||he&&e.nodeType===mn.comment&&X(/<[/\w]/g,e.data))return Ue(e),!0;if(le[r]||!(N.tagCheck instanceof Function&&N.tagCheck(r))&&!A[r]){if(!le[r]&&Qe(r)&&(M.tagNameCheck instanceof RegExp&&X(M.tagNameCheck,r)||M.tagNameCheck instanceof Function&&M.tagNameCheck(r)))return!1;if(Te&&!De[r]){let t=y(e)||e.parentNode,n=v(e)||e.childNodes;if(n&&t){let r=n.length;for(let i=r-1;i>=0;--i){let r=h(n[i],!0);t.insertBefore(r,_(e))}}}return Ue(e),!0}return e instanceof c&&!He(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&X(/<\/no(script|embed|frames)/i,e.innerHTML)?(Ue(e),!0):(P&&e.nodeType===mn.text&&(n=e.textContent,Ct([ee,O,k],e=>{n=jt(n,e,` `)}),e.textContent!==n&&(Et(t.removed,{element:e.cloneNode()}),e.textContent=n)),K(D.afterSanitizeElements,e,null),!1)},Xe=function(e,t,r){if(ue[t]||Se&&(t===`id`||t===`name`)&&(r in n||r in H))return!1;let i=j[t]||N.attributeCheck instanceof Function&&N.attributeCheck(t,e);if(!(fe&&!ue[t]&&X(te,t))&&!(de&&X(ne,t))){if(!i||ue[t]){if(!(Qe(e)&&(M.tagNameCheck instanceof RegExp&&X(M.tagNameCheck,e)||M.tagNameCheck instanceof Function&&M.tagNameCheck(e))&&(M.attributeNameCheck instanceof RegExp&&X(M.attributeNameCheck,t)||M.attributeNameCheck instanceof Function&&M.attributeNameCheck(t,e))||t===`is`&&M.allowCustomizedBuiltInElements&&(M.tagNameCheck instanceof RegExp&&X(M.tagNameCheck,r)||M.tagNameCheck instanceof Function&&M.tagNameCheck(r))))return!1}else if(!I[t]&&!X(oe,jt(r,ie,``))&&!((t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&Mt(r,`data:`)===0&&ke[e])&&!(pe&&!X(re,jt(r,ie,``)))&&r)return!1}return!0},Ze=Q({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),Qe=function(e){return!Ze[Ot(e)]&&X(ae,e)},$e=function(e){K(D.beforeSanitizeAttributes,e,null);let{attributes:n}=e;if(!n||qe(e))return;let r={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:j,forceKeepAttr:void 0},i=n.length;for(;i--;){let{name:a,namespaceURI:o,value:s}=n[i],c=B(a),l=s,u=a===`value`?l:Nt(l);if(r.attrName=c,r.attrValue=u,r.keepAttr=!0,r.forceKeepAttr=void 0,K(D.uponSanitizeAttribute,e,r),u=r.attrValue,Ce&&(c===`id`||c===`name`)&&Mt(u,we)!==0&&(We(a,e),u=we+u),he&&X(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,u)){We(a,e);continue}if(c===`attributename`&&At(u,`href`)){We(a,e);continue}if(r.forceKeepAttr)continue;if(!r.keepAttr){We(a,e);continue}if(!me&&X(/\/>/i,u)){We(a,e);continue}P&&Ct([ee,O,k],e=>{u=jt(u,e,` `)});let d=B(e.nodeName);if(!Xe(d,c,u)){We(a,e);continue}if(b&&typeof p==`object`&&typeof p.getAttributeType==`function`&&!o)switch(p.getAttributeType(d,c)){case`TrustedHTML`:u=b.createHTML(u);break;case`TrustedScriptURL`:u=b.createScriptURL(u);break}if(u!==l)try{o?e.setAttributeNS(o,a,u):e.setAttribute(a,u),qe(e)?Ue(e):Tt(t.removed)}catch{We(a,e)}}K(D.afterSanitizeAttributes,e,null)},et=function(e){let t=null,n=Ke(e);for(K(D.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)K(D.uponSanitizeShadowNode,t,null),Ye(t),$e(t),t.content instanceof a&&et(t.content);K(D.afterSanitizeShadowDOM,e,null)};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,o=null,c=null,l=null;if(z=!e,z&&(e=`<!-->`),typeof e!=`string`&&!Je(e)&&(e=Ht(e),typeof e!=`string`))throw zt(`dirty is not a string, aborting`);if(!t.isSupported)return e;if(_e||W(n),t.removed=[],typeof e==`string`&&(Ee=!1),Ee){let t=e.nodeName;if(typeof t==`string`){let e=B(t);if(!A[e]||le[e])throw zt(`root node is forbidden and cannot be sanitized in-place`)}}else if(e instanceof s)i=Ge(`<!---->`),o=i.ownerDocument.importNode(e,!0),o.nodeType===mn.element&&o.nodeName===`BODY`||o.nodeName===`HTML`?i=o:i.appendChild(o);else{if(!ye&&!P&&!ge&&e.indexOf(`<`)===-1)return b&&xe?b.createHTML(e):e;if(i=Ge(e),!i)return ye?null:xe?x:``}i&&ve&&Ue(i.firstChild);let u=Ke(Ee?e:i);for(;c=u.nextNode();)Ye(c),$e(c),c.content instanceof a&&et(c.content);if(Ee)return e;if(ye){if(P){i.normalize();let e=i.innerHTML;Ct([ee,O,k],t=>{e=jt(e,t,` `)}),i.innerHTML=e}if(be)for(l=w.call(i.ownerDocument);i.firstChild;)l.appendChild(i.firstChild);else l=i;return(j.shadowroot||j.shadowrootmode)&&(l=E.call(r,l,!0)),l}let d=ge?i.outerHTML:i.innerHTML;return ge&&A[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&X(dn,i.ownerDocument.doctype.name)&&(d=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
|
|
1
|
+
import{r as e}from"./chunk-CilyBKbf.js";import{a as t,i as n,n as r,o as i,r as a,s as o,t as s}from"./select-D5oFJNaq.js";import{t as c}from"./circle-x-B7AOkLOS.js";import{t as l}from"./external-link-DC-KkLmq.js";import{t as u}from"./eye-YQHiLgt4.js";import{t as d}from"./pencil-CZF_NGi6.js";import{t as f}from"./plus-Qf7V331e.js";import{n as p,t as m}from"./textarea-CVB6Do1_.js";import{t as h}from"./trash-2-BhJSaMLG.js";import{t as g}from"./use-page-title-B4YPyIzc.js";import{a as _,i as v}from"./dist-wK15YRiu.js";import{t as y}from"./switch-CPd0R3ri.js";import{i as b,n as x,r as S,t as C}from"./tabs-DzjvuMEX.js";import{$n as w,At as T,Bn as E,Ct as D,F as ee,Ft as O,Ht as k,Jn as te,Mt as ne,Nt as re,Pt as ie,Qn as ae,R as oe,Tt as A,Un as se,Ut as j,V as ce,Vn as M,Vt as le,Wt as ue,_ as N,b as de,cr as fe,f as pe,g as me,h as P,ht as he,i as ge,jt as _e,k as ve,m as ye,p as be,pr as xe,q as Se,ur as Ce,v as we,vt as Te,w as Ee,x as F,xt as De,y as Oe,yt as ke,z as Ae,zn as I}from"./index-B4FdO6Vk.js";import{t as L}from"./badge-CC1v3nk4.js";import{n as je,r as Me,t as R}from"./lib-B9z0w3j9.js";import{a as Ne,i as z,n as Pe,o as Fe,r as Ie,t as Le}from"./table-QG2rKYu8.js";import{t as Re}from"./marked.esm-Ba5AUJng.js";var ze=te(`book-open-text`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M16 12h2`,key:`7q9ll5`}],[`path`,{d:`M16 8h2`,key:`msurwy`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}],[`path`,{d:`M6 12h2`,key:`32wvfc`}],[`path`,{d:`M6 8h2`,key:`30oboj`}]]),Be=te(`file-plus`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M9 15h6`,key:`cctwl0`}],[`path`,{d:`M12 18v-6`,key:`17g6i2`}]]),B=e(xe(),1),V=ae();function H({className:e,...t}){return(0,V.jsx)(`section`,{"data-config-section-shell":!0,className:ue(`border border-border bg-transparent rounded-none shadow-none`,e),...t})}function U({className:e,...t}){return(0,V.jsx)(`header`,{className:ue(`border-b border-border px-5 py-4`,e),...t})}function W({className:e,...t}){return(0,V.jsx)(`div`,{"data-config-section-body":!0,className:ue(`space-y-6 px-5 py-5`,e),...t})}function Ve({className:e,...t}){return(0,V.jsx)(`div`,{"data-config-line-notice":!0,className:ue(`border border-border bg-transparent rounded-none px-4 py-3 text-sm text-muted-foreground`,e),...t})}function G(e,t){let n=e.trim(),r=t.errorMessage??He(t);if(n===``)return t.allowEmpty?{value:void 0,error:null}:{value:void 0,error:r};if(!(t.integer?/^-?\d+$/:/^-?(?:\d+|\d*\.\d+)$/).test(n))return{value:void 0,error:r};let i=Number(n);return!Number.isFinite(i)||t.integer&&!Number.isSafeInteger(i)||t.min!==void 0&&i<t.min||t.max!==void 0&&i>t.max?{value:void 0,error:r}:{value:i,error:null}}function He(e){let t=e.integer?`an integer`:`a number`;return e.min!==void 0&&e.max!==void 0?`${e.label} must be ${t} between ${e.min} and ${e.max}`:e.min===void 0?e.max===void 0?`${e.label} must be ${t}`:`${e.label} must be ${t} less than or equal to ${e.max}`:`${e.label} must be ${t} greater than or equal to ${e.min}`}var Ue=Object.fromEntries([{value:`openai-compatible`,label:`OpenAI-compatible`},{value:`anthropic-compatible`,label:`Anthropic-compatible`},{value:`gemini`,label:`Gemini`}].map(e=>[e.value,e.label])),We=new Set([`openai-compatible`,`anthropic-compatible`]),Ge=`Enter the exact endpoint base URL. agent-qa will not append paths.`,Ke=`Testing without a saved credential.`,qe=`Save a Gemini API key for this config before testing.`;function Je(){return[{id:`openai-compatible`,label:`OpenAI-compatible`,auth:{kind:`api-key`,credentialTypes:[`api-key`],optional:!0},modelAdapter:`openai-responses`},{id:`anthropic-compatible`,label:`Anthropic-compatible`,auth:{kind:`api-key`,credentialTypes:[`api-key`,`bearer-token`],optional:!0},modelAdapter:`anthropic-messages`},{id:`gemini`,label:`Gemini`,auth:{kind:`api-key`,credentialTypes:[`api-key`]}}]}function K(e=``,t=``){return{id:crypto.randomUUID(),key:e,value:t}}function Ye(e,t=[]){return t.find(t=>t.id===e)?.label??Ue[e]??e}function Xe(e){if(e===null)return null;let t=Date.now();if(e<t)return`Expired`;let n=e-t,r=Math.floor(n/(1e3*60*60)),i=Math.floor(n%(1e3*60*60)/(1e3*60));return r>24?`Expires in ${Math.floor(r/24)}d`:r>0?`Expires in ${r}h ${i}m`:`Expires in ${i}m`}function Ze(e){return e.type===`oauth`?`OAuth connected`:e.type===`bearer`||e.type===`bearer-token`?`Saved bearer token`:`Saved API key`}function Qe(e,t,n){return e.configName===t?e.type===`oauth`?e.provider===n:e.type===`bearer`||e.type===`bearer-token`?n===`anthropic-compatible`&&e.provider===`anthropic-compatible`:e.provider===n:!1}function $e(e,t){return e.find(e=>Qe(e,t.name,t.provider))}function et(e){return We.has(e.provider)?`No credential`:`Missing credential`}function tt(e){let t={};for(let n of e){let e=n.key.trim(),r=n.value.trim();!e&&!r||e&&(t[e]=r)}return Object.keys(t).length>0?t:void 0}function nt(e){let t=new Map;for(let n of e){let e=n.key.trim().toLowerCase();e&&t.set(e,(t.get(e)??0)+1)}return new Set([...t.entries()].filter(([,e])=>e>1).map(([e])=>e))}function rt(e){return e.error===`missing_credential`&&e.message?e.message:e.error===`auth_error`?`Authentication failed. Check the saved credential for this config.`:e.error===`model_not_found`?`Model not found. Check the model name.`:e.error===`network_error`?`Network error. Check the exact base URL and try again.`:e.error===`invalid_request`&&e.message?`Connection failed. ${e.message}`:e.message?e.message.startsWith(`Connection failed.`)?e.message:`Connection failed. ${e.message}`:`Connection failed. Provider returned an error.`}function it({config:e,onConfigChange:t}){let n=e.use?.llm??null,[r,i]=(0,B.useState)([]),[a,o]=(0,B.useState)([]),[s,c]=(0,B.useState)(Je()),[l,u]=(0,B.useState)(!0),[m,g]=(0,B.useState)(!1),[_,v]=(0,B.useState)(null),[y,b]=(0,B.useState)(null);(0,B.useEffect)(()=>{async function t(){try{u(!0),i((e?.registry??{}).llms??[]);let[t,n]=await Promise.all([Ae(),Se().catch(()=>({providers:Je()}))]);o(t.credentials??[]),c(n.providers.length?n.providers:Je())}catch{T.error(`Failed to load LLM configuration. Refresh and try again.`)}finally{u(!1)}}t()},[e]);async function x(){o((await Ae()).credentials??[])}async function S(e){if(e===n){T.error(`Cannot delete the active default configuration. Switch the default in Execution Defaults first.`);return}let a=r.filter(t=>t.name!==e),o=r;i(a);try{await A({"registry.llms":a}),T.success(`Configuration ${e} deleted`),t()}catch{i(o),T.error(`Failed to delete configuration`)}}async function C(e){let n=_===null?[...r,e]:r.map(t=>t.name===e.name?e:t);try{await A({"registry.llms":n}),i(n),T.success(`Changes saved`),g(!1),v(null),t(),await x()}catch{T.error(`Failed to save configuration. Check the fields and try again.`)}}function w(e){let t=$e(a,e);if(!t)return(0,V.jsx)(L,{variant:`secondary`,children:et(e)});let n=Xe(t.expires),r=t.expires!==null&&t.expires<Date.now();return(0,V.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-1.5`,children:[(0,V.jsx)(L,{variant:`secondary`,children:Ze(t)}),n&&(0,V.jsx)(L,{variant:r?`destructive`:`outline`,className:`text-xs`,children:n})]})}let E=je({data:r,columns:(0,B.useMemo)(()=>[{accessorKey:`name`,header:`Name`,size:140,cell:({row:e})=>(0,V.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`max-w-[220px] truncate font-mono`,children:e.original.name}),e.original.name===n?(0,V.jsx)(L,{variant:`outline`,className:`text-[11px]`,children:`Default`}):null]})},{accessorKey:`provider`,header:`Provider`,size:160,cell:({row:e})=>(0,V.jsx)(`span`,{className:`block min-w-0 max-w-[220px] truncate`,children:Ye(e.original.provider,s)})},{accessorKey:`model`,header:`Model`,cell:({row:e})=>(0,V.jsx)(`span`,{className:`block min-w-0 max-w-[280px] truncate`,children:e.original.model})},{id:`credential`,header:`Credential`,cell:({row:e})=>w(e.original)},{id:`actions`,header:``,size:80,cell:({row:e})=>(0,V.jsxs)(`div`,{className:`flex items-center justify-end gap-1`,children:[(0,V.jsx)(j,{variant:`ghost`,size:`sm`,className:`h-8 w-8 p-0 text-muted-foreground hover:text-foreground`,onClick:t=>{t.stopPropagation(),v(e.original),g(!0)},title:`Edit configuration`,"aria-label":`Edit configuration`,children:(0,V.jsx)(d,{className:`size-4`})}),(0,V.jsx)(j,{variant:`ghost`,size:`sm`,className:`h-8 w-8 p-0 text-muted-foreground hover:text-destructive`,onClick:t=>{t.stopPropagation(),e.original.name!==n&&b(e.original.name)},title:e.original.name===n?`Switch the default in Execution Defaults before deleting`:`Delete configuration`,"aria-label":`Delete configuration`,disabled:e.original.name===n,children:(0,V.jsx)(h,{className:`size-4`})})]})}],[n,a,s]),getCoreRowModel:Me()});return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(H,{children:[(0,V.jsxs)(U,{children:[(0,V.jsx)(`h2`,{className:`text-base font-semibold`,children:`LLM Configurations`}),(0,V.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Named model configurations for test runs. Choose the active default in Use / Execution Defaults.`})]}),(0,V.jsx)(W,{children:l?(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsx)(O,{className:`h-10 w-full rounded-none bg-muted`}),(0,V.jsx)(O,{className:`h-10 w-full rounded-none bg-muted`}),(0,V.jsx)(O,{className:`h-10 w-full rounded-none bg-muted`})]}):r.length===0?(0,V.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-12 text-center`,children:[(0,V.jsx)(p,{className:`size-10 text-muted-foreground`}),(0,V.jsx)(`h3`,{className:`mt-4 text-lg font-semibold`,children:`No LLM configurations`}),(0,V.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:`Add an LLM configuration to start running tests.`}),(0,V.jsxs)(j,{className:`mt-4`,onClick:()=>{v(null),g(!0)},children:[(0,V.jsx)(f,{className:`size-4`}),`Add Configuration`]})]}):(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsx)(`div`,{className:`flex justify-end`,children:(0,V.jsxs)(j,{size:`sm`,onClick:()=>{v(null),g(!0)},children:[(0,V.jsx)(f,{className:`size-4`}),`Add Configuration`]})}),(0,V.jsxs)(Le,{children:[(0,V.jsx)(Ne,{children:E.getHeaderGroups().map(e=>(0,V.jsx)(Fe,{children:e.headers.map(e=>(0,V.jsx)(z,{style:e.column.getSize()===150?void 0:{width:e.column.getSize()},className:`min-w-0`,children:e.isPlaceholder?null:R(e.column.columnDef.header,e.getContext())},e.id))},e.id))}),(0,V.jsx)(Pe,{children:E.getRowModel().rows.map(e=>(0,V.jsx)(Fe,{children:e.getVisibleCells().map(e=>(0,V.jsx)(Ie,{className:`min-w-0`,children:R(e.column.columnDef.cell,e.getContext())},e.id))},e.id))})]})]})})]}),(0,V.jsx)(at,{open:m,onOpenChange:e=>{g(e),e||v(null)},config:_,existingNames:r.map(e=>e.name),onSave:C,onAuthChange:x,authCredentials:a,providerMetadata:s}),(0,V.jsx)(pe,{open:y!==null,onOpenChange:e=>{e||b(null)},children:(0,V.jsxs)(be,{children:[(0,V.jsxs)(me,{children:[(0,V.jsx)(N,{children:`Delete Configuration`}),(0,V.jsxs)(ye,{children:[`Delete `,(0,V.jsx)(`span`,{className:`font-mono font-semibold`,children:y}),`? This action cannot be undone.`]})]}),(0,V.jsxs)(P,{children:[(0,V.jsx)(j,{variant:`outline`,onClick:()=>b(null),children:`Keep Configuration`}),(0,V.jsx)(j,{variant:`destructive`,onClick:()=>{y&&(S(y),b(null))},children:`Delete Configuration`})]})]})})]})}function at({open:e,onOpenChange:t,config:a,existingNames:u,onSave:d,onAuthChange:p,authCredentials:m,providerMetadata:g}){let v=a!==null,[y,b]=(0,B.useState)(``),[x,S]=(0,B.useState)(`openai-compatible`),[C,w]=(0,B.useState)(``),[D,O]=(0,B.useState)(``),[te,ae]=(0,B.useState)([]),[oe,A]=(0,B.useState)(`api-key`),[ce,M]=(0,B.useState)(``),[ue,de]=(0,B.useState)(``),[fe,ge]=(0,B.useState)(``),[xe,Se]=(0,B.useState)(``),[Ce,we]=(0,B.useState)(!1),[Ee,F]=(0,B.useState)(!1),[Oe,Ae]=(0,B.useState)(null),[je,Me]=(0,B.useState)(!1),[R,Ne]=(0,B.useState)(!1),[z,Pe]=(0,B.useState)(null),[Fe,Ie]=(0,B.useState)(``),[Le,Re]=(0,B.useState)(``),[ze,Be]=(0,B.useState)(!1),[H,U]=(0,B.useState)(null),W=g.length?g:Je(),Ve=(0,B.useMemo)(()=>{let e=W.map(e=>({value:e.id,label:e.label}));return x&&!e.some(e=>e.value===x)&&e.push({value:x,label:Ye(x,W)}),e},[W,x]),He=W.find(e=>e.id===x),Ue=m.some(e=>Qe(e,y,x)),$e=We.has(x),et=x===`anthropic-compatible`,it=$e,at=He?.auth.kind===`api-key`,ot=nt(te),st=ot.size>0;(0,B.useEffect)(()=>{if(e)if(Pe(null),Ie(``),Re(``),M(``),Se(``),Ae(null),U(null),a){let e=a.provider||`openai-compatible`;b(a.name),S(e),w(a.model),O(a.baseURL??``),ae(e===`anthropic-compatible`?Object.entries(a.providerHeaders??{}).map(([e,t])=>K(e,t)).concat(Object.keys(a.providerHeaders??{}).length===0?[K()]:[]):[]),A(e===`anthropic-compatible`?`bearer-token`:`api-key`),de(a.screenshotSize??``),ge(a.effectiveResolution==null?``:String(a.effectiveResolution))}else{let e=g.find(e=>e.id===`openai-compatible`)?.id??g[0]?.id??`openai-compatible`;b(``),S(e),w(``),O(``),ae([]),A(`api-key`),de(``),ge(``)}},[e,a,g]);function ct(e){return e?/^[a-z0-9][a-z0-9-]*$/.test(e)?u.filter(e=>e!==a?.name).includes(e)?`A configuration with this name already exists`:``:`Name must be lowercase letters, numbers, and hyphens, starting with a letter or number`:``}function lt(e){S(e),Pe(null),Re(``),Ae(null),M(``),Se(``),A(e===`anthropic-compatible`?`bearer-token`:`api-key`),O(``),ae(e===`anthropic-compatible`?[K()]:[])}function ut(e,t,n){ae(r=>r.map(r=>r.id===e?{...r,[t]:n}:r))}async function dt(){if(st){T.error(`Duplicate provider header names are not allowed`);return}Ne(!0),Pe(null);try{let e=et?tt(te):void 0;Pe(await De({provider:x,model:C,...D.trim()?{baseURL:D.trim()}:{},...e?{providerHeaders:e}:{},configName:y||void 0}))}catch{Pe({success:!1,error:`network_error`,message:`Network error. Check the exact base URL and try again.`})}finally{Ne(!1)}}async function ft(){let e=ct(y);if(e){Ie(e);return}if(!y||!x||!C)return;if(it&&D.trim()===``){Re(`Base URL is required for compatible providers.`);return}if(st){T.error(`Duplicate provider header names are not allowed`);return}let t=G(fe,{label:`Effective resolution`,min:1,integer:!0,allowEmpty:!0,errorMessage:`Effective resolution must be a positive integer`});if(t.error){T.error(t.error);return}Me(!0);try{let e=et?tt(te):void 0;await d({name:y,provider:x,model:C,baseURL:D.trim()||void 0,...e?{providerHeaders:e}:{},screenshotSize:ue||void 0,effectiveResolution:t.value})}catch(e){T.error(e instanceof Error?e.message:`Failed to save configuration`)}finally{Me(!1)}}async function pt(){if(!(!ce.trim()||!y||!at)){Be(!0);try{let e=et?oe:`api-key`;await Te(y,x,e,ce.trim()),T.success(e===`bearer-token`?`Bearer token saved`:`API key saved`),M(``),await p()}catch{T.error(`Failed to save credential`)}finally{Be(!1)}}}async function mt(){if(H)try{await ve(H),await p(),T.success(`Credential deleted`)}catch{T.error(`Failed to delete credential`)}finally{U(null)}}let ht=y.trim()!==``&&C.trim()!==``&&!Fe;function gt(){return at?(0,V.jsxs)(`div`,{className:`space-y-3`,children:[$e&&(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Credentials are optional for this config. Unauthenticated endpoints can still be tested.`}),x===`gemini`&&(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:qe}),et&&(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(_,{children:`Credential Type`}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Save an API key or Bearer token for this config.`}),(0,V.jsxs)(s,{value:oe,onValueChange:e=>A(e),children:[(0,V.jsx)(i,{className:`w-full`,children:(0,V.jsx)(o,{})}),(0,V.jsxs)(r,{children:[(0,V.jsx)(n,{value:`api-key`,children:`API key`}),(0,V.jsx)(n,{value:`bearer-token`,children:`Bearer token`})]})]})]}),(0,V.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,V.jsx)(k,{type:`password`,placeholder:`secret-value`,value:ce,onChange:e=>M(e.target.value),className:`min-w-[180px] flex-1`}),(0,V.jsxs)(j,{size:`sm`,onClick:pt,disabled:ze||!ce.trim()||!y||!!Fe,children:[ze?(0,V.jsx)(I,{className:`size-4 animate-spin`}):null,`Save Credential`]})]})]}):null}function _t(){if(He?.auth.kind!==`oauth-plugin`)return null;let e=Oe?.provider===x?Oe:null,t=He.label,n=He.auth.buttonLabel??`Login with ${t}`;async function r(){F(!0),Se(``);try{let e=await ke(x,y);if(Ae({provider:x,sessionId:e.sessionId,mode:e.mode}),window.open(e.authorizeUrl,`_blank`),e.mode===`browser-poll`){let n=window.setInterval(async()=>{try{let r=await he(x,e.sessionId);r.status===`completed`?(window.clearInterval(n),T.success(`${t} authenticated`),F(!1),Ae(null),await p()):r.status===`error`&&(window.clearInterval(n),T.error(r.error||`${t} authentication failed`),F(!1))}catch{}},2e3);window.setTimeout(()=>{window.clearInterval(n),F(!1)},300*1e3)}else F(!1)}catch{T.error(`Failed to start ${t} authentication`),F(!1)}}return(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Login with `,t,` for this config before testing.`]}),He.auth.mode===`manual-code`?(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,V.jsx)(_,{className:`text-sm`,children:`Open authorization page`}),(0,V.jsxs)(j,{variant:`outline`,size:`sm`,disabled:Ee||!y||!!Fe,onClick:r,children:[(0,V.jsx)(l,{className:`size-4`}),n]})]}),(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,V.jsx)(_,{className:`text-sm`,children:`Paste authorization code`}),(0,V.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,V.jsx)(k,{type:`password`,placeholder:`authorization-code`,value:xe,onChange:e=>Se(e.target.value),disabled:!e,className:`min-w-[180px] flex-1`}),(0,V.jsxs)(j,{size:`sm`,disabled:!xe.trim()||!e||Ce,onClick:async()=>{if(e){we(!0);try{await ee(x,e.sessionId,xe.trim()),T.success(`${t} authenticated`),Se(``),Ae(null),await p()}catch{T.error(`Failed to exchange code`)}finally{we(!1)}}},children:[Ce?(0,V.jsx)(I,{className:`size-4 animate-spin`}):null,`Connect`]})]})]})]}):(0,V.jsx)(`div`,{className:`space-y-3`,children:(0,V.jsxs)(j,{variant:`outline`,size:`sm`,disabled:Ee||!y||!!Fe,onClick:r,children:[Ee?(0,V.jsx)(I,{className:`size-4 animate-spin`}):(0,V.jsx)(l,{className:`size-4`}),Ee?`Authenticating...`:n]})})]})}function vt(){let e=m.filter(e=>e.configName===y);return e.length===0?null:(0,V.jsx)(`div`,{className:`space-y-2`,children:e.map(e=>{let t=Xe(e.expires),n=e.expires!==null&&e.expires<Date.now();return(0,V.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-3 rounded-none border border-border bg-transparent p-3 text-sm`,children:[(0,V.jsx)(L,{variant:`secondary`,className:`text-xs`,children:Ze(e)}),(0,V.jsx)(`span`,{className:`min-w-0 break-words font-medium`,children:Ye(e.provider,W)}),t&&(0,V.jsx)(L,{variant:n?`destructive`:`outline`,className:`text-xs`,children:t}),(0,V.jsx)(j,{variant:`ghost`,size:`sm`,className:`ml-auto h-8 w-8 p-0 text-destructive hover:text-destructive`,onClick:()=>U(e.configName),"aria-label":`Delete credential`,title:`Delete credential`,children:(0,V.jsx)(h,{className:`size-4`})})]},`${e.configName}-${e.type}-${e.provider}`)})})}function q(){return R?(0,V.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,role:`status`,children:[(0,V.jsx)(I,{className:`size-4 animate-spin`}),(0,V.jsx)(`span`,{children:`Testing connection...`})]}):z?z.success?z.unauthenticated?(0,V.jsx)(`div`,{className:`text-sm text-muted-foreground`,role:`status`,children:z.authMessage||z.message||Ke}):(0,V.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-success`,role:`status`,children:[(0,V.jsx)(se,{className:`size-4`}),(0,V.jsx)(`span`,{children:`Connection successful`}),z.responseTime!=null&&(0,V.jsxs)(`span`,{className:`text-muted-foreground`,children:[z.responseTime,`ms`]})]}):(0,V.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-destructive`,role:`alert`,children:[(0,V.jsx)(c,{className:`size-4`}),(0,V.jsx)(`span`,{children:rt(z)})]}):null}return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(pe,{open:e,onOpenChange:t,children:(0,V.jsxs)(be,{className:`sm:max-w-2xl max-h-[85vh] overflow-y-auto`,children:[(0,V.jsxs)(me,{children:[(0,V.jsx)(N,{children:v?`Edit ${a.name}`:`Add Configuration`}),(0,V.jsx)(ye,{children:v?`Update provider, model, and credentials for this configuration.`:`Create a named LLM configuration with its own provider, model, and credentials.`})]}),(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(_,{htmlFor:`config-name`,children:`Name`}),(0,V.jsx)(k,{id:`config-name`,placeholder:`e.g., claude-fast, gpt-cheap`,value:y,onChange:e=>{b(e.target.value),Fe&&Ie(``)},onBlur:()=>{y&&Ie(ct(y))},disabled:v,className:v?`bg-muted`:``,"aria-describedby":Fe?`name-error`:void 0}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Lowercase alphanumeric and hyphens (e.g., claude-fast, gpt-cheap)`}),Fe&&(0,V.jsx)(`p`,{id:`name-error`,className:`text-sm text-destructive`,children:Fe})]}),(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(_,{children:`Provider`}),(0,V.jsxs)(s,{value:x,onValueChange:lt,children:[(0,V.jsx)(i,{className:`w-full`,children:(0,V.jsx)(o,{})}),(0,V.jsx)(r,{children:Ve.map(e=>(0,V.jsx)(n,{value:e.value,children:e.label},e.value))})]})]}),(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(_,{htmlFor:`config-model`,children:`Model`}),(0,V.jsx)(k,{id:`config-model`,placeholder:`model-name`,value:C,onChange:e=>w(e.target.value)})]}),it&&(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,V.jsx)(_,{htmlFor:`config-base-url`,children:`Base URL`}),(0,V.jsx)(re,{children:(0,V.jsxs)(_e,{children:[(0,V.jsx)(ie,{asChild:!0,children:(0,V.jsx)(`button`,{type:`button`,"aria-label":`Compatible endpoint help`,className:`inline-flex size-5 items-center justify-center text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring cursor-help`,children:(0,V.jsx)(E,{className:`size-3.5`})})}),(0,V.jsx)(ne,{className:`max-w-[250px]`,children:Ge})]})})]}),(0,V.jsx)(k,{id:`config-base-url`,placeholder:x===`openai-compatible`?`https://openrouter.ai/api/v1`:`https://anthropic-proxy.example/messages`,value:D,onChange:e=>{O(e.target.value),Le&&Re(``)},"aria-invalid":Le?!0:void 0,"aria-describedby":Le?`base-url-error`:void 0}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:Ge}),Le&&(0,V.jsx)(`p`,{id:`base-url-error`,className:`text-sm text-destructive`,children:Le})]}),et&&(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(_,{children:`Provider Headers`}),(0,V.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Optional non-secret headers sent with this Anthropic-compatible endpoint.`})]}),(0,V.jsx)(`div`,{className:`space-y-2`,children:te.map(e=>{let t=e.key.trim().toLowerCase(),n=t!==``&&ot.has(t);return(0,V.jsxs)(`div`,{className:`space-y-1`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,V.jsx)(k,{placeholder:`header-name`,value:e.key,onChange:t=>ut(e.id,`key`,t.target.value),className:`min-w-[160px] flex-1`}),(0,V.jsx)(k,{placeholder:`header-value`,value:e.value,onChange:t=>ut(e.id,`value`,t.target.value),className:`min-w-[180px] flex-1`}),(0,V.jsx)(j,{type:`button`,variant:`ghost`,size:`sm`,className:`h-8 w-8 p-0 text-muted-foreground hover:text-destructive`,"aria-label":`Remove header`,title:`Remove header`,onClick:()=>ae(t=>t.filter(t=>t.id!==e.id)),disabled:te.length===1&&!e.key&&!e.value,children:(0,V.jsx)(h,{className:`size-4`})})]}),n&&(0,V.jsx)(`p`,{className:`text-xs text-destructive`,children:`Duplicate header names are not allowed.`})]},e.id)})}),(0,V.jsxs)(j,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>ae(e=>[...e,K()]),children:[(0,V.jsx)(f,{className:`size-4`}),`Add Header`]})]}),(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(_,{children:`Screenshot Size`}),(0,V.jsx)(k,{placeholder:`e.g., "1m", "512k" (empty = no compression)`,value:ue,onChange:e=>de(e.target.value)}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Maximum screenshot size for this model (e.g., "1m", "512k"). Empty = no compression.`})]}),(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(_,{htmlFor:`config-effective-resolution`,children:`Effective Resolution`}),(0,V.jsx)(k,{id:`config-effective-resolution`,type:`number`,min:1,step:1,placeholder:`e.g., 1568`,value:fe,onChange:e=>ge(e.target.value)}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Maximum effective screenshot edge sent to the model. Use this with screenshot compression to control token cost.`})]}),(0,V.jsx)(le,{}),(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h3`,{className:`text-base font-semibold`,children:`Credentials`}),(0,V.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Saved credentials are keyed by this named configuration.`})]}),gt(),_t(),vt()]})]}),(0,V.jsxs)(P,{children:[(0,V.jsx)(j,{variant:`outline`,onClick:dt,disabled:R||!x||!C||st,children:`Test Connection`}),(0,V.jsxs)(j,{onClick:ft,disabled:je||!ht||st,children:[je&&(0,V.jsx)(I,{className:`size-4 animate-spin`}),`Save Changes`]})]}),$e&&!Ue&&!R&&!z&&(0,V.jsx)(`div`,{className:`text-sm text-muted-foreground`,role:`status`,children:Ke}),q()]})}),(0,V.jsx)(pe,{open:H!==null,onOpenChange:e=>{e||U(null)},children:(0,V.jsxs)(be,{children:[(0,V.jsxs)(me,{children:[(0,V.jsx)(N,{children:`Delete Credential`}),(0,V.jsxs)(ye,{children:[`Delete saved credential for `,H,`? Tests using this config may fail until a new credential is saved.`]})]}),(0,V.jsxs)(P,{children:[(0,V.jsx)(j,{variant:`outline`,onClick:()=>U(null),children:`Keep Credential`}),(0,V.jsx)(j,{variant:`destructive`,onClick:mt,children:`Delete Credential`})]})]})})]})}function ot({config:e,onConfigChange:t}){let n=e.use?.timeout??{},[r,i]=(0,B.useState)(n.step??`30s`),[a,o]=(0,B.useState)(n.test??`10m`),[s,c]=(0,B.useState)(n.navigation??`10s`),[l,u]=(0,B.useState)(!1);async function d(){u(!0);try{await A({"use.timeout":{step:r,test:a,navigation:s}}),t(),T.success(`Configuration saved`)}catch{T.error(`Failed to save configuration`)}finally{u(!1)}}return(0,V.jsxs)(H,{children:[(0,V.jsxs)(U,{children:[(0,V.jsx)(`h2`,{className:`text-base font-semibold`,children:`Timeout`}),(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Configure timeout limits for test execution`})]}),(0,V.jsxs)(W,{children:[(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(_,{htmlFor:`timeout-step`,children:`Step Timeout`}),(0,V.jsx)(k,{id:`timeout-step`,type:`text`,placeholder:`e.g., "30s", "5m"`,value:r,onChange:e=>i(e.target.value)}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Max time for a single test step (e.g., "30s", "5m")`})]}),(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(_,{htmlFor:`timeout-test`,children:`Test Timeout`}),(0,V.jsx)(k,{id:`timeout-test`,type:`text`,placeholder:`e.g., "10m", "1h"`,value:a,onChange:e=>o(e.target.value)}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Max time for an entire test (e.g., "10m", "1h")`})]}),(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(_,{htmlFor:`timeout-navigation`,children:`Navigation Timeout`}),(0,V.jsx)(k,{id:`timeout-navigation`,type:`text`,placeholder:`e.g., "10s", "30s"`,value:s,onChange:e=>c(e.target.value)}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Max time for page navigation (e.g., "10s", "30s")`})]}),(0,V.jsx)(j,{size:`sm`,onClick:d,disabled:l,children:l?(0,V.jsx)(I,{className:`size-4 animate-spin`}):`Save Changes`})]})]})}function st({config:e,onConfigChange:t}){let n=e.use?.healing??{},[r,i]=(0,B.useState)(String(n.maxAttempts??3)),[a,o]=(0,B.useState)(!1);async function s(){let e=G(r,{label:`Max healing attempts`,min:1,integer:!0});if(e.error){T.error(e.error);return}o(!0);try{await A({"use.healing":{maxAttempts:e.value}}),t(),T.success(`Configuration saved`)}catch{T.error(`Failed to save configuration`)}finally{o(!1)}}return(0,V.jsxs)(H,{children:[(0,V.jsxs)(U,{children:[(0,V.jsx)(`h2`,{className:`text-base font-semibold`,children:`Healing`}),(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Configure self-healing behavior for failing test steps`})]}),(0,V.jsxs)(W,{children:[(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(_,{htmlFor:`healing-max-attempts`,children:`Max Healing Attempts`}),(0,V.jsx)(k,{id:`healing-max-attempts`,type:`number`,min:1,step:1,value:r,onChange:e=>i(e.target.value)})]}),(0,V.jsx)(j,{size:`sm`,onClick:s,disabled:a,children:a?(0,V.jsx)(I,{className:`size-4 animate-spin`}):`Save Changes`})]})]})}function ct({config:e,onConfigChange:t}){let n=e.services?.cache??{},[r,i]=(0,B.useState)(n.dir??``),[a,o]=(0,B.useState)(n.ttl??``),[s,c]=(0,B.useState)(!1);async function l(){c(!0);try{await A({"services.cache":{dir:r,ttl:a}}),t(),T.success(`Configuration saved`)}catch{T.error(`Failed to save configuration`)}finally{c(!1)}}return(0,V.jsxs)(H,{children:[(0,V.jsxs)(U,{children:[(0,V.jsx)(`h2`,{className:`text-base font-semibold`,children:`Cache`}),(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Configure action cache directory and expiration`})]}),(0,V.jsxs)(W,{children:[(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(_,{htmlFor:`cache-dir`,children:`Cache Directory`}),(0,V.jsx)(k,{id:`cache-dir`,placeholder:`.agent-qa/cache`,value:r,onChange:e=>i(e.target.value)})]}),(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(_,{htmlFor:`cache-ttl`,children:`TTL`}),(0,V.jsx)(k,{id:`cache-ttl`,placeholder:`7d`,value:a,onChange:e=>o(e.target.value)}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Cache time-to-live — human-readable duration (e.g., "7d", "24h", "30m")`})]}),(0,V.jsx)(j,{size:`sm`,onClick:l,disabled:s,children:s?(0,V.jsx)(I,{className:`size-4 animate-spin`}):`Save Changes`})]})]})}function lt({config:e,onConfigChange:t}){let[a,c]=(0,B.useState)((e.services?.logging??{}).level??`info`),[l,u]=(0,B.useState)(!1);async function d(){u(!0);try{await A({"services.logging":{level:a}}),t(),T.success(`Changes saved`)}catch{T.error(`Failed to save configuration`)}finally{u(!1)}}return(0,V.jsxs)(H,{children:[(0,V.jsxs)(U,{children:[(0,V.jsx)(`h2`,{className:`text-base font-semibold`,children:`Logging`}),(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Configure service log verbosity.`})]}),(0,V.jsxs)(W,{children:[(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(_,{htmlFor:`logging-level`,children:`Log Level`}),(0,V.jsxs)(s,{value:a,onValueChange:c,children:[(0,V.jsx)(i,{id:`logging-level`,children:(0,V.jsx)(o,{})}),(0,V.jsxs)(r,{children:[(0,V.jsx)(n,{value:`silent`,children:`Silent`}),(0,V.jsx)(n,{value:`error`,children:`Error`}),(0,V.jsx)(n,{value:`warn`,children:`Warn`}),(0,V.jsx)(n,{value:`info`,children:`Info`}),(0,V.jsx)(n,{value:`debug`,children:`Debug`})]})]})]}),(0,V.jsx)(j,{size:`sm`,onClick:d,disabled:l,children:l?(0,V.jsx)(I,{className:`size-4 animate-spin`}):`Save Changes`})]})]})}function ut({config:e,onConfigChange:t}){let a=e.use?.browser??{},[c,l]=(0,B.useState)(a.name??`chromium`),[u,d]=(0,B.useState)(a.headless??!0),f=a.viewport??{width:1280,height:720},[p,m]=(0,B.useState)(String(f.width)),[h,g]=(0,B.useState)(String(f.height)),[v,b]=(0,B.useState)(!1);async function x(){let e=G(p,{label:`Viewport width`,min:1,integer:!0});if(e.error){T.error(e.error);return}let n=G(h,{label:`Viewport height`,min:1,integer:!0});if(n.error){T.error(n.error);return}b(!0);try{await A({"use.browser":{name:c,headless:u,viewport:{width:e.value,height:n.value}}}),t(),T.success(`Configuration saved`)}catch{T.error(`Failed to save configuration`)}finally{b(!1)}}return(0,V.jsxs)(H,{children:[(0,V.jsxs)(U,{children:[(0,V.jsx)(`h2`,{className:`text-base font-semibold`,children:`Browser`}),(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Configure default browser settings for web test execution`})]}),(0,V.jsxs)(W,{children:[(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(_,{htmlFor:`browser-name`,children:`Browser`}),(0,V.jsxs)(s,{value:c,onValueChange:l,children:[(0,V.jsx)(i,{id:`browser-name`,children:(0,V.jsx)(o,{})}),(0,V.jsxs)(r,{children:[(0,V.jsx)(n,{value:`chromium`,children:`Chromium`}),(0,V.jsx)(n,{value:`firefox`,children:`Firefox`}),(0,V.jsx)(n,{value:`webkit`,children:`WebKit`})]})]})]}),(0,V.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,V.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,V.jsx)(_,{htmlFor:`browser-headless`,children:`Headless`}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Run web browsers without a visible window.`})]}),(0,V.jsx)(y,{id:`browser-headless`,checked:u,onCheckedChange:d})]}),(0,V.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(_,{htmlFor:`browser-vw`,children:`Viewport Width`}),(0,V.jsx)(k,{id:`browser-vw`,type:`number`,min:1,step:1,value:p,onChange:e=>m(e.target.value)})]}),(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(_,{htmlFor:`browser-vh`,children:`Viewport Height`}),(0,V.jsx)(k,{id:`browser-vh`,type:`number`,min:1,step:1,value:h,onChange:e=>g(e.target.value)})]})]}),(0,V.jsx)(j,{size:`sm`,onClick:x,disabled:v,children:v?(0,V.jsx)(I,{className:`size-4 animate-spin`}):`Save Changes`})]})]})}function dt({config:e,onConfigChange:t}){let[n,r]=(0,B.useState)((e.services?.recording??{}).enabled??!1),[i,a]=(0,B.useState)(!1);async function o(){a(!0);try{await A({"services.recording":{enabled:n}}),t(),T.success(`Changes saved`)}catch{T.error(`Failed to save configuration`)}finally{a(!1)}}return(0,V.jsxs)(H,{children:[(0,V.jsxs)(U,{children:[(0,V.jsx)(`h2`,{className:`text-base font-semibold`,children:`Recording`}),(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Configure whether runtime recording is enabled by default.`})]}),(0,V.jsxs)(W,{children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,V.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,V.jsx)(_,{htmlFor:`recording-enabled`,children:`Enabled`}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Record video of test execution`})]}),(0,V.jsx)(y,{id:`recording-enabled`,checked:n,onCheckedChange:r})]}),(0,V.jsx)(j,{size:`sm`,onClick:o,disabled:i,children:i?(0,V.jsx)(I,{className:`size-4 animate-spin`}):`Save Changes`})]})]})}function ft({config:e,onConfigChange:t}){let a=e.services?.accessibility??{},[c,l]=(0,B.useState)(a.enabled??!1),[u,d]=(0,B.useState)(a.standard??`wcag2aa`),[f,p]=(0,B.useState)(a.runAfter??`test-end`),[m,h]=(0,B.useState)(a.failOnViolation??!1),[g,v]=(0,B.useState)(!1);async function b(){v(!0);try{await A({"services.accessibility":{enabled:c,standard:u,runAfter:f,failOnViolation:m}}),t(),T.success(`Configuration saved`)}catch{T.error(`Failed to save configuration`)}finally{v(!1)}}return(0,V.jsxs)(H,{children:[(0,V.jsxs)(U,{children:[(0,V.jsx)(`h2`,{className:`text-base font-semibold`,children:`Accessibility`}),(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Configure accessibility audit settings`})]}),(0,V.jsxs)(W,{children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,V.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,V.jsx)(_,{htmlFor:`a11y-enabled`,children:`Enabled`}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Run accessibility checks during tests`})]}),(0,V.jsx)(y,{id:`a11y-enabled`,checked:c,onCheckedChange:l})]}),(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(_,{htmlFor:`a11y-standard`,children:`Standard`}),(0,V.jsxs)(s,{value:u,onValueChange:d,children:[(0,V.jsx)(i,{id:`a11y-standard`,children:(0,V.jsx)(o,{})}),(0,V.jsxs)(r,{children:[(0,V.jsx)(n,{value:`wcag2a`,children:`WCAG 2.0 A`}),(0,V.jsx)(n,{value:`wcag2aa`,children:`WCAG 2.0 AA`}),(0,V.jsx)(n,{value:`wcag2aaa`,children:`WCAG 2.0 AAA`})]})]})]}),(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(_,{htmlFor:`a11y-run-after`,children:`Run After`}),(0,V.jsxs)(s,{value:f,onValueChange:p,children:[(0,V.jsx)(i,{id:`a11y-run-after`,children:(0,V.jsx)(o,{})}),(0,V.jsxs)(r,{children:[(0,V.jsx)(n,{value:`every-step`,children:`Every Step`}),(0,V.jsx)(n,{value:`navigation`,children:`Navigation`}),(0,V.jsx)(n,{value:`test-end`,children:`Test End`})]})]})]}),(0,V.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,V.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,V.jsx)(_,{htmlFor:`a11y-fail`,children:`Fail on Violation`}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Fail the test if violations are found`})]}),(0,V.jsx)(y,{id:`a11y-fail`,checked:m,onCheckedChange:h})]}),(0,V.jsx)(j,{size:`sm`,onClick:b,disabled:g,children:g?(0,V.jsx)(I,{className:`size-4 animate-spin`}):`Save Changes`})]})]})}function pt({config:e,onConfigChange:t}){let n=e.use?.planner??{},[r,i]=(0,B.useState)(String(n.maxSubActions??20)),[a,o]=(0,B.useState)(String(n.previousStepCount??5)),[s,c]=(0,B.useState)(!1);async function l(){let e=G(r,{label:`Max sub-actions`,min:1,integer:!0});if(e.error){T.error(e.error);return}let n=G(a,{label:`Previous step count`,min:0,integer:!0});if(n.error){T.error(n.error);return}c(!0);try{await A({"use.planner":{maxSubActions:e.value,previousStepCount:n.value}}),t(),T.success(`Configuration saved`)}catch{T.error(`Failed to save configuration`)}finally{c(!1)}}return(0,V.jsxs)(H,{children:[(0,V.jsxs)(U,{children:[(0,V.jsx)(`h2`,{className:`text-base font-semibold`,children:`Planner`}),(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Configure the AI planner observation and planning settings`})]}),(0,V.jsxs)(W,{children:[(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(_,{htmlFor:`planner-max-sub-actions`,children:`Max Sub-Actions`}),(0,V.jsx)(k,{id:`planner-max-sub-actions`,type:`number`,min:1,step:1,value:r,onChange:e=>i(e.target.value)}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Maximum sub-actions per step`})]}),(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(_,{htmlFor:`planner-prev-steps`,children:`Previous Step Count`}),(0,V.jsx)(k,{id:`planner-prev-steps`,type:`number`,min:0,step:1,value:a,onChange:e=>o(e.target.value)}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Number of previous steps included in planner context`})]}),(0,V.jsx)(j,{size:`sm`,onClick:l,disabled:s,children:s?(0,V.jsx)(I,{className:`size-4 animate-spin`}):`Save Changes`})]})]})}var{entries:mt,setPrototypeOf:ht,isFrozen:gt,getPrototypeOf:_t,getOwnPropertyDescriptor:vt}=Object,{freeze:q,seal:yt,create:bt}=Object,{apply:xt,construct:St}=typeof Reflect<`u`&&Reflect;q||=function(e){return e},yt||=function(e){return e},xt||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},St||=function(e){return new e(...[...arguments].slice(1))};var Ct=Z(Array.prototype.forEach),wt=Z(Array.prototype.lastIndexOf),Tt=Z(Array.prototype.pop),Et=Z(Array.prototype.push),Dt=Z(Array.prototype.splice),J=Array.isArray,Ot=Z(String.prototype.toLowerCase),kt=Z(String.prototype.toString),At=Z(String.prototype.match),jt=Z(String.prototype.replace),Mt=Z(String.prototype.indexOf),Nt=Z(String.prototype.trim),Pt=Z(Number.prototype.toString),Ft=Z(Boolean.prototype.toString),It=typeof BigInt>`u`?null:Z(BigInt.prototype.toString),Lt=typeof Symbol>`u`?null:Z(Symbol.prototype.toString),Y=Z(Object.prototype.hasOwnProperty),Rt=Z(Object.prototype.toString),X=Z(RegExp.prototype.test),zt=Bt(TypeError);function Z(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return xt(e,t,n)}}function Bt(e){return function(){return St(e,[...arguments])}}function Q(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ot;if(ht&&ht(e,null),!J(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(gt(t)||(t[r]=e),i=e)}e[i]=!0}return e}function Vt(e){for(let t=0;t<e.length;t++)Y(e,t)||(e[t]=null);return e}function $(e){let t=bt(null);for(let[n,r]of mt(e))Y(e,n)&&(J(r)?t[n]=Vt(r):r&&typeof r==`object`&&r.constructor===Object?t[n]=$(r):t[n]=r);return t}function Ht(e){switch(typeof e){case`string`:return e;case`number`:return Pt(e);case`boolean`:return Ft(e);case`bigint`:return It?It(e):`0`;case`symbol`:return Lt?Lt(e):`Symbol()`;case`undefined`:return Rt(e);case`function`:case`object`:{if(e===null)return Rt(e);let t=e,n=Ut(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:Rt(e)}return Rt(e)}default:return Rt(e)}}function Ut(e,t){for(;e!==null;){let n=vt(e,t);if(n){if(n.get)return Z(n.get);if(typeof n.value==`function`)return Z(n.value)}e=_t(e)}function n(){return null}return n}function Wt(e){try{return X(e,``),!0}catch{return!1}}var Gt=q(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),Kt=q(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),qt=q([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),Jt=q([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),Yt=q(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),Xt=q([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),Zt=q([`#text`]),Qt=q(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),$t=q(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),en=q(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),tn=q([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),nn=yt(/\{\{[\w\W]*|[\w\W]*\}\}/gm),rn=yt(/<%[\w\W]*|[\w\W]*%>/gm),an=yt(/\$\{[\w\W]*/gm),on=yt(/^data-[\-\w.\u00B7-\uFFFF]+$/),sn=yt(/^aria-[\-\w]+$/),cn=yt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ln=yt(/^(?:\w+script|data):/i),un=yt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),dn=yt(/^html$/i),fn=yt(/^[a-z][.\w]*(-[.\w]+)+$/i),pn=Object.freeze({__proto__:null,ARIA_ATTR:sn,ATTR_WHITESPACE:un,CUSTOM_ELEMENT:fn,DATA_ATTR:on,DOCTYPE_NAME:dn,ERB_EXPR:rn,IS_ALLOWED_URI:cn,IS_SCRIPT_OR_DATA:ln,MUSTACHE_EXPR:nn,TMPLIT_EXPR:an}),mn={element:1,text:3,progressingInstruction:7,comment:8,document:9},hn=function(){return typeof window>`u`?null:window},gn=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},_n=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function vn(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:hn(),t=e=>vn(e);if(t.version=`3.4.2`,t.removed=[],!e||!e.document||e.document.nodeType!==mn.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e,r=n,i=r.currentScript,{DocumentFragment:a,HTMLTemplateElement:o,Node:s,Element:c,NodeFilter:l,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:d,DOMParser:f,trustedTypes:p}=e,m=c.prototype,h=Ut(m,`cloneNode`),g=Ut(m,`remove`),_=Ut(m,`nextSibling`),v=Ut(m,`childNodes`),y=Ut(m,`parentNode`);if(typeof o==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let b,x=``,{implementation:S,createNodeIterator:C,createDocumentFragment:w,getElementsByTagName:T}=n,{importNode:E}=r,D=_n();t.isSupported=typeof mt==`function`&&typeof y==`function`&&S&&S.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:ee,ERB_EXPR:O,TMPLIT_EXPR:k,DATA_ATTR:te,ARIA_ATTR:ne,IS_SCRIPT_OR_DATA:re,ATTR_WHITESPACE:ie,CUSTOM_ELEMENT:ae}=pn,{IS_ALLOWED_URI:oe}=pn,A=null,se=Q({},[...Gt,...Kt,...qt,...Yt,...Zt]),j=null,ce=Q({},[...Qt,...$t,...en,...tn]),M=Object.seal(bt(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),le=null,ue=null,N=Object.seal(bt(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),de=!0,fe=!0,pe=!1,me=!0,P=!1,he=!0,ge=!1,_e=!1,ve=!1,ye=!1,be=!1,xe=!1,Se=!0,Ce=!1,we=`user-content-`,Te=!0,Ee=!1,F={},De=null,Oe=Q({},[`annotation-xml`,`audio`,`colgroup`,`desc`,`foreignobject`,`head`,`iframe`,`math`,`mi`,`mn`,`mo`,`ms`,`mtext`,`noembed`,`noframes`,`noscript`,`plaintext`,`script`,`style`,`svg`,`template`,`thead`,`title`,`video`,`xmp`]),ke=null,Ae=Q({},[`audio`,`video`,`img`,`source`,`image`,`track`]),I=null,L=Q({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),je=`http://www.w3.org/1998/Math/MathML`,Me=`http://www.w3.org/2000/svg`,R=`http://www.w3.org/1999/xhtml`,Ne=R,z=!1,Pe=null,Fe=Q({},[je,Me,R],kt),Ie=Q({},[`mi`,`mo`,`mn`,`ms`,`mtext`]),Le=Q({},[`annotation-xml`]),Re=Q({},[`title`,`style`,`font`,`a`,`script`]),ze=null,Be=[`application/xhtml+xml`,`text/html`],B=null,V=null,H=n.createElement(`form`),U=function(e){return e instanceof RegExp||e instanceof Function},W=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(V&&V===e)return;(!e||typeof e!=`object`)&&(e={}),e=$(e),ze=Be.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,B=ze===`application/xhtml+xml`?kt:Ot,A=Y(e,`ALLOWED_TAGS`)&&J(e.ALLOWED_TAGS)?Q({},e.ALLOWED_TAGS,B):se,j=Y(e,`ALLOWED_ATTR`)&&J(e.ALLOWED_ATTR)?Q({},e.ALLOWED_ATTR,B):ce,Pe=Y(e,`ALLOWED_NAMESPACES`)&&J(e.ALLOWED_NAMESPACES)?Q({},e.ALLOWED_NAMESPACES,kt):Fe,I=Y(e,`ADD_URI_SAFE_ATTR`)&&J(e.ADD_URI_SAFE_ATTR)?Q($(L),e.ADD_URI_SAFE_ATTR,B):L,ke=Y(e,`ADD_DATA_URI_TAGS`)&&J(e.ADD_DATA_URI_TAGS)?Q($(Ae),e.ADD_DATA_URI_TAGS,B):Ae,De=Y(e,`FORBID_CONTENTS`)&&J(e.FORBID_CONTENTS)?Q({},e.FORBID_CONTENTS,B):Oe,le=Y(e,`FORBID_TAGS`)&&J(e.FORBID_TAGS)?Q({},e.FORBID_TAGS,B):$({}),ue=Y(e,`FORBID_ATTR`)&&J(e.FORBID_ATTR)?Q({},e.FORBID_ATTR,B):$({}),F=Y(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?$(e.USE_PROFILES):e.USE_PROFILES:!1,de=e.ALLOW_ARIA_ATTR!==!1,fe=e.ALLOW_DATA_ATTR!==!1,pe=e.ALLOW_UNKNOWN_PROTOCOLS||!1,me=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,P=e.SAFE_FOR_TEMPLATES||!1,he=e.SAFE_FOR_XML!==!1,ge=e.WHOLE_DOCUMENT||!1,ye=e.RETURN_DOM||!1,be=e.RETURN_DOM_FRAGMENT||!1,xe=e.RETURN_TRUSTED_TYPE||!1,ve=e.FORCE_BODY||!1,Se=e.SANITIZE_DOM!==!1,Ce=e.SANITIZE_NAMED_PROPS||!1,Te=e.KEEP_CONTENT!==!1,Ee=e.IN_PLACE||!1,oe=Wt(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:cn,Ne=typeof e.NAMESPACE==`string`?e.NAMESPACE:R,Ie=Y(e,`MATHML_TEXT_INTEGRATION_POINTS`)&&e.MATHML_TEXT_INTEGRATION_POINTS&&typeof e.MATHML_TEXT_INTEGRATION_POINTS==`object`?$(e.MATHML_TEXT_INTEGRATION_POINTS):Q({},[`mi`,`mo`,`mn`,`ms`,`mtext`]),Le=Y(e,`HTML_INTEGRATION_POINTS`)&&e.HTML_INTEGRATION_POINTS&&typeof e.HTML_INTEGRATION_POINTS==`object`?$(e.HTML_INTEGRATION_POINTS):Q({},[`annotation-xml`]);let t=Y(e,`CUSTOM_ELEMENT_HANDLING`)&&e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING==`object`?$(e.CUSTOM_ELEMENT_HANDLING):bt(null);if(M=bt(null),Y(t,`tagNameCheck`)&&U(t.tagNameCheck)&&(M.tagNameCheck=t.tagNameCheck),Y(t,`attributeNameCheck`)&&U(t.attributeNameCheck)&&(M.attributeNameCheck=t.attributeNameCheck),Y(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(M.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),P&&(fe=!1),be&&(ye=!0),F&&(A=Q({},Zt),j=bt(null),F.html===!0&&(Q(A,Gt),Q(j,Qt)),F.svg===!0&&(Q(A,Kt),Q(j,$t),Q(j,tn)),F.svgFilters===!0&&(Q(A,qt),Q(j,$t),Q(j,tn)),F.mathMl===!0&&(Q(A,Yt),Q(j,en),Q(j,tn))),N.tagCheck=null,N.attributeCheck=null,Y(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?N.tagCheck=e.ADD_TAGS:J(e.ADD_TAGS)&&(A===se&&(A=$(A)),Q(A,e.ADD_TAGS,B))),Y(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?N.attributeCheck=e.ADD_ATTR:J(e.ADD_ATTR)&&(j===ce&&(j=$(j)),Q(j,e.ADD_ATTR,B))),Y(e,`ADD_URI_SAFE_ATTR`)&&J(e.ADD_URI_SAFE_ATTR)&&Q(I,e.ADD_URI_SAFE_ATTR,B),Y(e,`FORBID_CONTENTS`)&&J(e.FORBID_CONTENTS)&&(De===Oe&&(De=$(De)),Q(De,e.FORBID_CONTENTS,B)),Y(e,`ADD_FORBID_CONTENTS`)&&J(e.ADD_FORBID_CONTENTS)&&(De===Oe&&(De=$(De)),Q(De,e.ADD_FORBID_CONTENTS,B)),Te&&(A[`#text`]=!0),ge&&Q(A,[`html`,`head`,`body`]),A.table&&(Q(A,[`tbody`]),delete le.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw zt(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw zt(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);b=e.TRUSTED_TYPES_POLICY,x=b.createHTML(``)}else b===void 0&&(b=gn(p,i)),b!==null&&typeof x==`string`&&(x=b.createHTML(``));q&&q(e),V=e},Ve=Q({},[...Kt,...qt,...Jt]),G=Q({},[...Yt,...Xt]),He=function(e){let t=y(e);(!t||!t.tagName)&&(t={namespaceURI:Ne,tagName:`template`});let n=Ot(e.tagName),r=Ot(t.tagName);return Pe[e.namespaceURI]?e.namespaceURI===Me?t.namespaceURI===R?n===`svg`:t.namespaceURI===je?n===`svg`&&(r===`annotation-xml`||Ie[r]):!!Ve[n]:e.namespaceURI===je?t.namespaceURI===R?n===`math`:t.namespaceURI===Me?n===`math`&&Le[r]:!!G[n]:e.namespaceURI===R?t.namespaceURI===Me&&!Le[r]||t.namespaceURI===je&&!Ie[r]?!1:!G[n]&&(Re[n]||!Ve[n]):!!(ze===`application/xhtml+xml`&&Pe[e.namespaceURI]):!1},Ue=function(e){Et(t.removed,{element:e});try{y(e).removeChild(e)}catch{g(e)}},We=function(e,n){try{Et(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch{Et(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e===`is`)if(ye||be)try{Ue(n)}catch{}else try{n.setAttribute(e,``)}catch{}},Ge=function(e){let t=null,r=null;if(ve)e=`<remove></remove>`+e;else{let t=At(e,/^[\r\n\t ]+/);r=t&&t[0]}ze===`application/xhtml+xml`&&Ne===R&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=b?b.createHTML(e):e;if(Ne===R)try{t=new f().parseFromString(i,ze)}catch{}if(!t||!t.documentElement){t=S.createDocument(Ne,`template`,null);try{t.documentElement.innerHTML=z?x:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Ne===R?T.call(t,ge?`html`:`body`)[0]:ge?t.documentElement:a},Ke=function(e){return C.call(e.ownerDocument||e,e,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},qe=function(e){return e instanceof d&&(typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||!(e.attributes instanceof u)||typeof e.removeAttribute!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`)},Je=function(e){return typeof s==`function`&&e instanceof s};function K(e,n,r){Ct(e,e=>{e.call(t,n,r,V)})}let Ye=function(e){let n=null;if(K(D.beforeSanitizeElements,e,null),qe(e))return Ue(e),!0;let r=B(e.nodeName);if(K(D.uponSanitizeElement,e,{tagName:r,allowedTags:A}),he&&e.hasChildNodes()&&!Je(e.firstElementChild)&&X(/<[/\w!]/g,e.innerHTML)&&X(/<[/\w!]/g,e.textContent)||he&&e.namespaceURI===R&&r===`style`&&Je(e.firstElementChild)||e.nodeType===mn.progressingInstruction||he&&e.nodeType===mn.comment&&X(/<[/\w]/g,e.data))return Ue(e),!0;if(le[r]||!(N.tagCheck instanceof Function&&N.tagCheck(r))&&!A[r]){if(!le[r]&&Qe(r)&&(M.tagNameCheck instanceof RegExp&&X(M.tagNameCheck,r)||M.tagNameCheck instanceof Function&&M.tagNameCheck(r)))return!1;if(Te&&!De[r]){let t=y(e)||e.parentNode,n=v(e)||e.childNodes;if(n&&t){let r=n.length;for(let i=r-1;i>=0;--i){let r=h(n[i],!0);t.insertBefore(r,_(e))}}}return Ue(e),!0}return e instanceof c&&!He(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&X(/<\/no(script|embed|frames)/i,e.innerHTML)?(Ue(e),!0):(P&&e.nodeType===mn.text&&(n=e.textContent,Ct([ee,O,k],e=>{n=jt(n,e,` `)}),e.textContent!==n&&(Et(t.removed,{element:e.cloneNode()}),e.textContent=n)),K(D.afterSanitizeElements,e,null),!1)},Xe=function(e,t,r){if(ue[t]||Se&&(t===`id`||t===`name`)&&(r in n||r in H))return!1;let i=j[t]||N.attributeCheck instanceof Function&&N.attributeCheck(t,e);if(!(fe&&!ue[t]&&X(te,t))&&!(de&&X(ne,t))){if(!i||ue[t]){if(!(Qe(e)&&(M.tagNameCheck instanceof RegExp&&X(M.tagNameCheck,e)||M.tagNameCheck instanceof Function&&M.tagNameCheck(e))&&(M.attributeNameCheck instanceof RegExp&&X(M.attributeNameCheck,t)||M.attributeNameCheck instanceof Function&&M.attributeNameCheck(t,e))||t===`is`&&M.allowCustomizedBuiltInElements&&(M.tagNameCheck instanceof RegExp&&X(M.tagNameCheck,r)||M.tagNameCheck instanceof Function&&M.tagNameCheck(r))))return!1}else if(!I[t]&&!X(oe,jt(r,ie,``))&&!((t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&Mt(r,`data:`)===0&&ke[e])&&!(pe&&!X(re,jt(r,ie,``)))&&r)return!1}return!0},Ze=Q({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),Qe=function(e){return!Ze[Ot(e)]&&X(ae,e)},$e=function(e){K(D.beforeSanitizeAttributes,e,null);let{attributes:n}=e;if(!n||qe(e))return;let r={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:j,forceKeepAttr:void 0},i=n.length;for(;i--;){let{name:a,namespaceURI:o,value:s}=n[i],c=B(a),l=s,u=a===`value`?l:Nt(l);if(r.attrName=c,r.attrValue=u,r.keepAttr=!0,r.forceKeepAttr=void 0,K(D.uponSanitizeAttribute,e,r),u=r.attrValue,Ce&&(c===`id`||c===`name`)&&Mt(u,we)!==0&&(We(a,e),u=we+u),he&&X(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,u)){We(a,e);continue}if(c===`attributename`&&At(u,`href`)){We(a,e);continue}if(r.forceKeepAttr)continue;if(!r.keepAttr){We(a,e);continue}if(!me&&X(/\/>/i,u)){We(a,e);continue}P&&Ct([ee,O,k],e=>{u=jt(u,e,` `)});let d=B(e.nodeName);if(!Xe(d,c,u)){We(a,e);continue}if(b&&typeof p==`object`&&typeof p.getAttributeType==`function`&&!o)switch(p.getAttributeType(d,c)){case`TrustedHTML`:u=b.createHTML(u);break;case`TrustedScriptURL`:u=b.createScriptURL(u);break}if(u!==l)try{o?e.setAttributeNS(o,a,u):e.setAttribute(a,u),qe(e)?Ue(e):Tt(t.removed)}catch{We(a,e)}}K(D.afterSanitizeAttributes,e,null)},et=function(e){let t=null,n=Ke(e);for(K(D.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)K(D.uponSanitizeShadowNode,t,null),Ye(t),$e(t),t.content instanceof a&&et(t.content);K(D.afterSanitizeShadowDOM,e,null)};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,o=null,c=null,l=null;if(z=!e,z&&(e=`<!-->`),typeof e!=`string`&&!Je(e)&&(e=Ht(e),typeof e!=`string`))throw zt(`dirty is not a string, aborting`);if(!t.isSupported)return e;if(_e||W(n),t.removed=[],typeof e==`string`&&(Ee=!1),Ee){let t=e.nodeName;if(typeof t==`string`){let e=B(t);if(!A[e]||le[e])throw zt(`root node is forbidden and cannot be sanitized in-place`)}}else if(e instanceof s)i=Ge(`<!---->`),o=i.ownerDocument.importNode(e,!0),o.nodeType===mn.element&&o.nodeName===`BODY`||o.nodeName===`HTML`?i=o:i.appendChild(o);else{if(!ye&&!P&&!ge&&e.indexOf(`<`)===-1)return b&&xe?b.createHTML(e):e;if(i=Ge(e),!i)return ye?null:xe?x:``}i&&ve&&Ue(i.firstChild);let u=Ke(Ee?e:i);for(;c=u.nextNode();)Ye(c),$e(c),c.content instanceof a&&et(c.content);if(Ee)return e;if(ye){if(P){i.normalize();let e=i.innerHTML;Ct([ee,O,k],t=>{e=jt(e,t,` `)}),i.innerHTML=e}if(be)for(l=w.call(i.ownerDocument);i.firstChild;)l.appendChild(i.firstChild);else l=i;return(j.shadowroot||j.shadowrootmode)&&(l=E.call(r,l,!0)),l}let d=ge?i.outerHTML:i.innerHTML;return ge&&A[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&X(dn,i.ownerDocument.doctype.name)&&(d=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
|
|
2
2
|
`+d),P&&Ct([ee,O,k],e=>{d=jt(d,e,` `)}),b&&xe?b.createHTML(d):d},t.setConfig=function(){W(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}),_e=!0},t.clearConfig=function(){V=null,_e=!1},t.isValidAttribute=function(e,t,n){return V||W({}),Xe(B(e),B(t),n)},t.addHook=function(e,t){typeof t==`function`&&Et(D[e],t)},t.removeHook=function(e,t){if(t!==void 0){let n=wt(D[e],t);return n===-1?void 0:Dt(D[e],n,1)[0]}return Tt(D[e])},t.removeHooks=function(e){D[e]=[]},t.removeAllHooks=function(){D=_n()},t}var yn=vn();function bn({config:e,onConfigChange:t}){let[n,r]=(0,B.useState)(!0),[i,a]=(0,B.useState)(``),[o,s]=(0,B.useState)(null),[c,l]=(0,B.useState)(!1),[f,p]=(0,B.useState)(!1),[h,g]=(0,B.useState)(!1),[_,v]=(0,B.useState)(!1),[y,w]=(0,B.useState)(``),E=(0,B.useRef)(``),ee=i!==E.current;async function O(){r(!0);try{let e=await oe();if(e.error===`no_config`)l(!1),s(null),a(``),E.current=``;else{l(!0),s(e.filePath);let t=e.content??``;a(t),E.current=t}}catch{T.error(`Failed to load agent rules`)}finally{r(!1)}}(0,B.useEffect)(()=>{O()},[]);async function te(){p(!0);try{await D(i),E.current=i,t(),T.success(`Configuration saved`)}catch{T.error(`Failed to save agent rules`)}finally{p(!1)}}function ne(){a(E.current)}async function re(){g(!0);try{let e=await Ee();l(!0),s(e.filePath),a(``),E.current=``,t(),T.success(`Agent rules file created`)}catch{T.error(`Failed to create rules file`)}finally{g(!1)}}async function ie(e){if(v(!1),e!==o)try{await A({"workspace.agentRules":e}),t(),await O()}catch{T.error(`Failed to update file path`)}}function ae(e){e.key===`Enter`?ie(y):e.key===`Escape`&&v(!1)}function se(){if(!i.trim())return(0,V.jsx)(`div`,{className:`text-sm text-muted-foreground text-center py-12`,children:`Nothing to preview. Switch to the Edit tab to write your rules.`});let e=Re.parse(i,{async:!1});return(0,V.jsx)(`div`,{className:`markdown-preview`,role:`document`,dangerouslySetInnerHTML:{__html:yn.sanitize(e,{USE_PROFILES:{html:!0}})}})}return n?(0,V.jsxs)(H,{children:[(0,V.jsxs)(U,{children:[(0,V.jsxs)(`h2`,{className:`flex items-center gap-2 text-base font-semibold`,children:[(0,V.jsx)(ze,{className:`size-5`}),`Agent Rules`]}),(0,V.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Custom instructions appended to the AI agent's system prompt`})]}),(0,V.jsx)(W,{children:(0,V.jsx)(`div`,{className:`flex items-center justify-center py-12 text-muted-foreground`,children:(0,V.jsx)(I,{className:`size-5 animate-spin`})})})]}):c?(0,V.jsxs)(H,{children:[(0,V.jsxs)(U,{children:[(0,V.jsxs)(`h2`,{className:`flex items-center gap-2 text-base font-semibold`,children:[(0,V.jsx)(ze,{className:`size-5`}),`Agent Rules`]}),(0,V.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Custom instructions appended to the AI agent's system prompt`})]}),(0,V.jsxs)(W,{children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(M,{className:`size-4 text-muted-foreground shrink-0`}),_?(0,V.jsx)(k,{className:`font-mono text-sm`,value:y,onChange:e=>w(e.target.value),onKeyDown:ae,onBlur:()=>ie(y),placeholder:`./path-to-rules.md`,"aria-label":`Agent rules file path`,autoFocus:!0}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`span`,{className:`font-mono text-sm text-muted-foreground truncate`,children:o}),(0,V.jsx)(j,{variant:`ghost`,size:`sm`,className:`ml-auto shrink-0`,onClick:()=>{w(o??``),v(!0)},children:`Change Path`})]})]}),(0,V.jsxs)(C,{defaultValue:`edit`,children:[(0,V.jsxs)(S,{children:[(0,V.jsxs)(b,{value:`edit`,className:`gap-1.5`,children:[(0,V.jsx)(d,{className:`size-3.5`}),`Edit`]}),(0,V.jsxs)(b,{value:`preview`,className:`gap-1.5`,children:[(0,V.jsx)(u,{className:`size-3.5`}),`Preview`]})]}),(0,V.jsx)(x,{value:`edit`,children:(0,V.jsx)(m,{className:`min-h-[300px] font-mono text-sm leading-relaxed resize-y w-full`,value:i,onChange:e=>a(e.target.value),placeholder:`Write your custom agent rules in markdown...`,"aria-label":`Agent rules markdown editor`})}),(0,V.jsx)(x,{value:`preview`,children:(0,V.jsx)(`div`,{className:`min-h-[300px] p-4 border border-border rounded-none overflow-y-auto`,children:se()})})]}),(0,V.jsxs)(`div`,{className:`flex gap-2`,children:[(0,V.jsx)(j,{size:`sm`,onClick:te,disabled:f||!ee,children:f?(0,V.jsx)(I,{className:`size-4 animate-spin`}):`Save Changes`}),(0,V.jsx)(j,{variant:`outline`,size:`sm`,onClick:ne,disabled:!ee,children:`Reset Changes`})]})]})]}):(0,V.jsxs)(H,{children:[(0,V.jsxs)(U,{children:[(0,V.jsxs)(`h2`,{className:`flex items-center gap-2 text-base font-semibold`,children:[(0,V.jsx)(ze,{className:`size-5`}),`Agent Rules`]}),(0,V.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Custom instructions appended to the AI agent's system prompt`})]}),(0,V.jsx)(W,{children:(0,V.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-12 text-center gap-4`,children:[(0,V.jsx)(ze,{className:`size-8 text-muted-foreground`}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`p`,{className:`text-sm font-semibold`,children:`No agent rules file configured`}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:`Create a markdown file with custom instructions for the AI agent. Rules are appended to the system prompt after the built-in rules.`})]}),(0,V.jsx)(j,{variant:`outline`,size:`sm`,onClick:re,disabled:h,children:h?(0,V.jsx)(I,{className:`size-4 animate-spin`}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Be,{className:`size-4 mr-1`}),`Create Rules File`]})})]})})]})}function xn({config:e,onConfigChange:t}){let n=e.services?.dashboard??{},[r,i]=(0,B.useState)(String(n.port??4173)),[a,o]=(0,B.useState)(n.dbPath??``),[s,c]=(0,B.useState)(n.artifactsDir??``),[l,u]=(0,B.useState)(!1);async function d(){let e=G(r,{label:`Port`,min:1,max:65535,integer:!0});if(e.error){T.error(e.error);return}u(!0);try{await A({"services.dashboard":{port:e.value,dbPath:a,artifactsDir:s}}),t(),T.success(`Changes saved`)}catch{T.error(`Failed to save configuration`)}finally{u(!1)}}return(0,V.jsxs)(H,{children:[(0,V.jsxs)(U,{children:[(0,V.jsx)(`h2`,{className:`text-base font-semibold`,children:`Dashboard`}),(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Configure dashboard server and storage paths`})]}),(0,V.jsxs)(W,{children:[(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(_,{htmlFor:`dashboard-port`,children:`Port`}),(0,V.jsx)(k,{id:`dashboard-port`,type:`number`,min:1,max:65535,step:1,value:r,onChange:e=>i(e.target.value)})]}),(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(_,{htmlFor:`dashboard-db-path`,children:`Database Path`}),(0,V.jsx)(k,{id:`dashboard-db-path`,placeholder:`.agent-qa/runs.db`,value:a,onChange:e=>o(e.target.value)})]}),(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(_,{htmlFor:`dashboard-artifacts-dir`,children:`Artifacts Directory`}),(0,V.jsx)(k,{id:`dashboard-artifacts-dir`,placeholder:`.agent-qa/artifacts`,value:s,onChange:e=>c(e.target.value)})]}),(0,V.jsx)(j,{size:`sm`,onClick:d,disabled:l,children:l?(0,V.jsx)(I,{className:`size-4 animate-spin`}):`Save Changes`})]})]})}function Sn({config:e,onConfigChange:t}){let n=e.workspace??{},r=n.testMatch??[],i=n.testPathIgnore??[],a=n.suiteMatch??[],[o,s]=(0,B.useState)(r.join(`
|
|
3
3
|
`)),[c,l]=(0,B.useState)(i.join(`
|
|
4
4
|
`)),[u,d]=(0,B.useState)(a.join(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Jn as e}from"./index-
|
|
1
|
+
import{Jn as e}from"./index-B4FdO6Vk.js";var t=e(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{or as e}from"./index-
|
|
1
|
+
import{or as e}from"./index-B4FdO6Vk.js";function t(e){return{id:e.id,name:e.name,status:e.status,duration:e.duration,subActionsData:e.subActionsData,originalStepName:e.originalStepName,variableSnapshot:e.variableSnapshot,screenshotPath:e.screenshotPath,screenshotBeforePath:e.screenshotBeforePath,annotationData:e.annotationData,observation:e.observation,reasoning:e.reasoning,plannedAction:e.plannedAction,action:e.action,error:e.error,confidence:e.confidence,runId:e.runId,stepOrder:e.stepOrder,consoleLogs:e.consoleLogs,networkLogs:e.networkLogs,healingAttempts:e.healingAttempts,accessibilityViolations:e.accessibilityViolations,screenContextBefore:e.screenContextBefore,screenContextAfter:e.screenContextAfter,rawRunId:e.runId,rawStepOrder:e.stepOrder,displayStepOrder:e.stepOrder+1,displayStepTotal:null}}function n(t,n){let r=t.phases.find(e=>e.phase===`observe`),a=t.phases.find(e=>e.phase===`plan`),o=t.phases.find(e=>e.phase===`execute`),s=t.subActionsData?.find(e=>!!(e.observation||e.reasoning||e.plannedAction!=null));return{id:t.id,name:t.instruction,status:e(t.status),duration:t.duration??0,subActionsData:t.subActionsData??i(t.phases),originalStepName:t.originalStepName,variableSnapshot:t.variableSnapshot,screenshotPath:null,screenshotBeforePath:null,annotationData:null,observation:r?.text??s?.observation??null,reasoning:a?.text??s?.reasoning??null,plannedAction:o?.action??s?.plannedAction??null,action:o?.action??s?.plannedAction??null,error:t.error??null,confidence:a?.confidence??s?.confidence??null,runId:null,stepOrder:n,consoleLogs:t.consoleLogs,networkLogs:t.networkLogs,healingAttempts:null,accessibilityViolations:null,screenContextBefore:null,screenContextAfter:null,rawRunId:null,rawStepOrder:n,displayStepOrder:n+1,displayStepTotal:null}}function r(e){let t=e.length;return e.map((e,n)=>({...e,displayStepOrder:n+1,displayStepTotal:t}))}function i(e){if(e.length===0)return null;let t=[],n=[];for(let r of e)(r.phase===`observe`||r.phase===`heal`)&&n.length>0&&(t.push(n),n=[]),n.push(r);return n.length>0&&t.push(n),t.map((e,n)=>{let r=e.find(e=>e.phase===`observe`),i=e.find(e=>e.phase===`plan`),a=e.find(e=>e.phase===`execute`),o=e.find(e=>e.phase===`verify`);return{index:n,observation:r?.text??``,reasoning:i?.text??``,plannedAction:a?.action??null,result:o?o.success?`success`:`failure`:n===t.length-1?`in-progress`:`failure`,error:void 0,screenStateBefore:``,cached:!1,confidence:i?.confidence,verifierReasoning:o?.text,phaseDurations:{observe:r?.duration,plan:i?.duration,execute:a?.duration,verify:o?.duration}}})}export{r as i,t as n,i as r,n as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./chunk-CilyBKbf.js";import{Mn as t,Qn as n,kn as r,pr as i,wn as a}from"./index-
|
|
1
|
+
import{r as e}from"./chunk-CilyBKbf.js";import{Mn as t,Qn as n,kn as r,pr as i,wn as a}from"./index-B4FdO6Vk.js";var o=e(i(),1),s=n();function c(e){let n=e+`CollectionProvider`,[i,c]=a(n),[l,u]=i(n,{collectionRef:{current:null},itemMap:new Map}),d=e=>{let{scope:t,children:n}=e,r=o.useRef(null),i=o.useRef(new Map).current;return(0,s.jsx)(l,{scope:t,itemMap:i,collectionRef:r,children:n})};d.displayName=n;let f=e+`CollectionSlot`,p=r(f),m=o.forwardRef((e,n)=>{let{scope:r,children:i}=e;return(0,s.jsx)(p,{ref:t(n,u(f,r).collectionRef),children:i})});m.displayName=f;let h=e+`CollectionItemSlot`,g=`data-radix-collection-item`,_=r(h),v=o.forwardRef((e,n)=>{let{scope:r,children:i,...a}=e,c=o.useRef(null),l=t(n,c),d=u(h,r);return o.useEffect(()=>(d.itemMap.set(c,{ref:c,...a}),()=>void d.itemMap.delete(c))),(0,s.jsx)(_,{[g]:``,ref:l,children:i})});v.displayName=h;function y(t){let n=u(e+`CollectionConsumer`,t);return o.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${g}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:d,Slot:m,ItemSlot:v},y,c]}export{c as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./chunk-CilyBKbf.js";import{t}from"./dist-
|
|
1
|
+
import{r as e}from"./chunk-CilyBKbf.js";import{t}from"./dist-BJdB11cl.js";import{r as n}from"./use-page-title-B4YPyIzc.js";import{Cn as r,En as i,Mn as a,Qn as o,pr as s,vn as c,wn as l,xn as u,yn as d}from"./index-B4FdO6Vk.js";var f=e(s(),1),p=o(),m=`rovingFocusGroup.onEntryFocus`,h={bubbles:!1,cancelable:!0},g=`RovingFocusGroup`,[_,v,y]=t(g),[b,x]=l(g,[y]),[S,C]=b(g),w=f.forwardRef((e,t)=>(0,p.jsx)(_.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,p.jsx)(_.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,p.jsx)(T,{...e,ref:t})})}));w.displayName=g;var T=f.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:o,orientation:s,loop:l=!1,dir:d,currentTabStopId:_,defaultCurrentTabStopId:y,onCurrentTabStopIdChange:b,onEntryFocus:x,preventScrollOnEntryFocus:C=!1,...w}=e,T=f.useRef(null),E=a(t,T),D=n(d),[O,k]=u({prop:_,defaultProp:y??null,onChange:b,caller:g}),[A,M]=f.useState(!1),N=c(x),P=v(o),F=f.useRef(!1),[I,L]=f.useState(0);return f.useEffect(()=>{let e=T.current;if(e)return e.addEventListener(m,N),()=>e.removeEventListener(m,N)},[N]),(0,p.jsx)(S,{scope:o,orientation:s,dir:D,loop:l,currentTabStopId:O,onItemFocus:f.useCallback(e=>k(e),[k]),onItemShiftTab:f.useCallback(()=>M(!0),[]),onFocusableItemAdd:f.useCallback(()=>L(e=>e+1),[]),onFocusableItemRemove:f.useCallback(()=>L(e=>e-1),[]),children:(0,p.jsx)(i.div,{tabIndex:A||I===0?-1:0,"data-orientation":s,...w,ref:E,style:{outline:`none`,...e.style},onMouseDown:r(e.onMouseDown,()=>{F.current=!0}),onFocus:r(e.onFocus,e=>{let t=!F.current;if(e.target===e.currentTarget&&t&&!A){let t=new CustomEvent(m,h);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=P().filter(e=>e.focusable);j([e.find(e=>e.active),e.find(e=>e.id===O),...e].filter(Boolean).map(e=>e.ref.current),C)}}F.current=!1}),onBlur:r(e.onBlur,()=>M(!1))})})}),E=`RovingFocusGroupItem`,D=f.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:a=!0,active:o=!1,tabStopId:s,children:c,...l}=e,u=d(),m=s||u,h=C(E,n),g=h.currentTabStopId===m,y=v(n),{onFocusableItemAdd:b,onFocusableItemRemove:x,currentTabStopId:S}=h;return f.useEffect(()=>{if(a)return b(),()=>x()},[a,b,x]),(0,p.jsx)(_.ItemSlot,{scope:n,id:m,focusable:a,active:o,children:(0,p.jsx)(i.span,{tabIndex:g?0:-1,"data-orientation":h.orientation,...l,ref:t,onMouseDown:r(e.onMouseDown,e=>{a?h.onItemFocus(m):e.preventDefault()}),onFocus:r(e.onFocus,()=>h.onItemFocus(m)),onKeyDown:r(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){h.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=A(e,h.orientation,h.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=y().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=h.loop?M(n,r+1):n.slice(r+1)}setTimeout(()=>j(n))}}),children:typeof c==`function`?c({isCurrentTabStop:g,hasTabStop:S!=null}):c})})});D.displayName=E;var O={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function k(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function A(e,t,n){let r=k(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return O[r]}function j(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function M(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var N=w,P=D;export{N as n,x as r,P as t};
|