progon-agent 1.3.2 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/dist/supervisor/cli.js +41 -41
  2. package/extension-bundle.json +3 -3
  3. package/extension-dist/background/background.js +89 -89
  4. package/extension-dist/card/card.html +8 -7
  5. package/extension-dist/card/card.js +3 -3
  6. package/extension-dist/chunks/shared-B4EisBUi.js +1 -0
  7. package/extension-dist/chunks/shared-B7QwPadt.js +98 -0
  8. package/extension-dist/chunks/shared-BQF2LG1p.js +377 -0
  9. package/extension-dist/chunks/shared-BgsXTfSV.js +1 -0
  10. package/extension-dist/chunks/shared-BpcMA-xb.js +135 -0
  11. package/extension-dist/chunks/shared-BwS34Mep.js +111 -0
  12. package/extension-dist/chunks/shared-CAKh7jnb.css +1 -0
  13. package/extension-dist/chunks/{shared-CInXPYm9.js → shared-CCOKrUJ3.js} +1 -1
  14. package/extension-dist/chunks/shared-Co5HfH-n.js +1 -0
  15. package/extension-dist/chunks/shared-Cs6uBr12.js +1 -0
  16. package/extension-dist/chunks/shared-D7SUgUlB.js +1 -0
  17. package/extension-dist/chunks/shared-DGDE0AeD.js +1 -0
  18. package/extension-dist/chunks/shared-DjlOTYdL.js +1 -0
  19. package/extension-dist/chunks/shared-Dk6zuyaK.css +1 -0
  20. package/extension-dist/chunks/shared-LK5ScAJA.js +227 -0
  21. package/extension-dist/chunks/shared-_8sSdh22.js +21 -0
  22. package/extension-dist/chunks/shared-sY-POWsC.js +51 -0
  23. package/extension-dist/content/content.css +1 -1
  24. package/extension-dist/content/content.js +211 -211
  25. package/extension-dist/manifest.json +29 -27
  26. package/extension-dist/offscreen/offscreen.html +2 -2
  27. package/extension-dist/offscreen/offscreen.js +1 -1
  28. package/extension-dist/popup/popup.html +7 -7
  29. package/extension-dist/popup/popup.js +3 -3
  30. package/extension-dist/sidepanel/sidepanel.html +9 -9
  31. package/extension-dist/sidepanel/sidepanel.js +1 -1
  32. package/extension-dist/workspace/workspace.css +1 -1
  33. package/extension-dist/workspace/workspace.html +11 -10
  34. package/extension-dist/workspace/workspace.js +59 -56
  35. package/package.json +2 -2
  36. package/extension-dist/chunks/shared-9kMbf8PO.js +0 -1
  37. package/extension-dist/chunks/shared-BWYPh-Al.js +0 -1
  38. package/extension-dist/chunks/shared-Bi_ASAsl.js +0 -377
  39. package/extension-dist/chunks/shared-BjgSKbjc.js +0 -1
  40. package/extension-dist/chunks/shared-Bts1WtwM.js +0 -1
  41. package/extension-dist/chunks/shared-Bwk7ZjOr.js +0 -21
  42. package/extension-dist/chunks/shared-CX8XGwZc.js +0 -1
  43. package/extension-dist/chunks/shared-CZrS2BT6.js +0 -111
  44. package/extension-dist/chunks/shared-C_dmgeUK.js +0 -120
  45. package/extension-dist/chunks/shared-CeuPJn47.js +0 -227
  46. package/extension-dist/chunks/shared-CiEEQWpw.js +0 -1
  47. package/extension-dist/chunks/shared-Cxo909tK.js +0 -1
  48. package/extension-dist/chunks/shared-DyRhAmgo.js +0 -51
  49. package/extension-dist/chunks/shared-Xq2emDMe.js +0 -98
  50. package/extension-dist/chunks/shared-_jlBqdBD.css +0 -1
