@logicplanes/kaeso-ui 0.6.0 → 0.7.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 (594) hide show
  1. package/AGENTS.md +1 -1
  2. package/ai/component-guides.md +232 -40
  3. package/ai/component-registry.json +481 -138
  4. package/ai/component-registry.md +174 -104
  5. package/ai/icons.md +2 -2
  6. package/ai/tokens.md +46 -48
  7. package/dist/chunks/app-frame-DibcP3SK.js +247 -0
  8. package/dist/chunks/app-frame-DibcP3SK.js.map +1 -0
  9. package/dist/chunks/arrow-focus-D9q8rMct.js +25 -0
  10. package/dist/chunks/arrow-focus-D9q8rMct.js.map +1 -0
  11. package/dist/chunks/{avatar-DVrkoFEg.js → avatar-rLwc_20v.js} +73 -60
  12. package/dist/chunks/avatar-rLwc_20v.js.map +1 -0
  13. package/dist/chunks/{badge-CTYrfTwc.js → badge-C6H9NlNw.js} +5 -6
  14. package/dist/chunks/{badge-CTYrfTwc.js.map → badge-C6H9NlNw.js.map} +1 -1
  15. package/dist/chunks/{banner-cJ89c-IR.js → banner-B3YT-DVa.js} +18 -18
  16. package/dist/chunks/banner-B3YT-DVa.js.map +1 -0
  17. package/dist/chunks/{button-Da8b-8ub.js → button-L10eO8bf.js} +34 -35
  18. package/dist/chunks/{button-Da8b-8ub.js.map → button-L10eO8bf.js.map} +1 -1
  19. package/dist/chunks/{button-group-BJxaz0sb.js → button-group-BZmq9BmX.js} +10 -11
  20. package/dist/chunks/{button-group-BJxaz0sb.js.map → button-group-BZmq9BmX.js.map} +1 -1
  21. package/dist/chunks/{calendar-CA9mDtwp.js → calendar-BR8wvVEv.js} +10 -11
  22. package/dist/chunks/{calendar-CA9mDtwp.js.map → calendar-BR8wvVEv.js.map} +1 -1
  23. package/dist/chunks/{checkbox-CPL47-us.js → checkbox-BkMPWcR_.js} +9 -10
  24. package/dist/chunks/{checkbox-CPL47-us.js.map → checkbox-BkMPWcR_.js.map} +1 -1
  25. package/dist/chunks/{cn-CLpm819s.js → cn-CF99d-bD.js} +8 -4
  26. package/dist/chunks/cn-CF99d-bD.js.map +1 -0
  27. package/dist/chunks/{code-CpqXogQK.js → code-C4bi_3gR.js} +3 -4
  28. package/dist/chunks/{code-CpqXogQK.js.map → code-C4bi_3gR.js.map} +1 -1
  29. package/dist/chunks/{code-block-BqFGa1-b.js → code-block-DBWno4Dm.js} +51 -53
  30. package/dist/chunks/code-block-DBWno4Dm.js.map +1 -0
  31. package/dist/chunks/code-block-DOZqnHjd.js +282 -0
  32. package/dist/chunks/code-block-DOZqnHjd.js.map +1 -0
  33. package/dist/chunks/{collapsible-DmLyF8Ol.js → collapsible-BFoDXP0y.js} +19 -17
  34. package/dist/chunks/collapsible-BFoDXP0y.js.map +1 -0
  35. package/dist/chunks/combobox-B8GjFlO4.js +365 -0
  36. package/dist/chunks/combobox-B8GjFlO4.js.map +1 -0
  37. package/dist/chunks/{command-list-GQ3y8on6.js → command-list-ttU7YLEl.js} +51 -50
  38. package/dist/chunks/command-list-ttU7YLEl.js.map +1 -0
  39. package/dist/chunks/{command-palette-DEJDRW31.js → command-palette-BEIK_hv9.js} +54 -52
  40. package/dist/chunks/command-palette-BEIK_hv9.js.map +1 -0
  41. package/dist/chunks/context-B2nNL7Im.js +19 -0
  42. package/dist/chunks/context-B2nNL7Im.js.map +1 -0
  43. package/dist/chunks/{copy-button-B67MEIu2.js → copy-button-59YLQ_oG.js} +48 -43
  44. package/dist/chunks/copy-button-59YLQ_oG.js.map +1 -0
  45. package/dist/chunks/core-B8c9Bty0.js +456 -0
  46. package/dist/chunks/core-B8c9Bty0.js.map +1 -0
  47. package/dist/chunks/dashboard-Cuv86JNj.js +135 -0
  48. package/dist/chunks/dashboard-Cuv86JNj.js.map +1 -0
  49. package/dist/chunks/data-table-BMopFMG6.js +641 -0
  50. package/dist/chunks/data-table-BMopFMG6.js.map +1 -0
  51. package/dist/chunks/date-picker-CkIMfoLV.js +345 -0
  52. package/dist/chunks/date-picker-CkIMfoLV.js.map +1 -0
  53. package/dist/chunks/{date-popup-7ZzVxhY1.js → date-popup-DhbnZRhl.js} +12 -14
  54. package/dist/chunks/{date-popup-7ZzVxhY1.js.map → date-popup-DhbnZRhl.js.map} +1 -1
  55. package/dist/chunks/{de-V_lN_KKk.js → de-QtAgHLnQ.js} +61 -3
  56. package/dist/chunks/de-QtAgHLnQ.js.map +1 -0
  57. package/dist/chunks/{delta-BCIXqi3O.js → delta-CJUsqoA_.js} +7 -8
  58. package/dist/chunks/{delta-BCIXqi3O.js.map → delta-CJUsqoA_.js.map} +1 -1
  59. package/dist/chunks/{dev-TgcS67XR.js → dev-CRNODF1J.js} +2 -3
  60. package/dist/chunks/{dev-TgcS67XR.js.map → dev-CRNODF1J.js.map} +1 -1
  61. package/dist/chunks/dialog-CYQsXjid.js +590 -0
  62. package/dist/chunks/dialog-CYQsXjid.js.map +1 -0
  63. package/dist/chunks/{disclosure-DhMvGSll.js → disclosure-0eeGo16u.js} +3 -4
  64. package/dist/chunks/{disclosure-DhMvGSll.js.map → disclosure-0eeGo16u.js.map} +1 -1
  65. package/dist/chunks/{display-options-BTFqLSJX.js → display-options-DZqFG-ly.js} +38 -38
  66. package/dist/chunks/display-options-DZqFG-ly.js.map +1 -0
  67. package/dist/chunks/domain-BqNtp2rQ.js +25 -0
  68. package/dist/chunks/domain-BqNtp2rQ.js.map +1 -0
  69. package/dist/chunks/empty-BLeimJFU.js +50 -0
  70. package/dist/chunks/empty-BLeimJFU.js.map +1 -0
  71. package/dist/chunks/{field-ng87P1GV.js → field-BJoH_7Mc.js} +15 -17
  72. package/dist/chunks/field-BJoH_7Mc.js.map +1 -0
  73. package/dist/chunks/{figure-_uZS1Y52.js → figure-g1FhNNJc.js} +8 -10
  74. package/dist/chunks/figure-g1FhNNJc.js.map +1 -0
  75. package/dist/chunks/filter-chip-KMkD6acL.js +208 -0
  76. package/dist/chunks/filter-chip-KMkD6acL.js.map +1 -0
  77. package/dist/chunks/{filter-row-Bs2lFT67.js → filter-row-Dia2atDQ.js} +9 -10
  78. package/dist/chunks/{filter-row-Bs2lFT67.js.map → filter-row-Dia2atDQ.js.map} +1 -1
  79. package/dist/chunks/{flow-BGFXfXgJ.js → flow-9Ap7HdzN.js} +27 -28
  80. package/dist/chunks/flow-9Ap7HdzN.js.map +1 -0
  81. package/dist/chunks/formatters-Be5AdLB2.js +12 -0
  82. package/dist/chunks/formatters-Be5AdLB2.js.map +1 -0
  83. package/dist/chunks/{heading-wBU2QK4s.js → heading-DjRyHd0R.js} +3 -4
  84. package/dist/chunks/{heading-wBU2QK4s.js.map → heading-DjRyHd0R.js.map} +1 -1
  85. package/dist/chunks/{i18n-0RW0IAf3.js → i18n-DA-5LboH.js} +2 -3
  86. package/dist/chunks/{i18n-0RW0IAf3.js.map → i18n-DA-5LboH.js.map} +1 -1
  87. package/dist/chunks/{icon-lgMMe3zk.js → icon-UqUodbsN.js} +26 -26
  88. package/dist/chunks/icon-UqUodbsN.js.map +1 -0
  89. package/dist/chunks/{icon-CPiYZMTw.js → icon-kQHSzziW.js} +3 -4
  90. package/dist/chunks/{icon-CPiYZMTw.js.map → icon-kQHSzziW.js.map} +1 -1
  91. package/dist/chunks/{identity-DCghs4Wp.js → identity-DCNUQgql.js} +231 -110
  92. package/dist/chunks/identity-DCNUQgql.js.map +1 -0
  93. package/dist/chunks/{input-iSaRkw-V.js → input-CI8DBTas.js} +20 -22
  94. package/dist/chunks/{input-iSaRkw-V.js.map → input-CI8DBTas.js.map} +1 -1
  95. package/dist/chunks/{input-QQR4KS9D.js → input-DpGqfw1G.js} +39 -39
  96. package/dist/chunks/input-DpGqfw1G.js.map +1 -0
  97. package/dist/chunks/input-group-FtZWEYNA.js +90 -0
  98. package/dist/chunks/input-group-FtZWEYNA.js.map +1 -0
  99. package/dist/chunks/{inset-BUzyXLK4.js → inset-BTAjcK6a.js} +2 -3
  100. package/dist/chunks/{inset-BUzyXLK4.js.map → inset-BTAjcK6a.js.map} +1 -1
  101. package/dist/chunks/{iso-field-D2CISQaB.js → iso-field-Dg-HGlv9.js} +7 -8
  102. package/dist/chunks/{iso-field-D2CISQaB.js.map → iso-field-Dg-HGlv9.js.map} +1 -1
  103. package/dist/chunks/{json-view-DeHSFq-2.js → json-view-CNpzGhtB.js} +25 -26
  104. package/dist/chunks/json-view-CNpzGhtB.js.map +1 -0
  105. package/dist/chunks/{kaeso-Bs1aLSTp.js → kaeso-C-E-8Dxz.js} +198 -200
  106. package/dist/chunks/kaeso-C-E-8Dxz.js.map +1 -0
  107. package/dist/chunks/{kaeso-theme-BIgOZi41.js → kaeso-theme-C9rnRKq2.js} +3 -5
  108. package/dist/chunks/{kaeso-theme-BIgOZi41.js.map → kaeso-theme-C9rnRKq2.js.map} +1 -1
  109. package/dist/chunks/{kbd-xC3k90CH.js → kbd-CI5W-2LJ.js} +4 -5
  110. package/dist/chunks/{kbd-xC3k90CH.js.map → kbd-CI5W-2LJ.js.map} +1 -1
  111. package/dist/chunks/{key-value-DKW2q0zt.js → key-value-nzN9Vojb.js} +12 -13
  112. package/dist/chunks/key-value-nzN9Vojb.js.map +1 -0
  113. package/dist/chunks/{labelled-D5udSPUI.js → labelled-DJa09XRF.js} +2 -3
  114. package/dist/chunks/{labelled-D5udSPUI.js.map → labelled-DJa09XRF.js.map} +1 -1
  115. package/dist/chunks/{linear-scale-BWKeRqDX.js → linear-scale-B5A7yNr7.js} +2 -3
  116. package/dist/chunks/{linear-scale-BWKeRqDX.js.map → linear-scale-B5A7yNr7.js.map} +1 -1
  117. package/dist/chunks/link-DXFn_hKF.js +54 -0
  118. package/dist/chunks/link-DXFn_hKF.js.map +1 -0
  119. package/dist/chunks/{link-provider-cvl8lSTT.js → link-provider-DSF9bbO3.js} +2 -3
  120. package/dist/chunks/{link-provider-cvl8lSTT.js.map → link-provider-DSF9bbO3.js.map} +1 -1
  121. package/dist/chunks/list-Bhtqsv9E.js +594 -0
  122. package/dist/chunks/list-Bhtqsv9E.js.map +1 -0
  123. package/dist/chunks/{loader-DtZd9btk.js → loader-C4ayEuXI.js} +3 -4
  124. package/dist/chunks/{loader-DtZd9btk.js.map → loader-C4ayEuXI.js.map} +1 -1
  125. package/dist/chunks/{loader-D27YO1c3.js → loader-DMnDOZWX.js} +10 -11
  126. package/dist/chunks/{loader-D27YO1c3.js.map → loader-DMnDOZWX.js.map} +1 -1
  127. package/dist/chunks/{logo-DTqTs3vV.js → logo-z7ZAq0So.js} +4 -5
  128. package/dist/chunks/{logo-DTqTs3vV.js.map → logo-z7ZAq0So.js.map} +1 -1
  129. package/dist/chunks/{markdown-BlIl3LuV.js → markdown-CLMrgRju.js} +118 -101
  130. package/dist/chunks/markdown-CLMrgRju.js.map +1 -0
  131. package/dist/chunks/{menu-D3tUjkCM.js → menu-Bl7vzB52.js} +126 -119
  132. package/dist/chunks/menu-Bl7vzB52.js.map +1 -0
  133. package/dist/chunks/{merge-refs-BN1FyQt9.js → merge-refs-SiVVoQsO.js} +2 -3
  134. package/dist/chunks/{merge-refs-BN1FyQt9.js.map → merge-refs-SiVVoQsO.js.map} +1 -1
  135. package/dist/chunks/{message-BxTkh1oA.js → message-DpD9D1Dj.js} +2 -3
  136. package/dist/chunks/{message-BxTkh1oA.js.map → message-DpD9D1Dj.js.map} +1 -1
  137. package/dist/chunks/meter-YuCR1Pjd.js +193 -0
  138. package/dist/chunks/meter-YuCR1Pjd.js.map +1 -0
  139. package/dist/chunks/nav-sheet-CQfZ7w_q.js +65 -0
  140. package/dist/chunks/nav-sheet-CQfZ7w_q.js.map +1 -0
  141. package/dist/chunks/{nav-wordmark-DR4Glswt.js → nav-wordmark-DoA-i2E9.js} +3 -4
  142. package/dist/chunks/{nav-wordmark-DR4Glswt.js.map → nav-wordmark-DoA-i2E9.js.map} +1 -1
  143. package/dist/chunks/{observe-resize-DhxhmoyB.js → observe-resize-DerQK57d.js} +2 -3
  144. package/dist/chunks/{observe-resize-DhxhmoyB.js.map → observe-resize-DerQK57d.js.map} +1 -1
  145. package/dist/chunks/{option-checkbox-Df7WhGn4.js → option-checkbox-wA9L8Nxo.js} +2 -3
  146. package/dist/chunks/{option-checkbox-Df7WhGn4.js.map → option-checkbox-wA9L8Nxo.js.map} +1 -1
  147. package/dist/chunks/over-sheet-CMUXcIMV.js +25 -0
  148. package/dist/chunks/over-sheet-CMUXcIMV.js.map +1 -0
  149. package/dist/chunks/page-header-C92GBvns.js +45 -0
  150. package/dist/chunks/page-header-C92GBvns.js.map +1 -0
  151. package/dist/chunks/{pagination-BT-lQc45.js → pagination-IL6wspAT.js} +13 -14
  152. package/dist/chunks/{pagination-BT-lQc45.js.map → pagination-IL6wspAT.js.map} +1 -1
  153. package/dist/chunks/{picker-popover-Bb-2Amjw.js → picker-popover-icF27914.js} +21 -22
  154. package/dist/chunks/picker-popover-icF27914.js.map +1 -0
  155. package/dist/chunks/{popover-CAoo5c59.js → popover-BFvV60-L.js} +9 -10
  156. package/dist/chunks/{popover-CAoo5c59.js.map → popover-BFvV60-L.js.map} +1 -1
  157. package/dist/chunks/{popover-root-D3q89WNF.js → popover-root-BI54wuLi.js} +2 -3
  158. package/dist/chunks/{popover-root-D3q89WNF.js.map → popover-root-BI54wuLi.js.map} +1 -1
  159. package/dist/chunks/{portal-context-CTatR2Z8.js → portal-context-Z2xSIPsc.js} +2 -3
  160. package/dist/chunks/{portal-context-CTatR2Z8.js.map → portal-context-Z2xSIPsc.js.map} +1 -1
  161. package/dist/chunks/{provider-marks-BVbDRIv-.js → provider-marks-DmonWRb5.js} +2 -3
  162. package/dist/chunks/{provider-marks-BVbDRIv-.js.map → provider-marks-DmonWRb5.js.map} +1 -1
  163. package/dist/chunks/{qr-code-DOsFDNiz.js → qr-code-CCNU8O2_.js} +3 -4
  164. package/dist/chunks/{qr-code-DOsFDNiz.js.map → qr-code-CCNU8O2_.js.map} +1 -1
  165. package/dist/chunks/{radio-DfOB6J3Z.js → radio-anvHOdCW.js} +5 -6
  166. package/dist/chunks/{radio-DfOB6J3Z.js.map → radio-anvHOdCW.js.map} +1 -1
  167. package/dist/chunks/{range-popup-iBru5bpM.js → range-popup-Z6K3WK7A.js} +61 -59
  168. package/dist/chunks/range-popup-Z6K3WK7A.js.map +1 -0
  169. package/dist/chunks/{reasoning-frame-DBIq2SMT.js → reasoning-frame-BCoFYqgO.js} +4 -5
  170. package/dist/chunks/{reasoning-frame-DBIq2SMT.js.map → reasoning-frame-BCoFYqgO.js.map} +1 -1
  171. package/dist/chunks/{release-art-D7Iq6Qhv.js → release-art-DJuOsmxV.js} +9 -11
  172. package/dist/chunks/{release-art-D7Iq6Qhv.js.map → release-art-DJuOsmxV.js.map} +1 -1
  173. package/dist/chunks/{resize-motion-DS3rIIqy.js → resize-motion-BbVXkxTO.js} +4 -7
  174. package/dist/chunks/{resize-motion-DS3rIIqy.js.map → resize-motion-BbVXkxTO.js.map} +1 -1
  175. package/dist/chunks/{rights-DDGgi823.js → rights-C44EtmsG.js} +68 -70
  176. package/dist/chunks/rights-C44EtmsG.js.map +1 -0
  177. package/dist/chunks/rolldown-runtime-CGnMp29N.js +10 -0
  178. package/dist/chunks/{rolling-number-ea1iiycC.js → rolling-number-wHJ6BD7h.js} +3 -4
  179. package/dist/chunks/{rolling-number-ea1iiycC.js.map → rolling-number-wHJ6BD7h.js.map} +1 -1
  180. package/dist/chunks/row-control-DlHLdthx.js +8 -0
  181. package/dist/chunks/row-control-DlHLdthx.js.map +1 -0
  182. package/dist/chunks/{safe-href-G5DBNVwm.js → safe-href-CWHpspUx.js} +2 -3
  183. package/dist/chunks/{safe-href-G5DBNVwm.js.map → safe-href-CWHpspUx.js.map} +1 -1
  184. package/dist/chunks/{scroll-area-D-ykAChX.js → scroll-area-CWPdGMJb.js} +4 -5
  185. package/dist/chunks/scroll-area-CWPdGMJb.js.map +1 -0
  186. package/dist/chunks/section-DmjNeJG9.js +97 -0
  187. package/dist/chunks/section-DmjNeJG9.js.map +1 -0
  188. package/dist/chunks/{segmented-BJJHHn0N.js → segmented-1WSOvDjT.js} +20 -21
  189. package/dist/chunks/segmented-1WSOvDjT.js.map +1 -0
  190. package/dist/chunks/{select-Ch4u5oIg.js → select-B3eoWXfR.js} +61 -61
  191. package/dist/chunks/select-B3eoWXfR.js.map +1 -0
  192. package/dist/chunks/{selects-text-R1lZHLKm.js → selects-text-kRMTsm4s.js} +5 -7
  193. package/dist/chunks/selects-text-kRMTsm4s.js.map +1 -0
  194. package/dist/chunks/{separator-B2CT4qia.js → separator-CAxDTLUL.js} +8 -6
  195. package/dist/chunks/separator-CAxDTLUL.js.map +1 -0
  196. package/dist/chunks/settings-CtVw9CiD.js +83 -0
  197. package/dist/chunks/settings-CtVw9CiD.js.map +1 -0
  198. package/dist/chunks/sheet-gHqkCQXy.js +127 -0
  199. package/dist/chunks/sheet-gHqkCQXy.js.map +1 -0
  200. package/dist/chunks/{shiki-CRJpi_Hd.js → shiki-QCHorMZO.js} +3 -4
  201. package/dist/chunks/{shiki-CRJpi_Hd.js.map → shiki-QCHorMZO.js.map} +1 -1
  202. package/dist/chunks/sidebar-BnIqRDVN.js +665 -0
  203. package/dist/chunks/sidebar-BnIqRDVN.js.map +1 -0
  204. package/dist/chunks/{sidebar-menu-f5NMgTdE.js → sidebar-menu-CSElX37g.js} +3 -4
  205. package/dist/chunks/sidebar-menu-CSElX37g.js.map +1 -0
  206. package/dist/chunks/sizes-CSjNvon0.js +20 -0
  207. package/dist/chunks/sizes-CSjNvon0.js.map +1 -0
  208. package/dist/chunks/{skeleton-Bx-vRJdy.js → skeleton-DTiYxSYX.js} +4 -5
  209. package/dist/chunks/skeleton-DTiYxSYX.js.map +1 -0
  210. package/dist/chunks/{slider-BuEZfzNB.js → slider-CSLWsGYq.js} +5 -5
  211. package/dist/chunks/{slider-BuEZfzNB.js.map → slider-CSLWsGYq.js.map} +1 -1
  212. package/dist/chunks/{stat-gR4hFqO8.js → stat-DuWKmxGr.js} +53 -51
  213. package/dist/chunks/stat-DuWKmxGr.js.map +1 -0
  214. package/dist/chunks/{status-CejTEkqR.js → status-Bi2tSKCj.js} +7 -8
  215. package/dist/chunks/{status-CejTEkqR.js.map → status-Bi2tSKCj.js.map} +1 -1
  216. package/dist/chunks/styles-CklJ8C7c.js +14 -0
  217. package/dist/chunks/styles-CklJ8C7c.js.map +1 -0
  218. package/dist/chunks/{swap-text-CxWcVD0a.js → swap-text-DL0V-pku.js} +3 -4
  219. package/dist/chunks/{swap-text-CxWcVD0a.js.map → swap-text-DL0V-pku.js.map} +1 -1
  220. package/dist/chunks/swap-value-TlZecHRF.js +29 -0
  221. package/dist/chunks/swap-value-TlZecHRF.js.map +1 -0
  222. package/dist/chunks/switch-C0sNr969.js +77 -0
  223. package/dist/chunks/switch-C0sNr969.js.map +1 -0
  224. package/dist/chunks/{table-BTUUwlXD.js → table-CceWZLhC.js} +20 -21
  225. package/dist/chunks/table-CceWZLhC.js.map +1 -0
  226. package/dist/chunks/{tabs-D0I6Jkd4.js → tabs-BElO8cFs.js} +18 -19
  227. package/dist/chunks/tabs-BElO8cFs.js.map +1 -0
  228. package/dist/chunks/{tag-BGvgGsvr.js → tag-o9BCsRkO.js} +13 -14
  229. package/dist/chunks/tag-o9BCsRkO.js.map +1 -0
  230. package/dist/chunks/{text-ChUk0Z46.js → text-BRYPrw1h.js} +8 -9
  231. package/dist/chunks/text-BRYPrw1h.js.map +1 -0
  232. package/dist/chunks/textarea-BP6I9yrU.js +172 -0
  233. package/dist/chunks/textarea-BP6I9yrU.js.map +1 -0
  234. package/dist/chunks/{theme-image-Bk97CYp8.js → theme-image-Cw4VJEag.js} +3 -4
  235. package/dist/chunks/{theme-image-Bk97CYp8.js.map → theme-image-Cw4VJEag.js.map} +1 -1
  236. package/dist/chunks/theme-menu-BgltuBqB.js +79 -0
  237. package/dist/chunks/theme-menu-BgltuBqB.js.map +1 -0
  238. package/dist/chunks/{theme-provider-CmsV0cYJ.js → theme-provider-DaD8hlXu.js} +3 -4
  239. package/dist/chunks/{theme-provider-CmsV0cYJ.js.map → theme-provider-DaD8hlXu.js.map} +1 -1
  240. package/dist/chunks/thumbnail-CtYBg7Ms.js +83 -0
  241. package/dist/chunks/thumbnail-CtYBg7Ms.js.map +1 -0
  242. package/dist/chunks/{thumbnail-D2hD8aEk.js → thumbnail-DmFBC3Rf.js} +7 -8
  243. package/dist/chunks/{thumbnail-D2hD8aEk.js.map → thumbnail-DmFBC3Rf.js.map} +1 -1
  244. package/dist/chunks/{timeline-BQm5Q-Ul.js → timeline-B3vkaxI1.js} +12 -13
  245. package/dist/chunks/timeline-B3vkaxI1.js.map +1 -0
  246. package/dist/chunks/timeseries-h7XdvYTo.js +404 -0
  247. package/dist/chunks/timeseries-h7XdvYTo.js.map +1 -0
  248. package/dist/chunks/{toast-CSlvlu-r.js → toast-XAZeCuV7.js} +47 -48
  249. package/dist/chunks/toast-XAZeCuV7.js.map +1 -0
  250. package/dist/chunks/{toc-Cu2QJL5A.js → toc-C9Ay3w5r.js} +22 -17
  251. package/dist/chunks/toc-C9Ay3w5r.js.map +1 -0
  252. package/dist/chunks/{tone-CWpsHPb6.js → tone-CF_XXfiq.js} +2 -3
  253. package/dist/chunks/{tone-CWpsHPb6.js.map → tone-CF_XXfiq.js.map} +1 -1
  254. package/dist/chunks/{toolbar-DE-R3sjA.js → toolbar-BHqTfPWr.js} +17 -18
  255. package/dist/chunks/toolbar-BHqTfPWr.js.map +1 -0
  256. package/dist/chunks/{tooltip-D2g_QO6w.js → tooltip-D0jdTWyX.js} +2 -3
  257. package/dist/chunks/{tooltip-D2g_QO6w.js.map → tooltip-D0jdTWyX.js.map} +1 -1
  258. package/dist/chunks/tooltip-DVpJ_urN.js +205 -0
  259. package/dist/chunks/tooltip-DVpJ_urN.js.map +1 -0
  260. package/dist/chunks/{tooltip-C8ehtFju.js → tooltip-OySqu0Bq.js} +30 -28
  261. package/dist/chunks/tooltip-OySqu0Bq.js.map +1 -0
  262. package/dist/chunks/{tooltip-root-CrLuOT4j.js → tooltip-root-BeCM9Uhj.js} +25 -25
  263. package/dist/chunks/tooltip-root-BeCM9Uhj.js.map +1 -0
  264. package/dist/chunks/{truncated-C0A4AU-U.js → truncated-C6K1q8DJ.js} +9 -10
  265. package/dist/chunks/{truncated-C0A4AU-U.js.map → truncated-C6K1q8DJ.js.map} +1 -1
  266. package/dist/chunks/{use-controllable-B5Fd12Bx.js → use-controllable-rN5Fg5EJ.js} +2 -3
  267. package/dist/chunks/{use-controllable-B5Fd12Bx.js.map → use-controllable-rN5Fg5EJ.js.map} +1 -1
  268. package/dist/chunks/{use-copy-Dm2ncvMX.js → use-copy-DtUCUOlR.js} +2 -3
  269. package/dist/chunks/{use-copy-Dm2ncvMX.js.map → use-copy-DtUCUOlR.js.map} +1 -1
  270. package/dist/chunks/{use-hydrating-COtYVRo4.js → use-hydrating-Dth8POSk.js} +2 -3
  271. package/dist/chunks/{use-hydrating-COtYVRo4.js.map → use-hydrating-Dth8POSk.js.map} +1 -1
  272. package/dist/chunks/{use-indicator-C1ovED2B.js → use-indicator-Dmlj4ucA.js} +3 -4
  273. package/dist/chunks/{use-indicator-C1ovED2B.js.map → use-indicator-Dmlj4ucA.js.map} +1 -1
  274. package/dist/chunks/{use-layout-width-CbSDbRb0.js → use-layout-width-D53VE1kJ.js} +3 -4
  275. package/dist/chunks/{use-layout-width-CbSDbRb0.js.map → use-layout-width-D53VE1kJ.js.map} +1 -1
  276. package/dist/chunks/{use-scroll-fade-uc8mWSDX.js → use-scroll-fade-CNLSc2jm.js} +3 -4
  277. package/dist/chunks/{use-scroll-fade-uc8mWSDX.js.map → use-scroll-fade-CNLSc2jm.js.map} +1 -1
  278. package/dist/chunks/{use-scroll-margin-atRtf0v_.js → use-scroll-margin-CpP0MUMb.js} +3 -4
  279. package/dist/chunks/{use-scroll-margin-atRtf0v_.js.map → use-scroll-margin-CpP0MUMb.js.map} +1 -1
  280. package/dist/chunks/{use-truncated-CW0hByYt.js → use-truncated-CVim8MP9.js} +3 -4
  281. package/dist/chunks/{use-truncated-CW0hByYt.js.map → use-truncated-CVim8MP9.js.map} +1 -1
  282. package/dist/chunks/use-utc-while-hydrating-PP48Tcfz.js +8 -0
  283. package/dist/chunks/use-utc-while-hydrating-PP48Tcfz.js.map +1 -0
  284. package/dist/chunks/{virtual-rows-CC_kc2PR.js → virtual-rows-ByQ87hP0.js} +5 -5
  285. package/dist/chunks/virtual-rows-ByQ87hP0.js.map +1 -0
  286. package/dist/chunks/{visually-hidden-CLTH1HKD.js → visually-hidden-BQ8nOlYI.js} +3 -4
  287. package/dist/chunks/{visually-hidden-CLTH1HKD.js.map → visually-hidden-BQ8nOlYI.js.map} +1 -1
  288. package/dist/chunks/{when-idle-Cy3pinqO.js → when-idle-DXKwyOLB.js} +1 -2
  289. package/dist/chunks/{when-idle-Cy3pinqO.js.map → when-idle-DXKwyOLB.js.map} +1 -1
  290. package/dist/chunks/{zh-CN-Dv7n5mAr.js → zh-CN-8ZWE79zI.js} +61 -3
  291. package/dist/chunks/zh-CN-8ZWE79zI.js.map +1 -0
  292. package/dist/components/app-frame.js +1 -1
  293. package/dist/components/avatar.js +1 -1
  294. package/dist/components/badge.js +1 -1
  295. package/dist/components/banner.js +1 -1
  296. package/dist/components/button-group.js +1 -1
  297. package/dist/components/button.js +1 -1
  298. package/dist/components/calendar.js +1 -1
  299. package/dist/components/charts/bar.js +131 -133
  300. package/dist/components/charts/bar.js.map +1 -1
  301. package/dist/components/charts/donut.js +81 -81
  302. package/dist/components/charts/donut.js.map +1 -1
  303. package/dist/components/charts/heatmap.js +56 -57
  304. package/dist/components/charts/heatmap.js.map +1 -1
  305. package/dist/components/charts/sankey.js +54 -55
  306. package/dist/components/charts/sankey.js.map +1 -1
  307. package/dist/components/charts/sparkline.js +3 -4
  308. package/dist/components/charts/timeseries.js +1 -1
  309. package/dist/components/charts.js +5 -5
  310. package/dist/components/checkbox.js +1 -1
  311. package/dist/components/code-block.js +4 -4
  312. package/dist/components/code.js +1 -1
  313. package/dist/components/collapsible.js +1 -1
  314. package/dist/components/combobox.js +1 -1
  315. package/dist/components/command-palette.js +1 -1
  316. package/dist/components/copy-button.js +1 -1
  317. package/dist/components/dashboard/legend.js +2 -3
  318. package/dist/components/dashboard/metric-tabs.js +47 -48
  319. package/dist/components/dashboard/metric-tabs.js.map +1 -1
  320. package/dist/components/dashboard/model-card.js +10 -11
  321. package/dist/components/dashboard/model-card.js.map +1 -1
  322. package/dist/components/dashboard/rank-list.js +11 -12
  323. package/dist/components/dashboard/rank-list.js.map +1 -1
  324. package/dist/components/dashboard.js +1 -1
  325. package/dist/components/data-table.js +1 -1
  326. package/dist/components/date-picker.js +1 -1
  327. package/dist/components/dialog.js +1 -1
  328. package/dist/components/display-options.js +1 -1
  329. package/dist/components/empty.js +1 -1
  330. package/dist/components/field.js +1 -1
  331. package/dist/components/figure.js +1 -1
  332. package/dist/components/filter-chip.js +1 -1
  333. package/dist/components/filter-row.js +1 -1
  334. package/dist/components/flow-canvas.js +171 -170
  335. package/dist/components/flow-canvas.js.map +1 -1
  336. package/dist/components/flow.js +1 -1
  337. package/dist/components/heading.js +1 -1
  338. package/dist/components/icon.js +2 -2
  339. package/dist/components/input.js +3 -3
  340. package/dist/components/kaeso/conversation.js +57 -58
  341. package/dist/components/kaeso/conversation.js.map +1 -1
  342. package/dist/components/kaeso/identity.js +1 -1
  343. package/dist/components/kaeso/moments.js +9 -10
  344. package/dist/components/kaeso/moments.js.map +1 -1
  345. package/dist/components/kaeso/rights.js +1 -1
  346. package/dist/components/kaeso/usage.js +75 -76
  347. package/dist/components/kaeso/usage.js.map +1 -1
  348. package/dist/components/kaeso.js +3 -3
  349. package/dist/components/kbd.js +1 -1
  350. package/dist/components/key-value.js +1 -1
  351. package/dist/components/link.js +1 -1
  352. package/dist/components/list.js +1 -1
  353. package/dist/components/loader.js +2 -2
  354. package/dist/components/logo.js +1 -1
  355. package/dist/components/markdown.js +2 -2
  356. package/dist/components/menu.js +3 -3
  357. package/dist/components/meter.js +1 -1
  358. package/dist/components/page-header.js +1 -1
  359. package/dist/components/pagination.js +1 -1
  360. package/dist/components/playground.js +1448 -694
  361. package/dist/components/playground.js.map +1 -1
  362. package/dist/components/popover.js +1 -1
  363. package/dist/components/qr-code.js +1 -1
  364. package/dist/components/radio.js +1 -1
  365. package/dist/components/release-art.js +1 -1
  366. package/dist/components/scroll-area.js +1 -1
  367. package/dist/components/section.js +1 -1
  368. package/dist/components/segmented.js +1 -1
  369. package/dist/components/select.js +1 -1
  370. package/dist/components/separator.js +1 -1
  371. package/dist/components/settings.js +1 -1
  372. package/dist/components/sheet.js +1 -1
  373. package/dist/components/sidebar.js +1 -1
  374. package/dist/components/skeleton.js +1 -1
  375. package/dist/components/slider.js +1 -1
  376. package/dist/components/stat.js +3 -3
  377. package/dist/components/status.js +1 -1
  378. package/dist/components/swap-text.js +1 -1
  379. package/dist/components/switch.js +1 -1
  380. package/dist/components/table.js +1 -1
  381. package/dist/components/tabs.js +1 -1
  382. package/dist/components/tag.js +1 -1
  383. package/dist/components/text.js +1 -1
  384. package/dist/components/theme-image.js +1 -1
  385. package/dist/components/theme-menu.js +1 -1
  386. package/dist/components/thumbnail.js +2 -2
  387. package/dist/components/timeline.js +1 -1
  388. package/dist/components/toast.js +1 -1
  389. package/dist/components/toc.js +1 -1
  390. package/dist/components/toolbar.js +1 -1
  391. package/dist/components/tooltip.js +2 -2
  392. package/dist/components/visually-hidden.js +1 -1
  393. package/dist/format.js +275 -196
  394. package/dist/format.js.map +1 -1
  395. package/dist/i18n-locales.js +1 -2
  396. package/dist/i18n-provider.js +6 -7
  397. package/dist/i18n-provider.js.map +1 -1
  398. package/dist/i18n.js +5 -4
  399. package/dist/index.js +114 -113
  400. package/dist/kaeso.css +144 -32
  401. package/dist/styles.css +2 -2
  402. package/dist/theme.js +1 -1
  403. package/dist/types/components/avatar/avatar.d.ts +1 -1
  404. package/dist/types/components/banner/banner.d.ts +12 -12
  405. package/dist/types/components/button/button.d.ts +2 -2
  406. package/dist/types/components/charts/core.d.ts +37 -3
  407. package/dist/types/components/charts/domain.d.ts +0 -1
  408. package/dist/types/components/charts/donut.d.ts +3 -2
  409. package/dist/types/components/charts/marks.d.ts +1 -0
  410. package/dist/types/components/charts/tooltip.d.ts +1 -0
  411. package/dist/types/components/checkbox/checkbox.d.ts +1 -1
  412. package/dist/types/components/code/code.d.ts +2 -2
  413. package/dist/types/components/code-block/code-block.d.ts +2 -2
  414. package/dist/types/components/code-block/diff-view.d.ts +2 -2
  415. package/dist/types/components/code-block/json-view.d.ts +1 -1
  416. package/dist/types/components/code-block/words.d.ts +3 -0
  417. package/dist/types/components/combobox/combobox.d.ts +1 -1
  418. package/dist/types/components/command-list/command-list.d.ts +1 -1
  419. package/dist/types/components/copy-button/copy-button.d.ts +2 -2
  420. package/dist/types/components/dashboard/dashboard.d.ts +3 -3
  421. package/dist/types/components/dashboard/swap-value.d.ts +1 -0
  422. package/dist/types/components/data-table/data-table.d.ts +2 -1
  423. package/dist/types/components/empty/empty.d.ts +6 -6
  424. package/dist/types/components/figure/figure.d.ts +2 -2
  425. package/dist/types/components/filter-chip/docs.d.ts +1 -0
  426. package/dist/types/components/filter-chip/filter-chip.d.ts +5 -0
  427. package/dist/types/components/flow/flow.d.ts +1 -1
  428. package/dist/types/components/heading/heading.d.ts +4 -4
  429. package/dist/types/components/input/input-group.d.ts +3 -24
  430. package/dist/types/components/input/sizes.d.ts +24 -0
  431. package/dist/types/components/kaeso/identity.d.ts +1 -0
  432. package/dist/types/components/key-value/key-value.d.ts +5 -5
  433. package/dist/types/components/label/label.d.ts +4 -4
  434. package/dist/types/components/link/link.d.ts +8 -4
  435. package/dist/types/components/list/list.d.ts +1 -0
  436. package/dist/types/components/menu/menu.d.ts +1 -1
  437. package/dist/types/components/menu/styles.d.ts +2 -2
  438. package/dist/types/components/meter/docs.d.ts +1 -0
  439. package/dist/types/components/meter/gauge.d.ts +1 -0
  440. package/dist/types/components/meter/meter.d.ts +5 -4
  441. package/dist/types/components/page-header/page-header.d.ts +1 -1
  442. package/dist/types/components/playground/decision-questions.d.ts +20 -0
  443. package/dist/types/components/playground/decision-response.d.ts +41 -0
  444. package/dist/types/components/playground/decision-types.d.ts +69 -0
  445. package/dist/types/components/playground/docs.d.ts +50 -0
  446. package/dist/types/components/playground/index.d.ts +9 -0
  447. package/dist/types/components/playground/model-picker.d.ts +2 -2
  448. package/dist/types/components/playground/probability-bar.d.ts +34 -0
  449. package/dist/types/components/playground/question-editor.d.ts +29 -0
  450. package/dist/types/components/playground/response-metrics.d.ts +3 -1
  451. package/dist/types/components/playground/response-view.d.ts +2 -0
  452. package/dist/types/components/popover/popover.d.ts +1 -1
  453. package/dist/types/components/section/section.d.ts +1 -1
  454. package/dist/types/components/select/select.d.ts +9 -9
  455. package/dist/types/components/separator/separator.d.ts +12 -0
  456. package/dist/types/components/sidebar/sidebar-menu.d.ts +1 -1
  457. package/dist/types/components/sidebar/sidebar.d.ts +4 -4
  458. package/dist/types/components/skeleton/skeleton.d.ts +3 -3
  459. package/dist/types/components/stat/stat.d.ts +6 -6
  460. package/dist/types/components/switch/switch.d.ts +9 -7
  461. package/dist/types/components/tabs/tabs.d.ts +1 -1
  462. package/dist/types/components/text/text.d.ts +5 -5
  463. package/dist/types/components/theme-menu/docs.d.ts +1 -0
  464. package/dist/types/components/theme-menu/theme-menu.d.ts +1 -0
  465. package/dist/types/components/thumbnail/media-view.d.ts +3 -3
  466. package/dist/types/components/toc/toc.d.ts +3 -3
  467. package/dist/types/components/tooltip/tooltip.d.ts +1 -1
  468. package/dist/types/format/index.d.ts +50 -4
  469. package/dist/types/hooks/use-scrolled-under.d.ts +6 -0
  470. package/dist/types/hooks/use-utc-while-hydrating.d.ts +1 -0
  471. package/dist/types/i18n/context.d.ts +1 -0
  472. package/dist/types/i18n/formatters.d.ts +3 -0
  473. package/dist/types/i18n/index.d.ts +1 -0
  474. package/dist/types/icons/groups.d.ts +1 -1
  475. package/dist/types/icons/vocabulary.d.ts +5 -0
  476. package/dist/types/utils/arrow-focus.d.ts +4 -1
  477. package/dist/types/utils/cn.d.ts +9 -0
  478. package/dist/types/utils/row-control.d.ts +2 -0
  479. package/dist/utils.js +6 -6
  480. package/foundations/color.md +23 -24
  481. package/foundations/elevation.md +5 -4
  482. package/foundations/layout.md +1 -1
  483. package/foundations/motion.md +1 -1
  484. package/foundations/shape.md +4 -3
  485. package/foundations/typography.md +3 -2
  486. package/package.json +19 -19
  487. package/dist/chunks/app-frame-R1TWy5PY.js +0 -235
  488. package/dist/chunks/app-frame-R1TWy5PY.js.map +0 -1
  489. package/dist/chunks/arrow-focus-B0KdRFX8.js +0 -20
  490. package/dist/chunks/arrow-focus-B0KdRFX8.js.map +0 -1
  491. package/dist/chunks/avatar-DVrkoFEg.js.map +0 -1
  492. package/dist/chunks/banner-cJ89c-IR.js.map +0 -1
  493. package/dist/chunks/cn-CLpm819s.js.map +0 -1
  494. package/dist/chunks/code-block-7c_BOBlJ.js +0 -247
  495. package/dist/chunks/code-block-7c_BOBlJ.js.map +0 -1
  496. package/dist/chunks/code-block-BqFGa1-b.js.map +0 -1
  497. package/dist/chunks/collapsible-DmLyF8Ol.js.map +0 -1
  498. package/dist/chunks/combobox-B-xciC2c.js +0 -357
  499. package/dist/chunks/combobox-B-xciC2c.js.map +0 -1
  500. package/dist/chunks/command-list-GQ3y8on6.js.map +0 -1
  501. package/dist/chunks/command-palette-DEJDRW31.js.map +0 -1
  502. package/dist/chunks/context-BELWW79w.js +0 -20
  503. package/dist/chunks/context-BELWW79w.js.map +0 -1
  504. package/dist/chunks/copy-button-B67MEIu2.js.map +0 -1
  505. package/dist/chunks/core-CQUQdd7y.js +0 -414
  506. package/dist/chunks/core-CQUQdd7y.js.map +0 -1
  507. package/dist/chunks/dashboard-NqG9Wgga.js +0 -132
  508. package/dist/chunks/dashboard-NqG9Wgga.js.map +0 -1
  509. package/dist/chunks/data-table-ByhxIgY2.js +0 -625
  510. package/dist/chunks/data-table-ByhxIgY2.js.map +0 -1
  511. package/dist/chunks/date-picker-BmLb22jd.js +0 -346
  512. package/dist/chunks/date-picker-BmLb22jd.js.map +0 -1
  513. package/dist/chunks/de-V_lN_KKk.js.map +0 -1
  514. package/dist/chunks/dialog-C3CMOFxU.js +0 -611
  515. package/dist/chunks/dialog-C3CMOFxU.js.map +0 -1
  516. package/dist/chunks/display-options-BTFqLSJX.js.map +0 -1
  517. package/dist/chunks/domain-DtP6QrOA.js +0 -28
  518. package/dist/chunks/domain-DtP6QrOA.js.map +0 -1
  519. package/dist/chunks/empty-BSAHpS5Q.js +0 -38
  520. package/dist/chunks/empty-BSAHpS5Q.js.map +0 -1
  521. package/dist/chunks/field-ng87P1GV.js.map +0 -1
  522. package/dist/chunks/figure-_uZS1Y52.js.map +0 -1
  523. package/dist/chunks/filter-chip-CQO2lHeZ.js +0 -204
  524. package/dist/chunks/filter-chip-CQO2lHeZ.js.map +0 -1
  525. package/dist/chunks/flow-BGFXfXgJ.js.map +0 -1
  526. package/dist/chunks/icon-lgMMe3zk.js.map +0 -1
  527. package/dist/chunks/identity-DCghs4Wp.js.map +0 -1
  528. package/dist/chunks/input-QQR4KS9D.js.map +0 -1
  529. package/dist/chunks/input-group-A2mru3OM.js +0 -106
  530. package/dist/chunks/input-group-A2mru3OM.js.map +0 -1
  531. package/dist/chunks/json-view-DeHSFq-2.js.map +0 -1
  532. package/dist/chunks/kaeso-Bs1aLSTp.js.map +0 -1
  533. package/dist/chunks/key-value-DKW2q0zt.js.map +0 -1
  534. package/dist/chunks/link-CWYlF_dE.js +0 -54
  535. package/dist/chunks/link-CWYlF_dE.js.map +0 -1
  536. package/dist/chunks/list-CT7yIoA5.js +0 -565
  537. package/dist/chunks/list-CT7yIoA5.js.map +0 -1
  538. package/dist/chunks/markdown-BlIl3LuV.js.map +0 -1
  539. package/dist/chunks/menu-D3tUjkCM.js.map +0 -1
  540. package/dist/chunks/meter-wcH0LXva.js +0 -193
  541. package/dist/chunks/meter-wcH0LXva.js.map +0 -1
  542. package/dist/chunks/nav-sheet-CteQQuMz.js +0 -66
  543. package/dist/chunks/nav-sheet-CteQQuMz.js.map +0 -1
  544. package/dist/chunks/over-sheet-B8vzr_zU.js +0 -8
  545. package/dist/chunks/over-sheet-B8vzr_zU.js.map +0 -1
  546. package/dist/chunks/page-header-JWk6TQNN.js +0 -45
  547. package/dist/chunks/page-header-JWk6TQNN.js.map +0 -1
  548. package/dist/chunks/picker-popover-Bb-2Amjw.js.map +0 -1
  549. package/dist/chunks/range-popup-iBru5bpM.js.map +0 -1
  550. package/dist/chunks/rights-DDGgi823.js.map +0 -1
  551. package/dist/chunks/scroll-area-D-ykAChX.js.map +0 -1
  552. package/dist/chunks/section-BmR6_Wts.js +0 -99
  553. package/dist/chunks/section-BmR6_Wts.js.map +0 -1
  554. package/dist/chunks/segmented-BJJHHn0N.js.map +0 -1
  555. package/dist/chunks/select-Ch4u5oIg.js.map +0 -1
  556. package/dist/chunks/selects-text-R1lZHLKm.js.map +0 -1
  557. package/dist/chunks/separator-B2CT4qia.js.map +0 -1
  558. package/dist/chunks/settings-BnheJGYB.js +0 -83
  559. package/dist/chunks/settings-BnheJGYB.js.map +0 -1
  560. package/dist/chunks/sheet-K6qa1kRf.js +0 -119
  561. package/dist/chunks/sheet-K6qa1kRf.js.map +0 -1
  562. package/dist/chunks/sidebar-D7eSzz33.js +0 -664
  563. package/dist/chunks/sidebar-D7eSzz33.js.map +0 -1
  564. package/dist/chunks/sidebar-menu-f5NMgTdE.js.map +0 -1
  565. package/dist/chunks/skeleton-Bx-vRJdy.js.map +0 -1
  566. package/dist/chunks/stat-gR4hFqO8.js.map +0 -1
  567. package/dist/chunks/styles-8fn_bHRP.js +0 -21
  568. package/dist/chunks/styles-8fn_bHRP.js.map +0 -1
  569. package/dist/chunks/swap-value-DMEInk8V.js +0 -30
  570. package/dist/chunks/swap-value-DMEInk8V.js.map +0 -1
  571. package/dist/chunks/switch-CklvBjKu.js +0 -76
  572. package/dist/chunks/switch-CklvBjKu.js.map +0 -1
  573. package/dist/chunks/table-BTUUwlXD.js.map +0 -1
  574. package/dist/chunks/tabs-D0I6Jkd4.js.map +0 -1
  575. package/dist/chunks/tag-BGvgGsvr.js.map +0 -1
  576. package/dist/chunks/text-ChUk0Z46.js.map +0 -1
  577. package/dist/chunks/textarea-Bmj2Yk79.js +0 -171
  578. package/dist/chunks/textarea-Bmj2Yk79.js.map +0 -1
  579. package/dist/chunks/theme-menu-DvtuCuuN.js +0 -56
  580. package/dist/chunks/theme-menu-DvtuCuuN.js.map +0 -1
  581. package/dist/chunks/thumbnail-DadL1nPU.js +0 -71
  582. package/dist/chunks/thumbnail-DadL1nPU.js.map +0 -1
  583. package/dist/chunks/timeline-BQm5Q-Ul.js.map +0 -1
  584. package/dist/chunks/timeseries-B_Z3nNn6.js +0 -403
  585. package/dist/chunks/timeseries-B_Z3nNn6.js.map +0 -1
  586. package/dist/chunks/toast-CSlvlu-r.js.map +0 -1
  587. package/dist/chunks/toc-Cu2QJL5A.js.map +0 -1
  588. package/dist/chunks/toolbar-DE-R3sjA.js.map +0 -1
  589. package/dist/chunks/tooltip-C8ehtFju.js.map +0 -1
  590. package/dist/chunks/tooltip-SZvkUaq9.js +0 -202
  591. package/dist/chunks/tooltip-SZvkUaq9.js.map +0 -1
  592. package/dist/chunks/tooltip-root-CrLuOT4j.js.map +0 -1
  593. package/dist/chunks/virtual-rows-CC_kc2PR.js.map +0 -1
  594. package/dist/chunks/zh-CN-Dv7n5mAr.js.map +0 -1
