sanoma 0.11.21 → 0.11.22

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 (417) hide show
  1. package/README.md +2 -0
  2. package/app/README.md +2 -2
  3. package/app/dist/api.d.ts +16 -2
  4. package/app/dist/api.js +1 -1
  5. package/app/dist/client/assets/ArrowDown.es-BOfBLlTP.js +1 -0
  6. package/app/dist/client/assets/CaretDown.es-D12mWb2j.js +1 -0
  7. package/app/dist/client/assets/CatchBoundary-Cb__yx-s.js +1 -0
  8. package/app/dist/client/assets/Copy.es-CvUujKw7.js +1 -0
  9. package/app/dist/client/assets/DialogTitle-Dz3loDe5.js +1 -0
  10. package/app/dist/client/assets/FloppyDisk.es-CDyDob8p.js +1 -0
  11. package/app/dist/client/assets/Globe.es-C1pgZCGM.js +1 -0
  12. package/app/dist/client/assets/MagnifyingGlass.es-CZ3i6pz0.js +1 -0
  13. package/app/dist/client/assets/Play.es-DGJ1CGhp.js +1 -0
  14. package/app/dist/client/assets/Plug.es-BPhGL8MK.js +1 -0
  15. package/app/dist/client/assets/Plus.es-i3Vaa2WW.js +1 -0
  16. package/app/dist/client/assets/Separator-Cu9cQDBN.js +1 -0
  17. package/app/dist/client/assets/X.es-B7rq0E_-.js +1 -0
  18. package/app/dist/client/assets/_id-C4bMZ73g.js +1 -0
  19. package/app/dist/client/assets/_id-CUaJYD_3.js +1 -0
  20. package/app/dist/client/assets/_id-DRetx-BJ.js +1 -0
  21. package/app/dist/client/assets/_id-mm7bTIIl.js +2 -0
  22. package/app/dist/client/assets/_id-tN6nFEpD.js +1 -0
  23. package/app/dist/client/assets/_name-BOi2qVWk.js +1 -0
  24. package/app/dist/client/assets/_name-CBI1waPs.js +4 -0
  25. package/app/dist/client/assets/_name-CrsiaFT6.js +1 -0
  26. package/app/dist/client/assets/_name-TzQfjXo8.js +1 -0
  27. package/app/dist/client/assets/_vendor-C3TGvx4w.js +1 -0
  28. package/app/dist/client/assets/_vendor-sHwAlFSF.js +1 -0
  29. package/app/dist/client/assets/app-chrome-_ahvxx73.js +5 -0
  30. package/app/dist/client/assets/app-scope-Bht7PIkQ.js +1 -0
  31. package/app/dist/client/assets/approval-BFFM_yEl.js +1 -0
  32. package/app/dist/client/assets/apps-CpdXjc1j.js +1 -0
  33. package/app/dist/client/assets/button-D5kdANef.js +1 -0
  34. package/app/dist/client/assets/change-glance-CdkbSGxZ.js +1 -0
  35. package/app/dist/client/assets/changes-C_K2tazO.js +1 -0
  36. package/app/dist/client/assets/changes-DFcdyDL_.js +1 -0
  37. package/app/dist/client/assets/chat-Djbdaxw8.js +14 -0
  38. package/app/dist/client/assets/chat-button-DNusaP5n.js +1 -0
  39. package/app/dist/client/assets/chat-prompt-z0XJPDtH.js +1 -0
  40. package/app/dist/client/assets/{code-BVYaiQEr.js → code-CT4-YDKq.js} +2 -2
  41. package/app/dist/client/assets/common-DHOhx6Zn.js +3 -0
  42. package/app/dist/client/assets/composite-9cNA7N0P.js +1 -0
  43. package/app/dist/client/assets/connect-DHUdrwwW.js +1 -0
  44. package/app/dist/client/assets/connections-fGNKJl3J.js +5 -0
  45. package/app/dist/client/assets/connectors-CuS1paNm.js +1 -0
  46. package/app/dist/client/assets/credentials-Cb7Lnfxk.js +1 -0
  47. package/app/dist/client/assets/css-BGIxQoYs.js +1 -0
  48. package/app/dist/client/assets/css-DgaLhXQH.js +1 -0
  49. package/app/dist/client/assets/data-DZ-ufRXn.js +1 -0
  50. package/app/dist/client/assets/decidable-OFQBEcco.js +1 -0
  51. package/app/dist/client/assets/declaration-form-D2ZMEVC6.js +1 -0
  52. package/app/dist/client/assets/dialog-B5pmfCdJ.js +1 -0
  53. package/app/dist/client/assets/diff-woXpYk--.js +1 -0
  54. package/app/dist/client/assets/engine-CBuzy-Ik.js +1 -0
  55. package/app/dist/client/assets/existing-BaPrTDs8.js +1 -0
  56. package/app/dist/client/assets/fence-CMhOJv7H.js +157 -0
  57. package/app/dist/client/assets/github-dark-C-LZuMrd.js +1 -0
  58. package/app/dist/client/assets/github-light-EUqPIrTm.js +1 -0
  59. package/app/dist/client/assets/graph-B5TYhcqD.js +7 -0
  60. package/app/dist/client/assets/grid-diff-wo26YSgM.js +1 -0
  61. package/app/dist/client/assets/held-card-HrJ6QpRY.js +1 -0
  62. package/app/dist/client/assets/highlighted-body-JLMTFACH-CjeaSnZq.js +1 -0
  63. package/app/dist/client/assets/hosting-Beoi95m6.js +1 -0
  64. package/app/dist/client/assets/html-BHZv6uqE.js +1 -0
  65. package/app/dist/client/assets/import-8WDFPfe6.js +1 -0
  66. package/app/dist/client/assets/inbox-B9hsZPsC.js +1 -0
  67. package/app/dist/client/assets/inbox-DM2npRZI.js +1 -0
  68. package/app/dist/client/assets/index-CHKfukjt.js +10 -0
  69. package/app/dist/client/assets/item-B4QRpXse.js +1 -0
  70. package/app/dist/client/assets/javascript-BzbQS41l.js +1 -0
  71. package/app/dist/client/assets/javascript-CpIGwZ_Y.js +1 -0
  72. package/app/dist/client/assets/json-qhed-kSA.js +1 -0
  73. package/app/dist/client/assets/jsx-Bz0zcwM4.js +1 -0
  74. package/app/dist/client/assets/kit-n8CE0xEs.js +1 -0
  75. package/app/dist/client/assets/lazyRouteComponent-DezoGNoN.js +1 -0
  76. package/app/dist/client/assets/markdown-BYOwaDjH.js +1 -0
  77. package/app/dist/client/assets/markdown-DS_nKu0s.js +164 -0
  78. package/app/dist/client/assets/mermaid-WFAXDIZX-DQBKIf0O.js +1 -0
  79. package/app/dist/client/assets/motion-D6e1hqz4.js +1 -0
  80. package/app/dist/client/assets/people-BiiQfYJ8.js +1 -0
  81. package/app/dist/client/assets/permissions-BmKxEfBi.js +2 -0
  82. package/app/dist/client/assets/permissions-grid-B755bq5J.js +1 -0
  83. package/app/dist/client/assets/preload-helper-BLdHbfdN.js +1 -0
  84. package/app/dist/client/assets/python-gzcpVVnB.js +1 -0
  85. package/app/dist/client/assets/queries-DGlVu9wp.js +57 -0
  86. package/app/dist/client/assets/react-dom-D6fTz1bt.js +1 -0
  87. package/app/dist/client/assets/route-BSe5L2p4.js +1 -0
  88. package/app/dist/client/assets/route-Ds87ixtB.js +1 -0
  89. package/app/dist/client/assets/runs-table-DMiD4HeY.js +1 -0
  90. package/app/dist/client/assets/scenario-DrgmfuFx.js +1 -0
  91. package/app/dist/client/assets/scenario-graph-Blv2e1PV.js +1 -0
  92. package/app/dist/client/assets/separator-Bdtc7rou.js +1 -0
  93. package/app/dist/client/assets/{sheet-BYL9XU5s.js → sheet-BKUFUA1l.js} +1 -1
  94. package/app/dist/client/assets/shellscript-CLZ0U2zV.js +1 -0
  95. package/app/dist/client/assets/site-icon-1Mcc1UIb.js +1 -0
  96. package/app/dist/client/assets/sites.index-K4mrFsLr.js +1 -0
  97. package/app/dist/client/assets/spinner-XaRXIj9W.js +1 -0
  98. package/app/dist/client/assets/sql-CEbI0hMM.js +1 -0
  99. package/app/dist/client/assets/start-form-CJ6VmNPY.js +1 -0
  100. package/app/dist/client/assets/store-BT988jIX.js +1 -0
  101. package/app/dist/client/assets/style-CTcG_5y0.css +2 -0
  102. package/app/dist/client/assets/table-B81tv0LG.js +1 -0
  103. package/app/dist/client/assets/textarea-CRpYU-qx.js +1 -0
  104. package/app/dist/client/assets/tsx-udAQXfEw.js +1 -0
  105. package/app/dist/client/assets/typescript-bsJCZSQ-.js +1 -0
  106. package/app/dist/client/assets/{useLoaderData-BQd5yMlA.js → useLoaderData-BsksXf-p.js} +1 -1
  107. package/app/dist/client/assets/useOpenInteractionType-UhakpAXY.js +1 -0
  108. package/app/dist/client/assets/useRegisterFieldControl-DIkKUJkh.js +1 -0
  109. package/app/dist/client/assets/useValueChanged-DBqn456b.js +1 -0
  110. package/app/dist/client/assets/utils-BRvE9-Fo.js +1 -0
  111. package/app/dist/client/assets/who-are-you-DUoVqvfP.js +1 -0
  112. package/app/dist/client/assets/workflow-lQtyyxKx.js +1 -0
  113. package/app/dist/client/assets/workflow-view-hk_RU9WF.js +1 -0
  114. package/app/dist/client/assets/workflows-DFB7lzzN.js +1 -0
  115. package/app/dist/client/assets/yaml-rwi0_p6S.js +1 -0
  116. package/app/dist/index.d.ts +4 -4
  117. package/app/dist/lib/chat.d.ts +64 -19
  118. package/app/dist/lib/chat.js +54 -18
  119. package/app/dist/lib/chat.js.map +1 -1
  120. package/app/dist/server/assets/{_id-wuJIq2ZZ.js → _id--MWJXj9R.js} +2 -2
  121. package/app/dist/server/assets/{_id-ce1EGp7Y.js → _id-BEGe86NW.js} +2 -2
  122. package/app/dist/server/assets/{_id-BViXAagq.js → _id-CbO7Ok0w.js} +12 -10
  123. package/app/dist/server/assets/{_id-Dt9tTylX.js → _id-DwdpIYKk.js} +2 -2
  124. package/app/dist/server/assets/{_id-wB8khGTz.js → _id-fK_nPFHK.js} +6 -6
  125. package/app/dist/server/assets/{_name-D_-MhjNf.js → _name-BzD9TxVC.js} +17 -17
  126. package/app/dist/server/assets/{_name-BqFwnyf7.js → _name-ClgMsl5m.js} +2 -2
  127. package/app/dist/server/assets/{_name-BGagGBjX.js → _name-DdFVsjcj.js} +7 -7
  128. package/app/dist/server/assets/{_name-DntbHE-b.js → _name-Dyh4G9Oy.js} +10 -11
  129. package/app/dist/server/assets/{_tanstack-start-manifest_v-BljuBM-G.js → _tanstack-start-manifest_v-DUtnBg7y.js} +101 -91
  130. package/app/dist/server/assets/{_vendor-CNB03LWX.js → _vendor-DyeUY8kH.js} +8 -8
  131. package/app/dist/server/assets/{_vendor-CcEviOki.js → _vendor-W3KKSusM.js} +2 -2
  132. package/app/dist/server/assets/{actor-D6iA0pDg.js → actor-BlaOwG6A.js} +1 -1
  133. package/app/dist/server/assets/app-chrome-BJlxsc9y.js +2116 -0
  134. package/app/dist/server/assets/{app-scope-CXIgOFmi.js → app-scope-ASuhE3xI.js} +2 -2
  135. package/app/dist/server/assets/{apply-plan-ybBda6vQ.js → apply-plan-Djw1tNPD.js} +8 -7
  136. package/app/dist/server/assets/{approval-Su315ikC.js → approval-BjTnfr1U.js} +15 -13
  137. package/app/dist/server/assets/{apps-xwQAehch.js → apps-C28F9Y5C.js} +7 -7
  138. package/app/dist/server/assets/button-Xwx3rpQ0.js +43 -0
  139. package/app/dist/server/assets/change-glance-Bc4htVPy.js +54 -0
  140. package/app/dist/server/assets/{change-glance-CpArIbGS.js → changes-B5P8BJSf.js} +2 -54
  141. package/app/dist/server/assets/{changes-Bc_OiDBD.js → changes-tbeMKxjY.js} +8 -7
  142. package/app/dist/server/assets/{chat-DMN_hoKm.js → chat-BNMeLc9V.js} +108 -30
  143. package/app/dist/server/assets/{chat-button-LtA80MoR.js → chat-button-SluTWK8R.js} +2 -2
  144. package/app/dist/server/assets/{code-COyt8L-n.js → code-hVpCkmAZ.js} +1 -1
  145. package/app/dist/server/assets/{common-CWHLj7KV.js → common-DpZcJvCy.js} +26 -24
  146. package/app/dist/server/assets/{connect-BpPiu5s6.js → connect-Cljunav2.js} +11 -10
  147. package/app/dist/server/assets/{connections-DBgb1bvX.js → connections-Cfz5LMy5.js} +12 -11
  148. package/app/dist/server/assets/{connectors-5a5_SlHO.js → connectors-tt9BF9L1.js} +8 -8
  149. package/app/dist/server/assets/{credentials-ud_Y68hx.js → credentials-CYUFAVU8.js} +10 -9
  150. package/app/dist/server/assets/{data-aEdhwcqy.js → data-D91ZZ5St.js} +7 -7
  151. package/app/dist/server/assets/{declaration-form-Dfg1yNuY.js → declaration-form-BzISD6gw.js} +7 -6
  152. package/app/dist/server/assets/{dialog-BGjiw3Dx.js → dialog-T0bzlKzs.js} +2 -2
  153. package/app/dist/server/assets/{dropdown-menu-DAC3LWas.js → dropdown-menu-RGvPORm4.js} +1 -1
  154. package/app/dist/server/assets/{existing-B4d4NrC8.js → existing-BZym0xE2.js} +8 -7
  155. package/app/dist/server/assets/fence-Br7MPP41.js +130 -0
  156. package/app/dist/server/assets/{field-C0Xx_90s.js → field-DFpkT1id.js} +1 -1
  157. package/app/dist/server/assets/{functions-BvFYzabD.js → functions-sf07C1qn.js} +2 -2
  158. package/app/dist/server/assets/{graph-qYOdoz2s.js → graph-C1Cl7owl.js} +5 -5
  159. package/app/dist/server/assets/{grid-diff-jTvp-8wS.js → grid-diff-D5bQDKl2.js} +1 -1
  160. package/app/dist/server/assets/held-card-CDewk4rs.js +75 -0
  161. package/app/dist/server/assets/{hosting-bbn9UvDc.js → hosting-O-l2L0ec.js} +16 -14
  162. package/app/dist/server/assets/{import-DIwvzHb6.js → import-qvpEIYFx.js} +8 -8
  163. package/app/dist/server/assets/{inbox-D6R6sWBB.js → inbox-BcJxCIPm.js} +8 -8
  164. package/app/dist/server/assets/{inbox-Dj-5FleF.js → inbox-BvpSeC3M.js} +2 -2
  165. package/app/dist/server/assets/{input-D63gF3G2.js → input-CF-vX8Xp.js} +1 -1
  166. package/app/dist/server/assets/{item-BDSXoEr_.js → item-LBDNja5f.js} +1 -1
  167. package/app/dist/server/assets/{kit-D6EulwBe.js → kit-DlT_THim.js} +2 -2
  168. package/app/dist/server/assets/markdown-BExKjghi.js +116 -0
  169. package/app/dist/server/assets/{middleware-B8JRLyxx.js → middleware-B6RPW0fH.js} +1 -1
  170. package/app/dist/server/assets/{people-CkU_AxrV.js → people-C8VXQrKg.js} +13 -12
  171. package/app/dist/server/assets/{permissions-BfMcQqQb.js → permissions-COAiOoCB.js} +9 -8
  172. package/app/dist/server/assets/{permissions-grid-DWP9FAAS.js → permissions-grid-CcYUiqhD.js} +4 -4
  173. package/app/dist/server/assets/{button-f9Lc8qLl.js → queries-DJcZ4mzA.js} +3 -45
  174. package/app/dist/server/assets/{route-BTT7nMJq.js → route-DOqitvxL.js} +2 -2
  175. package/app/dist/server/assets/{route-CF_8jQYY.js → route-aa9MThMA.js} +2 -2
  176. package/app/dist/server/assets/{router-BvYtxrVN.js → router-Co6gRNI1.js} +80 -46
  177. package/app/dist/server/assets/{runs-table-BBudn12Y.js → runs-table-BtGm2KOO.js} +6 -6
  178. package/app/dist/server/assets/{scenario-BXGTSTiP.js → scenario-DidUafqw.js} +5 -5
  179. package/app/dist/server/assets/{separator-8MZ7vR3f.js → separator-Cf98V8ie.js} +1 -1
  180. package/app/dist/server/assets/{sheet-5Cyp-4UW.js → sheet-DTOG7OHQ.js} +2 -2
  181. package/app/dist/server/assets/{sites.index-1l0BtgVf.js → sites.index-4TK8c0QC.js} +4 -4
  182. package/app/dist/server/assets/{spinner-C1ZW08lp.js → spinner-016IPVi-.js} +1 -1
  183. package/app/dist/server/assets/{start-CSU4irVK.js → start-VfVsXenI.js} +2 -2
  184. package/app/dist/server/assets/{start-form-DI60UOrc.js → start-form-CUeEdeP7.js} +10 -9
  185. package/app/dist/server/assets/{table-DtPk_h_5.js → table-y-dGlLx6.js} +1 -1
  186. package/app/dist/server/assets/{textarea-f0Ip5ed1.js → textarea-B02joDnr.js} +1 -1
  187. package/app/dist/server/assets/utils-CHesvfjo.js +138 -0
  188. package/app/dist/server/assets/{who-are-you-ZGyMnpVi.js → who-are-you-DW5qmIzp.js} +8 -7
  189. package/app/dist/server/assets/{workflow-Z99QWO42.js → workflow-BRu7ljgU.js} +5 -5
  190. package/app/dist/server/assets/{workflow-view-C8X8U11S.js → workflow-view-yF48p1lu.js} +14 -13
  191. package/app/dist/server/assets/{workflows-C0kJoGf1.js → workflows-DL-TJFLt.js} +13 -14
  192. package/app/dist/server/chat.d.ts +6 -1
  193. package/app/dist/server/chat.js +39 -20
  194. package/app/dist/server/chat.js.map +1 -1
  195. package/app/dist/server/server.js +48 -48
  196. package/app/dist/steps/agent/acp.d.ts +3 -97
  197. package/app/dist/steps/agent/acp.js +19 -49
  198. package/app/dist/steps/agent/acp.js.map +1 -1
  199. package/app/dist/steps/agent/checkout.d.ts +18 -1
  200. package/app/dist/steps/agent/checkout.js +17 -0
  201. package/app/dist/steps/agent/checkout.js.map +1 -1
  202. package/app/dist/steps/agent/harness.d.ts +2 -4
  203. package/app/dist/steps/agent/harness.js +45 -61
  204. package/app/dist/steps/agent/harness.js.map +1 -1
  205. package/app/dist/steps/agent/prompt.d.ts +1 -1
  206. package/app/dist/steps/agent/prompt.js +35 -14
  207. package/app/dist/steps/agent/prompt.js.map +1 -1
  208. package/app/dist/steps/agent/transcript.d.ts +10 -1
  209. package/app/dist/steps/agent/transcript.js +75 -2
  210. package/app/dist/steps/agent/transcript.js.map +1 -1
  211. package/app/dist/steps/agent/turn.d.ts +4 -6
  212. package/app/dist/steps/agent/turn.js +14 -16
  213. package/app/dist/steps/agent/turn.js.map +1 -1
  214. package/app/dist/stylesheet.json +1 -1
  215. package/app/src/api.ts +1 -1
  216. package/app/src/components/app-chrome.tsx +28 -13
  217. package/app/src/components/common.tsx +1 -24
  218. package/app/src/components/logo.tsx +25 -0
  219. package/app/src/components/shell/chat-parts.tsx +185 -126
  220. package/app/src/components/shell/chat-prompt.ts +6 -2
  221. package/app/src/components/shell/chat.tsx +154 -220
  222. package/app/src/components/shell/composer.tsx +140 -0
  223. package/app/src/components/shell/connect-agent.tsx +157 -0
  224. package/app/src/components/shell/engine-mark.tsx +9 -0
  225. package/app/src/components/shell/fence.tsx +25 -0
  226. package/app/src/components/shell/held-card.tsx +58 -0
  227. package/app/src/components/shell/markdown.tsx +152 -0
  228. package/app/src/components/shell/nav-user.tsx +11 -1
  229. package/app/src/components/shell/prefs.ts +9 -1
  230. package/app/src/components/shell/thread.tsx +174 -0
  231. package/app/src/components/ui/bubble.tsx +117 -0
  232. package/app/src/components/ui/code-block.tsx +235 -0
  233. package/app/src/components/ui/input-group.tsx +136 -0
  234. package/app/src/components/ui/marker.tsx +67 -0
  235. package/app/src/components/ui/message-scroller.tsx +117 -0
  236. package/app/src/components/ui/message.tsx +74 -0
  237. package/app/src/components/ui/trace.tsx +133 -0
  238. package/app/src/hooks/use-highlighted-code.ts +72 -0
  239. package/app/src/index.ts +4 -4
  240. package/app/src/lib/chat.ts +110 -22
  241. package/app/src/lib/cn-tables.ts +23 -23
  242. package/app/src/lib/highlighter.tsx +114 -0
  243. package/app/src/routes/__root.tsx +7 -4
  244. package/app/src/routes/connectors/index.tsx +1 -1
  245. package/app/src/routes/hosting/index.tsx +6 -9
  246. package/app/src/server/chat.ts +41 -19
  247. package/app/src/steps/agent/acp.ts +10 -80
  248. package/app/src/steps/agent/checkout.ts +30 -0
  249. package/app/src/steps/agent/harness.ts +53 -78
  250. package/app/src/steps/agent/prompt.ts +42 -14
  251. package/app/src/steps/agent/transcript.ts +90 -3
  252. package/app/src/steps/agent/turn.ts +18 -16
  253. package/app/src/worker/app.ts +6 -5
  254. package/dist/cli.js +18 -6
  255. package/dist/cli.js.map +1 -1
  256. package/dist/serve.js +1 -1
  257. package/dist/serve.js.map +1 -1
  258. package/dist/worker-port.d.ts +16 -2
  259. package/dist/worker-port.js +44 -5
  260. package/dist/worker-port.js.map +1 -1
  261. package/package.json +7 -3
  262. package/testing/README.md +3 -3
  263. package/testing/dist/build.d.ts +3 -3
  264. package/testing/dist/build.js +4 -4
  265. package/testing/dist/build.js.map +1 -1
  266. package/testing/dist/host.d.ts +34 -21
  267. package/testing/dist/host.js +135 -75
  268. package/testing/dist/host.js.map +1 -1
  269. package/workflows/CLOUD-IDENTITY.md +15 -20
  270. package/workflows/README.md +9 -7
  271. package/workflows/dist/client.d.ts +5 -3
  272. package/workflows/dist/client.js +4 -3
  273. package/workflows/dist/client.js.map +1 -1
  274. package/workflows/dist/cloud-identity.d.ts +5 -2
  275. package/workflows/dist/cloud-identity.js +7 -4
  276. package/workflows/dist/cloud-identity.js.map +1 -1
  277. package/workflows/dist/config.d.ts +7 -1
  278. package/workflows/dist/config.js +24 -1
  279. package/workflows/dist/config.js.map +1 -1
  280. package/workflows/dist/db/company.d.ts +1 -1
  281. package/workflows/dist/db/company.js +1 -1
  282. package/workflows/dist/db/identity.d.ts +2 -2
  283. package/workflows/dist/db/identity.js +2 -2
  284. package/workflows/dist/db/identity.js.map +1 -1
  285. package/workflows/dist/deadlines.d.ts +7 -2
  286. package/workflows/dist/deadlines.js +14 -5
  287. package/workflows/dist/deadlines.js.map +1 -1
  288. package/workflows/dist/describe.js +15 -3
  289. package/workflows/dist/describe.js.map +1 -1
  290. package/workflows/dist/description.d.ts +37 -2
  291. package/workflows/dist/description.js +22 -1
  292. package/workflows/dist/description.js.map +1 -1
  293. package/workflows/dist/host.d.ts +7 -6
  294. package/workflows/dist/host.js +1 -1
  295. package/workflows/dist/host.js.map +1 -1
  296. package/workflows/dist/identity-provisioning.d.ts +2 -5
  297. package/workflows/dist/identity-provisioning.js +16 -20
  298. package/workflows/dist/identity-provisioning.js.map +1 -1
  299. package/workflows/dist/index.d.ts +3 -3
  300. package/workflows/dist/index.js +1 -1
  301. package/workflows/dist/index.js.map +1 -1
  302. package/workflows/dist/op.d.ts +92 -1
  303. package/workflows/dist/op.js +19 -6
  304. package/workflows/dist/op.js.map +1 -1
  305. package/workflows/dist/renewal.d.ts +1 -1
  306. package/workflows/dist/renewal.js +1 -1
  307. package/workflows/dist/runtime-ops.d.ts +3 -4
  308. package/workflows/dist/runtime-ops.js +4 -4
  309. package/workflows/dist/runtime-ops.js.map +1 -1
  310. package/workflows/dist/schedules.d.ts +1 -1
  311. package/workflows/dist/schedules.js +1 -1
  312. package/workflows/dist/supervisor.d.ts +21 -18
  313. package/workflows/dist/supervisor.js +20 -22
  314. package/workflows/dist/supervisor.js.map +1 -1
  315. package/workflows/dist/vendor-info.d.ts +12 -3
  316. package/workflows/dist/vendor-info.js +20 -4
  317. package/workflows/dist/vendor-info.js.map +1 -1
  318. package/workflows/dist/worker.d.ts +11 -1
  319. package/workflows/dist/worker.js +9 -3
  320. package/workflows/dist/worker.js.map +1 -1
  321. package/workflows/src/client.ts +9 -6
  322. package/workflows/src/cloud-identity.ts +7 -4
  323. package/workflows/src/config.ts +36 -1
  324. package/workflows/src/db/company.ts +1 -1
  325. package/workflows/src/db/identity.ts +2 -2
  326. package/workflows/src/deadlines.ts +18 -8
  327. package/workflows/src/describe.ts +16 -3
  328. package/workflows/src/description.ts +25 -1
  329. package/workflows/src/host.ts +7 -6
  330. package/workflows/src/identity-provisioning.ts +19 -30
  331. package/workflows/src/index.ts +7 -1
  332. package/workflows/src/op.ts +104 -10
  333. package/workflows/src/renewal.ts +1 -1
  334. package/workflows/src/runtime-ops.ts +5 -5
  335. package/workflows/src/schedules.ts +1 -1
  336. package/workflows/src/supervisor.ts +40 -38
  337. package/workflows/src/vendor-info.ts +20 -5
  338. package/workflows/src/worker.ts +22 -5
  339. package/app/dist/client/assets/ArrowUp.es-DOgvoS0P.js +0 -1
  340. package/app/dist/client/assets/Copy.es-B0D5SwiQ.js +0 -1
  341. package/app/dist/client/assets/DialogTitle-BgjYK22C.js +0 -1
  342. package/app/dist/client/assets/FloppyDisk.es-DnuNe_a8.js +0 -1
  343. package/app/dist/client/assets/Globe.es-B6x2e4-a.js +0 -1
  344. package/app/dist/client/assets/MagnifyingGlass.es-DoNoHEhT.js +0 -1
  345. package/app/dist/client/assets/Play.es-BwXalGBh.js +0 -1
  346. package/app/dist/client/assets/Plug.es-CaZsN5P-.js +0 -1
  347. package/app/dist/client/assets/Plus.es-w9VPpTJB.js +0 -1
  348. package/app/dist/client/assets/Separator-BAhKFgSd.js +0 -1
  349. package/app/dist/client/assets/X.es-DKMYClf-.js +0 -1
  350. package/app/dist/client/assets/_id-BSRAaWtO.js +0 -1
  351. package/app/dist/client/assets/_id-BjDP-cPH.js +0 -1
  352. package/app/dist/client/assets/_id-BudM76zX.js +0 -1
  353. package/app/dist/client/assets/_id-C37U5bBa.js +0 -1
  354. package/app/dist/client/assets/_id-lmg24JVh.js +0 -2
  355. package/app/dist/client/assets/_name-CylqFo_t.js +0 -1
  356. package/app/dist/client/assets/_name-D8Gl8iwy.js +0 -4
  357. package/app/dist/client/assets/_name-DdPCU8pt.js +0 -1
  358. package/app/dist/client/assets/_name-TteWQXe0.js +0 -1
  359. package/app/dist/client/assets/_vendor-BLxW83yk.js +0 -1
  360. package/app/dist/client/assets/_vendor-Bq3uZU4-.js +0 -1
  361. package/app/dist/client/assets/app-chrome-H8uZ4dHI.js +0 -16
  362. package/app/dist/client/assets/app-scope-BeUW_8Qh.js +0 -1
  363. package/app/dist/client/assets/approval-DpgmTc63.js +0 -1
  364. package/app/dist/client/assets/apps-CoWzNm8M.js +0 -1
  365. package/app/dist/client/assets/change-glance-DbYcBT7H.js +0 -1
  366. package/app/dist/client/assets/changes-DIJvP7wQ.js +0 -1
  367. package/app/dist/client/assets/chat-button-BgpOfYh1.js +0 -1
  368. package/app/dist/client/assets/chat-prompt-hiawXcK0.js +0 -1
  369. package/app/dist/client/assets/common-Dw2i6XKZ.js +0 -3
  370. package/app/dist/client/assets/composite-D9GNDzFj.js +0 -1
  371. package/app/dist/client/assets/connect-CIq2KJTz.js +0 -1
  372. package/app/dist/client/assets/connections-iqd2XbWQ.js +0 -5
  373. package/app/dist/client/assets/connectors-rI8_D1n1.js +0 -1
  374. package/app/dist/client/assets/credentials-26vu6Fv5.js +0 -1
  375. package/app/dist/client/assets/data-sDMlKaLV.js +0 -1
  376. package/app/dist/client/assets/decidable-zcYI7bY8.js +0 -1
  377. package/app/dist/client/assets/declaration-form-BtSVvxhq.js +0 -1
  378. package/app/dist/client/assets/dialog-DskpUgkl.js +0 -1
  379. package/app/dist/client/assets/existing-BD3VgJ_8.js +0 -1
  380. package/app/dist/client/assets/graph-Prxl3c55.js +0 -7
  381. package/app/dist/client/assets/grid-diff-SMsvea6t.js +0 -1
  382. package/app/dist/client/assets/hosting-BBHUppH-.js +0 -1
  383. package/app/dist/client/assets/import-B92fd4Tl.js +0 -1
  384. package/app/dist/client/assets/inbox-57oGZtxE.js +0 -1
  385. package/app/dist/client/assets/inbox-B2AMNtk5.js +0 -1
  386. package/app/dist/client/assets/index-Bn3XeKy8.js +0 -10
  387. package/app/dist/client/assets/kit-BsK6VZTQ.js +0 -1
  388. package/app/dist/client/assets/lazyRouteComponent-Uri98HNq.js +0 -1
  389. package/app/dist/client/assets/motion-C8lNeYvK.js +0 -1
  390. package/app/dist/client/assets/people-ISOMYCTu.js +0 -1
  391. package/app/dist/client/assets/permissions-Cenat84K.js +0 -2
  392. package/app/dist/client/assets/permissions-grid-B2GtGwzv.js +0 -1
  393. package/app/dist/client/assets/route-BP1XwaTB.js +0 -1
  394. package/app/dist/client/assets/route-KVU6QgwJ.js +0 -1
  395. package/app/dist/client/assets/runs-table-35lNzKLn.js +0 -1
  396. package/app/dist/client/assets/scenario-DSwsavxS.js +0 -1
  397. package/app/dist/client/assets/scenario-graph-CAzWOtqV.js +0 -1
  398. package/app/dist/client/assets/separator-BlwkzEY0.js +0 -1
  399. package/app/dist/client/assets/site-icon-DZvOfBvU.js +0 -1
  400. package/app/dist/client/assets/sites.index-CcNo6N8u.js +0 -1
  401. package/app/dist/client/assets/spinner-BGy6LWIW.js +0 -1
  402. package/app/dist/client/assets/start-form-Bgo9I63s.js +0 -1
  403. package/app/dist/client/assets/store-BGu0d2Ld.js +0 -57
  404. package/app/dist/client/assets/style-CCDLLPgG.css +0 -2
  405. package/app/dist/client/assets/table-DjbI5VTn.js +0 -1
  406. package/app/dist/client/assets/textarea-DXO0eUdp.js +0 -1
  407. package/app/dist/client/assets/useOpenInteractionType-Bin8RjM5.js +0 -1
  408. package/app/dist/client/assets/useRegisterFieldControl-CQPTOU7Z.js +0 -1
  409. package/app/dist/client/assets/useValueChanged-DMkuvFZG.js +0 -1
  410. package/app/dist/client/assets/utils-CMsCvwYQ.js +0 -1
  411. package/app/dist/client/assets/who-are-you-Bt1WI3Cz.js +0 -1
  412. package/app/dist/client/assets/workflow-BJpO61A-.js +0 -1
  413. package/app/dist/client/assets/workflow-view-DP-UlRiH.js +0 -1
  414. package/app/dist/client/assets/workflows-BLCBgxbx.js +0 -1
  415. package/app/dist/server/assets/app-chrome-BYS81Vnx.js +0 -1410
  416. package/app/dist/server/assets/native-select-DLa-He0n.js +0 -37
  417. package/app/dist/server/assets/utils-wksS9pYh.js +0 -138
