@baseline-studio/playground 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (823) hide show
  1. package/README.md +20 -2
  2. package/app/.next-pack/BUILD_ID +1 -0
  3. package/app/.next-pack/app-build-manifest.json +2213 -0
  4. package/app/.next-pack/app-path-routes-manifest.json +118 -0
  5. package/app/.next-pack/build-manifest.json +33 -0
  6. package/app/.next-pack/package.json +1 -0
  7. package/app/.next-pack/prerender-manifest.json +486 -0
  8. package/app/.next-pack/react-loadable-manifest.json +14 -0
  9. package/app/.next-pack/required-server-files.json +344 -0
  10. package/app/.next-pack/routes-manifest.json +629 -0
  11. package/app/.next-pack/server/app/_not-found/page.js +2 -0
  12. package/app/.next-pack/server/app/_not-found/page.js.nft.json +1 -0
  13. package/app/.next-pack/server/app/_not-found/page_client-reference-manifest.js +1 -0
  14. package/app/.next-pack/server/app/_not-found.html +1 -0
  15. package/app/.next-pack/server/app/_not-found.meta +8 -0
  16. package/app/.next-pack/server/app/_not-found.rsc +29 -0
  17. package/app/.next-pack/server/app/activity/page.js +2 -0
  18. package/app/.next-pack/server/app/activity/page.js.nft.json +1 -0
  19. package/app/.next-pack/server/app/activity/page_client-reference-manifest.js +1 -0
  20. package/app/.next-pack/server/app/activity.html +1 -0
  21. package/app/.next-pack/server/app/activity.meta +9 -0
  22. package/app/.next-pack/server/app/activity.rsc +27 -0
  23. package/app/.next-pack/server/app/api/activity/route.js +1 -0
  24. package/app/.next-pack/server/app/api/activity/route.js.nft.json +1 -0
  25. package/app/.next-pack/server/app/api/activity/route_client-reference-manifest.js +1 -0
  26. package/app/.next-pack/server/app/api/apps/shot/route.js +1 -0
  27. package/app/.next-pack/server/app/api/apps/shot/route.js.nft.json +1 -0
  28. package/app/.next-pack/server/app/api/apps/shot/route_client-reference-manifest.js +1 -0
  29. package/app/.next-pack/server/app/api/apps/vshot/route.js +1 -0
  30. package/app/.next-pack/server/app/api/apps/vshot/route.js.nft.json +1 -0
  31. package/app/.next-pack/server/app/api/apps/vshot/route_client-reference-manifest.js +1 -0
  32. package/app/.next-pack/server/app/api/brain/route.js +1 -0
  33. package/app/.next-pack/server/app/api/brain/route.js.nft.json +1 -0
  34. package/app/.next-pack/server/app/api/brain/route_client-reference-manifest.js +1 -0
  35. package/app/.next-pack/server/app/api/build/route.js +1 -0
  36. package/app/.next-pack/server/app/api/build/route.js.nft.json +1 -0
  37. package/app/.next-pack/server/app/api/build/route_client-reference-manifest.js +1 -0
  38. package/app/.next-pack/server/app/api/check/route.js +5 -0
  39. package/app/.next-pack/server/app/api/check/route.js.nft.json +1 -0
  40. package/app/.next-pack/server/app/api/check/route_client-reference-manifest.js +1 -0
  41. package/app/.next-pack/server/app/api/files/route.js +1 -0
  42. package/app/.next-pack/server/app/api/files/route.js.nft.json +1 -0
  43. package/app/.next-pack/server/app/api/files/route_client-reference-manifest.js +1 -0
  44. package/app/.next-pack/server/app/api/fonts/[file]/route.js +1 -0
  45. package/app/.next-pack/server/app/api/fonts/[file]/route.js.nft.json +1 -0
  46. package/app/.next-pack/server/app/api/fonts/[file]/route_client-reference-manifest.js +1 -0
  47. package/app/.next-pack/server/app/api/home/route.js +1 -0
  48. package/app/.next-pack/server/app/api/home/route.js.nft.json +1 -0
  49. package/app/.next-pack/server/app/api/home/route_client-reference-manifest.js +1 -0
  50. package/app/.next-pack/server/app/api/local/pick-folder/route.js +1 -0
  51. package/app/.next-pack/server/app/api/local/pick-folder/route.js.nft.json +1 -0
  52. package/app/.next-pack/server/app/api/local/pick-folder/route_client-reference-manifest.js +1 -0
  53. package/app/.next-pack/server/app/api/local/repos/route.js +1 -0
  54. package/app/.next-pack/server/app/api/local/repos/route.js.nft.json +1 -0
  55. package/app/.next-pack/server/app/api/local/repos/route_client-reference-manifest.js +1 -0
  56. package/app/.next-pack/server/app/api/plan/route.js +1 -0
  57. package/app/.next-pack/server/app/api/plan/route.js.nft.json +1 -0
  58. package/app/.next-pack/server/app/api/plan/route_client-reference-manifest.js +1 -0
  59. package/app/.next-pack/server/app/api/projects/route.js +1 -0
  60. package/app/.next-pack/server/app/api/projects/route.js.nft.json +1 -0
  61. package/app/.next-pack/server/app/api/projects/route_client-reference-manifest.js +1 -0
  62. package/app/.next-pack/server/app/api/remote/route.js +1 -0
  63. package/app/.next-pack/server/app/api/remote/route.js.nft.json +1 -0
  64. package/app/.next-pack/server/app/api/remote/route_client-reference-manifest.js +1 -0
  65. package/app/.next-pack/server/app/api/screens/route.js +1 -0
  66. package/app/.next-pack/server/app/api/screens/route.js.nft.json +1 -0
  67. package/app/.next-pack/server/app/api/screens/route_client-reference-manifest.js +1 -0
  68. package/app/.next-pack/server/app/api/skills/route.js +1 -0
  69. package/app/.next-pack/server/app/api/skills/route.js.nft.json +1 -0
  70. package/app/.next-pack/server/app/api/skills/route_client-reference-manifest.js +1 -0
  71. package/app/.next-pack/server/app/api/state/ref/route.js +1 -0
  72. package/app/.next-pack/server/app/api/state/ref/route.js.nft.json +1 -0
  73. package/app/.next-pack/server/app/api/state/ref/route_client-reference-manifest.js +1 -0
  74. package/app/.next-pack/server/app/api/state/route.js +1 -0
  75. package/app/.next-pack/server/app/api/state/route.js.nft.json +1 -0
  76. package/app/.next-pack/server/app/api/state/route_client-reference-manifest.js +1 -0
  77. package/app/.next-pack/server/app/api/studio/crit/route.js +1 -0
  78. package/app/.next-pack/server/app/api/studio/crit/route.js.nft.json +1 -0
  79. package/app/.next-pack/server/app/api/studio/crit/route_client-reference-manifest.js +1 -0
  80. package/app/.next-pack/server/app/api/studio/diff/route.js +1 -0
  81. package/app/.next-pack/server/app/api/studio/diff/route.js.nft.json +1 -0
  82. package/app/.next-pack/server/app/api/studio/diff/route_client-reference-manifest.js +1 -0
  83. package/app/.next-pack/server/app/api/studio/html/route.js +1 -0
  84. package/app/.next-pack/server/app/api/studio/html/route.js.nft.json +1 -0
  85. package/app/.next-pack/server/app/api/studio/html/route_client-reference-manifest.js +1 -0
  86. package/app/.next-pack/server/app/api/studio/project/route.js +1 -0
  87. package/app/.next-pack/server/app/api/studio/project/route.js.nft.json +1 -0
  88. package/app/.next-pack/server/app/api/studio/project/route_client-reference-manifest.js +1 -0
  89. package/app/.next-pack/server/app/api/studio/route.js +1 -0
  90. package/app/.next-pack/server/app/api/studio/route.js.nft.json +1 -0
  91. package/app/.next-pack/server/app/api/studio/route_client-reference-manifest.js +1 -0
  92. package/app/.next-pack/server/app/api/studio/system/route.js +1 -0
  93. package/app/.next-pack/server/app/api/studio/system/route.js.nft.json +1 -0
  94. package/app/.next-pack/server/app/api/studio/system/route_client-reference-manifest.js +1 -0
  95. package/app/.next-pack/server/app/api/studio/variants/route.js +4 -0
  96. package/app/.next-pack/server/app/api/studio/variants/route.js.nft.json +1 -0
  97. package/app/.next-pack/server/app/api/studio/variants/route_client-reference-manifest.js +1 -0
  98. package/app/.next-pack/server/app/api/sync/route.js +1 -0
  99. package/app/.next-pack/server/app/api/sync/route.js.nft.json +1 -0
  100. package/app/.next-pack/server/app/api/sync/route_client-reference-manifest.js +1 -0
  101. package/app/.next-pack/server/app/api/themes/route.js +1 -0
  102. package/app/.next-pack/server/app/api/themes/route.js.nft.json +1 -0
  103. package/app/.next-pack/server/app/api/themes/route_client-reference-manifest.js +1 -0
  104. package/app/.next-pack/server/app/apple-icon/route.js +1 -0
  105. package/app/.next-pack/server/app/apple-icon/route.js.nft.json +1 -0
  106. package/app/.next-pack/server/app/apple-icon/route_client-reference-manifest.js +1 -0
  107. package/app/.next-pack/server/app/apple-icon.body +0 -0
  108. package/app/.next-pack/server/app/apple-icon.meta +1 -0
  109. package/app/.next-pack/server/app/brain/page.js +3 -0
  110. package/app/.next-pack/server/app/brain/page.js.nft.json +1 -0
  111. package/app/.next-pack/server/app/brain/page_client-reference-manifest.js +1 -0
  112. package/app/.next-pack/server/app/connection/page.js +2 -0
  113. package/app/.next-pack/server/app/connection/page.js.nft.json +1 -0
  114. package/app/.next-pack/server/app/connection/page_client-reference-manifest.js +1 -0
  115. package/app/.next-pack/server/app/design-system/[system]/page.js +2 -0
  116. package/app/.next-pack/server/app/design-system/[system]/page.js.nft.json +1 -0
  117. package/app/.next-pack/server/app/design-system/[system]/page_client-reference-manifest.js +1 -0
  118. package/app/.next-pack/server/app/design-system/components/page.js +2 -0
  119. package/app/.next-pack/server/app/design-system/components/page.js.nft.json +1 -0
  120. package/app/.next-pack/server/app/design-system/components/page_client-reference-manifest.js +1 -0
  121. package/app/.next-pack/server/app/design-system/directions/page.js +2 -0
  122. package/app/.next-pack/server/app/design-system/directions/page.js.nft.json +1 -0
  123. package/app/.next-pack/server/app/design-system/directions/page_client-reference-manifest.js +1 -0
  124. package/app/.next-pack/server/app/design-system/directions.html +1 -0
  125. package/app/.next-pack/server/app/design-system/directions.meta +7 -0
  126. package/app/.next-pack/server/app/design-system/directions.rsc +30 -0
  127. package/app/.next-pack/server/app/design-system/page.js +2 -0
  128. package/app/.next-pack/server/app/design-system/page.js.nft.json +1 -0
  129. package/app/.next-pack/server/app/design-system/page_client-reference-manifest.js +1 -0
  130. package/app/.next-pack/server/app/icon/route.js +1 -0
  131. package/app/.next-pack/server/app/icon/route.js.nft.json +1 -0
  132. package/app/.next-pack/server/app/icon/route_client-reference-manifest.js +1 -0
  133. package/app/.next-pack/server/app/icon.body +0 -0
  134. package/app/.next-pack/server/app/icon.meta +1 -0
  135. package/app/.next-pack/server/app/lab/attention/page.js +2 -0
  136. package/app/.next-pack/server/app/lab/attention/page.js.nft.json +1 -0
  137. package/app/.next-pack/server/app/lab/attention/page_client-reference-manifest.js +1 -0
  138. package/app/.next-pack/server/app/lab/attention.html +1 -0
  139. package/app/.next-pack/server/app/lab/attention.meta +7 -0
  140. package/app/.next-pack/server/app/lab/attention.rsc +30 -0
  141. package/app/.next-pack/server/app/lab/design-system/page.js +2 -0
  142. package/app/.next-pack/server/app/lab/design-system/page.js.nft.json +1 -0
  143. package/app/.next-pack/server/app/lab/design-system/page_client-reference-manifest.js +1 -0
  144. package/app/.next-pack/server/app/lab/home/page.js +2 -0
  145. package/app/.next-pack/server/app/lab/home/page.js.nft.json +1 -0
  146. package/app/.next-pack/server/app/lab/home/page_client-reference-manifest.js +1 -0
  147. package/app/.next-pack/server/app/lab/home.html +1 -0
  148. package/app/.next-pack/server/app/lab/home.meta +7 -0
  149. package/app/.next-pack/server/app/lab/home.rsc +30 -0
  150. package/app/.next-pack/server/app/lab/island/page.js +2 -0
  151. package/app/.next-pack/server/app/lab/island/page.js.nft.json +1 -0
  152. package/app/.next-pack/server/app/lab/island/page_client-reference-manifest.js +1 -0
  153. package/app/.next-pack/server/app/lab/island.html +1 -0
  154. package/app/.next-pack/server/app/lab/island.meta +7 -0
  155. package/app/.next-pack/server/app/lab/island.rsc +30 -0
  156. package/app/.next-pack/server/app/lab/kit/page.js +2 -0
  157. package/app/.next-pack/server/app/lab/kit/page.js.nft.json +1 -0
  158. package/app/.next-pack/server/app/lab/kit/page_client-reference-manifest.js +1 -0
  159. package/app/.next-pack/server/app/lab/kit.html +1 -0
  160. package/app/.next-pack/server/app/lab/kit.meta +7 -0
  161. package/app/.next-pack/server/app/lab/kit.rsc +30 -0
  162. package/app/.next-pack/server/app/lab/page.js +2 -0
  163. package/app/.next-pack/server/app/lab/page.js.nft.json +1 -0
  164. package/app/.next-pack/server/app/lab/page_client-reference-manifest.js +1 -0
  165. package/app/.next-pack/server/app/lab/skills/page.js +2 -0
  166. package/app/.next-pack/server/app/lab/skills/page.js.nft.json +1 -0
  167. package/app/.next-pack/server/app/lab/skills/page_client-reference-manifest.js +1 -0
  168. package/app/.next-pack/server/app/lab/studio/page.js +2 -0
  169. package/app/.next-pack/server/app/lab/studio/page.js.nft.json +1 -0
  170. package/app/.next-pack/server/app/lab/studio/page_client-reference-manifest.js +1 -0
  171. package/app/.next-pack/server/app/lab/studio.html +1 -0
  172. package/app/.next-pack/server/app/lab/studio.meta +7 -0
  173. package/app/.next-pack/server/app/lab/studio.rsc +30 -0
  174. package/app/.next-pack/server/app/lab.html +1 -0
  175. package/app/.next-pack/server/app/lab.meta +7 -0
  176. package/app/.next-pack/server/app/lab.rsc +30 -0
  177. package/app/.next-pack/server/app/manifest.webmanifest/route.js +16 -0
  178. package/app/.next-pack/server/app/manifest.webmanifest/route.js.nft.json +1 -0
  179. package/app/.next-pack/server/app/manifest.webmanifest/route_client-reference-manifest.js +1 -0
  180. package/app/.next-pack/server/app/manifest.webmanifest.body +1 -0
  181. package/app/.next-pack/server/app/manifest.webmanifest.meta +1 -0
  182. package/app/.next-pack/server/app/mcp/route.js +16 -0
  183. package/app/.next-pack/server/app/mcp/route.js.nft.json +1 -0
  184. package/app/.next-pack/server/app/mcp/route_client-reference-manifest.js +1 -0
  185. package/app/.next-pack/server/app/p/[slug]/autonomy/page.js +2 -0
  186. package/app/.next-pack/server/app/p/[slug]/autonomy/page.js.nft.json +1 -0
  187. package/app/.next-pack/server/app/p/[slug]/autonomy/page_client-reference-manifest.js +1 -0
  188. package/app/.next-pack/server/app/p/[slug]/brief/page.js +2 -0
  189. package/app/.next-pack/server/app/p/[slug]/brief/page.js.nft.json +1 -0
  190. package/app/.next-pack/server/app/p/[slug]/brief/page_client-reference-manifest.js +1 -0
  191. package/app/.next-pack/server/app/p/[slug]/crit/[screen]/page.js +2 -0
  192. package/app/.next-pack/server/app/p/[slug]/crit/[screen]/page.js.nft.json +1 -0
  193. package/app/.next-pack/server/app/p/[slug]/crit/[screen]/page_client-reference-manifest.js +1 -0
  194. package/app/.next-pack/server/app/p/[slug]/design-system/new/page.js +2 -0
  195. package/app/.next-pack/server/app/p/[slug]/design-system/new/page.js.nft.json +1 -0
  196. package/app/.next-pack/server/app/p/[slug]/design-system/new/page_client-reference-manifest.js +1 -0
  197. package/app/.next-pack/server/app/p/[slug]/design-system/page.js +2 -0
  198. package/app/.next-pack/server/app/p/[slug]/design-system/page.js.nft.json +1 -0
  199. package/app/.next-pack/server/app/p/[slug]/design-system/page_client-reference-manifest.js +1 -0
  200. package/app/.next-pack/server/app/p/[slug]/notes/page.js +2 -0
  201. package/app/.next-pack/server/app/p/[slug]/notes/page.js.nft.json +1 -0
  202. package/app/.next-pack/server/app/p/[slug]/notes/page_client-reference-manifest.js +1 -0
  203. package/app/.next-pack/server/app/p/[slug]/page.js +2 -0
  204. package/app/.next-pack/server/app/p/[slug]/page.js.nft.json +1 -0
  205. package/app/.next-pack/server/app/p/[slug]/page_client-reference-manifest.js +1 -0
  206. package/app/.next-pack/server/app/p/[slug]/plan/page.js +2 -0
  207. package/app/.next-pack/server/app/p/[slug]/plan/page.js.nft.json +1 -0
  208. package/app/.next-pack/server/app/p/[slug]/plan/page_client-reference-manifest.js +1 -0
  209. package/app/.next-pack/server/app/p/habit-tracker.html +1 -0
  210. package/app/.next-pack/server/app/p/habit-tracker.meta +7 -0
  211. package/app/.next-pack/server/app/p/habit-tracker.rsc +29 -0
  212. package/app/.next-pack/server/app/p/ledger.html +1 -0
  213. package/app/.next-pack/server/app/p/ledger.meta +7 -0
  214. package/app/.next-pack/server/app/p/ledger.rsc +29 -0
  215. package/app/.next-pack/server/app/p/portfolio-site.html +1 -0
  216. package/app/.next-pack/server/app/p/portfolio-site.meta +7 -0
  217. package/app/.next-pack/server/app/p/portfolio-site.rsc +29 -0
  218. package/app/.next-pack/server/app/page.js +2 -0
  219. package/app/.next-pack/server/app/page.js.nft.json +1 -0
  220. package/app/.next-pack/server/app/page_client-reference-manifest.js +1 -0
  221. package/app/.next-pack/server/app/playground-variants/activity/changes/page.js +2 -0
  222. package/app/.next-pack/server/app/playground-variants/activity/changes/page.js.nft.json +1 -0
  223. package/app/.next-pack/server/app/playground-variants/activity/changes/page_client-reference-manifest.js +1 -0
  224. package/app/.next-pack/server/app/playground-variants/activity/fixes/page.js +2 -0
  225. package/app/.next-pack/server/app/playground-variants/activity/fixes/page.js.nft.json +1 -0
  226. package/app/.next-pack/server/app/playground-variants/activity/fixes/page_client-reference-manifest.js +1 -0
  227. package/app/.next-pack/server/app/playground-variants/activity/fixes.html +1 -0
  228. package/app/.next-pack/server/app/playground-variants/activity/fixes.meta +9 -0
  229. package/app/.next-pack/server/app/playground-variants/activity/fixes.rsc +28 -0
  230. package/app/.next-pack/server/app/playground-variants/activity/log/page.js +2 -0
  231. package/app/.next-pack/server/app/playground-variants/activity/log/page.js.nft.json +1 -0
  232. package/app/.next-pack/server/app/playground-variants/activity/log/page_client-reference-manifest.js +1 -0
  233. package/app/.next-pack/server/app/playground-variants/activity/sessions/page.js +2 -0
  234. package/app/.next-pack/server/app/playground-variants/activity/sessions/page.js.nft.json +1 -0
  235. package/app/.next-pack/server/app/playground-variants/activity/sessions/page_client-reference-manifest.js +1 -0
  236. package/app/.next-pack/server/app/playground-variants/brain/fixes/page.js +2 -0
  237. package/app/.next-pack/server/app/playground-variants/brain/fixes/page.js.nft.json +1 -0
  238. package/app/.next-pack/server/app/playground-variants/brain/fixes/page_client-reference-manifest.js +1 -0
  239. package/app/.next-pack/server/app/playground-variants/brain/fixes.html +1 -0
  240. package/app/.next-pack/server/app/playground-variants/brain/fixes.meta +9 -0
  241. package/app/.next-pack/server/app/playground-variants/brain/fixes.rsc +28 -0
  242. package/app/.next-pack/server/app/playground-variants/brain/library/page.js +2 -0
  243. package/app/.next-pack/server/app/playground-variants/brain/library/page.js.nft.json +1 -0
  244. package/app/.next-pack/server/app/playground-variants/brain/library/page_client-reference-manifest.js +1 -0
  245. package/app/.next-pack/server/app/playground-variants/brain/timeline/page.js +2 -0
  246. package/app/.next-pack/server/app/playground-variants/brain/timeline/page.js.nft.json +1 -0
  247. package/app/.next-pack/server/app/playground-variants/brain/timeline/page_client-reference-manifest.js +1 -0
  248. package/app/.next-pack/server/app/playground-variants/connection/apps/page.js +2 -0
  249. package/app/.next-pack/server/app/playground-variants/connection/apps/page.js.nft.json +1 -0
  250. package/app/.next-pack/server/app/playground-variants/connection/apps/page_client-reference-manifest.js +1 -0
  251. package/app/.next-pack/server/app/playground-variants/connection/fixes/page.js +2 -0
  252. package/app/.next-pack/server/app/playground-variants/connection/fixes/page.js.nft.json +1 -0
  253. package/app/.next-pack/server/app/playground-variants/connection/fixes/page_client-reference-manifest.js +1 -0
  254. package/app/.next-pack/server/app/playground-variants/connection/proof/page.js +2 -0
  255. package/app/.next-pack/server/app/playground-variants/connection/proof/page.js.nft.json +1 -0
  256. package/app/.next-pack/server/app/playground-variants/connection/proof/page_client-reference-manifest.js +1 -0
  257. package/app/.next-pack/server/app/playground-variants/design-system/list/components/page.js +2 -0
  258. package/app/.next-pack/server/app/playground-variants/design-system/list/components/page.js.nft.json +1 -0
  259. package/app/.next-pack/server/app/playground-variants/design-system/list/components/page_client-reference-manifest.js +1 -0
  260. package/app/.next-pack/server/app/playground-variants/design-system/list/page.js +2 -0
  261. package/app/.next-pack/server/app/playground-variants/design-system/list/page.js.nft.json +1 -0
  262. package/app/.next-pack/server/app/playground-variants/design-system/list/page_client-reference-manifest.js +1 -0
  263. package/app/.next-pack/server/app/playground-variants/design-system/on-the-work/page.js +2 -0
  264. package/app/.next-pack/server/app/playground-variants/design-system/on-the-work/page.js.nft.json +1 -0
  265. package/app/.next-pack/server/app/playground-variants/design-system/on-the-work/page_client-reference-manifest.js +1 -0
  266. package/app/.next-pack/server/app/playground-variants/design-system/side-by-side/page.js +2 -0
  267. package/app/.next-pack/server/app/playground-variants/design-system/side-by-side/page.js.nft.json +1 -0
  268. package/app/.next-pack/server/app/playground-variants/design-system/side-by-side/page_client-reference-manifest.js +1 -0
  269. package/app/.next-pack/server/app/playground-variants/design-system/specimen/page.js +2 -0
  270. package/app/.next-pack/server/app/playground-variants/design-system/specimen/page.js.nft.json +1 -0
  271. package/app/.next-pack/server/app/playground-variants/design-system/specimen/page_client-reference-manifest.js +1 -0
  272. package/app/.next-pack/server/app/playground-variants/home/fixes/page.js +2 -0
  273. package/app/.next-pack/server/app/playground-variants/home/fixes/page.js.nft.json +1 -0
  274. package/app/.next-pack/server/app/playground-variants/home/fixes/page_client-reference-manifest.js +1 -0
  275. package/app/.next-pack/server/app/playground-variants/home/left-off/page.js +2 -0
  276. package/app/.next-pack/server/app/playground-variants/home/left-off/page.js.nft.json +1 -0
  277. package/app/.next-pack/server/app/playground-variants/home/left-off/page_client-reference-manifest.js +1 -0
  278. package/app/.next-pack/server/app/playground-variants/home/needs-you/page.js +2 -0
  279. package/app/.next-pack/server/app/playground-variants/home/needs-you/page.js.nft.json +1 -0
  280. package/app/.next-pack/server/app/playground-variants/home/needs-you/page_client-reference-manifest.js +1 -0
  281. package/app/.next-pack/server/app/playground-variants/home/paper/page.js +2 -0
  282. package/app/.next-pack/server/app/playground-variants/home/paper/page.js.nft.json +1 -0
  283. package/app/.next-pack/server/app/playground-variants/home/paper/page_client-reference-manifest.js +1 -0
  284. package/app/.next-pack/server/app/playground-variants/island/fixes/page.js +2 -0
  285. package/app/.next-pack/server/app/playground-variants/island/fixes/page.js.nft.json +1 -0
  286. package/app/.next-pack/server/app/playground-variants/island/fixes/page_client-reference-manifest.js +1 -0
  287. package/app/.next-pack/server/app/playground-variants/island/prompt/page.js +2 -0
  288. package/app/.next-pack/server/app/playground-variants/island/prompt/page.js.nft.json +1 -0
  289. package/app/.next-pack/server/app/playground-variants/island/prompt/page_client-reference-manifest.js +1 -0
  290. package/app/.next-pack/server/app/playground-variants/island/question/page.js +2 -0
  291. package/app/.next-pack/server/app/playground-variants/island/question/page.js.nft.json +1 -0
  292. package/app/.next-pack/server/app/playground-variants/island/question/page_client-reference-manifest.js +1 -0
  293. package/app/.next-pack/server/app/playground-variants/island/steady-mark/page.js +2 -0
  294. package/app/.next-pack/server/app/playground-variants/island/steady-mark/page.js.nft.json +1 -0
  295. package/app/.next-pack/server/app/playground-variants/island/steady-mark/page_client-reference-manifest.js +1 -0
  296. package/app/.next-pack/server/app/playground-variants/new-brief/axes/page.js +3 -0
  297. package/app/.next-pack/server/app/playground-variants/new-brief/axes/page.js.nft.json +1 -0
  298. package/app/.next-pack/server/app/playground-variants/new-brief/axes/page_client-reference-manifest.js +1 -0
  299. package/app/.next-pack/server/app/playground-variants/new-brief/from-screens/page.js +4 -0
  300. package/app/.next-pack/server/app/playground-variants/new-brief/from-screens/page.js.nft.json +1 -0
  301. package/app/.next-pack/server/app/playground-variants/new-brief/from-screens/page_client-reference-manifest.js +1 -0
  302. package/app/.next-pack/server/app/playground-variants/new-brief/in-the-plan/page.js +3 -0
  303. package/app/.next-pack/server/app/playground-variants/new-brief/in-the-plan/page.js.nft.json +1 -0
  304. package/app/.next-pack/server/app/playground-variants/new-brief/in-the-plan/page_client-reference-manifest.js +1 -0
  305. package/app/.next-pack/server/app/playground-variants/new-brief/plan-part/page.js +5 -0
  306. package/app/.next-pack/server/app/playground-variants/new-brief/plan-part/page.js.nft.json +1 -0
  307. package/app/.next-pack/server/app/playground-variants/new-brief/plan-part/page_client-reference-manifest.js +1 -0
  308. package/app/.next-pack/server/app/playground-variants/new-design-system/fixes/page.js +2 -0
  309. package/app/.next-pack/server/app/playground-variants/new-design-system/fixes/page.js.nft.json +1 -0
  310. package/app/.next-pack/server/app/playground-variants/new-design-system/fixes/page_client-reference-manifest.js +1 -0
  311. package/app/.next-pack/server/app/playground-variants/new-design-system/fixes.html +1 -0
  312. package/app/.next-pack/server/app/playground-variants/new-design-system/fixes.meta +9 -0
  313. package/app/.next-pack/server/app/playground-variants/new-design-system/fixes.rsc +30 -0
  314. package/app/.next-pack/server/app/playground-variants/new-design-system/from-the-screens/page.js +2 -0
  315. package/app/.next-pack/server/app/playground-variants/new-design-system/from-the-screens/page.js.nft.json +1 -0
  316. package/app/.next-pack/server/app/playground-variants/new-design-system/from-the-screens/page_client-reference-manifest.js +1 -0
  317. package/app/.next-pack/server/app/playground-variants/new-design-system/one-sheet/page.js +2 -0
  318. package/app/.next-pack/server/app/playground-variants/new-design-system/one-sheet/page.js.nft.json +1 -0
  319. package/app/.next-pack/server/app/playground-variants/new-design-system/one-sheet/page_client-reference-manifest.js +1 -0
  320. package/app/.next-pack/server/app/playground-variants/notes/fixes/page.js +2 -0
  321. package/app/.next-pack/server/app/playground-variants/notes/fixes/page.js.nft.json +1 -0
  322. package/app/.next-pack/server/app/playground-variants/notes/fixes/page_client-reference-manifest.js +1 -0
  323. package/app/.next-pack/server/app/playground-variants/notes/inbox/page.js +2 -0
  324. package/app/.next-pack/server/app/playground-variants/notes/inbox/page.js.nft.json +1 -0
  325. package/app/.next-pack/server/app/playground-variants/notes/inbox/page_client-reference-manifest.js +1 -0
  326. package/app/.next-pack/server/app/playground-variants/notes/wall/page.js +2 -0
  327. package/app/.next-pack/server/app/playground-variants/notes/wall/page.js.nft.json +1 -0
  328. package/app/.next-pack/server/app/playground-variants/notes/wall/page_client-reference-manifest.js +1 -0
  329. package/app/.next-pack/server/app/playground-variants/project/fixes/page.js +2 -0
  330. package/app/.next-pack/server/app/playground-variants/project/fixes/page.js.nft.json +1 -0
  331. package/app/.next-pack/server/app/playground-variants/project/fixes/page_client-reference-manifest.js +1 -0
  332. package/app/.next-pack/server/app/playground-variants/project-design-system/on-the-product/page.js +2 -0
  333. package/app/.next-pack/server/app/playground-variants/project-design-system/on-the-product/page.js.nft.json +1 -0
  334. package/app/.next-pack/server/app/playground-variants/project-design-system/on-the-product/page_client-reference-manifest.js +1 -0
  335. package/app/.next-pack/server/app/playground-variants/project-design-system/specimen/page.js +2 -0
  336. package/app/.next-pack/server/app/playground-variants/project-design-system/specimen/page.js.nft.json +1 -0
  337. package/app/.next-pack/server/app/playground-variants/project-design-system/specimen/page_client-reference-manifest.js +1 -0
  338. package/app/.next-pack/server/app/playground-variants/project-design-system/variables/page.js +2 -0
  339. package/app/.next-pack/server/app/playground-variants/project-design-system/variables/page.js.nft.json +1 -0
  340. package/app/.next-pack/server/app/playground-variants/project-design-system/variables/page_client-reference-manifest.js +1 -0
  341. package/app/.next-pack/server/app/playground-variants/project-flows/app-map/page.js +2 -0
  342. package/app/.next-pack/server/app/playground-variants/project-flows/app-map/page.js.nft.json +1 -0
  343. package/app/.next-pack/server/app/playground-variants/project-flows/app-map/page_client-reference-manifest.js +1 -0
  344. package/app/.next-pack/server/app/playground-variants/project-flows/by-flow/page.js +2 -0
  345. package/app/.next-pack/server/app/playground-variants/project-flows/by-flow/page.js.nft.json +1 -0
  346. package/app/.next-pack/server/app/playground-variants/project-flows/by-flow/page_client-reference-manifest.js +1 -0
  347. package/app/.next-pack/server/app/playground-variants/project-flows/by-place/page.js +2 -0
  348. package/app/.next-pack/server/app/playground-variants/project-flows/by-place/page.js.nft.json +1 -0
  349. package/app/.next-pack/server/app/playground-variants/project-flows/by-place/page_client-reference-manifest.js +1 -0
  350. package/app/.next-pack/server/app/playground-variants/project-flows/fixes/page.js +2 -0
  351. package/app/.next-pack/server/app/playground-variants/project-flows/fixes/page.js.nft.json +1 -0
  352. package/app/.next-pack/server/app/playground-variants/project-flows/fixes/page_client-reference-manifest.js +1 -0
  353. package/app/.next-pack/server/app/playground-variants/project-plan/board/page.js +2 -0
  354. package/app/.next-pack/server/app/playground-variants/project-plan/board/page.js.nft.json +1 -0
  355. package/app/.next-pack/server/app/playground-variants/project-plan/board/page_client-reference-manifest.js +1 -0
  356. package/app/.next-pack/server/app/playground-variants/project-plan/document/page.js +2 -0
  357. package/app/.next-pack/server/app/playground-variants/project-plan/document/page.js.nft.json +1 -0
  358. package/app/.next-pack/server/app/playground-variants/project-plan/document/page_client-reference-manifest.js +1 -0
  359. package/app/.next-pack/server/app/playground-variants/project-plan/fixes/page.js +2 -0
  360. package/app/.next-pack/server/app/playground-variants/project-plan/fixes/page.js.nft.json +1 -0
  361. package/app/.next-pack/server/app/playground-variants/project-plan/fixes/page_client-reference-manifest.js +1 -0
  362. package/app/.next-pack/server/app/playground-variants/project-plan/timeline/page.js +2 -0
  363. package/app/.next-pack/server/app/playground-variants/project-plan/timeline/page.js.nft.json +1 -0
  364. package/app/.next-pack/server/app/playground-variants/project-plan/timeline/page_client-reference-manifest.js +1 -0
  365. package/app/.next-pack/server/app/playground-variants/project-variants/fixes/page.js +2 -0
  366. package/app/.next-pack/server/app/playground-variants/project-variants/fixes/page.js.nft.json +1 -0
  367. package/app/.next-pack/server/app/playground-variants/project-variants/fixes/page_client-reference-manifest.js +1 -0
  368. package/app/.next-pack/server/app/playground-variants/skill/asks/page.js +6 -0
  369. package/app/.next-pack/server/app/playground-variants/skill/asks/page.js.nft.json +1 -0
  370. package/app/.next-pack/server/app/playground-variants/skill/asks/page_client-reference-manifest.js +1 -0
  371. package/app/.next-pack/server/app/playground-variants/skill/cards/page.js +6 -0
  372. package/app/.next-pack/server/app/playground-variants/skill/cards/page.js.nft.json +1 -0
  373. package/app/.next-pack/server/app/playground-variants/skill/cards/page_client-reference-manifest.js +1 -0
  374. package/app/.next-pack/server/app/playground-variants/skills/beside/page.js +2 -0
  375. package/app/.next-pack/server/app/playground-variants/skills/beside/page.js.nft.json +1 -0
  376. package/app/.next-pack/server/app/playground-variants/skills/beside/page_client-reference-manifest.js +1 -0
  377. package/app/.next-pack/server/app/playground-variants/skills/filter/page.js +2 -0
  378. package/app/.next-pack/server/app/playground-variants/skills/filter/page.js.nft.json +1 -0
  379. package/app/.next-pack/server/app/playground-variants/skills/filter/page_client-reference-manifest.js +1 -0
  380. package/app/.next-pack/server/app/playground-variants/skills/layers/page.js +2 -0
  381. package/app/.next-pack/server/app/playground-variants/skills/layers/page.js.nft.json +1 -0
  382. package/app/.next-pack/server/app/playground-variants/skills/layers/page_client-reference-manifest.js +1 -0
  383. package/app/.next-pack/server/app/playground-variants/skills/ledger/page.js +2 -0
  384. package/app/.next-pack/server/app/playground-variants/skills/ledger/page.js.nft.json +1 -0
  385. package/app/.next-pack/server/app/playground-variants/skills/ledger/page_client-reference-manifest.js +1 -0
  386. package/app/.next-pack/server/app/playground-variants/skills/map/page.js +2 -0
  387. package/app/.next-pack/server/app/playground-variants/skills/map/page.js.nft.json +1 -0
  388. package/app/.next-pack/server/app/playground-variants/skills/map/page_client-reference-manifest.js +1 -0
  389. package/app/.next-pack/server/app/playground-variants/skills/one-group/page.js +2 -0
  390. package/app/.next-pack/server/app/playground-variants/skills/one-group/page.js.nft.json +1 -0
  391. package/app/.next-pack/server/app/playground-variants/skills/one-group/page_client-reference-manifest.js +1 -0
  392. package/app/.next-pack/server/app/playground-variants/skills/rail/page.js +2 -0
  393. package/app/.next-pack/server/app/playground-variants/skills/rail/page.js.nft.json +1 -0
  394. package/app/.next-pack/server/app/playground-variants/skills/rail/page_client-reference-manifest.js +1 -0
  395. package/app/.next-pack/server/app/render/markup/page.js +2 -0
  396. package/app/.next-pack/server/app/render/markup/page.js.nft.json +1 -0
  397. package/app/.next-pack/server/app/render/markup/page_client-reference-manifest.js +1 -0
  398. package/app/.next-pack/server/app/s/[slug]/[id]/page.js +2 -0
  399. package/app/.next-pack/server/app/s/[slug]/[id]/page.js.nft.json +1 -0
  400. package/app/.next-pack/server/app/s/[slug]/[id]/page_client-reference-manifest.js +1 -0
  401. package/app/.next-pack/server/app/skills/[name]/page.js +2 -0
  402. package/app/.next-pack/server/app/skills/[name]/page.js.nft.json +1 -0
  403. package/app/.next-pack/server/app/skills/[name]/page_client-reference-manifest.js +1 -0
  404. package/app/.next-pack/server/app/skills/[name]/references/[file]/page.js +2 -0
  405. package/app/.next-pack/server/app/skills/[name]/references/[file]/page.js.nft.json +1 -0
  406. package/app/.next-pack/server/app/skills/[name]/references/[file]/page_client-reference-manifest.js +1 -0
  407. package/app/.next-pack/server/app/skills/page.js +2 -0
  408. package/app/.next-pack/server/app/skills/page.js.nft.json +1 -0
  409. package/app/.next-pack/server/app/skills/page_client-reference-manifest.js +1 -0
  410. package/app/.next-pack/server/app-paths-manifest.json +118 -0
  411. package/app/.next-pack/server/chunks/1152.js +1 -0
  412. package/app/.next-pack/server/chunks/1559.js +1 -0
  413. package/app/.next-pack/server/chunks/1692.js +1 -0
  414. package/app/.next-pack/server/chunks/1923.js +1 -0
  415. package/app/.next-pack/server/chunks/225.js +9 -0
  416. package/app/.next-pack/server/chunks/2325.js +1 -0
  417. package/app/.next-pack/server/chunks/2585.js +1 -0
  418. package/app/.next-pack/server/chunks/2617.js +1 -0
  419. package/app/.next-pack/server/chunks/2667.js +5 -0
  420. package/app/.next-pack/server/chunks/2841.js +1 -0
  421. package/app/.next-pack/server/chunks/2844.js +1 -0
  422. package/app/.next-pack/server/chunks/2894.js +1 -0
  423. package/app/.next-pack/server/chunks/2935.js +8 -0
  424. package/app/.next-pack/server/chunks/323.js +1 -0
  425. package/app/.next-pack/server/chunks/3381.js +8 -0
  426. package/app/.next-pack/server/chunks/344.js +5 -0
  427. package/app/.next-pack/server/chunks/3515.js +45 -0
  428. package/app/.next-pack/server/chunks/4215.js +133 -0
  429. package/app/.next-pack/server/chunks/458.js +1 -0
  430. package/app/.next-pack/server/chunks/4874.js +1 -0
  431. package/app/.next-pack/server/chunks/4903.js +3 -0
  432. package/app/.next-pack/server/chunks/5442.js +3 -0
  433. package/app/.next-pack/server/chunks/5548.js +111 -0
  434. package/app/.next-pack/server/chunks/5611.js +6 -0
  435. package/app/.next-pack/server/chunks/5646.js +1 -0
  436. package/app/.next-pack/server/chunks/5797.js +17 -0
  437. package/app/.next-pack/server/chunks/5816.js +1 -0
  438. package/app/.next-pack/server/chunks/5873.js +22 -0
  439. package/app/.next-pack/server/chunks/5905.js +1 -0
  440. package/app/.next-pack/server/chunks/5997.js +1 -0
  441. package/app/.next-pack/server/chunks/6261.js +3 -0
  442. package/app/.next-pack/server/chunks/6282.js +2 -0
  443. package/app/.next-pack/server/chunks/6795.js +1 -0
  444. package/app/.next-pack/server/chunks/6802.js +1 -0
  445. package/app/.next-pack/server/chunks/6823.js +1 -0
  446. package/app/.next-pack/server/chunks/8373.js +1 -0
  447. package/app/.next-pack/server/chunks/934.js +1 -0
  448. package/app/.next-pack/server/chunks/9987.js +1 -0
  449. package/app/.next-pack/server/chunks/9997.js +1 -0
  450. package/app/.next-pack/server/functions-config-manifest.json +30 -0
  451. package/app/.next-pack/server/middleware-build-manifest.js +1 -0
  452. package/app/.next-pack/server/middleware-manifest.json +6 -0
  453. package/app/.next-pack/server/middleware-react-loadable-manifest.js +1 -0
  454. package/app/.next-pack/server/next-font-manifest.js +1 -0
  455. package/app/.next-pack/server/next-font-manifest.json +1 -0
  456. package/app/.next-pack/server/pages/404.html +1 -0
  457. package/app/.next-pack/server/pages/500.html +1 -0
  458. package/app/.next-pack/server/pages/_app.js +1 -0
  459. package/app/.next-pack/server/pages/_app.js.nft.json +1 -0
  460. package/app/.next-pack/server/pages/_document.js +1 -0
  461. package/app/.next-pack/server/pages/_document.js.nft.json +1 -0
  462. package/app/.next-pack/server/pages/_error.js +19 -0
  463. package/app/.next-pack/server/pages/_error.js.nft.json +1 -0
  464. package/app/.next-pack/server/pages-manifest.json +6 -0
  465. package/app/.next-pack/server/server-reference-manifest.js +1 -0
  466. package/app/.next-pack/server/server-reference-manifest.json +1 -0
  467. package/app/.next-pack/server/webpack-runtime.js +1 -0
  468. package/app/.next-pack/static/chunks/1255-ab54a41c275880be.js +1 -0
  469. package/app/.next-pack/static/chunks/1620-3887f0a9bb6a6e52.js +1 -0
  470. package/app/.next-pack/static/chunks/2201-5a213ff898336baf.js +1 -0
  471. package/app/.next-pack/static/chunks/2357-8b5189e2265ea7c4.js +1 -0
  472. package/app/.next-pack/static/chunks/2383-15b938c92ef9f24f.js +1 -0
  473. package/app/.next-pack/static/chunks/2442-f2b612920f2deb45.js +1 -0
  474. package/app/.next-pack/static/chunks/2548-0ad3197772c64140.js +1 -0
  475. package/app/.next-pack/static/chunks/2619-04bc32f026a0d946.js +1 -0
  476. package/app/.next-pack/static/chunks/280-469df9888da704bc.js +1 -0
  477. package/app/.next-pack/static/chunks/3078-801925ff2259373c.js +1 -0
  478. package/app/.next-pack/static/chunks/3390-98fae590141e8a3b.js +91 -0
  479. package/app/.next-pack/static/chunks/3557-e90677d95fe82917.js +1 -0
  480. package/app/.next-pack/static/chunks/3765-1bebbcbea8ec579f.js +1 -0
  481. package/app/.next-pack/static/chunks/3942-ac2b767cb4cb9751.js +1 -0
  482. package/app/.next-pack/static/chunks/3949-343003dd0e44f70f.js +1 -0
  483. package/app/.next-pack/static/chunks/4196-ed534d55a1f082ca.js +1 -0
  484. package/app/.next-pack/static/chunks/4730-982221d491dfcf0a.js +1 -0
  485. package/app/.next-pack/static/chunks/4809-34ea5db9d8dab185.js +1 -0
  486. package/app/.next-pack/static/chunks/4842-6d4d7548082dad08.js +1 -0
  487. package/app/.next-pack/static/chunks/4873-d6eb65b5ee35a87a.js +1 -0
  488. package/app/.next-pack/static/chunks/4bd1b696-100b9d70ed4e49c1.js +1 -0
  489. package/app/.next-pack/static/chunks/5102-0ef1e800cc74f022.js +1 -0
  490. package/app/.next-pack/static/chunks/5384-1a55e5bc7d4e33fb.js +1 -0
  491. package/app/.next-pack/static/chunks/544-2c2ebb6324a65f39.js +1 -0
  492. package/app/.next-pack/static/chunks/5889-d11ac55253a33667.js +1 -0
  493. package/app/.next-pack/static/chunks/645-828e8183bd7c82dc.js +1 -0
  494. package/app/.next-pack/static/chunks/7404-c231d7b91a3bf5a9.js +1 -0
  495. package/app/.next-pack/static/chunks/7842-55c0fbd25977fb87.js +1 -0
  496. package/app/.next-pack/static/chunks/7953-2af792d7552f1019.js +1 -0
  497. package/app/.next-pack/static/chunks/8091-1cee6c2d5782680c.js +1 -0
  498. package/app/.next-pack/static/chunks/82-e26c71e4455eb8b9.js +1 -0
  499. package/app/.next-pack/static/chunks/8319.fc6a501f5c0d3c8c.js +1 -0
  500. package/app/.next-pack/static/chunks/8362-3bb810a059470f8a.js +1 -0
  501. package/app/.next-pack/static/chunks/845-c6fa6c59d6a99441.js +1 -0
  502. package/app/.next-pack/static/chunks/847-c7aea7b1f7c70b1d.js +1 -0
  503. package/app/.next-pack/static/chunks/852-26da3aecd173347f.js +1 -0
  504. package/app/.next-pack/static/chunks/8682-034cc1be61c0d2ae.js +1 -0
  505. package/app/.next-pack/static/chunks/876-4fad7d8e04855203.js +1 -0
  506. package/app/.next-pack/static/chunks/961-301e1bef686168c1.js +1 -0
  507. package/app/.next-pack/static/chunks/9729-7ef7b7cf4d60f7a8.js +1 -0
  508. package/app/.next-pack/static/chunks/9806.ff5dcfd2d1d7b40e.js +1 -0
  509. package/app/.next-pack/static/chunks/9906-611eb95340d24876.js +1 -0
  510. package/app/.next-pack/static/chunks/9979-d899b0f0df05f7c1.js +1 -0
  511. package/app/.next-pack/static/chunks/app/_not-found/page-b9c0e3bfc70d4052.js +1 -0
  512. package/app/.next-pack/static/chunks/app/activity/page-b9c0e3bfc70d4052.js +1 -0
  513. package/app/.next-pack/static/chunks/app/api/activity/route-b9c0e3bfc70d4052.js +1 -0
  514. package/app/.next-pack/static/chunks/app/api/apps/shot/route-b9c0e3bfc70d4052.js +1 -0
  515. package/app/.next-pack/static/chunks/app/api/apps/vshot/route-b9c0e3bfc70d4052.js +1 -0
  516. package/app/.next-pack/static/chunks/app/api/brain/route-b9c0e3bfc70d4052.js +1 -0
  517. package/app/.next-pack/static/chunks/app/api/build/route-b9c0e3bfc70d4052.js +1 -0
  518. package/app/.next-pack/static/chunks/app/api/check/route-b9c0e3bfc70d4052.js +1 -0
  519. package/app/.next-pack/static/chunks/app/api/files/route-b9c0e3bfc70d4052.js +1 -0
  520. package/app/.next-pack/static/chunks/app/api/fonts/[file]/route-b9c0e3bfc70d4052.js +1 -0
  521. package/app/.next-pack/static/chunks/app/api/home/route-b9c0e3bfc70d4052.js +1 -0
  522. package/app/.next-pack/static/chunks/app/api/local/pick-folder/route-b9c0e3bfc70d4052.js +1 -0
  523. package/app/.next-pack/static/chunks/app/api/local/repos/route-b9c0e3bfc70d4052.js +1 -0
  524. package/app/.next-pack/static/chunks/app/api/plan/route-b9c0e3bfc70d4052.js +1 -0
  525. package/app/.next-pack/static/chunks/app/api/projects/route-b9c0e3bfc70d4052.js +1 -0
  526. package/app/.next-pack/static/chunks/app/api/remote/route-b9c0e3bfc70d4052.js +1 -0
  527. package/app/.next-pack/static/chunks/app/api/screens/route-b9c0e3bfc70d4052.js +1 -0
  528. package/app/.next-pack/static/chunks/app/api/skills/route-b9c0e3bfc70d4052.js +1 -0
  529. package/app/.next-pack/static/chunks/app/api/state/ref/route-b9c0e3bfc70d4052.js +1 -0
  530. package/app/.next-pack/static/chunks/app/api/state/route-b9c0e3bfc70d4052.js +1 -0
  531. package/app/.next-pack/static/chunks/app/api/studio/crit/route-b9c0e3bfc70d4052.js +1 -0
  532. package/app/.next-pack/static/chunks/app/api/studio/diff/route-b9c0e3bfc70d4052.js +1 -0
  533. package/app/.next-pack/static/chunks/app/api/studio/html/route-b9c0e3bfc70d4052.js +1 -0
  534. package/app/.next-pack/static/chunks/app/api/studio/project/route-b9c0e3bfc70d4052.js +1 -0
  535. package/app/.next-pack/static/chunks/app/api/studio/route-b9c0e3bfc70d4052.js +1 -0
  536. package/app/.next-pack/static/chunks/app/api/studio/system/route-b9c0e3bfc70d4052.js +1 -0
  537. package/app/.next-pack/static/chunks/app/api/studio/variants/route-b9c0e3bfc70d4052.js +1 -0
  538. package/app/.next-pack/static/chunks/app/api/sync/route-b9c0e3bfc70d4052.js +1 -0
  539. package/app/.next-pack/static/chunks/app/api/themes/route-b9c0e3bfc70d4052.js +1 -0
  540. package/app/.next-pack/static/chunks/app/apple-icon/route-b9c0e3bfc70d4052.js +1 -0
  541. package/app/.next-pack/static/chunks/app/brain/page-6b6852005bdea3a1.js +1 -0
  542. package/app/.next-pack/static/chunks/app/connection/page-43258f5ed455145f.js +1 -0
  543. package/app/.next-pack/static/chunks/app/design-system/[system]/page-c1275b9f70359e35.js +1 -0
  544. package/app/.next-pack/static/chunks/app/design-system/components/page-b9c0e3bfc70d4052.js +1 -0
  545. package/app/.next-pack/static/chunks/app/design-system/directions/page-4ccb9d4cfcc1fe30.js +1 -0
  546. package/app/.next-pack/static/chunks/app/design-system/page-94a983ebbb098181.js +1 -0
  547. package/app/.next-pack/static/chunks/app/icon/route-b9c0e3bfc70d4052.js +1 -0
  548. package/app/.next-pack/static/chunks/app/lab/attention/page-e12e4d982da93f29.js +1 -0
  549. package/app/.next-pack/static/chunks/app/lab/design-system/page-b8fe2adddb384eed.js +1 -0
  550. package/app/.next-pack/static/chunks/app/lab/home/page-45d577dfba161de4.js +1 -0
  551. package/app/.next-pack/static/chunks/app/lab/island/page-fa6c4dfe18ff7da7.js +1 -0
  552. package/app/.next-pack/static/chunks/app/lab/kit/page-3baff477bc1bf93c.js +1 -0
  553. package/app/.next-pack/static/chunks/app/lab/page-2a32d0bfa1b59bf7.js +1 -0
  554. package/app/.next-pack/static/chunks/app/lab/skills/page-b731a885dceda086.js +1 -0
  555. package/app/.next-pack/static/chunks/app/lab/studio/page-3b4662783183cef9.js +1 -0
  556. package/app/.next-pack/static/chunks/app/layout-9fbb82b37fb32065.js +1 -0
  557. package/app/.next-pack/static/chunks/app/manifest.webmanifest/route-b9c0e3bfc70d4052.js +1 -0
  558. package/app/.next-pack/static/chunks/app/mcp/route-b9c0e3bfc70d4052.js +1 -0
  559. package/app/.next-pack/static/chunks/app/not-found-d8dd47e48e08331a.js +1 -0
  560. package/app/.next-pack/static/chunks/app/p/[slug]/autonomy/page-b9c0e3bfc70d4052.js +1 -0
  561. package/app/.next-pack/static/chunks/app/p/[slug]/brief/page-8878cf6d7ce7e81b.js +1 -0
  562. package/app/.next-pack/static/chunks/app/p/[slug]/crit/[screen]/page-b9c0e3bfc70d4052.js +1 -0
  563. package/app/.next-pack/static/chunks/app/p/[slug]/design-system/new/page-4fd6758aa223cbb1.js +1 -0
  564. package/app/.next-pack/static/chunks/app/p/[slug]/design-system/page-e2ec421d3c0883f0.js +1 -0
  565. package/app/.next-pack/static/chunks/app/p/[slug]/notes/page-b9c0e3bfc70d4052.js +1 -0
  566. package/app/.next-pack/static/chunks/app/p/[slug]/page-1f8281f54ea9e2f7.js +1 -0
  567. package/app/.next-pack/static/chunks/app/p/[slug]/plan/page-b9c0e3bfc70d4052.js +1 -0
  568. package/app/.next-pack/static/chunks/app/page-a3eacde957659fcc.js +1 -0
  569. package/app/.next-pack/static/chunks/app/playground-variants/activity/changes/page-ad24825167db1ad6.js +1 -0
  570. package/app/.next-pack/static/chunks/app/playground-variants/activity/fixes/page-b9c0e3bfc70d4052.js +1 -0
  571. package/app/.next-pack/static/chunks/app/playground-variants/activity/log/page-d2c54d65b5fca75b.js +1 -0
  572. package/app/.next-pack/static/chunks/app/playground-variants/activity/sessions/page-637cf612c5e1a92f.js +1 -0
  573. package/app/.next-pack/static/chunks/app/playground-variants/brain/fixes/page-b9c0e3bfc70d4052.js +1 -0
  574. package/app/.next-pack/static/chunks/app/playground-variants/brain/library/page-1662ed6dd3f14880.js +1 -0
  575. package/app/.next-pack/static/chunks/app/playground-variants/brain/timeline/page-800786ff1c915f75.js +1 -0
  576. package/app/.next-pack/static/chunks/app/playground-variants/connection/apps/page-2c79fd0beba4dba8.js +1 -0
  577. package/app/.next-pack/static/chunks/app/playground-variants/connection/fixes/page-43258f5ed455145f.js +1 -0
  578. package/app/.next-pack/static/chunks/app/playground-variants/connection/proof/page-7122c43d0f16735c.js +1 -0
  579. package/app/.next-pack/static/chunks/app/playground-variants/design-system/list/components/page-55f4e2bd2dc125a3.js +1 -0
  580. package/app/.next-pack/static/chunks/app/playground-variants/design-system/list/page-94a983ebbb098181.js +1 -0
  581. package/app/.next-pack/static/chunks/app/playground-variants/design-system/on-the-work/page-2e111523b5d9ab81.js +1 -0
  582. package/app/.next-pack/static/chunks/app/playground-variants/design-system/side-by-side/page-7f671cea75afeea9.js +1 -0
  583. package/app/.next-pack/static/chunks/app/playground-variants/design-system/specimen/page-df2593cd7cfdbc2b.js +1 -0
  584. package/app/.next-pack/static/chunks/app/playground-variants/home/fixes/page-1e450e87af5c0d52.js +1 -0
  585. package/app/.next-pack/static/chunks/app/playground-variants/home/left-off/page-e781b91f325db982.js +1 -0
  586. package/app/.next-pack/static/chunks/app/playground-variants/home/needs-you/page-0f7180e904d86eef.js +1 -0
  587. package/app/.next-pack/static/chunks/app/playground-variants/home/paper/page-8acb063092763fe5.js +1 -0
  588. package/app/.next-pack/static/chunks/app/playground-variants/island/fixes/page-581d3e25adf3c12e.js +1 -0
  589. package/app/.next-pack/static/chunks/app/playground-variants/island/prompt/page-a66fe3d33cdbbf39.js +1 -0
  590. package/app/.next-pack/static/chunks/app/playground-variants/island/question/page-a66fe3d33cdbbf39.js +1 -0
  591. package/app/.next-pack/static/chunks/app/playground-variants/island/steady-mark/page-a66fe3d33cdbbf39.js +1 -0
  592. package/app/.next-pack/static/chunks/app/playground-variants/new-brief/axes/page-bc61d726ebbd3af7.js +1 -0
  593. package/app/.next-pack/static/chunks/app/playground-variants/new-brief/from-screens/page-8652d53131d14db4.js +1 -0
  594. package/app/.next-pack/static/chunks/app/playground-variants/new-brief/in-the-plan/page-66a929a1eccb4b18.js +1 -0
  595. package/app/.next-pack/static/chunks/app/playground-variants/new-brief/plan-part/page-8cf72308466a4440.js +1 -0
  596. package/app/.next-pack/static/chunks/app/playground-variants/new-design-system/fixes/page-b9c0e3bfc70d4052.js +1 -0
  597. package/app/.next-pack/static/chunks/app/playground-variants/new-design-system/from-the-screens/page-a1e122b427b4fa9f.js +1 -0
  598. package/app/.next-pack/static/chunks/app/playground-variants/new-design-system/one-sheet/page-ef569809afacf34e.js +1 -0
  599. package/app/.next-pack/static/chunks/app/playground-variants/notes/fixes/page-b9c0e3bfc70d4052.js +1 -0
  600. package/app/.next-pack/static/chunks/app/playground-variants/notes/inbox/page-06ea9d708f23fc22.js +1 -0
  601. package/app/.next-pack/static/chunks/app/playground-variants/notes/wall/page-236712a946c7c7dc.js +1 -0
  602. package/app/.next-pack/static/chunks/app/playground-variants/project/fixes/page-9870e5167e2c2a69.js +1 -0
  603. package/app/.next-pack/static/chunks/app/playground-variants/project-design-system/on-the-product/page-4cc7c265d589b37c.js +1 -0
  604. package/app/.next-pack/static/chunks/app/playground-variants/project-design-system/specimen/page-a2059f1aa40764ca.js +1 -0
  605. package/app/.next-pack/static/chunks/app/playground-variants/project-design-system/variables/page-b7ec19097a83b2d2.js +1 -0
  606. package/app/.next-pack/static/chunks/app/playground-variants/project-flows/app-map/page-cdb5040040ac2396.js +1 -0
  607. package/app/.next-pack/static/chunks/app/playground-variants/project-flows/by-flow/page-611924afb955fc46.js +1 -0
  608. package/app/.next-pack/static/chunks/app/playground-variants/project-flows/by-place/page-47aa437868f25e15.js +1 -0
  609. package/app/.next-pack/static/chunks/app/playground-variants/project-flows/fixes/page-9870e5167e2c2a69.js +1 -0
  610. package/app/.next-pack/static/chunks/app/playground-variants/project-plan/board/page-b926699ad9dd394a.js +1 -0
  611. package/app/.next-pack/static/chunks/app/playground-variants/project-plan/document/page-a5c5a927e81bc566.js +1 -0
  612. package/app/.next-pack/static/chunks/app/playground-variants/project-plan/fixes/page-9870e5167e2c2a69.js +1 -0
  613. package/app/.next-pack/static/chunks/app/playground-variants/project-plan/timeline/page-91c548a5b9ea9470.js +1 -0
  614. package/app/.next-pack/static/chunks/app/playground-variants/project-variants/fixes/page-9870e5167e2c2a69.js +1 -0
  615. package/app/.next-pack/static/chunks/app/playground-variants/skill/asks/page-37739ab08757a61b.js +1 -0
  616. package/app/.next-pack/static/chunks/app/playground-variants/skill/cards/page-1946096eb0c78dcd.js +1 -0
  617. package/app/.next-pack/static/chunks/app/playground-variants/skills/beside/page-a6a8b6a6cdd3fc82.js +1 -0
  618. package/app/.next-pack/static/chunks/app/playground-variants/skills/filter/page-b97db65ac599c400.js +1 -0
  619. package/app/.next-pack/static/chunks/app/playground-variants/skills/layers/page-2a2223c2c424eaec.js +1 -0
  620. package/app/.next-pack/static/chunks/app/playground-variants/skills/ledger/page-f9ea4f3e7a9a9b2c.js +1 -0
  621. package/app/.next-pack/static/chunks/app/playground-variants/skills/map/page-1522188d2ff0ed12.js +1 -0
  622. package/app/.next-pack/static/chunks/app/playground-variants/skills/one-group/page-0f30a8a91821137e.js +1 -0
  623. package/app/.next-pack/static/chunks/app/playground-variants/skills/rail/page-ab8cb5f524ccb497.js +1 -0
  624. package/app/.next-pack/static/chunks/app/render/markup/page-1c01df57f9e7bbb2.js +1 -0
  625. package/app/.next-pack/static/chunks/app/s/[slug]/[id]/page-c9c8db19304e1c1c.js +1 -0
  626. package/app/.next-pack/static/chunks/app/skills/[name]/page-d9cd4b249d5cf1ec.js +1 -0
  627. package/app/.next-pack/static/chunks/app/skills/[name]/references/[file]/page-927e87440aa54686.js +1 -0
  628. package/app/.next-pack/static/chunks/app/skills/page-21bbe0883616280e.js +1 -0
  629. package/app/.next-pack/static/chunks/framework-e9384f6a6720bcd2.js +1 -0
  630. package/app/.next-pack/static/chunks/main-44487cf0f2c31ffd.js +1 -0
  631. package/app/.next-pack/static/chunks/main-app-7c486aa598a9b17f.js +1 -0
  632. package/app/.next-pack/static/chunks/pages/_app-4b3fb5e477a0267f.js +1 -0
  633. package/app/.next-pack/static/chunks/pages/_error-c970d8b55ace1b48.js +1 -0
  634. package/app/.next-pack/static/chunks/polyfills-42372ed130431b0a.js +1 -0
  635. package/app/.next-pack/static/chunks/webpack-b095dc2d90fb61fb.js +1 -0
  636. package/app/.next-pack/static/css/5bf8691e68650fe3.css +1 -0
  637. package/app/.next-pack/static/css/788a5084e46c64ae.css +1 -0
  638. package/app/.next-pack/static/css/b46042613e375027.css +1 -0
  639. package/app/.next-pack/static/g8RKjz4QqH6jA3z4kwQsG/_buildManifest.js +1 -0
  640. package/app/.next-pack/static/g8RKjz4QqH6jA3z4kwQsG/_ssgManifest.js +1 -0
  641. package/app/.next-pack/static/media/013b72fa676f92e0-s.woff2 +0 -0
  642. package/app/.next-pack/static/media/2204a898abe5c90a-s.woff2 +0 -0
  643. package/app/.next-pack/static/media/2aa7577a895dd046-s.woff2 +0 -0
  644. package/app/.next-pack/static/media/2b5b02fc7e511755-s.woff2 +0 -0
  645. package/app/.next-pack/static/media/65f03d54ccadf4a8-s.woff2 +0 -0
  646. package/app/.next-pack/static/media/7d4881bb7e1bf84d-s.p.woff2 +0 -0
  647. package/app/.next-pack/static/media/Geist-Variable.27834908.woff2 +0 -0
  648. package/app/.next-pack/static/media/Satoshi-Variable.2f4d9bbe.woff2 +0 -0
  649. package/app/.next-pack/static/media/a813b685af4569ea-s.p.woff2 +0 -0
  650. package/app/.next-pack/static/media/b9408752a0c24fb9-s.woff2 +0 -0
  651. package/app/.next-pack/static/media/e038a29029a234f2-s.woff2 +0 -0
  652. package/app/package.json +46 -0
  653. package/app/public/ds-fonts/Geist-OFL.txt +92 -0
  654. package/app/public/ds-fonts/Geist-Variable.woff2 +0 -0
  655. package/app/public/ds-fonts/Satoshi-Variable.woff2 +0 -0
  656. package/app/public/sample/note-settings.png +0 -0
  657. package/app/public/sample/p-DSCF7127.webp +0 -0
  658. package/app/public/sample/p-DSCF7256.webp +0 -0
  659. package/app/public/sample/p-DSCF7337.webp +0 -0
  660. package/app/public/sample/p-DSCF7437.webp +0 -0
  661. package/app/public/sample/p-DSCF7609.webp +0 -0
  662. package/app/public/sample/p-DSCF8088.webp +0 -0
  663. package/app/server.js +38 -0
  664. package/app/vendor/REF +1 -0
  665. package/bin/baseline-playground.mjs +160 -0
  666. package/package.json +24 -4
  667. package/skills/agent-teams/SKILL.md +132 -0
  668. package/skills/agent-teams/references/briefs-and-reports.md +81 -0
  669. package/skills/agent-teams/references/evidence.md +64 -0
  670. package/skills/baseline-taste/SKILL.md +204 -0
  671. package/skills/baseline-taste/references/corrections.md +480 -0
  672. package/skills/baseline-taste/references/look.md +494 -0
  673. package/skills/baseline-taste/references/motion-values.md +187 -0
  674. package/skills/baseline-taste/references/voice.md +118 -0
  675. package/skills/cognition/SKILL.md +259 -0
  676. package/skills/cognition/references/choice-architecture.md +83 -0
  677. package/skills/cognition/references/laws-of-ux.md +153 -0
  678. package/skills/cognition/references/simulation.md +101 -0
  679. package/skills/data-visualization/SKILL.md +200 -0
  680. package/skills/data-visualization/references/bars-and-progress.md +114 -0
  681. package/skills/data-visualization/references/chart-anatomy.md +129 -0
  682. package/skills/data-visualization/references/dashboards-and-reports.md +148 -0
  683. package/skills/data-visualization/references/palette.md +63 -0
  684. package/skills/data-visualization/references/timelines.md +83 -0
  685. package/skills/delivery/SKILL.md +249 -0
  686. package/skills/delivery/references/change-and-rollout.md +127 -0
  687. package/skills/delivery/references/facilitation.md +107 -0
  688. package/skills/delivery/references/plans-and-estimates.md +187 -0
  689. package/skills/delivery/references/product-documents.md +206 -0
  690. package/skills/delivery/references/sessions-and-orchestration.md +167 -0
  691. package/skills/delivery/references/stakeholders.md +146 -0
  692. package/skills/delivery/references/status-and-reports.md +142 -0
  693. package/skills/delivery/references/technical-docs.md +177 -0
  694. package/skills/design-critique/SKILL.md +245 -0
  695. package/skills/design-critique/references/changes-and-lessons.md +89 -0
  696. package/skills/design-critique/references/comparison-and-measuring.md +146 -0
  697. package/skills/design-critique/references/generated-tells.md +47 -0
  698. package/skills/design-critique/references/scoring-and-findings.md +148 -0
  699. package/skills/design-critique/references/states-data-and-access.md +94 -0
  700. package/skills/design-critique/references/walkthrough-and-heuristics.md +91 -0
  701. package/skills/design-exploration/SKILL.md +191 -0
  702. package/skills/design-exploration/references/axes-and-generators.md +312 -0
  703. package/skills/design-exploration/references/boards-and-convergence.md +103 -0
  704. package/skills/design-exploration/references/misses-and-rounds.md +87 -0
  705. package/skills/design-study/SKILL.md +162 -0
  706. package/skills/design-study/references/capture-and-breakdown.md +86 -0
  707. package/skills/design-study/references/synthesis.md +164 -0
  708. package/skills/design-systems/SKILL.md +234 -0
  709. package/skills/design-systems/references/audit-and-gates.md +76 -0
  710. package/skills/design-systems/references/components.md +107 -0
  711. package/skills/design-systems/references/tokens.md +150 -0
  712. package/skills/design-thinking/SKILL.md +216 -0
  713. package/skills/design-thinking/references/canon.md +135 -0
  714. package/skills/design-thinking/references/frames-across-briefs.md +133 -0
  715. package/skills/design-thinking/references/questions-and-pushback.md +114 -0
  716. package/skills/desktop-app-design/SKILL.md +251 -0
  717. package/skills/desktop-app-design/references/native-mockup.md +296 -0
  718. package/skills/desktop-app-design/references/platform-conventions.md +243 -0
  719. package/skills/desktop-app-design/references/window-compositions.md +159 -0
  720. package/skills/experience-design/SKILL.md +252 -0
  721. package/skills/experience-design/references/lists-choices-and-data.md +124 -0
  722. package/skills/experience-design/references/navigation-models.md +74 -0
  723. package/skills/experience-design/references/prototyping.md +84 -0
  724. package/skills/experience-design/references/state-inventory.md +58 -0
  725. package/skills/experience-design/references/walkthrough-and-heuristics.md +83 -0
  726. package/skills/frontend-craft/SKILL.md +293 -0
  727. package/skills/frontend-craft/references/gates.md +50 -0
  728. package/skills/frontend-craft/references/gestures-and-rendering.md +111 -0
  729. package/skills/frontend-craft/references/performance-measuring.md +180 -0
  730. package/skills/frontend-craft/references/performance.md +121 -0
  731. package/skills/frontend-craft/references/semantics-and-focus.md +90 -0
  732. package/skills/frontend-craft/references/state-and-structure.md +101 -0
  733. package/skills/frontend-craft/references/streaming-and-agents.md +70 -0
  734. package/skills/human-agent-interaction/SKILL.md +298 -0
  735. package/skills/human-agent-interaction/references/forms.md +87 -0
  736. package/skills/human-agent-interaction/references/frameworks.md +94 -0
  737. package/skills/human-agent-interaction/references/working-beside-a-person.md +60 -0
  738. package/skills/interaction-design/SKILL.md +269 -0
  739. package/skills/interaction-design/references/choreography.md +86 -0
  740. package/skills/interaction-design/references/feedback-and-waiting.md +71 -0
  741. package/skills/interaction-design/references/gestures.md +104 -0
  742. package/skills/interaction-design/references/measuring-feel.md +81 -0
  743. package/skills/interaction-design/references/springs-and-continuity.md +84 -0
  744. package/skills/ios-design/SKILL.md +241 -0
  745. package/skills/ios-design/references/conventions.md +272 -0
  746. package/skills/ios-design/references/ipad-widgets-live-activities.md +106 -0
  747. package/skills/ios-design/references/platform-measurements.md +438 -0
  748. package/skills/ios-design/references/web-on-phone.md +315 -0
  749. package/skills/ios-design/references/worked-screens.md +277 -0
  750. package/skills/knowledge-base/SKILL.md +225 -0
  751. package/skills/knowledge-base/references/capture-formats.md +81 -0
  752. package/skills/knowledge-base/references/depth-standard.md +98 -0
  753. package/skills/knowledge-base/references/page-templates.md +181 -0
  754. package/skills/marketing-design/SKILL.md +242 -0
  755. package/skills/marketing-design/references/brand-systems.md +79 -0
  756. package/skills/marketing-design/references/demos-and-rotators.md +107 -0
  757. package/skills/marketing-design/references/docs-sites.md +61 -0
  758. package/skills/marketing-design/references/formats.md +128 -0
  759. package/skills/marketing-design/references/line-drawings.md +119 -0
  760. package/skills/marketing-design/references/page-structure.md +177 -0
  761. package/skills/marketing-design/references/proof-and-captures.md +137 -0
  762. package/skills/marketing-design/references/studio-home.md +192 -0
  763. package/skills/perception/SKILL.md +271 -0
  764. package/skills/perception/references/colour-perception.md +111 -0
  765. package/skills/perception/references/measurements.md +136 -0
  766. package/skills/perception/references/seeing.md +95 -0
  767. package/skills/product-strategy/SKILL.md +272 -0
  768. package/skills/product-strategy/references/adoption.md +81 -0
  769. package/skills/product-strategy/references/business-models.md +89 -0
  770. package/skills/product-strategy/references/channels.md +92 -0
  771. package/skills/product-strategy/references/copy-structures.md +145 -0
  772. package/skills/product-strategy/references/decisions.md +136 -0
  773. package/skills/product-strategy/references/launch.md +66 -0
  774. package/skills/product-strategy/references/messaging-and-proof.md +113 -0
  775. package/skills/product-strategy/references/pace-layers.md +78 -0
  776. package/skills/product-strategy/references/positioning.md +103 -0
  777. package/skills/product-strategy/references/pricing.md +84 -0
  778. package/skills/product-strategy/references/prioritization.md +131 -0
  779. package/skills/product-strategy/references/sales-enablement.md +84 -0
  780. package/skills/product-strategy/references/stakeholders.md +116 -0
  781. package/skills/product-strategy/references/strategy-frameworks.md +174 -0
  782. package/skills/research/SKILL.md +210 -0
  783. package/skills/research/references/analyses.md +143 -0
  784. package/skills/research/references/competitive-analysis.md +96 -0
  785. package/skills/research/references/deliverables.md +77 -0
  786. package/skills/research/references/desk-research.md +148 -0
  787. package/skills/research/references/experiments.md +115 -0
  788. package/skills/research/references/interviews-and-usability.md +119 -0
  789. package/skills/research/references/methods.md +100 -0
  790. package/skills/research/references/metrics.md +104 -0
  791. package/skills/research/references/synthesis.md +95 -0
  792. package/skills/skill-building/SKILL.md +201 -0
  793. package/skills/skill-building/references/corrections-to-rules.md +93 -0
  794. package/skills/skill-building/references/evals-and-golden-tasks.md +121 -0
  795. package/skills/skill-building/references/ledger.md +71 -0
  796. package/skills/skill-building/references/standard.md +112 -0
  797. package/skills/spatial-design/SKILL.md +278 -0
  798. package/skills/spatial-design/references/camera-and-input.md +70 -0
  799. package/skills/spatial-design/references/measuring.md +48 -0
  800. package/skills/spatial-design/references/spatial-map.md +78 -0
  801. package/skills/ux-writing/SKILL.md +231 -0
  802. package/skills/ux-writing/references/calibration.md +105 -0
  803. package/skills/ux-writing/references/cut-list.md +89 -0
  804. package/skills/ux-writing/references/interface-copy.md +214 -0
  805. package/skills/ux-writing/references/page-copy.md +112 -0
  806. package/skills/ux-writing/references/positioning-lines.md +101 -0
  807. package/skills/ux-writing/references/voice-examples.md +64 -0
  808. package/skills/ux-writing/references/voice-method.md +113 -0
  809. package/skills/verify-before-done/SKILL.md +111 -0
  810. package/skills/verify-before-done/references/lessons.md +101 -0
  811. package/skills/verify-before-done/references/proof-recipes.md +129 -0
  812. package/skills/visual-design/SKILL.md +308 -0
  813. package/skills/visual-design/references/accessibility.md +160 -0
  814. package/skills/visual-design/references/colour.md +82 -0
  815. package/skills/visual-design/references/components-and-icons.md +99 -0
  816. package/skills/visual-design/references/layout-and-grids.md +107 -0
  817. package/skills/visual-design/references/surfaces-and-depth.md +82 -0
  818. package/skills/visual-design/references/type.md +103 -0
  819. package/skills/visual-design/references/worked-systems.md +126 -0
  820. package/skills/web-app-design/SKILL.md +252 -0
  821. package/skills/web-app-design/references/browser-conventions.md +193 -0
  822. package/skills/web-app-design/references/shell-and-navigation.md +159 -0
  823. package/skills/web-app-design/references/worked-screens.md +136 -0
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8682],{20534:(e,t,n)=>{n.d(t,{Q5:()=>f,Xq:()=>x,g5:()=>v,y2:()=>y});var a=n(95155),s=n(12115),i=n(82765),r=n(57784),l=n(78016),o=n(3278),c=n(68772),d=n(68515),u=n(55338),p=n(82),h=n(26022),m=n(80526);let g=e=>"blank"!==e.kind&&e.version>0;function f(){let[e,t]=(0,s.useState)(null);return(0,s.useEffect)(()=>{let{hostname:e,port:n,protocol:a}=window.location,s="localhost"===e?"127.0.0.1":"127.0.0.1"===e?"localhost":null;t(s?"".concat(a,"//").concat(s).concat(n?":".concat(n):""):"")},[]),e}let x=e=>e?"allow-scripts allow-forms allow-same-origin":"allow-scripts allow-forms";function v(e){let{src:t,title:n,device:i}=e,{w:r,h:l}=p.et[i],o=(0,s.useRef)(null),[c,d]=(0,s.useState)(!1),u=f();return(0,s.useEffect)(()=>{d(!1);let e=e=>{var t,n;return e.source===(null==(t=o.current)?void 0:t.contentWindow)&&(null==(n=e.data)?void 0:n.type)==="playground-ready"&&d(!0)};return addEventListener("message",e),()=>removeEventListener("message",e)},[t]),(0,a.jsxs)("span",{className:"relative block",style:{width:r,height:l},children:[!c&&(0,a.jsx)("img",{src:"".concat(t.replace(/&proto=1/,""),"&shot=").concat(i,"&scale=2"),alt:n,draggable:!1,decoding:"sync",className:"absolute inset-0 block size-full select-none"}),null!==u&&(0,a.jsx)("iframe",{ref:o,title:n,src:"".concat(u).concat(t),sandbox:x(u),allow:"clipboard-write",className:(0,m.cn)("block border-0",!c&&"invisible"),style:{width:r,height:l}})]})}function b(e){var t;let{screen:n,device:s}=e;return"html"===n.kind&&n.src&&(null!=(t=n.drawnFrom)?t:1)<=n.version?(0,a.jsx)(v,{title:n.name,src:"".concat(n.src,"&v=").concat(n.version,"&proto=1"),device:s}):(0,a.jsx)(p.ScreenRender,{screen:n,device:s,v:n.version,live:!0})}function y(e){var t,n,m,f,x,v,y,w,j,k,N;let{project:S,flows:C=[],start:M,flow:z,device:R,onClose:E}=e,A=(0,s.useMemo)(()=>new Map(S.screens.map(e=>[e.id,e])),[S]),[P,I]=(0,s.useState)(C.some(e=>e.id===z)?z:null),O=C.find(e=>e.id===P),D=null!=(x=null!=(f=null!=(m=M&&A.has(M)?M:void 0)?m:null==O?void 0:O.start)?f:null==(t=S.screens.find(g))?void 0:t.id)?x:null==(n=S.screens[0])?void 0:n.id,[T,W]=(0,s.useState)(D?[D]:[]),B=null!=(y=A.get(null!=(v=T.at(-1))?v:""))?y:S.screens[0],F=B?(0,p.XA)(B):["desktop"],[L,q]=(0,s.useState)(R&&F.includes(R)?R:F[0]);(0,s.useEffect)(()=>{!R&&window.matchMedia("(max-width: 767px)").matches&&q("phone")},[R]);let $=F.includes(L)?L:F[0],J=S.screens.filter(e=>g(e)&&(!O||O.screens.includes(e.id))),H=null!=(w=null==O?void 0:O.start)?w:D,U=(0,s.useCallback)(e=>A.has(e)&&W(t=>t.at(-1)===e?t:[...t,e]),[A]),K=(0,s.useCallback)(()=>W(e=>e.length>1?e.slice(0,-1):e),[]);return((0,s.useEffect)(()=>{let e=e=>{var t;(null==(t=e.data)?void 0:t.type)==="playground-goto"&&"string"==typeof e.data.screen&&U(e.data.screen)};return window.addEventListener("message",e),()=>window.removeEventListener("message",e)},[U]),(0,s.useEffect)(()=>{let e=e=>{"Escape"===e.key&&E(),e.altKey&&"ArrowLeft"===e.key&&K()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[E,K]),B)?(0,a.jsxs)("div",{role:"dialog","aria-modal":!0,"aria-label":"".concat(S.name,", playing"),className:"fixed inset-0 z-50 flex flex-col bg-bg-chrome animate-in fade-in-0 duration-quick",children:[(0,a.jsxs)("div",{className:"flex h-12 shrink-0 items-center gap-1 px-3 shadow-divider-b",children:[(0,a.jsx)(c.$,{variant:"ghost",size:"icon-sm","aria-label":"Back",disabled:T.length<2,onClick:K,children:(0,a.jsx)(i.Z,{})}),(0,a.jsx)("span",{className:"px-1.5 text-ui font-semibold text-fg-primary max-md:hidden",children:S.name}),C.length>0&&(0,a.jsxs)(u.rI,{modal:!1,children:[(0,a.jsx)(u.ty,{asChild:!0,children:(0,a.jsxs)(c.$,{variant:"ghost",size:"sm",className:"gap-1.5 text-fg-secondary","aria-label":"Flow, ".concat(null!=(j=null==O?void 0:O.name)?j:"All screens"),children:[null!=(k=null==O?void 0:O.name)?k:"All screens",(0,a.jsx)(r.a,{weight:"bold",className:"!size-2.5 text-fg-meta"})]})}),(0,a.jsx)(u.SQ,{align:"start",className:"w-56",children:(0,a.jsxs)(u.Hr,{value:null!=(N=null==O?void 0:O.id)?N:"all",onValueChange:e=>{let t=C.find(t=>t.id===e);I(t?t.id:null),t&&A.has(t.start)&&W([t.start])},children:[(0,a.jsx)(u.Ht,{value:"all",children:"All screens"}),(0,a.jsx)(u.mB,{}),C.map(e=>(0,a.jsx)(u.Ht,{value:e.id,children:e.name},e.id))]})})]}),(0,a.jsxs)(u.rI,{modal:!1,children:[(0,a.jsx)(u.ty,{asChild:!0,children:(0,a.jsxs)(c.$,{variant:"ghost",size:"sm",className:"gap-1.5 text-fg-secondary","aria-label":"Screen, ".concat(B.name),children:[B.name,(0,a.jsx)(r.a,{weight:"bold",className:"!size-2.5 text-fg-meta"})]})}),(0,a.jsx)(u.SQ,{align:"start",className:"w-56",children:(0,a.jsx)(u.Hr,{value:B.id,onValueChange:U,children:J.map(e=>(0,a.jsx)(u.Ht,{value:e.id,children:e.name},e.id))})})]}),(0,a.jsx)("span",{className:"flex-1"}),F.length>1&&(0,a.jsx)(d.O,{type:"single",size:"sm",value:$,onValueChange:e=>e&&q(e),"aria-label":"Breakpoint",className:"max-md:hidden",children:F.map(e=>(0,a.jsx)(d.d,{value:e,children:p.et[e].label},e))}),(0,a.jsx)(c.$,{variant:"ghost",size:"icon-sm","aria-label":"Start again",onClick:()=>H&&W([H]),children:(0,a.jsx)(l.o,{})}),(0,a.jsx)(c.$,{variant:"ghost",size:"icon-sm","aria-label":"Close the prototype",onClick:E,children:(0,a.jsx)(o.X,{})})]}),(0,a.jsx)("div",{className:"min-h-0 flex-1",onClickCapture:e=>{var t;let n=null==(t=e.target.closest("[data-goto]"))?void 0:t.getAttribute("data-goto");n&&A.has(n)&&(e.preventDefault(),e.stopPropagation(),U(n))},children:(0,a.jsx)(p.cG,{w:p.et[$].w+2*h.Qe[$].bezel,h:p.et[$].h+h.Qe[$].bar+2*h.Qe[$].bezel,pad:32,className:"size-full animate-in fade-in-0 duration-quick",children:(0,a.jsx)("div",{style:{padding:h.Qe[$].bezel,paddingTop:h.Qe[$].bezel+h.Qe[$].bar},children:(0,a.jsx)(h.KE,{device:$,box:{w:p.et[$].w,h:p.et[$].h,s:1},children:(0,a.jsx)(b,{screen:B,device:$})})})},"".concat(B.id,"-").concat($))})]}):null}},25522:(e,t,n)=>{n.d(t,{OSProvider:()=>d,Q:()=>u});var a=n(95155),s=n(12115),i=n(81375),r=n(93890),l=n(67455);let o=()=>({status:{},prs:{},comments:{},refs:[],markup:{}}),c=(0,s.createContext)(null);function d(e){let{children:t}=e,[n,d]=(0,s.useState)([]),[u,p]=(0,s.useState)(!1),h=(0,s.useRef)(n);h.current=n;let m=e=>h.current.find(t=>t.slug===e),[g,f]=(0,s.useState)({});(0,s.useRef)(g).current=g;let x=(0,s.useRef)({}),v=(0,s.useCallback)((e,t)=>{x.current[e]=Date.now(),f(n=>{var a;let s=t(null!=(a=n[e])?a:o());return fetch("/api/state",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({slug:e,state:s})}).catch(()=>{}),{...n,[e]:s}})},[]),b=(0,s.useRef)(null),y=(0,s.useCallback)(async()=>{try{let n=b.current?"?since=".concat(b.current):"",a=await (await fetch("/api/sync".concat(n),{cache:"no-store"})).json();if(b.current=a.stamp,p(!0),a.same||!a.projects)return;let i=a.projects;for(let n of((0,s.startTransition)(()=>d(e=>JSON.stringify(e)===JSON.stringify(i)?e:i)),i)){var e,t;let i=null==(e=a.states)?void 0:e[n.slug];!i||Date.now()-(null!=(t=x.current[n.slug])?t:0)<5e3||(0,s.startTransition)(()=>f(e=>{let t={...o(),...i};return JSON.stringify(e[n.slug])===JSON.stringify(t)?e:{...e,[n.slug]:t}}))}}catch(e){}},[]);(0,s.useEffect)(()=>{y();let e=setInterval(()=>"visible"===document.visibilityState&&y(),1e4);return addEventListener("focus",y),()=>(clearInterval(e),removeEventListener("focus",y))},[y]);let w=(0,s.useCallback)(async(e,t,n,a)=>{var s;let i=await fetch("/api/projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e,brief:t,folder:n,repo:a})}),r=await i.json();if(!i.ok)throw Error(null!=(s=r.error)?s:"Couldn't create the project.");return d(e=>[...e,r.project]),r.project},[]),j=(0,s.useCallback)((e,t)=>{var n,a,s,i,r;return null!=(r=null!=(i=null==(n=g[e])?void 0:n.status[t])?i:null==(s=m(e))||null==(a=s.screens.find(e=>e.id===t))?void 0:a.status)?r:"brief"},[g,n]),k=(0,s.useCallback)((e,t)=>{var n,a,s,i;let r=null==(n=m(e))?void 0:n.pullRequests.find(e=>e.id===t);return null!=(i=null==(a=g[e])?void 0:a.prs[t])?i:{state:null!=(s=null==r?void 0:r.state)?s:"waiting",number:null==r?void 0:r.number,date:null==r?void 0:r.date}},[g,n]),N=(0,s.useCallback)(e=>{var t;let n=m(e);return(null==n?void 0:n.folder)&&n.repo||(null==(t=g[e])?void 0:t.repo)||(null==n?void 0:n.repo)},[g]),S=e=>{var t;return!!m(e)&&!(null==(t=m(e))?void 0:t.folder)},C=(0,s.useCallback)((e,t)=>{var n,a,s;return null!=(s=null!=(a=null==(n=g[e])?void 0:n.comments[t])?a:S(e)?l.ky["".concat(e,"/").concat(t)]:void 0)?s:[]},[g]),M=(0,s.useCallback)(e=>{var t,n;return null!=(n=null==(t=g[e])?void 0:t.refs)?n:[]},[g]),z=(0,s.useCallback)(e=>{var t,n;let a=null!=(n=null==(t=g[e])?void 0:t.flows)?n:[];return[...a,...(S(e)&&l.mU[e]||[]).filter(e=>!a.some(t=>t.id===e.id))]},[g]),R=(0,s.useCallback)((e,t,n)=>{var a,s,r,l;return null!=(l=null==(r=g[e])||null==(s=r.markup)||null==(a=s[(0,i.Oo)(t,n)])?void 0:a.marks)?l:[]},[g]),E=(0,s.useCallback)((e,t,n)=>v(e,a=>{var s,i;return{...a,comments:{...a.comments,[t]:[...null!=(i=null!=(s=a.comments[t])?s:S(e)?l.ky["".concat(e,"/").concat(t)]:void 0)?i:[],n]}}}),[v]),A=async(e,t)=>{let n=new FormData;n.set("slug",e),n.set("file",t);let a=await fetch("/api/state/ref",{method:"POST",body:n});return a.ok?(await a.json()).ref:null},P=(0,s.useCallback)(async(e,t)=>{let n=[];for(let a of t){let t=await A(e,a);t&&n.push(t)}n.length&&v(e,e=>({...e,refs:[...e.refs,...n]}))},[v]),I=(0,s.useCallback)((e,t,n,a)=>v(e,e=>{var s;let r={...null!=(s=e.markup)?s:{}};return a.length?r[(0,i.Oo)(t,n)]={marks:a,at:new Date().toISOString()}:delete r[(0,i.Oo)(t,n)],{...e,markup:r}}),[v]),O=(0,s.useCallback)(async(e,t)=>{var n,a;if(!(null==(n=m(e))?void 0:n.folder))return v(e,e=>({...e,repo:t}));let s=await fetch("/api/remote",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({slug:e,repo:t})});if(!s.ok)throw Error(null!=(a=(await s.json().catch(()=>({}))).error)?a:"Couldn't connect the repo.");await y()},[v,y]),D=(0,s.useCallback)(async(e,t)=>{var n;let a=await fetch("/api/themes",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({project:e,theme:t})});if(!a.ok)throw Error(null!=(n=(await a.json().catch(()=>({}))).error)?n:"Couldn't change the theme.");await y()},[y]),T=(0,s.useMemo)(()=>({}),[]),W=(0,s.useCallback)(async(e,t)=>{let n=m(e),a=null==n?void 0:n.screens.find(e=>e.id===t);if(!n||!a)return;let s="app"===a.kind?"built":"approved";v(e,e=>{let n={...e.prs};return delete n[t],{...e,status:{...e.status,[t]:s},prs:n}})},[v]),B=(0,s.useCallback)((e,t)=>{let n=m(e);null==n||n.pullRequests.find(e=>e.id===t),v(e,e=>{var n;return{...e,prs:{...e.prs,[t]:{...null!=(n=e.prs[t])?n:{state:"ready"},state:"merged",date:new Date().toLocaleDateString("en-US",{month:"short",day:"numeric"})}},status:{...e.status,[t]:"built"}}})},[v]),{mode:F}=(0,r.b)(),L=(0,s.useMemo)(()=>n.map(e=>({...e,screens:e.screens.map(e=>e.src?{...e,src:"".concat(e.src).concat(e.src.includes("?")?"&":"?","mode=").concat(F)}:e)})),[n,F]),q=(0,s.useMemo)(()=>({projects:L,createProject:w,screenStatus:j,prState:k,repoOf:N,commentsOf:C,refsOf:M,markupOf:R,flowsOf:z,approve:W,merge:B,addComment:E,addRefs:P,saveMarkup:I,connectRepo:O,setTheme:D,building:T,loaded:u,refresh:y}),[L,w,j,k,N,C,M,R,z,W,B,E,P,I,O,D,T,u,y]);return(0,a.jsx)(c.Provider,{value:q,children:t})}function u(){let e=(0,s.useContext)(c);if(!e)throw Error("useOS outside OSProvider");return e}},26022:(e,t,n)=>{n.d(t,{JB:()=>m,KE:()=>d,Qe:()=>c,b8:()=>h});var a=n(95155),s=n(7649),i=n(10503),r=n(17829),l=n(68515),o=n(80526);let c={phone:{corner:54,bezel:11,bar:0},tablet:{corner:26,bezel:14,bar:0},desktop:{corner:10,bezel:0,bar:30}};function d(e){let{device:t,box:n,children:s,className:i}=e,r=c[t].corner*n.s;return(0,a.jsxs)("div",{className:(0,o.cn)("relative",i),style:{width:n.w,height:n.h},children:[(0,a.jsx)("div",{className:"relative size-full overflow-hidden bg-bg-content",style:{borderRadius:"desktop"===t?"0 0 ".concat(r,"px ").concat(r,"px"):r},children:s}),(0,a.jsx)(m,{device:t,box:n})]})}let u={phone:(0,a.jsx)(s.R,{}),tablet:(0,a.jsx)(i.f,{}),desktop:(0,a.jsx)(r.V,{})},p={phone:"Phone",tablet:"Tablet",desktop:"Desktop"};function h(e){let{devices:t,value:n,onChange:s}=e;return t.length<2?null:(0,a.jsx)(l.O,{type:"single",size:"sm",value:n,onValueChange:e=>e&&s(e),"aria-label":"Device",children:t.map(e=>(0,a.jsx)(l.d,{value:e,"aria-label":p[e],title:p[e],children:u[e]},e))})}function m(e){let{device:t,box:n}=e,s=c[t],i=s.bezel*n.s,r=s.corner*n.s;if("desktop"===t){let e=s.bar*n.s;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-x-0 z-20 flex items-center",style:{top:-e,height:e,gap:Math.min(6,.4*e),paddingInline:Math.min(12,.8*e),background:"var(--pg-browser-bar)",borderTopLeftRadius:r,borderTopRightRadius:r},children:[0,1,2].map(t=>(0,a.jsx)("span",{className:"rounded-full",style:{width:Math.min(6,.4*e),height:Math.min(6,.4*e),background:"var(--pg-browser-dot)"}},t))}),(0,a.jsx)("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-x-0 bottom-0 z-20",style:{top:-e,borderRadius:r,boxShadow:"var(--pg-device-lift)"}})]})}return(0,a.jsx)("div",{"aria-hidden":!0,className:"pointer-events-none absolute z-20",style:{inset:-i,borderRadius:r+i,boxShadow:"inset 0 0 0 ".concat(i,"px var(--pg-device-bezel), 0 0 0 ").concat(Math.max(1,1.5*n.s),"px var(--pg-device-rim), var(--pg-device-lift)")}})}},29465:(e,t,n)=>{n.d(t,{L4:()=>x,l3:()=>w});var a=n(95155),s=n(52619),i=n.n(s),r=n(12115),l=n(68772),o=n(49255),c=n(41620),d=n(50847),u=n(28976),p=n(80526),h=n(56005),m=n(47982),g=n(33246),f=n(45515);function x(e){return e?e.says?"thinking":/^(Editing|Committing|Building)/.test(e.text)?"building":/^(Drawing|Starting a worker|Writing|Setting)/.test(e.text)?"drawing":/^(Searching|Finding)/.test(e.text)||/^(Looking|Measuring|Pinning)/.test(e.text)?"looking":"reading":"reading"}let v={"Reading a skill":"Reading skills","Reading a Brain page":"Reading Brain pages","Searching the Brain":"Searching the Brain",Reading:"Reading",Editing:"Editing","Searching the code for":"Searching the code for","Finding files":"Finding files"};function b(e){let{at:t}=e,[n,s]=(0,r.useState)(()=>Date.now());(0,r.useEffect)(()=>{let e=setInterval(()=>s(Date.now()),1e3);return()=>clearInterval(e)},[]);let i=Math.max(0,Math.floor((n-Date.parse(t))/1e3));return i<5?null:(0,a.jsx)("span",{className:"num ml-1.5 text-fg-meta",children:i<60?"".concat(i,"s"):"".concat(Math.floor(i/60),":").concat(String(i%60).padStart(2,"0"))})}function y(e){var t,n;let{run:s,title:i,phases:l,className:h}=e,m=null!=(t=s.steps)?t:[],g=(function(e){let t=[];for(let a of e){let e=t.at(-1);if(!e||a.says||e.says||e.text!==a.text||e.who!==a.who)t.push({...a,n:1,until:a.at});else{var n;e.n++,e.until=a.at,!a.detail||(null==(n=e.detail)?void 0:n.split(", ").includes(a.detail))||(e.detail=e.detail?"".concat(e.detail,", ").concat(a.detail):a.detail)}}return t})(m).slice(-6),f=m[m.length-1],y=l?Math.min(function(e){let t=0;for(let n of e)/^(Editing|Writing$|Drawing$|Committing)/.test(n.text)&&(t=Math.max(t,1)),t>=1&&/^(Measuring|Looking at it)/.test(n.text)&&(t=Math.max(t,2)),n.text.startsWith("Pinning")&&(t=3);return t}(m),l.length-1):0,w=null!=(n=s.workers)?n:[],j=(0,r.useRef)(null);return(0,r.useEffect)(()=>{var e,t;null==(t=j.current)||null==(e=t.lastElementChild)||e.scrollIntoView({block:"nearest"})},[g.length]),(0,a.jsxs)("section",{"aria-live":"polite","aria-label":"The agent at work",className:(0,p.cn)("grid gap-3 rounded-panel bg-bg-floating p-3 shadow-float",h),children:[(0,a.jsxs)("header",{className:"flex items-center gap-2.5",children:[(0,a.jsx)(o.q,{state:x(f),className:"size-5 text-agent-work"}),(0,a.jsx)("h2",{className:"forming-text min-w-0 flex-1 truncate text-ui font-medium",children:i}),(0,a.jsx)("span",{className:"text-sm",children:(0,a.jsx)(c.P8,{since:s.started})})]}),l&&(0,a.jsx)("ol",{"aria-label":"Where it is",className:"grid gap-1.5",style:{gridTemplateColumns:"repeat(".concat(l.length,", minmax(0, 1fr))")},children:l.map((e,t)=>(0,a.jsxs)("li",{"aria-current":t===y?"step":void 0,className:"grid min-w-0 gap-1.5",children:[(0,a.jsx)("span",{className:(0,p.cn)("h-0.5 rounded-full",t<y?"bg-fg-secondary":t===y?"forming bg-fill-selected":"bg-fill-control")}),(0,a.jsx)("span",{className:(0,p.cn)("truncate text-xs",t===y?"forming-text font-medium":t<y?"text-fg-secondary":"text-fg-meta"),children:e})]},e))}),g.length?(0,a.jsx)("ol",{ref:j,className:"grid max-h-72 gap-2 overflow-y-auto",children:g.map((e,t)=>{var n;let i=t===g.length-1,r=e.n>1&&null!=(n=v[e.text])?n:e.text;return(0,a.jsxs)("li",{className:"walk-in flex gap-2 text-sm",children:[(0,a.jsx)("span",{className:"num w-9 shrink-0 text-fg-meta",children:((e,t)=>{let n=Math.max(0,Math.floor((Date.parse(t)-Date.parse(e))/1e3));return"".concat(Math.floor(n/60),":").concat(String(n%60).padStart(2,"0"))})(s.started,e.at)}),(0,a.jsxs)("span",{className:(0,p.cn)("min-w-0 flex-1 text-pretty",i?"text-fg-primary":"text-fg-meta"),children:[e.says?(0,a.jsx)("span",{className:i?"forming-text":"text-fg-secondary",children:e.text}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:(0,p.cn)(i&&"forming-text"),children:r}),e.n>1&&!e.detail&&(0,a.jsxs)("span",{className:"num text-fg-meta",children:[" ",e.n]}),e.detail&&(0,a.jsxs)("span",{className:(0,p.cn)("wrap-anywhere",i?"text-fg-secondary":"text-fg-meta"),children:[" ",(e=>{let t=e.split(", ");return t.length>3?"".concat(t.slice(0,3).join(", ")," and ").concat(t.length-3," more"):e.length>120?"".concat(e.slice(0,117).trimEnd(),"..."):e})(e.detail)]})]}),i&&(0,a.jsx)(b,{at:e.until}),e.who&&!(e.detail&&e.who.includes(e.detail))&&(0,a.jsx)("span",{className:"block truncate text-xs text-fg-meta",children:e.who})]})]},"".concat(e.at,"-").concat(t))})}):(0,a.jsx)("p",{className:"text-sm text-fg-meta",children:"Starting up"}),w.length>0&&(0,a.jsx)("div",{className:"grid border-t border-border-divider pt-2",children:w.map(e=>(0,a.jsx)(d.fI,{lead:"working"===e.state?(0,a.jsx)(o.q,{state:"drawing",className:"size-4 text-agent-work"}):(0,a.jsx)(u.rA,{status:"done"===e.state?"approved":"brief",tip:!1}),title:e.name,parent:"working"===e.state?e.doing:"failed"===e.state?"Stopped":void 0,status:"working"===e.state?"Working":"done"===e.state?"Done":"Stopped"},e.id))})]})}function w(e){var t,n;let{spread:s,run:r}=e,c=(null==r?void 0:r.status)==="running";if(!(0,m.bP)(s))return(0,a.jsx)("div",{className:"dot-grid flex min-h-0 flex-1 overflow-y-auto",children:(0,a.jsxs)("div",{className:"m-auto flex w-full max-w-6xl flex-col items-center gap-6 px-4 py-10 md:px-10 lg:flex-row lg:items-start lg:justify-center",children:[(0,a.jsx)(m.Qx,{spread:s,editable:!c,className:"w-full min-w-0 max-w-2xl"},s.id),(0,a.jsx)("div",{className:"w-full max-w-md shrink-0 max-lg:order-first lg:sticky lg:top-6 lg:w-80",children:c?(0,a.jsx)(y,{run:r,title:"Planning ".concat(s.title)}):(0,a.jsx)(m.gM,{spread:s})})]})});let d=s.directions.filter(e=>e.round===s.round),u=(null==r?void 0:r.status)==="running",x=u?Math.max(1,(null!=(t=r.workers)?t:[]).filter(e=>"working"===e.state).length):0,v="phone"===s.device,b={aspectRatio:"".concat(f.xW[s.device].w," / ").concat(f.xW[s.device].h)},w=d.length+x,j=v?Math.min(4,Math.max(2,w)):Math.min(3,Math.max(1,w)),k=u?s.axes?"Drawing round ".concat(s.round," of ").concat(s.title):"Reading the brief for ".concat(s.title):"Round ".concat(s.round," of ").concat(s.title," is ready"),N=u?(0,a.jsx)(y,{run:r,title:k}):(0,a.jsxs)("section",{"aria-live":"polite",className:"grid gap-1.5 rounded-panel bg-bg-floating p-3 shadow-float",children:[(0,a.jsxs)("span",{className:"flex items-center gap-2",children:[(0,a.jsx)(o.q,{state:"waiting",className:"size-4 text-agent-wait"}),(0,a.jsx)("h2",{className:"text-ui font-medium text-balance text-fg-primary",children:k})]}),(0,a.jsx)("p",{className:"text-ui text-pretty text-fg-secondary",children:null!=(n=s.summaries[s.round])?n:"".concat(1===d.length?"One direction":"".concat(d.length," directions")," to judge. Keep the ones worth another round.")}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5 pt-1.5",children:(0,a.jsx)(l.$,{asChild:!0,variant:"primary",size:"sm",children:(0,a.jsx)(i(),{href:"/s/".concat(s.project,"/").concat(s.id),children:"Judge them"})})})]});return(0,a.jsx)("div",{className:"dot-grid flex min-h-0 flex-1 overflow-y-auto",children:(0,a.jsxs)("div",{className:"m-auto flex w-full max-w-6xl flex-col items-center gap-6 px-4 py-10 lg:flex-row lg:items-start lg:justify-center md:px-10",children:[(0,a.jsxs)("div",{className:"w-full min-w-0 max-w-3xl",children:[0===d.length&&(0,a.jsxs)("article",{className:"grid gap-4 rounded-panel bg-bg-content p-6 shadow-ring",children:[(0,a.jsxs)("div",{className:"grid gap-2",children:[(0,a.jsx)("h1",{className:"font-heading text-title font-semibold text-balance text-fg-primary",children:s.title}),(0,a.jsx)("p",{className:"whitespace-pre-line text-ui text-pretty text-fg-secondary",children:s.brief})]}),s.written&&(0,a.jsx)(h.K,{spread:s})]}),(d.length>0||u&&s.axes)&&(0,a.jsxs)("div",{className:(0,p.cn)("grid gap-4",0===d.length&&"mt-6"),style:{gridTemplateColumns:"repeat(".concat(j,", minmax(0, 1fr))")},children:[d.map(e=>(0,a.jsxs)(i(),{href:"/s/".concat(s.project,"/").concat(s.id,"?d=").concat(e.id),className:"walk-in grid gap-2 rounded-panel outline-hidden focus-visible:ring-2 focus-visible:ring-ring",children:[(0,a.jsx)("div",{className:"w-full",style:b,children:(0,a.jsx)(g.vk,{spread:s,d:e,pad:0,className:"size-full"})}),(0,a.jsx)("span",{className:"truncate text-xs font-medium text-fg-secondary",children:e.name})]},e.id)),Array.from({length:x},(e,t)=>(0,a.jsxs)("div",{"aria-hidden":!0,className:"grid gap-2",children:[(0,a.jsx)("div",{className:(0,p.cn)("hatch grid place-items-center shadow-ring",v?"rounded-dialog":"rounded-panel"),style:b,children:(0,a.jsx)(o.q,{state:"drawing",className:"size-8 text-agent-work"})}),(0,a.jsx)("span",{className:"forming-text text-xs font-medium",children:"Drawing"})]},"slot-".concat(t)))]})]}),(0,a.jsx)("div",{className:"w-full max-w-md shrink-0 max-lg:order-first lg:sticky lg:top-6 lg:w-80",children:N})]})})}},32296:(e,t,n)=>{n.d(t,{Shell:()=>B,E2:()=>D,K7:()=>F});var a=n(95155),s=n(20063),i=n(12115),r=n(52619),l=n.n(r),o=n(3570),c=n(98038),d=n(95074),u=n(25341),p=n(22688),h=n(82765),m=n(46508),g=n(41620),f=n(29465),x=n(51063),v=n(93890),b=n(45515),y=n(69760),w=n(85884),j=n(16076),k=n(19913),N=n(3278),S=n(97458);n(55338);var C=n(68772),M=n(41880),z=n(57644),R=n(76654),E=n(67279);n(68515),n(74371);var A=n(25522);function P(e){var t;let{open:n,onOpenChange:r}=e,l=(0,s.useRouter)(),{createProject:o}=(0,A.Q)(),[c,d]=(0,i.useState)(""),[u,p]=(0,i.useState)(""),[h,m]=(0,i.useState)(""),[g,f]=(0,i.useState)(""),[x,v]=(0,i.useState)(!1),[b,y]=(0,i.useState)(null),[w,P]=(0,i.useState)(""),[I,O]=(0,i.useState)(!1),D=e=>e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,40),T=D(null!=(t=h.split("/").at(-1))?t:"")||D(c),W=g||(T?"~/Projects/".concat(T):""),[B,F]=(0,i.useState)(""),[L,q]=(0,i.useState)(!1),$=async()=>{v(!0);let e=await fetch("/api/local/pick-folder",{method:"POST"}).then(e=>e.json()).catch(()=>({error:"Couldn't open the folder picker."}));if(v(!1),e.path){var t;f(e.path),m(""),c.trim()||d(null!=(t=e.path.split("/").at(-1))?t:"")}else e.error&&F(e.error)},J=async()=>{var e;if(O(!0),b)return;let t=await fetch("/api/local/repos").then(e=>e.json()).catch(()=>({error:"Couldn't reach GitHub."}));t.repos?y(t.repos):P(null!=(e=t.error)?e:"Couldn't reach GitHub.")},H=async()=>{if(!c.trim())return F("Give it a name.");q(!0),F("");try{let e=await o(c.trim(),u.trim(),W,h||void 0);r(!1),d(""),p(""),f(""),m(""),F(""),l.push("/p/".concat(e.slug))}catch(e){F(e instanceof Error?e.message:"Couldn't create the project.")}finally{q(!1)}};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(z.lG,{open:n,onOpenChange:r,children:(0,a.jsx)(z.Cf,{className:"max-w-md","aria-describedby":void 0,children:(0,a.jsxs)("form",{onSubmit:e=>{e.preventDefault(),H()},children:[(0,a.jsx)(z.c7,{children:(0,a.jsx)(z.L3,{children:"New project"})}),(0,a.jsxs)("div",{className:"mt-4 grid gap-1.5",children:[(0,a.jsx)(E.J,{htmlFor:"np-name",children:"Name"}),(0,a.jsx)(M.p,{id:"np-name",autoFocus:!0,value:c,onChange:e=>d(e.target.value),"aria-invalid":!!B&&!c.trim()})]}),(0,a.jsxs)("div",{className:"mt-4 grid gap-1.5",children:[(0,a.jsx)(E.J,{htmlFor:"np-brief",children:"Brief"}),(0,a.jsx)(R.T,{id:"np-brief",value:u,onChange:e=>p(e.target.value),rows:4})]}),(0,a.jsxs)("div",{className:"mt-4 grid gap-1.5",children:[(0,a.jsx)(E.J,{id:"np-where",children:"Where it lives"}),(0,a.jsxs)("div",{"aria-labelledby":"np-where",className:"flex min-h-control min-w-0 items-center gap-2 rounded-control bg-fill-control px-3 text-sm shadow-ring",children:[h?(0,a.jsx)(j.f,{className:"size-4 shrink-0 text-fg-muted"}):(0,a.jsx)(k.vd,{className:"size-4 shrink-0 text-fg-muted"}),(0,a.jsx)("span",{className:"min-w-0 flex-1 truncate text-fg-primary",children:h?"".concat(h,", cloned to ").concat(W):W||"A new folder named after the project"}),(h||g)&&(0,a.jsx)(C.$,{type:"button",variant:"ghost",size:"icon-sm","aria-label":"Use a new folder instead",onClick:()=>(m(""),f("")),className:"-mr-2",children:(0,a.jsx)(N.X,{})})]}),(0,a.jsxs)("div",{className:"mt-1 flex gap-2",children:[(0,a.jsxs)(C.$,{type:"button",size:"sm",onClick:$,disabled:x,children:[(0,a.jsx)(k.vd,{}),x?"Choosing…":"Choose folder…"]}),(0,a.jsxs)(C.$,{type:"button",size:"sm",onClick:J,children:[(0,a.jsx)(j.f,{}),"From GitHub…"]})]})]}),B&&(0,a.jsx)("p",{className:"mt-2 text-sm text-status-danger",children:B}),(0,a.jsxs)(z.Es,{className:"mt-5",children:[(0,a.jsx)(C.$,{type:"button",onClick:()=>r(!1),children:"Cancel"}),(0,a.jsx)(C.$,{type:"submit",variant:"primary",disabled:L,children:L&&h?"Cloning…":"Create project"})]})]})})}),(0,a.jsxs)(S.Gj,{open:I,onOpenChange:O,title:"Choose a repo",children:[(0,a.jsx)(S.G7,{placeholder:"Find a repo"}),(0,a.jsxs)(S.oI,{children:[(0,a.jsx)(S.xL,{children:w||(b?"No repo by that name":"Loading your repos…")}),b&&b.length>0&&(0,a.jsx)(S.L$,{children:b.map(e=>{var t;return(0,a.jsxs)(S.h_,{value:"".concat(e.nameWithOwner," ").concat(null!=(t=e.description)?t:""),onSelect:()=>(e=>{var t;m(e),f(""),O(!1);let n=null!=(t=e.split("/").at(-1))?t:"";c.trim()||d(n.replace(/[-_]+/g," ").replace(/^./,e=>e.toUpperCase()))})(e.nameWithOwner),children:[(0,a.jsx)(j.f,{}),(0,a.jsx)("span",{className:"min-w-0 flex-1 truncate",children:e.nameWithOwner}),e.isPrivate&&(0,a.jsx)("span",{className:"text-xs text-fg-meta",children:"Private"})]},e.nameWithOwner)})})]})]})]})}n(82),n(50847),n(28976);var I=n(43160);let O=(0,i.createContext)(null),D=()=>(0,i.useContext)(O),T=e=>{var t;return null==(t=e.match(/^\/(?:p|s)\/([a-z0-9-]+)/))?void 0:t[1]};function W(e){var t,n,r,j,k,N;let{children:S}=e,C=(0,s.usePathname)(),M=(0,x.uB)(),{projects:z,screenStatus:R,loaded:E}=(0,A.Q)(),{spreads:D,runs:W,plans:B,loaded:F}=(0,b.SJ)(),L=(0,w._e)();(0,i.useEffect)(()=>{if(!E||!F||window.parent===window)return;let e=requestAnimationFrame(()=>e=requestAnimationFrame(()=>window.parent.postMessage({type:"playground-ready"},"*")));return()=>cancelAnimationFrame(e)},[E,F,C]);let{mode:q,toggle:$}=(0,v.b)(),[J,H]=(0,i.useState)(!1);(0,i.useLayoutEffect)(()=>{new URLSearchParams(window.location.search).has("island")&&H(!0)},[]);let[U,K]=(0,i.useState)(!1),[Q,X]=(0,i.useState)();(0,i.useEffect)(()=>{var e;return X(null==(e=document.cookie.match(new RegExp("".concat(I.x,"=([a-z0-9-]+)"))))?void 0:e[1])},[]);let[V,G]=(0,i.useState)(),_=null!=(k=null!=(j=null!=(r=T(C))?r:"/"===C?V:void 0)?j:Q)?k:null==(t=z[0])?void 0:t.slug,Y=z.find(e=>e.slug===_);(0,i.useEffect)(()=>{let e=new URLSearchParams(window.location.search);e.get("new")&&(K(!0),e.delete("new"),history.replaceState(null,"","".concat(C).concat(e.toString()?"?".concat(e):"")))},[C]);let Z=(0,s.useRouter)();(0,i.useEffect)(()=>{J&&[..._?["","/brief","/design-system"].map(e=>"/p/".concat(_).concat(e)):[],...z.map(e=>"/p/".concat(e.slug)),...g.tt.map(e=>e.id)].forEach(e=>Z.prefetch(e))},[J,_,z,Z]),(0,i.useEffect)(()=>{Y&&T(C)&&(document.cookie="".concat(I.x,"=").concat(Y.slug,"; path=/; max-age=31536000; samesite=lax"),X(Y.slug))},[Y]),(0,i.useEffect)(()=>{let e=e=>{let t=e.target instanceof Element&&e.target.closest("input, textarea, select, [contenteditable]");"n"!==e.key.toLowerCase()||e.metaKey||e.ctrlKey||e.altKey||t||document.querySelector("[role=dialog]")||(e.preventDefault(),K(!0))};return addEventListener("keydown",e),()=>removeEventListener("keydown",e)},[]);let ee=e=>e.flatMap(e=>{var t,n,a,s,i;let r=null!=(a=null==(t=z.find(t=>t.slug===e.project))?void 0:t.name)?a:e.project,l=(e=>{var t,n;let a=z.find(t=>t.slug===e.project),s="/p/".concat(e.project),i=e.spread.match(/^(plan|build|crit|variants|note)-(.+)$/);if(!i)return{href:s};let[,r,l]=i;if("plan"===r||"build"===r)return{href:"".concat(s,"?view=plan&part=").concat(encodeURIComponent(l)),on:null==(n=B[e.project])||null==(t=n.find(e=>e.id===l))?void 0:t.title};let o=null==a?void 0:a.screens.find(e=>e.id===l);return o?{href:"".concat(s,"?design=").concat(encodeURIComponent(l)),on:o.name}:{href:s}})(e),o=(null!=(s=e.workers)?s:[]).filter(e=>"working"===e.state);if(o.length)return o.map(t=>({key:"".concat(e.id,"-").concat(t.id),project:e.project,projectName:r,who:t.name,doing:t.doing||"Working on its piece",state:"building",since:e.started,...l}));let c=[...null!=(i=e.steps)?i:[]].reverse().find(e=>!e.says),d=null==c||null==(n=c.detail)?void 0:n.split("\n")[0];return[{key:e.id,project:e.project,projectName:r,doing:c?d?"".concat(c.text," ").concat(d):c.text:"Getting started",state:(0,f.L4)(c),since:e.started,...l}]}),et=e=>(0,y.DJ)(e,D,W),en=z.map(e=>{var t,n;let a=(0,y.hN)(e,D,R,L,B),s=et(e),i=a.length,r=i?(0,y.c)(a):null!=(t=null==s?void 0:s.text)?t:"";return{slug:e.slug,name:e.name,line:r,needs:i,state:i?"waiting":null!=(n=null==s?void 0:s.state)?n:"idle"}}),ea=en.reduce((e,t)=>e+t.needs,0),es=e=>({text:"".concat(e.length," waiting for you"),state:"waiting"}),ei=z.flatMap(e=>(0,y.hN)(e,D,R,L,B)),er=Y&&null!=(N=null==(n=en.find(e=>e.slug===Y.slug))?void 0:n.needs)?N:0,el=Y?ea-er:0,eo=(()=>{if(!Y)return;let e=W.filter(e=>e.project===Y.slug&&"running"===e.status),t=e.reduce((e,t)=>{var n;return e+Math.max(1,(null!=(n=t.workers)?n:[]).filter(e=>"working"===e.state).length)},0),n=et(Y),a=(e=>{let t=z.find(t=>t.slug===e);return t?(0,y.hN)(t,D,R,L,B):[]})(Y.slug);return a.length?es(a):n?{text:t>1?"".concat(t," agents are working"):"The agent is working",state:n.state,since:1===t?n.since:void 0,agents:ee(e)}:er?es(a):{text:"Ready for a brief",state:"idle"}})(),ec="/"===C,ed=(()=>{var e;let t=W.filter(e=>"running"===e.status),n=t.reduce((e,t)=>{var n;return e+Math.max(1,(null!=(n=t.workers)?n:[]).filter(e=>"working"===e.state).length)},0);return ea?es(ei):n?{text:n>1?"".concat(n," agents are working"):"The agent is working",state:"drawing",since:1===n?null==(e=t[0])?void 0:e.started:void 0,agents:ee(t)}:{text:"Ready for a brief",state:"idle"}})(),eu=(0,i.useMemo)(()=>({setTitle:e=>void(document.title="Playground"===e?e:"".concat(e,", Playground")),newProject:()=>K(!0),setFocus:G}),[]);return C.startsWith("/lab")||C.startsWith("/render")?(0,a.jsx)(O.Provider,{value:eu,children:S}):(0,a.jsxs)(O.Provider,{value:eu,children:[(0,a.jsx)(g.uq,{open:J,onOpenChange:H,project:ec&&!J?void 0:Y&&{slug:Y.slug,name:Y.name},title:ec&&!J?"Home":void 0,status:ec?ed:eo,elsewhere:ec?0:el,besideBack:C.startsWith("/p/")||C.startsWith("/s/"),onAsk:async e=>{if(!Y)return"Open a project first.";H(!1),M("/p/".concat(Y.slug,"/brief?text=").concat(encodeURIComponent(e)))},here:function(e,t){var n;if("/"===e)return"home";let a=g.tt.find(t=>e.startsWith(t.id));if(a)return a.id;if(!t)return"";let s=null==(n=e.match(/^\/p\/[a-z0-9-]+\/([a-z-]+)/))?void 0:n[1];return s&&["brief","design-system"].includes(s)?s:""}(C,null==Y?void 0:Y.slug),places:[{id:"home",label:"Home",Icon:o.t},{id:"brief",label:"New brief",Icon:c.F},{id:"design-system",label:"Design system",Icon:d.l}],projects:en,onGo:(e,t)=>{H(!1),M(e.startsWith("/")?e:"home"===e?"/":"/p/".concat(_,"/").concat(e),t)},onProject:e=>{H(!1),M("/p/".concat(e))},onNewProject:()=>(H(!1),K(!0)),actions:[{id:"mode",label:"dark"===q?"Light mode":"Dark mode",Icon:"dark"===q?u.b:p.A,run:()=>($(),H(!1))}]}),(C.startsWith("/p/")||C.startsWith("/s/"))&&(0,a.jsxs)(m.m_,{children:[(0,a.jsx)(m.k$,{asChild:!0,children:(0,a.jsx)(l(),{href:"/","aria-label":"Home",className:"fixed left-4 top-3 z-50 grid size-9 place-items-center rounded-pill bg-bg-floating text-fg-secondary shadow-float outline-hidden transition-hover hover:text-fg-primary focus-visible:ring-2 focus-visible:ring-ring [&_svg]:size-4",children:(0,a.jsx)(h.Z,{weight:"bold"})})}),(0,a.jsx)(m.ZI,{side:"bottom",children:"Home"})]}),(0,a.jsx)("main",{className:"h-dvh min-h-0 overflow-hidden bg-canvas pt-14",children:S}),(0,a.jsx)(P,{open:U,onOpenChange:K})]})}function B(e){let{children:t}=e;return(0,a.jsx)(x.AF,{children:(0,a.jsx)(W,{children:t})})}function F(e,t){let{setTitle:n}=D();(0,i.useLayoutEffect)(()=>{n(e)},[e,n])}},33246:(e,t,n)=>{n.d(t,{Cn:()=>m,LI:()=>h,vk:()=>p});var a=n(95155),s=n(88702),i=n(3278),r=n(74164),l=n(82),o=n(50847),c=n(80526),d=n(45515);let u=(e,t)=>{var n;return"".concat((0,d.IX)(e,t.id),"&shot=1&t=").concat(null!=(n=e.themeKey)?n:"")};function p(e){let{spread:t,d:n,live:s,pad:i=8,className:r}=e,{w:o,h:p}=d.xW[t.device];return(0,a.jsx)("div",{className:r,children:(0,a.jsx)(l.cG,{w:o,h:p,pad:i,className:"size-full",children:s?(0,a.jsx)("iframe",{title:n.name,src:(0,d.IX)(t,n.id),sandbox:"allow-scripts allow-forms",className:(0,c.cn)("block border-0 bg-bg-content shadow-ring","phone"===t.device?"rounded-dialog":"rounded-panel"),style:{width:o,height:p}}):(0,a.jsx)("img",{src:u(t,n),alt:n.name,loading:"lazy",draggable:!1,className:(0,c.cn)("block select-none shadow-ring","phone"===t.device?"rounded-dialog":"rounded-panel"),style:{width:o,height:p}})})})}function h(e){let{spread:t,d:n,size:l="icon-sm"}=e,o=e=>(0,d.Rb)({action:"react",project:t.project,spread:t.id,direction:n.id,reaction:n.reaction===e?null:e}),c=!!t.chosen,u="icon"===l?"default":"sm";return(0,a.jsxs)("div",{className:"flex shrink-0 items-center gap-0.5",children:[(0,a.jsx)(r.l,{size:u,"aria-label":"Keep ".concat(n.name),pressed:"keep"===n.reaction,disabled:c,onPressedChange:()=>o("keep"),className:"data-[state=on]:text-brand",children:(0,a.jsx)(s.J,{weight:"bold"})}),(0,a.jsx)(r.l,{size:u,"aria-label":"Cut ".concat(n.name),pressed:"cut"===n.reaction,disabled:c,onPressedChange:()=>o("cut"),children:(0,a.jsx)(i.X,{weight:"bold"})})]})}function m(e){var t;let{spread:n,d:s,onOpen:i,compact:r,className:l}=e,d=(null==(t=n.chosen)?void 0:t.direction)===s.id;return(0,a.jsx)("div",{"data-direction":s.id,className:(0,c.cn)("min-w-0",l),children:(0,a.jsx)(o.FA,{device:n.device,name:s.name,compact:r,picture:(0,a.jsx)("img",{src:u(n,s),alt:"",loading:"lazy",draggable:!1,className:"absolute inset-0 size-full select-none object-cover object-top"}),selected:d||"keep"===s.reaction,dim:!d&&"cut"===s.reaction,onOpen:i,actions:n.chosen?void 0:(0,a.jsx)(h,{spread:n,d:s})})})}},39557:(e,t,n)=>{n.d(t,{Cf:()=>a,Cv:()=>c,HV:()=>p,Hp:()=>u,JD:()=>d,PM:()=>l,VJ:()=>o,oz:()=>s});let a={track:.15,snappy:.25,smooth:.35,gentle:.5},s=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a.smooth;return{x:e,v:0,to:e,r:t}},i=!1;if(window.matchMedia){var r;let e=window.matchMedia("(prefers-reduced-motion: reduce)");i=e.matches,null==(r=e.addEventListener)||r.call(e,"change",e=>i=e.matches)}function l(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5e-4;if(i)return e.x=e.to,e.v=0,!0;let a=2*Math.PI/e.r,s=e.x-e.to,r=e.v+a*s,l=Math.exp(-a*t),o=(s+r*t)*l;return e.v=(e.v-a*r*t)*l,e.x=e.to+o,!!(Math.abs(o)<n&&Math.abs(e.v)<20*n)&&(e.x=e.to,e.v=0,!0)}let o=(e,t)=>Math.sign(e)*t*(1-1/(.55*Math.abs(e)/t+1)),c=(e,t)=>e+.5*t;class d{reset(e,t){this.s=[{t:e,x:t}]}add(e,t){for(this.s.push({t:e,x:t});this.s.length>2&&e-this.s[0].t>100;)this.s.shift()}speed(e){let t=this.s[0],n=this.s.at(-1);return t&&n&&n.t!==t.t&&!(e-n.t>80)?(n.x-t.x)/(n.t-t.t)*1e3:0}constructor(){this.s=[]}}class u{feed(e,t){let n,a=Math.abs(e),s=t-this.at;return this.at=t,s>100||this.coasting&&a>1.5*this.last+3?(this.coasting=!1,this.stepped=!1,this.falling=0,n="start"):this.coasting||this.stepped?n="coast":(this.falling=a<this.last?this.falling+1:0,n="move"),this.last=a,n}get lifted(){return this.falling>=4}release(){this.coasting=!0,this.falling=0}constructor(){this.last=0,this.at=-1e9,this.falling=0,this.coasting=!1,this.stepped=!1}}let p=(e,t)=>"start"===e&&Math.abs(t)>=40},45515:(e,t,n)=>{let a;n.d(t,{IX:()=>h,Ow:()=>c,Rb:()=>u,SJ:()=>d,oE:()=>m,xW:()=>p,yK:()=>g});var s=n(12115);let i={spreads:[],runs:[],proposals:[],reactions:0,plans:{},builds:{},loaded:!1},r="",l=new Set,o=e=>{i=e,l.forEach(e=>e(i))};async function c(){var e,t;let n=await fetch("/api/studio?since=".concat(r),{cache:"no-store"}).catch(()=>null);if(!(null==n?void 0:n.ok))return;let a=await n.json();r=a.stamp,a.same?i.loaded||o({...i,loaded:!0}):o({spreads:a.spreads,runs:a.runs,proposals:a.proposals,reactions:a.reactions,plans:null!=(e=a.plans)?e:{},builds:null!=(t=a.builds)?t:{},loaded:!0})}function d(){let[e,t]=(0,s.useState)(i);return(0,s.useEffect)(()=>{if(l.add(t),!a){c();let e=0;a=setInterval(()=>{"visible"===document.visibilityState&&(i.runs.some(e=>"running"===e.status)||i.spreads.some(e=>e.drawing)||Date.now()-e>=1e4)&&(e=Date.now(),c())},2e3),addEventListener("focus",()=>void c())}return t(i),()=>{l.delete(t),!l.size&&a&&(clearInterval(a),a=void 0)}},[]),e}async function u(e){let t=await fetch("/api/studio",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}).catch(()=>null),n=t?await t.json().catch(()=>({})):{error:"Couldn't reach Playground. Check it's running and try again."};return n.spread&&o({...i,spreads:i.spreads.map(e=>e.project===n.spread.project&&e.id===n.spread.id?{...e,...n.spread}:e)}),c(),n}let p={phone:{w:390,h:844},desktop:{w:1440,h:900},tablet:{w:834,h:1112}},h=(e,t)=>"/api/studio/html?project=".concat(encodeURIComponent(e.project),"&spread=").concat(encodeURIComponent(e.id),"&direction=").concat(encodeURIComponent(t)),m=e=>e.directions.filter(t=>"cut"!==t.reaction||t.round===e.round),g=e=>!e.chosen&&!e.drawing&&e.directions.some(t=>t.round===e.round)},47982:(e,t,n)=>{n.d(t,{Qx:()=>w,bP:()=>m,gM:()=>j,lS:()=>g});var a=n(95155),s=n(12115),i=n(98038),r=n(68772),l=n(76654),o=n(68515),c=n(49255),d=n(50847),u=n(28976),p=n(80526),h=n(45515);let m=e=>!!e.approved||e.directions.length>0||e.round>1,g=e=>!!e.written&&!m(e)&&!e.drawing,f=e=>{var t,n,a,s,i,r,l,o,c;return{title:e.title,brief:e.brief,for:null!=(r=null==(t=e.written)?void 0:t.for)?r:"",doneWhen:null!=(l=null==(n=e.written)?void 0:n.doneWhen)?l:"",builtWith:null!=(o=null==(a=e.written)?void 0:a.builtWith)?o:"",steps:(null==(s=e.steps)?void 0:s.length)?e.steps:(null!=(c=null==(i=e.written)?void 0:i.plan)?c:[]).map(e=>({text:e,status:"todo"}))}};function x(e){let{value:t,onChange:n,onSave:s,label:i,className:r,disabled:l,onKeyDown:o,inputRef:c}=e;return(0,a.jsx)("textarea",{ref:c,rows:1,value:t,"aria-label":i,disabled:l,onChange:e=>n(e.target.value),onBlur:s,onKeyDown:o,className:(0,p.cn)("field-sizing-content -mx-1.5 w-full resize-none rounded-item bg-transparent px-1.5 py-0.5 outline-hidden transition-hover",!l&&"hover:bg-fill-hover focus:bg-fill-hover focus-visible:ring-2 focus-visible:ring-ring",r)})}let v=e=>{let{status:t}=e;return"done"===t?(0,a.jsx)(u.rA,{status:"approved",tip:!1}):"doing"===t?(0,a.jsx)(c.q,{state:"drawing",className:"size-4 text-agent-work"}):(0,a.jsx)(u.rA,{status:"brief",tip:!1})},b={todo:"doing",doing:"done",done:"todo"},y={todo:"To do",doing:"Under way",done:"Done"};function w(e){let{spread:t,editable:n=!0,className:l}=e,[c,u]=(0,s.useState)(()=>f(t)),[m,g]=(0,s.useState)(""),w=(0,s.useRef)(!1),j=(0,s.useRef)(0),k=(0,s.useRef)(null),N=(0,s.useRef)([]),S="".concat(t.updated);(0,s.useEffect)(()=>{w.current||u(f(t))},[S]),(0,s.useEffect)(()=>{var e;null!=k.current&&(null==(e=N.current[k.current])||e.focus(),k.current=null)});let C=e=>{w.current=!0,j.current++,u(t=>({...t,...e}))},M=async function(){var e;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:c;if(!w.current)return;let a=j.current,s=await (0,h.Rb)({action:"plan",project:t.project,spread:t.id,plan:{...n,steps:n.steps.filter(e=>e.text.trim())}});g(null!=(e=s.error)?e:""),s.error||j.current!==a||(w.current=!1)},z=e=>{let t=[...c.steps];t.splice(e,0,{text:"",status:"todo"}),C({steps:t}),k.current=e},R=t.written,E=(e,t)=>(0,a.jsxs)("div",{className:"flex gap-x-4 gap-y-0.5 max-md:flex-col",children:[(0,a.jsx)("span",{className:"w-28 shrink-0 pt-0.5 text-sm text-fg-meta",children:t}),(0,a.jsx)(x,{label:t,value:c[e],onChange:t=>C({[e]:t}),onSave:()=>void M(),disabled:!n,className:"text-ui text-fg-primary"})]});return(0,a.jsxs)("article",{"aria-label":"The plan for ".concat(t.title),className:(0,p.cn)("grid gap-7 rounded-panel bg-bg-content p-8 shadow-ring max-md:p-5",l),children:[(0,a.jsxs)("header",{className:"grid gap-2",children:[(0,a.jsx)(x,{label:"Title",value:c.title,onChange:e=>C({title:e}),onSave:()=>void M(),disabled:!n,className:"font-heading text-title font-semibold text-balance text-fg-primary"}),(0,a.jsx)(x,{label:"Brief",value:c.brief,onChange:e=>C({brief:e}),onSave:()=>void M(),disabled:!n,className:"text-ui text-pretty text-fg-secondary"})]}),R?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"grid gap-3",children:[E("for","For"),E("doneWhen","Done when"),E("builtWith","Built with")]}),R.assumptions.length>0&&(0,a.jsxs)("section",{className:"grid gap-2",children:[(0,a.jsx)("h2",{className:"text-ui font-medium text-fg-secondary",children:"Assumed"}),R.assumptions.map(e=>(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-x-4 gap-y-1.5",children:[(0,a.jsx)("span",{className:"min-w-0 text-ui text-fg-primary",children:e.label}),(0,a.jsx)(o.O,{type:"single",size:"sm",value:e.value,onValueChange:n=>n&&(0,h.Rb)({action:"assume",project:t.project,spread:t.id,assumption:e.id,value:n}),"aria-label":e.label,disabled:!n,children:e.options.map(e=>(0,a.jsx)(o.d,{value:e,children:e},e))})]},e.id))]}),(0,a.jsxs)("section",{className:"grid gap-1",children:[(0,a.jsx)("h2",{className:"pb-1 text-ui font-medium text-fg-secondary",children:"Plan"}),(0,a.jsx)("ol",{className:"grid gap-0.5",children:c.steps.map((e,t)=>{var s,i,r;return(0,a.jsxs)("li",{className:"walk-in flex items-start gap-2",children:[(0,a.jsx)("button",{type:"button",disabled:!n,onClick:()=>{let e={...c,steps:c.steps.map((e,n)=>{var a;return n===t?{...e,status:b[null!=(a=e.status)?a:"todo"]}:e})};w.current=!0,j.current++,u(e),M(e)},"aria-label":"".concat(y[null!=(s=e.status)?s:"todo"],": ").concat(e.text||"new step"),className:"mt-1 grid size-5 shrink-0 place-items-center rounded-full outline-hidden focus-visible:ring-2 focus-visible:ring-ring",children:(0,a.jsx)(v,{status:null!=(i=e.status)?i:"todo"})}),(0,a.jsx)(x,{inputRef:e=>void(N.current[t]=e),label:"Step ".concat(t+1),value:e.text,onChange:e=>{let n;return n={text:e},C({steps:c.steps.map((e,a)=>a===t?{...e,...n}:e)})},onSave:()=>void M(),disabled:!n,className:(0,p.cn)("text-ui","done"===e.status?"text-fg-meta":"text-fg-primary"),onKeyDown:n=>{if("Enter"!==n.key||n.shiftKey){if("Backspace"===n.key&&!e.text){n.preventDefault();let e={...c,steps:c.steps.filter((e,n)=>n!==t)};C({steps:e.steps}),k.current=Math.max(0,t-1),M(e)}}else n.preventDefault(),z(t+1)}})]},null!=(r=e.id)?r:"new-".concat(t))})}),n&&(0,a.jsxs)(r.$,{variant:"ghost",size:"sm",className:"mt-1 w-fit",onClick:()=>z(c.steps.length),children:[(0,a.jsx)(i.F,{}),"Add a step"]})]})]}):(0,a.jsx)(d.vB,{status:"drawing",children:"Writing the plan"}),m&&(0,a.jsx)(d.vB,{danger:!0,children:m})]})}function j(e){let{spread:t}=e,[n,i]=(0,s.useState)(!1),[o,u]=(0,s.useState)(""),[m,g]=(0,s.useState)(!1),[f,x]=(0,s.useState)(""),v=async e=>{g(!0),x("");let n=await (0,h.Rb)({project:t.project,spread:t.id,...e});return g(!1),n.error&&x(n.error),!n.error};return(0,a.jsxs)("section",{"aria-live":"polite",className:"grid gap-1.5 rounded-panel bg-bg-floating p-3 shadow-float",children:[(0,a.jsxs)("span",{className:"flex items-center gap-2",children:[(0,a.jsx)(c.q,{state:"waiting",className:"size-4 text-agent-wait"}),(0,a.jsxs)("h2",{className:"text-ui font-medium text-balance text-fg-primary",children:["Here's my plan for ",t.title]})]}),(0,a.jsxs)("p",{className:"text-ui text-pretty text-fg-secondary",children:[t.replan?"I planned it again with what you said. ":"","Click anything in it to change it. Approve it and I'll start drawing."]}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-1.5 pt-1.5",children:[(0,a.jsx)(r.$,{variant:"primary",size:"sm",disabled:m,onClick:()=>v({action:"approve"}),children:"Approve plan"}),(0,a.jsx)(r.$,{variant:"ghost",size:"sm","aria-expanded":n,className:(0,p.cn)(n&&"bg-fill-selected"),onClick:()=>i(!n),children:"Not this"})]}),n&&(0,a.jsxs)("div",{className:"grid gap-1.5 pt-1",children:[(0,a.jsx)(l.T,{autoFocus:!0,value:o,onChange:e=>u(e.target.value),"aria-label":"What's wrong with the plan",placeholder:"What's wrong, and what it should be instead",rows:3}),(0,a.jsx)(r.$,{size:"sm",className:"w-fit",disabled:m||!o.trim(),onClick:async()=>await v({action:"replan",why:o.trim()})&&(i(!1),u("")),children:"Plan again"})]}),f&&(0,a.jsx)(d.vB,{danger:!0,children:f})]})}},56005:(e,t,n)=>{n.d(t,{BriefPage:()=>j,K:()=>S});var a=n(95155),s=n(12115),i=n(20063),r=n(26510),l=n(62861),o=n(28210),c=n(64906),d=n(45437),u=n(22747),p=n(68772),h=n(68515),m=n(74371),g=n(50847),f=n(32296),x=n(51063),v=n(77792),b=n(76654),y=n(80526),w=n(45515);function j(e){var t,n;let{project:o,name:c,system:d}=e;(0,f.K7)("New brief, ".concat(c));let u=(0,x.uB)(),h=null!=(n=null==(t=(0,i.useSearchParams)().get("text"))?void 0:t.trim())?n:"",[w,j]=(0,s.useState)(""),[S,C]=(0,s.useState)([]);(0,s.useEffect)(()=>{fetch("/api/themes",{cache:"no-store"}).then(e=>e.json()).then(e=>C(e.themes)).catch(()=>{})},[]);let M=S.find(e=>e.slug===d),z=S.find(e=>"baseline"===e.slug),[R,E]=(0,s.useState)(null),[A,P]=(0,s.useState)({}),[I,O]=(0,s.useState)(null),[D,T]=(0,s.useState)(""),[W,B]=(0,s.useState)(""),[F,L]=(0,s.useState)(""),[q,$]=(0,s.useState)(!1),J=async e=>{j(e),P({}),O(null),E(null),fetch("/api/plan",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"clarify",project:o,brief:e})}).then(e=>e.json()).then(e=>E(Array.isArray(e.questions)?e.questions:[])).catch(()=>E([]))},H=[{id:"crew",question:"Who builds it once you approve the plan?",options:v.$D.map(e=>({id:e.id,name:"team"===e.id?"A team of agents":e.name,line:e.line}))},{id:"system",question:"Which design system is it made in?",options:[...M?[{id:M.slug,name:"baseline"===M.slug?"Baseline":M.name,line:"What ".concat(c," uses now.")}]:[],...z&&(null==M?void 0:M.slug)!=="baseline"?[{id:"baseline",name:"Baseline",line:"Baseline's own, as Playground is made."}]:[],{id:v.LU,name:"A new design system",line:"Its own type, colour, spacing, corners and components, made for ".concat(c,".")}]},...A.system===v.LU?[{id:"feel",question:"How should it look and feel?",options:[],free:!0}]:[],...(null!=R?R:[]).map(e=>({id:e.id,question:e.question,options:e.options.map(e=>({id:e,name:e}))}))],U=I?H.find(e=>e.id===I):H.find(e=>!A[e.id]),K=null===R&&!U,Q=(e,t)=>{P(n=>({...n,[e.id]:t})),O(null)},X=async()=>{var e;$(!0),L("");let t=A.system===v.LU?"Design system: make a new one for this project, deriving its type, colour, spacing, radius, primitives and components from what it is for. How it should look and feel: ".concat(A.feel):A.system&&A.system!==d?"Design system: use ".concat(null==(e=S.find(e=>e.slug===A.system))?void 0:e.name," (").concat(A.system,")."):"",n=(null!=R?R:[]).filter(e=>A[e.id]).map(e=>"- ".concat(e.question," ").concat(A[e.id])),a=[w,t,n.length?"What they told you before the plan:\n".concat(n.join("\n")):""].filter(Boolean).join("\n\n"),s=await fetch("/api/plan",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"brief",project:o,brief:a,crew:"team"===A.crew?"team":"one"})}).then(e=>e.json()).catch(()=>({error:"Couldn't reach Playground. Try again."}));if($(!1),s.error)return L(s.error);u("/p/".concat(o,"?view=plan"))};return(0,a.jsx)(m.Zk,{children:(0,a.jsxs)("div",{className:"min-h-0 flex-1 overflow-y-auto",children:[(0,a.jsx)(g.Y9,{title:"New brief",crumbs:[{label:c,href:"/p/".concat(o)}]}),(0,a.jsx)("div",{className:(0,y.cn)(m.Eb,"pb-24"),children:w?(0,a.jsxs)("div",{className:"grid gap-8",children:[(0,a.jsxs)("div",{className:"-mx-2 grid",children:[(0,a.jsx)(g.fI,{stacked:!0,lead:(0,a.jsx)(r.Y,{className:N}),title:k(w),onClick:()=>j("")}),H.filter(e=>A[e.id]&&e.id!==(null==U?void 0:U.id)).map(e=>{var t,n;return(0,a.jsx)(g.fI,{stacked:!0,lead:(0,a.jsx)(l.r,{className:N}),title:k(null!=(t=e.free?A[e.id]:null==(n=e.options.find(t=>t.id===A[e.id]))?void 0:n.name)?t:""),parent:e.question,onClick:()=>O(e.id)},e.id)})]}),U?(0,a.jsxs)("section",{"aria-labelledby":"brief-q",className:"grid gap-3",children:[(0,a.jsx)("h2",{id:"brief-q",className:"text-ui font-medium text-fg-primary text-pretty",children:U.question}),U.free?(0,a.jsxs)("form",{className:"grid gap-3",onSubmit:e=>{if(e.preventDefault(),!D.trim())return B("Say how it should look and feel, in a few words.");Q(U,D.trim())},children:[(0,a.jsx)(b.T,{id:"brief-feel","aria-labelledby":"brief-q",autoFocus:!0,rows:3,value:D,onChange:e=>(T(e.target.value),W&&B("")),"aria-invalid":!!W,"aria-describedby":W?"brief-feel-error":void 0}),W&&(0,a.jsx)("p",{id:"brief-feel-error",className:"text-sm text-status-danger",children:W}),(0,a.jsx)("div",{children:(0,a.jsx)(p.$,{type:"submit",children:"Next"})})]}):(0,a.jsx)("div",{role:"radiogroup","aria-labelledby":"brief-q",className:"-mx-2 grid",children:U.options.map(e=>(0,a.jsx)(g.fI,{stacked:!0,lead:(0,a.jsx)("span",{"aria-hidden":!0,className:(0,y.cn)("size-3.5 rounded-full border border-fg-muted",A[U.id]===e.id&&"border-fg-primary bg-fg-primary")}),title:e.name,parent:e.line,selected:A[U.id]===e.id,checked:A[U.id]===e.id,onClick:()=>Q(U,e.id)},e.id))})]}):K?(0,a.jsx)(g.vB,{status:"drawing",children:"Reading your brief for anything it needs to ask"}):(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,a.jsx)(p.$,{variant:"primary",disabled:q,onClick:X,children:"Plan it"}),F&&(0,a.jsx)(g.vB,{danger:!0,children:F})]})]}):(0,a.jsx)(g.Dk,{label:"What do you want?",initial:h,send:"Next",autoFocus:!0,onSend:async e=>void await J(e)})})]})})}let k=e=>(0,a.jsx)("span",{className:"block whitespace-normal text-pretty",children:e}),N="size-4 text-fg-muted";function S(e){var t,n;let{spread:s,className:i}=e,r=s.written,p=(0,g.Xd)(null!=(t=null==r?void 0:r.assumptions)?t:[]),m=(0,g.Xd)(null!=(n=null==r?void 0:r.plan)?n:[]);return r?(0,a.jsxs)("div",{className:(0,y.cn)("min-w-0",i),children:[(0,a.jsxs)("div",{className:"grid",children:[(0,a.jsx)(g.fI,{stacked:!0,lead:(0,a.jsx)(o.K,{className:N}),title:"For",parent:r.for,trailWidth:"w-0"}),(0,a.jsx)(g.fI,{stacked:!0,lead:(0,a.jsx)(l.r,{className:N}),title:"Done when",parent:r.doneWhen,trailWidth:"w-0"}),r.builtWith&&(0,a.jsx)(g.fI,{stacked:!0,lead:(0,a.jsx)(c.B,{className:N}),title:"Built with",parent:r.builtWith,trailWidth:"w-0"})]}),r.assumptions.length>0&&(0,a.jsxs)(g.wn,{title:"Assumed",className:"mt-6",children:[(0,a.jsx)("div",{className:"grid",children:p.shown.map(e=>(0,a.jsx)(g.fI,{lead:(0,a.jsx)(d.d,{className:N}),title:k(e.label),trailWidth:"w-auto",trail:(0,a.jsx)(h.O,{type:"single",size:"sm",value:e.value,onValueChange:t=>t&&(0,w.Rb)({action:"assume",project:s.project,spread:s.id,assumption:e.id,value:t}),"aria-label":e.label,disabled:!!s.chosen,children:e.options.map(e=>(0,a.jsx)(h.d,{value:e,children:e},e))})},e.id))}),(0,a.jsx)(g.is,{...p.pager})]}),r.plan.length>0&&(0,a.jsxs)(g.wn,{title:"Plan",className:"mt-6",children:[(0,a.jsx)("div",{className:"grid",children:m.shown.map(e=>(0,a.jsx)(g.fI,{lead:(0,a.jsx)(u.Q,{className:N}),title:k(e),trailWidth:"w-0"},e))}),(0,a.jsx)(g.is,{...m.pager})]})]}):null}},67455:(e,t,n)=>{n.d(t,{c0:()=>a,dt:()=>r,e4:()=>l,ky:()=>o,mU:()=>i,me:()=>s});let a={trent:{id:"trent",name:"Trent",initials:"T"},maya:{id:"maya",name:"Maya Okafor",initials:"M"},jonah:{id:"jonah",name:"Jonah Reyes",initials:"J"}},s=a.trent,i={ledger:[{id:"full-app",name:"Full app",start:"sign-in",screens:["sign-in","invoice-list","settings","billing"]},{id:"sign-in",name:"Sign in",start:"sign-in",screens:["sign-in","invoice-list"]},{id:"billing",name:"Billing",start:"settings",screens:["settings","billing"]}],"habit-tracker":[{id:"daily",name:"Daily check-in",start:"today",screens:["today","stats"]}]},r=[{slug:"ledger",name:"Ledger",repo:"TrentM6/ledger-app",stage:"review",summary:"Settings waiting on your review",brief:{lead:"Invoicing for freelancers.",body:"Send an invoice in under a minute and get paid on time with reminders. Agencies come after launch."},collaborators:["maya","trent"],screens:[{id:"settings",name:"Settings",status:"review",version:3,kind:"ledger-settings"},{id:"invoice-list",name:"Invoice list",status:"built",version:4,kind:"ledger-list"},{id:"sign-in",name:"Sign in",status:"built",version:2,kind:"ledger-signin"},{id:"billing",name:"Billing",status:"drawing",version:1,kind:"ledger-billing"},{id:"onboarding",name:"Onboarding",status:"brief",version:0,kind:"blank"}],references:[250,30,150,300],pullRequests:[{id:"settings",screen:"Settings",state:"waiting",branch:"settings-page"},{id:"billing",screen:"Billing",state:"waiting",branch:"billing-page"},{id:"invoice-list",screen:"Invoice list",number:16,state:"merged",branch:"invoice-list",date:"Nov 21"},{id:"sign-in",screen:"Sign in",number:14,state:"merged",branch:"sign-in",date:"Nov 19"}],needsYou:!0},{slug:"habit-tracker",name:"Habit tracker",stage:"designing",summary:"Designing 3 screens",brief:{lead:"A habit tracker that forgives.",body:"Check off a habit in one tap. A missed day pauses a streak instead of ending it. iPhone first."},collaborators:["maya","trent"],screens:[{id:"today",name:"Today",status:"review",version:2,kind:"habit"},{id:"week",name:"Week",status:"drawing",version:1,kind:"habit"},{id:"stats",name:"Stats",status:"drawing",version:1,kind:"habit"}],references:[200,120],pullRequests:[],needsYou:!0},{slug:"portfolio-site",name:"Portfolio site",repo:"TrentM6/portfolio-site",stage:"live",summary:"Live since Nov 12",brief:{lead:"Photographs from New York.",body:"A quiet site for street photographs, 2019 to now. Big images, almost no chrome."},collaborators:["trent"],screens:[{id:"home",name:"Home",status:"built",version:5,kind:"site"},{id:"series",name:"Series",status:"built",version:3,kind:"site"}],references:[30,60,90],pullRequests:[{id:"home",screen:"Home",number:9,state:"merged",branch:"home",date:"Nov 12"},{id:"series",screen:"Series",number:8,state:"merged",branch:"series",date:"Nov 10"}],needsYou:!1}],l=[{v:3,label:"After the second look"},{v:2,label:"Reminders as days"},{v:1,label:"First draft"}],o={"ledger/settings":[{id:"c1",device:"desktop",x:968,y:280,who:"Maya Okafor",initials:"M",text:"Should payment terms default to Net 15 for freelancers?",when:"9:58 AM"}],"habit-tracker/today":[{id:"c2",device:"phone",x:398,y:182,who:"Maya Okafor",initials:"M",text:"Can the streak sit beside each habit?",when:"9:40 AM"},{id:"c3",device:"phone",x:398,y:294,who:"Maya Okafor",initials:"M",text:"Stretch could be optional on weekends.",when:"9:41 AM"}]}},69760:(e,t,n)=>{n.d(t,{DG:()=>o,DJ:()=>i,QM:()=>r,c:()=>u,gE:()=>c,hN:()=>l});var a=n(45515),s=n(47982);function i(e,t,n){var a,s,i;let r=n.filter(t=>t.project===e.slug&&"running"===t.status),l=t.find(t=>t.project===e.slug&&t.drawing);if(l)return{text:l.axes?"Drawing round ".concat(l.round," of ").concat(l.title):"Reading the brief for ".concat(l.title),state:l.axes?"drawing":"reading",since:null==(a=r.find(e=>e.spread===l.id))?void 0:a.started};let o=r[0];if(!o)return null;let c=t=>e.screens.find(e=>"".concat(t).concat(e.id)===o.spread),d=o.started;if(o.spread.startsWith("crit-")){let e=c("crit-");return e&&o.round>e.version?{text:"Drawing version ".concat(o.round," of ").concat(e.name),state:"drawing",since:d}:{text:e?"Getting ready to walk you through ".concat(e.name):"Getting a walkthrough ready",state:"looking",since:d}}return o.spread.startsWith("variants-")?{text:"Drawing variants of ".concat(null!=(i=null==(s=c("variants-"))?void 0:s.name)?i:"a screen"),state:"drawing",since:d}:o.spread.startsWith("note-")?{text:"Answering your note",state:"thinking",since:d}:"system"===o.spread?{text:"Building the design system",state:"drawing",since:d}:{text:"Working on the plan",state:"thinking",since:d}}let r=e=>"".concat(e.length," waiting for you");function l(e,t,n){var i,r,l;let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},d=[];for(let t of null!=(l=c[e.slug])?l:[])d.push({key:"plan-".concat(t.id),kind:"plan",section:t});for(let n of t.filter(t=>t.project===e.slug&&(0,s.lS)(t)))d.push({key:"round-".concat(n.id),kind:"round",spread:n,plan:!0});for(let n of t.filter(t=>t.project===e.slug&&!(0,s.lS)(t)&&(0,a.yK)(t)))d.push({key:"round-".concat(n.id),kind:"round",spread:n,plan:!1});let u=t=>"review"===n(e.slug,t.id);for(let t of e.screens)(null==(i=o[e.slug])?void 0:i[t.id])&&d.push({key:"screen-".concat(t.id),kind:"layouts",screen:t,count:o[e.slug][t.id],review:u(t)});for(let t of e.screens)!u(t)||(null==(r=o[e.slug])?void 0:r[t.id])||d.push({key:"screen-".concat(t.id),kind:"review",screen:t});return d}function o(e){return"plan"===e.kind?"A new part of the plan to approve":"round"===e.kind?e.plan?"A plan to approve before it's drawn":"Directions to choose from":"layouts"===e.kind?"".concat(e.count," ").concat(1===e.count?"layout":"layouts"," to pick"):"Version ".concat(e.screen.version," to review")}let c=e=>"plan"===e.kind?e.section.title:"round"===e.kind?e.spread.title:e.screen.name,d=e=>e.length>3?"".concat(e.slice(0,2).join(", ")," and ").concat(e.length-2," more"):e.length>1?"".concat(e.slice(0,-1).join(", ")," and ").concat(e.at(-1)):e[0];function u(e){let t=[],n=e.filter(e=>"plan"===e.kind).length;n&&t.push(1===n?"a part of the plan to approve":"".concat(n," parts of the plan to approve"));let a=e.filter(e=>"round"===e.kind);a.some(e=>"round"===e.kind&&e.plan)&&t.push("a plan to approve before it's drawn"),a.some(e=>"round"===e.kind&&!e.plan)&&t.push("directions to choose from");let s=e.flatMap(e=>"layouts"===e.kind?[e.screen.name]:[]);s.length&&t.push("layouts to pick for ".concat(d(s)));let i=e.flatMap(e=>"review"===e.kind?[e.screen.name]:[]);i.length&&t.push("".concat(d(i)," to review"));let r=t.join(", ");return r&&r[0].toUpperCase()+r.slice(1)}},77792:(e,t,n)=>{n.d(t,{$D:()=>p,LU:()=>m,vj:()=>d});var a=n(95155),s=n(57784),i=n(68772),r=n(55338),l=n(68515),o=n(80526);let c=[{id:"opus",name:"Opus 5.5",line:"Recommended. Strong on most design work."},{id:"fable",name:"Fable 5.2",line:"The most capable, for the hardest briefs. About twice the cost."},{id:"sonnet",name:"Sonnet 5.5",line:"Faster, for quick rounds. About half the cost."}];function d(e){var t;let{model:n,crew:l,onModel:d,onCrew:p,pieces:m=1,piece:g="direction",className:f}=e,x=null!=(t=c.find(e=>e.id===n))?t:c[0],v=m>1;return(0,a.jsxs)("div",{className:(0,o.cn)("grid gap-1.5",f),children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsxs)(r.rI,{modal:!1,children:[(0,a.jsx)(r.ty,{asChild:!0,children:(0,a.jsxs)(i.$,{size:"sm","aria-label":"Model: ".concat(x.name),children:[x.name,(0,a.jsx)(s.a,{weight:"bold",className:"text-fg-muted"})]})}),(0,a.jsx)(r.SQ,{align:"start",className:"w-72",children:(0,a.jsx)(r.Hr,{value:n,onValueChange:e=>d(e),children:c.map(e=>(0,a.jsx)(r.Ht,{value:e.id,className:"h-auto items-start py-2",children:(0,a.jsxs)("span",{className:"grid gap-0.5",children:[(0,a.jsx)("span",{className:"font-medium text-fg-primary",children:e.name}),(0,a.jsx)("span",{className:"text-sm text-fg-meta text-pretty",children:e.line})]})},e.id))})})]}),v&&(0,a.jsx)(u,{crew:l,onCrew:p})]}),v&&(0,a.jsx)(h,{children:function(e,t,n){if("one"===e)return"One agent works through it, one ".concat(n," after another.");let a=Math.min(t,5);return"A lead splits it into ".concat(t," ").concat(n,"s, ").concat(a===t?"draws them all at once":"".concat(a," at a time"),", and a fresh agent checks them. About ").concat(3>=Math.min(t,5)?"3":"4"," times the cost of one agent.")}(l,m,g)})]})}function u(e){let{crew:t,onCrew:n}=e;return(0,a.jsxs)(l.O,{type:"single",size:"sm",value:t,onValueChange:e=>e&&n(e),"aria-label":"Who works on it",children:[(0,a.jsx)(l.d,{value:"one",children:"One agent"}),(0,a.jsx)(l.d,{value:"team",children:"Team"})]})}let p=[{id:"one",name:"One agent",line:"Once you approve the plan, one agent builds it, one screen after another."},{id:"team",name:"Team",line:"A lead gives each screen its own agent, up to 5 at once, and a fresh agent checks them. About 4 times the cost."}];function h(e){let{children:t}=e;return(0,a.jsx)("p",{className:"text-sm text-fg-meta text-pretty",children:t})}let m="__new"},81375:(e,t,n)=>{n.d(t,{BN:()=>s,Oo:()=>a,dI:()=>i});let a=(e,t)=>"".concat(e,"@").concat(t);function s(e,t,n){return"pen"===e.kind?{...e,pts:e.pts.map(e=>{let[a,s]=e;return[a+t,s+n]})}:{...e,x:e.x+t,y:e.y+n}}let i=e=>"pen"===e.kind?e.pts[0]:[e.x,e.y]},85884:(e,t,n)=>{n.d(t,{al:()=>F,L1:()=>B,B_:()=>A,_e:()=>O,xe:()=>I,m$:()=>P});var a=n(95155),s=n(12115),i=n(47650),r=n(87293),l=n(68772),o=n(76654),c=n(68515),d=n(50847),u=n(50645),p=n(49255),h=n(82),m=n(93890),g=n(25522),f=n(20534),x=n(80526),v=n(39557);let b=[{id:"density",name:"Density",stops:["Airy","Balanced","Compact"]},{id:"structure",name:"Structure",stops:["List","Mixed","Tiles"]},{id:"leads",name:"Leads with",stops:["The total","Both","The habits"],project:"habit-tracker"},{id:"organised",name:"Organised by",stops:["Habit","Status","Day"],project:"habit-tracker"}],y=[{name:"Read",streak:"41 days",short:"41 days",month:97,weeks:[100,100,96,100,90]},{name:"Meditate",streak:"23 days",short:"23 days",month:90,weeks:[86,100,90,96,78]},{name:"Run",streak:"Paused, 9 days",short:"Paused",month:52,weeks:[86,80,62,10,0],paused:!0},{name:"Drink water",streak:"12 days",short:"12 days",month:86,weeks:[70,96,80,100,84]},{name:"Stretch",streak:"5 days",short:"5 days",month:95,weeks:[96,100,90,100,88]}],w=[54,62,48,58,36],j=y.filter(e=>!e.paused),k=function(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];return"<h1>Stats</h1>".concat(e?'<div class="sub">5 habits, 1 streak paused</div>':"")},N=e=>'<div class="seg"'.concat(null!=e?' style="margin-top:'.concat(e,'px"'):"",'><div>Week</div><div class="on">Month</div><div>Year</div></div>'),S=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=!(arguments.length>2)||void 0===arguments[2]||arguments[2];return'<div class="bars" style="height:'.concat(e,'px">').concat(w.map((e,a)=>'<div><i style="height:'.concat(Math.round(e*t),'px"></i>').concat(n?"W".concat(a+1):"","</div>")).join(""),"</div>")},C=(e,t,n)=>'<div class="mini" style="width:'.concat(t,"px;height:").concat(n,'px">').concat(e.map(e=>'<i style="height:'.concat(Math.max(2,Math.round(e/100*n)),'px"></i>')).join(""),"</div>"),M=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:y,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:44;return e.map(e=>'<div class="cell" style="height:'.concat(t,'px"><span>').concat(e.name,'</span><b class="').concat(e.paused?"p":"",'">').concat(e.streak,"</b></div>")).join("")},z=["var(--fill)","rgba(0,104,218,.3)","rgba(0,104,218,.6)","var(--tint)"];"".concat(k()).concat(N(),'\n<div class="card" style="margin-top:20px;height:206px;padding:16px 20px;position:relative"><div class="num">84%</div><div class="cap">of check-ins done in November</div>\n<div style="position:absolute;left:20px;right:20px;bottom:14px">').concat(S(80),'</div></div>\n<div class="hd">Current streaks</div><div class="card">').concat(M(),"</div>"),"".concat(k()).concat(N(),'\n<div class="hd" style="margin-top:20px">Current streaks</div>\n<div class="card">').concat(y.map(e=>'<div class="cell" style="height:58px"><span style="display:flex;flex-direction:column"><span>'.concat(e.name,'</span><span class="l2" style="font-size:13px;line-height:18px">').concat(e.month,'% this month</span></span><b class="').concat(e.paused?"p":"",'">').concat(e.streak,"</b></div>")).join(""),'</div>\n<div class="hd">November</div>\n<div class="card" style="display:flex;align-items:flex-end;gap:20px;padding:14px 20px"><div><div style="font-size:34px;line-height:41px;font-weight:600;font-variant-numeric:tabular-nums">84%</div><div class="cap">of check-ins done</div></div><div style="flex:1">').concat(S(60,.55,!1),"</div></div>"),"".concat(k(!1)).concat(N(),'\n<div class="num" style="margin-top:32px;font-size:76px;line-height:80px">84%</div><div class="cap" style="font-size:17px;line-height:22px">of check-ins done in November</div>\n<div style="margin-top:28px">').concat(S(124,1.25),'</div>\n<div class="card" style="margin-top:28px">').concat(M(),"</div>"),"".concat(k()).concat(N(),'\n<div class="card" style="margin-top:20px;display:flex;align-items:flex-end;gap:20px;padding:16px 20px"><div><div class="num" style="font-size:44px;line-height:48px">84%</div><div class="cap">of check-ins<br>in November</div></div><div style="flex:1">').concat(S(72,.75,!1),'</div></div>\n<div style="margin-top:12px;display:grid;grid-template-columns:1fr 1fr;gap:12px">').concat(j.map(e=>'<div class="card" style="padding:14px 16px"><div class="l2" style="font-size:15px;line-height:20px">'.concat(e.name,'</div><div style="margin-top:4px;font-size:22px;line-height:28px;font-weight:600;font-variant-numeric:tabular-nums">').concat(e.streak,'</div><div class="l2" style="font-size:13px;line-height:18px">').concat(e.month,"% this month</div></div>")).join(""),'</div>\n<div class="card" style="margin-top:12px"><div class="cell"><span>Run</span><b class="p">Paused, 9 days</b></div></div>'),"".concat(k()).concat(N(),'\n<div class="card" style="margin-top:20px;padding:4px 0">\n<div style="display:grid;grid-template-columns:1fr 92px 44px 60px;gap:8px;align-items:center;height:32px;padding:0 16px 0 20px;font-size:13px;line-height:18px" class="l2"><span>Habit</span><span>Streak</span><span>Month</span><span>Weeks</span></div>\n').concat(y.map(e=>'<div class="cell" style="display:grid;grid-template-columns:1fr 92px 44px 60px;gap:8px;height:40px;padding-right:16px;font-size:15px"><span>'.concat(e.name,'</span><span class="').concat(e.paused?"p":"l2",'">').concat(e.short,'</span><span class="l2" style="font-variant-numeric:tabular-nums">').concat(e.month,"%</span>").concat(C(e.weeks,60,18),"</div>")).join(""),'\n<div class="cell" style="display:grid;grid-template-columns:1fr 92px 44px 60px;gap:8px;height:40px;padding-right:16px;font-size:15px;font-weight:600"><span>All habits</span><span></span><span style="font-variant-numeric:tabular-nums">84%</span>').concat(C(w.map(e=>e/62*100),60,18),"</div>\n</div>"),"".concat(k()).concat(N(),'\n<div style="margin-top:20px;display:flex;flex-direction:column;gap:10px">').concat(y.map(e=>'<div class="card" style="display:flex;align-items:center;gap:16px;padding:12px 16px 12px 20px"><div style="flex:1"><div style="font-weight:600">'.concat(e.name,'</div><div class="').concat(e.paused?"p":"l2",'" style="font-size:15px;line-height:20px">').concat(e.streak,"</div></div>").concat(C(e.weeks,72,30),'<div class="l2" style="width:40px;text-align:right;font-size:15px;font-variant-numeric:tabular-nums">').concat(e.month,"%</div></div>")).join(""),'</div>\n<div class="hd">November</div>\n<div class="card"><div class="cell"><span>All habits</span><b>84% of check-ins</b></div></div>'),"".concat(k()).concat(N(),'\n<div class="card" style="margin-top:20px;padding:14px 16px 16px">\n<div style="display:flex;justify-content:space-between;align-items:baseline"><span style="font-weight:600">November</span><span class="l2" style="font-size:15px">84% of check-ins</span></div>\n<div class="l2" style="margin-top:10px;display:grid;grid-template-columns:repeat(7,1fr);gap:5px;text-align:center;font-size:11px;line-height:13px"><span>M</span><span>T</span><span>W</span><span>T</span><span>F</span><span>S</span><span>S</span></div>\n<div style="margin-top:6px;display:grid;grid-template-columns:repeat(7,1fr);grid-auto-rows:24px;gap:5px">').concat([...Array(6).fill("transparent"),...[3,3,2,3,3,1,3,3,3,2,3,3,0,2,3,3,3,3,2,3,1,3,3,3,2,3,2,0,0,0].map((e,t)=>t>=27?"rgba(120,120,128,.06)":z[e])].map(e=>'<i style="border-radius:6px;background:'.concat(e,'"></i>')).join(""),'</div>\n</div>\n<div class="hd">Current streaks</div><div class="card">').concat(M(y,38),"</div>"),"".concat(k()).concat(N(),'\n<div class="card" style="margin-top:20px;display:flex;align-items:flex-end;gap:20px;padding:16px 20px"><div><div class="num" style="font-size:44px;line-height:48px">84%</div><div class="cap">of check-ins<br>in November</div></div><div style="flex:1">').concat(S(80,.9),'</div></div>\n<div class="hd">Going</div><div class="card">').concat(M(j),'</div>\n<div class="hd">Paused</div><div class="card"><div class="cell"><span>Run</span><b class="p">9 days</b></div></div>');var R=n(26022);let E={items:[],pending:0,running:!1,failed:null,ranges:null,pick:null,parent:null},A=e=>!!e&&"blank"!==e.kind&&e.version>0;function P(e,t){let n=A(t),a=null==t?void 0:t.id,i="".concat(e,"/").concat(a),[r,l]=(0,s.useState)({key:"",data:E}),o=r.key===i?r.data:E,c=(0,s.useCallback)(e=>l({key:i,data:e}),[i]),[d,u]=(0,s.useState)(()=>Date.now()),[p,h]=(0,s.useState)(""),m=(0,s.useCallback)(async()=>{let t=await fetch("/api/studio/variants?project=".concat(e,"&screen=").concat(a),{cache:"no-store"}).catch(()=>null);(null==t?void 0:t.ok)&&c(await t.json())},[e,a,c]);(0,s.useEffect)(()=>{n&&m()},[n,m]);let g=o.running||o.pending>0;(0,s.useEffect)(()=>{if(!g)return;let e=setInterval(()=>"visible"===document.visibilityState&&void m(),2e3);return()=>clearInterval(e)},[g,m]);let f=o.items.some(e=>e.readyAt>d);return(0,s.useEffect)(()=>{if(!f)return;let e=setInterval(()=>u(Date.now()),150);return()=>clearInterval(e)},[f]),{on:n,data:o,now:d,error:p,send:(0,s.useCallback)(async t=>{var n,s,i;h("");let r=await fetch("/api/studio/variants",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project:e,screen:a,...t})}).then(e=>e.json()).catch(()=>({error:"Couldn't reach Playground."}));return r.error?(h(r.error),null):(u(Date.now()),c({items:r.items,pending:r.pending,running:r.running,failed:r.failed,ranges:null!=(n=r.ranges)?n:null,pick:null!=(s=r.pick)?s:null,parent:null!=(i=r.parent)?i:null}),r)},[e,a,c])}}function I(e){let[t,n]=(0,s.useState)({});return(0,s.useEffect)(()=>{let t=()=>fetch("/api/studio/variants?project=".concat(e),{cache:"no-store"}).then(e=>e.json()).then(e=>e.counts&&n(e.counts)).catch(()=>{});t();let a=setInterval(()=>"visible"===document.visibilityState&&void t(),5e3);return()=>clearInterval(a)},[e]),t}function O(){let[e,t]=(0,s.useState)({});return(0,s.useEffect)(()=>{let e=()=>fetch("/api/studio/variants",{cache:"no-store"}).then(e=>e.json()).then(e=>e.all&&t(e.all)).catch(()=>{});e();let n=setInterval(()=>"visible"===document.visibilityState&&void e(),6e3);return()=>clearInterval(n)},[]),e}function D(e){let{slug:t,screen:n,device:i,variant:r,scale:l,className:o,picture:c}=e,d=null!=i?i:(0,h.XA)(n)[0],u=(0,f.Q5)(),{mode:p}=(0,m.b)(),{w:g,h:v}=h.et[d],[b,y]=(0,s.useState)(!1),w="/api/studio/variants?project=".concat(t,"&screen=").concat(n.id,"&variant=").concat(r,"&mode=").concat(p);return(0,a.jsx)("div",{"aria-hidden":!0,className:(0,x.cn)("relative overflow-hidden bg-bg-content",o),style:{width:g*l,height:v*l},children:(0,a.jsx)("div",{className:"pointer-events-none absolute left-0 top-0 origin-top-left",style:{width:g,height:v,transform:"scale(".concat(l,")")},children:r&&c&&!b?(0,a.jsx)("img",{src:"".concat(w,"&shot=").concat(d),alt:"",draggable:!1,decoding:"async",onError:()=>y(!0),className:"block select-none",style:{width:g,height:v}}):r?null!==u&&(0,a.jsx)("iframe",{src:"".concat(u).concat(w),sandbox:(0,f.Xq)(u),tabIndex:-1,title:"",className:"block border-0",style:{width:g,height:v}}):(0,a.jsx)(h.ScreenRender,{screen:n,device:d})})})}function T(e,t,n){let a=e*n;return{x:t*Math.sin(a),y:t*(1-Math.cos(a)),deg:180*a*.55/Math.PI}}let W=(e,t,n)=>2*Math.asin(Math.min(.9,(e+t)/(2*n)));function B(e){let{slug:t,screen:n,device:s,variants:i,width:r,height:l,onOpen:o}=e,{data:c,now:d}=i,u=c.items.filter(e=>!e.parent),m=u.filter(e=>e.readyAt<=d),g=u.length-m.length+(c.parent?0:c.pending);if(!m.length&&!g)return null;let{w:f,h:x}=h.et[s],v=R.Qe[s],b=Math.round(l*("desktop"===s?1.45:1)),y=Math.max(900,Math.min(1600,r)),w=W(b,.35*b,y),j=Math.min(5,m.length+g),k=m.slice(0,j),N=m.length+g-j,S=b/(f+2*v.bezel),C={w:f*S,h:x*S,s:S},M="".concat((v.bezel+v.bar)*S,"px ").concat(v.bezel*S,"px ").concat(v.bezel*S,"px"),z=Array.from({length:j},(e,t)=>t%2?(t+1)/2:-t/2),E="".concat(m.length," ").concat(1===m.length?"variant":"variants"," of ").concat(n.name).concat(g?", ".concat(g," drawing"):""),A=T(Math.max(...z.map(Math.abs)),y,w);return(0,a.jsxs)("button",{type:"button",onClick:o,"aria-label":"Show the ".concat(E),title:E,className:"group/peek relative block cursor-pointer overflow-hidden text-left outline-hidden focus-visible:ring-2 focus-visible:ring-ring",style:{width:r,height:l,maskImage:"linear-gradient(to bottom, black 40%, transparent)"},children:[z.map((e,i)=>{var l,o;return(0,a.jsx)("span",{className:"absolute block origin-top transition-transform duration-quick group-hover/peek:-translate-y-1",style:{...(e=>{let t=T(e,y,w),n=(e=>{let t=Math.abs(e);return{s:1-.14*Math.min(t,2.5),o:t<=1?1-.15*t:Math.max(0,.85-.6*(t-1))}})(e);return{left:r/2+t.x-b/2,top:12+t.y,transform:"rotate(".concat(t.deg,"deg) scale(").concat(n.s,")"),opacity:n.o,zIndex:10-2*Math.abs(e)}})(e),padding:M},children:(0,a.jsx)(R.KE,{device:s,box:C,children:k[i]?(0,a.jsx)(D,{slug:t,screen:n,device:s,variant:k[i].id,scale:S,className:"absolute inset-0",picture:!0}):(0,a.jsx)("span",{className:"absolute inset-0 grid place-items-center hatch",children:(0,a.jsx)(p.q,{state:"drawing",className:"size-5 text-agent-work"})})})},null!=(o=null==(l=k[i])?void 0:l.id)?o:"p".concat(i))}),N>0&&(0,a.jsxs)("span",{className:"absolute grid h-6 place-items-center rounded-control bg-fill-control px-2 text-sm text-fg-secondary",style:{left:r/2+A.x+b/2+12,top:12+A.y+16},children:["+",N]})]})}function F(e){var t,n,m,f,y,w,j,k;let{slug:N,screen:S,device:C,variants:M,room:z,phone:E,onClose:A,open:P=!0}=e,{refresh:I}=(0,g.Q)(),{data:O,now:B,error:F,send:L}=M,[q,$]=(0,s.useState)(null),J=(0,s.useRef)(void 0),H=(0,s.useRef)(()=>{}),[U,K]=(0,s.useState)(null),Q=q?O.items.filter(e=>e.id!==q.id):O.items,X=Q.filter(e=>{var t;return(null!=(t=e.parent)?t:null)===U}),V=U&&null!=(f=O.items.find(e=>e.id===U))?f:null;(0,s.useEffect)(()=>{U&&!O.items.some(e=>e.id===U)&&K(null)},[U,O.items]);let G=(null!=(y=O.parent)?y:null)===U?O.pending:0,_=(0,s.useRef)(!1),Y=e=>e.readyAt<=B,[Z,ee]=(0,s.useState)(null),[et,en]=(0,s.useState)({}),[ea,es]=(0,s.useState)(""),[ei,er]=(0,s.useState)(!1),[el,eo]=(0,s.useState)(null),ec=e=>{if(ei&&el===e)return er(!1);eo(e),er(!0)},[ed,eu]=(0,s.useState)(""),ep=(0,s.useRef)(X.length),[eh,em]=(0,s.useState)(!1);(0,s.useEffect)(()=>em(!0),[]);let{w:eg,h:ef}=h.et[C],ex=null!=(w=X.find(e=>e.id===Z&&Y(e)))?w:null,ev=X.filter(e=>!Y(e)).length+G,eb=ev>0||O.running,ey=X.filter(Y).map(e=>e.id);(0,s.useEffect)(()=>{let e=X.filter(Y);if(e.length>ep.current&&ep.current>=0){var t,n,a,s;_.current||ee(null!=(s=null!=(a=null==(t=e[ep.current])?void 0:t.id)?a:null==(n=e.at(-1))?void 0:n.id)?s:null),ep.current=-1}else!e.some(e=>e.id===Z)&&e.length&&ee(e[0].id)});let ew=async()=>{let e=b.map((e,t)=>void 0!==et[t]?[et[t],et[t]]:[0,2]);await L({action:"draw",ranges:e,count:4,text:ea,...el?{from:el}:{}})&&(ep.current=O.items.filter(e=>{var t;return(null!=(t=e.parent)?t:null)===el&&Y(e)}).length,_.current=!1,K(el),es(""),er(!1))},ej=e=>Q.filter(t=>t.parent===e).length+(O.parent===e?O.pending:0);(0,s.useEffect)(()=>{var e;null==(e=e3.current)||e.scrollTo({top:0})},[U]);let ek=()=>{var e;if(!V)return A();er(!1),ee(V.id),K(null!=(e=V.parent)?e:null)};(0,s.useEffect)(()=>()=>H.current(),[]);let eN=async()=>{eu("keep"),await L({action:"keep"})&&A(),eu("")},eS=async e=>{eu("use"),await L({action:"use",id:e.id})&&(await I(),A()),eu("")};(0,s.useEffect)(()=>{let e=e=>{if(e.target.closest("input, textarea, [role=slider], [role=menu]"))return;let t=Z?ey.indexOf(Z):-1;if("ArrowRight"===e.key||"ArrowLeft"===e.key){let n=t+("ArrowRight"===e.key?1:-1),a=ey[Math.max(0,Math.min(ey.length-1,n))];_.current=!0,a&&ee(a)}else if(("Backspace"===e.key||"Delete"===e.key)&&ex)(e=>{var t,n;let a=X.findIndex(t=>t.id===e.id),s=X.filter(t=>t.id!==e.id&&Y(t));H.current(),$(e),ee(null!=(n=null==(t=s[Math.min(a,s.length-1)])?void 0:t.id)?n:null);let i=()=>{clearTimeout(J.current),H.current=()=>{},L({action:"cut",id:e.id}).then(()=>$(t=>(null==t?void 0:t.id)===e.id?null:t))};H.current=i,J.current=setTimeout(i,5e3)})(ex);else{if("Escape"!==e.key&&"ArrowUp"!==e.key)return;ek()}e.preventDefault()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)});let eC=R.Qe[C],eM=Math.min(Math.max(140,Math.min(E?420:"desktop"===C?900:560,z.h-96-40))*(eg+2*eC.bezel)/(ef+2*eC.bezel+eC.bar),E?z.w-64:"desktop"===C?.62*z.w:340),ez=eM/(eg+2*eC.bezel),eR={w:eg*ez,h:ef*ez,s:ez},eE=(ef+2*eC.bezel+eC.bar)*ez,eA="".concat((eC.bezel+eC.bar)*ez,"px ").concat(eC.bezel*ez,"px ").concat(eC.bezel*ez,"px"),eP=[...X.map(e=>({key:e.id,it:e})),...Array.from({length:G},(e,t)=>({key:"pending-".concat(t),it:null}))],eI=Math.max(4*eM,Math.min(1800,1.1*z.w)),eO=W(eM,.12*eM+(E?16:32),eI),eD=Math.max(0,eP.findIndex(e=>e.it&&e.it.id===Z)),eT=eP.length,eW=(0,s.useRef)((0,v.oz)(eD)),eB=(0,s.useRef)(new Map),eF=(0,s.useRef)(null),eL=(0,s.useRef)(0),[eq,e$]=(0,s.useState)(eD),eJ=(0,s.useRef)(eD),eH=(0,s.useCallback)(()=>{let e=eW.current.x;eP.forEach((t,n)=>{let{key:a}=t,s=eB.current.get(a);if(!s)return;let i=n-e,r=T(i,eI,eO),l=(e=>{let t=Math.abs(e);return{s:1-.1*Math.min(t,4),o:t<=1?1-.15*t:Math.max(0,.85-.3*(t-1))}})(i);s.style.transform="translate(".concat(z.w/2+r.x-eM/2,"px, ").concat(40+r.y,"px) rotate(").concat(r.deg,"deg) scale(").concat(l.s,")"),s.style.opacity=String(l.o),s.style.zIndex=String(20-Math.round(2*Math.abs(i))),s.style.pointerEvents=l.o<.3?"none":""});let t=eT?(Math.round(e)%eT+eT)%eT:0;t!==eJ.current&&(eJ.current=t,e$(t)),eF.current&&(eF.current.style.opacity=String(Math.max(0,1-2.5*Math.abs(e-Math.round(e)))))},[eP,eI,eO,z.w,eM,eT]);(0,s.useLayoutEffect)(()=>eH());let eU=(0,s.useRef)(!1),eK=(0,s.useRef)(void 0),eQ=(0,s.useCallback)(()=>{cancelAnimationFrame(eL.current),clearTimeout(eK.current);let e=performance.now(),t=n=>{let a=Math.min(.05,Math.max(0,(n-e)/1e3));e=n;let s=eU.current||(0,v.PM)(eW.current,a);eH(),(eU.current||!s)&&(eL.current=requestAnimationFrame(t))};eL.current=requestAnimationFrame(t),eU.current||(eK.current=setTimeout(()=>{eU.current||(cancelAnimationFrame(eL.current),eW.current.x=eW.current.to,eW.current.v=0,eH())},1400))},[eH]);(0,s.useEffect)(()=>()=>{cancelAnimationFrame(eL.current),clearTimeout(eK.current)},[]);let eX=(0,s.useRef)(U);(0,s.useEffect)(()=>{let e=eW.current;if(eX.current!==U){eX.current=U,e.x=e.to=eD,e.v=0,eH();return}let t=eD-e.to;.001>Math.abs(t)||(e.to+=t,e.r=Math.abs(t)>1.5?v.Cf.gentle:v.Cf.smooth,eQ())},[eD,!1,eT,U]);let eV=(0,s.useRef)(new v.Hp),eG=(0,s.useRef)(new v.JD),e_=(0,s.useRef)(0),eY=(0,s.useRef)(0),eZ=(0,s.useRef)(void 0),e0=()=>Math.max(1,eI*eO),e1=e=>{let t=eW.current;eU.current=!0,_.current=!0,eY.current=Math.round(t.to),t.v=0,t.to=t.x,e_.current=t.x,eG.current.reset(e,t.x),eQ()},e2=(e,t)=>{let n=eW.current;e_.current=e,eG.current.add(t,e),n.x=n.to=e<0?(0,v.VJ)(e,.4):e>eT-1?eT-1+(0,v.VJ)(e-(eT-1),.4):e,eH()},e5=e=>{var t;if(!eU.current)return;eU.current=!1;let n=eW.current,a=eG.current.speed(e),s=Math.round((0,v.Cv)(n.x,a)),i=null==(t=eP[((s=Math.max(0,Math.min(eT-1,s)))%eT+eT)%eT])?void 0:t.it;i&&Y(i)||(s=n.x+(eD-n.x)),n.to=Math.round(s),n.v=a,n.r=v.Cf.smooth,i&&Y(i)&&i.id!==Z&&ee(i.id),eQ()},e4=(0,s.useRef)(null),e6=(0,s.useRef)(!1),e8=e=>{let t=e4.current;t&&e.pointerId===t.id&&(e4.current=null,t.on&&(e6.current=!0,setTimeout(()=>e6.current=!1,0),e5(e.timeStamp)))},e3=(0,s.useRef)(null),e7=(0,s.useRef)(null),e9=(0,s.useRef)(null),te=(0,s.useRef)((0,v.oz)(0,v.Cf.snappy)),tt=(0,s.useRef)({ty:0,k:1}),tn=(0,s.useRef)(0),ta=(0,s.useCallback)(()=>{let e=e9.current;if(!e)return;let t=te.current.x,{ty:n,k:a}=tt.current;e.style.transformOrigin="50% ".concat(40,"px");let s=1-(1-a)*t;e.style.transform=t?"translateY(".concat((n*t).toFixed(1),"px) scale(").concat(s.toFixed(4),")"):"",eF.current&&(eF.current.style.transformOrigin="50% 0",eF.current.style.transform=t?"scale(".concat((1/s).toFixed(4),")"):"")},[]);(0,s.useLayoutEffect)(()=>{let e=e3.current,t=e7.current;if(ei&&e&&t){var n,a;let s=e.getBoundingClientRect().top,i=t.getBoundingClientRect().top,r=null!=(a=null==(n=eF.current)?void 0:n.offsetHeight)?a:0,l=s+40;l+(eE+12+r)>i-16?(tt.current={ty:-32,k:Math.max(.4,Math.min(1,(i-16-(l+-32)-r)/(eE+12)))},te.current.to=1):te.current.to=0}else te.current.to=0;cancelAnimationFrame(tn.current);let s=performance.now(),i=e=>{let t=Math.min(.05,Math.max(0,(e-s)/1e3));s=e;let n=(0,v.PM)(te.current,t,.001);ta(),n||(tn.current=requestAnimationFrame(i))};return tn.current=requestAnimationFrame(i),()=>cancelAnimationFrame(tn.current)},[ei,eE,z.h]);let ts=eh&&P&&(0,i.createPortal)((0,a.jsxs)("div",{className:"pointer-events-none fixed inset-x-0 bottom-0 z-40 flex flex-col items-center gap-2 px-4 pb-5",children:[(F||O.failed)&&(0,a.jsx)(d.vB,{danger:!0,className:"pointer-events-auto rounded-item bg-bg-floating px-3 py-1.5 shadow-float",children:F||O.failed}),q&&(0,a.jsxs)("div",{role:"status",className:(0,x.cn)(u.LJ,"pointer-events-auto flex items-center gap-1 p-1.5"),children:[(0,a.jsxs)("span",{className:"truncate px-2 text-sm text-fg-secondary",children:["Cut ",q.name]}),(0,a.jsx)(l.$,{size:"sm",variant:"ghost",onClick:()=>{clearTimeout(J.current),H.current=()=>{},q&&ee(q.id),$(null)},className:"shrink-0",children:"Undo"})]}),ei&&!eb&&(0,a.jsxs)("div",{ref:e7,role:"dialog","aria-label":"Create variants of ".concat(el&&(null==(t=O.items.find(e=>e.id===el))?void 0:t.name)||S.name),className:(0,x.cn)(u.LJ,"pointer-events-auto grid w-xl max-w-full gap-3 p-3"),children:[(0,a.jsx)(o.T,{autoFocus:!0,value:ea,onChange:e=>es(e.target.value),rows:2,placeholder:"What should change","aria-label":"What should change",className:"min-h-16 resize-none"}),(0,a.jsx)("div",{className:"grid gap-2",children:b.map((e,t)=>"project"in e&&e.project!==N?null:(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("span",{className:"w-24 shrink-0 text-sm text-fg-secondary",children:e.name}),(0,a.jsxs)(c.O,{type:"single",size:"sm",value:void 0===et[t]?"any":String(et[t]),onValueChange:e=>e&&en(n=>"any"===e?Object.fromEntries(Object.entries(n).filter(e=>{let[n]=e;return Number(n)!==t})):{...n,[t]:Number(e)}),"aria-label":e.name,className:"min-w-0 overflow-x-auto scrollbar-none",children:[(0,a.jsx)(c.d,{value:"any",children:"Any"}),e.stops.map((e,t)=>(0,a.jsx)(c.d,{value:String(t),children:e},e))]})]},e.id))}),(0,a.jsxs)("div",{className:"flex justify-end gap-1",children:[(0,a.jsx)(l.$,{size:"sm",variant:"ghost",onClick:()=>er(!1),children:"Cancel"}),(0,a.jsxs)(l.$,{size:"sm",variant:"accent",disabled:!!ed,onClick:()=>void ew(),children:["Create ",4," variants"]})]})]}),(0,a.jsxs)("div",{className:(0,x.cn)(u.LJ,"pointer-events-auto flex max-w-full items-center gap-1 overflow-x-auto p-1.5 scrollbar-none"),children:[(0,a.jsxs)(l.$,{size:"sm",variant:"ghost",onClick:ek,"aria-label":E?"Back to ".concat(null!=(j=null==V?void 0:V.name)?j:S.name):void 0,className:"shrink-0",children:[(0,a.jsx)(r.Z,{}),!E&&(null!=(k=null==V?void 0:V.name)?k:S.name)]}),!E&&(0,a.jsx)("span",{"aria-hidden":!0,className:"mx-1 h-4 w-px shrink-0 bg-border-divider"}),X.length>0?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(l.$,{size:"sm",variant:"ghost",disabled:!!ed,onClick:()=>void eN(),className:"shrink-0",children:"keep"===ed?(0,a.jsx)(d.vB,{status:"drawing",children:"Keeping it"}):"Keep version ".concat(S.version)}),ex&&(0,a.jsx)(l.$,{size:"sm",variant:ei?"ghost":"accent",disabled:!!ed,onClick:()=>void eS(ex),className:"shrink-0",children:"use"===ed?(0,a.jsx)(d.vB,{status:"drawing",children:"Using it"}):E?"Use this":"Use ".concat(ex.name)}),(0,a.jsx)("span",{"aria-hidden":!0,className:"mx-1 h-4 w-px shrink-0 bg-border-divider"}),eb?(0,a.jsx)(d.vB,{status:"drawing",className:"shrink-0 px-2",children:1===ev?"Drawing the last one":ev>1?"Drawing ".concat(ev):"Finishing"}):(0,a.jsx)(l.$,{size:"sm",variant:"ghost","aria-pressed":ei&&el===U,onClick:()=>ec(U),className:(0,x.cn)("shrink-0",ei&&el===U&&"bg-fill-selected text-fg-primary"),children:"Create more"})]}):eb?(0,a.jsx)(d.vB,{status:"drawing",className:"shrink-0 px-2",children:1===ev?"Drawing the last one":ev>1?"Drawing ".concat(ev):"Finishing"}):(0,a.jsx)(l.$,{size:"sm",variant:ei?"ghost":"accent","aria-pressed":ei,disabled:!!ed,onClick:()=>ec(U),className:(0,x.cn)("shrink-0",ei&&"bg-fill-selected text-fg-primary"),children:"Create variants"})]})]}),document.body),ti=!eP.length&&!eb,tr=(0,s.useRef)(!1);if((0,s.useEffect)(()=>{ti&&!tr.current&&(tr.current=!0,eo(U),er(!0))},[ti,U]),!eP.length)return(0,a.jsx)("section",{"aria-label":"Variants of ".concat(S.name),"data-branch":!0,className:"relative size-full",children:ts});let tl=null==(n=eP[eq])?void 0:n.it,to=!!tl&&(null==(m=O.pick)?void 0:m.id)===tl.id;return(0,a.jsxs)("section",{ref:e3,"aria-label":"Variants of ".concat(S.name),"data-branch":!0,onWheel:e=>{if(Math.abs(e.deltaX)<=Math.abs(e.deltaY))return;let t=eV.current.feed(e.deltaX,e.timeStamp);if("coast"!==t){if((0,v.HV)(t,e.deltaX)){eV.current.stepped=!0,_.current=!0;let t=eD+Math.sign(e.deltaX),n=ey[Math.max(0,Math.min(ey.length-1,t))];n&&ee(n);return}if("start"!==t&&eU.current||e1(e.timeStamp),e2(e_.current+e.deltaX/e0(),e.timeStamp),clearTimeout(eZ.current),eV.current.lifted)eV.current.release(),e5(e.timeStamp);else{let t;eZ.current=setTimeout((t=e.timeStamp,()=>{eV.current.release(),e5(t)}),100)}}},onPointerDown:e=>{0!==e.button||e.target.closest("[data-info]")||(e4.current={id:e.pointerId,x0:e.clientX,y0:e.clientY,from:0,on:!1})},onPointerMove:e=>{let t=e4.current;if(!t||e.pointerId!==t.id)return;let n=e.clientX-t.x0,a=e.clientY-t.y0;if(!t.on){if(8>Math.hypot(n,a))return;if(Math.abs(a)>Math.abs(n)){e4.current=null;return}t.on=!0,t.x0=e.clientX,e.currentTarget.setPointerCapture(e.pointerId),e1(e.timeStamp),t.from=e_.current;return}e2(t.from-(e.clientX-t.x0)/e0(),e.timeStamp)},onPointerUp:e8,onPointerCancel:e8,onClickCapture:e=>e6.current&&(e.stopPropagation(),e.preventDefault()),className:(0,x.cn)("relative size-full touch-pan-y select-none",E?"overflow-y-auto overflow-x-hidden pb-28 scrollbar-none":"overflow-hidden"),children:[(0,a.jsxs)("div",{ref:e9,className:"relative will-change-transform",style:{height:E?40+eE+96+40:"100%"},children:[eP.map(e=>{let{key:t,it:n}=e,s=!!n&&n.id===Z;return(0,a.jsx)("div",{ref:e=>void(e?eB.current.set(t,e):eB.current.delete(t)),className:"absolute left-0 top-0 origin-top will-change-transform",style:{width:eM},children:n&&Y(n)?(0,a.jsx)("button",{type:"button","aria-pressed":s,"aria-label":n.name,title:s?"Backspace cuts it":void 0,onClick:()=>(_.current=!0,ee(n.id)),className:(0,x.cn)("block rounded-panel outline-hidden focus-visible:ring-2 focus-visible:ring-ring",!s&&"cursor-pointer"),style:{padding:eA},children:(0,a.jsx)(R.KE,{device:C,box:eR,children:(0,a.jsx)(D,{slug:N,screen:S,device:C,variant:n.id,scale:ez,className:"forming absolute inset-0",picture:!0})})}):(0,a.jsx)("span",{className:"block",style:{padding:eA},children:(0,a.jsx)(R.KE,{device:C,box:eR,children:(0,a.jsx)("span",{className:"absolute inset-0 grid place-items-center hatch",children:(0,a.jsx)(p.q,{state:"drawing",className:"size-5 text-agent-work"})})})})},t)}),tl&&Y(tl)&&(0,a.jsxs)("div",{ref:eF,"data-info":!0,className:"absolute flex flex-col items-center gap-2",style:{left:z.w/2-Math.max(eM,280)/2,top:40+eE+12,width:Math.max(eM,280)},children:[(0,a.jsx)("span",{className:"max-w-full truncate text-ui font-medium text-fg-primary",children:tl.name}),(0,a.jsxs)("span",{className:"flex items-center gap-2",children:[(0,a.jsxs)("span",{className:"text-sm text-fg-secondary tabular-nums",children:[ey.indexOf(tl.id)+1," of ",ey.length]}),ej(tl.id)>0?(0,a.jsxs)(l.$,{size:"sm",variant:"ghost",onClick:()=>{var e;return e=tl.id,void(er(!1),ee(null),K(e))},children:[ej(tl.id)," ",1===ej(tl.id)?"variant":"variants"]}):!eb&&(0,a.jsx)(l.$,{size:"sm",variant:"ghost","aria-pressed":ei&&el===tl.id,onClick:()=>ec(tl.id),className:(0,x.cn)(ei&&el===tl.id&&"bg-fill-selected text-fg-primary"),children:"Create variants"})]}),to&&O.pick&&(0,a.jsxs)("span",{className:"flex gap-1.5 text-sm text-pretty text-fg-secondary",children:[(0,a.jsx)(p.q,{state:"waiting",className:"mt-0.5 size-3 shrink-0 text-agent-wait"}),(0,a.jsxs)("span",{children:["My pick: ",O.pick.why]})]})]})]}),ts]})}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[876],{5496:(e,t,l)=>{l.d(t,{GO:()=>w,MarksView:()=>v,oc:()=>g});var s=l(95155),n=l(12115),a=l(64245),i=l(81961),r=l(2914),c=l(78016),o=l(3278),d=l(68772),u=l(70921),m=l(68515),h=l(46508),x=l(80526),p=l(50645);let f="var(--bl-white)";function g(e){let{width:t,height:l,scale:a,tool:i,marks:r,onAdd:c}=e,o=(0,n.useRef)(null),[d,u]=(0,n.useState)(null),[m,h]=(0,n.useState)(null),p=e=>{let t=o.current.getBoundingClientRect();return[(e.clientX-t.left)/a,(e.clientY-t.top)/a]},g=e=>{m&&e.trim()&&c({id:"m".concat(Date.now()),kind:"text",size:16/a,x:m.x,y:m.y,text:e.trim()}),h(null)};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("svg",{ref:o,"data-markup":!0,width:t,height:l,className:(0,x.cn)("absolute left-0 top-0 overflow-visible touch-none","text"===i?"cursor-text":"cursor-crosshair"),onPointerDown:e=>{if(0!==e.button)return;let[t,l]=p(e);if("text"===i){e.preventDefault(),h({x:t,y:l});return}e.currentTarget.setPointerCapture(e.pointerId);let s="m".concat(Date.now());u("pen"===i?{id:s,kind:"pen",w:3/a,pts:[[t,l]]}:{id:s,kind:"box",w:3/a,x:t,y:l,bw:0,bh:0})},onPointerMove:e=>{if(!d)return;let[t,l]=p(e);if("pen"===d.kind){let[e,s]=d.pts[d.pts.length-1];Math.hypot(t-e,l-s)*a>=2&&u({...d,pts:[...d.pts,[t,l]]})}else"box"===d.kind&&u({...d,bw:t-d.x,bh:l-d.y})},onPointerUp:()=>{d&&(("pen"===d.kind?d.pts.length>1:"box"===d.kind&&Math.abs(d.bw)*a>6&&Math.abs(d.bh)*a>6)&&c("box"===d.kind?{...d,x:Math.min(d.x,d.x+d.bw),y:Math.min(d.y,d.y+d.bh),bw:Math.abs(d.bw),bh:Math.abs(d.bh)}:d),u(null))},onPointerCancel:()=>u(null),children:[...r,...d?[d]:[]].map(e=>(0,s.jsx)(j,{m:e},e.id))}),m&&(0,s.jsx)("input",{"data-markup-input":!0,autoFocus:!0,"aria-label":"Note on the canvas",placeholder:"Type a note",onKeyDown:e=>{"Enter"===e.key&&g(e.currentTarget.value),"Escape"===e.key&&(e.stopPropagation(),h(null))},onBlur:e=>g(e.currentTarget.value),className:"absolute origin-top-left bg-transparent font-medium outline-hidden placeholder:text-fg-meta",style:{left:m.x,top:m.y-12/a,transform:"scale(".concat(1/a,")"),fontSize:16,color:f,width:280}})]})}function v(e){let{width:t,height:l,marks:n}=e;return(0,s.jsx)("svg",{"aria-label":"Mark-up for Claude",role:"img",width:t,height:l,className:"pointer-events-none absolute left-0 top-0 overflow-visible",children:n.map(e=>(0,s.jsx)(j,{m:e},e.id))})}function j(e){let{m:t}=e;return"pen"===t.kind?(0,s.jsx)("polyline",{points:t.pts.map(e=>e.join(",")).join(" "),fill:"none",stroke:f,strokeWidth:t.w,strokeLinecap:"round",strokeLinejoin:"round"}):"box"===t.kind?(0,s.jsx)("rect",{x:t.x,y:t.y,width:t.bw,height:t.bh,rx:1.5*t.w,fill:"none",stroke:f,strokeWidth:t.w}):(0,s.jsx)("text",{x:t.x,y:t.y,fontSize:t.size,fontWeight:500,fill:f,stroke:"oklch(0 0 0 / 60%)",strokeWidth:t.size/8,paintOrder:"stroke",dominantBaseline:"middle",children:t.text})}let b=[{id:"pen",label:"Draw",Icon:a.h,key:"P"},{id:"box",label:"Box",Icon:i.M,key:"R"},{id:"text",label:"Note",Icon:r.G,key:"T"}];function w(e){let{tool:t,onTool:l,canUndo:n,onUndo:a,sending:i,onSend:r,onClose:f}=e,g=(e,t)=>(0,s.jsxs)(h.ZI,{side:"top",children:[e," ",(0,s.jsx)(u.u,{className:"ml-1",children:t})]});return(0,s.jsxs)("div",{role:"toolbar","aria-label":"Mark up",className:(0,x.cn)(p.LJ,"flex items-center gap-1 p-1"),children:[(0,s.jsx)(m.O,{type:"single",value:t,onValueChange:e=>e&&l(e),className:"bg-transparent p-0","aria-label":"Mark",children:b.map(e=>{let{id:t,label:l,Icon:n,key:a}=e;return(0,s.jsxs)(h.m_,{children:[(0,s.jsx)(h.k$,{asChild:!0,children:(0,s.jsx)(m.d,{value:t,"aria-label":l,className:"size-8 p-0 text-fg-secondary aria-checked:bg-fill-selected aria-checked:text-fg-primary aria-checked:shadow-none [&_svg]:!size-4",children:(0,s.jsx)(n,{})})}),g(l,a)]},t)})}),(0,s.jsxs)(h.m_,{children:[(0,s.jsx)(h.k$,{asChild:!0,children:(0,s.jsx)(d.$,{variant:"ghost",size:"icon-sm","aria-label":"Undo",disabled:!n,onClick:a,className:"size-8 text-fg-secondary [&_svg]:!size-4",children:(0,s.jsx)(c.o,{})})}),g("Undo","⌘Z")]}),(0,s.jsx)("span",{"aria-hidden":!0,className:"mx-0.5 h-4 w-hairline bg-border"}),(0,s.jsx)(d.$,{size:"sm",variant:"primary",disabled:!n||i,onClick:r,className:"mx-0.5 disabled:bg-fill-control disabled:text-fg-meta disabled:opacity-100",children:i?"Saving":"Save for Claude"}),(0,s.jsxs)(h.m_,{children:[(0,s.jsx)(h.k$,{asChild:!0,children:(0,s.jsx)(d.$,{variant:"ghost",size:"icon-sm","aria-label":"Close mark up",onClick:f,className:"size-8 text-fg-secondary [&_svg]:!size-4",children:(0,s.jsx)(o.X,{})})}),g("Close","Esc")]})]})}},62458:(e,t,l)=>{l.d(t,{ProjectView:()=>Y});var s=l(95155),n=l(52619),a=l.n(n),i=l(20063),r=l(12115),c=l(45515),o=l(98038),d=l(57784),u=l(16983),m=l(87583),h=l(68772),x=l(85568),p=l(68515),f=l(46508),g=l(42423),v=l(55338),j=l(74371),b=l(32296),w=l(20534),y=l(25522),N=l(50645),k=l(28976),S=l(67455),C=l(99273),M=l(3018),z=l(82180),R=l(41880),L=l(57644),E=l(80526),T=l(82),D=l(50847);function I(e){let{left:t,right:l,leftLabel:n,rightLabel:a,width:i,height:c}=e,[o,d]=(0,r.useState)(52),u=(0,r.useRef)(null),m=e=>{let t=u.current.getBoundingClientRect();d(Math.max(0,Math.min(100,(e-t.left)/t.width*100)))};return(0,s.jsxs)("div",{className:"relative pt-6",style:{width:i},children:[(0,s.jsx)("span",{className:"absolute left-0 top-0 text-sm font-medium text-fg-secondary",children:n}),(0,s.jsx)("span",{className:"absolute right-0 top-0 text-sm font-medium text-fg-secondary",children:a}),(0,s.jsxs)("div",{ref:u,className:"relative touch-none select-none",style:{width:i,height:c},onPointerDown:e=>{e.currentTarget.setPointerCapture(e.pointerId),m(e.clientX)},onPointerMove:e=>1===e.buttons&&m(e.clientX),children:[(0,s.jsx)("div",{className:"absolute inset-0",children:t}),(0,s.jsx)("div",{className:"absolute inset-0",style:{clipPath:"inset(0 0 0 ".concat(o,"%)")},children:l}),(0,s.jsx)("div",{role:"slider",tabIndex:0,"aria-label":"Split between the two","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(o),onKeyDown:e=>{"ArrowLeft"===e.key&&d(e=>Math.max(0,e-4)),"ArrowRight"===e.key&&d(e=>Math.min(100,e+4))},className:"absolute inset-y-0 z-10 -ml-px w-px cursor-ew-resize bg-fg-primary outline-hidden after:absolute after:left-1/2 after:top-1/2 after:size-4 after:-translate-x-1/2 after:-translate-y-1/2 after:rounded-full after:bg-fg-primary after:shadow-float focus-visible:after:ring-2 focus-visible:after:ring-fg-primary focus-visible:after:ring-offset-2 focus-visible:after:ring-offset-bg-chrome",style:{left:"".concat(o,"%")}})]})]})}function P(e){let{state:t}=e;return"building"===t?(0,s.jsx)(k.rA,{status:"building"}):"merged"===t?(0,s.jsx)(C.r,{className:"size-4 text-[var(--bl-status-merged)]"}):"ready"===t?(0,s.jsx)(M.D,{className:"size-4 text-status-success"}):(0,s.jsx)(M.D,{className:"size-4 text-fg-meta"})}let q={waiting:"Waits for its design",building:"The agent is building",ready:"Ready to merge",merged:"Merged"};function B(e){let{project:t}=e,{connectRepo:l}=(0,y.Q)(),[n,a]=(0,r.useState)(!1),[i,c]=(0,r.useState)(""),[o,d]=(0,r.useState)(""),u=/^[\w.-]+\/[\w.-]+$/.test(i.trim());return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(D.pp,{plain:!0,icon:z.Z,title:"No repo yet",line:t.folder?"The agent builds ".concat(t.name,"’s approved screens in ").concat(t.folder.split("/").filter(Boolean).at(-1)," and pushes to a GitHub repo you connect."):"The agent builds ".concat(t.name,"’s approved screens into a GitHub repo you connect."),action:(0,s.jsx)(h.$,{size:"sm",variant:"primary",onClick:()=>a(!0),children:"Connect a repo"})}),(0,s.jsx)(L.lG,{open:n,onOpenChange:a,children:(0,s.jsx)(L.Cf,{className:"max-w-md",children:(0,s.jsxs)("form",{onSubmit:async e=>{if(e.preventDefault(),u){d("");try{await l(t.slug,i.trim()),a(!1)}catch(e){d(e instanceof Error?e.message:"Couldn't connect the repo.")}}},children:[(0,s.jsxs)(L.c7,{children:[(0,s.jsx)(L.L3,{children:"Connect a repo"}),(0,s.jsx)(L.rr,{children:t.folder?"The GitHub repo the agent opens pull requests in, as owner and name. It becomes the folder's git remote.":"The GitHub repo the agent opens pull requests in, as owner and name."})]}),(0,s.jsx)(R.p,{autoFocus:!0,value:i,onChange:e=>c(e.target.value),"aria-label":"Repo","aria-invalid":!!o,className:"mt-4"}),o&&(0,s.jsx)("p",{className:"mt-2 text-sm text-status-danger",children:o}),(0,s.jsxs)(L.Es,{className:"mt-5",children:[(0,s.jsx)(h.$,{type:"button",onClick:()=>a(!1),children:"Cancel"}),(0,s.jsx)(h.$,{type:"submit",variant:"primary",disabled:!u,children:"Connect repo"})]})]})})})]})}function A(e){let{project:t,current:l,onPick:n}=e,{prState:a,repoOf:i}=(0,y.Q)(),r=i(t.slug),c=t.pullRequests.map(e=>({...e,live:a(t.slug,e.id)})),o=c.filter(e=>"building"===e.live.state||"ready"===e.live.state),d=c.filter(e=>"waiting"===e.live.state),u=c.filter(e=>"merged"===e.live.state),m="flex h-9 items-center px-2 text-sm font-medium text-fg-meta";return(0,s.jsxs)("div",{className:"flex h-full min-h-0 flex-col",children:[(0,s.jsxs)("div",{className:"flex h-11 shrink-0 items-center gap-2 pl-4 pr-2 shadow-divider-b",children:[(0,s.jsx)(z.Z,{className:"size-4 shrink-0 text-fg-meta"}),(0,s.jsx)("span",{className:"min-w-0 truncate text-ui font-semibold text-fg-primary",children:null!=r?r:"No repo"})]}),r&&(0,s.jsxs)("nav",{"aria-label":"Pull requests",className:"min-h-0 flex-1 overflow-y-auto p-2",children:[o.length>0&&(0,s.jsx)("div",{className:m,children:"Open"}),o.map(e=>(0,s.jsx)(D.fI,{nav:!0,onClick:()=>n(e.id),selected:e.id===l,lead:(0,s.jsx)(P,{state:e.live.state}),status:q[e.live.state],title:e.screen,trail:e.live.number?"#".concat(e.live.number):void 0},e.id)),d.length>0&&(0,s.jsx)("div",{className:(0,E.cn)(m,o.length>0&&"mt-3"),children:"Waiting on design"}),d.map(e=>(0,s.jsx)(D.fI,{nav:!0,onClick:()=>n(e.id),selected:e.id===l,lead:(0,s.jsx)(P,{state:"waiting"}),status:q.waiting,title:e.screen},e.id)),u.length>0&&(0,s.jsx)("div",{className:(0,E.cn)(m,(o.length>0||d.length>0)&&"mt-3"),children:"Merged"}),u.map(e=>{var t;return(0,s.jsx)(D.fI,{nav:!0,onClick:()=>n(e.id),selected:e.id===l,lead:(0,s.jsx)(P,{state:"merged"}),status:"Merged",title:e.screen,parent:e.live.number?"#".concat(e.live.number):void 0,trail:null!=(t=e.live.date)?t:e.date},e.id)})]})]})}function K(e){var t,l;let{project:n,prId:i}=e,{prState:c,merge:o,repoOf:d}=(0,y.Q)(),u=d(n.slug),m=null!=(t=n.pullRequests.find(e=>e.id===i))?t:n.pullRequests[0],x=null!=(l=n.screens.find(e=>e.id===(null==m?void 0:m.id)))?l:n.screens[0],f=m?c(n.slug,m.id):{state:"waiting"},g=x?(0,T.XA)(x):["desktop"],[v,j]=(0,r.useState)(g[0]),[b,w]=(0,r.useState)(null),[N,k]=(0,r.useState)(.4),S=T.et[g.includes(v)?v:g[0]],z=(0,r.useRef)(null);return((0,r.useEffect)(()=>{var e;"building"===f.state&&document.activeElement===document.body&&(null==(e=z.current)||e.focus())},[f.state]),(0,r.useLayoutEffect)(()=>{if(!b)return;let e=new ResizeObserver(()=>k(Math.max(.1,Math.min(1,(b.clientWidth-96)/S.w,(b.clientHeight-120)/S.h))));return e.observe(b),()=>e.disconnect()},[b,S.w,S.h]),u)?m&&x?(0,s.jsxs)("div",{className:"flex h-full min-h-0 flex-col",children:[(0,s.jsxs)("div",{className:"flex h-11 shrink-0 items-center gap-3 pl-4 pr-2 shadow-divider-b",children:[(0,s.jsx)("span",{ref:z,tabIndex:-1,className:"truncate text-ui font-semibold text-fg-primary outline-hidden",children:m.screen}),"ready"===f.state&&(0,s.jsx)(D.vB,{status:"built",children:"Matches the design"}),"building"===f.state&&(0,s.jsx)(D.vB,{status:"building",children:q.building}),"merged"===f.state&&(0,s.jsx)(D.vB,{className:"num",children:(0,s.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,s.jsx)(C.r,{className:"size-3.5 shrink-0 text-[var(--bl-status-merged)]"}),(0,s.jsx)("span",{className:"truncate",children:f.number?"Merged as #".concat(f.number):"Merged"})]})}),(0,s.jsx)("span",{className:"flex-1"}),g.length>1&&"waiting"!==f.state&&(0,s.jsx)(p.O,{type:"single",size:"sm",value:v,onValueChange:e=>e&&j(e),"aria-label":"Device",className:"max-sm:hidden",children:g.map(e=>(0,s.jsx)(p.d,{value:e,className:"num",children:T.et[e].px},e))}),"ready"===f.state&&(0,s.jsx)(h.$,{size:"sm",variant:"primary",onClick:()=>{o(n.slug,m.id),requestAnimationFrame(()=>{var e;return null==(e=z.current)?void 0:e.focus()})},children:"Merge"})]}),(0,s.jsx)("div",{ref:w,className:"dot-grid relative grid min-h-0 flex-1 place-items-center overflow-hidden p-6",children:"waiting"===f.state?(0,s.jsx)(D.pp,{plain:!0,title:"Waiting on its design",line:"The agent builds ".concat(m.screen," here once you approve its design."),action:(0,s.jsx)(h.$,{size:"sm",asChild:!0,children:(0,s.jsx)(a(),{href:"/p/".concat(n.slug,"?design=").concat(x.id),children:"Open the design"})})}):(0,s.jsx)(I,{leftLabel:"Approved design",rightLabel:"Build preview",width:S.w*N,height:S.h*N,left:(0,s.jsx)(T.lZ,{w:S.w,h:S.h,s:N,children:(0,s.jsx)(T.ScreenRender,{screen:x,device:v})}),right:(0,s.jsx)(T.lZ,{w:S.w,h:S.h,s:N,children:(0,s.jsx)(T.ScreenRender,{screen:x,device:v})})})})]}):(0,s.jsx)("div",{className:"dot-grid grid h-full place-items-center p-6",children:(0,s.jsx)(D.pp,{plain:!0,icon:M.D,title:"No pull requests yet",line:"One opens for each screen you approve."})}):(0,s.jsx)("div",{className:"dot-grid grid h-full place-items-center p-6",children:(0,s.jsx)(B,{project:n})})}var $=l(63765),F=l(3278),_=l(49255),O=l(5496),H=l(81375);let Z={save:{name:"Button",label:"Save changes",values:[{label:"Variant",value:"accent",token:!0},{label:"Fill",value:"accent-fill",token:!0,swatch:!0},{label:"Height",value:"28"},{label:"Radius",value:"7"},{label:"Label",value:"13, weight 500"}],rule:["ux-writing 24","a verb plus an object."]},cancel:{name:"Button",label:"Cancel",values:[{label:"Variant",value:"default",token:!0},{label:"Fill",value:"fill-control",token:!0},{label:"Height",value:"28"},{label:"Radius",value:"7"}],rule:["web-app-design 13","one committing action per view."]},segmented:{name:"Segmented control",label:"General",values:[{label:"Track",value:"fill-control",token:!0},{label:"Selected",value:"fill-segment",token:!0},{label:"Height",value:"32"},{label:"Radius",value:"8 outside, 6 inside"}],rule:["visual-design","inner radius is outer minus the inset."]},row:{name:"List row",label:"Currency",values:[{label:"Height",value:"48"},{label:"Name",value:"fg-primary",token:!0},{label:"Value",value:"fg-secondary",token:!0},{label:"Divider",value:"None"}],rule:["web-app-design 16","lists are unboxed and undivided."]},switch:{name:"Switch",label:"Send reminders",values:[{label:"On",value:"accent",token:!0},{label:"Size",value:"30 by 18"}],rule:["web-app-design 13","the accent marks an on state."]},title:{name:"Title",label:"Settings",values:[{label:"Size",value:"28, weight 600"},{label:"Face",value:"heading",token:!0},{label:"Colour",value:"fg-primary",token:!0}],rule:["ux-writing 32","titles name the place."]},list:{name:"Grouped list",label:"General",values:[{label:"Fill",value:"bg-raised",token:!0},{label:"Edge",value:"shadow-ring",token:!0},{label:"Radius",value:"12"},{label:"Rows",value:"4"}],rule:["web-app-design 16","one container, no dividers."]}};function V(e){let{project:t,screen:l,version:n,onVersion:a,selection:i,onSelect:c,onApprove:o,tool:u,onTool:m,dockInspect:p}=e,{screenStatus:f,repoOf:g,commentsOf:j,addComment:b,markupOf:k,saveMarkup:C,flowsOf:M}=(0,y.Q)(),z=f(t.slug,l.id),L=(0,T.XA)(l),D=j(t.slug,l.id),[P,q]=(0,r.useState)("fit"),[B,A]=(0,r.useState)(.3),[K,$]=(0,r.useState)(null),[F,V]=(0,r.useState)({w:1e3,h:700}),[X,G]=(0,r.useState)(null),[Q,Y]=(0,r.useState)(null),[U,J]=(0,r.useState)(null),[ee,et]=(0,r.useState)(null),[el,es]=(0,r.useState)([]),[en,ea]=(0,r.useState)("pen"),[ei,er]=(0,r.useState)(!1),ec="markup"===u,eo=k(t.slug,l.id,n),ed=(0,r.useRef)(!1);(0,r.useEffect)(()=>{ec&&!ed.current&&es(eS),ed.current=ec},[ec]);let eu=(0,r.useCallback)(()=>{es([]),m("select")},[m]),em=(0,r.useRef)(null),eh=(0,r.useRef)("review"===z);(0,r.useEffect)(()=>{var e;eh.current&&"approved"===z&&(null==(e=em.current)||e.focus()),eh.current="review"===z},[z]);let[ex,ep]=(0,r.useState)(null),ef=(0,r.useRef)(null),[eg,ev]=(0,r.useState)(!1),ej=Math.max(...L.map(e=>T.et[e].w)),eb=Math.max(...L.map(e=>T.et[e].h)),ew=L.map((e,t)=>{let l=L.slice(0,t);return eg?{d:e,x:(ej-T.et[e].w)/2,y:l.reduce((e,t)=>e+T.et[t].h+120,0)}:{d:e,x:l.reduce((e,t)=>e+T.et[t].w+120,0),y:0}}),ey=eg?ej:ew.at(-1).x+T.et[L.at(-1)].w,eN=eg?ew.at(-1).y+T.et[L.at(-1)].h:eb,ek="fit"===P?B:P,eS=eo.flatMap(e=>{let t=ew.find(t=>t.d===e.device);if(!t)return[];let{device:l,...s}=e;return[(0,H.BN)(s,t.x,t.y)]}),eC=eg?16:48,eM=F.w,ez=F.h+52,eR=ey*ek+2*F.w,eL=eN*ek+52+2*F.h,eE=(0,r.useRef)(null),eT=(0,r.useCallback)((e,t,l)=>{if(!K)return;let s=null!=t?t:K.clientWidth/2,n=null!=l?l:K.clientHeight/2;eE.current={px:(K.scrollLeft+s-eM)/ek,py:(K.scrollTop+n-ez)/ek,cx:s,cy:n},q(Math.min(4,Math.max(.05,e)))},[K,eM,ez,ek]);(0,r.useLayoutEffect)(()=>{if(!K)return;let e=new ResizeObserver(()=>{let e=K.clientWidth,t=K.clientHeight;V({w:e,h:t});let l=T.et[L[0]],s=Math.min((e-96)/(L.reduce((e,t)=>e+T.et[t].w,0)+120*(L.length-1)),(t-52-96)/Math.max(...L.map(e=>T.et[e].h))),n=e<560?32:96,a=Math.min((e-n)/l.w,(t-52-96)/l.h),i=e>=560&&s>=.3;ev(!i),A(Math.max(.08,Math.min(1,i?s:e<560?(e-n)/Math.max(...L.map(e=>T.et[e].w)):a)))});return e.observe(K),()=>e.disconnect()},[K,L.join(),52]);let eD=(0,r.useCallback)(()=>{if(!i||!ef.current||!K)return G(null);let e=ef.current.querySelector('[data-frame="desktop"] [data-part="'.concat(i,'"], [data-frame] [data-part="').concat(i,'"]'));if(!e)return G(null);let t=e.getBoundingClientRect(),l=K.getBoundingClientRect();G({l:t.left-l.left+K.scrollLeft,t:t.top-l.top+K.scrollTop,w:t.width,h:t.height})},[i,K]);(0,r.useLayoutEffect)(()=>{eD()},[eD,ek,n,l.id,eg,F.w]);let eI=l.version>1;(0,r.useEffect)(()=>{let e=e=>{if(e.target.closest("input, textarea, [contenteditable]")||document.querySelector("[role=dialog]"))return;if(ec){if((e.metaKey||e.ctrlKey)&&"z"===e.key.toLowerCase())e.preventDefault(),es(e=>e.slice(0,-1));else if("Escape"===e.key)eu();else if(!e.metaKey&&!e.ctrlKey&&!e.altKey){let t={p:"pen",r:"box",t:"text"}[e.key.toLowerCase()];t&&ea(t)}return}if(e.metaKey||e.ctrlKey||e.altKey)return;let t={v:"select",c:"comment",m:"markup",i:"inspect",d:"compare",f:"play"}[e.key.toLowerCase()];t&&(e.preventDefault(),"play"===t?J(L[0]):("compare"!==t||eI)&&m(t))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[L,eI,m,ec,eu]),(0,r.useLayoutEffect)(()=>{if(K){if(eE.current){let e=eE.current;eE.current=null,K.scrollLeft=eM+e.px*ek-e.cx,K.scrollTop=ez+e.py*ek-e.cy;return}"fit"===P&&(K.scrollLeft=eM+ey*ek/2-K.clientWidth/2,K.scrollTop=eg?ez-52-16:ez-52+(52+eN*ek)/2-K.clientHeight/2)}},[K,ek,P,F.w,F.h,l.id,eg,L.join(),"compare"===u]),(0,r.useEffect)(()=>{if(!K)return;let e=e=>{if(!e.ctrlKey&&!e.metaKey)return;e.preventDefault();let t=K.getBoundingClientRect();eT(ek*Math.exp(-(.01*Math.max(-25,Math.min(25,e.deltaY)))),e.clientX-t.left,e.clientY-t.top)};return K.addEventListener("wheel",e,{passive:!1}),()=>K.removeEventListener("wheel",e)},[K,ek,eT]);let[eP,eq]=(0,r.useState)(!1),[eB,eA]=(0,r.useState)(!1),eK=(0,r.useRef)(!1);(0,r.useEffect)(()=>{let e=e=>{var t,l,s,n;if(!((null==(s=e.target)||null==(n=s.closest)?void 0:n.call(s,"input, textarea, [contenteditable]"))||document.querySelector("[role=dialog]"))){if("Space"===e.code&&!(null==(l=e.target)||null==(t=l.closest)?void 0:t.call(l,"button, a, [role=button], [role=tab], [role=radio], [role=menuitem], [role=switch]"))){e.preventDefault(),eq(!0);return}(e.metaKey||e.ctrlKey)&&("="===e.key||"+"===e.key||"-"===e.key)?(e.preventDefault(),eT("-"===e.key?ek/1.5:1.5*ek)):!e.shiftKey||e.metaKey||e.ctrlKey||"Digit1"!==e.code?!e.shiftKey||e.metaKey||e.ctrlKey||"Digit0"!==e.code||(e.preventDefault(),eT(1)):(e.preventDefault(),q("fit"))}},t=e=>"Space"===e.code&&eq(!1);return window.addEventListener("keydown",e),window.addEventListener("keyup",t),()=>{window.removeEventListener("keydown",e),window.removeEventListener("keyup",t)}},[ek,eT]);let e$=(e,t,l)=>{var s;let n=null!=(s=ew.find(t=>t.d===e))?s:ew[0];return{x:eC+(n.x+t)*ek,y:52+(n.y+l)*ek}},eF=Array.from({length:Math.max(1,l.version)},(e,t)=>{var s,n;let a=l.version-t,i=(null==(s=l.notes)?void 0:s[a])||("settings"===l.id?null==(n=S.e4.find(e=>e.v===a))?void 0:n.label:void 0)||(1===a?"First draft":"Earlier draft");return{v:a,label:i}}),e_=i?Z[i]:null,eO=L[0],eH=T.et[eO],eZ=Math.min((F.w-96)/eH.w,(F.h-160)/eH.h,1),eV=g(t.slug);return(0,s.jsxs)("div",{className:"relative flex h-full min-h-0 flex-col",children:[(0,s.jsxs)("div",{className:"flex h-11 shrink-0 items-center gap-2 pl-4 pr-2 shadow-divider-b",children:[(0,s.jsx)("span",{className:"truncate text-ui font-semibold text-fg-primary max-lg:hidden",children:l.name}),(0,s.jsxs)(v.rI,{modal:!1,children:[(0,s.jsx)(v.ty,{asChild:!0,children:(0,s.jsxs)(h.$,{variant:"ghost",size:"sm",className:"num gap-1 px-2 text-fg-secondary","aria-label":"Version ".concat(n),children:["v",n,(0,s.jsx)(d.a,{weight:"bold",className:"!size-2.5 text-fg-meta"})]})}),(0,s.jsxs)(v.SQ,{align:"start",className:"w-60",children:[(0,s.jsx)(v.lp,{children:"Versions"}),(0,s.jsx)(v.Hr,{value:String(n),onValueChange:e=>a(Number(e)),children:eF.map(e=>(0,s.jsx)(v.Ht,{value:String(e.v),children:(0,s.jsxs)("span",{className:"truncate",children:["v",e.v,", ",e.label.charAt(0).toLowerCase()+e.label.slice(1)]})},e.v))})]})]}),(0,s.jsx)("span",{className:"flex-1"}),"review"===z&&(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(h.$,{size:"sm",variant:"primary",onClick:o,children:"Approve"})}),"approved"===z&&(0,s.jsxs)("span",{ref:em,tabIndex:-1,className:"inline-flex items-center gap-2 px-1 text-sm text-fg-secondary outline-hidden",role:"status",children:[(0,s.jsx)(N.rA,{status:"approved"}),eV?"Approved v".concat(l.version):"Approved v".concat(l.version,". Connect a repo in Build to build it.")]}),"drawing"===z&&(0,s.jsxs)("span",{className:"inline-flex items-center gap-2 px-1 text-sm text-fg-meta",children:[(0,s.jsx)(_.q,{state:"drawing",className:"size-4 text-agent-work"}),(0,s.jsx)("span",{className:"forming-text",children:"The agent is drawing"})]})]}),(0,s.jsxs)("div",{className:"flex min-h-0 flex-1",children:[(0,s.jsxs)("div",{ref:$,onClickCapture:e=>{eK.current&&(e.stopPropagation(),eK.current=!1)},onClick:e=>{var t;if(ec||e.target.closest("[data-overlay]"))return;et(null);let l=e.target.closest("[data-frame]");if("comment"===u){if(!l)return;let t=l.getBoundingClientRect();Y({device:l.dataset.frame,x:(e.clientX-t.left)/ek,y:(e.clientY-t.top)/ek});return}if("select"!==u&&"inspect"!==u)return;let s=null==(t=e.target.closest("[data-part]"))?void 0:t.getAttribute("data-part");c(s&&Z[s]?s:null)},onPointerDown:e=>{if(!K||!(eP||1===e.button))return;e.preventDefault();let t={x:e.clientX,y:e.clientY,l:K.scrollLeft,t:K.scrollTop};eA(!0),eK.current=!1;let l=e=>{Math.abs(e.clientX-t.x)+Math.abs(e.clientY-t.y)>3&&(eK.current=!0),K.scrollLeft=t.l-(e.clientX-t.x),K.scrollTop=t.t-(e.clientY-t.y)},s=()=>{eA(!1),window.removeEventListener("pointermove",l),window.removeEventListener("pointerup",s)};window.addEventListener("pointermove",l),window.addEventListener("pointerup",s)},className:(0,E.cn)("dot-grid relative min-h-0 min-w-0 flex-1 overflow-auto overscroll-none [background-attachment:local] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden","comment"===u&&"cursor-crosshair",eP&&"cursor-grab",eB&&"cursor-grabbing select-none"),children:["compare"===u&&eI?(0,s.jsx)("div",{className:"grid min-h-full place-items-center p-6",children:(0,s.jsx)(I,{leftLabel:"v".concat(Math.max(1,n-1)),rightLabel:"v".concat(n),width:eH.w*eZ,height:eH.h*eZ,left:(0,s.jsx)(T.lZ,{w:eH.w,h:eH.h,s:eZ,children:(0,s.jsx)(T.ScreenRender,{screen:l,device:eO,v:Math.max(1,n-1)})}),right:(0,s.jsx)(T.lZ,{w:eH.w,h:eH.h,s:eZ,children:(0,s.jsx)(T.ScreenRender,{screen:l,device:eO,v:n})})})}):(0,s.jsxs)("div",{className:"relative",style:{width:eR,height:eL},children:[(0,s.jsxs)("div",{ref:ef,className:"absolute origin-top-left",style:{left:eM,top:ez,width:ey,height:eN,transform:"scale(".concat(ek,")")},children:[ew.map(e=>{let{d:t,x:a,y:i}=e;return(0,s.jsx)("div",{"data-frame":t,className:"absolute",style:{left:a,top:i},children:(0,s.jsx)(T.ScreenRender,{screen:l,device:t,v:n})},t)}),ec?(0,s.jsx)(O.oc,{width:ey,height:eN,scale:ek,tool:en,marks:el,onAdd:e=>es(t=>[...t,e])}):eS.length>0&&(0,s.jsx)(O.MarksView,{width:ey,height:eN,marks:eS})]}),(()=>{let e=eM-eC,n=ez-52;return(0,s.jsxs)("div",{className:"pointer-events-none absolute inset-0",style:{transform:"translate(".concat(e,"px, ").concat(n,"px)")},children:[ew.map(e=>{let{d:t}=e,l=e$(t,0,0);return(0,s.jsxs)("div",{className:"absolute flex items-baseline justify-between gap-2 whitespace-nowrap text-sm",style:{left:l.x,top:l.y-24,width:Math.max(T.et[t].w*ek,48)},children:[(0,s.jsx)("span",{className:"font-medium text-fg-secondary",children:T.et[t].label}),T.et[t].w*ek>=140&&(0,s.jsx)("span",{className:"num text-fg-meta",children:T.et[t].px})]},t)}),D.filter(e=>!ec&&L.includes(e.device)).map(t=>{let l=e$(t.device,t.x,t.y),n=l.x+e,a={right:F.w-n-40,left:n-16},i=a.right>=240||a.right>=a.left,r=Math.max(160,Math.min(240,i?a.right:a.left)),c=ee===t.id;return(0,s.jsxs)("div",{"data-overlay":!0,className:"group/pin pointer-events-auto absolute",style:{left:l.x,top:l.y},onMouseEnter:()=>ep(t.id),onMouseLeave:()=>ep(null),children:[(0,s.jsx)("button",{type:"button","aria-label":"Comment from ".concat(t.who),"aria-expanded":c||ex===t.id,onClick:()=>et(c?null:t.id),className:"block rounded-full shadow-float outline-hidden focus-visible:ring-2 focus-visible:ring-fg-primary",children:(0,s.jsx)(x.eu,{size:"sm",children:(0,s.jsx)(x.q5,{name:t.who,children:t.initials})})}),(c||ex===t.id)&&(0,s.jsxs)("div",{role:"note",className:(0,E.cn)(N.LJ,"absolute top-0 z-[5] w-max px-3 py-2 text-sm text-fg-primary"),style:{maxWidth:r,...i?{left:28}:{right:28}},children:[t.text,(0,s.jsxs)("div",{className:"mt-0.5 text-fg-meta",children:[t.who.split(" ")[0],", ",t.when]})]})]},t.id)}),Q&&(()=>{let e=e$(Q.device,Q.x,Q.y);return(0,s.jsxs)("form",{"data-overlay":!0,className:"pointer-events-auto absolute flex items-start gap-2",style:{left:e.x,top:e.y},onClick:e=>e.stopPropagation(),onSubmit:e=>{e.preventDefault();let s=e.currentTarget.elements.namedItem("c").value.trim();s&&b(t.slug,l.id,{id:"c".concat(Date.now()),...Q,who:"Trent Mitchell",initials:"T",text:s,when:new Date().toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})}),Y(null)},children:[(0,s.jsx)(x.eu,{size:"sm",className:"mt-1.5",children:(0,s.jsx)(x.q5,{name:"Trent Mitchell",children:"T"})}),(0,s.jsx)(R.p,{name:"c",autoFocus:!0,placeholder:"Add a comment",onKeyDown:e=>"Escape"===e.key&&Y(null),onBlur:e=>!e.currentTarget.value&&Y(null),className:"w-64 bg-bg-floating"})]})})()]})})()]}),X&&"compare"!==u&&!ec&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"pointer-events-none absolute z-[4] rounded-[3px] ring-[1.5px] ring-fg-primary",style:{left:X.l-2,top:X.t-2,width:X.w+4,height:X.h+4}}),(0,s.jsxs)("span",{className:(0,E.cn)(N.LJ,"num pointer-events-none absolute z-[4] whitespace-nowrap px-1.5 py-0.5 text-sm text-fg-primary"),style:{left:X.l,top:X.t+X.h+8},children:[Math.round(X.h/ek)," high"]})]})]}),p&&"inspect"===u&&e_&&(0,s.jsx)("div",{className:"w-64 shrink-0 border-l border-border max-md:hidden",children:(0,s.jsx)(W,{part:i})})]}),(0,s.jsx)("div",{className:"absolute bottom-3 left-3 z-[6] md:left-1/2 md:-translate-x-1/2",children:ec?(0,s.jsx)(O.GO,{tool:en,onTool:ea,canUndo:el.length>0,onUndo:()=>es(e=>e.slice(0,-1)),sending:ei,onClose:eu,onSend:()=>{er(!0),C(t.slug,l.id,n,el.map(e=>{let[t,l]=(0,H.dI)(e),s=e=>{let{w:s,h:n}=T.et[e.d];return Math.hypot(Math.max(e.x-t,0,t-(e.x+s)),Math.max(e.y-l,0,l-(e.y+n)))},n=ew.reduce((e,t)=>s(t)<s(e)?t:e);return{...(0,H.BN)(e,-n.x,-n.y),device:n.d}})),er(!1),eu()}}):(0,s.jsx)(N.E5,{tool:u,zoom:ek,disabled:eI?[]:["compare"],onTool:e=>"play"===e?J(L[0]):m(e),onZoom:e=>"fit"===e?q("fit"):eT(e)})}),U&&(0,s.jsx)(w.y2,{project:t,flows:M(t.slug),start:l.id,device:U,onClose:()=>J(null)})]})}function W(e){let{part:t,onClose:l}=e,n=Z[t];return n?(0,s.jsxs)("aside",{"aria-label":"Inspect",className:"flex h-full min-h-0 flex-col",children:[(0,s.jsxs)("div",{className:"flex h-11 shrink-0 items-center gap-2 pl-4 pr-2 shadow-divider-b",children:[(0,s.jsx)("span",{className:"text-ui font-semibold text-fg-primary",children:"Inspect"}),(0,s.jsx)("span",{className:"flex-1"}),l&&(0,s.jsx)(h.$,{variant:"ghost",size:"icon-sm","aria-label":"Close Inspect",onClick:l,children:(0,s.jsx)(F.X,{})})]}),(0,s.jsxs)("div",{className:"min-h-0 flex-1 overflow-y-auto p-4",children:[(0,s.jsxs)("div",{className:"flex items-baseline justify-between gap-3",children:[(0,s.jsx)("span",{className:"text-ui font-medium text-fg-primary",children:n.name}),(0,s.jsx)("span",{className:"truncate text-sm text-fg-meta",children:n.label})]}),(0,s.jsx)("dl",{className:"mt-3 grid grid-cols-[auto_minmax(0,1fr)] gap-x-4 gap-y-2.5 text-sm",children:n.values.map(e=>(0,s.jsxs)("div",{className:"contents",children:[(0,s.jsx)("dt",{className:"text-fg-meta",children:e.label}),(0,s.jsxs)("dd",{className:(0,E.cn)("flex items-center justify-end gap-1.5 text-right text-fg-secondary",e.token?"font-mono text-xs":"num"),children:[e.swatch&&(0,s.jsx)("span",{className:"size-2.5 rounded-[3px] bg-brand-fill shadow-ring"}),e.value]})]},e.label))}),(0,s.jsxs)("p",{className:"mt-4 pt-3 text-sm text-fg-meta shadow-divider-t text-pretty",children:["Follows ",n.rule[0],", ",n.rule[1]]})]})]}):null}function X(e){let{title:t,children:l}=e;return(0,s.jsxs)("div",{className:"flex h-11 shrink-0 items-center gap-2 pl-4 pr-2 shadow-divider-b",children:[t&&(0,s.jsx)("span",{className:"min-w-0 truncate text-ui font-semibold text-fg-primary",children:t}),(0,s.jsx)("span",{className:"flex-1"}),l]})}function G(e){let{label:t,onClick:l}=e;return(0,s.jsxs)(f.m_,{children:[(0,s.jsx)(f.k$,{asChild:!0,children:(0,s.jsx)(h.$,{variant:"ghost",size:"icon-sm","aria-label":t,onClick:l,children:(0,s.jsx)(o.F,{})})}),(0,s.jsx)(f.ZI,{side:"bottom",children:t})]})}function Q(e){let{project:t,current:l,onPick:n}=e,{screenStatus:a,refsOf:i,addRefs:c}=(0,y.Q)(),o=i(t.slug),d=(0,r.useRef)(null),u="flex h-9 items-center justify-between pl-2 text-sm font-medium text-fg-meta";return(0,s.jsxs)("div",{className:"flex h-full min-h-0 flex-col",children:[(0,s.jsx)(X,{title:"Screens"}),(0,s.jsxs)("nav",{"aria-label":"Screens",className:"flex min-h-0 flex-1 flex-col gap-px overflow-y-auto p-2",children:[t.screens.map(e=>{let i=a(t.slug,e.id);return(0,s.jsx)(N.fI,{nav:!0,onClick:()=>n(e.id),selected:e.id===(null==l?void 0:l.id),lead:(0,s.jsx)(N.rA,{status:i}),status:k.qS[i],title:e.name},e.id)}),0===t.screens.length&&(0,s.jsx)("p",{className:"px-2 py-2 text-sm text-fg-meta",children:"None yet"}),(0,s.jsxs)("div",{className:"mt-5",children:[(0,s.jsxs)("div",{className:u,children:["References",(0,s.jsx)(G,{label:"Add a reference",onClick:()=>{var e;return null==(e=d.current)?void 0:e.click()}})]}),o.length>0?(0,s.jsx)("div",{className:"grid grid-cols-2 gap-2 px-2 pt-1",children:o.map(e=>(0,s.jsx)("a",{href:e.url,target:"_blank",rel:"noreferrer",title:e.name,className:"over-ring block aspect-[4/3] overflow-hidden rounded-item",children:(0,s.jsx)("img",{src:e.url,alt:e.name,className:"size-full object-cover"})},e.id))}):(0,s.jsx)("p",{className:"px-2 pb-1 text-sm text-fg-meta",children:"Screenshots you design toward"}),(0,s.jsx)("input",{ref:d,type:"file",accept:"image/*",multiple:!0,hidden:!0,onChange:e=>{var l;c(t.slug,Array.from(null!=(l=e.target.files)?l:[])),e.target.value=""}})]}),(0,s.jsxs)("div",{className:"mt-5",children:[(0,s.jsx)("div",{className:u,children:"Brief"}),(0,s.jsx)("p",{className:"px-2 text-ui text-fg-secondary text-pretty",children:[t.brief.lead,t.brief.body].filter(Boolean).join(" ")})]})]})]})}function Y(e){let{slug:t}=e,{projects:l,loaded:n,refresh:a}=(0,y.Q)(),i=l.find(e=>e.slug===t),o=(0,c.SJ)().builds[t],d=(0,r.useRef)(o);return((0,r.useEffect)(()=>{o&&o!==d.current&&a(),d.current=o},[o,a]),i||n)?i?(0,s.jsx)(U,{project:i},i.slug):(0,s.jsx)(j.Zk,{className:"grid place-items-center",children:(0,s.jsx)(g.Sv,{variant:"plain",children:(0,s.jsxs)(g.FT,{children:[(0,s.jsx)(g.cz,{children:"No project here"}),(0,s.jsx)(g.Ou,{children:"It may still be loading, or the link is out of date."})]})})}):(0,s.jsx)(j.Zk,{})}function U(e){var t,l,n,c,o,f,k,C;let{project:M}=e,z=(0,i.useRouter)(),R=(0,i.usePathname)(),L=(0,i.useSearchParams)(),E=function(){let[e,t]=(0,r.useState)(!0);return(0,r.useEffect)(()=>{let e=window.matchMedia("(min-width: 1024px)"),l=()=>t(e.matches);return l(),e.addEventListener("change",l),()=>e.removeEventListener("change",l)},[]),e}(),{projects:T,screenStatus:D,prState:I,repoOf:P,approve:q,flowsOf:B,setTheme:F}=(0,y.Q)();(0,b.K7)(M.name);let _="build"===L.get("mode")?"build":"design",O=L.get("play"),[H,X]=(0,r.useState)(O?{flow:O}:null),G=null!=(o=null!=(c=M.screens.find(e=>e.id===L.get("screen")))?c:M.screens.find(e=>"review"===D(M.slug,e.id)))?o:M.screens[0],Y=L.get("pr"),U=null!=(C=null!=(k=null!=(f=Y&&M.pullRequests.some(e=>e.id===Y)?Y:null)?f:null==(t=M.pullRequests.find(e=>"merged"!==I(M.slug,e.id).state))?void 0:t.id)?k:null==(l=M.pullRequests[0])?void 0:l.id)?C:"",J=Number(L.get("v"))||(null==G?void 0:G.version)||1,[ee,et]=(0,r.useState)("ledger"===M.slug?{screen:"settings",part:"save"}:null),el=ee&&G&&ee.screen===G.id&&("ledger-settings"===G.kind?Object.keys(Z):[]).includes(ee.part)?ee.part:null,[es,en]=(0,r.useState)("select"),ea=E&&"design"===_&&"inspect"===es&&!!el,[ei,er]=(0,r.useState)(""),ec=(0,r.useCallback)(function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],l=new URLSearchParams(L.toString());Object.entries(e).forEach(e=>{let[t,s]=e;return null===s?l.delete(t):l.set(t,s)});let s="".concat(R).concat(l.toString()?"?".concat(l):"");t?z.push(s,{scroll:!1}):z.replace(s,{scroll:!1})},[L,R,z]),eo=async(e,t)=>{try{await navigator.clipboard.writeText(t),er(e),setTimeout(()=>er(""),2e3)}catch(e){}},ed="Design the first screens for ".concat(M.name," in my Baseline Playground, from its brief."),eu=M.collaborators.map(e=>S.c0[e]).filter(Boolean),em=E?null:"design"===_?M.screens.length>0&&G?(0,s.jsxs)(v.rI,{modal:!1,children:[(0,s.jsx)(v.ty,{asChild:!0,children:(0,s.jsxs)(h.$,{variant:"ghost",size:"sm",className:"min-w-0 gap-1.5 px-2 text-fg-primary",children:[(0,s.jsx)(N.rA,{status:D(M.slug,G.id)}),(0,s.jsx)("span",{className:"truncate",children:G.name}),(0,s.jsx)(d.a,{weight:"bold",className:"!size-2.5 text-fg-meta"})]})}),(0,s.jsxs)(v.SQ,{align:"start",className:"w-56",children:[(0,s.jsx)(v.lp,{children:"Screens"}),M.screens.map(e=>(0,s.jsxs)(v._2,{onSelect:()=>ec({screen:e.id,v:null}),children:[(0,s.jsx)(N.rA,{status:D(M.slug,e.id)}),e.name]},e.id))]})]}):null:M.pullRequests.length>0&&P(M.slug)?(0,s.jsxs)(v.rI,{modal:!1,children:[(0,s.jsx)(v.ty,{asChild:!0,children:(0,s.jsxs)(h.$,{variant:"ghost",size:"sm",className:"min-w-0 gap-1.5 px-2 text-fg-primary",children:[(0,s.jsx)("span",{className:"truncate",children:null==(n=M.pullRequests.find(e=>e.id===U))?void 0:n.screen}),(0,s.jsx)(d.a,{weight:"bold",className:"!size-2.5 text-fg-meta"})]})}),(0,s.jsxs)(v.SQ,{align:"start",className:"w-56",children:[(0,s.jsx)(v.lp,{children:"Pull requests"}),M.pullRequests.map(e=>(0,s.jsx)(v._2,{onSelect:()=>ec({pr:e.id}),children:e.screen},e.id))]})]}):null;return(0,s.jsxs)(j.Zk,{children:[(0,s.jsxs)("div",{className:"flex h-11 shrink-0 items-center gap-2 px-4 shadow-divider-b md:pl-5 md:pr-2",children:[(0,s.jsx)(a(),{href:"/p/".concat(M.slug),className:"flex h-7 items-center rounded-control-sm px-1.5 text-ui font-semibold text-fg-primary transition-hover hover:bg-fill-hover max-md:hidden",children:M.name}),(0,s.jsxs)(p.O,{type:"single",size:"sm",value:_,onValueChange:e=>e&&ec({mode:"design"===e?null:e},!0),"aria-label":"Mode",children:[(0,s.jsx)(p.d,{value:"design",children:"Design"}),(0,s.jsx)(p.d,{value:"build",children:"Build"})]}),em,(0,s.jsx)("span",{className:"flex-1"}),(0,s.jsx)(x.Z7,{className:"mr-1 max-md:hidden [&>*+*]:-ml-1.5 [&>*]:ring-[1.5px] [&>*]:ring-bg-content","aria-label":"In this project: ".concat(eu.map(e=>e.name).join(", ")),children:eu.map(e=>(0,s.jsx)(x.eu,{size:"sm",children:(0,s.jsx)(x.q5,{name:e.name,children:e.initials})},e.id))}),"design"===_&&(0,s.jsx)("span",{className:"contents max-md:hidden",children:(0,s.jsx)($.wN,{current:M.theme,onPick:e=>F(M.slug,e)})}),"design"===_&&G&&(0,s.jsxs)(h.$,{variant:"secondary",size:"sm",className:"gap-1.5 max-md:hidden",onClick:()=>X({screen:G.id}),children:[(0,s.jsx)(u.j,{weight:"fill"}),"Play"]}),(0,s.jsx)(h.$,{size:"sm",className:"max-md:hidden",onClick:()=>eo("link",window.location.href),"aria-live":"polite",children:"link"===ei?"Link copied":"Share"})]}),(0,s.jsxs)("div",{className:E&&ea?"grid min-h-0 flex-1 grid-cols-[240px_minmax(0,1fr)_320px]":E?"grid min-h-0 flex-1 grid-cols-[240px_minmax(0,1fr)]":"grid min-h-0 flex-1",children:[E&&(0,s.jsx)("div",{className:"min-h-0 border-r border-border",children:"design"===_?(0,s.jsx)(Q,{project:M,current:G,onPick:e=>ec({screen:e,v:null})}):(0,s.jsx)(A,{project:M,current:U,onPick:e=>ec({pr:e})})}),(0,s.jsx)("div",{className:"relative min-h-0 min-w-0",children:"build"===_?(0,s.jsx)(K,{project:M,prId:U},U):G?(0,s.jsx)(V,{project:M,screen:G,version:J,onVersion:e=>ec({v:String(e)}),selection:el,onSelect:e=>et(e?{screen:G.id,part:e}:null),onApprove:()=>{G&&q(M.slug,G.id)},tool:es,onTool:en,dockInspect:!E},G.id):(0,s.jsx)("div",{className:"dot-grid grid h-full place-items-center p-6",children:(0,s.jsxs)(g.Sv,{variant:"plain",children:[(0,s.jsxs)(g.FT,{children:[(0,s.jsx)(g.Kr,{children:(0,s.jsx)(m.P,{className:"size-8 text-fg-faint"})}),(0,s.jsx)(g.cz,{children:"No screens yet"}),(0,s.jsx)(g.Ou,{children:"Ask Claude to design them. It plans the screens from the brief, then draws them here."})]}),(0,s.jsx)(g.HY,{children:(0,s.jsx)(h.$,{size:"sm",onClick:()=>eo("request",ed),"aria-live":"polite",children:"request"===ei?"Copied":"Copy the request"})})]})})}),ea&&el&&(0,s.jsx)("div",{className:"min-h-0 border-l border-border",children:(0,s.jsx)(W,{part:el,onClose:()=>en("select")})})]}),H&&(0,s.jsx)(w.y2,{project:M,flows:B(M.slug),start:H.screen,flow:H.flow,onClose:()=>{X(null),O&&ec({play:null})}})]})}},95469:(e,t,l)=>{l.d(t,{ProjectRoute:()=>r});var s=l(95155),n=l(83942);l(52619);var a=l(20063);l(12115),l(85568),l(68772),l(74371),l(32296);var i=l(25522);function r(e){var t;let{slug:l,workspace:r}=e,c=(0,a.useSearchParams)(),{projects:o,loaded:d}=(0,i.Q)(),u=o.find(e=>e.slug===l);return["build","design"].includes(null!=(t=c.get("mode"))?t:"")||["play","pr"].some(e=>c.has(e))?(0,s.jsx)(s.Fragment,{children:r}):u?(0,s.jsx)(n.u_,{project:u}):d?(0,s.jsx)(s.Fragment,{children:r}):null}l(82),l(50847),l(49255),l(28976),l(80526),l(45515),l(33246)}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[961],{8472:(e,t,n)=>{n.d(t,{q:()=>d});var s=n(95155),a=n(12115),r=n(98038),i=n(68772),l=n(39444),c=n(55338),o=n(50847);function d(e){let{project:t,act:n,side:d="top",trigger:u}=e,[h,m]=(0,a.useState)(!1),[x,p]=(0,a.useState)([]),g=async e=>{let t=x.length?"".concat(e,"\n\nScreens it touches: ").concat(x.join(", "),"."):e;if(!await n({action:"brief",brief:t}))return"Couldn't plan it. Try again.";p([]),m(!1)};return(0,s.jsxs)(l.AM,{open:h,onOpenChange:m,children:[(0,s.jsx)(l.Wv,{asChild:!0,children:null!=u?u:(0,s.jsxs)(i.$,{size:"sm",variant:"default",className:"shrink-0",children:[(0,s.jsx)(r.F,{}),"New design"]})}),(0,s.jsx)(l.hl,{side:d,sideOffset:8,collisionPadding:16,"aria-label":"New design for ".concat(t.name),className:"w-lg max-w-(--radix-popover-content-available-width) p-1.5",children:(0,s.jsx)(o.Dk,{label:"What to design next",send:"Plan it",autoFocus:!0,flat:!0,onSend:g,children:(0,s.jsx)("div",{className:"flex min-w-0 items-center px-1 pb-1",children:(0,s.jsxs)(c.rI,{children:[(0,s.jsx)(c.ty,{asChild:!0,children:(0,s.jsxs)(i.$,{type:"button",variant:"ghost",size:"sm","aria-label":x.length?"Screens it touches: ".concat(x.join(", ")):"Screens it touches",className:"min-w-0 max-w-full text-fg-secondary",children:[(0,s.jsx)(r.F,{}),(0,s.jsx)("span",{className:"truncate",children:x.length?x.join(", "):"Screens"})]})}),(0,s.jsx)(c.SQ,{side:d,align:"start",className:"max-h-80 overflow-y-auto",children:t.screens.map(e=>(0,s.jsx)(c.hO,{checked:x.includes(e.name),onCheckedChange:t=>p(n=>t?[...n,e.name]:n.filter(t=>t!==e.name)),onSelect:e=>e.preventDefault(),children:e.name},e.id))})]})})})})]})}},30961:(e,t,n)=>{n.d(t,{i:()=>A,jI:()=>F});var s=n(95155),a=n(12115),r=n(14436),i=n(16983),l=n(98038),c=n(3278),o=n(57784),d=n(12543),u=n(98943),h=n(41880),m=n(50847),x=n(47650),p=n(20063),g=n(68772),f=n(55338),v=n(76654),y=n(68515),j=n(49255),w=n(80526),b=n(39557);function N(e){let{screens:t,aim:n,working:r,waiting:i,onGo:l,navRef:c}=e,o=(0,a.useRef)(null),d=(0,a.useRef)(null),u=(0,a.useRef)(null),h=(0,a.useRef)(null),m=(0,a.useRef)({x:(0,b.oz)(0,b.Cf.snappy),y:(0,b.oz)(0,b.Cf.snappy),w:(0,b.oz)(0,b.Cf.snappy),o:(0,b.oz)(0,b.Cf.track),at:-1,raf:0,last:0,hide:0}),x=()=>{let e=m.current;if(e.raf)return;e.last=performance.now();let t=n=>{let s=Math.min(.064,(n-e.last)/1e3);e.last=n;let a=[e.x,e.y,e.w,e.o].map(e=>(0,b.PM)(e,s)).every(Boolean),r=m.current,i=d.current;i&&(i.style.opacity=String(Math.max(0,Math.min(1,r.o.x))),i.style.width="".concat(r.w.x,"px"),i.style.transform="translate3d(".concat(r.x.x-r.w.x/2,"px, ").concat(r.y.x,"px, 0) scale(").concat(.96+.04*Math.max(0,Math.min(1,r.o.x)),")")),e.raf=a?0:requestAnimationFrame(t)};e.raf=requestAnimationFrame(t)},p=e=>{let n=m.current,s=o.current,a=null==s?void 0:s.children[e],l=d.current;if(!s||!a||!l||!u.current||!h.current)return;window.clearTimeout(n.hide);let c=r.has(t[e].id),p=!c&&i.includes(t[e].id);u.current.textContent=t[e].name,h.current.textContent=c?"Agent working":p?"Needs you":"",h.current.hidden=!c&&!p,l.style.width="auto";let g=l.offsetWidth;l.style.width="".concat(n.w.x,"px");let f=l.offsetHeight,v=s.getBoundingClientRect().left,y=a.offsetLeft+a.offsetWidth/2,j=Math.max(8-v+g/2,Math.min(window.innerWidth-8-v-g/2,y)),w=a.offsetTop-f-6,b=n.o.x<.05;n.x.to=j,n.y.to=w,n.w.to=g,n.o.to=1,b&&(n.x.x=j,n.y.x=w,n.w.x=g,n.x.v=n.y.v=n.w.v=0,n.o.x=Math.max(n.o.x,.7)),n.at=e,x()},g=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:90,t=m.current;window.clearTimeout(t.hide),t.hide=window.setTimeout(()=>{t.o.to=0,t.at=-1,x()},e)};return(0,a.useEffect)(()=>{let e=m.current;return()=>{cancelAnimationFrame(e.raf),window.clearTimeout(e.hide)}},[]),(0,s.jsx)("nav",{ref:c,"aria-label":"Every screen",className:"pointer-events-none absolute inset-x-0 bottom-16 z-20 flex justify-center px-4",children:(0,s.jsxs)("div",{className:"relative max-w-2xl",children:[(0,s.jsxs)("div",{ref:d,"aria-hidden":!0,className:"pointer-events-none absolute top-0 left-0 z-10 flex h-control origin-bottom items-center justify-center gap-2 overflow-hidden whitespace-nowrap rounded-control bg-bg-inverse px-2.5 text-ui leading-none font-medium text-fg-inverse shadow-float will-change-transform",style:{opacity:0},children:[(0,s.jsx)("span",{ref:u}),(0,s.jsx)("span",{ref:h,hidden:!0,className:"text-fg-inverse-muted"})]}),(0,s.jsx)("div",{ref:o,onKeyDown:e=>{let n=o.current;if(!n)return;let s=[...n.children].indexOf(document.activeElement);if(s<0)return;let a="ArrowRight"===e.key?s+1:"ArrowLeft"===e.key?s-1:"Home"===e.key?0:"End"===e.key?t.length-1:null;null===a||a<0||a>=t.length||(e.preventDefault(),n.children[a].focus())},onPointerLeave:()=>g(),className:"pointer-events-auto flex flex-wrap justify-center",children:t.map((e,t)=>{let a=r.has(e.id),c=!a&&i.includes(e.id);return(0,s.jsx)("button",{type:"button","aria-label":"".concat(e.name).concat(a?", the agent is working on it":c?", needs you":""),"aria-current":t===n?"true":void 0,onPointerEnter:()=>p(t),onFocus:()=>p(t),onBlur:()=>g(0),onClick:()=>l(t),className:"grid size-6 place-items-center rounded-full outline-hidden focus-visible:ring-2 focus-visible:ring-ring",children:t!==n&&(a||c)?(0,s.jsx)(j.q,{state:a?"drawing":"waiting",className:(0,w.cn)("size-2.5",a?"text-agent-work":"text-agent-wait")}):(0,s.jsx)("span",{className:(0,w.cn)("block h-1.5 rounded-full transition-all",t===n?(0,w.cn)("w-4",a?"bg-agent-work":"bg-fg-primary"):(0,w.cn)("w-1.5",a?"bg-agent-work":c?"bg-agent-wait":"bg-fg-muted"))})},e.id)})})]})})}var k=n(82),M=n(26022),S=n(50645),C=n(99365),z=n(87736),E=n(45515),L=n(25522),P=n(8472),T=n(20534);function F(e,t){let[n,s]=(0,a.useState)(null),[r,i]=(0,a.useState)(""),l=(0,a.useCallback)(async()=>{let t=await fetch("/api/plan?project=".concat(e),{cache:"no-store"}).catch(()=>null);(null==t?void 0:t.ok)&&s(await t.json())},[e]),c=t||!!(null==n?void 0:n.running.length);return(0,a.useEffect)(()=>{l();let e=setInterval(()=>"visible"===document.visibilityState&&void l(),c?2e3:1e4);return()=>clearInterval(e)},[l,c]),{st:n,act:(0,a.useCallback)(async t=>{i("");let n=await fetch("/api/plan",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project:e,...t})}).then(e=>e.json()).catch(()=>({error:"Couldn't reach Playground."}));return n.error?i(n.error):s(n),!n.error},[e]),error:r,refresh:l}}let q=e=>{var t;return"html"===e.kind&&!!e.src&&(null!=(t=e.drawnFrom)?t:1)<=e.version};function R(e){let{screen:t,device:n,v:a,s:r,run:i,using:l}=e,{w:c,h:o}=k.et[n],d=M.Qe[n];return(0,s.jsx)("div",{className:"relative",style:{padding:"".concat((d.bezel+d.bar)*r,"px ").concat(d.bezel*r,"px ").concat(d.bezel*r,"px")},children:(0,s.jsx)(M.KE,{device:n,box:{w:c*r,h:o*r,s:r},children:(0,s.jsx)("div",{className:(0,w.cn)("absolute left-0 top-0 origin-top-left",!l&&"pointer-events-none"),style:{width:c,height:o,transform:"scale(".concat(r,")")},inert:!l||void 0,children:i?(0,s.jsx)(T.g5,{title:"".concat(t.name,", version ").concat(a),src:"".concat(t.src,"&v=").concat(a,"&proto=1"),device:n}):(0,s.jsx)(k.ScreenRender,{screen:t,device:n,v:a,bare:!0,eager:!0})})})})}let W=()=>!!document.querySelector("[data-walking]"),$=e=>Math.min(1,Math.max(0,e));function A(e){var t,n,c,o,d;let{project:u,screens:h,focus:m,onFocus:x,device:p,live:f,controls:v,waiting:y,needWords:S={},startAtPlan:C,startTab:P,branch:T,variantsOf:A,openBranch:K,play:V,peek:X}=e,U=null!=P?P:C?"plan":"designs",G=u.slug,_=F(G,!1),{st:Z,error:ee}=_,et=(0,a.useCallback)(async e=>{let t=await _.act(e);return(0,E.Ow)(),t},[_]),[en,es]=(0,a.useState)(null),[ea,er]=(0,a.useState)(""),ei=(0,L.Q)().flowsOf(u.slug),el=ei.find(e=>e.id===ea),ec=null==Z?void 0:Z.plan,eo=(0,a.useMemo)(()=>{var e;return null!=(e=null==Z?void 0:Z.decisions)?e:[]},[Z]),ed=null!=(c=null==Z?void 0:Z.running)?c:[],eu=null==ec?void 0:ec.sections.find(e=>"proposed"===e.status),eh=ed.find(e=>"planning"===e.kind),em=ed.find(e=>"building"===e.kind),ex=(0,E.SJ)().runs,ep=(0,a.useMemo)(()=>{let e=new Set;for(let t of ex){if("running"!==t.status||t.project!==G)continue;let n=/^(?:crit|variants)-(.+)$/.exec(t.spread);n&&e.add(n[1])}let t=e=>e.replace(/\s*\([^)]*\)\s*$/,"").trim().toLowerCase();for(let s of ed.filter(e=>"building"===e.kind)){var n;let a=null==ec?void 0:ec.sections.find(e=>e.id===s.section);for(let s of null!=(n=null==a?void 0:a.screens)?n:[]){let n=h.find(e=>e.name.toLowerCase()===t(s)||e.id===t(s));n&&e.add(n.id)}}return e},[ex,ed,ec,h,G]),eg=(0,a.useMemo)(()=>{let e=new Map;for(let t of ex){if("running"!==t.status||t.project!==G)continue;let n=/^crit-(.+)$/.exec(t.spread),s=/^variants-(.+)$/.exec(t.spread),a=h.find(e=>{var t;return e.id===(null==(t=null!=n?n:s)?void 0:t[1])});n&&a?e.set(a.id,t.round>a.version?"Drawing version ".concat(t.round):"Preparing its walkthrough"):s&&a&&e.set(a.id,"Drawing variants")}let t=e=>e.replace(/\s*\([^)]*\)\s*$/,"").trim().toLowerCase();for(let s of ed.filter(e=>"building"===e.kind)){var n;let a=null==ec?void 0:ec.sections.find(e=>e.id===s.section);for(let s of null!=(n=null==a?void 0:a.screens)?n:[]){let n=h.find(e=>e.name.toLowerCase()===t(s)||e.id===t(s));n&&!e.has(n.id)&&e.set(n.id,"Building ".concat(a.title))}}return e},[ex,ed,ec,h,G]),ef=e=>!!S[e]&&!ep.has(e)||eg.has(e),ev=(0,a.useRef)(ef);ev.current=ef;let ey=Math.max(0,h.findIndex(e=>e.id===m)),ej=(0,a.useRef)({x:ey,tx:ey,vx:0,rx:b.Cf.smooth,y:0,ty:0,vy:0,p:+("plan"===U||"system"===U),tp:+("plan"===U||"system"===U),vp:0,d:+!!K,td:+!!K,vd:0,q:+("flows"===U),tq:+("flows"===U),vq:0}),ew=(0,a.useRef)(new Set),eb=(0,a.useRef)(600),eN=(0,a.useRef)(400),[ek,eM]=(0,a.useState)({x:ey,y:0}),[eS,eC]=(0,a.useState)(ey),[ez,eE]=(0,a.useState)(U),eL="plan"===ez||"system"===ez,eP="flows"===ez,[eT,eF]=(0,a.useState)("flows"===U),[eq,eR]=(0,a.useState)(!!K),[eW,e$]=(0,a.useState)(!!K),eA=(0,a.useRef)(!1),[eH,eD]=(0,a.useState)(0),[eI,eB]=(0,a.useState)(!1),eO=(0,a.useRef)(null),eK=(0,a.useRef)(null),[eJ,eV]=(0,a.useState)({w:1440,h:900}),eY=(0,a.useRef)(0),eQ=(0,a.useRef)(void 0);(0,a.useEffect)(()=>{let e=()=>eV({w:innerWidth,h:innerHeight});return e(),addEventListener("resize",e),()=>removeEventListener("resize",e)},[]);let eX=Math.max(0,Math.min(h.length-1,ek.x)),eU=h[eX],eG=eJ.w<768,e_=h.some(e=>null==A?void 0:A(e).can),eZ=eG?140:80,e0=eG?96:128,e1=eG?96:e_?232:100,e2=eJ.h-eZ-e0-e1,e5=e=>{let t=p(e),{w:n,h:s}=k.et[t],a=M.Qe[t],r=n+2*a.bezel,i=s+2*a.bezel+a.bar,l=Math.min((eG?eJ.w-64:.5*eJ.w)/r,e2/i,1);return{s:l,w:r*l,h:i*l,screenW:n*l,screenH:s*l,bar:a.bar*l,bezel:a.bezel*l}},e3=eG?.5:.36,e4=eG?28:64,e8=Math.min(720,eJ.w-32),e6=eG?24:72,e9=eZ+e6+36+20,e7={w:eJ.w,h:Math.max(0,eJ.h-e9-(eG?0:e0+8))},te=(0,a.useRef)(ey);te.current=Math.max(0,Math.min(h.length-1,ek.x));let tt=(0,a.useRef)(new Map),tn=e=>t=>{t?tt.current.set(e,t):tt.current.delete(e)},ts=(0,a.useCallback)(()=>{let e=eJ.w,t=ej.current,n=$(t.y),s=Math.max($(t.p),$(t.q)),a=$(t.q),r=$(t.d),i=eZ+e2/2,l=h.map(e=>e5(e)).map((e,n)=>{let s;return{...e,kk:e3+(1-e3)*((s=Math.max(0,1-Math.abs(t.x-n)))*s*(3-2*s))}}),c=[];l.forEach((e,t)=>c.push(t?c[t-1]+l[t-1].w*l[t-1].kk/2+e4+e.w*e.kk/2:0));let o=Math.max(0,Math.min(l.length-1,Math.floor(t.x))),d=Math.min(l.length-1,o+1),u=l.length?c[o]+(c[d]-c[o])*(t.x-o):0;d>o&&(eb.current=c[d]-c[o]);let m=eG?0:n*Math.min(200,.12*e),x=Math.round(t.tx)===Math.round(t.x)?Math.round(t.x):-1,p=Math.round(t.tx),g=l[x],f=g?i+g.h/2+12-(eZ+e6):0;f>0&&(eN.current=f);let v=-f*r,y=eO.current;y&&(y.style.backgroundPosition="".concat((-(.2*u)).toFixed(1),"px ").concat((.35*v).toFixed(1),"px"));let j=new Map;l.forEach((t,a)=>{let l=tt.current.get("s-".concat(h[a].id));if(!l)return;let o=a===x,d=e/2+(c[a]-u)+(o?m:0),g=i+v;l.style.transform="translate(".concat(d-t.w/2,"px, ").concat(g-t.h/2,"px) scale(").concat(t.kk,")");let f=(o?1:1-n)*(1-s);if(l.style.opacity=String(f),l.style.pointerEvents=f<.5?"none":"",!eG){let e=g-t.h*t.kk/2;l.style.maskImage=o&&r>0?"linear-gradient(to bottom, transparent ".concat(Math.max(0,eZ-24-e)/t.kk,"px, black ").concat(Math.max(0,eZ+8-e)/t.kk,"px)"):""}let y=tt.current.get("l-".concat(a));if(y){var w,b;let n=eG&&a===p?e-64:Math.max(64,t.w*t.kk);y.style.width="".concat(n,"px");let s=g-t.h*t.kk/2-(eG?76:40),i=g+t.h*t.kk/2+20;y.style.transform="translate(".concat(d-n/2,"px, ").concat(eG?s+(i-s)*r:i,"px)");let l=eG&&a!==p?null!=(b=null==(w=y.querySelector("[data-name]"))?void 0:w.offsetWidth)?b:n:0,c=l>0&&(d-l/2<8||d+l/2>e-8);y.style.opacity=c?"0":String(f*(o?1:1-r))}j.set(a,{cx:d,cy:g,w:t.w*t.kk,h:t.h*t.kk})});let w=tt.current.get("stub"),b=Math.max(0,Math.min(h.length-1,te.current)),N=j.get(b);if(w&&N){var k;let e=eG?N.cy+N.h/2+8:N.cy+N.h/2+20+20+18*!!ev.current(null==(k=h[b])?void 0:k.id)+36+12;w.style.transform="translate(".concat(N.cx-w.offsetWidth/2,"px, ").concat(e,"px)");let a=Math.max(0,1-3*Math.abs(t.x-b))*(1-Math.min(1,16*r))*(1-s)*(1-n);w.style.opacity=String(a),w.style.pointerEvents=a>.5?"":"none"}else w&&(w.style.opacity="0");let M=tt.current.get("flows");M&&(M.style.top="".concat(eZ,"px"),M.style.height="".concat(eJ.h-eZ-e0,"px"),M.style.opacity=String(a),M.style.transform="translateY(".concat((1-a)*32,"px)"),M.style.pointerEvents=a>.5?"":"none");let S=eK.current;if(S){S.style.width="".concat(e8,"px");let n=eG?64:eZ;S.style.maxHeight="".concat(eJ.h-n-e0-16,"px");let s=$(t.p);S.style.transform="translate(".concat((e-e8)/2,"px, ").concat(n+(1-s)*32,"px)"),S.style.opacity=String(s),S.style.pointerEvents=s>.5?"":"none"}let C=tt.current.get("dots");C&&(C.style.opacity=String((1-s)*(1-r)));let z=tt.current.get("branch");z&&(z.style.top="".concat(e9,"px"),z.style.height="".concat(e7.h,"px"),z.style.opacity=String(Math.max(0,Math.min(1,(r-.04)*6))),z.style.transformOrigin="50% 0",z.style.transform="translateY(".concat(((1-r)*eN.current).toFixed(1),"px) scale(").concat((.6+.4*r).toFixed(4),")"),z.style.pointerEvents=r>.5?"":"none");let E=tt.current.get("decision"),L=j.get(x);E&&L&&(eG?E.style.transform="translateY(".concat(eJ.h-e0-E.offsetHeight-12,"px)"):E.style.transform="translate(".concat(L.cx-L.w/2-340,"px, ").concat(L.cy-L.h/2,"px)"),E.style.opacity=String(n),E.style.pointerEvents=n>.5?"":"none");let P=tt.current.get("live"),T=x>=0?h[x]:void 0;if(P&&L&&T){let e=e5(T);P.style.left="".concat(L.cx-e.w/2+e.bezel,"px"),P.style.top="".concat(L.cy-e.h/2+e.bezel+e.bar,"px")}},[eJ,h,eG,e2,e8]),ta=(0,a.useCallback)(()=>{cancelAnimationFrame(eY.current),clearTimeout(eQ.current);let e=[["x","tx","vx"],["y","ty","vy"],["p","tp","vp"],["d","td","vd"],["q","tq","vq"]],t=()=>{let e=ej.current;eM(t=>t.x===e.x&&t.y===e.y?t:{x:e.x,y:e.y}),e.d||e$(!1),e.q||eF(!1)},n=performance.now(),s=a=>{let r=ej.current,i=Math.min(.05,Math.max(0,(a-n)/1e3));n=a;let l=ew.current.size>0;for(let[t,n,s]of e){if(ew.current.has(t)||r[t]===r[n]&&!r[s])continue;let e={x:r[t],v:r[s],to:r[n],r:"x"===t?r.rx:"d"===t?b.Cf.snappy:b.Cf.smooth};(0,b.PM)(e,i,"x"===t?5e-4:.001)||(l=!0),r[t]=e.x,r[s]=e.v}ts(),l?eY.current=requestAnimationFrame(s):(clearTimeout(eQ.current),t())};eM(e=>999===e.y?e:{...e,y:999}),eY.current=requestAnimationFrame(s),ew.current.size||(eQ.current=setTimeout(()=>{let n=ej.current;if(!ew.current.size&&e.some(e=>{let[t,s]=e;return n[t]!==n[s]})){for(let[t,s,a]of(cancelAnimationFrame(eY.current),e))n[t]=n[s],n[a]=0;ts(),t()}},1400))},[ts]);(0,a.useLayoutEffect)(()=>ts());let tr=(0,a.useCallback)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;eR(e),e&&e$(!0),ew.current.delete("d"),ej.current.td=+!!e,t&&(ej.current.vd=t),ta()},[ta]),ti=e=>{eE(e),eB(!1),ej.current.tp=+("plan"===e||"system"===e),ej.current.tq=+("flows"===e),"flows"===e&&eF(!0),"designs"!==e&&(eR(!1),ej.current.td=0),ta()},tl=(e,t)=>{let n=Math.max(0,Math.min(h.length-1,e)),s=ej.current;ew.current.delete("x"),s.rx=Math.abs(n-s.x)>1.5?b.Cf.gentle:b.Cf.smooth,void 0!==t&&(s.vx=t),ej.current.tx=n,ej.current.ty=0,ej.current.td=0,eC(n),eD(0),eR(!1),eB(!1),ta()},tc=e=>{let t=!eU||e>=eU.version;eD(t?0:e),ej.current.ty=+!t,ta()};(0,a.useEffect)(()=>{if(!eA.current){eA.current=!0;return}Math.round(ej.current.tx)!==ey&&tl(ey)},[ey]),(0,a.useEffect)(()=>{if(999===ek.y)return;let e=h[ek.x];e&&e.id!==m&&x(e.id)},[ek]);let to=(0,a.useRef)(new b.Hp),td=(0,a.useRef)(new b.Hp),tu=(0,a.useRef)(new b.JD),th=(0,a.useRef)({x:0,d:0}),tm=(0,a.useRef)(0),tx=(0,a.useRef)(void 0),tp=e=>{let t=ej.current;ew.current.add("x"),tm.current=Math.round(t.tx),t.vx=0,t.tx=t.x,th.current.x=t.x,tu.current.reset(e,t.x),t.ty&&(t.ty=0,eD(0)),ta()},tg=(e,t)=>{let n=ej.current,s=h.length-1;th.current.x=e,tu.current.add(t,e),n.x=n.tx=e<0?(0,b.VJ)(e,.5):e>s?s+(0,b.VJ)(e-s,.5):e,eC(Math.max(0,Math.min(s,Math.round(n.x)))),ts()},tf=e=>{if(!ew.current.has("x"))return;let t=ej.current,n=h.length-1,s=tu.current.speed(e),a=Math.max(0,Math.min(n,Math.round(t.x)));tl(Math.max(Math.min(tm.current-1,a),Math.min(Math.max(tm.current+1,a),Math.round((0,b.Cv)(t.x,s)))),s)},tv=(0,a.useRef)(0),ty=e=>{if(!ew.current.has("d"))return;let t=tu.current.speed(e),n=(0,b.Cv)(ej.current.d,t);tr(tv.current?n>.8:n>.2,t)};(0,a.useEffect)(()=>{let e=eO.current;if(!e)return;let t=(e,t)=>{let n=to.current.feed(e,t);if("coast"!==n){if((0,b.HV)(n,e)){to.current.stepped=!0,tl(Math.round(ej.current.tx)+Math.sign(e));return}"start"!==n&&ew.current.has("x")||tp(t),tg(th.current.x+e/eb.current,t),clearTimeout(tx.current),to.current.lifted?(to.current.release(),tf(t)):tx.current=setTimeout(()=>{to.current.release(),tf(t)},100)}},n=e=>{if(!("designs"!==ez||en||e.target.closest("iframe, [data-bar], .walk-note, textarea"))){if(!(Math.abs(e.deltaX)>Math.abs(e.deltaY))){if(eG)return;let t=!!eU&&!!T&&!!(null==A?void 0:A(eU).can)&&!!A(eU).count&&!eH;if(!eq&&!t&&!ew.current.has("d"))return;e.preventDefault();let n=td.current.feed(e.deltaY,e.timeStamp);if("coast"===n)return;if((0,b.HV)(n,e.deltaY)){td.current.stepped=!0,tr(e.deltaY>0&&t);return}"start"!==n&&ew.current.has("d")||(e=>{let t=ej.current;ew.current.has("d")||(tv.current=Math.round(t.td)),ew.current.add("d"),t.vd=0,th.current.d=t.d,tu.current.reset(e,t.d),e$(!0),ta()})(e.timeStamp),((e,t)=>{let n=ej.current;th.current.d=e,tu.current.add(t,e),n.d=n.td=e<0?(0,b.VJ)(e,.06):e>1?1+(0,b.VJ)(e-1,.06):e,ts()})(th.current.d+e.deltaY/eN.current,e.timeStamp),clearTimeout(tx.current),td.current.lifted?(td.current.release(),ty(e.timeStamp)):tx.current=setTimeout(()=>{td.current.release(),ty(e.timeStamp)},100);return}e.preventDefault(),eq||ew.current.has("d")||t(e.deltaX,e.timeStamp)}},s=n=>{var s;(null==(s=n.data)?void 0:s.type)!=="playground-wheel"||"number"!=typeof n.data.dx||"designs"!==ez||eq||en||[...e.querySelectorAll("iframe")].some(e=>e.contentWindow===n.source)&&t(n.data.dx,performance.now())};return e.addEventListener("wheel",n,{passive:!1}),addEventListener("message",s),()=>{e.removeEventListener("wheel",n),removeEventListener("message",s)}});let tj=(0,a.useRef)(null),tw=(0,a.useRef)(!1);(0,a.useEffect)(()=>{let e=eO.current;if(!e)return;let t=e=>{0!==e.button||"designs"!==ez||eq||en||e.target.closest("button, a, input, textarea, select, iframe, [data-bar], [data-branch], .walk-note, [role=dialog], [role=menu]")||(tj.current={id:e.pointerId,x0:e.clientX,y0:e.clientY,from:0,on:!1})},n=t=>{let n=tj.current;if(!n||t.pointerId!==n.id)return;let s=t.clientX-n.x0,a=t.clientY-n.y0;if(!n.on){var r;if(8>Math.hypot(s,a))return;if(Math.abs(a)>Math.abs(s)){tj.current=null;return}n.on=!0,n.x0=t.clientX,e.setPointerCapture(t.pointerId),e.style.userSelect="none",null==(r=getSelection())||r.removeAllRanges(),tp(t.timeStamp),n.from=th.current.x;return}tg(n.from-(t.clientX-n.x0)/eb.current,t.timeStamp)},s=t=>{let n=tj.current;if(!n||t.pointerId!==n.id)return;let s=n.on;tj.current=null,e.style.userSelect="",s&&(tw.current=!0,setTimeout(()=>tw.current=!1,0),"pointercancel"===t.type?tl(Math.round(ej.current.x)):tf(t.timeStamp))},a=e=>{tw.current&&(e.stopPropagation(),e.preventDefault())};return e.addEventListener("pointerdown",t),e.addEventListener("pointermove",n),e.addEventListener("pointerup",s),e.addEventListener("pointercancel",s),e.addEventListener("click",a,!0),()=>{e.removeEventListener("pointerdown",t),e.removeEventListener("pointermove",n),e.removeEventListener("pointerup",s),e.removeEventListener("pointercancel",s),e.removeEventListener("click",a,!0)}}),(0,a.useEffect)(()=>{let e=e=>{if(!(e.target instanceof Element&&e.target.closest("input, textarea, select, [contenteditable], [role=dialog], [role=menu]"))&&!eq&&!en){if("designs"!==ez){var t,n,s;if("p"!==e.key||!eP||e.metaKey||e.ctrlKey)if("Escape"!==e.key)return;else ti("designs");else es(null!=(s=null!=(n=null==el?void 0:el.start)?n:null==(t=h[0])?void 0:t.id)?s:null)}else if(W()||"ArrowRight"!==e.key)if(W()||"ArrowLeft"!==e.key)if("ArrowDown"===e.key&&!eH&&eU&&T&&(null==A?void 0:A(eU).can)&&A(eU).count)tr(!0);else if("Escape"===e.key&&eH)tc(0);else if("p"!==e.key||e.metaKey||e.ctrlKey||!V||eH||!eU)if("c"!==e.key||e.metaKey||e.ctrlKey||eH||!eU||"html"!==eU.kind&&"app"!==eU.kind)if("Escape"!==e.key||!eI)return;else eB(!1);else eB(e=>!e);else es(eU.id);else tl(Math.round(ej.current.tx)-1);else tl(Math.round(ej.current.tx)+1);e.preventDefault()}};return addEventListener("keydown",e),()=>removeEventListener("keydown",e)});let tb=999===ek.y?"moving":"system"===ez?"system":eL?"plan":eP?"flows":eq?"branch":eH?"past":"now",tN=(0,a.useCallback)(()=>tr(!1),[tr]),tk=!eq&&(0,s.jsx)(Y,{where:eL?"plan":eP?"flows":eH?"past":"now",project:u,focused:eU,pastV:eH,waitingPart:eu,waitingCount:null!=(o=null==ec?void 0:ec.sections.filter(e=>"proposed"===e.status).length)?o:0,planning:!!eh,building:em?null==ec?void 0:ec.sections.find(e=>e.id===em.section):void 0,act:et,error:ee,controls:v,tab:ez,onTab:ti,flows:ei,flow:el,onFlow:er,onPlayFlow:()=>{var e,t,n;return es(null!=(n=null!=(t=null==el?void 0:el.start)?t:null==(e=h[0])?void 0:e.id)?n:null)},toNow:()=>tc(0),more:"designs"===ez?y.filter(e=>e!==(null==eU?void 0:eU.id)&&!ep.has(e)):[],onMore:e=>tl(h.findIndex(t=>t.id===e)),nameOf:e=>{var t,n;return null!=(n=null==(t=h.find(t=>t.id===e))?void 0:t.name)?n:""}});return(0,s.jsxs)("div",{ref:eO,className:"relative -mt-14 h-dvh touch-pan-y overflow-hidden dot-grid","aria-label":u.name,children:[tk,0===h.length&&!eL&&(0,s.jsx)("p",{className:"absolute inset-x-0 top-1/2 mx-auto max-w-sm -translate-y-1/2 px-4 text-center text-ui text-pretty text-fg-secondary",children:"Nothing is designed yet. Screens appear here as the agent builds the parts of the plan you approve."}),(0,s.jsx)("div",{ref:eK,"data-scrolls":!0,className:"absolute left-0 top-0 overflow-y-auto rounded-dialog bg-bg-content shadow-float scrollbar-none will-change-transform",style:{opacity:+("plan"===U||"system"===U)},"aria-hidden":!eL||void 0,inert:!eL||void 0,children:"system"===ez?(0,s.jsx)(z.bG,{project:u.slug,name:u.name,themeSlug:null==(t=u.theme)?void 0:t.slug},"system"):ec?(0,s.jsx)(J,{project:u,plan:ec,running:ed,act:et,failed:null==Z?void 0:Z.failed}):(0,s.jsx)("div",{className:"h-96"})}),h.map((e,t)=>{var n;let a=e5(e),c=t===eX,o=c&&"now"===tb,d=q(e)&&2>=Math.abs(t-eX)&&!(c&&eH),u=(0,s.jsxs)("div",{ref:tn("s-".concat(e.id)),className:(0,w.cn)("absolute left-0 top-0 origin-center will-change-transform",(!c||eq)&&"cursor-pointer"),style:{width:a.w,height:a.h},onClick:()=>c?eq&&tr(!1):t!==Math.round(ej.current.tx)&&tl(t),"aria-hidden":o&&!d||void 0,children:[(0,s.jsx)("span",{"aria-hidden":!0,className:"pointer-events-none absolute floor-shadow",style:{left:"4%",right:"4%",top:"97%",height:"9%"}}),(0,s.jsx)("div",{style:{visibility:o&&!d?"hidden":"visible"},inert:!c||void 0,children:(0,s.jsx)(R,{screen:e,device:p(e),v:c&&eH?eH:e.version,s:a.s,run:d,using:o&&d&&!eI})})]}),h=(0,s.jsxs)("div",{ref:tn("l-".concat(t)),className:(0,w.cn)("absolute left-0 top-0 flex items-center justify-center gap-1.5 text-ui will-change-transform",!c&&"pointer-events-none"),children:[ep.has(e.id)&&(0,s.jsx)(j.q,{state:"drawing",className:"size-3.5 shrink-0 text-agent-work"}),(0,s.jsxs)("span",{className:"relative flex min-w-0 items-center",children:[(0,s.jsx)("span",{className:(0,w.cn)("block min-w-0 truncate",ep.has(e.id)&&"forming-text",c?"font-medium text-fg-primary":S[e.id]&&!ep.has(e.id)?"text-fg-primary":"text-fg-secondary"),"aria-label":ep.has(e.id)?"".concat(e.name,", the agent is working on it"):void 0,"data-name":!0,children:e.name}),eG&&S[e.id]&&!ep.has(e.id)&&!(c&&eH)&&(0,s.jsx)("span",{role:"img","aria-label":S[e.id],title:S[e.id],className:"absolute right-full top-1/2 mr-1.5 -translate-y-1/2",children:(0,s.jsx)(j.q,{state:"waiting",className:"size-3 text-agent-wait"})}),!eG&&S[e.id]&&!ep.has(e.id)&&!(c&&eH)&&(0,s.jsxs)("span",{className:"absolute left-1/2 top-full mt-0.5 flex -translate-x-1/2 items-center gap-1.5 whitespace-nowrap text-sm text-fg-secondary",children:[(0,s.jsx)(j.q,{state:"waiting",className:"size-3 text-agent-wait"}),S[e.id]]}),!eG&&c&&eg.get(e.id)&&!eH&&(0,s.jsx)("span",{className:"absolute left-1/2 top-full mt-0.5 -translate-x-1/2 whitespace-nowrap text-sm text-fg-secondary",children:eg.get(e.id)}),c&&"moving"!==tb&&!eq&&(0,s.jsxs)("span",{className:(0,w.cn)("settle-in absolute left-1/2 top-full flex -translate-x-1/2 items-center gap-1 whitespace-nowrap",ef(e.id)&&!eH?"mt-7":"mt-2"),children:[e.version>1&&(0,s.jsx)(B,{screen:e,value:eH||e.version,onPick:tc,short:eG}),!eH&&!!(null==(n=e.states)?void 0:n.length)&&(0,s.jsx)(Q,{states:e.states}),!eH&&("html"===e.kind||"app"===e.kind)&&(0,s.jsxs)(g.$,{size:"sm",variant:"ghost","aria-pressed":eI,title:"Point at what should change (C)",onClick:()=>eB(!eI),className:(0,w.cn)("shrink-0 text-fg-secondary",eI&&"bg-fill-selected text-fg-primary"),children:[!eG&&(0,s.jsx)(r.I,{}),"Mark up"]}),V&&!eH&&(0,s.jsxs)(g.$,{size:"sm",variant:"ghost",title:"Play the prototype from here (P)",onClick:()=>es(e.id),className:"shrink-0 text-fg-secondary",children:[!eG&&(0,s.jsx)(i.j,{weight:"fill"}),"Play"]}),T&&(null==A?void 0:A(e).can)&&!A(e).count&&!eH&&!eq&&(0,s.jsxs)(g.$,{size:"sm",variant:"ghost",onClick:()=>tr(!0),className:"shrink-0 text-fg-secondary",children:[!eG&&(0,s.jsx)(l.F,{}),"Create variants"]}),eG&&T&&(null==A?void 0:A(e).can)&&!!A(e).count&&!eH&&!eq&&(0,s.jsxs)(g.$,{size:"sm",variant:"ghost",onClick:()=>tr(!0),className:"num shrink-0 text-fg-secondary",children:[A(e).count," variants"]})]})]})]});return(0,s.jsxs)("div",{children:[h,u]},e.id)}),(0,s.jsx)("div",{ref:tn("decision"),className:(0,w.cn)("absolute left-0 top-0 will-change-transform",eG?"inset-x-3 rounded-dialog bg-bg-floating p-4 shadow-float":"w-80"),style:{opacity:0},children:eU&&eH>0&&(0,s.jsx)(O,{version:eH,note:null==(n=eU.notes)?void 0:n[eH],decisions:eo.filter(e=>e.screen===eU.id&&e.version===eH)})}),eU&&(0,s.jsx)("div",{ref:tn("live"),className:(0,w.cn)("absolute z-30",q(eU)&&"pointer-events-none"),style:{visibility:"now"===tb?"visible":"hidden"},children:f(eU,{w:e5(eU).screenW,h:e5(eU).screenH,s:e5(eU).s},{on:eI&&"now"===tb,set:eB},q(eU))}),!eG&&eU&&T&&(null==A?void 0:A(eU).can)&&!!A(eU).count&&!eq&&(0,s.jsx)("div",{ref:tn("stub"),className:"absolute left-0 top-0 z-20 will-change-transform",style:{opacity:0},children:(0,s.jsx)("div",{className:"settle-in",children:null!=(d=null==X?void 0:X(eU,()=>tr(!0),eJ.w,e1-84))?d:(0,s.jsx)(D,{count:A(eU).count,device:p(eU),name:eU.name,onOpen:()=>tr(!0)})})},eU.id),eT&&h.length>0&&(0,s.jsx)("div",{ref:tn("flows"),className:"absolute inset-x-0 z-10 will-change-transform",style:{opacity:0},children:(0,s.jsx)(I,{screens:h,device:p,flow:el,room:{w:eJ.w,h:eJ.h-eZ-e0},phone:eG,onPlay:e=>es(e),lineOf:e=>ep.has(e)?eg.get(e)?{busy:!0,words:eg.get(e)}:void 0:S[e]?{busy:!1,words:S[e]}:void 0})}),eU&&eW&&T&&(0,s.jsx)("div",{ref:tn("branch"),className:"absolute inset-x-0 z-20 will-change-transform",style:{opacity:0},children:T(eU,e7,eG,tN,eq)}),h.length>1&&(0,s.jsx)(N,{screens:h,aim:eS,working:ep,waiting:y,onGo:tl,navRef:tn("dots")}),en&&V&&(0,s.jsx)(H,{screens:h,start:en,device:p,play:V,onClose:()=>{es(null);let e=h.findIndex(e=>e.id===en);"designs"===ez&&e>=0&&e!==Math.round(ej.current.tx)&&tl(e)}})]})}function H(e){var t;let{screens:n,start:r,device:i,play:l,onClose:o}=e,[d,u]=(0,a.useState)(null),[h,m]=(0,a.useState)(!0),[p,f]=(0,a.useState)(r),v=(0,a.useRef)(r);v.current=p;let y=(0,a.useRef)(void 0);(0,a.useEffect)(()=>{let e=()=>u({w:innerWidth,h:innerHeight});e();let t=()=>{m(!0),clearTimeout(y.current),y.current=setTimeout(()=>m(!1),2e3)};t();let s=e=>{"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),o(v.current))},a=e=>{var t;(null==(t=e.data)?void 0:t.type)==="playground-goto"&&"string"==typeof e.data.screen&&n.some(t=>t.id===e.data.screen)&&f(e.data.screen)};return addEventListener("resize",e),addEventListener("pointermove",t),addEventListener("keydown",s,!0),addEventListener("message",a),()=>{clearTimeout(y.current),removeEventListener("resize",e),removeEventListener("pointermove",t),removeEventListener("keydown",s,!0),removeEventListener("message",a)}},[o,n]);let j=null!=(t=n.find(e=>e.id===p))?t:n[0];if(!d||!j)return null;let b=i(j),{w:N,h:C}=k.et[b],z=M.Qe[b],E=!("phone"===b&&d.w<768),L=E?Math.min(1,(d.h-48)/(C+z.bar+2*z.bezel),(d.w-48)/(N+2*z.bezel)):Math.min(d.w/N,d.h/C),P={w:Math.round(N*L),h:Math.round(C*L),s:L};return(0,x.createPortal)((0,s.jsxs)("div",{role:"dialog","aria-modal":!0,"aria-label":"".concat(j.name,", playing"),className:(0,w.cn)("fixed inset-0 z-60 grid place-items-center",E?"bg-canvas":"bg-bg-content"),children:[E?(0,s.jsx)("div",{style:{paddingTop:z.bar*L},children:(0,s.jsx)(M.KE,{device:b,box:P,children:l(j,P)})}):l(j,P),(0,s.jsx)("div",{className:(0,w.cn)(S.LJ,"fixed right-3 top-3 p-1 transition-opacity duration-300",h?"opacity-100":"pointer-events-none opacity-0"),children:(0,s.jsx)(g.$,{size:"icon-sm",variant:"ghost","aria-label":"Stop playing",title:"Stop playing (Esc)",onClick:()=>o(v.current),children:(0,s.jsx)(c.X,{})})})]}),document.body)}function D(e){let{count:t,device:n,name:a,onOpen:r}=e,i=Math.min(t,5),c="desktop"===n?{w:13,h:9}:"tablet"===n?{w:10,h:13}:{w:7,h:12},o=(c.w+4)/28,d=Array.from({length:i},(e,t)=>t-(i-1)/2),u=i?Math.abs(d[0])*o:0,h=i?56*Math.sin(u)+c.w+4:22,m=i?c.h+28*(1-Math.cos(u))+4:12,x=t?"".concat(t," ").concat(1===t?"variant":"variants"," of ").concat(a):"Create variants of ".concat(a);return(0,s.jsxs)("button",{type:"button",onClick:r,"aria-label":x,title:t?"".concat(t," ").concat(1===t?"variant":"variants"):"Create variants",className:"group/stub grid justify-items-center rounded-control px-2 py-1 text-fg-muted outline-hidden transition-hover hover:text-fg-primary focus-visible:ring-2 focus-visible:ring-ring",children:[i>0&&(0,s.jsx)("svg",{"aria-hidden":!0,width:h,height:m,viewBox:"0 0 ".concat(h," ").concat(m),fill:"none",stroke:"currentColor",strokeWidth:1,className:"overflow-visible",children:d.map(e=>{let t=e*o,a=h/2+28*Math.sin(t),r=2+28*(1-Math.cos(t));return(0,s.jsx)("rect",{x:a-c.w/2,y:r,width:c.w,height:c.h,rx:"desktop"===n?1.5:2.5,transform:"rotate(".concat(180*t/Math.PI," ").concat(a," ").concat(r,")")},e)})}),!i&&(0,s.jsx)("span",{className:"grid size-5 place-items-center rounded-full shadow-ring transition-hover group-hover/stub:bg-fill-hover",children:(0,s.jsx)(l.F,{className:"size-3"})})]})}function I(e){var t,n,r,l;let{screens:c,device:o,flow:d,room:u,phone:h,onPlay:m,lineOf:x}=e,[p,g]=(0,a.useState)(null),f=new Set(c.map(e=>e.id)),v=new Map(c.map(e=>{var t;return[e.id,(null!=(t=e.links)?t:[]).filter(t=>f.has(t)&&t!==e.id)]})),y=(null==d?void 0:d.start)&&f.has(d.start)?d.start:null==(t=c[0])?void 0:t.id,b=new Map,N=new Map,S=new Map,C=0,z=e=>{let t=C++;b.set(e,0),N.set(e,t);let n=[e];for(;n.length;){var s;let e=n.shift();for(let a of null!=(s=v.get(e))?s:[])b.has(a)||(b.set(a,b.get(e)+1),N.set(a,t),S.set(a,e),n.push(a))}};for(let e of(y&&z(y),c))b.has(e.id)||z(e.id);{let e=Math.max(0,...c.map(e=>b.get(e.id))),t=c.map(e=>e.id),n=new Map(b),s=0;for(let a=0;a<=e;a++){let e=t.filter(e=>n.get(e)===a),r=Math.max(1,Math.ceil(e.length/4));e.forEach((e,t)=>b.set(e,a+s+Math.floor(t/4))),s+=r-1}}let E=new Map,L=0;for(let e=0;e<C;e++){let t=c.filter(t=>N.get(t.id)===e),n=Math.max(...t.map(e=>b.get(e.id))),s=e=>{var t;return(null!=(t=v.get(e))?t:[]).some(t=>{var n;return(null!=(n=b.get(t))?n:0)>b.get(e)})};for(let e=1;e<=n;e++){let n=t.filter(t=>b.get(t.id)===e),a=new Map;if(1===e)[...n].sort((e,t)=>Number(s(t.id))-Number(s(e.id))).forEach((e,t)=>a.set(e.id,t));else for(let e of new Set(n.map(e=>S.get(e.id)))){let t=n.filter(t=>S.get(t.id)===e);t.forEach((n,s)=>{var r;return a.set(n.id,(null!=(r=E.get(e))?r:(t.length-1)/2)-(t.length-1)/2+s)})}let r=0;for(let e of[...n].sort((e,t)=>a.get(e.id)-a.get(t.id))){let t=Math.max(r,Math.round(a.get(e.id)));E.set(e.id,t),r=t+1}}for(let e of t.filter(e=>0===b.get(e.id))){let n=t.filter(t=>S.get(t.id)===e.id).map(e=>E.get(e.id));E.set(e.id,n.length?(Math.min(...n)+Math.max(...n))/2:0)}let a=Math.min(...t.map(e=>E.get(e.id)));for(let e of t)E.set(e.id,E.get(e.id)-a+L);let r=Math.max(...t.map(e=>E.get(e.id)))-L+1;L+=r+.5*(e<C-1)}let P=L,T=Math.max(...c.map(e=>b.get(e.id)))+1,F=x&&c.some(e=>x(e.id))?h?64:46:28,q=h?48:96,W=h?24:64,$=new Map(c.map(e=>[e.id,(e=>{let t=o(e),{w:n,h:s}=k.et[t],a=M.Qe[t],r="desktop"===t?(h?220:300)/(n+2*a.bezel):(h?200:300)/(s+2*a.bezel+a.bar);return{d:t,s:r,w:(n+2*a.bezel)*r,h:(s+2*a.bezel+a.bar)*r}})(e)])),A=Math.max(...c.map(e=>$.get(e.id).w)),H=Math.max(...c.map(e=>$.get(e.id).h)),D=Math.max(.4,Math.min(1,(u.w-2*W-(T-1)*q)/(T*A),(u.h-32-(P-1)*32-P*F)/(P*H))),I=new Map(c.map(e=>{let t=$.get(e.id);return[e.id,{d:t.d,s:t.s*D,w:t.w*D,h:t.h*D}]})),B=A*D,O=H*D+F,K=new Map;for(let e of c){let t=I.get(e.id),n=b.get(e.id),s=E.get(e.id);K.set(e.id,{x:W+n*(B+q)+(B-t.w)/2,y:16+s*(O+32)+(O-F-t.h)/2,w:t.w,h:t.h})}let J=2*W+T*B+(T-1)*q,V=32+P*O+(P-1)*32,Y=Math.max(0,(u.w-J)/2),Q=Math.max(0,(u.h-V)/2),X=[];for(let e of c)for(let t of null!=(n=v.get(e.id))?n:[]){let n=null==(r=v.get(t))?void 0:r.includes(e.id);n&&X.some(n=>n.a===t&&n.b===e.id)||X.push({a:e.id,b:t,both:!!n})}let U=new Map,G=(e,t)=>"".concat(e,":").concat(t?"r":"l");for(let e of X){let t=b.get(e.a),n=b.get(e.b);if(1===Math.abs(n-t))for(let s of[G(e.a,n>t),G(e.b,n<t)])U.set(s,[...null!=(l=U.get(s))?l:[],"".concat(e.a,"-").concat(e.b)])}let _=(e,t,n)=>{let s=U.get(G(e,t));return s&&s.length>1?(s.indexOf(n)-(s.length-1)/2)*8:0},Z="flow-head",ee=y?K.get(y):void 0;return(0,s.jsx)("div",{"data-scrolls":!0,className:"size-full overflow-auto scrollbar-none",onPointerLeave:()=>g(null),children:(0,s.jsxs)("div",{className:"relative",style:{width:Math.max(J,u.w),height:Math.max(V,u.h)},children:[(0,s.jsxs)("svg",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 size-full overflow-visible",fill:"none",children:[(0,s.jsx)("defs",{children:["lit","base","quiet","start"].map(e=>(0,s.jsx)("marker",{id:"".concat(Z,"-").concat(e),viewBox:"0 0 8 8",refX:"7",refY:"4",markerWidth:"8",markerHeight:"8",orient:"auto-start-reverse",className:"lit"===e?"text-fg-primary":"quiet"===e?"text-fg-faint":"start"===e?"text-fg-secondary":"text-fg-muted",children:(0,s.jsx)("path",{d:"M1 1 L7 4 L1 7",stroke:"currentColor",strokeWidth:1.25,strokeLinecap:"round",strokeLinejoin:"round",fill:"none"})},e))}),X.map(e=>{let t=p?e.a===p||e.b===p:((e,t)=>{if(!d)return!1;let n=d.screens.indexOf(e),s=d.screens.indexOf(t);return n>=0&&s>=0&&1===Math.abs(n-s)})(e.a,e.b),n=p&&!t||d&&!t,a=t?"lit":n?"quiet":"base";return(0,s.jsx)("path",{d:((e,t)=>{let n=K.get(e),s=K.get(t),a=b.get(e),r=b.get(t);if(a===r){let e=s.y>n.y,t=n.x+n.w/2+Y;return"M".concat(t," ").concat((e?n.y+n.h+F+8:n.y-2)+Q," V").concat((e?s.y-2:s.y+s.h+F+8)+Q)}let i=r>a;if(Math.abs(r-a)>1){let e=16+E.get(t)*(O+32)-16+Q,l=(i?n.x+n.w+8:n.x-8)+Y,c=n.y+n.h/2+Q,o=W+(i?a:a-1)*(B+q)+B+q/2+Y,d=W+(i?r-1:r)*(B+q)+B+q/2+Y,u=s.y+s.h/2+Q,h=[[l,c],[o,c],[o,e],[d,e],[d,u],[(i?s.x-8:s.x+s.w+8)+Y,u]],m="M".concat(h[0][0]," ").concat(h[0][1]);for(let e=1;e<h.length-1;e++){let[t,n]=h[e-1],[s,a]=h[e],[r,i]=h[e+1],l=Math.min(8,Math.hypot(s-t,a-n)/2,Math.hypot(r-s,i-a)/2),c=s-Math.sign(s-t)*l,o=a-Math.sign(a-n)*l,d=s+Math.sign(r-s)*l,u=a+Math.sign(i-a)*l;m+=" L".concat(c," ").concat(o," Q").concat(s," ").concat(a," ").concat(d," ").concat(u)}return"".concat(m," L").concat(h.at(-1)[0]," ").concat(h.at(-1)[1])}let l=12*!i,c=_(e,i,"".concat(e,"-").concat(t)),o=_(t,!i,"".concat(e,"-").concat(t)),d=(i?n.x+n.w+8:n.x-8)+Y,u=n.y+n.h/2+l+c+Q,h=(i?s.x-8:s.x+s.w+8)+Y,m=s.y+s.h/2+l+o+Q,x=i?1:-1,p=m>u?1:-1,g=W+(i?a:r)*(B+q)+B+q/2+Y+x*(p>0?-c:c);if(1>Math.abs(m-u))return"M".concat(d," ").concat(u," H").concat(h);let f=Math.min(8,Math.abs(m-u)/2);return"M".concat(d," ").concat(u," H").concat(g-x*f," Q").concat(g," ").concat(u," ").concat(g," ").concat(u+p*f," V").concat(m-p*f," Q").concat(g," ").concat(m," ").concat(g+x*f," ").concat(m," H").concat(h)})(e.a,e.b),stroke:"currentColor",strokeWidth:t?1.5:1,markerEnd:"url(#".concat(Z,"-").concat(a,")"),markerStart:e.both?"url(#".concat(Z,"-").concat(a,")"):void 0,className:(0,w.cn)("transition-colors duration-150",t?"text-fg-primary":n?"text-fg-faint":"text-fg-muted")},"".concat(e.a,"-").concat(e.b))}),ee&&(0,s.jsxs)("g",{className:"text-fg-secondary",stroke:"currentColor",children:[(0,s.jsx)("circle",{cx:ee.x+Y-44,cy:ee.y+ee.h/2+Q,r:3,fill:"currentColor",stroke:"none"}),(0,s.jsx)("path",{d:"M".concat(ee.x+Y-40," ").concat(ee.y+ee.h/2+Q," H").concat(ee.x+Y-10),strokeWidth:1,markerEnd:"url(#".concat(Z,"-start)")})]})]}),c.map(e=>{let t,n=K.get(e.id),a=I.get(e.id),r=d&&(t=e.id,!(!d||d.screens.includes(t))),l=null==x?void 0:x(e.id);return(0,s.jsxs)("button",{type:"button",onClick:()=>m(e.id),onPointerEnter:()=>g(e.id),onFocus:()=>g(e.id),"aria-label":"Play the prototype from ".concat(e.name),className:(0,w.cn)("group/node absolute flex flex-col items-center gap-2 rounded-panel outline-hidden transition-opacity duration-150 focus-visible:ring-2 focus-visible:ring-ring",r&&"opacity-35"),style:{left:n.x+Y,top:n.y+Q,width:n.w},children:[(0,s.jsx)("span",{className:"relative block",children:(0,s.jsx)(R,{screen:e,device:a.d,v:e.version,s:a.s})}),(0,s.jsxs)("span",{className:"flex w-max flex-col items-center gap-0.5",style:{maxWidth:B+q-8},children:[(0,s.jsxs)("span",{className:(0,w.cn)("flex max-w-full items-center gap-1.5 text-ui",p===e.id?"font-medium text-fg-primary":"text-fg-secondary"),children:[(0,s.jsx)(i.j,{weight:"fill","aria-hidden":!0,className:"size-3 shrink-0 opacity-0 transition-opacity duration-150 group-hover/node:opacity-100 group-focus-visible/node:opacity-100"}),(0,s.jsx)("span",{className:"min-w-0 truncate",children:e.name}),(0,s.jsx)("span",{"aria-hidden":!0,className:"size-3 shrink-0"})]}),l&&(0,s.jsxs)("span",{className:"w-max text-balance text-center text-sm text-fg-secondary",style:{maxWidth:n.w+q-32},children:[(0,s.jsx)(j.q,{state:l.busy?"drawing":"waiting",className:(0,w.cn)("mr-1.5 inline-block size-3 align-middle",l.busy?"text-agent-work":"text-agent-wait")}),(0,s.jsx)("span",{className:(0,w.cn)(l.busy&&"forming-text"),children:l.words})]})]})]},e.id)})]})})}function B(e){let{screen:t,value:n,onPick:a,short:r}=e;return(0,s.jsxs)(f.rI,{modal:!1,children:[(0,s.jsx)(f.ty,{asChild:!0,children:(0,s.jsxs)(g.$,{variant:"ghost",size:"sm",className:"num shrink-0 gap-1.5 text-fg-secondary","aria-label":"".concat(t.name,"'s versions, showing version ").concat(n),children:[r?"v".concat(n):"Version ".concat(n),(0,s.jsx)(o.a,{weight:"bold",className:"text-fg-meta"})]})}),(0,s.jsx)(f.SQ,{align:"center",className:"max-h-72 w-40 overflow-y-auto",children:(0,s.jsx)(f.Hr,{value:String(n),onValueChange:e=>a(Number(e)),children:Array.from({length:t.version},(e,n)=>t.version-n).map(e=>(0,s.jsxs)(f.Ht,{value:String(e),className:"num",children:["Version ",e]},e))})})]})}function O(e){var t,n;let a,{version:r,note:i,decisions:l}=e,c=l[0],o=l.slice(1,4),d=e=>"you"===e?"You":"agent"===e?"The agent":"The agent, kept by you";return(0,s.jsxs)("article",{className:"grid gap-2",children:[(0,s.jsxs)("p",{className:"flex items-baseline gap-2 text-ui",children:[(0,s.jsxs)("span",{className:"font-semibold text-fg-primary",children:["Version ",r]}),c&&(0,s.jsx)("span",{className:"num text-fg-meta",children:(a=c.at)?new Date(a).toLocaleDateString("en-US",{month:"short",day:"numeric"}):""})]}),(0,s.jsx)("h3",{className:"text-heading font-semibold text-balance text-fg-primary",children:null!=(n=null!=(t=null==c?void 0:c.what)?t:i)?n:"No decision was logged for this version."}),c&&(0,s.jsxs)("dl",{className:"grid gap-1.5 text-ui",children:[c.why&&(0,s.jsx)(K,{term:"Why",className:"w-18",children:c.why}),c.tradeoff&&(0,s.jsx)(K,{term:"Tradeoff",className:"w-18",children:c.tradeoff}),(0,s.jsx)(K,{term:"Decided by",className:"w-18",children:d(c.who)})]}),o.length>0&&(0,s.jsx)("ul",{className:"grid gap-1 pt-1 text-sm",children:o.map(e=>(0,s.jsxs)("li",{className:"text-fg-secondary",children:[(0,s.jsxs)("span",{className:"text-fg-meta",children:[d(e.who),": "]}),e.what]},e.id))})]})}function K(e){let{term:t,children:n,className:a="w-22",edit:r}=e;return(0,s.jsxs)("div",{className:"flex gap-3 max-md:flex-col max-md:gap-0.5",children:[(0,s.jsx)("dt",{className:(0,w.cn)("shrink-0 text-fg-meta",a),children:t}),(0,s.jsx)("dd",{...r,className:(0,w.cn)(null==r?void 0:r.className,"min-w-0 flex-1 text-fg-secondary"),children:n})]})}function J(e){let{project:t,plan:n,running:r,act:i,failed:l}=e,c=e=>("planning"===e.status||"building"===e.status)&&!r.some(t=>t.section===e.id)&&!!(null==l?void 0:l.some(t=>t.key==="".concat("planning"===e.status?"plan":"build","-").concat(e.id))),[o,x]=(0,a.useState)(null),[f,y]=(0,a.useState)(null),[b,N]=(0,a.useState)(""),k=e=>{var t;return(null!=(t=e.feedback)?t:[]).filter(e=>!e.done).at(-1)},M=e=>{let t=r.find(t=>t.section===e.id);return c(e)?(0,s.jsx)("span",{className:"text-status-danger",children:"planning"===e.status?"Stopped before it was written up":"The build stopped"}):(null==t?void 0:t.kind)==="planning"||"planning"===e.status?(0,s.jsxs)("span",{className:"flex items-center gap-1.5 text-agent-work",children:[(0,s.jsx)(j.q,{state:"reading",className:"size-3.5"}),(0,s.jsx)("span",{className:"forming-text",children:k(e)?"Rewriting it":"Writing it up"})]}):(null==t?void 0:t.kind)==="building"?(0,s.jsxs)("span",{className:"flex items-center gap-1.5 text-agent-work",children:[(0,s.jsx)(j.q,{state:"building",className:"size-3.5"}),(0,s.jsx)("span",{className:"forming-text",children:"Being built"})]}):"building"===e.status?(0,s.jsxs)("span",{className:"flex items-center gap-1.5 text-fg-muted",children:[(0,s.jsx)(j.q,{state:"queued",className:"size-3.5"}),"Up next"]}):"proposed"===e.status?(0,s.jsxs)("span",{className:"flex items-center gap-1.5 text-agent-wait",children:[(0,s.jsx)(j.q,{state:"waiting",className:"size-3.5"}),"Waiting for you"]}):"review"===e.status?(0,s.jsxs)("span",{className:"flex items-center gap-1.5 text-agent-wait",children:[(0,s.jsx)(j.q,{state:"waiting",className:"size-3.5"}),"Ready to review"]}):"rejected"===e.status?(0,s.jsx)("span",{className:"text-fg-meta",children:"Turned down"}):null},S=(e,t)=>({contentEditable:"proposed"===e.status,suppressContentEditableWarning:!0,onBlur:n=>{let s=n.currentTarget.innerText.trim();s&&s!==e[t]&&i({action:"edit",section:e.id,[t]:s})},className:(0,w.cn)("rounded-item outline-hidden","proposed"===e.status&&"-mx-1 px-1 transition-hover hover:bg-fill-hover focus:bg-fill-selected")}),[z,E]=(0,a.useState)(""),[L,P]=(0,a.useState)([]),[T,F]=(0,a.useState)([]),q=z.toLowerCase().split(/\s+/).filter(Boolean),R=n.sections.filter(e=>"proposed"===e.status||"review"===e.status),W=n.sections.filter(e=>"planning"===e.status||"building"===e.status),$=n.sections.filter(e=>"built"===e.status),A=$.filter(e=>q.every(t=>[e.title,e.does,e.uses,e.approach,e.brief,e.screens.join(" ")].join(" ").toLowerCase().includes(t))),H=n.sections.filter(e=>"rejected"===e.status),D=(0,m.Xd)(A),I=(0,p.useSearchParams)().get("part"),{onPage:B}=D.pager;(0,a.useEffect)(()=>{if(!I)return;let e=A.findIndex(e=>e.id===I);e>=0&&B(Math.floor(e/D.pager.size)),(e>=0||H.some(e=>e.id===I))&&P(e=>e.includes(I)?e:[...e,I]),requestAnimationFrame(()=>{var e;return null==(e=document.getElementById("part-".concat(I)))?void 0:e.scrollIntoView({block:"start"})})},[I]);let O=e=>(0,s.jsxs)(s.Fragment,{children:[k(e)&&(0,s.jsxs)("div",{className:"grid gap-1 rounded-item bg-bg-content px-3 py-2.5 text-ui",children:[(0,s.jsx)("span",{className:"text-sm text-fg-meta",children:k(e).screen?"You asked, about ".concat(k(e).screen):"You asked"}),(0,s.jsx)("p",{className:"text-pretty text-fg-primary",children:k(e).text})]}),"planning"!==e.status||k(e)?"proposed"===e.status?(0,s.jsx)(s.Fragment,{children:e.does&&(0,s.jsx)("p",{...S(e,"does"),className:(0,w.cn)(S(e,"does").className,"max-w-prose text-ui text-pretty text-fg-secondary"),children:e.does})}):(0,s.jsxs)("dl",{className:"grid gap-1.5 text-ui",children:[e.does&&(0,s.jsx)(K,{term:"Does",edit:S(e,"does"),children:e.does}),e.uses&&(0,s.jsx)(K,{term:"Uses",edit:S(e,"uses"),children:e.uses}),e.approach&&(0,s.jsx)(K,{term:"Approach",edit:S(e,"approach"),children:e.approach}),e.screens.length>0&&(0,s.jsx)(K,{term:"Screens",children:e.screens.join(", ")})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("p",{className:"text-ui text-fg-meta",children:["“",e.brief,"”"]}),c(e)&&(0,s.jsx)(g.$,{size:"sm",variant:"ghost",className:"-ml-2.5 self-start",onClick:()=>void i({action:"change",section:e.id,text:e.brief}),children:"Ask again"})]}),e.ask&&"proposed"===e.status&&(0,s.jsxs)("div",{role:"radiogroup","aria-label":e.ask.q,className:"flex flex-col gap-2 pt-1",children:[(0,s.jsx)("span",{className:"text-ui font-medium text-fg-primary",children:e.ask.q}),(0,s.jsx)("div",{className:"grid gap-2",children:e.ask.options.map((t,n)=>{var a;let r=e.ask.value===t;return(0,s.jsxs)("button",{type:"button",role:"radio","aria-checked":r,onClick:()=>!r&&void i({action:"edit",section:e.id,answer:t}),className:(0,w.cn)("flex items-start gap-3 rounded-item p-4 text-left outline-hidden transition-hover focus-visible:ring-2 focus-visible:ring-ring",r?"bg-fill-selected shadow-ring-strong":"bg-bg-content shadow-ring hover:bg-fill-hover"),children:[(0,s.jsx)("span",{"aria-hidden":!0,className:(0,w.cn)("mt-0.5 grid size-3.5 shrink-0 place-items-center rounded-full",r?"shadow-ring-strong":"shadow-ring"),children:r&&(0,s.jsx)("span",{className:"size-1.5 rounded-full bg-fg-primary"})}),(0,s.jsxs)("span",{className:"grid min-w-0 flex-1 gap-1",children:[(0,s.jsxs)("span",{className:"flex flex-wrap items-baseline gap-x-2 text-ui font-medium text-fg-primary",children:[t,0===n&&(0,s.jsx)("span",{className:"text-sm font-normal text-fg-meta",children:"Recommended"})]}),(null==(a=e.ask.why)?void 0:a[n])&&(0,s.jsx)("span",{className:"text-sm text-pretty text-fg-secondary",children:e.ask.why[n]})]})]},t)})})]}),"proposed"===e.status&&(e.approach||e.uses||e.screens.length>0)&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("button",{type:"button","aria-expanded":T.includes(e.id),onClick:()=>F(t=>t.includes(e.id)?t.filter(t=>t!==e.id):[...t,e.id]),className:"flex items-center gap-1.5 self-start rounded-item text-sm text-fg-secondary outline-hidden transition-hover hover:text-fg-primary focus-visible:ring-2 focus-visible:ring-ring",children:[(0,s.jsx)(d.K,{className:(0,w.cn)("size-3.5 transition-transform",T.includes(e.id)&&"rotate-90")}),"How it would be built"]}),T.includes(e.id)&&(0,s.jsxs)("dl",{className:"grid gap-1.5 pl-5 text-ui",children:[e.approach&&(0,s.jsx)(K,{term:"Approach",edit:S(e,"approach"),children:e.approach}),e.uses&&(0,s.jsx)(K,{term:"Uses",edit:S(e,"uses"),children:e.uses}),e.screens.length>0&&(0,s.jsx)(K,{term:"Screens",children:e.screens.join(", ")})]})]}),e.ask&&"proposed"!==e.status&&"planning"!==e.status&&(0,s.jsxs)("p",{className:"text-sm text-fg-meta",children:[e.ask.q," ",e.ask.value,"."]}),e.rejected&&(0,s.jsxs)("p",{className:"text-sm text-fg-meta",children:["Turned down: ",e.rejected]}),"proposed"===e.status&&o!==e.id&&(f===e.id?(0,s.jsxs)("form",{className:"flex flex-col gap-2 pt-1",onSubmit:async t=>{t.preventDefault(),b.trim()&&await i({action:"reject",section:e.id,why:b})&&(y(null),N(""))},children:[(0,s.jsx)(v.T,{autoFocus:!0,value:b,onChange:e=>N(e.target.value),"aria-label":"What's wrong with this part",placeholder:"What's wrong, so the next plan answers it",rows:2,className:"min-h-16 resize-none"}),(0,s.jsxs)("span",{className:"ml-auto flex gap-1.5",children:[(0,s.jsx)(g.$,{type:"button",variant:"ghost",size:"sm",onClick:()=>y(null),children:"Cancel"}),(0,s.jsx)(g.$,{type:"submit",size:"sm",disabled:!b.trim(),children:"Turn it down"})]})]}):(0,s.jsxs)("span",{className:"flex flex-wrap gap-1.5 pt-2",children:[(0,s.jsx)(g.$,{size:"sm",onClick:()=>void i({action:"approve",section:e.id}),children:"Approve and build"}),(0,s.jsx)(g.$,{size:"sm",variant:"ghost",onClick:()=>x(e.id),children:"Change"}),(0,s.jsx)(g.$,{size:"sm",variant:"ghost",onClick:()=>(y(e.id),N("")),children:"Not this"})]})),o===e.id&&(0,s.jsx)(V,{screens:t.screens,onCancel:()=>x(null),onSend:async(t,n)=>await i({action:"change",section:e.id,text:t,screen:n})&&x(null)})]}),J=e=>(0,s.jsxs)("section",{id:"part-".concat(e.id),"aria-label":e.title,className:(0,w.cn)(C.pj,"scroll-mt-8 flex flex-col gap-3 p-5","proposed"===e.status&&"gap-4"),children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-baseline gap-x-3 gap-y-1",children:[(0,s.jsx)("h3",{...S(e,"title"),className:(0,w.cn)(S(e,"title").className,"min-w-0 flex-1 basis-56 text-heading font-semibold text-balance text-fg-primary"),children:e.title}),M(e)&&(0,s.jsx)("span",{className:"shrink-0 text-sm",children:M(e)})]}),O(e),"proposed"!==e.status&&("planning"!==e.status&&"building"!==e.status||c(e)&&"building"===e.status)&&o!==e.id&&(0,s.jsx)(g.$,{size:"sm",variant:"secondary",className:"mt-1 self-start",onClick:()=>x(e.id),children:"Change"})]},e.id),Y=e=>{let t=L.includes(e.id);return(0,s.jsxs)("section",{id:"part-".concat(e.id),"aria-label":e.title,className:(0,w.cn)(C.pj,"scroll-mt-8 flex flex-col p-0","rejected"===e.status&&"opacity-60"),children:[(0,s.jsxs)("button",{type:"button","aria-expanded":t,onClick:()=>{let t;return t=e.id,P(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])},className:"flex items-start gap-3 rounded-panel p-4 text-left outline-hidden transition-hover hover:bg-fill-hover hover:duration-0 focus-visible:ring-2 focus-visible:ring-ring",children:[(0,s.jsx)(d.K,{"aria-hidden":!0,className:(0,w.cn)("mt-0.5 size-3.5 shrink-0 text-fg-muted transition-transform",t&&"rotate-90")}),(0,s.jsxs)("span",{className:"grid min-w-0 flex-1 gap-1",children:[(0,s.jsx)("span",{className:"text-ui font-medium text-pretty text-fg-primary",children:e.title}),!t&&e.does&&(0,s.jsx)("span",{className:"line-clamp-2 text-sm text-pretty text-fg-secondary",children:e.does})]})]}),t&&(0,s.jsxs)("div",{className:"flex flex-col gap-2 px-4 pb-4 pl-10.5",children:[O(e),o!==e.id&&(0,s.jsx)(g.$,{size:"sm",variant:"secondary",className:"mt-1 self-start",onClick:()=>x(e.id),children:"Change"})]})]},e.id)};return(0,s.jsxs)("article",{className:"flex flex-col gap-3 p-8 max-md:p-5","aria-label":"".concat(t.name,"'s plan"),children:[(0,s.jsxs)("header",{className:"grid gap-2 pb-2",children:[(0,s.jsx)("h2",{className:"text-title font-semibold text-fg-primary",children:t.name}),n.brief&&(0,s.jsx)("p",{className:"text-ui text-pretty text-fg-secondary",children:n.brief})]}),0===n.sections.length&&(0,s.jsx)("p",{className:"text-ui text-fg-meta",children:"Nothing planned yet. New design starts the plan."}),R.length>0&&(0,s.jsx)(m.wn,{title:"Needs you",count:R.length,children:(0,s.jsx)("div",{className:"grid gap-2",children:R.map(J)})}),W.length>0&&(0,s.jsx)(m.wn,{title:"Being worked on",count:W.length,children:(0,s.jsx)("div",{className:"grid gap-2",children:W.map(J)})}),$.length>0&&(0,s.jsxs)(m.wn,{title:"Built",count:$.length,action:$.length>5&&(0,s.jsxs)("div",{className:"relative w-56 max-md:w-44",children:[(0,s.jsx)(u.e,{className:"pointer-events-none absolute left-2.5 top-1/2 size-3.5 -translate-y-1/2 text-fg-muted"}),(0,s.jsx)(h.p,{value:z,onChange:e=>(E(e.target.value),D.pager.onPage(0)),placeholder:"Search built parts","aria-label":"Search built parts",className:"h-8 pl-8"})]}),children:[0===A.length?(0,s.jsx)(m.pp,{plain:!0,icon:u.e,title:"No built part matches"}):(0,s.jsx)("div",{className:"grid gap-2",children:D.shown.map(Y)}),(0,s.jsx)(m.is,{...D.pager})]}),H.length>0&&(0,s.jsx)(m.wn,{title:"Turned down",count:H.length,children:(0,s.jsx)("div",{className:"grid gap-2",children:H.map(Y)})})]})}function V(e){let{screens:t,onCancel:n,onSend:r}=e,[i,l]=(0,a.useState)(""),[c,d]=(0,a.useState)(),[u,h]=(0,a.useState)(!1);return(0,s.jsxs)("form",{className:"grid gap-2 rounded-item bg-bg-content p-2.5 shadow-ring",onSubmit:async e=>{e.preventDefault(),i.trim()&&!u&&(h(!0),await r(i.trim(),c),h(!1))},children:[(0,s.jsx)(v.T,{autoFocus:!0,value:i,onChange:e=>l(e.target.value),onKeyDown:e=>{var t;"Escape"===e.key&&(e.stopPropagation(),n()),"Enter"===e.key&&(e.metaKey||e.ctrlKey)&&(null==(t=e.currentTarget.form)||t.requestSubmit())},rows:2,placeholder:"What should change","aria-label":"What should change",className:"min-h-16 resize-none"}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[t.length>0&&(0,s.jsxs)(f.rI,{modal:!1,children:[(0,s.jsx)(f.ty,{asChild:!0,children:(0,s.jsxs)(g.$,{type:"button",size:"sm",variant:"ghost",className:"shrink-0",children:[null!=c?c:"About a screen",(0,s.jsx)(o.a,{})]})}),(0,s.jsx)(f.SQ,{align:"start",className:"max-h-72 w-48 overflow-y-auto",children:(0,s.jsxs)(f.Hr,{value:null!=c?c:"",onValueChange:e=>d(e||void 0),children:[(0,s.jsx)(f.Ht,{value:"",children:"No screen"}),t.map(e=>(0,s.jsx)(f.Ht,{value:e.name,children:e.name},e.id))]})})]}),(0,s.jsxs)("span",{className:"ml-auto flex gap-1.5",children:[(0,s.jsx)(g.$,{type:"button",size:"sm",variant:"ghost",onClick:n,children:"Cancel"}),(0,s.jsx)(g.$,{type:"submit",size:"sm",disabled:!i.trim()||u,children:"Send to the agent"})]})]})]})}function Y(e){var t,n;let a,{where:r,project:l,focused:c,pastV:u,waitingPart:h,waitingCount:m,planning:x,building:p,act:v,error:b,controls:N,tab:k,onTab:M,flows:C,flow:z,onFlow:E,onPlayFlow:L,toNow:T,more:F=[],onMore:q,nameOf:R}=e,W=(0,s.jsxs)(y.O,{type:"single",size:"sm",value:k,onValueChange:e=>e&&M(e),"aria-label":"What ".concat(l.name," shows"),className:"shrink-0",children:[(0,s.jsxs)(y.d,{value:"plan","aria-label":h?"Plan, a part waits for you":"Plan",children:[(h||x)&&(0,s.jsx)(j.q,{state:x?"reading":"waiting",className:(0,w.cn)("size-3.5",x?"text-agent-work":"text-agent-wait")}),"Plan"]}),(0,s.jsx)(y.d,{value:"designs",children:"Designs"}),(0,s.jsx)(y.d,{value:"flows",children:"Flows"}),(0,s.jsx)(y.d,{value:"system",children:"Design system"})]}),$=(0,s.jsx)("span",{"aria-hidden":!0,className:"mx-1 h-4 w-px shrink-0 bg-border-divider"}),A="now"===r&&F.length>0&&q&&R&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"shrink-0 px-2 text-sm text-fg-secondary",children:1===F.length?"1 more needs you":"".concat(F.length," more need you")}),(0,s.jsxs)(g.$,{size:"sm",onClick:()=>q(F[0]),"aria-label":"Next that needs you: ".concat(R(F[0])),className:"shrink-0",children:[R(F[0]),(0,s.jsx)(d.K,{})]})]}),H=(0,s.jsx)(P.q,{project:l,act:v});return a="plan"===r&&h?(0,s.jsxs)(s.Fragment,{children:[W,$,(0,s.jsx)(g.$,{variant:"accent",size:"sm",onClick:()=>void v({action:"approve-all"}),className:"shrink-0",children:m>1?"Approve and build all ".concat(m):"Approve and build"})]}):"plan"===r||"system"===r?(0,s.jsxs)(s.Fragment,{children:[W,$,H]}):"flows"===r?(0,s.jsxs)(s.Fragment,{children:[W,$,C.length>0&&(0,s.jsxs)(f.rI,{modal:!1,children:[(0,s.jsx)(f.ty,{asChild:!0,children:(0,s.jsxs)(g.$,{size:"sm",variant:"ghost",className:"shrink-0",children:[null!=(t=null==z?void 0:z.name)?t:"Every screen",(0,s.jsx)(o.a,{})]})}),(0,s.jsx)(f.SQ,{side:"top",align:"center",className:"w-48",children:(0,s.jsxs)(f.Hr,{value:null!=(n=null==z?void 0:z.id)?n:"",onValueChange:E,children:[(0,s.jsx)(f.Ht,{value:"",children:"Every screen"}),C.map(e=>(0,s.jsx)(f.Ht,{value:e.id,children:e.name},e.id))]})})]}),(0,s.jsxs)(g.$,{size:"sm",title:"Play the prototype (P)","aria-label":"Play prototype",onClick:L,className:"shrink-0",children:[(0,s.jsx)(i.j,{weight:"fill"}),(0,s.jsx)("span",{className:"max-sm:hidden",children:"Play prototype"})]}),N&&$,N]}):"past"===r&&c?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("span",{className:"px-2 text-ui font-medium text-fg-primary",children:[c.name,", version ",u]}),(0,s.jsxs)(g.$,{size:"sm",variant:"primary",onClick:T,children:["Back to version ",c.version]})]}):(0,s.jsxs)(s.Fragment,{children:[A&&(0,s.jsxs)("span",{className:"flex shrink-0 items-center gap-1 max-sm:hidden",children:[A,$]}),A&&(0,s.jsxs)(g.$,{size:"sm",onClick:()=>q(F[0]),"aria-label":"Next that needs you: ".concat(R(F[0])),title:R(F[0]),className:"shrink-0 gap-1 px-2 sm:hidden",children:[(0,s.jsx)(j.q,{state:"waiting",className:"size-3.5 text-agent-wait"}),(0,s.jsx)(d.K,{})]}),W,p&&(0,s.jsxs)("span",{className:"flex max-w-56 shrink-0 items-center gap-2 px-2 text-ui font-medium text-fg-primary",children:[(0,s.jsx)(j.q,{state:"drawing",className:"size-4 shrink-0 text-agent-work"}),(0,s.jsxs)("span",{className:"truncate",children:["Building ",p.title]})]}),H,N&&$,N]}),(0,s.jsxs)("div",{"data-bar":!0,className:"pointer-events-none absolute inset-x-0 bottom-0 z-40 flex flex-col items-center gap-2 px-4 pb-5",children:[b&&(0,s.jsx)("p",{className:"pointer-events-auto rounded-item bg-bg-floating px-3 py-1.5 text-sm text-status-danger shadow-float",children:b}),(0,s.jsx)("div",{className:(0,w.cn)(S.LJ,"pointer-events-auto flex max-w-full items-center gap-1 overflow-x-auto p-1.5 scrollbar-none"),children:a})]})}function Q(e){let{states:t}=e,n=(0,p.useSearchParams)().get("state"),a=n&&t.includes(n)?n:"filled";return(0,s.jsxs)(y.O,{type:"single",size:"sm",value:a,onValueChange:e=>{if(!e)return;let t=new URL(window.location.href);"filled"===e?t.searchParams.delete("state"):t.searchParams.set("state",e),window.history.replaceState(null,"",t.pathname+t.search)},"aria-label":"State",className:"shrink-0",children:[(0,s.jsx)(y.d,{value:"filled",children:"Filled"}),t.map(e=>(0,s.jsx)(y.d,{value:e,children:e[0].toUpperCase()+e.slice(1).replace(/-/g," ")},e))]})}},87736:(e,t,n)=>{n.d(t,{NewSystem:()=>W,ProjectSystem:()=>z,SystemPage:()=>C,bG:()=>L});var s=n(95155),a=n(52619),r=n.n(a),i=n(20063),l=n(12115),c=n(22747),o=n(68772),d=n(99211),u=n(1144),h=n(41880),m=n(67279),x=n(66419),p=n(72e3),g=n(76654),f=n(74371),v=n(32296),y=n(51063),j=n(63765),w=n(50847),b=n(83949),N=n(22383),k=n(93890),M=n(80526);function S(e){let{theme:t,className:n}=e,{mode:a}=(0,k.b)();return(0,s.jsxs)(j.WB,{theme:{...t,mode:a},className:n,children:[(0,s.jsx)(w.wn,{title:"Colour",children:(0,s.jsx)("div",{className:"grid gap-5",children:b.n7.map(e=>(0,s.jsxs)("div",{className:"flex items-start gap-4 max-md:flex-col max-md:gap-2",children:[(0,s.jsx)("span",{className:"w-24 shrink-0 pt-1 text-ui text-fg-meta",children:e.name}),(0,s.jsx)("div",{className:"grid min-w-0 flex-1 grid-cols-4 gap-3 max-md:w-full max-md:gap-2",children:e.items.map(e=>(0,s.jsxs)("div",{className:"min-w-0",children:[e.text?(0,s.jsx)("div",{className:(0,M.cn)("grid h-14 place-items-center rounded-control bg-bg-content font-heading text-title font-semibold shadow-ring",e.cls),children:"Aa"}):(0,s.jsx)("div",{className:(0,M.cn)("h-14 rounded-control shadow-ring",e.cls)}),(0,s.jsx)("div",{className:"mt-1.5 truncate text-ui text-fg-secondary",children:e.name}),(0,s.jsx)(b.Kp,{className:"block break-all",children:e.token})]},e.token))})]},e.name))})}),(0,s.jsxs)(w.wn,{title:"Type",children:[(0,s.jsx)("div",{className:"grid grid-cols-2 gap-3 max-md:grid-cols-1",children:[{role:"Headings",family:t.fonts.heading.family,cls:"font-heading font-semibold"},{role:"Text",family:t.fonts.body.family,cls:"font-sans"}].map(e=>(0,s.jsxs)("div",{className:"flex items-center gap-4 rounded-panel bg-bg-content p-4 shadow-ring",children:[(0,s.jsx)("span",{className:(0,M.cn)("text-display text-fg-primary",e.cls),children:"Aa"}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("div",{className:"truncate text-ui text-fg-primary",children:e.family}),(0,s.jsx)("div",{className:"text-ui text-fg-meta",children:e.role})]})]},e.role))}),(0,s.jsx)("div",{className:"mt-4 grid",children:b.vH.map(e=>(0,s.jsxs)("div",{className:"flex min-h-11 items-center gap-4",children:[(0,s.jsx)("span",{className:(0,M.cn)("min-w-0 flex-1 truncate",e.cls),children:"text-title"===e.token?t.name:e.sample}),(0,s.jsx)(b.Kp,{className:"shrink-0",children:e.token})]},e.token))})]}),(0,s.jsx)(w.wn,{title:"Corners",children:(0,s.jsx)("div",{className:"flex flex-wrap gap-x-6 gap-y-4",children:b.O7.map(e=>(0,s.jsxs)("div",{className:"grid justify-items-start gap-1.5",children:[(0,s.jsx)("span",{className:(0,M.cn)("size-12 bg-fill-control shadow-ring",e.cls)}),(0,s.jsx)(b.Kp,{children:e.token.replace("rounded-","")})]},e.token))})}),(0,s.jsx)(w.wn,{title:"Components",count:b.rT.length,children:(0,s.jsx)("div",{"data-specimen":!0,className:"grid grid-cols-2 gap-x-3 gap-y-6 max-md:grid-cols-1",children:b.rT.map(e=>(0,s.jsxs)("figure",{className:"min-w-0",children:[(0,s.jsx)("div",{className:"grid h-36 place-items-center overflow-hidden rounded-panel bg-bg-content px-4 shadow-ring",children:e.hero}),(0,s.jsx)("figcaption",{className:"mt-2 text-ui text-fg-secondary",children:e.name})]},e.id))})})]},"".concat(t.slug,"-").concat(a))}function C(e){let{theme:t}=e;return(0,v.K7)("".concat(t.name,", Design systems")),(0,s.jsx)(f.Zk,{children:(0,s.jsxs)("div",{className:"min-h-0 flex-1 overflow-y-auto",children:[(0,s.jsx)(w.Y9,{title:t.name,crumbs:[{label:"Design systems",href:"/design-system"}]}),(0,s.jsxs)("div",{className:(0,M.cn)(f.Eb,"pb-24"),children:[(0,s.jsx)("p",{className:"max-w-xl text-ui text-fg-secondary text-pretty",children:t.line}),(0,s.jsx)(S,{theme:t,className:"mt-8"})]})]})})}function z(e){let{project:t,name:n,theme:a,others:r}=e;(0,v.K7)("Design system, ".concat(n));let[i,c]=(0,l.useState)(!1);return(0,s.jsx)(f.Zk,{children:(0,s.jsxs)("div",{className:"min-h-0 flex-1 overflow-y-auto",children:[(0,s.jsx)(w.Y9,{title:"Design system",children:!i&&(0,s.jsx)(o.$,{size:"sm",onClick:()=>c(!0),children:"Change design system"})}),(0,s.jsx)("div",{className:(0,M.cn)(f.Eb,"pb-24"),children:(0,s.jsx)(E,{project:t,name:n,theme:a,others:r,changing:i,onChanging:c})})]})})}function E(e){let{project:t,name:n,theme:a,others:c,changing:o,onChanging:d}=e,{making:u,failed:h}=function(e,t){let n=(0,i.useRouter)(),[s,a]=(0,l.useState)({making:!1,failed:null});return(0,l.useEffect)(()=>{let r=!0,i=async()=>{var s;let i=await fetch("/api/studio/system?project=".concat(e),{cache:"no-store"}).then(e=>e.json()).catch(()=>null);r&&i&&(a({making:i.making,failed:i.failed}),(null==(s=i.theme)?void 0:s.slug)&&i.theme.slug!==t&&n.refresh())};i();let l=setInterval(()=>"visible"===document.visibilityState&&void i(),s.making?2500:1e4);return()=>(r=!1,clearInterval(l))},[e,t,n,s.making]),s}(t,a.slug),m=a.name.toLowerCase()===n.toLowerCase();return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("p",{className:"text-ui text-fg-secondary",children:["Every screen in ",n," is made in"," ",m?"its own system":(0,s.jsx)(r(),{href:"/design-system/".concat(a.slug),className:"text-fg-primary underline-offset-4 outline-hidden hover:underline focus-visible:ring-2 focus-visible:ring-ring",children:a.name}),"."]}),u&&(0,s.jsxs)(w.vB,{status:"drawing",className:"mt-3",children:["Making ",n,"'s own system"]}),h&&!u&&(0,s.jsx)(w.vB,{danger:!0,className:"mt-3",children:h}),o&&(0,s.jsx)(P,{project:t,name:n,current:a,others:c,onCancel:()=>d(!1)}),(0,s.jsx)(S,{theme:a,className:"mt-8"})]})}function L(e){var t;let{project:n,name:a,themeSlug:r}=e,[i,c]=(0,l.useState)(null),[d,u]=(0,l.useState)(!1);(0,l.useEffect)(()=>{let e=!0;return fetch("/api/themes",{cache:"no-store"}).then(e=>e.ok?e.json():null).then(t=>e&&(null==t?void 0:t.themes)&&c(t.themes)).catch(()=>{}),()=>{e=!1}},[]);let h=null!=(t=null==i?void 0:i.find(e=>e.slug===r))?t:null==i?void 0:i.find(e=>"baseline"===e.slug);return h?(0,s.jsxs)("article",{className:"flex flex-col p-8 max-md:p-5","aria-label":"".concat(a,"'s design system"),children:[(0,s.jsxs)("header",{className:"flex flex-wrap items-center justify-between gap-3 pb-2",children:[(0,s.jsx)("h2",{className:"text-title font-semibold text-fg-primary",children:h.name}),!d&&(0,s.jsx)(o.$,{size:"sm",onClick:()=>u(!0),children:"Change design system"})]}),(0,s.jsx)(E,{project:n,name:a,theme:h,others:(null!=i?i:[]).filter(e=>e.preset),changing:d,onChanging:u})]}):(0,s.jsx)("div",{className:"h-96"})}function P(e){let{project:t,name:n,current:a,others:r,onCancel:i}=e,{mode:c}=(0,k.b)(),d=(0,y.uB)(),[u,h]=(0,l.useState)(""),[m,x]=(0,l.useState)(""),[p,f]=(0,l.useState)(""),[v,b]=(0,l.useState)(!1),N=[...r.filter(e=>e.slug!==a.slug).map(e=>({id:e.slug,name:e.name,line:e.line,swatch:(0,s.jsx)(j.Ig,{theme:{...e,mode:c}})})),{id:"new",name:"A new design system",line:"The agent makes one for ".concat(n," from how you describe it."),swatch:null}],S=async()=>{if(!u)return f("Pick a design system.");if("new"===u&&!m.trim())return f("Say how it should look and feel, in a few words.");b(!0),f("");let e=r.find(e=>e.slug===u),s="new"===u?"Give ".concat(n," a design system of its own, in place of ").concat(a.name,". Derive its type, colour, spacing, radius, primitives and components from what ").concat(n," is for, then restyle every screen in it.\n\nHow it should look and feel: ").concat(m.trim()):"Move ".concat(n," from ").concat(a.name," to ").concat(null==e?void 0:e.name,", and restyle every screen in it."),i=await fetch("/api/plan",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"brief",project:t,brief:s,crew:"one"})}).then(e=>e.json()).catch(()=>({error:"Couldn't reach Playground. Try again."}));if(b(!1),i.error)return f(i.error);d("/p/".concat(t,"?view=plan"))};return(0,s.jsxs)("section",{"aria-labelledby":"change-q",className:"mt-8 grid gap-3",children:[(0,s.jsxs)("h2",{id:"change-q",className:"text-ui font-medium text-fg-primary",children:["Which design system should ",n," use?"]}),(0,s.jsx)("div",{role:"radiogroup","aria-labelledby":"change-q",className:"-mx-2 grid",children:N.map(e=>(0,s.jsx)(w.fI,{stacked:!0,lead:(0,s.jsx)("span",{"aria-hidden":!0,className:(0,M.cn)("size-3.5 rounded-full border border-fg-muted",u===e.id&&"border-fg-primary bg-fg-primary")}),title:e.name,parent:e.line,trail:e.swatch,trailWidth:"w-3",selected:u===e.id,checked:u===e.id,onClick:()=>(h(e.id),f(""))},e.id))}),"new"===u&&(0,s.jsx)(g.T,{"aria-label":"How it should look and feel",placeholder:"How should it look and feel?",autoFocus:!0,rows:3,value:m,onChange:e=>(x(e.target.value),f("")),"aria-invalid":!!p&&!m.trim()}),p&&(0,s.jsx)("p",{className:"text-sm text-status-danger",children:p}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(o.$,{variant:"primary",disabled:v,onClick:S,children:"Ask the agent"}),(0,s.jsx)(o.$,{variant:"ghost",onClick:i,children:"Cancel"})]})]})}let T=["What it's for","Where it starts","The look","What it needs"],F=["Buttons and inputs","Lists and rows","Cards","Navigation","Tables","Charts","Dialogs and sheets","Empty and loading states"],q=[["baseline","From Baseline","Baseline's components, restyled and renamed for it"],["reference","From a reference","A product you admire, which the agent drafts from"],["blank","From nothing","Foundations proposed from what it's for alone"]],R=(e,t)=>{var n,s,a;return{...e,accent:{...e.accent,h:null!=(n=t.hue)?n:e.accent.h},neutral:null!=(s=t.neutral)?s:e.neutral,radius:null!=(a=t.radius)?a:e.radius}};function W(e){let{project:t,name:n,purpose:a,replaces:r,base:i}=e;(0,v.K7)("New design system, ".concat(n));let j=(0,y.uB)(),[b,k]=(0,l.useState)(0),[S,C]=(0,l.useState)(a),[z,E]=(0,l.useState)("baseline"),[L,P]=(0,l.useState)(""),[W,A]=(0,l.useState)({notes:""}),H=function(e,t){var n;let s=[null!=t.hue&&"an accent at hue ".concat(t.hue),t.neutral&&"".concat((0,N.NT)(R(e,t)).toLowerCase()," greys"),null!=t.radius&&"".concat(null==(n=N.n9.find(e=>e.r===t.radius))?void 0:n.name.toLowerCase()," corners")].filter(Boolean);return[s.length?"Baseline with ".concat(s.join(", "),"."):"",t.notes.trim()].filter(Boolean).join(" ")}(i,W),[D,I]=(0,l.useState)(F.slice(0,4)),[B,O]=(0,l.useState)(""),[K,J]=(0,l.useState)(!1),[V,Y]=(0,l.useState)(""),Q="new-system:".concat(t),[X,U]=(0,l.useState)(!1);(0,l.useEffect)(()=>{if(X)return;let e=Number(new URLSearchParams(location.search).get("step"));e>=1&&e<=T.length&&k(e-1);try{var t;let e=JSON.parse(null!=(t=sessionStorage.getItem(Q))?t:"null");e&&(C(e.purpose),E(e.start),P(e.reference),e.picks&&A(e.picks),I(e.needs))}catch(e){}U(!0)},[X,Q]),(0,l.useEffect)(()=>{if(!X)return;sessionStorage.setItem(Q,JSON.stringify({purpose:S,start:z,reference:L,picks:W,needs:D}));let e=new URL(location.href);e.searchParams.set("step",String(b+1)),history.replaceState(history.state,"",e)},[X,Q,b,S,z,L,W,D]);let G=[S.trim()?"":"Say what it's for first.","reference"!==z||L.trim()?"":"Name the reference first.","",D.length?"":"Pick at least one."],_=e=>(O(""),k(e)),Z=async()=>{let e=G.findIndex(Boolean);if(e>=0)return k(e),O(G[e]);J(!0),O(""),Y("");let n=await fetch("/api/studio/system",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project:t,purpose:S,start:z,reference:L,look:H,needs:D})}).then(e=>e.json()).catch(()=>({error:"Couldn't reach Playground."}));J(!1),n.error?Y(n.error):(sessionStorage.removeItem(Q),j("/p/".concat(t,"/design-system")))},ee=e=>B&&b===e?{"aria-invalid":!0,"aria-describedby":"ns-error"}:{},et=e=>B&&b===e?(0,s.jsx)("p",{id:"ns-error",className:"text-sm text-status-danger",children:B}):null,en=r?"Replace ".concat(n,"'s system"):"Make ".concat(n,"'s system");return(0,s.jsx)(f.Zk,{children:(0,s.jsxs)("div",{className:"min-h-0 flex-1 overflow-y-auto",children:[(0,s.jsx)(w.Y9,{title:"New design system",crumbs:[{label:"".concat(n,"'s design system"),href:"/p/".concat(t,"/design-system")}]}),(0,s.jsxs)("div",{className:(0,M.cn)(f.Eb,"grid gap-x-10 gap-y-6 pb-24 md:grid-cols-4"),children:[(0,s.jsx)("nav",{"aria-label":"Steps",className:"grid content-start max-md:hidden",children:T.map((e,t)=>(0,s.jsx)(w.fI,{nav:!0,lead:(0,s.jsx)("span",{className:"num text-sm",children:t+1}),title:e,selected:t===b,onClick:()=>_(t),trailWidth:"w-0"},e))}),(0,s.jsxs)("div",{className:"grid content-start gap-5 md:col-span-3",children:[(0,s.jsxs)("p",{className:"num -mb-3 text-sm text-fg-meta md:hidden",children:[b+1," of ",T.length]}),0===b&&(0,s.jsxs)("div",{className:"grid gap-1.5",children:[(0,s.jsxs)(m.J,{htmlFor:"ns-for",children:["What is ",n,"'s system for?"]}),(0,s.jsx)(g.T,{id:"ns-for",value:S,onChange:e=>C(e.target.value),autoFocus:!0,className:"field-sizing-content min-h-24",...ee(0)}),et(0)]}),1===b&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"grid gap-3",children:[(0,s.jsx)(m.J,{id:"ns-start",children:"Where should it start?"}),(0,s.jsx)(x.z,{"aria-labelledby":"ns-start",value:z,onValueChange:e=>E(e),className:"gap-4",children:q.map(e=>{let[t,n,a]=e;return(0,s.jsxs)(u.D0,{orientation:"horizontal",children:[(0,s.jsx)(x.C,{value:t,id:"ns-start-".concat(t)}),(0,s.jsxs)(u.o7,{children:[(0,s.jsx)(u.dh,{htmlFor:"ns-start-".concat(t),children:n}),(0,s.jsx)(u.ry,{children:a})]})]},t)})})]}),"reference"===z&&(0,s.jsxs)("div",{className:"grid gap-1.5",children:[(0,s.jsx)(m.J,{htmlFor:"ns-ref",children:"Reference"}),(0,s.jsx)(h.p,{id:"ns-ref",value:L,onChange:e=>P(e.target.value),...ee(1)}),et(1)]})]}),2===b&&(0,s.jsx)($,{base:i,picks:W,onPick:e=>A(t=>({...t,...e}))}),3===b&&(0,s.jsxs)("div",{className:"grid gap-3",children:[(0,s.jsx)(m.J,{id:"ns-needs",children:"What does it need?"}),(0,s.jsx)("div",{role:"group","aria-labelledby":"ns-needs",className:"grid gap-x-6 gap-y-3 sm:grid-cols-2",...ee(3),children:F.map(e=>(0,s.jsxs)(u.D0,{orientation:"horizontal",children:[(0,s.jsx)(d.S,{id:"ns-need-".concat(e),checked:D.includes(e),onCheckedChange:t=>I(n=>t?[...n,e]:n.filter(t=>t!==e))}),(0,s.jsx)(u.dh,{htmlFor:"ns-need-".concat(e),children:e})]},e))}),et(3)]}),(0,s.jsxs)("div",{className:"grid gap-1.5",children:[(0,s.jsxs)("div",{className:"flex gap-2",children:[b>0&&(0,s.jsx)(o.$,{onClick:()=>_(b-1),children:"Back"}),b<3?(0,s.jsxs)(o.$,{variant:"primary",onClick:()=>G[b]?O(G[b]):_(b+1),children:["Next",(0,s.jsx)(c.Q,{})]}):(0,s.jsxs)(o.$,{variant:"primary",disabled:K,onClick:Z,children:[K&&(0,s.jsx)(p.y,{}),en]})]}),V&&(0,s.jsx)("p",{className:"text-sm text-status-danger",children:V})]})]})]})]})})}function $(e){let{base:t,picks:n,onPick:a}=e,{mode:r}=(0,k.b)(),i=R(t,n);return(0,s.jsxs)("div",{className:"grid gap-6",children:[(0,s.jsx)(m.J,{children:"How should it look?"}),(0,s.jsxs)("div",{className:"grid gap-2",children:[(0,s.jsx)("span",{className:"text-sm text-fg-meta",children:"Accent"}),(0,s.jsx)(N.rz,{theme:i,mode:r,onPick:e=>a({hue:e})})]}),(0,s.jsxs)("div",{className:"grid max-w-md gap-2",children:[(0,s.jsx)("span",{className:"text-sm text-fg-meta",children:"Greys"}),(0,s.jsx)(N.h0,{theme:i,mode:r,onPick:e=>a({neutral:e})})]}),(0,s.jsxs)("div",{className:"grid max-w-md gap-2",children:[(0,s.jsx)("span",{className:"text-sm text-fg-meta",children:"Corners"}),(0,s.jsx)(N.$I,{theme:i,mode:r,onPick:e=>a({radius:e})})]}),(0,s.jsxs)("div",{className:"grid gap-1.5",children:[(0,s.jsx)(m.J,{htmlFor:"ns-look",children:"Anything else"}),(0,s.jsx)(g.T,{id:"ns-look",rows:3,value:n.notes,onChange:e=>a({notes:e.target.value})})]})]})}}}]);