@@ -1,59 +1,61 @@
1
1
  "use client";
2
- import { t as e } from "../chunks/cn-CLpm819s.js";
3
- import { t } from "../chunks/use-controllable-B5Fd12Bx.js";
4
- import { i as n, r } from "../chunks/context-BELWW79w.js";
5
- import { formatContext as i, formatDuration as a, formatNumber as o, formatPrice as s, formatUSD as c } from "../format.js";
6
- import { t as l } from "../chunks/use-truncated-CW0hByYt.js";
7
- import { n as u } from "../chunks/button-Da8b-8ub.js";
8
- import { t as d } from "../chunks/copy-button-B67MEIu2.js";
9
- import { a as f, o as p, s as m } from "../chunks/field-ng87P1GV.js";
10
- import { t as h } from "../chunks/input-QQR4KS9D.js";
11
- import { o as g, r as _ } from "../chunks/textarea-Bmj2Yk79.js";
12
- import { r as v } from "../chunks/tag-BGvgGsvr.js";
13
- import { r as y } from "../chunks/slider-BuEZfzNB.js";
14
- import { r as b } from "../chunks/switch-CklvBjKu.js";
15
- import { r as x } from "../chunks/segmented-BJJHHn0N.js";
16
- import { n as S, r as C } from "../chunks/select-Ch4u5oIg.js";
17
- import { r as w } from "../chunks/popover-CAoo5c59.js";
18
- import { r as T } from "../chunks/combobox-B-xciC2c.js";
19
- import { r as E } from "../chunks/thumbnail-D2hD8aEk.js";
20
- import { r as D, t as O } from "../chunks/command-list-GQ3y8on6.js";
21
- import { n as k, t as A } from "../chunks/picker-popover-Bb-2Amjw.js";
22
- import { c as j, d as M, s as ee, t as te } from "../chunks/identity-DCghs4Wp.js";
23
- import { t as ne } from "../chunks/reasoning-frame-DBIq2SMT.js";
24
- import { r as N } from "../chunks/markdown-BlIl3LuV.js";
25
- import { Children as P, createContext as re, forwardRef as F, isValidElement as ie, useCallback as ae, useContext as I, useEffect as L, useId as oe, useLayoutEffect as R, useMemo as z, useRef as B, useState as V, useSyncExternalStore as H } from "react";
26
- import { Fragment as U, jsx as W, jsxs as G } from "react/jsx-runtime";
27
- import { Add01Icon as K, ArrowLeft01Icon as q, ArrowReloadHorizontalIcon as se, ArrowRight01Icon as J, ArrowUp02Icon as ce, Attachment01Icon as le, AudioWave01Icon as ue, Cancel01Icon as de, Download01Icon as fe, File01Icon as Y, Pdf01Icon as X, StopIcon as Z } from "@hugeicons/core-free-icons";
28
- //#region src/components/playground/attachments.tsx
29
- var pe = { align: {
2
+ import { t as e } from "../chunks/cn-CF99d-bD.js";
3
+ import { a as t, i as n } from "../chunks/context-B2nNL7Im.js";
4
+ import { n as r } from "../chunks/button-L10eO8bf.js";
5
+ import { r as i } from "../chunks/tag-o9BCsRkO.js";
6
+ import { r as a } from "../chunks/thumbnail-DmFBC3Rf.js";
7
+ import { t as o } from "../chunks/use-controllable-rN5Fg5EJ.js";
8
+ import { t as s } from "../chunks/formatters-Be5AdLB2.js";
9
+ import { r as c } from "../chunks/markdown-CLMrgRju.js";
10
+ import { t as l } from "../chunks/copy-button-59YLQ_oG.js";
11
+ import { t as u } from "../chunks/reasoning-frame-BCoFYqgO.js";
12
+ import { t as d } from "../chunks/use-truncated-CVim8MP9.js";
13
+ import { plainFormatters as f } from "../format.js";
14
+ import { t as p } from "../chunks/input-DpGqfw1G.js";
15
+ import { o as m, r as h } from "../chunks/textarea-BP6I9yrU.js";
16
+ import { r as g } from "../chunks/popover-BFvV60-L.js";
17
+ import { r as _ } from "../chunks/segmented-1WSOvDjT.js";
18
+ import { n as v, r as y } from "../chunks/select-B3eoWXfR.js";
19
+ import { r as b } from "../chunks/slider-CSLWsGYq.js";
20
+ import { r as x, t as S } from "../chunks/command-list-ttU7YLEl.js";
21
+ import { n as C, t as w } from "../chunks/picker-popover-icF27914.js";
22
+ import { r as T } from "../chunks/combobox-B8GjFlO4.js";
23
+ import { r as E } from "../chunks/switch-C0sNr969.js";
24
+ import { a as D, o as O, s as k } from "../chunks/field-BJoH_7Mc.js";
25
+ import { c as A, d as j, s as M, t as N } from "../chunks/identity-DCNUQgql.js";
26
+ import { r as ee } from "../chunks/separator-CAxDTLUL.js";
27
+ import { Children as te, createContext as ne, forwardRef as P, isValidElement as re, useCallback as F, useContext as ie, useEffect as I, useId as L, useLayoutEffect as R, useMemo as z, useRef as B, useState as V, useSyncExternalStore as ae } from "react";
28
+ import { Fragment as H, jsx as U, jsxs as W } from "react/jsx-runtime";
29
+ import { Add01Icon as oe, ArrowExpand01Icon as G, ArrowLeft01Icon as K, ArrowReloadHorizontalIcon as q, ArrowRight01Icon as J, ArrowShrink02Icon as se, ArrowUp02Icon as Y, Attachment01Icon as ce, AudioWave01Icon as X, Cancel01Icon as le, Delete02Icon as ue, Download01Icon as de, File01Icon as fe, Pdf01Icon as Z, StopIcon as pe } from "@hugeicons/core-free-icons";
30
+ // src/components/playground/attachments.tsx
31
+ var me = { align: {
30
32
  start: { classes: "justify-start" },
31
33
  end: { classes: "justify-end" }
32
- } }, me = { align: "start" }, he = (e) => e.type.startsWith("image/") && !!e.src, ge = /* @__PURE__ */ F(function({ items: t, onRemove: r, align: i = "start", "aria-label": a, className: o }, s) {
33
- let c = n();
34
- return t.length === 0 ? null : /* @__PURE__ */ W("ul", {
35
- ref: s,
36
- "aria-label": a ?? c("attachments.label", "Attachments"),
37
- className: e("flex min-w-0 flex-wrap items-center gap-8", pe.align[i].classes, o),
38
- children: t.map((e) => {
39
- let t = c("attachments.remove", "Remove {name}", { name: e.name });
40
- return /* @__PURE__ */ W("li", {
34
+ } }, he = { align: "start" }, ge = (e) => e.type.startsWith("image/") && !!e.src, _e = /* @__PURE__ */ P(function({ items: n, onRemove: o, align: s = "start", "aria-label": c, className: l }, u) {
35
+ let d = t();
36
+ return n.length === 0 ? null : /* @__PURE__ */ U("ul", {
37
+ ref: u,
38
+ "aria-label": c ?? d("attachments.label", "Attachments"),
39
+ className: e("flex min-w-0 flex-wrap items-center gap-8", me.align[s].classes, l),
40
+ children: n.map((e) => {
41
+ let t = d("attachments.remove", "Remove {name}", { name: e.name });
42
+ return /* @__PURE__ */ U("li", {
41
43
  className: "relative flex min-w-0",
42
- children: he(e) ? /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(E, {
44
+ children: ge(e) ? /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U(a, {
43
45
  src: e.src ?? "",
44
46
  alt: e.name,
45
47
  size: "sm"
46
- }), r && /* @__PURE__ */ W(u, {
48
+ }), o && /* @__PURE__ */ U(r, {
47
49
  size: "xs",
48
50
  variant: "secondary",
49
- icon: de,
51
+ icon: le,
50
52
  "aria-label": t,
51
- onClick: () => r(e.id),
53
+ onClick: () => o(e.id),
52
54
  className: "absolute top-4 right-4 controls-on-picture"
53
- })] }) : /* @__PURE__ */ W(v, {
54
- icon: e.type === "application/pdf" ? X : e.type.startsWith("audio/") ? ue : Y,
55
- ...r ? {
56
- onRemove: () => r(e.id),
55
+ })] }) : /* @__PURE__ */ U(i, {
56
+ icon: e.type === "application/pdf" ? Z : e.type.startsWith("audio/") ? X : fe,
57
+ ...o ? {
58
+ onRemove: () => o(e.id),
57
59
  removeLabel: t
58
60
  } : {},
59
61
  className: "max-w-240",
@@ -63,178 +65,176 @@ var pe = { align: {
63
65
  })
64
66
  });
65
67
  });
66
- process.env.NODE_ENV !== "production" && (ge.displayName = "Attachments");
67
- //#endregion
68
- //#region src/components/playground/composer.tsx
69
- var _e = { size: {
68
+ process.env.NODE_ENV !== "production" && (_e.displayName = "Attachments");
69
+ // src/components/playground/composer.tsx
70
+ var ve = { size: {
70
71
  md: { classes: "rounded-frame" },
71
72
  sm: { classes: "rounded-frame" }
72
- } }, ve = { size: "md" }, ye = "(pointer: coarse)";
73
- function be(e) {
73
+ } }, ye = { size: "md" }, be = "(pointer: coarse)";
74
+ function xe(e) {
74
75
  if (typeof window > "u" || !window.matchMedia) return () => {};
75
- let t = window.matchMedia(ye);
76
+ let t = window.matchMedia(be);
76
77
  return t.addEventListener?.("change", e), () => t.removeEventListener?.("change", e);
77
78
  }
78
- var Q = () => typeof window < "u" && !!window.matchMedia?.(ye).matches, xe = () => H(be, Q, () => !1), Se = (e) => e ? Array.from(e) : [], Ce = (e) => Array.from(e.dataTransfer?.types ?? []).includes("Files"), we = /* @__PURE__ */ F(function({ value: r, defaultValue: i = "", onValueChange: a, onSubmit: o, onStop: s, submitOn: c = "enter", streaming: l = !1, loading: d = !1, disabled: f = !1, clearOnSubmit: p = !0, placeholder: m, "aria-label": h, maxRows: g = 10, size: _ = "md", actions: v, submitLabel: y, stopLabel: b, autoFocus: x, name: S, attachments: C = [], onAttach: w, onRemoveAttachment: T, accept: E, attachLabel: D, "data-force": O, className: k }, A) {
79
- let j = n(), M = m ?? j("composer.placeholder", "Write a prompt"), ee = h ?? j("composer.prompt", "Prompt"), te = y ?? j("composer.send", "Send"), ne = b ?? j("composer.stop", "Stop"), N = D ?? j("composer.attach", "Attach files"), [P, re] = t(r, i, a), F = B(null), [ie, I] = V(!1), L = !!w && !f, z = oe(), H = B(null), K = _ === "sm" ? 1 : 2, q = ae(() => {
80
- let e = H.current;
79
+ var Q = () => typeof window < "u" && !!window.matchMedia?.(be).matches, Se = () => ae(xe, Q, () => !1), Ce = (e) => e ? Array.from(e) : [], we = (e) => Array.from(e.dataTransfer?.types ?? []).includes("Files"), Te = /* @__PURE__ */ P(function({ value: n, defaultValue: i = "", onValueChange: a, onSubmit: s, onStop: c, submitOn: l = "enter", streaming: u = !1, loading: d = !1, disabled: f = !1, clearOnSubmit: p = !0, placeholder: m, "aria-label": h, maxRows: g = 10, size: _ = "md", actions: v, submitLabel: y, stopLabel: b, autoFocus: x, name: S, attachments: C = [], onAttach: w, onRemoveAttachment: T, accept: E, attachLabel: D, "data-force": O, className: k }, A) {
80
+ let j = t(), M = m ?? j("composer.placeholder", "Write a prompt"), N = h ?? j("composer.prompt", "Prompt"), ee = y ?? j("composer.send", "Send"), te = b ?? j("composer.stop", "Stop"), ne = D ?? j("composer.attach", "Attach files"), [P, re] = o(n, i, a), ie = B(null), [I, z] = V(!1), ae = !!w && !f, oe = L(), G = B(null), K = _ === "sm" ? 1 : 2, q = F(() => {
81
+ let e = G.current;
81
82
  e && (e.style.setProperty("--scroll-area-overflow-y-start", `${Math.max(0, e.scrollTop)}px`), e.style.setProperty("--scroll-area-overflow-y-end", `${Math.max(0, e.scrollHeight - e.clientHeight - e.scrollTop)}px`));
82
- }, []), se = ae(() => {
83
- let e = H.current;
83
+ }, []), J = F(() => {
84
+ let e = G.current;
84
85
  e && (e.style.height = "auto", e.style.height = `${Math.min(Math.max(e.scrollHeight, K * 20 + 16), g * 20 + 16)}px`, q());
85
86
  }, [
86
87
  g,
87
88
  K,
88
89
  q
89
90
  ]);
90
- R(se, [se, P]);
91
- let J = P.trim() === "" && C.length === 0, ue = !f && !l && !d && !J, de = () => {
92
- ue && (o?.(P), p && r === void 0 && re(""));
93
- }, fe = xe(), Y = c === "enter" && !fe, X = (e) => {
94
- e.key === "Enter" && (e.nativeEvent.isComposing || e.keyCode === 229 || (e.metaKey || e.ctrlKey || Y && !e.shiftKey && !e.altKey) && (e.preventDefault(), de()));
95
- }, pe = (e) => {
96
- e.preventDefault(), de();
91
+ R(J, [J, P]);
92
+ let se = P.trim() === "" && C.length === 0, X = !f && !u && !d && !se, le = () => {
93
+ X && (s?.(P), p && n === void 0 && re(""));
94
+ }, ue = Se(), de = l === "enter" && !ue, fe = (e) => {
95
+ e.key === "Enter" && (e.nativeEvent.isComposing || e.keyCode === 229 || (e.metaKey || e.ctrlKey || de && !e.shiftKey && !e.altKey) && (e.preventDefault(), le()));
96
+ }, Z = (e) => {
97
+ e.preventDefault(), le();
97
98
  }, me = (e) => {
98
- let t = Se(e.clipboardData?.files);
99
- L && t.length !== 0 && (e.clipboardData.getData("text/plain") || e.preventDefault(), w?.(t));
99
+ let t = Ce(e.clipboardData?.files);
100
+ ae && t.length !== 0 && (e.clipboardData.getData("text/plain") || e.preventDefault(), w?.(t));
100
101
  };
101
- return /* @__PURE__ */ G("form", {
102
- onSubmit: pe,
102
+ return /* @__PURE__ */ W("form", {
103
+ onSubmit: Z,
103
104
  onMouseDown: (e) => {
104
105
  if (f || e.button !== 0 || !e.currentTarget.contains(e.target)) return;
105
106
  let t = e.target.closest("textarea, button, a, input, select, label, [role], [tabindex]");
106
- t && e.currentTarget.contains(t) || (e.preventDefault(), H.current?.focus());
107
+ t && e.currentTarget.contains(t) || (e.preventDefault(), G.current?.focus());
107
108
  },
108
- ...L ? {
109
+ ...ae ? {
109
110
  onDragEnter: (e) => {
110
- Ce(e) && I(!0);
111
+ we(e) && z(!0);
111
112
  },
112
113
  onDragOver: (e) => {
113
- Ce(e) && (e.preventDefault(), e.dataTransfer.dropEffect = "copy");
114
+ we(e) && (e.preventDefault(), e.dataTransfer.dropEffect = "copy");
114
115
  },
115
116
  onDragLeave: (e) => {
116
- e.currentTarget.contains(e.relatedTarget) || I(!1);
117
+ e.currentTarget.contains(e.relatedTarget) || z(!1);
117
118
  },
118
119
  onDrop: (e) => {
119
- I(!1);
120
- let t = Se(e.dataTransfer?.files);
120
+ z(!1);
121
+ let t = Ce(e.dataTransfer?.files);
121
122
  t.length !== 0 && (e.preventDefault(), w?.(t));
122
123
  }
123
124
  } : {},
124
125
  ...O ? { "data-force": O } : {},
125
126
  ...f ? { "data-disabled": "" } : {},
126
- ...ie && L ? { "data-drop": "" } : {},
127
- className: e("flex min-w-0 cursor-text flex-col material-composer transition-control", _e.size[_].classes, f && "cursor-not-allowed", k),
127
+ ...I && ae ? { "data-drop": "" } : {},
128
+ className: e("flex min-w-0 cursor-text flex-col material-composer transition-control", ve.size[_].classes, f && "cursor-not-allowed", k),
128
129
  children: [
129
- C.length > 0 && /* @__PURE__ */ W(ge, {
130
+ C.length > 0 && /* @__PURE__ */ U(_e, {
130
131
  items: C,
131
132
  onRemove: f ? void 0 : T,
132
133
  className: "px-8 pt-8"
133
134
  }),
134
- /* @__PURE__ */ W("textarea", {
135
+ /* @__PURE__ */ U("textarea", {
135
136
  ref: (e) => {
136
- H.current = e, typeof A == "function" ? A(e) : A && (A.current = e);
137
+ G.current = e, typeof A == "function" ? A(e) : A && (A.current = e);
137
138
  },
138
139
  rows: K,
139
140
  value: P,
140
141
  onChange: (e) => re(e.target.value),
141
- onKeyDown: X,
142
+ onKeyDown: fe,
142
143
  onPaste: me,
143
144
  onScroll: q,
144
145
  disabled: f,
145
146
  placeholder: M,
146
- "aria-label": ee,
147
- ...l && !J ? { "aria-describedby": z } : {},
148
- "aria-keyshortcuts": Y ? "Enter Meta+Enter Control+Enter" : "Meta+Enter Control+Enter",
149
- ...Y ? { enterKeyHint: "send" } : {},
147
+ "aria-label": N,
148
+ ...u && !se ? { "aria-describedby": oe } : {},
149
+ "aria-keyshortcuts": de ? "Enter Meta+Enter Control+Enter" : "Meta+Enter Control+Enter",
150
+ ...de ? { enterKeyHint: "send" } : {},
150
151
  autoFocus: x,
151
152
  ...S ? { name: S } : {},
152
153
  className: "block w-full min-w-0 resize-none bg-transparent px-16 pt-12 pb-4 text-body text-fg outline-none scrollbar-quiet scroll-fade-y placeholder:text-fg-tertiary disabled:cursor-not-allowed disabled:text-fg-disabled disabled:placeholder:text-fg-disabled"
153
154
  }),
154
- /* @__PURE__ */ W("span", {
155
- id: z,
155
+ /* @__PURE__ */ U("span", {
156
+ id: oe,
156
157
  className: "sr-only",
157
158
  children: j("composer.stopToSend", "A response is arriving; stop it to send this prompt.")
158
159
  }),
159
- /* @__PURE__ */ G("div", {
160
+ /* @__PURE__ */ W("div", {
160
161
  className: "flex min-w-0 items-center gap-8 p-8 pt-4 controls-on-fill",
161
- children: [/* @__PURE__ */ G("div", {
162
+ children: [/* @__PURE__ */ W("div", {
162
163
  className: "flex min-w-0 flex-1 items-center gap-4",
163
- children: [w && /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(u, {
164
+ children: [w && /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U(r, {
164
165
  type: "button",
165
166
  size: "sm",
166
167
  variant: "ghost",
167
- icon: le,
168
- "aria-label": N,
168
+ icon: ce,
169
+ "aria-label": ne,
169
170
  disabled: f,
170
- onClick: () => F.current?.click()
171
- }), /* @__PURE__ */ W("input", {
172
- ref: F,
171
+ onClick: () => ie.current?.click()
172
+ }), /* @__PURE__ */ U("input", {
173
+ ref: ie,
173
174
  type: "file",
174
175
  multiple: !0,
175
176
  hidden: !0,
176
177
  tabIndex: -1,
177
178
  ...E ? { accept: E } : {},
178
179
  onChange: (e) => {
179
- let t = Se(e.currentTarget.files);
180
+ let t = Ce(e.currentTarget.files);
180
181
  e.currentTarget.value = "", t.length && w?.(t);
181
182
  }
182
183
  })] }), v]
183
- }), l ? /* @__PURE__ */ W(u, {
184
+ }), u ? /* @__PURE__ */ U(r, {
184
185
  type: "button",
185
186
  size: "sm",
186
187
  variant: "secondary",
187
- icon: Z,
188
- "aria-label": ne,
189
- onClick: () => s?.(),
188
+ icon: pe,
189
+ "aria-label": te,
190
+ onClick: () => c?.(),
190
191
  disabled: f
191
- }) : /* @__PURE__ */ W(u, {
192
+ }) : /* @__PURE__ */ U(r, {
192
193
  type: "submit",
193
194
  size: "sm",
194
195
  variant: "primary",
195
- icon: ce,
196
- "aria-label": te,
196
+ icon: Y,
197
+ "aria-label": ee,
197
198
  loading: d,
198
- disabled: !ue && !d
199
+ disabled: !X && !d
199
200
  })]
200
201
  })
201
202
  ]
202
203
  });
203
204
  });
204
- process.env.NODE_ENV !== "production" && (we.displayName = "Composer");
205
- //#endregion
206
- //#region src/components/playground/media-response.tsx
207
- var Te = { kind: {
205
+ process.env.NODE_ENV !== "production" && (Te.displayName = "Composer");
206
+ // src/components/playground/media-response.tsx
207
+ var Ee = { kind: {
208
208
  image: { classes: "" },
209
209
  audio: { classes: "" },
210
210
  video: { classes: "" }
211
- } }, Ee = { kind: "image" }, De = "relative min-w-0 overflow-hidden rounded-frame bg-fill-1 image-outline", Oe = "animate-pulse-quiet reduced:animate-none", ke = { aspectRatio: "16 / 9" };
212
- function Ae({ item: e, label: t }) {
213
- return /* @__PURE__ */ W(u, {
211
+ } }, De = { kind: "image" }, Oe = "relative min-w-0 overflow-hidden rounded-well bg-fill-1 image-outline", ke = "animate-pulse-quiet reduced:animate-none", Ae = { aspectRatio: "16 / 9" };
212
+ function je({ item: e, label: t }) {
213
+ return /* @__PURE__ */ U(r, {
214
214
  size: "sm",
215
215
  variant: "secondary",
216
- icon: fe,
216
+ icon: de,
217
217
  "aria-label": t,
218
218
  href: e.src,
219
219
  download: e.name
220
220
  });
221
221
  }
222
- function je({ items: t, expected: n, waiting: r, t: i }) {
222
+ function Me({ items: t, expected: n, waiting: r, t: i }) {
223
223
  let a = r ? Math.max(1, n) : t.length;
224
- return /* @__PURE__ */ W("ul", {
224
+ return /* @__PURE__ */ U("ul", {
225
225
  className: e("grid gap-8", a > 1 ? "grid-cols-2" : "max-w-480 grid-cols-1"),
226
226
  children: Array.from({ length: a }, (n, a) => {
227
227
  let o = r ? void 0 : t[a];
228
- return /* @__PURE__ */ W("li", {
229
- className: e(De, "aspect-square", !o && Oe),
230
- children: o && /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("img", {
228
+ return /* @__PURE__ */ U("li", {
229
+ className: e(Oe, "aspect-square", !o && ke),
230
+ children: o && /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U("img", {
231
231
  src: o.src,
232
232
  alt: o.alt ?? o.label ?? o.name,
233
233
  decoding: "async",
234
234
  className: "size-full object-contain"
235
- }), /* @__PURE__ */ W("span", {
235
+ }), /* @__PURE__ */ U("span", {
236
236
  className: "absolute right-8 bottom-8",
237
- children: /* @__PURE__ */ W(Ae, {
237
+ children: /* @__PURE__ */ U(je, {
238
238
  item: o,
239
239
  label: i("mediaResponse.download", "Download {name}", { name: o.label ?? o.name })
240
240
  })
@@ -243,9 +243,9 @@ function je({ items: t, expected: n, waiting: r, t: i }) {
243
243
  })
244
244
  });
245
245
  }
246
- function Me(e) {
246
+ function Ne(e) {
247
247
  let [t, n] = V(0);
248
- return L(() => {
248
+ return I(() => {
249
249
  if (!e) return;
250
250
  let t = Date.now();
251
251
  n(0);
@@ -253,178 +253,177 @@ function Me(e) {
253
253
  return () => clearInterval(r);
254
254
  }, [e]), t;
255
255
  }
256
- var Ne = /* @__PURE__ */ F(function({ kind: t = "image", status: r = "done", items: i = [], expected: a = 1, progress: s, onCancel: c, error: l, onRetry: d, footer: f, "aria-label": p, className: m }, h) {
257
- let g = n(), _ = p ?? g("responseView.response", "Response"), v = r === "pending" || r === "running", y = oe(), b = Me(v && t === "video"), x = B(r), [S, C] = V("");
258
- L(() => {
259
- let e = x.current;
260
- x.current = r, v ? C("") : (e === "pending" || e === "running") && r === "done" && C(g("responseView.endedDone", "{label} finished", { label: _ }));
256
+ var Pe = /* @__PURE__ */ P(function({ kind: n = "image", status: i = "done", items: a = [], expected: o = 1, progress: l, onCancel: u, error: d, onRetry: f, footer: p, "aria-label": m, className: h }, g) {
257
+ let _ = t(), { formatNumber: v } = s(), y = m ?? _("responseView.response", "Response"), b = i === "pending" || i === "running", x = L(), S = Ne(b && n === "video"), C = B(i), [w, T] = V("");
258
+ I(() => {
259
+ let e = C.current;
260
+ C.current = i, b ? T("") : (e === "pending" || e === "running") && i === "done" && T(_("responseView.endedDone", "{label} finished", { label: y }));
261
261
  }, [
262
- r,
263
- v,
264
- _,
265
- g
262
+ i,
263
+ b,
264
+ y,
265
+ _
266
266
  ]);
267
- let w = typeof s == "number" && Number.isFinite(s) ? Math.max(0, Math.min(100, s)) : null, T = t === "image" ? g("mediaResponse.makingImages", "Making the image") : t === "audio" ? g("mediaResponse.makingAudio", "Making the audio") : r === "pending" || w === null || w === 0 ? g("mediaResponse.queued", "Waiting for the provider to start the video") : g("mediaResponse.makingVideo", "Making the video, {percent}% done", { percent: o(Math.round(w)) }), E = f != null, D = g("responseView.retry", "Retry"), O = r === "done" && t === "video" && i[0], k = r === "done" && (d || O) ? /* @__PURE__ */ G("span", {
267
+ let E = typeof l == "number" && Number.isFinite(l) ? Math.max(0, Math.min(100, l)) : null, D = n === "image" ? _("mediaResponse.makingImages", "Making the image") : n === "audio" ? _("mediaResponse.makingAudio", "Making the audio") : i === "pending" || E === null || E === 0 ? _("mediaResponse.queued", "Waiting for the provider to start the video") : _("mediaResponse.makingVideo", "Making the video, {percent}% done", { percent: v(Math.round(E)) }), O = p != null, k = _("responseView.retry", "Retry"), A = i === "done" && n === "video" && a[0], j = i === "done" && (f || A) ? /* @__PURE__ */ W("span", {
268
268
  "data-reply-actions": "",
269
- className: e("flex items-center gap-x-4 transition-arrive reduced:transition-none starting:opacity-0", O && d ? "starting:-ml-72" : "starting:-ml-36"),
270
- children: [O && /* @__PURE__ */ W(u, {
269
+ className: e("flex items-center gap-x-4 transition-arrive reduced:transition-none starting:opacity-0", A && f ? "starting:-ml-72" : "starting:-ml-36"),
270
+ children: [A && /* @__PURE__ */ U(r, {
271
271
  size: "sm",
272
272
  variant: "quiet",
273
- icon: fe,
274
- "aria-label": g("mediaResponse.download", "Download {name}", { name: O.label ?? O.name }),
275
- href: O.src,
276
- download: O.name
277
- }), d && /* @__PURE__ */ W(u, {
273
+ icon: de,
274
+ "aria-label": _("mediaResponse.download", "Download {name}", { name: A.label ?? A.name }),
275
+ href: A.src,
276
+ download: A.name
277
+ }), f && /* @__PURE__ */ U(r, {
278
278
  size: "sm",
279
279
  variant: "quiet",
280
- icon: se,
281
- "aria-label": D,
282
- onClick: d
280
+ icon: q,
281
+ "aria-label": k,
282
+ onClick: f
283
283
  })]
284
- }) : null, A = i[0];
285
- return /* @__PURE__ */ G("article", {
286
- ref: h,
287
- "aria-label": _,
288
- "aria-busy": v || void 0,
289
- ...v ? { "aria-describedby": y } : {},
290
- className: e("flex min-w-0 flex-col gap-8", m),
284
+ }) : null, M = a[0];
285
+ return /* @__PURE__ */ W("article", {
286
+ ref: g,
287
+ "aria-label": y,
288
+ "aria-busy": b || void 0,
289
+ ...b ? { "aria-describedby": x } : {},
290
+ className: e("flex min-w-0 flex-col gap-8", h),
291
291
  children: [
292
- t === "image" && (v || i.length > 0) && /* @__PURE__ */ W(je, {
293
- items: i,
294
- expected: a,
295
- waiting: v,
296
- t: g
292
+ n === "image" && (b || a.length > 0) && /* @__PURE__ */ U(Me, {
293
+ items: a,
294
+ expected: o,
295
+ waiting: b,
296
+ t: _
297
297
  }),
298
- t === "audio" && (v ? /* @__PURE__ */ W("div", {
298
+ n === "audio" && (b ? /* @__PURE__ */ U("div", {
299
299
  "aria-hidden": !0,
300
- className: e("h-56 rounded-pill bg-fill-1", Oe)
301
- }) : A ? /* @__PURE__ */ G("div", {
300
+ className: e("h-56 rounded-pill bg-fill-1", ke)
301
+ }) : M ? /* @__PURE__ */ W("div", {
302
302
  className: "flex h-56 min-w-0 items-center gap-8",
303
- children: [/* @__PURE__ */ W("audio", {
303
+ children: [/* @__PURE__ */ U("audio", {
304
304
  controls: !0,
305
305
  preload: "metadata",
306
- src: A.src,
307
- "aria-label": A.label ?? A.name,
306
+ src: M.src,
307
+ "aria-label": M.label ?? M.name,
308
308
  className: "h-40 min-w-0 flex-1"
309
- }), /* @__PURE__ */ W(Ae, {
310
- item: A,
311
- label: g("mediaResponse.download", "Download {name}", { name: A.label ?? A.name })
309
+ }), /* @__PURE__ */ U(je, {
310
+ item: M,
311
+ label: _("mediaResponse.download", "Download {name}", { name: M.label ?? M.name })
312
312
  })]
313
313
  }) : null),
314
- t === "video" && (v || A ? /* @__PURE__ */ W("div", {
315
- className: e(De, v && "flex flex-col items-center justify-center gap-12 px-24"),
316
- style: ke,
317
- children: v ? /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("div", {
314
+ n === "video" && (b || M ? /* @__PURE__ */ U("div", {
315
+ className: e(Oe, b && "flex flex-col items-center justify-center gap-12 px-24"),
316
+ style: Ae,
317
+ children: b ? /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U("div", {
318
318
  role: "progressbar",
319
- "aria-label": T,
319
+ "aria-label": D,
320
320
  "aria-valuemin": 0,
321
321
  "aria-valuemax": 100,
322
- ...w === null ? {} : { "aria-valuenow": Math.round(w) },
322
+ ...E === null ? {} : { "aria-valuenow": Math.round(E) },
323
323
  className: "h-6 w-full max-w-240 overflow-hidden rounded-pill bg-fill-2",
324
- children: /* @__PURE__ */ W("div", {
325
- className: e("h-full rounded-pill bg-fg-secondary", w === null && Oe),
326
- style: { width: `${w === null ? 100 : Math.max(4, w)}%` }
324
+ children: /* @__PURE__ */ U("div", {
325
+ className: e("h-full rounded-pill bg-fg-secondary", E === null && ke),
326
+ style: { width: `${E === null ? 100 : Math.max(4, E)}%` }
327
327
  })
328
- }), c && /* @__PURE__ */ W(u, {
328
+ }), u && /* @__PURE__ */ U(r, {
329
329
  size: "sm",
330
330
  variant: "secondary",
331
- onClick: c,
332
- children: g("mediaResponse.cancel", "Cancel")
333
- })] }) : A && /* @__PURE__ */ W("video", {
331
+ onClick: u,
332
+ children: _("mediaResponse.cancel", "Cancel")
333
+ })] }) : M && /* @__PURE__ */ U("video", {
334
334
  controls: !0,
335
335
  playsInline: !0,
336
336
  preload: "metadata",
337
- src: A.src,
338
- "aria-label": A.label ?? A.name,
337
+ src: M.src,
338
+ "aria-label": M.label ?? M.name,
339
339
  className: "size-full object-contain"
340
340
  })
341
341
  }) : null),
342
- v && /* @__PURE__ */ G("p", {
343
- id: y,
342
+ b && /* @__PURE__ */ W("p", {
343
+ id: x,
344
344
  className: "flex min-h-22 items-center gap-8 px-12 text-small text-fg-secondary tabular",
345
- children: [/* @__PURE__ */ W("span", {
345
+ children: [/* @__PURE__ */ U("span", {
346
346
  className: "min-w-0 truncate",
347
- children: T
348
- }), t === "video" && b > 0 && /* @__PURE__ */ W("span", {
347
+ children: D
348
+ }), n === "video" && S > 0 && /* @__PURE__ */ U("span", {
349
349
  className: "text-fg-tertiary",
350
- children: g("format.seconds", "{s} s", { s: o(b) })
350
+ children: _("format.seconds", "{s} s", { s: v(S) })
351
351
  })]
352
352
  }),
353
- r === "done" && i.length === 0 && /* @__PURE__ */ W("span", {
353
+ i === "done" && a.length === 0 && /* @__PURE__ */ U("span", {
354
354
  className: "px-12 text-small text-fg-tertiary",
355
- children: g("mediaResponse.nothing", "The model returned nothing to show")
355
+ children: _("mediaResponse.nothing", "The model returned nothing to show")
356
356
  }),
357
- r === "stopped" && /* @__PURE__ */ G("div", {
357
+ i === "stopped" && /* @__PURE__ */ W("div", {
358
358
  className: "flex min-h-32 flex-wrap items-center gap-x-12 gap-y-4 px-12",
359
- children: [/* @__PURE__ */ W("span", {
359
+ children: [/* @__PURE__ */ U("span", {
360
360
  className: "text-small text-fg-secondary",
361
- children: g("mediaResponse.stopped", "Stopped before it finished")
362
- }), d && /* @__PURE__ */ W(u, {
361
+ children: _("mediaResponse.stopped", "Stopped before it finished")
362
+ }), f && /* @__PURE__ */ U(r, {
363
363
  size: "sm",
364
364
  variant: "secondary",
365
- onClick: d,
366
- children: g("responseView.retry", "Retry")
365
+ onClick: f,
366
+ children: _("responseView.retry", "Retry")
367
367
  })]
368
368
  }),
369
- r === "error" && /* @__PURE__ */ G("div", {
369
+ i === "error" && /* @__PURE__ */ W("div", {
370
370
  className: "flex flex-col items-start gap-8 px-12",
371
- children: [/* @__PURE__ */ G("div", {
371
+ children: [/* @__PURE__ */ W("div", {
372
372
  role: "alert",
373
373
  className: "flex min-w-0 flex-col gap-4",
374
- children: [/* @__PURE__ */ W("span", {
374
+ children: [/* @__PURE__ */ U("span", {
375
375
  className: "text-small font-medium text-fg",
376
- children: g("responseView.noResponse", "No response")
377
- }), l && /* @__PURE__ */ W(N, {
378
- text: l,
376
+ children: _("responseView.noResponse", "No response")
377
+ }), d && /* @__PURE__ */ U(c, {
378
+ text: d,
379
379
  size: "small",
380
380
  tone: "secondary",
381
381
  className: "max-w-prose min-w-0"
382
382
  })]
383
- }), d && /* @__PURE__ */ W(u, {
383
+ }), f && /* @__PURE__ */ U(r, {
384
384
  size: "sm",
385
385
  variant: "secondary",
386
- onClick: d,
387
- children: g("responseView.retry", "Retry")
386
+ onClick: f,
387
+ children: _("responseView.retry", "Retry")
388
388
  })]
389
389
  }),
390
- (E || k) && /* @__PURE__ */ G("div", {
390
+ (O || j) && /* @__PURE__ */ W("div", {
391
391
  className: "flex min-h-32 min-w-0 flex-wrap items-center gap-x-4 gap-y-4",
392
- children: [k, E && /* @__PURE__ */ W("div", {
393
- className: e("min-w-0", k ? "px-8" : "px-12"),
394
- children: f
392
+ children: [j, O && /* @__PURE__ */ U("div", {
393
+ className: e("min-w-0", j ? "px-8" : "px-12"),
394
+ children: p
395
395
  })]
396
396
  }),
397
- /* @__PURE__ */ W("span", {
397
+ /* @__PURE__ */ U("span", {
398
398
  role: "status",
399
399
  className: "sr-only",
400
- children: S
400
+ children: w
401
401
  })
402
402
  ]
403
403
  });
404
404
  });
405
- process.env.NODE_ENV !== "production" && (Ne.displayName = "MediaResponse");
406
- //#endregion
407
- //#region src/components/playground/compare-grid.tsx
408
- var Pe = { divider: {
405
+ process.env.NODE_ENV !== "production" && (Pe.displayName = "MediaResponse");
406
+ // src/components/playground/compare-grid.tsx
407
+ var Fe = { divider: {
409
408
  hairline: { classes: "hairline-l" },
410
409
  none: { classes: "" }
411
- } }, Fe = { divider: "hairline" }, Ie = /* @__PURE__ */ re({
410
+ } }, Ie = { divider: "hairline" }, Le = /* @__PURE__ */ ne({
412
411
  index: 0,
413
412
  count: 1,
414
413
  divider: "hairline",
415
414
  add: null,
416
415
  removing: () => {}
417
- }), Le = "button:not([disabled]), [href], input:not([disabled]), select, textarea, [tabindex]:not([tabindex='-1'])";
418
- function Re(e, t) {
416
+ }), Re = "button:not([disabled]), [href], input:not([disabled]), select, textarea, [tabindex]:not([tabindex='-1'])";
417
+ function ze(e, t) {
419
418
  let n = e?.querySelector("header");
420
- ((t ? n?.querySelector(t) : null) ?? n?.querySelector(Le))?.focus({ preventScroll: !0 });
419
+ ((t ? n?.querySelector(t) : null) ?? n?.querySelector(Re))?.focus({ preventScroll: !0 });
421
420
  }
422
- var ze = /* @__PURE__ */ F(function({ children: t, "aria-label": r, onAdd: i, addLabel: a, max: o = 4, active: s, onActiveChange: c, divider: l = "hairline", className: d }, f) {
423
- let p = n(), m = P.toArray(t).filter(ie), h = m.length, g = B(null), [_, v] = V(0), y = Math.min(s ?? _, Math.max(0, h - 1)), b = B(null), x = B(c);
421
+ var Be = /* @__PURE__ */ P(function({ children: n, "aria-label": i, onAdd: a, addLabel: o, max: s = 4, active: c, onActiveChange: l, divider: u = "hairline", className: d }, f) {
422
+ let p = t(), m = te.toArray(n).filter(re), h = m.length, g = B(null), [_, v] = V(0), y = Math.min(c ?? _, Math.max(0, h - 1)), b = B(null), x = B(l);
424
423
  R(() => {
425
- x.current = c;
424
+ x.current = l;
426
425
  });
427
- let S = ae((e) => {
426
+ let S = F((e) => {
428
427
  let t = g.current?.children[e], n = g.current;
429
428
  if (!t || !n) return;
430
429
  b.current = n.scrollLeft === t.offsetLeft ? null : e;
@@ -435,24 +434,24 @@ var ze = /* @__PURE__ */ F(function({ children: t, "aria-label": r, onAdd: i, ad
435
434
  });
436
435
  }, []), C = (e) => {
437
436
  let t = Math.max(0, Math.min(h - 1, e));
438
- v(t), c?.(t), S(t);
437
+ v(t), l?.(t), S(t);
439
438
  };
440
- L(() => {
441
- s !== void 0 && S(s);
442
- }, [s, S]);
439
+ I(() => {
440
+ c !== void 0 && S(c);
441
+ }, [c, S]);
443
442
  let w = B(h), T = B(!1), E = B(null);
444
443
  R(() => {
445
444
  let e = g.current?.children;
446
- if (h > w.current) v(h - 1), x.current?.(h - 1), S(h - 1), T.current && Re(e?.[h - 1]);
445
+ if (h > w.current) v(h - 1), x.current?.(h - 1), S(h - 1), T.current && ze(e?.[h - 1]);
447
446
  else if (h < w.current && E.current !== null) {
448
447
  let t = Math.min(E.current, h - 1);
449
- Re(e?.[t], "[data-compare-remove]");
448
+ ze(e?.[t], "[data-compare-remove]");
450
449
  }
451
450
  T.current = !1, E.current = null, w.current = h;
452
451
  }, [h, S]);
453
- let D = ae((e) => {
452
+ let D = F((e) => {
454
453
  E.current = e;
455
- }, []), [O, k] = V(null), A = ae(() => {
454
+ }, []), [O, k] = V(null), A = F(() => {
456
455
  let e = g.current;
457
456
  if (!e) return;
458
457
  let t = e.scrollWidth - e.clientWidth - e.scrollLeft;
@@ -482,69 +481,69 @@ var ze = /* @__PURE__ */ F(function({ children: t, "aria-label": r, onAdd: i, ad
482
481
  if (n !== b.current) return;
483
482
  b.current = null;
484
483
  }
485
- n !== y && (v(n), c?.(n));
484
+ n !== y && (v(n), l?.(n));
486
485
  }, M = () => {
487
486
  b.current = null;
488
- }, ee = h >= o, te = i ? /* @__PURE__ */ W(u, {
487
+ }, N = h >= s, ee = a ? /* @__PURE__ */ U(r, {
489
488
  variant: "ghost",
490
- icon: K,
491
- "aria-label": a ?? p("compareGrid.addModel", "Add model"),
489
+ icon: oe,
490
+ "aria-label": o ?? p("compareGrid.addModel", "Add model"),
492
491
  size: "sm",
493
492
  onClick: () => {
494
- T.current = !0, i();
493
+ T.current = !0, a();
495
494
  },
496
- disabled: ee,
497
- ...ee ? { disabledReason: p("compareGrid.compareUpTo", "Compare up to {max} at once", { max: o }) } : {}
498
- }) : null, ne = m[y]?.props.label ?? "", N = O?.overflow ? "flex" : "flex md:hidden", re = O?.overflow ? O.start : y === 0, F = O?.overflow ? O.end : y >= h - 1, I = {
495
+ disabled: N,
496
+ ...N ? { disabledReason: p("compareGrid.compareUpTo", "Compare up to {max} at once", { max: s }) } : {}
497
+ }) : null, ne = m[y]?.props.label ?? "", P = O?.overflow ? "flex" : "flex md:hidden", ie = O?.overflow ? O.start : y === 0, L = O?.overflow ? O.end : y >= h - 1, z = {
499
498
  index: y + 1,
500
499
  count: h
501
500
  };
502
- return /* @__PURE__ */ G("div", {
501
+ return /* @__PURE__ */ W("div", {
503
502
  ref: f,
504
503
  role: "group",
505
- "aria-label": r,
504
+ "aria-label": i,
506
505
  className: e("flex h-full min-h-0 min-w-0 flex-col", d),
507
- children: [(h > 1 || O?.overflow) && /* @__PURE__ */ G("div", {
508
- className: e("h-44 shrink-0 items-center gap-4 px-24 hairline-b", N),
506
+ children: [(h > 1 || O?.overflow) && /* @__PURE__ */ W("div", {
507
+ className: e("h-44 shrink-0 items-center gap-4 px-24 hairline-b", P),
509
508
  children: [
510
- /* @__PURE__ */ W(u, {
509
+ /* @__PURE__ */ U(r, {
511
510
  variant: "ghost",
512
- icon: q,
511
+ icon: K,
513
512
  "aria-label": p("compareGrid.previousColumn", "Previous column"),
514
513
  size: "sm",
515
- disabled: re,
514
+ disabled: ie,
516
515
  onClick: () => C(y - 1)
517
516
  }),
518
- /* @__PURE__ */ G("span", {
517
+ /* @__PURE__ */ W("span", {
519
518
  "aria-live": "polite",
520
519
  className: "min-w-0 flex-1 truncate text-center text-small text-fg-secondary tabular",
521
- children: [/* @__PURE__ */ W("span", {
520
+ children: [/* @__PURE__ */ U("span", {
522
521
  className: "sr-only",
523
522
  children: p("compareGrid.namedPosition", "{label}, {index} of {count}", {
524
523
  label: ne,
525
- ...I
524
+ ...z
526
525
  })
527
- }), /* @__PURE__ */ W("span", {
526
+ }), /* @__PURE__ */ U("span", {
528
527
  "aria-hidden": !0,
529
- children: p("compareGrid.position", "{index} of {count}", I)
528
+ children: p("compareGrid.position", "{index} of {count}", z)
530
529
  })]
531
530
  }),
532
- /* @__PURE__ */ W(u, {
531
+ /* @__PURE__ */ U(r, {
533
532
  variant: "ghost",
534
533
  icon: J,
535
534
  "aria-label": p("compareGrid.nextColumn", "Next column"),
536
535
  size: "sm",
537
- disabled: F,
536
+ disabled: L,
538
537
  onClick: () => C(y + 1)
539
538
  }),
540
- te && /* @__PURE__ */ W("span", {
539
+ ee && /* @__PURE__ */ U("span", {
541
540
  className: "contents md:hidden",
542
- children: te
541
+ children: ee
543
542
  })
544
543
  ]
545
- }), /* @__PURE__ */ W("div", {
544
+ }), /* @__PURE__ */ U("div", {
546
545
  className: "flex min-h-0 min-w-0 flex-1",
547
- children: /* @__PURE__ */ W("div", {
546
+ children: /* @__PURE__ */ U("div", {
548
547
  ref: g,
549
548
  onScroll: j,
550
549
  onPointerDown: M,
@@ -552,12 +551,12 @@ var ze = /* @__PURE__ */ F(function({ children: t, "aria-label": r, onAdd: i, ad
552
551
  onTouchStart: M,
553
552
  onKeyDown: M,
554
553
  className: "relative min-h-0 min-w-0 flex-1 compare-grid",
555
- children: m.map((e, t) => /* @__PURE__ */ W(Ie.Provider, {
554
+ children: m.map((e, t) => /* @__PURE__ */ U(Le.Provider, {
556
555
  value: {
557
556
  index: t,
558
557
  count: h,
559
- divider: l,
560
- add: t === h - 1 ? te : null,
558
+ divider: u,
559
+ add: t === h - 1 ? ee : null,
561
560
  removing: D
562
561
  },
563
562
  children: e
@@ -566,15 +565,15 @@ var ze = /* @__PURE__ */ F(function({ children: t, "aria-label": r, onAdd: i, ad
566
565
  })]
567
566
  });
568
567
  });
569
- process.env.NODE_ENV !== "production" && (ze.displayName = "CompareGrid");
570
- var Be = /* @__PURE__ */ new Set([
568
+ process.env.NODE_ENV !== "production" && (Be.displayName = "CompareGrid");
569
+ var Ve = /* @__PURE__ */ new Set([
571
570
  "ArrowUp",
572
571
  "PageUp",
573
572
  "Home"
574
573
  ]);
575
- function Ve(e, t) {
574
+ function He(e, t) {
576
575
  let n = B(null), r = B(null), i = B(!0);
577
- return L(() => {
576
+ return I(() => {
578
577
  let t = n.current, a = r.current;
579
578
  if (!e || !t || !a || typeof ResizeObserver > "u") return;
580
579
  let o = t.scrollTop, s = null, c = () => t.scrollHeight - t.clientHeight - t.scrollTop, l = () => {
@@ -586,7 +585,7 @@ function Ve(e, t) {
586
585
  }, f = (e) => {
587
586
  e.deltaY < 0 && u();
588
587
  }, p = (e) => {
589
- Be.has(e.key) && u();
588
+ Ve.has(e.key) && u();
590
589
  }, m = (e) => {
591
590
  s = e.touches[0]?.clientY ?? null;
592
591
  }, h = (e) => {
@@ -606,68 +605,68 @@ function Ve(e, t) {
606
605
  content: r
607
606
  };
608
607
  }
609
- var He = /* @__PURE__ */ F(function({ label: t, header: r, actions: i, children: a, footer: o, onRemove: s, removeLabel: c, stickToEnd: l = !0, followKey: d, className: f }, p) {
610
- let m = n(), { index: h, count: g, divider: _, add: v, removing: y } = I(Ie), { body: b, content: x } = Ve(l, d);
611
- return /* @__PURE__ */ G("section", {
608
+ var Ue = /* @__PURE__ */ P(function({ label: n, header: i, actions: a, children: o, footer: s, onRemove: c, removeLabel: l, stickToEnd: u = !0, followKey: d, className: f }, p) {
609
+ let m = t(), { index: h, count: g, divider: _, add: v, removing: y } = ie(Le), { body: b, content: x } = He(u, d);
610
+ return /* @__PURE__ */ W("section", {
612
611
  ref: p,
613
- "aria-label": t,
614
- className: e("row-span-3 grid min-h-0 min-w-0 snap-start snap-always grid-rows-subgrid", h > 0 && Pe.divider[_].classes, f),
612
+ "aria-label": n,
613
+ className: e("row-span-3 grid min-h-0 min-w-0 snap-start snap-always grid-rows-subgrid", h > 0 && Fe.divider[_].classes, f),
615
614
  children: [
616
- /* @__PURE__ */ G("header", {
615
+ /* @__PURE__ */ W("header", {
617
616
  className: "flex h-52 min-w-0 items-center gap-4 px-24 hairline-b",
618
617
  children: [
619
- /* @__PURE__ */ W("div", {
618
+ /* @__PURE__ */ U("div", {
620
619
  className: "flex min-w-0 flex-1 items-center",
621
- children: r
620
+ children: i
622
621
  }),
623
- i,
624
- s && g > 1 && /* @__PURE__ */ W(u, {
622
+ a,
623
+ c && g > 1 && /* @__PURE__ */ U(r, {
625
624
  variant: "ghost",
626
625
  "data-compare-remove": "",
627
- icon: de,
628
- "aria-label": c ?? m("compareGrid.remove", "Remove {label}", { label: t }),
626
+ icon: le,
627
+ "aria-label": l ?? m("compareGrid.remove", "Remove {label}", { label: n }),
629
628
  size: "sm",
630
629
  onClick: () => {
631
- y(h), s();
630
+ y(h), c();
632
631
  }
633
632
  }),
634
- v && /* @__PURE__ */ W("span", {
633
+ v && /* @__PURE__ */ U("span", {
635
634
  className: e("flex shrink-0", g > 1 && "max-md:hidden"),
636
635
  children: v
637
636
  })
638
637
  ]
639
638
  }),
640
- /* @__PURE__ */ W("div", {
639
+ /* @__PURE__ */ U("div", {
641
640
  className: "min-h-0 min-w-0 compare-thread",
642
- children: /* @__PURE__ */ W("div", {
641
+ children: /* @__PURE__ */ U("div", {
643
642
  ref: b,
644
643
  tabIndex: 0,
645
- "aria-label": m("compareGrid.thread", "{label} thread", { label: t }),
644
+ "aria-label": m("compareGrid.thread", "{label} thread", { label: n }),
646
645
  role: "region",
647
646
  className: "relative h-full min-h-0 overflow-y-auto overscroll-contain outline-none scrollbar-quiet scroll-fade-y",
648
- children: /* @__PURE__ */ W("div", {
647
+ children: /* @__PURE__ */ U("div", {
649
648
  ref: x,
650
649
  className: "flex min-h-full flex-col px-24 pt-16 pb-24",
651
- children: a
650
+ children: o
652
651
  })
653
652
  })
654
653
  }),
655
- o != null && /* @__PURE__ */ W("footer", {
654
+ s != null && /* @__PURE__ */ U("footer", {
656
655
  className: "flex min-h-44 min-w-0 items-start px-24 pt-12 pb-12",
657
- children: /* @__PURE__ */ W("div", {
656
+ children: /* @__PURE__ */ U("div", {
658
657
  className: "min-w-0 px-12",
659
- children: o
658
+ children: s
660
659
  })
661
660
  })
662
661
  ]
663
662
  });
664
663
  });
665
- process.env.NODE_ENV !== "production" && (He.displayName = "CompareGrid.Column");
666
- var Ue = /* @__PURE__ */ Object.assign(ze, { Column: He }), We = { state: {
664
+ process.env.NODE_ENV !== "production" && (Ue.displayName = "CompareGrid.Column");
665
+ var We = /* @__PURE__ */ Object.assign(Be, { Column: Ue }), Ge = { state: {
667
666
  done: { classes: "" },
668
667
  live: { classes: "" }
669
- } }, Ge = { state: "done" };
670
- function Ke(e) {
668
+ } }, Ke = { state: "done" };
669
+ function qe(e) {
671
670
  let t = e.trim().split("\n");
672
671
  for (let e = t.length - 1; e >= 0; e--) {
673
672
  let n = (t[e] ?? "").replace(/[*_`#>]+/g, "").trim();
@@ -675,284 +674,284 @@ function Ke(e) {
675
674
  }
676
675
  return "";
677
676
  }
678
- var qe = /* @__PURE__ */ F(function({ text: e = "", live: t = !1, duration: r, title: i, hint: o, open: s, defaultOpen: c, onOpenChange: l, children: u, className: d, "data-force": f }, p) {
679
- let m = n(), h = i ?? (!t && r !== void 0 ? m("responseView.thoughtFor", "Thought for {duration}", { duration: a(r) }) : m("responseView.thinking", "Thinking"));
680
- return /* @__PURE__ */ W(ne, {
681
- ref: p,
682
- heading: h,
683
- preview: o ?? (t ? Ke(e) : ""),
684
- previewHidden: o === void 0,
685
- live: t,
686
- open: s,
687
- defaultOpen: c,
688
- onOpenChange: l,
689
- className: d,
690
- "data-force": f,
691
- children: u ?? /* @__PURE__ */ W(N, {
677
+ var Je = /* @__PURE__ */ P(function({ text: e = "", live: n = !1, duration: r, title: i, hint: a, open: o, defaultOpen: l, onOpenChange: d, children: f, className: p, "data-force": m }, h) {
678
+ let g = t(), { formatDuration: _ } = s(), v = i ?? (!n && r !== void 0 ? g("responseView.thoughtFor", "Thought for {duration}", { duration: _(r) }) : g("responseView.thinking", "Thinking"));
679
+ return /* @__PURE__ */ U(u, {
680
+ ref: h,
681
+ heading: v,
682
+ preview: a ?? (n ? qe(e) : ""),
683
+ previewHidden: a === void 0,
684
+ live: n,
685
+ open: o,
686
+ defaultOpen: l,
687
+ onOpenChange: d,
688
+ className: p,
689
+ "data-force": m,
690
+ children: f ?? /* @__PURE__ */ U(c, {
692
691
  text: e,
693
692
  size: "small",
694
693
  tone: "secondary",
695
- streaming: t,
694
+ streaming: n,
696
695
  collapseAfter: 0,
697
696
  wrapCode: !0,
698
697
  className: "min-w-0"
699
698
  })
700
699
  });
701
700
  });
702
- process.env.NODE_ENV !== "production" && (qe.displayName = "Reasoning");
703
- //#endregion
704
- //#region src/components/playground/response-view.tsx
705
- var Je = { status: {
701
+ process.env.NODE_ENV !== "production" && (Je.displayName = "Reasoning");
702
+ // src/components/playground/response-view.tsx
703
+ var Ye = { status: {
706
704
  pending: { classes: "" },
707
705
  streaming: { classes: "" },
708
706
  done: { classes: "" },
709
707
  stopped: { classes: "" },
710
708
  incomplete: { classes: "" },
711
709
  error: { classes: "" }
712
- } }, Ye = { status: "done" };
713
- function Xe(e, t) {
710
+ } }, Xe = { status: "done" };
711
+ function Ze(e, t) {
714
712
  return t === "max_output_tokens" ? e("responseView.outputLimit", "Stopped at the output limit") : t === "content_filter" ? e("responseView.contentFilter", "Stopped by the provider's content filter") : e("responseView.incomplete", "The model ended the response early");
715
713
  }
716
- function Ze(e, t) {
714
+ function Qe(e, t) {
717
715
  let [n, r] = V(""), i = B(e);
718
- return L(() => {
716
+ return I(() => {
719
717
  let n = i.current;
720
718
  i.current = e, e === "pending" || e === "streaming" ? r("") : (n === "pending" || n === "streaming") && e !== "error" && r(t);
721
719
  }, [e, t]), n;
722
720
  }
723
- var Qe = /* @__PURE__ */ F(function({ text: t = "", reasoning: r, status: i = "done", reasoningDuration: a, reasoningOpen: o, defaultReasoningOpen: s, onReasoningOpenChange: c, incompleteReason: l, error: f, onRetry: p, footer: m, "aria-label": h, className: g }, _) {
724
- let v = n(), y = h ?? v("responseView.response", "Response"), b = oe(), x = i === "pending" || i === "streaming", S = t.trim() !== "", C = !!r && r.trim() !== "", w = x && C && !S, T = Ze(i, i === "stopped" ? v("responseView.endedStopped", "{label} stopped", { label: y }) : i === "incomplete" ? v("responseView.endedIncomplete", "{label}: {reason}", {
725
- label: y,
726
- reason: Xe(v, l)
727
- }) : v("responseView.endedDone", "{label} finished", { label: y })), E = v("responseView.retry", "Retry"), D = p ? /* @__PURE__ */ W(u, {
721
+ var $e = /* @__PURE__ */ P(function({ text: n = "", reasoning: i, status: a = "done", reasoningDuration: o, reasoningOpen: s, defaultReasoningOpen: u, onReasoningOpenChange: d, incompleteReason: f, error: p, onRetry: m, footer: h, "aria-label": g, className: _ }, v) {
722
+ let y = t(), b = g ?? y("responseView.response", "Response"), x = L(), S = a === "pending" || a === "streaming", C = n.trim() !== "", w = !!i && i.trim() !== "", T = S && w && !C, E = Qe(a, a === "stopped" ? y("responseView.endedStopped", "{label} stopped", { label: b }) : a === "incomplete" ? y("responseView.endedIncomplete", "{label}: {reason}", {
723
+ label: b,
724
+ reason: Ze(y, f)
725
+ }) : y("responseView.endedDone", "{label} finished", { label: b })), D = y("responseView.retry", "Retry"), O = m ? /* @__PURE__ */ U(r, {
728
726
  size: "sm",
729
727
  variant: "secondary",
730
- onClick: p,
731
- children: E
732
- }) : null, O = v("responseView.copy", "Copy response"), k = m != null, A = i === "done" && (S || p) ? /* @__PURE__ */ G("span", {
728
+ onClick: m,
729
+ children: D
730
+ }) : null, k = y("responseView.copy", "Copy response"), A = h != null, j = a === "done" && (C || m) ? /* @__PURE__ */ W("span", {
733
731
  "data-reply-actions": "",
734
- className: e("flex items-center gap-x-4 transition-arrive reduced:transition-none starting:opacity-0", S && p ? "starting:-ml-72" : "starting:-ml-36"),
735
- children: [S && /* @__PURE__ */ W(d, {
736
- value: t,
732
+ className: e("flex items-center gap-x-4 transition-arrive reduced:transition-none starting:opacity-0", C && m ? "starting:-ml-72" : "starting:-ml-36"),
733
+ children: [C && /* @__PURE__ */ U(l, {
734
+ value: n,
737
735
  size: "sm",
738
736
  variant: "quiet",
739
- label: O
740
- }), p && /* @__PURE__ */ W(u, {
737
+ label: k
738
+ }), m && /* @__PURE__ */ U(r, {
741
739
  size: "sm",
742
740
  variant: "quiet",
743
- icon: se,
744
- "aria-label": E,
745
- onClick: p
741
+ icon: q,
742
+ "aria-label": D,
743
+ onClick: m
746
744
  })]
747
745
  }) : null;
748
- return /* @__PURE__ */ G("article", {
749
- ref: _,
750
- "aria-label": y,
751
- "aria-busy": x || void 0,
752
- "aria-describedby": b,
753
- className: e("flex min-w-0 flex-col gap-8", g),
746
+ return /* @__PURE__ */ W("article", {
747
+ ref: v,
748
+ "aria-label": b,
749
+ "aria-busy": S || void 0,
750
+ "aria-describedby": x,
751
+ className: e("flex min-w-0 flex-col gap-8", _),
754
752
  children: [
755
- C && /* @__PURE__ */ W(qe, {
756
- text: r,
757
- live: w,
758
- duration: a,
759
- open: o,
760
- defaultOpen: s,
761
- onOpenChange: c
753
+ w && /* @__PURE__ */ U(Je, {
754
+ text: i,
755
+ live: T,
756
+ duration: o,
757
+ open: s,
758
+ defaultOpen: u,
759
+ onOpenChange: d
762
760
  }),
763
- S ? /* @__PURE__ */ W(N, {
764
- text: t,
761
+ C ? /* @__PURE__ */ U(c, {
762
+ text: n,
765
763
  size: "lg",
766
- streaming: x,
764
+ streaming: S,
767
765
  collapseAfter: 0,
768
766
  wrapCode: !0,
769
767
  className: "markdown-text-inset"
770
768
  }) : null,
771
- (i === "stopped" || i === "incomplete") && /* @__PURE__ */ G("div", {
769
+ (a === "stopped" || a === "incomplete") && /* @__PURE__ */ W("div", {
772
770
  className: "flex min-h-32 flex-wrap items-center gap-x-12 gap-y-4 px-12",
773
- children: [/* @__PURE__ */ W("span", {
771
+ children: [/* @__PURE__ */ U("span", {
774
772
  className: "text-small text-fg-secondary",
775
- children: i === "incomplete" ? Xe(v, l) : S ? v("responseView.stopped", "Stopped") : v("responseView.stoppedBeforeResponse", "Stopped before a response")
776
- }), D]
773
+ children: a === "incomplete" ? Ze(y, f) : C ? y("responseView.stopped", "Stopped") : y("responseView.stoppedBeforeResponse", "Stopped before a response")
774
+ }), O]
777
775
  }),
778
- i === "error" && /* @__PURE__ */ G("div", {
776
+ a === "error" && /* @__PURE__ */ W("div", {
779
777
  className: "flex flex-col items-start gap-8 px-12",
780
- children: [/* @__PURE__ */ G("div", {
778
+ children: [/* @__PURE__ */ W("div", {
781
779
  role: "alert",
782
780
  className: "flex min-w-0 flex-col gap-4",
783
- children: [/* @__PURE__ */ W("span", {
781
+ children: [/* @__PURE__ */ U("span", {
784
782
  className: "text-small font-medium text-fg",
785
- children: S ? v("responseView.failedPartway", "The response failed partway") : v("responseView.noResponse", "No response")
786
- }), f && /* @__PURE__ */ W(N, {
787
- text: f,
783
+ children: C ? y("responseView.failedPartway", "The response failed partway") : y("responseView.noResponse", "No response")
784
+ }), p && /* @__PURE__ */ U(c, {
785
+ text: p,
788
786
  size: "small",
789
787
  tone: "secondary",
790
788
  className: "max-w-prose min-w-0"
791
789
  })]
792
- }), D]
790
+ }), O]
793
791
  }),
794
- i === "done" && !S && /* @__PURE__ */ W("span", {
792
+ a === "done" && !C && /* @__PURE__ */ U("span", {
795
793
  className: "px-12 text-small text-fg-tertiary",
796
- children: v("responseView.noText", "The model returned no text")
794
+ children: y("responseView.noText", "The model returned no text")
797
795
  }),
798
- (A || k) && /* @__PURE__ */ G("div", {
796
+ (j || A) && /* @__PURE__ */ W("div", {
799
797
  "data-reply-tools": "",
800
- className: e("flex min-h-32 min-w-0 flex-wrap items-center gap-x-4 gap-y-4", A && "pl-4"),
801
- children: [A, k && /* @__PURE__ */ W("div", {
802
- className: e("min-w-0", A ? "px-8" : "px-12"),
803
- children: m
798
+ className: e("flex min-h-32 min-w-0 flex-wrap items-center gap-x-4 gap-y-4", j && "pl-4"),
799
+ children: [j, A && /* @__PURE__ */ U("div", {
800
+ className: e("min-w-0", j ? "px-8" : "px-12"),
801
+ children: h
804
802
  })]
805
803
  }),
806
- /* @__PURE__ */ W("span", {
807
- id: b,
804
+ /* @__PURE__ */ U("span", {
805
+ id: x,
808
806
  className: "sr-only",
809
- children: i === "pending" ? v("responseView.waiting", "Waiting for the response") : i === "streaming" ? v("responseView.responding", "Responding") : ""
807
+ children: a === "pending" ? y("responseView.waiting", "Waiting for the response") : a === "streaming" ? y("responseView.responding", "Responding") : ""
810
808
  }),
811
- /* @__PURE__ */ W("span", {
809
+ /* @__PURE__ */ U("span", {
812
810
  role: "status",
813
811
  className: "sr-only",
814
- children: T
812
+ children: E
815
813
  })
816
814
  ]
817
815
  });
818
816
  });
819
- process.env.NODE_ENV !== "production" && (Qe.displayName = "ResponseView");
820
- var $e = {
817
+ process.env.NODE_ENV !== "production" && ($e.displayName = "ResponseView");
818
+ var et = {
821
819
  2: "line-clamp-2",
822
820
  3: "line-clamp-3",
823
821
  4: "line-clamp-4",
824
822
  6: "line-clamp-6"
825
- }, et = /* @__PURE__ */ F(function({ children: t, attachments: r = [], maxLines: i = 4, "aria-label": a, className: o }, s) {
826
- let c = n(), d = a ?? c("userMessage.prompt", "Prompt"), f = c("userMessage.showAll", "Show all"), p = c("userMessage.showLess", "Show less"), [m, h] = V(!1), g = oe(), _ = B(null), v = l(_, i > 0 && !m), y = t !== "" && t != null && t !== !1;
827
- return /* @__PURE__ */ G("div", {
828
- ref: s,
823
+ }, tt = /* @__PURE__ */ P(function({ children: n, attachments: i = [], actions: a, maxLines: o = 4, "aria-label": s, className: c }, l) {
824
+ let u = t(), f = s ?? u("userMessage.prompt", "Prompt"), p = u("userMessage.showAll", "Show all"), m = u("userMessage.showLess", "Show less"), [h, g] = V(!1), _ = L(), v = B(null), y = d(v, o > 0 && !h), b = n !== "" && n != null && n !== !1;
825
+ return /* @__PURE__ */ W("div", {
826
+ ref: l,
829
827
  role: "group",
830
- "aria-label": d,
831
- className: e("flex min-w-0 flex-col items-end gap-2", o),
828
+ "aria-label": f,
829
+ className: e("flex min-w-0 flex-col items-end gap-2", c),
832
830
  children: [
833
- /* @__PURE__ */ W(ge, {
834
- items: r,
831
+ /* @__PURE__ */ U(_e, {
832
+ items: i,
835
833
  align: "end",
836
- className: y ? "mb-6" : void 0
834
+ className: b ? "mb-6" : void 0
837
835
  }),
838
- y && /* @__PURE__ */ W("p", {
839
- id: g,
840
- ref: _,
841
- className: e("max-w-prose min-w-0 rounded-frame bg-fill-1 px-16 py-10 text-body-lg whitespace-pre-wrap wrap-break-word text-fg", i !== 0 && !m && $e[i]),
842
- children: t
836
+ b && /* @__PURE__ */ U("p", {
837
+ id: _,
838
+ ref: v,
839
+ className: e("max-w-prose min-w-0 rounded-frame bg-fill-1 px-16 py-10 text-body-lg whitespace-pre-wrap wrap-break-word text-fg", o !== 0 && !h && et[o]),
840
+ children: n
843
841
  }),
844
- (v || m) && /* @__PURE__ */ W(u, {
845
- size: "sm",
846
- variant: "quiet",
847
- "aria-expanded": m,
848
- "aria-controls": g,
849
- reserveLabels: [f, p],
850
- onClick: () => h((e) => !e),
851
- children: m ? p : f
842
+ (y || h || a) && /* @__PURE__ */ W("div", {
843
+ className: "flex items-center gap-4",
844
+ children: [(y || h) && /* @__PURE__ */ U(r, {
845
+ size: "sm",
846
+ variant: "quiet",
847
+ "aria-expanded": h,
848
+ "aria-controls": _,
849
+ reserveLabels: [p, m],
850
+ onClick: () => g((e) => !e),
851
+ children: h ? m : p
852
+ }), a]
852
853
  })
853
854
  ]
854
855
  });
855
856
  });
856
- process.env.NODE_ENV !== "production" && (et.displayName = "UserMessage");
857
- var tt = /* @__PURE__ */ F(function({ children: t, className: n }, r) {
858
- return /* @__PURE__ */ W("div", {
857
+ process.env.NODE_ENV !== "production" && (tt.displayName = "UserMessage");
858
+ var nt = /* @__PURE__ */ P(function({ children: t, className: n }, r) {
859
+ return /* @__PURE__ */ U("div", {
859
860
  ref: r,
860
861
  className: e("flex min-w-0 flex-col gap-32", n),
861
862
  children: t
862
863
  });
863
864
  });
864
- process.env.NODE_ENV !== "production" && (tt.displayName = "Thread");
865
- //#endregion
866
- //#region src/components/playground/response-metrics.tsx
867
- var nt = { size: {
865
+ process.env.NODE_ENV !== "production" && (nt.displayName = "Thread");
866
+ // src/components/playground/response-metrics.tsx
867
+ var rt = { size: {
868
868
  sm: { classes: "text-caption gap-x-16 gap-y-2" },
869
869
  md: { classes: "text-small gap-x-20 gap-y-4" }
870
- } }, rt = { size: "sm" };
871
- function it(e) {
872
- return !Number.isFinite(e) || e < 0 ? "—" : a(e, { precise: !0 });
870
+ } }, it = { size: "sm" };
871
+ function at(e, { formatDuration: t } = f()) {
872
+ return !Number.isFinite(e) || e < 0 ? "—" : t(e, { precise: !0 });
873
873
  }
874
- function at(e) {
874
+ function ot(e) {
875
875
  let [t, n] = V(() => Date.now());
876
- return L(() => {
876
+ return I(() => {
877
877
  if (e === void 0) return;
878
878
  n(Date.now());
879
879
  let t = setInterval(() => n(Date.now()), 100);
880
880
  return () => clearInterval(t);
881
881
  }, [e]), e === void 0 ? void 0 : Math.max(0, t - e);
882
882
  }
883
- function ot(e) {
884
- return /[1-9]/.test(e) ? s(e) : c("0", { decimals: 0 });
883
+ function st(e, { formatPrice: t, formatUSD: n }) {
884
+ return /[1-9]/.test(e) ? t(e) : n("0", { decimals: 0 });
885
885
  }
886
886
  function $(e) {
887
887
  return typeof e == "number" && Number.isFinite(e);
888
888
  }
889
- function st({ label: e, children: t }) {
890
- return /* @__PURE__ */ G("div", {
889
+ function ct({ label: e, children: t }) {
890
+ return /* @__PURE__ */ W("div", {
891
891
  className: "flex items-baseline gap-6 whitespace-nowrap",
892
- children: [/* @__PURE__ */ W("dt", {
892
+ children: [/* @__PURE__ */ U("dt", {
893
893
  className: "text-fg-tertiary",
894
894
  children: e
895
- }), /* @__PURE__ */ W("dd", {
895
+ }), /* @__PURE__ */ U("dd", {
896
896
  className: "text-fg-secondary tabular",
897
897
  children: t
898
898
  })]
899
899
  });
900
900
  }
901
- var ct = /* @__PURE__ */ F(function({ timeToFirstToken: t, duration: r, inputTokens: i, outputTokens: s, reasoningTokens: c, live: l = !1, startedAt: u, cost: d, costKnown: f = !0, size: p = "sm", className: m }, h) {
902
- let g = n(), _ = at(l && u !== void 0 && !$(r) ? u : void 0), v = $(i) || $(s), y = !f && !l, b = y || d != null && d !== "", x = e("flex min-w-0 flex-wrap items-baseline", nt.size[p].classes, m);
903
- return !v && !b && !$(t) && !$(r) && !$(c) && _ === void 0 ? /* @__PURE__ */ W("dl", {
901
+ var lt = /* @__PURE__ */ P(function({ timeToFirstToken: n, duration: r, inputTokens: i, outputTokens: a, reasoningTokens: o, live: c = !1, startedAt: l, cost: u, costKnown: d = !0, formatCost: f, size: p = "sm", className: m }, h) {
902
+ let g = t(), _ = s(), { formatDuration: v, formatNumber: y } = _, b = ot(c && l !== void 0 && !$(r) ? l : void 0), x = $(i) || $(a), S = !d && !c, C = S || u != null && u !== "", w = e("flex min-w-0 flex-wrap items-baseline", rt.size[p].classes, m);
903
+ return !x && !C && !$(n) && !$(r) && !$(o) && b === void 0 ? /* @__PURE__ */ U("dl", {
904
904
  ref: h,
905
905
  "aria-label": g("responseMetrics.metrics", "Metrics"),
906
- className: e(x, p === "sm" ? "min-h-16" : "min-h-18")
907
- }) : /* @__PURE__ */ G("dl", {
906
+ className: e(w, p === "sm" ? "min-h-16" : "min-h-18")
907
+ }) : /* @__PURE__ */ W("dl", {
908
908
  ref: h,
909
909
  "aria-label": g("responseMetrics.metrics", "Metrics"),
910
- className: x,
910
+ className: w,
911
911
  children: [
912
- $(t) && /* @__PURE__ */ W(st, {
912
+ $(n) && /* @__PURE__ */ U(ct, {
913
913
  label: g("responseMetrics.firstToken", "First token"),
914
- children: it(t)
914
+ children: at(n, _)
915
915
  }),
916
- ($(r) || _ !== void 0) && /* @__PURE__ */ W(st, {
916
+ ($(r) || b !== void 0) && /* @__PURE__ */ U(ct, {
917
917
  label: g("responseMetrics.total", "Total"),
918
- children: $(r) ? it(r) : /* @__PURE__ */ W("span", {
918
+ children: $(r) ? at(r, _) : /* @__PURE__ */ U("span", {
919
919
  className: "text-fg-tertiary",
920
- children: ((e) => e < 1e4 ? g("format.seconds", "{s} s", { s: o(Math.floor(e / 100) / 10, {
920
+ children: ((e) => e < 1e4 ? g("format.seconds", "{s} s", { s: y(Math.floor(e / 100) / 10, {
921
921
  minimumFractionDigits: 1,
922
922
  maximumFractionDigits: 1
923
- }) }) : e < 6e4 ? g("format.seconds", "{s} s", { s: o(Math.floor(e / 1e3)) }) : a(Math.floor(e / 1e3) * 1e3))(_ ?? 0)
923
+ }) }) : e < 6e4 ? g("format.seconds", "{s} s", { s: y(Math.floor(e / 1e3)) }) : v(Math.floor(e / 1e3) * 1e3))(b ?? 0)
924
924
  })
925
925
  }),
926
- v && /* @__PURE__ */ W(st, {
926
+ x && /* @__PURE__ */ U(ct, {
927
927
  label: g("responseMetrics.tokens", "Tokens"),
928
928
  children: g("responseMetrics.tokensValue", "{input} in · {output} out", {
929
- input: $(i) ? o(i) : "—",
930
- output: $(s) ? o(s) : "—"
929
+ input: $(i) ? y(i) : "—",
930
+ output: $(a) ? y(a) : "—"
931
931
  })
932
932
  }),
933
- $(c) && /* @__PURE__ */ W(st, {
933
+ $(o) && /* @__PURE__ */ U(ct, {
934
934
  label: g("responseMetrics.reasoning", "Reasoning"),
935
- children: o(c)
935
+ children: y(o)
936
936
  }),
937
- b && /* @__PURE__ */ W(st, {
937
+ C && /* @__PURE__ */ U(ct, {
938
938
  label: g("responseMetrics.cost", "Cost"),
939
- children: y ? g("responseMetrics.costUnknown", "Unknown") : ot(d ?? "0")
939
+ children: S ? g("responseMetrics.costUnknown", "Unknown") : (f ?? ((e) => st(e, _)))(u ?? "0")
940
940
  })
941
941
  ]
942
942
  });
943
943
  });
944
- process.env.NODE_ENV !== "production" && (ct.displayName = "ResponseMetrics");
945
- //#endregion
946
- //#region src/components/playground/parameter-panel.tsx
947
- var lt = { layout: {
944
+ process.env.NODE_ENV !== "production" && (lt.displayName = "ResponseMetrics");
945
+ // src/components/playground/parameter-panel.tsx
946
+ var ut = { layout: {
948
947
  popover: { classes: "w-full gap-20" },
949
948
  panel: { classes: "w-full gap-24" }
950
- } }, ut = { layout: "popover" }, dt = [
949
+ } }, dt = { layout: "popover" }, ft = [
951
950
  "1024x1024",
952
951
  "1536x1024",
953
952
  "1024x1536"
954
953
  ];
955
- function ft(e, t) {
954
+ function pt(e, t) {
956
955
  switch (t) {
957
956
  case "auto": return e("parameterPanel.qualityAuto", "Automatic");
958
957
  case "low": return e("parameterPanel.qualityLow", "Low");
@@ -963,8 +962,8 @@ function ft(e, t) {
963
962
  default: return t;
964
963
  }
965
964
  }
966
- var pt = 4;
967
- function mt(e) {
965
+ var mt = 4;
966
+ function ht(e) {
968
967
  return [
969
968
  {
970
969
  value: "none",
@@ -996,126 +995,123 @@ function mt(e) {
996
995
  }
997
996
  ];
998
997
  }
999
- function ht({ label: t, value: r, unset: i, min: a, max: s, step: c, digits: l, disabled: u, onChange: d }) {
1000
- let f = n(), p = o(r, {
998
+ function gt({ label: n, value: r, unset: i, min: a, max: o, step: c, digits: l, disabled: u, onChange: d }) {
999
+ let f = t(), { formatNumber: p } = s(), m = p(r, {
1001
1000
  minimumFractionDigits: l,
1002
1001
  maximumFractionDigits: l
1003
1002
  });
1004
- return /* @__PURE__ */ G("div", {
1003
+ return /* @__PURE__ */ W("div", {
1005
1004
  className: "flex flex-col gap-8",
1006
- children: [/* @__PURE__ */ G("div", {
1005
+ children: [/* @__PURE__ */ W("div", {
1007
1006
  className: "flex items-baseline justify-between gap-12",
1008
- children: [/* @__PURE__ */ W("span", {
1009
- className: e("text-body font-medium", u ? "text-fg-disabled" : "text-fg"),
1010
- children: t
1011
- }), /* @__PURE__ */ W("span", {
1007
+ children: [/* @__PURE__ */ U("span", {
1008
+ className: e("text-small font-medium", u ? "text-fg-disabled" : "text-fg"),
1009
+ children: n
1010
+ }), /* @__PURE__ */ U("span", {
1012
1011
  className: e("text-small tabular", i ? "text-fg-tertiary" : "text-fg-secondary"),
1013
- children: i ? f("parameterPanel.valueDefault", "{value} (default)", { value: p }) : p
1012
+ children: i ? f("parameterPanel.valueDefault", "{value} (default)", { value: m }) : m
1014
1013
  })]
1015
- }), /* @__PURE__ */ W("div", {
1016
- className: "px-8",
1017
- children: /* @__PURE__ */ W(y, {
1018
- "aria-label": t,
1019
- min: a,
1020
- max: s,
1021
- step: c,
1022
- value: r,
1023
- disabled: u,
1024
- formatValue: (e) => o(e, {
1025
- minimumFractionDigits: l,
1026
- maximumFractionDigits: l
1027
- }),
1028
- onValueChange: (e) => d(Array.isArray(e) ? e[0] ?? a : e)
1029
- })
1014
+ }), /* @__PURE__ */ U(b, {
1015
+ "aria-label": n,
1016
+ min: a,
1017
+ max: o,
1018
+ step: c,
1019
+ value: r,
1020
+ disabled: u,
1021
+ formatValue: (e) => p(e, {
1022
+ minimumFractionDigits: l,
1023
+ maximumFractionDigits: l
1024
+ }),
1025
+ onValueChange: (e) => d(Array.isArray(e) ? e[0] ?? a : e)
1030
1026
  })]
1031
1027
  });
1032
1028
  }
1033
- var gt = /* @__PURE__ */ F(function({ value: t, onValueChange: r, defaults: i, instructions: a = !0, sampling: s = !0, reasoning: c = !1, maxOutputTokensLimit: l, text: d = !0, image: f, voices: p = !1, duration: m = !1, translate: v = !1, disabled: y = !1, layout: b = "popover", className: S }, w) {
1034
- let T = n(), E = (e) => r({
1035
- ...t,
1029
+ var _t = /* @__PURE__ */ P(function({ value: n, onValueChange: i, defaults: a, instructions: o = !0, sampling: c = !0, reasoning: l = !1, maxOutputTokensLimit: u, text: d = !0, image: f, voices: g = !1, duration: v = !1, translate: b = !1, disabled: x = !1, layout: S = "popover", className: C }, w) {
1030
+ let T = t(), { formatNumber: E } = s(), D = (e) => i({
1031
+ ...n,
1036
1032
  ...e
1037
- }), D = mt(T), O = c === !0 ? D : Array.isArray(c) ? D.filter((e) => c.includes(e.value)) : [], k = t.temperature !== void 0 || t.topP !== void 0 || t.maxOutputTokens !== void 0 || t.reasoningEffort !== void 0 || t.reasoningSummary !== void 0 || t.imageSize !== void 0 || t.imageCount !== void 0 || t.imageQuality !== void 0 || t.voice !== void 0 || t.durationSeconds !== void 0 || t.translate !== void 0, A = T("parameterPanel.modelDefault", "Model default"), j = (e) => {
1033
+ }), O = ht(T), k = l === !0 ? O : Array.isArray(l) ? O.filter((e) => l.includes(e.value)) : [], A = n.temperature !== void 0 || n.topP !== void 0 || n.maxOutputTokens !== void 0 || n.reasoningEffort !== void 0 || n.reasoningSummary !== void 0 || n.imageSize !== void 0 || n.imageCount !== void 0 || n.imageQuality !== void 0 || n.voice !== void 0 || n.durationSeconds !== void 0 || n.translate !== void 0, j = T("parameterPanel.modelDefault", "Model default"), M = (e) => {
1038
1034
  let [t, n] = e.split("x"), r = t === n ? T("parameterPanel.sizeSquare", "Square") : Number(t) > Number(n) ? T("parameterPanel.sizeLandscape", "Landscape") : T("parameterPanel.sizePortrait", "Portrait");
1039
1035
  return T("parameterPanel.sizeValue", "{shape}, {width} × {height}", {
1040
1036
  shape: r,
1041
1037
  width: t ?? "",
1042
1038
  height: n ?? ""
1043
1039
  });
1044
- }, M = f ? Array.from({ length: Math.min(pt, Math.max(1, f.maxCount)) }, (e, t) => t + 1) : [];
1045
- return /* @__PURE__ */ G("div", {
1040
+ }, N = f ? Array.from({ length: Math.min(mt, Math.max(1, f.maxCount)) }, (e, t) => t + 1) : [];
1041
+ return /* @__PURE__ */ W("div", {
1046
1042
  ref: w,
1047
- className: e("flex min-w-0 flex-col", lt.layout[b].classes, S),
1043
+ className: e("flex min-w-0 flex-col", ut.layout[S].classes, C),
1048
1044
  children: [
1049
- a && /* @__PURE__ */ W(_, {
1045
+ o && /* @__PURE__ */ U(h, {
1050
1046
  label: T("parameterPanel.systemInstructions", "System instructions"),
1051
1047
  rows: 3,
1052
1048
  maxRows: 8,
1053
1049
  placeholder: T("parameterPanel.instructionsPlaceholder", "You are a helpful assistant."),
1054
- value: t.instructions ?? "",
1055
- disabled: y,
1056
- onChange: (e) => E({ instructions: e.target.value === "" ? void 0 : e.target.value })
1050
+ value: n.instructions ?? "",
1051
+ disabled: x,
1052
+ onChange: (e) => D({ instructions: e.target.value === "" ? void 0 : e.target.value })
1057
1053
  }),
1058
- s && /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(ht, {
1054
+ c && /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U(gt, {
1059
1055
  label: T("parameterPanel.temperature", "Temperature"),
1060
- value: t.temperature ?? i?.temperature ?? 1,
1061
- unset: t.temperature === void 0,
1056
+ value: n.temperature ?? a?.temperature ?? 1,
1057
+ unset: n.temperature === void 0,
1062
1058
  min: 0,
1063
1059
  max: 2,
1064
1060
  step: .05,
1065
1061
  digits: 2,
1066
- disabled: y,
1067
- onChange: (e) => E({ temperature: e })
1068
- }), /* @__PURE__ */ W(ht, {
1062
+ disabled: x,
1063
+ onChange: (e) => D({ temperature: e })
1064
+ }), /* @__PURE__ */ U(gt, {
1069
1065
  label: T("parameterPanel.topP", "Top P"),
1070
- value: t.topP ?? i?.topP ?? 1,
1071
- unset: t.topP === void 0,
1066
+ value: n.topP ?? a?.topP ?? 1,
1067
+ unset: n.topP === void 0,
1072
1068
  min: 0,
1073
1069
  max: 1,
1074
1070
  step: .01,
1075
1071
  digits: 2,
1076
- disabled: y,
1077
- onChange: (e) => E({ topP: e })
1072
+ disabled: x,
1073
+ onChange: (e) => D({ topP: e })
1078
1074
  })] }),
1079
- d && /* @__PURE__ */ W(g, {
1075
+ d && /* @__PURE__ */ U(m, {
1080
1076
  label: T("parameterPanel.maxOutputTokens", "Max output tokens"),
1081
1077
  size: "sm",
1082
1078
  placeholder: T("parameterPanel.modelDefault", "Model default"),
1083
1079
  align: "start",
1084
1080
  min: "1",
1085
- ...l ? {
1086
- max: String(l),
1087
- description: T("parameterPanel.maxOutputTokensLimit", "Up to {max} for this model", { max: o(l) })
1081
+ ...u ? {
1082
+ max: String(u),
1083
+ description: T("parameterPanel.maxOutputTokensLimit", "Up to {max} for this model", { max: E(u) })
1088
1084
  } : {},
1089
1085
  step: "256",
1090
- value: t.maxOutputTokens === void 0 ? "" : String(t.maxOutputTokens),
1091
- disabled: y,
1086
+ value: n.maxOutputTokens === void 0 ? "" : String(n.maxOutputTokens),
1087
+ disabled: x,
1092
1088
  onValueChange: (e) => {
1093
1089
  let t = Number(e);
1094
- E({ maxOutputTokens: e.trim() === "" || !Number.isFinite(t) || t <= 0 ? void 0 : Math.round(t) });
1090
+ D({ maxOutputTokens: e.trim() === "" || !Number.isFinite(t) || t <= 0 ? void 0 : Math.round(t) });
1095
1091
  }
1096
1092
  }),
1097
- O.length > 0 && /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(C, {
1093
+ k.length > 0 && /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U(y, {
1098
1094
  label: T("parameterPanel.reasoningEffort", "Reasoning effort"),
1099
1095
  size: "sm",
1100
1096
  fullWidth: !0,
1101
- disabled: y,
1102
- value: t.reasoningEffort ?? "default",
1097
+ disabled: x,
1098
+ value: n.reasoningEffort ?? "default",
1103
1099
  options: [{
1104
1100
  value: "default",
1105
1101
  label: T("parameterPanel.modelDefault", "Model default")
1106
- }, ...O],
1107
- onValueChange: (e) => E({ reasoningEffort: e === "default" ? void 0 : e })
1108
- }), /* @__PURE__ */ G("div", {
1102
+ }, ...k],
1103
+ onValueChange: (e) => D({ reasoningEffort: e === "default" ? void 0 : e })
1104
+ }), /* @__PURE__ */ W("div", {
1109
1105
  className: "flex flex-col gap-8",
1110
- children: [/* @__PURE__ */ W("span", {
1111
- className: e("text-body font-medium", y ? "text-fg-disabled" : "text-fg"),
1106
+ children: [/* @__PURE__ */ U("span", {
1107
+ className: e("text-small font-medium", x ? "text-fg-disabled" : "text-fg"),
1112
1108
  children: T("parameterPanel.reasoningSummary", "Reasoning summary")
1113
- }), /* @__PURE__ */ W(x, {
1109
+ }), /* @__PURE__ */ U(_, {
1114
1110
  "aria-label": T("parameterPanel.reasoningSummary", "Reasoning summary"),
1115
1111
  size: "sm",
1116
1112
  fullWidth: !0,
1117
- disabled: y,
1118
- value: t.reasoningSummary ?? "auto",
1113
+ disabled: x,
1114
+ value: n.reasoningSummary ?? "auto",
1119
1115
  options: [
1120
1116
  {
1121
1117
  value: "auto",
@@ -1134,95 +1130,95 @@ var gt = /* @__PURE__ */ F(function({ value: t, onValueChange: r, defaults: i, i
1134
1130
  label: T("parameterPanel.summaryOff", "Off")
1135
1131
  }
1136
1132
  ],
1137
- onValueChange: (e) => E({ reasoningSummary: e === "auto" ? void 0 : e })
1133
+ onValueChange: (e) => D({ reasoningSummary: e === "auto" ? void 0 : e })
1138
1134
  })]
1139
1135
  })] }),
1140
- f?.sizes && /* @__PURE__ */ W(C, {
1136
+ f?.sizes && /* @__PURE__ */ U(y, {
1141
1137
  label: T("parameterPanel.imageSize", "Image size"),
1142
1138
  size: "sm",
1143
1139
  fullWidth: !0,
1144
- disabled: y,
1145
- value: t.imageSize ?? "default",
1140
+ disabled: x,
1141
+ value: n.imageSize ?? "default",
1146
1142
  options: [{
1147
1143
  value: "default",
1148
- label: A
1149
- }, ...dt.map((e) => ({
1144
+ label: j
1145
+ }, ...ft.map((e) => ({
1150
1146
  value: e,
1151
- label: j(e)
1147
+ label: M(e)
1152
1148
  }))],
1153
- onValueChange: (e) => E({ imageSize: e === "default" ? void 0 : e })
1149
+ onValueChange: (e) => D({ imageSize: e === "default" ? void 0 : e })
1154
1150
  }),
1155
- M.length > 1 && /* @__PURE__ */ W(C, {
1151
+ N.length > 1 && /* @__PURE__ */ U(y, {
1156
1152
  label: T("parameterPanel.imageCount", "Images per prompt"),
1157
1153
  size: "sm",
1158
1154
  fullWidth: !0,
1159
- disabled: y,
1160
- value: String(t.imageCount ?? 1),
1161
- options: M.map((e) => ({
1155
+ disabled: x,
1156
+ value: String(n.imageCount ?? 1),
1157
+ options: N.map((e) => ({
1162
1158
  value: String(e),
1163
- label: o(e)
1159
+ label: E(e)
1164
1160
  })),
1165
- onValueChange: (e) => E({ imageCount: e === "1" ? void 0 : Number(e) })
1161
+ onValueChange: (e) => D({ imageCount: e === "1" ? void 0 : Number(e) })
1166
1162
  }),
1167
- f && f.qualities.length > 0 && /* @__PURE__ */ W(C, {
1163
+ f && f.qualities.length > 0 && /* @__PURE__ */ U(y, {
1168
1164
  label: T("parameterPanel.imageQuality", "Image quality"),
1169
1165
  size: "sm",
1170
1166
  fullWidth: !0,
1171
- disabled: y,
1172
- value: t.imageQuality ?? "default",
1167
+ disabled: x,
1168
+ value: n.imageQuality ?? "default",
1173
1169
  options: [{
1174
1170
  value: "default",
1175
- label: A
1171
+ label: j
1176
1172
  }, ...f.qualities.map((e) => ({
1177
1173
  value: e,
1178
- label: ft(T, e)
1174
+ label: pt(T, e)
1179
1175
  }))],
1180
- onValueChange: (e) => E({ imageQuality: e === "default" ? void 0 : e })
1176
+ onValueChange: (e) => D({ imageQuality: e === "default" ? void 0 : e })
1181
1177
  }),
1182
- Array.isArray(p) && p.length > 0 ? /* @__PURE__ */ W(C, {
1178
+ Array.isArray(g) && g.length > 0 ? /* @__PURE__ */ U(y, {
1183
1179
  label: T("parameterPanel.voice", "Voice"),
1184
1180
  size: "sm",
1185
1181
  fullWidth: !0,
1186
- disabled: y,
1187
- value: t.voice ?? p[0] ?? "",
1188
- options: p.map((e) => ({
1182
+ disabled: x,
1183
+ value: n.voice ?? g[0] ?? "",
1184
+ options: g.map((e) => ({
1189
1185
  value: e,
1190
1186
  label: e
1191
1187
  })),
1192
- onValueChange: (e) => E({ voice: e === p[0] ? void 0 : e })
1193
- }) : p ? /* @__PURE__ */ W(h, {
1188
+ onValueChange: (e) => D({ voice: e === g[0] ? void 0 : e })
1189
+ }) : g ? /* @__PURE__ */ U(p, {
1194
1190
  label: T("parameterPanel.voice", "Voice"),
1195
1191
  size: "sm",
1196
1192
  placeholder: T("parameterPanel.voicePlaceholder", "A voice name or id"),
1197
- disabled: y,
1198
- value: t.voice ?? "",
1199
- onChange: (e) => E({ voice: e.target.value.trim() === "" ? void 0 : e.target.value })
1193
+ disabled: x,
1194
+ value: n.voice ?? "",
1195
+ onChange: (e) => D({ voice: e.target.value.trim() === "" ? void 0 : e.target.value })
1200
1196
  }) : null,
1201
- m && /* @__PURE__ */ W(g, {
1197
+ v && /* @__PURE__ */ U(m, {
1202
1198
  label: T("parameterPanel.duration", "Length in seconds"),
1203
1199
  size: "sm",
1204
- placeholder: A,
1200
+ placeholder: j,
1205
1201
  align: "start",
1206
1202
  min: "0.5",
1207
1203
  step: "0.5",
1208
- value: t.durationSeconds === void 0 ? "" : String(t.durationSeconds),
1209
- disabled: y,
1204
+ value: n.durationSeconds === void 0 ? "" : String(n.durationSeconds),
1205
+ disabled: x,
1210
1206
  onValueChange: (e) => {
1211
1207
  let t = Number(e);
1212
- E({ durationSeconds: e.trim() === "" || !Number.isFinite(t) || t <= 0 ? void 0 : t });
1208
+ D({ durationSeconds: e.trim() === "" || !Number.isFinite(t) || t <= 0 ? void 0 : t });
1213
1209
  }
1214
1210
  }),
1215
- v && /* @__PURE__ */ G("div", {
1211
+ b && /* @__PURE__ */ W("div", {
1216
1212
  className: "flex flex-col gap-8",
1217
- children: [/* @__PURE__ */ W("span", {
1218
- className: e("text-body font-medium", y ? "text-fg-disabled" : "text-fg"),
1213
+ children: [/* @__PURE__ */ U("span", {
1214
+ className: e("text-small font-medium", x ? "text-fg-disabled" : "text-fg"),
1219
1215
  children: T("parameterPanel.transcript", "Transcript")
1220
- }), /* @__PURE__ */ W(x, {
1216
+ }), /* @__PURE__ */ U(_, {
1221
1217
  "aria-label": T("parameterPanel.transcript", "Transcript"),
1222
1218
  size: "sm",
1223
1219
  fullWidth: !0,
1224
- disabled: y,
1225
- value: t.translate ? "english" : "spoken",
1220
+ disabled: x,
1221
+ value: n.translate ? "english" : "spoken",
1226
1222
  options: [{
1227
1223
  value: "spoken",
1228
1224
  label: T("parameterPanel.transcriptSpoken", "As spoken")
@@ -1230,57 +1226,57 @@ var gt = /* @__PURE__ */ F(function({ value: t, onValueChange: r, defaults: i, i
1230
1226
  value: "english",
1231
1227
  label: T("parameterPanel.transcriptEnglish", "In English")
1232
1228
  }],
1233
- onValueChange: (e) => E({ translate: e === "english" || void 0 })
1229
+ onValueChange: (e) => D({ translate: e === "english" || void 0 })
1234
1230
  })]
1235
1231
  }),
1236
- /* @__PURE__ */ W("div", {
1232
+ /* @__PURE__ */ U("div", {
1237
1233
  className: "flex justify-end",
1238
- children: /* @__PURE__ */ W(u, {
1234
+ children: /* @__PURE__ */ U(r, {
1239
1235
  size: "sm",
1240
1236
  variant: "ghost",
1241
- disabled: y || !k,
1242
- onClick: () => r(t.instructions === void 0 ? {} : { instructions: t.instructions }),
1237
+ disabled: x || !A,
1238
+ onClick: () => i(n.instructions === void 0 ? {} : { instructions: n.instructions }),
1243
1239
  children: T("parameterPanel.resetToDefaults", "Reset to defaults")
1244
1240
  })
1245
1241
  })
1246
1242
  ]
1247
1243
  });
1248
1244
  });
1249
- process.env.NODE_ENV !== "production" && (gt.displayName = "ParameterPanel");
1250
- var _t = /* @__PURE__ */ F(function({ trigger: e, title: t, open: r, defaultOpen: i, onOpenChange: a, side: o = "bottom", align: s = "end", ...c }, l) {
1251
- let d = n();
1252
- if (!e) return /* @__PURE__ */ W(gt, {
1253
- ref: l,
1254
- ...c
1245
+ process.env.NODE_ENV !== "production" && (_t.displayName = "ParameterPanel");
1246
+ var vt = /* @__PURE__ */ P(function({ trigger: e, title: n, open: i, defaultOpen: a, onOpenChange: o, side: s = "bottom", align: c = "end", ...l }, u) {
1247
+ let d = t();
1248
+ if (!e) return /* @__PURE__ */ U(_t, {
1249
+ ref: u,
1250
+ ...l
1255
1251
  });
1256
- let f = t ?? d("parameterPopover.parameters", "Parameters");
1257
- return /* @__PURE__ */ G(w, {
1252
+ let f = n ?? d("parameterPopover.parameters", "Parameters");
1253
+ return /* @__PURE__ */ W(g, {
1258
1254
  trapFocus: !0,
1259
- ...r === void 0 ? {} : { open: r },
1260
- ...i === void 0 ? {} : { defaultOpen: i },
1261
- ...a ? { onOpenChange: a } : {},
1262
- children: [/* @__PURE__ */ W(w.Trigger, { children: e }), /* @__PURE__ */ W(w.Content, {
1263
- ref: l,
1255
+ ...i === void 0 ? {} : { open: i },
1256
+ ...a === void 0 ? {} : { defaultOpen: a },
1257
+ ...o ? { onOpenChange: o } : {},
1258
+ children: [/* @__PURE__ */ U(g.Trigger, { children: e }), /* @__PURE__ */ U(g.Content, {
1259
+ ref: u,
1264
1260
  "aria-label": f,
1265
- side: o,
1266
- align: s,
1261
+ side: s,
1262
+ align: c,
1267
1263
  className: "w-320 max-w-(--available-width)",
1268
- children: /* @__PURE__ */ G("div", {
1264
+ children: /* @__PURE__ */ W("div", {
1269
1265
  className: "relative",
1270
1266
  children: [
1271
- /* @__PURE__ */ W("p", {
1267
+ /* @__PURE__ */ U("p", {
1272
1268
  className: "mb-16 flex min-h-32 items-center pr-40 text-body font-semibold text-fg",
1273
1269
  children: f
1274
1270
  }),
1275
- /* @__PURE__ */ W(gt, {
1276
- ...c,
1271
+ /* @__PURE__ */ U(_t, {
1272
+ ...l,
1277
1273
  layout: "popover"
1278
1274
  }),
1279
- /* @__PURE__ */ W("div", {
1275
+ /* @__PURE__ */ U("div", {
1280
1276
  className: "absolute top-0 right-0",
1281
- children: /* @__PURE__ */ W(w.Close, { children: /* @__PURE__ */ W(u, {
1277
+ children: /* @__PURE__ */ U(g.Close, { children: /* @__PURE__ */ U(r, {
1282
1278
  variant: "ghost",
1283
- icon: de,
1279
+ icon: le,
1284
1280
  "aria-label": d("parameterPopover.close", "Close parameters"),
1285
1281
  size: "sm"
1286
1282
  }) })
@@ -1290,54 +1286,53 @@ var _t = /* @__PURE__ */ F(function({ trigger: e, title: t, open: r, defaultOpen
1290
1286
  })]
1291
1287
  });
1292
1288
  });
1293
- process.env.NODE_ENV !== "production" && (_t.displayName = "ParameterPanel");
1294
- //#endregion
1295
- //#region src/components/playground/model-picker.tsx
1296
- var vt = {
1289
+ process.env.NODE_ENV !== "production" && (vt.displayName = "ParameterPanel");
1290
+ // src/components/playground/model-picker.tsx
1291
+ var yt = {
1297
1292
  ghost: "header",
1298
1293
  default: "default"
1299
- }, yt = { appearance: {
1300
- ghost: { classes: S.appearance.header.classes },
1301
- default: { classes: S.appearance.default.classes }
1302
- } }, bt = { appearance: "ghost" }, xt = "", St = "*";
1303
- function Ct({ option: t, query: n, providerLabel: r }) {
1304
- let a = t.model ?? t.value, o = [t.context ? i(t.context) : "", t.price ?? ""].filter(Boolean).join(" · ");
1305
- return /* @__PURE__ */ G(U, { children: [
1306
- r !== void 0 && /* @__PURE__ */ W("span", {
1294
+ }, bt = { appearance: {
1295
+ ghost: { classes: v.appearance.header.classes },
1296
+ default: { classes: v.appearance.default.classes }
1297
+ } }, xt = { appearance: "ghost" }, St = "", Ct = "*";
1298
+ function wt({ option: t, query: n, providerLabel: r }) {
1299
+ let { formatContext: i } = s(), a = t.model ?? t.value, o = [t.context ? i(t.context) : "", t.price ?? ""].filter(Boolean).join(" · ");
1300
+ return /* @__PURE__ */ W(H, { children: [
1301
+ r !== void 0 && /* @__PURE__ */ U("span", {
1307
1302
  "aria-hidden": !0,
1308
1303
  className: "flex",
1309
- children: /* @__PURE__ */ W(j, {
1304
+ children: /* @__PURE__ */ U(A, {
1310
1305
  provider: t.provider,
1311
1306
  name: r
1312
1307
  })
1313
1308
  }),
1314
- /* @__PURE__ */ G("span", {
1309
+ /* @__PURE__ */ W("span", {
1315
1310
  className: "flex min-w-0 flex-1 items-baseline gap-8",
1316
- children: [/* @__PURE__ */ W("span", {
1311
+ children: [/* @__PURE__ */ U("span", {
1317
1312
  className: "min-w-0 shrink truncate",
1318
- children: /* @__PURE__ */ W(T, {
1313
+ children: /* @__PURE__ */ U(T, {
1319
1314
  text: t.name ?? a,
1320
1315
  query: n
1321
1316
  })
1322
- }), t.name && t.name !== a && /* @__PURE__ */ W("span", {
1317
+ }), t.name && t.name !== a && /* @__PURE__ */ U("span", {
1323
1318
  className: "min-w-0 flex-1 truncate mono text-small font-regular text-fg-tertiary",
1324
- children: /* @__PURE__ */ W(T, {
1319
+ children: /* @__PURE__ */ U(T, {
1325
1320
  text: a,
1326
1321
  query: n
1327
1322
  })
1328
1323
  })]
1329
1324
  }),
1330
- t.capabilities && t.capabilities.length > 0 && /* @__PURE__ */ W(te, {
1325
+ t.capabilities && t.capabilities.length > 0 && /* @__PURE__ */ U(N, {
1331
1326
  capabilities: t.capabilities,
1332
1327
  className: "hidden sm:flex"
1333
1328
  }),
1334
- (t.note ?? o) && /* @__PURE__ */ W("span", {
1329
+ (t.note ?? o) && /* @__PURE__ */ U("span", {
1335
1330
  className: e("shrink-0 text-caption font-regular tabular", t.note ? "text-fg-secondary" : "hidden text-fg-tertiary sm:inline"),
1336
1331
  children: t.note ?? o
1337
1332
  })
1338
1333
  ] });
1339
1334
  }
1340
- function wt(e, t, n) {
1335
+ function Tt(e, t, n) {
1341
1336
  let r = e.model ?? e.value, i = t(e.provider);
1342
1337
  return {
1343
1338
  value: e.value,
@@ -1347,7 +1342,7 @@ function wt(e, t, n) {
1347
1342
  i,
1348
1343
  e.provider
1349
1344
  ],
1350
- render: ({ query: t }) => /* @__PURE__ */ W(Ct, {
1345
+ render: ({ query: t }) => /* @__PURE__ */ U(wt, {
1351
1346
  option: e,
1352
1347
  query: t,
1353
1348
  ...n ? { providerLabel: i } : {}
@@ -1355,222 +1350,981 @@ function wt(e, t, n) {
1355
1350
  ...e.disabled ? { disabled: !0 } : {}
1356
1351
  };
1357
1352
  }
1358
- function Tt(e, t, n, r) {
1353
+ function Et(e, t, n, r) {
1359
1354
  return n ? t.flatMap((t) => {
1360
1355
  let n = e.filter((e) => e.provider === t);
1361
1356
  return n.length ? [{
1362
1357
  id: `provider:${t}`,
1363
1358
  label: r(t),
1364
- leading: /* @__PURE__ */ W("span", {
1359
+ leading: /* @__PURE__ */ U("span", {
1365
1360
  "aria-hidden": !0,
1366
1361
  className: "flex",
1367
- children: /* @__PURE__ */ W(j, {
1362
+ children: /* @__PURE__ */ U(A, {
1368
1363
  provider: t,
1369
1364
  name: r(t),
1370
1365
  size: "sm"
1371
1366
  })
1372
1367
  }),
1373
1368
  count: n.length,
1374
- items: n.map((e) => wt(e, r, !1))
1369
+ items: n.map((e) => Tt(e, r, !1))
1375
1370
  }] : [];
1376
1371
  }) : [{
1377
1372
  id: "models",
1378
- items: e.map((e) => wt(e, r, !0))
1373
+ items: e.map((e) => Tt(e, r, !0))
1379
1374
  }];
1380
1375
  }
1381
- function Et(e, t) {
1382
- let n = r(), i = z(() => new Map(t.map((e) => [e.id, e])), [t]), a = ae((e) => M(e, i.get(e)?.name), [i]);
1376
+ function Dt(e, t) {
1377
+ let r = n(), i = z(() => new Map(t.map((e) => [e.id, e])), [t]), a = F((e) => j(e, i.get(e)?.name), [i]);
1383
1378
  return {
1384
1379
  nameOf: a,
1385
- providerOrder: z(() => [...new Set(e.map((e) => e.provider))].sort((e, t) => Number(!!i.get(t)?.connected) - Number(!!i.get(e)?.connected) || a(e).localeCompare(a(t), n, { sensitivity: "base" })), [
1380
+ providerOrder: z(() => [...new Set(e.map((e) => e.provider))].sort((e, t) => Number(!!i.get(t)?.connected) - Number(!!i.get(e)?.connected) || a(e).localeCompare(a(t), r, { sensitivity: "base" })), [
1386
1381
  e,
1387
1382
  i,
1388
1383
  a,
1389
- n
1384
+ r
1390
1385
  ])
1391
1386
  };
1392
1387
  }
1393
- function Dt(e, { providers: t = [], groupByProvider: n } = {}) {
1394
- let { nameOf: r, providerOrder: i } = Et(e, t), a = n ?? i.length > 1;
1395
- return z(() => Tt(e, i, a, r), [
1388
+ function Ot(e, { providers: t = [], groupByProvider: n } = {}) {
1389
+ let { nameOf: r, providerOrder: i } = Dt(e, t), a = n ?? i.length > 1;
1390
+ return z(() => Et(e, i, a, r), [
1396
1391
  e,
1397
1392
  i,
1398
1393
  a,
1399
1394
  r
1400
1395
  ]);
1401
1396
  }
1402
- var Ot = /* @__PURE__ */ F(function(t, r) {
1403
- let { options: i, providers: a = [], recent: s = [], groupByProvider: c, placeholder: l, "aria-label": u, appearance: d = "ghost", size: h = "sm", fullWidth: g, disabled: _, invalid: v, open: y, onOpenChange: x, "data-force": S, className: w, label: T, description: E, error: M, optional: te, required: ne, layout: N } = t, P = n(), re = f(), F = p(t), [ie, ae] = V(!1), I = y ?? ie, L = (e) => {
1404
- y === void 0 && ae(e), x?.(e);
1405
- }, [oe, R] = V(() => t.defaultValue ?? (t.multiple ? [] : null)), B = t.value === void 0 ? oe : t.value, H = Array.isArray(B) ? B : B ? [B] : [], K = t.multiple ? void 0 : t.allLabel, [q, se] = V(""), [J, ce] = V(null), [le, ue] = V(!1), [de, fe] = V(I);
1406
- I !== de && (fe(I), I && (se(""), ce(null)));
1407
- let Y = z(() => new Map(i.map((e) => [e.value, e])), [i]), { nameOf: X, providerOrder: Z } = Et(i, a), pe = c ?? Z.length > 1, me = i.some((e) => e.deprecated && !H.includes(e.value)), he = H.join("\0"), ge = z(() => {
1408
- let e = new Set(he.split("\0")), t = (t) => (le || !t.deprecated || e.has(t.value)) && (!J || t.provider === J), n = [];
1409
- K && !J && n.push({
1397
+ var kt = /* @__PURE__ */ P(function(n, r) {
1398
+ let { options: i, providers: a = [], recent: o = [], groupByProvider: c, placeholder: l, "aria-label": u, appearance: d = "ghost", size: f = "sm", fullWidth: p, disabled: m, invalid: h, open: g, onOpenChange: _, "data-force": v, className: b, label: T, description: j, error: N, optional: ee, required: te, layout: ne } = n, P = t(), { formatNumber: re } = s(), F = D(), ie = O(n), [I, L] = V(!1), R = g ?? I, B = (e) => {
1399
+ g === void 0 && L(e), _?.(e);
1400
+ }, [ae, oe] = V(() => n.defaultValue ?? (n.multiple ? [] : null)), G = n.value === void 0 ? ae : n.value, K = Array.isArray(G) ? G : G ? [G] : [], q = n.multiple ? void 0 : n.allLabel, [J, se] = V(""), [Y, ce] = V(null), [X, le] = V(!1), [ue, de] = V(R);
1401
+ R !== ue && (de(R), R && (se(""), ce(null)));
1402
+ let fe = z(() => new Map(i.map((e) => [e.value, e])), [i]), { nameOf: Z, providerOrder: pe } = Dt(i, a), me = c ?? pe.length > 1, he = i.some((e) => e.deprecated && !K.includes(e.value)), ge = K.join("\0"), _e = z(() => {
1403
+ let e = new Set(ge.split("\0")), t = (t) => (X || !t.deprecated || e.has(t.value)) && (!Y || t.provider === Y), n = [];
1404
+ q && !Y && n.push({
1410
1405
  id: "all",
1411
1406
  items: [{
1412
- value: xt,
1413
- label: K
1407
+ value: St,
1408
+ label: q
1414
1409
  }]
1415
1410
  });
1416
- let r = q.trim() || J ? [] : s.flatMap((e) => Y.get(e) && t(Y.get(e)) ? [wt(Y.get(e), X, !0)] : []);
1411
+ let r = J.trim() || Y ? [] : o.flatMap((e) => fe.get(e) && t(fe.get(e)) ? [Tt(fe.get(e), Z, !0)] : []);
1417
1412
  return r.length && n.push({
1418
1413
  id: "recent",
1419
1414
  label: P("modelPicker.recent", "Recent"),
1420
1415
  items: r
1421
- }), [...n, ...Tt(i.filter(t), Z, pe, X)];
1416
+ }), [...n, ...Et(i.filter(t), pe, me, Z)];
1422
1417
  }, [
1423
1418
  i,
1424
- Z,
1425
1419
  pe,
1426
- s,
1420
+ me,
1421
+ o,
1422
+ fe,
1423
+ J,
1427
1424
  Y,
1425
+ X,
1426
+ ge,
1428
1427
  q,
1429
- J,
1430
- le,
1431
- he,
1432
- K,
1433
1428
  P,
1434
- X
1435
- ]), _e = (e) => {
1436
- if (t.multiple) {
1437
- let n = H.includes(e) ? H.filter((t) => t !== e) : [...H, e];
1438
- t.value === void 0 && R(n), t.onValueChange?.(n);
1439
- } else t.value === void 0 && R(e === xt ? null : e), t.onValueChange?.(e), L(!1);
1440
- }, ve = z(() => {
1441
- let e = q.trim(), t = new Set(he.split("\0")), n = /* @__PURE__ */ new Map();
1429
+ Z
1430
+ ]), ve = (e) => {
1431
+ if (n.multiple) {
1432
+ let t = K.includes(e) ? K.filter((t) => t !== e) : [...K, e];
1433
+ n.value === void 0 && oe(t), n.onValueChange?.(t);
1434
+ } else n.value === void 0 && oe(e === St ? null : e), n.onValueChange?.(e), B(!1);
1435
+ }, ye = z(() => {
1436
+ let e = J.trim(), t = new Set(ge.split("\0")), n = /* @__PURE__ */ new Map();
1442
1437
  for (let r of i) {
1443
- if (r.deprecated && !le && !t.has(r.value)) continue;
1438
+ if (r.deprecated && !X && !t.has(r.value)) continue;
1444
1439
  let i = r.model ?? r.value;
1445
- e && D(e, [
1440
+ e && x(e, [
1446
1441
  r.name ?? i,
1447
1442
  i,
1448
- X(r.provider),
1443
+ Z(r.provider),
1449
1444
  r.provider
1450
1445
  ]) <= 0 || n.set(r.provider, (n.get(r.provider) ?? 0) + 1);
1451
1446
  }
1452
- return Z.filter((e) => n.has(e) || e === J).map((e) => ({
1447
+ return pe.filter((e) => n.has(e) || e === Y).map((e) => ({
1453
1448
  id: e,
1454
1449
  count: n.get(e) ?? 0
1455
1450
  }));
1456
1451
  }, [
1457
1452
  i,
1458
- Z,
1459
- q,
1460
- le,
1461
- he,
1453
+ pe,
1462
1454
  J,
1463
- X
1464
- ]), ye = pe && Z.length > 1 ? /* @__PURE__ */ W(C, {
1455
+ X,
1456
+ ge,
1457
+ Y,
1458
+ Z
1459
+ ]), be = me && pe.length > 1 ? /* @__PURE__ */ U(y, {
1465
1460
  "aria-label": P("modelPicker.provider", "Provider"),
1466
1461
  size: "sm",
1467
1462
  appearance: "ghost",
1468
- value: J ?? St,
1469
- onValueChange: (e) => ce(e === St ? null : e),
1463
+ value: Y ?? Ct,
1464
+ onValueChange: (e) => ce(e === Ct ? null : e),
1470
1465
  options: [{
1471
- value: St,
1466
+ value: Ct,
1472
1467
  label: P("modelPicker.everyProvider", "All providers")
1473
- }, ...ve.map(({ id: e, count: t }) => ({
1468
+ }, ...ye.map(({ id: e, count: t }) => ({
1474
1469
  value: e,
1475
- textValue: X(e),
1476
- label: /* @__PURE__ */ G("span", {
1470
+ textValue: Z(e),
1471
+ label: /* @__PURE__ */ W("span", {
1477
1472
  className: "flex min-w-0 items-center gap-8",
1478
1473
  children: [
1479
- /* @__PURE__ */ W("span", {
1474
+ /* @__PURE__ */ U("span", {
1480
1475
  "aria-hidden": !0,
1481
1476
  className: "flex shrink-0",
1482
- children: /* @__PURE__ */ W(j, {
1477
+ children: /* @__PURE__ */ U(A, {
1483
1478
  provider: e,
1484
1479
  size: "sm"
1485
1480
  })
1486
1481
  }),
1487
- /* @__PURE__ */ W("span", {
1482
+ /* @__PURE__ */ U("span", {
1488
1483
  className: "min-w-0 truncate",
1489
- children: X(e)
1484
+ children: Z(e)
1490
1485
  }),
1491
- /* @__PURE__ */ W("span", {
1486
+ /* @__PURE__ */ U("span", {
1492
1487
  className: "shrink-0 text-fg-tertiary tabular",
1493
- children: o(t)
1488
+ children: re(t)
1494
1489
  })
1495
1490
  ]
1496
1491
  })
1497
1492
  }))]
1498
- }) : null, be = ye || me ? /* @__PURE__ */ G(U, { children: [ye, me && /* @__PURE__ */ W(b, {
1493
+ }) : null, xe = be || he ? /* @__PURE__ */ W(H, { children: [be, he && /* @__PURE__ */ U(E, {
1499
1494
  size: "sm",
1500
1495
  label: P("modelPicker.showDeprecated", "Show deprecated"),
1501
- checked: le,
1502
- onCheckedChange: ue
1503
- })] }) : void 0, Q = H[0] ? Y.get(H[0]) : void 0, xe = t.multiple ? Q ? H.length === 1 ? /* @__PURE__ */ W(ee, {
1496
+ checked: X,
1497
+ onCheckedChange: le
1498
+ })] }) : void 0, Q = K[0] ? fe.get(K[0]) : void 0, Se = n.multiple ? Q ? K.length === 1 ? /* @__PURE__ */ U(M, {
1504
1499
  provider: Q.provider,
1505
- providerName: X(Q.provider),
1500
+ providerName: Z(Q.provider),
1506
1501
  model: Q.model ?? Q.value,
1507
1502
  ...Q.name ? { name: Q.name } : {}
1508
- }) : /* @__PURE__ */ G("span", {
1503
+ }) : /* @__PURE__ */ W("span", {
1509
1504
  className: "flex min-w-0 items-center",
1510
1505
  children: [
1511
- /* @__PURE__ */ W("span", {
1506
+ /* @__PURE__ */ U("span", {
1512
1507
  className: "min-w-0 truncate",
1513
1508
  children: Q.name ?? Q.model ?? Q.value
1514
1509
  }),
1515
1510
  " ",
1516
- /* @__PURE__ */ W("span", {
1511
+ /* @__PURE__ */ U("span", {
1517
1512
  className: "shrink-0 pl-4 tabular",
1518
- children: P("select.more", "+{count}", { count: String(H.length - 1) })
1513
+ children: P("select.more", "+{count}", { count: String(K.length - 1) })
1519
1514
  })
1520
1515
  ]
1521
- }) : void 0 : Q ? /* @__PURE__ */ W(ee, {
1516
+ }) : void 0 : Q ? /* @__PURE__ */ U(M, {
1522
1517
  provider: Q.provider,
1523
- providerName: X(Q.provider),
1518
+ providerName: Z(Q.provider),
1524
1519
  model: Q.model ?? Q.value,
1525
1520
  ...Q.name ? { name: Q.name } : {}
1526
- }) : B === xt || B === null && K ? K : void 0, Se = u ?? (typeof T == "string" ? T : P("modelPicker.model", "Model")), Ce = /* @__PURE__ */ W(A, {
1527
- title: Se,
1521
+ }) : G === St || G === null && q ? q : void 0, Ce = u ?? (typeof T == "string" ? T : P("modelPicker.model", "Model")), we = /* @__PURE__ */ U(w, {
1522
+ title: Ce,
1528
1523
  width: "lg",
1529
- open: I,
1530
- onOpenChange: L,
1531
- trigger: /* @__PURE__ */ W(k, {
1524
+ open: R,
1525
+ onOpenChange: B,
1526
+ trigger: /* @__PURE__ */ U(C, {
1532
1527
  ref: r,
1533
- appearance: vt[d],
1534
- size: h,
1535
- ...F.controlProps,
1536
- ...u || !T ? { "aria-label": Se } : {},
1537
- ..._ ? { disabled: _ } : {},
1538
- ...v ? { invalid: v } : {},
1539
- ...g ? { fullWidth: g } : {},
1540
- ...S ? { "data-force": S } : {},
1541
- ...Q && !t.multiple ? { title: Q.name && Q.name !== (Q.model ?? Q.value) ? `${Q.name} · ${Q.model ?? Q.value}` : Q.model ?? Q.value } : {},
1542
- placeholder: l ?? (t.multiple ? P("modelPicker.chooseSome", "Choose models") : P("modelPicker.choose", "Choose a model")),
1543
- className: e("max-w-full", !(T || E || M) && w),
1544
- children: xe
1528
+ appearance: yt[d],
1529
+ size: f,
1530
+ ...ie.controlProps,
1531
+ ...u || !T ? { "aria-label": Ce } : {},
1532
+ ...m ? { disabled: m } : {},
1533
+ ...h ? { invalid: h } : {},
1534
+ ...p ? { fullWidth: p } : {},
1535
+ ...v ? { "data-force": v } : {},
1536
+ ...Q && !n.multiple ? { title: Q.name && Q.name !== (Q.model ?? Q.value) ? `${Q.name} · ${Q.model ?? Q.value}` : Q.model ?? Q.value } : {},
1537
+ placeholder: l ?? (n.multiple ? P("modelPicker.chooseSome", "Choose models") : P("modelPicker.choose", "Choose a model")),
1538
+ className: e("max-w-full", !(T || j || N) && b),
1539
+ children: Se
1545
1540
  }),
1546
- children: /* @__PURE__ */ W(O, {
1547
- groups: ge,
1548
- "aria-label": Se,
1549
- value: t.multiple ? H : H[0] ?? (K ? xt : null),
1550
- ...t.multiple ? { multiple: !0 } : {},
1551
- onSelect: _e,
1552
- query: q,
1541
+ children: /* @__PURE__ */ U(S, {
1542
+ groups: _e,
1543
+ "aria-label": Ce,
1544
+ value: n.multiple ? K : K[0] ?? (q ? St : null),
1545
+ ...n.multiple ? { multiple: !0 } : {},
1546
+ onSelect: ve,
1547
+ query: J,
1553
1548
  onQueryChange: se,
1554
1549
  placeholder: P("modelPicker.search", "Search models"),
1555
1550
  emptyText: P("modelPicker.noMatch", "No models match"),
1556
- toolbar: be,
1551
+ toolbar: xe,
1557
1552
  autoFocus: !0
1558
1553
  })
1559
1554
  });
1560
- return re ? Ce : m({
1555
+ return F ? we : k({
1561
1556
  label: T,
1562
- description: E,
1563
- error: M,
1564
- optional: te,
1565
- required: ne,
1566
- layout: N,
1567
- id: F.wrapId,
1568
- disabled: _,
1569
- className: w
1570
- }, Ce);
1557
+ description: j,
1558
+ error: N,
1559
+ optional: ee,
1560
+ required: te,
1561
+ layout: ne,
1562
+ id: ie.wrapId,
1563
+ disabled: m,
1564
+ className: b
1565
+ }, we);
1566
+ });
1567
+ process.env.NODE_ENV !== "production" && (kt.displayName = "ModelPicker");
1568
+ // src/components/playground/probability-bar.tsx
1569
+ var At = { layout: {
1570
+ inline: { classes: "flex min-h-22 items-center gap-12" },
1571
+ stacked: { classes: "flex flex-col gap-6" },
1572
+ row: { classes: "col-span-full grid min-h-22 grid-cols-subgrid items-center" }
1573
+ } }, jt = { layout: "inline" };
1574
+ function Mt(e, t, { formatPercent: n }) {
1575
+ return e > 0 && e < .005 ? t("probabilityBar.below", "<{percent}", { percent: n(.01, 0) }) : e < 1 && e >= .995 ? t("probabilityBar.above", ">{percent}", { percent: n(.99, 0) }) : n(e, 0);
1576
+ }
1577
+ function Nt(e) {
1578
+ return typeof e == "number" && Number.isFinite(e);
1579
+ }
1580
+ var Pt = /* @__PURE__ */ P(function({ value: n, label: r, highlight: i = !1, pending: a = !1, layout: o = "inline", "aria-label": c, className: l }, u) {
1581
+ let d = t(), f = s(), p = L(), m = !a && Nt(n), h = m ? Math.max(0, Math.min(1, n)) : 0, g = m ? Mt(h, d, f) : "", _ = i ? d("probabilityBar.chosen", "{percent}, chosen", { percent: g }) : g, v = !a && !m, y = d("probabilityBar.missing", "Not given"), b = r == null ? null : /* @__PURE__ */ U("span", {
1582
+ id: p,
1583
+ className: e("min-w-0 text-small wrap-anywhere", o === "inline" ? "w-120 shrink-0" : o === "stacked" && "flex-1", i ? "font-medium text-fg" : "text-fg-secondary"),
1584
+ children: r
1585
+ }), x = /* @__PURE__ */ U("span", {
1586
+ className: e("shrink-0 text-small tabular", o === "inline" && "w-48 text-end", o === "row" && "text-end", i ? "font-medium text-fg" : v ? "text-fg-tertiary" : "text-fg-secondary"),
1587
+ children: v && o === "stacked" ? y : g
1588
+ }), S = v && o !== "stacked" ? /* @__PURE__ */ U("span", {
1589
+ className: e("min-w-0 truncate text-small text-fg-tertiary", o === "row" ? "col-span-2" : "flex-1"),
1590
+ children: y
1591
+ }) : /* @__PURE__ */ U("span", {
1592
+ "aria-hidden": !0,
1593
+ className: e("relative block h-6 min-w-0 overflow-hidden rounded-pill bg-fill-2 forced-colors:outline forced-colors:-outline-offset-1", o === "inline" && "flex-1", a && "animate-pulse-quiet reduced:animate-none"),
1594
+ children: m && /* @__PURE__ */ U("span", {
1595
+ className: e("block h-full rounded-pill width-motion reduced:transition-none data-mark forced-line", i ? "bg-viz-1" : "bg-fg-tertiary"),
1596
+ style: { width: `${h * 100}%` }
1597
+ })
1598
+ }), C = o === "stacked" ? /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ W("span", {
1599
+ className: "flex items-baseline justify-between gap-12",
1600
+ children: [b ?? /* @__PURE__ */ U("span", { className: "flex-1" }), x]
1601
+ }), S] }) : /* @__PURE__ */ W(H, { children: [
1602
+ b ?? (o === "row" ? /* @__PURE__ */ U("span", {}) : null),
1603
+ S,
1604
+ !v && x
1605
+ ] }), w = c ?? (typeof r == "string" ? r : void 0);
1606
+ return /* @__PURE__ */ U("div", {
1607
+ ref: u,
1608
+ ...m ? {
1609
+ role: "meter",
1610
+ "aria-valuemin": 0,
1611
+ "aria-valuemax": 100,
1612
+ "aria-valuenow": Math.round(h * 1e3) / 10,
1613
+ "aria-valuetext": _,
1614
+ ...w === void 0 ? b ? { "aria-labelledby": p } : {} : { "aria-label": w }
1615
+ } : {},
1616
+ ...a ? { "aria-hidden": !0 } : {},
1617
+ "data-probability-bar": "",
1618
+ "data-highlight": i || void 0,
1619
+ className: e(At.layout[o].classes, "min-w-0", l),
1620
+ children: C
1621
+ });
1622
+ });
1623
+ process.env.NODE_ENV !== "production" && (Pt.displayName = "ProbabilityBar");
1624
+ // src/components/playground/decision-types.ts
1625
+ function Ft(e, t) {
1626
+ switch (t) {
1627
+ case "predicate": return e("decision.kindPredicate", "Yes/no");
1628
+ case "choice": return e("decision.kindChoice", "Choice");
1629
+ case "score": return e("decision.kindScore", "Score");
1630
+ case "box": return e("decision.kindBox", "Box");
1631
+ }
1632
+ }
1633
+ function It(e, t, n) {
1634
+ return t.name?.trim() || e("decision.question", "Question {n}", { n: n + 1 });
1635
+ }
1636
+ function Lt(e, t, n) {
1637
+ return t?.value.trim() || e("decision.option", "Option {n}", { n: n + 1 });
1638
+ }
1639
+ function Rt(e, t, n) {
1640
+ return t?.label?.trim() || e("decision.level", "Level {n}", { n });
1641
+ }
1642
+ // src/components/playground/decision-response.tsx
1643
+ var zt = { status: {
1644
+ pending: { classes: "" },
1645
+ done: { classes: "" },
1646
+ error: { classes: "" }
1647
+ } }, Bt = { status: "done" }, Vt = "animate-pulse-quiet reduced:animate-none";
1648
+ function Ht(e, t) {
1649
+ let n = e.map((e, t) => t);
1650
+ if (e.length <= t) return n;
1651
+ let r = (t) => e[t]?.highlight ? 2 : e[t]?.value ?? -1;
1652
+ return [...n].sort((e, t) => r(t) - r(e) || e - t).slice(0, t).sort((e, t) => e - t);
1653
+ }
1654
+ function Ut({ bars: e, pending: t, max: n, unit: i, t: a }) {
1655
+ let [o, s] = V(!1), c = L(), l = e.length > n, u = o || !l ? e.map((e, t) => t) : t ? e.slice(0, n).map((e, t) => t) : Ht(e, n);
1656
+ return /* @__PURE__ */ W("div", {
1657
+ className: "flex flex-col gap-4",
1658
+ children: [/* @__PURE__ */ U("div", {
1659
+ id: c,
1660
+ className: "grid grid-cols-meter gap-x-12 gap-y-6",
1661
+ children: u.map((n) => {
1662
+ let r = e[n];
1663
+ return r ? /* @__PURE__ */ U(Pt, {
1664
+ layout: "row",
1665
+ label: r.label,
1666
+ value: r.value,
1667
+ highlight: !t && r.highlight,
1668
+ pending: t
1669
+ }, n) : null;
1670
+ })
1671
+ }), l && /* @__PURE__ */ U("span", {
1672
+ className: "flex h-32 items-center",
1673
+ children: /* @__PURE__ */ U(r, {
1674
+ size: "sm",
1675
+ variant: "ghost",
1676
+ disabled: t,
1677
+ "aria-expanded": o,
1678
+ "aria-controls": c,
1679
+ leadingIcon: o ? se : G,
1680
+ onClick: () => s((e) => !e),
1681
+ children: o ? a("decisionResponse.showFewer", "Show fewer") : i === "options" ? a("decisionResponse.showAllOptions", "Show all {count} options", { count: e.length }) : a("decisionResponse.showAllLevels", "Show all {count} levels", { count: e.length })
1682
+ })
1683
+ })]
1684
+ });
1685
+ }
1686
+ function Wt(e) {
1687
+ return Number.isFinite(e) ? Math.max(0, Math.min(1, e)) : 0;
1688
+ }
1689
+ function Gt({ answer: t, image: n, t: r }) {
1690
+ let { formatPercent: i } = s(), a = t ? {
1691
+ top: Wt(Math.min(t.top, t.bottom)),
1692
+ bottom: Wt(Math.max(t.top, t.bottom)),
1693
+ left: Wt(Math.min(t.left, t.right)),
1694
+ right: Wt(Math.max(t.left, t.right))
1695
+ } : void 0, o = [
1696
+ ["top", r("decisionResponse.boxTop", "Top")],
1697
+ ["left", r("decisionResponse.boxLeft", "Left")],
1698
+ ["bottom", r("decisionResponse.boxBottom", "Bottom")],
1699
+ ["right", r("decisionResponse.boxRight", "Right")]
1700
+ ];
1701
+ return /* @__PURE__ */ W("div", {
1702
+ className: "flex flex-col gap-8",
1703
+ children: [n && /* @__PURE__ */ W("div", {
1704
+ className: "relative max-w-480 min-w-0 overflow-hidden rounded-well bg-fill-1 image-outline",
1705
+ children: [/* @__PURE__ */ U("img", {
1706
+ src: n.src,
1707
+ alt: n.alt ?? "",
1708
+ decoding: "async",
1709
+ className: "block h-auto w-full"
1710
+ }), a && /* @__PURE__ */ U("span", {
1711
+ "aria-hidden": !0,
1712
+ "data-box": "",
1713
+ className: "pointer-events-none absolute rounded-code ring-box",
1714
+ style: {
1715
+ top: `${a.top * 100}%`,
1716
+ left: `${a.left * 100}%`,
1717
+ width: `${(a.right - a.left) * 100}%`,
1718
+ height: `${(a.bottom - a.top) * 100}%`
1719
+ }
1720
+ })]
1721
+ }), /* @__PURE__ */ U("dl", {
1722
+ className: "flex flex-wrap gap-x-24 gap-y-4",
1723
+ children: o.map(([t, n]) => /* @__PURE__ */ W("div", {
1724
+ className: "flex min-h-22 items-baseline gap-8",
1725
+ children: [/* @__PURE__ */ U("dt", {
1726
+ className: "text-small text-fg-tertiary",
1727
+ children: n
1728
+ }), /* @__PURE__ */ U("dd", {
1729
+ className: "text-small text-fg tabular",
1730
+ children: a ? i(a[t], 1) : /* @__PURE__ */ U("span", {
1731
+ "aria-hidden": !0,
1732
+ className: e("inline-block h-12 w-40 rounded-pill bg-fill-1", Vt)
1733
+ })
1734
+ })]
1735
+ }, t))
1736
+ })]
1737
+ });
1738
+ }
1739
+ function Kt({ question: n, index: r, answer: i, pending: a, image: o, maxBars: c, showInstructions: l }) {
1740
+ let u = t(), d = s(), { formatNumber: f } = d, p = L(), m = n.kind, h = i && (i.kind === m || i.kind === "refusal") ? i : void 0, g = h?.kind === "refusal" ? h : void 0, _ = !!h && !g, v = h && h.kind !== "refusal" && typeof h.confidence == "number" && Number.isFinite(h.confidence) ? h.confidence : void 0, y = l ? n.instructions?.trim() : void 0, b, x, S = "options";
1741
+ if (m === "predicate") {
1742
+ let e = h?.kind === "predicate" && Number.isFinite(h.probability) ? Wt(h.probability) : void 0;
1743
+ x = [{
1744
+ label: u("decisionResponse.yes", "Yes"),
1745
+ value: e,
1746
+ highlight: e !== void 0 && e >= .5
1747
+ }, {
1748
+ label: u("decisionResponse.no", "No"),
1749
+ value: e === void 0 ? void 0 : 1 - e,
1750
+ highlight: e !== void 0 && e < .5
1751
+ }];
1752
+ } else if (m === "choice") {
1753
+ let e = n.options ?? [], t = h?.kind === "choice" ? h.option : void 0, r = h?.kind === "choice" ? h.probabilities ?? [] : [];
1754
+ x = e.map((e, n) => ({
1755
+ label: Lt(u, e, n),
1756
+ value: r[n],
1757
+ highlight: n === t
1758
+ }));
1759
+ } else if (m === "score") {
1760
+ S = "levels";
1761
+ let e = n.levels ?? [], t = h?.kind === "score" && Number.isFinite(h.score) ? h.score : void 0, r = h?.kind === "score" ? h.probabilities ?? [] : [], i = t === void 0 ? void 0 : Math.max(0, Math.min(e.length - 1, Math.round(t)));
1762
+ t !== void 0 && (b = {
1763
+ value: f(t, { maximumFractionDigits: 2 }),
1764
+ max: f(Math.max(0, e.length - 1)),
1765
+ level: i === void 0 ? void 0 : e[i]?.label?.trim() || void 0
1766
+ }), x = e.map((e, t) => ({
1767
+ label: Rt(u, e, t),
1768
+ value: r[t],
1769
+ highlight: t === i
1770
+ }));
1771
+ }
1772
+ let C = /* @__PURE__ */ W("span", {
1773
+ className: "flex shrink-0 items-baseline gap-12 text-small text-fg-tertiary",
1774
+ children: [v !== void 0 && /* @__PURE__ */ U("span", {
1775
+ className: "tabular",
1776
+ children: u("decisionResponse.confidence", "Confidence {percent}", { percent: Mt(Wt(v), u, d) })
1777
+ }), /* @__PURE__ */ U("span", { children: Ft(u, m) })]
1778
+ });
1779
+ return /* @__PURE__ */ W("li", {
1780
+ className: "flex min-w-0 flex-col gap-12 px-12 py-16 not-first:hairline-t first:pt-0 last:pb-0",
1781
+ "aria-labelledby": p,
1782
+ "data-kind": m,
1783
+ "data-refused": g ? "" : void 0,
1784
+ children: [/* @__PURE__ */ W("div", {
1785
+ className: "flex min-w-0 flex-col gap-4",
1786
+ children: [/* @__PURE__ */ W("div", {
1787
+ className: "flex min-w-0 flex-wrap items-baseline justify-between gap-x-12 gap-y-4",
1788
+ children: [/* @__PURE__ */ U("span", {
1789
+ id: p,
1790
+ className: "min-w-0 text-body font-medium text-fg wrap-anywhere",
1791
+ children: It(u, n, r)
1792
+ }), C]
1793
+ }), y && /* @__PURE__ */ U("span", {
1794
+ className: "max-w-prose text-small text-fg-secondary wrap-break-word",
1795
+ children: y
1796
+ })]
1797
+ }), g ? /* @__PURE__ */ W("div", {
1798
+ className: "flex min-h-22 flex-col gap-4",
1799
+ children: [/* @__PURE__ */ U("span", {
1800
+ className: "text-body text-fg-secondary",
1801
+ children: u("decisionResponse.refused", "Refused: the model declined to answer this question")
1802
+ }), g.reason && /* @__PURE__ */ U("span", {
1803
+ className: "text-small text-fg-tertiary wrap-anywhere",
1804
+ children: g.reason
1805
+ })]
1806
+ }) : !a && !_ ? /* @__PURE__ */ U("span", {
1807
+ className: "flex min-h-22 items-center text-body text-fg-tertiary",
1808
+ children: u("decisionResponse.noAnswer", "No answer")
1809
+ }) : /* @__PURE__ */ W(H, { children: [
1810
+ m === "score" && /* @__PURE__ */ U("div", {
1811
+ className: "flex min-h-22 items-baseline",
1812
+ children: a || !b ? /* @__PURE__ */ U("span", {
1813
+ "aria-hidden": !0,
1814
+ className: e("h-12 w-120 self-center rounded-pill bg-fill-1", Vt)
1815
+ }) : /* @__PURE__ */ U("span", {
1816
+ className: "min-w-0 text-body text-fg tabular wrap-anywhere",
1817
+ children: b.level ? u("decisionResponse.scoreNear", "{score} of {max}, nearest {level}", {
1818
+ score: b.value,
1819
+ max: b.max,
1820
+ level: b.level
1821
+ }) : u("decisionResponse.score", "{score} of {max}", {
1822
+ score: b.value,
1823
+ max: b.max
1824
+ })
1825
+ })
1826
+ }),
1827
+ m === "box" && /* @__PURE__ */ U(Gt, {
1828
+ answer: h?.kind === "box" ? h : void 0,
1829
+ image: o,
1830
+ t: u
1831
+ }),
1832
+ x && x.length > 0 && /* @__PURE__ */ U(Ut, {
1833
+ bars: x,
1834
+ pending: a,
1835
+ max: c,
1836
+ unit: S,
1837
+ t: u
1838
+ })
1839
+ ] })]
1840
+ });
1841
+ }
1842
+ var qt = /* @__PURE__ */ P(function({ questions: n, answers: i = [], status: a = "done", image: o, maxBars: s = 8, showInstructions: l = !1, error: u, onRetry: d, footer: f, "aria-label": p, className: m }, h) {
1843
+ let g = t(), _ = p ?? g("responseView.response", "Response"), v = a === "pending", y = L(), b = B(a), [x, S] = V("");
1844
+ I(() => {
1845
+ let e = b.current;
1846
+ b.current = a, v ? S("") : e === "pending" && a === "done" && S(g("responseView.endedDone", "{label} finished", { label: _ }));
1847
+ }, [
1848
+ a,
1849
+ v,
1850
+ _,
1851
+ g
1852
+ ]);
1853
+ let C = f != null, w = Math.max(1, Math.floor(s));
1854
+ return /* @__PURE__ */ W("article", {
1855
+ ref: h,
1856
+ "aria-label": _,
1857
+ "aria-busy": v || void 0,
1858
+ ...v ? { "aria-describedby": y } : {},
1859
+ className: e("flex min-w-0 flex-col gap-16", m),
1860
+ children: [
1861
+ a === "error" ? /* @__PURE__ */ W("div", {
1862
+ className: "flex flex-col items-start gap-8 px-12",
1863
+ children: [/* @__PURE__ */ W("div", {
1864
+ role: "alert",
1865
+ className: "flex min-w-0 flex-col gap-4",
1866
+ children: [/* @__PURE__ */ U("span", {
1867
+ className: "text-small font-medium text-fg",
1868
+ children: g("decisionResponse.failed", "No answers")
1869
+ }), u && /* @__PURE__ */ U(c, {
1870
+ text: u,
1871
+ size: "small",
1872
+ tone: "secondary",
1873
+ className: "max-w-prose min-w-0"
1874
+ })]
1875
+ }), d && /* @__PURE__ */ U(r, {
1876
+ size: "sm",
1877
+ variant: "secondary",
1878
+ onClick: d,
1879
+ children: g("responseView.retry", "Retry")
1880
+ })]
1881
+ }) : /* @__PURE__ */ U("ol", {
1882
+ className: "flex min-w-0 flex-col",
1883
+ children: n.map((e, t) => /* @__PURE__ */ U(Kt, {
1884
+ question: e,
1885
+ index: t,
1886
+ answer: v ? void 0 : i[t],
1887
+ pending: v,
1888
+ image: o,
1889
+ maxBars: w,
1890
+ showInstructions: l
1891
+ }, e.id ?? t))
1892
+ }),
1893
+ v && /* @__PURE__ */ U("p", {
1894
+ id: y,
1895
+ className: "sr-only",
1896
+ children: g("decisionResponse.waiting", "Waiting for the answers")
1897
+ }),
1898
+ (C || a === "done" && d) && /* @__PURE__ */ W("div", {
1899
+ className: "flex min-h-32 min-w-0 flex-wrap items-center gap-x-4 gap-y-4",
1900
+ children: [a === "done" && d && /* @__PURE__ */ U("span", {
1901
+ "data-reply-actions": "",
1902
+ className: "flex items-center gap-x-4 transition-arrive reduced:transition-none starting:-ml-36 starting:opacity-0",
1903
+ children: /* @__PURE__ */ U(r, {
1904
+ size: "sm",
1905
+ variant: "quiet",
1906
+ icon: q,
1907
+ "aria-label": g("responseView.retry", "Retry"),
1908
+ onClick: d
1909
+ })
1910
+ }), C && /* @__PURE__ */ U("div", {
1911
+ className: e("min-w-0", a === "done" && d ? "px-8" : "px-12"),
1912
+ children: f
1913
+ })]
1914
+ }),
1915
+ /* @__PURE__ */ U("span", {
1916
+ role: "status",
1917
+ className: "sr-only",
1918
+ children: x
1919
+ })
1920
+ ]
1921
+ });
1922
+ });
1923
+ process.env.NODE_ENV !== "production" && (qt.displayName = "DecisionResponse");
1924
+ // src/components/playground/decision-questions.tsx
1925
+ var Jt = { layout: { list: { classes: "" } } }, Yt = { layout: "list" };
1926
+ function Xt(e, t, n) {
1927
+ switch (e.kind) {
1928
+ case "predicate": {
1929
+ let n = e.whenTrue?.trim(), r = e.whenFalse?.trim();
1930
+ return !n && !r ? [] : [{
1931
+ key: "yes",
1932
+ term: t("decisionResponse.yes", "Yes"),
1933
+ mono: !1,
1934
+ description: n
1935
+ }, {
1936
+ key: "no",
1937
+ term: t("decisionResponse.no", "No"),
1938
+ mono: !1,
1939
+ description: r
1940
+ }];
1941
+ }
1942
+ case "choice": return (e.options ?? []).map((e, n) => ({
1943
+ key: `o${n}`,
1944
+ term: Lt(t, e, n),
1945
+ mono: !!e.value.trim(),
1946
+ description: e.description?.trim() || void 0
1947
+ }));
1948
+ case "score": return (e.levels ?? []).map((e, t) => {
1949
+ let r = e.label?.trim(), i = e.description?.trim();
1950
+ return {
1951
+ key: `l${t}`,
1952
+ term: n(t),
1953
+ mono: !1,
1954
+ description: [r, i].filter(Boolean).join(": ") || void 0
1955
+ };
1956
+ });
1957
+ case "box": return [];
1958
+ }
1959
+ }
1960
+ function Zt({ question: n, index: r }) {
1961
+ let i = t(), { formatNumber: a } = s(), o = L(), c = n.instructions?.trim(), l = Xt(n, i, (e) => a(e)), u = n.kind === "choice" ? i("decisionQuestions.options", "{count, plural, one {# option} other {# options}}", { count: l.length }) : n.kind === "score" ? i("decisionQuestions.levels", "{count, plural, one {# level} other {# levels}}", { count: l.length }) : void 0;
1962
+ return /* @__PURE__ */ W("li", {
1963
+ className: "flex min-w-0 flex-col gap-12 px-12 py-16 not-first:hairline-t first:pt-0 last:pb-0",
1964
+ "aria-labelledby": o,
1965
+ "data-kind": n.kind,
1966
+ children: [/* @__PURE__ */ W("div", {
1967
+ className: "flex min-w-0 flex-col gap-4",
1968
+ children: [/* @__PURE__ */ W("div", {
1969
+ className: "flex min-w-0 flex-wrap items-baseline justify-between gap-x-12 gap-y-4",
1970
+ children: [/* @__PURE__ */ U("span", {
1971
+ id: o,
1972
+ className: "min-w-0 text-body font-medium text-fg wrap-anywhere",
1973
+ children: It(i, n, r)
1974
+ }), /* @__PURE__ */ W("span", {
1975
+ className: "flex shrink-0 items-baseline gap-12 text-small text-fg-tertiary",
1976
+ children: [u && /* @__PURE__ */ U("span", {
1977
+ className: "tabular",
1978
+ children: u
1979
+ }), /* @__PURE__ */ U("span", { children: Ft(i, n.kind) })]
1980
+ })]
1981
+ }), c ? /* @__PURE__ */ U("span", {
1982
+ className: "max-w-prose text-body text-fg-secondary wrap-break-word whitespace-pre-line",
1983
+ children: c
1984
+ }) : /* @__PURE__ */ U("span", {
1985
+ className: "text-body text-fg-tertiary",
1986
+ children: i("decisionQuestions.noInstructions", "No instructions")
1987
+ })]
1988
+ }), l.length > 0 && /* @__PURE__ */ U("dl", {
1989
+ className: "grid min-w-0 grid-cols-term gap-x-16 gap-y-6",
1990
+ children: l.map((t) => /* @__PURE__ */ W("div", {
1991
+ className: "col-span-full grid min-h-22 grid-cols-subgrid items-baseline",
1992
+ children: [/* @__PURE__ */ U("dt", {
1993
+ className: e("min-w-0 text-small text-fg wrap-anywhere", t.mono ? "font-mono" : "tabular font-medium"),
1994
+ children: t.term
1995
+ }), /* @__PURE__ */ U("dd", {
1996
+ className: e("min-w-0 text-small wrap-break-word", t.description ? "text-fg-secondary" : "text-fg-tertiary"),
1997
+ children: t.description ?? i("decisionQuestions.noDescription", "No description")
1998
+ })]
1999
+ }, t.key))
2000
+ })]
2001
+ });
2002
+ }
2003
+ var Qt = /* @__PURE__ */ P(function({ questions: n, layout: r = "list", "aria-label": i, className: a }, o) {
2004
+ let s = t();
2005
+ return /* @__PURE__ */ U("ol", {
2006
+ ref: o,
2007
+ "aria-label": i ?? s("decisionQuestions.label", "Questions"),
2008
+ className: e("flex min-w-0 flex-col", Jt.layout[r].classes, a),
2009
+ children: n.map((e, t) => /* @__PURE__ */ U(Zt, {
2010
+ question: e,
2011
+ index: t
2012
+ }, e.id ?? t))
2013
+ });
2014
+ });
2015
+ process.env.NODE_ENV !== "production" && (Qt.displayName = "DecisionQuestions");
2016
+ // src/components/playground/question-editor.tsx
2017
+ var $t = { layout: {
2018
+ panel: { classes: "gap-24" },
2019
+ compact: { classes: "gap-16" }
2020
+ } }, en = { layout: "panel" }, tn = 2, nn = 3;
2021
+ function rn(e) {
2022
+ return e === "" ? void 0 : e;
2023
+ }
2024
+ function an(e, t) {
2025
+ let n = {
2026
+ ...e,
2027
+ kind: t
2028
+ };
2029
+ return t === "choice" && !e.options?.length && (n.options = Array.from({ length: tn }, () => ({ value: "" }))), t === "score" && !e.levels?.length && (n.levels = Array.from({ length: nn }, () => ({}))), n;
2030
+ }
2031
+ function on(e, t, n) {
2032
+ return [
2033
+ "predicate",
2034
+ "choice",
2035
+ "score",
2036
+ "box"
2037
+ ].filter((e) => e !== "box" || t || n === "box").map((t) => ({
2038
+ value: t,
2039
+ label: Ft(e, t)
2040
+ }));
2041
+ }
2042
+ function sn({ rows: e, idOf: t, min: n, max: i, disabled: a, first: o, second: s, removeLabel: c, addLabel: l, limitText: u, onChange: d, onFocus: f, make: m, setFirst: h, setSecond: g }) {
2043
+ let _ = e.length >= i, v = (n) => {
2044
+ _ || (d([
2045
+ ...e.slice(0, n),
2046
+ m(),
2047
+ ...e.slice(n)
2048
+ ]), f(t(n)));
2049
+ }, y = (n) => {
2050
+ d(e.filter((e, t) => t !== n)), f(t(Math.max(0, n - 1)));
2051
+ }, b = (e) => (t) => {
2052
+ t.key !== "Enter" || t.nativeEvent.isComposing || (t.preventDefault(), v(e + 1));
2053
+ };
2054
+ return /* @__PURE__ */ W("div", {
2055
+ className: "flex flex-col gap-8",
2056
+ children: [/* @__PURE__ */ U("ul", {
2057
+ className: "flex flex-col gap-16 sm:gap-8",
2058
+ children: e.map((i, l) => {
2059
+ let u = o(i, l), f = s(i, l);
2060
+ return /* @__PURE__ */ W("li", {
2061
+ className: "flex min-w-0 items-start gap-8",
2062
+ children: [/* @__PURE__ */ W("div", {
2063
+ className: "grid min-w-0 flex-1 grid-cols-1 gap-8 sm:grid-cols-2",
2064
+ children: [/* @__PURE__ */ U(p, {
2065
+ id: t(l),
2066
+ size: "sm",
2067
+ "aria-label": u.label,
2068
+ placeholder: u.placeholder,
2069
+ value: u.value,
2070
+ disabled: a,
2071
+ onChange: (t) => d(e.map((e, n) => n === l ? h(e, t.target.value) : e)),
2072
+ onKeyDown: b(l)
2073
+ }), /* @__PURE__ */ U(p, {
2074
+ size: "sm",
2075
+ "aria-label": f.label,
2076
+ placeholder: f.placeholder,
2077
+ value: f.value,
2078
+ disabled: a,
2079
+ onChange: (t) => d(e.map((e, n) => n === l ? g(e, t.target.value) : e))
2080
+ })]
2081
+ }), /* @__PURE__ */ U(r, {
2082
+ size: "sm",
2083
+ variant: "ghost",
2084
+ icon: ue,
2085
+ "aria-label": c(l),
2086
+ disabled: a || e.length <= n,
2087
+ onClick: () => y(l)
2088
+ })]
2089
+ }, l);
2090
+ })
2091
+ }), /* @__PURE__ */ W("div", {
2092
+ className: "flex min-h-32 flex-wrap items-center gap-x-12 gap-y-4",
2093
+ children: [/* @__PURE__ */ U(r, {
2094
+ size: "sm",
2095
+ variant: "secondary",
2096
+ leadingIcon: oe,
2097
+ disabled: a || _,
2098
+ onClick: () => v(e.length),
2099
+ children: l
2100
+ }), _ && /* @__PURE__ */ U("span", {
2101
+ className: "text-small text-fg-tertiary",
2102
+ children: u
2103
+ })]
2104
+ })]
2105
+ });
2106
+ }
2107
+ var cn = /* @__PURE__ */ P(function({ value: n, onValueChange: i, allowBox: a = !1, maxQuestions: o = Infinity, maxOptions: s = 255, maxLevels: c = 10, disabled: l = !1, layout: u = "panel", "aria-label": d, className: f }, m) {
2108
+ let g = t(), _ = L(), v = B(0), [b, x] = V(null);
2109
+ I(() => {
2110
+ b && (document.getElementById(b)?.focus(), x(null));
2111
+ }, [b, n]);
2112
+ let S = (e, t) => e.id ?? `${_}-i${t}`, C = (e, t) => i(n.map((n, r) => r === e ? t : n)), w = () => {
2113
+ if (n.length >= o) return;
2114
+ v.current += 1;
2115
+ let e = `${_}-q${v.current}`;
2116
+ i([...n, {
2117
+ id: e,
2118
+ kind: "predicate"
2119
+ }]), x(`${e}-name`);
2120
+ }, T = (e) => {
2121
+ let t = n.filter((t, n) => n !== e);
2122
+ i(t);
2123
+ let r = t[Math.min(e, t.length - 1)];
2124
+ x(r ? `${S(r, Math.min(e, t.length - 1))}-remove` : `${_}-add`);
2125
+ };
2126
+ return /* @__PURE__ */ W("div", {
2127
+ ref: m,
2128
+ role: "group",
2129
+ "aria-label": d ?? g("questionEditor.label", "Questions"),
2130
+ className: e("flex min-w-0 flex-col", $t.layout[u].classes, f),
2131
+ children: [
2132
+ n.length === 0 && /* @__PURE__ */ U("p", {
2133
+ className: "text-body text-fg-secondary",
2134
+ children: g("questionEditor.empty", "No questions yet. Add one to ask the model something it answers with probabilities.")
2135
+ }),
2136
+ n.length > 0 && /* @__PURE__ */ U("ol", {
2137
+ className: e("flex min-w-0 flex-col", $t.layout[u].classes),
2138
+ children: n.map((t, n) => {
2139
+ let i = S(t, n), o = It(g, t, n), d = `${i}-head`;
2140
+ return /* @__PURE__ */ W("li", {
2141
+ className: e("flex min-w-0 flex-col", $t.layout[u].classes),
2142
+ children: [n > 0 && /* @__PURE__ */ U(ee, { "aria-hidden": !0 }), /* @__PURE__ */ W("fieldset", {
2143
+ "aria-labelledby": d,
2144
+ className: "flex min-w-0 flex-col gap-12",
2145
+ disabled: l,
2146
+ children: [
2147
+ /* @__PURE__ */ W("div", {
2148
+ className: "flex min-h-32 min-w-0 items-center justify-between gap-12",
2149
+ children: [/* @__PURE__ */ U("span", {
2150
+ id: d,
2151
+ className: "min-w-0 text-body font-medium text-fg wrap-anywhere",
2152
+ children: o
2153
+ }), /* @__PURE__ */ U(r, {
2154
+ id: `${i}-remove`,
2155
+ size: "sm",
2156
+ variant: "ghost",
2157
+ icon: ue,
2158
+ "aria-label": g("questionEditor.removeQuestion", "Remove {name}", { name: o }),
2159
+ disabled: l,
2160
+ onClick: () => T(n)
2161
+ })]
2162
+ }),
2163
+ /* @__PURE__ */ W("div", {
2164
+ className: "grid min-w-0 grid-cols-1 gap-12 sm:grid-cols-2",
2165
+ children: [/* @__PURE__ */ U(y, {
2166
+ label: g("questionEditor.kind", "Type"),
2167
+ value: t.kind,
2168
+ options: on(g, a, t.kind),
2169
+ disabled: l,
2170
+ fullWidth: !0,
2171
+ onValueChange: (e) => C(n, an(t, e))
2172
+ }), /* @__PURE__ */ U(p, {
2173
+ id: `${i}-name`,
2174
+ label: g("questionEditor.name", "Name"),
2175
+ placeholder: g("questionEditor.namePlaceholder", "is_invoice"),
2176
+ value: t.name ?? "",
2177
+ disabled: l,
2178
+ onChange: (e) => C(n, {
2179
+ ...t,
2180
+ name: rn(e.target.value)
2181
+ })
2182
+ })]
2183
+ }),
2184
+ /* @__PURE__ */ U(h, {
2185
+ label: g("questionEditor.instructions", "Instructions"),
2186
+ placeholder: g("questionEditor.instructionsPlaceholder", "What the model should decide, in a sentence"),
2187
+ rows: 2,
2188
+ value: t.instructions ?? "",
2189
+ disabled: l,
2190
+ onChange: (e) => C(n, {
2191
+ ...t,
2192
+ instructions: rn(e.target.value)
2193
+ })
2194
+ }),
2195
+ t.kind === "predicate" && /* @__PURE__ */ W("div", {
2196
+ className: "grid min-w-0 grid-cols-1 gap-12 sm:grid-cols-2",
2197
+ children: [/* @__PURE__ */ U(p, {
2198
+ label: g("questionEditor.whenTrue", "What yes means"),
2199
+ value: t.whenTrue ?? "",
2200
+ disabled: l,
2201
+ onChange: (e) => C(n, {
2202
+ ...t,
2203
+ whenTrue: rn(e.target.value)
2204
+ })
2205
+ }), /* @__PURE__ */ U(p, {
2206
+ label: g("questionEditor.whenFalse", "What no means"),
2207
+ value: t.whenFalse ?? "",
2208
+ disabled: l,
2209
+ onChange: (e) => C(n, {
2210
+ ...t,
2211
+ whenFalse: rn(e.target.value)
2212
+ })
2213
+ })]
2214
+ }),
2215
+ t.kind === "choice" && /* @__PURE__ */ W("div", {
2216
+ role: "group",
2217
+ "aria-labelledby": `${i}-options`,
2218
+ className: "flex min-w-0 flex-col gap-8",
2219
+ children: [/* @__PURE__ */ U("span", {
2220
+ id: `${i}-options`,
2221
+ className: "text-body font-medium text-fg",
2222
+ children: g("questionEditor.options", "Options")
2223
+ }), /* @__PURE__ */ U(sn, {
2224
+ rows: t.options ?? [],
2225
+ idOf: (e) => `${i}-option-${e}`,
2226
+ min: tn,
2227
+ max: s,
2228
+ disabled: l,
2229
+ first: (e, t) => ({
2230
+ value: e.value,
2231
+ label: g("questionEditor.optionValue", "Option {n}", { n: t + 1 }),
2232
+ placeholder: g("questionEditor.optionPlaceholder", "Value")
2233
+ }),
2234
+ second: (e, t) => ({
2235
+ value: e.description ?? "",
2236
+ label: g("questionEditor.optionDescription", "What option {n} means", { n: t + 1 }),
2237
+ placeholder: g("questionEditor.descriptionPlaceholder", "What it means")
2238
+ }),
2239
+ removeLabel: (e) => g("questionEditor.removeOption", "Remove option {n}", { n: e + 1 }),
2240
+ addLabel: g("questionEditor.addOption", "Add option"),
2241
+ limitText: g("questionEditor.optionLimit", "{max, plural, one {Up to # option} other {Up to # options}}", { max: s }),
2242
+ onChange: (e) => C(n, {
2243
+ ...t,
2244
+ options: e
2245
+ }),
2246
+ onFocus: x,
2247
+ make: () => ({ value: "" }),
2248
+ setFirst: (e, t) => ({
2249
+ ...e,
2250
+ value: t
2251
+ }),
2252
+ setSecond: (e, t) => ({
2253
+ ...e,
2254
+ description: rn(t)
2255
+ })
2256
+ })]
2257
+ }),
2258
+ t.kind === "score" && /* @__PURE__ */ W("div", {
2259
+ role: "group",
2260
+ "aria-labelledby": `${i}-levels`,
2261
+ className: "flex min-w-0 flex-col gap-8",
2262
+ children: [/* @__PURE__ */ U("span", {
2263
+ id: `${i}-levels`,
2264
+ className: "text-body font-medium text-fg",
2265
+ children: g("questionEditor.levels", "Levels, from 0 up")
2266
+ }), /* @__PURE__ */ U(sn, {
2267
+ rows: t.levels ?? [],
2268
+ idOf: (e) => `${i}-level-${e}`,
2269
+ min: tn,
2270
+ max: c,
2271
+ disabled: l,
2272
+ first: (e, t) => ({
2273
+ value: e.label ?? "",
2274
+ label: g("questionEditor.levelLabel", "Label of level {n}", { n: t }),
2275
+ placeholder: Rt(g, void 0, t)
2276
+ }),
2277
+ second: (e, t) => ({
2278
+ value: e.description ?? "",
2279
+ label: g("questionEditor.levelDescription", "What level {n} means", { n: t }),
2280
+ placeholder: g("questionEditor.descriptionPlaceholder", "What it means")
2281
+ }),
2282
+ removeLabel: (e) => g("questionEditor.removeLevel", "Remove level {n}", { n: e }),
2283
+ addLabel: g("questionEditor.addLevel", "Add level"),
2284
+ limitText: g("questionEditor.levelLimit", "{max, plural, one {Up to # level} other {Up to # levels}}", { max: c }),
2285
+ onChange: (e) => C(n, {
2286
+ ...t,
2287
+ levels: e
2288
+ }),
2289
+ onFocus: x,
2290
+ make: () => ({}),
2291
+ setFirst: (e, t) => ({
2292
+ ...e,
2293
+ label: rn(t)
2294
+ }),
2295
+ setSecond: (e, t) => ({
2296
+ ...e,
2297
+ description: rn(t)
2298
+ })
2299
+ })]
2300
+ }),
2301
+ t.kind === "box" && /* @__PURE__ */ U("p", {
2302
+ className: "text-small text-fg-secondary",
2303
+ children: g("questionEditor.boxHint", "The model answers with a box around what the instructions describe, on the image sent with the state.")
2304
+ })
2305
+ ]
2306
+ })]
2307
+ }, i);
2308
+ })
2309
+ }),
2310
+ /* @__PURE__ */ W("div", {
2311
+ className: "flex min-h-36 flex-wrap items-center gap-x-12 gap-y-4",
2312
+ children: [/* @__PURE__ */ U(r, {
2313
+ id: `${_}-add`,
2314
+ variant: "secondary",
2315
+ leadingIcon: oe,
2316
+ disabled: l || n.length >= o,
2317
+ onClick: w,
2318
+ children: g("questionEditor.addQuestion", "Add question")
2319
+ }), n.length >= o && /* @__PURE__ */ U("span", {
2320
+ className: "text-small text-fg-tertiary",
2321
+ children: g("questionEditor.questionLimit", "{max, plural, one {Up to # question} other {Up to # questions}}", { max: o })
2322
+ })]
2323
+ })
2324
+ ]
2325
+ });
1571
2326
  });
1572
- process.env.NODE_ENV !== "production" && (Ot.displayName = "ModelPicker");
1573
- //#endregion
1574
- export { ge as Attachments, Ue as CompareGrid, we as Composer, me as KAESO_ATTACHMENTS_DEFAULT_VARIANTS, pe as KAESO_ATTACHMENTS_VARIANTS, Fe as KAESO_COMPARE_GRID_DEFAULT_VARIANTS, Pe as KAESO_COMPARE_GRID_VARIANTS, ve as KAESO_COMPOSER_DEFAULT_VARIANTS, _e as KAESO_COMPOSER_VARIANTS, Ee as KAESO_MEDIA_RESPONSE_DEFAULT_VARIANTS, Te as KAESO_MEDIA_RESPONSE_VARIANTS, bt as KAESO_MODEL_PICKER_DEFAULT_VARIANTS, yt as KAESO_MODEL_PICKER_VARIANTS, ut as KAESO_PARAMETER_PANEL_DEFAULT_VARIANTS, lt as KAESO_PARAMETER_PANEL_VARIANTS, Ge as KAESO_REASONING_DEFAULT_VARIANTS, We as KAESO_REASONING_VARIANTS, rt as KAESO_RESPONSE_METRICS_DEFAULT_VARIANTS, nt as KAESO_RESPONSE_METRICS_VARIANTS, Ye as KAESO_RESPONSE_VIEW_DEFAULT_VARIANTS, Je as KAESO_RESPONSE_VIEW_VARIANTS, Ne as MediaResponse, Ot as ModelPicker, _t as ParameterPanel, qe as Reasoning, ct as ResponseMetrics, Qe as ResponseView, tt as Thread, et as UserMessage, it as formatLatency, Dt as useModelGroups };
2327
+ process.env.NODE_ENV !== "production" && (cn.displayName = "QuestionEditor");
2328
+ export { _e as Attachments, We as CompareGrid, Te as Composer, Qt as DecisionQuestions, qt as DecisionResponse, he as KAESO_ATTACHMENTS_DEFAULT_VARIANTS, me as KAESO_ATTACHMENTS_VARIANTS, Ie as KAESO_COMPARE_GRID_DEFAULT_VARIANTS, Fe as KAESO_COMPARE_GRID_VARIANTS, ye as KAESO_COMPOSER_DEFAULT_VARIANTS, ve as KAESO_COMPOSER_VARIANTS, Yt as KAESO_DECISION_QUESTIONS_DEFAULT_VARIANTS, Jt as KAESO_DECISION_QUESTIONS_VARIANTS, Bt as KAESO_DECISION_RESPONSE_DEFAULT_VARIANTS, zt as KAESO_DECISION_RESPONSE_VARIANTS, De as KAESO_MEDIA_RESPONSE_DEFAULT_VARIANTS, Ee as KAESO_MEDIA_RESPONSE_VARIANTS, xt as KAESO_MODEL_PICKER_DEFAULT_VARIANTS, bt as KAESO_MODEL_PICKER_VARIANTS, dt as KAESO_PARAMETER_PANEL_DEFAULT_VARIANTS, ut as KAESO_PARAMETER_PANEL_VARIANTS, jt as KAESO_PROBABILITY_BAR_DEFAULT_VARIANTS, At as KAESO_PROBABILITY_BAR_VARIANTS, en as KAESO_QUESTION_EDITOR_DEFAULT_VARIANTS, $t as KAESO_QUESTION_EDITOR_VARIANTS, Ke as KAESO_REASONING_DEFAULT_VARIANTS, Ge as KAESO_REASONING_VARIANTS, it as KAESO_RESPONSE_METRICS_DEFAULT_VARIANTS, rt as KAESO_RESPONSE_METRICS_VARIANTS, Xe as KAESO_RESPONSE_VIEW_DEFAULT_VARIANTS, Ye as KAESO_RESPONSE_VIEW_VARIANTS, Pe as MediaResponse, kt as ModelPicker, vt as ParameterPanel, Pt as ProbabilityBar, cn as QuestionEditor, Je as Reasoning, lt as ResponseMetrics, $e as ResponseView, nt as Thread, tt as UserMessage, at as formatLatency, Ot as useModelGroups };
1575
2329
 
1576
2330
  //# sourceMappingURL=playground.js.map