package/README.md CHANGED
@@ -230,6 +230,8 @@ With `PORT` set, as a container host sets it, `sanoma worker` runs its worker un
230
230
  - `GET /wake`: a [wakeup](workflows/README.md#hosts)'s wake, handed to the supervisor (resume if stopped); 204, never cached.
231
231
  - `GET /__sanoma/app-bundle?revision=<commit>` with `Authorization: Bearer <SANOMA_WAKEUP_TOKEN>`: the app bundle the Cloudflare host's Worker script runs at that commit (`AppBundle`, from `buildAppBundle` in `sanoma/app/bundle`, each public site's domain from `SANOMA_DOMAINS`), built on the first ask, one revision at a time, in a checkout of its own beside the worker's, made and installed as the start makes its own (`SANOMA_CHECKOUT`, the image's `sanoma-checkout`), and built by that checkout's own `sanoma`, the checkout removed after. 202 while it builds, then 200 with the bundle as JSON, kept in a file beside the checkout for the process's lifetime; a failed build 500 with why, once, the next ask building again. Every answer is JSON, `no-store`, marked `x-sanoma-app-bundle`; another token is a 401, a revision that is not a commit id a 400.
232
232
 
233
+ On a host that starts the process again on a wake, whose wake route its environment names (`SANOMA_HOST_URL` and `SANOMA_WAKEUP_TOKEN`, as the Cloudflare host gives them), being done means ending: once its worker stopped itself and no app bundle is building, the port closes and the process exits 0, as on SIGTERM, and the container ends with it. A wake before that wins, and a fresh worker starts; one after it finds the port closed, and the host starts a fresh process. A build that ends while the worker is stopped starts a fresh one, which ends the process on its own check. Elsewhere (loopback, no wake route, `sanoma serve`) the process stays up.
234
+
233
235
  Without `PORT`, it listens on nothing and its worker never stops itself: nothing in its process would start it again.
234
236
 
235
237
  ### Cloning a private repository
package/app/README.md CHANGED
@@ -445,7 +445,7 @@ A workflow's Graph and Code, and a run's graph, Ledger and Code, are one view: c
445
445
  - **Changes** (`/changes`, in the bar after Inbox when the repository has a remote): the changes sent for review from a chat's draft card (**Send for review**, offered once the draft has a commit and its checks pass), each draft's latest, newest first, **Open** and **Done** as pill tabs (`?show=`), each row its title, where it is, how many files it edits, its pull request and when it last moved. A change's page (`/changes/<id>`) shows where it is ("Waiting for admin", Published, Closed), its branch at the head it last planned, its pull request and its run; what changed, by kind (policies, people, resources, workflows, sites, each app's); who may do what, the Permissions grid of `main` against the branch's, each changed cell with its before and after; and, floating, Publish: the policy's answer, the checks, and once merged the merge commit and the deploy, with **Publish** and **Reject** while it waits. Publish is also the change's approval in the Inbox, with the change linked. How a change runs is the [runtime's](../workflows/README.md#changes).
446
446
  - **Workflows** (`/workflows`): the home, the window's full width. Its header says how many workflows the app has and the config's version (cut short, the whole of it in its tooltip), with **New workflow**, which opens the chat on a new chat with "Make a workflow that " in its composer for you to finish; a notice says so when the repo's policies do not hold, as they then refuse every call and start. Pill tabs, each its own URL with how many it holds, pick the rows (`?filter=`): **All**, **Waiting on you** (runs waiting on an approval you may decide), **Failed last run** and **Built-in**; the last tab is **All runs**. While the workflows are in more than one folder, a second row of tabs, **All**, **Yours** (the root's, the built-ins among them) and one per app (`?app=`), picks a folder, and the table puts each folder's under its heading, as Data does. Under them, one card: a box that finds a workflow by its title or name as you type, over a table of every workflow in the config, those whose runs wait on an approval you may decide first (badged with how many), then by their last run: its title (linking to its page), its name, built-in for the built-in `drift` (which starts like any other, with no input), how it starts (by hand, or the cron it runs on and its time zone), the vendors its operations call, in order of title, its last run's status and when, and how many approvals its runs wait on, on anyone. What it may call, its built-ins, its input and its outline are on its page. **All runs** (`?view=runs`) lists the latest 50 runs of every workflow, newest first: each with its workflow (linking to the run's page under its workflow, the run's id as its tooltip), a sandbox run's badge, its status, who started it and when, how many approvals it waits on, and a failed run's error. Its **Status** menu shows only the runs with that status, the latest 50 however old, kept in the URL as `?status=`; `?workflow=<name>` shows only that workflow's, named beside the menu with a button that removes it. The table refreshes as a workflow's Runs tab does. **New workflow** opens a dialog saying how to add one to the repo (a file under `workflows/`, listed in `sanoma.config.ts`, which the app shows once it restarts); drafting one from a description is coming.
