thursday-agent 0.30.0 → 0.31.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 (197) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +3 -3
  3. package/.next/prerender-manifest.json +3 -3
  4. package/.next/server/app/_global-error.html +1 -1
  5. package/.next/server/app/_global-error.rsc +1 -1
  6. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  7. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  8. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  9. package/.next/server/app/_not-found/page.js.nft.json +1 -1
  10. package/.next/server/app/_not-found.html +1 -1
  11. package/.next/server/app/_not-found.rsc +1 -1
  12. package/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  13. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  14. package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  15. package/.next/server/app/api/artifact/route.js.nft.json +1 -1
  16. package/.next/server/app/api/bot/memory/files/route.js.nft.json +1 -1
  17. package/.next/server/app/api/bot/memory/route.js.nft.json +1 -1
  18. package/.next/server/app/api/bot/route.js.nft.json +1 -1
  19. package/.next/server/app/api/bot/thread/file/route.js.nft.json +1 -1
  20. package/.next/server/app/api/bot/thread/lessons/route.js.nft.json +1 -1
  21. package/.next/server/app/api/bot/thread/route.js.nft.json +1 -1
  22. package/.next/server/app/api/bot/tool-result/[id]/route.js.nft.json +1 -1
  23. package/.next/server/app/api/config/route.js.nft.json +1 -1
  24. package/.next/server/app/api/file/[...path]/route.js.nft.json +1 -1
  25. package/.next/server/app/api/llm-model/automatic/route.js.nft.json +1 -1
  26. package/.next/server/app/api/llm-model/catalog/[provider]/route.js.nft.json +1 -1
  27. package/.next/server/app/api/llm-model/credits/[provider]/route.js.nft.json +1 -1
  28. package/.next/server/app/api/llm-model/route.js.nft.json +1 -1
  29. package/.next/server/app/api/llm-model/subscription/route.js.nft.json +1 -1
  30. package/.next/server/app/api/mcp/[name]/route.js.nft.json +1 -1
  31. package/.next/server/app/api/mcp/oauth/callback/route.js.nft.json +1 -1
  32. package/.next/server/app/api/mcp/route.js.nft.json +1 -1
  33. package/.next/server/app/api/mcp/tools/route.js.nft.json +1 -1
  34. package/.next/server/app/api/memory/edit/route.js.nft.json +1 -1
  35. package/.next/server/app/api/reach/route.js.nft.json +1 -1
  36. package/.next/server/app/api/routine/route.js.nft.json +1 -1
  37. package/.next/server/app/api/signins/route.js.nft.json +1 -1
  38. package/.next/server/app/api/skills/[source]/[name]/route.js.nft.json +1 -1
  39. package/.next/server/app/api/skills/route.js.nft.json +1 -1
  40. package/.next/server/app/api/thursday/call/end/route.js.nft.json +1 -1
  41. package/.next/server/app/api/thursday/call/plan/route.js.nft.json +1 -1
  42. package/.next/server/app/api/thursday/call/route.js.nft.json +1 -1
  43. package/.next/server/app/api/thursday/settings/route.js.nft.json +1 -1
  44. package/.next/server/app/api/thursday/text/route.js.nft.json +1 -1
  45. package/.next/server/app/api/thursday/tool-call/route.js.nft.json +1 -1
  46. package/.next/server/app/api/update/route.js.nft.json +1 -1
  47. package/.next/server/app/api/workspace/files/route.js.nft.json +1 -1
  48. package/.next/server/app/api/workspace/route.js.nft.json +1 -1
  49. package/.next/server/app/artifact/[...path]/page/server-reference-manifest.json +11 -11
  50. package/.next/server/app/artifact/[...path]/page.js.nft.json +1 -1
  51. package/.next/server/app/artifact/[...path]/page_client-reference-manifest.js +1 -1
  52. package/.next/server/app/page/server-reference-manifest.json +71 -71
  53. package/.next/server/app/page.js.nft.json +1 -1
  54. package/.next/server/app/page_client-reference-manifest.js +1 -1
  55. package/.next/server/chunks/[root-of-the-server]__0sg3_9d._.js +1 -1
  56. package/.next/server/chunks/[root-of-the-server]__0wnd1ac._.js +1 -1
  57. package/.next/server/chunks/[root-of-the-server]__10x2qg8._.js +2 -2
  58. package/.next/server/chunks/[root-of-the-server]__1bk734v._.js +1 -1
  59. package/.next/server/chunks/[root-of-the-server]__1rs2v4h._.js +1 -1
  60. package/.next/server/chunks/_0jzv71c._.js +2 -2
  61. package/.next/server/chunks/ssr/[root-of-the-server]__0auk-ke._.js +1 -1
  62. package/.next/server/chunks/ssr/{[root-of-the-server]__0rpm20m._.js → [root-of-the-server]__0k7utnr._.js} +2 -2
  63. package/.next/server/chunks/ssr/{[root-of-the-server]__0x2--_p._.js → [root-of-the-server]__0q3gl-j._.js} +2 -2
  64. package/.next/server/chunks/ssr/{[root-of-the-server]__0ama9d0._.js → [root-of-the-server]__0w1mcuc._.js} +2 -2
  65. package/.next/server/chunks/ssr/{[root-of-the-server]__145268e._.js → [root-of-the-server]__188x-0h._.js} +2 -2
  66. package/.next/server/chunks/ssr/{[root-of-the-server]__0p0cgo1._.js → [root-of-the-server]__1e4oxhz._.js} +2 -2
  67. package/.next/server/chunks/ssr/[root-of-the-server]__1j-bkt7._.js +1 -1
  68. package/.next/server/chunks/ssr/{[root-of-the-server]__153-ebp._.js → [root-of-the-server]__20dnr0-._.js} +2 -2
  69. package/.next/server/chunks/ssr/{_1fua8fv._.js → _058z7m3._.js} +2 -2
  70. package/.next/server/chunks/ssr/{_0rm-9aj._.js → _0a6m-4f._.js} +2 -2
  71. package/.next/server/chunks/ssr/_0akma_h._.js +1 -1
  72. package/.next/server/chunks/ssr/{_1q30h74._.js → _0bapnk-._.js} +2 -2
  73. package/.next/server/chunks/ssr/_0e7c-z3._.js +3 -0
  74. package/.next/server/chunks/ssr/_0gx6qzr._.js +1 -1
  75. package/.next/server/chunks/ssr/{_0k06tdw._.js → _0mwfawz._.js} +3 -3
  76. package/.next/server/chunks/ssr/_0pg2mgq._.js +1 -1
  77. package/.next/server/chunks/ssr/{_18cjc9o._.js → _0r-q97k._.js} +2 -2
  78. package/.next/server/chunks/ssr/{_1x_6jyh._.js → _0xs4a-f._.js} +2 -2
  79. package/.next/server/chunks/ssr/{_0732nef._.js → _0zajldg._.js} +2 -2
  80. package/.next/server/chunks/ssr/_14f64h2._.js +1 -1
  81. package/.next/server/chunks/ssr/_16_7zeo._.js +1 -1
  82. package/.next/server/chunks/ssr/_17fa2ns._.js +5 -5
  83. package/.next/server/chunks/ssr/{_0p18b0z._.js → _18dem-7._.js} +2 -2
  84. package/.next/server/chunks/ssr/_1_px1o-._.js +1 -1
  85. package/.next/server/chunks/ssr/_1e_9qjr._.js +1 -1
  86. package/.next/server/chunks/ssr/_1ehd80b._.js +1 -1
  87. package/.next/server/chunks/ssr/_1f59vze._.js +1 -1
  88. package/.next/server/chunks/ssr/_1neoj22._.js +1 -1
  89. package/.next/server/chunks/ssr/{_0l_qakv._.js → _1p5s8eb._.js} +2 -2
  90. package/.next/server/chunks/ssr/_1soynbw._.js +2 -2
  91. package/.next/server/chunks/ssr/{components_ui_markdown-body_tsx_0ywzjrl._.js → components_ui_markdown-body_tsx_0qqkcnl._.js} +2 -2
  92. package/.next/server/chunks/ssr/features_0rrgq_t._.js +1 -1
  93. package/.next/server/chunks/ssr/features_ai_components_model-picker_tsx_0ucb1y9._.js +1 -1
  94. package/.next/server/chunks/ssr/features_bot_components_01ye2wp._.js +1 -1
  95. package/.next/server/chunks/ssr/features_bot_components_bot-setting_tsx_01ajft6._.js +1 -1
  96. package/.next/server/chunks/ssr/features_bot_components_thread-setting_tsx_0yae7zy._.js +1 -1
  97. package/.next/server/chunks/ssr/features_config_components_config-setting_tsx_0xfwqdg._.js +1 -1
  98. package/.next/server/chunks/ssr/features_connectors_components_mcp-setting_tsx_0jmbgvp._.js +1 -1
  99. package/.next/server/chunks/ssr/features_memory_components_memory-setting_tsx_0oa43sw._.js +1 -1
  100. package/.next/server/chunks/ssr/features_routine_components_routine-setting_tsx_055fknz._.js +1 -1
  101. package/.next/server/chunks/ssr/features_skills_components_skills-setting_tsx_1wtuuip._.js +1 -1
  102. package/.next/server/chunks/ssr/features_thursday_components_thursday-setting_tsx_1_6ydrc._.js +1 -1
  103. package/.next/server/chunks/ssr/{node_modules_0er1nmg._.js → node_modules_0-1vgbg._.js} +2 -2
  104. package/.next/server/chunks/ssr/{node_modules_0a1kt26._.js → node_modules_0-ckar9._.js} +1 -1
  105. package/.next/server/chunks/ssr/{node_modules_0ze7604._.js → node_modules_00k__rl._.js} +1 -1
  106. package/.next/server/chunks/ssr/{node_modules_1bjctcm._.js → node_modules_00pm_md._.js} +1 -1
  107. package/.next/server/chunks/ssr/{node_modules_1axn4aw._.js → node_modules_01awxzc._.js} +2 -2
  108. package/.next/server/chunks/ssr/{node_modules_0ahwwc6._.js → node_modules_02r5cr9._.js} +2 -2
  109. package/.next/server/chunks/ssr/{node_modules_1vmqt-a._.js → node_modules_02y56-t._.js} +1 -1
  110. package/.next/server/chunks/ssr/{node_modules_060s01j._.js → node_modules_03qy_-5._.js} +2 -2
  111. package/.next/server/chunks/ssr/{node_modules_116k0n3._.js → node_modules_04-wxwz._.js} +1 -1
  112. package/.next/server/chunks/ssr/{node_modules_0u78wn3._.js → node_modules_062omwz._.js} +1 -1
  113. package/.next/server/chunks/ssr/{node_modules_0ntw_qg._.js → node_modules_06bncpv._.js} +1 -1
  114. package/.next/server/chunks/ssr/{node_modules_1mwxdhp._.js → node_modules_06c813r._.js} +1 -1
  115. package/.next/server/chunks/ssr/{node_modules_08xo4p2._.js → node_modules_0bnvlu3._.js} +2 -2
  116. package/.next/server/chunks/ssr/{node_modules_1d7evv9._.js → node_modules_0bo8_3v._.js} +1 -1
  117. package/.next/server/chunks/ssr/{node_modules_1le-lim._.js → node_modules_0cmpor-._.js} +2 -2
  118. package/.next/server/chunks/ssr/{node_modules_0py4_6y._.js → node_modules_0dmey3c._.js} +1 -1
  119. package/.next/server/chunks/ssr/{node_modules_0mujceo._.js → node_modules_0e82d9d._.js} +1 -1
  120. package/.next/server/chunks/ssr/{node_modules_03gt5eg._.js → node_modules_0fv219v._.js} +1 -1
  121. package/.next/server/chunks/ssr/{node_modules_09e0lw8._.js → node_modules_0i60h5u._.js} +1 -1
  122. package/.next/server/chunks/ssr/{node_modules_1ih7lxu._.js → node_modules_0p6fpim._.js} +2 -2
  123. package/.next/server/chunks/ssr/{node_modules_1dm5c-u._.js → node_modules_0qfnopf._.js} +1 -1
  124. package/.next/server/chunks/ssr/{node_modules_1tfn213._.js → node_modules_0upd5np._.js} +2 -2
  125. package/.next/server/chunks/ssr/{node_modules_1lnx_h4._.js → node_modules_0uqdbkl._.js} +1 -1
  126. package/.next/server/chunks/ssr/{node_modules_1cxx8tm._.js → node_modules_0v_sl8f._.js} +1 -1
  127. package/.next/server/chunks/ssr/{node_modules_1_c3zat._.js → node_modules_0vz0i7n._.js} +2 -2
  128. package/.next/server/chunks/ssr/{node_modules_1fdivhl._.js → node_modules_0wuqamc._.js} +1 -1
  129. package/.next/server/chunks/ssr/{node_modules_1depc7o._.js → node_modules_0ww0cj5._.js} +1 -1
  130. package/.next/server/chunks/ssr/{node_modules_16hmz5b._.js → node_modules_0xyg93a._.js} +1 -1
  131. package/.next/server/chunks/ssr/{node_modules_1kpg87p._.js → node_modules_0yt7v4_._.js} +1 -1
  132. package/.next/server/chunks/ssr/{node_modules_1q2a30m._.js → node_modules_10d_dh1._.js} +2 -2
  133. package/.next/server/chunks/ssr/{node_modules_03ytewb._.js → node_modules_12mf6-b._.js} +1 -1
  134. package/.next/server/chunks/ssr/{node_modules_0i2j6g6._.js → node_modules_16gjro8._.js} +1 -1
  135. package/.next/server/chunks/ssr/{node_modules_05yikon._.js → node_modules_16n2qm5._.js} +1 -1
  136. package/.next/server/chunks/ssr/{node_modules_1soi3y1._.js → node_modules_17cgr9d._.js} +2 -2
  137. package/.next/server/chunks/ssr/{node_modules_208s6_i._.js → node_modules_18-rz5f._.js} +1 -1
  138. package/.next/server/chunks/ssr/{node_modules_0ka66-h._.js → node_modules_1_sver8._.js} +1 -1
  139. package/.next/server/chunks/ssr/{node_modules_15_65ve._.js → node_modules_1_w2wh5._.js} +1 -1
  140. package/.next/server/chunks/ssr/{node_modules_0f3769j._.js → node_modules_1aa913r._.js} +1 -1
  141. package/.next/server/chunks/ssr/{node_modules_19xrd6b._.js → node_modules_1aptu5w._.js} +2 -2
  142. package/.next/server/chunks/ssr/{node_modules_0fi5we8._.js → node_modules_1cu3h7h._.js} +1 -1
  143. package/.next/server/chunks/ssr/{node_modules_0sk7kv9._.js → node_modules_1d3101y._.js} +1 -1
  144. package/.next/server/chunks/ssr/{node_modules_0mihldg._.js → node_modules_1d3tnng._.js} +1 -1
  145. package/.next/server/chunks/ssr/{node_modules_07k-xj6._.js → node_modules_1dd8593._.js} +1 -1
  146. package/.next/server/chunks/ssr/{node_modules_0c2vpni._.js → node_modules_1evm05k._.js} +2 -2
  147. package/.next/server/chunks/ssr/{node_modules_1sphzx9._.js → node_modules_1fs4p56._.js} +1 -1
  148. package/.next/server/chunks/ssr/{node_modules_0qu8a5o._.js → node_modules_1jsmkvt._.js} +1 -1
  149. package/.next/server/chunks/ssr/{node_modules_0ted14c._.js → node_modules_1lj69na._.js} +2 -2
  150. package/.next/server/chunks/ssr/{node_modules_02p2t58._.js → node_modules_1p53mn1._.js} +1 -1
  151. package/.next/server/chunks/ssr/{node_modules_1gxpcyd._.js → node_modules_1tecvpz._.js} +1 -1
  152. package/.next/server/chunks/ssr/{node_modules_1w8ljz0._.js → node_modules_1voere2._.js} +2 -2
  153. package/.next/server/chunks/ssr/{node_modules_16ki2uq._.js → node_modules_1wa6ii9._.js} +1 -1
  154. package/.next/server/chunks/ssr/{node_modules_0e7nwfw._.js → node_modules_1wvsdzr._.js} +1 -1
  155. package/.next/server/chunks/ssr/{node_modules_0umtxxj._.js → node_modules_1x6dj-b._.js} +1 -1
  156. package/.next/server/chunks/ssr/{node_modules_1k-0av-._.js → node_modules_1yr3qqm._.js} +1 -1
  157. package/.next/server/chunks/ssr/{node_modules_0-s3xam._.js → node_modules_1z14x_s._.js} +1 -1
  158. package/.next/server/chunks/ssr/{node_modules_0keiwh2._.js → node_modules_1zjjxof._.js} +2 -2
  159. package/.next/server/chunks/ssr/{node_modules_katex_dist_katex_mjs_0jhievg._.js → node_modules_katex_dist_katex_mjs_0lovye-._.js} +1 -1
  160. package/.next/server/chunks/ssr/{node_modules_katex_dist_katex_mjs_1zcod1m._.js → node_modules_katex_dist_katex_mjs_1zzajtz._.js} +1 -1
  161. package/.next/server/middleware-build-manifest.js +3 -3
  162. package/.next/server/pages/404.html +1 -1
  163. package/.next/server/pages/500.html +1 -1
  164. package/.next/server/server-reference-manifest.js +1 -1
  165. package/.next/server/server-reference-manifest.json +72 -72
  166. package/.next/static/chunks/{38rbtwatw658l.js → 02p1qzv-y8ojn.js} +1 -1
  167. package/.next/static/chunks/{21wm184xoke98.js → 0c8kcm5bf10hs.js} +5 -5
  168. package/.next/static/chunks/{0piazplcpaho6.js → 0msqr7mircvg3.js} +1 -1
  169. package/.next/static/chunks/{3da8rr3q6pt0b.js → 0tal1quf58fcp.js} +1 -1
  170. package/.next/static/chunks/{3iwdx3_gikxbg.js → 0tbosthr28whk.js} +2 -2
  171. package/.next/static/chunks/{0ocx6nt76fc71.js → 0yqy8h5u32vok.js} +1 -1
  172. package/.next/static/chunks/{3odtl00mfb4u7.js → 0zc0u62q44d6f.js} +1 -1
  173. package/.next/static/chunks/{0u_wx1-lmoae2.js → 17gy2mvd8ek83.js} +1 -1
  174. package/.next/static/chunks/{3x2goglbfw5t7.js → 1_8pwrnp1_qvs.js} +1 -1
  175. package/.next/static/chunks/{2v486bh_6kl11.js → 1ck5wi_ba02gc.js} +1 -1
  176. package/.next/static/chunks/{3i12sqqp1v8a8.js → 1hqsq7opotb1d.js} +1 -1
  177. package/.next/static/chunks/{29p2mdrn-z1oz.js → 1ih5j-j1he9w6.js} +1 -1
  178. package/.next/static/chunks/1jreuiyyp97su.js +1 -0
  179. package/.next/static/chunks/{2biit-egkb-xl.js → 1nt0py_w8q-id.js} +2 -2
  180. package/.next/static/chunks/{0oo3vqzbrckzw.js → 2ay3fjagqli-o.js} +1 -1
  181. package/.next/static/chunks/{25-zh-0nfxqyg.js → 2p7lpzd59ius6.js} +1 -1
  182. package/.next/static/chunks/{1fignuuc030t2.js → 2rzym-27bm4t_.js} +1 -1
  183. package/.next/static/chunks/2sg43yk9jd5-z.js +4 -0
  184. package/.next/static/chunks/{2cciu1ow-svbf.js → 2twk4sgtkwgxo.js} +1 -1
  185. package/.next/static/chunks/{0totfwrzgu9zy.js → 3jpa6ycdis1fh.js} +2 -2
  186. package/.next/static/chunks/{0nev6q2iq077s.js → 3mc-k-4e4apqr.js} +1 -1
  187. package/.next/static/chunks/{3k_xm_e4grb9u.js → 3o8wxqca38o3_.js} +1 -1
  188. package/.next/static/chunks/{3wblbyhomh9va.js → 3t1sluk82tekr.js} +1 -1
  189. package/.next/static/chunks/{078xraafllix3.js → 42zzm744prmio.js} +1 -1
  190. package/.next/static/chunks/{152u4p6c_6spk.js → 43tcpam1sdo85.js} +1 -1
  191. package/package.json +1 -1
  192. package/.next/server/chunks/ssr/_0lqzdd0._.js +0 -3
  193. package/.next/static/chunks/03m85vcsjg0qk.js +0 -1
  194. package/.next/static/chunks/2kt0nc5m372ie.js +0 -4
  195. /package/.next/static/{nXUvWsiGKRvNRk8kqeJ-u → UR_YhoU23yPaytwfmeAS2}/_buildManifest.js +0 -0
  196. /package/.next/static/{nXUvWsiGKRvNRk8kqeJ-u → UR_YhoU23yPaytwfmeAS2}/_clientMiddlewareManifest.js +0 -0
  197. /package/.next/static/{nXUvWsiGKRvNRk8kqeJ-u → UR_YhoU23yPaytwfmeAS2}/_ssgManifest.js +0 -0
