@stigmer/server-slim 0.1.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 (564) hide show
  1. package/README.md +3 -0
  2. package/console/404.html +1 -0
  3. package/console/__next.__PAGE__.txt +54 -0
  4. package/console/__next._full.txt +71 -0
  5. package/console/__next._index.txt +62 -0
  6. package/console/__next._tree.txt +6 -0
  7. package/console/_next/static/GjBokeF86FffwftazOhh6/_buildManifest.js +11 -0
  8. package/console/_next/static/GjBokeF86FffwftazOhh6/_clientMiddlewareManifest.js +1 -0
  9. package/console/_next/static/GjBokeF86FffwftazOhh6/_ssgManifest.js +1 -0
  10. package/console/_next/static/chunks/0376wi8qbsw94.js +1 -0
  11. package/console/_next/static/chunks/04cglffeuwumk.js +1 -0
  12. package/console/_next/static/chunks/04d276dp3qb52.js +1 -0
  13. package/console/_next/static/chunks/05526ws9tzwim.js +1 -0
  14. package/console/_next/static/chunks/05t5235u7o-c4.js +25 -0
  15. package/console/_next/static/chunks/06fz-g9t73bd6.js +4 -0
  16. package/console/_next/static/chunks/0789xt7opwvm-.js +24 -0
  17. package/console/_next/static/chunks/07twy5plc911w.js +1 -0
  18. package/console/_next/static/chunks/08-p5zefc1rea.js +1 -0
  19. package/console/_next/static/chunks/085db4op75mf5.js +1 -0
  20. package/console/_next/static/chunks/0923388wak11-.js +1 -0
  21. package/console/_next/static/chunks/0_7s7fzux7kiv.js +1 -0
  22. package/console/_next/static/chunks/0_bjj6hug8d9a.js +1 -0
  23. package/console/_next/static/chunks/0_zscrk6o0d0-.js +1 -0
  24. package/console/_next/static/chunks/0a4x97q7frgj3.js +1 -0
  25. package/console/_next/static/chunks/0ab5jlm8l0aud.js +1 -0
  26. package/console/_next/static/chunks/0c_c2b4z1yc02.js +1 -0
  27. package/console/_next/static/chunks/0cuyycns49hl4.js +1 -0
  28. package/console/_next/static/chunks/0cz1d0mv5g_q7.js +1 -0
  29. package/console/_next/static/chunks/0d8f3-znyc_to.js +1 -0
  30. package/console/_next/static/chunks/0e-f1rkyz_u2k.js +1 -0
  31. package/console/_next/static/chunks/0ffx83gbnwq09.js +28 -0
  32. package/console/_next/static/chunks/0fyno0jk61txk.js +115 -0
  33. package/console/_next/static/chunks/0ggwoicp90w_s.js +1 -0
  34. package/console/_next/static/chunks/0h_7_i44vofe3.js +1 -0
  35. package/console/_next/static/chunks/0hagmppwo8s-f.js +1 -0
  36. package/console/_next/static/chunks/0hfvbn6c9k3pf.js +1 -0
  37. package/console/_next/static/chunks/0hw7vilkfpzlc.js +1 -0
  38. package/console/_next/static/chunks/0kb63xcvghh_3.js +1 -0
  39. package/console/_next/static/chunks/0ko5wsi6kukgd.js +1 -0
  40. package/console/_next/static/chunks/0kq99qin4db-q.js +1 -0
  41. package/console/_next/static/chunks/0kqg4u5n17gje.js +1 -0
  42. package/console/_next/static/chunks/0ky9qppyx1n57.js +62 -0
  43. package/console/_next/static/chunks/0og4_5pph-mhm.js +1 -0
  44. package/console/_next/static/chunks/0p7p-bpdrqx75.js +1 -0
  45. package/console/_next/static/chunks/0q2bnr94vvuc2.js +1 -0
  46. package/console/_next/static/chunks/0q3sxhnylk_gn.js +1 -0
  47. package/console/_next/static/chunks/0qg6l3tattq3j.js +1 -0
  48. package/console/_next/static/chunks/0qwyk_70quvjh.js +1 -0
  49. package/console/_next/static/chunks/0qzyqii8_m5r2.js +1 -0
  50. package/console/_next/static/chunks/0rlfx91598uvc.js +1 -0
  51. package/console/_next/static/chunks/0s9njms3lumhx.js +1 -0
  52. package/console/_next/static/chunks/0srualwd948m1.js +29 -0
  53. package/console/_next/static/chunks/0u4m2805tgi7x.js +1 -0
  54. package/console/_next/static/chunks/0udcs-1vq74rp.js +1 -0
  55. package/console/_next/static/chunks/0vno04lmwdchj.js +1 -0
  56. package/console/_next/static/chunks/0vt1_fu_q116n.js +1 -0
  57. package/console/_next/static/chunks/0vuq85gcb9zcl.js +1 -0
  58. package/console/_next/static/chunks/0wxazby0i4xu3.js +5 -0
  59. package/console/_next/static/chunks/0yeh2zqwmmec0.js +22 -0
  60. package/console/_next/static/chunks/0zvl88sijsrqk.js +1 -0
  61. package/console/_next/static/chunks/110bgpy30m6m6.js +1 -0
  62. package/console/_next/static/chunks/14ipylvs6qyyw.js +1 -0
  63. package/console/_next/static/chunks/1745jt9onokna.js +1 -0
  64. package/console/_next/static/chunks/177rfq0tsoku9.js +4 -0
  65. package/console/_next/static/chunks/17mfsiiquey1d.js +1 -0
  66. package/console/_next/static/chunks/197iuvi8udifl.js +1 -0
  67. package/console/_next/static/chunks/1_2-z0tjk0xio.js +1 -0
  68. package/console/_next/static/chunks/1_gh5a14dqnji.js +1 -0
  69. package/console/_next/static/chunks/1ame8n7x9g3xc.js +1 -0
  70. package/console/_next/static/chunks/1apepr-7dz16b.js +1 -0
  71. package/console/_next/static/chunks/1dtukwrl8nulc.js +1 -0
  72. package/console/_next/static/chunks/1e0br64ibniud.js +24 -0
  73. package/console/_next/static/chunks/1fm-45g777ifx.js +1 -0
  74. package/console/_next/static/chunks/1g_iha5barqef.js +1 -0
  75. package/console/_next/static/chunks/1glr_lki18csr.js +2 -0
  76. package/console/_next/static/chunks/1hl355w6m5bp5.js +1 -0
  77. package/console/_next/static/chunks/1id3p9v9v5knn.js +1 -0
  78. package/console/_next/static/chunks/1j6kp4gg0_ylt.js +80 -0
  79. package/console/_next/static/chunks/1jssq3ch7qgd6.js +60 -0
  80. package/console/_next/static/chunks/1jzfyfh-3gqlb.js +1 -0
  81. package/console/_next/static/chunks/1k3d5c49mpp-2.js +1 -0
  82. package/console/_next/static/chunks/1kte_bxw9m-ie.js +1 -0
  83. package/console/_next/static/chunks/1lw52jm27gon2.js +1 -0
  84. package/console/_next/static/chunks/1m9e28v8syzxx.js +34 -0
  85. package/console/_next/static/chunks/1mrmq_pigo_yb.js +1 -0
  86. package/console/_next/static/chunks/1muf1a96cgbv5.js +1 -0
  87. package/console/_next/static/chunks/1n1x0ykt8by6w.js +1 -0
  88. package/console/_next/static/chunks/1qu0tqybdtj0_.js +1 -0
  89. package/console/_next/static/chunks/1r8itpdfffwxa.js +1 -0
  90. package/console/_next/static/chunks/1r_opkrpbuykx.js +1 -0
  91. package/console/_next/static/chunks/1tl0h3c_bp62t.js +1 -0
  92. package/console/_next/static/chunks/1v1m1fr8f0yle.js +1 -0
  93. package/console/_next/static/chunks/1v34vj52v7q0g.js +1 -0
  94. package/console/_next/static/chunks/1wztfxoxnu5_9.js +1 -0
  95. package/console/_next/static/chunks/1x7exm5d_hhb8.js +153 -0
  96. package/console/_next/static/chunks/1xwdphzrhi9cn.js +1 -0
  97. package/console/_next/static/chunks/1yc4gdqzxa5ie.js +1 -0
  98. package/console/_next/static/chunks/1zunrzvni97zi.js +1 -0
  99. package/console/_next/static/chunks/1zv6mtmekep40.js +36 -0
  100. package/console/_next/static/chunks/2-jaie5wchnsy.js +1 -0
  101. package/console/_next/static/chunks/20aa5hen470pm.js +1 -0
  102. package/console/_next/static/chunks/2116ko93nwgx8.js +1 -0
  103. package/console/_next/static/chunks/23vk0ig36j0he.js +1 -0
  104. package/console/_next/static/chunks/245vlws7l85dk.js +1 -0
  105. package/console/_next/static/chunks/24__o4dkdytc8.js +1 -0
  106. package/console/_next/static/chunks/24iwqo9ejhxl8.js +127 -0
  107. package/console/_next/static/chunks/24o9ia1be2cze.js +1 -0
  108. package/console/_next/static/chunks/25aea0bgjydel.css +1 -0
  109. package/console/_next/static/chunks/26-p2jxr4f20d.js +1 -0
  110. package/console/_next/static/chunks/28c--yt2jaxxf.js +1 -0
  111. package/console/_next/static/chunks/28vym848oh1ng.js +1 -0
  112. package/console/_next/static/chunks/29ou6qb6p1lni.js +1 -0
  113. package/console/_next/static/chunks/2aalpmeu_tni-.js +3 -0
  114. package/console/_next/static/chunks/2c4ifddi2dal0.js +20 -0
  115. package/console/_next/static/chunks/2ckm4edha_gkb.js +43 -0
  116. package/console/_next/static/chunks/2d5ods6a8n6yd.js +1 -0
  117. package/console/_next/static/chunks/2dm5g7ylrulvb.js +15 -0
  118. package/console/_next/static/chunks/2dtosus35_o5k.js +1 -0
  119. package/console/_next/static/chunks/2e0_cm1_wv-b4.js +1 -0
  120. package/console/_next/static/chunks/2fh_0n31hibdi.js +226 -0
  121. package/console/_next/static/chunks/2fjsaw5pgjcqb.js +1 -0
  122. package/console/_next/static/chunks/2h5pk3yu15nwr.js +1 -0
  123. package/console/_next/static/chunks/2i7w4yyf77gzw.js +1 -0
  124. package/console/_next/static/chunks/2jo3q7mfk65kd.js +1 -0
  125. package/console/_next/static/chunks/2jutbapb-t64n.js +31 -0
  126. package/console/_next/static/chunks/2k6tx8-w1creu.js +148 -0
  127. package/console/_next/static/chunks/2kh_m5onqedc5.js +1 -0
  128. package/console/_next/static/chunks/2ltzdgpjq3v6a.js +1 -0
  129. package/console/_next/static/chunks/2o2ftjhtb8od3.js +2 -0
  130. package/console/_next/static/chunks/2pyn841-jq-oo.js +10 -0
  131. package/console/_next/static/chunks/2rn289343m-y_.js +139 -0
  132. package/console/_next/static/chunks/2t2l3h2w_04bb.js +1 -0
  133. package/console/_next/static/chunks/2v11hooq3xd5t.js +15 -0
  134. package/console/_next/static/chunks/2vsg5t3fnqmfn.js +1 -0
  135. package/console/_next/static/chunks/2wayafjfoiq7q.css +6 -0
  136. package/console/_next/static/chunks/2xsvteosdtsb-.js +1 -0
  137. package/console/_next/static/chunks/2y-x8nhnufxzb.js +1 -0
  138. package/console/_next/static/chunks/2za4b-si894xj.js +1 -0
  139. package/console/_next/static/chunks/3-igvp1-n4pxs.js +104 -0
  140. package/console/_next/static/chunks/3-k25f-adpe5f.js +1 -0
  141. package/console/_next/static/chunks/3-pzmot7dbrfa.js +1 -0
  142. package/console/_next/static/chunks/3-x5lrgs3wcpl.js +80 -0
  143. package/console/_next/static/chunks/30nrkrr9518_z.js +1 -0
  144. package/console/_next/static/chunks/316lh1-hzgnod.js +1 -0
  145. package/console/_next/static/chunks/31wj1au8smjge.js +1 -0
  146. package/console/_next/static/chunks/329o6uup9qmb3.js +1 -0
  147. package/console/_next/static/chunks/34_1w929-5o6r.js +287 -0
  148. package/console/_next/static/chunks/35szx1ga574xu.js +1 -0
  149. package/console/_next/static/chunks/36tg522pkl8hm.js +1 -0
  150. package/console/_next/static/chunks/37-y9fgnir35a.js +1 -0
  151. package/console/_next/static/chunks/39wss1g0ffaqt.js +1 -0
  152. package/console/_next/static/chunks/3_cv0gj1bm3l6.js +1 -0
  153. package/console/_next/static/chunks/3_f8gd_6816re.js +101 -0
  154. package/console/_next/static/chunks/3a4qfuhsxefh2.js +12 -0
  155. package/console/_next/static/chunks/3asb3ztrvogwl.js +1 -0
  156. package/console/_next/static/chunks/3bsxbw10qhvqo.js +1 -0
  157. package/console/_next/static/chunks/3by94g38ljxl1.js +1 -0
  158. package/console/_next/static/chunks/3c_6owv8m4rta.js +90 -0
  159. package/console/_next/static/chunks/3ea2eo8b5gmju.js +2 -0
  160. package/console/_next/static/chunks/3ercnb2rksl_a.js +1 -0
  161. package/console/_next/static/chunks/3esxfmmm0ypxb.js +2 -0
  162. package/console/_next/static/chunks/3exiw74xbmika.js +1 -0
  163. package/console/_next/static/chunks/3f88-tc5u2heg.js +1 -0
  164. package/console/_next/static/chunks/3f_axahrombdp.js +1 -0
  165. package/console/_next/static/chunks/3gz91kn_v2lfa.js +1 -0
  166. package/console/_next/static/chunks/3i9z3x7tka5x2.js +1 -0
  167. package/console/_next/static/chunks/3ih4kfufd47st.js +1 -0
  168. package/console/_next/static/chunks/3itfi41ayfopd.js +15 -0
  169. package/console/_next/static/chunks/3iwgig-fgcscf.js +15 -0
  170. package/console/_next/static/chunks/3jf8qh1ev3gb4.js +2 -0
  171. package/console/_next/static/chunks/3l6svfyqdsq6o.js +1 -0
  172. package/console/_next/static/chunks/3lj0i-qlb4ah2.js +64 -0
  173. package/console/_next/static/chunks/3lmx6tkunfd3u.js +1 -0
  174. package/console/_next/static/chunks/3lp4d64he__am.js +152 -0
  175. package/console/_next/static/chunks/3m_jz3b2j38nn.js +1 -0
  176. package/console/_next/static/chunks/3oe9w1b39nzmn.js +3 -0
  177. package/console/_next/static/chunks/3on7r_d8o-kna.js +1 -0
  178. package/console/_next/static/chunks/3pbpowf3kdu5z.js +119 -0
  179. package/console/_next/static/chunks/3pwwv0u29nk8c.js +23 -0
  180. package/console/_next/static/chunks/3rweyye6o1z6b.js +79 -0
  181. package/console/_next/static/chunks/3sdqgrmvxm_u4.js +201 -0
  182. package/console/_next/static/chunks/3t3vbs-x5hixj.js +1 -0
  183. package/console/_next/static/chunks/3thqnz0a5zy-h.js +9 -0
  184. package/console/_next/static/chunks/3udubdawo7583.js +1 -0
  185. package/console/_next/static/chunks/3uz4lg6e199sb.js +1 -0
  186. package/console/_next/static/chunks/3v2mkz_46uei2.js +1 -0
  187. package/console/_next/static/chunks/3w5crjmhb-3um.js +1 -0
  188. package/console/_next/static/chunks/3waxhrmr_82j5.js +93 -0
  189. package/console/_next/static/chunks/3zmlzef_jxopu.js +1 -0
  190. package/console/_next/static/chunks/3zqvalj8nr-1y.js +1 -0
  191. package/console/_next/static/chunks/40igag4gq4k0a.js +77 -0
  192. package/console/_next/static/chunks/40wq034qcdji_.js +1 -0
  193. package/console/_next/static/chunks/44crhetqymq_e.js +34 -0
  194. package/console/_next/static/chunks/44q2pv6a3w19q.js +1 -0
  195. package/console/_next/static/chunks/turbopack-2u1d16houkiyo.js +1 -0
  196. package/console/_next/static/media/GeistMono_Variable-s.p.21mfa-4xv0w3g.woff2 +0 -0
  197. package/console/_next/static/media/Geist_Variable-s.p.217kyf1h_p0cg.woff2 +0 -0
  198. package/console/_next/static/media/IBMPlexMono_Medium-s.2v25u5rd2tsaf.woff2 +0 -0
  199. package/console/_next/static/media/IBMPlexMono_Regular-s.09u63wo58kris.woff2 +0 -0
  200. package/console/_next/static/media/IBMPlexSans_Bold-s.3iicodgz0epim.woff2 +0 -0
  201. package/console/_next/static/media/IBMPlexSans_Light-s.3ntejfdcyftfg.woff2 +0 -0
  202. package/console/_next/static/media/IBMPlexSans_Medium-s.3n25cgfiu6qss.woff2 +0 -0
  203. package/console/_next/static/media/IBMPlexSans_Regular-s.2e_-c_m03txvi.woff2 +0 -0
  204. package/console/_next/static/media/IBMPlexSans_SemiBold-s.2sutjpuns2xc5.woff2 +0 -0
  205. package/console/_next/static/media/Inter_Variable-s.2-lfiv6s83kzn.woff2 +0 -0
  206. package/console/_next/static/media/Nunito_Variable-s.3r4_r9s3kxd_-.woff2 +0 -0
  207. package/console/_not-found/__next._full.txt +73 -0
  208. package/console/_not-found/__next._index.txt +62 -0
  209. package/console/_not-found/__next._not-found.__PAGE__.txt +61 -0
  210. package/console/_not-found/__next._tree.txt +5 -0
  211. package/console/_not-found.html +1 -0
  212. package/console/_not-found.txt +73 -0
  213. package/console/apple-touch-icon-dark.png +0 -0
  214. package/console/apple-touch-icon-light.png +0 -0
  215. package/console/auth/callback/__next._full.txt +82 -0
  216. package/console/auth/callback/__next._index.txt +62 -0
  217. package/console/auth/callback/__next._tree.txt +8 -0
  218. package/console/auth/callback/__next.auth.callback.__PAGE__.txt +67 -0
  219. package/console/auth/callback.html +1 -0
  220. package/console/auth/callback.txt +82 -0
  221. package/console/auth/oauth/callback/__next._full.txt +84 -0
  222. package/console/auth/oauth/callback/__next._index.txt +62 -0
  223. package/console/auth/oauth/callback/__next._tree.txt +9 -0
  224. package/console/auth/oauth/callback/__next.auth.oauth.callback.__PAGE__.txt +69 -0
  225. package/console/auth/oauth/callback.html +1 -0
  226. package/console/auth/oauth/callback.txt +84 -0
  227. package/console/brand-avatar.png +0 -0
  228. package/console/chat/__placeholder__/__next._full.txt +80 -0
  229. package/console/chat/__placeholder__/__next._index.txt +62 -0
  230. package/console/chat/__placeholder__/__next._tree.txt +8 -0
  231. package/console/chat/__placeholder__/__next.chat.$d$channel.__PAGE__.txt +65 -0
  232. package/console/chat/__placeholder__.html +1 -0
  233. package/console/chat/__placeholder__.txt +80 -0
  234. package/console/connect/__placeholder__/__next._full.txt +79 -0
  235. package/console/connect/__placeholder__/__next._index.txt +62 -0
  236. package/console/connect/__placeholder__/__next._tree.txt +8 -0
  237. package/console/connect/__placeholder__/__next.connect.$d$token.__PAGE__.txt +64 -0
  238. package/console/connect/__placeholder__.html +1 -0
  239. package/console/connect/__placeholder__.txt +79 -0
  240. package/console/conversations/__next._full.txt +79 -0
  241. package/console/conversations/__next._index.txt +62 -0
  242. package/console/conversations/__next._tree.txt +7 -0
  243. package/console/conversations/__next.conversations.__PAGE__.txt +64 -0
  244. package/console/conversations/__placeholder__/__placeholder__/__next._full.txt +83 -0
  245. package/console/conversations/__placeholder__/__placeholder__/__next._index.txt +62 -0
  246. package/console/conversations/__placeholder__/__placeholder__/__next._tree.txt +9 -0
  247. package/console/conversations/__placeholder__/__placeholder__/__next.conversations.$d$channelId.$d$key.__PAGE__.txt +68 -0
  248. package/console/conversations/__placeholder__/__placeholder__.html +1 -0
  249. package/console/conversations/__placeholder__/__placeholder__.txt +83 -0
  250. package/console/conversations.html +1 -0
  251. package/console/conversations.txt +79 -0
  252. package/console/dashboard/__next._full.txt +77 -0
  253. package/console/dashboard/__next._index.txt +62 -0
  254. package/console/dashboard/__next._tree.txt +7 -0
  255. package/console/dashboard/__next.dashboard.__PAGE__.txt +62 -0
  256. package/console/dashboard.html +1 -0
  257. package/console/dashboard.txt +77 -0
  258. package/console/desktop/billing/__next._full.txt +82 -0
  259. package/console/desktop/billing/__next._index.txt +62 -0
  260. package/console/desktop/billing/__next._tree.txt +8 -0
  261. package/console/desktop/billing/__next.desktop.billing.__PAGE__.txt +67 -0
  262. package/console/desktop/billing.html +1 -0
  263. package/console/desktop/billing.txt +82 -0
  264. package/console/embed.js +1 -0
  265. package/console/favicon-dark-16x16.png +0 -0
  266. package/console/favicon-dark-32x32.png +0 -0
  267. package/console/favicon-dark.ico +0 -0
  268. package/console/favicon-dark.svg +1 -0
  269. package/console/favicon-light-16x16.png +0 -0
  270. package/console/favicon-light-32x32.png +0 -0
  271. package/console/favicon-light.ico +0 -0
  272. package/console/favicon-light.svg +1 -0
  273. package/console/index.html +1 -0
  274. package/console/index.txt +71 -0
  275. package/console/invite/__placeholder__/__next._full.txt +80 -0
  276. package/console/invite/__placeholder__/__next._index.txt +62 -0
  277. package/console/invite/__placeholder__/__next._tree.txt +8 -0
  278. package/console/invite/__placeholder__/__next.invite.$d$token.__PAGE__.txt +65 -0
  279. package/console/invite/__placeholder__.html +1 -0
  280. package/console/invite/__placeholder__.txt +80 -0
  281. package/console/library/__next._full.txt +89 -0
  282. package/console/library/__next._index.txt +62 -0
  283. package/console/library/__next._tree.txt +7 -0
  284. package/console/library/__next.library.__PAGE__.txt +74 -0
  285. package/console/library/agents/__next._full.txt +94 -0
  286. package/console/library/agents/__next._index.txt +62 -0
  287. package/console/library/agents/__next._tree.txt +8 -0
  288. package/console/library/agents/__next.library.agents.__PAGE__.txt +79 -0
  289. package/console/library/agents/__placeholder__/__placeholder__/__next._full.txt +96 -0
  290. package/console/library/agents/__placeholder__/__placeholder__/__next._index.txt +62 -0
  291. package/console/library/agents/__placeholder__/__placeholder__/__next._tree.txt +10 -0
  292. package/console/library/agents/__placeholder__/__placeholder__/__next.library.agents.$d$org.$d$slug.__PAGE__.txt +81 -0
  293. package/console/library/agents/__placeholder__/__placeholder__.html +1 -0
  294. package/console/library/agents/__placeholder__/__placeholder__.txt +96 -0
  295. package/console/library/agents/new/__next._full.txt +99 -0
  296. package/console/library/agents/new/__next._index.txt +62 -0
  297. package/console/library/agents/new/__next._tree.txt +9 -0
  298. package/console/library/agents/new/__next.library.agents.new.__PAGE__.txt +84 -0
  299. package/console/library/agents/new.html +1 -0
  300. package/console/library/agents/new.txt +99 -0
  301. package/console/library/agents.html +1 -0
  302. package/console/library/agents.txt +94 -0
  303. package/console/library/environments/__next._full.txt +95 -0
  304. package/console/library/environments/__next._index.txt +62 -0
  305. package/console/library/environments/__next._tree.txt +8 -0
  306. package/console/library/environments/__next.library.environments.__PAGE__.txt +80 -0
  307. package/console/library/environments/__placeholder__/__placeholder__/__next._full.txt +97 -0
  308. package/console/library/environments/__placeholder__/__placeholder__/__next._index.txt +62 -0
  309. package/console/library/environments/__placeholder__/__placeholder__/__next._tree.txt +10 -0
  310. package/console/library/environments/__placeholder__/__placeholder__/__next.library.environments.$d$org.$d$slug.__PAGE__.txt +82 -0
  311. package/console/library/environments/__placeholder__/__placeholder__.html +1 -0
  312. package/console/library/environments/__placeholder__/__placeholder__.txt +97 -0
  313. package/console/library/environments/new/__next._full.txt +99 -0
  314. package/console/library/environments/new/__next._index.txt +62 -0
  315. package/console/library/environments/new/__next._tree.txt +9 -0
  316. package/console/library/environments/new/__next.library.environments.new.__PAGE__.txt +84 -0
  317. package/console/library/environments/new.html +1 -0
  318. package/console/library/environments/new.txt +99 -0
  319. package/console/library/environments.html +1 -0
  320. package/console/library/environments.txt +95 -0
  321. package/console/library/files/__next._full.txt +94 -0
  322. package/console/library/files/__next._index.txt +62 -0
  323. package/console/library/files/__next._tree.txt +8 -0
  324. package/console/library/files/__next.library.files.__PAGE__.txt +79 -0
  325. package/console/library/files.html +1 -0
  326. package/console/library/files.txt +94 -0
  327. package/console/library/plugins/__next._full.txt +94 -0
  328. package/console/library/plugins/__next._index.txt +62 -0
  329. package/console/library/plugins/__next._tree.txt +8 -0
  330. package/console/library/plugins/__next.library.plugins.__PAGE__.txt +79 -0
  331. package/console/library/plugins/__placeholder__/__placeholder__/__next._full.txt +97 -0
  332. package/console/library/plugins/__placeholder__/__placeholder__/__next._index.txt +62 -0
  333. package/console/library/plugins/__placeholder__/__placeholder__/__next._tree.txt +10 -0
  334. package/console/library/plugins/__placeholder__/__placeholder__/__next.library.plugins.$d$org.$d$slug.__PAGE__.txt +82 -0
  335. package/console/library/plugins/__placeholder__/__placeholder__.html +1 -0
  336. package/console/library/plugins/__placeholder__/__placeholder__.txt +97 -0
  337. package/console/library/plugins/upload/__next._full.txt +99 -0
  338. package/console/library/plugins/upload/__next._index.txt +62 -0
  339. package/console/library/plugins/upload/__next._tree.txt +9 -0
  340. package/console/library/plugins/upload/__next.library.plugins.upload.__PAGE__.txt +84 -0
  341. package/console/library/plugins/upload.html +1 -0
  342. package/console/library/plugins/upload.txt +99 -0
  343. package/console/library/plugins.html +1 -0
  344. package/console/library/plugins.txt +94 -0
  345. package/console/library/routines/__next._full.txt +94 -0
  346. package/console/library/routines/__next._index.txt +62 -0
  347. package/console/library/routines/__next._tree.txt +8 -0
  348. package/console/library/routines/__next.library.routines.__PAGE__.txt +79 -0
  349. package/console/library/routines/__placeholder__/__placeholder__/__next._full.txt +97 -0
  350. package/console/library/routines/__placeholder__/__placeholder__/__next._index.txt +62 -0
  351. package/console/library/routines/__placeholder__/__placeholder__/__next._tree.txt +10 -0
  352. package/console/library/routines/__placeholder__/__placeholder__/__next.library.routines.$d$org.$d$slug.__PAGE__.txt +82 -0
  353. package/console/library/routines/__placeholder__/__placeholder__.html +1 -0
  354. package/console/library/routines/__placeholder__/__placeholder__.txt +97 -0
  355. package/console/library/routines/new/__next._full.txt +98 -0
  356. package/console/library/routines/new/__next._index.txt +62 -0
  357. package/console/library/routines/new/__next._tree.txt +9 -0
  358. package/console/library/routines/new/__next.library.routines.new.__PAGE__.txt +83 -0
  359. package/console/library/routines/new.html +1 -0
  360. package/console/library/routines/new.txt +98 -0
  361. package/console/library/routines.html +1 -0
  362. package/console/library/routines.txt +94 -0
  363. package/console/library/skills/__next._full.txt +94 -0
  364. package/console/library/skills/__next._index.txt +62 -0
  365. package/console/library/skills/__next._tree.txt +8 -0
  366. package/console/library/skills/__next.library.skills.__PAGE__.txt +79 -0
  367. package/console/library/skills/__placeholder__/__placeholder__/__next._full.txt +96 -0
  368. package/console/library/skills/__placeholder__/__placeholder__/__next._index.txt +62 -0
  369. package/console/library/skills/__placeholder__/__placeholder__/__next._tree.txt +10 -0
  370. package/console/library/skills/__placeholder__/__placeholder__/__next.library.skills.$d$org.$d$slug.__PAGE__.txt +81 -0
  371. package/console/library/skills/__placeholder__/__placeholder__.html +1 -0
  372. package/console/library/skills/__placeholder__/__placeholder__.txt +96 -0
  373. package/console/library/skills/new/__next._full.txt +98 -0
  374. package/console/library/skills/new/__next._index.txt +62 -0
  375. package/console/library/skills/new/__next._tree.txt +9 -0
  376. package/console/library/skills/new/__next.library.skills.new.__PAGE__.txt +83 -0
  377. package/console/library/skills/new.html +1 -0
  378. package/console/library/skills/new.txt +98 -0
  379. package/console/library/skills.html +1 -0
  380. package/console/library/skills.txt +94 -0
  381. package/console/library.html +1 -0
  382. package/console/library.txt +89 -0
  383. package/console/login/__next._full.txt +81 -0
  384. package/console/login/__next._index.txt +62 -0
  385. package/console/login/__next._tree.txt +7 -0
  386. package/console/login/__next.login.__PAGE__.txt +66 -0
  387. package/console/login.html +1 -0
  388. package/console/login.txt +81 -0
  389. package/console/marketplace/__next._full.txt +81 -0
  390. package/console/marketplace/__next._index.txt +62 -0
  391. package/console/marketplace/__next._tree.txt +7 -0
  392. package/console/marketplace/__next.marketplace.__PAGE__.txt +66 -0
  393. package/console/marketplace.html +1 -0
  394. package/console/marketplace.txt +81 -0
  395. package/console/models/__next._full.txt +77 -0
  396. package/console/models/__next._index.txt +62 -0
  397. package/console/models/__next._tree.txt +7 -0
  398. package/console/models/__next.models.__PAGE__.txt +62 -0
  399. package/console/models.html +1 -0
  400. package/console/models.txt +77 -0
  401. package/console/oauth/slack/callback/__next._full.txt +84 -0
  402. package/console/oauth/slack/callback/__next._index.txt +62 -0
  403. package/console/oauth/slack/callback/__next._tree.txt +9 -0
  404. package/console/oauth/slack/callback/__next.oauth.slack.callback.__PAGE__.txt +69 -0
  405. package/console/oauth/slack/callback.html +1 -0
  406. package/console/oauth/slack/callback.txt +84 -0
  407. package/console/runs/__placeholder__/__next._full.txt +77 -0
  408. package/console/runs/__placeholder__/__next._index.txt +62 -0
  409. package/console/runs/__placeholder__/__next._tree.txt +8 -0
  410. package/console/runs/__placeholder__/__next.runs.$d$id.__PAGE__.txt +62 -0
  411. package/console/runs/__placeholder__.html +1 -0
  412. package/console/runs/__placeholder__.txt +77 -0
  413. package/console/sessions/__placeholder__/__next._full.txt +77 -0
  414. package/console/sessions/__placeholder__/__next._index.txt +62 -0
  415. package/console/sessions/__placeholder__/__next._tree.txt +8 -0
  416. package/console/sessions/__placeholder__/__next.sessions.$d$id.__PAGE__.txt +62 -0
  417. package/console/sessions/__placeholder__.html +1 -0
  418. package/console/sessions/__placeholder__.txt +77 -0
  419. package/console/settings/__next._full.txt +85 -0
  420. package/console/settings/__next._index.txt +62 -0
  421. package/console/settings/__next._tree.txt +7 -0
  422. package/console/settings/__next.settings.__PAGE__.txt +70 -0
  423. package/console/settings/access-history/__next._full.txt +87 -0
  424. package/console/settings/access-history/__next._index.txt +62 -0
  425. package/console/settings/access-history/__next._tree.txt +8 -0
  426. package/console/settings/access-history/__next.settings.access-history.__PAGE__.txt +72 -0
  427. package/console/settings/access-history.html +1 -0
  428. package/console/settings/access-history.txt +87 -0
  429. package/console/settings/account-preferences/__next._full.txt +87 -0
  430. package/console/settings/account-preferences/__next._index.txt +62 -0
  431. package/console/settings/account-preferences/__next._tree.txt +8 -0
  432. package/console/settings/account-preferences/__next.settings.account-preferences.__PAGE__.txt +72 -0
  433. package/console/settings/account-preferences.html +1 -0
  434. package/console/settings/account-preferences.txt +87 -0
  435. package/console/settings/api-keys/__next._full.txt +86 -0
  436. package/console/settings/api-keys/__next._index.txt +62 -0
  437. package/console/settings/api-keys/__next._tree.txt +8 -0
  438. package/console/settings/api-keys/__next.settings.api-keys.__PAGE__.txt +71 -0
  439. package/console/settings/api-keys.html +1 -0
  440. package/console/settings/api-keys.txt +86 -0
  441. package/console/settings/billing/__next._full.txt +89 -0
  442. package/console/settings/billing/__next._index.txt +62 -0
  443. package/console/settings/billing/__next._tree.txt +8 -0
  444. package/console/settings/billing/__next.settings.billing.__PAGE__.txt +74 -0
  445. package/console/settings/billing.html +1 -0
  446. package/console/settings/billing.txt +89 -0
  447. package/console/settings/channel-apps/__next._full.txt +87 -0
  448. package/console/settings/channel-apps/__next._index.txt +62 -0
  449. package/console/settings/channel-apps/__next._tree.txt +8 -0
  450. package/console/settings/channel-apps/__next.settings.channel-apps.__PAGE__.txt +72 -0
  451. package/console/settings/channel-apps.html +1 -0
  452. package/console/settings/channel-apps.txt +87 -0
  453. package/console/settings/federation-issuers/__next._full.txt +88 -0
  454. package/console/settings/federation-issuers/__next._index.txt +62 -0
  455. package/console/settings/federation-issuers/__next._tree.txt +8 -0
  456. package/console/settings/federation-issuers/__next.settings.federation-issuers.__PAGE__.txt +73 -0
  457. package/console/settings/federation-issuers.html +1 -0
  458. package/console/settings/federation-issuers.txt +88 -0
  459. package/console/settings/invitations/__next._full.txt +87 -0
  460. package/console/settings/invitations/__next._index.txt +62 -0
  461. package/console/settings/invitations/__next._tree.txt +8 -0
  462. package/console/settings/invitations/__next.settings.invitations.__PAGE__.txt +72 -0
  463. package/console/settings/invitations.html +1 -0
  464. package/console/settings/invitations.txt +87 -0
  465. package/console/settings/licenses/__next._full.txt +90 -0
  466. package/console/settings/licenses/__next._index.txt +62 -0
  467. package/console/settings/licenses/__next._tree.txt +8 -0
  468. package/console/settings/licenses/__next.settings.licenses.__PAGE__.txt +75 -0
  469. package/console/settings/licenses.html +1 -0
  470. package/console/settings/licenses.txt +90 -0
  471. package/console/settings/members/__next._full.txt +86 -0
  472. package/console/settings/members/__next._index.txt +62 -0
  473. package/console/settings/members/__next._tree.txt +8 -0
  474. package/console/settings/members/__next.settings.members.__PAGE__.txt +71 -0
  475. package/console/settings/members.html +1 -0
  476. package/console/settings/members.txt +86 -0
  477. package/console/settings/memory/__next._full.txt +86 -0
  478. package/console/settings/memory/__next._index.txt +62 -0
  479. package/console/settings/memory/__next._tree.txt +8 -0
  480. package/console/settings/memory/__next.settings.memory.__PAGE__.txt +71 -0
  481. package/console/settings/memory.html +1 -0
  482. package/console/settings/memory.txt +86 -0
  483. package/console/settings/model-catalog/__next._full.txt +89 -0
  484. package/console/settings/model-catalog/__next._index.txt +62 -0
  485. package/console/settings/model-catalog/__next._tree.txt +8 -0
  486. package/console/settings/model-catalog/__next.settings.model-catalog.__PAGE__.txt +74 -0
  487. package/console/settings/model-catalog.html +1 -0
  488. package/console/settings/model-catalog.txt +89 -0
  489. package/console/settings/notifications/__next._full.txt +89 -0
  490. package/console/settings/notifications/__next._index.txt +62 -0
  491. package/console/settings/notifications/__next._tree.txt +8 -0
  492. package/console/settings/notifications/__next.settings.notifications.__PAGE__.txt +74 -0
  493. package/console/settings/notifications.html +1 -0
  494. package/console/settings/notifications.txt +89 -0
  495. package/console/settings/oauth-apps/__next._full.txt +87 -0
  496. package/console/settings/oauth-apps/__next._index.txt +62 -0
  497. package/console/settings/oauth-apps/__next._tree.txt +8 -0
  498. package/console/settings/oauth-apps/__next.settings.oauth-apps.__PAGE__.txt +72 -0
  499. package/console/settings/oauth-apps.html +1 -0
  500. package/console/settings/oauth-apps.txt +87 -0
  501. package/console/settings/org-embedding/__next._full.txt +87 -0
  502. package/console/settings/org-embedding/__next._index.txt +62 -0
  503. package/console/settings/org-embedding/__next._tree.txt +8 -0
  504. package/console/settings/org-embedding/__next.settings.org-embedding.__PAGE__.txt +72 -0
  505. package/console/settings/org-embedding.html +1 -0
  506. package/console/settings/org-embedding.txt +87 -0
  507. package/console/settings/org-policies/__next._full.txt +87 -0
  508. package/console/settings/org-policies/__next._index.txt +62 -0
  509. package/console/settings/org-policies/__next._tree.txt +8 -0
  510. package/console/settings/org-policies/__next.settings.org-policies.__PAGE__.txt +72 -0
  511. package/console/settings/org-policies.html +1 -0
  512. package/console/settings/org-policies.txt +87 -0
  513. package/console/settings/org-preferences/__next._full.txt +87 -0
  514. package/console/settings/org-preferences/__next._index.txt +62 -0
  515. package/console/settings/org-preferences/__next._tree.txt +8 -0
  516. package/console/settings/org-preferences/__next.settings.org-preferences.__PAGE__.txt +72 -0
  517. package/console/settings/org-preferences.html +1 -0
  518. package/console/settings/org-preferences.txt +87 -0
  519. package/console/settings/org-profile/__next._full.txt +89 -0
  520. package/console/settings/org-profile/__next._index.txt +62 -0
  521. package/console/settings/org-profile/__next._tree.txt +8 -0
  522. package/console/settings/org-profile/__next.settings.org-profile.__PAGE__.txt +74 -0
  523. package/console/settings/org-profile.html +1 -0
  524. package/console/settings/org-profile.txt +89 -0
  525. package/console/settings/plans/__next._full.txt +89 -0
  526. package/console/settings/plans/__next._index.txt +62 -0
  527. package/console/settings/plans/__next._tree.txt +8 -0
  528. package/console/settings/plans/__next.settings.plans.__PAGE__.txt +74 -0
  529. package/console/settings/plans.html +1 -0
  530. package/console/settings/plans.txt +89 -0
  531. package/console/settings/service-accounts/__next._full.txt +87 -0
  532. package/console/settings/service-accounts/__next._index.txt +62 -0
  533. package/console/settings/service-accounts/__next._tree.txt +8 -0
  534. package/console/settings/service-accounts/__next.settings.service-accounts.__PAGE__.txt +72 -0
  535. package/console/settings/service-accounts.html +1 -0
  536. package/console/settings/service-accounts.txt +87 -0
  537. package/console/settings/teams/__next._full.txt +86 -0
  538. package/console/settings/teams/__next._index.txt +62 -0
  539. package/console/settings/teams/__next._tree.txt +8 -0
  540. package/console/settings/teams/__next.settings.teams.__PAGE__.txt +71 -0
  541. package/console/settings/teams.html +1 -0
  542. package/console/settings/teams.txt +86 -0
  543. package/console/settings/usage/__next._full.txt +86 -0
  544. package/console/settings/usage/__next._index.txt +62 -0
  545. package/console/settings/usage/__next._tree.txt +8 -0
  546. package/console/settings/usage/__next.settings.usage.__PAGE__.txt +71 -0
  547. package/console/settings/usage.html +1 -0
  548. package/console/settings/usage.txt +86 -0
  549. package/console/settings/vaults/__next._full.txt +86 -0
  550. package/console/settings/vaults/__next._index.txt +62 -0
  551. package/console/settings/vaults/__next._tree.txt +8 -0
  552. package/console/settings/vaults/__next.settings.vaults.__PAGE__.txt +71 -0
  553. package/console/settings/vaults.html +1 -0
  554. package/console/settings/vaults.txt +86 -0
  555. package/console/settings.html +1 -0
  556. package/console/settings.txt +85 -0
  557. package/main.js +1656 -0
  558. package/mappings.wasm +0 -0
  559. package/package.json +25 -0
  560. package/workflow-bundle-agent-execution.js +29297 -0
  561. package/workflow-bundle-evals.js +11997 -0
  562. package/workflow-bundle-grading.js +11155 -0
  563. package/workflow-bundle-routine.js +11300 -0
  564. package/workflow-worker-thread.cjs +111 -0
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,470858,e=>{"use strict";class t extends Error{}t.prototype.name="InvalidTokenError";var s,i,r,n,a={debug:()=>void 0,info:()=>void 0,warn:()=>void 0,error:()=>void 0},o=((s=o||{})[s.NONE=0]="NONE",s[s.ERROR=1]="ERROR",s[s.WARN=2]="WARN",s[s.INFO=3]="INFO",s[s.DEBUG=4]="DEBUG",s);(i=o||(o={})).reset=function(){r=3,n=a},i.setLevel=function(e){if(!(0<=e&&e<=4))throw Error("Invalid log level");r=e},i.setLogger=function(e){n=e};var c=class e{constructor(e){this._name=e}debug(...t){r>=4&&n.debug(e._format(this._name,this._method),...t)}info(...t){r>=3&&n.info(e._format(this._name,this._method),...t)}warn(...t){r>=2&&n.warn(e._format(this._name,this._method),...t)}error(...t){r>=1&&n.error(e._format(this._name,this._method),...t)}throw(e){throw this.error(e),e}create(e){let t=Object.create(this);return t._method=e,t.debug("begin"),t}static createStatic(t,s){let i=new e(`${t}.${s}`);return i.debug("begin"),i}static _format(e,t){let s=`[${e}]`;return t?`${s} ${t}:`:s}static debug(t,...s){r>=4&&n.debug(e._format(t),...s)}static info(t,...s){r>=3&&n.info(e._format(t),...s)}static warn(t,...s){r>=2&&n.warn(e._format(t),...s)}static error(t,...s){r>=1&&n.error(e._format(t),...s)}};o.reset();var l=class{static decode(e){try{return function(e,s){let i;if("string"!=typeof e)throw new t("Invalid token specified: must be a string");s||(s={});let r=+(!0!==s.header),n=e.split(".")[r];if("string"!=typeof n)throw new t(`Invalid token specified: missing part #${r+1}`);try{i=function(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw Error("base64 string is not of the correct length")}try{var s;return s=t,decodeURIComponent(atob(s).replace(/(.)/g,(e,t)=>{let s=t.charCodeAt(0).toString(16).toUpperCase();return s.length<2&&(s="0"+s),"%"+s}))}catch(e){return atob(t)}}(n)}catch(e){throw new t(`Invalid token specified: invalid base64 for part #${r+1} (${e.message})`)}try{return JSON.parse(i)}catch(e){throw new t(`Invalid token specified: invalid json for part #${r+1} (${e.message})`)}}(e)}catch(e){throw c.error("JwtUtils.decode",e),e}}static async generateSignedJwt(e,t,s){let i=g.encodeBase64Url(new TextEncoder().encode(JSON.stringify(e))),r=g.encodeBase64Url(new TextEncoder().encode(JSON.stringify(t))),n=`${i}.${r}`,a=await window.crypto.subtle.sign({name:"ECDSA",hash:{name:"SHA-256"}},s,new TextEncoder().encode(n)),o=g.encodeBase64Url(new Uint8Array(a));return`${n}.${o}`}static async generateSignedJwtWithHmac(e,t,s){let i=g.encodeBase64Url(new TextEncoder().encode(JSON.stringify(e))),r=g.encodeBase64Url(new TextEncoder().encode(JSON.stringify(t))),n=`${i}.${r}`,a=await window.crypto.subtle.sign("HMAC",s,new TextEncoder().encode(n)),o=g.encodeBase64Url(new Uint8Array(a));return`${n}.${o}`}},h=e=>btoa([...new Uint8Array(e)].map(e=>String.fromCharCode(e)).join("")),d=class e{static _randomWord(){let e=new Uint32Array(1);return crypto.getRandomValues(e),e[0]}static generateUUIDv4(){return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,t=>(t^e._randomWord()&15>>t/4).toString(16)).replace(/-/g,"")}static generateCodeVerifier(){return e.generateUUIDv4()+e.generateUUIDv4()+e.generateUUIDv4()}static async generateCodeChallenge(e){if(!crypto.subtle)throw Error("Crypto.subtle is available only in secure contexts (HTTPS).");try{let t=new TextEncoder().encode(e),s=await crypto.subtle.digest("SHA-256",t);return h(s).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}catch(e){throw c.error("CryptoUtils.generateCodeChallenge",e),e}}static generateBasicAuth(e,t){return h(new TextEncoder().encode([e,t].join(":")))}static async hash(e,t){let s=new TextEncoder().encode(t);return new Uint8Array(await crypto.subtle.digest(e,s))}static async customCalculateJwkThumbprint(t){let s;switch(t.kty){case"RSA":s={e:t.e,kty:t.kty,n:t.n};break;case"EC":s={crv:t.crv,kty:t.kty,x:t.x,y:t.y};break;case"OKP":s={crv:t.crv,kty:t.kty,x:t.x};break;case"oct":s={crv:t.k,kty:t.kty};break;default:throw Error("Unknown jwk type")}let i=await e.hash("SHA-256",JSON.stringify(s));return e.encodeBase64Url(i)}static async generateDPoPProof({url:t,accessToken:s,httpMethod:i,keyPair:r,nonce:n}){let a,o={jti:window.crypto.randomUUID(),htm:null!=i?i:"GET",htu:t,iat:Math.floor(Date.now()/1e3)};s&&(a=await e.hash("SHA-256",s),o.ath=e.encodeBase64Url(a)),n&&(o.nonce=n);try{let e=await crypto.subtle.exportKey("jwk",r.publicKey),t={alg:"ES256",typ:"dpop+jwt",jwk:{crv:e.crv,kty:e.kty,x:e.x,y:e.y}};return await l.generateSignedJwt(t,o,r.privateKey)}catch(e){if(e instanceof TypeError)throw Error(`Error exporting dpop public key: ${e.message}`);throw e}}static async generateDPoPJkt(t){try{let s=await crypto.subtle.exportKey("jwk",t.publicKey);return await e.customCalculateJwkThumbprint(s)}catch(e){if(e instanceof TypeError)throw Error(`Could not retrieve dpop keys from storage: ${e.message}`);throw e}}static async generateDPoPKeys(){return await window.crypto.subtle.generateKey({name:"ECDSA",namedCurve:"P-256"},!1,["sign","verify"])}static async generateClientAssertionJwt(t,s,i,r="HS256"){let n=Math.floor(Date.now()/1e3),a={iss:t,sub:t,aud:i,jti:e.generateUUIDv4(),exp:n+300,iat:n},o={HS256:"SHA-256",HS384:"SHA-384",HS512:"SHA-512"}[r];if(!o)throw Error(`Unsupported algorithm: ${r}. Supported algorithms are: HS256, HS384, HS512`);let c=new TextEncoder,h=await crypto.subtle.importKey("raw",c.encode(s),{name:"HMAC",hash:o},!1,["sign"]);return await l.generateSignedJwtWithHmac({alg:r,typ:"JWT"},a,h)}};d.encodeBase64Url=e=>h(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_");var g=d,u=class{constructor(e){this._name=e,this._callbacks=[],this._logger=new c(`Event('${this._name}')`)}addHandler(e){return this._callbacks.push(e),()=>this.removeHandler(e)}removeHandler(e){let t=this._callbacks.lastIndexOf(e);t>=0&&this._callbacks.splice(t,1)}async raise(...e){for(let t of(this._logger.debug("raise:",...e),this._callbacks))await t(...e)}},_=class{static center({...e}){var t;return null==e.width&&(e.width=null!=(t=[800,720,600,480].find(e=>e<=window.outerWidth/1.618))?t:360),null!=e.left||(e.left=Math.max(0,Math.round(window.screenX+(window.outerWidth-e.width)/2))),null!=e.height&&(null!=e.top||(e.top=Math.max(0,Math.round(window.screenY+(window.outerHeight-e.height)/2)))),e}static serialize(e){return Object.entries(e).filter(([,e])=>null!=e).map(([e,t])=>`${e}=${"boolean"!=typeof t?t:t?"yes":"no"}`).join(",")}},p=class e extends u{constructor(){super(...arguments),this._logger=new c(`Timer('${this._name}')`),this._timerHandle=null,this._expiration=0,this._callback=()=>{let t=this._expiration-e.getEpochTime();this._logger.debug("timer completes in",t),this._expiration<=e.getEpochTime()&&(this.cancel(),super.raise())}}static getEpochTime(){return Math.floor(Date.now()/1e3)}init(t){let s=this._logger.create("init");t=Math.max(Math.floor(t),1);let i=e.getEpochTime()+t;if(this.expiration===i&&this._timerHandle)return void s.debug("skipping since already initialized for expiration at",this.expiration);this.cancel(),s.debug("using duration",t),this._expiration=i;let r=Math.min(t,5);this._timerHandle=setInterval(this._callback,1e3*r)}get expiration(){return this._expiration}cancel(){this._logger.create("cancel"),this._timerHandle&&(clearInterval(this._timerHandle),this._timerHandle=null)}},w=class{static readParams(e,t="query"){if(!e)throw TypeError("Invalid URL");return new URLSearchParams(new URL(e,"http://127.0.0.1")["fragment"===t?"hash":"search"].slice(1))}},m=class extends Error{constructor(e,t){var s,i,r;if(super(e.error_description||e.error||""),this.form=t,this.name="ErrorResponse",!e.error)throw c.error("ErrorResponse","No error passed"),Error("No error passed");this.error=e.error,this.error_description=null!=(s=e.error_description)?s:null,this.error_uri=null!=(i=e.error_uri)?i:null,this.state=e.userState,this.session_state=null!=(r=e.session_state)?r:null,this.url_state=e.url_state}},f=class extends Error{constructor(e){super(e),this.name="ErrorTimeout"}},y=class{constructor(e){this._logger=new c("AccessTokenEvents"),this._expiringTimer=new p("Access token expiring"),this._expiredTimer=new p("Access token expired"),this._expiringNotificationTimeInSeconds=e.expiringNotificationTimeInSeconds}async load(e){let t=this._logger.create("load");if(e.access_token&&void 0!==e.expires_in){let s=e.expires_in;if(t.debug("access token present, remaining duration:",s),s>0){let e=s-this._expiringNotificationTimeInSeconds;e<=0&&(e=1),t.debug("registering expiring timer, raising in",e,"seconds"),this._expiringTimer.init(e)}else t.debug("canceling existing expiring timer because we're past expiration."),this._expiringTimer.cancel();let i=s+1;t.debug("registering expired timer, raising in",i,"seconds"),this._expiredTimer.init(i)}else this._expiringTimer.cancel(),this._expiredTimer.cancel()}async unload(){this._logger.debug("unload: canceling existing access token timers"),this._expiringTimer.cancel(),this._expiredTimer.cancel()}addAccessTokenExpiring(e){return this._expiringTimer.addHandler(e)}removeAccessTokenExpiring(e){this._expiringTimer.removeHandler(e)}addAccessTokenExpired(e){return this._expiredTimer.addHandler(e)}removeAccessTokenExpired(e){this._expiredTimer.removeHandler(e)}},S=class{constructor(e,t,s,i,r){this._callback=e,this._client_id=t,this._intervalInSeconds=i,this._stopOnError=r,this._logger=new c("CheckSessionIFrame"),this._timer=null,this._session_state=null,this._message=e=>{e.origin===this._frame_origin&&e.source===this._frame.contentWindow&&("error"===e.data?(this._logger.error("error message from check session op iframe"),this._stopOnError&&this.stop()):"changed"===e.data?(this._logger.debug("changed message from check session op iframe"),this.stop(),this._callback()):this._logger.debug(e.data+" message from check session op iframe"))};let n=new URL(s);this._frame_origin=n.origin,this._frame=window.document.createElement("iframe"),this._frame.style.visibility="hidden",this._frame.style.position="fixed",this._frame.style.left="-1000px",this._frame.style.top="0",this._frame.width="0",this._frame.height="0",this._frame.src=n.href}load(){return new Promise(e=>{this._frame.onload=()=>{e()},window.document.body.appendChild(this._frame),window.addEventListener("message",this._message,!1)})}start(e){if(this._session_state===e)return;this._logger.create("start"),this.stop(),this._session_state=e;let t=()=>{this._frame.contentWindow&&this._session_state&&this._frame.contentWindow.postMessage(this._client_id+" "+this._session_state,this._frame_origin)};t(),this._timer=setInterval(t,1e3*this._intervalInSeconds)}stop(){this._logger.create("stop"),this._session_state=null,this._timer&&(clearInterval(this._timer),this._timer=null)}},v=class{constructor(){this._logger=new c("InMemoryWebStorage"),this._data={}}clear(){this._logger.create("clear"),this._data={}}getItem(e){return this._logger.create(`getItem('${e}')`),this._data[e]}setItem(e,t){this._logger.create(`setItem('${e}')`),this._data[e]=t}removeItem(e){this._logger.create(`removeItem('${e}')`),delete this._data[e]}get length(){return Object.getOwnPropertyNames(this._data).length}key(e){return Object.getOwnPropertyNames(this._data)[e]}},b=class extends Error{constructor(e,t){super(t),this.name="ErrorDPoPNonce",this.nonce=e}},k=class{constructor(e=[],t=null,s={}){this._jwtHandler=t,this._extraHeaders=s,this._logger=new c("JsonService"),this._contentTypes=[],this._contentTypes.push(...e,"application/json"),t&&this._contentTypes.push("application/jwt")}async fetchWithTimeout(e,t={}){let{timeoutInSeconds:s,...i}=t;if(!s)return await fetch(e,i);let r=new AbortController,n=setTimeout(()=>r.abort(),1e3*s);try{return await fetch(e,{...t,signal:r.signal})}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)throw new f("Network timed out");throw e}finally{clearTimeout(n)}}async getJson(e,{token:t,credentials:s,timeoutInSeconds:i}={}){let r,n,a=this._logger.create("getJson"),o={Accept:this._contentTypes.join(", ")};t&&(a.debug("token passed, setting Authorization header"),o.Authorization="Bearer "+t),this._appendExtraHeaders(o);try{a.debug("url:",e),r=await this.fetchWithTimeout(e,{method:"GET",headers:o,timeoutInSeconds:i,credentials:s})}catch(e){throw a.error("Network Error"),e}a.debug("HTTP response received, status",r.status);let c=r.headers.get("Content-Type");if(c&&!this._contentTypes.find(e=>c.startsWith(e))&&a.throw(Error(`Invalid response Content-Type: ${null!=c?c:"undefined"}, from URL: ${e}`)),r.ok&&this._jwtHandler&&(null==c?void 0:c.startsWith("application/jwt")))return await this._jwtHandler(await r.text());try{n=await r.json()}catch(e){if(a.error("Error parsing JSON response",e),r.ok)throw e;throw Error(`${r.statusText} (${r.status})`)}if(!r.ok){if(a.error("Error from server:",n),n.error)throw new m(n);throw Error(`${r.statusText} (${r.status}): ${JSON.stringify(n)}`)}return n}async postForm(e,{body:t,basicAuth:s,timeoutInSeconds:i,initCredentials:r,extraHeaders:n}){let a,o=this._logger.create("postForm"),c={Accept:this._contentTypes.join(", "),"Content-Type":"application/x-www-form-urlencoded",...n};void 0!==s&&(c.Authorization="Basic "+s),this._appendExtraHeaders(c);try{o.debug("url:",e),a=await this.fetchWithTimeout(e,{method:"POST",headers:c,body:t,timeoutInSeconds:i,credentials:r})}catch(e){throw o.error("Network error"),e}o.debug("HTTP response received, status",a.status);let l=a.headers.get("Content-Type");if(l&&!this._contentTypes.find(e=>l.startsWith(e)))throw Error(`Invalid response Content-Type: ${null!=l?l:"undefined"}, from URL: ${e}`);let h=await a.text(),d={};if(h)try{d=JSON.parse(h)}catch(e){if(o.error("Error parsing JSON response",e),a.ok)throw e;throw Error(`${a.statusText} (${a.status})`)}if(!a.ok){if(o.error("Error from server:",d),a.headers.has("dpop-nonce"))throw new b(a.headers.get("dpop-nonce"),`${JSON.stringify(d)}`);if(d.error)throw new m(d,t);throw Error(`${a.statusText} (${a.status}): ${JSON.stringify(d)}`)}return d}_appendExtraHeaders(e){let t=this._logger.create("appendExtraHeaders"),s=Object.keys(this._extraHeaders),i=["accept","content-type"],r=["authorization"];0!==s.length&&s.forEach(s=>{if(i.includes(s.toLocaleLowerCase()))return void t.warn("Protected header could not be set",s,i);if(r.includes(s.toLocaleLowerCase())&&Object.keys(e).includes(s))return void t.warn("Header could not be overridden",s,r);let n="function"==typeof this._extraHeaders[s]?this._extraHeaders[s]():this._extraHeaders[s];n&&""!==n&&(e[s]=n)})}},E=class{constructor(e){this._settings=e,this._logger=new c("MetadataService"),this._signingKeys=null,this._metadata=null,this._metadataUrl=this._settings.metadataUrl,this._jsonService=new k(["application/jwk-set+json"],null,this._settings.extraHeaders),this._settings.signingKeys&&(this._logger.debug("using signingKeys from settings"),this._signingKeys=this._settings.signingKeys),this._settings.metadata&&(this._logger.debug("using metadata from settings"),this._metadata=this._settings.metadata),this._settings.fetchRequestCredentials&&(this._logger.debug("using fetchRequestCredentials from settings"),this._fetchRequestCredentials=this._settings.fetchRequestCredentials)}resetSigningKeys(){this._signingKeys=null}async getMetadata(){let e=this._logger.create("getMetadata");if(this._metadata)return e.debug("using cached values"),this._metadata;if(!this._metadataUrl)throw e.throw(Error("No authority or metadataUrl configured on settings")),null;e.debug("getting metadata from",this._metadataUrl);let t=await this._jsonService.getJson(this._metadataUrl,{credentials:this._fetchRequestCredentials,timeoutInSeconds:this._settings.requestTimeoutInSeconds});return e.debug("merging remote JSON with seed metadata"),this._metadata=Object.assign({},t,this._settings.metadataSeed),this._metadata}getIssuer(){return this._getMetadataProperty("issuer")}getAuthorizationEndpoint(){return this._getMetadataProperty("authorization_endpoint")}getUserInfoEndpoint(){return this._getMetadataProperty("userinfo_endpoint")}getTokenEndpoint(e=!0){return this._getMetadataProperty("token_endpoint",e)}getCheckSessionIframe(){return this._getMetadataProperty("check_session_iframe",!0)}getEndSessionEndpoint(){return this._getMetadataProperty("end_session_endpoint",!0)}getRevocationEndpoint(e=!0){return this._getMetadataProperty("revocation_endpoint",e)}getKeysEndpoint(e=!0){return this._getMetadataProperty("jwks_uri",e)}async _getMetadataProperty(e,t=!1){let s=this._logger.create(`_getMetadataProperty('${e}')`),i=await this.getMetadata();if(s.debug("resolved"),void 0===i[e]){if(!0===t)return void s.warn("Metadata does not contain optional property");s.throw(Error("Metadata does not contain property "+e))}return i[e]}async getSigningKeys(){let e=this._logger.create("getSigningKeys");if(this._signingKeys)return e.debug("returning signingKeys from cache"),this._signingKeys;let t=await this.getKeysEndpoint(!1);e.debug("got jwks_uri",t);let s=await this._jsonService.getJson(t,{timeoutInSeconds:this._settings.requestTimeoutInSeconds});if(e.debug("got key set",s),!Array.isArray(s.keys))throw e.throw(Error("Missing keys on keyset")),null;return this._signingKeys=s.keys,this._signingKeys}},T=class{constructor({prefix:e="oidc.",store:t=localStorage}={}){this._logger=new c("WebStorageStateStore"),this._store=t,this._prefix=e}async set(e,t){this._logger.create(`set('${e}')`),e=this._prefix+e,await this._store.setItem(e,t)}async get(e){return this._logger.create(`get('${e}')`),e=this._prefix+e,await this._store.getItem(e)}async remove(e){this._logger.create(`remove('${e}')`),e=this._prefix+e;let t=await this._store.getItem(e);return await this._store.removeItem(e),t}async getAllKeys(){this._logger.create("getAllKeys");let e=await this._store.length,t=[];for(let s=0;s<e;s++){let e=await this._store.key(s);e&&0===e.indexOf(this._prefix)&&t.push(e.substr(this._prefix.length))}return t}},x=class{constructor({authority:e,metadataUrl:t,metadata:s,signingKeys:i,metadataSeed:r,client_id:n,client_secret:a,response_type:o="code",scope:c="openid",redirect_uri:l,post_logout_redirect_uri:h,client_authentication:d="client_secret_post",token_endpoint_auth_signing_alg:g="HS256",prompt:u,display:_,max_age:p,ui_locales:w,acr_values:m,resource:f,response_mode:y,filterProtocolClaims:S=!0,loadUserInfo:b=!1,requestTimeoutInSeconds:k,staleStateAgeInSeconds:E=900,mergeClaimsStrategy:x={array:"replace"},disablePKCE:R=!1,stateStore:P,revokeTokenAdditionalContentTypes:C,fetchRequestCredentials:I,refreshTokenAllowedScope:U,extraQueryParams:A={},extraTokenParams:O={},extraHeaders:N={},dpop:j,omitScopeWhenRequesting:q=!1}){var H;if(this.authority=e,t?this.metadataUrl=t:(this.metadataUrl=e,e&&(this.metadataUrl.endsWith("/")||(this.metadataUrl+="/"),this.metadataUrl+=".well-known/openid-configuration")),this.metadata=s,this.metadataSeed=r,this.signingKeys=i,this.client_id=n,this.client_secret=a,this.response_type=o,this.scope=c,this.redirect_uri=l,this.post_logout_redirect_uri=h,this.client_authentication=d,this.token_endpoint_auth_signing_alg=g,this.prompt=u,this.display=_,this.max_age=p,this.ui_locales=w,this.acr_values=m,this.resource=f,this.response_mode=y,this.filterProtocolClaims=null==S||S,this.loadUserInfo=!!b,this.staleStateAgeInSeconds=E,this.mergeClaimsStrategy=x,this.omitScopeWhenRequesting=q,this.disablePKCE=!!R,this.revokeTokenAdditionalContentTypes=C,this.fetchRequestCredentials=I||"same-origin",this.requestTimeoutInSeconds=k,P)this.stateStore=P;else{let e="u">typeof window?window.localStorage:new v;this.stateStore=new T({store:e})}if(this.refreshTokenAllowedScope=U,this.extraQueryParams=A,this.extraTokenParams=O,this.extraHeaders=N,this.dpop=j,this.dpop&&!(null==(H=this.dpop)?void 0:H.store))throw Error("A DPoPStore is required when dpop is enabled")}},R=class{constructor(e,t){this._settings=e,this._metadataService=t,this._logger=new c("UserInfoService"),this._getClaimsFromJwt=async e=>{let t=this._logger.create("_getClaimsFromJwt");try{let s=l.decode(e);return t.debug("JWT decoding successful"),s}catch(e){throw t.error("Error parsing JWT response"),e}},this._jsonService=new k(void 0,this._getClaimsFromJwt,this._settings.extraHeaders)}async getClaims(e){let t=this._logger.create("getClaims");e||this._logger.throw(Error("No token passed"));let s=await this._metadataService.getUserInfoEndpoint();t.debug("got userinfo url",s);let i=await this._jsonService.getJson(s,{token:e,credentials:this._settings.fetchRequestCredentials,timeoutInSeconds:this._settings.requestTimeoutInSeconds});return t.debug("got claims",i),i}},P=class{constructor(e,t){this._settings=e,this._metadataService=t,this._logger=new c("TokenClient"),this._jsonService=new k(this._settings.revokeTokenAdditionalContentTypes,null,this._settings.extraHeaders)}async exchangeCode({grant_type:e="authorization_code",redirect_uri:t=this._settings.redirect_uri,client_id:s=this._settings.client_id,client_secret:i=this._settings.client_secret,extraHeaders:r,...n}){let a,o=this._logger.create("exchangeCode");s||o.throw(Error("A client_id is required")),t||o.throw(Error("A redirect_uri is required")),n.code||o.throw(Error("A code is required"));let c=new URLSearchParams({grant_type:e,redirect_uri:t});for(let[e,t]of Object.entries(n))null!=t&&c.set(e,t);if(("client_secret_basic"===this._settings.client_authentication||"client_secret_jwt"===this._settings.client_authentication)&&null==i)throw o.throw(Error("A client_secret is required")),null;let l=await this._metadataService.getTokenEndpoint(!1);switch(this._settings.client_authentication){case"client_secret_basic":a=g.generateBasicAuth(s,i);break;case"client_secret_post":c.append("client_id",s),i&&c.append("client_secret",i);break;case"client_secret_jwt":{let e=await g.generateClientAssertionJwt(s,i,l,this._settings.token_endpoint_auth_signing_alg);c.append("client_id",s),c.append("client_assertion_type","urn:ietf:params:oauth:client-assertion-type:jwt-bearer"),c.append("client_assertion",e)}}o.debug("got token endpoint");let h=await this._jsonService.postForm(l,{body:c,basicAuth:a,timeoutInSeconds:this._settings.requestTimeoutInSeconds,initCredentials:this._settings.fetchRequestCredentials,extraHeaders:r});return o.debug("got response"),h}async exchangeCredentials({grant_type:e="password",client_id:t=this._settings.client_id,client_secret:s=this._settings.client_secret,scope:i=this._settings.scope,...r}){let n,a=this._logger.create("exchangeCredentials");t||a.throw(Error("A client_id is required"));let o=new URLSearchParams({grant_type:e});for(let[e,t]of(this._settings.omitScopeWhenRequesting||o.set("scope",i),Object.entries(r)))null!=t&&o.set(e,t);if(("client_secret_basic"===this._settings.client_authentication||"client_secret_jwt"===this._settings.client_authentication)&&null==s)throw a.throw(Error("A client_secret is required")),null;let c=await this._metadataService.getTokenEndpoint(!1);switch(this._settings.client_authentication){case"client_secret_basic":n=g.generateBasicAuth(t,s);break;case"client_secret_post":o.append("client_id",t),s&&o.append("client_secret",s);break;case"client_secret_jwt":{let e=await g.generateClientAssertionJwt(t,s,c,this._settings.token_endpoint_auth_signing_alg);o.append("client_id",t),o.append("client_assertion_type","urn:ietf:params:oauth:client-assertion-type:jwt-bearer"),o.append("client_assertion",e)}}a.debug("got token endpoint");let l=await this._jsonService.postForm(c,{body:o,basicAuth:n,timeoutInSeconds:this._settings.requestTimeoutInSeconds,initCredentials:this._settings.fetchRequestCredentials});return a.debug("got response"),l}async exchangeRefreshToken({grant_type:e="refresh_token",client_id:t=this._settings.client_id,client_secret:s=this._settings.client_secret,timeoutInSeconds:i,extraHeaders:r,...n}){let a,o=this._logger.create("exchangeRefreshToken");t||o.throw(Error("A client_id is required")),n.refresh_token||o.throw(Error("A refresh_token is required"));let c=new URLSearchParams({grant_type:e});for(let[e,t]of Object.entries(n))Array.isArray(t)?t.forEach(t=>c.append(e,t)):null!=t&&c.set(e,t);if(("client_secret_basic"===this._settings.client_authentication||"client_secret_jwt"===this._settings.client_authentication)&&null==s)throw o.throw(Error("A client_secret is required")),null;let l=await this._metadataService.getTokenEndpoint(!1);switch(this._settings.client_authentication){case"client_secret_basic":a=g.generateBasicAuth(t,s);break;case"client_secret_post":c.append("client_id",t),s&&c.append("client_secret",s);break;case"client_secret_jwt":{let e=await g.generateClientAssertionJwt(t,s,l,this._settings.token_endpoint_auth_signing_alg);c.append("client_id",t),c.append("client_assertion_type","urn:ietf:params:oauth:client-assertion-type:jwt-bearer"),c.append("client_assertion",e)}}o.debug("got token endpoint");let h=await this._jsonService.postForm(l,{body:c,basicAuth:a,timeoutInSeconds:i,initCredentials:this._settings.fetchRequestCredentials,extraHeaders:r});return o.debug("got response"),h}async revoke(e){var t;let s=this._logger.create("revoke");e.token||s.throw(Error("A token is required"));let i=await this._metadataService.getRevocationEndpoint(!1);s.debug(`got revocation endpoint, revoking ${null!=(t=e.token_type_hint)?t:"default token type"}`);let r=new URLSearchParams;for(let[t,s]of Object.entries(e))null!=s&&r.set(t,s);r.set("client_id",this._settings.client_id),this._settings.client_secret&&r.set("client_secret",this._settings.client_secret),await this._jsonService.postForm(i,{body:r,timeoutInSeconds:this._settings.requestTimeoutInSeconds}),s.debug("got response")}},C=class{constructor(e,t,s){this._settings=e,this._metadataService=t,this._claimsService=s,this._logger=new c("ResponseValidator"),this._userInfoService=new R(this._settings,this._metadataService),this._tokenClient=new P(this._settings,this._metadataService)}async validateSigninResponse(e,t,s){let i=this._logger.create("validateSigninResponse");this._processSigninState(e,t),i.debug("state processed"),await this._processCode(e,t,s),i.debug("code processed"),e.isOpenId&&this._validateIdTokenAttributes(e,"",t.nonce),i.debug("tokens validated"),await this._processClaims(e,null==t?void 0:t.skipUserInfo,e.isOpenId),i.debug("claims processed")}async validateCredentialsResponse(e,t){let s=this._logger.create("validateCredentialsResponse"),i=e.isOpenId&&!!e.id_token;i&&this._validateIdTokenAttributes(e),s.debug("tokens validated"),await this._processClaims(e,t,i),s.debug("claims processed")}async validateRefreshResponse(e,t){let s=this._logger.create("validateRefreshResponse");e.userState=t.data,null!=e.session_state||(e.session_state=t.session_state),null!=e.scope||(e.scope=t.scope),e.isOpenId&&e.id_token&&(this._validateIdTokenAttributes(e,t.id_token),s.debug("ID Token validated")),e.id_token||(e.id_token=t.id_token,e.profile=t.profile);let i=e.isOpenId&&!!e.id_token;await this._processClaims(e,!1,i),s.debug("claims processed")}validateSignoutResponse(e,t){let s=this._logger.create("validateSignoutResponse");if(t.id!==e.state&&s.throw(Error("State does not match")),s.debug("state validated"),e.userState=t.data,e.error)throw s.warn("Response was error",e.error),new m(e)}_processSigninState(e,t){let s=this._logger.create("_processSigninState");if(t.id!==e.state&&s.throw(Error("State does not match")),t.client_id||s.throw(Error("No client_id on state")),t.authority||s.throw(Error("No authority on state")),this._settings.authority!==t.authority&&s.throw(Error("authority mismatch on settings vs. signin state")),this._settings.client_id&&this._settings.client_id!==t.client_id&&s.throw(Error("client_id mismatch on settings vs. signin state")),s.debug("state validated"),e.userState=t.data,e.url_state=t.url_state,null!=e.scope||(e.scope=t.scope),e.error)throw s.warn("Response was error",e.error),new m(e);t.code_verifier&&!e.code&&s.throw(Error("Expected code in response"))}async _processClaims(e,t=!1,s=!0){let i=this._logger.create("_processClaims");if(e.profile=this._claimsService.filterProtocolClaims(e.profile),t||!this._settings.loadUserInfo||!e.access_token)return void i.debug("not loading user info");i.debug("loading user info");let r=await this._userInfoService.getClaims(e.access_token);i.debug("user info claims received from user info endpoint"),s&&r.sub!==e.profile.sub&&i.throw(Error("subject from UserInfo response does not match subject in ID Token")),e.profile=this._claimsService.mergeClaims(e.profile,this._claimsService.filterProtocolClaims(r)),i.debug("user info claims received, updated profile:",e.profile)}async _processCode(e,t,s){let i=this._logger.create("_processCode");if(e.code){i.debug("Validating code");let r=await this._tokenClient.exchangeCode({client_id:t.client_id,client_secret:t.client_secret,code:e.code,redirect_uri:t.redirect_uri,code_verifier:t.code_verifier,extraHeaders:s,...t.extraTokenParams});Object.assign(e,r)}else i.debug("No code to process")}_validateIdTokenAttributes(e,t,s){var i;let r=this._logger.create("_validateIdTokenAttributes");r.debug("decoding ID Token JWT");let n=l.decode(null!=(i=e.id_token)?i:"");if(n.sub||r.throw(Error("ID Token is missing a subject claim")),s&&n.nonce!==s&&r.throw(Error("nonce in id_token does not match nonce in client storage")),t){let e=l.decode(t);n.sub!==e.sub&&r.throw(Error("sub in id_token does not match current sub")),n.auth_time&&n.auth_time!==e.auth_time&&r.throw(Error("auth_time in id_token does not match original auth_time")),n.azp&&n.azp!==e.azp&&r.throw(Error("azp in id_token does not match original azp")),!n.azp&&e.azp&&r.throw(Error("azp not in id_token, but present in original id_token"))}e.profile=n}},I=class e{constructor(e){this.id=e.id||g.generateUUIDv4(),this.data=e.data,e.created&&e.created>0?this.created=e.created:this.created=p.getEpochTime(),this.request_type=e.request_type,this.url_state=e.url_state}toStorageString(){return new c("State").create("toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type,url_state:this.url_state})}static fromStorageString(t){return c.createStatic("State","fromStorageString"),Promise.resolve(new e(JSON.parse(t)))}static async clearStaleState(t,s){let i=c.createStatic("State","clearStaleState"),r=p.getEpochTime()-s,n=await t.getAllKeys();i.debug("got keys",n);for(let s=0;s<n.length;s++){let a=n[s],o=await t.get(a),c=!1;if(o)try{let t=await e.fromStorageString(o);i.debug("got item from key:",a,t.created),t.created<=r&&(c=!0)}catch(e){i.error("Error parsing state for key:",a,e),c=!0}else i.debug("no item in storage for key:",a),c=!0;c&&(i.debug("removed item for key:",a),t.remove(a))}}},U=class e extends I{constructor(e){super(e),this.code_verifier=e.code_verifier,this.code_challenge=e.code_challenge,this.authority=e.authority,this.client_id=e.client_id,this.redirect_uri=e.redirect_uri,this.scope=e.scope,this.client_secret=e.client_secret,this.extraTokenParams=e.extraTokenParams,this.response_mode=e.response_mode,this.skipUserInfo=e.skipUserInfo,this.nonce=e.nonce}static async create(t){let s=!0===t.code_verifier?g.generateCodeVerifier():t.code_verifier||void 0,i=s?await g.generateCodeChallenge(s):void 0;return new e({...t,code_verifier:s,code_challenge:i})}toStorageString(){return new c("SigninState").create("toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type,url_state:this.url_state,code_verifier:this.code_verifier,authority:this.authority,client_id:this.client_id,redirect_uri:this.redirect_uri,scope:this.scope,client_secret:this.client_secret,extraTokenParams:this.extraTokenParams,response_mode:this.response_mode,skipUserInfo:this.skipUserInfo,nonce:this.nonce})}static fromStorageString(t){c.createStatic("SigninState","fromStorageString");let s=JSON.parse(t);return e.create(s)}},A=class e{constructor(e){this.url=e.url,this.state=e.state}static async create({url:t,authority:s,client_id:i,redirect_uri:r,response_type:n,scope:a,state_data:o,response_mode:c,request_type:l,client_secret:h,nonce:d,url_state:g,resource:u,skipUserInfo:_,extraQueryParams:p,extraTokenParams:w,disablePKCE:m,dpopJkt:f,omitScopeWhenRequesting:y,...S}){if(!t)throw this._logger.error("create: No url passed"),Error("url");if(!i)throw this._logger.error("create: No client_id passed"),Error("client_id");if(!r)throw this._logger.error("create: No redirect_uri passed"),Error("redirect_uri");if(!n)throw this._logger.error("create: No response_type passed"),Error("response_type");if(!a)throw this._logger.error("create: No scope passed"),Error("scope");if(!s)throw this._logger.error("create: No authority passed"),Error("authority");let v=await U.create({data:o,request_type:l,url_state:g,code_verifier:!m,client_id:i,authority:s,redirect_uri:r,response_mode:c,client_secret:h,scope:a,extraTokenParams:w,skipUserInfo:_,nonce:d}),b=new URL(t);b.searchParams.append("client_id",i),b.searchParams.append("redirect_uri",r),b.searchParams.append("response_type",n),y||b.searchParams.append("scope",a),d&&b.searchParams.append("nonce",d),f&&b.searchParams.append("dpop_jkt",f);let k=v.id;for(let[e,t]of(g&&(k=`${k};${g}`),b.searchParams.append("state",k),v.code_challenge&&(b.searchParams.append("code_challenge",v.code_challenge),b.searchParams.append("code_challenge_method","S256")),u&&(Array.isArray(u)?u:[u]).forEach(e=>b.searchParams.append("resource",e)),Object.entries({response_mode:c,...S,...p})))null!=t&&b.searchParams.append(e,t.toString());return new e({url:b.href,state:v})}};A._logger=new c("SigninRequest");var O=class{constructor(e){if(this.access_token="",this.token_type="",this.profile={},this.state=e.get("state"),this.session_state=e.get("session_state"),this.state){let e=decodeURIComponent(this.state).split(";");this.state=e[0],e.length>1&&(this.url_state=e.slice(1).join(";"))}this.error=e.get("error"),this.error_description=e.get("error_description"),this.error_uri=e.get("error_uri"),this.code=e.get("code")}get expires_in(){if(void 0!==this.expires_at)return this.expires_at-p.getEpochTime()}set expires_in(e){"string"==typeof e&&(e=Number(e)),void 0!==e&&e>=0&&(this.expires_at=Math.floor(e)+p.getEpochTime())}get isOpenId(){var e;return(null==(e=this.scope)?void 0:e.split(" ").includes("openid"))||!!this.id_token}},N=class{constructor({url:e,state_data:t,id_token_hint:s,post_logout_redirect_uri:i,extraQueryParams:r,request_type:n,client_id:a,url_state:o}){if(this._logger=new c("SignoutRequest"),!e)throw this._logger.error("ctor: No url passed"),Error("url");let l=new URL(e);if(s&&l.searchParams.append("id_token_hint",s),a&&l.searchParams.append("client_id",a),i&&(l.searchParams.append("post_logout_redirect_uri",i),t||o)){this.state=new I({data:t,request_type:n,url_state:o});let e=this.state.id;o&&(e=`${e};${o}`),l.searchParams.append("state",e)}for(let[e,t]of Object.entries({...r}))null!=t&&l.searchParams.append(e,t.toString());this.url=l.href}},j=class{constructor(e){if(this.state=e.get("state"),this.state){let e=decodeURIComponent(this.state).split(";");this.state=e[0],e.length>1&&(this.url_state=e.slice(1).join(";"))}this.error=e.get("error"),this.error_description=e.get("error_description"),this.error_uri=e.get("error_uri")}},q=["nbf","jti","auth_time","nonce","acr","amr","azp","at_hash"],H=["sub","iss","aud","exp","iat"],M=class{constructor(e){this._settings=e,this._logger=new c("ClaimsService")}filterProtocolClaims(e){let t={...e};if(this._settings.filterProtocolClaims){for(let e of Array.isArray(this._settings.filterProtocolClaims)?this._settings.filterProtocolClaims:q)H.includes(e)||delete t[e]}return t}mergeClaims(e,t){let s={...e};for(let[e,i]of Object.entries(t))if(s[e]!==i)if(Array.isArray(s[e])||Array.isArray(i))if("replace"==this._settings.mergeClaimsStrategy.array)s[e]=i;else{let t=Array.isArray(s[e])?s[e]:[s[e]];for(let e of Array.isArray(i)?i:[i])t.includes(e)||t.push(e);s[e]=t}else"object"==typeof s[e]&&"object"==typeof i?s[e]=this.mergeClaims(s[e],i):s[e]=i;return s}},$=class{constructor(e,t){this.keys=e,this.nonce=t}},J=class{constructor(e,t){this._logger=new c("OidcClient"),this.settings=e instanceof x?e:new x(e),this.metadataService=null!=t?t:new E(this.settings),this._claimsService=new M(this.settings),this._validator=new C(this.settings,this.metadataService,this._claimsService),this._tokenClient=new P(this.settings,this.metadataService)}async createSigninRequest({state:e,request:t,request_uri:s,request_type:i,id_token_hint:r,login_hint:n,skipUserInfo:a,nonce:o,url_state:c,response_type:l=this.settings.response_type,scope:h=this.settings.scope,redirect_uri:d=this.settings.redirect_uri,prompt:g=this.settings.prompt,display:u=this.settings.display,max_age:_=this.settings.max_age,ui_locales:p=this.settings.ui_locales,acr_values:w=this.settings.acr_values,resource:m=this.settings.resource,response_mode:f=this.settings.response_mode,extraQueryParams:y=this.settings.extraQueryParams,extraTokenParams:S=this.settings.extraTokenParams,dpopJkt:v,omitScopeWhenRequesting:b=this.settings.omitScopeWhenRequesting}){let k=this._logger.create("createSigninRequest");if("code"!==l)throw Error("Only the Authorization Code flow (with PKCE) is supported");let E=await this.metadataService.getAuthorizationEndpoint();k.debug("Received authorization endpoint",E);let T=await A.create({url:E,authority:this.settings.authority,client_id:this.settings.client_id,redirect_uri:d,response_type:l,scope:h,state_data:e,url_state:c,prompt:g,display:u,max_age:_,ui_locales:p,id_token_hint:r,login_hint:n,acr_values:w,dpopJkt:v,resource:m,request:t,request_uri:s,extraQueryParams:y,extraTokenParams:S,request_type:i,response_mode:f,client_secret:this.settings.client_secret,skipUserInfo:a,nonce:o,disablePKCE:this.settings.disablePKCE,omitScopeWhenRequesting:b});await this.clearStaleState();let x=T.state;return await this.settings.stateStore.set(x.id,x.toStorageString()),T}async readSigninResponseState(e,t=!1){let s=this._logger.create("readSigninResponseState"),i=new O(w.readParams(e,this.settings.response_mode));if(!i.state)throw s.throw(Error("No state in response")),null;let r=await this.settings.stateStore[t?"remove":"get"](i.state);if(!r)throw s.throw(Error("No matching state found in storage")),null;return{state:await U.fromStorageString(r),response:i}}async processSigninResponse(e,t,s=!0){let i=this._logger.create("processSigninResponse"),{state:r,response:n}=await this.readSigninResponseState(e,s);if(i.debug("received state from storage; validating response"),this.settings.dpop&&this.settings.dpop.store){let e=await this.getDpopProof(this.settings.dpop.store);t={...t,DPoP:e}}try{await this._validator.validateSigninResponse(n,r,t)}catch(e){if(e instanceof b&&this.settings.dpop){let s=await this.getDpopProof(this.settings.dpop.store,e.nonce);t.DPoP=s,await this._validator.validateSigninResponse(n,r,t)}else throw e}return n}async getDpopProof(e,t){let s;return(await e.getAllKeys()).includes(this.settings.client_id)?(s=await e.get(this.settings.client_id)).nonce!==t&&t&&(s.nonce=t,await e.set(this.settings.client_id,s)):(s=new $(await g.generateDPoPKeys(),t),await e.set(this.settings.client_id,s)),await g.generateDPoPProof({url:await this.metadataService.getTokenEndpoint(!1),httpMethod:"POST",keyPair:s.keys,nonce:s.nonce})}async processResourceOwnerPasswordCredentials({username:e,password:t,skipUserInfo:s=!1,extraTokenParams:i={}}){let r=await this._tokenClient.exchangeCredentials({username:e,password:t,...i}),n=new O(new URLSearchParams);return Object.assign(n,r),await this._validator.validateCredentialsResponse(n,s),n}async useRefreshToken({state:e,redirect_uri:t,resource:s,timeoutInSeconds:i,extraHeaders:r,extraTokenParams:n}){var a;let o,c,l=this._logger.create("useRefreshToken");if(void 0===this.settings.refreshTokenAllowedScope)o=e.scope;else{let t=this.settings.refreshTokenAllowedScope.split(" ");o=((null==(a=e.scope)?void 0:a.split(" "))||[]).filter(e=>t.includes(e)).join(" ")}if(this.settings.dpop&&this.settings.dpop.store){let e=await this.getDpopProof(this.settings.dpop.store);r={...r,DPoP:e}}try{c=await this._tokenClient.exchangeRefreshToken({refresh_token:e.refresh_token,scope:o,redirect_uri:t,resource:s,timeoutInSeconds:i,extraHeaders:r,...n})}catch(a){if(a instanceof b&&this.settings.dpop)r.DPoP=await this.getDpopProof(this.settings.dpop.store,a.nonce),c=await this._tokenClient.exchangeRefreshToken({refresh_token:e.refresh_token,scope:o,redirect_uri:t,resource:s,timeoutInSeconds:i,extraHeaders:r,...n});else throw a}let h=new O(new URLSearchParams);return Object.assign(h,c),l.debug("validating response",h),await this._validator.validateRefreshResponse(h,{...e,scope:o}),h}async createSignoutRequest({state:e,id_token_hint:t,client_id:s,request_type:i,url_state:r,post_logout_redirect_uri:n=this.settings.post_logout_redirect_uri,extraQueryParams:a=this.settings.extraQueryParams}={}){let o=this._logger.create("createSignoutRequest"),c=await this.metadataService.getEndSessionEndpoint();if(!c)throw o.throw(Error("No end session endpoint")),null;o.debug("Received end session endpoint",c),s||!n||t||(s=this.settings.client_id);let l=new N({url:c,id_token_hint:t,client_id:s,post_logout_redirect_uri:n,state_data:e,extraQueryParams:a,request_type:i,url_state:r});await this.clearStaleState();let h=l.state;return h&&(o.debug("Signout request has state to persist"),await this.settings.stateStore.set(h.id,h.toStorageString())),l}async readSignoutResponseState(e,t=!1){let s=this._logger.create("readSignoutResponseState"),i=new j(w.readParams(e,this.settings.response_mode));if(!i.state){if(s.debug("No state in response"),i.error)throw s.warn("Response was error:",i.error),new m(i);return{state:void 0,response:i}}let r=await this.settings.stateStore[t?"remove":"get"](i.state);if(!r)throw s.throw(Error("No matching state found in storage")),null;return{state:await I.fromStorageString(r),response:i}}async processSignoutResponse(e){let t=this._logger.create("processSignoutResponse"),{state:s,response:i}=await this.readSignoutResponseState(e,!0);return s?(t.debug("Received state from storage; validating response"),this._validator.validateSignoutResponse(i,s)):t.debug("No state from storage; skipping response validation"),i}clearStaleState(){return this._logger.create("clearStaleState"),I.clearStaleState(this.settings.stateStore,this.settings.staleStateAgeInSeconds)}async revokeToken(e,t){return this._logger.create("revokeToken"),await this._tokenClient.revoke({token:e,token_type_hint:t})}},D=class{constructor(e){this._userManager=e,this._logger=new c("SessionMonitor"),this._start=async e=>{let t=e.session_state;if(!t)return;let s=this._logger.create("_start");if(e.profile?(this._sub=e.profile.sub,s.debug("session_state",t,", sub",this._sub)):(this._sub=void 0,s.debug("session_state",t,", anonymous user")),this._checkSessionIFrame)return void this._checkSessionIFrame.start(t);try{let e=await this._userManager.metadataService.getCheckSessionIframe();if(e){s.debug("initializing check session iframe");let i=this._userManager.settings.client_id,r=this._userManager.settings.checkSessionIntervalInSeconds,n=this._userManager.settings.stopCheckSessionOnError,a=new S(this._callback,i,e,r,n);await a.load(),this._checkSessionIFrame=a,a.start(t)}else s.warn("no check session iframe found in the metadata")}catch(e){s.error("Error from getCheckSessionIframe:",e instanceof Error?e.message:e)}},this._stop=()=>{let e=this._logger.create("_stop");if(this._sub=void 0,this._checkSessionIFrame&&this._checkSessionIFrame.stop(),this._userManager.settings.monitorAnonymousSession){let t=setInterval(async()=>{clearInterval(t);try{let e=await this._userManager.querySessionStatus();if(e){let t={session_state:e.session_state,profile:e.sub?{sub:e.sub}:null};this._start(t)}}catch(t){e.error("error from querySessionStatus",t instanceof Error?t.message:t)}},1e3)}},this._callback=async()=>{let e=this._logger.create("_callback");try{let t=await this._userManager.querySessionStatus(),s=!0;t&&this._checkSessionIFrame?t.sub===this._sub?(s=!1,this._checkSessionIFrame.start(t.session_state),e.debug("same sub still logged in at OP, session state has changed, restarting check session iframe; session_state",t.session_state),await this._userManager.events._raiseUserSessionChanged()):e.debug("different subject signed into OP",t.sub):e.debug("subject no longer signed into OP"),s?this._sub?await this._userManager.events._raiseUserSignedOut():await this._userManager.events._raiseUserSignedIn():e.debug("no change in session detected, no event to raise")}catch(t){this._sub&&(e.debug("Error calling queryCurrentSigninSession; raising signed out event",t),await this._userManager.events._raiseUserSignedOut())}},e||this._logger.throw(Error("No user manager passed")),this._userManager.events.addUserLoaded(this._start),this._userManager.events.addUserUnloaded(this._stop),this._init().catch(e=>{this._logger.error(e)})}async _init(){this._logger.create("_init");let e=await this._userManager.getUser();if(e)this._start(e);else if(this._userManager.settings.monitorAnonymousSession){let e=await this._userManager.querySessionStatus();if(e){let t={session_state:e.session_state,profile:e.sub?{sub:e.sub}:null};this._start(t)}}}},K=class e{constructor(e){var t;this.id_token=e.id_token,this.session_state=null!=(t=e.session_state)?t:null,this.access_token=e.access_token,this.refresh_token=e.refresh_token,this.token_type=e.token_type,this.scope=e.scope,this.profile=e.profile,this.expires_at=e.expires_at,this.state=e.userState,this.url_state=e.url_state}get expires_in(){if(void 0!==this.expires_at)return this.expires_at-p.getEpochTime()}set expires_in(e){void 0!==e&&(this.expires_at=Math.floor(e)+p.getEpochTime())}get expired(){let e=this.expires_in;if(void 0!==e)return e<=0}get scopes(){var e,t;return null!=(t=null==(e=this.scope)?void 0:e.split(" "))?t:[]}toStorageString(){return new c("User").create("toStorageString"),JSON.stringify({id_token:this.id_token,session_state:this.session_state,access_token:this.access_token,refresh_token:this.refresh_token,token_type:this.token_type,scope:this.scope,profile:this.profile,expires_at:this.expires_at})}static fromStorageString(t){return c.createStatic("User","fromStorageString"),new e(JSON.parse(t))}},W="oidc-client",L=class{constructor(){this._abort=new u("Window navigation aborted"),this._disposeHandlers=new Set,this._window=null}async navigate(e){let t=this._logger.create("navigate");if(!this._window)throw Error("Attempted to navigate on a disposed window");t.debug("setting URL in window"),this._window.location.replace(e.url);let{url:s,keepOpen:i}=await new Promise((s,i)=>{let r=r=>{var n;let a=r.data,o=null!=(n=e.scriptOrigin)?n:window.location.origin;if(r.origin===o&&(null==a?void 0:a.source)===W){try{let s=w.readParams(a.url,e.response_mode).get("state");if(s||t.warn("no state found in response url"),r.source!==this._window&&s!==e.state)return}catch{this._dispose(),i(Error("Invalid response from window"))}s(a)}};window.addEventListener("message",r,!1),this._disposeHandlers.add(()=>window.removeEventListener("message",r,!1));let n=new BroadcastChannel(`oidc-client-popup-${e.state}`);n.addEventListener("message",r,!1),this._disposeHandlers.add(()=>n.close()),this._disposeHandlers.add(this._abort.addHandler(e=>{this._dispose(),i(e)}))});return t.debug("got response from window"),this._dispose(),i||this.close(),{url:s}}_dispose(){for(let e of(this._logger.create("_dispose"),this._disposeHandlers))e();this._disposeHandlers.clear()}static _notifyParent(e,t,s=!1,i=window.location.origin){let r={source:W,url:t,keepOpen:s},n=new c("_notifyParent");if(e)n.debug("With parent. Using parent.postMessage."),e.postMessage(r,i);else{n.debug("No parent. Using BroadcastChannel.");let e=new URL(t).searchParams.get("state");if(!e)throw Error("No parent and no state in URL. Can't complete notification.");let s=new BroadcastChannel(`oidc-client-popup-${e}`);s.postMessage(r),s.close()}}},z={location:!1,toolbar:!1,height:640,closePopupWindowAfterInSeconds:-1},F="_blank",B=class extends x{constructor(e){let{popup_redirect_uri:t=e.redirect_uri,popup_post_logout_redirect_uri:s=e.post_logout_redirect_uri,popupWindowFeatures:i=z,popupWindowTarget:r=F,redirectMethod:n="assign",redirectTarget:a="self",iframeNotifyParentOrigin:o=e.iframeNotifyParentOrigin,iframeScriptOrigin:c=e.iframeScriptOrigin,requestTimeoutInSeconds:l,silent_redirect_uri:h=e.redirect_uri,silentRequestTimeoutInSeconds:d,automaticSilentRenew:g=!0,validateSubOnSilentRenew:u=!0,includeIdTokenInSilentRenew:_=!1,monitorSession:p=!1,monitorAnonymousSession:w=!1,checkSessionIntervalInSeconds:m=2,query_status_response_type:f="code",stopCheckSessionOnError:y=!0,revokeTokenTypes:S=["access_token","refresh_token"],revokeTokensOnSignout:b=!1,includeIdTokenInSilentSignout:k=!1,accessTokenExpiringNotificationTimeInSeconds:E=60,maxSilentRenewTimeoutRetries:x,userStore:R}=e;if(super(e),this.popup_redirect_uri=t,this.popup_post_logout_redirect_uri=s,this.popupWindowFeatures=i,this.popupWindowTarget=r,this.redirectMethod=n,this.redirectTarget=a,this.iframeNotifyParentOrigin=o,this.iframeScriptOrigin=c,this.silent_redirect_uri=h,this.silentRequestTimeoutInSeconds=d||l||10,this.automaticSilentRenew=g,this.validateSubOnSilentRenew=u,this.includeIdTokenInSilentRenew=_,this.monitorSession=p,this.monitorAnonymousSession=w,this.checkSessionIntervalInSeconds=m,this.stopCheckSessionOnError=y,this.query_status_response_type=f,this.revokeTokenTypes=S,this.revokeTokensOnSignout=b,this.includeIdTokenInSilentSignout=k,this.accessTokenExpiringNotificationTimeInSeconds=E,this.maxSilentRenewTimeoutRetries=x,R)this.userStore=R;else{let e="u">typeof window?window.sessionStorage:new v;this.userStore=new T({store:e})}}},V=class e extends L{constructor({silentRequestTimeoutInSeconds:t=10}){super(),this._logger=new c("IFrameWindow"),this._timeoutInSeconds=t,this._frame=e.createHiddenIframe(),this._window=this._frame.contentWindow}static createHiddenIframe(){let e=window.document.createElement("iframe");return e.style.visibility="hidden",e.style.position="fixed",e.style.left="-1000px",e.style.top="0",e.width="0",e.height="0",window.document.body.appendChild(e),e}async navigate(e){this._logger.debug("navigate: Using timeout of:",this._timeoutInSeconds);let t=setTimeout(()=>void this._abort.raise(new f("IFrame timed out without a response")),1e3*this._timeoutInSeconds);return this._disposeHandlers.add(()=>clearTimeout(t)),await super.navigate(e)}close(){var e;this._frame&&(this._frame.parentNode&&(this._frame.addEventListener("load",e=>{var t;let s=e.target;null==(t=s.parentNode)||t.removeChild(s),this._abort.raise(Error("IFrame removed from DOM"))},!0),null==(e=this._frame.contentWindow)||e.location.replace("about:blank")),this._frame=null),this._window=null}static notifyParent(e,t){return super._notifyParent(window.parent,e,!1,t)}},G=class{constructor(e){this._settings=e,this._logger=new c("IFrameNavigator")}async prepare({silentRequestTimeoutInSeconds:e=this._settings.silentRequestTimeoutInSeconds}){return new V({silentRequestTimeoutInSeconds:e})}async callback(e){this._logger.create("callback"),V.notifyParent(e,this._settings.iframeNotifyParentOrigin)}},Q=class extends L{constructor({popupWindowTarget:e=F,popupWindowFeatures:t={},popupSignal:s,popupAbortOnClose:i}){super(),this._logger=new c("PopupWindow");let r=_.center({...z,...t});this._window=window.open(void 0,e,_.serialize(r)),this.abortOnClose=!!i,s&&s.addEventListener("abort",()=>{var e;this._abort.raise(Error(null!=(e=s.reason)?e:"Popup aborted"))}),t.closePopupWindowAfterInSeconds&&t.closePopupWindowAfterInSeconds>0&&setTimeout(()=>{!this._window||"boolean"!=typeof this._window.closed||this._window.closed?this._abort.raise(Error("Popup blocked by user")):this.close()},1e3*t.closePopupWindowAfterInSeconds)}async navigate(e){var t;null==(t=this._window)||t.focus();let s=setInterval(()=>{(!this._window||this._window.closed)&&(this._logger.debug("Popup closed by user or isolated by redirect"),i(),this._disposeHandlers.delete(i),this.abortOnClose&&this._abort.raise(Error("Popup closed by user")))},500),i=()=>clearInterval(s);return this._disposeHandlers.add(i),await super.navigate(e)}close(){this._window&&!this._window.closed&&(this._window.close(),this._abort.raise(Error("Popup closed"))),this._window=null}static notifyOpener(e,t){super._notifyParent(window.opener,e,t),t||window.opener||window.close()}},X=class{constructor(e){this._settings=e,this._logger=new c("PopupNavigator")}async prepare({popupWindowFeatures:e=this._settings.popupWindowFeatures,popupWindowTarget:t=this._settings.popupWindowTarget,popupSignal:s,popupAbortOnClose:i}){return new Q({popupWindowFeatures:e,popupWindowTarget:t,popupSignal:s,popupAbortOnClose:i})}async callback(e,{keepOpen:t=!1}){this._logger.create("callback"),Q.notifyOpener(e,t)}},Y=class{constructor(e){this._settings=e,this._logger=new c("RedirectNavigator")}async prepare({redirectMethod:e=this._settings.redirectMethod,redirectTarget:t=this._settings.redirectTarget}){var s;let i;this._logger.create("prepare");let r=window.self;"top"===t&&(r=null!=(s=window.top)?s:window.self);let n=r.location[e].bind(r.location);return{navigate:async e=>{this._logger.create("navigate");let t=new Promise((t,s)=>{i=s,window.addEventListener("pageshow",()=>t(window.location.href)),n(e.url)});return await t},close:()=>{this._logger.create("close"),null==i||i(Error("Redirect aborted")),r.stop()}}}async callback(){}},Z=class extends y{constructor(e){super({expiringNotificationTimeInSeconds:e.accessTokenExpiringNotificationTimeInSeconds}),this._logger=new c("UserManagerEvents"),this._userLoaded=new u("User loaded"),this._userUnloaded=new u("User unloaded"),this._silentRenewError=new u("Silent renew error"),this._userSignedIn=new u("User signed in"),this._userSignedOut=new u("User signed out"),this._userSessionChanged=new u("User session changed")}async load(e,t=!0){await super.load(e),t&&await this._userLoaded.raise(e)}async unload(){await super.unload(),await this._userUnloaded.raise()}addUserLoaded(e){return this._userLoaded.addHandler(e)}removeUserLoaded(e){return this._userLoaded.removeHandler(e)}addUserUnloaded(e){return this._userUnloaded.addHandler(e)}removeUserUnloaded(e){return this._userUnloaded.removeHandler(e)}addSilentRenewError(e){return this._silentRenewError.addHandler(e)}removeSilentRenewError(e){return this._silentRenewError.removeHandler(e)}async _raiseSilentRenewError(e){await this._silentRenewError.raise(e)}addUserSignedIn(e){return this._userSignedIn.addHandler(e)}removeUserSignedIn(e){this._userSignedIn.removeHandler(e)}async _raiseUserSignedIn(){await this._userSignedIn.raise()}addUserSignedOut(e){return this._userSignedOut.addHandler(e)}removeUserSignedOut(e){this._userSignedOut.removeHandler(e)}async _raiseUserSignedOut(){await this._userSignedOut.raise()}addUserSessionChanged(e){return this._userSessionChanged.addHandler(e)}removeUserSessionChanged(e){this._userSessionChanged.removeHandler(e)}async _raiseUserSessionChanged(){await this._userSessionChanged.raise()}},ee=class{constructor(e){this._userManager=e,this._logger=new c("SilentRenewService"),this._isStarted=!1,this._retryTimer=new p("Retry Silent Renew"),this._timeoutRetryCount=0,this._tokenExpiring=async()=>{let e=this._logger.create("_tokenExpiring");try{await this._userManager.signinSilent(),this._timeoutRetryCount=0,e.debug("silent token renewal successful")}catch(t){if(t instanceof f){this._timeoutRetryCount++;let s=this._userManager.settings.maxSilentRenewTimeoutRetries;if(void 0!==s&&this._timeoutRetryCount>s){e.error(`Timeout retry limit reached (${this._timeoutRetryCount} > ${s}), raising silentRenewError:`,t),this._timeoutRetryCount=0,await this._userManager.events._raiseSilentRenewError(t);return}e.warn(`ErrorTimeout from signinSilent (attempt ${this._timeoutRetryCount}), retry in 5s:`,t),this._retryTimer.init(5);return}e.error("Error from signinSilent:",t),this._timeoutRetryCount=0,await this._userManager.events._raiseSilentRenewError(t)}}}async start(){let e=this._logger.create("start");if(!this._isStarted){this._isStarted=!0,this._userManager.events.addAccessTokenExpiring(this._tokenExpiring),this._retryTimer.addHandler(this._tokenExpiring);try{await this._userManager.getUser()}catch(t){e.error("getUser error",t)}}}stop(){this._isStarted&&(this._retryTimer.cancel(),this._retryTimer.removeHandler(this._tokenExpiring),this._userManager.events.removeAccessTokenExpiring(this._tokenExpiring),this._isStarted=!1)}},et=class{constructor(e){this.refresh_token=e.refresh_token,this.id_token=e.id_token,this.session_state=e.session_state,this.scope=e.scope,this.profile=e.profile,this.data=e.state}},es=class{constructor(e,t,s,i){this._logger=new c("UserManager"),this.settings=new B(e),this._client=new J(e),this._redirectNavigator=null!=t?t:new Y(this.settings),this._popupNavigator=null!=s?s:new X(this.settings),this._iframeNavigator=null!=i?i:new G(this.settings),this._events=new Z(this.settings),this._silentRenewService=new ee(this),this.settings.automaticSilentRenew&&this.startSilentRenew(),this._sessionMonitor=null,this.settings.monitorSession&&(this._sessionMonitor=new D(this))}get events(){return this._events}get metadataService(){return this._client.metadataService}async getUser(e=!1){let t=this._logger.create("getUser"),s=await this._loadUser();return s?(t.info("user loaded"),await this._events.load(s,e),s):(t.info("user not found in storage"),null)}async removeUser(){let e=this._logger.create("removeUser");await this.storeUser(null),e.info("user removed from storage"),await this._events.unload()}async signinRedirect(e={}){var t;let s;this._logger.create("signinRedirect");let{redirectMethod:i,...r}=e;(null==(t=this.settings.dpop)?void 0:t.bind_authorization_code)&&(s=await this.generateDPoPJkt(this.settings.dpop));let n=await this._redirectNavigator.prepare({redirectMethod:i});await this._signinStart({request_type:"si:r",dpopJkt:s,...r},n)}async signinRedirectCallback(e=window.location.href){let t=this._logger.create("signinRedirectCallback"),s=await this._signinEnd(e);return s.profile&&s.profile.sub?t.info("success, signed in subject",s.profile.sub):t.info("no subject"),s}async signinResourceOwnerCredentials({username:e,password:t,skipUserInfo:s=!1}){let i=this._logger.create("signinResourceOwnerCredential"),r=await this._client.processResourceOwnerPasswordCredentials({username:e,password:t,skipUserInfo:s,extraTokenParams:this.settings.extraTokenParams});i.debug("got signin response");let n=await this._buildUser(r);return n.profile&&n.profile.sub?i.info("success, signed in subject",n.profile.sub):i.info("no subject"),n}async signinPopup(e={}){var t;let s,i=this._logger.create("signinPopup");(null==(t=this.settings.dpop)?void 0:t.bind_authorization_code)&&(s=await this.generateDPoPJkt(this.settings.dpop));let{popupWindowFeatures:r,popupWindowTarget:n,popupSignal:a,popupAbortOnClose:o,...c}=e,l=this.settings.popup_redirect_uri;l||i.throw(Error("No popup_redirect_uri configured"));let h=await this._popupNavigator.prepare({popupWindowFeatures:r,popupWindowTarget:n,popupSignal:a,popupAbortOnClose:o}),d=await this._signin({request_type:"si:p",redirect_uri:l,display:"popup",dpopJkt:s,...c},h);return d&&(d.profile&&d.profile.sub?i.info("success, signed in subject",d.profile.sub):i.info("no subject")),d}async signinPopupCallback(e=window.location.href,t=!1){let s=this._logger.create("signinPopupCallback");await this._popupNavigator.callback(e,{keepOpen:t}),s.info("success")}async signinSilent(e={}){var t,s;let i,r,n=this._logger.create("signinSilent"),{silentRequestTimeoutInSeconds:a,...o}=e,c=await this._loadUser();if(!e.forceIframeAuth&&(null==c?void 0:c.refresh_token)){n.debug("using refresh token");let e=new et(c);return await this._useRefreshToken({state:e,redirect_uri:o.redirect_uri,resource:o.resource,extraTokenParams:o.extraTokenParams,timeoutInSeconds:a})}(null==(t=this.settings.dpop)?void 0:t.bind_authorization_code)&&(i=await this.generateDPoPJkt(this.settings.dpop));let l=this.settings.silent_redirect_uri;l||n.throw(Error("No silent_redirect_uri configured")),c&&this.settings.validateSubOnSilentRenew&&(n.debug("subject prior to silent renew:",c.profile.sub),r=c.profile.sub);let h=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:a});return(c=await this._signin({request_type:"si:s",redirect_uri:l,prompt:"none",id_token_hint:this.settings.includeIdTokenInSilentRenew?null==c?void 0:c.id_token:void 0,dpopJkt:i,...o},h,r))&&((null==(s=c.profile)?void 0:s.sub)?n.info("success, signed in subject",c.profile.sub):n.info("no subject")),c}async _useRefreshToken(e){let t=await this._client.useRefreshToken({timeoutInSeconds:this.settings.silentRequestTimeoutInSeconds,...e}),s=new K({...e.state,...t});return await this.storeUser(s),await this._events.load(s),s}async signinSilentCallback(e=window.location.href){let t=this._logger.create("signinSilentCallback");await this._iframeNavigator.callback(e),t.info("success")}async signinCallback(e=window.location.href){let{state:t}=await this._client.readSigninResponseState(e);switch(t.request_type){case"si:r":return await this.signinRedirectCallback(e);case"si:p":await this.signinPopupCallback(e);break;case"si:s":await this.signinSilentCallback(e);break;default:throw Error("invalid request_type in state")}}async signoutCallback(e=window.location.href,t=!1){let{state:s}=await this._client.readSignoutResponseState(e);if(s)switch(s.request_type){case"so:r":return await this.signoutRedirectCallback(e);case"so:p":await this.signoutPopupCallback(e,t);break;case"so:s":await this.signoutSilentCallback(e);break;default:throw Error("invalid request_type in state")}}async querySessionStatus(e={}){let t=this._logger.create("querySessionStatus"),{silentRequestTimeoutInSeconds:s,...i}=e,r=this.settings.silent_redirect_uri;r||t.throw(Error("No silent_redirect_uri configured"));let n=await this._loadUser(),a=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:s}),o=await this._signinStart({request_type:"si:s",redirect_uri:r,prompt:"none",id_token_hint:this.settings.includeIdTokenInSilentRenew?null==n?void 0:n.id_token:void 0,response_type:this.settings.query_status_response_type,scope:"openid",skipUserInfo:!0,...i},a);try{let e=await this._client.processSigninResponse(o.url,{});if(t.debug("got signin response"),e.session_state&&e.profile.sub)return t.info("success for subject",e.profile.sub),{session_state:e.session_state,sub:e.profile.sub};return t.info("success, user not authenticated"),null}catch(e){if(this.settings.monitorAnonymousSession&&e instanceof m)switch(e.error){case"login_required":case"consent_required":case"interaction_required":case"account_selection_required":return t.info("success for anonymous user"),{session_state:e.session_state}}throw e}}async _signin(e,t,s){let i=await this._signinStart(e,t);return await this._signinEnd(i.url,s)}async _signinStart(e,t){let s=this._logger.create("_signinStart");try{let i=await this._client.createSigninRequest(e);return s.debug("got signin request"),await t.navigate({url:i.url,state:i.state.id,response_mode:i.state.response_mode,scriptOrigin:this.settings.iframeScriptOrigin})}catch(e){throw s.debug("error after preparing navigator, closing navigator window"),t.close(),e}}async _signinEnd(e,t){let s=this._logger.create("_signinEnd"),i=await this._client.processSigninResponse(e,{});return s.debug("got signin response"),await this._buildUser(i,t)}async _buildUser(e,t){let s=this._logger.create("_buildUser"),i=new K(e);if(t){if(t!==i.profile.sub)throw s.debug("current user does not match user returned from signin. sub from signin:",i.profile.sub),new m({...e,error:"login_required"});s.debug("current user matches user returned from signin")}return await this.storeUser(i),s.debug("user stored"),await this._events.load(i),i}async signoutRedirect(e={}){let t=this._logger.create("signoutRedirect"),{redirectMethod:s,...i}=e,r=await this._redirectNavigator.prepare({redirectMethod:s});await this._signoutStart({request_type:"so:r",post_logout_redirect_uri:this.settings.post_logout_redirect_uri,...i},r),t.info("success")}async signoutRedirectCallback(e=window.location.href){let t=this._logger.create("signoutRedirectCallback"),s=await this._signoutEnd(e);return t.info("success"),s}async signoutPopup(e={}){let t=this._logger.create("signoutPopup"),{popupWindowFeatures:s,popupWindowTarget:i,popupSignal:r,...n}=e,a=this.settings.popup_post_logout_redirect_uri,o=await this._popupNavigator.prepare({popupWindowFeatures:s,popupWindowTarget:i,popupSignal:r});await this._signout({request_type:"so:p",post_logout_redirect_uri:a,state:null==a?void 0:{},...n},o),t.info("success")}async signoutPopupCallback(e=window.location.href,t=!1){let s=this._logger.create("signoutPopupCallback");await this._popupNavigator.callback(e,{keepOpen:t}),s.info("success")}async _signout(e,t){let s=await this._signoutStart(e,t);return await this._signoutEnd(s.url)}async _signoutStart(e={},t){var s;let i=this._logger.create("_signoutStart");try{let r=await this._loadUser();i.debug("loaded current user from storage"),this.settings.revokeTokensOnSignout&&await this._revokeInternal(r);let n=e.id_token_hint||r&&r.id_token;n&&(i.debug("setting id_token_hint in signout request"),e.id_token_hint=n),await this.removeUser(),i.debug("user removed, creating signout request");let a=await this._client.createSignoutRequest(e);return i.debug("got signout request"),await t.navigate({url:a.url,state:null==(s=a.state)?void 0:s.id,scriptOrigin:this.settings.iframeScriptOrigin})}catch(e){throw i.debug("error after preparing navigator, closing navigator window"),t.close(),e}}async _signoutEnd(e){let t=this._logger.create("_signoutEnd"),s=await this._client.processSignoutResponse(e);return t.debug("got signout response"),s}async signoutSilent(e={}){var t;let s=this._logger.create("signoutSilent"),{silentRequestTimeoutInSeconds:i,...r}=e,n=this.settings.includeIdTokenInSilentSignout?null==(t=await this._loadUser())?void 0:t.id_token:void 0,a=this.settings.popup_post_logout_redirect_uri,o=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:i});await this._signout({request_type:"so:s",post_logout_redirect_uri:a,id_token_hint:n,...r},o),s.info("success")}async signoutSilentCallback(e=window.location.href){let t=this._logger.create("signoutSilentCallback");await this._iframeNavigator.callback(e),t.info("success")}async revokeTokens(e){let t=await this._loadUser();await this._revokeInternal(t,e)}async _revokeInternal(e,t=this.settings.revokeTokenTypes){let s=this._logger.create("_revokeInternal");if(!e)return;let i=t.filter(t=>"string"==typeof e[t]);if(!i.length)return void s.debug("no need to revoke due to no token(s)");for(let t of i)await this._client.revokeToken(e[t],t),s.info(`${t} revoked successfully`),"access_token"!==t&&(e[t]=null);await this.storeUser(e),s.debug("user stored"),await this._events.load(e)}startSilentRenew(){this._logger.create("startSilentRenew"),this._silentRenewService.start()}stopSilentRenew(){this._silentRenewService.stop()}get _userStoreKey(){return`user:${this.settings.authority}:${this.settings.client_id}`}async _loadUser(){let e=this._logger.create("_loadUser"),t=await this.settings.userStore.get(this._userStoreKey);return t?(e.debug("user storageString loaded"),K.fromStorageString(t)):(e.debug("no user storageString"),null)}async storeUser(e){let t=this._logger.create("storeUser");if(e){t.debug("storing user");let s=e.toStorageString();await this.settings.userStore.set(this._userStoreKey,s)}else this._logger.debug("removing user"),await this.settings.userStore.remove(this._userStoreKey),this.settings.dpop&&await this.settings.dpop.store.remove(this.settings.client_id)}async clearStaleState(){await this._client.clearStaleState()}async dpopProof(e,t,s,i){var r,n;let a=await (null==(n=null==(r=this.settings.dpop)?void 0:r.store)?void 0:n.get(this.settings.client_id));if(a)return await g.generateDPoPProof({url:e,accessToken:null==t?void 0:t.access_token,httpMethod:s,keyPair:a.keys,nonce:i})}async generateDPoPJkt(e){let t=await e.store.get(this.settings.client_id);return t||(t=new $(await g.generateDPoPKeys()),await e.store.set(this.settings.client_id,t)),await g.generateDPoPJkt(t.keys)}};e.s(["f",0,function(e){let t=window.location.origin;return new es({authority:e.issuer,client_id:e.clientId,redirect_uri:`${t}/auth/callback`,post_logout_redirect_uri:e.postLogoutRedirectUri??`${t}/login`,scope:e.scopes?.join(" ")??"openid email profile offline_access",response_type:"code",automaticSilentRenew:!0,userStore:new T({store:sessionStorage}),extraQueryParams:{audience:e.audience}})}],470858)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,236863,t=>{"use strict";var e=t.i(857844);t.S([e,"Mermaid,l"],236863)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,781736,168362,488589,624041,808037,e=>{"use strict";var t=e.i(651023),s=e.i(66196),n=e.i(58509),i=e.i(933605),r=e.i(789633),o=e.i(926665),a=e.i(151665),l=e.i(206157),u=e.i(367805);let g=t.createContext(void 0);function c(e){let s=t.useContext(g);if(void 0===s&&!e)throw Error((0,u.f)(47));return s}var d=e.i(345808),f=e.i(598263),p=e.i(783921),m=e.i(566745),x=e.i(630628),h=e.i(294365),v=e.i(245060),b=e.i(133022),y=e.i(258563),j=e.i(77175),k=e.i(600628),C=e.i(769375),w=e.i(607335);let S={...k.j,disabled:(0,p.f)(e=>e.disabled),instantType:(0,p.f)(e=>e.instantType),openMethod:(0,p.f)(e=>e.openMethod),openChangeReason:(0,p.f)(e=>e.openChangeReason),modal:(0,p.f)(e=>e.modal),stickIfOpen:(0,p.f)(e=>e.stickIfOpen),titleElementId:(0,p.f)(e=>e.titleElementId),descriptionElementId:(0,p.f)(e=>e.descriptionElementId),openOnHover:(0,p.f)(e=>e.openOnHover),closeDelay:(0,p.f)(e=>e.closeDelay),hasViewport:(0,p.f)(e=>e.hasViewport)};class N extends f.f{constructor(e){let s={...{...(0,k.i)(),disabled:!1,modal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,nested:!1,openOnHover:!1,closeDelay:0,hasViewport:!1},...e};s.open&&e?.mounted===void 0&&(s.mounted=!0),super(s,{popupRef:t.createRef(),backdropRef:t.createRef(),internalBackdropRef:t.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:t.createRef(),beforeContentFocusGuardRef:t.createRef(),stickIfOpenTimeout:new m.U,triggerElements:new C.f},S)}setOpen=(e,t)=>{let s=t.reason===v.f.triggerHover,n=t.reason===b.f.triggerPress&&0===t.event.detail,i=!e&&(t.reason===y.f.escapeKey||null==t.reason);if(t.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.(e,t),t.isCanceled)return;let r={open:e,nativeEvent:t.event,reason:t.reason,nested:this.state.nested,triggerElement:t.trigger},o=this.state.floatingRootContext.context.events;o?.emit("openchange",r);let a=()=>{let s={open:e,openChangeReason:t.reason},n=t.trigger?.id??null;(n||e)&&(s.activeTriggerId=n,s.activeTriggerElement=t.trigger??null),this.update(s)};s?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(w.K,()=>{this.set("stickIfOpen",!1)}),d.flushSync(a)):a(),n||i?this.set("instantType",n?"click":"dismiss"):t.reason===j.f.focusOut?this.set("instantType","focus"):this.set("instantType",void 0)};static useStore(e,t){let s=(0,x.f)(()=>new N(t)).current,n=e??s;return(0,h.f)(s.disposeEffect),n}disposeEffect=()=>this.context.stickIfOpenTimeout.disposeEffect()}var O=e.i(5963),R=e.i(210214),E=e.i(258642),M=e.i(450091),T=e.i(974265);function P({props:e}){let{children:u,open:c,defaultOpen:d=!1,onOpenChange:f,onOpenChangeComplete:p,modal:m=!1,handle:x,triggerId:h,defaultTriggerId:b=null}=e,y=N.useStore(x?.store,{modal:m,open:d,openProp:c,activeTriggerId:b,triggerIdProp:h});(0,n.f)(()=>{void 0===c&&!1===y.state.open&&!0===d&&y.update({open:!0,activeTriggerId:b})}),y.useControlledProp("openProp",c),y.useControlledProp("triggerIdProp",h);let j=y.useState("open"),k=y.useState("positionerElement"),C=y.useState("payload"),w=y.useState("openChangeReason");y.useContextCallback("onOpenChange",f),y.useContextCallback("onOpenChangeComplete",p);let{openMethod:S,triggerProps:I}=(0,M.f)(j);(0,E.z)(y);let{forceUnmount:z}=(0,E.L)(j,y,()=>{y.update({stickIfOpen:!0,openChangeReason:null})});(0,s.f)(j&&!0===m&&w!==v.f.triggerHover&&"touch"!==S,k),t.useEffect(()=>{j||y.context.stickIfOpenTimeout.clear()},[y,j]);let F=t.useCallback(e=>{let t=(0,O.f)(e);return t.preventUnmountOnClose=()=>{y.set("preventUnmountingOnClose",!0)},t},[y]),D=t.useCallback(()=>{y.setOpen(!1,F(R.f.imperativeAction))},[y,F]);t.useImperativeHandle(e.actionsRef,()=>({unmount:z,close:D}),[z,D]);let L=(0,l.f)({popupStore:y,onOpenChange:y.setOpen}),A=(0,i.f)(L,{outsidePressEvent:{mouse:"trap-focus"===m?"sloppy":"intentional",touch:"sloppy"}}),V=(0,o.f)(L),{getReferenceProps:_,getFloatingProps:H,getTriggerProps:K}=(0,r.f)([A,V]),B=t.useMemo(()=>_(I),[_,I]),G=t.useMemo(()=>K(I),[K,I]),W=t.useMemo(()=>H(),[H]);y.useSyncedValues({modal:m,openMethod:S,activeTriggerProps:B,inactiveTriggerProps:G,popupProps:W,floatingRootContext:L,nested:null!=(0,a.G)()});let X=t.useMemo(()=>({store:y}),[y]);return(0,T.jsx)(g.Provider,{value:X,children:"function"==typeof u?u({payload:C}):u})}var I=e.i(676477),z=e.i(991730),F=e.i(383590),D=e.i(327601),L=e.i(437287),A=e.i(804012),V=e.i(397254),_=e.i(189879),H=e.i(672408),K=e.i(247857),B=e.i(559266);let G=t.forwardRef(function(e,s){let{render:n,className:i,disabled:o=!1,nativeButton:a=!0,handle:l,payload:g,openOnHover:f=!1,delay:p=300,closeDelay:m=0,id:x,...h}=e,v=c(!0),y=l?.store??v?.store;if(!y)throw Error((0,u.f)(74));let k=(0,_.f)(x),C=y.useState("isTriggerActive",k),S=y.useState("floatingRootContext"),N=y.useState("isOpenedByTrigger",k),R=t.useRef(null),{registerTrigger:M,isMountedByThisTrigger:P}=(0,E.F)(k,R,y,{payload:g,disabled:o,openOnHover:f,closeDelay:m}),G=y.useState("openChangeReason"),W=y.useState("stickIfOpen"),X=y.useState("openMethod"),U=(0,V.f)(S,{enabled:null!=S&&f&&("touch"!==X||G!==b.f.triggerPress),mouseOnly:!0,move:!1,handleClose:(0,L.f)(),restMs:p,delay:{close:m},triggerElementRef:R,isActiveTrigger:C}),$=(0,A.f)(S,{enabled:null!=S,stickIfOpen:W}),J=(0,r.f)([$]),Y=y.useState("triggerProps",P),{getButtonProps:q,buttonRef:Q}=(0,z.f)({disabled:o,native:a}),Z=t.useMemo(()=>({open:e=>e&&G===b.f.triggerPress?F.f.open(e):F.J.open(e)}),[G]),ee=(0,D.f)("button",e,{state:{disabled:o,open:N},ref:[Q,s,M,R],props:[J.getReferenceProps(),U,Y,{[w.j]:"",id:k},h,q],stateAttributesMapping:Z}),et=t.useRef(null),es=(0,I.f)(e=>{d.flushSync(()=>{y.setOpen(!1,(0,O.f)(j.f.focusOut,e.nativeEvent,e.currentTarget))});let t=(0,B.E)(et.current);t?.focus()}),en=(0,I.f)(e=>{let t=y.select("positionerElement");if(t&&(0,B.A)(e,t))y.context.beforeContentFocusGuardRef.current?.focus();else{d.flushSync(()=>{y.setOpen(!1,(0,O.f)(j.f.focusOut,e.nativeEvent,e.currentTarget))});let s=(0,B.W)(y.context.triggerFocusTargetRef.current||R.current);for(;null!==s&&(0,K.I)(t,s);){let e=s;if((s=(0,B.O)(s))===e)break}s?.focus()}});return C?(0,T.jsxs)(t.Fragment,{children:[(0,T.jsx)(H.f,{ref:et,onFocus:es}),(0,T.jsx)(t.Fragment,{children:ee},k),(0,T.jsx)(H.f,{ref:y.context.triggerFocusTargetRef,onFocus:en})]}):(0,T.jsx)(t.Fragment,{children:ee},k)});var W=e.i(937692);let X=t.createContext(void 0),U=t.forwardRef(function(e,t){let{keepMounted:s=!1,...n}=e,{store:i}=c();return i.useState("mounted")||s?(0,T.jsx)(X.Provider,{value:s,children:(0,T.jsx)(W.r,{ref:t,...n})}):null});var $=e.i(658130),J=e.i(500977);let Y=t.createContext(void 0);var q=e.i(56590),Q=e.i(536893),Z=e.i(177817),ee=e.i(767569),et=e.i(418847);let es=t.forwardRef(function(e,s){let{render:n,className:i,anchor:r,positionMethod:o="absolute",side:l="bottom",align:g="center",sideOffset:d=0,alignOffset:f=0,collisionBoundary:p="clipping-ancestors",collisionPadding:m=5,arrowPadding:x=5,sticky:h=!1,disableAnchorTracking:b=!1,collisionAvoidance:y=w.n,...j}=e,{store:k}=c(),C=function(){let e=t.useContext(X);if(void 0===e)throw Error((0,u.f)(45));return e}(),S=(0,a.T)(),N=k.useState("floatingRootContext"),O=k.useState("mounted"),R=k.useState("open"),E=k.useState("openChangeReason"),M=k.useState("activeTriggerElement"),P=k.useState("modal"),I=k.useState("positionerElement"),z=k.useState("instantType"),L=k.useState("transitionStatus"),A=k.useState("hasViewport"),V=t.useRef(null),_=(0,Z.f)(I,!1,!1),H=(0,q.f)({anchor:r,floatingRootContext:N,positionMethod:o,mounted:O,side:l,sideOffset:d,align:g,alignOffset:f,arrowPadding:x,collisionBoundary:p,collisionPadding:m,sticky:h,disableAnchorTracking:b,keepMounted:C,nodeId:S,collisionAvoidance:y,adaptiveOrigin:A?ee.e:void 0}),K=t.useMemo(()=>{let e={};return R||(e.pointerEvents="none"),{role:"presentation",hidden:!O,style:{...H.positionerStyles,...e}}},[R,O,H.positionerStyles]),B=t.useMemo(()=>({props:K,...H}),[K,H]),G=N.useState("domReferenceElement");(0,J.f)(()=>{let e=V.current;if(G&&(V.current=G),e&&G&&G!==e){k.set("instantType",void 0);let e=new AbortController;return _(()=>{k.set("instantType","trigger-change")},e.signal),()=>{e.abort()}}},[G,_,k]);let W={open:R,side:B.side,align:B.align,anchorHidden:B.anchorHidden,instant:z},U=t.useCallback(e=>{k.set("positionerElement",e)},[k]),es=(0,D.f)("div",e,{state:W,props:[B.props,(0,et.f)(L),j],ref:[s,U],stateAttributesMapping:F.E});return(0,T.jsxs)(Y.Provider,{value:B,children:[O&&!0===P&&E!==v.f.triggerHover&&(0,T.jsx)(Q.f,{ref:k.context.internalBackdropRef,inert:(0,$.f)(!R),cutout:M}),(0,T.jsx)(a.s,{id:S,children:es})]})});var en=e.i(229315),ei=e.i(488306),er=e.i(761896),eo=e.i(284759),ea=e.i(889269),el=e.i(992238),eu=e.i(560752);let eg=t.createContext(void 0);function ec(e){let{value:t,children:s}=e;return(0,T.jsx)(eg.Provider,{value:t,children:s})}let ed={...F.E,...eo.T},ef=t.forwardRef(function(e,s){let{className:n,render:i,initialFocus:r,finalFocus:o,...a}=e,{store:l}=c(),g=function(){let e=t.useContext(Y);if(!e)throw Error((0,u.f)(46));return e}(),d=null!=(0,eu.f)(!0),{context:f,hasClosePart:p}=function(){let[e,s]=t.useState(0),n=(0,I.f)(()=>(s(e=>e+1),()=>{s(e=>Math.max(0,e-1))}));return{context:t.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}(),m=l.useState("open"),x=l.useState("openMethod"),h=l.useState("instantType"),b=l.useState("transitionStatus"),y=l.useState("popupProps"),j=l.useState("titleElementId"),k=l.useState("descriptionElementId"),C=l.useState("modal"),w=l.useState("mounted"),S=l.useState("openChangeReason"),N=l.useState("activeTriggerElement"),O=l.useState("floatingRootContext");(0,ea.f)({open:m,ref:l.context.popupRef,onComplete(){m&&l.context.onOpenChangeComplete?.(!0)}});let R=l.useState("disabled"),E=l.useState("openOnHover"),M=l.useState("closeDelay");(0,er.f)(O,{enabled:E&&!R,closeDelay:M});let P=void 0===r?function(e){return"touch"!==e||l.context.popupRef.current}:r,z={open:m,side:g.side,align:g.align,instant:h,transitionStatus:b},F=t.useCallback(e=>{l.set("popupElement",e)},[l]),L=(0,D.f)("div",e,{state:z,ref:[s,l.context.popupRef,F],props:[y,{"aria-labelledby":j,"aria-describedby":k,onKeyDown(e){d&&el.f.has(e.key)&&e.stopPropagation()}},(0,et.f)(b),a],stateAttributesMapping:ed});return(0,T.jsx)(ei.f,{context:O,openInteractionType:x,modal:!1!==C&&p,disabled:!w||S===v.f.triggerHover,initialFocus:P,returnFocus:o,restoreFocus:"popup",previousFocusableElement:(0,en.E)(N)?N:void 0,nextFocusableElement:l.context.triggerFocusTargetRef,beforeContentFocusGuardRef:l.context.beforeContentFocusGuardRef,children:(0,T.jsx)(ec,{value:f,children:L})})});e.s(["Popup",0,ef,"Portal",0,U,"Positioner",0,es,"Root",0,function(e){return c(!0)?(0,T.jsx)(P,{props:e}):(0,T.jsx)(a.V,{children:(0,T.jsx)(P,{props:e})})},"Trigger",0,G],307311);var ep=e.i(307311);e.s(["f",0,ep],781736),e.s(["f",0,ep],168362),e.s(["f",0,ep],488589),e.s(["f",0,ep],624041),e.s(["f",0,ep],808037)},213149,e=>{"use strict";var t=e.i(974265),s=e.i(651023),n=e.i(893976),i=e.i(468806),r=e.i(170255),o=e.i(818094),a=e.i(971854),l=e.i(610595),u=e.i(884561),g=e.i(869803),c=e.i(83940),d=e.i(623021),f=e.i(430182),p=e.i(891287),m=e.i(921701),x=e.i(691444),h=e.i(389046),v=e.i(530091),b=e.i(971977),y=e.i(379410);let j={[r.X.session]:"Participants send messages. The agent answers in this conversation's workspace, using only the vaults the conversation names; stopping and approving stay with its owner.",[r.X.routine]:"Participants start this routine, with a note, and see its runs. Every run acts as the person who created it; the note reaches the agent as information, not instructions."};function k({resourceKind:e,resourceKindString:i,resourceId:r,org:a,includeTeams:g=!1,excludeGrantees:c,onGranted:d,onCancel:C,className:w}){let{create:S,isCreating:N,error:O,clearError:R}=(0,h.f)(),[E,M]=(0,s.useState)(null),[T,P]=(0,s.useState)(null),I=(0,s.useCallback)(t=>{M(t),P(s=>null===s||null===t||("team"===t.kind?(0,o.k)(e,s):(0,o.T)(e,s))?s:null)},[e]),z=null!==E&&null!==T&&!N,F=(0,s.useCallback)(async e=>{if(e.preventDefault(),z&&null!==T&&null!==E){R();try{let e=(0,p.f)(m.D,{principal:(0,u.a)(E.grantee),resource:(0,p.f)(m.h,{kind:i,id:r}),relation:(0,x.C)(T)}),t=await S(e);d?.(t)}catch{}}},[z,T,E,i,r,S,R,d]),D=T===f.M.participant?j[e]??null:null;return(0,t.jsxs)("form",{onSubmit:F,className:(0,n.f)("stg:space-y-3",w),children:[(0,t.jsxs)("div",{className:"stg:space-y-3",children:[(0,t.jsx)(b.f,{org:a,value:E,onChange:I,includeTeams:g,excludeGrantees:c,disabled:N}),(0,t.jsx)(v.f,{kind:e,granteeKind:E?.kind??"identity_account",selected:T,onSelect:P,disabled:N}),D&&(0,t.jsx)("p",{className:"stg:text-2xs stg:text-muted-foreground",children:D})]}),O&&(0,t.jsx)("p",{className:"stg:text-destructive stg:text-2xs",role:"alert",children:(0,l.g)(O)}),(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-2",children:[(0,t.jsxs)("button",{type:"submit",disabled:!z,className:(0,n.f)("stg:inline-flex stg:items-center stg:gap-1.5 stg:rounded-md stg:px-3 stg:py-1.5 stg:text-xs stg:font-medium","stg:bg-primary stg:text-primary-foreground stg:hover:bg-primary-hover","stg:disabled:pointer-events-none stg:disabled:opacity-40"),children:[N&&(0,t.jsx)(y.f,{size:12}),"Grant access"]}),C&&(0,t.jsx)("button",{type:"button",onClick:C,disabled:N,className:(0,n.f)("stg:rounded-md stg:px-3 stg:py-1.5 stg:text-xs","stg:text-muted-foreground stg:hover:text-foreground stg:hover:bg-accent-hover","stg:disabled:pointer-events-none stg:disabled:opacity-50"),children:"Cancel"})]})]})}var C=e.i(237915);function w({resource:e,resourceKindString:i,resourceKind:r,org:o,className:f}){let{accessList:p,isLoading:m,fetchError:x,revoke:h,isRevoking:v,revokeError:b,refetch:y,hasGrantableRoles:j,canShareWithTeams:S}=(0,c.f)(e),N=(0,a.T)(),[O,R]=(0,s.useState)(!1),E=(0,s.useMemo)(()=>p.flatMap(e=>{let t=e.principal?(0,u.l)(e.principal):void 0;return t?[t]:[]}),[p]);if("local"===N&&"organization"!==e.kind)return(0,t.jsxs)("p",{className:(0,n.f)("stg:text-xs stg:text-muted-foreground",f),children:["This edition does not share ",i.replaceAll("_"," "),"s with individual people. Sharing with specific people is available in Stigmer Enterprise and Cloud."]});let M={kind:i,id:e.id};return(0,t.jsxs)("div",{className:(0,n.f)("stg:flex stg:flex-col stg:gap-4",f),children:[(0,t.jsxs)("div",{className:"stg:space-y-1",children:[(0,t.jsx)("p",{className:"stg:text-xs stg:text-muted-foreground",children:m?"Loading access list...":`${p.length} with access`}),x&&(0,t.jsx)("p",{className:"stg:text-destructive stg:text-2xs",role:"alert",children:(0,l.g)(x)}),!m&&p.length>0&&(0,t.jsx)("ul",{className:(0,n.f)(g.J,"stg:space-y-1 stg:mt-2"),"aria-label":"Who has access",children:p.map(e=>(0,t.jsx)(d.r,{entry:e,grantGate:M,onRemove:h,isRemoving:v},(0,d.V)(e)))}),b&&(0,t.jsx)("p",{className:"stg:text-destructive stg:text-2xs",role:"alert",children:(0,l.g)(b)})]}),j&&(0,t.jsx)(C.f,{resource:M,relation:"can_grant_access",children:(0,t.jsx)("div",{className:"stg:border-t stg:border-border stg:pt-3",children:O?(0,t.jsx)(k,{resourceKind:r,resourceKindString:i,resourceId:e.id,org:o,includeTeams:S,excludeGrantees:E,onGranted:()=>{R(!1),y()},onCancel:()=>R(!1)}):(0,t.jsx)("button",{type:"button",onClick:()=>R(!0),className:(0,n.f)("stg:w-full stg:rounded-md stg:px-3 stg:py-1.5 stg:text-xs stg:font-medium stg:text-center","stg:border stg:border-dashed stg:border-border","stg:text-muted-foreground stg:hover:text-foreground stg:hover:border-border-prominent","stg:hover:bg-accent-hover stg:transition-colors"),children:S?"+ Add people or teams":"+ Add people"})})})]})}var S=e.i(313488),N=e.i(816418),O=e.i(758960),R=e.i(853793),E=e.i(647767),M=e.i(459153),T=e.i(255817),P=e.i(781836);let I={agent:"agent",plugin:"plugin",skill:"skill",vault:"vault",environment:"environment",file:"file"},z={agent:r.X.agent,plugin:r.X.plugin,skill:r.X.skill,vault:r.X.vault,environment:r.X.environment,file:r.X.file};function F({kind:e,resourceId:n,visibility:i,org:o,onChanged:a,className:l}){var u;let g,c,{updateVisibility:d,isPending:f}=function(e,t){let n=(0,T.f)(),[i,r]=(0,s.useState)(!1),[o,a]=(0,s.useState)(null);return{updateVisibility:(0,s.useCallback)(async s=>{if(t){r(!0),a(null);try{let i=(0,p.f)(M.r,{resourceId:t,visibility:s});switch(e){case"skill":await n.skill.updateVisibility(i);break;case"agent":await n.agent.updateVisibility(i);break;case"plugin":await n.plugin.updateVisibility(i);break;case"vault":await n.vault.updateVisibility(i);break;case"environment":await n.environment.updateVisibility(i);break;case"file":await n.file.updateVisibility(i)}}catch(e){throw a((0,P.f)(e)),e}finally{r(!1)}}},[e,t,n]),isPending:i,error:o}}(e,n),m=(0,N.$)(),x=(u=z[e],c=(g=r.r.values.find(e=>e.number===u))?(0,E.R)(g,r.e).authorization?.visibility:void 0,{supportsOrg:c?.supportsOrg??!1,supportsChildOrgs:c?.supportsChildOrgs??!1}),h=x.supportsChildOrgs&&!1===m?o??null:null,{organization:v}=(0,S.f)(h),b=x.supportsChildOrgs?(0,R.I)({offersChildOrgs:null!==v&&(v.spec?.parentOrg??"")===""}):x.supportsOrg?"vault"===e?(0,R.D)():(0,R.P)():[],y=(0,s.useCallback)(async e=>{try{await d(e),a?.()}catch{}},[d,a]),j=(0,t.jsx)(O.n,{visibility:i,className:l});if(b.length<2)return j;let k=(0,t.jsx)(O.O,{visibility:i,options:b,onVisibilityChange:y,isPending:f,ariaLabel:"Resource visibility",className:l});return(0,t.jsx)(C.f,{resource:{kind:I[e],id:n},relation:"can_manage_audience",fallback:j,loading:j,children:k})}function D({title:e,description:s,children:n}){return(0,t.jsxs)("section",{className:"stg:px-6 stg:py-4",children:[(0,t.jsx)("h3",{className:"stg:text-xs stg:font-medium stg:text-muted-foreground",children:e}),s&&(0,t.jsx)("p",{className:"stg:mt-0.5 stg:text-2xs stg:text-muted-foreground",children:s}),(0,t.jsx)("div",{className:"stg:mt-2.5",children:n})]})}function L(){return(0,t.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M4 4l8 8M12 4l-8 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}e.s(["f",0,function({open:e,onOpenChange:l,resource:u,visibility:g}){let c=(0,s.useId)(),d=(0,s.useCallback)(()=>{l(!1)},[l]),f=(0,o.L)(u.kind),p=(0,a._)(r.X.team)&&(0,o.l)(u.kind)?"People and teams with access":"People with access";return(0,t.jsx)(i.f,{open:e,onOpenChange:l,width:"md","aria-labelledby":c,children:e&&(0,t.jsxs)("div",{className:"stg:flex stg:flex-col",children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-start stg:justify-between stg:border-b stg:border-border stg:px-6 stg:py-4",children:[(0,t.jsxs)("div",{className:"stg:min-w-0",children:[(0,t.jsx)("h2",{id:c,className:"stg:text-base stg:font-semibold stg:text-foreground",children:"Manage access"}),u.name&&(0,t.jsx)("p",{className:"stg:mt-0.5 stg:truncate stg:text-xs stg:text-muted-foreground",children:u.name})]}),(0,t.jsx)("button",{type:"button",onClick:d,"aria-label":"Close",className:(0,n.f)("stg:rounded-md stg:p-1 stg:text-muted-foreground","stg:hover:text-foreground stg:hover:bg-accent-hover","stg:focus:outline-none stg:focus:ring-2 stg:focus:ring-ring"),children:(0,t.jsx)(L,{})})]}),(0,t.jsxs)("div",{className:"stg:flex stg:flex-col stg:divide-y stg:divide-border",children:[g&&(0,t.jsx)(D,{title:"General access",description:"Who can find and open this resource.",children:(0,t.jsx)(F,{kind:g.kind,resourceId:u.id,visibility:g.current,org:g.org,onChanged:g.onChanged})}),f&&(0,t.jsx)(D,{title:p,children:(0,t.jsx)(w,{resource:{kind:u.kindString,id:u.id,resourceKind:u.kind},resourceKindString:u.kindString,resourceKind:u.kind,org:u.org})})]}),(0,t.jsx)("div",{className:"stg:flex stg:items-center stg:justify-end stg:border-t stg:border-border stg:px-6 stg:py-3",children:(0,t.jsx)("button",{type:"button",onClick:d,className:(0,n.f)("stg:rounded-md stg:px-3 stg:py-1.5 stg:text-sm stg:font-medium","stg:bg-primary stg:text-primary-foreground stg:hover:bg-primary-hover","stg:focus:outline-none stg:focus:ring-2 stg:focus:ring-ring stg:focus:ring-offset-2"),children:"Done"})})]})})}],213149)},530091,e=>{"use strict";var t=e.i(974265),s=e.i(651023),n=e.i(893976),i=e.i(869803),r=e.i(818094),o=e.i(691444);let a=[];e.s(["f",0,function({kind:e,onSelect:l,selected:u,defaultRole:g,disabled:c=!1,granteeKind:d="identity_account",omitRoles:f,className:p}){let m=(0,s.useId)(),{options:x,selected:h,select:v}=function(e,t,n="identity_account",i=a){let[l,u]=(0,s.useState)(t??null),g=(0,s.useMemo)(()=>{if(null===e)return[];let t=new Set(i);return("team"===n?(0,r.M)(e):(0,r.H)(e)).filter(e=>!t.has(e)).map(t=>({role:t,label:(0,o.p)(t),description:(0,o.A)(e,t),value:(0,o.C)(t)}))},[e,n,i]),c=(0,s.useMemo)(()=>null!==l?(0,o.C)(l):"",[l]),d=(0,s.useCallback)(e=>u(e),[]),f=(0,s.useCallback)(()=>u(null),[]);return(0,s.useMemo)(()=>({options:g,selected:l,selectedValue:c,select:d,clear:f,hasOptions:g.length>0}),[g,l,c,d,f])}(e,g,d,f),b=void 0!==u?u:h;return 0===x.length?null:(0,t.jsxs)("fieldset",{className:(0,n.f)(i.n,"stg:space-y-1.5",p),children:[(0,t.jsx)("legend",{className:"stg:text-xs stg:font-medium stg:text-foreground",children:"Role"}),(0,t.jsx)("div",{className:"stg:flex stg:flex-wrap stg:gap-2",children:x.map(e=>{let s=b===e.role;return(0,t.jsxs)("label",{className:(0,n.f)("stg:inline-flex stg:cursor-pointer stg:flex-col stg:rounded-md stg:border stg:px-3 stg:py-1.5 stg:text-xs stg:transition-colors",s?"stg:border-primary stg:bg-primary-subtle stg:text-primary stg:font-medium":"stg:border-input stg:bg-background stg:text-muted-foreground stg:hover:border-border stg:hover:text-foreground",c&&"stg:pointer-events-none stg:opacity-50"),children:[(0,t.jsx)("input",{type:"radio",name:m,value:e.value,checked:s,disabled:c,onChange:()=>{var t;v(t=e.role),l?.(t)},className:"stg:sr-only"}),(0,t.jsx)("span",{children:e.label}),(0,t.jsx)("span",{className:"stg:text-2xs stg:text-muted-foreground stg:font-normal stg:mt-0.5",children:e.description})]},e.value)})})]})}],530091)},758960,853793,e=>{"use strict";var t=e.i(974265),s=e.i(651023),n=e.i(781736),i=e.i(168362),r=e.i(488589),o=e.i(624041),a=e.i(808037),l=e.i(893976),u=e.i(364354),g=e.i(188482),c=e.i(10337),d=e.i(966205);let f="stg:inline-flex stg:shrink-0 stg:items-center stg:gap-1 stg:rounded-full stg:bg-muted stg:px-2 stg:py-0.5 stg:text-2xs stg:font-medium stg:text-muted-foreground",p=(0,s.forwardRef)(function({option:e,isSelected:s,role:n,isHighlighted:i,disabled:r,tabIndex:o,onSelect:a,onMouseEnter:u,onKeyDown:g},c){let d=void 0!==e.lockedReason,f="radio"===n?{"aria-checked":s}:{"aria-selected":s};return(0,t.jsxs)("button",{ref:c,type:"button",role:n,...f,"aria-disabled":d||void 0,tabIndex:o,disabled:r||d,onClick:a,onMouseEnter:u,onKeyDown:g,className:(0,l.f)("stg:flex stg:w-full stg:items-start stg:gap-2 stg:rounded-md stg:px-2.5 stg:py-2 stg:text-left stg:transition-colors","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring",d?"stg:disabled:pointer-events-none stg:cursor-default":"stg:disabled:pointer-events-none stg:disabled:opacity-50",!d&&(i?"stg:bg-accent stg:text-foreground":"stg:hover:bg-accent-hover")),children:[(0,t.jsx)(m,{tone:e.tone,className:"stg:mt-0.5 stg:size-3.5 stg:shrink-0 stg:text-muted-foreground"}),(0,t.jsxs)("span",{className:"stg:min-w-0 stg:flex-1",children:[(0,t.jsx)("span",{className:(0,l.f)("stg:block stg:text-xs stg:font-medium",d?"stg:text-muted-foreground":"stg:text-foreground"),children:e.label}),(0,t.jsx)("span",{className:"stg:block stg:text-2xs stg:leading-snug stg:text-muted-foreground",children:d?e.lockedReason:e.description})]}),d?(0,t.jsx)(x,{className:"stg:mt-0.5 stg:size-3.5 stg:shrink-0 stg:text-muted-foreground"}):s&&(0,t.jsx)(b,{className:"stg:mt-0.5 stg:size-3.5 stg:shrink-0 stg:text-primary"})]})});function m({tone:e,className:s}){switch(e){case"org":return(0,t.jsx)(h,{className:s});case"childOrgs":return(0,t.jsx)(v,{className:s});default:return(0,t.jsx)(x,{className:s})}}function x({className:e}){return(0,t.jsxs)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("rect",{x:"3.5",y:"7",width:"9",height:"7",rx:"1.5"}),(0,t.jsx)("path",{d:"M5.5 7V5a2.5 2.5 0 0 1 5 0v2"})]})}function h({className:e}){return(0,t.jsxs)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("circle",{cx:"6",cy:"5",r:"2.5"}),(0,t.jsx)("path",{d:"M2 13c0-2.21 1.79-4 4-4s4 1.79 4 4"}),(0,t.jsx)("circle",{cx:"11.5",cy:"5.5",r:"2"}),(0,t.jsx)("path",{d:"M14 13c0-1.66-1.12-3-2.5-3-.5 0-1 .14-1.4.4"})]})}function v({className:e}){return(0,t.jsxs)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M2 14V4.5L6.5 2v12"}),(0,t.jsx)("path",{d:"M6.5 6.5 14 8.5V14"}),(0,t.jsx)("path",{d:"M2 14h12"}),(0,t.jsx)("path",{d:"M4.25 6h.01M4.25 8.5h.01M4.25 11h.01M10.5 10.5h.01M10.5 12.5h.01"})]})}function b({className:e}){return(0,t.jsx)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M3 8.5 6.5 12 13 4.5"})})}var y=e.i(302933);let j={value:y.b.visibility_private,label:"Private",description:"Only you can access",tone:"private"},k={value:y.b.visibility_org,label:"Organization",description:"All members of your organization",confirmPrompt:"Make visible to all org members?",tone:"org"},C={value:y.b.visibility_child_orgs,label:"Child organizations",description:"Every organization under this one",confirmDialog:{title:"Share with every child organization?",description:"Everyone in every child organization of this organization, including child organizations created later, will be able to view and use this resource. You can return it to a narrower visibility at any time."},tone:"childOrgs"};function w(e){switch(e){case y.b.visibility_org:return k;case y.b.visibility_child_orgs:return C;default:return j}}function S(){return(0,t.jsx)("svg",{className:"stg:size-2.5 stg:shrink-0 stg:text-muted-foreground",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M3 4.5 6 7.5 9 4.5"})})}e.s(["I",0,function(e){return e.offersChildOrgs?[j,k,C]:[j,k]},"P",0,function(){return[j,k]},"D",0,function(){return[{...j,description:"Only organization admins, and the people and teams granted access where this edition offers grants, can use this vault"},{...k,description:"Everyone in the organization can use this vault in their runs. Members see names only; saved values stay hidden.",confirmPrompt:"Let everyone in the organization use this vault?"}]},"Q",0,w],853793),e.s(["n",0,function({visibility:e,className:s,onClick:n}){let i=w(e),r=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(m,{tone:i.tone,className:"stg:size-2.5"}),i.label]});return n?(0,t.jsxs)(g.W,{children:[(0,t.jsx)(g.y,{render:(0,t.jsx)("button",{type:"button",onClick:n,"aria-label":`${i.label} visibility — manage access`,className:(0,l.f)(f,"stg:transition-colors stg:hover:bg-accent-hover stg:hover:text-foreground","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring",s)}),children:r}),(0,t.jsx)(g.Y,{side:"top",children:"Manage access"})]}):(0,t.jsx)("span",{className:(0,l.f)(f,s),children:r})},"O",0,function({visibility:e,options:g,onVisibilityChange:x,mode:h="manage",isPending:v=!1,disabled:b=!1,ariaLabel:y="Resource visibility",className:j}){let k=(0,u.P)(),{confirmState:C,confirm:N,handleConfirm:O,handleCancel:R}=(0,d.f)(),[E,M]=(0,s.useState)(!1),[T,P]=(0,s.useState)(null),[I,z]=(0,s.useState)(-1),F=(0,s.useRef)([]),D=b||v,L=(0,s.useMemo)(()=>g.some(t=>t.value===e)?g:[...g,w(e)],[g,e]),A=(0,s.useCallback)(t=>{let s=L.map(e=>e.value);return s.indexOf(t)>s.indexOf(e)},[L,e]),V=(0,s.useCallback)(e=>{M(!1),P(null),x(e)},[x]),_=(0,s.useCallback)(t=>{if(void 0!==t.lockedReason)return;let s=t.value;if(s===e){P(null),M(!1);return}if("create"===h||!A(s))return void V(s);if(t.confirmDialog){M(!1),P(null),N({title:t.confirmDialog.title,description:t.confirmDialog.description,confirmLabel:`Make ${t.label}`,variant:"default"}).then(e=>{e&&x(s)});return}t.confirmPrompt?P(s):V(s)},[e,h,A,V,N,x]),H=(0,s.useCallback)((e,t)=>{let s=L.length,n=e;for(let e=0;e<s&&(n=(n+t+s)%s,L[n]?.lockedReason!==void 0);e++);z(n),F.current[n]?.focus()},[L]),K=(0,s.useCallback)((e,t)=>{switch(e.key){case"ArrowDown":case"ArrowRight":e.preventDefault(),H(t,1);break;case"ArrowUp":case"ArrowLeft":e.preventDefault(),H(t,-1);break;case"Home":e.preventDefault(),z(0),F.current[0]?.focus();break;case"End":{e.preventDefault();let t=L.length-1;z(t),F.current[t]?.focus()}}},[H,L.length]);(0,s.useEffect)(()=>{if(!E){P(null),z(-1);return}let t=L.findIndex(t=>t.value===e),s=t>=0?t:0;z(s);let n=requestAnimationFrame(()=>F.current[s]?.focus());return()=>cancelAnimationFrame(n)},[E,L,e]);let B=(0,t.jsx)(c.f,{state:C,onConfirm:O,onCancel:R}),G=s=>L.map((n,i)=>(0,t.jsx)(p,{ref:e=>{F.current[i]=e},option:n,role:s,isSelected:e===n.value,isHighlighted:"option"===s&&I===i,tabIndex:"radio"===s?e===n.value?0:-1:I===i?0:-1,disabled:D,onSelect:()=>_(n),onMouseEnter:"option"===s?()=>z(i):void 0,onKeyDown:e=>K(e,i)},n.value));if("create"===h)return(0,t.jsx)("div",{role:"radiogroup","aria-label":y,"aria-disabled":D||void 0,className:(0,l.f)("stg:flex stg:flex-col stg:gap-0.5 stg:rounded-md stg:border stg:border-border stg:p-1",D&&"stg:pointer-events-none stg:opacity-50",j),children:G("radio")});let W=w(e),X=null!==T?L.find(e=>e.value===T):void 0;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(n.f.Root,{open:E,onOpenChange:M,children:[(0,t.jsxs)(i.f.Trigger,{disabled:D,"aria-label":`${y}: ${W.label}`,className:(0,l.f)(f,"stg:transition-colors stg:hover:bg-accent-hover stg:hover:text-foreground","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring","stg:disabled:pointer-events-none stg:disabled:opacity-50",j),children:[v?(0,t.jsx)("span",{className:"stg:inline-block stg:size-2.5 stg:animate-spin stg:rounded-full stg:border-2 stg:border-current stg:border-t-transparent","aria-hidden":"true"}):(0,t.jsx)(m,{tone:W.tone,className:"stg:size-2.5"}),W.label,(0,t.jsx)(S,{})]}),(0,t.jsx)(r.f.Portal,{container:k,children:(0,t.jsx)(o.f.Positioner,{sideOffset:4,align:"start",children:(0,t.jsxs)(a.f.Popup,{role:"listbox","aria-label":y,className:(0,l.f)("stg:z-popover stg:w-72 stg:rounded-lg stg:border stg:border-border stg:bg-popover stg:p-1 stg:shadow-md","stg:text-popover-foreground stg:animate-in stg:fade-in-0 stg:zoom-in-95"),children:[G("option"),X?.confirmPrompt&&(0,t.jsxs)("div",{role:"alert",className:(0,l.f)("stg:mt-1 stg:flex stg:items-center stg:gap-2 stg:rounded-md stg:px-2.5 stg:py-1.5","stg:bg-status-degraded-subtle"),children:[(0,t.jsx)("span",{className:(0,l.f)("stg:flex-1 stg:text-2xs stg:leading-snug","stg:text-foreground"),children:X.confirmPrompt}),(0,t.jsx)("button",{type:"button",onClick:()=>P(null),className:(0,l.f)("stg:rounded stg:px-2 stg:py-0.5 stg:text-2xs stg:font-medium","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring","stg:text-foreground stg:hover:underline"),children:"Cancel"}),(0,t.jsx)("button",{type:"button",onClick:()=>V(X.value),className:(0,l.f)("stg:rounded stg:px-2 stg:py-0.5 stg:text-2xs stg:font-medium","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring","stg:bg-primary stg:text-primary-foreground stg:hover:bg-primary-hover"),children:"Confirm"})]})]})})})]}),B]})}],758960)},313488,e=>{"use strict";var t=e.i(255817),s=e.i(616701);e.s(["f",0,function(e){let n=(0,t.f)(),{data:i,isLoading:r,isRefetching:o,error:a,refetch:l}=(0,s.f)(e?()=>n.organization.get(e):null,[e,n],null);return{organization:i,isLoading:r,isRefetching:o,error:a,refetch:l}}])},10337,e=>{"use strict";var t=e.i(974265),s=e.i(651023),n=e.i(893976),i=e.i(468806);e.s(["f",0,function({state:e,onConfirm:r,onCancel:o}){let a=(0,s.useCallback)(e=>{e||o()},[o]);if(!e)return null;let l="destructive"===e.variant;return(0,t.jsx)(i.f,{open:!0,onOpenChange:a,width:"sm","aria-label":e.title,children:(0,t.jsxs)("div",{className:"stg:flex stg:flex-col stg:gap-4 stg:p-6",children:[(0,t.jsxs)("div",{className:"stg:flex stg:flex-col stg:gap-1.5",children:[(0,t.jsx)("h3",{className:"stg:text-base stg:font-semibold stg:text-foreground",children:e.title}),(0,t.jsx)("p",{className:"stg:text-sm stg:text-muted-foreground",children:e.description})]}),(0,t.jsxs)("div",{className:"stg:flex stg:justify-end stg:gap-2",children:[(0,t.jsx)("button",{type:"button",onClick:o,className:(0,n.f)("stg:rounded-md stg:px-3 stg:py-1.5 stg:text-sm stg:font-medium stg:transition-colors","stg:border stg:border-input stg:bg-background stg:text-foreground","stg:hover:bg-accent stg:hover:text-accent-foreground","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring"),children:e.cancelLabel??"Cancel"}),(0,t.jsx)("button",{type:"button",onClick:r,className:(0,n.f)("stg:rounded-md stg:px-3 stg:py-1.5 stg:text-sm stg:font-medium stg:transition-colors","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring",l?"stg:bg-destructive stg:text-destructive-foreground stg:hover:bg-destructive-hover":"stg:bg-primary stg:text-primary-foreground stg:hover:bg-primary-hover"),children:e.confirmLabel??"Confirm"})]})]})})}])},966205,e=>{"use strict";var t=e.i(651023);e.s(["f",0,function(){let[e,s]=(0,t.useState)(null),n=(0,t.useCallback)(e=>new Promise(t=>{s({...e,resolve:t})}),[]),i=(0,t.useCallback)(()=>{e?.resolve(!0),s(null)},[e]),r=(0,t.useCallback)(()=>{e?.resolve(!1),s(null)},[e]);return(0,t.useMemo)(()=>({confirmState:e,confirm:n,handleConfirm:i,handleCancel:r}),[e,n,i,r])}])},816418,e=>{"use strict";var t=e.i(255817),s=e.i(616701);function n(){let e=(0,t.f)(),{data:n,isLoading:i,error:r}=(0,s.f)(()=>e.platform.getServerInfo(),[e],null,{cacheKey:"server-info"});return{serverInfo:n,isLoading:i,error:r}}e.s(["a",0,function(){let{serverInfo:e}=n();return e?.environments},"P",0,n,"$",0,function(){let{serverInfo:e,isLoading:t}=n();if(!t)return e?.singleOrg===!0}])}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,311015,e=>{"use strict";var t=e.i(974265),s=e.i(893976),r=e.i(65642),i=e.i(651023),n=e.i(475254);let a=(0,n.f)("package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 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.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]),l=(0,n.f)("search-x",[["path",{d:"m13.5 8.5-5 5",key:"1cs55j"}],["path",{d:"m8.5 8.5 5 5",key:"a8mexj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]),o=(0,n.f)("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"}]]);var d=e.i(63209);let g="stg:h-10 stg:w-10";e.s(["f",0,function({variant:e,resourceLabel:n,icon:c,title:u,description:m,errorMessage:x,action:h,children:f,className:p}){let j=function(e){let{variant:t,resourceLabel:s="resources",title:r,description:n,errorMessage:c}=e;return(0,i.useMemo)(()=>{let e=function(e,t){switch(e){case"first-use":return{title:`No ${t} yet`,description:`Create ${"agents"===t?"an agent":`a ${t.replace(/s$/,"")}`} to get started.`};case"zero-results":return{title:"No results found",description:"Try adjusting your search or filters."};case"permission":return{title:`No access to ${t}`,description:"You don't have permission to view these resources. Contact your organization admin."};case"error":return{title:"Something went wrong",description:"We couldn't load this content. Please try again."}}}(t,s);return{title:r??e.title,description:"error"===t&&c?c:n??e.description,defaultIcon:function(e){switch(e){case"first-use":return(0,i.createElement)(a,{className:g});case"zero-results":return(0,i.createElement)(l,{className:g});case"permission":return(0,i.createElement)(o,{className:g});case"error":return(0,i.createElement)(d.f,{className:g})}}(t),role:"error"===t?"alert":"status"}},[t,s,r,n,c])}({variant:e,resourceLabel:n,title:u,description:m,errorMessage:x});return(0,t.jsxs)("div",{role:j.role,className:(0,s.f)("stg:flex stg:flex-col stg:items-center stg:gap-3 stg:py-12 stg:text-center",p),children:[(0,t.jsx)("div",{className:"stg:text-muted-foreground-faint",children:c??j.defaultIcon}),(0,t.jsxs)("div",{className:"stg:flex stg:flex-col stg:gap-1",children:[(0,t.jsx)("p",{className:"stg:m-0 stg:text-sm stg:font-medium stg:text-muted-foreground",children:j.title}),(0,t.jsx)("p",{className:"stg:m-0 stg:max-w-sm stg:text-xs stg:text-muted-foreground",children:j.description})]}),f?(0,t.jsx)("div",{className:"stg:mt-1",children:f}):h&&(0,t.jsx)(r.f,{variant:"error"===e?"outline":"primary",icon:h.icon,onClick:h.onClick,className:"stg:mt-1",children:h.label})]})}],311015)},476007,e=>{"use strict";var t=e.i(974265),s=e.i(651023),r=e.i(610595),i=e.i(893976);let n={auth:"Authentication required",permission:"Access denied","not-found":"Not found",validation:"Invalid request",server:"Server error",unavailable:"Service unavailable",cancelled:"Request cancelled",unknown:"Something went wrong"};function a({className:e}){return(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:e,"aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M7.13 2.5a1 1 0 0 1 1.74 0l5.5 9.5A1 1 0 0 1 13.5 13.5h-11a1 1 0 0 1-.87-1.5l5.5-9.5z"}),(0,t.jsx)("path",{d:"M8 6v3"}),(0,t.jsx)("circle",{cx:"8",cy:"11",r:"0.5",fill:"currentColor",stroke:"none"})]})}function l({className:e}){return(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:e,"aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M8 1.5l5 2v4c0 3.5-2.5 5.5-5 6.5-2.5-1-5-3-5-6.5v-4l5-2z"}),(0,t.jsx)("path",{d:"M6 6.5l4 4M10 6.5l-4 4"})]})}function o({className:e}){return(0,t.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:e,"aria-hidden":"true",children:(0,t.jsx)("path",{d:"M4 6l4 4 4-4"})})}function d({className:e}){return(0,t.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:e,"aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M2 6.5h4v-4"}),(0,t.jsx)("path",{d:"M3.5 11.5a5.5 5.5 0 1 0 .5-6l-2 1"})]})}e.s(["f",0,function({error:e,title:g,retry:c,className:u}){let[m,x]=(0,s.useState)(!1);if(!e)return null;let h=(0,r.V)(e),f=(0,r.g)(e),p=(0,r.X)(e),j=(0,r.f)(e);return(0,t.jsx)("div",{role:"alert",className:(0,i.f)("stg:bg-destructive-subtle stg:border-destructive/20 stg:text-destructive stg:rounded-lg stg:border stg:p-4",u),children:(0,t.jsxs)("div",{className:"stg:flex stg:items-start stg:gap-3",children:["auth"===h||"permission"===h?(0,t.jsx)(l,{className:"stg:mt-0.5 stg:size-4 stg:shrink-0"}):(0,t.jsx)(a,{className:"stg:mt-0.5 stg:size-4 stg:shrink-0"}),(0,t.jsxs)("div",{className:"stg:min-w-0 stg:flex-1 stg:space-y-1",children:[(0,t.jsx)("p",{className:"stg:text-sm stg:font-medium",children:g??n[h]}),(0,t.jsx)("p",{className:"stg:m-0 stg:text-destructive stg:text-sm",children:f}),p&&(0,t.jsxs)("div",{className:"stg:pt-1",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>x(e=>!e),className:"stg:text-destructive stg:hover:underline stg:inline-flex stg:items-center stg:gap-1 stg:text-xs stg:transition-colors",children:[(0,t.jsx)(o,{className:(0,i.f)("stg:size-3 stg:transition-transform",m&&"stg:rotate-180")}),"Technical details"]}),m&&(0,t.jsxs)("dl",{className:"stg:text-destructive stg:mt-1.5 stg:space-y-0.5 stg:font-mono stg:text-xs",children:[(0,t.jsxs)("div",{className:"stg:flex stg:gap-2",children:[(0,t.jsx)("dt",{className:"stg:shrink-0",children:"Method:"}),(0,t.jsx)("dd",{className:"stg:truncate",children:p.method})]}),(0,t.jsxs)("div",{className:"stg:flex stg:gap-2",children:[(0,t.jsx)("dt",{className:"stg:shrink-0",children:"Path:"}),(0,t.jsx)("dd",{className:"stg:truncate",children:p.path})]})]})]})]}),c&&j&&(0,t.jsxs)("button",{type:"button",onClick:c,className:(0,i.f)("stg:inline-flex stg:shrink-0 stg:items-center stg:gap-1.5 stg:rounded-md stg:border stg:px-2.5 stg:py-1.5 stg:text-xs stg:font-medium","stg:border-destructive/20 stg:text-destructive stg:hover:bg-destructive-subtle","stg:transition-colors"),children:[(0,t.jsx)(d,{className:"stg:size-3"}),"Retry"]})]})})}])},630983,e=>{"use strict";var t=e.i(974265),s=e.i(893976);function r({className:e}){return(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:e,"aria-hidden":"true",children:[(0,t.jsx)("circle",{cx:"8",cy:"8",r:"6.25"}),(0,t.jsx)("path",{d:"M8 7v4"}),(0,t.jsx)("circle",{cx:"8",cy:"5",r:"0.5",fill:"currentColor",stroke:"none"})]})}e.s(["f",0,function({children:e,className:i}){return(0,t.jsxs)("div",{role:"status",className:(0,s.f)("stg:bg-muted-subtle stg:text-muted-foreground stg:flex stg:items-start stg:gap-2.5 stg:rounded-lg stg:border stg:border-transparent stg:px-4 stg:py-3",i),children:[(0,t.jsx)(r,{className:"stg:mt-0.5 stg:size-4 stg:shrink-0"}),(0,t.jsx)("p",{className:"stg:text-xs stg:leading-relaxed",children:e})]})}])},66724,e=>{"use strict";var t=e.i(974265),s=e.i(893976);e.s(["f",0,function({title:e,description:r,actions:i,headingLevel:n=1,headingId:a,className:l}){return(0,t.jsxs)("header",{className:(0,s.f)("stg:flex stg:flex-col stg:gap-1",l),children:[(0,t.jsxs)("div",{className:"stg:flex stg:min-h-8 stg:flex-wrap stg:items-center stg:justify-between stg:gap-x-6 stg:gap-y-2",children:[(0,t.jsx)(1===n?"h1":"h2",{id:a,className:"stg:m-0 stg:text-xl stg:font-semibold stg:tracking-tight stg:text-foreground",children:e}),null!=i&&!1!==i&&(0,t.jsx)("div",{className:"stg:flex stg:shrink-0 stg:items-center stg:gap-2",children:i})]}),null!=r&&(0,t.jsx)("p",{className:"stg:m-0 stg:max-w-2xl stg:text-sm stg:text-muted-foreground",children:r})]})}])},24207,e=>{"use strict";var t=e.i(974265),s=e.i(651023),r=e.i(893976),i=e.i(610595),n=e.i(17616),a=e.i(564138),l=e.i(361353),o=e.i(379410),d=e.i(832981),g=e.i(689960),c=e.i(255817),u=e.i(781836),m=e.i(891287),x=e.i(730578),h=e.i(766330),f=e.i(205413),p=e.i(616701),j=e.i(631829),b=e.i(734433),v=e.i(476007),y=e.i(311015);function N({org:e,className:i,now:n}){let{memories:a,isLoading:l,error:o,refetch:g}=function(e){let t=(0,c.f)(),{data:s,isLoading:r,isRefetching:i,error:n,refetch:a}=(0,p.f)(e?()=>(0,f.T)(s=>t.memory.list((0,m.f)(x.W,{org:e,pageSize:h.J,pageToken:s}))):null,[t,e],[]);return{memories:s,isLoading:r,isRefetching:i,error:n,refetch:a}}(e),[u,j]=(0,s.useState)({mode:"idle"}),w=(0,s.useCallback)(()=>j({mode:"idle"}),[]),C=(0,s.useCallback)(()=>{j({mode:"idle"}),g()},[g]);if(l)return(0,t.jsx)(b.SettingsSkeleton,{label:"Loading memories",rows:3,className:i});if(o)return(0,t.jsx)(v.f,{error:o,title:"Your memories could not be read",retry:g,className:i});if(0===a.length)return(0,t.jsx)(y.f,{variant:"first-use",title:"Nothing remembered yet",description:"When an agent proposes a fact worth keeping, it appears here for your decision.",className:(0,r.f)("stg:rounded-lg stg:border stg:border-dashed stg:border-border",i)});let S=(0,d.Q)(a);return(0,t.jsxs)("div",{className:(0,r.f)("stg:space-y-6",i),children:[S.proposed.length>0&&(0,t.jsx)(k,{heading:"Pending proposals",description:"Facts agents proposed to remember. Nothing is stored in your sessions until you confirm it.",memories:S.proposed,rowState:u,setRowState:j,onChanged:C,onCancel:w,now:n}),S.confirmed.length>0&&(0,t.jsx)(k,{heading:"Remembered",description:"Confirmed facts, shared with agents in your future sessions.",memories:S.confirmed,rowState:u,setRowState:j,onChanged:C,onCancel:w,now:n}),S.rejected.length>0&&(0,t.jsx)(k,{heading:"Rejected",description:"Proposals you declined, kept for reference. Delete them to clear the record.",memories:S.rejected,rowState:u,setRowState:j,onChanged:C,onCancel:w,now:n})]})}function k({heading:e,description:s,memories:r,rowState:i,setRowState:n,onChanged:a,onCancel:l,now:o}){return(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"stg:text-foreground stg:text-xs stg:font-semibold",children:e}),(0,t.jsx)("p",{className:"stg:text-muted-foreground stg:mb-2 stg:text-xs",children:s}),(0,t.jsx)("div",{className:"stg:space-y-2",role:"list","aria-label":e,children:r.map(e=>{let s=e.metadata?.id??"";return(0,t.jsx)(w,{memory:e,now:o,mode:"idle"!==i.mode&&i.id===s?i.mode:"idle",onStartDelete:()=>n({mode:"confirming-delete",id:s}),onStartEdit:()=>n({mode:"editing",id:s}),onCancel:l,onChanged:a},s)})})]})}function w({memory:e,now:m,mode:x,onStartDelete:h,onStartEdit:f,onCancel:p,onChanged:b}){var v,y,N,k;let M,L=e.metadata?.id??"",_=e.spec?.content??"",$=e.status?.lifecycleState,A=(0,d.A)(e),R=e.status?.stateChangedAt,{confirmMemory:W,isConfirming:B,error:E}=(0,g.f)(),{rejectMemory:q,isRejecting:P,error:T}=(0,j.f)(),{deleteMemory:V,isDeleting:F,error:I}=function(){let e=(0,c.f)(),[t,r]=(0,s.useState)(!1),[i,n]=(0,s.useState)(null),a=(0,s.useCallback)(()=>n(null),[]);return{deleteMemory:(0,s.useCallback)(async t=>{r(!0),n(null);try{return await e.memory.delete(t)}catch(e){throw n((0,u.f)(e)),e}finally{r(!1)}},[e]),isDeleting:t,error:i,clearError:a}}(),D=E??T??I,O=B||P||F,K=(0,s.useCallback)(async e=>{try{await e(L),b()}catch{}},[L,b]);return"editing"===x?(0,t.jsx)(C,{memory:e,onCancel:p,onSaved:b}):"confirming-delete"===x?(0,t.jsxs)("div",{role:"listitem",className:"stg:flex stg:items-center stg:justify-between stg:gap-3 stg:rounded-lg stg:border stg:border-destructive/30 stg:bg-destructive-subtle stg:px-3 stg:py-2.5",children:[(0,t.jsxs)("div",{className:"stg:min-w-0 stg:flex-1",children:[(0,t.jsxs)("p",{className:"stg:text-xs stg:text-foreground",children:["Forget this permanently? ",(0,t.jsx)("q",{className:"stg:italic",children:_})]}),I&&(0,t.jsx)("p",{className:"stg:mt-0.5 stg:text-2xs stg:text-destructive",children:(0,i.g)(I)})]}),(0,t.jsxs)("div",{className:"stg:flex stg:shrink-0 stg:items-center stg:gap-1.5",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>void K(V),disabled:F,className:(0,r.f)("stg:inline-flex stg:items-center stg:gap-1 stg:rounded-md stg:px-2.5 stg:py-1 stg:text-xs stg:font-medium","stg:bg-destructive stg:text-destructive-foreground stg:hover:bg-destructive-hover","stg:disabled:pointer-events-none stg:disabled:opacity-50"),children:[F&&(0,t.jsx)(o.f,{size:12}),"Delete"]}),(0,t.jsx)("button",{type:"button",onClick:p,disabled:F,className:(0,r.f)("stg:rounded-md stg:px-2.5 stg:py-1 stg:text-xs","stg:text-muted-foreground stg:hover:text-foreground stg:hover:bg-accent-hover","stg:disabled:pointer-events-none stg:disabled:opacity-50"),children:"Cancel"})]})]}):(0,t.jsx)("div",{role:"listitem",className:"stg:rounded-lg stg:border stg:border-border-muted stg:px-3 stg:py-2.5 stg:hover:border-border stg:transition-colors",children:(0,t.jsxs)("div",{className:"stg:flex stg:items-start stg:justify-between stg:gap-3",children:[(0,t.jsxs)("div",{className:"stg:min-w-0 stg:flex-1",children:[(0,t.jsx)("p",{className:"stg:text-sm stg:text-foreground stg:whitespace-pre-wrap",children:_}),(0,t.jsxs)("p",{className:"stg:mt-1 stg:text-xs stg:text-muted-foreground",children:[A?`${A} \xb7 `:"",(v=$,y=R?(0,n.S)(R):void 0,N=m,M=v===a._.lifecycle_state_confirmed?"Confirmed":v===a._.lifecycle_state_rejected?"Rejected":"Proposed",y?`${M} ${(0,l.f)(y,N)}`:M)]}),D&&(0,t.jsx)("p",{className:"stg:mt-0.5 stg:text-2xs stg:text-destructive",role:"alert",children:(0,i.g)(D)})]}),(0,t.jsxs)("div",{className:"stg:flex stg:shrink-0 stg:items-center stg:gap-1.5",children:[$===a._.lifecycle_state_confirmed&&(0,t.jsx)(S,{label:`Edit memory: ${_}`,onClick:f,disabled:O,children:"Edit"}),(void 0===(k=$)||k===a._.lifecycle_state_unspecified||k===a._.lifecycle_state_proposed)&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(S,{label:`Confirm memory: ${_}`,onClick:()=>void K(W),disabled:O,emphasis:"primary",children:[B&&(0,t.jsx)(o.f,{size:12}),"Confirm"]}),(0,t.jsxs)(S,{label:`Reject memory: ${_}`,onClick:()=>void K(q),disabled:O,children:[P&&(0,t.jsx)(o.f,{size:12}),"Reject"]})]}),(0,t.jsx)("button",{type:"button",onClick:h,disabled:O,"aria-label":`Delete memory: ${_}`,className:(0,r.f)("stg:shrink-0 stg:rounded stg:p-1","stg:text-muted-foreground stg:hover:text-destructive stg:hover:bg-destructive-subtle","stg:transition-colors stg:disabled:pointer-events-none stg:disabled:opacity-50"),children:(0,t.jsx)(z,{})})]})]})})}function C({memory:e,onCancel:n,onSaved:a}){let[l,d]=(0,s.useState)(e.spec?.content??""),{updateContent:g,isUpdating:m,error:x}=function(){let e=(0,c.f)(),[t,r]=(0,s.useState)(!1),[i,n]=(0,s.useState)(null),a=(0,s.useCallback)(()=>n(null),[]);return{updateContent:(0,s.useCallback)(async(t,s)=>{r(!0),n(null);try{return await e.memory.update({metadata:{id:t.metadata?.id??"",etag:t.metadata?.etag??""},spec:{content:s}},["spec.content"])}catch(e){throw n((0,u.f)(e)),e}finally{r(!1)}},[e]),isUpdating:t,error:i,clearError:a}}(),h=l.trim(),f=h.length>0&&h.length<=500&&!m,p=async()=>{try{await g(e,h),a()}catch{}};return(0,t.jsxs)("div",{role:"listitem",className:"stg:rounded-lg stg:border stg:border-border stg:px-3 stg:py-2.5",children:[(0,t.jsx)("textarea",{value:l,onChange:e=>d(e.target.value),rows:2,maxLength:500,"aria-label":"Edit memory text",className:(0,r.f)("stg:w-full stg:resize-y stg:rounded-md stg:border stg:border-input stg:bg-background stg:px-2 stg:py-1.5 stg:text-sm stg:text-foreground","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring")}),(0,t.jsxs)("div",{className:"stg:mt-1.5 stg:flex stg:items-center stg:justify-between",children:[(0,t.jsxs)("span",{className:"stg:text-2xs stg:text-muted-foreground",children:[h.length,"/500"]}),(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-1.5",children:[(0,t.jsxs)(S,{label:"Save memory text",onClick:()=>void p(),disabled:!f,emphasis:"primary",children:[m&&(0,t.jsx)(o.f,{size:12}),"Save"]}),(0,t.jsx)(S,{label:"Cancel editing",onClick:n,disabled:m,children:"Cancel"})]})]}),x&&(0,t.jsx)("p",{className:"stg:mt-1 stg:text-2xs stg:text-destructive",role:"alert",children:(0,i.g)(x)})]})}function S({label:e,onClick:s,disabled:i,emphasis:n,children:a}){return(0,t.jsx)("button",{type:"button","aria-label":e,onClick:s,disabled:i,className:(0,r.f)("stg:inline-flex stg:items-center stg:gap-1 stg:rounded-md stg:px-2 stg:py-1 stg:text-xs stg:font-medium","primary"===n?"stg:bg-primary stg:text-primary-foreground stg:hover:bg-primary-hover":"stg:border stg:border-input stg:bg-background stg:text-foreground stg:hover:bg-accent stg:hover:text-accent-foreground","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring","stg:disabled:pointer-events-none stg:disabled:opacity-50"),children:a})}function z(){return(0,t.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M2.5 4h11M5.5 4V2.5a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1V4"}),(0,t.jsx)("path",{d:"M12.5 4v9a1 1 0 0 1-1 1h-7a1 1 0 0 1-1-1V4"}),(0,t.jsx)("line",{x1:"6.5",y1:"7",x2:"6.5",y2:"11"}),(0,t.jsx)("line",{x1:"9.5",y1:"7",x2:"9.5",y2:"11"})]})}var M=e.i(297629),L=e.i(193251),_=e.i(365785);e.s(["MemorySection",0,function(){let e=(0,M.x)();return(0,t.jsx)(_.f,{title:"Memory",description:(0,t.jsx)(t.Fragment,{children:"Facts agents proposed to remember about you in this organization. Confirmed memories are shared with agents in your future sessions and appear in those runs' records; once you have many, each conversation recalls the most relevant ones, shown on the run. Only you can see them here, and you can edit or delete any of them at any time."}),children:e?(0,t.jsx)(N,{org:e}):(0,t.jsx)(L.j,{what:"its memories"})})}],24207)},193251,e=>{"use strict";var t=e.i(974265),s=e.i(311015);e.s(["H",0,"Ask one of them if this organization needs one.","j",0,function({what:e}){return(0,t.jsx)(s.f,{variant:"first-use",title:"No organization selected",description:`Choose an organization to see ${e}.`,className:"stg:rounded-lg stg:border stg:border-dashed stg:border-border"})}])},365785,e=>{"use strict";var t=e.i(974265),s=e.i(651023),r=e.i(893976),i=e.i(311015),n=e.i(630983),a=e.i(66724);e.s(["f",0,function({title:e,description:l,actions:o,unavailable:d,denied:g=!1,children:c,className:u}){let m=(0,s.useId)(),x=!0===g?{title:`Only an admin can open ${e}`,description:"Ask an owner or an admin of this organization."}:g||null,h=!!d||null!==x;return(0,t.jsxs)("section",{"aria-labelledby":m,className:(0,r.f)("stg:flex stg:flex-col stg:gap-6",u),children:[(0,t.jsx)(a.f,{title:e,description:l,actions:h?void 0:o,headingLevel:2,headingId:m}),d?(0,t.jsx)(n.f,{children:d}):null!==x?(0,t.jsx)(i.f,{variant:"permission",title:x.title,description:x.description,className:"stg:rounded-lg stg:border stg:border-border"}):c]})}])},734433,e=>{"use strict";var t=e.i(974265),s=e.i(893976),r=e.i(996675);e.s(["SettingsSkeleton",0,function({label:e="Loading",variant:i="rows",rows:n,className:a}){return"figures"===i?(0,t.jsxs)(r.f,{label:e,className:(0,s.f)("stg:flex stg:flex-col stg:gap-4",a),children:[(0,t.jsx)("div",{className:"stg:grid stg:grid-cols-1 stg:gap-3 stg:sm:grid-cols-3","aria-hidden":"true",children:Array.from({length:n??3},(e,s)=>(0,t.jsxs)("span",{className:"stg:flex stg:h-20 stg:flex-col stg:justify-center stg:gap-2 stg:rounded-lg stg:border stg:border-border stg:bg-card stg:px-4",children:[(0,t.jsx)("span",{className:"stg:h-2.5 stg:w-20 stg:animate-pulse stg:rounded stg:bg-muted-subtle"}),(0,t.jsx)("span",{className:"stg:h-5 stg:w-24 stg:animate-pulse stg:rounded stg:bg-muted"})]},s))}),(0,t.jsx)("span",{className:"stg:block stg:h-40 stg:animate-pulse stg:rounded-lg stg:border stg:border-border stg:bg-card","aria-hidden":"true"})]}):(0,t.jsx)(r.f,{label:e,className:(0,s.f)("stg:overflow-hidden stg:rounded-lg stg:border stg:border-border stg:bg-card",a),children:(0,t.jsx)("ul",{className:"stg:m-0 stg:list-none stg:divide-y stg:divide-border stg:p-0","aria-hidden":"true",children:Array.from({length:n??4},(e,s)=>(0,t.jsxs)("li",{className:"stg:flex stg:items-center stg:gap-3 stg:px-4 stg:py-3",children:[(0,t.jsx)("span",{className:"stg:size-8 stg:shrink-0 stg:animate-pulse stg:rounded-full stg:bg-muted"}),(0,t.jsxs)("span",{className:"stg:flex stg:flex-1 stg:flex-col stg:gap-1.5",children:[(0,t.jsx)("span",{className:"stg:h-3 stg:w-40 stg:max-w-full stg:animate-pulse stg:rounded stg:bg-muted"}),(0,t.jsx)("span",{className:"stg:h-2.5 stg:w-64 stg:max-w-full stg:animate-pulse stg:rounded stg:bg-muted-subtle"})]}),(0,t.jsx)("span",{className:"stg:h-5 stg:w-14 stg:shrink-0 stg:animate-pulse stg:rounded-full stg:bg-muted"})]},s))})})}])}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,362856,e=>{"use strict";var t=e.i(974265),s=e.i(19738),r=e.i(297629),a=e.i(651023),n=e.i(893976),i=e.i(394327),l=e.i(425748),o=e.i(931203),d=e.i(891287),g=e.i(269285),c=e.i(255817),u=e.i(616701);function m(e){let t=(0,c.f)(),s=e.org??"",r=e.timeWindow??g.F.LAST_7D,a=e.refetchInterval??0,n=s?async()=>await t.run.getRunSummary((0,d.f)(g.E,{org:s,timeWindow:r})):null,{data:i,isLoading:l,isRefetching:o,error:m,refetch:h}=(0,u.f)(n,[t,s,r],null,{refetchInterval:a||!1});return{summary:i,isLoading:l,isRefetching:o,error:m,refetch:h}}var h=e.i(17616),x=e.i(205413);let f=new Date(0),p=[];var v=e.i(826782);let j=[{label:"Active",valueClass:"stg:text-foreground",getValue:e=>String(e.activeCount)},{label:"Completed",valueClass:"stg:text-status-ready",getValue:e=>String(e.completedCount)},{label:"Failed",valueClass:"stg:text-destructive",getValue:e=>String(e.failedCount)},{label:"Tokens",valueClass:"stg:text-foreground",getValue:e=>(0,v.I)(e.totalTokens)}],b=(0,a.memo)(function({summary:e,isLoading:s,className:r}){return s?(0,t.jsx)("div",{className:(0,n.f)("stg:space-y-3",r),"aria-busy":"true",children:(0,t.jsx)("div",{className:"stg:grid stg:gap-3 stg:sm:grid-cols-2 stg:lg:grid-cols-4",children:Array.from({length:4},(e,s)=>(0,t.jsx)("div",{className:"stg:h-[72px] stg:animate-pulse stg:rounded-lg stg:border stg:border-border stg:bg-muted/50"},s))})}):e?(0,t.jsx)("div",{className:(0,n.f)("stg:grid stg:gap-3 stg:sm:grid-cols-2 stg:lg:grid-cols-4",r),children:j.map(s=>(0,t.jsxs)("div",{className:"stg:rounded-lg stg:border stg:border-border stg:bg-card stg:px-4 stg:py-3",children:[(0,t.jsx)("p",{className:"stg:text-xs stg:font-medium stg:text-muted-foreground",children:s.label}),(0,t.jsx)("p",{className:(0,n.f)("stg:mt-1 stg:text-2xl stg:font-semibold",s.valueClass),children:s.getValue(e)})]},s.label))}):null});var N=e.i(869803),y=e.i(361353);let k=(0,a.memo)(function({failedRuns:e,isLoading:s,onViewClick:r,className:a}){return s?(0,t.jsxs)("div",{className:(0,n.f)("stg:rounded-lg stg:border stg:border-border stg:bg-card stg:p-4",a),"aria-busy":"true",children:[(0,t.jsx)("div",{className:"stg:mb-3 stg:h-4 stg:w-32 stg:animate-pulse stg:rounded stg:bg-muted"}),(0,t.jsx)("div",{className:"stg:space-y-2",children:Array.from({length:3},(e,s)=>(0,t.jsx)("div",{className:"stg:h-10 stg:animate-pulse stg:rounded stg:bg-muted/50"},s))})]}):(0,t.jsxs)("div",{className:(0,n.f)("stg:rounded-lg stg:border stg:border-border stg:bg-card stg:p-4",a),children:[(0,t.jsx)("h3",{className:"stg:mb-3 stg:text-sm stg:font-semibold stg:text-foreground",children:"Recent Failures"}),0===e.length?(0,t.jsx)("p",{className:"stg:py-6 stg:text-center stg:text-xs stg:text-muted-foreground",children:"No recent failures"}):(0,t.jsx)("ul",{className:(0,n.f)(N.J,"stg:space-y-1.5"),role:"list",children:e.map(e=>(0,t.jsxs)("li",{className:"stg:flex stg:items-start stg:gap-2 stg:rounded-md stg:px-2 stg:py-1.5 stg:text-xs stg:hover:bg-muted/50",children:[(0,t.jsxs)("div",{className:"stg:min-w-0 stg:flex-1",children:[(0,t.jsx)("p",{className:"stg:truncate stg:font-medium stg:text-foreground",children:e.name}),e.error&&(0,t.jsx)("p",{className:"stg:truncate stg:text-muted-foreground",children:e.error})]}),(0,t.jsx)("span",{className:"stg:shrink-0 stg:text-muted-foreground",children:(0,y.f)(e.failedAt)}),r&&(0,t.jsx)("button",{type:"button",onClick:()=>r(e.id),className:"stg:shrink-0 stg:text-primary stg:hover:underline",children:"View"})]},e.id))})]})});var w=e.i(643531),C=e.i(803874),A=e.i(87794);let L=({href:e,className:s,children:r})=>(0,t.jsx)("a",{href:e,className:s,children:r});function S({org:e,links:s,renderLink:r=L,className:i}){let l=(0,a.useId)(),{providers:o}=(0,A.f)(e),d=(0,C.f)(e?{kind:"organization",id:e}:null,"can_create_agent",{fail:"closed"}),g=(o??[]).some(e=>"served"===e.availability.state),c=d.allowed,u=!d.isLoading&&null===d.error&&!d.allowed,m=[{title:"Connect a model provider",body:"Add an Anthropic or OpenAI key, so your agents have a model to think with.",href:s.connectProvider,act:"Connect a provider",done:g},{title:"Make an agent",body:u?"An admin of this organization makes agents; you can run the ones shared with you.":"Give it instructions, the skills it needs and the tools it may use.",href:c?s.createAgent:void 0,act:"Make an agent",done:!1},{title:"Start a session",body:"Ask an agent for something and watch it work: what it reads, what it runs, what it makes.",href:s.startSession,act:"Start a session",done:!1}];return(0,t.jsxs)("section",{"aria-labelledby":l,className:(0,n.f)("stg:rounded-xl stg:border stg:border-border stg:bg-card",i),children:[(0,t.jsxs)("div",{className:"stg:border-b stg:border-border stg:px-5 stg:py-4",children:[(0,t.jsx)("h2",{id:l,className:"stg:m-0 stg:text-base stg:font-semibold stg:text-foreground",children:"Get your organization running"}),(0,t.jsx)("p",{className:"stg:m-0 stg:mt-0.5 stg:text-sm stg:text-muted-foreground",children:"Nothing has run here yet. Three steps to a first answer."})]}),(0,t.jsx)("ol",{className:"stg:m-0 stg:list-none stg:divide-y stg:divide-border stg:p-0",children:m.map((e,s)=>(0,t.jsxs)("li",{className:"stg:flex stg:items-center stg:gap-4 stg:px-5 stg:py-4",children:[(0,t.jsx)("span",{"aria-hidden":"true",className:(0,n.f)("stg:flex stg:size-7 stg:shrink-0 stg:items-center stg:justify-center stg:rounded-full stg:text-xs stg:font-semibold",e.done?"stg:bg-foreground stg:text-background":"stg:border stg:border-border stg:text-muted-foreground"),children:e.done?(0,t.jsx)(w.f,{className:"stg:size-3.5"}):s+1}),(0,t.jsxs)("div",{className:"stg:min-w-0 stg:flex-1",children:[(0,t.jsxs)("p",{className:(0,n.f)("stg:m-0 stg:text-sm stg:font-medium",e.done?"stg:text-muted-foreground stg:line-through":"stg:text-foreground"),children:[e.title,e.done&&(0,t.jsx)("span",{className:"stg:sr-only",children:" (done)"})]}),(0,t.jsx)("p",{className:"stg:m-0 stg:mt-0.5 stg:text-sm stg:text-muted-foreground",children:e.body})]}),!e.done&&void 0!==e.href&&r({href:e.href,className:"stg:shrink-0 stg:rounded-md stg:border stg:border-border stg:px-3 stg:py-1.5 stg:text-xs stg:font-medium stg:text-foreground stg:no-underline stg:hover:bg-muted-subtle",children:e.act})]},e.title))})]})}var M=e.i(311015),z=e.i(476007);let T=(0,a.memo)(function({org:e,onFailedRunClick:s,firstStepLinks:r,renderLink:v,className:j}){var N;let{summary:y,isLoading:w,error:C,refetch:A}=function(e){let t=e.refetchInterval??6e4,{summary:s,isLoading:r,error:n,refetch:d}=m({org:e.org,timeWindow:g.F.LAST_7D,refetchInterval:t}),c=(0,a.useMemo)(()=>(0,o.a)("7d"),[]),{report:u,isLoading:h,error:x,refetch:f}=(0,l.f)(e.org??null,c),p=r||h;return{summary:(0,a.useMemo)(()=>{if(p&&!s)return null;let e=Number(u?.totalUsage?.totalTokens??BigInt(0));return{activeCount:s?.activeCount??0,completedCount:s?.phaseCounts[i.A.RUN_COMPLETED]??0,failedCount:s?.phaseCounts[i.A.RUN_FAILED]??0,totalTokens:e,orgUsage:u}},[s,u,p]),isLoading:p,error:n??x,refetch:(0,a.useMemo)(()=>()=>{d(),f()},[d,f])}}({org:e,refetchInterval:6e4}),{failedRuns:L,isLoading:T}=function(e){let t=(0,c.f)(),s=e??"",r=(0,a.useMemo)(()=>s?async()=>{let e=[];for await(let r of(0,x.Y)(e=>t.run.list((0,d.f)(g.m,{pageSize:5,pageToken:e,phase:i.A.RUN_FAILED,org:s}))))if(e.push(r),5===e.length)break;return e}:null,[t,s]),{data:n,isLoading:l,error:o}=(0,u.f)(r,[t,s],[],{refetchInterval:6e4});return{failedRuns:(0,a.useMemo)(()=>{if(!n.length)return p;let e=n.map(e=>{let t=e.status?.audit?.specAudit?.createdAt;return{id:e.metadata?.id??"",name:e.metadata?.name||"Untitled run",error:e.status?.error??"",failedAt:t?(0,h.S)(t):f,resourceName:e.status?.agentId??""}});return e.sort((e,t)=>t.failedAt.getTime()-e.failedAt.getTime()),e.slice(0,5)},[n]),isLoading:l,error:o}}(e),I=void 0!==r&&null===C&&null!==(N=y)&&0===N.activeCount&&0===N.completedCount&&0===N.failedCount,D=m({org:I?e:null,timeWindow:g.F.ALL_TIME}),R=D.summary?D.summary.activeCount+Object.values(D.summary.phaseCounts).reduce((e,t)=>e+t,0):null,U=I&&null===D.error&&0===R,V=I&&null===D.summary&&null===D.error;return e?(0,t.jsxs)("section",{"aria-label":"Platform dashboard",className:(0,n.f)("stg:space-y-6",j),children:[C&&(0,t.jsx)(z.f,{error:C,title:"The week's figures could not be read",retry:A}),U&&r?(0,t.jsx)(S,{org:e,links:r,renderLink:v}):(0,t.jsxs)(t.Fragment,{children:[!C&&(0,t.jsx)(b,{summary:y,isLoading:w||V}),(0,t.jsx)(k,{failedRuns:L,isLoading:T,onViewClick:s})]})]}):(0,t.jsx)("section",{"aria-label":"Platform dashboard",className:j,children:(0,t.jsx)(M.f,{variant:"first-use",title:"No organization selected",description:"Choose an organization to see what its agents did this week."})})});var I=e.i(66724),D=e.i(683738);let R={connectProvider:"/models",createAgent:"/library/agents/new",startSession:"/"},U=({href:e,className:r,children:a})=>(0,t.jsx)(s.default,{href:e,className:r,children:a});e.s(["DashboardPage",0,function(){let{activeOrg:e}=(0,r.S)(),s=e?.metadata?.id??"",{navigateToRun:a}=(0,D.f)();return(0,t.jsxs)("div",{className:"mx-auto max-w-5xl px-6 py-8",children:[(0,t.jsx)(I.f,{className:"mb-8",title:"Dashboard",description:"What your organization's agents did this week."}),(0,t.jsx)(T,{org:s,onFailedRunClick:a,firstStepLinks:R,renderLink:U})]})}],362856)},643531,e=>{"use strict";var t=e.i(678745);e.s(["f",()=>t.f])},311015,e=>{"use strict";var t=e.i(974265),s=e.i(893976),r=e.i(65642),a=e.i(651023),n=e.i(475254);let i=(0,n.f)("package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 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.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]),l=(0,n.f)("search-x",[["path",{d:"m13.5 8.5-5 5",key:"1cs55j"}],["path",{d:"m8.5 8.5 5 5",key:"a8mexj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]),o=(0,n.f)("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"}]]);var d=e.i(63209);let g="stg:h-10 stg:w-10";e.s(["f",0,function({variant:e,resourceLabel:n,icon:c,title:u,description:m,errorMessage:h,action:x,children:f,className:p}){let v=function(e){let{variant:t,resourceLabel:s="resources",title:r,description:n,errorMessage:c}=e;return(0,a.useMemo)(()=>{let e=function(e,t){switch(e){case"first-use":return{title:`No ${t} yet`,description:`Create ${"agents"===t?"an agent":`a ${t.replace(/s$/,"")}`} to get started.`};case"zero-results":return{title:"No results found",description:"Try adjusting your search or filters."};case"permission":return{title:`No access to ${t}`,description:"You don't have permission to view these resources. Contact your organization admin."};case"error":return{title:"Something went wrong",description:"We couldn't load this content. Please try again."}}}(t,s);return{title:r??e.title,description:"error"===t&&c?c:n??e.description,defaultIcon:function(e){switch(e){case"first-use":return(0,a.createElement)(i,{className:g});case"zero-results":return(0,a.createElement)(l,{className:g});case"permission":return(0,a.createElement)(o,{className:g});case"error":return(0,a.createElement)(d.f,{className:g})}}(t),role:"error"===t?"alert":"status"}},[t,s,r,n,c])}({variant:e,resourceLabel:n,title:u,description:m,errorMessage:h});return(0,t.jsxs)("div",{role:v.role,className:(0,s.f)("stg:flex stg:flex-col stg:items-center stg:gap-3 stg:py-12 stg:text-center",p),children:[(0,t.jsx)("div",{className:"stg:text-muted-foreground-faint",children:c??v.defaultIcon}),(0,t.jsxs)("div",{className:"stg:flex stg:flex-col stg:gap-1",children:[(0,t.jsx)("p",{className:"stg:m-0 stg:text-sm stg:font-medium stg:text-muted-foreground",children:v.title}),(0,t.jsx)("p",{className:"stg:m-0 stg:max-w-sm stg:text-xs stg:text-muted-foreground",children:v.description})]}),f?(0,t.jsx)("div",{className:"stg:mt-1",children:f}):x&&(0,t.jsx)(r.f,{variant:"error"===e?"outline":"primary",icon:x.icon,onClick:x.onClick,className:"stg:mt-1",children:x.label})]})}],311015)},476007,e=>{"use strict";var t=e.i(974265),s=e.i(651023),r=e.i(610595),a=e.i(893976);let n={auth:"Authentication required",permission:"Access denied","not-found":"Not found",validation:"Invalid request",server:"Server error",unavailable:"Service unavailable",cancelled:"Request cancelled",unknown:"Something went wrong"};function i({className:e}){return(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:e,"aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M7.13 2.5a1 1 0 0 1 1.74 0l5.5 9.5A1 1 0 0 1 13.5 13.5h-11a1 1 0 0 1-.87-1.5l5.5-9.5z"}),(0,t.jsx)("path",{d:"M8 6v3"}),(0,t.jsx)("circle",{cx:"8",cy:"11",r:"0.5",fill:"currentColor",stroke:"none"})]})}function l({className:e}){return(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:e,"aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M8 1.5l5 2v4c0 3.5-2.5 5.5-5 6.5-2.5-1-5-3-5-6.5v-4l5-2z"}),(0,t.jsx)("path",{d:"M6 6.5l4 4M10 6.5l-4 4"})]})}function o({className:e}){return(0,t.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:e,"aria-hidden":"true",children:(0,t.jsx)("path",{d:"M4 6l4 4 4-4"})})}function d({className:e}){return(0,t.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:e,"aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M2 6.5h4v-4"}),(0,t.jsx)("path",{d:"M3.5 11.5a5.5 5.5 0 1 0 .5-6l-2 1"})]})}e.s(["f",0,function({error:e,title:g,retry:c,className:u}){let[m,h]=(0,s.useState)(!1);if(!e)return null;let x=(0,r.V)(e),f=(0,r.g)(e),p=(0,r.X)(e),v=(0,r.f)(e);return(0,t.jsx)("div",{role:"alert",className:(0,a.f)("stg:bg-destructive-subtle stg:border-destructive/20 stg:text-destructive stg:rounded-lg stg:border stg:p-4",u),children:(0,t.jsxs)("div",{className:"stg:flex stg:items-start stg:gap-3",children:["auth"===x||"permission"===x?(0,t.jsx)(l,{className:"stg:mt-0.5 stg:size-4 stg:shrink-0"}):(0,t.jsx)(i,{className:"stg:mt-0.5 stg:size-4 stg:shrink-0"}),(0,t.jsxs)("div",{className:"stg:min-w-0 stg:flex-1 stg:space-y-1",children:[(0,t.jsx)("p",{className:"stg:text-sm stg:font-medium",children:g??n[x]}),(0,t.jsx)("p",{className:"stg:m-0 stg:text-destructive stg:text-sm",children:f}),p&&(0,t.jsxs)("div",{className:"stg:pt-1",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>h(e=>!e),className:"stg:text-destructive stg:hover:underline stg:inline-flex stg:items-center stg:gap-1 stg:text-xs stg:transition-colors",children:[(0,t.jsx)(o,{className:(0,a.f)("stg:size-3 stg:transition-transform",m&&"stg:rotate-180")}),"Technical details"]}),m&&(0,t.jsxs)("dl",{className:"stg:text-destructive stg:mt-1.5 stg:space-y-0.5 stg:font-mono stg:text-xs",children:[(0,t.jsxs)("div",{className:"stg:flex stg:gap-2",children:[(0,t.jsx)("dt",{className:"stg:shrink-0",children:"Method:"}),(0,t.jsx)("dd",{className:"stg:truncate",children:p.method})]}),(0,t.jsxs)("div",{className:"stg:flex stg:gap-2",children:[(0,t.jsx)("dt",{className:"stg:shrink-0",children:"Path:"}),(0,t.jsx)("dd",{className:"stg:truncate",children:p.path})]})]})]})]}),c&&v&&(0,t.jsxs)("button",{type:"button",onClick:c,className:(0,a.f)("stg:inline-flex stg:shrink-0 stg:items-center stg:gap-1.5 stg:rounded-md stg:border stg:px-2.5 stg:py-1.5 stg:text-xs stg:font-medium","stg:border-destructive/20 stg:text-destructive stg:hover:bg-destructive-subtle","stg:transition-colors"),children:[(0,t.jsx)(d,{className:"stg:size-3"}),"Retry"]})]})})}])},66724,e=>{"use strict";var t=e.i(974265),s=e.i(893976);e.s(["f",0,function({title:e,description:r,actions:a,headingLevel:n=1,headingId:i,className:l}){return(0,t.jsxs)("header",{className:(0,s.f)("stg:flex stg:flex-col stg:gap-1",l),children:[(0,t.jsxs)("div",{className:"stg:flex stg:min-h-8 stg:flex-wrap stg:items-center stg:justify-between stg:gap-x-6 stg:gap-y-2",children:[(0,t.jsx)(1===n?"h1":"h2",{id:i,className:"stg:m-0 stg:text-xl stg:font-semibold stg:tracking-tight stg:text-foreground",children:e}),null!=a&&!1!==a&&(0,t.jsx)("div",{className:"stg:flex stg:shrink-0 stg:items-center stg:gap-2",children:a})]}),null!=r&&(0,t.jsx)("p",{className:"stg:m-0 stg:max-w-2xl stg:text-sm stg:text-muted-foreground",children:r})]})}])},425748,931203,e=>{"use strict";var t=e.i(891287),s=e.i(269285),r=e.i(255817),a=e.i(616701);function n(e){return e.toISOString().slice(0,10)}function i(e){let[t,s,r]=e.split("-").map(Number);return new Date(t,s-1,r)}e.s(["f",0,function(e,n){let i=(0,r.f)(),{data:l,isLoading:o,isRefetching:d,error:g,refetch:c}=(0,a.f)(e?()=>i.run.getOrgUsageReport((0,t.f)(s.r,{org:e,fromDate:n.from,toDate:n.to})):null,[e,n.from,n.to,i],null);return{report:l,isLoading:o,isRefetching:d,error:g,refetch:c}}],425748),e.s(["_",0,["7d","14d","30d"],"a",0,function(e,t=new Date){let s=Number.parseInt(e,10),r=new Date(t);return r.setUTCDate(r.getUTCDate()-(s-1)),{from:n(r),to:n(t)}},"e",0,function(e){let t=i(e.from),s=i(e.to),r=new Intl.DateTimeFormat("en-US",{month:"short",day:"2-digit"});return`${r.format(t)} – ${r.format(s)}`},"w",0,function(e){switch(e){case"7d":return"7 days";case"14d":return"14 days";case"30d":return"30 days"}}],931203)}]);