@orgsdk/cli 0.2.1 → 1.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 (241) hide show
  1. package/README.md +7 -3
  2. package/bin/configuration.mjs +0 -12
  3. package/bin/options.mjs +6 -5
  4. package/bin/orgsdk.mjs +5 -7
  5. package/bin/supervision.mjs +29 -40
  6. package/dist/THIRD_PARTY_NOTICES.txt +53 -0
  7. package/dist/runtime/README.md +3 -3
  8. package/dist/server/index.js +996 -669
  9. package/dist/server/out/404/index.html +1 -1
  10. package/dist/server/out/404.html +1 -1
  11. package/dist/server/out/__next.!KHdvcmtzcGFjZSk.__PAGE__.txt +34 -33
  12. package/dist/server/out/__next._full.txt +28 -27
  13. package/dist/server/out/__next._tree.txt +1 -1
  14. package/dist/server/out/_next/static/chunks/08j8vkv6c63tl.js +1 -0
  15. package/dist/server/out/_next/static/chunks/08mhtndhqtap6.js +1 -0
  16. package/dist/server/out/_next/static/chunks/0_4g944_32yce.js +1 -0
  17. package/dist/server/out/_next/static/chunks/0ldil27yuop5w.js +1 -0
  18. package/dist/server/out/_next/static/chunks/0ml0xmlylpypc.js +1 -0
  19. package/dist/server/out/_next/static/chunks/0pnz1790dyskl.js +1 -0
  20. package/dist/server/out/_next/static/chunks/0vvzjn6qqroc-.js +1 -0
  21. package/dist/server/out/_next/static/chunks/1-rdwquujn9vu.js +1 -0
  22. package/dist/server/out/_next/static/chunks/{0y5lgqdwpeabb.js → 119rk6qs93dvi.js} +1 -1
  23. package/dist/server/out/_next/static/chunks/1mvslk_7tkoql.js +1 -0
  24. package/dist/server/out/_next/static/chunks/1qo38zfnwh7m8.js +1 -0
  25. package/dist/server/out/_next/static/chunks/1wzgdpm-y6pr7.js +1 -0
  26. package/dist/server/out/_next/static/chunks/1ybinna1i7_ih.js +1 -0
  27. package/dist/server/out/_next/static/chunks/1z4_it-ka8j5y.js +1 -0
  28. package/dist/server/out/_next/static/chunks/{0khjy8qh1ll42.js → 23_jxnb5bd655.js} +1 -1
  29. package/dist/server/out/_next/static/chunks/26xwt7opuq5ra.js +1 -0
  30. package/dist/server/out/_next/static/chunks/2_mjw80no8x2k.js +1 -0
  31. package/dist/server/out/_next/static/chunks/2e3acf42jw52v.js +1 -0
  32. package/dist/server/out/_next/static/chunks/2isb6m1ll4dfq.js +3 -0
  33. package/dist/server/out/_next/static/chunks/2q18r9vstryqj.js +3 -0
  34. package/dist/server/out/_next/static/chunks/2zwn2yzygk1de.js +1 -0
  35. package/dist/server/out/_next/static/chunks/{2z60o39-yshg2.js → 36wd29nar_zo_.js} +1 -1
  36. package/dist/server/out/_next/static/chunks/37a4b-pq_bp3z.js +1 -0
  37. package/dist/server/out/_next/static/chunks/37ulwyxnek-f9.js +1 -0
  38. package/dist/server/out/_next/static/chunks/38qp_i6ue7fcy.js +1 -0
  39. package/dist/server/out/_next/static/chunks/3a4y69p5pl3_7.js +10 -0
  40. package/dist/server/out/_next/static/chunks/3l2yelj-blib4.js +1 -0
  41. package/dist/server/out/_next/static/chunks/3u6154viqt17v.js +1 -0
  42. package/dist/server/out/_next/static/chunks/{2navy2mx7--vk.js → 3w6l6p3ylx6oq.js} +2 -2
  43. package/dist/server/out/_next/static/chunks/{0cwfl2xanfapu.js → 3yetoibj5lso8.js} +1 -1
  44. package/dist/server/out/_next/static/chunks/42mg-r2kufm8n.js +1 -0
  45. package/dist/server/out/_not-found/__next._full.txt +22 -19
  46. package/dist/server/out/_not-found/__next._not-found.__PAGE__.txt +25 -22
  47. package/dist/server/out/_not-found/__next._tree.txt +1 -1
  48. package/dist/server/out/_not-found/index.html +1 -1
  49. package/dist/server/out/_not-found/index.txt +22 -19
  50. package/dist/server/out/accounts/2fa/__next._full.txt +25 -24
  51. package/dist/server/out/accounts/2fa/__next._tree.txt +1 -1
  52. package/dist/server/out/accounts/2fa/__next.accounts.2fa.__PAGE__.txt +28 -27
  53. package/dist/server/out/accounts/2fa/index.html +1 -1
  54. package/dist/server/out/accounts/2fa/index.txt +25 -24
  55. package/dist/server/out/accounts/email/__next._full.txt +25 -24
  56. package/dist/server/out/accounts/email/__next._tree.txt +1 -1
  57. package/dist/server/out/accounts/email/__next.accounts.email.__PAGE__.txt +28 -27
  58. package/dist/server/out/accounts/email/index.html +1 -1
  59. package/dist/server/out/accounts/email/index.txt +25 -24
  60. package/dist/server/out/accounts/login/__next._full.txt +25 -24
  61. package/dist/server/out/accounts/login/__next._tree.txt +1 -1
  62. package/dist/server/out/accounts/login/__next.accounts.login.__PAGE__.txt +28 -27
  63. package/dist/server/out/accounts/login/index.html +1 -1
  64. package/dist/server/out/accounts/login/index.txt +25 -24
  65. package/dist/server/out/accounts/logout/__next._full.txt +25 -24
  66. package/dist/server/out/accounts/logout/__next._tree.txt +1 -1
  67. package/dist/server/out/accounts/logout/__next.accounts.logout.__PAGE__.txt +28 -27
  68. package/dist/server/out/accounts/logout/index.html +1 -1
  69. package/dist/server/out/accounts/logout/index.txt +25 -24
  70. package/dist/server/out/accounts/password/change/__next._full.txt +26 -25
  71. package/dist/server/out/accounts/password/change/__next._tree.txt +1 -1
  72. package/dist/server/out/accounts/password/change/__next.accounts.password.change.__PAGE__.txt +30 -29
  73. package/dist/server/out/accounts/password/change/index.html +1 -1
  74. package/dist/server/out/accounts/password/change/index.txt +26 -25
  75. package/dist/server/out/accounts/password/reset/__next._full.txt +25 -23
  76. package/dist/server/out/accounts/password/reset/__next._tree.txt +1 -1
  77. package/dist/server/out/accounts/password/reset/__next.accounts.password.reset.__PAGE__.txt +29 -27
  78. package/dist/server/out/accounts/password/reset/index.html +1 -1
  79. package/dist/server/out/accounts/password/reset/index.txt +25 -23
  80. package/dist/server/out/accounts/signup/__next._full.txt +25 -24
  81. package/dist/server/out/accounts/signup/__next._tree.txt +1 -1
  82. package/dist/server/out/accounts/signup/__next.accounts.signup.__PAGE__.txt +28 -27
  83. package/dist/server/out/accounts/signup/index.html +1 -1
  84. package/dist/server/out/accounts/signup/index.txt +25 -24
  85. package/dist/server/out/actions/__next.!KHdvcmtzcGFjZSk.actions.__PAGE__.txt +33 -33
  86. package/dist/server/out/actions/__next._full.txt +28 -28
  87. package/dist/server/out/actions/__next._tree.txt +1 -1
  88. package/dist/server/out/actions/index.html +1 -1
  89. package/dist/server/out/actions/index.txt +28 -28
  90. package/dist/server/out/agents/__next.!KHdvcmtzcGFjZSk.agents.__PAGE__.txt +38 -37
  91. package/dist/server/out/agents/__next._full.txt +31 -30
  92. package/dist/server/out/agents/__next._tree.txt +1 -1
  93. package/dist/server/out/agents/index.html +1 -1
  94. package/dist/server/out/agents/index.txt +31 -30
  95. package/dist/server/out/approvals/__next.!KHdvcmtzcGFjZSk.approvals.__PAGE__.txt +38 -37
  96. package/dist/server/out/approvals/__next._full.txt +31 -30
  97. package/dist/server/out/approvals/__next._tree.txt +1 -1
  98. package/dist/server/out/approvals/index.html +1 -1
  99. package/dist/server/out/approvals/index.txt +31 -30
  100. package/dist/server/out/artifacts/__next.!KHdvcmtzcGFjZSk.artifacts.__PAGE__.txt +30 -30
  101. package/dist/server/out/artifacts/__next._full.txt +25 -25
  102. package/dist/server/out/artifacts/__next._tree.txt +1 -1
  103. package/dist/server/out/artifacts/index.html +1 -1
  104. package/dist/server/out/artifacts/index.txt +25 -25
  105. package/dist/server/out/audit/__next.!KHdvcmtzcGFjZSk.audit.__PAGE__.txt +35 -34
  106. package/dist/server/out/audit/__next._full.txt +28 -27
  107. package/dist/server/out/audit/__next._tree.txt +1 -1
  108. package/dist/server/out/audit/index.html +1 -1
  109. package/dist/server/out/audit/index.txt +28 -27
  110. package/dist/server/out/chat/__next.!KHdvcmtzcGFjZSk.chat.__PAGE__.txt +34 -33
  111. package/dist/server/out/chat/__next._full.txt +27 -26
  112. package/dist/server/out/chat/__next._tree.txt +1 -1
  113. package/dist/server/out/chat/index.html +1 -1
  114. package/dist/server/out/chat/index.txt +27 -26
  115. package/dist/server/out/connections/__next.!KHdvcmtzcGFjZSk.connections.__PAGE__.txt +38 -37
  116. package/dist/server/out/connections/__next._full.txt +31 -30
  117. package/dist/server/out/connections/__next._tree.txt +1 -1
  118. package/dist/server/out/connections/index.html +1 -1
  119. package/dist/server/out/connections/index.txt +31 -30
  120. package/dist/server/out/credentials/__next.!KHdvcmtzcGFjZSk.credentials.__PAGE__.txt +29 -29
  121. package/dist/server/out/credentials/__next._full.txt +24 -24
  122. package/dist/server/out/credentials/__next._tree.txt +1 -1
  123. package/dist/server/out/credentials/index.html +1 -1
  124. package/dist/server/out/credentials/index.txt +24 -24
  125. package/dist/server/out/documents/__next.!KHdvcmtzcGFjZSk.documents.__PAGE__.txt +38 -37
  126. package/dist/server/out/documents/__next._full.txt +31 -30
  127. package/dist/server/out/documents/__next._tree.txt +1 -1
  128. package/dist/server/out/documents/index.html +1 -1
  129. package/dist/server/out/documents/index.txt +31 -30
  130. package/dist/server/out/index.html +1 -1
  131. package/dist/server/out/index.txt +28 -27
  132. package/dist/server/out/people/__next.!KHdvcmtzcGFjZSk.people.__PAGE__.txt +38 -37
  133. package/dist/server/out/people/__next._full.txt +31 -30
  134. package/dist/server/out/people/__next._tree.txt +1 -1
  135. package/dist/server/out/people/index.html +1 -1
  136. package/dist/server/out/people/index.txt +31 -30
  137. package/dist/server/out/plugins/__next.!KHdvcmtzcGFjZSk.plugins.__PAGE__.txt +31 -31
  138. package/dist/server/out/plugins/__next._full.txt +26 -26
  139. package/dist/server/out/plugins/__next._tree.txt +1 -1
  140. package/dist/server/out/plugins/icons/SOURCES.md +24 -0
  141. package/dist/server/out/plugins/icons/asana.ico +0 -0
  142. package/dist/server/out/plugins/icons/browser-cdp.png +0 -0
  143. package/dist/server/out/plugins/icons/chromium-license.txt +27 -0
  144. package/dist/server/out/plugins/icons/data.svg +1 -0
  145. package/dist/server/out/plugins/icons/facebook.svg +1 -0
  146. package/dist/server/out/plugins/icons/github.svg +10 -0
  147. package/dist/server/out/plugins/icons/gmail.svg +1 -0
  148. package/dist/server/out/plugins/icons/google-drive.svg +1 -0
  149. package/dist/server/out/plugins/icons/google-sheets.svg +1 -0
  150. package/dist/server/out/plugins/icons/google-tasks.svg +1 -0
  151. package/dist/server/out/plugins/icons/harvest.svg +7 -0
  152. package/dist/server/out/plugins/icons/linkedin.png +0 -0
  153. package/dist/server/out/plugins/icons/llm.svg +1 -0
  154. package/dist/server/out/plugins/icons/lucide-license.txt +43 -0
  155. package/dist/server/out/plugins/icons/serper.png +0 -0
  156. package/dist/server/out/plugins/icons/servicem8.png +0 -0
  157. package/dist/server/out/plugins/icons/shippo.png +0 -0
  158. package/dist/server/out/plugins/icons/shopify.png +0 -0
  159. package/dist/server/out/plugins/icons/twitter.svg +1 -0
  160. package/dist/server/out/plugins/icons/xero.svg +15 -0
  161. package/dist/server/out/plugins/icons/zendesk.svg +6 -0
  162. package/dist/server/out/plugins/index.html +1 -1
  163. package/dist/server/out/plugins/index.txt +26 -26
  164. package/dist/server/out/projects/__next.!KHdvcmtzcGFjZSk.projects.__PAGE__.txt +38 -37
  165. package/dist/server/out/projects/__next._full.txt +31 -30
  166. package/dist/server/out/projects/__next._tree.txt +1 -1
  167. package/dist/server/out/projects/index.html +1 -1
  168. package/dist/server/out/projects/index.txt +31 -30
  169. package/dist/server/out/runs/__next.!KHdvcmtzcGFjZSk.runs.__PAGE__.txt +30 -30
  170. package/dist/server/out/runs/__next._full.txt +25 -25
  171. package/dist/server/out/runs/__next._tree.txt +1 -1
  172. package/dist/server/out/runs/index.html +1 -1
  173. package/dist/server/out/runs/index.txt +25 -25
  174. package/dist/server/out/schedules/__next.!KHdvcmtzcGFjZSk.schedules.__PAGE__.txt +29 -29
  175. package/dist/server/out/schedules/__next._full.txt +24 -24
  176. package/dist/server/out/schedules/__next._tree.txt +1 -1
  177. package/dist/server/out/schedules/index.html +1 -1
  178. package/dist/server/out/schedules/index.txt +24 -24
  179. package/dist/server/out/settings/__next.!KHdvcmtzcGFjZSk.settings.__PAGE__.txt +38 -37
  180. package/dist/server/out/settings/__next._full.txt +31 -30
  181. package/dist/server/out/settings/__next._tree.txt +1 -1
  182. package/dist/server/out/settings/index.html +1 -1
  183. package/dist/server/out/settings/index.txt +31 -30
  184. package/dist/server/out/setup/__next._full.txt +27 -26
  185. package/dist/server/out/setup/__next._tree.txt +1 -1
  186. package/dist/server/out/setup/__next.setup.__PAGE__.txt +30 -29
  187. package/dist/server/out/setup/index.html +1 -1
  188. package/dist/server/out/setup/index.txt +27 -26
  189. package/dist/server/out/studio/approve/__next._full.txt +30 -0
  190. package/dist/server/out/studio/approve/__next._tree.txt +5 -0
  191. package/dist/server/out/studio/approve/__next.studio.approve.__PAGE__.txt +37 -0
  192. package/dist/server/out/studio/approve/index.html +1 -0
  193. package/dist/server/out/studio/approve/index.txt +30 -0
  194. package/dist/server/out/tables/__next.!KHdvcmtzcGFjZSk.tables.__PAGE__.txt +35 -34
  195. package/dist/server/out/tables/__next._full.txt +28 -27
  196. package/dist/server/out/tables/__next._tree.txt +1 -1
  197. package/dist/server/out/tables/index.html +1 -1
  198. package/dist/server/out/tables/index.txt +28 -27
  199. package/dist/server/out/webhooks/__next.!KHdvcmtzcGFjZSk.webhooks.__PAGE__.txt +38 -37
  200. package/dist/server/out/webhooks/__next._full.txt +31 -30
  201. package/dist/server/out/webhooks/__next._tree.txt +1 -1
  202. package/dist/server/out/webhooks/index.html +1 -1
  203. package/dist/server/out/webhooks/index.txt +31 -30
  204. package/dist/server/out/workspaces/invite/__next._full.txt +28 -27
  205. package/dist/server/out/workspaces/invite/__next._tree.txt +1 -1
  206. package/dist/server/out/workspaces/invite/__next.workspaces.invite.__PAGE__.txt +31 -30
  207. package/dist/server/out/workspaces/invite/index.html +1 -1
  208. package/dist/server/out/workspaces/invite/index.txt +28 -27
  209. package/docs/browser-sessions.md +3 -3
  210. package/docs/npm-distribution.md +4 -4
  211. package/docs/studio.md +25 -0
  212. package/package.json +3 -1
  213. package/runtime/README.md +3 -3
  214. package/dist/server/out/_next/static/chunks/0ay0b1lpy734z.js +0 -1
  215. package/dist/server/out/_next/static/chunks/0e7s8ie0wlk66.js +0 -1
  216. package/dist/server/out/_next/static/chunks/0ey-6hb0za4r_.js +0 -1
  217. package/dist/server/out/_next/static/chunks/0r0572w1rwpcv.js +0 -1
  218. package/dist/server/out/_next/static/chunks/0u_9k8f7709np.js +0 -1
  219. package/dist/server/out/_next/static/chunks/0w34iczo7r1v5.js +0 -1
  220. package/dist/server/out/_next/static/chunks/0zfiikazg0_ga.js +0 -1
  221. package/dist/server/out/_next/static/chunks/19ue6x5c3f_38.js +0 -3
  222. package/dist/server/out/_next/static/chunks/1c2xcwifk3vhh.js +0 -1
  223. package/dist/server/out/_next/static/chunks/1dwr62uuyceq-.js +0 -1
  224. package/dist/server/out/_next/static/chunks/1fweh1ttncdlv.js +0 -1
  225. package/dist/server/out/_next/static/chunks/1iklteprcoims.js +0 -1
  226. package/dist/server/out/_next/static/chunks/1qaow7bdy3oid.js +0 -1
  227. package/dist/server/out/_next/static/chunks/1wn9ohqcnx8y8.js +0 -3
  228. package/dist/server/out/_next/static/chunks/1zieh-zxgxmcp.js +0 -1
  229. package/dist/server/out/_next/static/chunks/25qsan0t-_of0.js +0 -1
  230. package/dist/server/out/_next/static/chunks/26yareaaj1kyr.js +0 -1
  231. package/dist/server/out/_next/static/chunks/2bkkmnhngpacd.js +0 -1
  232. package/dist/server/out/_next/static/chunks/2e39uy7huhczu.js +0 -1
  233. package/dist/server/out/_next/static/chunks/2rp65hq6bmpxv.js +0 -1
  234. package/dist/server/out/_next/static/chunks/3_d6w25_b15kx.js +0 -1
  235. package/dist/server/out/_next/static/chunks/3d8gkwu9nszjk.js +0 -1
  236. package/dist/server/out/_next/static/chunks/3l-16g1y6k5rs.js +0 -1
  237. package/dist/server/out/_next/static/chunks/3obu_9-ka7u_h.js +0 -1
  238. package/dist/server/out/_next/static/chunks/3u7q5w03st-rs.js +0 -1
  239. /package/dist/server/out/_next/static/{pj0R4_8zvgkN95QPXRHgC → EF7eiGRF-6pU64XbVOn6f}/_buildManifest.js +0 -0
  240. /package/dist/server/out/_next/static/{pj0R4_8zvgkN95QPXRHgC → EF7eiGRF-6pU64XbVOn6f}/_clientMiddlewareManifest.js +0 -0
  241. /package/dist/server/out/_next/static/{pj0R4_8zvgkN95QPXRHgC → EF7eiGRF-6pU64XbVOn6f}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,59659,e=>{"use strict";var a=e.i(56420);let t={name:"trash",size:24,node:[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],aliases:["trash-2"]};t.node;let r=(0,a.f)(t);e.s(["f",0,r],59659)},40192,54105,19877,e=>{"use strict";var a=e.i(22219);e.s(["z",0,a],40192),e.s(["z",0,a],54105),e.s(["z",0,a],19877)},13581,29487,e=>{"use strict";var a=e.i(71645),t=e.i(95813);e.s(["f",0,function(e,r=0){let[i,s]=(0,a.useState)(),[n,l]=(0,a.useState)(""),[d,c]=(0,a.useState)(!0),o=(0,a.useRef)(void 0),u=(0,a.useRef)(!1),h=(0,a.useCallback)(async()=>{o.current?.abort();let a=new AbortController;o.current=a;try{let t=await e(a.signal);if(a.signal.aborted||!u.current)return;s(t),l("")}catch(e){!a.signal.aborted&&u.current&&l((0,t.f)(e))}finally{!a.signal.aborted&&u.current&&c(!1)}},[e]);return(0,a.useEffect)(()=>{u.current=!0,queueMicrotask(()=>{u.current&&h()});let e=r>0?setInterval(()=>{h()},r):void 0;return()=>{u.current=!1,o.current?.abort(),clearInterval(e)}},[h,r]),{data:i,error:n,isLoading:d,refresh:h}}],13581);var r=e.i(18050),i=e.i(19455);e.s(["f",0,function({isLoading:e,error:a,refresh:t}){return(0,r.jsxs)(r.Fragment,{children:[e?(0,r.jsx)("p",{role:"status",children:"Loading workspace data…"}):void 0,a?(0,r.jsxs)("div",{className:"error",role:"alert",children:[(0,r.jsx)("p",{children:a}),(0,r.jsx)(i.f,{variant:"outline",onClick:()=>{t()},children:"Try again"})]}):void 0]})}],29487)},61790,e=>{"use strict";var a=e.i(18050),t=e.i(58925),r=e.i(56420);let i={name:"pencil",size:24,node:[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]};i.node;let s=(0,r.f)(i);var n=e.i(59659),l=e.i(71645),d=e.i(73656),c=e.i(40192),o=e.i(54105),u=e.i(19877),h=e.i(95813),v=e.i(15080),p=e.i(13581),f=e.i(19455),j=e.i(93479),m=e.i(59037),x=e.i(29487),g=e.i(87309);function b({canManage:e,onDirtyChange:r}){let i=(0,p.f)(v._),y=(0,g.h)(),[k,w]=(0,l.useState)(""),[N,S]=(0,l.useState)(""),[C,z]=(0,l.useState)("openai"),[M,D]=(0,l.useState)(""),[E,O]=(0,l.useState)(!1),[R,A]=(0,l.useState)(""),[L,V]=(0,l.useState)(""),T=i.data?.find(e=>e.id===k);(0,m.f)(""!==M||N!==(T?.name??"")||C!==(T?.provider??"openai"),r);let q=async e=>{O(!0),A(""),V("");try{await e(),await i.refresh()}catch(e){A((0,h.f)(e))}finally{O(!1)}};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("section",{className:"panel",children:[(0,a.jsxs)("div",{className:"panel-title",children:[(0,a.jsxs)("h2",{children:[(0,a.jsx)(t.f,{size:18})," Credential inventory"]}),(0,a.jsxs)("span",{className:"badge",children:[i.data?.length??0," credentials"]})]}),(0,a.jsx)("p",{className:"small",children:"Secret values are encrypted and never returned. Replacing a secret affects future runs; retained runs keep their snapshot scope."}),(0,a.jsx)(x.f,{...i}),i.isLoading||i.data?.length!==0?void 0:(0,a.jsxs)("div",{className:"resource-empty",children:[(0,a.jsx)(t.f,{size:28}),(0,a.jsx)("h3",{children:"No credentials yet"}),(0,a.jsx)("p",{children:"Add a provider credential, then assign it to a plugin."})]}),i.data?.map(r=>(0,a.jsxs)("div",{className:"resource-row",children:[(0,a.jsx)(t.f,{size:17}),(0,a.jsxs)("div",{children:[(0,a.jsx)("strong",{children:r.name}),(0,a.jsxs)("small",{children:[r.provider," · Value hidden"]})]}),e?(0,a.jsxs)("div",{className:"row",children:[(0,a.jsxs)(f.f,{variant:"outline",size:"sm",disabled:E,onClick:()=>{w(r.id),S(r.name),z(r.provider),D("")},children:[(0,a.jsx)(s,{size:13}),"Edit"]}),(0,a.jsx)(f.f,{variant:"ghost",size:"icon","aria-label":`Delete credential ${r.name}`,disabled:E,onClick:()=>{q(async()=>{await y({title:"Delete this credential?",description:"Disconnect any plugins using this credential before deleting it.",actionLabel:"Delete credential"})&&(await d.V.credentials.delete.mutate({id:r.id}),V("Credential deleted."))})},children:(0,a.jsx)(n.f,{size:14})})]}):void 0]},r.id))]}),e?(0,a.jsxs)("section",{className:"panel",children:[(0,a.jsx)("h2",{children:k?"Replace or rename credential":"Add a credential"}),(0,a.jsxs)("form",{onSubmit:e=>{e.preventDefault(),q(async()=>{let e=M.trim()?c.z.record(o.z.string(),u.z.json()).parse(JSON.parse(M)):void 0;if(k)await d.V.credentials.update.mutate({id:k,name:N,provider:C,...void 0!==e&&{secret:e}});else{if(void 0===e)throw Error("Enter the credential secret as a JSON object.");await d.V.credentials.create.mutate({name:N,provider:C,secret:e})}D(""),w(""),S(""),z("openai"),V("Credential saved. Assign it in plugin settings.")})},children:[(0,a.jsxs)("div",{className:"row",children:[(0,a.jsxs)("label",{children:["Credential name",(0,a.jsx)(j.f,{required:!0,value:N,disabled:E,onChange:e=>{S(e.target.value)}})]}),(0,a.jsxs)("label",{children:["Provider",(0,a.jsx)(j.f,{required:!0,value:C,disabled:E,onChange:e=>{z(e.target.value)}})]})]}),(0,a.jsxs)("label",{children:[k?"Replacement secret JSON (leave blank to keep current value)":"Secret JSON",(0,a.jsx)(j.f,{type:"password",required:!k,autoComplete:"new-password",value:M,disabled:E,placeholder:'{"api_key":"…"}',onChange:e=>{D(e.target.value)}})]}),(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)(f.f,{type:"submit",disabled:E,children:"Save credential"}),k?(0,a.jsx)(f.f,{type:"button",variant:"outline",onClick:()=>{w(""),S(""),D(""),z("openai")},children:"Cancel editing"}):void 0]})]})]}):(0,a.jsx)("p",{className:"notice",children:"Only workspace owners and admins can manage credentials."}),R?(0,a.jsx)("p",{className:"error",role:"alert",children:R}):void 0,L?(0,a.jsx)("p",{className:"notice",role:"status",children:L}):void 0]})}var y=e.i(94757);e.s(["default",0,function(){let{canManage:e,setDirty:t}=(0,y.useWorkspace)();return(0,a.jsx)(b,{canManage:e,onDirtyChange:t})}],61790)},59037,e=>{"use strict";var a=e.i(71645);e.s(["f",0,function(e,t){(0,a.useEffect)(()=>{t(e);let a=e=>{e.preventDefault()};return e&&addEventListener("beforeunload",a),()=>{removeEventListener("beforeunload",a),t(!1)}},[e,t])}])}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,59659,e=>{"use strict";var a=e.i(56420);let r={name:"trash",size:24,node:[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],aliases:["trash-2"]};r.node;let i=(0,a.f)(r);e.s(["f",0,i],59659)},13581,29487,e=>{"use strict";var a=e.i(71645),r=e.i(95813);e.s(["f",0,function(e,i=0){let[s,t]=(0,a.useState)(),[n,l]=(0,a.useState)(""),[o,d]=(0,a.useState)(!0),c=(0,a.useRef)(void 0),m=(0,a.useRef)(!1),u=(0,a.useCallback)(async()=>{c.current?.abort();let a=new AbortController;c.current=a;try{let r=await e(a.signal);if(a.signal.aborted||!m.current)return;t(r),l("")}catch(e){!a.signal.aborted&&m.current&&l((0,r.f)(e))}finally{!a.signal.aborted&&m.current&&d(!1)}},[e]);return(0,a.useEffect)(()=>{m.current=!0,queueMicrotask(()=>{m.current&&u()});let e=i>0?setInterval(()=>{u()},i):void 0;return()=>{m.current=!1,c.current?.abort(),clearInterval(e)}},[u,i]),{data:s,error:n,isLoading:o,refresh:u}}],13581);var i=e.i(18050),s=e.i(19455);e.s(["f",0,function({isLoading:e,error:a,refresh:r}){return(0,i.jsxs)(i.Fragment,{children:[e?(0,i.jsx)("p",{role:"status",children:"Loading workspace data…"}):void 0,a?(0,i.jsxs)("div",{className:"error",role:"alert",children:[(0,i.jsx)("p",{children:a}),(0,i.jsx)(s.f,{variant:"outline",onClick:()=>{r()},children:"Try again"})]}):void 0]})}],29487)},82609,e=>{"use strict";var a=e.i(18050),r=e.i(56420);let i={name:"mail-plus",size:24,node:[["path",{d:"M22 13V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v12c0 1.1.9 2 2 2h8",key:"12jkf8"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}],["path",{d:"M19 16v6",key:"tddt3s"}],["path",{d:"M16 19h6",key:"xwg31i"}]]};i.node;let s=(0,r.f)(i);var t=e.i(59659),n=e.i(82303),l=e.i(71645),o=e.i(73656),d=e.i(95813),c=e.i(13581),m=e.i(19455),u=e.i(93479),h=e.i(29487),v=e.i(87309);function p({onChanged:e}){let r=(0,c.f)((0,l.useCallback)(e=>o.U.workspace.current.query(void 0,{signal:e}),[])),i=(0,v.h)(),[b,x]=(0,l.useState)(""),[f,j]=(0,l.useState)("member"),[w,g]=(0,l.useState)(!1),[k,y]=(0,l.useState)(""),[N,M]=(0,l.useState)(""),C=r.data?.role,I="owner"===C||"admin"===C,R=async a=>{g(!0),y(""),M("");try{await a(),await r.refresh(),await e()}catch(e){y((0,d.f)(e))}finally{g(!1)}};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("section",{className:"panel",children:[(0,a.jsxs)("div",{className:"panel-title",children:[(0,a.jsxs)("h2",{children:[(0,a.jsx)(n.f,{size:18})," Workspace members"]}),(0,a.jsxs)("span",{className:"badge",children:[r.data?.members.length??0," people"]})]}),(0,a.jsx)(h.f,{...r}),r.data?.members.map(e=>(0,a.jsxs)("div",{className:"resource-row",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("strong",{children:e.email}),(0,a.jsx)("small",{children:e.username})]}),"owner"===C&&"owner"!==e.role?(0,a.jsxs)("select",{className:"member-role","aria-label":`Role for ${e.email}`,value:e.role,disabled:w,onChange:a=>{let r="admin"===a.target.value?"admin":"member";R(async()=>{await o.U.workspace.updateMember.mutate({id:e.id,role:r}),M("Member role updated.")})},children:[(0,a.jsx)("option",{value:"member",children:"Member"}),(0,a.jsx)("option",{value:"admin",children:"Admin"})]}):(0,a.jsx)("span",{className:"badge",children:e.role}),I&&"owner"!==e.role&&("owner"===C||"member"===e.role)?(0,a.jsx)(m.f,{variant:"ghost",size:"icon","aria-label":`Remove ${e.email}`,disabled:w,onClick:()=>{R(async()=>{await i({title:"Remove this member?",description:`${e.email} will lose access to this workspace.`,actionLabel:"Remove member"})&&(await o.U.workspace.removeMember.mutate({id:e.id}),M("Member removed."))})},children:(0,a.jsx)(t.f,{size:14})}):void 0,"owner"===C&&"owner"!==e.role?(0,a.jsx)(m.f,{variant:"outline",size:"sm",disabled:w,onClick:()=>{R(async()=>{await i({title:"Transfer workspace ownership?",description:`${e.email} will become the owner. Your own role will change to admin.`,actionLabel:"Transfer ownership"})&&(await o.U.workspace.transferOwnership.mutate({membership_id:e.id}),M("Ownership transferred."))})},children:"Make owner"}):void 0]},e.id))]}),I?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("section",{className:"panel",children:[(0,a.jsxs)("h2",{children:[(0,a.jsx)(s,{size:18})," Invite a teammate"]}),(0,a.jsxs)("form",{onSubmit:e=>{e.preventDefault(),R(async()=>{await o.U.workspace.invite.mutate({email:b,role:f}),x(""),M("Invitation queued.")})},children:[(0,a.jsxs)("div",{className:"row",children:[(0,a.jsxs)("label",{children:["Invite by email",(0,a.jsx)(u.f,{type:"email",required:!0,value:b,disabled:w,onChange:e=>{x(e.target.value)}})]}),(0,a.jsxs)("label",{children:["Invitation role",(0,a.jsxs)("select",{value:f,disabled:w,onChange:e=>{j("admin"===e.target.value?"admin":"member")},children:[(0,a.jsx)("option",{value:"member",children:"Member"}),"owner"===C?(0,a.jsx)("option",{value:"admin",children:"Admin"}):void 0]})]})]}),(0,a.jsx)(m.f,{type:"submit",disabled:w,children:"Invite member"})]})]}),(0,a.jsxs)("section",{className:"panel",children:[(0,a.jsx)("h2",{children:"Invitations"}),r.data?.invitations.length===0?(0,a.jsx)("p",{className:"small",children:"No invitations have been sent."}):void 0,r.data?.invitations.map(e=>(0,a.jsxs)("div",{className:"resource-row",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("strong",{children:e.email}),(0,a.jsxs)("small",{children:[e.role," · Expires"," ",new Date(e.expires_at).toLocaleString()]})]}),(0,a.jsx)("span",{className:"badge",children:e.accepted_at?"Accepted":e.revoked_at?"Revoked":new Date(e.expires_at)<new Date?"Expired":"Pending"}),e.accepted_at||e.revoked_at||"owner"!==C&&"member"!==e.role?void 0:(0,a.jsx)(m.f,{variant:"outline",size:"sm",disabled:w,onClick:()=>{R(async()=>{await o.U.workspace.revokeInvitation.mutate({id:e.id}),M("Invitation revoked.")})},children:"Revoke"})]},e.id))]})]}):void 0,k?(0,a.jsx)("p",{className:"error",role:"alert",children:k}):void 0,N?(0,a.jsx)("p",{className:"notice",role:"status",children:N}):void 0]})}var b=e.i(94757);e.s(["default",0,function(){let{refresh:e}=(0,b.useWorkspace)();return(0,a.jsx)(p,{onChanged:e})}],82609)},93479,e=>{"use strict";var a=e.i(18050),r=e.i(71645),i=e.i(39689);let s=r.forwardRef(({className:e,type:r,...s},t)=>(0,a.jsx)("input",{type:r,className:(0,i.f)("flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:t,...s}));s.displayName="Input",e.s(["f",0,s])}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,59659,e=>{"use strict";var a=e.i(56420);let r={name:"trash",size:24,node:[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],aliases:["trash-2"]};r.node;let i=(0,a.f)(r);e.s(["f",0,i],59659)},13581,29487,e=>{"use strict";var a=e.i(71645),r=e.i(95813);e.s(["f",0,function(e,i=0){let[s,t]=(0,a.useState)(),[n,l]=(0,a.useState)(""),[o,d]=(0,a.useState)(!0),c=(0,a.useRef)(void 0),m=(0,a.useRef)(!1),h=(0,a.useCallback)(async()=>{c.current?.abort();let a=new AbortController;c.current=a;try{let r=await e(a.signal);if(a.signal.aborted||!m.current)return;t(r),l("")}catch(e){!a.signal.aborted&&m.current&&l((0,r.f)(e))}finally{!a.signal.aborted&&m.current&&d(!1)}},[e]);return(0,a.useEffect)(()=>{m.current=!0,queueMicrotask(()=>{m.current&&h()});let e=i>0?setInterval(()=>{h()},i):void 0;return()=>{m.current=!1,c.current?.abort(),clearInterval(e)}},[h,i]),{data:s,error:n,isLoading:o,refresh:h}}],13581);var i=e.i(18050),s=e.i(19455);e.s(["f",0,function({isLoading:e,error:a,refresh:r}){return(0,i.jsxs)(i.Fragment,{children:[e?(0,i.jsx)("p",{role:"status",children:"Loading workspace data…"}):void 0,a?(0,i.jsxs)("div",{className:"error",role:"alert",children:[(0,i.jsx)("p",{children:a}),(0,i.jsx)(s.f,{variant:"outline",onClick:()=>{r()},children:"Try again"})]}):void 0]})}],29487)},82609,e=>{"use strict";var a=e.i(18050),r=e.i(56420);let i={name:"mail-plus",size:24,node:[["path",{d:"M22 13V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v12c0 1.1.9 2 2 2h8",key:"12jkf8"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}],["path",{d:"M19 16v6",key:"tddt3s"}],["path",{d:"M16 19h6",key:"xwg31i"}]]};i.node;let s=(0,r.f)(i);var t=e.i(59659),n=e.i(82303),l=e.i(71645),o=e.i(73656),d=e.i(95813),c=e.i(13581),m=e.i(19455),h=e.i(93479),u=e.i(29487),v=e.i(87309);function p({onChanged:e}){let r=(0,c.f)((0,l.useCallback)(e=>o.V.workspace.current.query(void 0,{signal:e}),[])),i=(0,v.h)(),[b,x]=(0,l.useState)(""),[j,w]=(0,l.useState)("member"),[f,k]=(0,l.useState)(!1),[g,y]=(0,l.useState)(""),[M,N]=(0,l.useState)(""),C=r.data?.role,S="owner"===C||"admin"===C,I=async a=>{k(!0),y(""),N("");try{await a(),await r.refresh(),await e()}catch(e){y((0,d.f)(e))}finally{k(!1)}};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("section",{className:"panel",children:[(0,a.jsxs)("div",{className:"panel-title",children:[(0,a.jsxs)("h2",{children:[(0,a.jsx)(n.f,{size:18})," Workspace members"]}),(0,a.jsxs)("span",{className:"badge",children:[r.data?.members.length??0," people"]})]}),(0,a.jsx)(u.f,{...r}),r.data?.members.map(e=>(0,a.jsxs)("div",{className:"resource-row",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("strong",{children:e.email}),(0,a.jsx)("small",{children:e.username})]}),"owner"===C&&"owner"!==e.role?(0,a.jsxs)("select",{className:"member-role","aria-label":`Role for ${e.email}`,value:e.role,disabled:f,onChange:a=>{let r="admin"===a.target.value?"admin":"member";I(async()=>{await o.V.workspace.updateMember.mutate({id:e.id,role:r}),N("Member role updated.")})},children:[(0,a.jsx)("option",{value:"member",children:"Member"}),(0,a.jsx)("option",{value:"admin",children:"Admin"})]}):(0,a.jsx)("span",{className:"badge",children:e.role}),S&&"owner"!==e.role&&("owner"===C||"member"===e.role)?(0,a.jsx)(m.f,{variant:"ghost",size:"icon","aria-label":`Remove ${e.email}`,disabled:f,onClick:()=>{I(async()=>{await i({title:"Remove this member?",description:`${e.email} will lose access to this workspace.`,actionLabel:"Remove member"})&&(await o.V.workspace.removeMember.mutate({id:e.id}),N("Member removed."))})},children:(0,a.jsx)(t.f,{size:14})}):void 0,"owner"===C&&"owner"!==e.role?(0,a.jsx)(m.f,{variant:"outline",size:"sm",disabled:f,onClick:()=>{I(async()=>{await i({title:"Transfer workspace ownership?",description:`${e.email} will become the owner. Your own role will change to admin.`,actionLabel:"Transfer ownership"})&&(await o.V.workspace.transferOwnership.mutate({membership_id:e.id}),N("Ownership transferred."))})},children:"Make owner"}):void 0]},e.id))]}),S?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("section",{className:"panel",children:[(0,a.jsxs)("h2",{children:[(0,a.jsx)(s,{size:18})," Invite a teammate"]}),(0,a.jsxs)("form",{onSubmit:e=>{e.preventDefault(),I(async()=>{await o.V.workspace.invite.mutate({email:b,role:j}),x(""),N("Invitation queued.")})},children:[(0,a.jsxs)("div",{className:"row",children:[(0,a.jsxs)("label",{children:["Invite by email",(0,a.jsx)(h.f,{type:"email",required:!0,value:b,disabled:f,onChange:e=>{x(e.target.value)}})]}),(0,a.jsxs)("label",{children:["Invitation role",(0,a.jsxs)("select",{value:j,disabled:f,onChange:e=>{w("admin"===e.target.value?"admin":"member")},children:[(0,a.jsx)("option",{value:"member",children:"Member"}),"owner"===C?(0,a.jsx)("option",{value:"admin",children:"Admin"}):void 0]})]})]}),(0,a.jsx)(m.f,{type:"submit",disabled:f,children:"Invite member"})]})]}),(0,a.jsxs)("section",{className:"panel",children:[(0,a.jsx)("h2",{children:"Invitations"}),r.data?.invitations.length===0?(0,a.jsx)("p",{className:"small",children:"No invitations have been sent."}):void 0,r.data?.invitations.map(e=>(0,a.jsxs)("div",{className:"resource-row",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("strong",{children:e.email}),(0,a.jsxs)("small",{children:[e.role," · Expires"," ",new Date(e.expires_at).toLocaleString()]})]}),(0,a.jsx)("span",{className:"badge",children:e.accepted_at?"Accepted":e.revoked_at?"Revoked":new Date(e.expires_at)<new Date?"Expired":"Pending"}),e.accepted_at||e.revoked_at||"owner"!==C&&"member"!==e.role?void 0:(0,a.jsx)(m.f,{variant:"outline",size:"sm",disabled:f,onClick:()=>{I(async()=>{await o.V.workspace.revokeInvitation.mutate({id:e.id}),N("Invitation revoked.")})},children:"Revoke"})]},e.id))]})]}):void 0,g?(0,a.jsx)("p",{className:"error",role:"alert",children:g}):void 0,M?(0,a.jsx)("p",{className:"notice",role:"status",children:M}):void 0]})}var b=e.i(94757);e.s(["default",0,function(){let{refresh:e}=(0,b.useWorkspace)();return(0,a.jsx)(p,{onChanged:e})}],82609)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,76046,e=>{"use strict";e.i(44362);var t=e.i(14778);e.s(["k",0,function(){location.assign(function(e){let t=new URLSearchParams(e).get("next");if(!t||!t.startsWith("/")||t.startsWith("//")||t.includes("\\"))return"/";for(let e of t)if((e.codePointAt(0)??0)<=32)return"/";let a=new URL(t,location.origin);return a.origin===location.origin?`${a.pathname}${a.search}${a.hash}`:"/"}(location.search))},"z",0,"Confirm your identity below, then retry your change.","$",0,function(e){return(0,t.f)(e)&&e.data?.code==="UNAUTHORIZED"},"y",0,function(){let e=`${location.pathname}${location.search}${location.hash}`;location.replace(`/accounts/login/?next=${encodeURIComponent(e)}`)},"u",0,function(e){return!e.is_authenticated&&e.flows.some(e=>"mfa_authenticate"===e.id)}])},95813,e=>{"use strict";e.s(["f",0,function(e,t="The request failed. Please try again."){return e instanceof Error?e.message:t}])},86441,e=>{"use strict";var t=e.i(18050),a=e.i(22016),r=e.i(73656),n=e.i(71645),s=e.i(92229),o=e.i(18879),i=e.i(11105);function c(){let e=(0,r.S)("/accounts/email/");return e.startsWith("https:")||e.startsWith("http:")?(0,t.jsx)("a",{href:e,target:"_blank",rel:"noreferrer",children:"Confirm your identity on your installation, then retry."}):(0,t.jsxs)("details",{open:!0,className:"mt-6 border-t border-slate-200 pt-4",children:[(0,t.jsx)("summary",{className:"cursor-pointer text-sm font-medium",children:"Confirm your identity"}),(0,t.jsxs)("p",{className:"text-sm",children:["Session expired? ",(0,t.jsx)(a.default,{href:"/accounts/login/",children:"Sign in again"}),"."]}),(0,t.jsx)("p",{className:"text-sm",children:"If a security change asks you to confirm your identity, enter your password or an authenticator code, then retry the change."}),(0,t.jsx)(i.F,{submitLabel:"Confirm password",onSubmit:async e=>(await r.V.auth.reauthenticate.mutate({password:(0,o.f)(e,"password")}),"Identity confirmed. Retry your change."),children:(0,t.jsx)(i.j,{label:"Password",type:"password",name:"password",autoComplete:"current-password",required:!0})}),(0,t.jsx)("div",{className:"mt-5",children:(0,t.jsx)(i.F,{submitLabel:"Confirm code",onSubmit:async e=>(await r.V.auth.mfaReauthenticate.mutate({code:(0,o.f)(e,"code")}),"Identity confirmed. Retry your change."),children:(0,t.jsx)(i.j,{label:"Authenticator or recovery code",name:"code",autoComplete:"one-time-code",required:!0})})})]})}e.s(["f",0,function({children:e}){let[o,i]=(0,n.useState)(),[l,u]=(0,n.useState)(!1);(0,n.useEffect)(()=>{let e=new AbortController;return(0,r.m)(e.signal).then(t=>{e.signal.aborted||i(t)}).catch(()=>{e.signal.aborted||u(!0)}),()=>{e.abort()}},[]);let[d,h]=(0,n.useState)(!1);return l?(0,t.jsx)("p",{role:"alert",children:"Unable to load your account. Reload to try again."}):o?o.is_authenticated?(0,t.jsxs)(s.T,{value:()=>{h(!0)},children:[e,d&&(0,t.jsx)(c,{})]}):(0,t.jsxs)("p",{children:["Please ",(0,t.jsx)(a.default,{href:"/accounts/login/",children:"sign in"})," to manage your account."]}):(0,t.jsx)("p",{role:"status",children:"Loading your account…"})}],86441)},11105,92229,e=>{"use strict";var t=e.i(18050),a=e.i(71645),r=e.i(76046),n=e.i(95813);let s=(0,a.createContext)(void 0);function o(){let e=(0,a.useContext)(s);return(t,a)=>e&&(0,r.$)(t)?(e(),r.z):(0,n.f)(t,a)}e.s(["T",0,s,"G",0,o],92229);var i=e.i(19455),c=e.i(93479);e.s(["j",0,function({label:e,...a}){return(0,t.jsxs)("label",{children:[e,(0,t.jsx)(c.f,{...a})]})},"F",0,function({children:e,submitLabel:r,onSubmit:n}){let s=o(),[c,l]=(0,a.useState)(!1),[u,d]=(0,a.useState)(""),[h,m]=(0,a.useState)("");async function f(e){e.preventDefault();let t=new FormData(e.currentTarget);l(!0),d(""),m("");try{m(await n(t)??"")}catch(e){d(s(e,"Unable to save. Please try again."))}finally{l(!1)}}return(0,t.jsxs)("form",{onSubmit:e=>{f(e)},children:[(0,t.jsxs)("fieldset",{disabled:c,className:"min-w-0 border-0 p-0",children:[e,(0,t.jsx)(i.f,{type:"submit",disabled:c,children:c?"Please wait…":r})]}),u&&(0,t.jsx)("p",{role:"alert",className:"error mt-4",children:u}),h&&(0,t.jsx)("p",{role:"status",className:"notice mt-4",children:h})]})}],11105)},81010,e=>{"use strict";var t=e.i(18050),a=e.i(71645),r=e.i(73656),n=e.i(95813),s=e.i(18879),o=e.i(19455),i=e.i(15448),c=e.i(86441),l=e.i(92229),u=e.i(11105);function d(){let e=(0,l.G)(),[i,c]=(0,a.useState)(),[d,h]=(0,a.useState)(!1),[m,f]=(0,a.useState)(""),[y,p]=(0,a.useState)([]),[b,x]=(0,a.useState)("");return(0,a.useEffect)(()=>{let e=!0;return r.V.auth.authenticators.query().then(t=>{e&&c(t.some(e=>"totp"===e.type))}).catch(t=>{e&&x((0,n.f)(t,"Unable to load authenticators."))}),()=>{e=!1}},[]),(0,t.jsxs)(t.Fragment,{children:[b&&(0,t.jsx)("p",{role:"alert",className:"error",children:b}),void 0===i&&!b&&(0,t.jsx)("p",{role:"status",children:"Loading security settings…"}),!1===i&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"text-sm",children:"Add two-factor authentication using an authenticator app. You will enter a code when signing in."}),m?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"text-sm",children:"Add an account in your authenticator app with this setup key. Select time-based codes."}),(0,t.jsx)("code",{className:"block break-all rounded bg-slate-100 p-3 text-sm",children:m}),(0,t.jsx)("div",{className:"mt-5",children:(0,t.jsx)(u.F,{submitLabel:"Enable two-factor authentication",onSubmit:async e=>(await r.V.auth.enableTotp.mutate({code:(0,s.f)(e,"code")}),c(!0),f(""),"Two-factor authentication enabled. Generate recovery codes below."),children:(0,t.jsx)(u.j,{label:"Code from your authenticator",name:"code",autoComplete:"one-time-code",inputMode:"numeric",required:!0})})})]}):(0,t.jsx)(o.f,{disabled:d,onClick:()=>{x(""),h(!0),r.V.auth.totpSetup.mutate().then(e=>{if(c(e.enabled),!e.enabled){if(!e.secret)throw Error("Unable to start authenticator setup. Reload and try again.");f(e.secret)}}).catch(t=>{x(e(t,"Unable to start setup."))}).finally(()=>{h(!1)})},children:d?"Preparing setup…":"Set up authenticator"})]}),!0===i&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"text-sm",children:"Two-factor authentication is enabled."}),(0,t.jsx)("h2",{className:"mt-6",children:"Recovery codes"}),(0,t.jsx)("p",{className:"text-sm",children:"Save these codes somewhere safe. Each code can be used once if you lose access to your authenticator. Generating new codes replaces your previous codes."}),(0,t.jsx)("div",{className:"mb-4",children:(0,t.jsx)(u.F,{submitLabel:"Show recovery codes",onSubmit:async()=>{let e=await r.V.auth.recoveryCodes.query();return 0===e.unused_codes.length?"These codes have already been shown. Use your saved copy or generate new codes.":(p(e.unused_codes),"Store these codes somewhere safe.")},children:null})}),(0,t.jsx)(u.F,{submitLabel:"Generate new recovery codes",onSubmit:async()=>(p((await r.V.auth.generateRecoveryCodes.mutate()).unused_codes),"Store your recovery codes before leaving this page."),children:null}),y.length>0&&(0,t.jsx)("pre",{className:"mt-4 overflow-x-auto rounded bg-slate-100 p-4","aria-label":"Recovery codes",children:y.join("\n")}),(0,t.jsxs)("details",{className:"mt-8 border-t border-slate-200 pt-4",children:[(0,t.jsx)("summary",{className:"cursor-pointer text-sm font-medium",children:"Disable two-factor authentication"}),(0,t.jsx)("p",{className:"text-sm",children:"Your next sign-in will require only your password. Confirm your identity below if requested."}),(0,t.jsx)(u.F,{submitLabel:"Disable two-factor authentication",onSubmit:async()=>(await r.V.auth.disableTotp.mutate(),c(!1),p([]),"Two-factor authentication disabled."),children:null})]})]})]})}e.s(["TwoFactor",0,function(){return(0,t.jsx)(i.f,{title:"Two-factor authentication",description:"Protect your account with an authenticator and recovery codes.",showAccountNavigation:!0,children:(0,t.jsx)(c.f,{children:(0,t.jsx)(d,{})})})}])},18879,e=>{"use strict";e.s(["f",0,function(e,t){let a=e.get(t);return"string"==typeof a?a:""}])}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,22016,(e,t,r)=>{"use strict";e.i(47167),Object.defineProperty(r,"__esModule",{value:!0});var n={default:function(){return g},useLinkStatus:function(){return v}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let a=e.r(90809),l=e.r(18050),u=a._(e.r(71645)),i=e.r(95057),s=e.r(8372),c=e.r(18581),d=e.r(18967),f=e.r(5550),p=e.r(88540),h=e.r(91949),m=e.r(73668),y=e.r(9396);function g(t){var r;let n,o,a,[g,v]=(0,u.useOptimistic)(h.IDLE_LINK_STATUS),x=(0,u.useRef)(null),{href:j,as:P,children:_,prefetch:S=null,passHref:C,replace:O,shallow:T,scroll:w,onClick:R,onMouseEnter:M,onTouchStart:E,legacyBehavior:N=!1,onNavigate:F,transitionTypes:A,ref:k,unstable_dynamicOnHover:L,...B}=t;n=_,N&&("string"==typeof n||"number"==typeof n)&&(n=(0,l.jsx)("a",{children:n}));let I=u.default.useContext(s.AppRouterContext),D=!1!==S,U=!1===S?"none":!0===S?"full":"auto",K="none"!==U?"auto"===U?y.FetchStrategy.PPR:y.FetchStrategy.Full:y.FetchStrategy.PPR,H="string"==typeof(r=P||j)?r:(0,i.formatUrl)(r);if(N){if(n?.$$typeof===Symbol.for("react.lazy"))throw Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag.");o=u.default.Children.only(n)}let $=N?o&&"object"==typeof o&&o.ref:k,V,z=u.default.useCallback(e=>(null!==I&&(x.current=(0,h.mountLinkInstance)(e,H,I,K,D,v,V)),()=>{x.current&&((0,h.unmountLinkForCurrentNavigation)(x.current),x.current=null),(0,h.unmountPrefetchableInstance)(e)}),[D,H,I,K,v,V]),W={ref:(0,c.useMergedRef)(z,$),onClick(t){N||"function"!=typeof R||R(t),N&&o.props&&"function"==typeof o.props.onClick&&o.props.onClick(t),!I||t.defaultPrevented||function(t,r,n,o,a,l,u,i="none"){if("u">typeof window){let s,{nodeName:c}=t.currentTarget;if("A"===c.toUpperCase()&&((s=t.currentTarget.getAttribute("target"))&&"_self"!==s||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,m.isLocalURL)(r)){o&&(t.preventDefault(),location.replace(r));return}if(t.preventDefault(),l){let e=!1;if(l({preventDefault:()=>{e=!0}}),e)return}let{navigate:d}=e.r(32916);d(r,o?"replace":"push",!1===a?p.ScrollBehavior.NoScroll:p.ScrollBehavior.Default,n.current,u,i)}}(t,H,x,O,w,F,A,U)},onMouseEnter(e){N||"function"!=typeof M||M(e),N&&o.props&&"function"==typeof o.props.onMouseEnter&&o.props.onMouseEnter(e),I&&D&&(0,h.onNavigationIntent)(e.currentTarget,!0===L)},onTouchStart:function(e){N||"function"!=typeof E||E(e),N&&o.props&&"function"==typeof o.props.onTouchStart&&o.props.onTouchStart(e),I&&D&&(0,h.onNavigationIntent)(e.currentTarget,!0===L)}};return(0,d.isAbsoluteUrl)(H)?W.href=H:N&&!C&&("a"!==o.type||"href"in o.props)||(W.href=(0,f.addBasePath)(H)),a=N?u.default.cloneElement(o,W):(0,l.jsx)("a",{...B,...W,children:n}),(0,l.jsx)(b.Provider,{value:g,children:a})}let b=(0,u.createContext)(h.IDLE_LINK_STATUS),v=()=>(0,u.useContext)(b);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},28298,(e,t,r)=>{"use strict";e.i(47167),Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useRouterBFCache",{enumerable:!0,get:function(){return o}});let n=e.r(71645);function o(e,t,r){let[o,a]=(0,n.useState)(()=>({tree:e,renderTree:t,stateKey:r,next:null}));if(o.tree===e)return o;let l={tree:e,renderTree:t,stateKey:r,next:null},u=1,i=o,s=l;for(;null!==i&&u<1;){if(i.stateKey===r){s.next=i.next;break}{u++;let e={tree:i.tree,renderTree:i.renderTree,stateKey:i.stateKey,next:null};s.next=e,s=e}i=i.next}return a(l),l}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},15783,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={createClientParams:function(){return a.createRenderParamsFromClient},createClientSearchParams:function(){return l.createRenderSearchParamsFromClient}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let a=e.r(97689),l=e.r(66996);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},47257,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"ClientPageRoot",{enumerable:!0,get:function(){return s}});let n=e.r(18050),o=e.r(8372),a=e.r(71645),l=e.r(33906),u=e.r(61994),i=e.r(15783);function s({Component:e,serverProvidedParams:t}){let r,c;if(null!==t)r=t.searchParams,c=t.params;else{let e=(0,a.use)(o.LayoutRouterContext);c=null!==e?e.parentParams:{},r=(0,l.urlSearchParamsToParsedUrlQuery)((0,a.use)(u.SearchParamsContext))}let d=(0,i.createClientSearchParams)(r),f=(0,i.createClientParams)(c);return(0,n.jsx)(e,{params:f,searchParams:d})}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},92825,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"ClientSegmentRoot",{enumerable:!0,get:function(){return u}});let n=e.r(18050),o=e.r(8372),a=e.r(71645),l=e.r(15783);function u({Component:e,slots:t,serverProvidedParams:r}){let i;if(null!==r)i=r.params;else{let e=(0,a.use)(o.LayoutRouterContext);i=null!==e?e.parentParams:{}}let s=(0,l.createClientParams)(i);return(0,n.jsx)(e,{...t,params:s})}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},68017,(e,t,r)=>{"use strict";e.i(47167),Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"HTTPAccessFallbackBoundary",{enumerable:!0,get:function(){return c}});let n=e.r(90809),o=e.r(18050),a=n._(e.r(71645)),l=e.r(90373),u=e.r(54394),i=e.r(8372);class s extends a.default.Component{constructor(e){super(e),this.state={triggeredStatus:void 0,previousPathname:e.pathname}}componentDidCatch(){}static getDerivedStateFromError(e){if((0,u.isHTTPAccessFallbackError)(e))return{triggeredStatus:(0,u.getAccessFallbackHTTPStatus)(e)};throw e}static getDerivedStateFromProps(e,t){return e.pathname!==t.previousPathname&&t.triggeredStatus?{triggeredStatus:void 0,previousPathname:e.pathname}:{triggeredStatus:t.triggeredStatus,previousPathname:e.pathname}}render(){let{notFound:e,forbidden:t,unauthorized:r,children:n}=this.props,{triggeredStatus:a}=this.state,l={[u.HTTPAccessErrorStatus.NOT_FOUND]:e,[u.HTTPAccessErrorStatus.FORBIDDEN]:t,[u.HTTPAccessErrorStatus.UNAUTHORIZED]:r};if(a){let i=a===u.HTTPAccessErrorStatus.NOT_FOUND&&e,s=a===u.HTTPAccessErrorStatus.FORBIDDEN&&t,c=a===u.HTTPAccessErrorStatus.UNAUTHORIZED&&r;return i||s||c?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("meta",{name:"robots",content:"noindex"}),!1,l[a]]}):n}return n}}function c({notFound:e,forbidden:t,unauthorized:r,children:n}){let u=(0,l.useUntrackedPathname)(),d=(0,a.useContext)(i.MissingSlotContext);return e||t||r?(0,o.jsx)(s,{pathname:u,notFound:e,forbidden:t,unauthorized:r,missingSlots:d,children:n}):(0,o.jsx)(o.Fragment,{children:n})}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},77694,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={InstantValidationBoundaryContext:function(){return a.InstantValidationBoundaryContext},PlaceValidationBoundaryBelowThisLevel:function(){return a.PlaceValidationBoundaryBelowThisLevel},RenderValidationBoundaryAtThisLevel:function(){return a.RenderValidationBoundaryAtThisLevel},SlotMarker:function(){return a.SlotMarker}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let a=e.r(22976);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},22976,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={InstantValidationBoundaryContext:function(){return a},PlaceValidationBoundaryBelowThisLevel:function(){return l},RenderValidationBoundaryAtThisLevel:function(){return u},SlotMarker:function(){return i}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let a=null,l=null,u=null,i=null;("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},39756,(e,t,r)=>{"use strict";e.i(47167),Object.defineProperty(r,"__esModule",{value:!0});var n={LoadingBoundaryProvider:function(){return _},default:function(){return C}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let a=e.r(90809),l=e.r(18050),u=a._(e.r(71645)),i=e.r(8372),s=e.r(1244),c=e.r(72383),d=e.r(91915),f=e.r(58442),p=e.r(68017);e.r(77694);let h=e.r(27828),m=e.r(28298);e.r(74180);let y=e.r(61994),g=e.r(33906),b=e.r(24988);function v(e,t,r){let n=e.getClientRects();if(0===n.length)return 0;let o=1/0;for(let e=0;e<n.length;e++){let t=n[e];t.top<o&&(o=t.top)}return o>=r()&&o<=t?1:2}function x(e){let t=u.default.useRef(null);return(0,u.useLayoutEffect)(()=>{let{scrollRef:r,renderTree:n}=e,o=r.forceScroll?r.scrollRef:n.data.scrollRef;if(null===o||!o.current)return;let a=null,l=r.hashFragment;if(l){if(null===(a="top"===l?document.body:document.getElementById(l)??document.getElementsByName(l)[0]??null)){o.current=!1,r.onlyHashChange=!1,r.hashFragment=null;return}}else a=t.current;if(null===a)return;let u=!1;(0,d.disableSmoothScrollDuringRouteTransition)(()=>{let e=document.documentElement,t=null,r=null,n=null,i=()=>{var r;let o,a;return null===n&&(r=t,n=!Number.isFinite(a=Number.parseFloat(o=getComputedStyle(e).scrollPaddingTop))||a<0?0:o.endsWith("px")?a:o.endsWith("%")?a/100*r:0),n};(l||(t=e.clientHeight,0!==(r=v(a,t,i))))&&((u=!0,o.current=!1,l)?a.scrollIntoView():1!==r&&(e.scrollTop=0,2===v(a,t,i)&&a.scrollIntoView()))},{dontForceLayout:!0,onlyHashChange:r.onlyHashChange}),u&&(r.onlyHashChange=!1,r.hashFragment=null)},void 0),(0,l.jsx)(u.Fragment,{ref:t,children:e.children})}function j({children:e,renderTree:t}){let r=(0,u.useContext)(i.GlobalLayoutRouterContext);if(!r)throw Error("invariant global layout router not mounted");return(0,l.jsx)(x,{scrollRef:r.scrollRef,renderTree:t,children:e})}function P({tree:e,segmentPath:t,debugNameContext:r,renderTree:n,params:o,url:a,isActive:c}){let d,f=(0,u.useContext)(i.GlobalLayoutRouterContext);if((0,u.useContext)(y.NavigationPromisesContext),!f)throw Error("invariant global layout router not mounted");let p=null!==n.data.prefetchRsc?n.data.prefetchRsc:n.data.rsc,h=(0,u.useDeferredValue)(n.data.rsc,p);if((0,b.isDeferredRsc)(h)){let e=(0,u.use)(h);null===e&&(0,u.use)(s.unresolvedThenable),d=e}else null===h&&(0,u.use)(s.unresolvedThenable),d=h;let m=d;return(0,l.jsx)(i.LayoutRouterContext.Provider,{value:{parentTree:e,parentRenderTree:n,parentSegmentPath:t,parentParams:o,parentLoadingData:null,debugNameContext:r,url:a,isActive:c},children:m})}function _({loading:e,children:t}){let r=(0,u.use)(i.LayoutRouterContext);return null===r?t:(0,l.jsx)(i.LayoutRouterContext.Provider,{value:{parentTree:r.parentTree,parentRenderTree:r.parentRenderTree,parentSegmentPath:r.parentSegmentPath,parentParams:r.parentParams,parentLoadingData:e,debugNameContext:r.debugNameContext,url:r.url,isActive:r.isActive},children:t})}function S({name:e,loading:t,children:r}){if(null!==t){let n=t[0],o=t[1],a=t[2];return(0,l.jsx)(u.Suspense,{name:e,fallback:(0,l.jsxs)(l.Fragment,{children:[o,a,n]}),children:r})}return(0,l.jsx)(l.Fragment,{children:r})}function C({parallelRouterKey:e,error:t,errorStyles:r,errorScripts:n,templateStyles:o,templateScripts:a,template:d,notFound:y,forbidden:b,unauthorized:v,segmentViewBoundaries:x}){let _=(0,u.useContext)(i.LayoutRouterContext);if(!_)throw Error("invariant expected layout router to be mounted");let{parentTree:O,parentRenderTree:T,parentSegmentPath:w,parentParams:R,parentLoadingData:M,url:E,isActive:N,debugNameContext:F}=_,A=O[0],k=null===w?[e]:w.concat([A,e]),L=O[1][e],B=T.slots?.get(e);(void 0===L||void 0===B)&&(0,u.use)(s.unresolvedThenable);let I=L[0],D=(0,h.createSegmentKey)(I),U=(0,m.useRouterBFCache)(L,B,D),K=[];do{let e=U.tree,u=U.renderTree,s=U.stateKey,h=e[0],m=R;if(Array.isArray(h)){let e=h[0],t=h[1],r=h[2],n=(0,g.getParamValueFromCacheKey)(t,r);null!==n&&(m={...R,[e]:n})}let x=function(e){if("/"===e)return"/";if("string"==typeof e)if("(__SLOT__)"===e)return;else return e+"/";return e[1]+"/"}(h),_=x??F,C=void 0===x?void 0:F,O=(0,l.jsxs)(j,{renderTree:u,children:[(0,l.jsx)(c.ErrorBoundary,{errorComponent:t,errorStyles:r,errorScripts:n,children:(0,l.jsx)(S,{name:C,loading:M,children:(0,l.jsx)(p.HTTPAccessFallbackBoundary,{notFound:y,forbidden:b,unauthorized:v,children:(0,l.jsxs)(f.RedirectBoundary,{children:[(0,l.jsx)(P,{url:E,tree:e,params:m,renderTree:u,segmentPath:k,debugNameContext:_,isActive:N&&s===D}),null]})})})}),null]}),T=(0,l.jsxs)(i.TemplateContext.Provider,{value:O,children:[o,a,d]},s);K.push(T),U=U.next}while(null!==U)return K}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},37457,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return u}});let n=e.r(90809),o=e.r(18050),a=n._(e.r(71645)),l=e.r(8372);function u(){let e=(0,a.useContext)(l.TemplateContext);return(0,o.jsx)(o.Fragment,{children:e})}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},97689,(e,t,r)=>{"use strict";e.i(47167),Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"createRenderParamsFromClient",{enumerable:!0,get:function(){return n}});let n=e.r(6831).createRenderParamsFromClient;("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},6831,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"createRenderParamsFromClient",{enumerable:!0,get:function(){return o}});let n=new WeakMap;function o(e){let t=n.get(e);if(t)return t;let r=Promise.resolve(e);return r.status="fulfilled",r.value=e,n.set(e,r),r}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},66996,(e,t,r)=>{"use strict";e.i(47167),Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"createRenderSearchParamsFromClient",{enumerable:!0,get:function(){return n}});let n=e.r(93504).createRenderSearchParamsFromClient;("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},93504,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"createRenderSearchParamsFromClient",{enumerable:!0,get:function(){return o}});let n=new WeakMap;function o(e){let t=n.get(e);if(t)return t;let r=Promise.resolve(e);return r.status="fulfilled",r.value=e,n.set(e,r),r}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},18581,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useMergedRef",{enumerable:!0,get:function(){return o}});let n=e.r(71645);function o(e,t){let r=(0,n.useRef)(null),o=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=r.current;e&&(r.current=null,e());let t=o.current;t&&(o.current=null,t())}else e&&(r.current=a(e,n)),t&&(o.current=a(t,n))},[e,t])}function a(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},27201,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"IconMark",{enumerable:!0,get:function(){return o}});let n=e.r(18050),o=()=>"u">typeof window?null:(0,n.jsx)("meta",{name:"«nxt-icon»"})},91915,(e,t,r)=>{"use strict";function n(e,t={}){if(t.onlyHashChange)return void e();let r=document.documentElement;if("smooth"!==r.dataset.scrollBehavior)return void e();let o=r.style.scrollBehavior;r.style.scrollBehavior="auto",t.dontForceLayout||r.getClientRects(),e(),r.style.scrollBehavior=o}e.i(47167),Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"disableSmoothScrollDuringRouteTransition",{enumerable:!0,get:function(){return n}})},95057,(e,t,r)=>{"use strict";e.i(47167),Object.defineProperty(r,"__esModule",{value:!0});var n={formatUrl:function(){return u},formatWithValidation:function(){return s},urlObjectKeys:function(){return i}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let a=e.r(90809)._(e.r(98183)),l=/https?|ftp|gopher|file/;function u(e){let{auth:t,hostname:r}=e,n=e.protocol||"",o=e.pathname||"",u=e.hash||"",i=e.query||"",s=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?s=t+e.host:r&&(s=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(s+=":"+e.port)),i&&"object"==typeof i&&(i=String(a.urlQueryToSearchParams(i)));let c=e.search||i&&`?${i}`||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||l.test(n))&&!1!==s?(s="//"+(s||""),o&&"/"!==o[0]&&(o="/"+o)):s||(s=""),u&&"#"!==u[0]&&(u="#"+u),c&&"?"!==c[0]&&(c="?"+c),o=o.replace(/[?#]/g,encodeURIComponent),c=c.replace("#","%23"),`${n}${s}${o}${c}${u}`}let i=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function s(e){return u(e)}},73668,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return a}});let n=e.r(18967),o=e.r(52817);function a(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,o.hasBasePath)(r.pathname)}catch(e){return!1}}},18967,(e,t,r)=>{"use strict";e.i(47167),Object.defineProperty(r,"__esModule",{value:!0});var n={DecodeError:function(){return g},MiddlewareNotFoundError:function(){return j},MissingStaticPage:function(){return x},NormalizeError:function(){return b},PageNotFoundError:function(){return v},SP:function(){return m},ST:function(){return y},WEB_VITALS:function(){return a},execOnce:function(){return l},getDisplayName:function(){return d},getLocationOrigin:function(){return s},getURL:function(){return c},isAbsoluteUrl:function(){return i},isResSent:function(){return f},loadGetInitialProps:function(){return h},normalizeRepeatedSlashes:function(){return p},stringifyError:function(){return P}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let a=["CLS","FCP","INP","LCP","TTFB"];function l(e){let t,r=!1;return(...n)=>(r||(r=!0,t=e(...n)),t)}let u=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,i=e=>{let t=e.charCodeAt(0);return!!(t>=65&&t<=90||t>=97&&t<=122)&&u.test(e)};function s(){let{protocol:e,hostname:t,port:r}=window.location;return`${e}//${t}${r?":"+r:""}`}function c(){let{href:e}=window.location,t=s();return e.substring(t.length)}function d(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function f(e){return e.finished||e.headersSent}function p(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")}async function h(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await h(t.Component,t.ctx)}:{};let n=await e.getInitialProps(t);if(r&&f(r))return n;if(!n)throw Error(`"${d(e)}.getInitialProps()" should resolve to an object. But found "${n}" instead.`);return n}let m="u">typeof performance,y=m&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class g extends Error{}class b extends Error{}class v extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class x extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class j extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function P(e){return JSON.stringify({message:e.message,stack:e.stack})}},11382,68217,e=>{"use strict";var t=e.i(22219);e.s(["z",0,t],11382),e.s(["z",0,t],68217)},15448,e=>{"use strict";var t=e.i(18050),r=e.i(22016),n=e.i(2716);e.s(["f",0,function({title:e,description:o,children:a,showAccountNavigation:l=!1}){return(0,t.jsxs)("div",{className:"min-h-screen",children:[(0,t.jsxs)("header",{className:"flex items-center justify-between border-b border-slate-200 bg-white px-6 py-4 sm:px-10",children:[(0,t.jsxs)(r.default,{href:"/",className:"flex items-center gap-2 text-lg font-semibold text-slate-900",children:[(0,t.jsx)(n.f,{className:"h-9 w-9"}),"OrgSDK"]}),(0,t.jsx)(r.default,{href:"/",className:"text-sm",children:"Back to app"})]}),(0,t.jsxs)("main",{className:"mx-auto w-full max-w-xl px-4 py-10 sm:py-16",children:[l&&(0,t.jsxs)("nav",{"aria-label":"Account",className:"mb-6 flex flex-wrap gap-4 text-sm",children:[(0,t.jsx)(r.default,{href:"/accounts/email/",children:"Account"}),(0,t.jsx)(r.default,{href:"/accounts/password/change/",children:"Password"}),(0,t.jsx)(r.default,{href:"/accounts/2fa/",children:"Two-factor authentication"}),(0,t.jsx)(r.default,{href:"/accounts/logout/",children:"Sign out"})]}),(0,t.jsxs)("section",{className:"panel",children:[(0,t.jsx)("h1",{className:"!text-2xl",children:e}),o&&(0,t.jsx)("p",{className:"mb-6 text-sm",children:o}),a]})]})]})}])},42468,e=>{"use strict";var t=e.i(18050),r=e.i(19455),n=e.i(93479),o=e.i(71645),a=e.i(15448),l=e.i(11382),u=e.i(68217),i=e.i(73656);let s="orgsdk:studio-pairing",c="orgsdk:studio-installation",d=Array.from({length:8},(e,t)=>28940+t);function f(e){let t=new URL(e),r=["localhost","127.0.0.1","[::1]"].includes(t.hostname);if("https:"!==t.protocol&&!(r&&"http:"===t.protocol)||t.origin===location.origin||t.username||t.password||"/"!==t.pathname||t.search||t.hash)throw Error("Enter an HTTPS server origin, or a local loopback address.");return t.origin}function p(e){return(0,i.u)({url:e+"/trpc",csrfToken:()=>"",fetch:(e,t)=>fetch(e,{...t,redirect:"error",credentials:"omit"})})}async function h(e){let t=f(e),r=await p(t).studio.discover.query(void 0,{signal:AbortSignal.timeout(2500)});if(!l.z.object({product:u.z.literal("orgsdk"),protocol:u.z.literal(1),audience:u.z.literal(location.origin)}).safeParse(r).success)throw Error("This installation does not support this version of Studio.");return t}async function m(){let e=d.map(e=>"http://127.0.0.1:"+String(e)),t=localStorage.getItem(c);return t&&e.includes(t)&&e.unshift(...e.splice(e.indexOf(t),1)),(await Promise.allSettled(e.map(e=>h(e)))).filter(e=>"fulfilled"===e.status).map(e=>e.value)}function y(e){return Array.from(e,e=>e.toString(16).padStart(2,"0")).join("")}async function g(e){let t=await h(e),r=y(crypto.getRandomValues(new Uint8Array(32))),n=y(new Uint8Array(await crypto.subtle.digest("SHA-256",new TextEncoder().encode(r))));sessionStorage.setItem(s,JSON.stringify({endpoint:t,verifier:r,until:Date.now()+6e5})),location.assign(t+"/studio/approve/#"+n)}async function b(){let e=new URLSearchParams(location.hash.slice(1)).get("code");if(!e)return!1;history.replaceState(history.state,"",location.pathname+location.search);let t=sessionStorage.getItem(s);if(sessionStorage.removeItem(s),!t)throw Error("Start a new connection from this tab.");let r=JSON.parse(t);if(null===r||"object"!=typeof r||!("endpoint"in r)||"string"!=typeof r.endpoint||!("verifier"in r)||"string"!=typeof r.verifier||!("until"in r)||"number"!=typeof r.until||r.until<Date.now())throw Error("Connection request expired. Connect again.");let n=f(r.endpoint),o=await p(n).studio.exchange.mutate({code:e,verifier:r.verifier});return(0,i.T)(n,o.token),localStorage.setItem(c,n),o.expiresAt}e.s(["StudioConnection",0,function({children:e}){let[l,u]=(0,o.useState)(!1),[i,s]=(0,o.useState)(!1),[d,f]=(0,o.useState)(""),[p,h]=(0,o.useState)([]),[y,v]=(0,o.useState)(!1),[x,j]=(0,o.useState)(""),P=(0,o.useRef)(null);async function _(e){v(!0),j("");try{await e()}catch(e){j(e instanceof Error?e.message:"Connection failed.")}finally{v(!1)}}return((0,o.useEffect)(()=>{let e,t=!0;return P.current??=b(),P.current.then(r=>{t&&(f(new URLSearchParams(location.search).get("server")??localStorage.getItem(c)??""),!1!==r&&(u(!0),e=setTimeout(()=>{s(!0)},Math.max(0,r-Date.now()))))}).catch(e=>{t&&j(e instanceof Error?e.message:"Connection failed.")}),()=>{t=!1,clearTimeout(e)}},[]),l)?(0,t.jsxs)(t.Fragment,{children:[i&&(0,t.jsxs)("aside",{role:"alert",className:"panel",children:[(0,t.jsx)("p",{children:"Your dashboard session has expired. Copy any unsaved edits before reconnecting."}),(0,t.jsx)(r.f,{onClick:()=>{location.reload()},children:"Reconnect"})]}),e]}):(0,t.jsxs)(a.f,{title:"Connect to OrgSDK",description:"Choose the computer or hosted installation that owns your workspace.",children:[(0,t.jsx)(r.f,{disabled:y,type:"button",onClick:()=>void _(async()=>{let e=await m();if(h(e),0===e.length)throw Error("No compatible local installation responded. Start OrgSDK and allow this site to connect to your computer, or open the local address printed by OrgSDK.");1===e.length&&e[0]&&await g(e[0])}),children:"Connect to this computer"}),p.length>1&&(0,t.jsxs)("section",{children:[(0,t.jsx)("h2",{children:"Choose an installation"}),p.map(e=>(0,t.jsx)(r.f,{disabled:y,onClick:()=>void _(()=>g(e)),children:e},e))]}),(0,t.jsxs)("form",{className:"mt-6 space-y-3",onSubmit:e=>{e.preventDefault(),_(()=>g(d))},children:[(0,t.jsxs)("label",{className:"block",children:["Server address",(0,t.jsx)(n.f,{type:"url",required:!0,value:d,placeholder:"https://workspace.example.com",onChange:e=>{f(e.target.value)}})]}),(0,t.jsx)(r.f,{variant:"outline",disabled:y,type:"submit",children:"Connect to server"})]}),y&&(0,t.jsx)("p",{role:"status",children:"Connecting…"}),x&&(0,t.jsx)("p",{role:"alert",className:"error",children:x})]})}],42468)},93479,e=>{"use strict";var t=e.i(18050),r=e.i(71645),n=e.i(39689);let o=r.forwardRef(({className:e,type:r,...o},a)=>(0,t.jsx)("input",{type:r,className:(0,n.f)("flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:a,...o}));o.displayName="Input",e.s(["f",0,o])},2716,e=>{"use strict";var t=e.i(18050);e.s(["f",0,function({className:e,...r}){return(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 64 64",fill:"none","aria-hidden":"true",className:e,...r,children:[(0,t.jsx)("circle",{cx:"32",cy:"32",r:"19",stroke:"#4f46e5",strokeWidth:"12"}),(0,t.jsx)("circle",{cx:"50",cy:"14",r:"6",fill:"#8b5cf6"})]})}])}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,51757,e=>{"use strict";var t=e.i(56420);let s={name:"circle-check",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 9-5.5 5.5L8 12",key:"xofnsj"}]],aliases:["check-circle-2"]};s.node;let n=(0,t.f)(s);e.s(["f",0,n],51757)},59659,e=>{"use strict";var t=e.i(56420);let s={name:"trash",size:24,node:[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],aliases:["trash-2"]};s.node;let n=(0,t.f)(s);e.s(["f",0,n],59659)},13581,29487,e=>{"use strict";var t=e.i(71645),s=e.i(95813);e.s(["f",0,function(e,n=0){let[a,i]=(0,t.useState)(),[r,c]=(0,t.useState)(""),[o,l]=(0,t.useState)(!0),d=(0,t.useRef)(void 0),u=(0,t.useRef)(!1),h=(0,t.useCallback)(async()=>{d.current?.abort();let t=new AbortController;d.current=t;try{let s=await e(t.signal);if(t.signal.aborted||!u.current)return;i(s),c("")}catch(e){!t.signal.aborted&&u.current&&c((0,s.f)(e))}finally{!t.signal.aborted&&u.current&&l(!1)}},[e]);return(0,t.useEffect)(()=>{u.current=!0,queueMicrotask(()=>{u.current&&h()});let e=n>0?setInterval(()=>{h()},n):void 0;return()=>{u.current=!1,d.current?.abort(),clearInterval(e)}},[h,n]),{data:a,error:r,isLoading:o,refresh:h}}],13581);var n=e.i(18050),a=e.i(19455);e.s(["f",0,function({isLoading:e,error:t,refresh:s}){return(0,n.jsxs)(n.Fragment,{children:[e?(0,n.jsx)("p",{role:"status",children:"Loading workspace data…"}):void 0,t?(0,n.jsxs)("div",{className:"error",role:"alert",children:[(0,n.jsx)("p",{children:t}),(0,n.jsx)(a.f,{variant:"outline",onClick:()=>{s()},children:"Try again"})]}):void 0]})}],29487)},16271,e=>{"use strict";var t=e.i(18050),s=e.i(67965),n=e.i(56420);let a={name:"copy",size:24,node:[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]};a.node;let i=(0,n.f)(a);var r=e.i(58925);let c={name:"plug",size:24,node:[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]]};c.node;let o=(0,n.f)(c);var l=e.i(59659),d=e.i(71645),u=e.i(73656),h=e.i(95813),p=e.i(15080),j=e.i(13581),v=e.i(19455),x=e.i(93479),m=e.i(29487),f=e.i(87309),g=e.i(94757),k=e.i(59037),y=e.i(75016),b=e.i(10505);let C=[["catalog:read","Discover granted projects, actions and SDK"],["code:execute","Execute one-off code in selected projects"],["actions:write","Create and version actions in selected projects"],["actions:run","Execute granted saved actions"],["actions:test","Run isolated mocked action tests"],["runs:read","Inspect this client's own runs"],["runs:cancel","Cancel this client's own runs"]],w=C.map(([e])=>e),N=["catalog:read","actions:run","runs:read","runs:cancel"];async function _(e,t){let[s,n]=await Promise.all([(0,p.q)(e),(0,p.t)(e)]),a=await Promise.all(n.filter(e=>e.project===t).map(async t=>(await u.V.actions.versions.query({id:t.id},{signal:e})).map(e=>({...e,actionName:t.name,project:t.project}))));return{projects:s.filter(e=>e.id===t),versions:a.flat()}}function S(e,t,s){return s?[...e,t]:e.filter(e=>e!==t)}function M({canManage:e,navigate:n}){let{selected:a,projects:c,setDirty:P}=(0,g.useWorkspace)(),z=(0,j.f)(p.h),q=(0,d.useCallback)(e=>_(e,a),[a]),T=(0,j.f)(q),A=new Set(T.data?.versions.map(e=>e.id)),R=(z.data??[]).filter(e=>e.projects.includes(a)||e.action_versions.some(e=>A.has(e))),L=c.find(e=>e.id===a)?.name??"this project",[E,$]=(0,d.useState)(a?[a]:[]),[V,O]=(0,d.useState)([]),[D,U]=(0,d.useState)("projects"),B=(0,f.h)(),[H,I]=(0,d.useState)(""),[K,F]=(0,d.useState)(w),[G,J]=(0,d.useState)(""),[W,Y]=(0,d.useState)(!1),[Q,X]=(0,d.useState)(""),[Z,ee]=(0,d.useState)("");(0,k.f)(""!==H.trim()||""!==G,P);let et=async e=>{Y(!0),X(""),ee("");try{await e(),await z.refresh()}catch(e){X((0,h.f)(e))}finally{Y(!1)}};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("section",{className:"panel",children:[(0,t.jsxs)("h2",{children:[(0,t.jsx)(s.f,{size:18})," Connect an agent over MCP"]}),(0,t.jsxs)("p",{children:["Choose what your agent can do in ",L,", then add the MCP connection to its client. Your project controls the actions, plugins and workspace data available to it."]}),(0,t.jsxs)("div",{className:"my-4 flex flex-wrap gap-4 text-sm",children:[(0,t.jsx)(y.f,{href:`/projects/?${new URLSearchParams({project:a,tab:"access"}).toString()}`,children:"Review data access"}),(0,t.jsx)(y.f,{href:`/plugins/?${new URLSearchParams({project:a}).toString()}`,children:"Manage project plugins"})]}),(0,t.jsxs)("div",{className:"two-columns",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{children:"1. Create a scoped token"}),(0,t.jsx)("p",{className:"small",children:"Give each client its own token. Select only the access it needs, then save the token in that client."})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{children:"2. Configure your client"}),(0,t.jsxs)("p",{className:"small",children:["Use this workspace domain with the MCP endpoint ",(0,t.jsx)("code",{children:"/mcp/"}),", or the typed tRPC API at ",(0,t.jsx)("code",{children:"/trpc"}),". Send the token as"," ",(0,t.jsx)("code",{children:"Authorization: Bearer <token>"}),"."]}),(0,t.jsxs)(v.f,{variant:"outline",onClick:()=>{navigator.clipboard.writeText(`${(0,u.U)()}/mcp/`).then(()=>{ee("MCP endpoint copied.")}).catch(()=>{X("Could not copy. Use this workspace domain followed by /mcp/.")})},children:[(0,t.jsx)(i,{size:13}),"Copy MCP endpoint"]})]})]}),(0,t.jsx)("p",{className:"small",children:"Activity reflects requests observed locally since tracking began, not whether a client is online. Recently used means a request in the last seven days; inactive means no request in that window. Never used means no observed request, including tokens issued before tracking began."})]}),(0,t.jsxs)("section",{className:"panel",children:[(0,t.jsxs)("div",{className:"panel-title",children:[(0,t.jsxs)("h2",{children:["Clients with access to ",L]}),(0,t.jsx)(v.f,{variant:"outline",size:"sm",onClick:()=>{z.refresh()},children:"Refresh activity"})]}),(0,t.jsx)(m.f,{...z}),(0,t.jsx)(m.f,{...T}),z.data?(0,t.jsxs)("p",{className:"small",children:[R.filter(e=>!e.revoked&&e.request_count>0).length," ","current tokens used ·"," ",R.filter(e=>!e.revoked&&0===e.request_count).length," ","never observed · ",R.filter(e=>e.revoked).length," ","revoked"]}):void 0,z.isLoading||T.isLoading||z.error||T.error||0!==R.length?void 0:(0,t.jsx)("p",{children:"No clients have been granted access to this project yet."}),R.map(s=>(0,t.jsxs)("div",{className:"resource-row",children:[(0,t.jsx)(r.f,{size:17}),(0,t.jsxs)("div",{children:[(0,t.jsx)("strong",{children:s.name}),(0,t.jsxs)("small",{children:["Scoped client token · ",(0,b.A)(s.scopes)," ·"," ",s.activity_state.replaceAll("_"," ")]}),(0,t.jsxs)("small",{children:["Projects:"," ",s.projects.map(e=>T.data?.projects.find(t=>t.id===e)?.name??e).join(", ")||"None"]}),(0,t.jsxs)("small",{children:["Exact action versions:"," ",s.action_versions.map(e=>{let t=T.data?.versions.find(t=>t.id===e);return t?`${t.actionName} \xb7 version ${String(t.number)}`:e}).join(", ")||"None"]}),(0,t.jsxs)("small",{children:[s.request_count," requests · ",s.success_count," successful · ",s.error_count," errors · ",s.trpc_request_count," tRPC ·"," ",s.mcp_request_count," MCP"]}),(0,t.jsxs)("small",{children:["First observed:"," ",s.first_used_at?new Date(s.first_used_at).toLocaleString():"Never"," ","· Last observed:"," ",s.last_used_at?new Date(s.last_used_at).toLocaleString():"Never"]}),s.last_used_at?(0,t.jsxs)("small",{children:["Last outcome: ",s.last_outcome," · ",s.last_transport," · HTTP ",s.last_status_code]}):void 0]}),e&&!s.revoked?(0,t.jsxs)(v.f,{variant:"outline",size:"sm",disabled:W,onClick:()=>{et(async()=>{await B({title:"Revoke this client's access?",description:"The client will no longer be able to use this workspace with its token.",actionLabel:"Revoke token"})&&(await u.V.tokens.revoke.mutate({id:s.id}),ee("Client token revoked."))})},children:[(0,t.jsx)(l.f,{size:13}),"Revoke"]}):void 0]},s.id))]}),(0,t.jsx)("p",{className:"small",children:"Counts include requests with a valid token identity and current membership, including scope denials. Errors include HTTP failures and MCP protocol or tool errors, even with HTTP 200. Request bodies and secrets are not stored."}),e?(0,t.jsxs)("section",{className:"panel",children:[(0,t.jsx)("h2",{children:"Create access token"}),(0,t.jsxs)("form",{onSubmit:e=>{e.preventDefault(),et(async()=>{J((await u.V.tokens.create.mutate({name:H,scopes:K,projects:"projects"===D?E:[],action_versions:"versions"===D?V:[]})).token),I(""),ee("Token created. Copy it now; it will not be shown again.")})},children:[(0,t.jsxs)("label",{children:["Client name",(0,t.jsx)(x.f,{required:!0,value:H,disabled:W,onChange:e=>{I(e.target.value)},placeholder:"e.g. Local MCP client"})]}),(0,t.jsxs)("label",{children:["Permission preset",(0,t.jsxs)("select",{disabled:W,defaultValue:"author",onChange:e=>{let t="author"===e.target.value;F(t?w:N),U(t?"projects":"versions")},children:[(0,t.jsx)("option",{value:"author",children:"Authoring client — explore code, save and test actions"}),(0,t.jsx)("option",{value:"runner",children:"Action runner — execute selected saved versions"})]})]}),(0,t.jsxs)("fieldset",{children:[(0,t.jsx)("legend",{children:"Actual operations granted"}),C.map(([e,s])=>(0,t.jsxs)("label",{className:"check permission-option",children:[(0,t.jsx)(x.f,{type:"checkbox",checked:K.includes(e),disabled:W,onChange:t=>{F(s=>t.target.checked?[...s,e]:s.filter(t=>t!==e))}}),(0,t.jsxs)("span",{children:[s," ",(0,t.jsx)("code",{children:e})]})]},e))]}),(0,t.jsxs)("fieldset",{disabled:W,children:[(0,t.jsx)("legend",{children:"Resource grants"}),(0,t.jsxs)("label",{children:["Grant access to",(0,t.jsxs)("select",{value:D,onChange:e=>{U(e.target.value)},children:[(0,t.jsx)("option",{value:"projects",children:"Selected projects"}),(0,t.jsx)("option",{value:"versions",children:"Exact immutable action versions"})]})]}),(0,t.jsx)(m.f,{...T}),"projects"===D?T.data?.projects.map(e=>(0,t.jsxs)("label",{className:"check",children:[(0,t.jsx)("input",{type:"checkbox",checked:E.includes(e.id),onChange:t=>{$(s=>S(s,e.id,t.target.checked))}}),e.name]},e.id)):T.data?.versions.map(e=>(0,t.jsxs)("label",{className:"check",children:[(0,t.jsx)("input",{type:"checkbox",checked:V.includes(e.id),onChange:t=>{O(s=>S(s,e.id,t.target.checked))}}),e.actionName," · version ",e.number," ·"," ",T.data?.projects.find(t=>t.id===e.project)?.name]},e.id)),"versions"===D&&K.some(e=>["code:execute","actions:write"].includes(e))?(0,t.jsx)("p",{className:"error",children:"Code execution and action authoring require a project grant. Remove these operations or select projects."}):null,(0,t.jsx)("p",{className:"small",children:"Project grants include current and future actions in those projects. Exact-version grants permit only the versions selected here. Clients cannot manage plugins, credentials, grants or approvals. Existing keys retain their current authority until revoked."})]}),(0,t.jsx)(v.f,{type:"submit",disabled:W||!!G||0===K.length||("projects"===D?0===E.length:0===V.length||K.some(e=>["code:execute","actions:write"].includes(e))),children:"Create token"})]}),G?(0,t.jsxs)("div",{className:"issued-token",children:[(0,t.jsxs)("label",{children:["New access token",(0,t.jsx)(x.f,{type:"password",readOnly:!0,autoComplete:"off",value:G})]}),(0,t.jsxs)("p",{className:"small",children:["Configure your client’s HTTP MCP transport with this workspace’s"," ",(0,t.jsx)("code",{children:"/mcp/"})," endpoint and an"," ",(0,t.jsx)("code",{children:"Authorization: Bearer"})," header containing this token. Keep the token in the client’s secret configuration. OrgSDK does not require a model account."]}),(0,t.jsx)(v.f,{variant:"outline",onClick:()=>{navigator.clipboard.writeText(JSON.stringify({mcpServers:{orgsdk:{type:"http",url:`${(0,u.U)()}/mcp/`,headers:{Authorization:`Bearer ${G}`}}}},null,2)).then(()=>{ee("MCP configuration copied. Store it privately in your client configuration.")}).catch(()=>{X("Clipboard unavailable. Configure the endpoint and authorization header manually.")})},children:"Copy MCP configuration"}),(0,t.jsxs)(v.f,{variant:"outline",onClick:()=>{navigator.clipboard.writeText(G).then(()=>{ee("Token copied.")}).catch(()=>{X("Clipboard access failed. Select and copy the new token field.")})},children:[(0,t.jsx)(i,{size:13}),"Copy token"]}),(0,t.jsx)(v.f,{variant:"ghost",onClick:()=>{J("")},children:"Dismiss token"})]}):void 0]}):(0,t.jsx)("p",{className:"notice",children:"Only owners and admins can issue or revoke access tokens."}),(0,t.jsxs)("div",{className:"quick-grid",children:[(0,t.jsxs)("button",{className:"quick-action",onClick:()=>{n("credentials")},children:[(0,t.jsx)(r.f,{size:18}),(0,t.jsx)("strong",{children:"Credentials"}),(0,t.jsx)("span",{children:"Manage encrypted provider secrets."})]}),(0,t.jsxs)("button",{className:"quick-action",onClick:()=>{n("plugins")},children:[(0,t.jsx)(o,{size:18}),(0,t.jsx)("strong",{children:"Plugins"}),(0,t.jsx)("span",{children:"Install and configure your projects’ integrations."})]})]}),Q?(0,t.jsx)("p",{className:"error",role:"alert",children:Q}):void 0,Z?(0,t.jsx)("p",{className:"notice",role:"status",children:Z}):void 0]})}e.s(["default",0,function(){let{canManage:e,goTo:s,selected:n}=(0,g.useWorkspace)();return(0,t.jsx)(M,{canManage:e,navigate:s},n)}],16271)},10505,79432,e=>{"use strict";var t=e.i(18050),s=e.i(56420);let n={name:"activity",size:24,node:[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]};n.node;let a=(0,s.f)(n);e.s(["f",0,a],79432);var i=e.i(51757);let r={name:"clock-3",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]]};r.node;let c=(0,s.f)(r),o={name:"shield-exclamation-point",size:24,node:[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],aliases:["shield-alert"]};o.node;let l=(0,s.f)(o),d={name:"circle-x",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],aliases:["x-circle"]};d.node;let u=(0,s.f)(d);function h(e){return({chat:"Chat task",code:"Code execution",session:"Execution session",action:"Action run",validate:"Code validation",test:"Action tests"})[e]??e.replaceAll("_"," ")}e.s(["k",0,function({status:e}){let s={succeeded:i.f,waiting_approval:l,running:a,queued:c,failed:u,cancelled:u,interrupted:u}[e]??c;return(0,t.jsxs)("span",{className:`run-status status-${e}`,children:[(0,t.jsx)(s,{size:13,"aria-hidden":"true"}),e.replaceAll("_"," ")]})},"B",0,["queued","running","waiting_approval"],"A",0,function(e){return void 0===e?"":"string"==typeof e?e:JSON.stringify(e,void 0,2)},"N",0,function(e,t){let s=t.find(t=>t.id===e.project)?.name??"Project";return"chat"===e.operation?`${s} \xb7 ${(function(e,t){if(null!==e&&"object"==typeof e&&Object.hasOwn(e,t)){let s=Reflect.get(e,t);if("string"==typeof s)return s}return""})(e.inputs,"message").slice(0,70)}`:`${s} \xb7 ${h(e.operation)}`},"T",0,h],10505)},59037,e=>{"use strict";var t=e.i(71645);e.s(["f",0,function(e,s){(0,t.useEffect)(()=>{s(e);let t=e=>{e.preventDefault()};return e&&addEventListener("beforeunload",t),()=>{removeEventListener("beforeunload",t),s(!1)}},[e,s])}])}]);
@@ -0,0 +1,10 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,14778,e=>{"use strict";var t=e.i(42765);e.s(["f",()=>t.n])},35921,78337,e=>{"use strict";var t=e.i(24408);e.s(["f",()=>t.t],35921);var r=e.i(6245);e.s(["f",()=>r.t],78337)},44362,6245,42765,24408,e=>{"use strict";let t;function r(e){let t={subscribe(t){let r=null,n=!1,i=!1,o=!1;function s(){if(null===r){o=!0;return}!i&&(i=!0,"function"==typeof r?r():r&&r.unsubscribe())}return r=e({next(e){var r;n||null==(r=t.next)||r.call(t,e)},error(e){var r;n||(n=!0,null==(r=t.error)||r.call(t,e),s())},complete(){var e;n||(n=!0,null==(e=t.complete)||e.call(t),s())}}),o&&s(),{unsubscribe:s}},pipe:(...e)=>e.reduce(n,t)};return t}function n(e,t){return t(e)}function i(e){return r(t=>(function t(r=0,n=e.op){let i=e.links[r];if(!i)throw Error("No more links to execute - did you forget to add an ending link?");return i({op:n,next:e=>t(r+1,e)})})().subscribe(t))}function o(e){return Array.isArray(e)?e:[e]}function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t,r){var n;return(n=function(e,t){if("object"!=s(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=s(n))return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"==s(n)?n:n+"")in e)?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach(function(t){a(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function c(e){return!!e&&!Array.isArray(e)&&"object"==typeof e}function h(){return Object.create(null)}e.s(["n",0,i,"t",0,function(e){return t=>{let n=o(e.true).map(e=>e(t)),s=o(e.false).map(e=>e(t));return t=>r(r=>{let o=e.condition(t.op)?n:s;return i({op:t.op,links:o}).subscribe(r)})}}],6245);let f=[-32603,-32603,-32603,-32603];function d(e){return e instanceof b}var p,y,b=class e extends Error{constructor(t,r){var n,i;let o=null==r?void 0:r.cause;super(t,{cause:o}),a(this,"cause",void 0),a(this,"shape",void 0),a(this,"data",void 0),a(this,"meta",void 0),this.meta=null==r?void 0:r.meta,this.cause=o,this.shape=null==r||null==(n=r.result)?void 0:n.error,this.data=null==r||null==(i=r.result)?void 0:i.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,e.prototype)}static from(t,r={}){return d(t)?(r.meta&&(t.meta=u(u({},t.meta),r.meta)),t):c(t)&&c(t.error)&&"number"==typeof t.error.code&&"string"==typeof t.error.message?new e(t.error.message,u(u({},r),{},{result:t,cause:r.cause})):new e("string"==typeof t?t:c(t)&&"string"==typeof t.message?t.message:"Unknown error",u(u({},r),{},{cause:t}))}};function v(e){return e?"input"in e?e:{input:e,output:e}:{input:{serialize:e=>e,deserialize:e=>e},output:{serialize:e=>e,deserialize:e=>e}}}e.s(["n",0,d,"t",0,b],42765);let m=()=>{},w=e=>{Object.freeze&&Object.freeze(e)};function g(e){return(g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function S(e,t,r){var n;return(n=function(e,t){if("object"!=g(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=g(n))return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"==g(n)?n:n+"")in e)?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function O(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function E(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?O(Object(r),!0).forEach(function(t){S(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}Symbol("trpc_formattedErrorShape");var k=class extends Error{constructor(){super("Unable to transform response from server")}};function P(e){return null!=e?e:"."}function x(e,t){this.v=e,this.k=t}function j(e){var t,r;function n(t,r){try{var o=e[t](r),s=o.value,a=s instanceof x;Promise.resolve(a?s.v:s).then(function(r){if(a){var l="return"===t?"return":"next";if(!s.k||r.done)return n(l,r);r=e[l](r).value}i(o.done?"return":"normal",r)},function(e){n("throw",e)})}catch(e){i("throw",e)}}function i(e,i){switch(e){case"return":t.resolve({value:i,done:!0});break;case"throw":t.reject(i);break;default:t.resolve({value:i,done:!1})}(t=t.next)?n(t.key,t.arg):r=null}this._invoke=function(e,i){return new Promise(function(o,s){var a={key:e,arg:i,resolve:o,reject:s,next:null};r?r=r.next=a:(t=r=a,n(e,i))})},"function"!=typeof e.return&&(this.return=void 0)}function C(...e){let t=new AbortController,r=()=>{for(let t of e)null==t||t.removeEventListener("abort",n)},n=()=>{r(),t.abort()};for(let t of e){if(null==t?void 0:t.aborted){n();break}null==t||t.addEventListener("abort",n,{once:!0})}return{signal:t.signal,cleanup:r}}j.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},j.prototype.next=function(e){return this._invoke("next",e)},j.prototype.throw=function(e){return this._invoke("throw",e)},j.prototype.return=function(e){return this._invoke("return",e)},Symbol();let T={query:"GET",mutation:"POST",subscription:"PATCH"};function A(e){return"input"in e?e.transformer.input.serialize(e.input):function(e){let t={};for(let r=0;r<e.length;r++){let n=e[r];t[r]=n}return t}(e.inputs.map(t=>e.transformer.input.serialize(t)))}let L=e=>{var t,r;let n=e.url.split("?"),i=n[0].replace(/\/$/,"")+"/"+(t=e.path,"."===(r=e.pathSeparator)?t:t.split(".").join(r)),o=[];if(n[1]&&o.push(n[1]),"inputs"in e&&o.push("batch=1"),"query"===e.type||"subscription"===e.type){let t=A(e);void 0!==t&&"POST"!==e.methodOverride&&o.push(`input=${encodeURIComponent(JSON.stringify(t))}`)}return o.length&&(i+="?"+o.join("&")),i},I=e=>{if("query"===e.type&&"POST"!==e.methodOverride)return;let t=A(e);return void 0!==t?JSON.stringify(t):void 0};var N=class extends Error{constructor(){let e="AbortError";super(e),this.name=e,this.message=e}};async function D(e){var t,r,n,i=e.signal;if(null==i?void 0:i.aborted){if(null==(n=i.throwIfAborted)||n.call(i),"u">typeof DOMException)throw new DOMException("AbortError","AbortError");throw new N}let o=e.getUrl(e),s=e.getBody(e),a=null!=(t=e.methodOverride)?t:T[e.type],l=await (async()=>{let t=await e.headers();return Symbol.iterator in t?Object.fromEntries(t):t})(),c=Object.keys(l).some(e=>"content-type"===e.toLowerCase()),h=u(u(u({},e.contentTypeHeader&&"GET"!==a&&!c?{"content-type":e.contentTypeHeader}:{}),e.trpcAcceptHeader?{[null!=(r=e.trpcAcceptHeaderKey)?r:"trpc-accept"]:e.trpcAcceptHeader}:void 0),l);return(function(e){if(e)return e;if("u">typeof window&&"function"==typeof window.fetch)return window.fetch.bind(window);if("u">typeof globalThis&&"function"==typeof globalThis.fetch)return globalThis.fetch;throw Error("No fetch implementation found")})(e.fetch)(o,{method:a,signal:e.signal,body:s,headers:h})}async function W(e){let t={},r=await D(e);t.response=r;let n=await r.json();return t.responseJSON=n,{json:n,meta:t}}let M=()=>{throw Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")};function $(e){let t=null,r=null;function n(){let n=function(t){let r=[[]],n=0;for(;;){var i,o,s;let a,l=t[n];if(!l)break;let u=r[r.length-1];if(l.aborted){null==(i=l.reject)||i.call(l,Error("Aborted")),n++;continue}try{a=e.validate(u.concat(l).map(e=>e.key))}catch(e){null==(o=l.reject)||o.call(l,e),n++;continue}if(a){u.push(l),n++;continue}if(0===u.length){null==(s=l.reject)||s.call(l,Error("Input is too big for a single dispatch")),n++;continue}r.push([])}return r}(t);for(let i of(clearTimeout(r),r=null,t=null,n)){if(!i.length)continue;let t={items:i};for(let e of i)e.batch=t;e.fetch(t.items.map(e=>e.key)).then(async e=>{for(let n of(await Promise.all(e.map(async(e,r)=>{var n,i;let o=t.items[r];try{let t=await Promise.resolve(e);null==(n=o.resolve)||n.call(o,t)}catch(e){null==(i=o.reject)||i.call(o,e)}o.batch=null,o.reject=null,o.resolve=null})),t.items)){var r;null==(r=n.reject)||r.call(n,Error("Missing result")),n.batch=null}}).catch(e=>{for(let n of t.items){var r;null==(r=n.reject)||r.call(n,e),n.batch=null}})}}return{load:function(e){let i={aborted:!1,key:e,batch:null,resolve:M,reject:M},o=new Promise((e,r)=>{i.reject=r,i.resolve=e,null!=t||(t=[]),t.push(i)});return null!=r||(r=setTimeout(n)),o}}}function q(e){let t=e,n=new Set,i=r(e=>(void 0!==t&&e.next(t),n.add(e),()=>{n.delete(e)}));return i.next=e=>{if(t!==e)for(let r of(t=e,[...n]))n.has(r)&&r.next(e)},i.get=()=>t,i}e.s(["n",0,$,"t",0,function(e){var t,n;let i={url:e.url.toString(),fetch:e.fetch,transformer:v(e.transformer),methodOverride:e.methodOverride,pathSeparator:P(e.pathSeparator)},o=null!=(t=e.maxURLLength)?t:1/0,s=null!=(n=e.maxItems)?n:1/0;return()=>{let t=t=>({validate(e){if(1/0===o&&1/0===s)return!0;if(e.length>s)return!1;let r=e.map(e=>e.path).join(","),n=e.map(e=>e.input);return L(u(u({},i),{},{type:t,path:r,inputs:n,signal:null})).length<=o},async fetch(r){let n,o=r.map(e=>e.path).join(","),s=r.map(e=>e.input),a=function(...e){let t=new AbortController,r=e.length,n=0,i=()=>{++n===r&&t.abort()};for(let t of e)(null==t?void 0:t.aborted)?i():null==t||t.addEventListener("abort",i,{once:!0});return t.signal}(...r.map(e=>e.signal)),l=await (n=u(u({},i),{},{path:o,inputs:s,type:t,headers:()=>e.headers?"function"==typeof e.headers?e.headers({opList:r}):e.headers:{},signal:a}),W(u(u({},n),{},{contentTypeHeader:"application/json",getUrl:L,getBody:I})));return(Array.isArray(l.json)?l.json:r.map(()=>l.json)).map(e=>({meta:l.meta,json:e}))}}),n={query:$(t("query")),mutation:$(t("mutation"))};return({op:e})=>r(t=>{let r;if("subscription"===e.type)throw Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");let o=new AbortController,{signal:s,cleanup:a}=C(e.signal,o.signal),l=n[e.type].load(u(u({},e),{},{signal:s})),h=!1;return l.then(e=>{h=!0,r=e;let n=function(e,t){let r;try{r=function(e,t){if("error"in e){let r=t.deserialize(e.error);return{ok:!1,error:E(E({},e),{},{error:r})}}return{ok:!0,result:E(E({},e.result),(!e.result.type||"data"===e.result.type)&&{type:"data",data:t.deserialize(e.result.data)})}}(e,t)}catch(e){throw new k}if(!r.ok&&(!c(r.error.error)||"number"!=typeof r.error.error.code)||r.ok&&!c(r.result))throw new k;return r}(e.json,i.transformer.output);n.ok?(t.next({context:e.meta,result:n.result}),t.complete()):t.error(b.from(n.error,{meta:e.meta}))}).catch(e=>{h=!0,t.error(b.from(e,{meta:null==r?void 0:r.meta}))}),()=>{h||o.abort(),a()}})}}],24408),Symbol();let R=(e,...t)=>"function"==typeof e?e(...t):e;async function U(e){let t=await R(e.url);return e.connectionParams?t+`${t.includes("?")?"&":"?"}connectionParams=1`:t}async function z(e,t){let r={method:"connectionParams",data:await R(e)};return t.encode(r)}var _=class e{constructor(t){var r;if(a(this,"id",++e.connectCount),a(this,"WebSocketPonyfill",void 0),a(this,"urlOptions",void 0),a(this,"keepAliveOpts",void 0),a(this,"encoder",void 0),a(this,"wsObservable",q(null)),a(this,"openPromise",null),this.WebSocketPonyfill=null!=(r=t.WebSocketPonyfill)?r:WebSocket,!this.WebSocketPonyfill)throw Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=t.urlOptions,this.keepAliveOpts=t.keepAlive,this.encoder=t.encoder}get ws(){return this.wsObservable.get()}set ws(e){this.wsObservable.next(e)}isOpen(){return!!this.ws&&this.ws.readyState===this.WebSocketPonyfill.OPEN&&!this.openPromise}isClosed(){return!!this.ws&&(this.ws.readyState===this.WebSocketPonyfill.CLOSING||this.ws.readyState===this.WebSocketPonyfill.CLOSED)}async open(){if(this.openPromise)return this.openPromise;this.id=++e.connectCount;let t=U(this.urlOptions).then(e=>new this.WebSocketPonyfill(e));this.openPromise=t.then(async e=>{this.ws=e,e.binaryType="arraybuffer",e.addEventListener("message",function({data:e}){"PING"===e&&this.send("PONG")}),this.keepAliveOpts.enabled&&function(e,{intervalMs:t,pongTimeoutMs:r}){let n,i;function o(){n=setTimeout(()=>{e.send("PING"),i=setTimeout(()=>{e.close()},r)},t)}e.addEventListener("open",o),e.addEventListener("message",({data:e})=>{clearTimeout(n),o(),"PONG"===e&&(clearTimeout(i),clearTimeout(n),o())}),e.addEventListener("close",()=>{clearTimeout(n),clearTimeout(i)})}(e,this.keepAliveOpts),e.addEventListener("close",()=>{this.ws===e&&(this.ws=null)}),await function(e){let t,r,{promise:n,resolve:i,reject:o}={promise:new Promise((e,n)=>{t=e,r=n}),resolve:t,reject:r};return e.addEventListener("open",()=>{e.removeEventListener("error",o),i()}),e.addEventListener("error",o),n}(e),this.urlOptions.connectionParams&&e.send(await z(this.urlOptions.connectionParams,this.encoder))});try{await this.openPromise}finally{this.openPromise=null}}async close(){try{await this.openPromise}finally{var e;null==(e=this.ws)||e.close()}}};a(_,"connectCount",0);let G=new WeakMap,H=()=>{};t=Symbol.toStringTag;var J=class e{constructor(e){S(this,"promise",void 0),S(this,"subscribers",[]),S(this,"settlement",null),S(this,t,"Unpromise"),"function"==typeof e?this.promise=new Promise(e):this.promise=e;let r=this.promise.then(e=>{let{subscribers:t}=this;this.subscribers=null,this.settlement={status:"fulfilled",value:e},null==t||t.forEach(({resolve:t})=>{t(e)})});"catch"in r&&r.catch(e=>{let{subscribers:t}=this;this.subscribers=null,this.settlement={status:"rejected",reason:e},null==t||t.forEach(({reject:t})=>{t(e)})})}subscribe(){let e,t,{settlement:r}=this;if(null===r){var n;let r,i;if(null===this.subscribers)throw Error("Unpromise settled but still has subscribers");let o={promise:new Promise((e,t)=>{r=e,i=t}),resolve:r,reject:i};this.subscribers=(n=this.subscribers,[...n,o]),e=o.promise,t=()=>{null!==this.subscribers&&(this.subscribers=function(e,t){let r=e.indexOf(t);if(-1!==r)return[...e.slice(0,r),...e.slice(r+1)];return e}(this.subscribers,o))}}else{let{status:n}=r;e="fulfilled"===n?Promise.resolve(r.value):Promise.reject(r.reason),t=H}return Object.assign(e,{unsubscribe:t})}then(e,t){let r=this.subscribe(),{unsubscribe:n}=r;return Object.assign(r.then(e,t),{unsubscribe:n})}catch(e){let t=this.subscribe(),{unsubscribe:r}=t;return Object.assign(t.catch(e),{unsubscribe:r})}finally(e){let t=this.subscribe(),{unsubscribe:r}=t;return Object.assign(t.finally(e),{unsubscribe:r})}static proxy(t){let r=e.getSubscribablePromise(t);return void 0!==r?r:e.createSubscribablePromise(t)}static createSubscribablePromise(t){let r=new e(t);return G.set(t,r),G.set(r,r),r}static getSubscribablePromise(e){return G.get(e)}static resolve(t){let r="object"==typeof t&&null!==t&&"then"in t&&"function"==typeof t.then?t:Promise.resolve(t);return e.proxy(r).subscribe()}static async any(t){let r=(Array.isArray(t)?t:[...t]).map(e.resolve);try{return await Promise.any(r)}finally{r.forEach(({unsubscribe:e})=>{e()})}}static async race(t){let r=(Array.isArray(t)?t:[...t]).map(e.resolve);try{return await Promise.race(r)}finally{r.forEach(({unsubscribe:e})=>{e()})}}static async raceReferences(e){let t=e.map(B);try{return await Promise.race(t)}finally{for(let e of t)e.unsubscribe()}}};function B(e){return J.proxy(e).then(()=>[e])}null!=(p=Symbol).dispose||(p.dispose=Symbol()),null!=(y=Symbol).asyncDispose||(y.asyncDispose=Symbol());let K=Symbol();function F(){var e="function"==typeof SuppressedError?SuppressedError:function(e,t){var r=Error();return r.name="SuppressedError",r.error=e,r.suppressed=t,r},t={},r=[];function n(e,t){if(null!=t){if(Object(t)!==t)throw TypeError("using declarations can only be used with objects, functions, null, or undefined.");if(e)var n=t[Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose")];if(void 0===n&&(n=t[Symbol.dispose||Symbol.for("Symbol.dispose")],e))var i=n;if("function"!=typeof n)throw TypeError("Object is not disposable.");i&&(n=function(){try{i.call(t)}catch(e){return Promise.reject(e)}}),r.push({v:t,d:n,a:e})}else e&&r.push({d:t,a:e});return t}return{e:t,u:n.bind(null,!1),a:n.bind(null,!0),d:function(){var n,i=this.e,o=0;function s(){for(;n=r.pop();)try{if(!n.a&&1===o)return o=0,r.push(n),Promise.resolve().then(s);if(n.d){var e=n.d.call(n.v);if(n.a)return o|=2,Promise.resolve(e).then(s,a)}else o|=1}catch(e){return a(e)}if(1===o)return i!==t?Promise.reject(i):Promise.resolve();if(i!==t)throw i}function a(r){return i=i!==t?new e(r,i):r,s()}return s()}}}async function V(e){try{let o,s;var t,r,n,i=F();let a=i.u((t=e.timeoutMs,o=null,r={start(){if(o)throw Error("Timer already started");return new Promise(e=>{o=setTimeout(()=>e(K),t)})}},n=()=>{o&&clearTimeout(o)},s=r[Symbol.dispose],r[Symbol.dispose]=()=>{n(),null==s||s.call(r)},r)),l=await J.race([e.promise,a.start()]);if(l===K)return await e.onTimeout();return l}catch(e){i.e=e}finally{i.d()}}Symbol("ping");var X=class{constructor(e){a(this,"links",void 0),a(this,"runtime",void 0),a(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=e.links.map(e=>e(this.runtime))}$request(e){var t;return i({links:this.links,op:u(u({},e),{},{context:null!=(t=e.context)?t:{},id:++this.requestId})}).pipe(e=>{let t=0,n=null,i=!1,o=new Set;function s(e,t){for(let r of[...e])e.has(r)&&t(r)}function a(e){let t=n,r=o;n=null,o=new Set,i=!1;try{s(r,e)}finally{null==t||t.unsubscribe()}}return r(r=>{t++;let l=o;return l.add(r),!function(){let t;if(n||i)return;i=!0;let r=!1;try{t=e.subscribe({next(e){s(o,t=>{var r;return null==(r=t.next)?void 0:r.call(t,e)})},error(e){r=!0,a(t=>{var r;return null==(r=t.error)?void 0:r.call(t,e)})},complete(){r=!0,a(e=>{var t;return null==(t=e.complete)?void 0:t.call(e)})}})}finally{i=!1}r?t.unsubscribe():n=t}(),{unsubscribe(){let e;0==--t&&n&&(e=n,n=null,null==e||e.unsubscribe()),l.delete(r)}}})})}async requestAsPromise(e){try{let t,r=this.$request(e);return(await (t=new AbortController,new Promise((e,n)=>{let i=!1;function o(){i||(i=!0,s.unsubscribe())}t.signal.addEventListener("abort",()=>{n(t.signal.reason)});let s=r.subscribe({next(t){i=!0,e(t),o()},error(e){n(e)},complete(){t.abort(),o()}})}))).result.data}catch(e){throw b.from(e)}}query(e,t,r){return this.requestAsPromise({type:"query",path:e,input:t,context:null==r?void 0:r.context,signal:null==r?void 0:r.signal})}mutation(e,t,r){return this.requestAsPromise({type:"mutation",path:e,input:t,context:null==r?void 0:r.context,signal:null==r?void 0:r.signal})}subscription(e,t,r){return this.$request({type:"subscription",path:e,input:t,context:r.context,signal:r.signal}).subscribe({next(e){var t,n,i,o;switch(e.result.type){case"state":null==(t=r.onConnectionStateChange)||t.call(r,e.result);break;case"started":null==(n=r.onStarted)||n.call(r,{context:e.context});break;case"stopped":null==(i=r.onStopped)||i.call(r);break;case"data":case void 0:null==(o=r.onData)||o.call(r,e.result.data)}},error(e){var t;null==(t=r.onError)||t.call(r,e)},complete(){var e;null==(e=r.onComplete)||e.call(r)}})}};let Q=Symbol.for("trpc_untypedClient"),Y={query:"query",mutate:"mutation",subscribe:"subscription"};function Z(e){function t(e){if(Object(e)!==e)return Promise.reject(TypeError(e+" is not an object."));var t=e.done;return Promise.resolve(e.value).then(function(e){return{value:e,done:t}})}return(Z=function(e){this.s=e,this.n=e.next}).prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var r=this.s.return;return void 0===r?Promise.resolve({value:e,done:!0}):t(r.apply(this.s,arguments))},throw:function(e){var r=this.s.return;return void 0===r?Promise.reject(e):t(r.apply(this.s,arguments))}},new Z(e)}async function ee(e){let t=await R(e.url);if(e.connectionParams){let r=await R(e.connectionParams),n=t.includes("?")?"&":"?";t+=n+"connectionParams="+encodeURIComponent(JSON.stringify(r))}return t}function et(e,t){this.v=e,this.k=t}function er(e){var t,r;function n(t,r){try{var o=e[t](r),s=o.value,a=s instanceof et;Promise.resolve(a?s.v:s).then(function(r){if(a){var l="return"===t?"return":"next";if(!s.k||r.done)return n(l,r);r=e[l](r).value}i(o.done?"return":"normal",r)},function(e){n("throw",e)})}catch(e){i("throw",e)}}function i(e,i){switch(e){case"return":t.resolve({value:i,done:!0});break;case"throw":t.reject(i);break;default:t.resolve({value:i,done:!1})}(t=t.next)?n(t.key,t.arg):r=null}this._invoke=function(e,i){return new Promise(function(o,s){var a={key:e,arg:i,resolve:o,reject:s,next:null};r?r=r.next=a:(t=r=a,n(e,i))})},"function"!=typeof e.return&&(this.return=void 0)}er.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},er.prototype.next=function(e){return this._invoke("next",e)},er.prototype.throw=function(e){return this._invoke("throw",e)},er.prototype.return=function(e){return this._invoke("return",e)},e.s(["$",0,function(e){let t;var r=new X(e);let n=function e(t,r,n){let i=r.join(".");return null!=n[i]||(n[i]=new Proxy(m,{get(i,o){if("string"==typeof o&&"then"!==o)return e(t,[...r,o],n)},apply(e,n,i){let o=r[r.length-1];if("valueOf"===o||"toString"===o||"toJSON"===o)return`tRPC.proxy(${r.slice(0,-1).join(".")})`;let s={args:i,path:r};return"call"===o?s={args:i.length>=2?[i[1]]:[],path:r.slice(0,-1)}:"apply"===o&&(s={args:i.length>=2?i[1]:[],path:r.slice(0,-1)}),w(s.args),w(s.path),t(s)}})),n[i]}(({path:e,args:t})=>{let n=[...e],i=Y[n.pop()],o=n.join(".");return r[i](o,...t)},[],h());return t=e=>e===Q?r:n[e],new Proxy(m,{get(e,r){if("then"!==r)return t(r)}})},"I",0,function(e){let t=v(e.transformer),n=P(e.pathSeparator);return()=>({op:i})=>r(r=>{var o;let s,{type:a,path:l,input:c}=i;if("subscription"!==a)throw Error("httpSubscriptionLink only supports subscriptions");let d=new AbortController,p=function(e){var t;let{deserialize:r=e=>e}=e,n=h(),i=e.signal,o=null,s=()=>new ReadableStream({async start(t){let[s,a]=await Promise.all([e.url(),e.init()]),l=o=new e.EventSource(s,a);t.enqueue({type:"connecting",eventSource:o,event:null});let u=(e,r)=>{l.addEventListener(e,e=>{try{r(e)}catch(e){l.close(),t.error(e)}})};u("connected",e=>{let r=JSON.parse(e.data);n=r,t.enqueue({type:"connected",options:r,eventSource:l})}),u("serialized-error",e=>{t.enqueue({type:"serialized-error",error:r(JSON.parse(e.data)),eventSource:l})}),l.addEventListener("ping",()=>{t.enqueue({type:"ping",eventSource:l})}),l.addEventListener("return",()=>{l.close(),t.close(),o=null}),l.addEventListener("error",e=>{l.readyState===l.CLOSED?t.error(e):t.enqueue({type:"connecting",eventSource:l,event:e})}),u("message",e=>{let n={data:r(JSON.parse(e.data))};e.lastEventId&&(n.id=e.lastEventId),t.enqueue({type:"data",data:n,eventSource:l})});let c=()=>{try{l.close(),t.close()}catch(e){}};i.aborted?c():i.addEventListener("abort",c)},cancel(){null==o||o.close()}});return t=function*(){try{var e,t=F();let r=t.a((()=>{var e;let t,r=s(),n=r.getReader();async function i(){await n.cancel().catch(()=>{}),o=null}return e={read:()=>n.read(),async recreate(){await i(),n=(r=s()).getReader()}},t=e[Symbol.asyncDispose],e[Symbol.asyncDispose]=async()=>{await i(),await (null==t?void 0:t.call(e))},e})());for(;;){let t=r.read(),i=n.reconnectAfterInactivityMs;i&&(t=V({promise:t,timeoutMs:i,onTimeout:async()=>{let e={value:{type:"timeout",ms:i,eventSource:o},done:!1};return await r.recreate(),e}}));let s=yield(e=t,new x(e,0));if(s.done)return s.value;yield s.value}}catch(e){t.e=e}finally{yield new x(t.d(),0)}},function(){return new j(t.apply(this,arguments))}()}({url:async()=>{var r;return L({transformer:t,url:await ee(e),input:(r=s)&&(null==c||"object"==typeof c)?u(u({},null!=c?c:{}),{},{lastEventId:r}):c,path:l,pathSeparator:n,type:a,signal:null})},init:()=>R(e.eventSourceOptions,{op:i}),signal:function(...e){return C(...e).signal}(i.signal,d.signal),deserialize:e=>t.output.deserialize(e),EventSource:null!=(o=e.EventSource)?o:globalThis.EventSource}),y=q({type:"state",state:"connecting",error:null}),v=y.subscribe({next(e){r.next({result:e})}});return(async()=>{var e=!1,t=!1;try{for(var n,i,o=function(e){var t,r,n,i=2;for("u">typeof Symbol&&(r=Symbol.asyncIterator,n=Symbol.iterator);i--;){if(r&&null!=(t=e[r]))return t.call(e);if(n&&null!=(t=e[n]))return new Z(t.call(e));r="@@asyncIterator",n="@@iterator"}throw TypeError("Object is not async iterable")}(p);e=!(i=await o.next()).done;e=!1){let e=i.value;switch(e.type){case"ping":break;case"data":let t,n=e.data;n.id?(s=n.id,t={id:n.id,data:n}):t={data:n.data},r.next({result:t,context:{eventSource:e.eventSource}});break;case"connected":r.next({result:{type:"started"},context:{eventSource:e.eventSource}}),y.next({type:"state",state:"pending",error:null});break;case"serialized-error":{let t=b.from({error:e.error});if(f.includes(e.error.code)){y.next({type:"state",state:"connecting",error:t});break}throw t}case"connecting":{let t=y.get(),r=e.event&&b.from(e.event);if(!r&&"connecting"===t.state)break;y.next({type:"state",state:"connecting",error:r});break}case"timeout":y.next({type:"state",state:"connecting",error:new b(`Timeout of ${e.ms}ms reached while waiting for a response`)})}}}catch(e){t=!0,n=e}finally{try{e&&null!=o.return&&await o.return()}finally{if(t)throw n}}r.next({result:{type:"stopped"}}),y.next({type:"state",state:"idle",error:null}),r.complete()})().catch(e=>{r.error(b.from(e))}),()=>{r.complete(),d.abort(),v.unsubscribe()}})}],44362)},21176,e=>{"use strict";class t extends Error{constructor(e,t){super(e),this.name="ParseError",this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}}function r(e){}function n(e,t,r){return 100===r&&97===e.charCodeAt(t+1)&&116===e.charCodeAt(t+2)&&97===e.charCodeAt(t+3)&&58===e.charCodeAt(t+4)}function i(e,t,r){return 101===r&&118===e.charCodeAt(t+1)&&101===e.charCodeAt(t+2)&&110===e.charCodeAt(t+3)&&116===e.charCodeAt(t+4)&&58===e.charCodeAt(t+5)}class o extends Event{constructor(e,t){var r,n;super(e),this.code=null!=(r=null==t?void 0:t.code)?r:void 0,this.message=null!=(n=null==t?void 0:t.message)?n:void 0}[Symbol.for("nodejs.util.inspect.custom")](e,t,r){return r(s(this),t)}[Symbol.for("Deno.customInspect")](e,t){return e(s(this),t)}}function s(e){return{type:e.type,message:e.message,code:e.code,defaultPrevented:e.defaultPrevented,cancelable:e.cancelable,timeStamp:e.timeStamp}}var a,l,u,c,h,f,d,p,y,b,v,m,w,g,S,O,E,k,P,x,j,C,T,A=e=>{throw TypeError(e)},L=(e,t,r)=>t.has(e)||A("Cannot "+r),I=(e,t,r)=>(L(e,t,"read from private field"),r?r.call(e):t.get(e)),N=(e,t,r)=>t.has(e)?A("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),D=(e,t,r,n)=>(L(e,t,"write to private field"),t.set(e,r),r),W=(e,t,r)=>(L(e,t,"access private method"),r);class M extends EventTarget{constructor(e,o){var s,k,A;super(),N(this,g),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,N(this,a),N(this,l),N(this,u),N(this,c),N(this,h),N(this,f),N(this,d),N(this,p,null),N(this,y),N(this,b),N(this,v,null),N(this,m,null),N(this,w,null),N(this,O,async e=>{var t;I(this,b).reset();let{body:r,redirected:n,status:i,headers:o}=e;if(204===i){W(this,g,j).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(n?D(this,u,new URL(e.url)):D(this,u,void 0),200!==i)return void W(this,g,j).call(this,`Non-200 status code (${i})`,i);if(!(o.get("content-type")||"").startsWith("text/event-stream"))return void W(this,g,j).call(this,'Invalid content type, expected "text/event-stream"',i);if(I(this,a)===this.CLOSED)return;D(this,a,this.OPEN);let s=new Event("open");if(null==(t=I(this,w))||t.call(this,s),this.dispatchEvent(s),"object"!=typeof r||!r||!("getReader"in r)){W(this,g,j).call(this,"Invalid response body, expected a web ReadableStream",i),this.close();return}let l=new TextDecoder,c=r.getReader(),h=!0;do{let{done:e,value:t}=await c.read();t&&I(this,b).feed(l.decode(t,{stream:!e})),e&&(h=!1,I(this,b).reset(),W(this,g,C).call(this))}while(h)}),N(this,E,e=>{D(this,y,void 0),"AbortError"!==e.name&&"aborted"!==e.type&&W(this,g,C).call(this,function e(t){return t instanceof Error?"errors"in t&&Array.isArray(t.errors)?t.errors.map(e).join(", "):"cause"in t&&t.cause instanceof Error?`${t}: ${e(t.cause)}`:t.message:`${t}`}(e))}),N(this,P,e=>{"string"==typeof e.id&&D(this,p,e.id);let t=new MessageEvent(e.event||"message",{data:e.data,origin:I(this,u)?I(this,u).origin:I(this,l).origin,lastEventId:e.id||""});I(this,m)&&(!e.event||"message"===e.event)&&I(this,m).call(this,t),this.dispatchEvent(t)}),N(this,x,e=>{D(this,f,e)}),N(this,T,()=>{D(this,d,void 0),I(this,a)===this.CONNECTING&&W(this,g,S).call(this)});try{if(e instanceof URL)D(this,l,e);else if("string"==typeof e){let t;D(this,l,new URL(e,(t="document"in globalThis?globalThis.document:void 0)&&"object"==typeof t&&"baseURI"in t&&"string"==typeof t.baseURI?t.baseURI:void 0))}else throw Error("Invalid URL")}catch{let e;throw A="An invalid or illegal string was specified","function"==typeof(e=globalThis.DOMException)?new e(A,"SyntaxError"):SyntaxError(A)}D(this,b,function(e){if("function"==typeof e)throw TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?");let{onEvent:o=r,onError:s=r,onRetry:a=r,onComment:l,maxBufferSize:u}=e,c=[],h=0,f=!0,d,p="",y=0,b,v=!1;function m(){void 0!==u&&(h+p.length<=u||(v=!0,c.length=0,h=0,d=void 0,p="",y=0,b=void 0,s(new t(`Buffered data exceeded max buffer size of ${u} characters`,{type:"max-buffer-size-exceeded"}))))}function w(e){let t=0;if(-1===e.indexOf("\r")){let r=e.indexOf(`
2
+ `,t);for(;-1!==r;){if(t===r){y>0&&o({id:d,event:b,data:p}),d=void 0,p="",y=0,b=void 0,t=r+1,r=e.indexOf(`
3
+ `,t);continue}let s=e.charCodeAt(t);if(n(e,t,s)){let n=32===e.charCodeAt(t+5)?t+6:t+5,i=e.slice(n,r);if(0===y&&10===e.charCodeAt(r+1)){o({id:d,event:b,data:i}),d=void 0,p="",b=void 0,t=r+2,r=e.indexOf(`
4
+ `,t);continue}p=0===y?i:`${p}
5
+ ${i}`,y++}else i(e,t,s)?b=e.slice(32===e.charCodeAt(t+6)?t+7:t+6,r)||void 0:g(e,t,r);t=r+1,r=e.indexOf(`
6
+ `,t)}return e.slice(t)}for(;t<e.length;){let r=e.indexOf("\r",t),n=e.indexOf(`
7
+ `,t),i=-1;if(-1!==r&&-1!==n?i=r<n?r:n:-1!==r?i=r===e.length-1?-1:r:-1!==n&&(i=n),-1===i)break;g(e,t,i),t=i+1,13===e.charCodeAt(t-1)&&10===e.charCodeAt(t)&&t++}return e.slice(t)}function g(e,t,r){if(t===r)return void(y>0&&o({id:d,event:b,data:p}),d=void 0,p="",y=0,b=void 0);let s=e.charCodeAt(t);if(n(e,t,s)){let n=32===e.charCodeAt(t+5)?t+6:t+5,i=e.slice(n,r);p=0===y?i:`${p}
8
+ ${i}`,y++;return}if(i(e,t,s)){b=e.slice(32===e.charCodeAt(t+6)?t+7:t+6,r)||void 0;return}if(105===s&&100===e.charCodeAt(t+1)&&58===e.charCodeAt(t+2)){let n=e.slice(32===e.charCodeAt(t+3)?t+4:t+3,r);n.includes("\0")||(d=n);return}if(58===s){l&&l(e.slice(t,r).slice(32===e.charCodeAt(t+1)?2:1));return}let a=e.slice(t,r),u=a.indexOf(":");if(-1===u)return void S(a,"",a);let c=a.slice(0,u),h=32===a.charCodeAt(u+1)?2:1;S(c,a.slice(u+h),a)}function S(e,r,n){switch(e){case"event":b=r||void 0;break;case"data":p=0===y?r:`${p}
9
+ ${r}`,y++;break;case"id":r.includes("\0")||(d=r);break;case"retry":/^\d+$/.test(r)?a(parseInt(r,10)):s(new t(`Invalid \`retry\` value: "${r}"`,{type:"invalid-retry",value:r,line:n}));break;default:s(new t(`Unknown field "${e.length>20?`${e.slice(0,20)}…`:e}"`,{type:"unknown-field",field:e,value:r,line:n}))}}return{feed:function(e){if(v)throw Error("Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing.");if(f&&(f=!1,239===e.charCodeAt(0)&&187===e.charCodeAt(1)&&191===e.charCodeAt(2)&&(e=e.slice(3))),0===c.length){let t=w(e);""!==t&&(c.push(t),h=t.length),m();return}if(-1===e.indexOf(`
10
+ `)&&-1===e.indexOf("\r")){c.push(e),h+=e.length,m();return}c.push(e);let t=c.join("");c.length=0,h=0;let r=w(t);""!==r&&(c.push(r),h=r.length),m()},reset:function(e={}){if(e.consume&&c.length>0){let e=c.join("");g(e,0,e.length)}f=!0,d=void 0,p="",y=0,b=void 0,c.length=0,h=0,v=!1}}}({onEvent:I(this,P),onRetry:I(this,x)})),D(this,a,this.CONNECTING),D(this,f,3e3),D(this,h,null!=(s=null==o?void 0:o.fetch)?s:globalThis.fetch),D(this,c,null!=(k=null==o?void 0:o.withCredentials)&&k),W(this,g,S).call(this)}get readyState(){return I(this,a)}get url(){return I(this,l).href}get withCredentials(){return I(this,c)}get onerror(){return I(this,v)}set onerror(e){D(this,v,e)}get onmessage(){return I(this,m)}set onmessage(e){D(this,m,e)}get onopen(){return I(this,w)}set onopen(e){D(this,w,e)}addEventListener(e,t,r){super.addEventListener(e,t,r)}removeEventListener(e,t,r){super.removeEventListener(e,t,r)}close(){I(this,d)&&clearTimeout(I(this,d)),I(this,a)!==this.CLOSED&&(I(this,y)&&I(this,y).abort(),D(this,a,this.CLOSED),D(this,y,void 0))}}a=new WeakMap,l=new WeakMap,u=new WeakMap,c=new WeakMap,h=new WeakMap,f=new WeakMap,d=new WeakMap,p=new WeakMap,y=new WeakMap,b=new WeakMap,v=new WeakMap,m=new WeakMap,w=new WeakMap,g=new WeakSet,S=function(){D(this,a,this.CONNECTING),D(this,y,new AbortController),I(this,h)(I(this,l),W(this,g,k).call(this)).then(I(this,O)).catch(I(this,E))},O=new WeakMap,E=new WeakMap,k=function(){var e;let t={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...I(this,p)?{"Last-Event-ID":I(this,p)}:void 0},cache:"no-store",signal:null==(e=I(this,y))?void 0:e.signal};return"window"in globalThis&&(t.credentials=this.withCredentials?"include":"same-origin"),t},P=new WeakMap,x=new WeakMap,j=function(e,t){var r;I(this,a)!==this.CLOSED&&D(this,a,this.CLOSED);let n=new o("error",{code:t,message:e});null==(r=I(this,v))||r.call(this,n),this.dispatchEvent(n)},C=function(e,t){var r;if(I(this,a)===this.CLOSED)return;D(this,a,this.CONNECTING);let n=new o("error",{code:t,message:e});null==(r=I(this,v))||r.call(this,n),this.dispatchEvent(n),D(this,d,setTimeout(I(this,T),I(this,f)))},T=new WeakMap,M.CONNECTING=0,M.OPEN=1,M.CLOSED=2,Object.defineProperty(M,Symbol.for("eventsource.supports-fetch-override"),{value:!0,writable:!1,configurable:!1,enumerable:!1}),e.s(["f",0,M],21176)},73656,e=>{"use strict";var t=e.i(21176),r=e.i(44362),n=e.i(35921),i=e.i(78337),o=e.i(14778);function s(e){let o=e.url??"/trpc",s=e.studioToken;return(0,i.f)({condition:e=>"subscription"===e.type,true:s?(0,r.I)({url:o,EventSource:t.f,eventSourceOptions:{fetch:(e,t)=>{let r=new Headers(t.headers);return r.set("x-orgsdk-studio-session",s),fetch(e,{...t,headers:r,credentials:"omit",redirect:"error"})}}}):(0,r.I)({url:o,eventSourceOptions:{withCredentials:!0}}),false:(0,n.f)({url:o,fetch:(t,r)=>(e.fetch??globalThis.fetch)(t,{...r,signal:r?.signal??null,credentials:e.studioToken?"omit":"same-origin",...e.studioToken&&{redirect:"error"}}),headers(){if(e.studioToken)return{"x-orgsdk-studio-session":e.studioToken};let t=(e.csrfToken??function(){return"u"<typeof document?void 0:document.cookie.split(";").map(e=>e.trim()).find(e=>e.startsWith("csrftoken="))?.slice(10)})();return t?{"X-CSRFToken":t}:{}}})})}let a={endpoint:"",transport:s({})},l=(0,r.$)({links:[e=>{let t=a.transport,r=t(e);return n=>(t!==a.transport&&(r=(t=a.transport)(e)),r(n))}]});async function u(e){try{return await l.auth.session.query(void 0,e?{signal:e}:void 0)}catch(e){throw(0,o.f)(e)&&e.data?.code==="PRECONDITION_FAILED"&&location.assign(new URL("/setup/",location.origin).href),e}}e.s(["T",0,function(e,t){a.endpoint=e,a.transport=s({url:e+"/trpc",studioToken:t})},"u",0,function(e={}){return(0,r.$)({links:[s(e)]})},"S",0,function(e){return a.endpoint+e},"U",0,function(){return a.endpoint||location.origin},"m",0,u,"V",0,l])}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,11241,e=>{"use strict";var s=e.i(56420);let t={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};t.node;let i=(0,s.f)(t);e.s(["f",0,i],11241)},51757,e=>{"use strict";var s=e.i(56420);let t={name:"circle-check",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 9-5.5 5.5L8 12",key:"xofnsj"}]],aliases:["check-circle-2"]};t.node;let i=(0,s.f)(t);e.s(["f",0,i],51757)},62368,e=>{"use strict";var s=e.i(56420);let t={name:"download",size:24,node:[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]};t.node;let i=(0,s.f)(t);e.s(["f",0,i],62368)},95925,29272,e=>{"use strict";var s=e.i(56420);let t={name:"rotate-ccw",size:24,node:[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]};t.node;let i=(0,s.f)(t);e.s(["f",0,i],95925);let a={name:"square",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]};a.node;let r=(0,s.f)(a);e.s(["f",0,r],29272)},66595,e=>{"use strict";var s=e.i(56420);let t={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};t.node;let i=(0,s.f)(t);e.s(["f",0,i],66595)},40192,54105,19877,e=>{"use strict";var s=e.i(22219);e.s(["z",0,s],40192),e.s(["z",0,s],54105),e.s(["z",0,s],19877)},13581,29487,e=>{"use strict";var s=e.i(71645),t=e.i(95813);e.s(["f",0,function(e,i=0){let[a,r]=(0,s.useState)(),[n,l]=(0,s.useState)(""),[c,d]=(0,s.useState)(!0),o=(0,s.useRef)(void 0),u=(0,s.useRef)(!1),h=(0,s.useCallback)(async()=>{o.current?.abort();let s=new AbortController;o.current=s;try{let t=await e(s.signal);if(s.signal.aborted||!u.current)return;r(t),l("")}catch(e){!s.signal.aborted&&u.current&&l((0,t.f)(e))}finally{!s.signal.aborted&&u.current&&d(!1)}},[e]);return(0,s.useEffect)(()=>{u.current=!0,queueMicrotask(()=>{u.current&&h()});let e=i>0?setInterval(()=>{h()},i):void 0;return()=>{u.current=!1,o.current?.abort(),clearInterval(e)}},[h,i]),{data:a,error:n,isLoading:c,refresh:h}}],13581);var i=e.i(18050),a=e.i(19455);e.s(["f",0,function({isLoading:e,error:s,refresh:t}){return(0,i.jsxs)(i.Fragment,{children:[e?(0,i.jsx)("p",{role:"status",children:"Loading workspace data…"}):void 0,s?(0,i.jsxs)("div",{className:"error",role:"alert",children:[(0,i.jsx)("p",{children:s}),(0,i.jsx)(a.f,{variant:"outline",onClick:()=>{t()},children:"Try again"})]}):void 0]})}],29487)},3340,e=>{"use strict";var s=e.i(18050),t=e.i(18566),i=e.i(59140),a=e.i(66595),r=e.i(71645),n=e.i(73656),l=e.i(13581),c=e.i(15080),d=e.i(19455),o=e.i(93479),u=e.i(29487),h=e.i(10505),x=e.i(94757),p=e.i(36174);function j({projects:e,selected:t,onSelect:i,actionId:m=""}){let{selected:f}=(0,x.useWorkspace)(),v=(0,r.useCallback)(async e=>{let[s,t]=await Promise.all([(0,c.f)(e),m?n.V.actions.versions.query({id:m},{signal:e}):void 0]),i=new Set(t?.map(e=>e.id));return s.filter(e=>e.project===f&&(!m||null!==e.action_version&&i.has(e.action_version)))},[m,f]),g=(0,l.f)(v,5e3),[y,b]=(0,r.useState)(""),[k,w]=(0,r.useState)(""),[N,S]=(0,r.useState)(""),C=g.data?.filter(s=>s.project===f&&(!k||s.status===k)&&(!N||s.operation===N)&&`${(0,h.N)(s,e)} ${s.id}`.toLowerCase().includes(y.toLowerCase()))??[];return t&&!g.data?.some(e=>e.id===t)?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(u.f,{...g}),g.isLoading||g.error?null:(0,s.jsx)("p",{role:"alert",children:"This run is not available in this action or project."})]}):t?(0,s.jsx)(p.T,{id:t,projects:e,back:()=>{i("")},openRun:i},t):(0,s.jsxs)("section",{className:"panel",children:[(0,s.jsxs)("div",{className:"panel-title",children:[(0,s.jsx)("h2",{children:"Run history"}),(0,s.jsxs)("span",{className:"badge",children:[C.length," runs"]})]}),(0,s.jsxs)("p",{className:"small",children:["Project:"," ",e.find(e=>e.id===f)?.name??"Choose a project"]}),(0,s.jsxs)("div",{className:"resource-toolbar",children:[(0,s.jsxs)("label",{className:"search-field",children:[(0,s.jsx)(a.f,{size:15}),(0,s.jsx)(o.f,{"aria-label":"Search runs",placeholder:"Search by project or run ID…",value:y,onChange:e=>{b(e.target.value)}})]}),(0,s.jsxs)("select",{"aria-label":"Run status",value:k,onChange:e=>{w(e.target.value)},children:[(0,s.jsx)("option",{value:"",children:"All statuses"}),["queued","running","waiting_approval","succeeded","failed","cancelled","interrupted"].map(e=>(0,s.jsx)("option",{value:e,children:e.replaceAll("_"," ")},e))]}),(0,s.jsxs)("select",{"aria-label":"Run type",value:N,onChange:e=>{S(e.target.value)},children:[(0,s.jsx)("option",{value:"",children:"All work"}),(0,s.jsx)("option",{value:"action",children:"Actions"}),(0,s.jsx)("option",{value:"code",children:"Code execution"}),(0,s.jsx)("option",{value:"validate",children:"Code validation"}),(0,s.jsx)("option",{value:"test",children:"Action tests"}),(0,s.jsx)("option",{value:"chat",children:"Chat tasks"})]})]}),(0,s.jsx)(u.f,{...g}),g.isLoading||0!==C.length?void 0:(0,s.jsxs)("div",{className:"resource-empty",children:[(0,s.jsx)("h3",{children:"No matching runs"}),(0,s.jsx)("p",{children:"Execute code from an external client or run a saved action, then follow its progress here."})]}),(0,s.jsx)("div",{className:"table-wrap",children:(0,s.jsxs)("table",{children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{children:"Work"}),(0,s.jsx)("th",{children:"Status"}),(0,s.jsx)("th",{children:"Created"}),(0,s.jsx)("th",{})]})}),(0,s.jsx)("tbody",{children:C.map(t=>(0,s.jsxs)("tr",{children:[(0,s.jsxs)("td",{children:[(0,s.jsx)("strong",{children:(0,h.N)(t,e)}),(0,s.jsx)("small",{className:"block muted",children:t.id.slice(0,8)})]}),(0,s.jsx)("td",{children:(0,s.jsx)(h.k,{status:t.status})}),(0,s.jsx)("td",{children:new Date(t.created_at).toLocaleString()}),(0,s.jsx)("td",{children:(0,s.jsx)(d.f,{variant:"outline",size:"sm",onClick:()=>{i(t.id)},children:"View run"})})]},t.id))})]})})]})}e.s(["default",0,function(){let{projects:e,selected:a,navigateTo:r}=(0,x.useWorkspace)(),n=(0,t.useSearchParams)();return(0,s.jsx)(i.c,{current:"runs",children:t=>(0,s.jsx)(j,{projects:e,actionId:t,selected:n.get("run")??"",onSelect:e=>{let s=new URLSearchParams({project:a});t&&s.set("action",t),e&&s.set("run",e),r(`/runs/?${s.toString()}`)}},`${a}:${t}`)})}],3340)},24687,e=>{"use strict";var s=e.i(18050),t=e.i(71645),i=e.i(39689);let a=t.forwardRef(({className:e,...t},a)=>(0,s.jsx)("textarea",{className:(0,i.f)("flex min-h-[60px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:a,...t}));a.displayName="Textarea",e.s(["f",0,a])},12102,e=>{"use strict";var s=e.i(40192),t=e.i(54105),i=e.i(19877),a=e.i(22219),a=a;let r=s.z.record(t.z.string(),i.z.json());e.s(["z",0,function(e){let s=JSON.parse(e);return a.array(r).min(1).max(50).parse(s)},"J",0,function(e){let s=JSON.parse(e);return r.parse(s)}],12102)},59140,e=>{"use strict";var s=e.i(18050),t=e.i(71645),i=e.i(18566),a=e.i(11241),r=e.i(73656),n=e.i(13581),l=e.i(94757),c=e.i(75016),d=e.i(29487);let o=[{id:"editor",label:"Code & configuration",path:"/actions/"},{id:"runs",label:"Runs",path:"/runs/"},{id:"schedules",label:"Schedule",path:"/schedules/"},{id:"webhooks",label:"Webhooks",path:"/webhooks/"}];function u({action:e,current:t}){let i=e.project,r=new URLSearchParams({project:i,action:e.id});return(0,s.jsxs)("div",{className:"mb-6 min-w-0 space-y-3",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,s.jsxs)(c.f,{className:"inline-flex items-center gap-1 text-sm",href:`/actions/?${new URLSearchParams({project:i}).toString()}`,children:[(0,s.jsx)(a.f,{size:14,"aria-hidden":"true"})," All actions"]}),(0,s.jsx)("span",{className:"text-slate-300","aria-hidden":"true",children:"/"}),(0,s.jsx)("strong",{className:"min-w-0 break-words",children:e.name})]}),(0,s.jsx)("nav",{className:"flex flex-wrap gap-2","aria-label":"Action sections",children:o.map(e=>(0,s.jsx)(c.f,{href:`${e.path}?${r.toString()}`,"aria-current":t===e.id?"page":void 0,className:t===e.id?"rounded-md bg-indigo-50 px-3 py-2 text-sm font-medium text-indigo-700":"rounded-md px-3 py-2 text-sm text-slate-600 hover:bg-slate-100",children:e.label},e.id))})]})}function h({project:e,actionId:i,current:a,children:l}){let o=(0,t.useCallback)(async s=>{if(!i)return;let t=await r.V.actions.get.query({id:i},{signal:s});if(t.project!==e)throw Error("This action is not available in the selected project.");return t},[i,e]),x=(0,n.f)(o);return i&&(x.isLoading||x.error||x.data?.id!==i)?(0,s.jsx)(d.f,{...x}):(0,s.jsxs)(s.Fragment,{children:[x.data?(0,s.jsx)(u,{action:x.data,current:a}):(0,s.jsx)("p",{className:"mb-5",children:(0,s.jsx)(c.f,{href:`/actions/?${new URLSearchParams({project:e}).toString()}`,children:"Back to project actions"})}),l(i)]})}e.s(["F",0,u,"c",0,function({current:e,children:t}){let{selected:a}=(0,l.useWorkspace)(),r=(0,i.useSearchParams)().get("action")??"";return(0,s.jsx)(h,{project:a,actionId:r,current:e,children:t},`${a}:${r}`)}])},44555,e=>{"use strict";var s=e.i(18050),t=e.i(56420);let i={name:"shield-check",size:24,node:[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]};i.node;let a=(0,t.f)(i);var r=e.i(71645),n=e.i(73656),l=e.i(95813),c=e.i(13581),d=e.i(15080),o=e.i(19455),u=e.i(29487);e.s(["f",0,function({runId:e,openRun:t}){let i=(0,c.f)(d.i,5e3),[h,x]=(0,r.useState)(""),[p,j]=(0,r.useState)(""),m=i.data?.filter(s=>"pending"===s.status&&(!e||s.run===e))??[],f=async(e,s)=>{x(e),j("");try{await n.V.approvals.decide.mutate({id:e,decision:s}),await i.refresh()}catch(e){j((0,l.f)(e))}finally{x("")}};return(0,s.jsxs)("section",{className:"panel",children:[(0,s.jsxs)("div",{className:"panel-title",children:[(0,s.jsxs)("h2",{children:[(0,s.jsx)(a,{size:18})," ",e?"Run approvals":"Approval queue"]}),(0,s.jsxs)("span",{className:"badge",children:[m.length," pending"]})]}),(0,s.jsx)(u.f,{...i}),p?(0,s.jsx)("p",{className:"error",role:"alert",children:p}):void 0,i.isLoading||0!==m.length?void 0:(0,s.jsxs)("div",{className:"resource-empty",children:[(0,s.jsx)(a,{size:28}),(0,s.jsx)("h3",{children:"All caught up"}),(0,s.jsx)("p",{children:"No decisions are waiting for you."})]}),m.map(e=>(0,s.jsxs)("article",{className:"approval-card",children:[(0,s.jsx)("span",{className:"eyebrow",children:"Human approval required"}),(0,s.jsx)("p",{className:"approval-prompt",children:e.prompt}),(0,s.jsxs)("div",{className:"row",children:[(0,s.jsx)(o.f,{disabled:!!h,onClick:()=>{f(e.id,"approved")},children:h===e.id?"Saving decision…":"Approve"}),(0,s.jsx)(o.f,{variant:"outline",disabled:!!h,onClick:()=>{f(e.id,"denied")},children:"Deny"}),t?(0,s.jsx)(o.f,{variant:"ghost",onClick:()=>{t(e.run)},children:"Inspect run"}):void 0]})]},e.id))]})}],44555)},36174,e=>{"use strict";var s=e.i(18050),t=e.i(11241),i=e.i(62368),a=e.i(95925),r=e.i(29272),n=e.i(71645),l=e.i(73656),c=e.i(95813),d=e.i(13581),o=e.i(15080),u=e.i(19455),h=e.i(85951),x=e.i(10505),p=e.i(29487),j=e.i(90409),m=e.i(59241),f=e.i(12102),v=e.i(75016),g=e.i(93479),y=e.i(24687);function b({id:e}){let[t,i]=(0,n.useState)(""),[a,r]=(0,n.useState)('{"type":"object"}'),[d,o]=(0,n.useState)("{}"),[h,x]=(0,n.useState)(!1),[p,j]=(0,n.useState)(""),[m,k]=(0,n.useState)(""),[w,N]=(0,n.useState)("");async function S(){x(!0),N(""),j("");try{let s=await l.V.runs.promote.mutate({id:e,name:t.trim(),input_schema:(0,f.J)(a),output_schema:(0,f.J)(d)});k(s.action),j(`Saved exact run source as version ${String(s.version.number)} of ${t.trim()} (action ${s.action}).`)}catch(e){N((0,c.f)(e))}finally{x(!1)}}return(0,s.jsxs)("details",{children:[(0,s.jsx)("summary",{children:"Promote accepted source to a saved action"}),(0,s.jsx)("p",{children:"The server copies this run’s exact source and SDK provenance. Run inputs remain examples and are not saved as defaults."}),(0,s.jsxs)("label",{children:["New action name",(0,s.jsx)(g.f,{value:t,disabled:h,onChange:e=>{i(e.target.value)}})]}),(0,s.jsxs)("label",{children:["Input schema (JSON)",(0,s.jsx)(y.f,{className:"code",value:a,disabled:h,onChange:e=>{r(e.target.value)}})]}),(0,s.jsxs)("label",{children:["Output schema (JSON)",(0,s.jsx)(y.f,{className:"code",value:d,disabled:h,onChange:e=>{o(e.target.value)}})]}),(0,s.jsx)(u.f,{disabled:h||!t.trim(),onClick:()=>{S()},children:"Promote exact source"}),w?(0,s.jsx)("p",{role:"alert",className:"error",children:w}):null,p?(0,s.jsx)("p",{role:"status",children:p}):null,m?(0,s.jsx)(v.f,{href:`/actions/?action=${encodeURIComponent(m)}`,children:"Open saved action"}):null]})}var k=e.i(44555);function w(e){let s=new Blob([e.content],{type:e.media_type}),t=URL.createObjectURL(s),i=document.createElement("a");i.href=t,i.download=e.name,i.click(),URL.revokeObjectURL(t)}function N({run:e,hasCheckReport:t}){return t?(0,s.jsx)(m.f,{output:e.output}):"succeeded"!==e.status?(0,s.jsx)("p",{children:x.B.includes(e.status)?"This run is still in progress. Its result will appear here.":`This run ${e.status}. Review the trace before retrying.`}):"chat"===e.operation?(0,s.jsx)(h.f,{content:(0,x.A)(e.output)}):(0,s.jsx)("pre",{children:(0,x.A)(e.output)||"Completed without output."})}let S={session:"Session result",test:"Mocked test results",validate:"Semantic validation diagnostics"};e.s(["T",0,function({id:e,projects:h,back:m,openRun:f}){let v=(0,j.f)(e),g=(0,d.f)(o.K),[y,C]=(0,n.useState)(!1),[A,z]=(0,n.useState)(""),_=v.data?.run,R=void 0!==_&&("test"===_.operation||"validate"===_.operation)&&null!==_.output&&"object"==typeof _.output&&Object.hasOwn(_.output,"result"),L=async s=>{C(!0),z("");try{if("cancel"===s)await l.V.runs.cancel.mutate({id:e});else{let s=await l.V.runs.retry.mutate({id:e,idempotency_key:crypto.randomUUID()});f(s.id)}await v.refresh()}catch(e){z((0,c.f)(e))}finally{C(!1)}};return(0,s.jsxs)("div",{className:"run-detail",children:[(0,s.jsxs)(u.f,{variant:"ghost",onClick:m,children:[(0,s.jsx)(t.f,{size:14})," All runs"]}),(0,s.jsx)(p.f,{...v}),A?(0,s.jsx)("p",{className:"error",role:"alert",children:A}):void 0,_?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("section",{className:"panel",children:[(0,s.jsxs)("div",{className:"panel-title",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("p",{className:"eyebrow",children:["RUN ",_.id.slice(0,8)]}),(0,s.jsxs)("h2",{children:[h.find(e=>e.id===_.project)?.name??"Project"," ","· ",(0,x.T)(_.operation)]})]}),(0,s.jsxs)("div",{className:"row",children:[(0,s.jsx)(x.k,{status:_.status}),x.B.includes(_.status)?(0,s.jsxs)(u.f,{variant:"outline",disabled:y||_.cancel_requested,onClick:()=>{L("cancel")},children:[(0,s.jsx)(r.f,{size:13}),_.cancel_requested?"Cancellation requested":"Cancel run"]}):void 0,["action","code","validate","test"].includes(_.operation)&&["failed","interrupted","cancelled"].includes(_.status)?(0,s.jsxs)(u.f,{variant:"outline",disabled:y,onClick:()=>{L("retry")},children:[(0,s.jsx)(a.f,{size:13})," Retry run"]}):void 0]})]}),(0,s.jsxs)("p",{className:"small",children:["Created ",new Date(_.created_at).toLocaleString()," · Updated"," ",new Date(_.updated_at).toLocaleString()]}),_.retry_of?(0,s.jsx)(u.f,{variant:"link",onClick:()=>{f(_.retry_of??"")},children:"View original run"}):void 0,_.error?(0,s.jsx)("div",{className:"error",role:"alert",children:_.error}):void 0,(0,s.jsxs)("dl",{children:[(0,s.jsx)("dt",{children:"Origin"}),(0,s.jsxs)("dd",{children:[_.origin," ",_.origin_reference]}),(0,s.jsx)("dt",{children:"Originating client"}),(0,s.jsx)("dd",{children:_.client_token??"No client token (historical attribution may be unknown)"}),(0,s.jsx)("dt",{children:"SDK revision"}),(0,s.jsx)("dd",{children:(0,x.A)(_.sdk_revision)||"Unknown"}),(0,s.jsx)("dt",{children:"Configuration revision"}),(0,s.jsx)("dd",{children:(0,x.A)(_.configuration_revision)||"Unknown"}),(0,s.jsx)("dt",{children:"Immutable action version"}),(0,s.jsx)("dd",{children:_.action_version??"One-off source / none"}),(0,s.jsx)("dt",{children:"Source digest"}),(0,s.jsx)("dd",{children:(0,x.A)(_.source_digest)||"Unknown"})]}),null===_.source?null:(0,s.jsxs)("details",{children:[(0,s.jsx)("summary",{children:"Accepted source"}),(0,s.jsx)("pre",{children:(0,x.A)(_.source)})]}),"code"===_.operation&&null!==_.source?(0,s.jsx)(b,{id:_.id},_.id):null,(0,s.jsx)("h3",{children:S[_.operation]??"Outcome"}),(0,s.jsx)(N,{run:_,hasCheckReport:R}),(0,s.jsxs)("details",{children:[(0,s.jsx)("summary",{children:"Run inputs"}),(0,s.jsx)("pre",{children:(0,x.A)(_.inputs)})]})]}),"waiting_approval"===_.status?(0,s.jsx)(k.f,{runId:e}):void 0,(0,s.jsxs)("section",{className:"panel",children:[(0,s.jsx)("h2",{children:"Artifacts"}),(0,s.jsx)(p.f,{...g}),g.data?.filter(s=>s.run===e).length===0?(0,s.jsx)("p",{className:"small",children:"No artifacts were saved by this run."}):void 0,g.data?.filter(s=>s.run===e).map(e=>(0,s.jsxs)("details",{children:[(0,s.jsx)("summary",{children:e.name}),(0,s.jsxs)(u.f,{variant:"outline",size:"sm",onClick:()=>{w(e)},children:[(0,s.jsx)(i.f,{size:13}),"Download"]}),(0,s.jsx)("pre",{children:e.content})]},e.id))]}),"session"===_.operation?null:(0,s.jsxs)("section",{className:"panel",children:[(0,s.jsx)("h2",{children:"Execution trace"}),v.data?.events.length===0?(0,s.jsx)("p",{className:"small",children:"Waiting for the first execution event."}):void 0,(0,s.jsx)("ol",{className:"run-timeline",children:v.data?.events.map(e=>(0,s.jsxs)("li",{children:[(0,s.jsx)("span",{className:"timeline-dot"}),(0,s.jsxs)("details",{children:[(0,s.jsxs)("summary",{children:[(0,s.jsx)("strong",{children:e.kind.replaceAll("."," ")}),(0,s.jsx)("time",{children:new Date(e.created_at).toLocaleTimeString()})]}),(0,s.jsx)("pre",{children:(0,x.A)(e.data)})]})]},e.sequence))})]})]}):void 0]})},"t",0,w],36174)},10505,79432,e=>{"use strict";var s=e.i(18050),t=e.i(56420);let i={name:"activity",size:24,node:[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]};i.node;let a=(0,t.f)(i);e.s(["f",0,a],79432);var r=e.i(51757);let n={name:"clock-3",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]]};n.node;let l=(0,t.f)(n),c={name:"shield-exclamation-point",size:24,node:[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],aliases:["shield-alert"]};c.node;let d=(0,t.f)(c),o={name:"circle-x",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],aliases:["x-circle"]};o.node;let u=(0,t.f)(o);function h(e){return({chat:"Chat task",code:"Code execution",session:"Execution session",action:"Action run",validate:"Code validation",test:"Action tests"})[e]??e.replaceAll("_"," ")}e.s(["k",0,function({status:e}){let t={succeeded:r.f,waiting_approval:d,running:a,queued:l,failed:u,cancelled:u,interrupted:u}[e]??l;return(0,s.jsxs)("span",{className:`run-status status-${e}`,children:[(0,s.jsx)(t,{size:13,"aria-hidden":"true"}),e.replaceAll("_"," ")]})},"B",0,["queued","running","waiting_approval"],"A",0,function(e){return void 0===e?"":"string"==typeof e?e:JSON.stringify(e,void 0,2)},"N",0,function(e,s){let t=s.find(s=>s.id===e.project)?.name??"Project";return"chat"===e.operation?`${t} \xb7 ${(function(e,s){if(null!==e&&"object"==typeof e&&Object.hasOwn(e,s)){let t=Reflect.get(e,s);if("string"==typeof t)return t}return""})(e.inputs,"message").slice(0,70)}`:`${t} \xb7 ${h(e.operation)}`},"T",0,h],10505)},90409,59241,e=>{"use strict";var s=e.i(71645),t=e.i(73656),i=e.i(13581);e.s(["f",0,function(e){let a=(0,s.useCallback)(async s=>{let[i,a]=await Promise.all([t.V.runs.get.query({id:e},{signal:s}),t.V.runs.events.query({id:e},{signal:s})]);return{run:i,events:a}},[e]),r=(0,i.f)(a,3e3),n=r.data?.run.id===e?r.data:void 0,l=void 0!==n,{refresh:c}=r;return(0,s.useEffect)(()=>{if(l)return function(e,s,i=t.V.runs.stream.subscribe){let a,r=!0,n=()=>{r&&!a&&(a=setTimeout(()=>{a=void 0,r&&s()},400))},l=i({id:e},{onData:n,onComplete(){r&&(clearTimeout(a),a=void 0,s())},onError:n});return()=>{r=!1,clearTimeout(a),l.unsubscribe()}}(e,c)},[e,l,c]),{...r,data:n}}],90409);var a=e.i(18050),r=e.i(10505);function n(e){return"object"!=typeof e||null===e||Array.isArray(e)?void 0:e}e.s(["f",0,function({output:e}){let s=n(e),t=n(s?.result)??s;if(!t)return null;let i=n(t.validation)??t,l=Array.isArray(i.diagnostics)?i.diagnostics:[],c=Array.isArray(t.cases)?t.cases:[];return(0,a.jsxs)("div",{children:["boolean"==typeof i.valid?(0,a.jsx)("p",{children:i.valid?"Source passed semantic validation.":"Source failed semantic validation."}):null,l.length>0?(0,a.jsx)("ul",{children:l.map((e,s)=>{let t=n(e);return(0,a.jsxs)("li",{children:["Line ",(0,r.A)(t?.line),", column"," ",(0,r.A)(t?.column),":"," ",(0,r.A)(t?.message)]},s)})}):null,c.length>0?(0,a.jsxs)("table",{children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{children:"Case"}),(0,a.jsx)("th",{children:"Result"}),(0,a.jsx)("th",{children:"Details"})]})}),(0,a.jsx)("tbody",{children:c.map((e,s)=>{let t=n(e);return(0,a.jsxs)("tr",{children:[(0,a.jsx)("td",{children:(0,r.A)(t?.name)}),(0,a.jsx)("td",{children:t?.passed===!0?"Passed":"Failed"}),(0,a.jsxs)("td",{children:["string"==typeof t?.error&&""!==t.error?(0,a.jsx)("p",{children:t.error}):null,Array.isArray(t?.violations)?(0,a.jsx)("pre",{children:(0,r.A)(t.violations)}):null,(0,a.jsxs)("details",{children:[(0,a.jsx)("summary",{children:"Actual output and logs"}),(0,a.jsx)("pre",{children:(0,r.A)(t?.actual)}),(0,a.jsx)("pre",{children:(0,r.A)(t?.logs)})]})]})]},s)})})]}):null]})}],59241)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,96001,s=>{s.v(t=>Promise.all(["static/chunks/119rk6qs93dvi.js"].map(t=>s.l(t))).then(()=>t(160)))},67426,s=>{s.v(t=>Promise.all(["static/chunks/2lxgam-nk-e9a.js"].map(t=>s.l(t))).then(()=>t(99279)))}]);