447
447
  - **People** (`/people`): who may act, as the data files declare them (`sanoma.person`, `.agent` and `.group`), with how many people beside the title, and the tabs **People**, **Groups** and **Agents** (`?show=`), each with how many. The problems with a declaration of theirs, or in a file that declares them, show above the table (their resources are left out, and nobody is admitted while there are any). People lists each person's name, email (`none` without one), groups (written on each group, read back by its members), how they sign in (an email code to their email, their GitHub login, or that they cannot) and when they last signed in and how (`Never` until they do), from the ledger; Agents lists each one's name, whom it acts for, its groups (also `agents`, muted and marked built in, the group the runtime puts every agent in) and the declaration, which opens in its file on Hosting; Groups lists each group's members, then, while there are agents, the built-in `agents` with them. A row opens over the list (`?person=<id>`, a group's name) with its file and export (opening it on Hosting) and its declaration's form (below): its fields from the type's schema, as declared, its id (a group's name) read-only, as the policy and the groups name it, and a group's members read-only, since they name declared people. On a host, each person's row, and their open card, has **Invite link** (only someone in `admin` makes one, and only for someone with an email declared; otherwise it is disabled and says why), which mints a one-use link that signs them in and shows it in a card, **Invite link for <name>**, with **Copy**, to send them however you like; a new link replaces their last.
448
- - **Hosting** (`/hosting`): where the company runs, then the rest of what the data files declare at vendors. On top, a card per slot: Repository, Database, Host, Wakeup and Agent box (the sandbox the coding agents' boxes are opened in), each the declared resource whose type meets that contract (`resourceTypes[].capabilities`; the repository is the one the host clones), with its name, type, its plain declared fields, its binding and the latest drift verdict (with the fields that differ, and Adopt), the host's with where the last apply that made it says it answers and how it stays up, from its type (`resourceTypes[].host.lifetime`): Always on, or Stops when quiet, what is due while it sleeps started by the Wakeup, or, with no Wakeup declared, a notice that none wakes it, so going live declares none and the host stays up. For a host that derives (`cloudflare.host`), its card also shows, read-only, what apply gives it (`hostDerived`, by `deriveHosts` as apply runs it, nothing minted): the runtime image, the repository and branch it runs, the public sites' domains it attaches, and each key it is given, stored or not and since when: `SANOMA_SIGNING_KEY` (or, when the config binds none, the host's own, `SANOMA_HOST_SIGNING_KEY`, generated into the store at its create), `SANOMA_SECRETS_KEY` with the built-in store, `SANOMA_SOURCE_KEY` and the wakeup's token; never a value. The agent box's card says whether each key its connector takes is set, with a link to the connector page where it is; a live instance that declares no sandbox says what to declare instead, since its coding agents refuse to run without one. While no host and no database are declared, and while going live has bound its repository but not yet its host (`resources/sanoma/infra.ts`), going live's steps show above them (**Go live**, below). Under them, **Other resources**: each other resource the data files declare (people are on People, collections on Data; its name, type and vendor, the declaration it comes from, which opens in its file below the table, marked, and the vendor object the lockfile binds it to, its id cut short), with the latest drift check's verdict: clean, drifted (with each field that differs, as declared and as the vendor holds it, shown under its row), gone, absent (not bound yet, and whether its identity found an object), error (and why), or not checked. Bindings in the lockfile that no data file declares are listed under the table, each with its key, type and id: apply asks whether to forget each or delete its object. **Apply** starts the built-in `apply` workflow on every declaration, and goes to its run; the config registers it beside drift. Apply holds its plan for a person: wherever an approval's details carry one, the Inbox and the run show it as the change view: problems in the data files, each change to the lockfile apply did not make in plain words ("points store at a different project: abcdefgh… → wxyzabcd…"), then the steps by action: creates with their planned fields (what the vendor fills in is "known after apply"), updates and replaces with the fields that differ (and, for a replace, the fields that cannot change in place), binds (found by identity, or given), gone objects and orphaned bindings with the question each asks, and the unchanged, folded. Each drifted field has **Adopt**, which writes the value the vendor holds, as that check's report has it, into the data file (`setFields`: only that declaration changes), commits it when the worker is given a `source` (the company's repository; without one it only writes the file), as an `adopt` run in the worker, and starts a drift check, which reads the file as it now is. A declaration's literal fields are written from a form too: **Edit**, beside the file a declared resource opens in (`?edit`), and a row of People open, draw the declaration's form (`components/declaration-form.tsx`): its type's schema's fields (less those only the vendor sets or never reads back), as the data file declares them, a field that names another declared resource and a person's, agent's or group's identity read-only. **Save** sends the fields you changed (a `patch` run, `{ at: { file, export }, fields }`, for a declaration the description names: a resource, a collection, a site or an app; it sets fields and removes none, so an emptied one is refused on the form) through the same writer, which parses the file and changes literals only: a field the file computes (a name or reference, a call, a spread) or a declaration that is no object literal is refused with the writer's reason (`invalid_input`, with the `field`), which the form shows under that field, read-only from then on, and stays the code's to change. Under the form, where it landed: **Saved as a change**, linking to its review, or saved to the file and the commit; a refusal (a 403) shows its reason. The form shows the declaration as the files hold it: the app makes its description again on the next request once a file it loaded changes (`liveDescription`), and a Save or an Adopt reads the config again, so what was saved shows on People, Hosting and Data at once. Where a Save lands: when the repository drafts and its remote has a connector's remote half, it is a change (**Changes**, above): the fields set in a draft of its own, `ui-<8 hex>`, committed there as you ("Change <fields> of <export>") and sent for review, the answer being the change's run, whose page is `/changes/<id>`; a change to the rules (a people file) waits for `admin` as any change to them does. Without a remote it is written and committed in the checkout as Adopt is, a people file (or a file one imports) only by someone in `admin` (403 for anyone else, since nothing would review it). Adopt and Save write the checkout one at a time. **Run drift** starts the built-in `drift` workflow, which reads the data files as they are then; the page reads the drift runs as a workflow's Runs tab does, every 2 seconds, links to the latest run, and shows the report of the latest that finished. Problems in the data files show under the tables, each at its file, line and column, since their resources are left out: those the app found when it started, and any the last check found. The declared list is the description's, made again once a data file, the lockfile or a folder they are in changes, so a declaration written since opens without a restart; the public sites' hosts and logins stay as the app started.
448
+ - **Hosting** (`/hosting`): where the company runs, then the rest of what the data files declare at vendors. On top, a card per slot: Repository, Database, Host, Wakeup and Agent box (the sandbox the coding agents' boxes are opened in), each the declared resource whose type meets that contract (`resourceTypes[].capabilities`; the repository is the one the host clones), with its name, type, its plain declared fields, its binding and the latest drift verdict (with the fields that differ, and Adopt), the host's with where the last apply that made it says it answers and how it stays up, from its type (`resourceTypes[].host.lifetime`): Always on, or Stops when idle, what is due while it sleeps started by the Wakeup, or, with no Wakeup declared, a notice that none wakes it, so going live declares none and the host stays up. For a host that derives (`cloudflare.host`), its card also shows, read-only, what apply gives it (`hostDerived`, by `deriveHosts` as apply runs it, nothing minted): the runtime image, the repository and branch it runs, the public sites' domains it attaches, and each key it is given, stored or not and since when: `SANOMA_SIGNING_KEY` (or, when the config binds none, the host's own, `SANOMA_HOST_SIGNING_KEY`, generated into the store at its create), `SANOMA_SECRETS_KEY` with the built-in store, `SANOMA_SOURCE_KEY` and the wakeup's token; never a value. The agent box's card says whether each key its connector takes is set, with a link to the connector page where it is; a live instance that declares no sandbox says what to declare instead, since its coding agents refuse to run without one. While no host and no database are declared, and while going live has bound its repository but not yet its host (`resources/sanoma/infra.ts`), going live's steps show above them (**Go live**, below). Under them, **Other resources**: each other resource the data files declare (people are on People, collections on Data; its name, type and vendor, the declaration it comes from, which opens in its file below the table, marked, and the vendor object the lockfile binds it to, its id cut short), with the latest drift check's verdict: clean, drifted (with each field that differs, as declared and as the vendor holds it, shown under its row), gone, absent (not bound yet, and whether its identity found an object), error (and why), or not checked. Bindings in the lockfile that no data file declares are listed under the table, each with its key, type and id: apply asks whether to forget each or delete its object. **Apply** starts the built-in `apply` workflow on every declaration, and goes to its run; the config registers it beside drift. Apply holds its plan for a person: wherever an approval's details carry one, the Inbox and the run show it as the change view: problems in the data files, each change to the lockfile apply did not make in plain words ("points store at a different project: abcdefgh… → wxyzabcd…"), then the steps by action: creates with their planned fields (what the vendor fills in is "known after apply"), updates and replaces with the fields that differ (and, for a replace, the fields that cannot change in place), binds (found by identity, or given), gone objects and orphaned bindings with the question each asks, and the unchanged, folded. Each drifted field has **Adopt**, which writes the value the vendor holds, as that check's report has it, into the data file (`setFields`: only that declaration changes), commits it when the worker is given a `source` (the company's repository; without one it only writes the file), as an `adopt` run in the worker, and starts a drift check, which reads the file as it now is. A declaration's literal fields are written from a form too: **Edit**, beside the file a declared resource opens in (`?edit`), and a row of People open, draw the declaration's form (`components/declaration-form.tsx`): its type's schema's fields (less those only the vendor sets or never reads back), as the data file declares them, a field that names another declared resource and a person's, agent's or group's identity read-only. **Save** sends the fields you changed (a `patch` run, `{ at: { file, export }, fields }`, for a declaration the description names: a resource, a collection, a site or an app; it sets fields and removes none, so an emptied one is refused on the form) through the same writer, which parses the file and changes literals only: a field the file computes (a name or reference, a call, a spread) or a declaration that is no object literal is refused with the writer's reason (`invalid_input`, with the `field`), which the form shows under that field, read-only from then on, and stays the code's to change. Under the form, where it landed: **Saved as a change**, linking to its review, or saved to the file and the commit; a refusal (a 403) shows its reason. The form shows the declaration as the files hold it: the app makes its description again on the next request once a file it loaded changes (`liveDescription`), and a Save or an Adopt reads the config again, so what was saved shows on People, Hosting and Data at once. Where a Save lands: when the repository drafts and its remote has a connector's remote half, it is a change (**Changes**, above): the fields set in a draft of its own, `ui-<8 hex>`, committed there as you ("Change <fields> of <export>") and sent for review, the answer being the change's run, whose page is `/changes/<id>`; a change to the rules (a people file) waits for `admin` as any change to them does. Without a remote it is written and committed in the checkout as Adopt is, a people file (or a file one imports) only by someone in `admin` (403 for anyone else, since nothing would review it). Adopt and Save write the checkout one at a time. **Run drift** starts the built-in `drift` workflow, which reads the data files as they are then; the page reads the drift runs as a workflow's Runs tab does, every 2 seconds, links to the latest run, and shows the report of the latest that finished. Problems in the data files show under the tables, each at its file, line and column, since their resources are left out: those the app found when it started, and any the last check found. The declared list is the description's, made again once a data file, the lockfile or a folder they are in changes, so a declaration written since opens without a restart; the public sites' hosts and logins stay as the app started.
449
449
  - **Data** (`/data`): the config's collections, with how many beside the title, in a table: each one's title and name, the field it is found by, its fields, the workflows that save it (**Written by**), the sites that call it (**Shown on**) and the file that declares it (opening its declaration on Hosting), a row opening its grid. While they are declared in more than one folder, the rows are grouped by it, the root's first (**Yours**), then each app's with its folder and source, and tabs above the card show All or one folder's (`?app=<name>`, `?app=.` for the root's), with how many each. How many records each holds is not shown yet. **A collection** (`/data/<name>`) is its records in a grid you edit in place, the page's full width: a column per field, in the collection's order, then when each record was saved and by whom. Click or arrow to a cell (Shift and an arrow, or a drag, selects a range; Cmd/Ctrl+C copies it, tab-separated, for a spreadsheet), type or press Enter to change it, Enter to save it, Esc to cancel, Tab to save and move right: text and numbers in an input, a date in a date input, yes/no a checkbox, an enum's values and the declared people a menu. An edit shows at once and is one save of that record, made over the record as the edit found it (`ifRecord`); a record's edits, the form's too, are saved one after another, each over the one before, and a toast offers **Undo**, which puts that field back. A save the policy denies says why and the cell goes back to the record as it is; one it holds shows the record as it is stored, marked with a hollow dot, **waits for approval**, until its `call` run ends. A record someone changed since the grid read it is a conflict, never overwritten: the cell turns orange with what you typed, and a row under it says what is there now (who set what, and when, when the runtime says) with **Keep theirs** and **Use mine**. **Paste** a range (Cmd/Ctrl+V, tab-separated as Excel and Sheets copy one, quoted cells too) from the cell you are on, over the rows there and as new records past the last (each new record's key from the pasted column that lands on the key, else one to type before Save), or one value into every selected cell; drag the **fill handle**, at the selection's bottom-right corner, down to repeat its values; type into a selection to set every cell in it; **Delete** clears the selected cells, and deletes the records whose key is among them; **Shift+Enter** adds a record below the rows. Each value is read as its field reads it, so a number column gets numbers and an enum one of its values. None of these saves: they are staged as one change, its cells tinted with a bar at their left, new rows green, deleted ones struck, a cell its field cannot read (or a new record's missing key or field) in red, and a bar above the footer counts them ("6 changes in 3 records · from your paste: …") with **Review**, **Discard** and **Save as one change**; Cmd/Ctrl+Z takes back the last step, and while a change is staged an edit of a cell is a step of it, and the record form, the filters, the sort and the key links wait for it ("Save or discard the staged changes first"), as does leaving the page. **Review** lists each record's changed fields, as they were and as staged, the cells to fix first, and **Save n now**, which saves the records ready and leaves the rest staged. Save reads the records again first: one changed since it was staged is a conflict to settle, per cell, before anything is sent. Then the change is one call, `data.<name>.saveMany`, all or nothing, the policy deciding each record and the ledger recording each, in one run: a conflict it finds keeps the change to settle; a denial drops the records it refused, marked **refused**, and keeps the rest; a hold says the change **waits for approval**, linking to its run, and marks its records; any other failure saves nothing and keeps the change staged. The footer says how many records match, when you last saved, and the cell you are on; **Export CSV** downloads the grid as shown. Drag a heading's edge to widen its column (kept per collection in this browser). A field's heading sorts by it, ascending, then descending, then by key again (`?order=`, `-` for descending); above the grid, **<key> starts with** keeps the records whose key starts with what you type (`?key=`), each enum field has a menu of its values (`?where=`), **Fields** hides some (`?hide=`, said by a chip that shows them again), and **Show at most** sets how many it reads, 100 at first, up to 1000 (`?limit=`); it says so when there may be more. **Columns**: each field's heading but the key's has a menu: **Rename**, **Change type**, **Hide column** (`?hide=`), on a free-form field each key its records hold with how many, to make a column of (**Convert to column**), and **Remove column**; **+** after the last heading, or **New column** under **Fields**, opens the New column panel. Each opens a panel beside the grid (`?column=`) with what it takes (a name; a type of the chips Text, Number, Yes / no, Date, A person, A choice with its choices one per line, and Link to another table and Free-form, which arrive with real tables; Optional) and **What will happen** in plain words, drafted over the records on screen; **Review the change** proposes it (`proposeColumnChangeFn`): the collection's declaration in `resources/data.ts` edited by a `patch` run as a form's Save is (a rename renames the field, a removal leaves the records' values where they are), landed as a change for review that carries its plan, or, with no remote, written and committed. A table change's page reviews it in its words: a card per change (**Safe**; **Needs a decision**, with the records that won't convert, a sample and two choices; **Keeps the data**), **Try it first** (a copy, once previews land), **The details** (the declaration's lines, and what runs on the database: nothing until the runtime plans the change), **Approve and apply** and **Send back** for its Publish and Reject, and **Couldn't apply this change · Nothing changed** over a run that failed. The plan is the app's draft (`planOf` in `components/grid/plan.ts`) until the runtime plans a table change itself; and since repository writes answer 501 on the Cloudflare Worker, columns change from a laptop first. A record saved before its fields changed, which they now refuse, is badged **needs fixing**, what they refuse in its tooltip. **Add record**, or a record's key (or Space on its row), opens the record form beside the grid (`?new`, `?record=<key>`), drawn from the collection's fields as a start form is from a workflow's input: text, a number, yes/no, a choice for an enum, a date input for a date (one a workflow saved with a time shows as a date and time), and a person as their id, a new record's people starting as you; an edit's key cannot change. **Save** saves it (an edit over the record as the form read it, so one someone changed since is refused), and **Delete**, once confirmed, deletes it. The grid and the form change one copy of the records in the browser (a TanStack DB collection over the page's read of them), so each shows the other's change at once, without reading the records again. Every read and change is the collection's operation (`data.<name>.list`, `.save`, `.delete`) called through `api` as you, so the policy decides each and a save or a delete is in the ledger: a denial shows on the form; a call the policy holds for an approval says **Held for approval**, linking to its run of the built-in `call` workflow (`/workflows/call/runs/<runId>`), which makes it once approved in the Inbox; what the fields refuse shows under them. Under an open record's form, **History · from the ledger** lists its saves and deletes, newest first, each with when, who (a workflow's run by the workflow's name), the fields it changed (before → after; the first save says **created**) and a link to its run but for a direct call's, which has no page yet: read from the ledger by the record's target (`SanomaClient.history`), and only for someone the policy lets `get` the record, since the ledger holds its values (its latest 500 calls, reads among them: it says so when older changes are not shown); a saved toast's key opens it there. The header names the collection, its operations' prefix and where `resources/data.ts` declares it (opening it on Hosting), and **Used by** lists the workflows whose `uses` name one of its operations, then the sites' pages that read or write it, as a workflow's page lists those that call it. **Import** (`/data/<name>/import`, Data / the collection / Import) brings a sheet in, in three steps, each its own URL (`?step=match`, `?step=review`): **Upload** takes a CSV file, chosen or dropped (its first row names the columns; RFC 4180, so quoted cells with commas, quotes or line breaks read whole), and shows its first rows; **Match columns** has a select per column, matched to the field of its name (each field once, the key marked), **Skip**, and for a column no field is named for, a new field to add first (the collection's columns change through the file, not here, yet); a column whose values its field does not take as written lists each with how many rows hold it and what it stands for: an enum's value, a declared person (a name or an email guessed as that person; while nobody is declared, any id is taken as written), left out (filling nothing: a new record's field stays empty, an update keeps the record's), or **Fix first**; under them, the rows the fields would still refuse, by row and why. **Review** reads the records the sheet's keys have, as you, and counts the rows, the new records, the updates, the unchanged and those with problems, over a table of what each row will do: **add**, **update** (a changed field showing what it **was**), **unchanged**, or **fix first**, with why. **Add n, update m** starts a run of the built-in `import` (`sanoma/workflows`' [Importing a sheet](../workflows/README.md#importing-a-sheet)) as you and opens it: the policy decides each save, a denied row is left as a problem, a held batch waits in the Inbox, and the run's output lists what it added, updated and left. A workbook (`.xlsx`) is refused with how to save it as CSV: reading one in the browser would add a 930 kB library.
450
450
 
451
451
  ![A collection's grid: the outbound leads sorted by stage, a record open in the form beside it](https://github.com/Sanoma-AI/sanoma/raw/main/.github/assets/data.png)
@@ -459,7 +459,7 @@ A workflow's Graph and Code, and a run's graph, Ledger and Code, are one view: c
459
459
 
460
460
  Named authentication uses the connection forms below. A connector that still declares only an `env` schema retains its separate credential fields; those are not account selectors. Named connections never gain an environment-first fallback or process-wide credential swapping.
461
461
 
462
- The screens share one shell: down the left, the bar, and beside it the chat column, then the page. The bar has **Chat** first, then the sections and the sites' tiles in their groups, each an icon in a tile with its label under it, the current one filled (Inbox badged with how many approvals are pending), and at its foot the menu under your initials. **Chat** folds the chat column away and opens it again, and the app opens it as you left it on your next visit (it keeps that in a cookie, `sanoma_chat`, so the server renders the page with it open or folded from the first paint); until then it is open where it sits beside the page and folded where it would lie over it. The column is your chat with the agent: your latest chat (the others, and **New chat**, at its top), your messages at the right, its replies under them with the steps it took as a checked list, and at its foot the composer, carrying the page you are on. The agent edits only a draft of its own, a branch `draft/<chat>` it opens at its first edit and commits to as it goes, and runs the checks there; its reply ends with the draft's card (the branch, what changes, the checks) and you apply it by merging the branch (the live instance runs the old code until it restarts). It takes an app into the draft with `take_app`, a git merge of the source repository (an `https` URL) whose `apps/<name>/` lands as the company's, every other file staying the company's but `package.json`, which gets the source's beside its own, and updates one with `update_app`, a merge of the new commits of the source its `app.ts` names, as far as they touch `apps/<name>/` and `package.json`; a file git cannot merge is committed with its conflict markers, which the agent resolves before the checks pass ([Apps](../workflows/README.md#apps)). `takeAppPrompt` and `updateAppPrompt` (`src/lib/apps.ts`) are what the Apps page's Add and Update put in the chat. A lookup the policy holds shows its approval's card in the reply (or who it waits for, with the Inbox's link), and the turn goes on once it is decided. The chat is kept in the company's database: a restart loses the turn under way, not the chat or the draft, and **Continue** picks up. The model is the first connector with a model half, its default; without its key, the reply says so with a link to its connector page. A new chat's composer picks its engine, which the chat keeps and names at its top: **Sanoma** (our own loop, the default), or an existing coding agent on the company's Anthropic key, **Pi** or **Claude Code**, driven through the AI SDK's `HarnessAgent` in the person's box, one per person per company, kept across restarts: in the sandbox the company declares (one `agent37.instance` in a data file, which going live writes into `resources/sanoma/infra.ts` once Agent37's key is stored), each box an Agent37 instance its connector opens, else, on this computer, a directory of its own (`.sanoma/agent-home/boxes/<box>`); a live instance that declares none refuses the coding agents, the reply saying what to declare, so no agent ever runs inside the live instance. Each turn opens the box, brings the chat's draft into the box's clone (`repo/`) as a git bundle, which carries commits and the branch alone (no remote, no token, no secret of the company's), and runs `pnpm install --frozen-lockfile --ignore-scripts` there with the box's own pnpm (never the one a `packageManager` field names) on the first turn and whenever the lockfile changed, so the box keeps a second `node_modules` of its own. A coding agent reads the repository's `AGENTS.md` itself; its file edits are allowed inside the clone and refused outside it (by their real paths in the box, where the files are) or under `.git` or `node_modules`, its shell commands are refused, each with the reason shown as a refused step (so taking or updating an app is the Sanoma engine's) (Claude Code reads files itself, as this machine's user: only its edits and commands ask); at the end of its turn its edits are committed in the clone as the person, brought back to the draft as a bundle and checked there. One turn runs in a box at a time: a second, from another of the person's chats, is refused until the first ends; a box that fails mid-turn loses that turn's edits, and says so. Claude Code's first turn in a box installs it under the box's home (about 760 MB, 40 s), which needs pnpm 11 and bash on the `PATH`; its bridge listens on all interfaces, guarded by a token, so keep that port behind a firewall. Under **Your own plan**, the composer offers a person's own coding agent, on their own subscription, driven over the Agent Client Protocol by the app's own client in the person's box, on its clone of the chat's draft: **Copilot**, **OpenCode** (its free models need no sign-in), **Pi**, **Claude Code** and **Codex**. A person's own agent spends that person's plan under their vendor's terms, which Sanoma neither checks nor changes. The agent runs in the person's box (on a laptop, a directory of this machine) with an environment of its own: its `HOME` is `.acp` in that box (`.sanoma/agent-home/boxes/<box>/.acp`, kept across restarts), so a sign-in is kept for that person and never the company's (every person's agent runs as this machine's user, so on an instance several people share, what an agent runs itself can reach another person's sign-in), and none of the app's or this machine's credentials reach it (no token variables; `gh`, `security` and the browser openers refuse on its `PATH`). Its first turn on a machine installs it there (`.acp/<agent>`) with the pnpm on the `PATH` (the desktop shell ships its own), in 10 to 45 s and 150 to 340 MB each. So `.sanoma/agent-home/boxes` holds a box for each person of the company: its home is Pi's and Claude Code's on the company's key (whose session's files are the clone's and that home's only, never its `.acp`; Claude Code's own reads and the commands a bridge runs are this machine's user's), and its `.acp` the person's own agents' (their `HOME`, installs and sign-ins, given only to that person's agents). The `harness`, `acp` and `people` directories of earlier versions are no longer read: delete them by hand. When the vendor asks the person to sign in, the reply is a sign-in card: the vendor's link and code (Copilot's and Codex's device flows), with a field for a code the vendor asks to have pasted back (Claude Code's), or, for Pi, whose sign-in needs a real terminal, the command to run once on this computer; the app opens no link and enters no code, the card keeps neither once it ends, and after signing in the person sends the message again. The agent's requests to read or edit a file are allowed inside the clone and refused outside it or under `.git` or `node_modules`, as are its requests to run a command and anything else it asks for, each with the reason as a refused step (it is never given an always-allow); the files it reads and writes through the app are the clone's only. What it runs in the app's terminal, and what its own tools do without asking (OpenCode edits and runs commands inside the clone without asking), are its own: the commit brought back to the draft and its checks, at the end of the turn, are the gate. From 1024 px wide the column sits beside the page; narrower, it lies over the page; on a phone (under 768 px) there is none, and the bar is a sheet over the page, opened from the menu button atop it, that closes as you follow a link or tap beside it. Each page starts with its title, with what it counts beside it and the pages above it as links (Workflows, then the workflow's title, on a run's page), its actions at the end of the row; then, on a page with views, pill tabs, each a URL; then one card. What you open from a list, an approval, a run, a scenario or a graph's node, floats over the card's right in a card of its own, and sits above the list (under a graph) while the page's card is too narrow. **Density**, in the menu at the bar's foot under the theme, switches the page to **Compact**, a tighter density for people who live in the app: the page a quarter tighter in every padding, gap and control (its icons too; the text keeps its size), half the gap between a page's regions, a lower graph card and source (a floating card keeps its width). The browser remembers the density in a cookie (`sanoma_density`), so the server renders the page in it from the first paint. The menu at the bar's foot, under your initials, has who you are (and Change name, under the default resolver), the theme (light, dark or the system's, which the browser remembers) and the density. Inside the [desktop app](../../desktop/README.md)'s window it also lists the companies open there, this one checked: choosing another switches the window to it, and **Add company…** shows the desktop app's start screen (`src/lib/desktop.ts`, over the `window.sanomaDesktop` the desktop app gives the page; in a browser there is none, and the menu has no Companies). The screens are built with [shadcn/ui](https://ui.shadcn.com) components (`src/components/ui`, from `components.json`) on Tailwind CSS, in the theme `src/style.css` holds: Sanoma's palette in light and dark, IBM Plex Sans and Mono (Fraunces for display), and 28 px controls.
462
+ The screens share one shell: down the left, the bar, and beside it the chat column, then the page. The bar has **Chat** first, then the sections and the sites' tiles in their groups, each an icon in a tile with its label under it, the current one filled (Inbox badged with how many approvals are pending), and at its foot the menu under your initials. **Chat** folds the chat column away and opens it again, and the app opens it as you left it on your next visit (it keeps that in a cookie, `sanoma_chat`, so the server renders the page with it open or folded from the first paint); until then it is open where it sits beside the page and folded where it would lie over it. The column is your chat with the agent: your latest chat (the others, and **New chat**, at its top), your messages at the right, its replies under them with the steps it took as a checked list, and at its foot the composer, carrying the page you are on. Until the agent is connected (our loop without its model's key, and no engine chosen), a new chat shows **Connect your agent**: **Your Claude plan** (recommended; **Sign in with Claude** starts Claude Code's sign-in at once), **Your ChatGPT plan** through Codex (on a live instance **An OpenAI API key**, not offered yet, since OpenAI's plan sign-in is this computer's), **An API key** (the Anthropic connector's page) and **More agents** (Copilot, OpenCode, Pi); **Agent…** in the menu at the bar's foot shows them again. The engine chosen there or in the composer is the one your new chats open on, kept in a cookie (`sanoma_engine`). Once it is connected, the agent speaks first in your first chat (titled Getting started): who it is, what it read in the company (its workflows, connectors and people) and a few suggested asks, each a button that sends it in the chat; after a sign-in it asked for, it speaks once that is done. A reply that ends with suggested asks (after a change, two next ones) shows them the same way, never as text. The agent edits only a draft of its own, a branch `draft/<chat>` it opens at its first edit and commits to as it goes, and runs the checks there; its reply ends with the draft's card (the branch, what changes, the checks) and you apply it by merging the branch (the live instance runs the old code until it restarts). It takes an app into the draft with `take_app`, a git merge of the source repository (an `https` URL) whose `apps/<name>/` lands as the company's, every other file staying the company's but `package.json`, which gets the source's beside its own, and updates one with `update_app`, a merge of the new commits of the source its `app.ts` names, as far as they touch `apps/<name>/` and `package.json`; a file git cannot merge is committed with its conflict markers, which the agent resolves before the checks pass ([Apps](../workflows/README.md#apps)). `takeAppPrompt` and `updateAppPrompt` (`src/lib/apps.ts`) are what the Apps page's Add and Update put in the chat. A lookup the policy holds shows its approval's card in the reply (or who it waits for, with the Inbox's link), and the turn goes on once it is decided. The chat is kept in the company's database: a restart loses the turn under way, not the chat or the draft, and **Continue** picks up. The model is the first connector with a model half, its default; without its key, the reply says so with a link to its connector page. A new chat's composer picks its engine, each with its mark (a coding agent's from its connector), which the chat keeps, the agent with the account it runs on, and names at its top: **Sanoma** (our own loop, the default), or an existing coding agent on the company's Anthropic key, **Pi** or **Claude Code**, driven through the AI SDK's `HarnessAgent` in the person's box, one per person per company, kept across restarts: in the sandbox the company declares (one `agent37.instance` in a data file, which going live writes into `resources/sanoma/infra.ts` once Agent37's key is stored), each box an Agent37 instance its connector opens, else, on this computer, a directory of its own (`.sanoma/agent-home/boxes/<box>`); a live instance that declares none refuses the coding agents, the reply saying what to declare, so no agent ever runs inside the live instance. Each turn opens the box, brings the chat's draft into the box's clone (`repo/`) as a git bundle, which carries commits and the branch alone (no remote, no token, no secret of the company's), and runs `pnpm install --frozen-lockfile --ignore-scripts` there with the box's own pnpm (never the one a `packageManager` field names) on the first turn and whenever the lockfile changed, so the box keeps a second `node_modules` of its own. A coding agent reads the repository's `AGENTS.md` itself; its file edits are allowed inside the clone and refused outside it (by their real paths in the box, where the files are) or under `.git` or `node_modules`, its shell commands are refused, each with the reason shown as a refused step (so taking or updating an app is the Sanoma engine's) (Claude Code reads files itself, as this machine's user: only its edits and commands ask); at the end of its turn its edits are committed in the clone as the person, brought back to the draft as a bundle and checked there. One turn runs in a box at a time: a second, from another of the person's chats, is refused until the first ends; a box that fails mid-turn loses that turn's edits, and says so. Claude Code's first turn in a box installs it under the box's home (about 760 MB, 40 s), which needs pnpm 11 and bash on the `PATH`; its bridge listens on all interfaces, guarded by a token, so keep that port behind a firewall. Under **Your own plan**, the composer offers a person's own coding agent, on their own subscription, driven over the Agent Client Protocol by the app's own client in the person's box, on its clone of the chat's draft: **Copilot**, **OpenCode** (its free models need no sign-in), **Pi**, **Claude Code** and **Codex**, as far as their connectors are installed. A live instance offers no coding agent while it declares no box, and not **OpenCode** or **Pi** on a person's plan, whose sign-in is a command run once on the person's own computer. A person's own agent spends that person's plan under their vendor's terms, which Sanoma neither checks nor changes. The agent runs in the person's box (on a laptop, a directory of this machine) with an environment of its own: its `HOME` is `.acp` in that box (`.sanoma/agent-home/boxes/<box>/.acp`, kept across restarts), so a sign-in is kept for that person and never the company's (every person's agent runs as this machine's user, so on an instance several people share, what an agent runs itself can reach another person's sign-in), and none of the app's or this machine's credentials reach it (no token variables; `gh`, `security` and the browser openers refuse on its `PATH`). Its first turn on a machine installs it there (`.acp/<agent>`) with the pnpm on the `PATH` (the desktop shell ships its own), in 10 to 45 s and 150 to 340 MB each. So `.sanoma/agent-home/boxes` holds a box for each person of the company: its home is Pi's and Claude Code's on the company's key (whose session's files are the clone's and that home's only, never its `.acp`; Claude Code's own reads and the commands a bridge runs are this machine's user's), and its `.acp` the person's own agents' (their `HOME`, installs and sign-ins, given only to that person's agents). The `harness`, `acp` and `people` directories of earlier versions are no longer read: delete them by hand. When the vendor asks the person to sign in, the reply is a sign-in card: the vendor's link and code (Copilot's and Codex's device flows), with a field for a code the vendor asks to have pasted back (Claude Code's), or, for Pi, whose sign-in needs a real terminal, the command to run once on this computer; the app opens no link and enters no code, the card keeps neither once it ends, and after signing in the person sends the message again. The agent's requests to read or edit a file are allowed inside the clone and refused outside it or under `.git` or `node_modules`, as are its requests to run a command and anything else it asks for, each with the reason as a refused step (it is never given an always-allow); the files it reads and writes through the app are the clone's only. What it runs in the app's terminal, and what its own tools do without asking (OpenCode edits and runs commands inside the clone without asking), are its own: the commit brought back to the draft and its checks, at the end of the turn, are the gate. From 1024 px wide the column sits beside the page; narrower, it lies over the page; on a phone (under 768 px) there is none, and the bar is a sheet over the page, opened from the menu button atop it, that closes as you follow a link or tap beside it. Each page starts with its title, with what it counts beside it and the pages above it as links (Workflows, then the workflow's title, on a run's page), its actions at the end of the row; then, on a page with views, pill tabs, each a URL; then one card. What you open from a list, an approval, a run, a scenario or a graph's node, floats over the card's right in a card of its own, and sits above the list (under a graph) while the page's card is too narrow. **Density**, in the menu at the bar's foot under the theme, switches the page to **Compact**, a tighter density for people who live in the app: the page a quarter tighter in every padding, gap and control (its icons too; the text keeps its size), half the gap between a page's regions, a lower graph card and source (a floating card keeps its width). The browser remembers the density in a cookie (`sanoma_density`), so the server renders the page in it from the first paint. The menu at the bar's foot, under your initials, has who you are (and Change name, under the default resolver), the theme (light, dark or the system's, which the browser remembers) and the density. Inside the [desktop app](../../desktop/README.md)'s window it also lists the companies open there, this one checked: choosing another switches the window to it, and **Add company…** shows the desktop app's start screen (`src/lib/desktop.ts`, over the `window.sanomaDesktop` the desktop app gives the page; in a browser there is none, and the menu has no Companies). The screens are built with [shadcn/ui](https://ui.shadcn.com) components (`src/components/ui`, from `components.json`) on Tailwind CSS, in the theme `src/style.css` holds: Sanoma's palette in light and dark, IBM Plex Sans and Mono (Fraunces for display), and 28 px controls.
463
463
 
464
464
  ### Connection management
465
465
 
package/app/dist/api.d.ts CHANGED
@@ -124,6 +124,20 @@ export declare const AppConfigSchema: z.ZodObject<{
124
124
  optional: z.ZodOptional<z.ZodLiteral<true>>;
125
125
  }, z.core.$strict>>>;
126
126
  }, z.core.$strict>>;
127
+ agents: z.ZodArray<z.ZodObject<{
128
+ id: z.ZodString;
129
+ vendor: z.ZodString;
130
+ title: z.ZodString;
131
+ mark: z.ZodOptional<z.ZodObject<{
132
+ src: z.ZodString;
133
+ dark: z.ZodOptional<z.ZodString>;
134
+ }, z.core.$strict>>;
135
+ own: z.ZodBoolean;
136
+ once: z.ZodOptional<z.ZodLiteral<true>>;
137
+ onKey: z.ZodOptional<z.ZodObject<{
138
+ model: z.ZodString;
139
+ }, z.core.$strict>>;
140
+ }, z.core.$strict>>;
127
141
  resourceTypes: z.ZodArray<z.ZodObject<{
128
142
  id: z.ZodString;
129
143
  vendor: z.ZodString;
@@ -143,7 +157,7 @@ export declare const AppConfigSchema: z.ZodObject<{
143
157
  host: z.ZodOptional<z.ZodObject<{
144
158
  lifetime: z.ZodEnum<{
145
159
  "long-lived": "long-lived";
146
- "stops-when-quiet": "stops-when-quiet";
160
+ "stops-on-exit": "stops-on-exit";
147
161
  }>;
148
162
  }, z.core.$strict>>;
149
163
  }, z.core.$strict>>;
@@ -646,7 +660,7 @@ export declare const INFRA = "resources/sanoma/infra.ts";
646
660
  */
647
661
  export declare const DECLARE_BOX = "Coding agents work in a box of their own on a live instance, and this company declares none: declare one in resources/sanoma/infra.ts (`export const box = agent37.instance({})`, with the agent37 connector in sanoma.config.ts) and set AGENT37_API_KEY";
648
662
  /**
649
- * Why a host of type `hostType` that stops when quiet has no Wakeup, `wakes` being the connected
663
+ * Why a host of type `hostType` that stops when idle has no Wakeup, `wakes` being the connected
650
664
  * wakeups and the host types each wakes, when known: going live's refusal to declare one, and
651
665
  * Hosting's notice on a host declared without one.
652
666
  */
package/app/dist/api.js CHANGED
@@ -197,7 +197,7 @@ export const INFRA = "resources/sanoma/infra.ts";
197
197
  */
198
198
  export const DECLARE_BOX = `Coding agents work in a box of their own on a live instance, and this company declares none: declare one in ${INFRA} (\`export const box = agent37.instance({})\`, with the agent37 connector in sanoma.config.ts) and set AGENT37_API_KEY`;
199
199
  /**
200
- * Why a host of type `hostType` that stops when quiet has no Wakeup, `wakes` being the connected
200
+ * Why a host of type `hostType` that stops when idle has no Wakeup, `wakes` being the connected
201
201
  * wakeups and the host types each wakes, when known: going live's refusal to declare one, and
202
202
  * Hosting's notice on a host declared without one.
203
203
  */
@@ -0,0 +1 @@
1
+ import{i as e,r as t,s as n}from"./engine-CBuzy-Ik.js";import{t as r}from"./react-dom-D6fTz1bt.js";import{Ct as i,_t as a,vt as o,yt as s}from"./common-DHOhx6Zn.js";import{C as c,S as l,T as u,b as d,v as f,w as p,x as m,y as h,z as g}from"./kit-n8CE0xEs.js";import{A as _,C as v,Ct as y,Dt as b,Et as x,Ft as S,H as C,Ht as w,J as T,Kt as E,L as D,Lt as ee,Mt as O,N as k,Nt as A,Ot as j,Q as te,Qt as ne,R as M,S as re,St as N,T as P,U as F,Wt as I,X as L,Y as R,Z as ie,Zt as ae,_ as z,a as B,an as V,at as H,b as U,bt as W,c as oe,cn as G,ct as se,d as ce,et as le,f as ue,g as de,gn as K,hn as q,i as fe,j as pe,jt as me,kt as he,lt as ge,mn as _e,mt as ve,n as ye,nn as be,nt as J,o as xe,p as Se,pn as Ce,pt as we,q as Te,r as Ee,rn as De,sn as Oe,t as ke,tn as Ae,tt as je,u as Me,v as Ne,w as Pe,wt as Fe,x as Ie,xt as Le,y as Re,zt as ze}from"./store-BT988jIX.js";import{M as Be,N as Ve,O as He,V as Ue,_ as Y,c as We,d as Ge,f as Ke,g as qe,h as X,i as Je,k as Ye,m as Xe,o as Ze,r as Qe,s as $e,u as et,v as Z,y as tt}from"./button-D5kdANef.js";import{t as nt}from"./utils-BRvE9-Fo.js";import{t as rt}from"./Separator-Cu9cQDBN.js";import{a as it,f as at}from"./composite-9cNA7N0P.js";import{a as ot,d as st,f as ct,r as lt}from"./DialogTitle-Dz3loDe5.js";import{r as ut,t as dt}from"./useOpenInteractionType-UhakpAXY.js";import{k as ft}from"./index-CHKfukjt.js";var Q=n(e(),1);function pt(e){return he&&e.movementX===0&&e.movementY===0}function mt(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function ht(e,t){return mt(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function gt(e,t,n){return mt(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function _t(e,t,n){return mt(t,n?e===Le:e===N,e===W)}function vt(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===`Escape`:mt(t,n?e===N:e===Le,e===y)}function yt(e,t){let{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:a=!0,selectedIndex:o=null,allowEscape:s=!1,loopFocus:c=!1,nested:l=!1,rtl:u=!1,virtual:d=!1,focusItemOnOpen:f=`auto`,focusItemOnHover:p=!0,openOnArrowKeyDown:m=!0,disabledIndices:h=void 0,orientation:g=`vertical`,triggerOrientation:_=g,parentOrientation:y,id:C,resetOnPointerLeave:w=!0,externalTree:E,nestedReturnFocusRef:D,grid:ee}=t,O=ee!=null,k=e.useState(`open`),A=e.useState(`floatingElement`),j=e.useState(`domReferenceElement`),te=e.context.dataRef,ne=H(A),M=se(j),N=S(ne),P=re(),F=v(E),L=Q.useRef(f),z=Q.useRef(o??-1),B=Q.useRef(null),V=Q.useRef(!0),U=Z(e=>{i(z.current===-1?null:z.current,e)}),W=Q.useRef(!!A),oe=Q.useRef(k),G=Q.useRef(!1),ce=Q.useRef(!1),ue=Q.useRef(null),de=S(h),q=S(k),fe=S(o),pe=S(w),me=I(),he=I(),_e=Z(()=>{me.cancel();function e(e){d||(ue.current=ct(e,{sync:G.current,preventScroll:!0}))}let t=n.current[z.current],r=ce.current;t&&e(t),(G.current?e=>e():e=>me.request(e))(()=>{let i=n.current[z.current]||t;i&&(t||e(i),we&&(r||!V.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});Y(()=>{te.current.orientation=g},[te,g]),Y(()=>{k||(B.current=null),k&&f===`auto`||(L.current=f)},[k,f]),Y(()=>{a&&(k&&A?(z.current=o??-1,L.current&&o!=null&&(ce.current=!0,U())):W.current&&(z.current=-1,U()))},[a,k,A,o,U]),Y(()=>{if(a){if(!k)G.current=!1;else if(A){if(r==null){if(G.current=!1,fe.current!=null)return;if(W.current&&(z.current=-1,_e()),(!oe.current||!W.current)&&L.current&&(B.current!=null||L.current===!0&&B.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>he.request(e):queueMicrotask)(t),e+=1):(z.current=B.current==null||gt(B.current,_,u)||l?T(n):Te(n),B.current=null,U())};t()}}else ie(n.current,r)||(z.current=r,_e(),ce.current=!1)}}},[a,k,A,r,fe,l,n,_,u,U,_e,he]),Y(()=>{if(!a||A||!F||d||!W.current)return;let e=F.nodesRef.current,t=e.find(e=>e.id===P)?.context?.elements.floating,n=Fe(K(j??t??null)),r=e.some(e=>e.context&&x(e.context.elements.floating,n));t&&!r&&V.current&&t.focus({preventScroll:!0})},[a,A,j,F,P,d]),Y(()=>{oe.current=k,W.current=!!A});let ve=r!=null,ye=Z(e=>{if(!q.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(z.current!==t||r!==t)&&(z.current=t,U(e))}),be=Z(()=>y??F?.nodesRef.current.find(e=>e.id===P)?.context?.dataRef?.current.orientation),xe=Z(()=>T(n,de.current)),Se=Z(t=>{if(V.current=!1,G.current=!0,t.which===229||!q.current&&t.currentTarget===N.current)return;if(l&&vt(t.key,g,u,O)){ht(t.key,be())||J(t),e.setOpen(!1,Ce(De,t.nativeEvent));let n=D?.current??j;Be(n)&&n.focus();return}r!=null&&r!==z.current&&!ie(n.current,r)&&(z.current=r);let i=z.current,a=T(n,h),o=Te(n,h);if(M||(t.key===`Home`&&(J(t),z.current=a,U(t)),t.key===`End`&&(J(t),z.current=o,U(t))),ee!=null){let e=ee(t,z.current,n,g,c,u,h,a,o);if(e!=null&&e!==z.current&&(z.current=e,U(t)),g===`both`)return}if(ht(t.key,g)){J(t);let e=Fe(t.currentTarget.ownerDocument);if(k&&!d&&x(t.currentTarget,e)&&!n.current.some(t=>t!=null&&x(t,e))){z.current=gt(t.key,g,u)?a:o,U(t),r===z.current&&_e();return}let{index:l,wrapped:f}=R(n.current,i,{decrement:!gt(t.key,g,u),loopFocus:c,allowEscape:s,disabledIndices:h,minIndex:a,maxIndex:o});f&&(G.current=!1),z.current=l,U(t)}}),we=Q.useMemo(()=>({onFocus(e){G.current=!0,ye(e)},onClick({currentTarget:e}){d||e.focus({preventScroll:!0})},onMouseMove(e){pt(e)||(G.current=!0,ce.current=!1,p&&ye(e))},onPointerLeave(e){if(!q.current||!V.current||e.pointerType===`touch`)return;G.current=!0;let t=e.relatedTarget;if(p&&!n.current.includes(t)&&pe.current&&(ue.current?.(),ue.current=null,z.current=-1,U(e),!d)){let e=N.current,t=Fe(K(e));e&&x(e,t)&&e.focus({preventScroll:!0})}}}),[ye,q,N,p,n,U,pe,d]),Ee=Q.useMemo(()=>d&&k&&ve&&{"aria-activedescendant":`${C}-${r}`},[d,k,ve,C,r]),Oe=Q.useMemo(()=>({...M?{}:Ee,onKeyDown(t){if(t.key===`Tab`&&t.shiftKey&&k&&!d){let n=b(t.nativeEvent);if(n&&!x(N.current,n))return;J(t);let r=Ce(ae,t.nativeEvent);e.setOpen(!1,r);let i=D?.current??j;!r.isCanceled&&Be(i)&&i.focus()}else Se(t)},onPointerMove(e){pt(e)||(V.current=!0)}}),[Ee,Se,N,M,e,k,d,j,D]),ke=Q.useMemo(()=>{function t(t){e.setOpen(!0,Ce(De,t.nativeEvent,t.currentTarget))}function n(e){f===`auto`&&le(e.nativeEvent)&&(L.current=!d)}function r(e){L.current=f,f===`auto`&&je(e.nativeEvent)&&(L.current=!0)}return{onKeyDown(n){let r=e.select(`open`);V.current=!1;let i=n.key.startsWith(`Arrow`),a=_t(n.key,be(),u),o=ht(n.key,r?g:_),s=(l?a:o)||n.key===`Enter`||n.key.trim()===``;if(d&&r&&(!l||ge(n.currentTarget)))return Se(n);if(r||m||!i){if(s){let e=ht(n.key,be());B.current=l&&e?null:n.key}l?a&&(J(n),r?(z.current=xe(),U(n),d&&N.current?.focus()):t(n)):o&&(fe.current!=null&&(z.current=fe.current),J(n),!r&&m?t(n):Se(n),r&&U(n))}},onFocus(t){t.target===t.currentTarget&&e.select(`open`)&&!d&&(z.current=-1,U(t))},onPointerDown:r,onPointerEnter:r,onMouseDown:n,onClick:n}},[Se,f,xe,l,U,e,m,g,_,be,u,fe,d,N]),Ae=Q.useMemo(()=>({...Ee,...ke}),[Ee,ke]);return Q.useMemo(()=>a?{reference:Ae,floating:Oe,item:we,trigger:ke}:{},[a,Ae,Oe,ke,we])}function bt(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,disabledIndices:o,onTyping:s,enabled:c=!0,resetMs:l=750,selectedIndex:u=null}=t,d=Z(s),f=e.useState(`open`),p=ee(),m=Q.useRef(``),h=Q.useRef(u??i??-1),g=Q.useRef(null),_=Z(e=>{function t(e){return r?.current[e]}function s(e){let n=t(e);return n&&!L(n)||n?.matches(`:disabled`)?!1:o==null||!te(Ze,e,o)}function c(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(e[n]?.toLowerCase().startsWith(i)&&s(n))return n}return-1}let _=n.current;if(m.current.length>0&&e.key===` `&&(J(e),d?.(!0)),m.current.length>0&&m.current[0]!==` `&&c(_,m.current)===-1&&e.key!==` `&&d?.(!1),_==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;f&&e.key!==` `&&(J(e),d?.(!0));let v=m.current===``;v&&(h.current=u??i??-1),_.every((e,t)=>e&&s(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&m.current===e.key&&(m.current=``,h.current=g.current),m.current+=e.key,p.start(l,()=>{m.current=``,h.current=g.current,d?.(!1)});let y=((v?u??i??-1:h.current)??0)+1,b=c(_,m.current,y);b===-1?e.key!==` `&&(m.current=``,d?.(!1)):(a?.(b,e),g.current=b)}),v=Z(t=>{let n=t.relatedTarget,r=e.select(`domReferenceElement`),i=e.select(`floatingElement`);x(r,n)||x(i,n)||(p.clear(),m.current=``,h.current=g.current,d?.(!1))});Y(()=>{(f||u===null)&&(p.clear(),g.current=null,m.current!==``&&(m.current=``,d?.(!1)))},[f,u,p,d]);let y=Q.useMemo(()=>({onKeyDown:_,onBlur:v}),[_,v]);return Q.useMemo(()=>c?{reference:y,floating:y}:{},[c,y])}var $=t(),xt=Q.createContext(void 0);function St(e){let t=Q.useContext(xt);if(t===void 0&&!e)throw Error(X(33));return t}var Ct=Q.createContext(void 0);function wt(e){let t=Q.useContext(Ct);if(t===void 0&&!e)throw Error(X(36));return t}var Tt=Q.createContext(void 0);function Et(e=!0){let t=Q.useContext(Tt);if(t===void 0&&!e)throw Error(X(25));return t}var Dt=Q.createContext(null);function Ot(e=`root`){let t=Q.useContext(Dt),n=Q.useContext(Ct);return t===null||n===void 0?null:(e===`submenu-trigger`?n.virtualFocus||n.parentVirtualFocus:n.virtualFocus)?t:null}var kt={visible:!0,ref:null};function At(){return kt}function jt(e,t,n=`root`){let r=Ot(n),i=((n===`submenu-trigger`?r?.useSubmenuTrigger:r?.useItem)??At)({label:e.label,children:e.children,render:e.render}),a=et(t,i.ref);return{visible:i.visible,ref:a,props:i.props}}var Mt=Q.createContext(void 0);function Nt(){let e=Q.useContext(Mt);if(e===void 0)throw Error(X(30));return e}function Pt(e){e.preventDefault()}function Ft(e){let{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,typingRef:o,itemRef:s,itemMetadata:c}=e,l=wt(),u=Et(!0),d=c.type===`submenu-trigger`,f=d?l.parentVirtualFocus:l.virtualFocus,p=(d&&l.parent.type===`menu`?l.parent.store:l.store).useState(`webkitAriaSelected`,n),{events:m}=a.useState(`floatingTreeRoot`),h=a.useState(`open`),g=u!==void 0,_=!f&&h&&n?0:-1;return Q.useMemo(()=>({id:r,role:`menuitem`,tabIndex:_,"aria-selected":p,onMouseDown:f?Pt:void 0,onKeyDown(e){e.key===` `&&o?.current&&e.preventDefault()},onMouseMove(e){i&&m.emit(`itemhover`,{nodeId:i,target:e.currentTarget})},onClick(e){t&&m.emit(`close`,{domEvent:e.nativeEvent,reason:Ae})},onMouseUp(e){if(u){let t=u.initialCursorPointRef.current;if(u.initialCursorPointRef.current=null,g&&t&&Math.abs(e.clientX-t.x)<=1&&Math.abs(e.clientY-t.y)<=1||g&&!me&&e.button===2)return}s.current&&a.context.allowMouseUpTriggerRef.current&&(!g||e.button===2)&&c.type===`regular-item`&&Ke(s.current,e,{detail:1,pointerType:`mouse`})}}),[t,_,r,m,i,a.context.allowMouseUpTriggerRef,o,s,u,g,c.type,p,f])}var It={type:`regular-item`};function Lt(e){let{closeOnClick:t,disabled:n,highlighted:r,id:i,store:a,typingRef:o=a.context.typingRef,nativeButton:s,itemMetadata:c,nodeId:l}=e,u=Q.useRef(null),{getButtonProps:d,buttonRef:f}=Ge({disabled:n,focusableWhenDisabled:!0,native:s,composite:!0}),p=Ft({closeOnClick:t,highlighted:r,id:i,nodeId:l,store:a,typingRef:o,itemRef:u,itemMetadata:c}),m=Q.useCallback(e=>qe(p,{onMouseEnter(e){c.type===`submenu-trigger`&&c.setActive(e.nativeEvent)}},e,d),[p,d,c]),h=et(u,f);return Q.useMemo(()=>({getItemProps:m,itemRef:h}),[m,h])}var Rt=`data-checked`,zt=`data-unchecked`,Bt={checked(e){return e?{[Rt]:``}:{[zt]:``}},...ze},Vt=Q.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:s=!1,disabled:c=!1,closeOnClick:l=!1,checked:u=!1,onCheckedChange:d,style:f,...p}=e,{store:m}=wt(),h=o({guess:!0,label:a}),g=q(i),_=m.useState(`disabled`),v=m.useState(`isActive`,h.index),y=m.useState(`floatingNodeId`),b=m.useState(`itemProps`),x=c||_,{getItemProps:S,itemRef:C}=Lt({closeOnClick:l,disabled:x,highlighted:v,id:g,store:m,nativeButton:s,nodeId:y,itemMetadata:It}),w=Q.useMemo(()=>({disabled:x,highlighted:v,checked:u}),[x,v,u]);function T(e){let t=Ce(Ae,e.nativeEvent,void 0,{preventUnmountOnClose:We});d?.(!u,t)}let E=Je(`div`,e,{state:w,stateAttributesMapping:Bt,props:[b,{role:`menuitemcheckbox`,"aria-checked":u,onClick:T},p,S],ref:[C,t,h.ref]});return(0,$.jsx)(Mt.Provider,{value:w,children:E})}),Ht=Q.forwardRef(function(e,t){let{checked:n,defaultChecked:r,onCheckedChange:a,...o}=e,[s,c]=i({controlled:n,default:r??!1,name:`MenuCheckboxItem`,state:`checked`}),l=jt(e,t);function u(e,t){a?.(e,t),t.isCanceled||c(e)}return l.visible?(0,$.jsx)(Vt,{...o,checked:s,onCheckedChange:u,ref:l.ref}):null}),Ut=Q.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a=!1,...o}=e,s=Nt(),c=Q.useRef(null),{transitionStatus:l,mounted:u,setMounted:d}=w(s.checked);O({batch:!0,enabled:!s.checked,open:s.checked,ref:c,onComplete(){s.checked||d(!1)}});let f={checked:s.checked,disabled:s.disabled,highlighted:s.highlighted,transitionStatus:l};return Je(`span`,e,{state:f,ref:[t,c],stateAttributesMapping:Bt,props:{"aria-hidden":!0,...o},enabled:a||u})}),Wt=Q.createContext(void 0);function Gt(){let e=Q.useContext(Wt);if(e===void 0)throw Error(X(31));return e}var Kt=Q.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,[o,s]=Q.useState(void 0),c=Je(`div`,e,{ref:t,props:{role:`group`,"aria-labelledby":o,...a}});return(0,$.jsx)(Wt.Provider,{value:s,children:c})}),qt=Q.forwardRef(function(e,t){let n=Ot()?.Group??Kt;return(0,$.jsx)(n,{...e,ref:t})}),Jt=Q.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=q(a),c=Gt();return Y(()=>(c(s),()=>{c(e=>e===s?void 0:e)}),[c,s]),Je(`div`,e,{ref:t,props:{id:s,"aria-hidden":!0,...o}})}),Yt=Q.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:s=!1,disabled:c=!1,closeOnClick:l=!0,style:u,...d}=e,{store:f}=wt(),p=o({guess:!0,label:a}),m=q(i),h=f.useState(`disabled`),g=f.useState(`isActive`,p.index),_=f.useState(`floatingNodeId`),v=f.useState(`itemProps`),y=c||h,{getItemProps:b,itemRef:x}=Lt({closeOnClick:l,disabled:y,highlighted:g,id:m,store:f,nativeButton:s,nodeId:_,itemMetadata:It});return Je(`div`,e,{state:{disabled:y,highlighted:g},props:[v,d,b],ref:[x,t,p.ref]})}),Xt=Q.forwardRef(function(e,t){let n=jt(e,t);return n.visible?(0,$.jsx)(Yt,{...e,ref:n.ref}):null}),Zt=Q.createContext(void 0);function Qt(e){let t=Q.useContext(Zt);if(t===void 0&&!e)throw Error(X(69));return t}var $t=Q.createContext(void 0);function en(){return Q.useContext($t)}function tn(e,t){let n=Qe(e.render);if(Q.isValidElement(n)){let e=n.props;if(Object.hasOwn(e,`id`))return e.id??``}return e.id??t}function nn(e,t,n){let r=tn(e,t),i=r===t?void 0:r;return[r,Q.useCallback(e=>n?.(e?i:void 0),[i,n])]}function rn(e,t,n){let r=Qe(e.render),i=Q.isValidElement(r)?r.props:void 0,a=e[`aria-label`]??i?.[`aria-label`],o=e[`aria-labelledby`]??i?.[`aria-labelledby`];return o==null&&!a&&(o=t?t.id||void 0:n||void 0),o}var an=Q.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,id:o,initialFocus:s,...l}=e,{store:u,defaultFloatingId:d,setRenderedFloatingId:f,virtualFocus:p,orientation:m}=wt(),g=en(),{side:_,align:v}=St(),y=Qt(!0)!=null,b=u.useState(`open`),x=u.useState(`transitionStatus`),S=u.useState(`popupProps`),C=u.useState(`mounted`),w=u.useState(`instantType`),T=u.useState(`activeTriggerElement`),E=u.useState(`parent`),D=u.useState(`lastOpenChangeReason`),ee=u.useState(`rootId`),k=u.useState(`floatingRootContext`),A=u.useState(`floatingTreeRoot`),j=u.useState(`closeDelay`),te=u.useState(`hoverEnabled`),ne=u.useState(`disabled`),M=u.useState(`openMethod`),re=u.useState(`activeTriggerId`),N=u.useState(`listElement`),[P,F]=nn(e,d,f),I=rn(e,T,re),L=E.type===`menu`?g:void 0,R=E.type===`context-menu`,ie=s??E.type!==`menu`;s===void 0&&N&&E.type!==`menu`&&(ie=()=>u.state.activeIndex===null&&N),O({open:b,ref:u.context.popupRef,onComplete(){b&&u.context.onOpenChangeComplete?.(!0)}}),Q.useEffect(()=>{function e(e){u.setOpen(!1,Ce(e.reason,e.domEvent))}return A.events.on(`close`,e),()=>{A.events.off(`close`,e)}},[A.events,u]),c(k,{enabled:te&&!ne&&!R&&E.type!==`menubar`,closeDelay:j});let ae=u.useStateSetter(`popupElement`),{parentVirtualFocusRef:z,handleFocus:B}=(Q.useContext(Dt)?.useParentHandoff??sn)(u,E,b,p),V={transitionStatus:x,side:_,align:v,open:b,nested:E.type===`menu`,instant:w},H=Je(`div`,e,{state:V,ref:[t,u.context.popupRef,ae,F],stateAttributesMapping:we,props:[S,{id:P,...N?{role:`presentation`}:{role:`menu`,"aria-orientation":m===`horizontal`?`horizontal`:void 0,"aria-labelledby":I},onKeyDown(e){L?.onPopupKeyDown?.(e),y&&it.has(e.key)&&e.stopPropagation()},onFocus:B},h(x),l,{"data-rootownerid":ee}]}),U=E.type===void 0||R;(T||E.type===`menubar`&&D!==`outside-press`)&&(U=!0);let W=L?.getReturnElement??z;return(0,$.jsx)(st,{context:k,openInteractionType:M,modal:R,disabled:!C,returnFocus:a??W??U,explicitReturnFocus:a===void 0&&W?!1:void 0,initialFocus:ie,restoreFocus:!0,getInsideElements:E.type===void 0?()=>[u.context.beforeTriggerFocusGuardRef.current]:void 0,externalTree:E.type===`menubar`?void 0:A,previousFocusableElement:T,nextFocusableElement:E.type===void 0?u.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:u.context.beforeContentFocusGuardRef,children:H})}),on={parentVirtualFocusRef:void 0,handleFocus:void 0};function sn(){return on}var cn=Q.forwardRef(function(e,t){let n=Ot()?.Popup??an;return(0,$.jsx)(n,{...e,ref:t})}),ln=Q.createContext(void 0);function un(){let e=Q.useContext(ln);if(e===void 0)throw Error(X(32));return e}var dn=Q.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i,parent:a}=wt();if(!(i.useState(`mounted`)||n))return null;let o=a.type===`menu`||a.type===`menubar`?`group`:void 0;return(0,$.jsx)(ln.Provider,{value:n,children:(0,$.jsx)(P,{ref:t,...r,portalOwnerRole:o})})});function fn(e){let{store:t,domReference:n,positionerElement:r,open:i}=e,a=Q.useRef(null),o=Q.useRef(null),s=A(r);Y(()=>{i||(o.current?.abort(),o.current=null,t.state.instantType===`trigger-change`&&t.set(`instantType`,void 0))},[i,t]),Y(()=>{let e=n,r=a.current;if(e&&(a.current=e),!r||!e||e===r||!t.select(`open`))return;t.set(`instantType`,void 0);let i=new AbortController;return o.current=i,s(()=>{t.select(`open`)&&t.set(`instantType`,`trigger-change`)},i.signal),()=>{i.abort()}},[n,s,t])}var pn=20;function mn(e,t,n,r){let[i,a]=Q.useState(!1);Y(()=>{if(!e||!t||n==null){a(!1);return}let r=K(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-pn)},[e,t,n]),lt(e&&(!t||i),r)}var hn=Q.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o,align:c,sideOffset:l=0,alignOffset:u=0,collisionBoundary:p=`clipping-ancestors`,collisionPadding:m=5,arrowPadding:h=5,sticky:g=!1,disableAnchorTracking:v=!1,collisionAvoidance:y=_,style:b,...x}=e,{store:S,virtualFocus:C,syncHighlightedItem:w}=wt(),T=un(),E=Et(!0),D=S.useState(`parent`),O=S.useState(`floatingRootContext`),k=S.useState(`floatingTreeRoot`),A=S.useState(`mounted`),j=S.useState(`open`),te=S.useState(`modal`),ne=S.useState(`openMethod`),M=S.useState(`activeTriggerElement`),re=S.useState(`transitionStatus`),N=S.useState(`positionerElement`),P=S.useState(`instantType`),F=S.useState(`adaptiveOrigin`),I=S.useState(`lastOpenChangeReason`),L=S.useState(`floatingNodeId`),R=S.useState(`floatingParentNodeId`),ie=O.useState(`domReferenceElement`),ae=n,z=l,B=u,V=c,H=y;D.type===`context-menu`&&(ae=n??D.context?.anchor,V??=`start`,!o&&V!==`center`&&(B=e.alignOffset??2,z=e.sideOffset??-5));let U=o,W=V;D.type===`menu`?(U??=`inline-end`,W??=`start`,H=e.collisionAvoidance??pe):D.type===`menubar`&&(U??=D.context.orientation===`vertical`?`inline-end`:`bottom`,W??=`start`);let oe=D.type===`context-menu`,se=d({anchor:ae,floatingRootContext:O,positionMethod:E?`fixed`:r,mounted:A,side:U,sideOffset:z,align:W,alignOffset:B,arrowPadding:oe?0:h,collisionBoundary:p,collisionPadding:m,sticky:g,nodeId:L,keepMounted:T,disableAnchorTracking:v,collisionAvoidance:H,shift:oe?{crossAxis:!(`side`in H&&H.side===`flip`),rootBoundary:`layoutViewport`}:void 0,externalTree:k,adaptiveOrigin:F,lazyFlip:C?`placement`:!1});Q.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===L&&S.set(`hoverEnabled`,!1),e.nodeId!==L&&e.parentNodeId===S.select(`floatingParentNodeId`)&&S.setOpen(!1,Ce(G)))}return k.events.on(`menuopenchange`,e),()=>{k.events.off(`menuopenchange`,e)}},[S,k.events,L]),Q.useEffect(()=>{if(S.select(`floatingParentNodeId`)==null)return;function e(e){if(e.open||e.nodeId!==S.select(`floatingParentNodeId`))return;let t=e.reason??`sibling-open`;S.setOpen(!1,Ce(t))}return k.events.on(`menuopenchange`,e),()=>{k.events.off(`menuopenchange`,e)}},[k.events,S]);let ce=ee();Q.useEffect(()=>{j||ce.clear()},[j,ce]),Q.useEffect(()=>{function e(e){if(j&&e.nodeId===S.select(`floatingParentNodeId`)){if(e.target&&M&&M!==e.target){let e=S.select(`closeDelay`);e>0?ce.isStarted()||ce.start(e,()=>{S.setOpen(!1,Ce(G))}):S.setOpen(!1,Ce(G))}else ce.clear()}}return k.events.on(`itemhover`,e),()=>{k.events.off(`itemhover`,e)}},[k.events,j,M,S,ce]),Q.useEffect(()=>{let e={open:j,nodeId:L,parentNodeId:R,reason:S.select(`lastOpenChangeReason`)};k.events.emit(`menuopenchange`,e)},[k.events,j,S,L,R]),fn({store:S,domReference:ie,positionerElement:N,open:j});let le={open:j,side:se.side,align:se.align,anchorHidden:se.anchorHidden,nested:D.type===`menu`,instant:P},ue=D.type===`menubar`&&D.context.modal;mn(j&&(ue||te&&I!==`trigger-hover`),ne===`touch`,N,M);let de=f(e,le,{styles:se.positionerStyles,transitionStatus:re,props:x,refs:[t,S.useStateSetter(`positionerElement`)],hidden:!A,inert:!j}),K=A&&D.type!==`menu`&&(D.type!==`menubar`&&te&&I!==`trigger-hover`||D.type===`menubar`&&D.context.modal),q=null;return D.type===`menubar`?q=D.context.contentElement:D.type===void 0&&(q=M),(0,$.jsxs)(xt.Provider,{value:se,children:[K&&(0,$.jsx)(ot,{ref:D.type===`context-menu`||D.type===`nested-context-menu`?D.context.internalBackdropRef:null,inert:at(!j),cutout:q}),(0,$.jsx)(Re,{id:L,children:(0,$.jsx)(s,{elementsRef:S.context.itemDomElements,labelsRef:S.context.itemLabels,onMapChange:w,children:de})})]})}),gn=Q.createContext(void 0);function _n(){let e=Q.useContext(gn);if(e===void 0)throw Error(X(34));return e}var vn=Q.forwardRef(function(e,t){let{render:n,className:r,value:a,defaultValue:o,onValueChange:s,disabled:c=!1,style:l,"aria-labelledby":u,...d}=e,[f,p]=Q.useState(void 0),[m,h]=i({controlled:a,default:o,name:`MenuRadioGroup`}),g=Z((e,t)=>{s?.(e,t),!t.isCanceled&&h(e)}),_=Je(`div`,e,{state:{disabled:c},ref:t,props:{role:`group`,"aria-labelledby":u??f,"aria-disabled":c||void 0,...d}}),v=Q.useMemo(()=>({value:m,setValue:g,disabled:c}),[m,g,c]);return(0,$.jsx)(Wt.Provider,{value:p,children:(0,$.jsx)(gn.Provider,{value:v,children:_})})}),yn=Q.memo(Q.forwardRef(function(e,t){let n=Ot()?.RadioGroup??vn;return(0,$.jsx)(n,{...e,ref:t})})),bn=Q.createContext(void 0);function xn(){let e=Q.useContext(bn);if(e===void 0)throw Error(X(35));return e}var Sn=Q.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:s=!1,disabled:c=!1,closeOnClick:l=!1,value:u,style:d,...f}=e,{store:p}=wt(),{value:m,setValue:h,disabled:g}=_n(),_=o({guess:!0,label:a}),v=q(i),y=p.useState(`isActive`,_.index),b=p.useState(`floatingNodeId`),x=p.useState(`itemProps`),S=p.useState(`disabled`),C=c||g||S,w=m===u,{getItemProps:T,itemRef:E}=Lt({closeOnClick:l,disabled:C,highlighted:y,id:v,store:p,nativeButton:s,nodeId:b,itemMetadata:It}),D=Q.useMemo(()=>({disabled:C,highlighted:y,checked:w}),[C,y,w]);function ee(e){let t=Ce(Ae,e.nativeEvent,void 0,{preventUnmountOnClose:We});h(u,t)}let O=Je(`div`,e,{state:D,stateAttributesMapping:Bt,props:[x,{role:`menuitemradio`,"aria-checked":w,onClick:ee},f,T],ref:[E,t,_.ref]});return(0,$.jsx)(bn.Provider,{value:D,children:O})}),Cn=Q.forwardRef(function(e,t){let n=jt(e,t);return n.visible?(0,$.jsx)(Sn,{...e,ref:n.ref}):null}),wn=Q.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a=!1,...o}=e,s=xn(),c=Q.useRef(null),{transitionStatus:l,mounted:u,setMounted:d}=w(s.checked);O({batch:!0,enabled:!s.checked,open:s.checked,ref:c,onComplete(){s.checked||d(!1)}});let f={checked:s.checked,disabled:s.disabled,highlighted:s.highlighted,transitionStatus:l};return Je(`span`,e,{state:f,stateAttributesMapping:Bt,ref:[t,c],props:{"aria-hidden":!0,...o},enabled:a||u})}),Tn=Q.createContext(null);function En(e){let t=Q.useContext(Tn);if(t===null&&!e)throw Error(X(5));return t}function Dn(e){return e==null?V:e.type.startsWith(`key`)?be:e.type.startsWith(`mouse`)||e.type.startsWith(`pointer`)?Oe:V}var On={...ye,disabled:e=>e.parent.type===`menubar`&&e.parent.context.disabled||e.disabled,modal:e=>(e.parent.type===void 0||e.parent.type===`context-menu`)&&(e.modal??!0),openMethod:e=>e.openMethod,keyboardOpen:e=>e.keyboardOpen,allowMouseEnter:e=>e.allowMouseEnter,highlightItemOnHover:e=>e.highlightItemOnHover,parent:e=>e.parent,rootId:e=>e.parent.type===`menu`?e.parent.store.select(`rootId`):e.parent.type===void 0?e.rootId:e.parent.context.rootId,activeIndex:e=>e.activeIndex,listElement:e=>e.listElement,triggerControlsId:(e,t)=>{let n=ye.triggerPopupId(e,t);return n?e.listElement?.id||n:void 0},filterTriggerProps:e=>e.filterTriggerProps,inputProps:e=>e.inputProps,webkitAriaSelected:(e,t)=>he&&e.inputFocused&&t?!0:void 0,highlightedItemId:e=>e.highlightedItem?.id||void 0,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType===`trigger-change`&&!ye.open(e)?void 0:e.instantType,lastOpenChangeReason:e=>e.openChangeReason,floatingTreeRoot:e=>e.parent.type===`menu`?e.parent.store.select(`floatingTreeRoot`):e.floatingTreeRoot,floatingNodeId:e=>e.floatingNodeId,floatingParentNodeId:e=>e.floatingParentNodeId,itemProps:e=>e.itemProps,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin,keyboardEventRelay:e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===`menu`)return e.parent.store.select(`keyboardEventRelay`)}},kn=class extends Ee{constructor(e,t,n=!1){let r=new fe,i=jn(r,t,n,e);super(i,An(r),On),this.observe(`parent`,e=>{e.type===`menu`?this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef:e.type!==void 0&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef)})}subscribeToParentMenu(){let e=this.state.parent;if(e.type!==`menu`)return;let t=e.store.select(`rootId`),n=e.store.select(`floatingTreeRoot`),r=e.store.select(`keyboardEventRelay`);return e.store.subscribe(()=>{let i=e.store.select(`rootId`),a=e.store.select(`floatingTreeRoot`),o=e.store.select(`keyboardEventRelay`);(t!==i||n!==a||r!==o)&&(t=i,n=a,r=o,this.notifyAll())})}setOpen(e,t){this.state.floatingRootContext.context.events.emit(`setOpen`,{open:e,eventDetails:t})}setActiveIndex(e,t,n){if(this.state.activeIndex!==e){let r=(e===null?void 0:this.context.itemDomElements.current[e])===this.context.reportedItem;this.context.highlightReason=r?`none`:t,this.context.highlightEvent=r?void 0:n}this.set(`activeIndex`,e)}highlightItem(e,t,n){let r=this.context.itemDomElements.current.indexOf(e);r>-1&&this.setActiveIndex(r,t,n)}};function An(e){return{positionerRef:Q.createRef(),popupRef:Q.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},highlightReason:`none`,highlightEvent:void 0,reportedItem:void 0,allowMouseUpTriggerRef:{current:!1},virtualFocusRef:void 0,triggerFocusTargetRef:Q.createRef(),beforeTriggerFocusGuardRef:Q.createRef(),beforeContentFocusGuardRef:Q.createRef(),onOpenChangeComplete:void 0,triggerElements:e}}function jn(e,t,n=!1,r){return{...ke(e,t,n),disabled:!1,modal:!0,openMethod:null,keyboardOpen:!1,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,listElement:null,filterTriggerProps:$e,inputProps:$e,inputFocused:!1,highlightedItem:void 0,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new Pe,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:$e,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...r}}var Mn=Q.createContext(null);function Nn(e,t){return(e===`trigger-press`||e===`item-press`)&&t?.detail===0}function Pn(e,t){return e===`list-navigation`||Nn(e,t)}var Fn=D(function(e){let{children:t,open:n,onOpenChange:r,onOpenChangeComplete:i,onItemHighlighted:a,defaultOpen:o=!1,disabled:s=!1,modal:c,loopFocus:l=!0,orientation:u=`vertical`,actionsRef:d,closeParentOnEsc:f=!1,handle:p,triggerId:m,defaultTriggerId:h=null,highlightItemOnHover:_=!0,isSubmenu:v=!1,virtualFocus:y=!1,virtualFocusRef:b,allowEscape:x=!0,resetOnPointerLeave:S=!0}=e,C=Et(!0),w=wt(!0),T=En(!0),E=w?.store,D=w?.virtualFocus??!1,O=Q.useMemo(()=>v&&E?{type:`menu`,store:E}:T?{type:`menubar`,context:T}:C&&!E?{type:`context-menu`,context:C}:{type:void 0},[C,E,T,v]),k=q(),j=q(),[te,M]=Q.useState(void 0),N=(te??j)||void 0,P=re(),F=O.type===`menu`?O.store:void 0,I=(n??o)&&F?.state.transitionStatus===`starting`,L=tt(()=>I?F?.state.instantType:void 0).current,R=tt(()=>{let e=new kn({open:o,openProp:n,activeTriggerId:h,triggerIdProp:m,parent:O,disabled:s,highlightItemOnHover:_,modal:O.type===void 0?c:void 0,rootId:k,instantType:L},N,P!=null);return e.context.virtualFocusRef=b,e}).current;R.useControlledProp(`openProp`,n),R.useControlledProp(`triggerIdProp`,m),R.useContextCallback(`onOpenChangeComplete`,i);let ie=R.useState(`floatingTreeRoot`),ae=Ie(ie),H=R.useState(`open`),W=R.useState(`activeTriggerElement`),G=R.useState(`positionerElement`),se=R.useState(`hoverEnabled`),le=R.useState(`disabled`),de=R.useState(`lastOpenChangeReason`),K=R.useState(`parent`),fe=R.useState(`activeIndex`),pe=R.useState(`keyboardOpen`),me=R.useState(`payload`),he=R.useState(`floatingParentNodeId`),ge=Q.useRef(null),ve=Q.useRef(K.type!==`context-menu`),ye=ee(),J=Q.useRef(!0),we=ee(),Te=he!=null,{openMethod:Ee,triggerProps:De}=dt(H);R.useSyncedValues({disabled:s,highlightItemOnHover:_,modal:K.type===void 0?c:void 0,openMethod:Ee,rootId:k}),ce(R);let{forceUnmount:Oe,transitionStatus:ke}=ue(H,R,()=>{R.set(`allowMouseEnter`,!1)},I),Ae=A(R.context.popupRef);Q.useEffect(()=>{if(L===void 0)return;let e=()=>{R.state.instantType===L&&R.set(`instantType`,void 0)};if(!H){e();return}if(ke!==void 0)return;if(R.context.popupRef.current==null){e();return}let t=new AbortController;return Ae(e,t.signal),()=>{t.abort()}},[L,H,ke,Ae,R]),Y(()=>{C&&!w?R.update({parent:{type:`context-menu`,context:C},floatingNodeId:ae,floatingParentNodeId:P}):(w||!R.select(`activeTriggerElement`))&&R.update({floatingNodeId:ae,floatingParentNodeId:P})},[C,w,ae,P,W,R]),Q.useEffect(()=>{H||(ge.current=null),K.type===`context-menu`&&(H?ye.start(500,()=>{ve.current=!0}):(ye.clear(),ve.current=!1))},[ye,H,K.type]),Y(()=>{!H&&!se&&R.set(`hoverEnabled`,!0)},[H,se,R]);let je=Z((e,t)=>{let n=t.reason;if(!e&&!R.select(`open`)||H===e&&t.trigger===W&&de===n)return;let i=oe(t);if(!e&&t.trigger==null&&(t.trigger=W??void 0),r?.(e,t),t.isCanceled)return;R.state.floatingRootContext.dispatchOpenChange(e,t);let a=t.event;if(e===!1&&n!==`item-press`&&a?.type===`click`&&a.pointerType===`touch`&&!J.current)return;e&&n===`trigger-focus`?(J.current=!1,we.start(300,()=>{J.current=!0})):(J.current=!0,we.clear());let o=!e&&(n===`escape-key`||n==null);ge.current=t.event;let s=Me(R.state,e,t.trigger,i());s.openChangeReason=n,s.keyboardOpen=e&&Pn(n,a),s.instantType=K.type===`menubar`&&(n===`trigger-focus`||n===`focus-out`||n===`trigger-hover`||n===`list-navigation`||n===`sibling-open`)?`group`:Nn(n,a)?`click`:o?`dismiss`:void 0,R.update(s)}),Pe=z({popupStore:R,floatingRootContext:R.state.floatingRootContext,floatingId:N,nested:P!=null,onOpenChange:je}),Fe=Pe.context.events;Y(()=>{let e=({open:e,eventDetails:t})=>je(e,t);return Fe.on(`setOpen`,e),()=>{Fe?.off(`setOpen`,e)}},[Fe,je]),Y(()=>R.subscribeToParentMenu(),[R]);let Le=Q.useCallback(()=>{R.setOpen(!1,Ce(ne))},[R]);Q.useImperativeHandle(d,()=>({unmount:Oe,close:Le}),[Oe,Le]);let Re;K.type===`context-menu`&&(Re=K.context),Q.useImperativeHandle(Re?.positionerRef,()=>G,[G]),Q.useImperativeHandle(Re?.actionsRef,()=>({setOpen:je}),[je]);let ze=Ne(Pe,{enabled:!le,bubbles:{escapeKey:f&&K.type===`menu`},outsidePress(){return K.type!==`context-menu`||ge.current?.type===`contextmenu`||ve.current},externalTree:Te?ie:void 0}),Be=g(),Ve=yt(Pe,{enabled:!le,listRef:R.context.itemDomElements,activeIndex:fe,virtual:y,nested:K.type===`menubar`||!y&&K.type!==void 0,parentOrientation:K.type===`menubar`?K.context.orientation:void 0,loopFocus:l,focusItemOnOpen:y?pe:void 0,allowEscape:y&&l&&x,orientation:u,triggerOrientation:y?`vertical`:u,rtl:Be===`rtl`,disabledIndices:Ze,onNavigate(e,t){R.setActiveIndex(e,Dn(t),t?.nativeEvent)},openOnArrowKeyDown:K.type!==`context-menu`&&!(y&&v),externalTree:!y&&Te?ie:void 0,nestedReturnFocusRef:F?.context.virtualFocusRef,focusItemOnHover:_,resetOnPointerLeave:S}),He=Q.useCallback(e=>{R.context.typingRef.current=e},[R]),Ue=bt(Pe,{enabled:!le&&!y,listRef:R.context.itemLabels,elementsRef:R.context.itemDomElements,activeIndex:fe,resetMs:500,onMatch:(e,t)=>{H&&e!==fe&&R.setActiveIndex(e,be,t.nativeEvent)},onTyping:He}),We=Z(a),Ge=Q.useRef(-1),Ke=Z(()=>{let e=R.state.activeIndex,t=e===null?void 0:R.context.itemDomElements.current[e]??void 0;if(t?.isConnected===!1)return;let n=t===void 0?-1:e;if(Ge.current===n&&R.context.reportedItem===t)return;Ge.current=n,R.context.reportedItem=t,y&&R.set(`highlightedItem`,t);let{highlightReason:r,highlightEvent:i}=R.context;R.context.highlightReason=V,R.context.highlightEvent=void 0,a&&We(t,_e(r,i,{label:t===void 0?void 0:R.context.itemLabels.current[n]??void 0}))});Y(()=>{Ke()},[fe,Ke]);let X=Q.useMemo(()=>{if(!y)return Ve.reference;if(!Ve.trigger)return $e;let{onFocus:e,...t}=Ve.trigger;return t},[y,Ve.reference,Ve.trigger]);R.useSyncedValue(`inputProps`,y?Ve.reference??$e:$e);let Je=Q.useMemo(()=>{let e=qe(Ue.reference,X,ze.reference,{onMouseMove(){R.set(`allowMouseEnter`,!0)}},De);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=H,e},[R,Ue.reference,X,ze.reference,De,H]),Ye=Q.useMemo(()=>{let e=qe(Ve.trigger,ze.trigger,De);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=!1,e},[Ve.trigger,ze.trigger,De]);tt(()=>(R.update({inactiveTriggerProps:Ye}),null));let Xe=Q.useMemo(()=>qe(B,{onMouseMove(){R.set(`allowMouseEnter`,!0),K.type===`menu`&&R.set(`hoverEnabled`,!1)},onClick(){R.select(`hoverEnabled`)&&R.set(`hoverEnabled`,!1)},onKeyDown(e){let t=R.select(`keyboardEventRelay`);t&&!e.isPropagationStopped()&&t(e)}},Ue.floating,Ve.floating,ze.floating),[K.type,R,Ue.floating,Ve.floating,ze.floating]),Qe=Ve.item??$e;Se(R,{floatingRootContext:Pe,activeTriggerProps:Je,inactiveTriggerProps:Ye,popupProps:Xe,itemProps:Qe});let et=Q.useMemo(()=>({store:R,parent:O,orientation:u,loopFocus:l,allowEscape:x,defaultFloatingId:j,setRenderedFloatingId:M,virtualFocus:y,parentVirtualFocus:D,syncHighlightedItem:Ke}),[R,O,u,l,x,j,y,D,Ke]),nt=typeof t==`function`?t({payload:me}):t,rt=(0,$.jsxs)(Ct.Provider,{value:et,children:[p&&(0,$.jsx)(xe,{handle:p,store:R}),nt]});return(K.type===void 0||K.type===`context-menu`)&&(rt=(0,$.jsx)(U,{externalTree:ie,children:rt})),rt});function In(e){let t=Q.useContext(Mn);if(t===null)return(0,$.jsx)(Fn,{...e});let n=t.Root;return(0,$.jsx)(Mn.Provider,{value:null,children:(0,$.jsx)(n,{...t.options,...e})})}var Ln=5;function Rn(e,t){let n=zn(t);return e.clientX>=n.left-Ln&&e.clientX<=n.right+Ln&&e.clientY>=n.top-Ln&&e.clientY<=n.bottom+Ln}function zn(e){let t=e.getBoundingClientRect(),n=Ye(e);if(j)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(r.content===`none`&&i.content===`none`)return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}function Bn(e){let{render:t,className:n,style:r,state:i=$e,props:o=Ze,refs:s=Ze,metadata:c,stateAttributesMapping:l,tag:u=`div`,...d}=e,{compositeProps:f,compositeRef:p}=a({metadata:c});return Je(u,e,{state:i,ref:[p,...s],props:[f,...o,d],stateAttributesMapping:l})}function Vn(e){if(Be(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`);if(!Ve(e))return Vn(He(e))}var Hn=n(r(),1);function Un(e,t){function n(n,r,i){let a=n.currentTarget;Hn.flushSync(()=>{e.setOpen(!1,Ce(ae,n.nativeEvent,a))}),C(a.isConnected?a:t.current,r,i)?.focus()}function r(t){n(t,-1,e.select(`positionerElement`))}function i(t){let r=e.select(`positionerElement`);r&&F(t,r)?e.context.beforeContentFocusGuardRef.current?.focus():n(t,1,r)}return{handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function Wn(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,i=Q.useRef(!1);return Q.useMemo(()=>t?{onMouseDown:e=>{(n===`open`&&!r||n===`close`&&r)&&(i.current=!0,K(e.currentTarget).addEventListener(`click`,()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:$e,[t,n,r])}var Gn=M(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,id:s,openOnHover:c,delay:d=100,closeDelay:f=0,handle:h,payload:g,..._}=e,y=wt(!0),b=u(h)??y?.store;if(!b)throw Error(X(85));let S=q(s),C=b.useState(`isTriggerActive`,S),w=b.useState(`floatingRootContext`),T=b.useState(`isOpenedByTrigger`,S),D=b.useState(`triggerControlsId`,S),O=Q.useRef(null),A=qn(),j=Xe(!0),te=v(),ne=Q.useMemo(()=>te??new Pe,[te]),M=Ie(ne),N=re(),{registerTrigger:P,isMountedByThisTrigger:F}=de(S,O,b,{payload:g,closeDelay:f,parent:A,floatingTreeRoot:ne,floatingNodeId:M,floatingParentNodeId:N,keyboardEventRelay:j?.relayKeyboardEvent}),I=A.type===`menubar`,L=b.useState(`disabled`),R=a||L||I&&A.context.disabled,{getButtonProps:ie,buttonRef:ae}=Ge({disabled:R,native:o});Q.useEffect(()=>{!T&&A.type===void 0&&(b.context.allowMouseUpTriggerRef.current=!1)},[b,T,A.type]);let z=Q.useRef(null),B=ee(),V=Z(e=>{if(!z.current)return;B.clear(),b.context.allowMouseUpTriggerRef.current=!1;let t=e.target;x(z.current,t)||x(b.select(`positionerElement`),t)||t===z.current||t!=null&&Vn(t)===b.select(`rootId`)||Rn(e,z.current)||ne.events.emit(`close`,{domEvent:e,reason:E})});Q.useEffect(()=>{let e=K(z.current);if(T&&b.select(`lastOpenChangeReason`)===`trigger-hover`)return e.addEventListener(`mouseup`,V,{once:!0}),()=>{e.removeEventListener(`mouseup`,V)}},[T,V,b]);let H=I&&A.context.hasSubmenuOpen,U=l(w,{enabled:(c??H)&&!R&&(!I||H&&!F),handleClose:m({blockPointerEvents:!I}),mouseOnly:!0,move:!1,restMs:A.type===void 0?d:void 0,delay:{close:f},triggerElementRef:O,externalTree:ne,isActiveTrigger:C,isClosing:()=>b.select(`transitionStatus`)===`ending`}),W=Kn(T,b.select(`lastOpenChangeReason`)),oe=ut(w,{enabled:!R,event:T&&I?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:A.type===void 0&&W}),G=p(w,{enabled:!R&&H}),se=Wn({open:T,enabled:I,mouseDownAction:`open`}),ce=Q.useMemo(()=>qe(G.reference,oe.reference),[G.reference,oe.reference]),le=b.useState(`triggerProps`,F),ue=b.useState(`filterTriggerProps`),{handlePreFocusGuardFocus:fe,handleFocusTargetFocus:pe}=Un(b,O),me={disabled:R,open:T},he=[z,t,ae,P,O],ge=[ce,U??$e,le,{"aria-haspopup":`menu`,"aria-controls":D,id:S,onMouseDown:e=>{b.select(`open`)||(B.start(200,()=>{b.context.allowMouseUpTriggerRef.current=!0}),K(e.currentTarget).addEventListener(`mouseup`,V,{once:!0}))}},ue,I?{role:`menuitem`}:{},se,_,ie],_e=Je(`button`,e,{enabled:!I,stateAttributesMapping:ve,state:me,ref:he,props:ge});return I?(0,$.jsx)(Bn,{tag:`button`,render:n,className:r,style:i,state:me,refs:he,props:ge,stateAttributesMapping:ve}):T?(0,$.jsxs)(Q.Fragment,{children:[(0,$.jsx)(k,{ref:b.context.beforeTriggerFocusGuardRef,onFocus:fe},`${S}-pre-focus-guard`),(0,$.jsx)(Q.Fragment,{children:_e},S),(0,$.jsx)(k,{ref:b.context.triggerFocusTargetRef,onFocus:pe},`${S}-post-focus-guard`)]}):(0,$.jsx)(Q.Fragment,{children:_e},S)});function Kn(e,t){let n=ee(),[r,i]=Q.useState(!1);return Y(()=>{e&&t===`trigger-hover`?(i(!0),n.start(500,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function qn(){let e=En(!0);return Q.useMemo(()=>e?{type:`menubar`,context:e}:{type:void 0},[e])}function Jn({...e}){return(0,$.jsx)(In,{"data-slot":`dropdown-menu`,...e})}function Yn({...e}){return(0,$.jsx)(Gn,{"data-slot":`dropdown-menu-trigger`,...e})}function Xn({align:e=`start`,alignOffset:t=0,side:n=`bottom`,sideOffset:r=4,className:i,...a}){return(0,$.jsx)(dn,{children:(0,$.jsx)(hn,{className:`isolate z-50 outline-none`,align:e,alignOffset:t,side:n,sideOffset:r,children:(0,$.jsx)(cn,{"data-slot":`dropdown-menu-content`,className:nt(`z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95`,i),...a})})})}function Zn({...e}){return(0,$.jsx)(qt,{"data-slot":`dropdown-menu-group`,...e})}function Qn({className:e,inset:t,...n}){return(0,$.jsx)(Jt,{"data-slot":`dropdown-menu-label`,"data-inset":t,className:nt(`px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7`,e),...n})}function $n({className:e,inset:t,variant:n=`default`,...r}){return(0,$.jsx)(Xt,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:nt(`group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive`,e),...r})}function er({className:e,children:t,checked:n,inset:r,...i}){return(0,$.jsxs)(Ht,{"data-slot":`dropdown-menu-checkbox-item`,"data-inset":r,className:nt(`relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),checked:n,...i,children:[(0,$.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex items-center justify-center`,"data-slot":`dropdown-menu-checkbox-item-indicator`,children:(0,$.jsx)(Ut,{children:(0,$.jsx)(ft,{"aria-hidden":`true`})})}),t]})}function tr({...e}){return(0,$.jsx)(yn,{"data-slot":`dropdown-menu-radio-group`,...e})}function nr({className:e,children:t,inset:n,...r}){return(0,$.jsxs)(Cn,{"data-slot":`dropdown-menu-radio-item`,"data-inset":n,className:nt(`relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r,children:[(0,$.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex items-center justify-center`,"data-slot":`dropdown-menu-radio-item-indicator`,children:(0,$.jsx)(wn,{children:(0,$.jsx)(ft,{"aria-hidden":`true`})})}),t]})}function rr({className:e,...t}){return(0,$.jsx)(rt,{"data-slot":`dropdown-menu-separator`,className:nt(`-mx-1 my-1 h-px bg-border`,e),...t})}var ir=new Map([[`bold`,Q.createElement(Q.Fragment,null,Q.createElement(`path`,{d:`M208.49,120.49a12,12,0,0,1-17,0L140,69V216a12,12,0,0,1-24,0V69L64.49,120.49a12,12,0,0,1-17-17l72-72a12,12,0,0,1,17,0l72,72A12,12,0,0,1,208.49,120.49Z`}))],[`duotone`,Q.createElement(Q.Fragment,null,Q.createElement(`path`,{d:`M200,112H56l72-72Z`,opacity:`0.2`}),Q.createElement(`path`,{d:`M205.66,106.34l-72-72a8,8,0,0,0-11.32,0l-72,72A8,8,0,0,0,56,120h64v96a8,8,0,0,0,16,0V120h64a8,8,0,0,0,5.66-13.66ZM75.31,104,128,51.31,180.69,104Z`}))],[`fill`,Q.createElement(Q.Fragment,null,Q.createElement(`path`,{d:`M207.39,115.06A8,8,0,0,1,200,120H136v96a8,8,0,0,1-16,0V120H56a8,8,0,0,1-5.66-13.66l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,207.39,115.06Z`}))],[`light`,Q.createElement(Q.Fragment,null,Q.createElement(`path`,{d:`M204.24,116.24a6,6,0,0,1-8.48,0L134,54.49V216a6,6,0,0,1-12,0V54.49L60.24,116.24a6,6,0,0,1-8.48-8.48l72-72a6,6,0,0,1,8.48,0l72,72A6,6,0,0,1,204.24,116.24Z`}))],[`regular`,Q.createElement(Q.Fragment,null,Q.createElement(`path`,{d:`M205.66,117.66a8,8,0,0,1-11.32,0L136,59.31V216a8,8,0,0,1-16,0V59.31L61.66,117.66a8,8,0,0,1-11.32-11.32l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,205.66,117.66Z`}))],[`thin`,Q.createElement(Q.Fragment,null,Q.createElement(`path`,{d:`M202.83,114.83a4,4,0,0,1-5.66,0L132,49.66V216a4,4,0,0,1-8,0V49.66L58.83,114.83a4,4,0,0,1-5.66-5.66l72-72a4,4,0,0,1,5.66,0l72,72A4,4,0,0,1,202.83,114.83Z`}))]]),ar=Q.forwardRef((e,t)=>Q.createElement(Ue,{ref:t,...e,weights:ir}));ar.displayName=`ArrowUpIcon`;var or=new Map([[`bold`,Q.createElement(Q.Fragment,null,Q.createElement(`path`,{d:`M208.49,152.49l-72,72a12,12,0,0,1-17,0l-72-72a12,12,0,0,1,17-17L116,187V40a12,12,0,0,1,24,0V187l51.51-51.52a12,12,0,0,1,17,17Z`}))],[`duotone`,Q.createElement(Q.Fragment,null,Q.createElement(`path`,{d:`M200,144l-72,72L56,144Z`,opacity:`0.2`}),Q.createElement(`path`,{d:`M207.39,140.94A8,8,0,0,0,200,136H136V40a8,8,0,0,0-16,0v96H56a8,8,0,0,0-5.66,13.66l72,72a8,8,0,0,0,11.32,0l72-72A8,8,0,0,0,207.39,140.94ZM128,204.69,75.31,152H180.69Z`}))],[`fill`,Q.createElement(Q.Fragment,null,Q.createElement(`path`,{d:`M205.66,149.66l-72,72a8,8,0,0,1-11.32,0l-72-72A8,8,0,0,1,56,136h64V40a8,8,0,0,1,16,0v96h64a8,8,0,0,1,5.66,13.66Z`}))],[`light`,Q.createElement(Q.Fragment,null,Q.createElement(`path`,{d:`M204.24,148.24l-72,72a6,6,0,0,1-8.48,0l-72-72a6,6,0,0,1,8.48-8.48L122,201.51V40a6,6,0,0,1,12,0V201.51l61.76-61.75a6,6,0,0,1,8.48,8.48Z`}))],[`regular`,Q.createElement(Q.Fragment,null,Q.createElement(`path`,{d:`M205.66,149.66l-72,72a8,8,0,0,1-11.32,0l-72-72a8,8,0,0,1,11.32-11.32L120,196.69V40a8,8,0,0,1,16,0V196.69l58.34-58.35a8,8,0,0,1,11.32,11.32Z`}))],[`thin`,Q.createElement(Q.Fragment,null,Q.createElement(`path`,{d:`M202.83,146.83l-72,72a4,4,0,0,1-5.66,0l-72-72a4,4,0,0,1,5.66-5.66L124,206.34V40a4,4,0,0,1,8,0V206.34l65.17-65.17a4,4,0,0,1,5.66,5.66Z`}))]]),sr=Q.forwardRef((e,t)=>Q.createElement(Ue,{ref:t,...e,weights:or}));sr.displayName=`ArrowDownIcon`;export{Xn as a,Qn as c,rr as d,Yn as f,er as i,tr as l,ar as n,Zn as o,Jn as r,$n as s,sr as t,nr as u};
@@ -0,0 +1 @@
1
+ import{i as e,s as t}from"./engine-CBuzy-Ik.js";import{V as n}from"./button-D5kdANef.js";var r=t(e(),1),i=new Map([[`bold`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M216.49,104.49l-80,80a12,12,0,0,1-17,0l-80-80a12,12,0,0,1,17-17L128,159l71.51-71.52a12,12,0,0,1,17,17Z`}))],[`duotone`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M208,96l-80,80L48,96Z`,opacity:`0.2`}),r.createElement(`path`,{d:`M215.39,92.94A8,8,0,0,0,208,88H48a8,8,0,0,0-5.66,13.66l80,80a8,8,0,0,0,11.32,0l80-80A8,8,0,0,0,215.39,92.94ZM128,164.69,67.31,104H188.69Z`}))],[`fill`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,48,88H208a8,8,0,0,1,5.66,13.66Z`}))],[`light`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M212.24,100.24l-80,80a6,6,0,0,1-8.48,0l-80-80a6,6,0,0,1,8.48-8.48L128,167.51l75.76-75.75a6,6,0,0,1,8.48,8.48Z`}))],[`regular`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z`}))],[`thin`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M210.83,98.83l-80,80a4,4,0,0,1-5.66,0l-80-80a4,4,0,0,1,5.66-5.66L128,170.34l77.17-77.17a4,4,0,1,1,5.66,5.66Z`}))]]),a=r.forwardRef((e,t)=>r.createElement(n,{ref:t,...e,weights:i}));a.displayName=`CaretDownIcon`;export{a as t};
@@ -0,0 +1 @@
1
+ import{i as e,r as t,s as n}from"./engine-CBuzy-Ik.js";var r=n(e(),1),i=t(),a=class extends r.Component{constructor(...e){super(...e),this.state={error:0},this.reset=()=>{this.setState({error:0})}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:0}:{resetKey:n}}static getDerivedStateFromError(e){return{error:[e]}}componentDidCatch(e,t){this.props.onCatch?.(e,t)}render(){let e=this.state.error;return e?r.createElement(this.props.errorComponent??o,{error:e[0],reset:this.reset}):this.props.children}};function o({error:e}){let[t,n]=r.useState(!1);return(0,i.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,i.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,i.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,i.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,i.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,i.jsx)(`div`,{children:(0,i.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e?.message?(0,i.jsx)(`code`,{children:e.message}):null})}):null]})}export{o as n,a as t};
@@ -0,0 +1 @@
1
+ import{i as e,s as t}from"./engine-CBuzy-Ik.js";import{V as n}from"./button-D5kdANef.js";var r=t(e(),1),i=new Map([[`bold`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M216,28H88A12,12,0,0,0,76,40V76H40A12,12,0,0,0,28,88V216a12,12,0,0,0,12,12H168a12,12,0,0,0,12-12V180h36a12,12,0,0,0,12-12V40A12,12,0,0,0,216,28ZM156,204H52V100H156Zm48-48H180V88a12,12,0,0,0-12-12H100V52H204Z`}))],[`duotone`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M216,40V168H168V88H88V40Z`,opacity:`0.2`}),r.createElement(`path`,{d:`M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z`}))],[`fill`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32Zm-8,128H176V88a8,8,0,0,0-8-8H96V48H208Z`}))],[`light`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M216,34H88a6,6,0,0,0-6,6V82H40a6,6,0,0,0-6,6V216a6,6,0,0,0,6,6H168a6,6,0,0,0,6-6V174h42a6,6,0,0,0,6-6V40A6,6,0,0,0,216,34ZM162,210H46V94H162Zm48-48H174V88a6,6,0,0,0-6-6H94V46H210Z`}))],[`regular`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z`}))],[`thin`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M216,36H88a4,4,0,0,0-4,4V84H40a4,4,0,0,0-4,4V216a4,4,0,0,0,4,4H168a4,4,0,0,0,4-4V172h44a4,4,0,0,0,4-4V40A4,4,0,0,0,216,36ZM164,212H44V92H164Zm48-48H172V88a4,4,0,0,0-4-4H92V44H212Z`}))]]),a=r.forwardRef((e,t)=>r.createElement(n,{ref:t,...e,weights:i}));a.displayName=`CopyIcon`;export{a as t};
@@ -0,0 +1 @@
1
+ import{i as e,r as t,s as n}from"./engine-CBuzy-Ik.js";import{At as r,B as i,C as a,D as o,Dt as s,Et as c,Ft as l,G as u,I as d,It as f,L as p,Lt as m,M as h,Mt as g,N as _,Pt as v,Qt as y,Rt as b,T as x,Tt as S,U as ee,Ut as C,V as te,W as ne,Wt as re,X as ie,Zt as ae,a as oe,at as se,ct as ce,d as w,et as le,f as T,ft as ue,gn as E,h as de,hn as fe,i as D,it as pe,kt as me,l as O,lt as he,m as k,n as ge,nt as _e,o as A,p as j,pn as ve,pt as ye,qt as M,r as be,rt as xe,t as Se,tt as Ce,u as we,v as N,wt as P,z as Te,zt as F}from"./store-BT988jIX.js";import{F as I,I as L,M as R,T as Ee,_ as z,c as B,d as De,h as Oe,i as V,k as H,u as ke,v as Ae}from"./button-D5kdANef.js";import{a as je,f as Me}from"./composite-9cNA7N0P.js";var U=n(e(),1),Ne=0;function Pe(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(Ne);function a(){(!i||i())&&e?.focus({preventScroll:n})}if(r)return a(),B;let o=requestAnimationFrame(a);return Ne=o,()=>{Ne===o&&(cancelAnimationFrame(o),Ne=0)}}var Fe=`data-base-ui-inert`,W=new WeakMap,G=new WeakSet,K=new WeakMap,Ie=0;function q(e){return e?L(e)?e.host:q(e.parentNode):null}var J=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=q(t);return e.contains(n)?n:null}).filter(e=>e!=null),Y=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},X=(e,t,n)=>{let r=[],i=e=>{e&&!n.has(e)&&Array.from(e.children).forEach(e=>{Ee(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function Le(e,t,n,{mark:r=!0}){let i=J(t,e),a=r?X(t,Y(i),new Set(i)):[],o=[],s=[];if(n){let e=J(t,Array.from(t.querySelectorAll(`[aria-live]`))),n=i.concat(e);X(t,Y(n),new Set(n)).forEach(e=>{let t=e.getAttribute(`aria-hidden`),n=t!==null&&t!==`false`,r=(W.get(e)||0)+1;W.set(e,r),o.push(e),r===1&&n&&G.add(e),n||e.setAttribute(`aria-hidden`,`true`)})}return r&&a.forEach(e=>{let t=(K.get(e)||0)+1;K.set(e,t),s.push(e),t===1&&e.setAttribute(Fe,``)}),Ie+=1,()=>{o.forEach(e=>{let t=(W.get(e)||0)-1;W.set(e,t),t||(G.has(e)||e.removeAttribute(`aria-hidden`),G.delete(e))}),r&&s.forEach(e=>{let t=(K.get(e)||0)-1;K.set(e,t),t||e.removeAttribute(Fe)}),--Ie,Ie||(W=new WeakMap,G=new WeakSet,K=new WeakMap)}}function Re(e,t={}){let{ariaHidden:n=!1,mark:r=!0}=t,i=E(e[0]).body;return Le(e,i,n,{mark:r})}var Z=t();function ze(e,t){let n=H(s(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||(le(e)?`keyboard`:t||`mouse`):`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var Be=20,Q=[];function Ve(){Q=Q.filter(e=>e.deref()?.isConnected)}function He(e){Ve(),e&&Ee(e)!==`body`&&(Q.push(new WeakRef(e)),Q.length>Be&&(Q=Q.slice(-20)))}function Ue(){return Ve(),Q[Q.length-1]?.deref()}function We(e){return e?ne(e)?e:u(e)[0]||e:null}function Ge(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=Te(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return ne(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function Ke(e){let{context:t,children:n,disabled:r=!1,initialFocus:f=!0,returnFocus:p=!0,explicitReturnFocus:g,restoreFocus:y=!1,modal:x=!0,closeOnFocusOut:C=!0,openInteractionType:oe=``,nextFocusableElement:w,previousFocusableElement:T,beforeContentFocusGuardRef:ue,externalTree:de,getInsideElements:fe}=e,D=t.useState(`open`),O=t.useState(`domReferenceElement`),k=t.useState(`floatingElement`),{events:ge,dataRef:A}=t.context,j=Ae(()=>A.current.floatingContext?.nodeId),ye=f===!1,M=ce(O)&&ye,be=l(f),Se=l(p),we=l(g),N=l(oe),Te=l(D),F=a(de),I=o(),L=U.useRef(!1),B=U.useRef(!1),De=U.useRef(!1),Oe=U.useRef(null),V=U.useRef(``),H=U.useRef(``),je=U.useRef(null),Me=U.useRef(null),Ne=ke(je,ue,I?.beforeInsideRef),Fe=ke(Me,I?.afterInsideRef),W=m(),G=m(),K=re(),Ie=I!=null,q=se(k),J=Ae((e=q)=>e?u(e):[]),Y=Ae(()=>fe?.().filter(e=>e!=null)??[]);U.useEffect(()=>{if(r||!x)return;function e(e){e.key===`Tab`&&c(q,P(E(q)))&&J().length===0&&!M&&_e(e)}let t=E(q);return b(t,`keydown`,e)},[r,q,x,M,J]),U.useEffect(()=>{if(r||!D)return;let e=E(q);function t(){De.current=!1}function n(e){let t=s(e),n=Y(),r=c(k,t)||c(O,t)||c(I?.portalNode,t)||n.some(e=>e===t||c(e,t));De.current=!r,H.current=e.pointerType||`keyboard`,S(t,`[data-base-ui-click-trigger]`)&&(B.current=!0,G.start(0,()=>{B.current=!1}))}function i(){H.current=`keyboard`}return d(b(e,`pointerdown`,n,!0),b(e,`pointerup`,t,!0),b(e,`pointercancel`,t,!0),b(e,`keydown`,i,!0),t)},[r,k,O,q,D,I,G,Y]),U.useEffect(()=>{if(r||!C)return;let e=E(q);function n(){B.current=!0,G.start(0,()=>{B.current=!1})}function i(e){let t=s(e);ne(t)&&(Oe.current=t)}function a(n){let r=n.relatedTarget,i=n.currentTarget,a=s(n);x&&r==null&&a!=null&&c(k,a)&&He(a),queueMicrotask(()=>{let o=j(),s=t.context.triggerElements,l=Y(),u=r?.hasAttribute(h(`focus-guard`))&&[je.current,Me.current,I?.beforeInsideRef.current,I?.afterInsideRef.current,I?.beforeOutsideRef.current,I?.afterOutsideRef.current,v(T),v(w)].includes(r),d=!(c(O,r)||c(k,r)||c(r,k)||c(I?.portalNode,r)||l.some(e=>e===r||c(e,r))||s.hasMatchingElement(e=>c(e,r))||u||F&&(pe(F.nodesRef.current,o).find(e=>c(e.context?.elements.floating,r)||c(e.context?.elements.domReference,r))||xe(F.nodesRef.current,o).find(e=>[e.context?.elements.floating,se(e.context?.elements.floating)].includes(r)||e.context?.elements.domReference===r)));if(i===O&&q&&Ge(q),y&&i!==O&&!ie(a)&&P(e)===e.body){if(R(q)&&(q.focus(),y===`popup`)){K.request(()=>{q.focus()});return}let e=J(),t=Oe.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||q;R(n)&&n.focus()}A.current.insideReactTree?A.current.insideReactTree=!1:(M||!x)&&r&&d&&!B.current&&(M||r!==Ue())&&(L.current=!0,t.setOpen(!1,ve(ae,n)))})}function o(){De.current||(A.current.insideReactTree=!0,W.start(0,()=>{A.current.insideReactTree=!1}))}let l=R(O)?O:null;if(k||l)return d(l&&b(l,`focusout`,a),l&&b(l,`pointerdown`,n),k&&b(k,`focusin`,i),k&&b(k,`focusout`,a),k&&I&&b(k,`focusout`,o,!0))},[r,O,k,q,x,F,I,t,C,y,J,M,j,A,W,G,K,w,T,Y]),U.useEffect(()=>{if(r||!k||!D)return;let e=Array.from(I?.portalNode?.querySelectorAll(`[${h(`portal`)}]`)||[]),t=(F?xe(F.nodesRef.current,j()):[]).find(e=>ce(e.context?.elements.domReference||null))?.context?.elements.domReference,n=Re([k,...e,je.current,Me.current,I?.beforeOutsideRef.current,I?.afterOutsideRef.current,...Y(),t,v(T),v(w),M?O:null].filter(e=>e!=null),{ariaHidden:x||M,mark:!1}),i=Re([k,...e].filter(e=>e!=null));return()=>{i(),n()}},[D,r,O,k,x,I,M,F,j,w,T,Y]),z(()=>{if(!D||r||!R(q))return;V.current=``,H.current=``;let e=E(q),t=P(e);queueMicrotask(()=>{let n=be.current,r=typeof n==`function`?n(N.current||``):n;if(r===void 0||r===!1||c(q,t))return;let i=null,a=()=>(i??=J(q),i[0]||q),o;o=r===!0||r===null?a():v(r),o||=a();let s=c(q,P(e)),l=A.current.openEvent,u=l?.type===`mousedown`&&le(l);Pe(o,{sync:u,preventScroll:o===q,shouldFocus(){if(!Te.current)return!1;if(s)return!0;let t=P(e);return!(t!==o&&c(q,t))}})})},[r,D,q,J,be,N,Te,A]);let X=U.useRef(null);z(()=>{if(r||!q){X.current=null;return}X.current&&=(X.current.cancelled=!0,null);let e=E(q),t=P(e),n=N.current==null;He(t);function i(e){if(e.open||(V.current=ze(e.nativeEvent,H.current)),(e.reason===`focus-out`&&e.triggerElement?.hasAttribute(h(`focus-guard`))||e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`)&&(L.current=!0),e.reason===`outside-press`){if(e.nested)L.current=!1;else if(le(e.nativeEvent)||Ce(e.nativeEvent))L.current=!1;else{let e=!1;E(q).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?L.current=!1:L.current=!0}}}ge.on(`openchange`,i);function a(e){let r=Se.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=O?.isConnected?O:null,o=t?.isConnected&&Ee(t)!==`body`?t:null,s=n?o||a:a||o;return s||=Ue()||null,typeof i==`boolean`?s:v(i)||s||null}return()=>{ge.off(`openchange`,i);let t=P(e),n=Y(),r=c(k,t)||n.some(e=>e===t||c(e,t))||F&&pe(F.nodesRef.current,j(),!1).some(e=>c(e.context?.elements.floating,t)),o=Se.current,s=V.current,l=a(s),u={cancelled:!1};X.current=u,queueMicrotask(()=>{X.current===u&&(X.current=null);let n=We(l),i=we.current??typeof o!=`boolean`;if(!u.cancelled&&o&&!L.current&&R(n)&&(i||n===t||t===e.body||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}L.current=!1})}},[r,k,q,Se,we,N,ge,F,O,j,Y]),z(()=>{if(!me||D||!k)return;let e=P(E(k));R(e)&&he(e)&&c(k,e)&&e.blur()},[D,k]),z(()=>{if(!r&&I)return I.setFocusManagerState({modal:x,closeOnFocusOut:C,open:D,onOpenChange:t.setOpen,domReference:O}),()=>{I.setFocusManagerState(null)}},[r,I,x,D,t,C,O]),z(()=>{if(!r&&q)return Ge(q),()=>{queueMicrotask(Ve)}},[r,q]);let Le=!r&&(!x||!M)&&(Ie||x);return(0,Z.jsxs)(U.Fragment,{children:[Le&&(0,Z.jsx)(_,{"data-type":`inside`,ref:Ne,onFocus:e=>{if(x){let e=J();Pe(e[e.length-1])}else I?.portalNode&&(L.current=!1,ee(e,I.portalNode)?i(O)?.focus():v(T??I.beforeOutsideRef)?.focus())}}),n,Le&&(0,Z.jsx)(_,{"data-type":`inside`,ref:Fe,onFocus:e=>{x?Pe(J()[0]):I?.portalNode&&(C&&(L.current=!0),ee(e,I.portalNode)?te(O)?.focus():v(w??I.afterOutsideRef)?.focus())}})]})}var qe=U.createContext(void 0);function $(e){let t=U.useContext(qe);if(!e&&t===void 0)throw Error(Oe(27));return t}var Je=U.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=$(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`),d={open:c,transitionStatus:s.useState(`transitionStatus`)};return V(`div`,e,{state:d,ref:[s.context.backdropRef,t],stateAttributesMapping:ye,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})}),Ye=U.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,...s}=e,c=$(),l=c.useState(`open`),{getButtonProps:u,buttonRef:d}=De({disabled:a,native:o}),f={disabled:a};function p(e){l&&c.setOpen(!1,ve(M,e.nativeEvent))}return V(`button`,e,{state:f,ref:[t,d],props:[{onClick:p},s,u]})}),Xe=U.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=$(),c=fe(a);return s.useSyncedValueWithCleanup(`descriptionElementId`,c),V(`p`,e,{ref:t,props:[{id:c},o]})}),Ze=U.createContext(void 0);function Qe(){let e=U.useContext(Ze);if(e===void 0)throw Error(Oe(26));return e}var $e=`--nested-dialogs`,et=`data-nested-dialog-open`,tt={...ue,...F,nestedDialogOpen(e){return e?{[et]:``}:null}},nt=U.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...s}=e,c=$(),l=c.useState(`descriptionElementId`),u=c.useState(`disablePointerDismissal`),d=c.useState(`floatingRootContext`),f=c.useState(`popupProps`),p=c.useState(`modal`),m=c.useState(`mounted`),h=c.useState(`nested`),_=c.useState(`nestedOpenDialogCount`),v=c.useState(`open`),y=c.useState(`openMethod`),b=c.useState(`titleElementId`),x=c.useState(`transitionStatus`),S=c.useState(`role`),ee=d.useState(`floatingId`);Qe(),g({open:v,ref:c.context.popupRef,onComplete(){v&&c.context.onOpenChangeComplete?.(!0)}});let C=o===void 0?O(c.context.popupRef):o,te=_>0,ne=c.useStateSetter(`popupElement`),re=V(`div`,e,{state:{open:v,nested:h,transitionStatus:x,nestedDialogOpen:te},props:[f,{id:ee,"aria-labelledby":b,"aria-describedby":l,role:S,...oe,hidden:!m,onKeyDown(e){je.has(e.key)&&e.stopPropagation()},style:{[$e]:_}},s],ref:[t,c.context.popupRef,ne],stateAttributesMapping:tt});return(0,Z.jsx)(Ke,{context:d,openInteractionType:y,disabled:!m,closeOnFocusOut:!u,initialFocus:C,returnFocus:a,modal:p!==!1,restoreFocus:`popup`,children:re})}),rt=U.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,Z.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})}),it=U.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=$(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,Z.jsx)(Ze.Provider,{value:n,children:(0,Z.jsxs)(x,{ref:t,...r,children:[a&&o===!0&&(0,Z.jsx)(rt,{ref:i.context.internalBackdropRef,inert:Me(!s)}),e.children]})}):null}),at={},ot={},st=``;function ct(e,t){return I(e)?e:t}function lt(e,t,n){return/hidden|clip/.test(e.getComputedStyle(ct(t,n)).overflowY)}function ut(e){if(typeof document>`u`)return!1;let t=E(e);return H(t).innerWidth-t.documentElement.clientWidth>0}function dt(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=E(e),n=t.documentElement,r=t.body,i=ct(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function ft(e){let t=E(e),n=t.documentElement,r=t.body,i=ct(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function pt(e){let t=E(e),n=t.documentElement,r=t.body,i=H(n),a=0,o=0,s=!1,c=C.create();if(me&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,at={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},st=n.style.scrollBehavior,ot={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=ct(n,r);s=dt(e),s?(n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`):(Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`)}function u(){Object.assign(n.style,at),Object.assign(r.style,ot),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=st)}function d(){u(),c.request(l)}l();let f=b(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var mt=new class{lockCount=0;restore=null;timeoutLock=f.create();timeoutUnlock=f.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=E(e),n=t.documentElement,i=t.body,a=H(n);if(lt(a,n,i)){let t=new a.MutationObserver(()=>{lt(a,n,i)||(t.disconnect(),this.restore=null,this.lock(e))}),r={attributes:!0};t.observe(n,r),t.observe(i,r),this.restore=()=>t.disconnect();return}let o=r||!ut(e);this.restore=o?ft(e):pt(e)}};function ht(e=!0,t=null){z(()=>{if(e)return mt.acquire(t)},[e,t])}function gt({store:e,parentContext:t,isDrawer:n}){let r=e.useState(`open`),i=e.useState(`mounted`),a=e.useState(`disablePointerDismissal`),o=e.useState(`modal`),l=e.useState(`popupElement`),u=e.useState(`floatingRootContext`),[d,f]=U.useState(0),[p,m]=U.useState(0),h=d===0,g=N(u,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||`button`in t&&t.button!==0)return!1;if(`touches`in t){if(t.type===`touchend`){if(t.changedTouches.length!==1||t.touches.length!==0)return!1}else if(t.touches.length!==1)return!1}let n=s(t);if(h&&!a){if(o){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||c(n,l)&&!n?.hasAttribute(`data-base-ui-portal`):!0}return!0}return!1},escapeKey:h});return ht(r&&o===!0,l),e.useContextCallback(`onNestedDialogOpen`,(t,n)=>{(e.select(`open`)||e.select(`mounted`))&&(f(t),m(n))}),z(()=>{!r&&!i&&(f(0),m(0))},[r,i]),z(()=>(t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(d+1,p+ +!!n),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,d,p,t]),j(e,{activeTriggerProps:g.reference,inactiveTriggerProps:g.trigger,popupProps:g.floating,nestedOpenDialogCount:d,nestedOpenDrawerCount:p}),null}var _t={...ge,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role},vt=class extends be{constructor(e,t,n){let r=new D,i=yt(e,r,t,n);super(i,bt(r),_t)}setOpen=(e,t)=>{t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),!t.isCanceled&&(this.state.floatingRootContext.dispatchOpenChange(e,t),this.update(we(this.state,e,t.trigger)))}};function yt(e,t,n,r=!1){return{...Se(t,n,r),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e}}function bt(e){return{popupRef:U.createRef(),backdropRef:U.createRef(),internalBackdropRef:U.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function xt(e,t){let{children:n,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:o,disablePointerDismissal:s=!1,modal:c=!0,actionsRef:l,handle:u,triggerId:d,defaultTriggerId:f=null}=t,p=e===`drawer`,m=e===`alert-dialog`,h=m?!0:c,g=m||s,_=m?`alertdialog`:`dialog`,v=$(!0),b={modal:h,disablePointerDismissal:g,nested:v!=null,role:_},x=k((e,t)=>new vt({open:i,openProp:r,activeTriggerId:f,triggerIdProp:d,...b},e,t),!0);x.useControlledProp(`openProp`,r),x.useControlledProp(`triggerIdProp`,d),x.useSyncedValues(b),x.useContextCallback(`onOpenChange`,a),x.useContextCallback(`onOpenChangeComplete`,o);let S=x.useState(`open`),ee=x.useState(`mounted`),C=x.useState(`payload`);de(x,S),w(x);let{forceUnmount:te}=T(S,x);U.useImperativeHandle(l,()=>({unmount:te,close:()=>x.setOpen(!1,ve(y))}),[te,x]);let ne=S||ee||u!=null;return(0,Z.jsxs)(qe.Provider,{value:x,children:[u&&(0,Z.jsx)(A,{handle:u,store:x}),ne&&(0,Z.jsx)(gt,{store:x,parentContext:v?.context,isDrawer:p}),typeof n==`function`?n({payload:C}):n]})}var St=p(function(e){return xt(`dialog`,e)}),Ct=U.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=$(),c=fe(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),V(`h2`,e,{ref:t,props:[{id:c},o]})});export{rt as a,Ye as c,Ke as d,Pe as f,it as i,Je as l,St as n,nt as o,ht as r,Xe as s,Ct as t,$ as u};
@@ -0,0 +1 @@
1
+ import{i as e,s as t}from"./engine-CBuzy-Ik.js";import{V as n}from"./button-D5kdANef.js";var r=t(e(),1),i=new Map([[`bold`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M222.14,69.17,186.83,33.86A19.86,19.86,0,0,0,172.69,28H48A20,20,0,0,0,28,48V208a20,20,0,0,0,20,20H208a20,20,0,0,0,20-20V83.31A19.86,19.86,0,0,0,222.14,69.17ZM164,204H92V160h72Zm40,0H188V156a20,20,0,0,0-20-20H88a20,20,0,0,0-20,20v48H52V52H171l33,33ZM164,84a12,12,0,0,1-12,12H96a12,12,0,0,1,0-24h56A12,12,0,0,1,164,84Z`}))],[`duotone`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M216,83.31V208a8,8,0,0,1-8,8H176V152a8,8,0,0,0-8-8H88a8,8,0,0,0-8,8v64H48a8,8,0,0,1-8-8V48a8,8,0,0,1,8-8H172.69a8,8,0,0,1,5.65,2.34l35.32,35.32A8,8,0,0,1,216,83.31Z`,opacity:`0.2`}),r.createElement(`path`,{d:`M219.31,72,184,36.69A15.86,15.86,0,0,0,172.69,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V83.31A15.86,15.86,0,0,0,219.31,72ZM168,208H88V152h80Zm40,0H184V152a16,16,0,0,0-16-16H88a16,16,0,0,0-16,16v56H48V48H172.69L208,83.31ZM160,72a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h56A8,8,0,0,1,160,72Z`}))],[`fill`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M219.31,72,184,36.69A15.86,15.86,0,0,0,172.69,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V83.31A15.86,15.86,0,0,0,219.31,72ZM208,208H184V152a16,16,0,0,0-16-16H88a16,16,0,0,0-16,16v56H48V48H172.69L208,83.31ZM160,72a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h56A8,8,0,0,1,160,72Z`}))],[`light`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M217.9,73.42,182.58,38.1a13.9,13.9,0,0,0-9.89-4.1H48A14,14,0,0,0,34,48V208a14,14,0,0,0,14,14H208a14,14,0,0,0,14-14V83.31A13.9,13.9,0,0,0,217.9,73.42ZM170,210H86V152a2,2,0,0,1,2-2h80a2,2,0,0,1,2,2Zm40-2a2,2,0,0,1-2,2H182V152a14,14,0,0,0-14-14H88a14,14,0,0,0-14,14v58H48a2,2,0,0,1-2-2V48a2,2,0,0,1,2-2H172.69a2,2,0,0,1,1.41.58L209.42,81.9a2,2,0,0,1,.58,1.41ZM158,72a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h56A6,6,0,0,1,158,72Z`}))],[`regular`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M219.31,72,184,36.69A15.86,15.86,0,0,0,172.69,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V83.31A15.86,15.86,0,0,0,219.31,72ZM168,208H88V152h80Zm40,0H184V152a16,16,0,0,0-16-16H88a16,16,0,0,0-16,16v56H48V48H172.69L208,83.31ZM160,72a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h56A8,8,0,0,1,160,72Z`}))],[`thin`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M216.49,74.83,181.17,39.51A11.93,11.93,0,0,0,172.69,36H48A12,12,0,0,0,36,48V208a12,12,0,0,0,12,12H208a12,12,0,0,0,12-12V83.31A11.93,11.93,0,0,0,216.49,74.83ZM172,212H84V152a4,4,0,0,1,4-4h80a4,4,0,0,1,4,4Zm40-4a4,4,0,0,1-4,4H180V152a12,12,0,0,0-12-12H88a12,12,0,0,0-12,12v60H48a4,4,0,0,1-4-4V48a4,4,0,0,1,4-4H172.69a4,4,0,0,1,2.82,1.17l35.32,35.32A4,4,0,0,1,212,83.31ZM156,72a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h56A4,4,0,0,1,156,72Z`}))]]),a=r.forwardRef((e,t)=>r.createElement(n,{ref:t,...e,weights:i}));a.displayName=`FloppyDiskIcon`;export{a as t};
@@ -0,0 +1 @@
1
+ import{i as e,s as t}from"./engine-CBuzy-Ik.js";import{V as n}from"./button-D5kdANef.js";var r=t(e(),1),i=new Map([[`bold`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,187a113.4,113.4,0,0,1-20.39-35h40.82a116.94,116.94,0,0,1-10,20.77A108.61,108.61,0,0,1,128,207Zm-26.49-59a135.42,135.42,0,0,1,0-40h53a135.42,135.42,0,0,1,0,40ZM44,128a83.49,83.49,0,0,1,2.43-20H77.25a160.63,160.63,0,0,0,0,40H46.43A83.49,83.49,0,0,1,44,128Zm84-79a113.4,113.4,0,0,1,20.39,35H107.59a116.94,116.94,0,0,1,10-20.77A108.61,108.61,0,0,1,128,49Zm50.73,59h30.82a83.52,83.52,0,0,1,0,40H178.75a160.63,160.63,0,0,0,0-40Zm20.77-24H173.71a140.82,140.82,0,0,0-15.5-34.36A84.51,84.51,0,0,1,199.52,84ZM97.79,49.64A140.82,140.82,0,0,0,82.29,84H56.48A84.51,84.51,0,0,1,97.79,49.64ZM56.48,172H82.29a140.82,140.82,0,0,0,15.5,34.36A84.51,84.51,0,0,1,56.48,172Zm101.73,34.36A140.82,140.82,0,0,0,173.71,172h25.81A84.51,84.51,0,0,1,158.21,206.36Z`}))],[`duotone`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z`,opacity:`0.2`}),r.createElement(`path`,{d:`M128,24h0A104,104,0,1,0,232,128,104.12,104.12,0,0,0,128,24Zm88,104a87.61,87.61,0,0,1-3.33,24H174.16a157.44,157.44,0,0,0,0-48h38.51A87.61,87.61,0,0,1,216,128ZM102,168H154a115.11,115.11,0,0,1-26,45A115.27,115.27,0,0,1,102,168Zm-3.9-16a140.84,140.84,0,0,1,0-48h59.88a140.84,140.84,0,0,1,0,48ZM40,128a87.61,87.61,0,0,1,3.33-24H81.84a157.44,157.44,0,0,0,0,48H43.33A87.61,87.61,0,0,1,40,128ZM154,88H102a115.11,115.11,0,0,1,26-45A115.27,115.27,0,0,1,154,88Zm52.33,0H170.71a135.28,135.28,0,0,0-22.3-45.6A88.29,88.29,0,0,1,206.37,88ZM107.59,42.4A135.28,135.28,0,0,0,85.29,88H49.63A88.29,88.29,0,0,1,107.59,42.4ZM49.63,168H85.29a135.28,135.28,0,0,0,22.3,45.6A88.29,88.29,0,0,1,49.63,168Zm98.78,45.6a135.28,135.28,0,0,0,22.3-45.6h35.66A88.29,88.29,0,0,1,148.41,213.6Z`}))],[`fill`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M128,24h0A104,104,0,1,0,232,128,104.12,104.12,0,0,0,128,24Zm78.36,64H170.71a135.28,135.28,0,0,0-22.3-45.6A88.29,88.29,0,0,1,206.37,88ZM216,128a87.61,87.61,0,0,1-3.33,24H174.16a157.44,157.44,0,0,0,0-48h38.51A87.61,87.61,0,0,1,216,128ZM128,43a115.27,115.27,0,0,1,26,45H102A115.11,115.11,0,0,1,128,43ZM102,168H154a115.11,115.11,0,0,1-26,45A115.27,115.27,0,0,1,102,168Zm-3.9-16a140.84,140.84,0,0,1,0-48h59.88a140.84,140.84,0,0,1,0,48Zm50.35,61.6a135.28,135.28,0,0,0,22.3-45.6h35.66A88.29,88.29,0,0,1,148.41,213.6Z`}))],[`light`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm81.57,64H169.19a132.58,132.58,0,0,0-25.73-50.67A90.29,90.29,0,0,1,209.57,90ZM218,128a89.7,89.7,0,0,1-3.83,26H171.81a155.43,155.43,0,0,0,0-52h42.36A89.7,89.7,0,0,1,218,128Zm-90,87.83a110,110,0,0,1-15.19-19.45A124.24,124.24,0,0,1,99.35,166h57.3a124.24,124.24,0,0,1-13.46,30.38A110,110,0,0,1,128,215.83ZM96.45,154a139.18,139.18,0,0,1,0-52h63.1a139.18,139.18,0,0,1,0,52ZM38,128a89.7,89.7,0,0,1,3.83-26H84.19a155.43,155.43,0,0,0,0,52H41.83A89.7,89.7,0,0,1,38,128Zm90-87.83a110,110,0,0,1,15.19,19.45A124.24,124.24,0,0,1,156.65,90H99.35a124.24,124.24,0,0,1,13.46-30.38A110,110,0,0,1,128,40.17Zm-15.46-.84A132.58,132.58,0,0,0,86.81,90H46.43A90.29,90.29,0,0,1,112.54,39.33ZM46.43,166H86.81a132.58,132.58,0,0,0,25.73,50.67A90.29,90.29,0,0,1,46.43,166Zm97,50.67A132.58,132.58,0,0,0,169.19,166h40.38A90.29,90.29,0,0,1,143.46,216.67Z`}))],[`regular`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M128,24h0A104,104,0,1,0,232,128,104.12,104.12,0,0,0,128,24Zm88,104a87.61,87.61,0,0,1-3.33,24H174.16a157.44,157.44,0,0,0,0-48h38.51A87.61,87.61,0,0,1,216,128ZM102,168H154a115.11,115.11,0,0,1-26,45A115.27,115.27,0,0,1,102,168Zm-3.9-16a140.84,140.84,0,0,1,0-48h59.88a140.84,140.84,0,0,1,0,48ZM40,128a87.61,87.61,0,0,1,3.33-24H81.84a157.44,157.44,0,0,0,0,48H43.33A87.61,87.61,0,0,1,40,128ZM154,88H102a115.11,115.11,0,0,1,26-45A115.27,115.27,0,0,1,154,88Zm52.33,0H170.71a135.28,135.28,0,0,0-22.3-45.6A88.29,88.29,0,0,1,206.37,88ZM107.59,42.4A135.28,135.28,0,0,0,85.29,88H49.63A88.29,88.29,0,0,1,107.59,42.4ZM49.63,168H85.29a135.28,135.28,0,0,0,22.3,45.6A88.29,88.29,0,0,1,49.63,168Zm98.78,45.6a135.28,135.28,0,0,0,22.3-45.6h35.66A88.29,88.29,0,0,1,148.41,213.6Z`}))],[`thin`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M128,28h0A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,190.61c-6.33-6.09-23-24.41-31.27-54.61h62.54C151,194.2,134.33,212.52,128,218.61ZM94.82,156a140.42,140.42,0,0,1,0-56h66.36a140.42,140.42,0,0,1,0,56ZM128,37.39c6.33,6.09,23,24.41,31.27,54.61H96.73C105,61.8,121.67,43.48,128,37.39ZM169.41,100h46.23a92.09,92.09,0,0,1,0,56H169.41a152.65,152.65,0,0,0,0-56Zm43.25-8h-45a129.39,129.39,0,0,0-29.19-55.4A92.25,92.25,0,0,1,212.66,92ZM117.54,36.6A129.39,129.39,0,0,0,88.35,92h-45A92.25,92.25,0,0,1,117.54,36.6ZM40.36,100H86.59a152.65,152.65,0,0,0,0,56H40.36a92.09,92.09,0,0,1,0-56Zm3,64h45a129.39,129.39,0,0,0,29.19,55.4A92.25,92.25,0,0,1,43.34,164Zm95.12,55.4A129.39,129.39,0,0,0,167.65,164h45A92.25,92.25,0,0,1,138.46,219.4Z`}))]]),a=r.forwardRef((e,t)=>r.createElement(n,{ref:t,...e,weights:i}));a.displayName=`GlobeIcon`;export{a as t};
@@ -0,0 +1 @@
1
+ import{i as e,s as t}from"./engine-CBuzy-Ik.js";import{V as n}from"./button-D5kdANef.js";var r=t(e(),1),i=new Map([[`bold`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M232.49,215.51,185,168a92.12,92.12,0,1,0-17,17l47.53,47.54a12,12,0,0,0,17-17ZM44,112a68,68,0,1,1,68,68A68.07,68.07,0,0,1,44,112Z`}))],[`duotone`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z`,opacity:`0.2`}),r.createElement(`path`,{d:`M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z`}))],[`fill`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M168,112a56,56,0,1,1-56-56A56,56,0,0,1,168,112Zm61.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88,88,0,1,1,11.32-11.31l50.06,50.06A8,8,0,0,1,229.66,229.66ZM112,184a72,72,0,1,0-72-72A72.08,72.08,0,0,0,112,184Z`}))],[`light`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M228.24,219.76l-51.38-51.38a86.15,86.15,0,1,0-8.48,8.48l51.38,51.38a6,6,0,0,0,8.48-8.48ZM38,112a74,74,0,1,1,74,74A74.09,74.09,0,0,1,38,112Z`}))],[`regular`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z`}))],[`thin`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M226.83,221.17l-52.7-52.7a84.1,84.1,0,1,0-5.66,5.66l52.7,52.7a4,4,0,0,0,5.66-5.66ZM36,112a76,76,0,1,1,76,76A76.08,76.08,0,0,1,36,112Z`}))]]),a=r.forwardRef((e,t)=>r.createElement(n,{ref:t,...e,weights:i}));a.displayName=`MagnifyingGlassIcon`;export{a as t};
@@ -0,0 +1 @@
1
+ import{i as e,s as t}from"./engine-CBuzy-Ik.js";import{V as n}from"./button-D5kdANef.js";function r({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0)n=e.nextSub;else{for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}}while(1)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(1)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function i(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var a=[],o=0,{link:s,unlink:c,propagate:l,checkDirty:u,shallowPropagate:d}=r({update(e){return e._update()},notify(e){a[p++]=e,e.flags&=-3},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,_(e))}}),f=0,p=0,m,h=0;function g(e){try{++h,e()}finally{--h||v()}}function _(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=c(n,e)}function v(){if(!(h>0)){for(;f<p;){let e=a[f];a[f++]=void 0,e.notify()}f=0,p=0}}function y(e,t){let n=typeof e==`function`,r=e,a={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:+!n,get(){return m!==void 0&&s(a,m,o),a._snapshot},subscribe(e){let t=i(e),n={current:!1},r=b(()=>{a.get(),n.current?(m=void 0,t.next?.(a._snapshot)):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let i=m,s=t?.compare??Object.is;if(n)m=a,++o,a.depsTail=void 0;else if(e===void 0)return!1;n&&(a.flags=5);try{let t=a._snapshot,i=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!s(t,i)?(a._snapshot=i,!0):!1}finally{m=i,n&&(a.flags&=-5),_(a)}}};return n?(a.flags=17,a.get=function(){let e=a.flags;if(e&16||e&32&&u(a.deps,a)){if(a._update()){let e=a.subs;e!==void 0&&d(e)}}else e&32&&(a.flags=e&-33);return m!==void 0&&s(a,m,o),a._snapshot}):a.set=function(e){if(a._update(e)){let e=a.subs;e!==void 0&&(l(e),d(e),v())}},a}function b(e){let t=()=>{let t=m;m=n,++o,n.depsTail=void 0,n.flags=6;try{return e()}finally{m=t,n.flags&=-5,_(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:6,notify(){let e=this.flags;e&16||e&32&&u(this.deps,this)?t():this.flags=2},stop(){this.flags=0,this.depsTail=void 0,_(this)}};return t(),n}var x=t(e(),1),S=new Map([[`bold`,x.createElement(x.Fragment,null,x.createElement(`path`,{d:`M234.49,111.07,90.41,22.94A20,20,0,0,0,60,39.87V216.13a20,20,0,0,0,30.41,16.93l144.08-88.13a19.82,19.82,0,0,0,0-33.86ZM84,208.85V47.15L216.16,128Z`}))],[`duotone`,x.createElement(x.Fragment,null,x.createElement(`path`,{d:`M228.23,134.69,84.15,222.81A8,8,0,0,1,72,216.12V39.88a8,8,0,0,1,12.15-6.69l144.08,88.12A7.82,7.82,0,0,1,228.23,134.69Z`,opacity:`0.2`}),x.createElement(`path`,{d:`M232.4,114.49,88.32,26.35a16,16,0,0,0-16.2-.3A15.86,15.86,0,0,0,64,39.87V216.13A15.94,15.94,0,0,0,80,232a16.07,16.07,0,0,0,8.36-2.35L232.4,141.51a15.81,15.81,0,0,0,0-27ZM80,215.94V40l143.83,88Z`}))],[`fill`,x.createElement(x.Fragment,null,x.createElement(`path`,{d:`M240,128a15.74,15.74,0,0,1-7.6,13.51L88.32,229.65a16,16,0,0,1-16.2.3A15.86,15.86,0,0,1,64,216.13V39.87a15.86,15.86,0,0,1,8.12-13.82,16,16,0,0,1,16.2.3L232.4,114.49A15.74,15.74,0,0,1,240,128Z`}))],[`light`,x.createElement(x.Fragment,null,x.createElement(`path`,{d:`M231.36,116.19,87.28,28.06a14,14,0,0,0-14.18-.27A13.69,13.69,0,0,0,66,39.87V216.13a13.69,13.69,0,0,0,7.1,12.08,14,14,0,0,0,14.18-.27l144.08-88.13a13.82,13.82,0,0,0,0-23.62Zm-6.26,13.38L81,217.7a2,2,0,0,1-2.06,0,1.78,1.78,0,0,1-1-1.61V39.87a1.78,1.78,0,0,1,1-1.61A2.06,2.06,0,0,1,80,38a2,2,0,0,1,1,.31L225.1,126.43a1.82,1.82,0,0,1,0,3.14Z`}))],[`regular`,x.createElement(x.Fragment,null,x.createElement(`path`,{d:`M232.4,114.49,88.32,26.35a16,16,0,0,0-16.2-.3A15.86,15.86,0,0,0,64,39.87V216.13A15.94,15.94,0,0,0,80,232a16.07,16.07,0,0,0,8.36-2.35L232.4,141.51a15.81,15.81,0,0,0,0-27ZM80,215.94V40l143.83,88Z`}))],[`thin`,x.createElement(x.Fragment,null,x.createElement(`path`,{d:`M230.32,117.9,86.24,29.79a11.91,11.91,0,0,0-12.17-.23A11.71,11.71,0,0,0,68,39.89V216.11a11.71,11.71,0,0,0,6.07,10.33,11.91,11.91,0,0,0,12.17-.23L230.32,138.1a11.82,11.82,0,0,0,0-20.2Zm-4.18,13.37L82.06,219.39a4,4,0,0,1-4.07.07,3.77,3.77,0,0,1-2-3.35V39.89a3.77,3.77,0,0,1,2-3.35,4,4,0,0,1,4.07.07l144.08,88.12a3.8,3.8,0,0,1,0,6.54Z`}))]]),C=x.forwardRef((e,t)=>x.createElement(n,{ref:t,...e,weights:S}));C.displayName=`PlayIcon`;export{i,g as n,y as r,C as t};
@@ -0,0 +1 @@
1
+ import{i as e,s as t}from"./engine-CBuzy-Ik.js";import{V as n}from"./button-D5kdANef.js";var r=t(e(),1),i=new Map([[`bold`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M240.49,63.51a12,12,0,0,0-17,0L192,95,161,64l31.52-31.51a12,12,0,0,0-17-17L144,47,120.49,23.51a12,12,0,1,0-17,17L107,44,56.89,94.14a44,44,0,0,0,0,62.23l12.88,12.88L23.51,215.51a12,12,0,0,0,17,17l46.26-46.26,12.88,12.88a44,44,0,0,0,62.23,0L212,149l3.51,3.52a12,12,0,0,0,17-17L209,112l31.52-31.51A12,12,0,0,0,240.49,63.51Zm-95.6,118.63a20,20,0,0,1-28.29,0L73.86,139.4a20,20,0,0,1,0-28.29L124,61l71,71Z`}))],[`duotone`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M212,132l-58.63,58.63a32,32,0,0,1-45.25,0L65.37,147.88a32,32,0,0,1,0-45.25L124,44Z`,opacity:`0.2`}),r.createElement(`path`,{d:`M237.66,66.34a8,8,0,0,0-11.32,0L192,100.69,155.31,64l34.35-34.34a8,8,0,1,0-11.32-11.32L144,52.69,117.66,26.34a8,8,0,0,0-11.32,11.32L112.69,44l-53,53a40,40,0,0,0,0,56.57l15.71,15.71L26.34,218.34a8,8,0,0,0,11.32,11.32l49.09-49.09,15.71,15.71a40,40,0,0,0,56.57,0l53-53,6.34,6.35a8,8,0,0,0,11.32-11.32L203.31,112l34.35-34.34A8,8,0,0,0,237.66,66.34ZM147.72,185a24,24,0,0,1-33.95,0L71,142.23a24,24,0,0,1,0-33.95l53-53L200.69,132Z`}))],[`fill`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M237.66,77.66,203.31,112l26.35,26.34a8,8,0,0,1-11.32,11.32L212,143.31l-53,53a40,40,0,0,1-56.57,0L86.75,180.57,37.66,229.66a8,8,0,0,1-11.32-11.32l49.09-49.09L59.72,153.54a40,40,0,0,1,0-56.57l53-53-6.35-6.34a8,8,0,0,1,11.32-11.32L144,52.69l34.34-34.35a8,8,0,1,1,11.32,11.32L155.31,64,192,100.69l34.34-34.35a8,8,0,0,1,11.32,11.32Z`}))],[`light`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M236.24,67.76a6,6,0,0,0-8.48,0L192,103.51,152.49,64l35.75-35.76a6,6,0,0,0-8.48-8.48L144,55.51,116.24,27.76a6,6,0,1,0-8.48,8.48L115.51,44,61.13,98.38a38,38,0,0,0,0,53.75l17.13,17.12-50.5,50.51a6,6,0,1,0,8.48,8.48l50.51-50.5,17.13,17.13a38,38,0,0,0,53.74,0L212,140.49l7.76,7.75a6,6,0,0,0,8.48-8.48L200.49,112l35.75-35.76A6,6,0,0,0,236.24,67.76ZM149.13,186.38a26,26,0,0,1-36.77,0L69.62,143.64a26,26,0,0,1,0-36.77L124,52.49,203.51,132Z`}))],[`regular`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M237.66,66.34a8,8,0,0,0-11.32,0L192,100.69,155.31,64l34.35-34.34a8,8,0,1,0-11.32-11.32L144,52.69,117.66,26.34a8,8,0,0,0-11.32,11.32L112.69,44l-53,53a40,40,0,0,0,0,56.57l15.71,15.71L26.34,218.34a8,8,0,0,0,11.32,11.32l49.09-49.09,15.71,15.71a40,40,0,0,0,56.57,0l53-53,6.34,6.35a8,8,0,0,0,11.32-11.32L203.31,112l34.35-34.34A8,8,0,0,0,237.66,66.34ZM147.72,185a24,24,0,0,1-33.95,0L71,142.23a24,24,0,0,1,0-33.95l53-53L200.69,132Z`}))],[`thin`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M234.83,69.17a4,4,0,0,0-5.66,0L192,106.34,149.66,64l37.17-37.17a4,4,0,1,0-5.66-5.66L144,58.34,114.83,29.17a4,4,0,0,0-5.66,5.66L118.34,44,62.54,99.8a36.05,36.05,0,0,0,0,50.91l18.55,18.54L29.17,221.17a4,4,0,0,0,5.66,5.66l51.92-51.92,18.54,18.55a36.06,36.06,0,0,0,50.91,0l55.8-55.8,9.17,9.17a4,4,0,0,0,5.66-5.66L197.66,112l37.17-37.17A4,4,0,0,0,234.83,69.17ZM150.54,187.8a28,28,0,0,1-39.59,0L68.2,145.05a28,28,0,0,1,0-39.59L124,49.66,206.34,132Z`}))]]),a=r.forwardRef((e,t)=>r.createElement(n,{ref:t,...e,weights:i}));a.displayName=`PlugIcon`;export{a as t};
@@ -0,0 +1 @@
1
+ import{i as e,s as t}from"./engine-CBuzy-Ik.js";import{V as n}from"./button-D5kdANef.js";var r=t(e(),1),i=new Map([[`bold`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M228,128a12,12,0,0,1-12,12H140v76a12,12,0,0,1-24,0V140H40a12,12,0,0,1,0-24h76V40a12,12,0,0,1,24,0v76h76A12,12,0,0,1,228,128Z`}))],[`duotone`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z`,opacity:`0.2`}),r.createElement(`path`,{d:`M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z`}))],[`fill`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM184,136H136v48a8,8,0,0,1-16,0V136H72a8,8,0,0,1,0-16h48V72a8,8,0,0,1,16,0v48h48a8,8,0,0,1,0,16Z`}))],[`light`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M222,128a6,6,0,0,1-6,6H134v82a6,6,0,0,1-12,0V134H40a6,6,0,0,1,0-12h82V40a6,6,0,0,1,12,0v82h82A6,6,0,0,1,222,128Z`}))],[`regular`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z`}))],[`thin`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M220,128a4,4,0,0,1-4,4H132v84a4,4,0,0,1-8,0V132H40a4,4,0,0,1,0-8h84V40a4,4,0,0,1,8,0v84h84A4,4,0,0,1,220,128Z`}))]]),a=r.forwardRef((e,t)=>r.createElement(n,{ref:t,...e,weights:i}));a.displayName=`PlusIcon`;export{a as t};
@@ -0,0 +1 @@
1
+ import{i as e,s as t}from"./engine-CBuzy-Ik.js";import{i as n}from"./button-D5kdANef.js";var r=t(e(),1).forwardRef(function(e,t){let{className:r,render:i,orientation:a=`horizontal`,style:o,...s}=e;return n(`div`,e,{state:{orientation:a},ref:t,props:[{role:`separator`,"aria-orientation":a},s]})});export{r as t};
@@ -0,0 +1 @@
1
+ import{i as e,s as t}from"./engine-CBuzy-Ik.js";import{V as n}from"./button-D5kdANef.js";var r=t(e(),1),i=new Map([[`bold`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z`}))],[`duotone`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z`,opacity:`0.2`}),r.createElement(`path`,{d:`M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z`}))],[`fill`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM181.66,170.34a8,8,0,0,1-11.32,11.32L128,139.31,85.66,181.66a8,8,0,0,1-11.32-11.32L116.69,128,74.34,85.66A8,8,0,0,1,85.66,74.34L128,116.69l42.34-42.35a8,8,0,0,1,11.32,11.32L139.31,128Z`}))],[`light`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z`}))],[`regular`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z`}))],[`thin`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M202.83,197.17a4,4,0,0,1-5.66,5.66L128,133.66,58.83,202.83a4,4,0,0,1-5.66-5.66L122.34,128,53.17,58.83a4,4,0,0,1,5.66-5.66L128,122.34l69.17-69.17a4,4,0,1,1,5.66,5.66L133.66,128Z`}))]]),a=r.forwardRef((e,t)=>r.createElement(n,{ref:t,...e,weights:i}));a.displayName=`XIcon`;export{a as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./engine-CBuzy-Ik.js";import{s as t}from"./kit-n8CE0xEs.js";import{R as n}from"./index-CHKfukjt.js";var r=e(),i=()=>(0,r.jsxs)(t,{variant:`destructive`,children:[`No change `,n.useParams().id,`.`]});export{i as notFoundComponent};
@@ -0,0 +1 @@
1
+ import{i as e,r as t,s as n}from"./engine-CBuzy-Ik.js";import{Pn as r,St as i,Zt as a,lt as o,ri as s,xr as c}from"./queries-DGlVu9wp.js";import{M as l,W as u,s as d}from"./common-DHOhx6Zn.js";import{R as f,m as p,s as m,t as h}from"./kit-n8CE0xEs.js";import{t as g}from"./Play.es-DGJ1CGhp.js";import{t as _}from"./index-CHKfukjt.js";import{t as v}from"./workflow-view-hk_RU9WF.js";var y=n(e()),b=t();function x(){let{id:e}=_.useParams(),{data:t,error:n,dataUpdatedAt:x}=a(o(e)),{run:S,ledger:C}=t,w=i(S.workflow),T=C.at(-1),E=T?.type===`sleep.started`&&T.until<=x?T.until:0,D=(0,y.useMemo)(()=>({...t,at:E}),[t,E]),O=S.workflow===`change`?c(S.runId):void 0;return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(d,{action:O===void 0?w&&(0,b.jsx)(h,{size:`sm`,children:(0,b.jsxs)(s,{to:`/workflows/$name`,params:{name:S.workflow},search:{new:!0},children:[(0,b.jsx)(g,{"aria-hidden":`true`,"data-icon":`inline-start`}),`New run`]})}):(0,b.jsx)(h,{size:`sm`,children:(0,b.jsx)(s,{to:`/changes/$id`,params:{id:O},children:`Review`})}),children:[(0,b.jsx)(p,{id:`run-status`,dot:!0,tone:f[S.status],children:S.status}),S.sandbox!==void 0&&(0,b.jsx)(l,{name:S.sandbox}),(0,b.jsxs)(`span`,{className:`text-muted-foreground`,children:[r(S),` · `,(0,b.jsx)(u,{at:S.createdAt})]})]}),n&&(0,b.jsxs)(m,{variant:`destructive`,children:[`Could not refresh: `,n.message]}),(0,b.jsx)(v,{name:S.workflow,workflow:w,run:D},S.runId)]})}export{x as component};
@@ -0,0 +1 @@
1
+ import{r as e}from"./engine-CBuzy-Ik.js";import{s as t}from"./kit-n8CE0xEs.js";import{u as n}from"./index-CHKfukjt.js";var r=e(),i=()=>(0,r.jsxs)(t,{variant:`destructive`,children:[`No run `,n.useParams().id,`.`]});export{i as notFoundComponent};
@@ -0,0 +1,2 @@
1
+ import{i as e,r as t,s as n}from"./engine-CBuzy-Ik.js";import{A as r,Bn as i,C as a,Hn as o,Nn as s,Pn as c,Rn as l,Vi as u,Vn as d,Zn as f,Zt as p,ct as m,jt as h,k as g,or as _,qn as v,ri as y,tt as ee,zn as te}from"./queries-DGlVu9wp.js";import{N as ne,St as b,W as x,bt as S,g as C,o as w,p as T,s as E,xt as D}from"./common-DHOhx6Zn.js";import{B as O,G as k,H as A,I as j,N as re,W as ie,a as M,i as N,l as P,m as F,n as I,r as L,s as R}from"./kit-n8CE0xEs.js";import{t as z}from"./button-D5kdANef.js";import{n as B,t as V}from"./utils-BRvE9-Fo.js";import{R as H}from"./index-CHKfukjt.js";import{a as U,i as W,o as G,r as K,s as q,t as J}from"./changes-DFcdyDL_.js";import{a as Y,n as ae,o as oe,r as se,s as ce,t as le}from"./grid-diff-wo26YSgM.js";import{n as ue}from"./change-glance-CdkbSGxZ.js";import{r as X,t as de}from"./approval-BFFM_yEl.js";import{n as fe}from"./permissions-grid-B755bq5J.js";var Z=t();function pe({change:e,verbs:t=X}){let{state:n}=e,r={...e,workflow:_},i=e.approvals.find(e=>e.status===`pending`&&e.covers.includes(`sanoma.change.merge`));return(0,Z.jsxs)(M,{role:`region`,"aria-label":`Publish`,className:V(T,`order-first`),children:[(0,Z.jsx)(k,{className:`border-b`,children:(0,Z.jsx)(I,{children:`Publish`})}),(0,Z.jsxs)(A,{className:`flex min-h-0 flex-1 flex-col gap-3 overflow-y-auto`,children:[(0,Z.jsx)(me,{state:n}),(0,Z.jsxs)(N,{children:[(0,Z.jsx)(L,{label:`Checks`,children:n.check?n.check.ok?`pass`:(0,Z.jsx)(`ul`,{className:`flex flex-col gap-1`,children:n.check.problems.map((e,t)=>(0,Z.jsx)(`li`,{children:(0,Z.jsx)(`code`,{className:`text-xs`,children:e})},t))}):(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:`not run yet`})}),(0,Z.jsx)(L,{label:`Card`,children:n.card.reason}),n.merged&&(0,Z.jsx)(he,{merged:n.merged})]})]}),i&&(0,Z.jsxs)(ie,{className:`flex-wrap gap-2`,children:[(0,Z.jsx)(de,{run:r,approval:i,verbs:t}),(0,Z.jsxs)(`p`,{className:`w-full text-sm text-muted-foreground`,children:[t===X?`Rejecting`:`Choosing ${t.reject}`,` closes the change.`]})]})]})}function me({state:e}){let{decision:t}=e,n;n=e.phase===`merged`?`Published`:e.phase===`closed`?e.closedBy?`Closed by ${e.closedBy}`:`Closed`:t?.answer===`deny`?`Refused: ${t.reason??`the policy denies it`}`:e.phase===`blocked`?`Blocked: ${e.blocked??`it waits for a new commit`}`:t?t.answer===`hold`?`Publish waits for ${J(t.approver)}`:t.approver?`Allowed: Publish is for ${J(t.approver)}`:`Allowed`:`The policy has not been asked yet`;let r=U(e)?void 0:q(t);return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,Z.jsx)(`p`,{className:`font-medium`,children:n}),r&&(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:r})]})}function he({merged:e}){let{deploy:t,verified:n}=e,r=t?.follow;return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(L,{label:`Merged`,children:[(0,Z.jsx)(w,{sha:e.sha}),`, `,(0,Z.jsx)(x,{at:e.at})]}),r&&(0,Z.jsx)(L,{label:`This computer`,children:`revision`in r?(0,Z.jsxs)(Z.Fragment,{children:[`follows main at `,(0,Z.jsx)(w,{sha:r.revision})]}):`skipped`in r?`did not follow main: ${r.skipped}`:`could not follow main: ${r.error}`}),t?.apply&&(0,Z.jsxs)(L,{label:`Deploy`,children:[(0,Z.jsx)(y,{...m({runId:t.apply.runId,workflow:`apply`}),children:`the hosts' apply`}),t.apply.error?`: ${t.apply.error}`:``]}),n&&(0,Z.jsxs)(L,{label:`Verified`,children:[(0,Z.jsx)(y,{...m({runId:n.runId,workflow:`drift`}),children:`drift`}),n.error?`: ${n.error}`:n.drifted.length>0?`: not as declared: ${n.drifted.join(`, `)}`:`: as declared`]})]})}var Q=n(e(),1),ge={approve:`Approve and apply`,reject:`Send back`};function $({title:e,detail:t,tone:n,said:r,children:i}){return(0,Z.jsxs)(O,{size:`sm`,"aria-label":e,role:`region`,className:V(n===`waiting`&&`ring-tone-waiting-foreground/40`),children:[(0,Z.jsxs)(k,{className:`flex flex-wrap items-center gap-x-2.5`,children:[(0,Z.jsx)(I,{children:e}),t&&(0,Z.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:t}),(0,Z.jsx)(`span`,{className:`ml-auto`,children:(0,Z.jsx)(F,{tone:n,children:r})})]}),(0,Z.jsx)(A,{className:`flex flex-col gap-3 text-sm`,children:i})]})}function _e({keyField:e,field:t,change:n}){let[r,i]=(0,Q.useState)(n.kind===`retype`?n.decision:void 0),{count:a,sample:o}=n.wontConvert,s=[[`clear-unconvertible`,`Convert the rest and leave these ${a} empty`],[`keep-text`,`Keep ${t} as text while someone fixes them in the grid`]];return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{className:`overflow-auto rounded-lg border`,children:[(0,Z.jsxs)(`table`,{"aria-label":`Records that can't convert`,className:`w-full text-sm`,children:[(0,Z.jsx)(`thead`,{children:(0,Z.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,Z.jsx)(`th`,{scope:`col`,className:`px-3 py-1.5 font-medium`,children:e}),(0,Z.jsxs)(`th`,{scope:`col`,className:`px-3 py-1.5 font-medium`,children:[t,` now`]})]})}),(0,Z.jsx)(`tbody`,{children:o.map(({key:e,value:t})=>(0,Z.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,Z.jsx)(`td`,{className:`px-3 py-1.5 font-medium`,children:e}),(0,Z.jsx)(`td`,{className:`px-3 py-1.5`,children:typeof t==`string`?t:JSON.stringify(t)})]},e))})]}),a>o.length&&(0,Z.jsxs)(`p`,{className:`border-t px-3 py-1.5 text-xs text-muted-foreground`,children:[`and `,B(a-o.length,`record`),` more`]})]}),(0,Z.jsxs)(`fieldset`,{className:`flex flex-col gap-2`,children:[(0,Z.jsxs)(`legend`,{className:`mb-2 font-medium`,children:[`What should happen to these `,a,`?`]}),s.map(([e,n])=>(0,Z.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(`input`,{type:`radio`,name:`unconverted-${t}`,value:e,checked:r===e,onChange:()=>i(e)}),n]},e))]}),(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Your choice isn't sent yet: it goes with Approve and apply once the table change lands. Until then these keep the text they hold.`})]})}function ve({change:e,plan:t,keyField:n}){let r=i(t);switch(e.kind){case`add`:{let t=e.required&&e.empty>0;return(0,Z.jsx)($,{title:`Add ${e.field}`,detail:f(e.type),tone:t?`waiting`:`ok`,said:t?`Needs values`:`Safe`,children:(0,Z.jsxs)(`p`,{children:[r,` show it empty.`,t&&` It is required: each needs a value before it saves again.`]})})}case`rename`:{let n=!t.sql.length&&t.rows>0;return(0,Z.jsx)($,{title:`Rename ${e.from} to ${e.to}`,tone:n?`waiting`:`ok`,said:n?`Needs the data moved`:`Safe`,children:(0,Z.jsx)(`p`,{children:v(t,e)})})}case`retype`:case`convert`:{let r=e.kind===`retype`?e.to:e.type,i=e.kind===`retype`?`Change ${e.field} from ${f(e.from)} to ${f(r)}`:`Make ${e.key} of ${e.field} a column, ${f(r)}`,a=e.wontConvert.count;return a===0?(0,Z.jsx)($,{title:i,tone:`ok`,said:`Safe`,children:(0,Z.jsx)(`p`,{children:`Every value converts.`})}):(0,Z.jsxs)($,{title:i,tone:`waiting`,said:`Needs a decision`,children:[(0,Z.jsxs)(`p`,{children:[B(t.rows-a,`record`),` convert. `,a,` can't, because what's in them isn't `,f(r),`.`]}),(0,Z.jsx)(_e,{keyField:n,field:e.kind===`retype`?e.field:e.key,change:e})]})}case`require`:return(0,Z.jsx)($,{title:`Make ${e.field} required`,tone:e.empty?`waiting`:`ok`,said:e.empty?`Needs values`:`Safe`,children:(0,Z.jsx)(`p`,{children:e.empty?`${B(e.empty,`record`)} have it empty: each needs a value before it saves again.`:`Every record has it.`})});case`delete`:return(0,Z.jsx)($,{title:`Remove ${e.field}`,tone:`ok`,said:`Keeps the data`,children:(0,Z.jsxs)(`p`,{children:[`It leaves the grid and the forms.`,` `,e.filled===0?`No record has a value in it.`:`The values in ${B(e.filled,`record`)} are kept.`]})});case`link`:return(0,Z.jsx)($,{title:`Link ${e.field} to ${e.to}`,tone:e.unmatched?`waiting`:`ok`,said:e.unmatched?`Needs a decision`:`Safe`,children:(0,Z.jsx)(`p`,{children:e.unmatched?`${B(e.unmatched,`record`)} to match against ${e.to}'s records.`:`${r} match.`})})}}function ye({change:e,plan:t,collection:n}){let[r,i]=(0,Q.useState)(!1),a=n?.key??`key`,s=t.changes.length>1;return(0,Z.jsxs)(`section`,{"aria-label":`The table change`,className:`flex flex-col gap-3`,children:[e.status===`failed`&&!e.state.merged&&(0,Z.jsxs)(O,{size:`sm`,role:`status`,"aria-label":`Couldn't apply this change`,className:`ring-tone-bad-foreground/40`,children:[(0,Z.jsxs)(k,{className:`flex flex-wrap items-center gap-x-2.5`,children:[(0,Z.jsx)(I,{children:`Couldn't apply this change`}),(0,Z.jsx)(F,{tone:`waiting`,children:`Nothing changed`})]}),(0,Z.jsxs)(A,{className:`text-sm`,children:[`Your records and columns are exactly as they were.`,` `,(0,Z.jsx)(y,{to:`/runs/$id`,params:{id:e.runId},className:`underline underline-offset-4`,children:`See what went wrong`})]})]}),(0,Z.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[B(t.changes.length,`change`),` to `,t.collection,` · `,B(t.rows,`record`),s&&`. They apply together: either every one lands, or none does.`]}),o(t)&&(0,Z.jsx)(`p`,{role:`note`,className:`rounded-lg border px-3 py-2 text-sm text-muted-foreground`,children:`Until real tables land, this changes resources/data.ts only: each record keeps what it holds, and one the new declaration no longer fits shows as needs fixing.`}),t.changes.map((e,n)=>(0,Z.jsx)(ve,{change:e,plan:t,keyField:a},n)),(0,Z.jsxs)(O,{size:`sm`,role:`region`,"aria-label":`Try it first`,children:[(0,Z.jsx)(k,{children:(0,Z.jsx)(I,{children:`Try it first`})}),(0,Z.jsxs)(A,{className:`flex flex-col items-start gap-2.5 text-sm`,children:[(0,Z.jsxs)(`p`,{children:[`Open a copy of `,t.collection,` with this change applied. Your real records aren't touched.`]}),(0,Z.jsx)(z,{variant:`outline`,disabled:!0,title:`Copies arrive with previews`,children:`Try on a copy`})]})]}),(0,Z.jsxs)(S,{open:r,onOpenChange:i,render:(0,Z.jsx)(O,{size:`sm`,role:`region`,"aria-label":`The details`}),children:[(0,Z.jsxs)(k,{className:`flex flex-wrap items-center gap-x-2.5`,children:[(0,Z.jsx)(I,{children:`The details`}),(0,Z.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Only if you want them`}),(0,Z.jsx)(b,{render:(0,Z.jsx)(z,{variant:`ghost`,size:`sm`,className:`ml-auto`}),children:r?`Hide`:`Show`})]}),(0,Z.jsx)(D,{render:(0,Z.jsx)(A,{}),children:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[n&&(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Z.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`The company's file · `,(0,Z.jsx)(`code`,{children:n.declared?.file??`resources/data.ts`})]}),(0,Z.jsx)(`pre`,{className:`overflow-auto rounded-lg border bg-muted/40 px-3 py-2 text-xs leading-relaxed`,children:d(n.fields,t.changes).map((e,t)=>(0,Z.jsx)(`span`,{className:V(`block`,e.sign===`+`?`bg-tone-ok/15`:`bg-tone-bad/15`),children:`${e.sign} ${e.text}`},t))})]}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`What runs on the database`}),t.sql.length?(0,Z.jsx)(`pre`,{className:`overflow-auto rounded-lg border bg-muted/40 px-3 py-2 text-xs leading-relaxed`,children:t.sql.join(`
2
+ `)}):(0,Z.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[l,`.`]})]})]})})]})]})}function be({before:e,after:t}){let n=(0,Q.useMemo)(()=>Y(e,t),[e,t]),[r,i]=(0,Q.useState)(!1),a=r?n:ce(n),o=oe(n),s=a.workflows.length===0&&a.ops.length===0;return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:o.length>0?o.join(` · `):`No one's answers change`}),(0,Z.jsx)(z,{variant:`ghost`,size:`sm`,"aria-pressed":r,onClick:()=>i(!r),children:r?`Hide unchanged rows`:`Show unchanged rows`})]}),!s&&(0,Z.jsx)(O,{className:`gap-0 py-0`,children:(0,Z.jsx)(fe,{groups:a.groups.map(e=>e.group),workflows:a.workflows,ops:a.ops,cell:(e,t)=>(0,Z.jsx)(xe,{cell:e.cells[t]}),linkRow:e=>e.status!==`added`&&e.status!==`removed`})})]})}function xe({cell:e}){let t=e.after??e.before;return t?e.change===`same`?(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:le(t)}):(0,Z.jsx)(F,{tone:j[e.change],"aria-label":ae(e),children:se(e)}):null}function Se(){let{id:e}=H.useParams(),{data:t,error:n}=p(a(e));if(!t)throw u();let{state:i}=t,o=te.safeParse(i.plan).data,{data:l}=p(r());return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(E,{children:[(0,Z.jsx)(F,{dot:!0,tone:re[i.phase],children:G(i)}),(0,Z.jsxs)(`span`,{className:`text-muted-foreground`,children:[i.branch&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`code`,{children:i.branch}),i.head&&(0,Z.jsxs)(Z.Fragment,{children:[` `,`at `,(0,Z.jsx)(w,{sha:i.head})]}),` `,`·`,` `]}),i.pullRequest&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(ue,{pullRequest:i.pullRequest}),` ·`,` `]}),`opened by `,c(t),` · `,(0,Z.jsx)(x,{at:t.createdAt}),` ·`,` `,(0,Z.jsx)(y,{...m({runId:t.runId,workflow:_}),children:s(t.runId)})]})]}),n&&(0,Z.jsxs)(R,{variant:`destructive`,children:[`Could not refresh: `,n.message]}),(0,Z.jsx)(C,{float:(0,Z.jsx)(pe,{change:t,...o&&{verbs:ge}}),children:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-(--gap-region) p-4`,children:[(0,Z.jsx)(Ce,{change:t}),(0,Z.jsx)(Te,{change:t}),o&&(0,Z.jsx)(ye,{change:t,plan:o,collection:g(o.collection)(l)}),(0,Z.jsx)(Ee,{change:t}),(0,Z.jsx)(De,{change:t})]})})]})}function Ce({change:{state:e}}){let{decision:t}=e;if(U(e))return null;if(t?.answer===`deny`){let e=q(t);return(0,Z.jsxs)(R,{variant:`destructive`,children:[e?`${e}: `:``,t.reason??`the policy refuses this change`]})}return e.phase===`blocked`&&e.blocked?(0,Z.jsxs)(R,{variant:`destructive`,children:[`This change cannot publish now: `,e.blocked]}):null}var we=new Intl.ListFormat(`en`,{type:`conjunction`});function Te({change:e}){let{data:t}=p({...r(),select:h}),n=e.state.facts?.stranded??[];if(n.length===0||U(e.state))return null;let i=we.format(e.edits.map(e=>t[e]??e)),a=n.length===1;return(0,Z.jsxs)(R,{children:[B(n.length,`run`),` of`,` `,i?`${i}, which this change edits,`:`the workflows this change edits`,` `,a?`is`:`are`,` waiting: publishing cannot move `,a?`it`:`them`,` to the new version.`,` `,n.map((e,t)=>(0,Z.jsxs)(`span`,{children:[t>0&&`, `,(0,Z.jsx)(y,{to:`/runs/$id`,params:{id:e},children:s(e)})]},e))]})}function Ee({change:{state:e}}){let t=W(K(e.facts));return(0,Z.jsx)(P,{title:`What changed`,children:e.facts?t.map(({key:e,title:t,files:n})=>(0,Z.jsx)(ne,{title:t,children:(0,Z.jsx)(`ul`,{className:`flex flex-col gap-1`,children:n.map(e=>(0,Z.jsx)(`li`,{children:(0,Z.jsx)(`code`,{className:`text-xs`,children:e})},e))})},e)):(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Sanoma has not read the change yet.`})})}function De({change:{state:e}}){let{data:t}=p(ee()),n=e.check?.grid;return n&&Y(t,n).changed?(0,Z.jsx)(P,{title:`Who may do what`,children:(0,Z.jsx)(be,{before:t,after:n})}):!n&&e.facts?.rules?(0,Z.jsx)(P,{title:`Who may do what`,children:(0,Z.jsxs)(R,{variant:`destructive`,children:[`The branch's Permissions grid could not be computed`,e.check?.problems.length?`: ${e.check.problems.join(`; `)}`:``,`.`]})}):null}export{Se as component};
@@ -0,0 +1 @@
1
+ import{r as e}from"./engine-CBuzy-Ik.js";import{s as t}from"./kit-n8CE0xEs.js";import{t as n}from"./index-CHKfukjt.js";var r=e(),i=()=>(0,r.jsxs)(t,{variant:`destructive`,children:[`No run `,n.useParams().id,`.`]});export{i as notFoundComponent};
@@ -0,0 +1 @@
1
+ import{i as e,r as t,s as n}from"./engine-CBuzy-Ik.js";import{A as r,Q as i,Vi as a,Zt as o,mt as s,q as c,ri as l}from"./queries-DGlVu9wp.js";import{D as u,L as d,f,n as p,s as m,x as h}from"./common-DHOhx6Zn.js";import{B as g,K as _}from"./kit-n8CE0xEs.js";import{n as v}from"./utils-BRvE9-Fo.js";import{a as y,i as b,n as x,o as S,r as C,t as w}from"./table-B81tv0LG.js";import{B as T}from"./index-CHKfukjt.js";import{n as E}from"./apps-71ZEzcL9.js";import{t as D}from"./chat-button-DNusaP5n.js";var O=n(e()),k=t(),A=e=>t=>{let n=t.apps.find(t=>t.name===e);if(!n)return;let r=t.policy.files.filter(({file:e})=>e.startsWith(`${n.dir}/policies/`)).map(({file:e,text:t})=>({file:e,rules:t.match(/^\s*(?:permit|forbid)\s*\(/gm)?.length??0,reasons:[...t.matchAll(/@reason\("((?:[^"\\]|\\.)*)"\)/g)].map(([,e])=>e)}));return{app:n,sites:t.sites.filter(t=>t.app===e),collections:t.collections.filter(t=>t.app===e),workflows:t.workflows.filter(t=>t.app===e),policies:r,ops:i(t)}},j=e=>{let t=t=>t.startsWith(`${e}/`);return({scenarios:e,errors:n})=>({files:[...Map.groupBy(e.filter(e=>t(e.file)),e=>e.file)].map(([e,t])=>({file:e,count:t.length,workflows:[...new Set(t.map(e=>e.workflow))]})),errors:n.filter(e=>t(e.file))})};function M(){let{name:e}=T.useParams(),t=(0,O.useMemo)(()=>A(e),[e]),{data:n}=o({...r(),select:t});if(!n)throw a();let{app:i}=n;return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(m,{action:i.source&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(f,{href:i.source,children:`Source`}),(0,k.jsx)(D,{prompt:E(i.name),children:`Update`})]}),children:i.source&&(0,k.jsx)(p,{folder:i.name})}),(0,k.jsx)(N,{app:i}),(0,k.jsxs)(g,{className:`gap-0 py-0`,children:[(0,k.jsx)(P,{title:`Sites`,note:`${n.sites.length} · in the bar`,children:n.sites.length>0&&(0,k.jsxs)(w,{children:[(0,k.jsx)(y,{children:(0,k.jsxs)(S,{children:[(0,k.jsx)(b,{children:`Site`}),(0,k.jsx)(b,{children:`Pages`}),(0,k.jsx)(b,{children:`Calls`}),(0,k.jsx)(b,{className:`text-right`,children:`Seen by`})]})}),(0,k.jsx)(x,{children:n.sites.map(e=>(0,k.jsxs)(S,{children:[(0,k.jsx)(C,{className:`font-medium`,children:(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,k.jsx)(d,{site:e}),(0,k.jsxs)(`code`,{className:`text-xs font-normal text-muted-foreground`,children:[`/sites/`,e.name]})]})}),(0,k.jsx)(C,{className:`text-muted-foreground`,children:v(e.pages.length,`page`)}),(0,k.jsx)(C,{className:`whitespace-normal`,children:(0,k.jsx)(I,{items:[...new Set(e.calls.map(e=>e.target))]})}),(0,k.jsx)(C,{className:`text-right`,children:e.public?(0,k.jsx)(_,{variant:`secondary`,children:`Visitors`}):(0,k.jsx)(`span`,{className:`text-muted-foreground`,children:`People in the app`})})]},e.name))})]})}),(0,k.jsx)(P,{title:`Collections`,note:`${n.collections.length} · on Data`,children:n.collections.length>0&&(0,k.jsxs)(w,{children:[(0,k.jsx)(y,{children:(0,k.jsxs)(S,{children:[(0,k.jsx)(b,{children:`Collection`}),(0,k.jsx)(b,{children:`Key`}),(0,k.jsx)(b,{children:`Fields`})]})}),(0,k.jsx)(x,{children:n.collections.map(({name:e,title:t,key:n,fields:r})=>(0,k.jsxs)(S,{children:[(0,k.jsx)(C,{className:`font-medium`,children:(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,k.jsx)(l,{to:`/data/$name`,params:{name:e},children:t??e}),(0,k.jsxs)(`code`,{className:`text-xs font-normal text-muted-foreground`,children:[`data.`,e]})]})}),(0,k.jsx)(C,{children:(0,k.jsx)(`code`,{children:n})}),(0,k.jsx)(C,{className:`whitespace-normal text-muted-foreground`,children:Object.keys(r).join(`, `)})]},e))})]})}),(0,k.jsx)(P,{title:`Workflows`,note:`${n.workflows.length} · on Workflows`,children:n.workflows.length>0&&(0,k.jsx)(L,{workflows:n.workflows,ops:n.ops})}),(0,k.jsx)(P,{title:`Policies`,note:`${v(n.policies.length,`file`)} · on Permissions`,children:n.policies.length>0&&(0,k.jsxs)(w,{children:[(0,k.jsx)(y,{children:(0,k.jsxs)(S,{children:[(0,k.jsx)(b,{children:`File`}),(0,k.jsx)(b,{children:`Rules`}),(0,k.jsx)(b,{children:`Why`}),(0,k.jsx)(b,{className:`text-right`,children:(0,k.jsx)(`span`,{className:`sr-only`,children:`Open`})})]})}),(0,k.jsx)(x,{children:n.policies.map(({file:e,rules:t,reasons:n})=>(0,k.jsxs)(S,{children:[(0,k.jsx)(C,{children:(0,k.jsx)(`code`,{className:`text-xs`,children:e})}),(0,k.jsx)(C,{className:`text-muted-foreground`,children:v(t,`rule`)}),(0,k.jsx)(C,{className:`whitespace-normal`,children:n.join(`; `)||`-`}),(0,k.jsx)(C,{className:`text-right`,children:(0,k.jsx)(l,{to:`/permissions`,children:`See the grid`})})]},e))})]})}),(0,k.jsx)(P,{title:`Scenarios`,note:`run by sanoma check`,children:(0,k.jsx)(R,{dir:i.dir})})]}),(0,k.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`People are never inside an app: its folder declares collections, workflows, policies and sites, and the company's people stay at the root, on People.`})]})}function N({app:e}){return(0,k.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[e.source?(0,k.jsxs)(k.Fragment,{children:[`Taken from `,(0,k.jsx)(f,{href:e.source,children:e.source}),` into `,(0,k.jsxs)(`code`,{children:[e.dir,`/`]}),`.`]}):(0,k.jsxs)(k.Fragment,{children:[`The company's own app, in `,(0,k.jsxs)(`code`,{children:[e.dir,`/`]}),`.`]}),` `,`Everything below lives in that folder and is named `,(0,k.jsxs)(`code`,{children:[e.name,`.`]}),`…`]})}function P({title:e,note:t,children:n}){return(0,k.jsxs)(`section`,{"aria-label":e,className:`flex flex-col border-b last:border-b-0`,children:[(0,k.jsxs)(`div`,{className:`flex items-baseline gap-2 px-4 pt-3 pb-1`,children:[(0,k.jsx)(`h2`,{className:`text-sm font-medium`,children:e}),(0,k.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:t})]}),n||F]})}var F=(0,k.jsx)(`p`,{className:`px-4 pb-3 text-sm text-muted-foreground`,children:`None.`});function I({items:e}){return e.length===0?(0,k.jsx)(`span`,{className:`text-muted-foreground`,children:`-`}):(0,k.jsx)(`span`,{className:`flex flex-wrap gap-x-2 gap-y-1`,children:e.map(e=>(0,k.jsx)(`code`,{className:`text-xs`,children:e},e))})}function L({workflows:e,ops:t}){let{data:n}=o(c());return(0,k.jsxs)(w,{children:[(0,k.jsx)(y,{children:(0,k.jsxs)(S,{children:[(0,k.jsx)(b,{children:`Workflow`}),(0,k.jsx)(b,{children:`Uses`}),(0,k.jsx)(b,{children:`Last run`}),(0,k.jsx)(b,{className:`text-right`,children:(0,k.jsx)(`span`,{className:`sr-only`,children:`Runs`})})]})}),(0,k.jsx)(x,{children:e.map(e=>(0,k.jsxs)(S,{children:[(0,k.jsx)(C,{className:`font-medium`,children:(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,k.jsx)(l,{to:`/workflows/$name`,params:{name:e.name},children:e.title??e.name}),(0,k.jsx)(`code`,{className:`text-xs font-normal text-muted-foreground`,children:e.name})]})}),(0,k.jsx)(C,{className:`whitespace-normal`,children:e.ops.length===0?(0,k.jsx)(`span`,{className:`text-muted-foreground`,children:`-`}):(0,k.jsx)(`span`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1`,children:e.ops.map(e=>(0,k.jsx)(`span`,{className:`inline-flex items-center gap-1.5 text-xs`,children:(0,k.jsx)(u,{id:e,op:t.get(e)})},e))})}),(0,k.jsx)(C,{children:(0,k.jsx)(h,{run:n[e.name],none:`Never run`})}),(0,k.jsx)(C,{className:`text-right`,children:(0,k.jsx)(l,{to:`/workflows/$name`,params:{name:e.name},search:{view:`runs`},children:`Runs`})})]},e.name))})]})}function R({dir:e}){let t=(0,O.useMemo)(()=>j(e),[e]),{data:{files:n,errors:r}}=o({...s(),select:t});return n.length===0&&r.length===0?F:(0,k.jsxs)(w,{children:[(0,k.jsx)(y,{children:(0,k.jsxs)(S,{children:[(0,k.jsx)(b,{children:`File`}),(0,k.jsx)(b,{children:`Scenarios`}),(0,k.jsx)(b,{children:`Of`})]})}),(0,k.jsxs)(x,{children:[n.map(({file:e,count:t,workflows:n})=>(0,k.jsxs)(S,{children:[(0,k.jsx)(C,{children:(0,k.jsx)(`code`,{className:`text-xs`,children:e})}),(0,k.jsx)(C,{className:`text-muted-foreground`,children:v(t,`scenario`)}),(0,k.jsx)(C,{className:`whitespace-normal`,children:(0,k.jsx)(`span`,{className:`flex flex-wrap gap-x-3 gap-y-1`,children:n.map(e=>(0,k.jsx)(l,{to:`/workflows/$name`,params:{name:e},search:{view:`scenarios`},children:e},e))})})]},e)),r.map(({file:e,message:t})=>(0,k.jsxs)(S,{children:[(0,k.jsx)(C,{children:(0,k.jsx)(`code`,{className:`text-xs`,children:e})}),(0,k.jsx)(C,{colSpan:2,className:`whitespace-normal text-destructive`,children:t})]},e))]})]})}export{M as component};