@@ -1,4 +1,4 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,986530,e=>{"use strict";var t=e.i(843476),n=e.i(225913);e.i(271645);var s=e.i(647163);function r({className:e,...n}){return(0,t.jsx)("label",{"data-slot":"label",className:(0,s.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...n})}e.i(652225);let a=(0,n.cva)("group/field flex w-full gap-2 data-[invalid=true]:text-destructive",{variants:{orientation:{vertical:"flex-col *:w-full [&>.sr-only]:w-auto",horizontal:"flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",responsive:"flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"}},defaultVariants:{orientation:"vertical"}});e.s(["Field",0,function({className:e,orientation:n="vertical",...r}){return(0,t.jsx)("div",{role:"group","data-slot":"field","data-orientation":n,className:(0,s.cn)(a({orientation:n}),e),...r})},"FieldContent",0,function({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"field-content",className:(0,s.cn)("group/field-content flex flex-1 flex-col gap-0.5 leading-snug",e),...n})},"FieldLabel",0,function({className:e,...n}){return(0,t.jsx)(r,{"data-slot":"field-label",className:(0,s.cn)("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border has-[>[data-slot=field]]:not-has-[:disabled,[data-disabled]]:hover:bg-muted/50 has-[>[data-slot=field]]:has-[:focus-visible]:border-ring has-[>[data-slot=field]]:has-[:focus-visible]:ring-3 has-[>[data-slot=field]]:has-[:focus-visible]:ring-ring/50 *:data-[slot=field]:p-2.5 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10","has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col",e),...n})}],986530)},787800,e=>{"use strict";var t=e.i(843476),n=e.i(689664),s=e.i(716327),r=e.i(867927),a=e.i(21357),o=e.i(77071),i=e.i(456420);let c={name:"refresh-cw",size:24,node:[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]};c.node;let l=(0,i.default)(c),d={name:"server",size:24,node:[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]};d.node;let m=(0,i.default)(d);var u=e.i(759659),p=e.i(263676),h=e.i(271645),f=e.i(798120),g=e.i(167881),x=e.i(986530),v=e.i(23750),j=e.i(647163);let b=(0,h.memo)(({data:e,name:n,initialExpandDepth:s=2})=>{let r=(0,h.useMemo)(()=>"string"==typeof e?function(e){let t=e.trim();if(!(t.startsWith("{")&&t.endsWith("}"))&&!(t.startsWith("[")&&t.endsWith("]")))return{success:!1,data:e};try{return{success:!0,data:JSON.parse(e)}}catch{return{success:!1,data:e}}}(e).data:e,[e]);return(0,t.jsx)("div",{className:"text-sm",children:(0,t.jsx)(k,{data:r,name:n,depth:0,initialExpandDepth:s})})});b.displayName="JsonView";let y=(e,t)=>({role:"button",tabIndex:0,"aria-expanded":e,onClick:t,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),t())}}),N="outline-none focus-visible:ring-3 focus-visible:ring-ring/50",k=(0,h.memo)(({data:e,name:n,depth:s=0,initialExpandDepth:r})=>{var a;let o=void 0===e?"undefined":Array.isArray(e)?"array":null===e?"null":typeof e,[i,c]=(0,h.useState)("string"!==o&&s<r),l={number:"text-blue-500",boolean:"text-amber-500",null:"text-purple-500",undefined:"text-gray-500",string:"text-foreground break-all whitespace-pre-wrap",default:"text-muted-foreground"};switch(o){case"object":case"array":let d,m,u;return m=(d=(a="array"===o)?e:Object.entries(e)).length,u={open:a?"[":"{",close:a?"]":"}",collapsed:a?"[ ... ]":"{ ... }",empty:a?"[]":"{}"},0===m?(0,t.jsxs)("div",{className:"flex items-center",children:[n&&(0,t.jsxs)("span",{className:"mr-1 text-muted-foreground",children:[n,":"]}),(0,t.jsx)("span",{className:"text-muted-foreground",children:u.empty})]}):(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsxs)("div",{className:(0,j.cn)("flex items-center mr-1 rounded cursor-pointer group hover:bg-input/30",N),...y(i,()=>c(!i)),children:[n&&(0,t.jsxs)("span",{className:"mr-1 text-muted-foreground hover:text-foreground",children:[n,":"]}),i?(0,t.jsx)("span",{className:"text-muted-foreground group-hover:text-foreground",children:u.open}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-muted-foreground group-hover:text-foreground",children:u.collapsed}),(0,t.jsxs)("span",{className:"ml-1 text-muted-foreground group-hover:text-foreground",children:[m," ",1===m?"item":"items"]})]})]}),i&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"pl-2 ml-4 border-l border-border",children:a?d.map((e,n)=>(0,t.jsx)("div",{className:"my-1",children:(0,t.jsx)(k,{data:e,name:`${n}`,depth:s+1,initialExpandDepth:r})},n)):d.map(([e,n])=>(0,t.jsx)("div",{className:"my-1",children:(0,t.jsx)(k,{data:n,name:e,depth:s+1,initialExpandDepth:r})},e))}),(0,t.jsx)("div",{className:"text-muted-foreground",children:u.close})]})]});case"string":return e.length>100?(0,t.jsxs)("div",{className:"flex mr-1 rounded group hover:bg-input/30",children:[n&&(0,t.jsxs)("span",{className:"mr-1 text-muted-foreground hover:text-foreground",children:[n,":"]}),(0,t.jsx)("pre",{className:(0,j.cn)(l.string,"cursor-pointer group-hover:text-foreground",N),...y(i,()=>c(!i)),title:i?"Click to collapse":"Click to expand",children:i?`"${e}"`:`"${e.slice(0,100)}..."`})]}):(0,t.jsxs)("div",{className:"flex mr-1 rounded hover:bg-input/30",children:[n&&(0,t.jsxs)("span",{className:"mr-1 text-muted-foreground",children:[n,":"]}),(0,t.jsxs)("pre",{className:l.string,children:['"',e,'"']})]});case"undefined":return(0,t.jsxs)("div",{className:"flex items-center mr-1 rounded hover:bg-input/30",children:[n&&(0,t.jsxs)("span",{className:"mr-1 text-muted-foreground",children:[n,":"]}),(0,t.jsx)("span",{className:l.undefined,children:"undefined"})]});default:return(0,t.jsxs)("div",{className:"flex items-center mr-1 rounded hover:bg-input/30",children:[n&&(0,t.jsxs)("span",{className:"mr-1 text-muted-foreground",children:[n,":"]}),(0,t.jsx)("span",{className:l[o]||l.default,children:null===e?"null":String(e)})]})}});k.displayName="JsonNode";var S=e.i(917162),w=e.i(818125),C=e.i(319036),O=e.i(127341),z=e.i(184762),T=e.i(6799),A=e.i(95187);let P=(0,A.createServerReference)("7fa8750647f1851e3227e670682b47e611e56eeb37",A.callServer,void 0,A.findSourceMapURL,"callToolAction"),F=(0,A.createServerReference)("7f8f770c556f170baf9cab251672c2a238550b0747",A.callServer,void 0,A.findSourceMapURL,"deleteServerAction"),$=(0,A.createServerReference)("7f8fc6bc21b2160e31bcee0e1bf0bc95ebcd77e535",A.callServer,void 0,A.findSourceMapURL,"refreshServerAction"),R=(0,A.createServerReference)("7f5588be3768e20d906ac9d2ee9aa3b566fc4779b7",A.callServer,void 0,A.findSourceMapURL,"registerServerAction");var D=e.i(362201),M=e.i(245629);let L=D.object({url:D.url(),headers:D.record(D.string(),D.string()).optional()}),E=D.object({command:D.string().min(1),args:D.array(D.string()).optional(),env:D.record(D.string(),D.string()).optional()}),I=D.union([L,E]),B=D.object({name:D.string(),description:D.string().optional(),inputSchema:D.looseObject({}).optional(),outputSchema:D.looseObject({}).optional()});function q(e){return"url"in e}D.object({clientInformation:D.looseObject({}).optional(),tokens:D.looseObject({}).optional(),authorizationServer:D.looseObject({}).optional(),codeVerifier:D.string().optional(),state:D.string().optional()});let J=D.object({name:D.string().min(1).max(40),config:I,toolCount:D.number().int(),lastError:D.string().nullish()}),U=B.extend({id:D.number().int(),description:D.string().nullish()});J.omit({toolCount:!0}).extend({tools:U.array().default([]),toolsSyncedAt:M.DateLikeSchema});let K=D.object({name:D.string().min(1,"Name is required").max(40).regex(/^[a-zA-Z0-9_-]+$/,"Only letters, numbers, - and _ are allowed"),config:I}),H=D.union([D.object({mcpServers:D.record(D.string(),I)}),D.record(D.string(),I)]),V=[{name:"todoist",icon:"todoist.com",description:"Tasks, projects, and due dates",config:{url:"https://ai.todoist.net/mcp"}},{name:"home-assistant",icon:"home-assistant.io",description:"Lights, switches, and the rest of the house — your address and a long-lived token",config:{url:"http://homeassistant.local:8123/api/mcp",headers:{Authorization:"Bearer <your-home-assistant-token>"}}},{name:"kiwi",icon:"kiwi.com",description:"Flight search — no account",config:{url:"https://mcp.kiwi.com"}},{name:"zapier",icon:"zapier.com",description:"Gmail, Google Calendar, and thousands of apps you connect there",config:{url:"https://mcp.zapier.com/api/v1/connect"}},{name:"notion",icon:"notion.so",description:"Pages, databases, and search",config:{url:"https://mcp.notion.com/mcp"}},{name:"canva",icon:"canva.com",description:"Create and manage designs",config:{url:"https://mcp.canva.com/mcp"}},{name:"slack",icon:"slack.com",description:"Channels, messages, and search",config:{url:"https://mcp.slack.com/mcp"}},{name:"box",icon:"box.com",description:"Files, folders, and content search",config:{url:"https://mcp.box.com/mcp"}},{name:"airtable",icon:"airtable.com",description:"Bases, tables, and records",config:{url:"https://mcp.airtable.com/mcp"}},{name:"fireflies",icon:"fireflies.ai",description:"Meeting transcripts and summaries",config:{url:"https://mcp.fireflies.ai/mcp"}},{name:"asana",icon:"asana.com",description:"Tasks, projects, and portfolios",config:{url:"https://mcp.asana.com/mcp"}},{name:"monday",icon:"monday.com",description:"Boards, items, and updates",config:{url:"https://mcp.monday.com/mcp"}},{name:"clickup",icon:"clickup.com",description:"Tasks, docs, and spaces",config:{url:"https://mcp.clickup.com/mcp"}},{name:"linear",icon:"linear.app",description:"Issues, projects, and cycles",config:{url:"https://mcp.linear.app/mcp"}},{name:"atlassian",icon:"atlassian.com",description:"Jira and Confluence",config:{url:"https://mcp.atlassian.com/v1/mcp"}},{name:"hubspot",icon:"hubspot.com",description:"Contacts, deals, and companies",config:{url:"https://app.hubspot.com/mcp/v1/http"}},{name:"attio",icon:"attio.com",description:"CRM records and lists",config:{url:"https://mcp.attio.com/mcp"}},{name:"intercom",icon:"intercom.com",description:"Conversations and support tickets",config:{url:"https://mcp.intercom.com/mcp"}},{name:"wix",icon:"wix.com",description:"Sites, stores, and bookings",config:{url:"https://mcp.wix.com/mcp"}},{name:"webflow",icon:"webflow.com",description:"Sites, pages, and CMS collections",config:{url:"https://mcp.webflow.com/mcp"}},{name:"sanity",icon:"sanity.io",description:"Structured content and datasets",config:{url:"https://mcp.sanity.io/mcp"}},{name:"stripe",icon:"stripe.com",description:"Payments, invoices, and customers",config:{url:"https://mcp.stripe.com"}},{name:"paypal",icon:"paypal.com",description:"Payments and orders",config:{url:"https://mcp.paypal.com/mcp"}},{name:"square",icon:"squareup.com",description:"Payments, catalog, and orders",config:{url:"https://mcp.squareup.com/mcp"}},{name:"ramp",icon:"ramp.com",description:"Spend, cards, and transactions",config:{url:"https://mcp.ramp.com/mcp"}},{name:"github",icon:"github.com",description:"Repos, issues, PRs — paste a personal access token",config:{url:"https://api.githubcopilot.com/mcp/",headers:{Authorization:"Bearer <your-github-pat>"}}},{name:"vercel",icon:"vercel.com",description:"Deployments and projects",config:{url:"https://mcp.vercel.com"}},{name:"netlify",icon:"netlify.com",description:"Sites, builds, and deploys",config:{url:"https://mcp.netlify.com/mcp"}},{name:"cloudflare",icon:"cloudflare.com",description:"Workers bindings — D1, R2, KV",config:{url:"https://bindings.mcp.cloudflare.com/mcp"}},{name:"supabase",icon:"supabase.com",description:"Projects, tables, and SQL",config:{url:"https://mcp.supabase.com/mcp"}},{name:"neon",icon:"neon.tech",description:"Postgres branches and queries",config:{url:"https://mcp.neon.tech/mcp"}},{name:"prisma",icon:"prisma.io",description:"Postgres databases and schema",config:{url:"https://mcp.prisma.io/mcp"}},{name:"sentry",icon:"sentry.io",description:"Errors and performance issues",config:{url:"https://mcp.sentry.dev/mcp"}},{name:"grafana",icon:"grafana.com",description:"Dashboards, metrics, and alerts",config:{url:"https://mcp.grafana.com/mcp"}},{name:"semgrep",icon:"semgrep.dev",description:"Scan code for security findings",config:{url:"https://mcp.semgrep.ai/mcp"}},{name:"postman",icon:"postman.com",description:"Collections, environments, and requests",config:{url:"https://mcp.postman.com/mcp"}},{name:"resend",icon:"resend.com",description:"Send email and manage audiences",config:{url:"https://mcp.resend.com/mcp"}},{name:"hugging-face",icon:"huggingface.co",description:"Models, datasets, and Spaces",config:{url:"https://huggingface.co/mcp"}},{name:"apify",icon:"apify.com",description:"Run scrapers and automation actors",config:{url:"https://mcp.apify.com"}},{name:"exa",icon:"exa.ai",description:"Web search for agents",config:{url:"https://mcp.exa.ai/mcp"}},{name:"kagi",icon:"kagi.com",description:"Search, summarize, and answer",config:{url:"https://mcp.kagi.com/mcp"}},{name:"context7",icon:"context7.com",description:"Up-to-date library docs",config:{url:"https://mcp.context7.com/mcp"}},{name:"deepwiki",icon:"deepwiki.com",description:"Ask questions about any GitHub repo",config:{url:"https://mcp.deepwiki.com/mcp"}},{name:"microsoft-learn",icon:"learn.microsoft.com",description:"Microsoft and Azure docs — no account",config:{url:"https://learn.microsoft.com/api/mcp"}},{name:"aws-knowledge",icon:"aws.amazon.com",description:"AWS docs and API references — no account",config:{url:"https://knowledge-mcp.global.api.aws"}},{name:"cloudflare-docs",icon:"developers.cloudflare.com",description:"Cloudflare docs — no account",config:{url:"https://docs.mcp.cloudflare.com/mcp"}},{name:"stack-overflow",icon:"stackoverflow.com",description:"Questions, answers, and teams",config:{url:"https://mcp.stackoverflow.com"}}];var W=e.i(895836),_=e.i(333999),G=e.i(609856),Q=e.i(283653);function X({name:e,onDone:n}){let[s,r]=(0,h.useState)(""),{data:a,isLoading:o,error:i}=(0,Q.useServerRoute)(f.queryKey.mcpServer(e)),[c,d]=(0,G.useServerAction)($,{...el,onOk:t=>{el.onOk(t),(0,Q.revalidate)(f.queryKey.mcpServer(e))}}),[m,p]=(0,G.useServerAction)(F,{okMessage:"Server deleted",onOk:()=>{n(),(0,Q.revalidate)(f.queryKey.mcp)}}),x=async()=>{await S.notify.confirm({title:`Delete ${e}?`,description:"Its connection and saved authorization go with it.",okText:"Delete",destructive:!0})&&m(e)};if(o)return(0,t.jsx)(W.SettingSkeleton,{rows:4});if(!a)return(0,t.jsx)(W.SettingDialogContent,{title:e,footer:(0,t.jsxs)(g.Button,{variant:"ghost",loading:p,onClick:x,className:"mr-auto text-destructive hover:text-destructive",children:[(0,t.jsx)(u.Trash2,{}),"Delete"]}),children:(0,t.jsx)("p",{className:"rounded-lg bg-destructive/10 px-3 py-2 font-mono text-xs text-destructive",children:i?(0,j.errorToString)(i):"This server could not be read."})});let v=a.tools.length,b=s.trim().toLowerCase(),y=b?a.tools.filter(e=>`${e.name} ${e.description??""}`.toLowerCase().includes(b)):a.tools,N=q(a.config)?"HTTP":"STDIO";return(0,t.jsxs)(W.SettingDialogContent,{title:a.name,description:(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[(0,t.jsx)("span",{className:"shrink-0 rounded-sm bg-muted px-1.5 py-0.5 font-mono text-[10px]",children:N}),(0,t.jsx)("span",{className:"truncate font-mono",children:em(a.config)})]}),footer:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(g.Button,{variant:"ghost",loading:p,onClick:x,className:"mr-auto text-destructive hover:text-destructive",children:[(0,t.jsx)(u.Trash2,{}),"Delete"]}),(0,t.jsxs)(g.Button,{variant:"outline",loading:d,onClick:()=>c(a.name),children:[(0,t.jsx)(l,{}),"Reconnect"]})]}),children:[a.lastError&&(0,t.jsx)("p",{className:"rounded-lg bg-destructive/10 px-3 py-2 font-mono text-xs text-destructive",children:a.lastError}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(W.SettingFilter,{value:s,onChange:r,placeholder:"Filter tools"}),(0,t.jsxs)("span",{className:"shrink-0 font-mono text-xs text-muted-foreground",children:[v," ",1===v?"tool":"tools"]})]}),y.map(e=>(0,t.jsx)(ee,{tool:e,serverName:a.name},e.name)),0===y.length&&v>0&&(0,t.jsx)("p",{className:"py-6 text-center text-sm text-muted-foreground",children:"No tool here goes by that."})]})}function Y({server:e}){let s=e.toolCount,a=e.lastError?"error":s>0?"connected":"idle";return(0,t.jsxs)("button",{type:"button",onClick:()=>{S.notify.component({className:"sm:max-w-3xl",renderer:({close:n})=>(0,t.jsx)(X,{name:e.name,onDone:n})})},className:"group flex w-full items-center gap-3 p-4 text-left outline-none transition-colors hover:bg-muted/50 focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",children:[(0,t.jsx)("span",{className:"grid size-10 shrink-0 place-items-center rounded-lg bg-muted text-muted-foreground",children:(0,t.jsx)(Z,{server:e})}),(0,t.jsxs)("span",{className:"min-w-0 flex-1 space-y-0.5",children:[(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[(0,t.jsx)("span",{className:"truncate text-sm font-medium",children:e.name}),"connected"===a&&(0,t.jsx)(n.Check,{className:"size-3 shrink-0 text-muted-foreground"})]}),(0,t.jsx)("span",{className:"block truncate text-xs text-muted-foreground",children:"error"===a?(0,t.jsx)("span",{className:"text-destructive",children:e.lastError}):(0,t.jsxs)(t.Fragment,{children:[s>0?`${s} ${1===s?"tool":"tools"}`:"No tools yet",(0,t.jsxs)("span",{className:"font-mono text-[11px] text-muted-foreground",children:[" · ",em(e.config)]})]})})]}),(0,t.jsx)(r.ChevronRight,{className:"size-4 shrink-0 text-muted-foreground/60 transition-colors group-hover:text-foreground"})]})}function Z({server:e}){let n,s=(n=V.find(t=>q(t.config)?q(e.config)&&t.config.url.replace(/\/+$/,"")===e.config.url.replace(/\/+$/,""):!q(e.config)&&t.config.command===e.config.command&&(t.config.args??[]).join(" ")===(e.config.args??[]).join(" "))??V.find(t=>t.name===e.name),n?.icon);return s?(0,t.jsx)(w.SiteIcon,{host:s,className:"size-5",fallback:(0,t.jsx)(m,{className:"size-4"})}):(0,t.jsx)(m,{className:"size-4"})}function ee({tool:e,serverName:n}){let[a,o]=(0,h.useState)(!1),[i,c]=(0,h.useState)(!1),[l,d]=(0,h.useState)(!1),m=[["inputSchema",e.inputSchema],["outputSchema",e.outputSchema]].filter(([,e])=>e);return(0,t.jsxs)("div",{className:"rounded-xl border border-border/60 bg-background p-4",children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-sm",children:e.name}),m.length>0&&(0,t.jsxs)(g.Button,{size:"xs",variant:"ghost",className:"shrink-0 font-mono",onClick:()=>o(!a),children:[a?(0,t.jsx)(s.ChevronDown,{}):(0,t.jsx)(r.ChevronRight,{}),"Schema"]}),(0,t.jsxs)(g.Button,{size:"xs",variant:"ghost",className:"shrink-0 font-mono",onClick:()=>c(!i),children:[i?(0,t.jsx)(s.ChevronDown,{}):(0,t.jsx)(r.ChevronRight,{}),"Test"]})]}),e.description?(0,t.jsx)("p",{className:(0,j.cn)("mt-0.5 text-xs leading-relaxed text-muted-foreground",!l&&"line-clamp-2",e.description.length>140&&"cursor-pointer"),onClick:()=>d(!l),children:e.description}):null,a?(0,t.jsx)("div",{className:"mt-2 space-y-3 overflow-x-auto rounded-lg border border-input p-3",children:m.map(([e,n])=>(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("span",{className:"block font-mono text-xs text-muted-foreground",children:"inputSchema"===e?"in":"out"}),(0,t.jsx)("pre",{className:"font-mono text-xs leading-relaxed whitespace-pre",children:function e(t,n=0){if(!t||"object"!=typeof t)return"unknown";let s=" ".repeat(n+1),r=" ".repeat(n);if(Array.isArray(t.enum))return t.enum.map(e=>JSON.stringify(e)).join(" | ");let a=t.anyOf??t.oneOf;if(Array.isArray(a))return a.map(t=>e(t,n)).join(" | ");if("array"===t.type){let s=e(t.items,n);return/[|{]/.test(s)?`(${s})[]`:`${s}[]`}if("object"===t.type||t.properties){let a=t.properties;if(!a||0===Object.keys(a).length)return"{}";let o=t.required??[],i=Object.entries(a).map(([t,r])=>{let a=o.includes(t)?"":"?",i=r?.description,c="string"==typeof i&&i.length<=60?` // ${i}`:"";return`${s}${t}${a}: ${e(r,n+1)}${c}`});return`{
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,986530,e=>{"use strict";var t=e.i(843476),n=e.i(225913);e.i(271645);var s=e.i(647163);function r({className:e,...n}){return(0,t.jsx)("label",{"data-slot":"label",className:(0,s.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...n})}e.i(652225);let a=(0,n.cva)("group/field flex w-full gap-2 data-[invalid=true]:text-destructive",{variants:{orientation:{vertical:"flex-col *:w-full [&>.sr-only]:w-auto",horizontal:"flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",responsive:"flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"}},defaultVariants:{orientation:"vertical"}});e.s(["Field",0,function({className:e,orientation:n="vertical",...r}){return(0,t.jsx)("div",{role:"group","data-slot":"field","data-orientation":n,className:(0,s.cn)(a({orientation:n}),e),...r})},"FieldContent",0,function({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"field-content",className:(0,s.cn)("group/field-content flex flex-1 flex-col gap-0.5 leading-snug",e),...n})},"FieldLabel",0,function({className:e,...n}){return(0,t.jsx)(r,{"data-slot":"field-label",className:(0,s.cn)("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border has-[>[data-slot=field]]:not-has-[:disabled,[data-disabled]]:hover:bg-muted/50 has-[>[data-slot=field]]:has-[:focus-visible]:border-ring has-[>[data-slot=field]]:has-[:focus-visible]:ring-3 has-[>[data-slot=field]]:has-[:focus-visible]:ring-ring/50 *:data-[slot=field]:p-2.5 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10","has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col",e),...n})}],986530)},787800,e=>{"use strict";var t=e.i(843476),n=e.i(689664),s=e.i(716327),r=e.i(867927),a=e.i(21357),o=e.i(77071),i=e.i(456420);let c={name:"refresh-cw",size:24,node:[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]};c.node;let l=(0,i.default)(c),d={name:"server",size:24,node:[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]};d.node;let m=(0,i.default)(d);var u=e.i(759659),p=e.i(263676),h=e.i(271645),f=e.i(798120),g=e.i(167881),x=e.i(986530),v=e.i(23750),j=e.i(647163);let b=(0,h.memo)(({data:e,name:n,initialExpandDepth:s=2})=>{let r=(0,h.useMemo)(()=>"string"==typeof e?function(e){let t=e.trim();if(!(t.startsWith("{")&&t.endsWith("}"))&&!(t.startsWith("[")&&t.endsWith("]")))return{success:!1,data:e};try{return{success:!0,data:JSON.parse(e)}}catch{return{success:!1,data:e}}}(e).data:e,[e]);return(0,t.jsx)("div",{className:"text-sm",children:(0,t.jsx)(k,{data:r,name:n,depth:0,initialExpandDepth:s})})});b.displayName="JsonView";let y=(e,t)=>({role:"button",tabIndex:0,"aria-expanded":e,onClick:t,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),t())}}),N="outline-none focus-visible:ring-3 focus-visible:ring-ring/50",k=(0,h.memo)(({data:e,name:n,depth:s=0,initialExpandDepth:r})=>{var a;let o=void 0===e?"undefined":Array.isArray(e)?"array":null===e?"null":typeof e,[i,c]=(0,h.useState)("string"!==o&&s<r),l={number:"text-blue-500",boolean:"text-amber-500",null:"text-purple-500",undefined:"text-gray-500",string:"text-foreground break-all whitespace-pre-wrap",default:"text-muted-foreground"};switch(o){case"object":case"array":let d,m,u;return m=(d=(a="array"===o)?e:Object.entries(e)).length,u={open:a?"[":"{",close:a?"]":"}",collapsed:a?"[ ... ]":"{ ... }",empty:a?"[]":"{}"},0===m?(0,t.jsxs)("div",{className:"flex items-center",children:[n&&(0,t.jsxs)("span",{className:"mr-1 text-muted-foreground",children:[n,":"]}),(0,t.jsx)("span",{className:"text-muted-foreground",children:u.empty})]}):(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsxs)("div",{className:(0,j.cn)("flex items-center mr-1 rounded cursor-pointer group hover:bg-input/30",N),...y(i,()=>c(!i)),children:[n&&(0,t.jsxs)("span",{className:"mr-1 text-muted-foreground hover:text-foreground",children:[n,":"]}),i?(0,t.jsx)("span",{className:"text-muted-foreground group-hover:text-foreground",children:u.open}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-muted-foreground group-hover:text-foreground",children:u.collapsed}),(0,t.jsxs)("span",{className:"ml-1 text-muted-foreground group-hover:text-foreground",children:[m," ",1===m?"item":"items"]})]})]}),i&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"pl-2 ml-4 border-l border-border",children:a?d.map((e,n)=>(0,t.jsx)("div",{className:"my-1",children:(0,t.jsx)(k,{data:e,name:`${n}`,depth:s+1,initialExpandDepth:r})},n)):d.map(([e,n])=>(0,t.jsx)("div",{className:"my-1",children:(0,t.jsx)(k,{data:n,name:e,depth:s+1,initialExpandDepth:r})},e))}),(0,t.jsx)("div",{className:"text-muted-foreground",children:u.close})]})]});case"string":return e.length>100?(0,t.jsxs)("div",{className:"flex mr-1 rounded group hover:bg-input/30",children:[n&&(0,t.jsxs)("span",{className:"mr-1 text-muted-foreground hover:text-foreground",children:[n,":"]}),(0,t.jsx)("pre",{className:(0,j.cn)(l.string,"cursor-pointer group-hover:text-foreground",N),...y(i,()=>c(!i)),title:i?"Click to collapse":"Click to expand",children:i?`"${e}"`:`"${e.slice(0,100)}..."`})]}):(0,t.jsxs)("div",{className:"flex mr-1 rounded hover:bg-input/30",children:[n&&(0,t.jsxs)("span",{className:"mr-1 text-muted-foreground",children:[n,":"]}),(0,t.jsxs)("pre",{className:l.string,children:['"',e,'"']})]});case"undefined":return(0,t.jsxs)("div",{className:"flex items-center mr-1 rounded hover:bg-input/30",children:[n&&(0,t.jsxs)("span",{className:"mr-1 text-muted-foreground",children:[n,":"]}),(0,t.jsx)("span",{className:l.undefined,children:"undefined"})]});default:return(0,t.jsxs)("div",{className:"flex items-center mr-1 rounded hover:bg-input/30",children:[n&&(0,t.jsxs)("span",{className:"mr-1 text-muted-foreground",children:[n,":"]}),(0,t.jsx)("span",{className:l[o]||l.default,children:null===e?"null":String(e)})]})}});k.displayName="JsonNode";var S=e.i(917162),w=e.i(818125),C=e.i(319036),O=e.i(127341),z=e.i(184762),T=e.i(6799),A=e.i(95187);let P=(0,A.createServerReference)("7fdf85427a0a032700d41992a6ebb12bd047967f27",A.callServer,void 0,A.findSourceMapURL,"callToolAction"),F=(0,A.createServerReference)("7fa6e416c28879069b24e242d8b3d12173f0d4aa63",A.callServer,void 0,A.findSourceMapURL,"deleteServerAction"),$=(0,A.createServerReference)("7f1e6ef44f3d02d570a424ac642c7c8f8d00176946",A.callServer,void 0,A.findSourceMapURL,"refreshServerAction"),R=(0,A.createServerReference)("7fa0af01e68e76f223a2ee572801fd2acb8142726a",A.callServer,void 0,A.findSourceMapURL,"registerServerAction");var D=e.i(362201),M=e.i(245629);let L=D.object({url:D.url(),headers:D.record(D.string(),D.string()).optional()}),E=D.object({command:D.string().min(1),args:D.array(D.string()).optional(),env:D.record(D.string(),D.string()).optional()}),I=D.union([L,E]),B=D.object({name:D.string(),description:D.string().optional(),inputSchema:D.looseObject({}).optional(),outputSchema:D.looseObject({}).optional()});function q(e){return"url"in e}D.object({clientInformation:D.looseObject({}).optional(),tokens:D.looseObject({}).optional(),authorizationServer:D.looseObject({}).optional(),codeVerifier:D.string().optional(),state:D.string().optional()});let J=D.object({name:D.string().min(1).max(40),config:I,toolCount:D.number().int(),lastError:D.string().nullish()}),U=B.extend({id:D.number().int(),description:D.string().nullish()});J.omit({toolCount:!0}).extend({tools:U.array().default([]),toolsSyncedAt:M.DateLikeSchema});let K=D.object({name:D.string().min(1,"Name is required").max(40).regex(/^[a-zA-Z0-9_-]+$/,"Only letters, numbers, - and _ are allowed"),config:I}),H=D.union([D.object({mcpServers:D.record(D.string(),I)}),D.record(D.string(),I)]),V=[{name:"todoist",icon:"todoist.com",description:"Tasks, projects, and due dates",config:{url:"https://ai.todoist.net/mcp"}},{name:"home-assistant",icon:"home-assistant.io",description:"Lights, switches, and the rest of the house — your address and a long-lived token",config:{url:"http://homeassistant.local:8123/api/mcp",headers:{Authorization:"Bearer <your-home-assistant-token>"}}},{name:"kiwi",icon:"kiwi.com",description:"Flight search — no account",config:{url:"https://mcp.kiwi.com"}},{name:"zapier",icon:"zapier.com",description:"Gmail, Google Calendar, and thousands of apps you connect there",config:{url:"https://mcp.zapier.com/api/v1/connect"}},{name:"notion",icon:"notion.so",description:"Pages, databases, and search",config:{url:"https://mcp.notion.com/mcp"}},{name:"canva",icon:"canva.com",description:"Create and manage designs",config:{url:"https://mcp.canva.com/mcp"}},{name:"slack",icon:"slack.com",description:"Channels, messages, and search",config:{url:"https://mcp.slack.com/mcp"}},{name:"box",icon:"box.com",description:"Files, folders, and content search",config:{url:"https://mcp.box.com/mcp"}},{name:"airtable",icon:"airtable.com",description:"Bases, tables, and records",config:{url:"https://mcp.airtable.com/mcp"}},{name:"fireflies",icon:"fireflies.ai",description:"Meeting transcripts and summaries",config:{url:"https://mcp.fireflies.ai/mcp"}},{name:"asana",icon:"asana.com",description:"Tasks, projects, and portfolios",config:{url:"https://mcp.asana.com/mcp"}},{name:"monday",icon:"monday.com",description:"Boards, items, and updates",config:{url:"https://mcp.monday.com/mcp"}},{name:"clickup",icon:"clickup.com",description:"Tasks, docs, and spaces",config:{url:"https://mcp.clickup.com/mcp"}},{name:"linear",icon:"linear.app",description:"Issues, projects, and cycles",config:{url:"https://mcp.linear.app/mcp"}},{name:"atlassian",icon:"atlassian.com",description:"Jira and Confluence",config:{url:"https://mcp.atlassian.com/v1/mcp"}},{name:"hubspot",icon:"hubspot.com",description:"Contacts, deals, and companies",config:{url:"https://app.hubspot.com/mcp/v1/http"}},{name:"attio",icon:"attio.com",description:"CRM records and lists",config:{url:"https://mcp.attio.com/mcp"}},{name:"intercom",icon:"intercom.com",description:"Conversations and support tickets",config:{url:"https://mcp.intercom.com/mcp"}},{name:"wix",icon:"wix.com",description:"Sites, stores, and bookings",config:{url:"https://mcp.wix.com/mcp"}},{name:"webflow",icon:"webflow.com",description:"Sites, pages, and CMS collections",config:{url:"https://mcp.webflow.com/mcp"}},{name:"sanity",icon:"sanity.io",description:"Structured content and datasets",config:{url:"https://mcp.sanity.io/mcp"}},{name:"stripe",icon:"stripe.com",description:"Payments, invoices, and customers",config:{url:"https://mcp.stripe.com"}},{name:"paypal",icon:"paypal.com",description:"Payments and orders",config:{url:"https://mcp.paypal.com/mcp"}},{name:"square",icon:"squareup.com",description:"Payments, catalog, and orders",config:{url:"https://mcp.squareup.com/mcp"}},{name:"ramp",icon:"ramp.com",description:"Spend, cards, and transactions",config:{url:"https://mcp.ramp.com/mcp"}},{name:"github",icon:"github.com",description:"Repos, issues, PRs — paste a personal access token",config:{url:"https://api.githubcopilot.com/mcp/",headers:{Authorization:"Bearer <your-github-pat>"}}},{name:"vercel",icon:"vercel.com",description:"Deployments and projects",config:{url:"https://mcp.vercel.com"}},{name:"netlify",icon:"netlify.com",description:"Sites, builds, and deploys",config:{url:"https://mcp.netlify.com/mcp"}},{name:"cloudflare",icon:"cloudflare.com",description:"Workers bindings — D1, R2, KV",config:{url:"https://bindings.mcp.cloudflare.com/mcp"}},{name:"supabase",icon:"supabase.com",description:"Projects, tables, and SQL",config:{url:"https://mcp.supabase.com/mcp"}},{name:"neon",icon:"neon.tech",description:"Postgres branches and queries",config:{url:"https://mcp.neon.tech/mcp"}},{name:"prisma",icon:"prisma.io",description:"Postgres databases and schema",config:{url:"https://mcp.prisma.io/mcp"}},{name:"sentry",icon:"sentry.io",description:"Errors and performance issues",config:{url:"https://mcp.sentry.dev/mcp"}},{name:"grafana",icon:"grafana.com",description:"Dashboards, metrics, and alerts",config:{url:"https://mcp.grafana.com/mcp"}},{name:"semgrep",icon:"semgrep.dev",description:"Scan code for security findings",config:{url:"https://mcp.semgrep.ai/mcp"}},{name:"postman",icon:"postman.com",description:"Collections, environments, and requests",config:{url:"https://mcp.postman.com/mcp"}},{name:"resend",icon:"resend.com",description:"Send email and manage audiences",config:{url:"https://mcp.resend.com/mcp"}},{name:"hugging-face",icon:"huggingface.co",description:"Models, datasets, and Spaces",config:{url:"https://huggingface.co/mcp"}},{name:"apify",icon:"apify.com",description:"Run scrapers and automation actors",config:{url:"https://mcp.apify.com"}},{name:"exa",icon:"exa.ai",description:"Web search for agents",config:{url:"https://mcp.exa.ai/mcp"}},{name:"kagi",icon:"kagi.com",description:"Search, summarize, and answer",config:{url:"https://mcp.kagi.com/mcp"}},{name:"context7",icon:"context7.com",description:"Up-to-date library docs",config:{url:"https://mcp.context7.com/mcp"}},{name:"deepwiki",icon:"deepwiki.com",description:"Ask questions about any GitHub repo",config:{url:"https://mcp.deepwiki.com/mcp"}},{name:"microsoft-learn",icon:"learn.microsoft.com",description:"Microsoft and Azure docs — no account",config:{url:"https://learn.microsoft.com/api/mcp"}},{name:"aws-knowledge",icon:"aws.amazon.com",description:"AWS docs and API references — no account",config:{url:"https://knowledge-mcp.global.api.aws"}},{name:"cloudflare-docs",icon:"developers.cloudflare.com",description:"Cloudflare docs — no account",config:{url:"https://docs.mcp.cloudflare.com/mcp"}},{name:"stack-overflow",icon:"stackoverflow.com",description:"Questions, answers, and teams",config:{url:"https://mcp.stackoverflow.com"}}];var W=e.i(895836),_=e.i(333999),G=e.i(609856),Q=e.i(283653);function X({name:e,onDone:n}){let[s,r]=(0,h.useState)(""),{data:a,isLoading:o,error:i}=(0,Q.useServerRoute)(f.queryKey.mcpServer(e)),[c,d]=(0,G.useServerAction)($,{...el,onOk:t=>{el.onOk(t),(0,Q.revalidate)(f.queryKey.mcpServer(e))}}),[m,p]=(0,G.useServerAction)(F,{okMessage:"Server deleted",onOk:()=>{n(),(0,Q.revalidate)(f.queryKey.mcp)}}),x=async()=>{await S.notify.confirm({title:`Delete ${e}?`,description:"Its connection and saved authorization go with it.",okText:"Delete",destructive:!0})&&m(e)};if(o)return(0,t.jsx)(W.SettingSkeleton,{rows:4});if(!a)return(0,t.jsx)(W.SettingDialogContent,{title:e,footer:(0,t.jsxs)(g.Button,{variant:"ghost",loading:p,onClick:x,className:"mr-auto text-destructive hover:text-destructive",children:[(0,t.jsx)(u.Trash2,{}),"Delete"]}),children:(0,t.jsx)("p",{className:"rounded-lg bg-destructive/10 px-3 py-2 font-mono text-xs text-destructive",children:i?(0,j.errorToString)(i):"This server could not be read."})});let v=a.tools.length,b=s.trim().toLowerCase(),y=b?a.tools.filter(e=>`${e.name} ${e.description??""}`.toLowerCase().includes(b)):a.tools,N=q(a.config)?"HTTP":"STDIO";return(0,t.jsxs)(W.SettingDialogContent,{title:a.name,description:(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[(0,t.jsx)("span",{className:"shrink-0 rounded-sm bg-muted px-1.5 py-0.5 font-mono text-[10px]",children:N}),(0,t.jsx)("span",{className:"truncate font-mono",children:em(a.config)})]}),footer:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(g.Button,{variant:"ghost",loading:p,onClick:x,className:"mr-auto text-destructive hover:text-destructive",children:[(0,t.jsx)(u.Trash2,{}),"Delete"]}),(0,t.jsxs)(g.Button,{variant:"outline",loading:d,onClick:()=>c(a.name),children:[(0,t.jsx)(l,{}),"Reconnect"]})]}),children:[a.lastError&&(0,t.jsx)("p",{className:"rounded-lg bg-destructive/10 px-3 py-2 font-mono text-xs text-destructive",children:a.lastError}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(W.SettingFilter,{value:s,onChange:r,placeholder:"Filter tools"}),(0,t.jsxs)("span",{className:"shrink-0 font-mono text-xs text-muted-foreground",children:[v," ",1===v?"tool":"tools"]})]}),y.map(e=>(0,t.jsx)(ee,{tool:e,serverName:a.name},e.name)),0===y.length&&v>0&&(0,t.jsx)("p",{className:"py-6 text-center text-sm text-muted-foreground",children:"No tool here goes by that."})]})}function Y({server:e}){let s=e.toolCount,a=e.lastError?"error":s>0?"connected":"idle";return(0,t.jsxs)("button",{type:"button",onClick:()=>{S.notify.component({className:"sm:max-w-3xl",renderer:({close:n})=>(0,t.jsx)(X,{name:e.name,onDone:n})})},className:"group flex w-full items-center gap-3 p-4 text-left outline-none transition-colors hover:bg-muted/50 focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",children:[(0,t.jsx)("span",{className:"grid size-10 shrink-0 place-items-center rounded-lg bg-muted text-muted-foreground",children:(0,t.jsx)(Z,{server:e})}),(0,t.jsxs)("span",{className:"min-w-0 flex-1 space-y-0.5",children:[(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[(0,t.jsx)("span",{className:"truncate text-sm font-medium",children:e.name}),"connected"===a&&(0,t.jsx)(n.Check,{className:"size-3 shrink-0 text-muted-foreground"})]}),(0,t.jsx)("span",{className:"block truncate text-xs text-muted-foreground",children:"error"===a?(0,t.jsx)("span",{className:"text-destructive",children:e.lastError}):(0,t.jsxs)(t.Fragment,{children:[s>0?`${s} ${1===s?"tool":"tools"}`:"No tools yet",(0,t.jsxs)("span",{className:"font-mono text-[11px] text-muted-foreground",children:[" · ",em(e.config)]})]})})]}),(0,t.jsx)(r.ChevronRight,{className:"size-4 shrink-0 text-muted-foreground/60 transition-colors group-hover:text-foreground"})]})}function Z({server:e}){let n,s=(n=V.find(t=>q(t.config)?q(e.config)&&t.config.url.replace(/\/+$/,"")===e.config.url.replace(/\/+$/,""):!q(e.config)&&t.config.command===e.config.command&&(t.config.args??[]).join(" ")===(e.config.args??[]).join(" "))??V.find(t=>t.name===e.name),n?.icon);return s?(0,t.jsx)(w.SiteIcon,{host:s,className:"size-5",fallback:(0,t.jsx)(m,{className:"size-4"})}):(0,t.jsx)(m,{className:"size-4"})}function ee({tool:e,serverName:n}){let[a,o]=(0,h.useState)(!1),[i,c]=(0,h.useState)(!1),[l,d]=(0,h.useState)(!1),m=[["inputSchema",e.inputSchema],["outputSchema",e.outputSchema]].filter(([,e])=>e);return(0,t.jsxs)("div",{className:"rounded-xl border border-border/60 bg-background p-4",children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-sm",children:e.name}),m.length>0&&(0,t.jsxs)(g.Button,{size:"xs",variant:"ghost",className:"shrink-0 font-mono",onClick:()=>o(!a),children:[a?(0,t.jsx)(s.ChevronDown,{}):(0,t.jsx)(r.ChevronRight,{}),"Schema"]}),(0,t.jsxs)(g.Button,{size:"xs",variant:"ghost",className:"shrink-0 font-mono",onClick:()=>c(!i),children:[i?(0,t.jsx)(s.ChevronDown,{}):(0,t.jsx)(r.ChevronRight,{}),"Test"]})]}),e.description?(0,t.jsx)("p",{className:(0,j.cn)("mt-0.5 text-xs leading-relaxed text-muted-foreground",!l&&"line-clamp-2",e.description.length>140&&"cursor-pointer"),onClick:()=>d(!l),children:e.description}):null,a?(0,t.jsx)("div",{className:"mt-2 space-y-3 overflow-x-auto rounded-lg border border-input p-3",children:m.map(([e,n])=>(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("span",{className:"block font-mono text-xs text-muted-foreground",children:"inputSchema"===e?"in":"out"}),(0,t.jsx)("pre",{className:"font-mono text-xs leading-relaxed whitespace-pre",children:function e(t,n=0){if(!t||"object"!=typeof t)return"unknown";let s=" ".repeat(n+1),r=" ".repeat(n);if(Array.isArray(t.enum))return t.enum.map(e=>JSON.stringify(e)).join(" | ");let a=t.anyOf??t.oneOf;if(Array.isArray(a))return a.map(t=>e(t,n)).join(" | ");if("array"===t.type){let s=e(t.items,n);return/[|{]/.test(s)?`(${s})[]`:`${s}[]`}if("object"===t.type||t.properties){let a=t.properties;if(!a||0===Object.keys(a).length)return"{}";let o=t.required??[],i=Object.entries(a).map(([t,r])=>{let a=o.includes(t)?"":"?",i=r?.description,c="string"==typeof i&&i.length<=60?` // ${i}`:"";return`${s}${t}${a}: ${e(r,n+1)}${c}`});return`{
2
2
  ${i.join("\n")}
3
3
  ${r}}`}return Array.isArray(t.type)?t.type.join(" | "):"string"==typeof t.type?t.type:"unknown"}(n)})]},e))}):null,i?(0,t.jsx)(et,{tool:e,serverName:n}):null]})}function et({tool:e,serverName:n}){let[s,r]=(0,h.useState)(()=>(function(e){let t=e.inputSchema?.properties;if(!t||"object"!=typeof t)return"{}";let n={};for(let[e,s]of Object.entries(t))n[e]=s?.type==="number"||s?.type==="integer"?0:s?.type!=="boolean"&&(s?.type==="array"?[]:s?.type==="object"?{}:"");return JSON.stringify(n,null,2)})(e)),[o,i]=(0,h.useState)(""),[c,l,d,m,u]=(0,G.useServerAction)(P,{errorMessage:!1});return(0,t.jsxs)("div",{className:"mt-2 space-y-2 rounded-lg border border-input p-3",children:[(0,t.jsx)(z.Textarea,{value:s,onChange:e=>r(e.target.value),spellCheck:!1,className:"min-h-24 resize-none font-mono text-xs"}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)("span",{className:"font-mono text-xs text-destructive",children:o||m}),(0,t.jsxs)(g.Button,{size:"sm",loading:l,onClick:()=>{let t;try{t=s.trim()?JSON.parse(s):void 0}catch{i("Not valid JSON");return}i(""),u(),c(n,e.name,t)},children:[!l&&(0,t.jsx)(a.Play,{}),"Run"]})]}),void 0!==d&&(0,t.jsx)("div",{className:"overflow-x-auto rounded-lg bg-muted/40 p-3",children:(0,t.jsx)(b,{data:d,initialExpandDepth:3})})]})}function en(e){return S.notify.component({className:"sm:max-w-lg",renderer:({close:n})=>(0,t.jsx)(es,{initial:e,onDone:n})})}function es({initial:e,onDone:n}){let s=e&&q(e.config)?e.config:void 0,r=e&&!q(e.config)?e.config:void 0,[a,o]=(0,_.useObjectState)({mode:r?"stdio":"http",name:e?.name??"",url:s?.url??"",headers:eo(s?.headers),command:r?.command??"",args:(r?.args??[]).join(" "),env:eo(r?.env),raw:""}),{mode:i,name:c,url:l,headers:d,command:m,args:u,env:p,raw:f}=a,[j,b]=(0,G.useServerAction)(R,{...el,onOk:e=>{el.onOk(e),"error"!==e.status&&n()}}),y=(0,h.useMemo)(()=>{var e,t,n,s,r;let a,o;return"json"===i?function(e){let t,n=e.trim();if(!n)return{value:null,error:""};try{t=JSON.parse(n)}catch{return{value:null,error:"Not valid JSON"}}let s=I.safeParse(t);if(s.success)return{value:{name:null,config:s.data},error:""};let r=H.safeParse(t);if(!r.success)return{value:null,error:"Needs a url or a command"};let a=Object.entries("mcpServers"in r.data?r.data.mcpServers:r.data)[0];return a?{value:{name:a[0],config:a[1]},error:""}:{value:null,error:"No server in there"}}(f):"http"===i?(e=l,t=d,(a=L.safeParse({url:e.trim(),headers:ei(t)})).success?{value:{name:null,config:a.data},error:""}:{value:null,error:e.trim()?"Needs a valid url":""}):(n=m,s=u,r=p,(o=E.safeParse({command:n.trim(),args:s.split(/\s+/).filter(Boolean),env:ei(r)})).success?{value:{name:null,config:o.data},error:""}:{value:null,error:n.trim()?"Needs a command":""})},[i,f,l,d,m,u,p]),N="json"===i?f:JSON.stringify([i,l,d,m,u,p]),[k,S]=(0,h.useState)(N);(0,h.useEffect)(()=>{let e=setTimeout(()=>S(N),700);return()=>clearTimeout(e)},[N]);let w=k===N?y.error:"",T=c||y.value?.name||"",A=K.safeParse({name:T,config:y.value?.config});function P(e){let t=y.value?.config;return t?"json"===e?o({mode:e,raw:JSON.stringify(t,null,2)}):"http"===e&&q(t)?o({mode:e,url:t.url,headers:eo(t.headers)}):"stdio"!==e||q(t)?void o({mode:e}):o({mode:e,command:t.command,args:(t.args??[]).join(" "),env:eo(t.env)}):o({mode:e})}let F=(0,t.jsxs)("span",{className:"flex items-center gap-2 font-mono text-xs text-muted-foreground",children:["JSON",(0,t.jsx)(C.Switch,{size:"sm",checked:"json"===i,onCheckedChange:e=>{let t;return e?P("json"):void P((t=y.value?.config)&&!q(t)?"stdio":"http")}})]});return(0,t.jsx)(W.SettingDialogContent,{title:"Add MCP server",description:"Its tools become available to every bot.",footer:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(g.Button,{variant:"ghost",onClick:n,children:"Cancel"}),(0,t.jsx)(g.Button,{disabled:!A.success,loading:b,onClick:()=>{A.success&&!b&&j(A.data)},children:"Connect"})]}),children:(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)(x.Field,{children:[(0,t.jsx)(x.FieldLabel,{children:"Name"}),(0,t.jsx)(v.Input,{value:T,onChange:e=>o({name:e.target.value}),placeholder:"notion",spellCheck:!1})]}),"json"===i?(0,t.jsxs)(x.Field,{children:[(0,t.jsxs)("div",{className:"flex min-h-6 items-center justify-between gap-2",children:[(0,t.jsx)(x.FieldLabel,{children:"JSON"}),F]}),(0,t.jsx)(z.Textarea,{value:f,onChange:e=>o({raw:e.target.value}),spellCheck:!1,placeholder:ec,className:"min-h-64 resize-none font-mono text-xs"})]}):(0,t.jsxs)(O.Tabs,{value:i,onValueChange:e=>P(e),className:"gap-6",children:[(0,t.jsxs)(x.Field,{children:[(0,t.jsxs)("div",{className:"flex min-h-6 items-center justify-between gap-2",children:[(0,t.jsx)(x.FieldLabel,{children:"Transport"}),F]}),(0,t.jsxs)(O.TabsList,{className:"w-full",children:[(0,t.jsx)(O.TabsTrigger,{value:"http",children:"HTTP"}),(0,t.jsx)(O.TabsTrigger,{value:"stdio",children:"STDIO"})]})]}),(0,t.jsxs)(O.TabsContent,{value:"http",className:"space-y-6",children:[(0,t.jsxs)(x.Field,{children:[(0,t.jsx)(x.FieldLabel,{children:"URL"}),(0,t.jsx)(v.Input,{value:l,onChange:e=>o({url:e.target.value}),placeholder:"https://mcp.notion.com/mcp",spellCheck:!1,className:"font-mono text-xs"})]}),(0,t.jsx)(er,{label:"Headers",pairs:d,onChange:e=>o({headers:e}),keyPlaceholder:"Authorization",valuePlaceholder:"Bearer sk-..."})]}),(0,t.jsxs)(O.TabsContent,{value:"stdio",className:"space-y-6",children:[(0,t.jsxs)(x.Field,{children:[(0,t.jsx)(x.FieldLabel,{children:"Command"}),(0,t.jsx)(v.Input,{value:m,onChange:e=>o({command:e.target.value}),placeholder:"npx",spellCheck:!1,className:"font-mono text-xs"})]}),(0,t.jsxs)(x.Field,{children:[(0,t.jsx)(x.FieldLabel,{children:"Args"}),(0,t.jsx)(v.Input,{value:u,onChange:e=>o({args:e.target.value}),placeholder:"-y @notionhq/notion-mcp-server",spellCheck:!1,className:"font-mono text-xs"})]}),(0,t.jsx)(er,{label:"Env",pairs:p,onChange:e=>o({env:e}),keyPlaceholder:"NOTION_TOKEN",valuePlaceholder:"ntn_..."})]})]}),w&&(0,t.jsx)("p",{className:"font-mono text-xs text-destructive",children:w})]})})}function er({label:e,pairs:n,onChange:s,keyPlaceholder:r,valuePlaceholder:a}){let i=(e,t)=>s(n.map(n=>n.id===e?{...n,...t}:n));return(0,t.jsxs)(x.Field,{children:[(0,t.jsx)(x.FieldLabel,{children:e}),(0,t.jsxs)("div",{className:"space-y-2",children:[n.map(e=>(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(v.Input,{value:e.key,onChange:t=>i(e.id,{key:t.target.value}),placeholder:r,spellCheck:!1,className:"font-mono text-xs"}),(0,t.jsx)(v.Input,{value:e.value,onChange:t=>i(e.id,{value:t.target.value}),placeholder:a,spellCheck:!1,className:"font-mono text-xs"}),(0,t.jsx)(g.Button,{variant:"ghost",size:"icon","aria-label":"Remove this row",onClick:()=>s(n.filter(t=>t.id!==e.id)),children:(0,t.jsx)(p.X,{})})]},e.id)),(0,t.jsxs)(g.Button,{variant:"outline",size:"sm",onClick:()=>s([...n,ea()]),children:[(0,t.jsx)(o.Plus,{}),"Add"]})]})]})}let ea=(e="",t="")=>({id:crypto.randomUUID(),key:e,value:t}),eo=e=>Object.entries(e??{}).map(([e,t])=>ea(e,t)),ei=e=>{let t=e.filter(e=>e.key.trim());if(t.length)return Object.fromEntries(t.map(e=>[e.key.trim(),e.value]))},ec=`/** STDIO Example */
4
4
  {
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,480869,e=>{"use strict";var t=e.i(843476),n=e.i(401851),a=e.i(493801),s=e.i(456420);let i={name:"calendar-days",size:24,node:[["path",{d:"M8 2v3",key:"1ioesn"}],["path",{d:"M16 2v3",key:"otl347"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M8 13h.01",key:"1sbv64"}],["path",{d:"M12 13h.01",key:"y0uutt"}],["path",{d:"M16 13h.01",key:"wip0gl"}],["path",{d:"M8 17h.01",key:"p3bg7i"}],["path",{d:"M12 17h.01",key:"p32p05"}],["path",{d:"M16 17h.01",key:"ql8jdd"}]]};i.node;let r=(0,s.default)(i);var l=e.i(689664),o=e.i(716327),d=e.i(867927),c=e.i(772382),u=e.i(632781),h=e.i(648119),m=e.i(21357),x=e.i(759659),f=e.i(263676),p=e.i(271645),g=e.i(798120),b=e.i(167881),y=e.i(630374),j=e.i(463415),k=e.i(23750),w=e.i(917162),v=e.i(421429),N=e.i(660302),S=e.i(319036),M=e.i(184762),D=e.i(41533),$=e.i(635963),T=e.i(978411),C=e.i(895836),R=e.i(989409),A=e.i(245629),O=e.i(609856),z=e.i(283653),I=e.i(647163),q=e.i(95187);let E=(0,q.createServerReference)("7f621b99182ca53b4cd8a555d03bd596c306919419",q.callServer,void 0,q.findSourceMapURL,"createRoutineAction"),L=(0,q.createServerReference)("7f2721d272673b2dda08f67a83f4b6cb25a053ba59",q.callServer,void 0,q.findSourceMapURL,"deleteRoutineAction"),P=(0,q.createServerReference)("7f353b0518405d026a2fc61ca64cdcc7d533e2c30d",q.callServer,void 0,q.findSourceMapURL,"runRoutineNowAction"),B=(0,q.createServerReference)("7f6a09a0d2e08607380b9a21bb65b0eb1ba62df39b",q.callServer,void 0,q.findSourceMapURL,"stopWatchingAction"),U=(0,q.createServerReference)("7f6e9614a1896b9bc927af4a827617fc66b58ec55e",q.callServer,void 0,q.findSourceMapURL,"updateRoutineAction");var F=e.i(362201);let H=[1,2,3,4,5,6,7],W=F.string().regex(/^([01]\d|2[0-3]):[0-5]\d$/,"A time is HH:MM, 00:00 to 23:59");function K(e){let[t,n]=e.split(" "),[a,s,i]=t.split("-").map(Number),[r,l]=n.split(":").map(Number);return new Date(a,s-1,i,r,l)}let G=/^\d{4}-\d\d-\d\d ([01]\d|2[0-3]):[0-5]\d$/,J=F.string().regex(G,'A moment is "YYYY-MM-DD HH:MM"').refine(e=>{if(!G.test(e))return!0;let t=K(e);return t.getMonth()===Number(e.slice(5,7))-1&&t.getDate()===Number(e.slice(8,10))},"There is no such day"),Y=F.discriminatedUnion("kind",[F.object({kind:F.literal("once"),at:J}),F.object({kind:F.literal("daily"),time:W,days:F.array(F.number().int().min(1).max(7)).min(1,"Pick at least one day").transform(e=>[...new Set(e)].sort((e,t)=>e-t))}),F.object({kind:F.literal("every"),hours:F.number().int().min(D.ROUTINE.minHours,`No more often than every ${D.ROUTINE.minHours}h`).max(168)})]),_=F.object({bot:F.string().trim().min(1,"Pick a bot"),label:F.string().trim().min(1,"Give it a name").max(80),request:F.string().trim().min(1,"Say what it should do"),schedule:Y}),V=F.object({id:F.string(),status:F.enum(["running","waiting","done","cancelled"]),outcome:F.string().nullable(),updatedAt:A.DateLikeSchema});_.extend({id:F.string(),enabled:F.boolean(),nextRunAt:A.DateLikeSchema,watch:F.string().nullable(),watchedAt:A.DateLikeSchema.nullable(),watchLast:F.enum(["same","changed","failed"]).nullable(),runs:F.array(V)});let X=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Q=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Z(e){if("once"===e.kind){let[t,n]=e.at.split(" "),[,a,s]=t.split("-").map(Number);return`Once \xb7 ${Q[a-1]} ${s} ${n}`}if("every"===e.kind)return 1===e.hours?"Every hour":`Every ${e.hours} hours`;let{days:t,time:n}=e;if(7===t.length)return`Daily ${n}`;if(1===t.length)return`${X[t[0]-1]} ${n}`;let a=t.every((e,n)=>0===n||e===t[n-1]+1)?`${X[t[0]-1]}–${X[t.at(-1)-1]}`:t.map(e=>X[e-1]).join(" ");return`Daily ${n} \xb7 ${a}`}var ee=e.i(431594);function et({routine:e,bots:n,open:a,onOpen:s,onSwitch:i}){let r=function(e,t){let n=e.runs[0],a=n?.outcome?(0,I.plainText)(n.outcome):"",s=n?`${(0,A.whenOf)(n.updatedAt)}${a?` — ${a}`:""}`:"Not run yet";if(!e.enabled)return{text:`Off \xb7 ${s}`,tone:"text-muted-foreground"};let i=t?.find(t=>t.name===e.bot);return t&&(!i||i.disabled)?{text:i?`${e.bot} is switched off`:`${e.bot} is gone — pick another bot`,tone:I.WAITING_INK,waits:!0}:n?.status==="running"?{text:"Running now",tone:"",shine:!0}:n?.status==="waiting"?{text:`The last run waits on you${a?`: ${a}`:""}`,tone:I.WAITING_INK,waits:!0}:{text:s,tone:"text-muted-foreground"}}(e,n),l=e.runs[0]?.status==="running";return(0,t.jsxs)("div",{className:(0,I.cn)("flex items-center gap-3 p-4 transition-colors",a?"bg-muted/80":"hover:bg-muted/50"),children:[(0,t.jsxs)("button",{type:"button",onClick:s,className:(0,I.cn)("flex min-w-0 flex-1 items-center gap-3 rounded-md text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",!e.enabled&&"opacity-70"),children:[(0,t.jsx)($.BotMark,{size:40,seed:e.bot,...(0,$.markOf)(e.bot,n),state:l?"thinking":"idle",notify:!!r.waits,className:"shrink-0"}),(0,t.jsxs)("span",{className:"min-w-0 flex-1 space-y-0.5",children:[(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"truncate text-sm font-medium",children:e.label}),l&&(0,t.jsx)(u.Loader2,{className:"size-3 shrink-0 animate-spin text-muted-foreground"})]}),(0,t.jsx)("span",{className:"flex min-w-0 text-[13px] leading-snug",children:r.shine?(0,t.jsx)(N.ShinyText,{text:r.text,speed:2.2,className:"min-w-0 truncate"}):(0,t.jsx)("span",{className:(0,I.cn)("min-w-0 truncate",r.tone),children:r.text})})]}),(0,t.jsxs)("span",{className:"flex w-44 shrink-0 flex-col items-end gap-0.5 font-mono text-[11px] leading-4 text-muted-foreground tabular-nums",children:[(0,t.jsxs)("span",{className:"flex max-w-full items-center gap-1.5 text-foreground",children:[(0,t.jsx)(ee.RoutineMark,{className:"size-3 shrink-0 text-muted-foreground"}),(0,t.jsx)("span",{className:"truncate",children:Z(e.schedule)})]}),e.watch&&(0,t.jsxs)("span",{className:(0,I.cn)("flex max-w-full items-center gap-1.5","failed"===e.watchLast?I.WAITING_INK:"text-muted-foreground"),children:[(0,t.jsx)(c.Eye,{className:"size-3 shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:function(e){let t="same"===e.watchLast?"no change":"changed"===e.watchLast?"changed":"failed"===e.watchLast?"watch failed":"watching";if(!e.watchedAt||!e.watchLast)return t;let n=(0,A.shortAgo)(e.watchedAt);return`${t} \xb7 ${"now"===n?"just now":`${n} ago`}`}(e)})]}),(0,t.jsx)("span",{className:"max-w-full truncate text-muted-foreground",children:e.enabled?`next ${(0,A.whenOf)(e.nextRunAt)}`:"off"})]})]}),(0,t.jsx)(S.Switch,{checked:e.enabled,onCheckedChange:i,"aria-label":`${e.label} on or off`,className:"shrink-0"}),(0,t.jsx)("button",{type:"button",onClick:s,"aria-label":`Open ${e.label}`,className:"shrink-0 rounded-md text-muted-foreground outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,t.jsx)(d.ChevronRight,{className:"size-4"})})]})}let en=e=>String(e).padStart(2,"0");function ea(e,t=new Date){let a=new Date(t);return a.setDate(a.getDate()+e),(0,n.format)(a,"yyyy-MM-dd")}let es=(e,t)=>{let n=e?.schedule;return{label:e?.label??"",bot:e?.bot??t.find(e=>!e.disabled)?.name??"",request:e?.request??"",kind:n?.kind??"daily",time:n?.kind==="daily"?n.time:n?.kind==="once"?n.at.slice(11):"09:00",days:n?.kind==="daily"?n.days:[...H],hours:n?.kind==="every"?n.hours:6,date:n?.kind==="once"?n.at.slice(0,10):ea(1)}};function ei(e){let t=/^\d\d:\d\d$/.test(e.time);return"once"===e.kind?t&&e.date?{kind:"once",at:`${e.date} ${e.time}`}:null:"daily"===e.kind?e.days.length&&t?{kind:"daily",time:e.time,days:e.days}:null:{kind:"every",hours:e.hours}}let er=e=>e?.kind==="once"&&K(e.at)<=new Date,el=[{label:"Every day",days:[...H]},{label:"Weekdays",days:[1,2,3,4,5]},{label:"Weekends",days:[6,7]}],eo=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],ed=[1,2,3,6,12,24].filter(e=>e>=D.ROUTINE.minHours);function ec({routine:e,bots:n,onClose:a,onMade:s}){var i,r;let l,[c,u]=(0,p.useState)(null),N=(0,p.useCallback)(e=>{u(e?.closest("[data-slot=dialog-content]")??null)},[]),D="new"===e?null:e,C="new"===e?"new":e?.id??"",[q,F]=(0,p.useState)(()=>es(D,n));(0,p.useEffect)(()=>F(es(D,n)),[C]);let W=e=>F(t=>({...t,...e})),K=()=>(0,z.revalidate)(g.queryKey.routines),[G,J]=(0,O.useServerAction)(E,{onOk:e=>{K(),s(e.id)}}),[Y]=(0,O.useServerAction)(U,{onOk:K}),[_]=(0,O.useServerAction)(L,{onOk:K}),[V,Q]=(0,O.useServerAction)(B,{onOk:K}),et=async()=>{!D||await w.notify.confirm({title:"Stop watching?",description:`Every start opens a run again. ${D.bot} can set a watch again during one of its runs.`,okText:"Stop watching",destructive:!0})&&await V(D.id).catch(()=>{})},[ex,ey]=(0,O.useServerAction)(P,{onOk:()=>{K(),(0,z.revalidate)(g.queryKey.threads)}}),ej=ei(q),ek=ej&&!er(ej)&&q.label.trim()&&q.bot&&q.request.trim()?{label:q.label.trim(),bot:q.bot,request:q.request.trim(),schedule:ej}:null,ew=e=>{D&&Y(D.id,e)},ev=e=>{W(e);let t=ei({...q,...e});!t||er(t)||D&&function(e,t){if("once"===e.kind)return"once"===t.kind&&e.at===t.at;if("every"===e.kind)return"every"===t.kind&&e.hours===t.hours;let n=e=>[...e].sort((e,t)=>e-t).join();return"daily"===t.kind&&e.time===t.time&&n(e.days)===n(t.days)}(t,D.schedule)||ew({schedule:t,..."once"===t.kind?{enabled:!0}:{}})},eN=!!(D&&(q.label.trim()&&q.label.trim()!==D.label||q.request.trim()&&q.request.trim()!==D.request)),eS=D?eN:!!(q.label.trim()||q.request.trim()),eM=(0,p.useRef)(eS);eM.current=eS;let eD=(0,R.useSettingsStore)(e=>e.holdUnsaved);(0,p.useEffect)(()=>(eD(()=>eM.current),()=>eD(null)),[eD]);let e$=async()=>{(!eM.current||await w.notify.discard())&&a()},eT=async()=>{!D||await w.notify.confirm({title:`Delete "${D.label}"?`,description:"It starts no more. The jobs it already opened stay.",okText:"Delete",destructive:!0})&&(await _(D.id).catch(()=>{}),a())},eC=n.find(e=>e.name===q.bot),eR=D?.runs[0]?.status==="running"||D?.runs[0]?.status==="waiting";return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{ref:N,hidden:!0}),(0,t.jsx)(y.Dialog,{open:!!(e&&c),onOpenChange:e=>!e&&void e$(),modal:!1,disablePointerDismissal:!0,children:(0,t.jsx)(y.DialogPortal,{container:c,children:(0,t.jsx)(y.DialogPopup,{className:"absolute inset-y-0 right-0 z-10 flex w-[min(35rem,calc(100%-13rem))] flex-col border-l border-border/60 bg-popover text-popover-foreground shadow-2xl shadow-black/10 duration-150 data-open:animate-in data-open:fade-in-0 data-open:slide-in-from-right-4 data-closed:animate-out data-closed:fade-out-0 data-closed:slide-out-to-right-4",children:e&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-2.5 pt-3.5 pr-3 pb-1.5 pl-5",children:[eC?(0,t.jsx)($.BotMark,{size:28,seed:eC.name,...(0,$.markOf)(eC.name,n),notify:!1,className:"shrink-0"}):(0,t.jsx)("span",{className:"flex size-7 shrink-0 items-center justify-center rounded-full bg-muted text-muted-foreground",children:(0,t.jsx)(ee.RoutineMark,{className:"size-3.5"})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)(y.DialogTitle,{className:"sr-only",children:D?D.label:"New routine"}),(0,t.jsx)("p",{className:"truncate text-[15px] leading-5 font-semibold",children:D?D.label:"New routine"}),D&&(0,t.jsxs)("p",{className:"mt-0.5 flex min-w-0 items-center gap-1.5 font-mono text-[11px] text-muted-foreground",children:[(0,t.jsx)(ee.RoutineMark,{className:"size-3 shrink-0"}),(0,t.jsxs)("span",{className:"truncate",children:[D.bot," · ",Z(D.schedule),D.enabled&&` \xb7 next ${(0,A.whenOf)(D.nextRunAt)}`]})]})]}),D&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(S.Switch,{checked:D.enabled,onCheckedChange:e=>void Y(D.id,{enabled:e}),"aria-label":`${D.label} on or off`,className:"mr-1 shrink-0"}),(0,t.jsxs)(j.DropdownMenu,{children:[(0,t.jsx)(j.DropdownMenuTrigger,{render:(0,t.jsx)(b.Button,{size:"icon-sm",variant:"ghost","aria-label":"More",className:"text-muted-foreground"}),children:(0,t.jsx)(h.MoreHorizontal,{})}),(0,t.jsx)(j.DropdownMenuContent,{align:"end",children:(0,t.jsxs)(j.DropdownMenuItem,{variant:"destructive",onClick:eT,children:[(0,t.jsx)(x.Trash2,{}),"Delete"]})})]})]}),(0,t.jsx)(y.DialogClose,{render:(0,t.jsx)(b.Button,{size:"icon-sm",variant:"ghost","aria-label":"Close the routine"}),children:(0,t.jsx)(f.X,{})})]}),(0,t.jsxs)("div",{className:"min-h-0 flex-1 space-y-4 overflow-y-auto px-5 pt-3 pb-5",children:[(0,t.jsxs)(eb,{label:"Name",htmlFor:"routine-name",children:[(0,t.jsx)(k.Input,{id:"routine-name",value:q.label,onChange:e=>W({label:e.target.value}),placeholder:"e.g. Morning mail",maxLength:80,autoFocus:!D}),(0,t.jsx)(eu,{children:"What it is called in this list, and what she calls it on a call."})]}),(0,t.jsxs)(eb,{label:"Bot",children:[(0,t.jsxs)(j.DropdownMenu,{children:[(0,t.jsxs)(j.DropdownMenuTrigger,{render:(0,t.jsx)(b.Button,{variant:"outline",className:"justify-start gap-2 pl-1.5 font-normal"}),children:[eC?(0,t.jsx)($.BotMark,{size:20,seed:eC.name,...(0,$.markOf)(eC.name,n),notify:!1,className:"shrink-0"}):null,(0,t.jsx)("span",{className:(0,I.cn)(!eC&&"pl-1.5 text-muted-foreground"),children:eC?.name??(q.bot||"Pick a bot")}),(0,t.jsx)(o.ChevronDown,{className:"ml-1 size-3.5 text-muted-foreground"})]}),(0,t.jsx)(j.DropdownMenuContent,{align:"start",children:(0,t.jsx)(j.DropdownMenuGroup,{children:n.filter(e=>!e.disabled).map(e=>(0,t.jsxs)(j.DropdownMenuItem,{onClick:()=>{W({bot:e.name}),e.name!==D?.bot&&ew({bot:e.name})},children:[(0,t.jsx)($.BotMark,{size:16,seed:e.name,...(0,$.markOf)(e.name,n),notify:!1,className:"shrink-0"}),e.name]},e.name))})})]}),(0,t.jsx)(eu,{children:"Who does the job each time it starts."})]}),(0,t.jsx)(eb,{label:"When",children:(0,t.jsxs)("div",{className:"space-y-3.5",children:[(0,t.jsx)(v.Segmented,{"aria-label":"How it starts",value:q.kind,onChange:e=>ev({kind:e}),options:[{value:"once",label:"Once"},{value:"daily",label:"On set days"},{value:"every",label:"Every few hours"}]}),(0,t.jsx)("div",{className:"space-y-2.5",children:"once"===q.kind?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(em,{word:"On",children:(0,t.jsx)(ef,{value:q.date,onPick:e=>ev({date:e})})}),(0,t.jsxs)(em,{word:"At",children:[(0,t.jsx)(ep,{value:q.time,onChange:e=>W({time:e}),onDone:()=>ev({})}),(0,t.jsx)("span",{className:"text-[13px] text-muted-foreground",children:"or"}),(0,t.jsx)(eh,{picked:!1,onClick:()=>{let e;return ev(((e=new Date(Date.now()+36e5)).setMinutes(5*Math.ceil(e.getMinutes()/5),0,0),{date:ea(0,e),time:`${en(e.getHours())}:${en(e.getMinutes())}`}))},children:"In an hour"})]})]}):"daily"===q.kind?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(em,{word:"On",children:H.map(e=>{let n=q.days.includes(e);return(0,t.jsx)(eh,{picked:n,several:!0,"aria-label":eo[e-1],onClick:()=>ev({days:n?q.days.filter(t=>t!==e):[...q.days,e].sort((e,t)=>e-t)}),children:X[e-1]},e)})}),(0,t.jsx)(em,{children:el.map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>ev({days:[...e.days]}),className:"h-6.5 rounded-full bg-muted px-2.5 text-xs text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:e.label},e.label))}),(0,t.jsx)(em,{word:"At",children:(0,t.jsx)(ep,{value:q.time,onChange:e=>W({time:e}),onDone:()=>ev({})})})]}):(0,t.jsxs)(em,{word:"Every",children:[(ed.includes(q.hours)?ed:[...ed,q.hours].sort((e,t)=>e-t)).map(e=>(0,t.jsx)(eh,{picked:e===q.hours,onClick:()=>ev({hours:e}),className:"min-w-10 px-3",children:e},e)),(0,t.jsx)("span",{className:"text-[13px] text-muted-foreground",children:"hours"})]})}),(0,t.jsx)(eg,{schedule:ej,kind:q.kind})]})}),(0,t.jsxs)(eb,{label:"Job",htmlFor:"routine-request",children:[(0,t.jsx)(M.Textarea,{id:"routine-request",value:q.request,onChange:e=>W({request:e.target.value}),placeholder:"e.g. Go through the mail that came since the last run and draft replies to what needs one. Send nothing.",className:"min-h-28"}),(0,t.jsx)(eu,{children:"Handed to the bot as a new thread each time, with a line on how the last run ended. Nobody is there to ask, so say everything it needs."})]}),D?.watch&&(0,t.jsxs)("div",{className:"space-y-1.5 pt-1",children:[(0,t.jsxs)("div",{className:"flex h-6 items-center gap-2",children:[(0,t.jsxs)("span",{className:"flex-1 font-mono text-xs text-muted-foreground",children:["Watch · set by ",D.bot]}),(0,t.jsx)(b.Button,{type:"button",size:"sm",variant:"ghost",loading:Q,onClick:()=>void et(),className:"h-7 rounded-full px-2.5 text-[12px]",children:"Stop watching"})]}),(0,t.jsx)("pre",{className:"rounded-lg bg-muted/50 p-2 font-mono text-[11.5px] leading-relaxed break-all whitespace-pre-wrap",children:D.watch}),(0,t.jsxs)(eu,{children:["Wakes ",D.bot," only when what this prints changes.",D.watchedAt&&D.watchLast?` Last checked ${(0,A.whenOf)(D.watchedAt)}: ${"same"===D.watchLast?"no change.":"changed"===D.watchLast?"it changed, and a run opened.":"it failed, and a run opened to fix it."}`:" Not checked at a start yet."]})]}),D&&(0,t.jsxs)("div",{className:"pt-1",children:[(0,t.jsx)("div",{className:"flex h-6 items-center",children:(0,t.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:"Runs"})}),0===D.runs.length?(0,t.jsx)("p",{className:"py-2 text-[13px] text-muted-foreground",children:"Not run yet."}):D.runs.map(e=>(0,t.jsxs)("button",{type:"button",onClick:()=>{var t;return t=e.id,void(R.useSettingsStore.getState().hide(),T.roomOpens.open(t))},className:"flex h-9 w-full items-center gap-3 border-t border-border/60 text-left text-[13px] outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,t.jsx)("span",{className:"w-28 shrink-0 font-mono text-[11px] text-muted-foreground tabular-nums",children:(0,A.whenOf)(e.updatedAt)}),(0,t.jsx)("span",{className:(0,I.cn)("min-w-0 flex-1 truncate","waiting"===e.status?I.WAITING_INK:"text-muted-foreground"),children:"running"===e.status?"Running now":e.outcome?(0,I.plainText)(e.outcome):"cancelled"===e.status?"Stopped":"No words"}),(0,t.jsx)(d.ChevronRight,{className:"size-3 shrink-0 text-muted-foreground"})]},e.id))]})]}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-3 border-t border-border/60 px-5 py-3",children:[(0,t.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-4 text-muted-foreground",children:D||ek?"Starts while Thursday is running on this computer, whether or not a tab is open. A time that passed meanwhile starts once, not once for each.":`Still needs ${i=q,r=ej,(l=[i.label.trim()?null:"a name",i.bot?null:"a bot",!r?"a time":er(r)?"a time still ahead":null,i.request.trim()?null:"a job"].filter(e=>null!==e)).length>1?`${l.slice(0,-1).join(", ")} and ${l.at(-1)}`:l[0]??"nothing"}.`}),eN&&(0,t.jsx)(b.Button,{size:"sm",onClick:()=>{if(!D)return;let e={};q.label.trim()&&q.label.trim()!==D.label&&(e.label=q.label.trim()),q.request.trim()&&q.request.trim()!==D.request&&(e.request=q.request.trim()),Object.keys(e).length&&ew(e)},children:"Save"}),D?(0,t.jsxs)(b.Button,{variant:"outline",size:"sm",loading:ey,disabled:eR,title:eR?"Its last run is still open":void 0,onClick:()=>void ex(D.id),children:[(0,t.jsx)(m.Play,{}),"Run now"]}):(0,t.jsx)(b.Button,{size:"sm",loading:J,disabled:!ek,onClick:()=>ek&&void G(ek),children:"Create"})]})]})})})})]})}let eu=({children:e})=>(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e});function eh({picked:e,several:n=!1,className:a,children:s,...i}){return(0,t.jsxs)("button",{type:"button","aria-pressed":e,className:(0,I.cn)("inline-flex h-8 items-center justify-center gap-1.5 rounded-full px-3.5 text-[13px] whitespace-nowrap outline-none transition-colors focus-visible:ring-3 focus-visible:ring-ring/50",!e&&"text-foreground ring-1 ring-border ring-inset hover:bg-muted",e&&(n?"bg-brand/10 pl-2.5 font-medium text-brand ring-1 ring-brand/30 ring-inset":"bg-brand font-medium text-brand-foreground"),a),...i,children:[e&&n&&(0,t.jsx)(l.Check,{className:"size-3.5"}),s]})}function em({word:e,children:n}){return(0,t.jsxs)("div",{className:"flex items-start gap-2.5",children:[(0,t.jsx)("span",{className:"flex h-8 w-9 shrink-0 items-center text-[13px] text-muted-foreground",children:e}),(0,t.jsx)("div",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-1.5",children:n})]})}function ex(e){let t=K(`${e} 00:00`),a=(t.getTime()-K(`${ea(0)} 00:00`).getTime())/864e5;return(0,n.format)(t,a<7?"EEE d":"EEE, MMM d")}function ef({value:e,onPick:n}){let a=(0,p.useRef)(null),s=[0,1,2,3].map(e=>ea(e)),i=()=>a.current?.showPicker();return(0,t.jsxs)(t.Fragment,{children:[s.map((a,s)=>(0,t.jsx)(eh,{picked:a===e,onClick:()=>n(a),children:0===s?"Today":1===s?"Tomorrow":ex(a)},a)),!s.includes(e)&&(0,t.jsx)(eh,{picked:!0,onClick:i,children:ex(e)}),(0,t.jsxs)("span",{className:"relative",children:[(0,t.jsx)(eh,{picked:!1,"aria-label":"Another day",onClick:i,className:"w-8 px-0",children:(0,t.jsx)(r,{className:"size-3.5"})}),(0,t.jsx)("input",{ref:a,type:"date",tabIndex:-1,"aria-hidden":!0,min:s[0],value:e,onChange:e=>e.target.value&&n(e.target.value),className:"pointer-events-none absolute inset-0 opacity-0"})]})]})}function ep({value:e,onChange:n,onDone:a}){return(0,t.jsx)(k.Input,{type:"time","aria-label":"Time of day",value:e,onChange:e=>n(e.target.value),onBlur:a,onClick:e=>e.currentTarget.showPicker?.(),className:"h-8.5 w-28 px-3 text-[15px] tabular-nums md:text-[15px] [&::-webkit-calendar-picker-indicator]:hidden"})}function eg({schedule:e,kind:n}){if(!e||er(e))return(0,t.jsx)("p",{className:"text-xs text-destructive",children:e?"That time has passed. Pick a later one.":"daily"===n?"Pick a time and at least one day.":"Pick a time."});let s=function(e,t){if("once"===e.kind)return K(e.at);if("every"===e.kind)return new Date(t.getTime()+36e5*e.hours);let[n,a]=e.time.split(":").map(Number);for(let s=0;s<=7;s++){let i=new Date(t);i.setDate(i.getDate()+s),i.setHours(n,a,0,0);let r=0===i.getDay()?7:i.getDay();if(i>t&&e.days.includes(r))return i}return new Date(t.getTime()+864e5)}(e,new Date);return(0,t.jsxs)("p",{className:"flex items-start gap-2 text-[13px] leading-5",children:[(0,t.jsx)(ee.RoutineMark,{className:"mt-0.75 size-3.5 shrink-0 text-muted-foreground"}),(0,t.jsxs)("span",{className:"min-w-0",children:[Z(e),(0,t.jsxs)("span",{className:"text-muted-foreground",children:[" · ","once"===e.kind?`${(0,a.formatDistanceToNowStrict)(s,{addSuffix:!0})}, then it switches itself off`:`first start ${(0,A.whenOf)(s)}`]})]})]})}function eb({label:e,htmlFor:n,children:a}){return(0,t.jsxs)("div",{className:"flex gap-3",children:[(0,t.jsx)("label",{htmlFor:n,className:"w-14 shrink-0 pt-2 font-mono text-xs text-muted-foreground",children:e}),(0,t.jsx)("div",{className:"min-w-0 flex-1 space-y-1.5",children:a})]})}e.s(["RoutineSetting",0,function(){let[e,n]=(0,p.useState)(null),{data:a,isLoading:s,error:i}=(0,z.useServerRoute)(g.queryKey.routines),{data:r}=(0,z.useServerRoute)(g.queryKey.bot),[l]=(0,O.useServerAction)(U,{onOk:()=>(0,z.revalidate)(g.queryKey.routines)});if(s)return(0,t.jsx)(C.SettingSkeleton,{rows:3});if(i)return(0,t.jsx)(C.SettingError,{message:i.message});let o=a??[],d=o.filter(e=>e.enabled).length,c=o.find(t=>t.id===e);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(C.SettingScreen,{footer:(0,t.jsxs)(C.SettingRailNote,{children:[o.length," set up · ",d," on",o.length>=D.ROUTINE.max&&` \xb7 ${D.ROUTINE.max} is the most`]}),children:(0,t.jsx)(C.SettingItems,{addRow:o.length<D.ROUTINE.max?{label:"New routine",onClick:()=>n("new")}:void 0,children:0===o.length?(0,t.jsx)("p",{className:"p-4 text-sm leading-relaxed text-muted-foreground",children:'Nothing starts by itself yet. Tell Thursday what should — "every weekday at nine, go through my mail" — or make one here.'}):o.map(a=>(0,t.jsx)(et,{routine:a,bots:r,open:a.id===e,onOpen:()=>n(a.id),onSwitch:e=>l(a.id,{enabled:e})},a.id))})}),(0,t.jsx)(ec,{routine:"new"===e?"new":c??null,bots:r??[],onClose:()=>n(null),onMade:e=>n(e)})]})}],480869)},493801,e=>{"use strict";var t=e.i(24708),n=e.i(989366);e.s(["formatDistanceToNowStrict",0,function(e,a){return(0,n.formatDistanceStrict)(e,(0,t.constructNow)(e),a)}])},648119,e=>{"use strict";var t=e.i(456420);let n={name:"ellipsis",size:24,node:[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],aliases:["more-horizontal"]};n.node;let a=(0,t.default)(n);e.s(["MoreHorizontal",0,a],648119)},21357,e=>{"use strict";var t=e.i(456420);let n={name:"play",size:24,node:[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]};n.node;let a=(0,t.default)(n);e.s(["Play",0,a],21357)},759659,e=>{"use strict";var t=e.i(456420);let n={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"]};n.node;let a=(0,t.default)(n);e.s(["Trash2",0,a],759659)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,480869,e=>{"use strict";var t=e.i(843476),n=e.i(401851),a=e.i(493801),s=e.i(456420);let i={name:"calendar-days",size:24,node:[["path",{d:"M8 2v3",key:"1ioesn"}],["path",{d:"M16 2v3",key:"otl347"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M8 13h.01",key:"1sbv64"}],["path",{d:"M12 13h.01",key:"y0uutt"}],["path",{d:"M16 13h.01",key:"wip0gl"}],["path",{d:"M8 17h.01",key:"p3bg7i"}],["path",{d:"M12 17h.01",key:"p32p05"}],["path",{d:"M16 17h.01",key:"ql8jdd"}]]};i.node;let r=(0,s.default)(i);var l=e.i(689664),o=e.i(716327),d=e.i(867927),c=e.i(772382),u=e.i(632781),h=e.i(648119),m=e.i(21357),x=e.i(759659),f=e.i(263676),p=e.i(271645),g=e.i(798120),b=e.i(167881),y=e.i(630374),j=e.i(463415),k=e.i(23750),w=e.i(917162),v=e.i(421429),N=e.i(660302),S=e.i(319036),M=e.i(184762),D=e.i(41533),$=e.i(635963),T=e.i(978411),C=e.i(895836),R=e.i(989409),A=e.i(245629),O=e.i(609856),z=e.i(283653),I=e.i(647163),q=e.i(95187);let E=(0,q.createServerReference)("7f152ff000c53ce0a4820048e52211171b88786a43",q.callServer,void 0,q.findSourceMapURL,"createRoutineAction"),L=(0,q.createServerReference)("7f536061415569b87ebebdd91631fb0bfa72412baa",q.callServer,void 0,q.findSourceMapURL,"deleteRoutineAction"),P=(0,q.createServerReference)("7fab6ca5f7fa7981be422507ed54ce0e782eb3a50d",q.callServer,void 0,q.findSourceMapURL,"runRoutineNowAction"),B=(0,q.createServerReference)("7f780acc6073bc6ceedd6cf45c47c9c799e200b055",q.callServer,void 0,q.findSourceMapURL,"stopWatchingAction"),U=(0,q.createServerReference)("7f2128aa0a91e5886ee562529d81fb93f40e6caa67",q.callServer,void 0,q.findSourceMapURL,"updateRoutineAction");var F=e.i(362201);let H=[1,2,3,4,5,6,7],W=F.string().regex(/^([01]\d|2[0-3]):[0-5]\d$/,"A time is HH:MM, 00:00 to 23:59");function K(e){let[t,n]=e.split(" "),[a,s,i]=t.split("-").map(Number),[r,l]=n.split(":").map(Number);return new Date(a,s-1,i,r,l)}let G=/^\d{4}-\d\d-\d\d ([01]\d|2[0-3]):[0-5]\d$/,J=F.string().regex(G,'A moment is "YYYY-MM-DD HH:MM"').refine(e=>{if(!G.test(e))return!0;let t=K(e);return t.getMonth()===Number(e.slice(5,7))-1&&t.getDate()===Number(e.slice(8,10))},"There is no such day"),Y=F.discriminatedUnion("kind",[F.object({kind:F.literal("once"),at:J}),F.object({kind:F.literal("daily"),time:W,days:F.array(F.number().int().min(1).max(7)).min(1,"Pick at least one day").transform(e=>[...new Set(e)].sort((e,t)=>e-t))}),F.object({kind:F.literal("every"),hours:F.number().int().min(D.ROUTINE.minHours,`No more often than every ${D.ROUTINE.minHours}h`).max(168)})]),_=F.object({bot:F.string().trim().min(1,"Pick a bot"),label:F.string().trim().min(1,"Give it a name").max(80),request:F.string().trim().min(1,"Say what it should do"),schedule:Y}),V=F.object({id:F.string(),status:F.enum(["running","waiting","done","cancelled"]),outcome:F.string().nullable(),updatedAt:A.DateLikeSchema});_.extend({id:F.string(),enabled:F.boolean(),nextRunAt:A.DateLikeSchema,watch:F.string().nullable(),watchedAt:A.DateLikeSchema.nullable(),watchLast:F.enum(["same","changed","failed"]).nullable(),runs:F.array(V)});let X=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Q=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Z(e){if("once"===e.kind){let[t,n]=e.at.split(" "),[,a,s]=t.split("-").map(Number);return`Once \xb7 ${Q[a-1]} ${s} ${n}`}if("every"===e.kind)return 1===e.hours?"Every hour":`Every ${e.hours} hours`;let{days:t,time:n}=e;if(7===t.length)return`Daily ${n}`;if(1===t.length)return`${X[t[0]-1]} ${n}`;let a=t.every((e,n)=>0===n||e===t[n-1]+1)?`${X[t[0]-1]}–${X[t.at(-1)-1]}`:t.map(e=>X[e-1]).join(" ");return`Daily ${n} \xb7 ${a}`}var ee=e.i(431594);function et({routine:e,bots:n,open:a,onOpen:s,onSwitch:i}){let r=function(e,t){let n=e.runs[0],a=n?.outcome?(0,I.plainText)(n.outcome):"",s=n?`${(0,A.whenOf)(n.updatedAt)}${a?` — ${a}`:""}`:"Not run yet";if(!e.enabled)return{text:`Off \xb7 ${s}`,tone:"text-muted-foreground"};let i=t?.find(t=>t.name===e.bot);return t&&(!i||i.disabled)?{text:i?`${e.bot} is switched off`:`${e.bot} is gone — pick another bot`,tone:I.WAITING_INK,waits:!0}:n?.status==="running"?{text:"Running now",tone:"",shine:!0}:n?.status==="waiting"?{text:`The last run waits on you${a?`: ${a}`:""}`,tone:I.WAITING_INK,waits:!0}:{text:s,tone:"text-muted-foreground"}}(e,n),l=e.runs[0]?.status==="running";return(0,t.jsxs)("div",{className:(0,I.cn)("flex items-center gap-3 p-4 transition-colors",a?"bg-muted/80":"hover:bg-muted/50"),children:[(0,t.jsxs)("button",{type:"button",onClick:s,className:(0,I.cn)("flex min-w-0 flex-1 items-center gap-3 rounded-md text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",!e.enabled&&"opacity-70"),children:[(0,t.jsx)($.BotMark,{size:40,seed:e.bot,...(0,$.markOf)(e.bot,n),state:l?"thinking":"idle",notify:!!r.waits,className:"shrink-0"}),(0,t.jsxs)("span",{className:"min-w-0 flex-1 space-y-0.5",children:[(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"truncate text-sm font-medium",children:e.label}),l&&(0,t.jsx)(u.Loader2,{className:"size-3 shrink-0 animate-spin text-muted-foreground"})]}),(0,t.jsx)("span",{className:"flex min-w-0 text-[13px] leading-snug",children:r.shine?(0,t.jsx)(N.ShinyText,{text:r.text,speed:2.2,className:"min-w-0 truncate"}):(0,t.jsx)("span",{className:(0,I.cn)("min-w-0 truncate",r.tone),children:r.text})})]}),(0,t.jsxs)("span",{className:"flex w-44 shrink-0 flex-col items-end gap-0.5 font-mono text-[11px] leading-4 text-muted-foreground tabular-nums",children:[(0,t.jsxs)("span",{className:"flex max-w-full items-center gap-1.5 text-foreground",children:[(0,t.jsx)(ee.RoutineMark,{className:"size-3 shrink-0 text-muted-foreground"}),(0,t.jsx)("span",{className:"truncate",children:Z(e.schedule)})]}),e.watch&&(0,t.jsxs)("span",{className:(0,I.cn)("flex max-w-full items-center gap-1.5","failed"===e.watchLast?I.WAITING_INK:"text-muted-foreground"),children:[(0,t.jsx)(c.Eye,{className:"size-3 shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:function(e){let t="same"===e.watchLast?"no change":"changed"===e.watchLast?"changed":"failed"===e.watchLast?"watch failed":"watching";if(!e.watchedAt||!e.watchLast)return t;let n=(0,A.shortAgo)(e.watchedAt);return`${t} \xb7 ${"now"===n?"just now":`${n} ago`}`}(e)})]}),(0,t.jsx)("span",{className:"max-w-full truncate text-muted-foreground",children:e.enabled?`next ${(0,A.whenOf)(e.nextRunAt)}`:"off"})]})]}),(0,t.jsx)(S.Switch,{checked:e.enabled,onCheckedChange:i,"aria-label":`${e.label} on or off`,className:"shrink-0"}),(0,t.jsx)("button",{type:"button",onClick:s,"aria-label":`Open ${e.label}`,className:"shrink-0 rounded-md text-muted-foreground outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,t.jsx)(d.ChevronRight,{className:"size-4"})})]})}let en=e=>String(e).padStart(2,"0");function ea(e,t=new Date){let a=new Date(t);return a.setDate(a.getDate()+e),(0,n.format)(a,"yyyy-MM-dd")}let es=(e,t)=>{let n=e?.schedule;return{label:e?.label??"",bot:e?.bot??t.find(e=>!e.disabled)?.name??"",request:e?.request??"",kind:n?.kind??"daily",time:n?.kind==="daily"?n.time:n?.kind==="once"?n.at.slice(11):"09:00",days:n?.kind==="daily"?n.days:[...H],hours:n?.kind==="every"?n.hours:6,date:n?.kind==="once"?n.at.slice(0,10):ea(1)}};function ei(e){let t=/^\d\d:\d\d$/.test(e.time);return"once"===e.kind?t&&e.date?{kind:"once",at:`${e.date} ${e.time}`}:null:"daily"===e.kind?e.days.length&&t?{kind:"daily",time:e.time,days:e.days}:null:{kind:"every",hours:e.hours}}let er=e=>e?.kind==="once"&&K(e.at)<=new Date,el=[{label:"Every day",days:[...H]},{label:"Weekdays",days:[1,2,3,4,5]},{label:"Weekends",days:[6,7]}],eo=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],ed=[1,2,3,6,12,24].filter(e=>e>=D.ROUTINE.minHours);function ec({routine:e,bots:n,onClose:a,onMade:s}){var i,r;let l,[c,u]=(0,p.useState)(null),N=(0,p.useCallback)(e=>{u(e?.closest("[data-slot=dialog-content]")??null)},[]),D="new"===e?null:e,C="new"===e?"new":e?.id??"",[q,F]=(0,p.useState)(()=>es(D,n));(0,p.useEffect)(()=>F(es(D,n)),[C]);let W=e=>F(t=>({...t,...e})),K=()=>(0,z.revalidate)(g.queryKey.routines),[G,J]=(0,O.useServerAction)(E,{onOk:e=>{K(),s(e.id)}}),[Y]=(0,O.useServerAction)(U,{onOk:K}),[_]=(0,O.useServerAction)(L,{onOk:K}),[V,Q]=(0,O.useServerAction)(B,{onOk:K}),et=async()=>{!D||await w.notify.confirm({title:"Stop watching?",description:`Every start opens a run again. ${D.bot} can set a watch again during one of its runs.`,okText:"Stop watching",destructive:!0})&&await V(D.id).catch(()=>{})},[ex,ey]=(0,O.useServerAction)(P,{onOk:()=>{K(),(0,z.revalidate)(g.queryKey.threads)}}),ej=ei(q),ek=ej&&!er(ej)&&q.label.trim()&&q.bot&&q.request.trim()?{label:q.label.trim(),bot:q.bot,request:q.request.trim(),schedule:ej}:null,ew=e=>{D&&Y(D.id,e)},ev=e=>{W(e);let t=ei({...q,...e});!t||er(t)||D&&function(e,t){if("once"===e.kind)return"once"===t.kind&&e.at===t.at;if("every"===e.kind)return"every"===t.kind&&e.hours===t.hours;let n=e=>[...e].sort((e,t)=>e-t).join();return"daily"===t.kind&&e.time===t.time&&n(e.days)===n(t.days)}(t,D.schedule)||ew({schedule:t,..."once"===t.kind?{enabled:!0}:{}})},eN=!!(D&&(q.label.trim()&&q.label.trim()!==D.label||q.request.trim()&&q.request.trim()!==D.request)),eS=D?eN:!!(q.label.trim()||q.request.trim()),eM=(0,p.useRef)(eS);eM.current=eS;let eD=(0,R.useSettingsStore)(e=>e.holdUnsaved);(0,p.useEffect)(()=>(eD(()=>eM.current),()=>eD(null)),[eD]);let e$=async()=>{(!eM.current||await w.notify.discard())&&a()},eT=async()=>{!D||await w.notify.confirm({title:`Delete "${D.label}"?`,description:"It starts no more. The jobs it already opened stay.",okText:"Delete",destructive:!0})&&(await _(D.id).catch(()=>{}),a())},eC=n.find(e=>e.name===q.bot),eR=D?.runs[0]?.status==="running"||D?.runs[0]?.status==="waiting";return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{ref:N,hidden:!0}),(0,t.jsx)(y.Dialog,{open:!!(e&&c),onOpenChange:e=>!e&&void e$(),modal:!1,disablePointerDismissal:!0,children:(0,t.jsx)(y.DialogPortal,{container:c,children:(0,t.jsx)(y.DialogPopup,{className:"absolute inset-y-0 right-0 z-10 flex w-[min(35rem,calc(100%-13rem))] flex-col border-l border-border/60 bg-popover text-popover-foreground shadow-2xl shadow-black/10 duration-150 data-open:animate-in data-open:fade-in-0 data-open:slide-in-from-right-4 data-closed:animate-out data-closed:fade-out-0 data-closed:slide-out-to-right-4",children:e&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-2.5 pt-3.5 pr-3 pb-1.5 pl-5",children:[eC?(0,t.jsx)($.BotMark,{size:28,seed:eC.name,...(0,$.markOf)(eC.name,n),notify:!1,className:"shrink-0"}):(0,t.jsx)("span",{className:"flex size-7 shrink-0 items-center justify-center rounded-full bg-muted text-muted-foreground",children:(0,t.jsx)(ee.RoutineMark,{className:"size-3.5"})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)(y.DialogTitle,{className:"sr-only",children:D?D.label:"New routine"}),(0,t.jsx)("p",{className:"truncate text-[15px] leading-5 font-semibold",children:D?D.label:"New routine"}),D&&(0,t.jsxs)("p",{className:"mt-0.5 flex min-w-0 items-center gap-1.5 font-mono text-[11px] text-muted-foreground",children:[(0,t.jsx)(ee.RoutineMark,{className:"size-3 shrink-0"}),(0,t.jsxs)("span",{className:"truncate",children:[D.bot," · ",Z(D.schedule),D.enabled&&` \xb7 next ${(0,A.whenOf)(D.nextRunAt)}`]})]})]}),D&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(S.Switch,{checked:D.enabled,onCheckedChange:e=>void Y(D.id,{enabled:e}),"aria-label":`${D.label} on or off`,className:"mr-1 shrink-0"}),(0,t.jsxs)(j.DropdownMenu,{children:[(0,t.jsx)(j.DropdownMenuTrigger,{render:(0,t.jsx)(b.Button,{size:"icon-sm",variant:"ghost","aria-label":"More",className:"text-muted-foreground"}),children:(0,t.jsx)(h.MoreHorizontal,{})}),(0,t.jsx)(j.DropdownMenuContent,{align:"end",children:(0,t.jsxs)(j.DropdownMenuItem,{variant:"destructive",onClick:eT,children:[(0,t.jsx)(x.Trash2,{}),"Delete"]})})]})]}),(0,t.jsx)(y.DialogClose,{render:(0,t.jsx)(b.Button,{size:"icon-sm",variant:"ghost","aria-label":"Close the routine"}),children:(0,t.jsx)(f.X,{})})]}),(0,t.jsxs)("div",{className:"min-h-0 flex-1 space-y-4 overflow-y-auto px-5 pt-3 pb-5",children:[(0,t.jsxs)(eb,{label:"Name",htmlFor:"routine-name",children:[(0,t.jsx)(k.Input,{id:"routine-name",value:q.label,onChange:e=>W({label:e.target.value}),placeholder:"e.g. Morning mail",maxLength:80,autoFocus:!D}),(0,t.jsx)(eu,{children:"What it is called in this list, and what she calls it on a call."})]}),(0,t.jsxs)(eb,{label:"Bot",children:[(0,t.jsxs)(j.DropdownMenu,{children:[(0,t.jsxs)(j.DropdownMenuTrigger,{render:(0,t.jsx)(b.Button,{variant:"outline",className:"justify-start gap-2 pl-1.5 font-normal"}),children:[eC?(0,t.jsx)($.BotMark,{size:20,seed:eC.name,...(0,$.markOf)(eC.name,n),notify:!1,className:"shrink-0"}):null,(0,t.jsx)("span",{className:(0,I.cn)(!eC&&"pl-1.5 text-muted-foreground"),children:eC?.name??(q.bot||"Pick a bot")}),(0,t.jsx)(o.ChevronDown,{className:"ml-1 size-3.5 text-muted-foreground"})]}),(0,t.jsx)(j.DropdownMenuContent,{align:"start",children:(0,t.jsx)(j.DropdownMenuGroup,{children:n.filter(e=>!e.disabled).map(e=>(0,t.jsxs)(j.DropdownMenuItem,{onClick:()=>{W({bot:e.name}),e.name!==D?.bot&&ew({bot:e.name})},children:[(0,t.jsx)($.BotMark,{size:16,seed:e.name,...(0,$.markOf)(e.name,n),notify:!1,className:"shrink-0"}),e.name]},e.name))})})]}),(0,t.jsx)(eu,{children:"Who does the job each time it starts."})]}),(0,t.jsx)(eb,{label:"When",children:(0,t.jsxs)("div",{className:"space-y-3.5",children:[(0,t.jsx)(v.Segmented,{"aria-label":"How it starts",value:q.kind,onChange:e=>ev({kind:e}),options:[{value:"once",label:"Once"},{value:"daily",label:"On set days"},{value:"every",label:"Every few hours"}]}),(0,t.jsx)("div",{className:"space-y-2.5",children:"once"===q.kind?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(em,{word:"On",children:(0,t.jsx)(ef,{value:q.date,onPick:e=>ev({date:e})})}),(0,t.jsxs)(em,{word:"At",children:[(0,t.jsx)(ep,{value:q.time,onChange:e=>W({time:e}),onDone:()=>ev({})}),(0,t.jsx)("span",{className:"text-[13px] text-muted-foreground",children:"or"}),(0,t.jsx)(eh,{picked:!1,onClick:()=>{let e;return ev(((e=new Date(Date.now()+36e5)).setMinutes(5*Math.ceil(e.getMinutes()/5),0,0),{date:ea(0,e),time:`${en(e.getHours())}:${en(e.getMinutes())}`}))},children:"In an hour"})]})]}):"daily"===q.kind?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(em,{word:"On",children:H.map(e=>{let n=q.days.includes(e);return(0,t.jsx)(eh,{picked:n,several:!0,"aria-label":eo[e-1],onClick:()=>ev({days:n?q.days.filter(t=>t!==e):[...q.days,e].sort((e,t)=>e-t)}),children:X[e-1]},e)})}),(0,t.jsx)(em,{children:el.map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>ev({days:[...e.days]}),className:"h-6.5 rounded-full bg-muted px-2.5 text-xs text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:e.label},e.label))}),(0,t.jsx)(em,{word:"At",children:(0,t.jsx)(ep,{value:q.time,onChange:e=>W({time:e}),onDone:()=>ev({})})})]}):(0,t.jsxs)(em,{word:"Every",children:[(ed.includes(q.hours)?ed:[...ed,q.hours].sort((e,t)=>e-t)).map(e=>(0,t.jsx)(eh,{picked:e===q.hours,onClick:()=>ev({hours:e}),className:"min-w-10 px-3",children:e},e)),(0,t.jsx)("span",{className:"text-[13px] text-muted-foreground",children:"hours"})]})}),(0,t.jsx)(eg,{schedule:ej,kind:q.kind})]})}),(0,t.jsxs)(eb,{label:"Job",htmlFor:"routine-request",children:[(0,t.jsx)(M.Textarea,{id:"routine-request",value:q.request,onChange:e=>W({request:e.target.value}),placeholder:"e.g. Go through the mail that came since the last run and draft replies to what needs one. Send nothing.",className:"min-h-28"}),(0,t.jsx)(eu,{children:"Handed to the bot as a new thread each time, with a line on how the last run ended. Nobody is there to ask, so say everything it needs."})]}),D?.watch&&(0,t.jsxs)("div",{className:"space-y-1.5 pt-1",children:[(0,t.jsxs)("div",{className:"flex h-6 items-center gap-2",children:[(0,t.jsxs)("span",{className:"flex-1 font-mono text-xs text-muted-foreground",children:["Watch · set by ",D.bot]}),(0,t.jsx)(b.Button,{type:"button",size:"sm",variant:"ghost",loading:Q,onClick:()=>void et(),className:"h-7 rounded-full px-2.5 text-[12px]",children:"Stop watching"})]}),(0,t.jsx)("pre",{className:"rounded-lg bg-muted/50 p-2 font-mono text-[11.5px] leading-relaxed break-all whitespace-pre-wrap",children:D.watch}),(0,t.jsxs)(eu,{children:["Wakes ",D.bot," only when what this prints changes.",D.watchedAt&&D.watchLast?` Last checked ${(0,A.whenOf)(D.watchedAt)}: ${"same"===D.watchLast?"no change.":"changed"===D.watchLast?"it changed, and a run opened.":"it failed, and a run opened to fix it."}`:" Not checked at a start yet."]})]}),D&&(0,t.jsxs)("div",{className:"pt-1",children:[(0,t.jsx)("div",{className:"flex h-6 items-center",children:(0,t.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:"Runs"})}),0===D.runs.length?(0,t.jsx)("p",{className:"py-2 text-[13px] text-muted-foreground",children:"Not run yet."}):D.runs.map(e=>(0,t.jsxs)("button",{type:"button",onClick:()=>{var t;return t=e.id,void(R.useSettingsStore.getState().hide(),T.roomOpens.open(t))},className:"flex h-9 w-full items-center gap-3 border-t border-border/60 text-left text-[13px] outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,t.jsx)("span",{className:"w-28 shrink-0 font-mono text-[11px] text-muted-foreground tabular-nums",children:(0,A.whenOf)(e.updatedAt)}),(0,t.jsx)("span",{className:(0,I.cn)("min-w-0 flex-1 truncate","waiting"===e.status?I.WAITING_INK:"text-muted-foreground"),children:"running"===e.status?"Running now":e.outcome?(0,I.plainText)(e.outcome):"cancelled"===e.status?"Stopped":"No words"}),(0,t.jsx)(d.ChevronRight,{className:"size-3 shrink-0 text-muted-foreground"})]},e.id))]})]}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-3 border-t border-border/60 px-5 py-3",children:[(0,t.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-4 text-muted-foreground",children:D||ek?"Starts while Thursday is running on this computer, whether or not a tab is open. A time that passed meanwhile starts once, not once for each.":`Still needs ${i=q,r=ej,(l=[i.label.trim()?null:"a name",i.bot?null:"a bot",!r?"a time":er(r)?"a time still ahead":null,i.request.trim()?null:"a job"].filter(e=>null!==e)).length>1?`${l.slice(0,-1).join(", ")} and ${l.at(-1)}`:l[0]??"nothing"}.`}),eN&&(0,t.jsx)(b.Button,{size:"sm",onClick:()=>{if(!D)return;let e={};q.label.trim()&&q.label.trim()!==D.label&&(e.label=q.label.trim()),q.request.trim()&&q.request.trim()!==D.request&&(e.request=q.request.trim()),Object.keys(e).length&&ew(e)},children:"Save"}),D?(0,t.jsxs)(b.Button,{variant:"outline",size:"sm",loading:ey,disabled:eR,title:eR?"Its last run is still open":void 0,onClick:()=>void ex(D.id),children:[(0,t.jsx)(m.Play,{}),"Run now"]}):(0,t.jsx)(b.Button,{size:"sm",loading:J,disabled:!ek,onClick:()=>ek&&void G(ek),children:"Create"})]})]})})})})]})}let eu=({children:e})=>(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e});function eh({picked:e,several:n=!1,className:a,children:s,...i}){return(0,t.jsxs)("button",{type:"button","aria-pressed":e,className:(0,I.cn)("inline-flex h-8 items-center justify-center gap-1.5 rounded-full px-3.5 text-[13px] whitespace-nowrap outline-none transition-colors focus-visible:ring-3 focus-visible:ring-ring/50",!e&&"text-foreground ring-1 ring-border ring-inset hover:bg-muted",e&&(n?"bg-brand/10 pl-2.5 font-medium text-brand ring-1 ring-brand/30 ring-inset":"bg-brand font-medium text-brand-foreground"),a),...i,children:[e&&n&&(0,t.jsx)(l.Check,{className:"size-3.5"}),s]})}function em({word:e,children:n}){return(0,t.jsxs)("div",{className:"flex items-start gap-2.5",children:[(0,t.jsx)("span",{className:"flex h-8 w-9 shrink-0 items-center text-[13px] text-muted-foreground",children:e}),(0,t.jsx)("div",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-1.5",children:n})]})}function ex(e){let t=K(`${e} 00:00`),a=(t.getTime()-K(`${ea(0)} 00:00`).getTime())/864e5;return(0,n.format)(t,a<7?"EEE d":"EEE, MMM d")}function ef({value:e,onPick:n}){let a=(0,p.useRef)(null),s=[0,1,2,3].map(e=>ea(e)),i=()=>a.current?.showPicker();return(0,t.jsxs)(t.Fragment,{children:[s.map((a,s)=>(0,t.jsx)(eh,{picked:a===e,onClick:()=>n(a),children:0===s?"Today":1===s?"Tomorrow":ex(a)},a)),!s.includes(e)&&(0,t.jsx)(eh,{picked:!0,onClick:i,children:ex(e)}),(0,t.jsxs)("span",{className:"relative",children:[(0,t.jsx)(eh,{picked:!1,"aria-label":"Another day",onClick:i,className:"w-8 px-0",children:(0,t.jsx)(r,{className:"size-3.5"})}),(0,t.jsx)("input",{ref:a,type:"date",tabIndex:-1,"aria-hidden":!0,min:s[0],value:e,onChange:e=>e.target.value&&n(e.target.value),className:"pointer-events-none absolute inset-0 opacity-0"})]})]})}function ep({value:e,onChange:n,onDone:a}){return(0,t.jsx)(k.Input,{type:"time","aria-label":"Time of day",value:e,onChange:e=>n(e.target.value),onBlur:a,onClick:e=>e.currentTarget.showPicker?.(),className:"h-8.5 w-28 px-3 text-[15px] tabular-nums md:text-[15px] [&::-webkit-calendar-picker-indicator]:hidden"})}function eg({schedule:e,kind:n}){if(!e||er(e))return(0,t.jsx)("p",{className:"text-xs text-destructive",children:e?"That time has passed. Pick a later one.":"daily"===n?"Pick a time and at least one day.":"Pick a time."});let s=function(e,t){if("once"===e.kind)return K(e.at);if("every"===e.kind)return new Date(t.getTime()+36e5*e.hours);let[n,a]=e.time.split(":").map(Number);for(let s=0;s<=7;s++){let i=new Date(t);i.setDate(i.getDate()+s),i.setHours(n,a,0,0);let r=0===i.getDay()?7:i.getDay();if(i>t&&e.days.includes(r))return i}return new Date(t.getTime()+864e5)}(e,new Date);return(0,t.jsxs)("p",{className:"flex items-start gap-2 text-[13px] leading-5",children:[(0,t.jsx)(ee.RoutineMark,{className:"mt-0.75 size-3.5 shrink-0 text-muted-foreground"}),(0,t.jsxs)("span",{className:"min-w-0",children:[Z(e),(0,t.jsxs)("span",{className:"text-muted-foreground",children:[" · ","once"===e.kind?`${(0,a.formatDistanceToNowStrict)(s,{addSuffix:!0})}, then it switches itself off`:`first start ${(0,A.whenOf)(s)}`]})]})]})}function eb({label:e,htmlFor:n,children:a}){return(0,t.jsxs)("div",{className:"flex gap-3",children:[(0,t.jsx)("label",{htmlFor:n,className:"w-14 shrink-0 pt-2 font-mono text-xs text-muted-foreground",children:e}),(0,t.jsx)("div",{className:"min-w-0 flex-1 space-y-1.5",children:a})]})}e.s(["RoutineSetting",0,function(){let[e,n]=(0,p.useState)(null),{data:a,isLoading:s,error:i}=(0,z.useServerRoute)(g.queryKey.routines),{data:r}=(0,z.useServerRoute)(g.queryKey.bot),[l]=(0,O.useServerAction)(U,{onOk:()=>(0,z.revalidate)(g.queryKey.routines)});if(s)return(0,t.jsx)(C.SettingSkeleton,{rows:3});if(i)return(0,t.jsx)(C.SettingError,{message:i.message});let o=a??[],d=o.filter(e=>e.enabled).length,c=o.find(t=>t.id===e);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(C.SettingScreen,{footer:(0,t.jsxs)(C.SettingRailNote,{children:[o.length," set up · ",d," on",o.length>=D.ROUTINE.max&&` \xb7 ${D.ROUTINE.max} is the most`]}),children:(0,t.jsx)(C.SettingItems,{addRow:o.length<D.ROUTINE.max?{label:"New routine",onClick:()=>n("new")}:void 0,children:0===o.length?(0,t.jsx)("p",{className:"p-4 text-sm leading-relaxed text-muted-foreground",children:'Nothing starts by itself yet. Tell Thursday what should — "every weekday at nine, go through my mail" — or make one here.'}):o.map(a=>(0,t.jsx)(et,{routine:a,bots:r,open:a.id===e,onOpen:()=>n(a.id),onSwitch:e=>l(a.id,{enabled:e})},a.id))})}),(0,t.jsx)(ec,{routine:"new"===e?"new":c??null,bots:r??[],onClose:()=>n(null),onMade:e=>n(e)})]})}],480869)},493801,e=>{"use strict";var t=e.i(24708),n=e.i(989366);e.s(["formatDistanceToNowStrict",0,function(e,a){return(0,n.formatDistanceStrict)(e,(0,t.constructNow)(e),a)}])},648119,e=>{"use strict";var t=e.i(456420);let n={name:"ellipsis",size:24,node:[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],aliases:["more-horizontal"]};n.node;let a=(0,t.default)(n);e.s(["MoreHorizontal",0,a],648119)},21357,e=>{"use strict";var t=e.i(456420);let n={name:"play",size:24,node:[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]};n.node;let a=(0,t.default)(n);e.s(["Play",0,a],21357)},759659,e=>{"use strict";var t=e.i(456420);let n={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"]};n.node;let a=(0,t.default)(n);e.s(["Trash2",0,a],759659)}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,213377,t=>{"use strict";t.s(["STUDIO_TOOLS",0,{generate_image:"generate_image",generate_speech:"generate_speech",transcribe:"transcribe",generate_video:"generate_video"},"TOOL_NAMES",0,{memory_recall:"memory_recall",memory_create:"memory_create",memory_remember:"memory_remember",memory_describe:"memory_describe",memory_forget:"memory_forget",bash:"bash",write_file:"write_file",tool_search:"tool_search",tool_call:"tool_call",load_skill:"load_skill",web_search:"web_search",thread_start:"thread_start",thread_tell:"thread_tell",thread_answer:"thread_answer",thread_status:"thread_status",thread_cancel:"thread_cancel",thread_show:"thread_show",thread_seen:"thread_seen",routine:"routine",routine_watch:"routine_watch",send_message:"send_message",thread_recall:"thread_recall",sign_in_use:"sign_in_use",sign_in_keep:"sign_in_keep",check_mail:"check_mail",look_at:"look_at",make_deck:"make_deck",describe_self:"describe_self",end_call:"end_call",emote:"emote"}])},540921,t=>{"use strict";var e=t.i(843476),r=t.i(867927),n=t.i(271645),o=t.i(798120),i=t.i(167881),a=t.i(917162),s=t.i(95187);let f=(0,s.createServerReference)("7f6f14c75cc3236a3c73293e95c1e15afbda4701f6",s.callServer,void 0,s.findSourceMapURL,"undoLessonAction");var u=t.i(635963),h=t.i(245629),l=t.i(609856),c=t.i(283653),p=t.i(647163);function d(t){return"memory"===t.kind?"added"===t.change?"kept a note":"removed"===t.change?"dropped a note":"updated a note":"added"===t.change?`wrote the skill ${t.name}`:"removed"===t.change?`removed its skill ${t.name}`:`changed its skill ${t.name}`}function y({lesson:t,face:s}){let[g,m]=(0,n.useState)(!1),[b,v]=(0,l.useServerAction)(f,{okMessage:({said:t})=>t,onOk:()=>(0,c.revalidate)(o.queryKey.lessons({bot:t.bot}).url)}),w=async()=>{let e,r;await a.notify.confirm((e=`the skill ${t.name}`,r="memory"===t.kind?`${t.bot}'s note`:e,{title:"memory"===t.kind?"added"===t.change?"Forget this note?":"removed"===t.change?"Bring this note back?":"Put this note back?":"added"===t.change?`Delete ${e}?`:"removed"===t.change?`Bring ${e} back?`:`Put ${e} back?`,description:"added"===t.change?`${t.bot} wrote it in this job. It is deleted, and the next job goes without it.`:"removed"===t.change?`${r.charAt(0).toUpperCase()}${r.slice(1)} comes back as it was before this job.`:`${r.charAt(0).toUpperCase()}${r.slice(1)} goes back to how it was before this job.`,okText:"added"===t.change?"Delete":"Put back",destructive:"added"===t.change}))&&b(t.id)};return(0,e.jsxs)("div",{className:"border-t border-border/60 first-of-type:border-t-0",children:[(0,e.jsxs)("div",{className:"flex items-start gap-2 py-1.5",children:[(0,e.jsxs)("button",{type:"button",onClick:()=>m(t=>!t),"aria-expanded":g,className:"flex min-w-0 flex-1 flex-col gap-0.5 rounded-lg px-1 text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,e.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5 text-[12px] text-muted-foreground",children:[s&&(0,e.jsx)(u.BotMark,{size:14,seed:s.name,color:s.icon?.color,shape:s.icon?.shape,outline:s.icon?.outline,paint:s.icon?.paint,notify:!1,className:"shrink-0"}),(0,e.jsxs)("span",{className:"truncate",children:[s?`${t.bot} ${d(t)}`:d(t),!s&&t.threadLabel&&` \xb7 ${t.threadLabel}`]}),(0,e.jsxs)("span",{className:"shrink-0 font-mono text-[10px] tabular-nums",children:[t.added>0&&`+${t.added}`,t.added>0&&t.removed>0&&" ",t.removed>0&&`−${t.removed}`]}),!s&&(0,e.jsx)("span",{className:"shrink-0 font-mono text-[10px]",children:(0,h.shortAgo)(t.at)})]}),(0,e.jsxs)("span",{className:(0,p.cn)("flex min-w-0 items-center gap-1 text-[13px]",t.undoneAt&&"text-muted-foreground line-through"),children:[(0,e.jsx)(r.ChevronRight,{className:(0,p.cn)("size-3 shrink-0 text-muted-foreground transition-transform",g&&"rotate-90")}),(0,e.jsx)("span",{className:"truncate",children:t.line})]})]}),t.undoneAt?(0,e.jsx)("span",{className:"shrink-0 pt-1 font-mono text-[10px] text-muted-foreground",children:"put back"}):(0,e.jsx)(i.Button,{type:"button",size:"sm",variant:"ghost",loading:v,onClick:w,className:"h-7 shrink-0 rounded-full px-2.5 text-[12px]",children:"Undo"})]}),g&&(0,e.jsx)("pre",{className:"mb-2 ml-5 max-h-48 overflow-y-auto rounded-lg bg-muted/50 p-2 font-mono text-[11px] leading-relaxed whitespace-pre-wrap break-words",children:t.text||"(empty)"})]})}t.s(["BotLessons",0,function({bot:t}){let{data:r}=(0,c.useServerRoute)(o.queryKey.lessons({bot:t}));return r?.length?(0,e.jsxs)("div",{className:"pt-1",children:[(0,e.jsx)("div",{className:"flex h-6 items-center",children:(0,e.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:"Learned"})}),r.map(t=>(0,e.jsx)(y,{lesson:t},t.id))]}):null},"JobLessons",0,function({threadId:t,faces:r}){let{data:n}=(0,c.useServerRoute)(o.queryKey.lessons({thread:t}));return n?.length?(0,e.jsxs)("div",{className:"pt-2",children:[(0,e.jsx)("p",{className:"px-1 pb-1 font-mono text-[10px] text-muted-foreground",children:"Kept for next time"}),n.map(t=>(0,e.jsx)(y,{lesson:t,face:r.find(e=>e.name===t.bot)??{name:t.bot}},t.id))]}):null}],540921)},567334,877267,t=>{"use strict";let e,r=[[" "],[" ",".","`"],[".",",","·","'"],[":",";","-","^"],["=","+","~",'"'],["*","?","◦","j"],["c","v","○","7"],["o","x","◇","い"],["s","y","t","あ"],["e","a","u","な"],["k","w","z","や"],["q","h","n","米"]],n=r.length;function o(t,e){return a(.05,.42,t/e)}let i={A:[".##.","#..#","####","#..#","#..#"],B:["###.","#..#","###.","#..#","###."],C:[".###","#...","#...","#...",".###"],D:["###.","#..#","#..#","#..#","###."],E:["####","#...","###.","#...","####"],F:["####","#...","###.","#...","#..."],G:[".###","#...","#.##","#..#",".###"],H:["#..#","#..#","####","#..#","#..#"],I:["###",".#.",".#.",".#.","###"],J:["..##","...#","...#","#..#",".##."],K:["#..#","#.#.","##..","#.#.","#..#"],L:["#...","#...","#...","#...","####"],M:["#...#","##.##","#.#.#","#...#","#...#"],N:["#..#","##.#","#.##","#..#","#..#"],O:[".##.","#..#","#..#","#..#",".##."],P:["###.","#..#","###.","#...","#..."],Q:[".##.","#..#","#..#","#.#.",".#.#"],R:["###.","#..#","###.","#.#.","#..#"],S:[".###","#...",".##.","...#","###."],T:["###",".#.",".#.",".#.",".#."],U:["#..#","#..#","#..#","#..#",".##."],V:["#...#","#...#",".#.#.",".#.#.","..#.."],W:["#...#","#...#","#.#.#","##.##","#...#"],X:["#..#","#..#",".##.","#..#","#..#"],Y:["#.#","#.#",".#.",".#.",".#."],Z:["####","...#",".##.","#...","####"],0:[".##.","#.##","#..#","##.#",".##."],1:[".#.","##.",".#.",".#.","###"],2:["###.","...#",".##.","#...","####"],3:["###.","...#",".##.","...#","###."],4:["#..#","#..#","####","...#","...#"],5:["####","#...","###.","...#","###."],6:[".##.","#...","###.","#..#",".##."],7:["####","...#","..#.",".#..",".#.."],8:[".##.","#..#",".##.","#..#",".##."],9:[".##.","#..#",".###","...#",".##."],"!":["#","#","#",".","#"],"?":["###.","...#",".##.","....",".#.."],".":[".",".",".",".","#"],",":["..","..","..",".#","#."],"'":["#","#",".",".","."],"-":["...","...","###","...","..."],"+":["...",".#.","###",".#.","..."],":":[".","#",".","#","."],"(":[".#","#.","#.","#.",".#"],")":["#.",".#",".#",".#","#."],"<":["..#",".#.","#..",".#.","..#"],">":["#..",".#.","..#",".#.","#.."],"^":[".#.","#.#","...","...","..."],"~":["....",".#.#","#.#.","....","...."],"♥":[".#.#.","#####","#####",".###.","..#.."]," ":["..","..","..","..",".."]};function a(t,e,r){let n=Math.min(1,Math.max(0,(r-t)/(e-t)));return n*n*(3-2*n)}Object.keys(i).filter(t=>!/^[A-Z0-9 ]$/.test(t)),t.s(["ALPHA_TOP",0,.82,"CHAR_RATE",0,2.2,"EMOJI_CHAR_RATE",0,.6,"EMOJI_POOL",0,["🍎","🌹","🍓","❤️","🎈","🧨","🔴","🍊","🔥","🦊","🏀","🧡","🍑","⭐","🍋","🌻","💛","🐥","🌟","🍌","🍀","🌿","🐸","🥝","💚","🌵","🥑","💧","🌊","🫐","🐳","💙","🔵","🧊","🍇","💜","🔮","🟣","🪻","🍆","🌸","🌷","💗","🦩","🩷","🍫","🐻","🌰","🥐","🤍","☁️","🖤","⚪","⚫","🦢","🌈","🦜","🎨","🪩","🦄","✨","🍬","🎡"],"FACE_WORD_MAX",0,8,"LETTERS",0,i,"LEVELS",0,n,"ORB_INK",0,{dark:[247,247,247],light:[10,10,10]},"RAMP",0,r,"emojiAlpha",0,function(t,e){return .06+.94*o(t,e)},"emojiPx",0,function(t,e,r){return t*(.5+.5*o(e,r))},"emojiWeight",0,o,"hash",0,function(t,e){let r=43758.5453*Math.sin(127.1*t+311.7*e);return r-Math.floor(r)},"smoothstep",0,a,"undrawable",0,function(t){return Array.from(t.toUpperCase()).find(t=>!(t in i))??null}],567334);var s=t.i(271645);function f(){if(e)return e;let t=navigator,r=t.userAgentData?.platform||t.platform||"";return e=/mac|iphone|ipad|ipod/i.test(r)?"emoji":"letters"}let u=()=>()=>{};t.s(["faceGlyphs",0,f,"useFaceGlyphs",0,function(){return(0,s.useSyncExternalStore)(u,f,()=>"emoji")}],877267)},183414,t=>{"use strict";var e=t.i(41533);let r=Math.PI/180,n=t=>((t+180)%360+360)%360-180,o=null;function i(t,e,r){let n=!1;for(let o=0,i=r.length-2;o<r.length;i=o,o+=2){let a=r[o],s=r[o+1],f=r[i],u=r[i+1];s>e!=u>e&&t<(f-a)*(e-s)/(u-s)+a&&(n=!n)}return n}function a(t,e,r){for(let n of[r,r+360,r-360]){let[r,o,a,s]=t.bbox;if(!(n<r)&&!(n>o)&&!(e<a)&&!(e>s))for(let r=0;r<t.polys.length;r++){let{rings:o,bbox:a}=t.polys[r];if(!(n<a[0])&&!(n>a[1])&&!(e<a[2])&&!(e>a[3])&&i(n,e,o[0])&&!o.slice(1).some(t=>i(n,e,t)))return r}}return -1}t.s(["fitView",0,function(t,o,i,s,f){let u,h=function(t,o,i,s){let f=s?t.countries.findIndex(t=>t.code===s):-1;if(f>=0&&t.countries[f].polys.length){let e,s,u=t.countries[f],h=a(u,o,i);return{country:f,poly:h>=0?h:(e=0,s=1/0,u.polys.forEach(({bbox:t},a)=>{let f=Math.max(0,Math.abs(n(i-(t[0]+t[1])/2))-(t[1]-t[0])/2),u=Math.max(0,t[2]-o,o-t[3]),h=Math.hypot(f*Math.cos(o*r),u);h<s&&(s=h,e=a)}),e)}}let u=(e,r)=>{for(let n=0;n<t.countries.length;n++){let o=a(t.countries[n],e,r);if(o>=0)return{country:n,poly:o}}return null},h=u(o,i),l=Math.round(10*e.HERE.coastDeg);for(let t=1;!h&&t<=l;t++){let e=t/10;for(let t=0;t<8&&!h;t++)h=u(o+e*Math.sin(t*Math.PI/4),i+e*Math.cos(t*Math.PI/4))}return h}(t,o,i,f),{width:l,height:c}=s,p=o,d=i;if(h){let e=t.countries[h.country].polys,a=t=>{let e=0;for(let r=0,n=t.length-2;r<t.length;n=r,r+=2)e+=t[n]*t[r+1]-t[r]*t[n+1];return Math.abs(e/2)*Math.cos(t[1]*r)},s=h.poly,f=0;e.forEach((t,e)=>{let r=a(t.rings[0]);r>f&&(f=r,s=e)});let y=h.poly;if(s!==h.poly&&a(e[h.poly].rings[0])<.25*f){let t=e[s].bbox;4>Math.hypot(Math.max(0,t[0]-i,i-t[1])*Math.cos(o*r),Math.max(0,t[2]-o,o-t[3]))&&(y=s)}let g=[...e[y].bbox],m=[y];for(let t=0;t<3;t++)e.forEach((t,e)=>{let r=t.bbox;m.includes(e)||Math.max(0,r[0]-g[1],g[0]-r[1])>=2.5||Math.max(0,r[2]-g[3],g[2]-r[3])>=2.5||(m.push(e),g[0]=Math.min(g[0],r[0]),g[1]=Math.max(g[1],r[1]),g[2]=Math.min(g[2],r[2]),g[3]=Math.max(g[3],r[3]))});p=(g[2]+g[3])/2,d=n((g[0]+g[1])/2);let b=Math.cos(p*r),v=Math.abs(o-p),w=Math.abs(n(i-d))*b;for(let t of m){let r=e[t].rings[0];for(let t=0;t<r.length;t+=2)w=Math.max(w,Math.abs(n(r[t]-d))*b),v=Math.max(v,Math.abs(r[t+1]-p))}u=Math.min(.32*c/Math.sin(Math.min(70,Math.max(1,1.15*v))*r),.44*l/Math.sin(Math.min(80,Math.max(1,1.15*w))*r))}else u=c/2/Math.sin(8*r);return u=Math.max(s.least,Math.min(.32*c/Math.sin(r),u)),h&&(p=Math.min(89,p+.08*c/u/r)),{lat:o,lon:i,latc:p,lonc:d,radius:u,home:h?h.country:-1}},"loadWorld",0,function(){return o??=fetch("/here/world.json").then(async t=>{if(!t.ok)throw Error(`/here/world.json answered ${t.status}`);return function(t){if(t?.v!==2||!Array.isArray(t.a)||!Array.isArray(t.c))throw Error("world.json is not a map this app packs");let e=t.q,r=t.a.map(t=>{let r=new Float32Array(t.length),n=0,o=0;for(let i=0;i<t.length;i+=2)n+=t[i],o+=t[i+1],r[i]=n/e-180,r[i+1]=o/e-90;return r}),n=t=>{let e=[],n=null;for(let o of t){let t=r[o>=0?o:~o],i=t.length/2;for(let r=+!!e.length;r<i;r++){let a=o>=0?r:i-1-r,s=t[2*a];if(null!==n){for(;s-n>180;)s-=360;for(;s-n<-180;)s+=360}e.push(s,t[2*a+1]),n=s}}if(e.length>=4&&Math.abs(e[e.length-2]-e[0])>359){let t=0;for(let r=1;r<e.length;r+=2)t+=e[r];let r=t<0?-90:90;e.push(e[e.length-2],r,e[0],r)}return new Float32Array(e)},o=()=>[180,-180,90,-90],i=(t,e)=>{for(let r=0;r<e.length;r+=2)t[0]=Math.min(t[0],e[r]),t[1]=Math.max(t[1],e[r]),t[2]=Math.min(t[2],e[r+1]),t[3]=Math.max(t[3],e[r+1])};return{countries:t.c.map(({n:t,k:e,p:r})=>{let a=o();return{name:t,code:e??null,polys:r.map(t=>t.map(n).filter(t=>(t=>{let e=0;for(let r=0,n=t.length-2;r<t.length;n=r,r+=2)e+=t[n]*t[r+1]-t[r]*t[n+1];return Math.abs(e/2)})(t)>0)).filter(t=>t.length>0).map(t=>{let e=o();return i(e,t[0]),i(a,t[0]),{rings:t,bbox:e}}),bbox:a}})}}(await t.json())}).catch(t=>{throw o=null,t})},"project",0,function(t,e,n,o,i){let a=t*r,s=n*r,f=(e-o)*r;return{x:i*Math.cos(a)*Math.sin(f),y:-i*(Math.cos(s)*Math.sin(a)-Math.sin(s)*Math.cos(a)*Math.cos(f)),seen:Math.sin(s)*Math.sin(a)+Math.cos(s)*Math.cos(a)*Math.cos(f)>0}},"releaseWorld",0,function(){o=null},"wrap",0,n])},989366,t=>{"use strict";var e=t.i(55545),r=t.i(455024),n=t.i(99151),o=t.i(845110),i=t.i(281092),a=t.i(234662);t.s(["formatDistanceStrict",0,function(t,s,f){var u;let h,l,c=(0,r.getDefaultOptions)(),p=f?.locale??c.locale??e.defaultLocale,d=(l=(0,i.toDate)(t)-(0,i.toDate)(s))<0?-1:l>0?1:l;if(isNaN(d))throw RangeError("Invalid time value");let y=Object.assign({},f,{addSuffix:f?.addSuffix,comparison:d}),[g,m]=(0,o.normalizeDates)(f?.in,...d>0?[s,t]:[t,s]),b=(u=f?.roundingMethod??"round",t=>{let e=(u?Math[u]:Math.trunc)(t);return 0===e?0:e}),v=m.getTime()-g.getTime(),w=v/a.millisecondsInMinute,x=(v-((0,n.getTimezoneOffsetInMilliseconds)(m)-(0,n.getTimezoneOffsetInMilliseconds)(g)))/a.millisecondsInMinute,M=f?.unit;if("second"===(h=M||(w<1?"second":w<60?"minute":w<a.minutesInDay?"hour":x<a.minutesInMonth?"day":x<a.minutesInYear?"month":"year"))){let t=b(v/1e3);return p.formatDistance("xSeconds",t,y)}if("minute"===h){let t=b(w);return p.formatDistance("xMinutes",t,y)}if("hour"===h){let t=b(w/60);return p.formatDistance("xHours",t,y)}if("day"===h){let t=b(x/a.minutesInDay);return p.formatDistance("xDays",t,y)}if("month"===h){let t=b(x/a.minutesInMonth);return 12===t&&"month"!==M?p.formatDistance("xYears",1,y):p.formatDistance("xMonths",t,y)}else{let t=b(x/a.minutesInYear);return p.formatDistance("xYears",t,y)}}],989366)},569644,t=>{"use strict";var e=t.i(456420);let r={name:"folder-open",size:24,node:[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]};r.node;let n=(0,e.default)(r);t.s(["FolderOpen",0,n],569644)},97923,t=>{"use strict";var e=t.i(456420);let r={name:"log-in",size:24,node:[["path",{d:"m10 17 5-5-5-5",key:"1bsop3"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}]]};r.node;let n=(0,e.default)(r);t.s(["LogIn",0,n],97923)},747925,t=>{"use strict";var e=t.i(456420);let r={name:"wrench",size:24,node:[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]]};r.node;let n=(0,e.default)(r);t.s(["Wrench",0,n],747925)},467034,(t,e,r)=>{var n={872:function(t,e){"use strict";e.byteLength=function(t){var e=f(t),r=e[0],n=e[1];return(r+n)*3/4-n},e.toByteArray=function(t){var e,r,i=f(t),a=i[0],s=i[1],u=new o((a+s)*3/4-s),h=0,l=s>0?a-4:a;for(r=0;r<l;r+=4)e=n[t.charCodeAt(r)]<<18|n[t.charCodeAt(r+1)]<<12|n[t.charCodeAt(r+2)]<<6|n[t.charCodeAt(r+3)],u[h++]=e>>16&255,u[h++]=e>>8&255,u[h++]=255&e;return 2===s&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,u[h++]=255&e),1===s&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,u[h++]=e>>8&255,u[h++]=255&e),u},e.fromByteArray=function(t){for(var e,n=t.length,o=n%3,i=[],a=0,s=n-o;a<s;a+=16383)i.push(function(t,e,n){for(var o,i=[],a=e;a<n;a+=3)o=(t[a]<<16&0xff0000)+(t[a+1]<<8&65280)+(255&t[a+2]),i.push(r[o>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return i.join("")}(t,a,a+16383>s?s:a+16383));return 1===o?i.push(r[(e=t[n-1])>>2]+r[e<<4&63]+"=="):2===o&&i.push(r[(e=(t[n-2]<<8)+t[n-1])>>10]+r[e>>4&63]+r[e<<2&63]+"="),i.join("")};for(var r=[],n=[],o="u">typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,s=i.length;a<s;++a)r[a]=i[a],n[i.charCodeAt(a)]=a;function f(t){var e=t.length;if(e%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");-1===r&&(r=e);var n=r===e?0:4-r%4;return[r,n]}n[45]=62,n[95]=63},230:function(t,e,r){"use strict";var n=r(872),o=r(321),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function a(t){if(t>0x7fffffff)throw RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,s.prototype),e}function s(t,e,r){if("number"==typeof t){if("string"==typeof e)throw TypeError('The "string" argument must be of type string. Received type number');return h(t)}return f(t,e,r)}function f(t,e,r){if("string"==typeof t){var n=t,o=e;if(("string"!=typeof o||""===o)&&(o="utf8"),!s.isEncoding(o))throw TypeError("Unknown encoding: "+o);var i=0|p(n,o),f=a(i),u=f.write(n,o);return u!==i&&(f=f.slice(0,u)),f}if(ArrayBuffer.isView(t))return l(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(T(t,ArrayBuffer)||t&&T(t.buffer,ArrayBuffer)||"u">typeof SharedArrayBuffer&&(T(t,SharedArrayBuffer)||t&&T(t.buffer,SharedArrayBuffer)))return function(t,e,r){var n;if(e<0||t.byteLength<e)throw RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),s.prototype),n}(t,e,r);if("number"==typeof t)throw TypeError('The "value" argument must not be of type number. Received type number');var h=t.valueOf&&t.valueOf();if(null!=h&&h!==t)return s.from(h,e,r);var d=function(t){if(s.isBuffer(t)){var e=0|c(t.length),r=a(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||function(t){return t!=t}(t.length)?a(0):l(t):"Buffer"===t.type&&Array.isArray(t.data)?l(t.data):void 0}(t);if(d)return d;if("u">typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return s.from(t[Symbol.toPrimitive]("string"),e,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function u(t){if("number"!=typeof t)throw TypeError('"size" argument must be of type number');if(t<0)throw RangeError('The value "'+t+'" is invalid for option "size"')}function h(t){return u(t),a(t<0?0:0|c(t))}function l(t){for(var e=t.length<0?0:0|c(t.length),r=a(e),n=0;n<e;n+=1)r[n]=255&t[n];return r}e.Buffer=s,e.SlowBuffer=function(t){return+t!=t&&(t=0),s.alloc(+t)},e.INSPECT_MAX_BYTES=50,e.kMaxLength=0x7fffffff,s.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),!s.TYPED_ARRAY_SUPPORT&&"u">typeof console&&"function"==typeof console.error&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}}),s.poolSize=8192,s.from=function(t,e,r){return f(t,e,r)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array),s.alloc=function(t,e,r){return(u(t),t<=0)?a(t):void 0!==e?"string"==typeof r?a(t).fill(e,r):a(t).fill(e):a(t)},s.allocUnsafe=function(t){return h(t)},s.allocUnsafeSlow=function(t){return h(t)};function c(t){if(t>=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|t}function p(t,e){if(s.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||T(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var o=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return _(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return k(t).length;default:if(o)return n?-1:_(t).length;e=(""+e).toLowerCase(),o=!0}}function d(t,e,r){var o,i,a,s=!1;if((void 0===e||e<0)&&(e=0),e>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(e>>>=0)))return"";for(t||(t="utf8");;)switch(t){case"hex":return function(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=e;i<r;++i)o+=O[t[i]];return o}(this,e,r);case"utf8":case"utf-8":return b(this,e,r);case"ascii":return function(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(127&t[o]);return n}(this,e,r);case"latin1":case"binary":return function(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}(this,e,r);case"base64":return o=this,i=e,a=r,0===i&&a===o.length?n.fromByteArray(o):n.fromByteArray(o.slice(i,a));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(t,e,r){for(var n=t.slice(e,r),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}(this,e,r);default:if(s)throw TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),s=!0}}function y(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function g(t,e,r,n,o){var i;if(0===t.length)return -1;if("string"==typeof r?(n=r,r=0):r>0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),(i=r*=1)!=i&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length)if(o)return -1;else r=t.length-1;else if(r<0)if(!o)return -1;else r=0;if("string"==typeof e&&(e=s.from(e,n)),s.isBuffer(e))return 0===e.length?-1:m(t,e,r,n,o);if("number"==typeof e){if(e&=255,"function"==typeof Uint8Array.prototype.indexOf)if(o)return Uint8Array.prototype.indexOf.call(t,e,r);else return Uint8Array.prototype.lastIndexOf.call(t,e,r);return m(t,[e],r,n,o)}throw TypeError("val must be string, number or Buffer")}function m(t,e,r,n,o){var i,a=1,s=t.length,f=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return -1;a=2,s/=2,f/=2,r/=2}function u(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(o){var h=-1;for(i=r;i<s;i++)if(u(t,i)===u(e,-1===h?0:i-h)){if(-1===h&&(h=i),i-h+1===f)return h*a}else -1!==h&&(i-=i-h),h=-1}else for(r+f>s&&(r=s-f),i=r;i>=0;i--){for(var l=!0,c=0;c<f;c++)if(u(t,i+c)!==u(e,c)){l=!1;break}if(l)return i}return -1}s.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==s.prototype},s.compare=function(t,e){if(T(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),T(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(t)||!s.isBuffer(e))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var r=t.length,n=e.length,o=0,i=Math.min(r,n);o<i;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:+(n<r)},s.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(t,e){if(!Array.isArray(t))throw TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return s.alloc(0);if(void 0===e)for(r=0,e=0;r<t.length;++r)e+=t[r].length;var r,n=s.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){var i=t[r];if(T(i,Uint8Array)&&(i=s.from(i)),!s.isBuffer(i))throw TypeError('"list" argument must be an Array of Buffers');i.copy(n,o),o+=i.length}return n},s.byteLength=p,s.prototype._isBuffer=!0,s.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)y(this,e,e+1);return this},s.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)y(this,e,e+3),y(this,e+1,e+2);return this},s.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)y(this,e,e+7),y(this,e+1,e+6),y(this,e+2,e+5),y(this,e+3,e+4);return this},s.prototype.toString=function(){var t=this.length;return 0===t?"":0==arguments.length?b(this,0,t):d.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(t){if(!s.isBuffer(t))throw TypeError("Argument must be a Buffer");return this===t||0===s.compare(this,t)},s.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},i&&(s.prototype[i]=s.prototype.inspect),s.prototype.compare=function(t,e,r,n,o){if(T(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(t))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return -1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,o>>>=0,this===t)return 0;for(var i=o-n,a=r-e,f=Math.min(i,a),u=this.slice(n,o),h=t.slice(e,r),l=0;l<f;++l)if(u[l]!==h[l]){i=u[l],a=h[l];break}return i<a?-1:+(a<i)},s.prototype.includes=function(t,e,r){return -1!==this.indexOf(t,e,r)},s.prototype.indexOf=function(t,e,r){return g(this,t,e,r,!0)},s.prototype.lastIndexOf=function(t,e,r){return g(this,t,e,r,!1)};function b(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var i,a,s,f,u=t[o],h=null,l=u>239?4:u>223?3:u>191?2:1;if(o+l<=r)switch(l){case 1:u<128&&(h=u);break;case 2:(192&(i=t[o+1]))==128&&(f=(31&u)<<6|63&i)>127&&(h=f);break;case 3:i=t[o+1],a=t[o+2],(192&i)==128&&(192&a)==128&&(f=(15&u)<<12|(63&i)<<6|63&a)>2047&&(f<55296||f>57343)&&(h=f);break;case 4:i=t[o+1],a=t[o+2],s=t[o+3],(192&i)==128&&(192&a)==128&&(192&s)==128&&(f=(15&u)<<18|(63&i)<<12|(63&a)<<6|63&s)>65535&&f<1114112&&(h=f)}null===h?(h=65533,l=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),o+=l}var c=n,p=c.length;if(p<=4096)return String.fromCharCode.apply(String,c);for(var d="",y=0;y<p;)d+=String.fromCharCode.apply(String,c.slice(y,y+=4096));return d}function v(t,e,r){if(t%1!=0||t<0)throw RangeError("offset is not uint");if(t+e>r)throw RangeError("Trying to access beyond buffer length")}function w(t,e,r,n,o,i){if(!s.isBuffer(t))throw TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<i)throw RangeError('"value" argument is out of bounds');if(r+n>t.length)throw RangeError("Index out of range")}function x(t,e,r,n,o,i){if(r+n>t.length||r<0)throw RangeError("Index out of range")}function M(t,e,r,n,i){return e*=1,r>>>=0,i||x(t,e,r,4,34028234663852886e22,-34028234663852886e22),o.write(t,e,r,n,23,4),r+4}function A(t,e,r,n,i){return e*=1,r>>>=0,i||x(t,e,r,8,17976931348623157e292,-17976931348623157e292),o.write(t,e,r,n,52,8),r+8}s.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else if(isFinite(e))e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o,i,a,s,f,u,h,l,c=this.length-e;if((void 0===r||r>c)&&(r=c),t.length>0&&(r<0||e<0)||e>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var p=!1;;)switch(n){case"hex":return function(t,e,r,n){r=Number(r)||0;var o=t.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i=e.length;n>i/2&&(n=i/2);for(var a=0;a<n;++a){var s,f=parseInt(e.substr(2*a,2),16);if((s=f)!=s)break;t[r+a]=f}return a}(this,t,e,r);case"utf8":case"utf-8":return o=e,i=r,I(_(t,this.length-o),this,o,i);case"ascii":return a=e,s=r,I(B(t),this,a,s);case"latin1":case"binary":return function(t,e,r,n){return I(B(e),t,r,n)}(this,t,e,r);case"base64":return f=e,u=r,I(k(t),this,f,u);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return h=e,l=r,I(function(t,e){for(var r,n,o=[],i=0;i<t.length&&!((e-=2)<0);++i)n=(r=t.charCodeAt(i))>>8,o.push(r%256),o.push(n);return o}(t,this.length-h),this,h,l);default:if(p)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),p=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},s.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);var n=this.subarray(t,e);return Object.setPrototypeOf(n,s.prototype),n},s.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||v(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n},s.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||v(t,e,this.length);for(var n=this[t+--e],o=1;e>0&&(o*=256);)n+=this[t+--e]*o;return n},s.prototype.readUInt8=function(t,e){return t>>>=0,e||v(t,1,this.length),this[t]},s.prototype.readUInt16LE=function(t,e){return t>>>=0,e||v(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUInt16BE=function(t,e){return t>>>=0,e||v(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUInt32LE=function(t,e){return t>>>=0,e||v(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+0x1000000*this[t+3]},s.prototype.readUInt32BE=function(t,e){return t>>>=0,e||v(t,4,this.length),0x1000000*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||v(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*e)),n},s.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||v(t,e,this.length);for(var n=e,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},s.prototype.readInt8=function(t,e){return(t>>>=0,e||v(t,1,this.length),128&this[t])?-((255-this[t]+1)*1):this[t]},s.prototype.readInt16LE=function(t,e){t>>>=0,e||v(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?0xffff0000|r:r},s.prototype.readInt16BE=function(t,e){t>>>=0,e||v(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?0xffff0000|r:r},s.prototype.readInt32LE=function(t,e){return t>>>=0,e||v(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return t>>>=0,e||v(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readFloatLE=function(t,e){return t>>>=0,e||v(t,4,this.length),o.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return t>>>=0,e||v(t,4,this.length),o.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return t>>>=0,e||v(t,8,this.length),o.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return t>>>=0,e||v(t,8,this.length),o.read(this,t,!1,52,8)},s.prototype.writeUIntLE=function(t,e,r,n){if(t*=1,e>>>=0,r>>>=0,!n){var o=Math.pow(2,8*r)-1;w(this,t,e,r,o,0)}var i=1,a=0;for(this[e]=255&t;++a<r&&(i*=256);)this[e+a]=t/i&255;return e+r},s.prototype.writeUIntBE=function(t,e,r,n){if(t*=1,e>>>=0,r>>>=0,!n){var o=Math.pow(2,8*r)-1;w(this,t,e,r,o,0)}var i=r-1,a=1;for(this[e+i]=255&t;--i>=0&&(a*=256);)this[e+i]=t/a&255;return e+r},s.prototype.writeUInt8=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,1,255,0),this[e]=255&t,e+1},s.prototype.writeUInt16LE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeUInt16BE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeUInt32LE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,4,0xffffffff,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},s.prototype.writeUInt32BE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,4,0xffffffff,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeIntLE=function(t,e,r,n){if(t*=1,e>>>=0,!n){var o=Math.pow(2,8*r-1);w(this,t,e,r,o-1,-o)}var i=0,a=1,s=0;for(this[e]=255&t;++i<r&&(a*=256);)t<0&&0===s&&0!==this[e+i-1]&&(s=1),this[e+i]=(t/a|0)-s&255;return e+r},s.prototype.writeIntBE=function(t,e,r,n){if(t*=1,e>>>=0,!n){var o=Math.pow(2,8*r-1);w(this,t,e,r,o-1,-o)}var i=r-1,a=1,s=0;for(this[e+i]=255&t;--i>=0&&(a*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/a|0)-s&255;return e+r},s.prototype.writeInt8=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeInt16BE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeInt32LE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,4,0x7fffffff,-0x80000000),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},s.prototype.writeInt32BE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,4,0x7fffffff,-0x80000000),t<0&&(t=0xffffffff+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeFloatLE=function(t,e,r){return M(this,t,e,!0,r)},s.prototype.writeFloatBE=function(t,e,r){return M(this,t,e,!1,r)},s.prototype.writeDoubleLE=function(t,e,r){return A(this,t,e,!0,r)},s.prototype.writeDoubleBE=function(t,e,r){return A(this,t,e,!1,r)},s.prototype.copy=function(t,e,r,n){if(!s.isBuffer(t))throw TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r||0===t.length||0===this.length)return 0;if(e<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var o=n-r;if(this===t&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(e,r,n);else if(this===t&&r<e&&e<n)for(var i=o-1;i>=0;--i)t[i+e]=this[i+r];else Uint8Array.prototype.set.call(t,this.subarray(r,n),e);return o},s.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw TypeError("encoding must be a string");if("string"==typeof n&&!s.isEncoding(n))throw TypeError("Unknown encoding: "+n);if(1===t.length){var o,i=t.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(t=i)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw RangeError("Out of range index");if(r<=e)return this;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o<r;++o)this[o]=t;else{var a=s.isBuffer(t)?t:s.from(t,n),f=a.length;if(0===f)throw TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<r-e;++o)this[o+e]=a[o%f]}return this};var E=/[^+/0-9A-Za-z-_]/g;function _(t,e){e=e||1/0;for(var r,n=t.length,o=null,i=[],a=0;a<n;++a){if((r=t.charCodeAt(a))>55295&&r<57344){if(!o){if(r>56319||a+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=(o-55296<<10|r-56320)+65536}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return i}function B(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}function k(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(E,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function I(t,e,r,n){for(var o=0;o<n&&!(o+r>=e.length)&&!(o>=t.length);++o)e[o+r]=t[o];return o}function T(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}var O=function(){for(var t="0123456789abcdef",e=Array(256),r=0;r<16;++r)for(var n=16*r,o=0;o<16;++o)e[n+o]=t[r]+t[o];return e}()},321:function(t,e){e.read=function(t,e,r,n,o){var i,a,s=8*o-n-1,f=(1<<s)-1,u=f>>1,h=-7,l=r?o-1:0,c=r?-1:1,p=t[e+l];for(l+=c,i=p&(1<<-h)-1,p>>=-h,h+=s;h>0;i=256*i+t[e+l],l+=c,h-=8);for(a=i&(1<<-h)-1,i>>=-h,h+=n;h>0;a=256*a+t[e+l],l+=c,h-=8);if(0===i)i=1-u;else{if(i===f)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,n),i-=u}return(p?-1:1)*a*Math.pow(2,i-n)},e.write=function(t,e,r,n,o,i){var a,s,f,u=8*i-o-1,h=(1<<u)-1,l=h>>1,c=5960464477539062e-23*(23===o),p=n?0:i-1,d=n?1:-1,y=+(e<0||0===e&&1/e<0);for(isNaN(e=Math.abs(e))||e===1/0?(s=+!!isNaN(e),a=h):(a=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-a))<1&&(a--,f*=2),a+l>=1?e+=c/f:e+=c*Math.pow(2,1-l),e*f>=2&&(a++,f/=2),a+l>=h?(s=0,a=h):a+l>=1?(s=(e*f-1)*Math.pow(2,o),a+=l):(s=e*Math.pow(2,l-1)*Math.pow(2,o),a=0));o>=8;t[r+p]=255&s,p+=d,s/=256,o-=8);for(a=a<<o|s,u+=o;u>0;t[r+p]=255&a,p+=d,a/=256,u-=8);t[r+p-d]|=128*y}}},o={};function i(t){var e=o[t];if(void 0!==e)return e.exports;var r=o[t]={exports:{}},a=!0;try{n[t](r,r.exports,i),a=!1}finally{a&&delete o[t]}return r.exports}i.ab="/ROOT/node_modules/next/dist/compiled/buffer/",e.exports=i(230)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,213377,t=>{"use strict";t.s(["STUDIO_TOOLS",0,{generate_image:"generate_image",generate_speech:"generate_speech",transcribe:"transcribe",generate_video:"generate_video"},"TOOL_NAMES",0,{memory_recall:"memory_recall",memory_create:"memory_create",memory_remember:"memory_remember",memory_describe:"memory_describe",memory_forget:"memory_forget",bash:"bash",write_file:"write_file",tool_search:"tool_search",tool_call:"tool_call",load_skill:"load_skill",web_search:"web_search",thread_start:"thread_start",thread_tell:"thread_tell",thread_answer:"thread_answer",thread_status:"thread_status",thread_cancel:"thread_cancel",thread_show:"thread_show",thread_seen:"thread_seen",routine:"routine",routine_watch:"routine_watch",send_message:"send_message",thread_recall:"thread_recall",sign_in_use:"sign_in_use",sign_in_keep:"sign_in_keep",check_mail:"check_mail",look_at:"look_at",make_deck:"make_deck",describe_self:"describe_self",end_call:"end_call",emote:"emote"}])},540921,t=>{"use strict";var e=t.i(843476),r=t.i(867927),n=t.i(271645),o=t.i(798120),i=t.i(167881),a=t.i(917162),s=t.i(95187);let f=(0,s.createServerReference)("7f62df5d341273027cb64947430687f91573ced089",s.callServer,void 0,s.findSourceMapURL,"undoLessonAction");var u=t.i(635963),h=t.i(245629),l=t.i(609856),c=t.i(283653),p=t.i(647163);function d(t){return"memory"===t.kind?"added"===t.change?"kept a note":"removed"===t.change?"dropped a note":"updated a note":"added"===t.change?`wrote the skill ${t.name}`:"removed"===t.change?`removed its skill ${t.name}`:`changed its skill ${t.name}`}function y({lesson:t,face:s}){let[g,m]=(0,n.useState)(!1),[b,v]=(0,l.useServerAction)(f,{okMessage:({said:t})=>t,onOk:()=>(0,c.revalidate)(o.queryKey.lessons({bot:t.bot}).url)}),w=async()=>{let e,r;await a.notify.confirm((e=`the skill ${t.name}`,r="memory"===t.kind?`${t.bot}'s note`:e,{title:"memory"===t.kind?"added"===t.change?"Forget this note?":"removed"===t.change?"Bring this note back?":"Put this note back?":"added"===t.change?`Delete ${e}?`:"removed"===t.change?`Bring ${e} back?`:`Put ${e} back?`,description:"added"===t.change?`${t.bot} wrote it in this job. It is deleted, and the next job goes without it.`:"removed"===t.change?`${r.charAt(0).toUpperCase()}${r.slice(1)} comes back as it was before this job.`:`${r.charAt(0).toUpperCase()}${r.slice(1)} goes back to how it was before this job.`,okText:"added"===t.change?"Delete":"Put back",destructive:"added"===t.change}))&&b(t.id)};return(0,e.jsxs)("div",{className:"border-t border-border/60 first-of-type:border-t-0",children:[(0,e.jsxs)("div",{className:"flex items-start gap-2 py-1.5",children:[(0,e.jsxs)("button",{type:"button",onClick:()=>m(t=>!t),"aria-expanded":g,className:"flex min-w-0 flex-1 flex-col gap-0.5 rounded-lg px-1 text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,e.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5 text-[12px] text-muted-foreground",children:[s&&(0,e.jsx)(u.BotMark,{size:14,seed:s.name,color:s.icon?.color,shape:s.icon?.shape,outline:s.icon?.outline,paint:s.icon?.paint,notify:!1,className:"shrink-0"}),(0,e.jsxs)("span",{className:"truncate",children:[s?`${t.bot} ${d(t)}`:d(t),!s&&t.threadLabel&&` \xb7 ${t.threadLabel}`]}),(0,e.jsxs)("span",{className:"shrink-0 font-mono text-[10px] tabular-nums",children:[t.added>0&&`+${t.added}`,t.added>0&&t.removed>0&&" ",t.removed>0&&`−${t.removed}`]}),!s&&(0,e.jsx)("span",{className:"shrink-0 font-mono text-[10px]",children:(0,h.shortAgo)(t.at)})]}),(0,e.jsxs)("span",{className:(0,p.cn)("flex min-w-0 items-center gap-1 text-[13px]",t.undoneAt&&"text-muted-foreground line-through"),children:[(0,e.jsx)(r.ChevronRight,{className:(0,p.cn)("size-3 shrink-0 text-muted-foreground transition-transform",g&&"rotate-90")}),(0,e.jsx)("span",{className:"truncate",children:t.line})]})]}),t.undoneAt?(0,e.jsx)("span",{className:"shrink-0 pt-1 font-mono text-[10px] text-muted-foreground",children:"put back"}):(0,e.jsx)(i.Button,{type:"button",size:"sm",variant:"ghost",loading:v,onClick:w,className:"h-7 shrink-0 rounded-full px-2.5 text-[12px]",children:"Undo"})]}),g&&(0,e.jsx)("pre",{className:"mb-2 ml-5 max-h-48 overflow-y-auto rounded-lg bg-muted/50 p-2 font-mono text-[11px] leading-relaxed whitespace-pre-wrap break-words",children:t.text||"(empty)"})]})}t.s(["BotLessons",0,function({bot:t}){let{data:r}=(0,c.useServerRoute)(o.queryKey.lessons({bot:t}));return r?.length?(0,e.jsxs)("div",{className:"pt-1",children:[(0,e.jsx)("div",{className:"flex h-6 items-center",children:(0,e.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:"Learned"})}),r.map(t=>(0,e.jsx)(y,{lesson:t},t.id))]}):null},"JobLessons",0,function({threadId:t,faces:r}){let{data:n}=(0,c.useServerRoute)(o.queryKey.lessons({thread:t}));return n?.length?(0,e.jsxs)("div",{className:"pt-2",children:[(0,e.jsx)("p",{className:"px-1 pb-1 font-mono text-[10px] text-muted-foreground",children:"Kept for next time"}),n.map(t=>(0,e.jsx)(y,{lesson:t,face:r.find(e=>e.name===t.bot)??{name:t.bot}},t.id))]}):null}],540921)},567334,877267,t=>{"use strict";let e,r=[[" "],[" ",".","`"],[".",",","·","'"],[":",";","-","^"],["=","+","~",'"'],["*","?","◦","j"],["c","v","○","7"],["o","x","◇","い"],["s","y","t","あ"],["e","a","u","な"],["k","w","z","や"],["q","h","n","米"]],n=r.length;function o(t,e){return a(.05,.42,t/e)}let i={A:[".##.","#..#","####","#..#","#..#"],B:["###.","#..#","###.","#..#","###."],C:[".###","#...","#...","#...",".###"],D:["###.","#..#","#..#","#..#","###."],E:["####","#...","###.","#...","####"],F:["####","#...","###.","#...","#..."],G:[".###","#...","#.##","#..#",".###"],H:["#..#","#..#","####","#..#","#..#"],I:["###",".#.",".#.",".#.","###"],J:["..##","...#","...#","#..#",".##."],K:["#..#","#.#.","##..","#.#.","#..#"],L:["#...","#...","#...","#...","####"],M:["#...#","##.##","#.#.#","#...#","#...#"],N:["#..#","##.#","#.##","#..#","#..#"],O:[".##.","#..#","#..#","#..#",".##."],P:["###.","#..#","###.","#...","#..."],Q:[".##.","#..#","#..#","#.#.",".#.#"],R:["###.","#..#","###.","#.#.","#..#"],S:[".###","#...",".##.","...#","###."],T:["###",".#.",".#.",".#.",".#."],U:["#..#","#..#","#..#","#..#",".##."],V:["#...#","#...#",".#.#.",".#.#.","..#.."],W:["#...#","#...#","#.#.#","##.##","#...#"],X:["#..#","#..#",".##.","#..#","#..#"],Y:["#.#","#.#",".#.",".#.",".#."],Z:["####","...#",".##.","#...","####"],0:[".##.","#.##","#..#","##.#",".##."],1:[".#.","##.",".#.",".#.","###"],2:["###.","...#",".##.","#...","####"],3:["###.","...#",".##.","...#","###."],4:["#..#","#..#","####","...#","...#"],5:["####","#...","###.","...#","###."],6:[".##.","#...","###.","#..#",".##."],7:["####","...#","..#.",".#..",".#.."],8:[".##.","#..#",".##.","#..#",".##."],9:[".##.","#..#",".###","...#",".##."],"!":["#","#","#",".","#"],"?":["###.","...#",".##.","....",".#.."],".":[".",".",".",".","#"],",":["..","..","..",".#","#."],"'":["#","#",".",".","."],"-":["...","...","###","...","..."],"+":["...",".#.","###",".#.","..."],":":[".","#",".","#","."],"(":[".#","#.","#.","#.",".#"],")":["#.",".#",".#",".#","#."],"<":["..#",".#.","#..",".#.","..#"],">":["#..",".#.","..#",".#.","#.."],"^":[".#.","#.#","...","...","..."],"~":["....",".#.#","#.#.","....","...."],"♥":[".#.#.","#####","#####",".###.","..#.."]," ":["..","..","..","..",".."]};function a(t,e,r){let n=Math.min(1,Math.max(0,(r-t)/(e-t)));return n*n*(3-2*n)}Object.keys(i).filter(t=>!/^[A-Z0-9 ]$/.test(t)),t.s(["ALPHA_TOP",0,.82,"CHAR_RATE",0,2.2,"EMOJI_CHAR_RATE",0,.6,"EMOJI_POOL",0,["🍎","🌹","🍓","❤️","🎈","🧨","🔴","🍊","🔥","🦊","🏀","🧡","🍑","⭐","🍋","🌻","💛","🐥","🌟","🍌","🍀","🌿","🐸","🥝","💚","🌵","🥑","💧","🌊","🫐","🐳","💙","🔵","🧊","🍇","💜","🔮","🟣","🪻","🍆","🌸","🌷","💗","🦩","🩷","🍫","🐻","🌰","🥐","🤍","☁️","🖤","⚪","⚫","🦢","🌈","🦜","🎨","🪩","🦄","✨","🍬","🎡"],"FACE_WORD_MAX",0,8,"LETTERS",0,i,"LEVELS",0,n,"ORB_INK",0,{dark:[247,247,247],light:[10,10,10]},"RAMP",0,r,"emojiAlpha",0,function(t,e){return .06+.94*o(t,e)},"emojiPx",0,function(t,e,r){return t*(.5+.5*o(e,r))},"emojiWeight",0,o,"hash",0,function(t,e){let r=43758.5453*Math.sin(127.1*t+311.7*e);return r-Math.floor(r)},"smoothstep",0,a,"undrawable",0,function(t){return Array.from(t.toUpperCase()).find(t=>!(t in i))??null}],567334);var s=t.i(271645);function f(){if(e)return e;let t=navigator,r=t.userAgentData?.platform||t.platform||"";return e=/mac|iphone|ipad|ipod/i.test(r)?"emoji":"letters"}let u=()=>()=>{};t.s(["faceGlyphs",0,f,"useFaceGlyphs",0,function(){return(0,s.useSyncExternalStore)(u,f,()=>"emoji")}],877267)},183414,t=>{"use strict";var e=t.i(41533);let r=Math.PI/180,n=t=>((t+180)%360+360)%360-180,o=null;function i(t,e,r){let n=!1;for(let o=0,i=r.length-2;o<r.length;i=o,o+=2){let a=r[o],s=r[o+1],f=r[i],u=r[i+1];s>e!=u>e&&t<(f-a)*(e-s)/(u-s)+a&&(n=!n)}return n}function a(t,e,r){for(let n of[r,r+360,r-360]){let[r,o,a,s]=t.bbox;if(!(n<r)&&!(n>o)&&!(e<a)&&!(e>s))for(let r=0;r<t.polys.length;r++){let{rings:o,bbox:a}=t.polys[r];if(!(n<a[0])&&!(n>a[1])&&!(e<a[2])&&!(e>a[3])&&i(n,e,o[0])&&!o.slice(1).some(t=>i(n,e,t)))return r}}return -1}t.s(["fitView",0,function(t,o,i,s,f){let u,h=function(t,o,i,s){let f=s?t.countries.findIndex(t=>t.code===s):-1;if(f>=0&&t.countries[f].polys.length){let e,s,u=t.countries[f],h=a(u,o,i);return{country:f,poly:h>=0?h:(e=0,s=1/0,u.polys.forEach(({bbox:t},a)=>{let f=Math.max(0,Math.abs(n(i-(t[0]+t[1])/2))-(t[1]-t[0])/2),u=Math.max(0,t[2]-o,o-t[3]),h=Math.hypot(f*Math.cos(o*r),u);h<s&&(s=h,e=a)}),e)}}let u=(e,r)=>{for(let n=0;n<t.countries.length;n++){let o=a(t.countries[n],e,r);if(o>=0)return{country:n,poly:o}}return null},h=u(o,i),l=Math.round(10*e.HERE.coastDeg);for(let t=1;!h&&t<=l;t++){let e=t/10;for(let t=0;t<8&&!h;t++)h=u(o+e*Math.sin(t*Math.PI/4),i+e*Math.cos(t*Math.PI/4))}return h}(t,o,i,f),{width:l,height:c}=s,p=o,d=i;if(h){let e=t.countries[h.country].polys,a=t=>{let e=0;for(let r=0,n=t.length-2;r<t.length;n=r,r+=2)e+=t[n]*t[r+1]-t[r]*t[n+1];return Math.abs(e/2)*Math.cos(t[1]*r)},s=h.poly,f=0;e.forEach((t,e)=>{let r=a(t.rings[0]);r>f&&(f=r,s=e)});let y=h.poly;if(s!==h.poly&&a(e[h.poly].rings[0])<.25*f){let t=e[s].bbox;4>Math.hypot(Math.max(0,t[0]-i,i-t[1])*Math.cos(o*r),Math.max(0,t[2]-o,o-t[3]))&&(y=s)}let g=[...e[y].bbox],m=[y];for(let t=0;t<3;t++)e.forEach((t,e)=>{let r=t.bbox;m.includes(e)||Math.max(0,r[0]-g[1],g[0]-r[1])>=2.5||Math.max(0,r[2]-g[3],g[2]-r[3])>=2.5||(m.push(e),g[0]=Math.min(g[0],r[0]),g[1]=Math.max(g[1],r[1]),g[2]=Math.min(g[2],r[2]),g[3]=Math.max(g[3],r[3]))});p=(g[2]+g[3])/2,d=n((g[0]+g[1])/2);let b=Math.cos(p*r),v=Math.abs(o-p),w=Math.abs(n(i-d))*b;for(let t of m){let r=e[t].rings[0];for(let t=0;t<r.length;t+=2)w=Math.max(w,Math.abs(n(r[t]-d))*b),v=Math.max(v,Math.abs(r[t+1]-p))}u=Math.min(.32*c/Math.sin(Math.min(70,Math.max(1,1.15*v))*r),.44*l/Math.sin(Math.min(80,Math.max(1,1.15*w))*r))}else u=c/2/Math.sin(8*r);return u=Math.max(s.least,Math.min(.32*c/Math.sin(r),u)),h&&(p=Math.min(89,p+.08*c/u/r)),{lat:o,lon:i,latc:p,lonc:d,radius:u,home:h?h.country:-1}},"loadWorld",0,function(){return o??=fetch("/here/world.json").then(async t=>{if(!t.ok)throw Error(`/here/world.json answered ${t.status}`);return function(t){if(t?.v!==2||!Array.isArray(t.a)||!Array.isArray(t.c))throw Error("world.json is not a map this app packs");let e=t.q,r=t.a.map(t=>{let r=new Float32Array(t.length),n=0,o=0;for(let i=0;i<t.length;i+=2)n+=t[i],o+=t[i+1],r[i]=n/e-180,r[i+1]=o/e-90;return r}),n=t=>{let e=[],n=null;for(let o of t){let t=r[o>=0?o:~o],i=t.length/2;for(let r=+!!e.length;r<i;r++){let a=o>=0?r:i-1-r,s=t[2*a];if(null!==n){for(;s-n>180;)s-=360;for(;s-n<-180;)s+=360}e.push(s,t[2*a+1]),n=s}}if(e.length>=4&&Math.abs(e[e.length-2]-e[0])>359){let t=0;for(let r=1;r<e.length;r+=2)t+=e[r];let r=t<0?-90:90;e.push(e[e.length-2],r,e[0],r)}return new Float32Array(e)},o=()=>[180,-180,90,-90],i=(t,e)=>{for(let r=0;r<e.length;r+=2)t[0]=Math.min(t[0],e[r]),t[1]=Math.max(t[1],e[r]),t[2]=Math.min(t[2],e[r+1]),t[3]=Math.max(t[3],e[r+1])};return{countries:t.c.map(({n:t,k:e,p:r})=>{let a=o();return{name:t,code:e??null,polys:r.map(t=>t.map(n).filter(t=>(t=>{let e=0;for(let r=0,n=t.length-2;r<t.length;n=r,r+=2)e+=t[n]*t[r+1]-t[r]*t[n+1];return Math.abs(e/2)})(t)>0)).filter(t=>t.length>0).map(t=>{let e=o();return i(e,t[0]),i(a,t[0]),{rings:t,bbox:e}}),bbox:a}})}}(await t.json())}).catch(t=>{throw o=null,t})},"project",0,function(t,e,n,o,i){let a=t*r,s=n*r,f=(e-o)*r;return{x:i*Math.cos(a)*Math.sin(f),y:-i*(Math.cos(s)*Math.sin(a)-Math.sin(s)*Math.cos(a)*Math.cos(f)),seen:Math.sin(s)*Math.sin(a)+Math.cos(s)*Math.cos(a)*Math.cos(f)>0}},"releaseWorld",0,function(){o=null},"wrap",0,n])},989366,t=>{"use strict";var e=t.i(55545),r=t.i(455024),n=t.i(99151),o=t.i(845110),i=t.i(281092),a=t.i(234662);t.s(["formatDistanceStrict",0,function(t,s,f){var u;let h,l,c=(0,r.getDefaultOptions)(),p=f?.locale??c.locale??e.defaultLocale,d=(l=(0,i.toDate)(t)-(0,i.toDate)(s))<0?-1:l>0?1:l;if(isNaN(d))throw RangeError("Invalid time value");let y=Object.assign({},f,{addSuffix:f?.addSuffix,comparison:d}),[g,m]=(0,o.normalizeDates)(f?.in,...d>0?[s,t]:[t,s]),b=(u=f?.roundingMethod??"round",t=>{let e=(u?Math[u]:Math.trunc)(t);return 0===e?0:e}),v=m.getTime()-g.getTime(),w=v/a.millisecondsInMinute,x=(v-((0,n.getTimezoneOffsetInMilliseconds)(m)-(0,n.getTimezoneOffsetInMilliseconds)(g)))/a.millisecondsInMinute,M=f?.unit;if("second"===(h=M||(w<1?"second":w<60?"minute":w<a.minutesInDay?"hour":x<a.minutesInMonth?"day":x<a.minutesInYear?"month":"year"))){let t=b(v/1e3);return p.formatDistance("xSeconds",t,y)}if("minute"===h){let t=b(w);return p.formatDistance("xMinutes",t,y)}if("hour"===h){let t=b(w/60);return p.formatDistance("xHours",t,y)}if("day"===h){let t=b(x/a.minutesInDay);return p.formatDistance("xDays",t,y)}if("month"===h){let t=b(x/a.minutesInMonth);return 12===t&&"month"!==M?p.formatDistance("xYears",1,y):p.formatDistance("xMonths",t,y)}else{let t=b(x/a.minutesInYear);return p.formatDistance("xYears",t,y)}}],989366)},569644,t=>{"use strict";var e=t.i(456420);let r={name:"folder-open",size:24,node:[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]};r.node;let n=(0,e.default)(r);t.s(["FolderOpen",0,n],569644)},97923,t=>{"use strict";var e=t.i(456420);let r={name:"log-in",size:24,node:[["path",{d:"m10 17 5-5-5-5",key:"1bsop3"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}]]};r.node;let n=(0,e.default)(r);t.s(["LogIn",0,n],97923)},747925,t=>{"use strict";var e=t.i(456420);let r={name:"wrench",size:24,node:[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]]};r.node;let n=(0,e.default)(r);t.s(["Wrench",0,n],747925)},467034,(t,e,r)=>{var n={872:function(t,e){"use strict";e.byteLength=function(t){var e=f(t),r=e[0],n=e[1];return(r+n)*3/4-n},e.toByteArray=function(t){var e,r,i=f(t),a=i[0],s=i[1],u=new o((a+s)*3/4-s),h=0,l=s>0?a-4:a;for(r=0;r<l;r+=4)e=n[t.charCodeAt(r)]<<18|n[t.charCodeAt(r+1)]<<12|n[t.charCodeAt(r+2)]<<6|n[t.charCodeAt(r+3)],u[h++]=e>>16&255,u[h++]=e>>8&255,u[h++]=255&e;return 2===s&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,u[h++]=255&e),1===s&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,u[h++]=e>>8&255,u[h++]=255&e),u},e.fromByteArray=function(t){for(var e,n=t.length,o=n%3,i=[],a=0,s=n-o;a<s;a+=16383)i.push(function(t,e,n){for(var o,i=[],a=e;a<n;a+=3)o=(t[a]<<16&0xff0000)+(t[a+1]<<8&65280)+(255&t[a+2]),i.push(r[o>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return i.join("")}(t,a,a+16383>s?s:a+16383));return 1===o?i.push(r[(e=t[n-1])>>2]+r[e<<4&63]+"=="):2===o&&i.push(r[(e=(t[n-2]<<8)+t[n-1])>>10]+r[e>>4&63]+r[e<<2&63]+"="),i.join("")};for(var r=[],n=[],o="u">typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,s=i.length;a<s;++a)r[a]=i[a],n[i.charCodeAt(a)]=a;function f(t){var e=t.length;if(e%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");-1===r&&(r=e);var n=r===e?0:4-r%4;return[r,n]}n[45]=62,n[95]=63},230:function(t,e,r){"use strict";var n=r(872),o=r(321),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function a(t){if(t>0x7fffffff)throw RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,s.prototype),e}function s(t,e,r){if("number"==typeof t){if("string"==typeof e)throw TypeError('The "string" argument must be of type string. Received type number');return h(t)}return f(t,e,r)}function f(t,e,r){if("string"==typeof t){var n=t,o=e;if(("string"!=typeof o||""===o)&&(o="utf8"),!s.isEncoding(o))throw TypeError("Unknown encoding: "+o);var i=0|p(n,o),f=a(i),u=f.write(n,o);return u!==i&&(f=f.slice(0,u)),f}if(ArrayBuffer.isView(t))return l(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(T(t,ArrayBuffer)||t&&T(t.buffer,ArrayBuffer)||"u">typeof SharedArrayBuffer&&(T(t,SharedArrayBuffer)||t&&T(t.buffer,SharedArrayBuffer)))return function(t,e,r){var n;if(e<0||t.byteLength<e)throw RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),s.prototype),n}(t,e,r);if("number"==typeof t)throw TypeError('The "value" argument must not be of type number. Received type number');var h=t.valueOf&&t.valueOf();if(null!=h&&h!==t)return s.from(h,e,r);var d=function(t){if(s.isBuffer(t)){var e=0|c(t.length),r=a(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||function(t){return t!=t}(t.length)?a(0):l(t):"Buffer"===t.type&&Array.isArray(t.data)?l(t.data):void 0}(t);if(d)return d;if("u">typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return s.from(t[Symbol.toPrimitive]("string"),e,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function u(t){if("number"!=typeof t)throw TypeError('"size" argument must be of type number');if(t<0)throw RangeError('The value "'+t+'" is invalid for option "size"')}function h(t){return u(t),a(t<0?0:0|c(t))}function l(t){for(var e=t.length<0?0:0|c(t.length),r=a(e),n=0;n<e;n+=1)r[n]=255&t[n];return r}e.Buffer=s,e.SlowBuffer=function(t){return+t!=t&&(t=0),s.alloc(+t)},e.INSPECT_MAX_BYTES=50,e.kMaxLength=0x7fffffff,s.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),!s.TYPED_ARRAY_SUPPORT&&"u">typeof console&&"function"==typeof console.error&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}}),s.poolSize=8192,s.from=function(t,e,r){return f(t,e,r)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array),s.alloc=function(t,e,r){return(u(t),t<=0)?a(t):void 0!==e?"string"==typeof r?a(t).fill(e,r):a(t).fill(e):a(t)},s.allocUnsafe=function(t){return h(t)},s.allocUnsafeSlow=function(t){return h(t)};function c(t){if(t>=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|t}function p(t,e){if(s.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||T(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var o=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return _(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return k(t).length;default:if(o)return n?-1:_(t).length;e=(""+e).toLowerCase(),o=!0}}function d(t,e,r){var o,i,a,s=!1;if((void 0===e||e<0)&&(e=0),e>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(e>>>=0)))return"";for(t||(t="utf8");;)switch(t){case"hex":return function(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=e;i<r;++i)o+=O[t[i]];return o}(this,e,r);case"utf8":case"utf-8":return b(this,e,r);case"ascii":return function(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(127&t[o]);return n}(this,e,r);case"latin1":case"binary":return function(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}(this,e,r);case"base64":return o=this,i=e,a=r,0===i&&a===o.length?n.fromByteArray(o):n.fromByteArray(o.slice(i,a));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(t,e,r){for(var n=t.slice(e,r),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}(this,e,r);default:if(s)throw TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),s=!0}}function y(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function g(t,e,r,n,o){var i;if(0===t.length)return -1;if("string"==typeof r?(n=r,r=0):r>0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),(i=r*=1)!=i&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length)if(o)return -1;else r=t.length-1;else if(r<0)if(!o)return -1;else r=0;if("string"==typeof e&&(e=s.from(e,n)),s.isBuffer(e))return 0===e.length?-1:m(t,e,r,n,o);if("number"==typeof e){if(e&=255,"function"==typeof Uint8Array.prototype.indexOf)if(o)return Uint8Array.prototype.indexOf.call(t,e,r);else return Uint8Array.prototype.lastIndexOf.call(t,e,r);return m(t,[e],r,n,o)}throw TypeError("val must be string, number or Buffer")}function m(t,e,r,n,o){var i,a=1,s=t.length,f=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return -1;a=2,s/=2,f/=2,r/=2}function u(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(o){var h=-1;for(i=r;i<s;i++)if(u(t,i)===u(e,-1===h?0:i-h)){if(-1===h&&(h=i),i-h+1===f)return h*a}else -1!==h&&(i-=i-h),h=-1}else for(r+f>s&&(r=s-f),i=r;i>=0;i--){for(var l=!0,c=0;c<f;c++)if(u(t,i+c)!==u(e,c)){l=!1;break}if(l)return i}return -1}s.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==s.prototype},s.compare=function(t,e){if(T(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),T(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(t)||!s.isBuffer(e))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var r=t.length,n=e.length,o=0,i=Math.min(r,n);o<i;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:+(n<r)},s.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(t,e){if(!Array.isArray(t))throw TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return s.alloc(0);if(void 0===e)for(r=0,e=0;r<t.length;++r)e+=t[r].length;var r,n=s.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){var i=t[r];if(T(i,Uint8Array)&&(i=s.from(i)),!s.isBuffer(i))throw TypeError('"list" argument must be an Array of Buffers');i.copy(n,o),o+=i.length}return n},s.byteLength=p,s.prototype._isBuffer=!0,s.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)y(this,e,e+1);return this},s.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)y(this,e,e+3),y(this,e+1,e+2);return this},s.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)y(this,e,e+7),y(this,e+1,e+6),y(this,e+2,e+5),y(this,e+3,e+4);return this},s.prototype.toString=function(){var t=this.length;return 0===t?"":0==arguments.length?b(this,0,t):d.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(t){if(!s.isBuffer(t))throw TypeError("Argument must be a Buffer");return this===t||0===s.compare(this,t)},s.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},i&&(s.prototype[i]=s.prototype.inspect),s.prototype.compare=function(t,e,r,n,o){if(T(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(t))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return -1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,o>>>=0,this===t)return 0;for(var i=o-n,a=r-e,f=Math.min(i,a),u=this.slice(n,o),h=t.slice(e,r),l=0;l<f;++l)if(u[l]!==h[l]){i=u[l],a=h[l];break}return i<a?-1:+(a<i)},s.prototype.includes=function(t,e,r){return -1!==this.indexOf(t,e,r)},s.prototype.indexOf=function(t,e,r){return g(this,t,e,r,!0)},s.prototype.lastIndexOf=function(t,e,r){return g(this,t,e,r,!1)};function b(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var i,a,s,f,u=t[o],h=null,l=u>239?4:u>223?3:u>191?2:1;if(o+l<=r)switch(l){case 1:u<128&&(h=u);break;case 2:(192&(i=t[o+1]))==128&&(f=(31&u)<<6|63&i)>127&&(h=f);break;case 3:i=t[o+1],a=t[o+2],(192&i)==128&&(192&a)==128&&(f=(15&u)<<12|(63&i)<<6|63&a)>2047&&(f<55296||f>57343)&&(h=f);break;case 4:i=t[o+1],a=t[o+2],s=t[o+3],(192&i)==128&&(192&a)==128&&(192&s)==128&&(f=(15&u)<<18|(63&i)<<12|(63&a)<<6|63&s)>65535&&f<1114112&&(h=f)}null===h?(h=65533,l=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),o+=l}var c=n,p=c.length;if(p<=4096)return String.fromCharCode.apply(String,c);for(var d="",y=0;y<p;)d+=String.fromCharCode.apply(String,c.slice(y,y+=4096));return d}function v(t,e,r){if(t%1!=0||t<0)throw RangeError("offset is not uint");if(t+e>r)throw RangeError("Trying to access beyond buffer length")}function w(t,e,r,n,o,i){if(!s.isBuffer(t))throw TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<i)throw RangeError('"value" argument is out of bounds');if(r+n>t.length)throw RangeError("Index out of range")}function x(t,e,r,n,o,i){if(r+n>t.length||r<0)throw RangeError("Index out of range")}function M(t,e,r,n,i){return e*=1,r>>>=0,i||x(t,e,r,4,34028234663852886e22,-34028234663852886e22),o.write(t,e,r,n,23,4),r+4}function A(t,e,r,n,i){return e*=1,r>>>=0,i||x(t,e,r,8,17976931348623157e292,-17976931348623157e292),o.write(t,e,r,n,52,8),r+8}s.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else if(isFinite(e))e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o,i,a,s,f,u,h,l,c=this.length-e;if((void 0===r||r>c)&&(r=c),t.length>0&&(r<0||e<0)||e>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var p=!1;;)switch(n){case"hex":return function(t,e,r,n){r=Number(r)||0;var o=t.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i=e.length;n>i/2&&(n=i/2);for(var a=0;a<n;++a){var s,f=parseInt(e.substr(2*a,2),16);if((s=f)!=s)break;t[r+a]=f}return a}(this,t,e,r);case"utf8":case"utf-8":return o=e,i=r,I(_(t,this.length-o),this,o,i);case"ascii":return a=e,s=r,I(B(t),this,a,s);case"latin1":case"binary":return function(t,e,r,n){return I(B(e),t,r,n)}(this,t,e,r);case"base64":return f=e,u=r,I(k(t),this,f,u);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return h=e,l=r,I(function(t,e){for(var r,n,o=[],i=0;i<t.length&&!((e-=2)<0);++i)n=(r=t.charCodeAt(i))>>8,o.push(r%256),o.push(n);return o}(t,this.length-h),this,h,l);default:if(p)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),p=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},s.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);var n=this.subarray(t,e);return Object.setPrototypeOf(n,s.prototype),n},s.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||v(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n},s.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||v(t,e,this.length);for(var n=this[t+--e],o=1;e>0&&(o*=256);)n+=this[t+--e]*o;return n},s.prototype.readUInt8=function(t,e){return t>>>=0,e||v(t,1,this.length),this[t]},s.prototype.readUInt16LE=function(t,e){return t>>>=0,e||v(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUInt16BE=function(t,e){return t>>>=0,e||v(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUInt32LE=function(t,e){return t>>>=0,e||v(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+0x1000000*this[t+3]},s.prototype.readUInt32BE=function(t,e){return t>>>=0,e||v(t,4,this.length),0x1000000*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||v(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*e)),n},s.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||v(t,e,this.length);for(var n=e,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},s.prototype.readInt8=function(t,e){return(t>>>=0,e||v(t,1,this.length),128&this[t])?-((255-this[t]+1)*1):this[t]},s.prototype.readInt16LE=function(t,e){t>>>=0,e||v(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?0xffff0000|r:r},s.prototype.readInt16BE=function(t,e){t>>>=0,e||v(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?0xffff0000|r:r},s.prototype.readInt32LE=function(t,e){return t>>>=0,e||v(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return t>>>=0,e||v(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readFloatLE=function(t,e){return t>>>=0,e||v(t,4,this.length),o.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return t>>>=0,e||v(t,4,this.length),o.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return t>>>=0,e||v(t,8,this.length),o.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return t>>>=0,e||v(t,8,this.length),o.read(this,t,!1,52,8)},s.prototype.writeUIntLE=function(t,e,r,n){if(t*=1,e>>>=0,r>>>=0,!n){var o=Math.pow(2,8*r)-1;w(this,t,e,r,o,0)}var i=1,a=0;for(this[e]=255&t;++a<r&&(i*=256);)this[e+a]=t/i&255;return e+r},s.prototype.writeUIntBE=function(t,e,r,n){if(t*=1,e>>>=0,r>>>=0,!n){var o=Math.pow(2,8*r)-1;w(this,t,e,r,o,0)}var i=r-1,a=1;for(this[e+i]=255&t;--i>=0&&(a*=256);)this[e+i]=t/a&255;return e+r},s.prototype.writeUInt8=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,1,255,0),this[e]=255&t,e+1},s.prototype.writeUInt16LE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeUInt16BE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeUInt32LE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,4,0xffffffff,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},s.prototype.writeUInt32BE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,4,0xffffffff,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeIntLE=function(t,e,r,n){if(t*=1,e>>>=0,!n){var o=Math.pow(2,8*r-1);w(this,t,e,r,o-1,-o)}var i=0,a=1,s=0;for(this[e]=255&t;++i<r&&(a*=256);)t<0&&0===s&&0!==this[e+i-1]&&(s=1),this[e+i]=(t/a|0)-s&255;return e+r},s.prototype.writeIntBE=function(t,e,r,n){if(t*=1,e>>>=0,!n){var o=Math.pow(2,8*r-1);w(this,t,e,r,o-1,-o)}var i=r-1,a=1,s=0;for(this[e+i]=255&t;--i>=0&&(a*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/a|0)-s&255;return e+r},s.prototype.writeInt8=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeInt16BE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeInt32LE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,4,0x7fffffff,-0x80000000),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},s.prototype.writeInt32BE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,4,0x7fffffff,-0x80000000),t<0&&(t=0xffffffff+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeFloatLE=function(t,e,r){return M(this,t,e,!0,r)},s.prototype.writeFloatBE=function(t,e,r){return M(this,t,e,!1,r)},s.prototype.writeDoubleLE=function(t,e,r){return A(this,t,e,!0,r)},s.prototype.writeDoubleBE=function(t,e,r){return A(this,t,e,!1,r)},s.prototype.copy=function(t,e,r,n){if(!s.isBuffer(t))throw TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r||0===t.length||0===this.length)return 0;if(e<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var o=n-r;if(this===t&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(e,r,n);else if(this===t&&r<e&&e<n)for(var i=o-1;i>=0;--i)t[i+e]=this[i+r];else Uint8Array.prototype.set.call(t,this.subarray(r,n),e);return o},s.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw TypeError("encoding must be a string");if("string"==typeof n&&!s.isEncoding(n))throw TypeError("Unknown encoding: "+n);if(1===t.length){var o,i=t.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(t=i)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw RangeError("Out of range index");if(r<=e)return this;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o<r;++o)this[o]=t;else{var a=s.isBuffer(t)?t:s.from(t,n),f=a.length;if(0===f)throw TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<r-e;++o)this[o+e]=a[o%f]}return this};var E=/[^+/0-9A-Za-z-_]/g;function _(t,e){e=e||1/0;for(var r,n=t.length,o=null,i=[],a=0;a<n;++a){if((r=t.charCodeAt(a))>55295&&r<57344){if(!o){if(r>56319||a+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=(o-55296<<10|r-56320)+65536}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return i}function B(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}function k(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(E,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function I(t,e,r,n){for(var o=0;o<n&&!(o+r>=e.length)&&!(o>=t.length);++o)e[o+r]=t[o];return o}function T(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}var O=function(){for(var t="0123456789abcdef",e=Array(256),r=0;r<16;++r)for(var n=16*r,o=0;o<16;++o)e[n+o]=t[r]+t[o];return e}()},321:function(t,e){e.read=function(t,e,r,n,o){var i,a,s=8*o-n-1,f=(1<<s)-1,u=f>>1,h=-7,l=r?o-1:0,c=r?-1:1,p=t[e+l];for(l+=c,i=p&(1<<-h)-1,p>>=-h,h+=s;h>0;i=256*i+t[e+l],l+=c,h-=8);for(a=i&(1<<-h)-1,i>>=-h,h+=n;h>0;a=256*a+t[e+l],l+=c,h-=8);if(0===i)i=1-u;else{if(i===f)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,n),i-=u}return(p?-1:1)*a*Math.pow(2,i-n)},e.write=function(t,e,r,n,o,i){var a,s,f,u=8*i-o-1,h=(1<<u)-1,l=h>>1,c=5960464477539062e-23*(23===o),p=n?0:i-1,d=n?1:-1,y=+(e<0||0===e&&1/e<0);for(isNaN(e=Math.abs(e))||e===1/0?(s=+!!isNaN(e),a=h):(a=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-a))<1&&(a--,f*=2),a+l>=1?e+=c/f:e+=c*Math.pow(2,1-l),e*f>=2&&(a++,f/=2),a+l>=h?(s=0,a=h):a+l>=1?(s=(e*f-1)*Math.pow(2,o),a+=l):(s=e*Math.pow(2,l-1)*Math.pow(2,o),a=0));o>=8;t[r+p]=255&s,p+=d,s/=256,o-=8);for(a=a<<o|s,u+=o;u>0;t[r+p]=255&a,p+=d,a/=256,u-=8);t[r+p-d]|=128*y}}},o={};function i(t){var e=o[t];if(void 0!==e)return e.exports;var r=o[t]={exports:{}},a=!0;try{n[t](r,r.exports,i),a=!1}finally{a&&delete o[t]}return r.exports}i.ab="/ROOT/node_modules/next/dist/compiled/buffer/",e.exports=i(230)}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,107941,e=>{"use strict";var t=e.i(843476),n=e.i(24071),i=e.i(867927),s=e.i(482022),r=e.i(829600),a=e.i(456420);let o={name:"file-code-corner",size:24,node:[["path",{d:"M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35",key:"1wthlu"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m5 16-3 3 3 3",key:"331omg"}],["path",{d:"m9 22 3-3-3-3",key:"lsp7cz"}]],aliases:["file-code-2"]};o.node;let l=(0,a.default)(o);var d=e.i(905015),c=e.i(226091),u=e.i(726067),m=e.i(569644),x=e.i(815170),h=e.i(51921);let f={name:"sheet",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["line",{x1:"3",x2:"21",y1:"9",y2:"9",key:"1vqk6q"}],["line",{x1:"3",x2:"21",y1:"15",y2:"15",key:"o2sbyz"}],["line",{x1:"9",x2:"9",y1:"9",y2:"21",key:"1ib60c"}],["line",{x1:"15",x2:"15",y1:"9",y2:"21",key:"1n26ft"}]]};f.node;let p=(0,a.default)(f);var g=e.i(759659),v=e.i(438583),y=e.i(271645),k=e.i(798120),j=e.i(167881),b=e.i(917162),S=e.i(41533),w=e.i(895836),N=e.i(621285),A=e.i(476769),F=e.i(95187);let C=(0,F.createServerReference)("7fe9cda7e190f932392ef0ad209543eb30a6dae467",F.callServer,void 0,F.findSourceMapURL,"emptyScratchAction");var P=e.i(199099),$=e.i(245629),R=e.i(609856),z=e.i(283653),E=e.i(647163);let T={markdown:c.FileText,csv:p,json:d.FileJson,text:c.FileText,frame:l,image:x.Image,audio:h.Music,video:v.Video,none:r.File};function M({label:e,rows:n,children:i}){return 0===n.length?null:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"px-3 pt-3 pb-1 font-mono text-[10px] text-muted-foreground",children:e}),i]})}function W({entry:e,active:n,onPick:s}){let r="dir"===e.kind?u.Folder:T[e.view];return(0,t.jsxs)("button",{type:"button",onClick:s,title:"file"===e.kind?`${e.name} \xb7 ${(0,$.shortAgo)(e.at)}`:e.name,className:(0,E.cn)("mx-2 flex items-center gap-2 rounded-md px-2 py-1.5 text-left text-[13px] outline-none focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",n?(0,E.cn)(w.PICKED_ROW,"font-medium"):"text-muted-foreground hover:bg-muted/60 hover:text-foreground"),children:[(0,t.jsx)(r,{className:"size-3.5 shrink-0 opacity-70"}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate",children:e.name}),"file"===e.kind?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"shrink-0 font-mono text-[11px] text-muted-foreground",children:(0,E.formatBytes)(e.bytes)}),(0,t.jsx)("span",{className:"w-3.5 shrink-0"})]}):(0,t.jsx)(i.ChevronRight,{className:"size-3.5 shrink-0 text-muted-foreground/50"})]})}function O({empty:e}){return(0,t.jsx)("div",{className:"space-y-4 p-8",children:e?(0,t.jsxs)("p",{className:"max-w-lg text-sm leading-relaxed text-muted-foreground",children:["Nothing here yet. What a bot writes during a call lands in"," ",(0,t.jsxs)("span",{className:"font-mono text-[13px] text-foreground",children:[S.PATHS.artifacts,"/"]})," ","— a page, a table, a picture — and shows up here to open."]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"text-sm leading-relaxed text-muted-foreground",children:"Pick a file on the left."}),(0,t.jsx)("p",{className:"max-w-lg text-sm leading-relaxed text-muted-foreground",children:"Only what the app can open is listed — a page, a table, a picture, a note. Installed packages and tool leftovers are left out, and no folder is measured, so a folder opens as fast as it lists. Reveal folder, at the foot, opens everything else."})]})})}function K({file:e,onGone:n}){let i=e.path,[r]=(0,R.useServerAction)(P.revealFileAction),[a,o]=(0,R.useServerAction)(A.deleteWorkspaceFileAction,{okMessage:"File deleted",onOk:()=>{(0,z.revalidate)(k.queryKey.workspace),n()}}),l=async()=>{await b.notify.confirm({title:`Delete ${i.split("/").pop()}?`,description:"It is deleted from disk for good.",okText:"Delete",destructive:!0})&&a(i)};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-3 border-b border-border/60 px-6 py-2",children:[(0,t.jsx)(B,{path:i}),(0,t.jsxs)("span",{className:"shrink-0 font-mono text-[11px] text-muted-foreground",children:[(0,E.formatBytes)(e.bytes)," · ",(0,$.shortAgo)(e.at)]}),(0,t.jsx)("a",{href:k.queryKey.fileView(i),target:"_blank",rel:"noreferrer","aria-label":"Open in a new tab",className:"grid size-7 shrink-0 place-items-center rounded-md text-muted-foreground outline-none transition-colors hover:bg-muted/60 hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,t.jsx)(s.ExternalLink,{className:"size-4"})}),(0,t.jsx)(j.Button,{size:"icon-sm",variant:"ghost","aria-label":"Reveal in the file manager",className:"text-muted-foreground",onClick:()=>r(i),children:(0,t.jsx)(m.FolderOpen,{})}),(0,t.jsx)(j.Button,{size:"icon-sm",variant:"ghost","aria-label":"Delete",loading:o,className:"text-muted-foreground",onClick:l,children:(0,t.jsx)(g.Trash2,{})})]}),(0,t.jsx)("div",{className:"min-h-0 flex-1 overflow-auto",children:(0,t.jsx)(N.FilePreview,{path:i,bytes:e.bytes})})]})}function B({path:e}){let n=["workspace",...e.split("/").filter(Boolean)];return(0,t.jsx)("span",{className:"flex min-w-0 flex-1 items-center gap-1 font-mono text-[11px] text-muted-foreground",children:n.map((e,s)=>(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-1",children:[s>0&&(0,t.jsx)(i.ChevronRight,{className:"size-3 shrink-0 opacity-50"}),(0,t.jsx)("span",{className:(0,E.cn)("truncate",s===n.length-1&&"text-foreground"),children:e})]},`${s}-${e}`))})}e.s(["WorkspaceSetting",0,function(){let[e,i]=(0,y.useState)(""),[s,r]=(0,y.useState)(S.WORKSPACE_VIEW.rows),[a,o]=(0,y.useState)(null),[l,d]=(0,y.useState)(""),{data:c,isLoading:u,error:x}=(0,z.useServerRoute)(k.queryKey.workspaceFolder(e,s),{keepPreviousData:!0}),h=e=>{i(e),r(S.WORKSPACE_VIEW.rows)},[f,p]=(0,R.useServerAction)(C,{okMessage:"Scratch emptied",onOk:()=>(0,z.revalidate)(k.queryKey.workspace)}),[g]=(0,R.useServerAction)(P.revealFileAction),v=async()=>{await b.notify.confirm({title:"Empty scratch?",description:`Everything under ${S.PATHS.scratch}/ is deleted for good. ${S.PATHS.artifacts}/ and ${S.PATHS.projects}/ are untouched.`,okText:"Empty",destructive:!0})&&f()};if(u)return(0,t.jsx)(w.SettingPanesSkeleton,{});if(x)return(0,t.jsx)(w.SettingError,{message:x.message});let N=c?.entries??[],A=c?.total??0,F=l.trim().toLowerCase(),$=F?N.filter(e=>e.name.toLowerCase().includes(F)):N,E=$.filter(e=>"dir"===e.kind),T=$.filter(e=>"file"===e.kind),B=""!==e||N.some(e=>"dir"===e.kind&&e.name===S.PATHS.scratch),V=N.find(e=>"file"===e.kind&&e.path===a?.path)??a;return(0,t.jsx)(w.SettingPanes,{footer:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(w.SettingRailNote,{children:(0,t.jsxs)("span",{className:"font-mono",children:[(0,t.jsx)("span",{className:"font-medium text-foreground",children:`${S.PATHS.workspace}${e?`/${e}`:""}`}),` \xb7 ${function(e,t){let n=e.filter(e=>"dir"===e.kind).length,i=e.length-n,s=[n&&`${n} ${1===n?"folder":"folders"}`,i&&`${i} ${1===i?"file":"files"}`].filter(Boolean);if(!s.length)return"empty";let r=s.join(" · ");return t>e.length?`${r} of ${t.toLocaleString("en")}`:r}(N,A)}`]})}),(0,t.jsxs)(j.Button,{variant:"outline",size:"sm",onClick:()=>g(e||"."),children:[(0,t.jsx)(m.FolderOpen,{}),"Reveal folder"]}),B&&(0,t.jsx)(j.Button,{variant:"outline",size:"sm",loading:p,onClick:v,className:"text-destructive hover:text-destructive",children:"Empty scratch"})]}),left:(0,t.jsxs)("div",{className:"flex flex-col py-2",children:[(0,t.jsx)(w.SettingFilter,{value:l,onChange:d,placeholder:"Filter this folder",className:"mx-2 mb-1.5 w-auto"}),e&&(0,t.jsxs)("button",{type:"button",onClick:()=>h(e.split("/").slice(0,-1).join("/")),className:"mx-2 mb-1 flex items-center gap-1 rounded-md px-2 py-1 text-left font-mono text-[11px] text-muted-foreground outline-none hover:bg-muted/60 hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",children:[(0,t.jsx)(n.ChevronLeft,{className:"size-3 shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:e.split("/").slice(0,-1).pop()??"workspace"})]}),0===$.length?(0,t.jsx)("p",{className:"px-4 py-3 text-xs text-muted-foreground",children:F?"Nothing matches":"Empty folder"}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(M,{label:"folders",rows:E,children:E.map(e=>(0,t.jsx)(W,{entry:e,onPick:()=>h(e.path)},e.path))}),(0,t.jsx)(M,{label:"files",rows:T,children:T.map(e=>(0,t.jsx)(W,{entry:e,active:e.path===a?.path,onPick:()=>"file"===e.kind&&o(e)},e.path))})]}),A>N.length&&(0,t.jsx)("button",{type:"button",onClick:()=>r(s+S.WORKSPACE_VIEW.rows),className:"mx-2 mt-2 rounded-md px-2 py-1.5 text-left font-mono text-[11px] text-muted-foreground outline-none hover:bg-muted/60 hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",children:`Show ${Math.min(S.WORKSPACE_VIEW.rows,A-N.length)} more of ${A.toLocaleString("en")}`})]}),right:V?.kind==="file"?(0,t.jsx)(K,{file:V,onGone:()=>o(null)},V.path):(0,t.jsx)(O,{empty:!e&&0===N.length})})}],107941)},476769,e=>{"use strict";var t=e.i(95187);let n=(0,t.createServerReference)("7f61757932a8cad5a6c7a745c182dfdf0c56414989",t.callServer,void 0,t.findSourceMapURL,"deleteWorkspaceFileAction");e.s(["deleteWorkspaceFileAction",0,n])},726067,e=>{"use strict";var t=e.i(456420);let n={name:"folder",size:24,node:[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]};n.node;let i=(0,t.default)(n);e.s(["Folder",0,i],726067)},759659,e=>{"use strict";var t=e.i(456420);let n={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"]};n.node;let i=(0,t.default)(n);e.s(["Trash2",0,i],759659)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,107941,e=>{"use strict";var t=e.i(843476),n=e.i(24071),i=e.i(867927),s=e.i(482022),r=e.i(829600),a=e.i(456420);let o={name:"file-code-corner",size:24,node:[["path",{d:"M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35",key:"1wthlu"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m5 16-3 3 3 3",key:"331omg"}],["path",{d:"m9 22 3-3-3-3",key:"lsp7cz"}]],aliases:["file-code-2"]};o.node;let l=(0,a.default)(o);var d=e.i(905015),c=e.i(226091),u=e.i(726067),m=e.i(569644),x=e.i(815170),h=e.i(51921);let f={name:"sheet",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["line",{x1:"3",x2:"21",y1:"9",y2:"9",key:"1vqk6q"}],["line",{x1:"3",x2:"21",y1:"15",y2:"15",key:"o2sbyz"}],["line",{x1:"9",x2:"9",y1:"9",y2:"21",key:"1ib60c"}],["line",{x1:"15",x2:"15",y1:"9",y2:"21",key:"1n26ft"}]]};f.node;let p=(0,a.default)(f);var g=e.i(759659),v=e.i(438583),y=e.i(271645),k=e.i(798120),j=e.i(167881),b=e.i(917162),S=e.i(41533),w=e.i(895836),N=e.i(621285),A=e.i(122552),F=e.i(95187);let C=(0,F.createServerReference)("7fb090e5374a73e5a3f5d0bb518953a01443857180",F.callServer,void 0,F.findSourceMapURL,"emptyScratchAction");var P=e.i(535091),$=e.i(245629),R=e.i(609856),z=e.i(283653),E=e.i(647163);let T={markdown:c.FileText,csv:p,json:d.FileJson,text:c.FileText,frame:l,image:x.Image,audio:h.Music,video:v.Video,none:r.File};function M({label:e,rows:n,children:i}){return 0===n.length?null:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"px-3 pt-3 pb-1 font-mono text-[10px] text-muted-foreground",children:e}),i]})}function W({entry:e,active:n,onPick:s}){let r="dir"===e.kind?u.Folder:T[e.view];return(0,t.jsxs)("button",{type:"button",onClick:s,title:"file"===e.kind?`${e.name} \xb7 ${(0,$.shortAgo)(e.at)}`:e.name,className:(0,E.cn)("mx-2 flex items-center gap-2 rounded-md px-2 py-1.5 text-left text-[13px] outline-none focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",n?(0,E.cn)(w.PICKED_ROW,"font-medium"):"text-muted-foreground hover:bg-muted/60 hover:text-foreground"),children:[(0,t.jsx)(r,{className:"size-3.5 shrink-0 opacity-70"}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate",children:e.name}),"file"===e.kind?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"shrink-0 font-mono text-[11px] text-muted-foreground",children:(0,E.formatBytes)(e.bytes)}),(0,t.jsx)("span",{className:"w-3.5 shrink-0"})]}):(0,t.jsx)(i.ChevronRight,{className:"size-3.5 shrink-0 text-muted-foreground/50"})]})}function O({empty:e}){return(0,t.jsx)("div",{className:"space-y-4 p-8",children:e?(0,t.jsxs)("p",{className:"max-w-lg text-sm leading-relaxed text-muted-foreground",children:["Nothing here yet. What a bot writes during a call lands in"," ",(0,t.jsxs)("span",{className:"font-mono text-[13px] text-foreground",children:[S.PATHS.artifacts,"/"]})," ","— a page, a table, a picture — and shows up here to open."]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"text-sm leading-relaxed text-muted-foreground",children:"Pick a file on the left."}),(0,t.jsx)("p",{className:"max-w-lg text-sm leading-relaxed text-muted-foreground",children:"Only what the app can open is listed — a page, a table, a picture, a note. Installed packages and tool leftovers are left out, and no folder is measured, so a folder opens as fast as it lists. Reveal folder, at the foot, opens everything else."})]})})}function K({file:e,onGone:n}){let i=e.path,[r]=(0,R.useServerAction)(P.revealFileAction),[a,o]=(0,R.useServerAction)(A.deleteWorkspaceFileAction,{okMessage:"File deleted",onOk:()=>{(0,z.revalidate)(k.queryKey.workspace),n()}}),l=async()=>{await b.notify.confirm({title:`Delete ${i.split("/").pop()}?`,description:"It is deleted from disk for good.",okText:"Delete",destructive:!0})&&a(i)};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-3 border-b border-border/60 px-6 py-2",children:[(0,t.jsx)(B,{path:i}),(0,t.jsxs)("span",{className:"shrink-0 font-mono text-[11px] text-muted-foreground",children:[(0,E.formatBytes)(e.bytes)," · ",(0,$.shortAgo)(e.at)]}),(0,t.jsx)("a",{href:k.queryKey.fileView(i),target:"_blank",rel:"noreferrer","aria-label":"Open in a new tab",className:"grid size-7 shrink-0 place-items-center rounded-md text-muted-foreground outline-none transition-colors hover:bg-muted/60 hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,t.jsx)(s.ExternalLink,{className:"size-4"})}),(0,t.jsx)(j.Button,{size:"icon-sm",variant:"ghost","aria-label":"Reveal in the file manager",className:"text-muted-foreground",onClick:()=>r(i),children:(0,t.jsx)(m.FolderOpen,{})}),(0,t.jsx)(j.Button,{size:"icon-sm",variant:"ghost","aria-label":"Delete",loading:o,className:"text-muted-foreground",onClick:l,children:(0,t.jsx)(g.Trash2,{})})]}),(0,t.jsx)("div",{className:"min-h-0 flex-1 overflow-auto",children:(0,t.jsx)(N.FilePreview,{path:i,bytes:e.bytes})})]})}function B({path:e}){let n=["workspace",...e.split("/").filter(Boolean)];return(0,t.jsx)("span",{className:"flex min-w-0 flex-1 items-center gap-1 font-mono text-[11px] text-muted-foreground",children:n.map((e,s)=>(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-1",children:[s>0&&(0,t.jsx)(i.ChevronRight,{className:"size-3 shrink-0 opacity-50"}),(0,t.jsx)("span",{className:(0,E.cn)("truncate",s===n.length-1&&"text-foreground"),children:e})]},`${s}-${e}`))})}e.s(["WorkspaceSetting",0,function(){let[e,i]=(0,y.useState)(""),[s,r]=(0,y.useState)(S.WORKSPACE_VIEW.rows),[a,o]=(0,y.useState)(null),[l,d]=(0,y.useState)(""),{data:c,isLoading:u,error:x}=(0,z.useServerRoute)(k.queryKey.workspaceFolder(e,s),{keepPreviousData:!0}),h=e=>{i(e),r(S.WORKSPACE_VIEW.rows)},[f,p]=(0,R.useServerAction)(C,{okMessage:"Scratch emptied",onOk:()=>(0,z.revalidate)(k.queryKey.workspace)}),[g]=(0,R.useServerAction)(P.revealFileAction),v=async()=>{await b.notify.confirm({title:"Empty scratch?",description:`Everything under ${S.PATHS.scratch}/ is deleted for good. ${S.PATHS.artifacts}/ and ${S.PATHS.projects}/ are untouched.`,okText:"Empty",destructive:!0})&&f()};if(u)return(0,t.jsx)(w.SettingPanesSkeleton,{});if(x)return(0,t.jsx)(w.SettingError,{message:x.message});let N=c?.entries??[],A=c?.total??0,F=l.trim().toLowerCase(),$=F?N.filter(e=>e.name.toLowerCase().includes(F)):N,E=$.filter(e=>"dir"===e.kind),T=$.filter(e=>"file"===e.kind),B=""!==e||N.some(e=>"dir"===e.kind&&e.name===S.PATHS.scratch),V=N.find(e=>"file"===e.kind&&e.path===a?.path)??a;return(0,t.jsx)(w.SettingPanes,{footer:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(w.SettingRailNote,{children:(0,t.jsxs)("span",{className:"font-mono",children:[(0,t.jsx)("span",{className:"font-medium text-foreground",children:`${S.PATHS.workspace}${e?`/${e}`:""}`}),` \xb7 ${function(e,t){let n=e.filter(e=>"dir"===e.kind).length,i=e.length-n,s=[n&&`${n} ${1===n?"folder":"folders"}`,i&&`${i} ${1===i?"file":"files"}`].filter(Boolean);if(!s.length)return"empty";let r=s.join(" · ");return t>e.length?`${r} of ${t.toLocaleString("en")}`:r}(N,A)}`]})}),(0,t.jsxs)(j.Button,{variant:"outline",size:"sm",onClick:()=>g(e||"."),children:[(0,t.jsx)(m.FolderOpen,{}),"Reveal folder"]}),B&&(0,t.jsx)(j.Button,{variant:"outline",size:"sm",loading:p,onClick:v,className:"text-destructive hover:text-destructive",children:"Empty scratch"})]}),left:(0,t.jsxs)("div",{className:"flex flex-col py-2",children:[(0,t.jsx)(w.SettingFilter,{value:l,onChange:d,placeholder:"Filter this folder",className:"mx-2 mb-1.5 w-auto"}),e&&(0,t.jsxs)("button",{type:"button",onClick:()=>h(e.split("/").slice(0,-1).join("/")),className:"mx-2 mb-1 flex items-center gap-1 rounded-md px-2 py-1 text-left font-mono text-[11px] text-muted-foreground outline-none hover:bg-muted/60 hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",children:[(0,t.jsx)(n.ChevronLeft,{className:"size-3 shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:e.split("/").slice(0,-1).pop()??"workspace"})]}),0===$.length?(0,t.jsx)("p",{className:"px-4 py-3 text-xs text-muted-foreground",children:F?"Nothing matches":"Empty folder"}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(M,{label:"folders",rows:E,children:E.map(e=>(0,t.jsx)(W,{entry:e,onPick:()=>h(e.path)},e.path))}),(0,t.jsx)(M,{label:"files",rows:T,children:T.map(e=>(0,t.jsx)(W,{entry:e,active:e.path===a?.path,onPick:()=>"file"===e.kind&&o(e)},e.path))})]}),A>N.length&&(0,t.jsx)("button",{type:"button",onClick:()=>r(s+S.WORKSPACE_VIEW.rows),className:"mx-2 mt-2 rounded-md px-2 py-1.5 text-left font-mono text-[11px] text-muted-foreground outline-none hover:bg-muted/60 hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",children:`Show ${Math.min(S.WORKSPACE_VIEW.rows,A-N.length)} more of ${A.toLocaleString("en")}`})]}),right:V?.kind==="file"?(0,t.jsx)(K,{file:V,onGone:()=>o(null)},V.path):(0,t.jsx)(O,{empty:!e&&0===N.length})})}],107941)},122552,e=>{"use strict";var t=e.i(95187);let n=(0,t.createServerReference)("7f2569c942512cbda5681690c4b95480b8a9217259",t.callServer,void 0,t.findSourceMapURL,"deleteWorkspaceFileAction");e.s(["deleteWorkspaceFileAction",0,n])},726067,e=>{"use strict";var t=e.i(456420);let n={name:"folder",size:24,node:[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]};n.node;let i=(0,t.default)(n);e.s(["Folder",0,i],726067)},759659,e=>{"use strict";var t=e.i(456420);let n={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"]};n.node;let i=(0,t.default)(n);e.s(["Trash2",0,i],759659)}]);