@@ -0,0 +1,111 @@
1
+ import{r as e}from"./shared-hePW80VL.js";import{$ as t,$n as n,$t as r,An as i,At as a,Bt as o,Ct as s,Dt as c,E as l,Et as u,F as d,Fn as f,Fr as p,Ft as m,Gi as h,Gt as g,Ht as _,I as v,It as y,J as b,Ji as x,Jn as S,Ki as C,Li as w,Lt as T,Mi as E,Mt as D,Nn as O,Nt as k,Ot as A,Pn as j,Po as M,Pt as ee,Qn as N,Rt as te,St as P,Tt as F,Ui as I,Ur as L,Wi as R,Xn as ne,Yn as re,Yr as ie,Z as ae,Zr as oe,_t as se,ar as z,at as ce,bi as le,bn as ue,bt as de,ci as B,ct as fe,dn as pe,et as me,fr as V,ft as he,gt as ge,ht as _e,in as ve,jt as ye,kt as be,li as xe,lt as Se,mn as Ce,nn as we,oi as Te,on as Ee,ot as De,pa as Oe,pn as ke,pt as Ae,qi as je,qn as Me,qr as Ne,rt as Pe,si as Fe,st as Ie,tn as Le,tt as Re,vt as ze,wt as Be,xi as Ve,xt as He,yt as Ue,zt as We}from"./shared-LK5ScAJA.js";import{$n as H,D as Ge,F as Ke,Jt as U,N as qe,P as Je,Tt as Ye,Yn as Xe,Zn as Ze,_r as W,dr as G,f as Qe,hr as $e,lr as et,mr as tt,or as K,rr as q,sr as J}from"./shared-B7QwPadt.js";var nt=/\u200B/g,rt=/\s+/g;function it(e){return e.replace(nt,``).replace(rt,` `).trim()}
2
+ /**
3
+ * @license lucide-react v0.574.0 - ISC
4
+ *
5
+ * This source code is licensed under the ISC license.
6
+ * See the LICENSE file in the root directory of this source tree.
7
+ */
8
+ var at=B(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),ot=B(`crosshair`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`22`,x2:`18`,y1:`12`,y2:`12`,key:`l9bcsi`}],[`line`,{x1:`6`,x2:`2`,y1:`12`,y2:`12`,key:`13hhkx`}],[`line`,{x1:`12`,x2:`12`,y1:`6`,y2:`2`,key:`10w3f3`}],[`line`,{x1:`12`,x2:`12`,y1:`22`,y2:`18`,key:`15g9kq`}]]),st=B(`ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),ct=B(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),lt=B(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),ut=B(`frame`,[[`line`,{x1:`22`,x2:`2`,y1:`6`,y2:`6`,key:`15w7dq`}],[`line`,{x1:`22`,x2:`2`,y1:`18`,y2:`18`,key:`1ip48p`}],[`line`,{x1:`6`,x2:`6`,y1:`2`,y2:`22`,key:`a2lnyx`}],[`line`,{x1:`18`,x2:`18`,y1:`2`,y2:`22`,key:`8vb6jd`}]]),dt=B(`history`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),ft=B(`keyboard`,[[`path`,{d:`M10 8h.01`,key:`1r9ogq`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M14 8h.01`,key:`1primd`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}],[`path`,{d:`M18 8h.01`,key:`emo2bl`}],[`path`,{d:`M6 8h.01`,key:`x9i8wu`}],[`path`,{d:`M7 16h10`,key:`wp8him`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}],[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`,key:`18n3k1`}]]),pt=B(`layers`,[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]]),mt=B(`list-checks`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]),ht=B(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),gt=B(`lock`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]),_t=B(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),vt=B(`mouse-pointer-click`,[[`path`,{d:`M14 4.1 12 6`,key:`ita8i4`}],[`path`,{d:`m5.1 8-2.9-.8`,key:`1go3kf`}],[`path`,{d:`m6 12-1.9 2`,key:`mnht97`}],[`path`,{d:`M7.2 2.2 8 5.1`,key:`1cfko1`}],[`path`,{d:`M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z`,key:`s0h3yz`}]]),yt=B(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),bt=B(`target`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`6`,key:`1vlfrh`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]),xt=B(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),St=B(`variable`,[[`path`,{d:`M8 21s-4-3-4-9 4-9 4-9`,key:`uto9ud`}],[`path`,{d:`M16 3s4 3 4 9-4 9-4 9`,key:`4w2vsq`}],[`line`,{x1:`15`,x2:`9`,y1:`9`,y2:`15`,key:`f7djnv`}],[`line`,{x1:`9`,x2:`15`,y1:`9`,y2:`15`,key:`1shsy8`}]]),Ct=[`text_contains`,`text_equals`,`text_free`,`element_visible`,`element_exists`,`element_not_exists`,`input_value`],wt={text_contains:{labelKey:`checkTypes.text_contains`,icon:[[`path`,{d:`M17 6.1H3`}],[`path`,{d:`M21 12.1H3`}],[`path`,{d:`M15.1 18H3`}]]},text_equals:{labelKey:`checkTypes.text_equals`,icon:[[`path`,{d:`M5 9h14`}],[`path`,{d:`M5 15h14`}]]},text_free:{labelKey:`checkTypes.text_free`,icon:[[`path`,{d:`M12 20h9`}],[`path`,{d:`M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z`}]]},element_visible:{labelKey:`checkTypes.element_visible`,icon:[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`}]]},element_exists:{labelKey:`checkTypes.element_exists`,icon:[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`}],[`path`,{d:`M12 22V12`}]]},element_not_exists:{labelKey:`checkTypes.element_not_exists`,icon:[[`path`,{d:`M5 3a2 2 0 0 0-2 2`}],[`path`,{d:`M19 3a2 2 0 0 1 2 2`}],[`path`,{d:`M21 19a2 2 0 0 1-2 2`}],[`path`,{d:`M5 21a2 2 0 0 1-2-2`}],[`path`,{d:`M9 3h1`}],[`path`,{d:`M9 21h1`}],[`path`,{d:`M14 3h1`}],[`path`,{d:`M14 21h1`}],[`path`,{d:`M3 9v1`}],[`path`,{d:`M21 9v1`}],[`path`,{d:`M3 14v1`}],[`path`,{d:`M21 14v1`}]]},input_value:{labelKey:`checkTypes.input_value`,icon:[[`path`,{d:`M5 4h1a3 3 0 0 1 3 3 3 3 0 0 1 3-3h1`}],[`path`,{d:`M13 20h-1a3 3 0 0 1-3-3 3 3 0 0 1-3 3H5`}],[`path`,{d:`M5 16H4a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2h1`}],[`path`,{d:`M13 8h7a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-7`}],[`path`,{d:`M9 7v10`}]]}},Tt=`checkTypes.assert_text`
9
+ /**
10
+ * @license lucide-react v0.574.0 - ISC
11
+ *
12
+ * This source code is licensed under the ISC license.
13
+ * See the LICENSE file in the root directory of this source tree.
14
+ */
15
+ /**
16
+ * @license lucide-react v0.574.0 - ISC
17
+ *
18
+ * This source code is licensed under the ISC license.
19
+ * See the LICENSE file in the root directory of this source tree.
20
+ */
21
+ /**
22
+ * @license lucide-react v0.574.0 - ISC
23
+ *
24
+ * This source code is licensed under the ISC license.
25
+ * See the LICENSE file in the root directory of this source tree.
26
+ */
27
+ /**
28
+ * @license lucide-react v0.574.0 - ISC
29
+ *
30
+ * This source code is licensed under the ISC license.
31
+ * See the LICENSE file in the root directory of this source tree.
32
+ */
33
+ /**
34
+ * @license lucide-react v0.574.0 - ISC
35
+ *
36
+ * This source code is licensed under the ISC license.
37
+ * See the LICENSE file in the root directory of this source tree.
38
+ */
39
+ /**
40
+ * @license lucide-react v0.574.0 - ISC
41
+ *
42
+ * This source code is licensed under the ISC license.
43
+ * See the LICENSE file in the root directory of this source tree.
44
+ */
45
+ /**
46
+ * @license lucide-react v0.574.0 - ISC
47
+ *
48
+ * This source code is licensed under the ISC license.
49
+ * See the LICENSE file in the root directory of this source tree.
50
+ */
51
+ /**
52
+ * @license lucide-react v0.574.0 - ISC
53
+ *
54
+ * This source code is licensed under the ISC license.
55
+ * See the LICENSE file in the root directory of this source tree.
56
+ */
57
+ /**
58
+ * @license lucide-react v0.574.0 - ISC
59
+ *
60
+ * This source code is licensed under the ISC license.
61
+ * See the LICENSE file in the root directory of this source tree.
62
+ */
63
+ /**
64
+ * @license lucide-react v0.574.0 - ISC
65
+ *
66
+ * This source code is licensed under the ISC license.
67
+ * See the LICENSE file in the root directory of this source tree.
68
+ */
69
+ /**
70
+ * @license lucide-react v0.574.0 - ISC
71
+ *
72
+ * This source code is licensed under the ISC license.
73
+ * See the LICENSE file in the root directory of this source tree.
74
+ */
75
+ /**
76
+ * @license lucide-react v0.574.0 - ISC
77
+ *
78
+ * This source code is licensed under the ISC license.
79
+ * See the LICENSE file in the root directory of this source tree.
80
+ */
81
+ /**
82
+ * @license lucide-react v0.574.0 - ISC
83
+ *
84
+ * This source code is licensed under the ISC license.
85
+ * See the LICENSE file in the root directory of this source tree.
86
+ */
87
+ /**
88
+ * @license lucide-react v0.574.0 - ISC
89
+ *
90
+ * This source code is licensed under the ISC license.
91
+ * See the LICENSE file in the root directory of this source tree.
92
+ */
93
+ /**
94
+ * @license lucide-react v0.574.0 - ISC
95
+ *
96
+ * This source code is licensed under the ISC license.
97
+ * See the LICENSE file in the root directory of this source tree.
98
+ */
99
+ /**
100
+ * @license lucide-react v0.574.0 - ISC
101
+ *
102
+ * This source code is licensed under the ISC license.
103
+ * See the LICENSE file in the root directory of this source tree.
104
+ */
105
+ /**
106
+ * @license lucide-react v0.574.0 - ISC
107
+ *
108
+ * This source code is licensed under the ISC license.
109
+ * See the LICENSE file in the root directory of this source tree.
110
+ */
111
+ ;function Et(e){return!Ke(e)}function Dt(e){if(!Et(e))throw Error(`Check type "${e}" is legacy and read-only: it has no catalog entry`);let t=wt[e];if(t===void 0)throw Error(`Unknown check type: ${String(e)}`);return t}function Ot(e){return Et(e)?Dt(e).labelKey:Tt}function kt(e){return Dt(e).icon}function At(e){return Dt(e),Ge[Je(e)].filter(t=>t===e||qe(e,t))}var Y=/* @__PURE__ */ e(x(),1),jt=/*#__PURE__*/ Y.createContext(void 0);function X(e){let t=Y.useContext(jt);if(t===void 0&&!e)throw Error(V(47));return t}var Mt=/* @__PURE__ */ e(h(),1),Nt={...se,disabled:e=>e.disabled,instantType:e=>e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,modal:e=>e.modal,focusManagerModal:e=>e.focusManagerModal,stickIfOpen:e=>e.stickIfOpen,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},Pt=class extends a{constructor(e,t,n){let r=new ze;super(Ft(e,r,t,n),It(r),Nt),Oe(this,`setOpen`,(e,t)=>{var n,r;let a=t.reason===i,o=t.reason===`trigger-press`&&t.event.detail===0,c=!e&&(t.reason===`escape-key`||t.reason==null),l=He(t),u=this.select(`activeTriggerId`);if(!e&&t.reason===`close-press`&&t.trigger==null&&u!=null&&(t.trigger=this.context.triggerElements.getById(u)??this.select(`activeTriggerElement`)??void 0),(n=(r=this.context).onOpenChange)==null||n.call(r,e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let d=()=>{let n=s(this.state,e,t.trigger,l());n.openChangeReason=t.reason,this.update(n)};a?(this.set(`stickIfOpen`,!0),this.context.stickIfOpenTimeout.start(500,()=>{this.set(`stickIfOpen`,!1)}),Mt.flushSync(d)):d();let f;o?f=`click`:c?f=`dismiss`:t.reason===`focus-out`&&(f=`focus`),this.set(`instantType`,f)})}};function Ft(e,t,n,r=!1){let i={...ge(t,n,r),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return i.open&&(e==null?void 0:e.mounted)===void 0&&(i.mounted=!0),i}function It(e){return{popupRef:/*#__PURE__*/ Y.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:/*#__PURE__*/ Y.createRef(),beforeContentFocusGuardRef:/*#__PURE__*/ Y.createRef(),stickIfOpenTimeout:new r,triggerElements:e}}var Z=je(),Lt=ye(function({props:e}){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,modal:o=!1,handle:s,triggerId:c,defaultTriggerId:l=null}=e,u=zt(s,{modal:o,open:r,openProp:n,activeTriggerId:l,triggerIdProp:c});u.useControlledProp(`openProp`,n),u.useControlledProp(`triggerIdProp`,c);let d=u.useState(`open`),f=u.useState(`mounted`),p=u.useState(`payload`);u.useContextCallback(`onOpenChange`,i),u.useContextCallback(`onOpenChangeComplete`,a),A(u,d),Be(u);let{forceUnmount:m}=F(d,u,()=>{u.update({stickIfOpen:!0,openChangeReason:null})});u.useSyncedValues({modal:o}),Y.useEffect(()=>{d||u.context.stickIfOpenTimeout.clear()},[u,d]),Y.useImperativeHandle(e.actionsRef,()=>({unmount:m,close:()=>u.setOpen(!1,ve(ue))}),[m,u]);let h=d||f;return/*#__PURE__*/ (0,Z.jsxs)(jt.Provider,{value:u,children:[s&&/*#__PURE__*/ (0,Z.jsx)(de,{handle:s,store:u}),h&&/*#__PURE__*/ (0,Z.jsx)(Bt,{store:u,modal:o}),typeof t==`function`?t({payload:p}):t]})});function Rt(e){return X(!0)?/*#__PURE__*/ (0,Z.jsx)(Lt,{props:e}):/*#__PURE__*/ (0,Z.jsx)(T,{children:/*#__PURE__*/ (0,Z.jsx)(Lt,{props:e})})}function zt(e,t){let n=c((e,n)=>new Pt(t,e,n));return Y.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function Bt({store:e,modal:t}){let n=e.useState(`floatingRootContext`),r=k(n,{outsidePressEvent:{mouse:t===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),i=r.reference,a=r.floating;return u(e,{activeTriggerProps:i,inactiveTriggerProps:i,popupProps:a}),null}var Vt=D(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:s=!0,handle:c,payload:l,openOnHover:u=!1,delay:d=300,closeDelay:p=0,id:m,...h}=e,_=X(!0),v=_e(c)??_;if(!v)throw Error(V(74));let y=Ee(m),x=v.useState(`isTriggerActive`,y),S=v.useState(`floatingRootContext`),C=v.useState(`isOpenedByTrigger`,y),w=v.useState(`triggerPopupId`,y),T=Y.useRef(null),{registerTrigger:E,isMountedByThisTrigger:D}=be(y,T,v,{payload:l,disabled:a,openOnHover:u,closeDelay:p}),O=v.useState(`openChangeReason`),k=v.useState(`stickIfOpen`),A=v.useState(`openMethod`),M=v.useState(`focusManagerModal`),N=he(S,{enabled:!a&&u&&(A!==`touch`||O!==`trigger-press`),mouseOnly:!0,move:!1,handleClose:Se(),restMs:d,delay:{close:p},triggerElementRef:T,isActiveTrigger:x,isClosing:()=>v.select(`transitionStatus`)===`ending`}),te=ee(S,{stickIfOpen:k}),P=ae(()=>v.select(`open`),e=>{v.set(`openMethod`,e)}),F=v.useState(`triggerProps`,D),{getButtonProps:I,buttonRef:L}=pe({disabled:a,native:s}),R={open(e){return e&&O===`trigger-press`?j.open(e):f.open(e)}},{preFocusGuardRef:ne,handlePreFocusGuardFocus:re,handleFocusTargetFocus:ie}=b(v,T),oe=z(`button`,e,{state:{disabled:a,open:C},ref:[L,t,E,T],props:[te.reference,N,F,P,{[o]:``,id:y,"aria-haspopup":`dialog`,"aria-expanded":C,"aria-controls":w},h,I],stateAttributesMapping:R}),se=/*#__PURE__*/ (0,Z.jsx)(Y.Fragment,{children:oe},y);return D&&!M?/*#__PURE__*/ (0,Z.jsxs)(Y.Fragment,{children:[/*#__PURE__*/ (0,Z.jsx)(g,{ref:ne,onFocus:re}),se,/*#__PURE__*/ (0,Z.jsx)(g,{ref:v.context.triggerFocusTargetRef,onFocus:ie})]}):se}),Ht=/*#__PURE__*/ Y.createContext(void 0);function Ut(){let e=Y.useContext(Ht);if(e===void 0)throw Error(V(45));return e}var Wt=/*#__PURE__*/ Y.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return X().useState(`mounted`)||n?/*#__PURE__*/ (0,Z.jsx)(Ht.Provider,{value:n,children:/*#__PURE__*/ (0,Z.jsx)(We,{ref:t,...r})}):null}),Gt=/*#__PURE__*/ Y.createContext(void 0);function Kt(){let e=Y.useContext(Gt);if(!e)throw Error(V(46));return e}var qt=/*#__PURE__*/ Y.forwardRef(function(e,n){let{render:r,className:i,style:a,anchor:o,positionMethod:s,side:c,align:l,sideOffset:u,alignOffset:d,collisionBoundary:f=`clipping-ancestors`,collisionPadding:p,arrowPadding:m,sticky:h,disableAnchorTracking:g=!1,collisionAvoidance:v=_,...b}=e,x=X(),S=Ut(),C=te(),w=x.useState(`floatingRootContext`),T=x.useState(`mounted`),E=x.useState(`open`),D=x.useState(`openChangeReason`),O=x.useState(`activeTriggerElement`),k=x.useState(`modal`),A=x.useState(`openMethod`),j=x.useState(`positionerElement`),M=x.useState(`instantType`),ee=x.useState(`transitionStatus`),N=x.useState(`adaptiveOrigin`),P=Y.useRef(null),F=we(j),I=Pe({anchor:o,floatingRootContext:w,positionMethod:s,mounted:T,side:c,sideOffset:u,align:l,alignOffset:d,arrowPadding:m,collisionBoundary:f,collisionPadding:p,sticky:h,disableAnchorTracking:g,keepMounted:S,nodeId:C,collisionAvoidance:v,adaptiveOrigin:N}),L=w.useState(`domReferenceElement`);ke(()=>{let e=L,t=P.current;if(e&&(P.current=e),t&&e&&e!==t){x.set(`instantType`,void 0);let e=new AbortController;return F(()=>{x.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[L,F,x]);let R=k===!0&&D!==`trigger-hover`;t(E&&R,A===`touch`,j,O);let ne=x.useStateSetter(`positionerElement`),re={open:E,side:I.side,align:I.align,anchorHidden:I.anchorHidden,instant:M},ie=me(e,re,{styles:I.positionerStyles,transitionStatus:ee,props:b,refs:[n,ne],hidden:!T,inert:!E});return/*#__PURE__*/ (0,Z.jsxs)(Gt.Provider,{value:I,children:[T&&R&&/*#__PURE__*/ (0,Z.jsx)(Re,{inert:ce(!E),cutout:O}),/*#__PURE__*/ (0,Z.jsx)(y,{id:C,children:ie})]})}),Jt=/*#__PURE__*/ Y.createContext(void 0);function Yt(){let[e,t]=Y.useState(0),n=Ce(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:Y.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}var Xt=/*#__PURE__*/ Y.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,c=X(),l=Kt(),u=fe(!0)!=null,{context:d,hasClosePart:f}=Yt(),p=c.useState(`open`),h=c.useState(`openMethod`),g=c.useState(`instantType`),_=c.useState(`transitionStatus`),v=c.useState(`popupProps`),y=c.useState(`titleElementId`),b=c.useState(`descriptionElementId`),x=c.useState(`modal`),S=c.useState(`mounted`),C=c.useState(`openChangeReason`),w=c.useState(`activeTriggerElement`),T=c.useState(`floatingRootContext`),E=T.useState(`floatingId`),D=c.useState(`disabled`),k=c.useState(`openOnHover`),A=c.useState(`closeDelay`);Le({open:p,ref:c.context.popupRef,onComplete(){if(p){var e,t;(e=(t=c.context).onOpenChangeComplete)==null||e.call(t,!0)}}}),Ae(T,{enabled:k&&!D,closeDelay:A});let j=a===void 0?P(c.context.popupRef):a,M=x!==!1&&f;c.useSyncedValue(`focusManagerModal`,M);let ee=c.useStateSetter(`popupElement`),N={open:p,side:l.side,align:l.align,instant:g,transitionStatus:_},te=z(`div`,e,{state:N,ref:[t,c.context.popupRef,ee],props:[v,{id:E,role:`dialog`,...Ue,"aria-labelledby":y,"aria-describedby":b,onKeyDown(e){u&&Ie.has(e.key)&&e.stopPropagation()}},De(_),s],stateAttributesMapping:O});return/*#__PURE__*/ (0,Z.jsx)(m,{context:T,openInteractionType:h,modal:M,disabled:!S||C===`trigger-hover`,initialFocus:j,returnFocus:o,restoreFocus:`popup`,previousFocusableElement:le(w)?w:void 0,nextFocusableElement:c.context.triggerFocusTargetRef,beforeContentFocusGuardRef:c.context.beforeContentFocusGuardRef,children:/*#__PURE__*/ (0,Z.jsx)(Jt.Provider,{value:d,children:te})})}),Zt=/*#__PURE__*/ Y.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=X(),s=Ee(a.id);return o.useSyncedValueWithCleanup(`titleElementId`,s),z(`h2`,e,{ref:t,props:[{id:s},a]})}),Qt=/*#__PURE__*/ Y.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=X(),s=Ee(a.id);return o.useSyncedValueWithCleanup(`descriptionElementId`,s),z(`p`,e,{ref:t,props:[{id:s},a]})}),$t={fallbackAxisSide:`none`},en=8;function tn(e){switch(e){case`escape-key`:return`escape`;case`outside-press`:return`outside`;case`trigger-press`:return`trigger`;case`focus-out`:return`focus-out`;default:return`other`}}function nn({title:e,description:t,footerStart:n,footerEnd:r,side:i=`bottom`,align:a=`start`,collisionAvoidance:o,titleVisible:s=!0,className:c,initialFocusRef:l,trapFocus:u=!1,"data-testid":f,children:p,trigger:m,triggerTooltip:h,positionAnchor:g,anchor:_,open:y,onOpenChange:b}){let x=I(),S=`flex flex-col p-3 ${v}`;return/* @__PURE__ */ (0,Z.jsxs)(Rt,{open:y,modal:u?`trap-focus`:!1,onOpenChange:b===void 0?void 0:(e,t)=>{(e||!d(_,t.reason,t.event))&&b(e,tn(t.reason))},children:[m===void 0?null:h===void 0?/* @__PURE__ */ (0,Z.jsx)(Vt,{render:m}):/* @__PURE__ */ (0,Z.jsx)(xe,{relationship:h.relationship,content:h.content,children:/* @__PURE__ */ (0,Z.jsx)(Vt,{render:m})}),/* @__PURE__ */ (0,Z.jsx)(Wt,{container:x,children:/* @__PURE__ */ (0,Z.jsx)(qt,{anchor:g===void 0?_:g,side:i,align:a,collisionAvoidance:o,sideOffset:en,collisionPadding:8,positionMethod:`fixed`,className:`z-popover`,children:/* @__PURE__ */ (0,Z.jsxs)(Xt,{initialFocus:l,finalFocus:_===void 0?void 0:()=>_,"data-testid":f,className:c===void 0?`w-[280px] ${S}`:`${S} ${c}`,children:[/* @__PURE__ */ (0,Z.jsxs)(`div`,{className:s?`grid gap-0.5`:`sr-only`,children:[/* @__PURE__ */ (0,Z.jsx)(Zt,{className:`m-0 text-[length:var(--text-body-sm)] leading-normal font-semibold text-fg-primary`,children:e}),t===void 0?null:/* @__PURE__ */ (0,Z.jsx)(Qt,{className:`m-0 text-xs leading-normal text-fg-muted`,children:t})]}),/* @__PURE__ */ (0,Z.jsx)(`div`,{className:L(`grid gap-2`,s&&`mt-2.5`),children:p}),n!==void 0||r!==void 0?/* @__PURE__ */ (0,Z.jsxs)(`div`,{className:`mt-3 flex items-center justify-between gap-2 border-t border-stroke-light pt-2.5`,children:[/* @__PURE__ */ (0,Z.jsx)(`div`,{className:`flex items-center gap-2`,children:n}),/* @__PURE__ */ (0,Z.jsx)(`div`,{className:`flex items-center gap-2`,children:r})]}):null]})})})]})}var rn=`gap-0! rounded-lg! border-solid! border-(--color-border-strong)! bg-(--color-bg-modal)! p-1.5! shadow-(--shadow-menu)!`,an=`w-[320px] max-w-[calc(100vw-16px)] ${rn}`,on=`w-(--anchor-width) ${rn}`,sn=(0,Y.createContext)(null);function cn(){return(0,Y.useContext)(sn)}var ln=`grid size-7 shrink-0 place-items-center rounded-md border border-solid border-stroke bg-surface-secondary p-0 text-fg-primary transition-[border-color,background-color] duration-(--motion-short) ease-(--ease-out) enabled:hover:border-stroke-hover enabled:hover:bg-surface-hover focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--color-border-focus) disabled:cursor-default disabled:opacity-disabled [&>svg]:size-4`;function un({value:e,maxAgents:t,onValueChange:n,copy:r,settingsLink:i,disabled:a=!1,className:o}){return/* @__PURE__ */ (0,Z.jsxs)(`div`,{role:`group`,"aria-label":r.groupLabel,"data-testid":`effort-agents-stepper`,className:L(`flex items-center gap-3 rounded-md border border-solid border-stroke-light bg-(--color-bg-modal-inset) px-3 py-2 text-xs text-fg-primary [animation:var(--animation-slide-down)] motion-reduce:[animation:none]`,o),children:[/* @__PURE__ */ (0,Z.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[r.label,/* @__PURE__ */ (0,Z.jsxs)(`small`,{className:`block text-caption text-fg-muted`,children:[r.limit(t),`\u00A0`,i]})]}),/* @__PURE__ */ (0,Z.jsx)(`button`,{type:`button`,className:ln,"aria-label":r.fewer,disabled:a||e<=1,onClick:()=>n(e-1),"data-testid":`effort-agents-fewer`,children:/* @__PURE__ */ (0,Z.jsx)(_t,{"aria-hidden":`true`})}),/* @__PURE__ */ (0,Z.jsx)(`span`,{className:`min-w-7 text-center text-lg font-semibold tracking-[-0.3px] tabular-nums`,"data-testid":`effort-agents-value`,children:/* @__PURE__ */ (0,Z.jsx)(`span`,{className:`inline-block [animation:var(--animation-effort-tick)] motion-reduce:[animation:none]`,children:e},e)}),/* @__PURE__ */ (0,Z.jsx)(`button`,{type:`button`,className:ln,"aria-label":r.more,disabled:a||e>=t,onClick:()=>n(e+1),"data-testid":`effort-agents-more`,children:/* @__PURE__ */ (0,Z.jsx)(oe,{"aria-hidden":`true`})})]})}var dn=[`h-[5px]`,`h-2`,`h-[11px]`],fn=[``,`[animation-delay:40ms]`,`[animation-delay:80ms]`];function pn({level:e,look:t,rise:n=!1,className:r}){return/* @__PURE__ */ (0,Z.jsx)(`span`,{"aria-hidden":`true`,className:L(`inline-flex flex-none items-end`,t===`line`?`h-3 gap-[1.5px]`:`h-[11px] gap-0.5`,r),children:dn.map((r,i)=>{let a=i<e;return/* @__PURE__ */ (0,Z.jsx)(`i`,{className:L(`w-[3px] origin-bottom rounded-[1px]`,r,!a&&t!==`line`&&`bg-current opacity-25`,!a&&t===`line`&&`bg-(--color-text-disabled)`,a&&t===`line`&&`bg-(--color-primary-text)`,a&&t===`quiet`&&`bg-current opacity-70`,a&&t===`lit`&&`bg-primary`,a&&t===`lit`&&n&&`[animation:var(--animation-effort-rise)]`,a&&t===`lit`&&n&&fn[i])},r)})})}var mn={effort:`normal`},hn={kind:`none`};function gn(e,t){switch(t.kind){case`none`:return!0;case`place`:return e!==`max`}}function _n(e,t){return Math.min(Math.max(e,1),t)}function vn(e,t){return e===`max`?{effort:`max`,maxAgents:t}:{effort:e}}function yn(e,t,n){return e.effort===`max`?{effort:`max`,maxAgents:_n(t,n)}:e}function bn(e,t){return e.effort===`max`||t.effort===`max`?e.effort===`max`&&t.effort===`max`&&e.maxAgents===t.maxAgents:e.effort===t.effort}function xn(e,t){return gn(e.effort,t.block)?e.effort===`max`?{effort:`max`,maxAgents:_n(e.maxAgents,t.maxAgents)}:e:mn}var Sn={kind:`chip`},Cn=[`normal`,`thinking`,`max`],wn={normal:1,thinking:2,max:3},Tn=`qa-ai-chat-effort inline-flex h-7 items-center gap-1.5 whitespace-nowrap rounded-full border border-solid pr-[7px] pl-[9px] text-xs font-medium transition-[border-color,background-color,color,box-shadow] duration-(--motion-short) focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--color-border-focus) disabled:cursor-default disabled:opacity-50`;function En({choice:e,facts:t,onChoose:n,onAgentsChange:r,onOpenSettings:i,copy:a,look:o,disabled:s=!1}){let[c,l]=(0,Y.useState)(!1),[u,d]=(0,Y.useState)(null),f=(0,Y.useRef)(null),p=cn(),m=t===null||s,h=c&&!m,g=e.effort===`max`?a.long.max(e.maxAgents):a.long[e.effort],_=u!==null&&bn(u,e)?a.chipLabel(g):``,v=e=>t!==null&&gn(e,t.block),y=e=>{v(e)&&t!==null&&(n(e),d(vn(e,t.maxAgents)))},b=n=>{t!==null&&(r(n),d(yn(e,n,t.maxAgents)))},x=e=>{let t=[...e.currentTarget.querySelectorAll(`[role="radio"]`)].filter(e=>e.getAttribute(`aria-disabled`)!==`true`),n=t.findIndex(e=>e===document.activeElement),r=n=>{let r=t[n];if(r===void 0)return;e.preventDefault(),r.focus();let i=r.dataset.value,a=Cn.find(e=>e===i);a!==void 0&&y(a)};switch(e.key){case`ArrowDown`:case`ArrowRight`:r((n+1)%t.length);break;case`ArrowUp`:case`ArrowLeft`:r((n-1+t.length)%t.length);break;case`Home`:r(0);break;case`End`:r(t.length-1)}},S=e=>t!==null&&t.block.kind===`place`&&!gn(e,t.block)?a.reasonPlace:null,C=o.kind===`setting`?/* @__PURE__ */ (0,Z.jsxs)(`button`,{type:`button`,className:`qa-ai-chat-set`,"aria-label":a.chipLabel(g),disabled:m,"data-effort":e.effort,"data-testid":`ai-chat-effort-chip`,children:[/* @__PURE__ */ (0,Z.jsx)(pn,{level:wn[e.effort],look:`line`}),/* @__PURE__ */ (0,Z.jsxs)(`span`,{className:`qa-ai-chat-set-value`,children:[/* @__PURE__ */ (0,Z.jsx)(`span`,{className:`qa-ai-chat-set-long`,children:e.effort===`max`?a.chipMax(e.maxAgents):a.levels[e.effort]}),/* @__PURE__ */ (0,Z.jsx)(`span`,{className:`qa-ai-chat-set-short`,children:e.effort===`max`?o.chipMaxShort(e.maxAgents):a.levels[e.effort]})]})]}):/* @__PURE__ */ (0,Z.jsxs)(`button`,{type:`button`,className:L(Tn,e.effort===`max`?`border-[color-mix(in_srgb,var(--color-primary)_45%,transparent)] bg-(--color-bg-primary-tint-10) text-(--color-primary-text)`:`border-(--color-border) bg-transparent text-fg-secondary enabled:hover:border-(--color-border-hover) enabled:hover:text-fg-primary`,h&&`border-(--color-border-focus) shadow-(--glow-primary-sm)`),"aria-label":a.chipLabel(g),disabled:m,"data-effort":e.effort,"data-testid":`ai-chat-effort-chip`,children:[/* @__PURE__ */ (0,Z.jsx)(pn,{level:wn[e.effort],look:`lit`,className:`w-3.5 justify-center`}),/* @__PURE__ */ (0,Z.jsx)(`span`,{children:e.effort===`max`?a.chipMax(e.maxAgents):a.levels[e.effort]}),/* @__PURE__ */ (0,Z.jsx)(Te,{"aria-hidden":`true`,className:L(`size-3 transition-transform duration-(--motion-medium) ease-(--ease-out)`,h&&`rotate-180`)})]});return/* @__PURE__ */ (0,Z.jsxs)(Z.Fragment,{children:[/* @__PURE__ */ (0,Z.jsx)(nn,{title:a.name,titleVisible:!1,trigger:C,open:h,onOpenChange:e=>l(e&&!m),side:`top`,collisionAvoidance:$t,...p===null?{}:{positionAnchor:p},initialFocusRef:f,className:p===null?an:on,"data-testid":`ai-chat-effort-popover`,children:t!==null&&/* @__PURE__ */ (0,Z.jsxs)(`div`,{className:`flex flex-col`,children:[/* @__PURE__ */ (0,Z.jsxs)(`div`,{"aria-hidden":`true`,className:`flex items-baseline justify-between gap-2 px-2 py-1.5`,children:[/* @__PURE__ */ (0,Z.jsx)(`b`,{className:`text-xs font-semibold tracking-[-0.1px] text-fg-primary`,children:a.name}),a.note!==null&&/* @__PURE__ */ (0,Z.jsx)(`small`,{className:`text-caption text-fg-muted`,children:a.note})]}),/* @__PURE__ */ (0,Z.jsx)(`div`,{role:`radiogroup`,"aria-label":a.name,className:`flex flex-col gap-px`,onKeyDown:x,children:Cn.map(t=>{let n=e.effort===t,r=!v(t),i=S(t);return/* @__PURE__ */ (0,Z.jsxs)(`button`,{ref:n?f:void 0,type:`button`,role:`radio`,"aria-checked":n,"aria-disabled":r||void 0,tabIndex:n?0:-1,"data-value":t,"data-testid":`ai-chat-effort-${t}`,onClick:()=>y(t),className:L(`grid w-full grid-cols-[16px_minmax(0,1fr)_16px] items-center gap-2.5 rounded-md border-0 bg-transparent px-2 py-[7px] text-left text-fg-secondary`,`focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-(--color-border-focus)`,r?`cursor-not-allowed text-fg-muted opacity-55`:`hover:bg-(--color-bg-elevated-hover) focus-visible:bg-(--color-bg-elevated-hover)`),children:[/* @__PURE__ */ (0,Z.jsx)(pn,{level:wn[t],look:n?`lit`:`quiet`}),/* @__PURE__ */ (0,Z.jsxs)(`span`,{children:[/* @__PURE__ */ (0,Z.jsx)(`b`,{className:`block text-body-sm font-medium text-fg-primary`,children:a.levels[t]}),/* @__PURE__ */ (0,Z.jsx)(`small`,{className:`block text-caption leading-[1.4] text-fg-muted`,"data-testid":i===null?void 0:`ai-chat-effort-withheld`,children:i===null?a.rows[t]:i})]}),/* @__PURE__ */ (0,Z.jsx)(Fe,{"aria-hidden":`true`,className:L(`size-3.5 text-(--color-primary-text)`,!n&&`invisible`)})]},t)})}),e.effort===`max`&&/* @__PURE__ */ (0,Z.jsx)(un,{className:`mx-1 mb-1`,value:e.maxAgents,maxAgents:t.maxAgents,onValueChange:b,copy:a.agents,settingsLink:/* @__PURE__ */ (0,Z.jsx)(`button`,{type:`button`,className:`inline border-0 bg-transparent p-0 text-left text-caption text-fg-muted underline-offset-2 hover:text-(--color-primary-text) hover:underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--color-border-focus)`,onClick:i,children:a.agents.settingsLink})}),a.footer!==null&&/* @__PURE__ */ (0,Z.jsx)(`div`,{className:`mt-1 border-0 border-t border-solid border-(--color-border-light) px-2 pt-2 pb-1 text-caption text-fg-muted`,children:a.footer})]})}),/* @__PURE__ */ (0,Z.jsx)(`span`,{className:`sr-only`,"aria-live":`polite`,children:_})]})}var Dn=`text-primary hover:underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--color-border-focus)`;function On({state:e,disabled:t=!1}){let{t:r}=Ve(),{navigation:i}=w(),a=(0,Y.useId)(),o=kn(),{refusal:s}=e;return/* @__PURE__ */ (0,Z.jsxs)(`div`,{className:`flex flex-col gap-1.5`,"data-effort":e.choice.effort,"data-testid":`launch-effort`,children:[/* @__PURE__ */ (0,Z.jsx)(`span`,{id:a,className:`text-body-sm font-medium text-fg-secondary`,children:o.name}),/* @__PURE__ */ (0,Z.jsx)(`div`,{role:`group`,"aria-labelledby":a,className:`flex items-center`,children:/* @__PURE__ */ (0,Z.jsx)(En,{choice:e.choice,facts:e.facts,onChoose:e.choose,onAgentsChange:e.setAgents,onOpenSettings:()=>i.openInWeb({kind:`ai-settings`},`new-tab`),copy:o,look:Sn,disabled:t||e.locked})}),e.locked&&/* @__PURE__ */ (0,Z.jsx)(`p`,{className:`m-0 text-caption leading-[1.45] text-fg-muted`,"data-testid":`launch-effort-locked`,children:r(`launchEffort.locked`)}),e.loadError!==null&&/* @__PURE__ */ (0,Z.jsx)(N,{tone:`error`,title:r(`launchEffort.loadError`),actions:/* @__PURE__ */ (0,Z.jsx)(n,{onClick:e.reload,children:r(`common.retry`)})}),s!==null&&/* @__PURE__ */ (0,Z.jsx)(N,{tone:`error`,title:r(`launchEffort.refusal.title`),"data-testid":`launch-effort-refusal`,children:s.kind===`agentsOverMax`?r(`launchEffort.refusal.agentsOverMax`,{max:s.max}):/* @__PURE__ */ (0,Z.jsxs)(Z.Fragment,{children:[s.modelName===null?r(`launchEffort.refusal.leadModelNone`):r(`launchEffort.refusal.leadModelNamed`,{model:s.modelName}),` `,/* @__PURE__ */ (0,Z.jsx)(E,{target:{kind:`ai-settings`},placement:`new-tab`,className:Dn,children:r(`launchEffort.refusal.chooseModel`)})]})})]})}function kn(){let{t:e}=Ve();return{name:e(`launchEffort.label`),note:null,levels:{normal:e(`launchEffort.levels.normal`),thinking:e(`launchEffort.levels.thinking`),max:e(`launchEffort.levels.max`)},rows:{normal:e(`launchEffort.lines.normal`),thinking:e(`launchEffort.lines.thinking`),max:e(`launchEffort.lines.max`)},footer:null,chipMax:t=>e(`launchEffort.chipMax`,{count:t}),long:{normal:e(`launchEffort.long.normal`),thinking:e(`launchEffort.long.thinking`),max:t=>e(`launchEffort.long.max`,{count:t})},chipLabel:t=>e(`launchEffort.chipLabel`,{level:t}),reasonPlace:e(`launchEffort.reasonPlace`),agents:{label:e(`launchEffort.agents.label`),limit:t=>e(`launchEffort.agents.limit`,{max:t}),settingsLink:e(`launchEffort.agents.settingsLink`),groupLabel:e(`launchEffort.agents.groupLabel`),fewer:e(`launchEffort.agents.fewer`),more:e(`launchEffort.agents.more`)}}}var An=`peer m-0 size-3.75 shrink-0 cursor-pointer appearance-none rounded-xs border-(length:--checkbox-border-width) border-solid border-stroke-strong bg-transparent [transition:background-color_var(--motion-short)_var(--ease-out),border-color_var(--motion-short)_var(--ease-out)] hover:not-checked:not-indeterminate:border-primary-400 group-hover/check:not-checked:not-indeterminate:border-primary-400 checked:border-primary checked:bg-primary indeterminate:border-primary indeterminate:bg-primary focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-stroke-focus disabled:cursor-not-allowed disabled:opacity-disabled`,jn=`pointer-events-none absolute size-2.75 scale-[.6] text-fg-on-accent opacity-0 [transition:opacity_var(--motion-short)_var(--ease-out),scale_var(--motion-medium)_var(--ease-out)]`;function Mn({checked:e,onChange:t,indeterminate:n=!1,disabled:r=!1,label:i,id:a,describedBy:o,...s}){let c=(0,Y.useRef)(null);(0,Y.useEffect)(()=>{c.current!==null&&(c.current.indeterminate=n)});let l=/* @__PURE__ */ (0,Z.jsxs)(`span`,{className:`relative inline-grid size-3.75 shrink-0 place-items-center`,children:[/* @__PURE__ */ (0,Z.jsx)(`input`,{ref:c,type:`checkbox`,id:a,checked:e,disabled:r,"aria-checked":n?`mixed`:void 0,"aria-label":s[`aria-label`],"aria-describedby":o,"data-testid":s[`data-testid`],onChange:e=>t(e.target.checked),className:An}),n?/* @__PURE__ */ (0,Z.jsx)(_t,{"aria-hidden":`true`,strokeWidth:3,className:L(jn,`peer-indeterminate:scale-100 peer-indeterminate:opacity-100`)}):/* @__PURE__ */ (0,Z.jsx)(Fe,{"aria-hidden":`true`,strokeWidth:3,className:L(jn,`peer-checked:scale-100 peer-checked:opacity-100`)})]});return i===void 0?l:/* @__PURE__ */ (0,Z.jsxs)(`label`,{className:L(`group/check inline-flex select-none items-center gap-2.5 text-body-sm text-fg-primary`,r?`cursor-not-allowed`:`cursor-pointer`),children:[l,i]})}function Nn({value:e,onValueChange:t,clearLabel:n,count:r,look:i=`field`,size:a=`md`,className:o,ref:s,...c}){let l=(0,Y.useRef)(null),u=e!==``,d=R();return/* @__PURE__ */ (0,Z.jsxs)(`div`,{className:L(i===`quiet`?re:ne(`default`,!1,d,a,`search`),o),children:[/* @__PURE__ */ (0,Z.jsx)(`span`,{className:Me,children:/* @__PURE__ */ (0,Z.jsx)(ie,{"aria-hidden":`true`})}),/* @__PURE__ */ (0,Z.jsx)(`input`,{ref:e=>{l.current=e,typeof s==`function`?s(e):s&&(s.current=e)},type:`search`,value:e,onChange:e=>t(e.target.value),className:L(S,`[&::-webkit-search-cancel-button]:appearance-none`),...c}),u&&r!==void 0&&/* @__PURE__ */ (0,Z.jsx)(`span`,{className:`shrink-0 text-xs tabular-nums text-fg-muted`,children:r}),u&&/* @__PURE__ */ (0,Z.jsx)(p,{size:`sm`,className:`-mr-1.5`,"aria-label":n,icon:/* @__PURE__ */ (0,Z.jsx)(Ne,{"aria-hidden":`true`}),onClick:()=>{var e;t(``),(e=l.current)==null||e.focus()}})]})}async function Pn(e,t){let[n,r]=await Promise.all([e.aiSettings.getUser({signal:t}),e.modelPreferences.get(`swarm_lead`,{signal:t})]);return{maxAgents:n.swarm.maxAgents,leadSelectionName:r.selection===null?null:r.selection.name}}var Fn=/* @__PURE__ */ new Set([`ai_models.selection_not_sendable`,`ai_models.no_sendable_model`]);function In(e=mn,t=!1){let n=C(),[r,i]=(0,Y.useState)(e),[a,o]=(0,Y.useState)(null),[s,c]=(0,Y.useState)(!1),{data:u,loading:d,error:f,reload:p,reloadAfterChange:m}=l({fetcher:e=>Pn(n,e),deps:[n]}),h=t?{kind:`place`}:{kind:`none`},g=u===void 0?null:{...u,block:h},_=g===null||s?r:xn(r,g);return{facts:g,loading:d,loadError:f,reload:p,choice:_,choose:e=>{g===null||s||(o(null),i(vn(e,g.maxAgents)))},setAgents:e=>{g===null||s||(o(null),i(yn(_,e,g.maxAgents)))},input:_,refusal:a,locked:s,lock:()=>{i(_),c(!0)},releaseLock:()=>c(!1),adoptLaunchRefusal:e=>{if(!(e instanceof M)||e.errorCode===void 0)return!1;let t=e.errorCode;if(t===`workflows.agents_over_max`){var n;let t=Ye.safeParse((n=e.params)==null?void 0:n.max);return m(),t.success?(i({effort:`max`,maxAgents:t.data}),o({kind:`agentsOverMax`,max:t.data}),!0):!1}return _.effort===`max`&&Fn.has(t)?(m(),o({kind:`leadModel`,modelName:t===`ai_models.selection_not_sendable`&&g!==null?g.leadSelectionName:null}),!0):!1},clearRefusal:()=>o(null),reset:()=>{i(e),o(null)}}}var Ln=`\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022`,Rn=`ui-secret-dots`;function zn({label:e,size:t=`md`,className:n,"data-testid":r}){return/* @__PURE__ */ (0,Z.jsxs)(`span`,{role:`img`,"aria-label":e,"data-testid":r,className:L(`inline-flex max-w-full min-w-0 items-center gap-1.5 rounded-md border border-stroke-light bg-surface-hover-layer text-(length:--text-body-sm)`,t===`sm`?`h-6 px-1.5`:`h-8 px-2.5`,n),children:[/* @__PURE__ */ (0,Z.jsx)(gt,{size:14,className:`shrink-0 text-fg-muted`,"aria-hidden":`true`}),/* @__PURE__ */ (0,Z.jsx)(`span`,{className:L(Rn,`tracking-[2px] text-fg-secondary`),"aria-hidden":`true`,children:Ln})]})}var Q=5e3;function Bn(e,t,n){return G().min(1).max(n).refine(e=>e===it(e),{message:`${e} must be the ${t} with whitespace collapsed: no leading or trailing whitespace, no line breaks, tabs or repeated spaces, no zero-width spaces`})}var $=Bn(`targetName`,`element name`,200).nullable().optional(),Vn=J({}),Hn=J({expectedText:G().min(1).max(Q),targetName:$}),Un=J({expectedText:G().min(1).max(Q),targetName:$}),Wn=J({targetName:$}),Gn=J({targetName:$}),Kn=J({targetText:Bn(`targetText`,`element text`,Q).nullable().optional(),targetName:$}),qn=J({expectedValue:G().max(Q),targetName:$}),Jn={text_free:Vn,text_contains:Hn,text_equals:Un,assert_text:J({mode:Xe([`equals`,`contains`,`matches`,`starts_with`,`ends_with`]),value:G().max(Q)}),element_visible:Wn,element_exists:Gn,element_not_exists:Kn,input_value:qn};function Yn(e,t){return Jn[e].safeParse(t)}var Xn=`frame-page-path-shape-v1`,Zn=[`url`,`page_text`,`screenshot`],Qn=[`content_script`,`service_worker`,`playback_runtime`],$n=G().regex(/^[0-9a-f]{64}$/),er=G().min(1).max(128).regex(/^[A-Za-z0-9][A-Za-z0-9._:-]*$/),tr=J({mode:q(Xn),originSha256:$n,pathnameShapeSha256:$n}).strict(),nr=J({...U.shape,pageId:W(),sortOrder:K().int().nonnegative(),sourceType:q(`url_pathname`),kind:q(`segment`),segmentIndex:K().int().min(0).max(50),applicability:tr}).strict(),rr=J({...U.shape,pageId:W(),sortOrder:K().int().nonnegative(),sourceType:q(`url_href`),kind:q(`regex`),regexPattern:G().min(1).max(500).refine(e=>e.trim().length>0,`regexPattern must not be blank`),regexGroup:K().int().min(0).max(20)}).strict(),ir=H(`sourceType`,[nr,rr]);J({maskContractVersion:q(2),frameRevision:er,activeStepIndex:K().int().nonnegative(),activeStepId:W(),activePageId:W(),activeNextPageId:W().nullable(),rules:Ze(ir),rulesDigest:$n}).strict(),J({fieldPath:G().min(1).max(512),kind:Xe(Zn),pageId:W(),stepId:U.shape.stepId.nullable(),occurrence:U.shape.occurrence.nullable(),urlEpoch:K().int().nonnegative().nullable(),provenance:Xe(Qn)}).strict().superRefine((e,t)=>{e.stepId===null!=(e.occurrence===null)&&t.addIssue({code:`custom`,path:[`occurrence`],message:`URL secret surface context occurrence must be null exactly when stepId is null`})});var ar=`WORKFLOW_LAUNCH`,or=`WORKFLOW_HOST_ATTACH`;J({type:q(ar),clientRequestId:W(),projectId:W(),surface:Xe([`extension_atlas_card`,`extension_make_auto_modal`]),launch:Qe,maxAgents:Ye,accessHint:G().min(1).nullable()}).strict(),J({type:q(or),workflowId:W(),accessHint:G().min(1).nullable()}).strict();var sr=H(`kind`,[J({kind:q(`attached`),epoch:K().int()}).strict(),J({kind:q(`pending`),detail:G()}).strict(),J({kind:q(`refused`),outcome:G(),detail:G().nullable()}).strict(),J({kind:q(`unreadable`),outcome:G(),detail:G().nullable()}).strict()]),cr=H(`ok`,[J({ok:q(!0),result:sr}).strict(),J({ok:q(!1),refusal:H(`kind`,[J({kind:q(`malformed_message`)}).strict(),J({kind:q(`no_launch_window`)}).strict(),J({kind:q(`attach_failed`),detail:G()}).strict()])}).strict()]),lr=H(`ok`,[J({ok:q(!0),workflowId:W(),attach:tt([sr,J({kind:q(`attach_failed`),detail:G()}).strict()])}).strict(),J({ok:q(!1),refusal:H(`kind`,[J({kind:q(`malformed_message`)}).strict(),J({kind:q(`no_launch_window`)}).strict(),J({kind:q(`refused`),status:K().int(),errorCode:G(),params:et(G(),$e()).nullable()}).strict(),J({kind:q(`unreachable`),detail:G(),errorCode:G().nullable()}).strict(),J({kind:q(`protocol_error`),detail:G()}).strict()])}).strict()]);export{ut as $,sn as A,Et as B,Sn as C,xn as D,vn as E,nn as F,vt as G,xt as H,Ct as I,ht as J,_t as K,kt as L,an as M,on as N,yn as O,$t as P,dt as Q,Ot as R,En as S,hn as T,bt as U,St as V,yt as W,pt as X,mt as Y,ft as Z,In as _,$n as a,On as b,Jn as c,Wn as d,lt as et,qn as f,zn as g,Yn as h,lr as i,at as it,cn as j,pn as k,Gn as l,Un as m,ar as n,st as nt,er as o,Hn as p,gt as q,cr as r,ot as rt,ir as s,or as t,ct as tt,Kn as u,Nn as v,mn as w,kn as x,Mn as y,At as z};