@snksergio/design-system 0.19.1 → 0.30.2

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 (248) hide show
  1. package/README.md +39 -12
  2. package/dist-lib/chunks/{app-shell-Cy9be0Zx.mjs → app-shell-78w0pYdP.mjs} +849 -79
  3. package/dist-lib/chunks/app-shell-78w0pYdP.mjs.map +1 -0
  4. package/dist-lib/chunks/{app-shell-CPx9X7zP.cjs → app-shell-Cyh8AUJT.cjs} +947 -176
  5. package/dist-lib/chunks/app-shell-Cyh8AUJT.cjs.map +1 -0
  6. package/dist-lib/chunks/{clientes-showcase-mocks-ayU1SDOA.mjs → clientes-showcase-mocks-CwWGCCmf.mjs} +1 -27
  7. package/dist-lib/chunks/clientes-showcase-mocks-CwWGCCmf.mjs.map +1 -0
  8. package/dist-lib/chunks/{clientes-showcase-mocks-DygUqkkh.cjs → clientes-showcase-mocks-CwhluBTT.cjs} +1 -44
  9. package/dist-lib/chunks/clientes-showcase-mocks-CwhluBTT.cjs.map +1 -0
  10. package/dist-lib/chunks/{input-BWevV7up.cjs → input-BjUSWce3.cjs} +24 -4
  11. package/dist-lib/chunks/input-BjUSWce3.cjs.map +1 -0
  12. package/dist-lib/chunks/{input-C9eKSSEb.mjs → input-DCDU4i4S.mjs} +23 -3
  13. package/dist-lib/chunks/input-DCDU4i4S.mjs.map +1 -0
  14. package/dist-lib/chunks/kpi-delta-C_3V6uG6.cjs +148 -0
  15. package/dist-lib/chunks/kpi-delta-C_3V6uG6.cjs.map +1 -0
  16. package/dist-lib/chunks/kpi-delta-DpYuDY4h.mjs +149 -0
  17. package/dist-lib/chunks/kpi-delta-DpYuDY4h.mjs.map +1 -0
  18. package/dist-lib/chunks/{page-header-CQbTGWQ8.mjs → page-header-B6XJyIMz.mjs} +2 -2
  19. package/dist-lib/chunks/{page-header-CQbTGWQ8.mjs.map → page-header-B6XJyIMz.mjs.map} +1 -1
  20. package/dist-lib/chunks/{page-header-BZ-WrxV2.cjs → page-header-D0rpU0yn.cjs} +4 -4
  21. package/dist-lib/chunks/{page-header-BZ-WrxV2.cjs.map → page-header-D0rpU0yn.cjs.map} +1 -1
  22. package/dist-lib/chunks/{panel-pOXMw6a-.cjs → panel-B_SSIEDs.cjs} +1876 -1067
  23. package/dist-lib/chunks/panel-B_SSIEDs.cjs.map +1 -0
  24. package/dist-lib/chunks/{panel-BCUixETK.mjs → panel-CEkyoGiO.mjs} +1639 -831
  25. package/dist-lib/chunks/panel-CEkyoGiO.mjs.map +1 -0
  26. package/dist-lib/index.cjs +3819 -230
  27. package/dist-lib/index.cjs.map +1 -1
  28. package/dist-lib/index.mjs +3898 -313
  29. package/dist-lib/index.mjs.map +1 -1
  30. package/dist-lib/preview/chat.cjs +41 -42
  31. package/dist-lib/preview/chat.cjs.map +1 -1
  32. package/dist-lib/preview/chat.mjs +2 -3
  33. package/dist-lib/preview/chat.mjs.map +1 -1
  34. package/dist-lib/preview/clientes.cjs +22 -24
  35. package/dist-lib/preview/clientes.cjs.map +1 -1
  36. package/dist-lib/preview/clientes.mjs +5 -7
  37. package/dist-lib/preview/clientes.mjs.map +1 -1
  38. package/dist-lib/preview/dashboard.cjs +232 -28
  39. package/dist-lib/preview/dashboard.cjs.map +1 -1
  40. package/dist-lib/preview/dashboard.mjs +215 -11
  41. package/dist-lib/preview/dashboard.mjs.map +1 -1
  42. package/dist-lib/preview/mocks.cjs +1 -1
  43. package/dist-lib/preview/mocks.mjs +1 -1
  44. package/dist-lib/src/components/index.d.ts +14 -0
  45. package/dist-lib/src/components/index.d.ts.map +1 -1
  46. package/dist-lib/src/components/shadcn/command.d.ts.map +1 -1
  47. package/dist-lib/src/components/shadcn/input.d.ts.map +1 -1
  48. package/dist-lib/src/components/shadcn/tabs.d.ts +11 -6
  49. package/dist-lib/src/components/shadcn/tabs.d.ts.map +1 -1
  50. package/dist-lib/src/components/shadcn/tooltip.d.ts +25 -7
  51. package/dist-lib/src/components/shadcn/tooltip.d.ts.map +1 -1
  52. package/dist-lib/src/components/ui/ChoroplethMap/choropleth-map.d.ts +13 -0
  53. package/dist-lib/src/components/ui/ChoroplethMap/choropleth-map.d.ts.map +1 -0
  54. package/dist-lib/src/components/ui/ChoroplethMap/choropleth-map.styles.d.ts +95 -0
  55. package/dist-lib/src/components/ui/ChoroplethMap/choropleth-map.styles.d.ts.map +1 -0
  56. package/dist-lib/src/components/ui/ChoroplethMap/choropleth-map.types.d.ts +81 -0
  57. package/dist-lib/src/components/ui/ChoroplethMap/choropleth-map.types.d.ts.map +1 -0
  58. package/dist-lib/src/components/ui/ChoroplethMap/index.d.ts +3 -0
  59. package/dist-lib/src/components/ui/ChoroplethMap/index.d.ts.map +1 -0
  60. package/dist-lib/src/components/ui/ColorPicker/color-picker.d.ts +16 -0
  61. package/dist-lib/src/components/ui/ColorPicker/color-picker.d.ts.map +1 -0
  62. package/dist-lib/src/components/ui/ColorPicker/color-picker.presets.d.ts +13 -0
  63. package/dist-lib/src/components/ui/ColorPicker/color-picker.presets.d.ts.map +1 -0
  64. package/dist-lib/src/components/ui/ColorPicker/color-picker.styles.d.ts +135 -0
  65. package/dist-lib/src/components/ui/ColorPicker/color-picker.styles.d.ts.map +1 -0
  66. package/dist-lib/src/components/ui/ColorPicker/color-picker.types.d.ts +35 -0
  67. package/dist-lib/src/components/ui/ColorPicker/color-picker.types.d.ts.map +1 -0
  68. package/dist-lib/src/components/ui/ColorPicker/index.d.ts +6 -0
  69. package/dist-lib/src/components/ui/ColorPicker/index.d.ts.map +1 -0
  70. package/dist-lib/src/components/ui/ConversationListItem/conversation-list-item.d.ts +23 -0
  71. package/dist-lib/src/components/ui/ConversationListItem/conversation-list-item.d.ts.map +1 -0
  72. package/dist-lib/src/components/ui/ConversationListItem/conversation-list-item.styles.d.ts +173 -0
  73. package/dist-lib/src/components/ui/ConversationListItem/conversation-list-item.styles.d.ts.map +1 -0
  74. package/dist-lib/src/components/ui/ConversationListItem/conversation-list-item.types.d.ts +59 -0
  75. package/dist-lib/src/components/ui/ConversationListItem/conversation-list-item.types.d.ts.map +1 -0
  76. package/dist-lib/src/components/ui/ConversationListItem/index.d.ts +5 -0
  77. package/dist-lib/src/components/ui/ConversationListItem/index.d.ts.map +1 -0
  78. package/dist-lib/src/components/ui/DataTable/data-table.d.ts.map +1 -1
  79. package/dist-lib/src/components/ui/DataTable/data-table.types.d.ts +14 -1
  80. package/dist-lib/src/components/ui/DataTable/data-table.types.d.ts.map +1 -1
  81. package/dist-lib/src/components/ui/DataTable/hooks/use-column-auto-width.d.ts +9 -0
  82. package/dist-lib/src/components/ui/DataTable/hooks/use-column-auto-width.d.ts.map +1 -1
  83. package/dist-lib/src/components/ui/DataTable/hooks/use-data-table-controller.d.ts.map +1 -1
  84. package/dist-lib/src/components/ui/DataTable/services/saved-views.types.d.ts +9 -0
  85. package/dist-lib/src/components/ui/DataTable/services/saved-views.types.d.ts.map +1 -1
  86. package/dist-lib/src/components/ui/DataTable/utils/calculate-column-widths.d.ts +16 -0
  87. package/dist-lib/src/components/ui/DataTable/utils/calculate-column-widths.d.ts.map +1 -1
  88. package/dist-lib/src/components/ui/DatePicker/datepicker.d.ts +31 -8
  89. package/dist-lib/src/components/ui/DatePicker/datepicker.d.ts.map +1 -1
  90. package/dist-lib/src/components/ui/DatePicker/index.d.ts +1 -1
  91. package/dist-lib/src/components/ui/DatePicker/index.d.ts.map +1 -1
  92. package/dist-lib/src/components/ui/DateSeparatorChip/date-separator-chip.d.ts +18 -0
  93. package/dist-lib/src/components/ui/DateSeparatorChip/date-separator-chip.d.ts.map +1 -0
  94. package/dist-lib/src/components/ui/DateSeparatorChip/date-separator-chip.styles.d.ts +63 -0
  95. package/dist-lib/src/components/ui/DateSeparatorChip/date-separator-chip.styles.d.ts.map +1 -0
  96. package/dist-lib/src/components/ui/DateSeparatorChip/date-separator-chip.types.d.ts +21 -0
  97. package/dist-lib/src/components/ui/DateSeparatorChip/date-separator-chip.types.d.ts.map +1 -0
  98. package/dist-lib/src/components/ui/DateSeparatorChip/index.d.ts +5 -0
  99. package/dist-lib/src/components/ui/DateSeparatorChip/index.d.ts.map +1 -0
  100. package/dist-lib/src/components/ui/EmptyState/empty-state.d.ts +12 -0
  101. package/dist-lib/src/components/ui/EmptyState/empty-state.d.ts.map +1 -0
  102. package/dist-lib/src/components/ui/EmptyState/empty-state.styles.d.ts +83 -0
  103. package/dist-lib/src/components/ui/EmptyState/empty-state.styles.d.ts.map +1 -0
  104. package/dist-lib/src/components/ui/EmptyState/empty-state.types.d.ts +43 -0
  105. package/dist-lib/src/components/ui/EmptyState/empty-state.types.d.ts.map +1 -0
  106. package/dist-lib/src/components/ui/EmptyState/index.d.ts +5 -0
  107. package/dist-lib/src/components/ui/EmptyState/index.d.ts.map +1 -0
  108. package/dist-lib/src/components/ui/FileUploadField/file-upload-field.d.ts +15 -0
  109. package/dist-lib/src/components/ui/FileUploadField/file-upload-field.d.ts.map +1 -0
  110. package/dist-lib/src/components/ui/FileUploadField/file-upload-field.styles.d.ts +66 -0
  111. package/dist-lib/src/components/ui/FileUploadField/file-upload-field.styles.d.ts.map +1 -0
  112. package/dist-lib/src/components/ui/FileUploadField/file-upload-field.types.d.ts +41 -0
  113. package/dist-lib/src/components/ui/FileUploadField/file-upload-field.types.d.ts.map +1 -0
  114. package/dist-lib/src/components/ui/FileUploadField/index.d.ts +3 -0
  115. package/dist-lib/src/components/ui/FileUploadField/index.d.ts.map +1 -0
  116. package/dist-lib/src/components/ui/Kpi/kpi-delta.d.ts +4 -1
  117. package/dist-lib/src/components/ui/Kpi/kpi-delta.d.ts.map +1 -1
  118. package/dist-lib/src/components/ui/Kpi/kpi.d.ts +1 -1
  119. package/dist-lib/src/components/ui/Kpi/kpi.d.ts.map +1 -1
  120. package/dist-lib/src/components/ui/Kpi/kpi.styles.d.ts +42 -0
  121. package/dist-lib/src/components/ui/Kpi/kpi.styles.d.ts.map +1 -1
  122. package/dist-lib/src/components/ui/Kpi/kpi.types.d.ts +13 -1
  123. package/dist-lib/src/components/ui/Kpi/kpi.types.d.ts.map +1 -1
  124. package/dist-lib/src/components/ui/MarkdownText/index.d.ts +5 -0
  125. package/dist-lib/src/components/ui/MarkdownText/index.d.ts.map +1 -0
  126. package/dist-lib/src/components/ui/MarkdownText/markdown-text.d.ts +14 -0
  127. package/dist-lib/src/components/ui/MarkdownText/markdown-text.d.ts.map +1 -0
  128. package/dist-lib/src/components/ui/MarkdownText/markdown-text.styles.d.ts +72 -0
  129. package/dist-lib/src/components/ui/MarkdownText/markdown-text.styles.d.ts.map +1 -0
  130. package/dist-lib/src/components/ui/MarkdownText/markdown-text.types.d.ts +26 -0
  131. package/dist-lib/src/components/ui/MarkdownText/markdown-text.types.d.ts.map +1 -0
  132. package/dist-lib/src/components/ui/MenuSidebar/sidebar-section.d.ts.map +1 -1
  133. package/dist-lib/src/components/ui/MenuSidebar/sidebar.styles.d.ts +1 -0
  134. package/dist-lib/src/components/ui/MenuSidebar/sidebar.styles.d.ts.map +1 -1
  135. package/dist-lib/src/components/ui/MenuSidebar/sidebar.types.d.ts +7 -1
  136. package/dist-lib/src/components/ui/MenuSidebar/sidebar.types.d.ts.map +1 -1
  137. package/dist-lib/src/components/ui/MessageAck/index.d.ts +5 -0
  138. package/dist-lib/src/components/ui/MessageAck/index.d.ts.map +1 -0
  139. package/dist-lib/src/components/ui/MessageAck/message-ack.d.ts +18 -0
  140. package/dist-lib/src/components/ui/MessageAck/message-ack.d.ts.map +1 -0
  141. package/dist-lib/src/components/ui/MessageAck/message-ack.styles.d.ts +61 -0
  142. package/dist-lib/src/components/ui/MessageAck/message-ack.styles.d.ts.map +1 -0
  143. package/dist-lib/src/components/ui/MessageAck/message-ack.types.d.ts +14 -0
  144. package/dist-lib/src/components/ui/MessageAck/message-ack.types.d.ts.map +1 -0
  145. package/dist-lib/src/components/ui/MessageBubble/index.d.ts +5 -0
  146. package/dist-lib/src/components/ui/MessageBubble/index.d.ts.map +1 -0
  147. package/dist-lib/src/components/ui/MessageBubble/message-bubble.d.ts +20 -0
  148. package/dist-lib/src/components/ui/MessageBubble/message-bubble.d.ts.map +1 -0
  149. package/dist-lib/src/components/ui/MessageBubble/message-bubble.styles.d.ts +180 -0
  150. package/dist-lib/src/components/ui/MessageBubble/message-bubble.styles.d.ts.map +1 -0
  151. package/dist-lib/src/components/ui/MessageBubble/message-bubble.types.d.ts +87 -0
  152. package/dist-lib/src/components/ui/MessageBubble/message-bubble.types.d.ts.map +1 -0
  153. package/dist-lib/src/components/ui/MessageComposer/index.d.ts +5 -0
  154. package/dist-lib/src/components/ui/MessageComposer/index.d.ts.map +1 -0
  155. package/dist-lib/src/components/ui/MessageComposer/message-composer.d.ts +18 -0
  156. package/dist-lib/src/components/ui/MessageComposer/message-composer.d.ts.map +1 -0
  157. package/dist-lib/src/components/ui/MessageComposer/message-composer.styles.d.ts +113 -0
  158. package/dist-lib/src/components/ui/MessageComposer/message-composer.styles.d.ts.map +1 -0
  159. package/dist-lib/src/components/ui/MessageComposer/message-composer.types.d.ts +49 -0
  160. package/dist-lib/src/components/ui/MessageComposer/message-composer.types.d.ts.map +1 -0
  161. package/dist-lib/src/components/ui/MessageVariablesPicker/index.d.ts +6 -0
  162. package/dist-lib/src/components/ui/MessageVariablesPicker/index.d.ts.map +1 -0
  163. package/dist-lib/src/components/ui/MessageVariablesPicker/message-variables-picker.d.ts +12 -0
  164. package/dist-lib/src/components/ui/MessageVariablesPicker/message-variables-picker.d.ts.map +1 -0
  165. package/dist-lib/src/components/ui/MessageVariablesPicker/message-variables-picker.styles.d.ts +57 -0
  166. package/dist-lib/src/components/ui/MessageVariablesPicker/message-variables-picker.styles.d.ts.map +1 -0
  167. package/dist-lib/src/components/ui/MessageVariablesPicker/message-variables-picker.types.d.ts +36 -0
  168. package/dist-lib/src/components/ui/MessageVariablesPicker/message-variables-picker.types.d.ts.map +1 -0
  169. package/dist-lib/src/components/ui/Modal/modal.d.ts +3 -1
  170. package/dist-lib/src/components/ui/Modal/modal.d.ts.map +1 -1
  171. package/dist-lib/src/components/ui/Modal/modal.styles.d.ts +7 -1
  172. package/dist-lib/src/components/ui/Modal/modal.styles.d.ts.map +1 -1
  173. package/dist-lib/src/components/ui/MonthYearPicker/index.d.ts +3 -0
  174. package/dist-lib/src/components/ui/MonthYearPicker/index.d.ts.map +1 -0
  175. package/dist-lib/src/components/ui/MonthYearPicker/month-year-picker.d.ts +11 -0
  176. package/dist-lib/src/components/ui/MonthYearPicker/month-year-picker.d.ts.map +1 -0
  177. package/dist-lib/src/components/ui/MonthYearPicker/month-year-picker.styles.d.ts +113 -0
  178. package/dist-lib/src/components/ui/MonthYearPicker/month-year-picker.styles.d.ts.map +1 -0
  179. package/dist-lib/src/components/ui/MonthYearPicker/month-year-picker.types.d.ts +34 -0
  180. package/dist-lib/src/components/ui/MonthYearPicker/month-year-picker.types.d.ts.map +1 -0
  181. package/dist-lib/src/components/ui/SingleMenuSidebar/single-menu-sidebar.styles.d.ts +1 -1
  182. package/dist-lib/src/components/ui/Spinner/index.d.ts +3 -0
  183. package/dist-lib/src/components/ui/Spinner/index.d.ts.map +1 -0
  184. package/dist-lib/src/components/ui/Spinner/spinner.d.ts +11 -0
  185. package/dist-lib/src/components/ui/Spinner/spinner.d.ts.map +1 -0
  186. package/dist-lib/src/components/ui/Spinner/spinner.styles.d.ts +55 -0
  187. package/dist-lib/src/components/ui/Spinner/spinner.styles.d.ts.map +1 -0
  188. package/dist-lib/src/components/ui/Spinner/spinner.types.d.ts +12 -0
  189. package/dist-lib/src/components/ui/Spinner/spinner.types.d.ts.map +1 -0
  190. package/dist-lib/src/components/ui/TableToolbar/parts/table-toolbar-views.d.ts +7 -1
  191. package/dist-lib/src/components/ui/TableToolbar/parts/table-toolbar-views.d.ts.map +1 -1
  192. package/dist-lib/src/components/ui/Toast/toast.d.ts +44 -0
  193. package/dist-lib/src/components/ui/Toast/toast.d.ts.map +1 -0
  194. package/dist-lib/src/hooks/useBrand.d.ts +31 -0
  195. package/dist-lib/src/hooks/useBrand.d.ts.map +1 -0
  196. package/dist-lib/src/preview/pages/ChatV2/components/QueueColumn/queue-column.styles.d.ts +3 -3
  197. package/dist-lib/src/preview/pages/ClientesShowcase/clientes-showcase-mocks.d.ts +1 -1
  198. package/dist-lib/src/preview/pages/ClientesShowcase/clientes-showcase-mocks.d.ts.map +1 -1
  199. package/dist-lib/src/preview/pages/ClientesShowcase/clientes-showcase.types.d.ts +1 -1
  200. package/dist-lib/src/preview/pages/ClientesShowcase/clientes-showcase.types.d.ts.map +1 -1
  201. package/dist-lib/src/preview/pages/ClientesShowcase/components/DetailDrawer/detail-drawer.types.d.ts +1 -1
  202. package/dist-lib/src/preview/pages/ClientesShowcase/components/DetailDrawer/detail-drawer.types.d.ts.map +1 -1
  203. package/dist-lib/src/preview/pages/DashboardShowcase.d.ts.map +1 -1
  204. package/dist-lib/src/preview/pages/_table-data.d.ts +51 -0
  205. package/dist-lib/src/preview/pages/_table-data.d.ts.map +1 -0
  206. package/dist-lib/src/utils/tv.d.ts.map +1 -1
  207. package/dist-lib/theme.css +32 -0
  208. package/dist-lib/tokens/brands/blue/primitives/color-palette.d.ts +266 -0
  209. package/dist-lib/tokens/brands/blue/primitives/color-palette.d.ts.map +1 -0
  210. package/dist-lib/tokens/brands/blue/semantic/color-dark.d.ts +200 -0
  211. package/dist-lib/tokens/brands/blue/semantic/color-dark.d.ts.map +1 -0
  212. package/dist-lib/tokens/brands/blue/semantic/color-light.d.ts +202 -0
  213. package/dist-lib/tokens/brands/blue/semantic/color-light.d.ts.map +1 -0
  214. package/dist-lib/tokens/brands/default/semantic/typography.d.ts +4 -2
  215. package/dist-lib/tokens/brands/default/semantic/typography.d.ts.map +1 -1
  216. package/dist-lib/tokens/brands/green/primitives/color-palette.d.ts +267 -0
  217. package/dist-lib/tokens/brands/green/primitives/color-palette.d.ts.map +1 -0
  218. package/dist-lib/tokens/brands/green/semantic/color-dark.d.ts +200 -0
  219. package/dist-lib/tokens/brands/green/semantic/color-dark.d.ts.map +1 -0
  220. package/dist-lib/tokens/brands/green/semantic/color-light.d.ts +201 -0
  221. package/dist-lib/tokens/brands/green/semantic/color-light.d.ts.map +1 -0
  222. package/dist-lib/tokens/brands/pay/primitives/color-palette.d.ts +146 -0
  223. package/dist-lib/tokens/brands/pay/primitives/color-palette.d.ts.map +1 -0
  224. package/dist-lib/tokens/brands/pay/semantic/color-dark.d.ts +201 -0
  225. package/dist-lib/tokens/brands/pay/semantic/color-dark.d.ts.map +1 -0
  226. package/dist-lib/tokens/brands/pay/semantic/color-light.d.ts +199 -0
  227. package/dist-lib/tokens/brands/pay/semantic/color-light.d.ts.map +1 -0
  228. package/dist-lib/tokens.cjs +35 -0
  229. package/dist-lib/tokens.cjs.map +1 -1
  230. package/dist-lib/tokens.mjs +35 -0
  231. package/dist-lib/tokens.mjs.map +1 -1
  232. package/package.json +21 -7
  233. package/dist-lib/chunks/app-shell-CPx9X7zP.cjs.map +0 -1
  234. package/dist-lib/chunks/app-shell-Cy9be0Zx.mjs.map +0 -1
  235. package/dist-lib/chunks/badge-DBdk74KN.mjs +0 -840
  236. package/dist-lib/chunks/badge-DBdk74KN.mjs.map +0 -1
  237. package/dist-lib/chunks/badge-gU2wtxrn.cjs +0 -856
  238. package/dist-lib/chunks/badge-gU2wtxrn.cjs.map +0 -1
  239. package/dist-lib/chunks/chip-group-2-f_Yo7Y.cjs +0 -763
  240. package/dist-lib/chunks/chip-group-2-f_Yo7Y.cjs.map +0 -1
  241. package/dist-lib/chunks/chip-group-_e-yh1Zq.mjs +0 -747
  242. package/dist-lib/chunks/chip-group-_e-yh1Zq.mjs.map +0 -1
  243. package/dist-lib/chunks/clientes-showcase-mocks-DygUqkkh.cjs.map +0 -1
  244. package/dist-lib/chunks/clientes-showcase-mocks-ayU1SDOA.mjs.map +0 -1
  245. package/dist-lib/chunks/input-BWevV7up.cjs.map +0 -1
  246. package/dist-lib/chunks/input-C9eKSSEb.mjs.map +0 -1
  247. package/dist-lib/chunks/panel-BCUixETK.mjs.map +0 -1
  248. package/dist-lib/chunks/panel-pOXMw6a-.cjs.map +0 -1
@@ -1,19 +1,19 @@
1
- import { i as isFilterEntryActive, e as FilterPopover, T as ToolbarToolButton, f as ButtonGroup, g as ToolbarSimpleFilterDrawer, h as ACTIONS_COLUMN_WIDTH } from "./chunks/panel-BCUixETK.mjs";
2
- import { j, A, k, B, l, C, m, n, o, D, q, r, s, t, u, v, w, x, y, d, z, E, G, H, a, I, F, b, J, c, K, M, P, L, S, N, O, Q, R, U, V, W, X, Y, Z, _, $, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, aa, p, ab, ac, ad, ae } from "./chunks/panel-BCUixETK.mjs";
3
- import { g as Dialog, h as DialogTrigger, i as DialogContent, j as DialogTitle, k as DialogClose, D as DropdownMenu, c as DropdownMenuTrigger, d as DropdownMenuContent, e as DropdownMenuItem, C as CommandDialog, l as CommandInput, m as CommandList, n as CommandEmpty, o as CommandGroup, p as CommandItem, q as DropdownMenuGroup, r as DropdownMenuLabel, f as DropdownMenuSeparator } from "./chunks/app-shell-Cy9be0Zx.mjs";
4
- import { A as A2, H as H2, s as s2, t as t2, u as u2, v as v2, w as w2, I as I2, x as x2, y as y2, z as z2, B as B2, E as E2, M as M2, F as F2, G as G2, J as J2, S as S2, K as K2, L as L2, N as N2, O as O2, P as P2, Q as Q2, U as U2, R as R2, T, V as V2 } from "./chunks/app-shell-Cy9be0Zx.mjs";
5
- import { t as tv, B as Button, c as cn, C as Chip } from "./chunks/chip-group-_e-yh1Zq.mjs";
6
- import { a as a10, b as b2, d as d2, e, f } from "./chunks/chip-group-_e-yh1Zq.mjs";
1
+ import { C as Checkbox, g as getContrastTextColor, a as FormField, e as Avatar, i as isFilterEntryActive, f as FilterPopover, T as ToolbarToolButton, h as ButtonGroup, j as ToolbarSimpleFilterDrawer, k as ACTIONS_COLUMN_WIDTH, l as Calendar, m as Textarea } from "./chunks/panel-CEkyoGiO.mjs";
2
+ import { n, A, B, o, q, r, s, t, D, u, v, w, x, y, z, E, G, H, d, I, J, K, L, M, F, b, N, c, O, Q, P, R, S, U, V, W, X, Y, Z, _, $, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, aa, ab, ac, ad, ae, af, ag, ah, ai, aj, ak, al, p, am, an, ao, ap, aq } from "./chunks/panel-CEkyoGiO.mjs";
3
+ import { t as tv, c as cn, P as Popover, j as PopoverTrigger, k as PopoverContent, B as Button, l as Dialog, m as DialogTrigger, n as DialogContent, o as DialogTitle, C as Chip, p as PopoverAnchor, q as DialogClose, r as DialogDescription, D as DropdownMenu, f as DropdownMenuTrigger, g as DropdownMenuContent, h as DropdownMenuItem, s as CommandDialog, u as CommandInput, v as CommandList, w as CommandEmpty, x as CommandGroup, y as CommandItem, z as DropdownMenuGroup, E as DropdownMenuLabel, i as DropdownMenuSeparator } from "./chunks/app-shell-78w0pYdP.mjs";
4
+ import { A as A2, d as d2, e, H as H2, F as F2, G as G2, I as I2, J as J2, K as K2, L as L2, M as M2, N as N2, O as O2, Q as Q2, R as R2, S as S2, T, U as U2, V as V2, W as W2, X as X2, Y as Y2, Z as Z2, _ as _2, $ as $2, a0 as a02, a1 as a12, a2 as a22, a3 as a32, a4 as a42, a5 as a52, a6 as a62, a7 as a72 } from "./chunks/app-shell-78w0pYdP.mjs";
7
5
  import { jsxs, jsx, Fragment } from "react/jsx-runtime";
8
6
  import * as React from "react";
9
- import { forwardRef, useId, useState, useCallback, useMemo, createContext, useContext, useRef, useEffect } from "react";
10
- import { C as Checkbox } from "./chunks/badge-DBdk74KN.mjs";
11
- import { B as B3, T as T2, a as a11, b as b3, c as c2, d as d3, e as e2, f as f2, g, u as u3 } from "./chunks/badge-DBdk74KN.mjs";
12
- import { MoreHorizontal, SlidersHorizontal, TrendingUp, X as X2, PanelLeftClose, Check, ChevronsUpDown, Search, ChevronDown, User } from "lucide-react";
13
- import { P as P3, p as p2 } from "./chunks/page-header-CQbTGWQ8.mjs";
7
+ import { forwardRef, useId, useState, Fragment as Fragment$1, isValidElement, useCallback, useMemo, createElement, useRef, useEffect, useLayoutEffect, createContext, useContext } from "react";
8
+ import { Check, MoreHorizontal, SlidersHorizontal, Calendar as Calendar$1, AlertCircle, CheckCheck, Clock, MoreVertical, Ban, X as X3, CalendarDays, ChevronDown, ChevronLeft, ChevronRight, PanelLeftClose, ChevronsUpDown, Search, User } from "lucide-react";
9
+ import { Reply } from "lucide-react";
10
+ import * as SeparatorPrimitive from "@radix-ui/react-separator";
11
+ import { I as Input } from "./chunks/input-DCDU4i4S.mjs";
12
+ import { i } from "./chunks/input-DCDU4i4S.mjs";
13
+ import { a, b as b2, K as K3 } from "./chunks/kpi-delta-DpYuDY4h.mjs";
14
+ import { P as P2, p as p2 } from "./chunks/page-header-B6XJyIMz.mjs";
14
15
  import * as TooltipPrimitive from "@radix-ui/react-tooltip";
15
16
  import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
16
- import { I as I3, i } from "./chunks/input-C9eKSSEb.mjs";
17
17
  const cardCheckbox = tv({
18
18
  slots: {
19
19
  root: [
@@ -84,6 +84,671 @@ const CardCheckbox = forwardRef(
84
84
  }
85
85
  );
86
86
  CardCheckbox.displayName = "CardCheckbox";
87
+ const Separator = React.forwardRef(
88
+ ({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ jsx(
89
+ SeparatorPrimitive.Root,
90
+ {
91
+ ref,
92
+ decorative,
93
+ orientation,
94
+ className: cn(
95
+ "shrink-0 bg-border",
96
+ orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
97
+ className
98
+ ),
99
+ ...props
100
+ }
101
+ )
102
+ );
103
+ Separator.displayName = SeparatorPrimitive.Root.displayName;
104
+ const badgeVariants = tv({
105
+ base: [
106
+ "inline-flex items-center justify-center",
107
+ "border border-transparent",
108
+ "font-semibold leading-none whitespace-nowrap",
109
+ "transition-colors",
110
+ "focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-ring-secondary",
111
+ "[&_svg]:pointer-events-none [&_svg]:shrink-0"
112
+ ],
113
+ variants: {
114
+ color: {
115
+ primary: "",
116
+ secondary: "",
117
+ critical: "",
118
+ success: "",
119
+ warning: "",
120
+ info: ""
121
+ },
122
+ variant: {
123
+ solid: "",
124
+ soft: "",
125
+ outline: "bg-transparent",
126
+ ghost: "bg-transparent border-transparent"
127
+ },
128
+ size: {
129
+ sm: "h-comp-2xs px-pad-sm text-caption-xs gap-gp-2xs [&_svg]:size-3",
130
+ // 20px / 6 / 10
131
+ md: "h-comp-xs px-pad-md text-body-xs gap-gp-xs [&_svg]:size-3.5",
132
+ // 24px / 8 / 12 (default)
133
+ lg: "h-comp-sm px-pad-lg text-body-sm font-normal gap-gp-sm [&_svg]:size-4"
134
+ // 28px / 10 / 13
135
+ },
136
+ shape: {
137
+ default: "rounded-radius-sm",
138
+ // 6px — counter, value tags
139
+ pill: "rounded-radius-full"
140
+ // pill — status chips
141
+ }
142
+ },
143
+ compoundVariants: [
144
+ /* ── Primary (brand) ─────────────────────────────────────────────── */
145
+ { color: "primary", variant: "solid", class: "bg-bg-brand text-fg-on-brand" },
146
+ { color: "primary", variant: "soft", class: "bg-bg-brand-subtle text-fg-brand" },
147
+ { color: "primary", variant: "outline", class: "border-border-brand text-fg-brand" },
148
+ { color: "primary", variant: "ghost", class: "text-fg-brand" },
149
+ /* ── Secondary (neutral) ─────────────────────────────────────────── */
150
+ { color: "secondary", variant: "solid", class: "bg-bg-emphasis text-fg-default" },
151
+ { color: "secondary", variant: "soft", class: "bg-bg-muted text-fg-muted" },
152
+ { color: "secondary", variant: "outline", class: "border-border-default text-fg-default" },
153
+ { color: "secondary", variant: "ghost", class: "text-fg-muted" },
154
+ /* ── Critical (danger) ───────────────────────────────────────────── */
155
+ { color: "critical", variant: "solid", class: "bg-bg-danger text-fg-on-danger" },
156
+ { color: "critical", variant: "soft", class: "bg-bg-danger-muted text-fg-danger" },
157
+ { color: "critical", variant: "outline", class: "border-border-danger-muted text-fg-danger" },
158
+ { color: "critical", variant: "ghost", class: "text-fg-danger" },
159
+ /* ── Success ─────────────────────────────────────────────────────── */
160
+ { color: "success", variant: "solid", class: "bg-bg-success text-fg-on-success" },
161
+ { color: "success", variant: "soft", class: "bg-bg-success-muted text-fg-success" },
162
+ { color: "success", variant: "outline", class: "border-border-success-muted text-fg-success" },
163
+ { color: "success", variant: "ghost", class: "text-fg-success" },
164
+ /* ── Warning ─────────────────────────────────────────────────────── */
165
+ { color: "warning", variant: "solid", class: "bg-bg-warning text-fg-on-warning" },
166
+ { color: "warning", variant: "soft", class: "bg-bg-warning-muted text-fg-warning" },
167
+ { color: "warning", variant: "outline", class: "border-border-warning-muted text-fg-warning" },
168
+ { color: "warning", variant: "ghost", class: "text-fg-warning" },
169
+ /* ── Info ────────────────────────────────────────────────────────── */
170
+ { color: "info", variant: "solid", class: "bg-bg-info text-fg-on-info" },
171
+ { color: "info", variant: "soft", class: "bg-bg-info-muted text-fg-info" },
172
+ { color: "info", variant: "outline", class: "border-border-info-muted text-fg-info" },
173
+ { color: "info", variant: "ghost", class: "text-fg-info" }
174
+ ],
175
+ defaultVariants: {
176
+ color: "secondary",
177
+ variant: "soft",
178
+ size: "md",
179
+ shape: "default"
180
+ }
181
+ });
182
+ function Badge({ className, color, variant, size, shape, ...props }) {
183
+ return /* @__PURE__ */ jsx(
184
+ "span",
185
+ {
186
+ className: badgeVariants({ color, variant, size, shape, className }),
187
+ ...props
188
+ }
189
+ );
190
+ }
191
+ const colorPickerStyles = tv({
192
+ slots: {
193
+ root: "inline-flex w-full items-center gap-gp-md",
194
+ swatch: [
195
+ "relative inline-flex shrink-0 items-center justify-center",
196
+ "rounded-radius-md border",
197
+ "transition-[border-color,box-shadow]",
198
+ "focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-ring-brand",
199
+ // opacity do disabled vem do slot root (cobre tudo uniformemente) — não duplicar aqui
200
+ "disabled:cursor-not-allowed"
201
+ ],
202
+ hexInput: "flex-1",
203
+ content: "flex flex-col gap-gp-lg p-sp-md min-w-container-dropdown-lg",
204
+ presetsGrid: "grid grid-cols-10 gap-gp-sm",
205
+ preset: [
206
+ "relative inline-flex items-center justify-center",
207
+ "size-comp-xs rounded-radius-md border border-border-input",
208
+ "transition-[box-shadow,border-color]",
209
+ "hover:border-border-brand",
210
+ "focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-ring-brand"
211
+ ],
212
+ presetCheck: "size-icon-sm",
213
+ customRow: "flex flex-col gap-gp-md"
214
+ },
215
+ variants: {
216
+ size: {
217
+ sm: { swatch: "size-form-md" },
218
+ md: { swatch: "size-form-lg" }
219
+ },
220
+ state: {
221
+ default: { swatch: "border-border-input hover:border-border-brand" },
222
+ error: { swatch: "border-border-danger-muted" },
223
+ warning: { swatch: "border-border-warning-muted" },
224
+ success: { swatch: "border-border-success-muted" }
225
+ },
226
+ disabled: {
227
+ true: { root: "pointer-events-none opacity-50" }
228
+ }
229
+ },
230
+ compoundVariants: [
231
+ // disabled SEMPRE por último (L-006)
232
+ {
233
+ disabled: true,
234
+ class: { swatch: "border-border-input hover:border-border-input" }
235
+ }
236
+ ],
237
+ defaultVariants: {
238
+ size: "md",
239
+ state: "default",
240
+ disabled: false
241
+ }
242
+ });
243
+ const DEFAULT_COLOR_PRESETS = [
244
+ // Marca iGreen — verdes
245
+ "#0E7C3A",
246
+ "#16A34A",
247
+ "#22C55E",
248
+ "#4ADE80",
249
+ "#86EFAC",
250
+ // Frios
251
+ "#0891B2",
252
+ "#06B6D4",
253
+ "#0EA5E9",
254
+ "#2563EB",
255
+ "#4F46E5",
256
+ // Roxos / rosas
257
+ "#7C3AED",
258
+ "#9333EA",
259
+ "#C026D3",
260
+ "#DB2777",
261
+ "#F43F5E",
262
+ // Quentes
263
+ "#DC2626",
264
+ "#EA580C",
265
+ "#F97316",
266
+ "#F59E0B",
267
+ "#FACC15",
268
+ // Neutras
269
+ "#FFFFFF",
270
+ "#E5E7EB",
271
+ "#9CA3AF",
272
+ "#6B7280",
273
+ "#374151",
274
+ "#111827"
275
+ ];
276
+ function normalizeHex(raw) {
277
+ let h = raw.trim().replace(/^#/, "");
278
+ if (/^[0-9a-fA-F]{3}$/.test(h)) {
279
+ h = h.split("").map((c2) => c2 + c2).join("");
280
+ }
281
+ if (/^[0-9a-fA-F]{6}$/.test(h)) {
282
+ return `#${h.toUpperCase()}`;
283
+ }
284
+ return null;
285
+ }
286
+ function sameHex(a10, b3) {
287
+ const na = normalizeHex(a10);
288
+ const nb = normalizeHex(b3);
289
+ return na !== null && nb !== null && na === nb;
290
+ }
291
+ const ColorPicker = forwardRef(
292
+ function ColorPicker2({
293
+ value,
294
+ onValueChange,
295
+ presets = DEFAULT_COLOR_PRESETS,
296
+ id: idProp,
297
+ state = "default",
298
+ size = "md",
299
+ disabled = false,
300
+ allowCustomHex = true,
301
+ placeholder = "#RRGGBB",
302
+ open: openProp,
303
+ onOpenChange,
304
+ className
305
+ }, ref) {
306
+ const autoId = useId();
307
+ const id = idProp ?? autoId;
308
+ const [uncontrolledOpen, setUncontrolledOpen] = useState(false);
309
+ const isControlled = openProp !== void 0;
310
+ const open = isControlled ? openProp : uncontrolledOpen;
311
+ const setOpen = (next) => {
312
+ if (!isControlled) setUncontrolledOpen(next);
313
+ onOpenChange?.(next);
314
+ };
315
+ const [inlineDraft, setInlineDraft] = useState(value);
316
+ const [customDraft, setCustomDraft] = useState(value);
317
+ const styles2 = colorPickerStyles({ size, state, disabled });
318
+ const commit = (raw) => {
319
+ const norm = normalizeHex(raw);
320
+ if (!norm) return false;
321
+ onValueChange(norm);
322
+ return true;
323
+ };
324
+ const handleInlineCommit = () => {
325
+ if (!commit(inlineDraft)) {
326
+ setInlineDraft(value);
327
+ }
328
+ };
329
+ const handlePreset = (hex) => {
330
+ const norm = normalizeHex(hex);
331
+ if (!norm) return;
332
+ onValueChange(norm);
333
+ setInlineDraft(norm);
334
+ setCustomDraft(norm);
335
+ setOpen(false);
336
+ };
337
+ const handleCustomConfirm = () => {
338
+ const norm = normalizeHex(customDraft);
339
+ if (!norm) return;
340
+ onValueChange(norm);
341
+ setInlineDraft(norm);
342
+ setOpen(false);
343
+ };
344
+ const swatchBg = normalizeHex(value) ?? "transparent";
345
+ return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
346
+ /* @__PURE__ */ jsxs("div", { className: styles2.root({ className }), children: [
347
+ /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
348
+ "button",
349
+ {
350
+ ref,
351
+ type: "button",
352
+ disabled,
353
+ "aria-label": "Selecionar cor",
354
+ "aria-haspopup": "dialog",
355
+ "aria-expanded": open,
356
+ className: styles2.swatch(),
357
+ style: { backgroundColor: swatchBg }
358
+ }
359
+ ) }),
360
+ /* @__PURE__ */ jsx(
361
+ Input,
362
+ {
363
+ id,
364
+ type: "text",
365
+ inputMode: "text",
366
+ size,
367
+ state,
368
+ disabled,
369
+ placeholder,
370
+ "aria-label": "Cor hexadecimal",
371
+ className: styles2.hexInput(),
372
+ value: inlineDraft,
373
+ onChange: (e2) => setInlineDraft(e2.target.value),
374
+ onBlur: handleInlineCommit,
375
+ onKeyDown: (e2) => {
376
+ if (e2.key === "Enter") {
377
+ e2.preventDefault();
378
+ handleInlineCommit();
379
+ }
380
+ }
381
+ }
382
+ )
383
+ ] }),
384
+ /* @__PURE__ */ jsxs(
385
+ PopoverContent,
386
+ {
387
+ align: "start",
388
+ mobileSheet: true,
389
+ role: "dialog",
390
+ "aria-label": "Paleta de cores",
391
+ className: styles2.content(),
392
+ children: [
393
+ /* @__PURE__ */ jsx(
394
+ "div",
395
+ {
396
+ className: styles2.presetsGrid(),
397
+ role: "group",
398
+ "aria-label": "Cores predefinidas",
399
+ children: presets.map((hex) => {
400
+ const norm = normalizeHex(hex) ?? hex;
401
+ const selected = sameHex(hex, value);
402
+ const checkColor = getContrastTextColor(hex);
403
+ return /* @__PURE__ */ jsx(
404
+ "button",
405
+ {
406
+ type: "button",
407
+ "aria-label": norm,
408
+ "aria-pressed": selected,
409
+ className: styles2.preset(),
410
+ style: { backgroundColor: norm },
411
+ onClick: () => handlePreset(hex),
412
+ children: selected && /* @__PURE__ */ jsx(
413
+ Check,
414
+ {
415
+ className: styles2.presetCheck(),
416
+ style: { color: checkColor },
417
+ "aria-hidden": "true"
418
+ }
419
+ )
420
+ },
421
+ norm
422
+ );
423
+ })
424
+ }
425
+ ),
426
+ allowCustomHex && /* @__PURE__ */ jsxs(Fragment, { children: [
427
+ /* @__PURE__ */ jsx(Separator, {}),
428
+ /* @__PURE__ */ jsxs("div", { className: styles2.customRow(), children: [
429
+ /* @__PURE__ */ jsx(FormField, { label: "Cor personalizada", id: `${id}-custom`, children: ({ id: customId }) => /* @__PURE__ */ jsx(
430
+ Input,
431
+ {
432
+ id: customId,
433
+ type: "text",
434
+ size,
435
+ placeholder,
436
+ "aria-label": "Cor hexadecimal",
437
+ value: customDraft,
438
+ onChange: (e2) => setCustomDraft(e2.target.value),
439
+ onKeyDown: (e2) => {
440
+ if (e2.key === "Enter") {
441
+ e2.preventDefault();
442
+ handleCustomConfirm();
443
+ }
444
+ }
445
+ }
446
+ ) }),
447
+ /* @__PURE__ */ jsx(
448
+ Button,
449
+ {
450
+ type: "button",
451
+ size: "sm",
452
+ fullWidth: true,
453
+ disabled: normalizeHex(customDraft) === null,
454
+ onClick: handleCustomConfirm,
455
+ children: "Aplicar"
456
+ }
457
+ )
458
+ ] })
459
+ ] })
460
+ ]
461
+ }
462
+ )
463
+ ] });
464
+ }
465
+ );
466
+ const markdownTextStyles = tv({
467
+ slots: {
468
+ root: "text-body-sm text-fg-default break-words",
469
+ strong: "font-semibold",
470
+ em: "italic",
471
+ strike: "line-through",
472
+ code: "font-mono bg-bg-muted rounded-radius-xs px-pad-md text-fg-default",
473
+ link: "text-fg-brand underline underline-offset-2 break-all hover:opacity-80"
474
+ },
475
+ variants: {
476
+ inline: {
477
+ true: { root: "whitespace-normal" },
478
+ false: { root: "whitespace-pre-wrap" }
479
+ }
480
+ },
481
+ defaultVariants: {
482
+ inline: false
483
+ }
484
+ });
485
+ const CODE_RE = /```([\s\S]+?)```|`([^`]+?)`/g;
486
+ const URL_RE = /((?:https?:\/\/|www\.)[^\s<>()]+[^\s<>().,!?;:'"])/g;
487
+ function parseInline(text, s2, prefix) {
488
+ const markers = [
489
+ { re: /\*([^*\n]+?)\*/, slot: "strong", el: "strong" },
490
+ { re: /_([^_\n]+?)_/, slot: "em", el: "em" },
491
+ { re: /~([^~\n]+?)~/, slot: "strike", el: "span" }
492
+ ];
493
+ for (const { re, slot, el } of markers) {
494
+ const m = re.exec(text);
495
+ if (!m || m.index === void 0) continue;
496
+ const before = text.slice(0, m.index);
497
+ const inner = m[1];
498
+ const after = text.slice(m.index + m[0].length);
499
+ const Tag = el;
500
+ const className = slot === "strong" ? s2.strong() : slot === "em" ? s2.em() : s2.strike();
501
+ return [
502
+ ...parseInline(before, s2, `${prefix}-b`),
503
+ /* @__PURE__ */ jsx(Tag, { className, children: parseInline(inner, s2, `${prefix}-i`) }, `${prefix}-${slot}`),
504
+ ...parseInline(after, s2, `${prefix}-a`)
505
+ ];
506
+ }
507
+ return text ? [text] : [];
508
+ }
509
+ function parseLinksAndInline(text, s2, prefix) {
510
+ const out = [];
511
+ let last = 0;
512
+ let i2 = 0;
513
+ URL_RE.lastIndex = 0;
514
+ let m;
515
+ while ((m = URL_RE.exec(text)) !== null) {
516
+ if (m.index > last) {
517
+ out.push(...parseInline(text.slice(last, m.index), s2, `${prefix}-${i2}t`));
518
+ }
519
+ const raw = m[0];
520
+ const href = raw.startsWith("www.") ? `https://${raw}` : raw;
521
+ out.push(
522
+ /* @__PURE__ */ jsx(
523
+ "a",
524
+ {
525
+ href,
526
+ target: "_blank",
527
+ rel: "noopener noreferrer",
528
+ className: s2.link(),
529
+ children: raw
530
+ },
531
+ `${prefix}-${i2}link`
532
+ )
533
+ );
534
+ last = m.index + raw.length;
535
+ i2 += 1;
536
+ }
537
+ if (last < text.length) {
538
+ out.push(...parseInline(text.slice(last), s2, `${prefix}-${i2}t`));
539
+ }
540
+ return out;
541
+ }
542
+ function parseMarkdown(source, s2) {
543
+ const out = [];
544
+ let last = 0;
545
+ let i2 = 0;
546
+ CODE_RE.lastIndex = 0;
547
+ let m;
548
+ while ((m = CODE_RE.exec(source)) !== null) {
549
+ if (m.index > last) {
550
+ out.push(...parseLinksAndInline(source.slice(last, m.index), s2, `${i2}t`));
551
+ }
552
+ const codeContent = m[1] ?? m[2] ?? "";
553
+ out.push(
554
+ /* @__PURE__ */ jsx("code", { className: s2.code(), children: codeContent }, `${i2}code`)
555
+ );
556
+ last = m.index + m[0].length;
557
+ i2 += 1;
558
+ }
559
+ if (last < source.length) {
560
+ out.push(...parseLinksAndInline(source.slice(last), s2, `${i2}t`));
561
+ }
562
+ return out;
563
+ }
564
+ function MarkdownText({
565
+ children,
566
+ inline = false,
567
+ className
568
+ }) {
569
+ const styles2 = markdownTextStyles({ inline });
570
+ const source = inline ? children.replace(/\s+/g, " ").trim() : children;
571
+ const nodes = parseMarkdown(source, styles2);
572
+ const content = nodes.map((node, i2) => /* @__PURE__ */ jsx(Fragment$1, { children: node }, i2));
573
+ if (inline) {
574
+ return /* @__PURE__ */ jsx("span", { className: styles2.root({ className }), children: content });
575
+ }
576
+ return /* @__PURE__ */ jsx("p", { className: styles2.root({ className }), children: content });
577
+ }
578
+ const conversationListItemStyles = tv({
579
+ slots: {
580
+ root: [
581
+ "group/cli relative w-full text-left",
582
+ "grid grid-cols-[auto_minmax(0,1fr)_auto] items-start",
583
+ "gap-gp-lg px-pad-2xl",
584
+ "rounded-radius-md border border-transparent",
585
+ "transition-[background-color,box-shadow] duration-150",
586
+ // stripe de seleção (oculto por padrão)
587
+ "before:content-[''] before:absolute before:left-0 before:top-0 before:bottom-0",
588
+ "before:w-[3px] before:rounded-r-radius-xs before:bg-transparent",
589
+ "before:transition-colors before:pointer-events-none",
590
+ // hover
591
+ "hover:bg-bg-muted",
592
+ // foco (Padrão 1)
593
+ "focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-ring-brand"
594
+ ],
595
+ media: "flex shrink-0 items-center",
596
+ body: "flex min-w-0 flex-col gap-gp-xs",
597
+ topRow: "flex min-w-0 items-center gap-gp-md",
598
+ title: "min-w-0 flex-1 truncate text-body-sm font-semibold text-fg-default",
599
+ time: "shrink-0 text-caption-sm text-fg-muted [font-variant-numeric:tabular-nums]",
600
+ preview: "min-w-0 text-body-xs text-fg-muted [&_*]:line-clamp-1 line-clamp-1",
601
+ badges: "flex flex-wrap items-center gap-gp-xs",
602
+ trailing: "flex shrink-0 flex-col items-end gap-gp-xs",
603
+ unread: [
604
+ // count-badge: dimensões finas alinhadas ao padrão de contadores do DS
605
+ // (Chip/Table usam min-w-[18px] h-[18px] px-[5px] — exceção posicional fina)
606
+ "inline-flex items-center justify-center",
607
+ "min-w-[18px] h-[18px] px-[5px]",
608
+ "rounded-radius-full",
609
+ "bg-bg-danger text-fg-on-danger",
610
+ "text-caption-xs font-semibold [font-variant-numeric:tabular-nums]"
611
+ ],
612
+ actions: [
613
+ "flex items-center gap-gp-xs",
614
+ // revelado no hover/focus-within da linha
615
+ "opacity-0 transition-opacity duration-150",
616
+ "group-hover/cli:opacity-100 group-focus-within/cli:opacity-100"
617
+ ]
618
+ },
619
+ variants: {
620
+ variant: {
621
+ // ticket: layout completo (badges + ações), default
622
+ ticket: {},
623
+ // chat: lista mais simples (DM-style) — body um pouco mais apertado
624
+ chat: { body: "gap-gp-2xs" }
625
+ },
626
+ density: {
627
+ comfortable: { root: "py-pad-lg", media: "py-[2px]" },
628
+ compact: { root: "py-pad-md" }
629
+ },
630
+ selected: {
631
+ true: { root: "bg-bg-muted before:bg-bg-brand" },
632
+ false: {}
633
+ },
634
+ unread: {
635
+ true: { title: "font-bold text-fg-default", preview: "text-fg-default font-medium" },
636
+ false: {}
637
+ },
638
+ disabled: {
639
+ true: { root: "pointer-events-none opacity-50 cursor-not-allowed" },
640
+ false: {}
641
+ }
642
+ },
643
+ compoundVariants: [
644
+ // disabled SEMPRE por último (L-006)
645
+ {
646
+ disabled: true,
647
+ class: {
648
+ root: "hover:bg-transparent before:bg-transparent",
649
+ actions: "opacity-0"
650
+ }
651
+ }
652
+ ],
653
+ defaultVariants: {
654
+ variant: "ticket",
655
+ density: "comfortable",
656
+ selected: false,
657
+ unread: false,
658
+ disabled: false
659
+ }
660
+ });
661
+ function initialsFromName(name) {
662
+ if (!name) return "";
663
+ const parts = name.trim().split(/\s+/).filter(Boolean);
664
+ if (parts.length === 0) return "";
665
+ if (parts.length === 1) return parts[0].slice(0, 2).toUpperCase();
666
+ return (parts[0][0] + parts[parts.length - 1][0]).toUpperCase();
667
+ }
668
+ function isAvatarData(value) {
669
+ return typeof value === "object" && value !== null && !isValidElement(value) && ("src" in value || "name" in value || "colorHex" in value);
670
+ }
671
+ const ConversationListItem = forwardRef(function ConversationListItem2({
672
+ title: title2,
673
+ avatar,
674
+ preview,
675
+ time,
676
+ badges,
677
+ unread,
678
+ variant = "ticket",
679
+ density = "comfortable",
680
+ selected = false,
681
+ disabled = false,
682
+ actions,
683
+ onClick,
684
+ className
685
+ }, ref) {
686
+ const hasUnread = typeof unread === "number" && unread > 0;
687
+ const styles2 = conversationListItemStyles({
688
+ variant,
689
+ density,
690
+ selected,
691
+ unread: hasUnread,
692
+ disabled
693
+ });
694
+ const interactive = !disabled && typeof onClick === "function";
695
+ const handleKeyDown = (e2) => {
696
+ if (!interactive) return;
697
+ if (e2.key === "Enter" || e2.key === " ") {
698
+ e2.preventDefault();
699
+ onClick?.();
700
+ }
701
+ };
702
+ const stopActions = (e2) => e2.stopPropagation();
703
+ let avatarNode = null;
704
+ if (avatar != null) {
705
+ if (isAvatarData(avatar)) {
706
+ const { src, name, colorHex } = avatar;
707
+ const label = name ?? title2;
708
+ avatarNode = /* @__PURE__ */ jsx(Avatar, { size: "lg", colorHex, "aria-label": label, children: src ? /* @__PURE__ */ jsx(
709
+ "img",
710
+ {
711
+ src,
712
+ alt: "",
713
+ className: "size-full object-cover",
714
+ "aria-hidden": "true"
715
+ }
716
+ ) : initialsFromName(name ?? title2) });
717
+ } else {
718
+ avatarNode = avatar;
719
+ }
720
+ }
721
+ return /* @__PURE__ */ jsxs(
722
+ "div",
723
+ {
724
+ ref,
725
+ className: styles2.root({
726
+ className: [interactive && "cursor-pointer", className].filter(Boolean).join(" ")
727
+ }),
728
+ onClick: interactive ? onClick : void 0,
729
+ onKeyDown: interactive ? handleKeyDown : void 0,
730
+ ...interactive ? { role: "button", tabIndex: 0 } : {},
731
+ "aria-disabled": disabled || void 0,
732
+ "aria-current": selected ? "true" : void 0,
733
+ children: [
734
+ avatarNode && /* @__PURE__ */ jsx("span", { className: styles2.media(), children: avatarNode }),
735
+ /* @__PURE__ */ jsxs("span", { className: styles2.body(), children: [
736
+ /* @__PURE__ */ jsxs("span", { className: styles2.topRow(), children: [
737
+ /* @__PURE__ */ jsx("span", { className: styles2.title(), children: title2 }),
738
+ time && /* @__PURE__ */ jsx("span", { className: styles2.time(), children: time })
739
+ ] }),
740
+ preview && /* @__PURE__ */ jsx(MarkdownText, { inline: true, className: styles2.preview(), children: preview }),
741
+ badges && /* @__PURE__ */ jsx("span", { className: styles2.badges(), children: badges })
742
+ ] }),
743
+ (hasUnread || actions) && /* @__PURE__ */ jsxs("span", { className: styles2.trailing(), children: [
744
+ hasUnread && /* @__PURE__ */ jsx("span", { className: styles2.unread(), "aria-label": `${unread} não lidas`, children: unread > 99 ? "99+" : unread }),
745
+ actions && /* @__PURE__ */ jsx("span", { className: styles2.actions(), onClick: stopActions, children: actions })
746
+ ] })
747
+ ]
748
+ }
749
+ );
750
+ });
751
+ ConversationListItem.displayName = "ConversationListItem";
87
752
  const HIDDEN_AT = {
88
753
  md: "md:hidden",
89
754
  lg: "lg:hidden",
@@ -164,20 +829,20 @@ function useToolbarFilters(options) {
164
829
  [generateId]
165
830
  );
166
831
  const remove = useCallback((id) => {
167
- setList((prev) => prev.filter((f3) => f3.id !== id));
832
+ setList((prev) => prev.filter((f) => f.id !== id));
168
833
  }, []);
169
834
  const update = useCallback((id, patch) => {
170
835
  setList(
171
- (prev) => prev.map((f3) => f3.id === id ? { ...f3, ...patch } : f3)
836
+ (prev) => prev.map((f) => f.id === id ? { ...f, ...patch } : f)
172
837
  );
173
838
  }, []);
174
839
  const clear = useCallback(() => setList([]), []);
175
840
  const replaceAll = useCallback((next) => setList(next), []);
176
841
  const count = useMemo(
177
- () => list.filter((f3) => {
178
- if (f3.value === null || f3.value === void 0) return false;
179
- if (typeof f3.value === "string") return f3.value.length > 0;
180
- if (Array.isArray(f3.value)) return f3.value.length > 0;
842
+ () => list.filter((f) => {
843
+ if (f.value === null || f.value === void 0) return false;
844
+ if (typeof f.value === "string") return f.value.length > 0;
845
+ if (Array.isArray(f.value)) return f.value.length > 0;
181
846
  return true;
182
847
  }).length,
183
848
  [list]
@@ -190,7 +855,7 @@ function useToolbarSort(options) {
190
855
  const toggle = useCallback(
191
856
  (columnKey) => {
192
857
  setList((prev) => {
193
- const idx = prev.findIndex((s3) => s3.columnKey === columnKey);
858
+ const idx = prev.findIndex((s2) => s2.columnKey === columnKey);
194
859
  if (idx === -1) {
195
860
  const next = [...prev, { columnKey, direction: "asc" }];
196
861
  if (next.length > maxColumns) next.shift();
@@ -202,7 +867,7 @@ function useToolbarSort(options) {
202
867
  next[idx] = { ...current, direction: "desc" };
203
868
  return next;
204
869
  }
205
- return prev.filter((_2, i2) => i2 !== idx);
870
+ return prev.filter((_3, i2) => i2 !== idx);
206
871
  });
207
872
  },
208
873
  [maxColumns]
@@ -210,7 +875,7 @@ function useToolbarSort(options) {
210
875
  const set = useCallback(
211
876
  (columnKey, direction) => {
212
877
  setList((prev) => {
213
- const idx = prev.findIndex((s3) => s3.columnKey === columnKey);
878
+ const idx = prev.findIndex((s2) => s2.columnKey === columnKey);
214
879
  if (idx === -1) {
215
880
  const next2 = [...prev, { columnKey, direction }];
216
881
  if (next2.length > maxColumns) next2.shift();
@@ -224,7 +889,7 @@ function useToolbarSort(options) {
224
889
  [maxColumns]
225
890
  );
226
891
  const remove = useCallback((columnKey) => {
227
- setList((prev) => prev.filter((s3) => s3.columnKey !== columnKey));
892
+ setList((prev) => prev.filter((s2) => s2.columnKey !== columnKey));
228
893
  }, []);
229
894
  const clear = useCallback(() => setList([]), []);
230
895
  const replaceAll = useCallback(
@@ -232,7 +897,7 @@ function useToolbarSort(options) {
232
897
  []
233
898
  );
234
899
  const directionOf = useCallback(
235
- (columnKey) => list.find((s3) => s3.columnKey === columnKey)?.direction,
900
+ (columnKey) => list.find((s2) => s2.columnKey === columnKey)?.direction,
236
901
  [list]
237
902
  );
238
903
  return {
@@ -410,6 +1075,109 @@ function actionColumn(opts) {
410
1075
  function customColumn(field, headerName, render, overrides) {
411
1076
  return { field, headerName, render, ...overrides };
412
1077
  }
1078
+ const formatFull = (date) => date.toLocaleDateString("pt-BR", {
1079
+ day: "2-digit",
1080
+ month: "long",
1081
+ year: "numeric"
1082
+ });
1083
+ const formatShort = (date) => date.toLocaleDateString("pt-BR", {
1084
+ day: "2-digit",
1085
+ month: "short",
1086
+ year: "numeric"
1087
+ });
1088
+ const DatePicker = React.forwardRef(
1089
+ (props, ref) => {
1090
+ const { placeholder, disabled, align = "start", className } = props;
1091
+ const [open, setOpen] = React.useState(false);
1092
+ let label = null;
1093
+ let calendar;
1094
+ if (props.mode === "range") {
1095
+ const v2 = props.value;
1096
+ label = v2?.from ? v2.to ? `${formatShort(v2.from)} – ${formatShort(v2.to)}` : formatShort(v2.from) : null;
1097
+ calendar = /* @__PURE__ */ jsx(
1098
+ Calendar,
1099
+ {
1100
+ mode: "range",
1101
+ min: 1,
1102
+ numberOfMonths: props.numberOfMonths ?? 2,
1103
+ selected: v2,
1104
+ onSelect: (range) => {
1105
+ props.onValueChange?.(range);
1106
+ if (range?.from && range?.to) setOpen(false);
1107
+ },
1108
+ autoFocus: true
1109
+ }
1110
+ );
1111
+ } else if (props.mode === "multiple") {
1112
+ const v2 = props.value;
1113
+ label = v2 && v2.length > 0 ? v2.length === 1 ? "1 data selecionada" : `${v2.length} datas selecionadas` : null;
1114
+ calendar = /* @__PURE__ */ jsx(
1115
+ Calendar,
1116
+ {
1117
+ mode: "multiple",
1118
+ numberOfMonths: props.numberOfMonths,
1119
+ selected: v2,
1120
+ onSelect: (dates) => props.onValueChange?.(dates),
1121
+ autoFocus: true
1122
+ }
1123
+ );
1124
+ } else {
1125
+ const v2 = props.value;
1126
+ label = v2 ? formatFull(v2) : null;
1127
+ calendar = /* @__PURE__ */ jsx(
1128
+ Calendar,
1129
+ {
1130
+ mode: "single",
1131
+ numberOfMonths: props.numberOfMonths,
1132
+ selected: v2,
1133
+ onSelect: (date) => {
1134
+ props.onValueChange?.(date);
1135
+ setOpen(false);
1136
+ }
1137
+ }
1138
+ );
1139
+ }
1140
+ const text = label ?? placeholder ?? (props.mode === "range" ? "Selecione o período" : "Selecione a data");
1141
+ return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
1142
+ /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
1143
+ "button",
1144
+ {
1145
+ ref,
1146
+ type: "button",
1147
+ disabled,
1148
+ "data-placeholder": label ? void 0 : "",
1149
+ className: cn(
1150
+ // Trigger espelha o SelectTrigger (`shadcn/select.tsx`), que é o
1151
+ // precedente do DS pra "botão que tem que parecer input": mesmos
1152
+ // tokens de bg/border/radius/padding/gap e o mesmo tratamento de
1153
+ // foco (borda + shadow-sh-ring), em vez de `ring-4` de botão.
1154
+ // Antes divergia em 6 pontos — bg-surface (opaco) no lugar de
1155
+ // bg-input (translúcido), border-default, radius-md, pad-lg,
1156
+ // gp-sm e sem hover — e por isso não lia como campo de formulário.
1157
+ "flex min-h-form-lg w-full items-center gap-gp-md",
1158
+ "rounded-radius-lg px-pad-xl",
1159
+ "bg-bg-input dark:bg-bg-muted",
1160
+ "hover:bg-bg-input-hover dark:hover:bg-bg-muted-hover",
1161
+ "border border-border-input",
1162
+ "text-body-sm font-normal text-fg-default",
1163
+ "transition-[border-color,box-shadow,background-color] outline-none",
1164
+ "focus-visible:border-border-brand focus-visible:shadow-sh-ring",
1165
+ "data-[state=open]:border-border-brand data-[state=open]:shadow-sh-ring",
1166
+ "disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-bg-input dark:disabled:hover:bg-bg-muted",
1167
+ "data-[placeholder]:text-fg-muted",
1168
+ className
1169
+ ),
1170
+ children: [
1171
+ /* @__PURE__ */ jsx(Calendar$1, { className: "size-icon-sm shrink-0 text-fg-muted", strokeWidth: 1.8 }),
1172
+ /* @__PURE__ */ jsx("span", { className: "truncate", children: text })
1173
+ ]
1174
+ }
1175
+ ) }),
1176
+ /* @__PURE__ */ jsx(PopoverContent, { align, className: "w-auto p-pad-xl", children: calendar })
1177
+ ] });
1178
+ }
1179
+ );
1180
+ DatePicker.displayName = "DatePicker";
413
1181
  const icons = {
414
1182
  "line-outline": "M14 9C14 6.23858 11.7614 4 9 4C6.23858 4 4 6.23858 4 9C4 11.7614 6.23858 14 9 14C11.7614 14 14 11.7614 14 9ZM18 9C18 13.9706 13.9706 18 9 18C4.02944 18 0 13.9706 0 9C0 4.02944 4.02944 0 9 0C13.9706 0 18 4.02944 18 9Z",
415
1183
  "line-close": "M13.7237 4.27627C14.0362 4.58869 14.0362 5.09529 13.7237 5.40771L10.1315 9L13.7237 12.5923C14.0362 12.9047 14.0362 13.4113 13.7237 13.7237C13.4113 14.0362 12.9047 14.0362 12.5923 13.7237L9 10.1315L5.40771 13.7237C5.09529 14.0362 4.58869 14.0362 4.27627 13.7237C3.96386 13.4113 3.96386 12.9047 4.27627 12.5923L7.86852 9L4.27627 5.40771C3.96386 5.09529 3.96386 4.58869 4.27627 4.27627C4.58869 3.96386 5.09529 3.96386 5.40771 4.27627L9 7.86852L12.5923 4.27627C12.9047 3.96386 13.4113 3.96386 13.7237 4.27627Z",
@@ -2848,7 +3616,7 @@ const iconStyles = tv({
2848
3616
  }
2849
3617
  });
2850
3618
  const PRESETS = ["xs", "sm", "md", "lg", "xl"];
2851
- const isPresetSize = (s3) => typeof s3 === "string" && PRESETS.includes(s3);
3619
+ const isPresetSize = (s2) => typeof s2 === "string" && PRESETS.includes(s2);
2852
3620
  const VIEWBOX_18 = /* @__PURE__ */ new Set([
2853
3621
  "line-outline",
2854
3622
  "line-close",
@@ -2897,152 +3665,957 @@ const Icon = forwardRef(
2897
3665
  ...props,
2898
3666
  children: [
2899
3667
  title2 ? /* @__PURE__ */ jsx("title", { children: title2 }) : null,
2900
- paths.map((d4, i2) => /* @__PURE__ */ jsx("path", { d: d4 }, i2))
3668
+ paths.map((d3, i2) => /* @__PURE__ */ jsx("path", { d: d3 }, i2))
2901
3669
  ]
2902
3670
  }
2903
3671
  );
2904
3672
  }
2905
3673
  );
2906
3674
  Icon.displayName = "Icon";
2907
- const kpi = tv({
3675
+ const dateSeparatorChipStyles = tv({
2908
3676
  slots: {
2909
- root: "flex flex-col gap-gp-lg",
2910
- header: "flex items-start justify-between gap-gp-md",
2911
- label: "m-0 text-body-md font-semibold text-fg-default",
2912
- iconBox: "grid size-form-lg shrink-0 place-items-center rounded-radius-lg [&>svg]:size-icon-md",
2913
- main: "flex flex-col gap-gp-xs",
2914
- valueRow: "flex flex-wrap items-center gap-gp-md",
2915
- value: "text-body-2xl font-bold leading-none text-fg-default [font-variant-numeric:tabular-nums]",
2916
- hint: "text-caption-sm text-fg-subtle",
2917
- chart: "mt-gp-xs",
2918
- footnote: "mt-pad-md border-t border-border-subtle pt-pad-lg text-caption-md text-fg-muted"
3677
+ root: "flex w-full items-center justify-center",
3678
+ rule: "flex-1",
3679
+ chip: "mx-auto shrink-0"
2919
3680
  },
2920
3681
  variants: {
2921
- surface: {
2922
- card: {
2923
- root: "rounded-radius-xl border border-border-subtle bg-bg-surface p-pad-3xl shadow-sh-sm"
3682
+ variant: {
3683
+ date: {
3684
+ // sem réguas o chip centralizado
3685
+ root: "py-pad-2xs"
2924
3686
  },
2925
- plain: { root: "p-pad-3xl" }
2926
- },
2927
- tone: {
2928
- brand: { iconBox: "bg-bg-brand-subtle text-fg-brand" },
2929
- success: { iconBox: "bg-bg-success-muted text-fg-success" },
2930
- warning: { iconBox: "bg-bg-warning-muted text-fg-warning" },
2931
- info: { iconBox: "bg-bg-info-muted text-fg-info" },
2932
- danger: { iconBox: "bg-bg-danger-muted text-fg-danger" },
2933
- neutral: { iconBox: "bg-bg-muted text-fg-muted" }
3687
+ boundary: {
3688
+ // chip ladeado por 2 réguas finas, com respiro lateral
3689
+ root: "gap-gp-md py-pad-md"
3690
+ }
2934
3691
  }
2935
3692
  },
2936
3693
  defaultVariants: {
2937
- surface: "card",
2938
- tone: "neutral"
3694
+ variant: "date"
2939
3695
  }
2940
3696
  });
2941
- const kpiGroup = tv({
2942
- base: "grid w-full",
3697
+ function DateSeparatorChip({
3698
+ label,
3699
+ variant = "date",
3700
+ icon,
3701
+ className
3702
+ }) {
3703
+ const styles2 = dateSeparatorChipStyles({ variant });
3704
+ const isBoundary = variant === "boundary";
3705
+ const chip = /* @__PURE__ */ jsxs(Chip, { color: "neutral", variant: "soft", size: "sm", className: styles2.chip(), children: [
3706
+ icon ? /* @__PURE__ */ jsx(Icon, { name: icon, size: "xs" }) : null,
3707
+ label
3708
+ ] });
3709
+ return /* @__PURE__ */ jsx("div", { role: "separator", "aria-label": label, className: cn(styles2.root(), className), children: isBoundary ? /* @__PURE__ */ jsxs(Fragment, { children: [
3710
+ /* @__PURE__ */ jsx(Separator, { decorative: true, className: styles2.rule() }),
3711
+ chip,
3712
+ /* @__PURE__ */ jsx(Separator, { decorative: true, className: styles2.rule() })
3713
+ ] }) : chip });
3714
+ }
3715
+ const emptyStateStyles = tv({
3716
+ slots: {
3717
+ root: "flex flex-col items-center justify-center gap-gp-md text-center",
3718
+ icon: "inline-flex shrink-0 items-center justify-center text-fg-subtle [&_svg]:size-full",
3719
+ title: "text-fg-strong",
3720
+ description: "text-body-sm text-fg-muted max-w-[360px]",
3721
+ action: "mt-gp-xs"
3722
+ },
2943
3723
  variants: {
2944
- columns: {
2945
- 2: "grid-cols-1 sm:grid-cols-2",
2946
- 3: "grid-cols-1 sm:grid-cols-2 lg:grid-cols-3",
2947
- 4: "grid-cols-1 sm:grid-cols-2 lg:grid-cols-4",
2948
- 5: "grid-cols-1 sm:grid-cols-2 lg:grid-cols-5",
2949
- 6: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-6"
2950
- },
2951
- divided: {
2952
- // 1 card único com divisórias (linha no mobile, coluna no sm+)
2953
- true: "overflow-hidden rounded-radius-xl border border-border-subtle bg-bg-surface shadow-sh-sm divide-y divide-border-subtle sm:divide-y-0 sm:divide-x",
2954
- false: "gap-gp-2xl"
3724
+ size: {
3725
+ sm: {
3726
+ icon: "size-icon-xl",
3727
+ title: "text-title-sm"
3728
+ },
3729
+ md: {
3730
+ icon: "size-icon-2xl",
3731
+ title: "text-title-sm"
3732
+ },
3733
+ lg: {
3734
+ icon: "size-icon-2xl",
3735
+ title: "text-title-md"
3736
+ }
2955
3737
  }
2956
3738
  },
2957
3739
  defaultVariants: {
2958
- columns: 4,
2959
- divided: false
3740
+ size: "md"
2960
3741
  }
2961
3742
  });
2962
- const KpiSurfaceContext = createContext("card");
2963
- function KpiGroup({
2964
- columns = 4,
2965
- divided = false,
2966
- children,
2967
- className
2968
- }) {
2969
- return /* @__PURE__ */ jsx(KpiSurfaceContext.Provider, { value: divided ? "plain" : "card", children: /* @__PURE__ */ jsx("div", { className: cn(kpiGroup({ columns, divided }), className), children }) });
3743
+ const ACTION_BUTTON_SIZE = {
3744
+ sm: "sm",
3745
+ md: "md",
3746
+ lg: "lg"
3747
+ };
3748
+ function isActionConfig(action) {
3749
+ return !isValidElement(action) && typeof action === "object" && action !== null && "label" in action && "onClick" in action;
2970
3750
  }
2971
- KpiGroup.displayName = "KpiGroup";
2972
- function Kpi({
2973
- label,
2974
- value,
2975
- delta,
2976
- hint,
3751
+ function renderIcon(icon) {
3752
+ if (icon == null || isValidElement(icon)) return icon;
3753
+ if (typeof icon === "function" || typeof icon === "object" && "$$typeof" in icon) {
3754
+ return createElement(
3755
+ icon,
3756
+ { "aria-hidden": true }
3757
+ );
3758
+ }
3759
+ return icon;
3760
+ }
3761
+ function EmptyState({
2977
3762
  icon,
2978
- tone = "neutral",
2979
- footnote,
2980
- children,
2981
- surface,
3763
+ title: title2,
3764
+ description: description2,
3765
+ action,
3766
+ size = "md",
2982
3767
  className
2983
3768
  }) {
2984
- const inherited = useContext(KpiSurfaceContext);
2985
- const s3 = kpi({ surface: surface ?? inherited, tone });
2986
- return /* @__PURE__ */ jsxs("article", { className: cn(s3.root(), className), children: [
2987
- /* @__PURE__ */ jsxs("header", { className: s3.header(), children: [
2988
- /* @__PURE__ */ jsx("h3", { className: s3.label(), children: label }),
2989
- icon && /* @__PURE__ */ jsx("span", { className: s3.iconBox(), "aria-hidden": true, children: icon })
2990
- ] }),
2991
- /* @__PURE__ */ jsxs("div", { className: s3.main(), children: [
2992
- /* @__PURE__ */ jsxs("div", { className: s3.valueRow(), children: [
2993
- /* @__PURE__ */ jsx("span", { className: s3.value(), children: value }),
2994
- delta
2995
- ] }),
2996
- hint && /* @__PURE__ */ jsx("span", { className: s3.hint(), children: hint })
2997
- ] }),
2998
- children && /* @__PURE__ */ jsx("div", { className: s3.chart(), children }),
2999
- footnote && /* @__PURE__ */ jsx("div", { className: s3.footnote(), children: footnote })
3769
+ const styles2 = emptyStateStyles({ size });
3770
+ return /* @__PURE__ */ jsxs("div", { className: styles2.root({ className }), children: [
3771
+ icon != null && /* @__PURE__ */ jsx("span", { className: styles2.icon(), "aria-hidden": "true", children: renderIcon(icon) }),
3772
+ /* @__PURE__ */ jsx("h3", { className: styles2.title(), children: title2 }),
3773
+ description2 && /* @__PURE__ */ jsx("p", { className: styles2.description(), children: description2 }),
3774
+ action != null && (isActionConfig(action) ? /* @__PURE__ */ jsx("div", { className: styles2.action(), children: /* @__PURE__ */ jsx(
3775
+ Button,
3776
+ {
3777
+ type: "button",
3778
+ size: ACTION_BUTTON_SIZE[size],
3779
+ color: action.color,
3780
+ variant: action.variant,
3781
+ onClick: action.onClick,
3782
+ children: action.label
3783
+ }
3784
+ ) }) : /* @__PURE__ */ jsx("div", { className: styles2.action(), children: action }))
3000
3785
  ] });
3001
3786
  }
3002
- Kpi.displayName = "Kpi";
3003
- function KpiDelta({
3787
+ const fileUploadFieldStyles = tv({
3788
+ slots: {
3789
+ dropzone: [
3790
+ "flex w-full flex-col items-center justify-center text-center",
3791
+ "min-h-form-xl gap-gp-xs px-pad-2xl py-pad-lg",
3792
+ "rounded-radius-xl bg-bg-muted",
3793
+ "border border-dashed border-border-default",
3794
+ "transition-[color,box-shadow,background-color,border-color] duration-200 ease-out",
3795
+ "cursor-pointer hover:border-border-brand",
3796
+ // Padrão 1 — focus estático
3797
+ "focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-ring-brand"
3798
+ ],
3799
+ dropIcon: "text-fg-subtle",
3800
+ dropText: "text-body-sm text-fg-muted",
3801
+ dropHint: "text-caption-md text-fg-subtle",
3802
+ fileRow: [
3803
+ "flex w-full items-center gap-gp-sm",
3804
+ "min-h-form-xl px-pad-xl py-pad-md",
3805
+ "rounded-radius-xl bg-bg-muted border border-border-subtle"
3806
+ ],
3807
+ thumb: [
3808
+ "size-icon-2xl shrink-0 rounded-radius-md object-cover",
3809
+ "border border-border-subtle"
3810
+ ],
3811
+ fileChipWrap: "flex min-w-0 flex-1 items-center",
3812
+ fileName: "min-w-0 truncate",
3813
+ removeWrap: "ml-auto shrink-0"
3814
+ },
3815
+ variants: {
3816
+ disabled: {
3817
+ // DS v3 não tem token bg-disabled/border-disabled → padrão Button = opacity-50 (L-006)
3818
+ true: {
3819
+ dropzone: "pointer-events-none opacity-50",
3820
+ fileRow: "opacity-50"
3821
+ }
3822
+ }
3823
+ },
3824
+ defaultVariants: { disabled: false }
3825
+ });
3826
+ function resolveIsImage(value, preview, accept) {
3827
+ if (preview === "image") return true;
3828
+ if (preview === "file") return false;
3829
+ if (value instanceof File) return value.type.startsWith("image/");
3830
+ if (accept) return /image\//.test(accept) || /\.(png|jpe?g|gif|webp|svg|avif)/i.test(accept);
3831
+ return /\.(png|jpe?g|gif|webp|svg|avif)(\?|$)/i.test(value);
3832
+ }
3833
+ function matchesAccept(file, accept) {
3834
+ if (!accept) return true;
3835
+ const tokens = accept.split(",").map((t2) => t2.trim().toLowerCase());
3836
+ const name = file.name.toLowerCase();
3837
+ const mime = file.type.toLowerCase();
3838
+ return tokens.some((token) => {
3839
+ if (!token) return false;
3840
+ if (token.startsWith(".")) return name.endsWith(token);
3841
+ if (token.endsWith("/*")) return mime.startsWith(token.slice(0, token.length - 1));
3842
+ return mime === token;
3843
+ });
3844
+ }
3845
+ function FileUploadField({
3004
3846
  value,
3005
- tone = "success",
3006
- direction,
3847
+ onChange,
3848
+ accept,
3849
+ maxSizeMB,
3850
+ preview = "auto",
3851
+ fileName,
3852
+ label,
3853
+ required,
3854
+ state,
3855
+ errorMessage,
3856
+ helperText,
3857
+ onError,
3858
+ disabled,
3859
+ id,
3007
3860
  className
3008
3861
  }) {
3009
- return /* @__PURE__ */ jsxs(
3010
- Chip,
3862
+ const inputRef = useRef(null);
3863
+ const styles2 = fileUploadFieldStyles({ disabled });
3864
+ const [objectUrl, setObjectUrl] = useState(null);
3865
+ useEffect(() => {
3866
+ if (value instanceof File) {
3867
+ const url = URL.createObjectURL(value);
3868
+ setObjectUrl(url);
3869
+ return () => URL.revokeObjectURL(url);
3870
+ }
3871
+ setObjectUrl(null);
3872
+ return void 0;
3873
+ }, [value]);
3874
+ const openPicker = () => {
3875
+ if (disabled) return;
3876
+ inputRef.current?.click();
3877
+ };
3878
+ const handleFiles = (file) => {
3879
+ if (!file) return;
3880
+ if (!matchesAccept(file, accept)) {
3881
+ onError?.("type");
3882
+ resetInput();
3883
+ return;
3884
+ }
3885
+ if (maxSizeMB != null && file.size > maxSizeMB * 1024 * 1024) {
3886
+ onError?.("size");
3887
+ resetInput();
3888
+ return;
3889
+ }
3890
+ onChange(file);
3891
+ };
3892
+ const resetInput = () => {
3893
+ if (inputRef.current) inputRef.current.value = "";
3894
+ };
3895
+ const handleRemove = () => {
3896
+ onChange(null);
3897
+ resetInput();
3898
+ };
3899
+ const hint = [
3900
+ accept ? accept : null,
3901
+ maxSizeMB != null ? `máx. ${maxSizeMB}MB` : null
3902
+ ].filter(Boolean).join(" · ");
3903
+ const displayName = value instanceof File ? value.name : fileName ?? "Arquivo";
3904
+ const isImage = value != null && resolveIsImage(value, preview, accept);
3905
+ const imageSrc = value instanceof File ? objectUrl : value;
3906
+ return /* @__PURE__ */ jsx(
3907
+ FormField,
3011
3908
  {
3012
- color: tone,
3013
- variant: "soft",
3014
- size: "sm",
3015
- shape: "pill",
3909
+ label,
3910
+ required,
3911
+ state,
3912
+ errorMessage,
3913
+ helperText,
3016
3914
  className,
3017
- children: [
3018
- direction && /* @__PURE__ */ jsx(
3019
- TrendingUp,
3915
+ id,
3916
+ disabled,
3917
+ children: ({ id: fieldId }) => /* @__PURE__ */ jsxs("div", { children: [
3918
+ /* @__PURE__ */ jsx(
3919
+ "input",
3020
3920
  {
3021
- className: cn("size-[12px]", direction === "down" && "rotate-180"),
3022
- "aria-hidden": true
3921
+ ref: inputRef,
3922
+ id: fieldId,
3923
+ type: "file",
3924
+ accept,
3925
+ disabled,
3926
+ className: "hidden",
3927
+ onChange: (e2) => handleFiles(e2.target.files?.[0])
3023
3928
  }
3024
3929
  ),
3025
- value
3026
- ]
3930
+ value == null ? /* @__PURE__ */ jsxs(
3931
+ "button",
3932
+ {
3933
+ type: "button",
3934
+ onClick: openPicker,
3935
+ disabled,
3936
+ "aria-label": label ? `${label}: clique para anexar` : "Clique para anexar",
3937
+ className: styles2.dropzone(),
3938
+ children: [
3939
+ /* @__PURE__ */ jsx(Icon, { name: "line-cloud-upload", size: "lg", className: styles2.dropIcon() }),
3940
+ /* @__PURE__ */ jsx("span", { className: styles2.dropText(), children: "Clique para anexar" }),
3941
+ hint && /* @__PURE__ */ jsx("span", { className: styles2.dropHint(), children: hint })
3942
+ ]
3943
+ }
3944
+ ) : /* @__PURE__ */ jsxs("div", { className: styles2.fileRow(), children: [
3945
+ isImage && imageSrc ? /* @__PURE__ */ jsx("img", { src: imageSrc, alt: displayName, className: styles2.thumb() }) : /* @__PURE__ */ jsx("div", { className: styles2.fileChipWrap(), children: /* @__PURE__ */ jsxs(Chip, { color: "neutral", variant: "soft", size: "lg", className: "max-w-full", children: [
3946
+ /* @__PURE__ */ jsx(Icon, { name: "line-file", size: "sm" }),
3947
+ /* @__PURE__ */ jsx("span", { className: styles2.fileName(), children: displayName })
3948
+ ] }) }),
3949
+ /* @__PURE__ */ jsx("div", { className: styles2.removeWrap(), children: /* @__PURE__ */ jsx(
3950
+ Button,
3951
+ {
3952
+ type: "button",
3953
+ color: "critical",
3954
+ variant: "ghost",
3955
+ size: "icon-sm",
3956
+ disabled,
3957
+ "aria-label": "Remover arquivo",
3958
+ onClick: handleRemove,
3959
+ children: /* @__PURE__ */ jsx(Icon, { name: "line-bin", size: "sm" })
3960
+ }
3961
+ ) })
3962
+ ] })
3963
+ ] })
3027
3964
  }
3028
3965
  );
3029
3966
  }
3030
- KpiDelta.displayName = "KpiDelta";
3031
- const dialog = tv({
3032
- base: [
3033
- // Override do DialogContent default (grid + p-pad-4xl + rounded-radius-base + shadow-sh-xl)
3034
- "!gap-0 !p-0",
3035
- "border border-border-default",
3036
- "!rounded-radius-2xl !shadow-sh-2xl",
3037
- "outline-float",
3038
- "flex flex-col overflow-hidden",
3039
- "w-[calc(100%-32px)]"
3040
- ],
3967
+ const messageAckStyles = tv({
3968
+ slots: {
3969
+ icon: "inline-block shrink-0 align-middle size-icon-xs"
3970
+ },
3971
+ variants: {
3972
+ tone: {
3973
+ muted: { icon: "text-fg-muted" },
3974
+ success: { icon: "text-fg-success" },
3975
+ danger: { icon: "text-fg-danger" }
3976
+ }
3977
+ },
3978
+ defaultVariants: { tone: "muted" }
3979
+ });
3980
+ const MessageAck = ({ ack, error = false, className }) => {
3981
+ if (error) {
3982
+ const styles22 = messageAckStyles({ tone: "danger" });
3983
+ return /* @__PURE__ */ jsx(AlertCircle, { "aria-hidden": true, className: cn(styles22.icon(), className) });
3984
+ }
3985
+ const tone = ack >= 4 ? "success" : "muted";
3986
+ const styles2 = messageAckStyles({ tone });
3987
+ const iconClassName = cn(styles2.icon(), className);
3988
+ if (ack >= 4) return /* @__PURE__ */ jsx(CheckCheck, { "aria-hidden": true, className: iconClassName });
3989
+ if (ack === 3) return /* @__PURE__ */ jsx(CheckCheck, { "aria-hidden": true, className: iconClassName });
3990
+ if (ack === 2) return /* @__PURE__ */ jsx(Check, { "aria-hidden": true, className: iconClassName });
3991
+ return /* @__PURE__ */ jsx(Clock, { "aria-hidden": true, className: iconClassName });
3992
+ };
3993
+ MessageAck.displayName = "MessageAck";
3994
+ const messageBubbleStyles = tv({
3995
+ slots: {
3996
+ row: "group/bubble flex w-full items-end gap-gp-sm",
3997
+ avatarSlot: "shrink-0 self-end",
3998
+ /* coluna da bolha — limita a 70% da largura da linha (exceção documentada) */
3999
+ column: "relative flex min-w-0 max-w-[70%] flex-col",
4000
+ bubble: [
4001
+ "relative flex min-w-0 flex-col gap-gp-xs",
4002
+ "px-pad-2xl py-pad-lg",
4003
+ "rounded-radius-md shadow-sh-sm",
4004
+ "border border-transparent"
4005
+ ],
4006
+ author: "text-caption-md font-semibold text-fg-brand",
4007
+ /* citação (reply) */
4008
+ quoted: [
4009
+ "mb-gp-xs flex min-w-0 flex-col gap-gp-xs",
4010
+ "border-l-2 border-border-brand-subtle",
4011
+ "rounded-radius-xs bg-bg-muted",
4012
+ "px-pad-lg py-pad-md"
4013
+ ],
4014
+ quotedAuthor: "truncate text-caption-sm font-semibold text-fg-brand",
4015
+ quotedPreview: "flex min-w-0 items-center gap-gp-xs",
4016
+ quotedPreviewText: "truncate text-caption-sm text-fg-muted",
4017
+ quotedThumb: "size-icon-xl shrink-0 rounded-radius-xs object-cover",
4018
+ /* mídia */
4019
+ media: "flex min-w-0 flex-col gap-gp-xs",
4020
+ mediaImage: "max-w-full cursor-pointer rounded-radius-sm object-cover transition-opacity hover:opacity-90 focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-ring-brand",
4021
+ mediaVideo: "max-w-full rounded-radius-sm focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-ring-brand",
4022
+ mediaAudio: "w-full",
4023
+ mediaDoc: [
4024
+ "flex items-center gap-gp-md",
4025
+ "rounded-radius-sm bg-bg-muted",
4026
+ "px-pad-lg py-pad-md"
4027
+ ],
4028
+ mediaDocIcon: "shrink-0 text-fg-brand",
4029
+ mediaDocInfo: "flex min-w-0 flex-col",
4030
+ mediaDocName: "truncate text-body-sm font-semibold text-fg-default",
4031
+ mediaDocHint: "text-caption-sm text-fg-muted",
4032
+ mediaLocation: [
4033
+ "flex items-center gap-gp-md",
4034
+ "rounded-radius-sm bg-bg-muted",
4035
+ "px-pad-lg py-pad-md",
4036
+ "text-body-sm text-fg-default",
4037
+ "transition-colors hover:bg-bg-muted-hover"
4038
+ ],
4039
+ mediaLocationIcon: "shrink-0 text-fg-brand",
4040
+ mediaContact: [
4041
+ "flex items-center gap-gp-md",
4042
+ "rounded-radius-sm bg-bg-muted",
4043
+ "px-pad-lg py-pad-md"
4044
+ ],
4045
+ mediaContactInfo: "flex min-w-0 flex-col",
4046
+ mediaContactName: "truncate text-body-sm font-semibold text-fg-default",
4047
+ mediaContactHint: "text-caption-sm text-fg-muted",
4048
+ /* corpo */
4049
+ body: "min-w-0 text-body-sm text-fg-default",
4050
+ /* corpo de mensagem apagada */
4051
+ deleted: [
4052
+ "flex items-center gap-gp-xs",
4053
+ "text-body-sm italic text-fg-muted"
4054
+ ],
4055
+ deletedIcon: "shrink-0",
4056
+ /* rodapé */
4057
+ meta: "mt-gp-xs flex items-center justify-end gap-gp-xs self-end",
4058
+ metaTime: "text-caption-sm text-fg-muted tabular-nums",
4059
+ metaEdited: "text-caption-sm italic text-fg-muted",
4060
+ /* ações (hover) */
4061
+ actionsTrigger: [
4062
+ "absolute right-pad-md top-pad-md",
4063
+ "opacity-0 transition-opacity",
4064
+ "group-hover/bubble:opacity-100 focus-visible:opacity-100"
4065
+ ],
4066
+ actionsContent: "flex min-w-0 flex-col gap-gp-xs"
4067
+ },
4068
+ variants: {
4069
+ side: {
4070
+ sent: {
4071
+ row: "flex-row-reverse",
4072
+ column: "items-end",
4073
+ bubble: "bg-bg-success-muted"
4074
+ },
4075
+ received: {
4076
+ row: "flex-row",
4077
+ column: "items-start",
4078
+ bubble: "bg-bg-surface"
4079
+ }
4080
+ },
4081
+ tail: {
4082
+ true: {},
4083
+ false: {}
4084
+ }
4085
+ },
4086
+ compoundVariants: [
4087
+ /* rabeta = canto reto no lado de quem enviou */
4088
+ { side: "sent", tail: true, class: { bubble: "rounded-br-none" } },
4089
+ { side: "received", tail: true, class: { bubble: "rounded-bl-none" } }
4090
+ ],
4091
+ defaultVariants: {
4092
+ side: "received",
4093
+ tail: true
4094
+ }
4095
+ });
4096
+ const styles$1 = messageBubbleStyles();
4097
+ function handleMediaKeyDown(event, onMediaClick) {
4098
+ if (!onMediaClick) return;
4099
+ if (event.key === "Enter" || event.key === " ") {
4100
+ event.preventDefault();
4101
+ onMediaClick();
4102
+ }
4103
+ }
4104
+ function formatTime(value) {
4105
+ const date = value instanceof Date ? value : new Date(value);
4106
+ if (Number.isNaN(date.getTime())) return "";
4107
+ return date.toLocaleTimeString("pt-BR", {
4108
+ hour: "2-digit",
4109
+ minute: "2-digit",
4110
+ hour12: false
4111
+ });
4112
+ }
4113
+ const MEDIA_LABEL = {
4114
+ text: "",
4115
+ image: "Imagem",
4116
+ audio: "Áudio",
4117
+ video: "Vídeo",
4118
+ document: "Documento",
4119
+ location: "Localização",
4120
+ vcard: "Contato",
4121
+ contact: "Contato"
4122
+ };
4123
+ function MessageMediaRenderer({
4124
+ mediaType,
4125
+ mediaUrl,
4126
+ body: body2,
4127
+ onMediaClick
4128
+ }) {
4129
+ switch (mediaType) {
4130
+ case "image":
4131
+ return /* @__PURE__ */ jsx("div", { className: styles$1.media(), children: mediaUrl ? /* @__PURE__ */ jsx(
4132
+ "img",
4133
+ {
4134
+ src: mediaUrl,
4135
+ alt: body2 || "Imagem",
4136
+ className: styles$1.mediaImage(),
4137
+ role: onMediaClick ? "button" : void 0,
4138
+ tabIndex: onMediaClick ? 0 : void 0,
4139
+ onClick: onMediaClick,
4140
+ onKeyDown: (e2) => handleMediaKeyDown(e2, onMediaClick)
4141
+ }
4142
+ ) : null });
4143
+ case "audio":
4144
+ return /* @__PURE__ */ jsx("div", { className: styles$1.media(), children: mediaUrl ? (
4145
+ // eslint-disable-next-line jsx-a11y/media-has-caption
4146
+ /* @__PURE__ */ jsx("audio", { controls: true, src: mediaUrl, className: styles$1.mediaAudio() })
4147
+ ) : null });
4148
+ case "video":
4149
+ return /* @__PURE__ */ jsx("div", { className: styles$1.media(), children: mediaUrl ? (
4150
+ // eslint-disable-next-line jsx-a11y/media-has-caption
4151
+ /* @__PURE__ */ jsx(
4152
+ "video",
4153
+ {
4154
+ controls: true,
4155
+ src: mediaUrl,
4156
+ className: styles$1.mediaVideo(),
4157
+ role: onMediaClick ? "button" : void 0,
4158
+ tabIndex: onMediaClick ? 0 : void 0,
4159
+ onClick: onMediaClick,
4160
+ onKeyDown: (e2) => handleMediaKeyDown(e2, onMediaClick)
4161
+ }
4162
+ )
4163
+ ) : null });
4164
+ case "document":
4165
+ return /* @__PURE__ */ jsxs("div", { className: styles$1.mediaDoc(), children: [
4166
+ /* @__PURE__ */ jsx(
4167
+ Icon,
4168
+ {
4169
+ name: "line-file",
4170
+ size: "lg",
4171
+ className: styles$1.mediaDocIcon()
4172
+ }
4173
+ ),
4174
+ /* @__PURE__ */ jsxs("div", { className: styles$1.mediaDocInfo(), children: [
4175
+ /* @__PURE__ */ jsx("span", { className: styles$1.mediaDocName(), children: body2 || "Documento" }),
4176
+ /* @__PURE__ */ jsx("span", { className: styles$1.mediaDocHint(), children: "Toque para baixar" })
4177
+ ] }),
4178
+ mediaUrl ? /* @__PURE__ */ jsx(
4179
+ Button,
4180
+ {
4181
+ type: "button",
4182
+ size: "xs",
4183
+ variant: "ghost",
4184
+ color: "primary",
4185
+ "aria-label": "Baixar documento",
4186
+ onClick: onMediaClick,
4187
+ children: /* @__PURE__ */ jsx(Icon, { name: "line-download-01", size: "sm" })
4188
+ }
4189
+ ) : null
4190
+ ] });
4191
+ case "location":
4192
+ return mediaUrl ? /* @__PURE__ */ jsxs(
4193
+ "a",
4194
+ {
4195
+ href: mediaUrl,
4196
+ target: "_blank",
4197
+ rel: "noopener noreferrer",
4198
+ className: styles$1.mediaLocation(),
4199
+ onClick: onMediaClick,
4200
+ children: [
4201
+ /* @__PURE__ */ jsx(
4202
+ Icon,
4203
+ {
4204
+ name: "line-pin",
4205
+ size: "md",
4206
+ className: styles$1.mediaLocationIcon()
4207
+ }
4208
+ ),
4209
+ /* @__PURE__ */ jsx("span", { children: body2 || "Ver localização" })
4210
+ ]
4211
+ }
4212
+ ) : /* @__PURE__ */ jsxs("div", { className: styles$1.mediaLocation(), children: [
4213
+ /* @__PURE__ */ jsx(
4214
+ Icon,
4215
+ {
4216
+ name: "line-pin",
4217
+ size: "md",
4218
+ className: styles$1.mediaLocationIcon()
4219
+ }
4220
+ ),
4221
+ /* @__PURE__ */ jsx("span", { children: body2 || "Localização" })
4222
+ ] });
4223
+ case "vcard":
4224
+ case "contact":
4225
+ return /* @__PURE__ */ jsxs("div", { className: styles$1.mediaContact(), children: [
4226
+ /* @__PURE__ */ jsx(
4227
+ Icon,
4228
+ {
4229
+ name: "line-user",
4230
+ size: "lg",
4231
+ className: styles$1.mediaDocIcon()
4232
+ }
4233
+ ),
4234
+ /* @__PURE__ */ jsxs("div", { className: styles$1.mediaContactInfo(), children: [
4235
+ /* @__PURE__ */ jsx("span", { className: styles$1.mediaContactName(), children: body2 || "Contato" }),
4236
+ /* @__PURE__ */ jsx("span", { className: styles$1.mediaContactHint(), children: "Cartão de contato" })
4237
+ ] })
4238
+ ] });
4239
+ case "text":
4240
+ default:
4241
+ return null;
4242
+ }
4243
+ }
4244
+ function MessageBubble({
4245
+ side,
4246
+ body: body2,
4247
+ createdAt,
4248
+ ack,
4249
+ ackError,
4250
+ mediaType = "text",
4251
+ mediaUrl,
4252
+ media,
4253
+ quotedMessage,
4254
+ isEdited = false,
4255
+ isDeleted = false,
4256
+ tail = true,
4257
+ authorName,
4258
+ avatar,
4259
+ actions,
4260
+ onMediaClick,
4261
+ className
4262
+ }) {
4263
+ const [actionsOpen, setActionsOpen] = useState(false);
4264
+ const s2 = messageBubbleStyles({ side, tail });
4265
+ const time = formatTime(createdAt);
4266
+ const hasMedia = !isDeleted && mediaType !== "text";
4267
+ const showAck = side === "sent" && ack !== void 0 && !isDeleted;
4268
+ return /* @__PURE__ */ jsxs("div", { className: s2.row({ className }), children: [
4269
+ avatar ? /* @__PURE__ */ jsx("div", { className: s2.avatarSlot(), children: avatar }) : null,
4270
+ /* @__PURE__ */ jsx("div", { className: s2.column(), children: /* @__PURE__ */ jsxs("div", { className: s2.bubble(), children: [
4271
+ actions && !isDeleted ? /* @__PURE__ */ jsxs(
4272
+ Popover,
4273
+ {
4274
+ open: actionsOpen,
4275
+ onOpenChange: setActionsOpen,
4276
+ modal: false,
4277
+ children: [
4278
+ /* @__PURE__ */ jsx(PopoverAnchor, { asChild: true, children: /* @__PURE__ */ jsx(
4279
+ Button,
4280
+ {
4281
+ type: "button",
4282
+ size: "2xs",
4283
+ variant: "ghost",
4284
+ color: "secondary",
4285
+ "aria-label": "Ações da mensagem",
4286
+ "aria-haspopup": "menu",
4287
+ "aria-expanded": actionsOpen,
4288
+ className: s2.actionsTrigger(),
4289
+ onClick: () => setActionsOpen((o2) => !o2),
4290
+ children: /* @__PURE__ */ jsx(MoreVertical, { "aria-hidden": "true" })
4291
+ }
4292
+ ) }),
4293
+ /* @__PURE__ */ jsx(
4294
+ PopoverContent,
4295
+ {
4296
+ align: side === "sent" ? "end" : "start",
4297
+ role: "menu",
4298
+ className: s2.actionsContent(),
4299
+ children: actions
4300
+ }
4301
+ )
4302
+ ]
4303
+ }
4304
+ ) : null,
4305
+ authorName && !isDeleted ? /* @__PURE__ */ jsx("span", { className: s2.author(), children: authorName }) : null,
4306
+ quotedMessage && !isDeleted ? /* @__PURE__ */ jsxs("div", { className: s2.quoted(), children: [
4307
+ quotedMessage.authorName ? /* @__PURE__ */ jsx("span", { className: s2.quotedAuthor(), children: quotedMessage.fromMe ? "Você" : quotedMessage.authorName }) : null,
4308
+ /* @__PURE__ */ jsxs("div", { className: s2.quotedPreview(), children: [
4309
+ quotedMessage.mediaType === "image" && quotedMessage.mediaUrl ? /* @__PURE__ */ jsx(
4310
+ "img",
4311
+ {
4312
+ src: quotedMessage.mediaUrl,
4313
+ alt: "",
4314
+ className: s2.quotedThumb()
4315
+ }
4316
+ ) : null,
4317
+ /* @__PURE__ */ jsx("span", { className: s2.quotedPreviewText(), children: quotedMessage.body ? /* @__PURE__ */ jsx(MarkdownText, { inline: true, children: quotedMessage.body }) : MEDIA_LABEL[quotedMessage.mediaType ?? "text"] || "Mensagem" })
4318
+ ] })
4319
+ ] }) : null,
4320
+ isDeleted ? /* @__PURE__ */ jsxs("span", { className: s2.deleted(), children: [
4321
+ /* @__PURE__ */ jsx(Ban, { className: s2.deletedIcon(), "aria-hidden": "true" }),
4322
+ "Mensagem apagada"
4323
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
4324
+ hasMedia ? media ?? /* @__PURE__ */ jsx(
4325
+ MessageMediaRenderer,
4326
+ {
4327
+ mediaType,
4328
+ mediaUrl,
4329
+ body: body2,
4330
+ onMediaClick
4331
+ }
4332
+ ) : null,
4333
+ body2 && (mediaType === "text" || !hasMedia) ? /* @__PURE__ */ jsx(MarkdownText, { className: s2.body(), children: body2 }) : null
4334
+ ] }),
4335
+ /* @__PURE__ */ jsxs("div", { className: s2.meta(), children: [
4336
+ isEdited && !isDeleted ? /* @__PURE__ */ jsx("span", { className: s2.metaEdited(), children: "editada" }) : null,
4337
+ /* @__PURE__ */ jsx("span", { className: s2.metaTime(), children: time }),
4338
+ showAck ? /* @__PURE__ */ jsx(MessageAck, { ack, error: ackError }) : null
4339
+ ] })
4340
+ ] }) })
4341
+ ] });
4342
+ }
4343
+ MessageBubble.displayName = "MessageBubble";
4344
+ const messageComposerStyles = tv({
4345
+ slots: {
4346
+ root: [
4347
+ "flex w-full flex-col",
4348
+ "rounded-radius-lg border border-border-subtle",
4349
+ "bg-bg-surface dark:bg-bg-muted",
4350
+ "shadow-sh-sm",
4351
+ "transition-[border-color,box-shadow,background-color]",
4352
+ "focus-within:border-border-brand focus-within:shadow-sh-ring"
4353
+ ],
4354
+ replyPreview: "border-b border-border-subtle px-pad-2xl py-pad-lg",
4355
+ banner: [
4356
+ "border-b border-border-subtle px-pad-2xl py-pad-lg",
4357
+ "text-body-sm text-fg-muted"
4358
+ ],
4359
+ field: "flex w-full items-end gap-gp-md",
4360
+ toolbarStart: "flex shrink-0 items-center gap-gp-xs",
4361
+ toolbarEnd: "flex shrink-0 items-center gap-gp-xs",
4362
+ inputArea: "flex min-w-0 flex-1 items-end",
4363
+ recording: "flex min-w-0 flex-1 items-center",
4364
+ textarea: [
4365
+ // funde a textarea na moldura externa: sem borda/ring/bg/shadow próprios
4366
+ "min-h-form-lg w-full resize-none",
4367
+ "border-none bg-transparent shadow-none",
4368
+ "px-pad-md py-pad-md",
4369
+ "focus-visible:shadow-none focus-visible:border-none",
4370
+ "hover:bg-transparent dark:hover:bg-transparent",
4371
+ "disabled:hover:bg-transparent dark:disabled:hover:bg-transparent"
4372
+ ],
4373
+ send: "shrink-0"
4374
+ },
4375
+ variants: {
4376
+ size: {
4377
+ sm: {
4378
+ field: "px-pad-md py-pad-sm",
4379
+ textarea: "min-h-form-md max-h-[160px] text-body-sm"
4380
+ },
4381
+ md: {
4382
+ field: "px-pad-lg py-pad-md",
4383
+ textarea: "min-h-form-lg max-h-[200px] text-body-sm"
4384
+ }
4385
+ },
4386
+ state: {
4387
+ open: {},
4388
+ disabled: { root: "opacity-60" },
4389
+ "read-only": {}
4390
+ }
4391
+ },
4392
+ compoundVariants: [
4393
+ // disabled SEMPRE por último (L-006)
4394
+ {
4395
+ state: "disabled",
4396
+ class: { root: "pointer-events-none" }
4397
+ }
4398
+ ],
4399
+ defaultVariants: {
4400
+ size: "md",
4401
+ state: "open"
4402
+ }
4403
+ });
4404
+ const MessageComposer = forwardRef(function MessageComposer2({
4405
+ value,
4406
+ onChange,
4407
+ onSend,
4408
+ onKeyDown,
4409
+ placeholder,
4410
+ state = "open",
4411
+ size = "md",
4412
+ toolbarStart,
4413
+ toolbarEnd,
4414
+ replyPreview,
4415
+ banner,
4416
+ sending = false,
4417
+ recording,
4418
+ className
4419
+ }, ref) {
4420
+ const innerRef = useRef(null);
4421
+ const setRefs = useCallback(
4422
+ (node) => {
4423
+ innerRef.current = node;
4424
+ if (typeof ref === "function") ref(node);
4425
+ else if (ref) ref.current = node;
4426
+ },
4427
+ [ref]
4428
+ );
4429
+ useLayoutEffect(() => {
4430
+ const el = innerRef.current;
4431
+ if (!el) return;
4432
+ el.style.height = "auto";
4433
+ el.style.height = `${el.scrollHeight}px`;
4434
+ }, [value]);
4435
+ const isDisabled = state === "disabled";
4436
+ const isReadOnly = state === "read-only";
4437
+ const canSend = value.trim().length > 0 && !isDisabled && !sending;
4438
+ const styles2 = messageComposerStyles({ size, state });
4439
+ const handleKeyDown = (event) => {
4440
+ onKeyDown?.(event);
4441
+ if (event.defaultPrevented) return;
4442
+ if (event.key === "Enter" && !event.shiftKey) {
4443
+ event.preventDefault();
4444
+ if (canSend) onSend();
4445
+ }
4446
+ };
4447
+ return /* @__PURE__ */ jsxs("div", { className: styles2.root({ className }), children: [
4448
+ replyPreview ? /* @__PURE__ */ jsx("div", { className: styles2.replyPreview(), children: replyPreview }) : null,
4449
+ banner ? /* @__PURE__ */ jsx("div", { className: styles2.banner(), children: banner }) : null,
4450
+ !isReadOnly && /* @__PURE__ */ jsxs(Fragment, { children: [
4451
+ (replyPreview || banner) && /* @__PURE__ */ jsx(Separator, {}),
4452
+ /* @__PURE__ */ jsxs("div", { className: styles2.field(), children: [
4453
+ toolbarStart ? /* @__PURE__ */ jsx("div", { className: styles2.toolbarStart(), children: toolbarStart }) : null,
4454
+ recording ? /* @__PURE__ */ jsx("div", { className: styles2.recording(), children: recording }) : /* @__PURE__ */ jsx("div", { className: styles2.inputArea(), children: /* @__PURE__ */ jsx(
4455
+ Textarea,
4456
+ {
4457
+ ref: setRefs,
4458
+ rows: 1,
4459
+ value,
4460
+ disabled: isDisabled,
4461
+ placeholder,
4462
+ "aria-label": placeholder ?? "Mensagem",
4463
+ className: styles2.textarea(),
4464
+ onChange: (e2) => onChange(e2.target.value),
4465
+ onKeyDown: handleKeyDown
4466
+ }
4467
+ ) }),
4468
+ toolbarEnd ? /* @__PURE__ */ jsx("div", { className: styles2.toolbarEnd(), children: toolbarEnd }) : null,
4469
+ !recording && /* @__PURE__ */ jsx(
4470
+ Button,
4471
+ {
4472
+ type: "button",
4473
+ size: size === "sm" ? "icon-sm" : "icon-md",
4474
+ color: "primary",
4475
+ variant: "filled",
4476
+ loading: sending,
4477
+ disabled: !canSend,
4478
+ "aria-label": "Enviar mensagem",
4479
+ className: styles2.send(),
4480
+ onClick: () => {
4481
+ if (canSend) onSend();
4482
+ },
4483
+ children: /* @__PURE__ */ jsx(Icon, { name: "line-telegram" })
4484
+ }
4485
+ )
4486
+ ] })
4487
+ ] })
4488
+ ] });
4489
+ });
4490
+ const messageVariablesPickerStyles = tv({
4491
+ slots: {
4492
+ /** Container interno do PopoverContent. */
4493
+ content: "flex flex-col gap-gp-md p-sp-sm min-w-[200px]",
4494
+ /** Header opcional ("Variáveis disponíveis"). */
4495
+ header: "text-caption-md text-fg-muted px-pad-md",
4496
+ /** Lista de chips. */
4497
+ list: "flex flex-wrap gap-gp-xs",
4498
+ /** Estado vazio. */
4499
+ empty: "text-caption-md text-fg-subtle px-pad-md"
4500
+ },
4501
+ variants: {
4502
+ size: {
4503
+ sm: {},
4504
+ md: { content: "min-w-[240px]" }
4505
+ }
4506
+ },
4507
+ defaultVariants: { size: "sm" }
4508
+ });
4509
+ const DEFAULT_MESSAGE_VARIABLES = [
4510
+ { token: "{{firstName}}", label: "Primeiro Nome" },
4511
+ { token: "{{name}} ", label: "Nome" },
4512
+ { token: "{{ms}} ", label: "Saudação" },
4513
+ { token: "{{protocol}} ", label: "Protocolo" },
4514
+ { token: "{{hora}} ", label: "Hora" }
4515
+ ];
4516
+ function MessageVariablesPicker({
4517
+ onSelect,
4518
+ variables = DEFAULT_MESSAGE_VARIABLES,
4519
+ label = "Variáveis",
4520
+ triggerVariant = "icon",
4521
+ open: openProp,
4522
+ onOpenChange,
4523
+ closeOnSelect = true,
4524
+ size = "sm",
4525
+ className,
4526
+ disabled
4527
+ }) {
4528
+ const styles2 = messageVariablesPickerStyles({ size });
4529
+ const [openState, setOpenState] = useState(false);
4530
+ const isControlled = openProp !== void 0;
4531
+ const open = isControlled ? openProp : openState;
4532
+ const setOpen = (next) => {
4533
+ if (!isControlled) setOpenState(next);
4534
+ onOpenChange?.(next);
4535
+ };
4536
+ const handleSelect = (token) => {
4537
+ onSelect(token);
4538
+ if (closeOnSelect) setOpen(false);
4539
+ };
4540
+ const buttonSize = triggerVariant === "icon" ? size === "md" ? "icon-md" : "icon-sm" : size;
4541
+ return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
4542
+ /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: triggerVariant === "icon" ? /* @__PURE__ */ jsx(
4543
+ Button,
4544
+ {
4545
+ type: "button",
4546
+ color: "primary",
4547
+ variant: "ghost",
4548
+ size: buttonSize,
4549
+ disabled,
4550
+ className,
4551
+ "aria-label": "Inserir variável",
4552
+ "aria-haspopup": "dialog",
4553
+ children: /* @__PURE__ */ jsx(Icon, { name: "line-code" })
4554
+ }
4555
+ ) : /* @__PURE__ */ jsx(
4556
+ Button,
4557
+ {
4558
+ type: "button",
4559
+ color: "primary",
4560
+ variant: "ghost",
4561
+ size: buttonSize,
4562
+ disabled,
4563
+ className,
4564
+ "aria-haspopup": "dialog",
4565
+ iconLeft: /* @__PURE__ */ jsx(Icon, { name: "line-code" }),
4566
+ children: label
4567
+ }
4568
+ ) }),
4569
+ /* @__PURE__ */ jsx(PopoverContent, { align: "start", sideOffset: 6, mobileSheet: true, children: /* @__PURE__ */ jsxs("div", { className: styles2.content(), children: [
4570
+ variables.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
4571
+ /* @__PURE__ */ jsx("span", { className: styles2.header(), children: "Variáveis disponíveis" }),
4572
+ /* @__PURE__ */ jsx(Separator, {})
4573
+ ] }),
4574
+ variables.length === 0 ? /* @__PURE__ */ jsx("span", { className: styles2.empty(), children: "Nenhuma variável disponível" }) : /* @__PURE__ */ jsx("div", { className: styles2.list(), children: variables.map((variable) => /* @__PURE__ */ jsx(
4575
+ Chip,
4576
+ {
4577
+ color: "primary",
4578
+ variant: "soft",
4579
+ size: "sm",
4580
+ asButton: true,
4581
+ "aria-label": `Inserir ${variable.label}`,
4582
+ onMouseDown: (e2) => e2.preventDefault(),
4583
+ onClick: () => handleSelect(variable.token),
4584
+ children: variable.label
4585
+ },
4586
+ variable.token
4587
+ )) })
4588
+ ] }) })
4589
+ ] });
4590
+ }
4591
+ const dialog = tv({
4592
+ base: [
4593
+ // Override do DialogContent default (grid + p-pad-4xl + rounded-radius-base + shadow-sh-xl)
4594
+ "!gap-0 !p-0",
4595
+ "border border-border-default",
4596
+ "!rounded-radius-2xl !shadow-sh-2xl",
4597
+ "outline-float",
4598
+ "flex flex-col overflow-hidden",
4599
+ "w-[calc(100%-32px)]",
4600
+ // Teto de altura + body rolável (ver `body` abaixo).
4601
+ //
4602
+ // Sem isto, modal com conteúdo alto CRESCE ALÉM DA TELA e o
4603
+ // `overflow-hidden` acima corta o resto — sem barra de rolagem, sem chegar
4604
+ // no rodapé, sem alcançar os botões. Vale para todo modal do sistema; foi
4605
+ // reportado num formulário longo e reproduz em qualquer um.
4606
+ // Mesma convenção de unidade do `w-[calc(...)]` da linha acima. `dvh` em
4607
+ // vez de `vh` por causa da barra do navegador no celular.
4608
+ "max-h-[calc(100dvh-32px)]"
4609
+ ],
3041
4610
  variants: {
3042
4611
  size: {
3043
4612
  sm: "!max-w-[440px]",
3044
4613
  md: "!max-w-[540px]",
3045
- lg: "!max-w-[720px]"
4614
+ lg: "!max-w-[720px]",
4615
+ // Modais de dados (grades com muitas colunas). `full` escala com a viewport
4616
+ // mas mantém margens (não vira tela cheia) e limita em telas ultrawide.
4617
+ xl: "!max-w-[1100px]",
4618
+ full: "!max-w-[min(1400px,92vw)]"
3046
4619
  }
3047
4620
  },
3048
4621
  defaultVariants: { size: "md" }
@@ -3102,7 +4675,13 @@ const description = tv({
3102
4675
  base: "m-0 text-body-xs font-normal text-fg-muted leading-[1.45]"
3103
4676
  });
3104
4677
  const body = tv({
3105
- base: "flex flex-col gap-[18px] px-pad-4xl py-[22px]"
4678
+ // `min-h-0` é o que permite o flex item encolher e a rolagem acontecer aqui,
4679
+ // em vez de o conteúdo empurrar o container para fora da tela. Sem ele,
4680
+ // `overflow-y-auto` não tem efeito nenhum dentro de um flex column.
4681
+ base: [
4682
+ "flex flex-col gap-[18px] px-pad-4xl py-[22px]",
4683
+ "min-h-0 flex-1 overflow-y-auto"
4684
+ ]
3106
4685
  });
3107
4686
  const foot = tv({
3108
4687
  base: [
@@ -3151,15 +4730,15 @@ function Modal({
3151
4730
  {
3152
4731
  className: dialog({ size, className }),
3153
4732
  hideClose: true,
3154
- "aria-labelledby": title$1 ? "modal-title" : void 0,
3155
- "aria-describedby": description$1 ? "modal-description" : void 0,
4733
+ ...description$1 ? {} : { "aria-describedby": void 0 },
3156
4734
  children: [
3157
- !hideClose && /* @__PURE__ */ jsx(DialogClose, { className: closeBtn(), "aria-label": "Fechar", children: /* @__PURE__ */ jsx(X2, { className: "size-icon-sm" }) }),
4735
+ !title$1 && /* @__PURE__ */ jsx(DialogTitle, { className: "sr-only", children: "Diálogo" }),
4736
+ !hideClose && /* @__PURE__ */ jsx(DialogClose, { className: closeBtn(), "aria-label": "Fechar", children: /* @__PURE__ */ jsx(X3, { className: "size-icon-sm" }) }),
3158
4737
  hasHeader && /* @__PURE__ */ jsxs("header", { className: head(), children: [
3159
4738
  icon && /* @__PURE__ */ jsx("span", { className: headIcon(), "aria-hidden": "true", children: icon }),
3160
4739
  (title$1 || description$1) && /* @__PURE__ */ jsxs("div", { className: headTitleWrap(), children: [
3161
- title$1 && /* @__PURE__ */ jsx("h3", { id: "modal-title", className: title(), children: title$1 }),
3162
- description$1 && /* @__PURE__ */ jsx("p", { id: "modal-description", className: description(), children: description$1 })
4740
+ title$1 && /* @__PURE__ */ jsx(DialogTitle, { className: title(), children: title$1 }),
4741
+ description$1 && /* @__PURE__ */ jsx(DialogDescription, { className: description(), children: description$1 })
3163
4742
  ] })
3164
4743
  ] }),
3165
4744
  children !== void 0 && children !== null && /* @__PURE__ */ jsx("div", { className: body(), children }),
@@ -3240,25 +4819,253 @@ function StructuredActions({
3240
4819
  renderPrimary
3241
4820
  ] });
3242
4821
  }
3243
- const TooltipProvider = ({
3244
- delayDuration = 200,
3245
- ...props
3246
- }) => /* @__PURE__ */ jsx(TooltipPrimitive.Provider, { delayDuration, ...props });
3247
- const Tooltip = TooltipPrimitive.Root;
4822
+ const monthYearStyles = tv({
4823
+ slots: {
4824
+ trigger: [
4825
+ "flex min-h-form-lg w-full items-center justify-between gap-gp-md",
4826
+ "rounded-radius-lg px-pad-xl",
4827
+ "bg-bg-input dark:bg-bg-muted",
4828
+ "hover:bg-bg-input-hover dark:hover:bg-bg-muted-hover",
4829
+ "border border-border-input",
4830
+ "text-body-sm font-normal text-fg-default text-left",
4831
+ "transition-[color,box-shadow,background-color,border-color]",
4832
+ "focus-visible:outline-none",
4833
+ "data-[placeholder]:text-fg-muted data-[placeholder]:opacity-70",
4834
+ "focus-visible:border-border-brand data-[state=open]:border-border-brand",
4835
+ "focus-visible:shadow-sh-ring data-[state=open]:shadow-sh-ring",
4836
+ "disabled:cursor-not-allowed disabled:opacity-50",
4837
+ "disabled:hover:bg-bg-input dark:disabled:hover:bg-bg-muted"
4838
+ ],
4839
+ triggerLeadingIcon: "size-icon-sm shrink-0 text-fg-muted",
4840
+ value: "min-w-0 flex-1 truncate",
4841
+ triggerIcon: "size-icon-sm shrink-0 text-fg-muted",
4842
+ // Dropdown compacto — largura própria (não amarra na do trigger, a grade
4843
+ // 3×4 tem largura natural).
4844
+ content: "w-[16rem] p-pad-md",
4845
+ header: "flex items-center justify-between gap-gp-md pb-pad-md",
4846
+ navButton: [
4847
+ "inline-flex size-form-sm items-center justify-center shrink-0",
4848
+ "rounded-radius-base text-fg-muted",
4849
+ "hover:bg-bg-muted hover:text-fg-default",
4850
+ "focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-ring-brand",
4851
+ "disabled:pointer-events-none disabled:opacity-40"
4852
+ ],
4853
+ yearLabel: "text-body-sm font-semibold text-fg-default tabular-nums",
4854
+ grid: "grid grid-cols-3 gap-gp-sm"
4855
+ }
4856
+ });
4857
+ const monthYearMonthButton = tv({
4858
+ base: [
4859
+ "flex items-center justify-center min-h-form-md px-pad-md",
4860
+ "rounded-radius-base text-body-sm font-medium",
4861
+ "transition-[background-color,color]",
4862
+ "focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-ring-brand"
4863
+ ],
4864
+ variants: {
4865
+ selected: {
4866
+ true: "bg-bg-brand text-fg-on-brand hover:bg-bg-brand-hover",
4867
+ false: "text-fg-default hover:bg-bg-muted"
4868
+ },
4869
+ disabled: {
4870
+ true: "pointer-events-none opacity-40"
4871
+ }
4872
+ },
4873
+ defaultVariants: {
4874
+ selected: false
4875
+ }
4876
+ });
4877
+ function parseValue(value) {
4878
+ if (!value) return null;
4879
+ const match = /^(\d{4})-(\d{2})$/.exec(value);
4880
+ if (!match) return null;
4881
+ const year = Number(match[1]);
4882
+ const month = Number(match[2]);
4883
+ if (month < 1 || month > 12) return null;
4884
+ return { year, month };
4885
+ }
4886
+ function toOrdinal(year, monthIndex) {
4887
+ return year * 12 + monthIndex;
4888
+ }
4889
+ function capitalizeFirst(text) {
4890
+ return text.charAt(0).toUpperCase() + text.slice(1);
4891
+ }
4892
+ const MonthYearPicker = forwardRef(function MonthYearPicker2({
4893
+ value,
4894
+ onValueChange,
4895
+ placeholder = "Selecione o mês",
4896
+ min,
4897
+ max,
4898
+ locale = "pt-BR",
4899
+ disabled,
4900
+ open: openProp,
4901
+ defaultOpen,
4902
+ onOpenChange,
4903
+ align = "start",
4904
+ className,
4905
+ contentClassName,
4906
+ "aria-label": ariaLabel
4907
+ }, ref) {
4908
+ const parsed = parseValue(value);
4909
+ const now = /* @__PURE__ */ new Date();
4910
+ const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen ?? false);
4911
+ const isControlled = openProp !== void 0;
4912
+ const open = isControlled ? openProp : uncontrolledOpen;
4913
+ const setOpen = (next) => {
4914
+ if (!isControlled) setUncontrolledOpen(next);
4915
+ onOpenChange?.(next);
4916
+ };
4917
+ const [viewYear, setViewYear] = useState(
4918
+ parsed?.year ?? now.getFullYear()
4919
+ );
4920
+ const monthLabels = useMemo(() => {
4921
+ const fmt = new Intl.DateTimeFormat(locale, { month: "short" });
4922
+ return Array.from(
4923
+ { length: 12 },
4924
+ (_3, i2) => capitalizeFirst(fmt.format(new Date(2020, i2, 1)).replace(/\.$/, ""))
4925
+ );
4926
+ }, [locale]);
4927
+ const triggerLabel = useMemo(() => {
4928
+ if (!parsed) return null;
4929
+ const fmt = new Intl.DateTimeFormat(locale, {
4930
+ month: "long",
4931
+ year: "numeric"
4932
+ });
4933
+ return capitalizeFirst(fmt.format(new Date(parsed.year, parsed.month - 1, 1)));
4934
+ }, [parsed, locale]);
4935
+ const styles2 = monthYearStyles();
4936
+ const minParsed = parseValue(min);
4937
+ const maxParsed = parseValue(max);
4938
+ const minOrdinal = minParsed ? toOrdinal(minParsed.year, minParsed.month - 1) : -Infinity;
4939
+ const maxOrdinal = maxParsed ? toOrdinal(maxParsed.year, maxParsed.month - 1) : Infinity;
4940
+ const isMonthDisabled = (monthIndex) => {
4941
+ const ord = toOrdinal(viewYear, monthIndex);
4942
+ return ord < minOrdinal || ord > maxOrdinal;
4943
+ };
4944
+ const prevYearDisabled = toOrdinal(viewYear - 1, 11) < minOrdinal;
4945
+ const nextYearDisabled = toOrdinal(viewYear + 1, 0) > maxOrdinal;
4946
+ const selectMonth = (monthIndex) => {
4947
+ const next = `${viewYear}-${String(monthIndex + 1).padStart(2, "0")}`;
4948
+ onValueChange?.(next);
4949
+ setOpen(false);
4950
+ };
4951
+ return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
4952
+ /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
4953
+ "button",
4954
+ {
4955
+ ref,
4956
+ type: "button",
4957
+ "aria-label": ariaLabel,
4958
+ "aria-haspopup": "dialog",
4959
+ disabled,
4960
+ "data-placeholder": parsed ? void 0 : "",
4961
+ className: styles2.trigger({ className }),
4962
+ children: [
4963
+ /* @__PURE__ */ jsx(
4964
+ CalendarDays,
4965
+ {
4966
+ className: styles2.triggerLeadingIcon(),
4967
+ "aria-hidden": "true"
4968
+ }
4969
+ ),
4970
+ /* @__PURE__ */ jsx("span", { className: styles2.value(), children: triggerLabel ?? placeholder }),
4971
+ /* @__PURE__ */ jsx(ChevronDown, { className: styles2.triggerIcon(), "aria-hidden": "true" })
4972
+ ]
4973
+ }
4974
+ ) }),
4975
+ /* @__PURE__ */ jsxs(
4976
+ PopoverContent,
4977
+ {
4978
+ align,
4979
+ className: styles2.content({ className: contentClassName }),
4980
+ children: [
4981
+ /* @__PURE__ */ jsxs("div", { className: styles2.header(), children: [
4982
+ /* @__PURE__ */ jsx(
4983
+ "button",
4984
+ {
4985
+ type: "button",
4986
+ className: styles2.navButton(),
4987
+ onClick: () => setViewYear((y2) => y2 - 1),
4988
+ disabled: prevYearDisabled,
4989
+ "aria-label": "Ano anterior",
4990
+ children: /* @__PURE__ */ jsx(ChevronLeft, { className: "size-icon-sm", "aria-hidden": "true" })
4991
+ }
4992
+ ),
4993
+ /* @__PURE__ */ jsx("span", { className: styles2.yearLabel(), "aria-live": "polite", children: viewYear }),
4994
+ /* @__PURE__ */ jsx(
4995
+ "button",
4996
+ {
4997
+ type: "button",
4998
+ className: styles2.navButton(),
4999
+ onClick: () => setViewYear((y2) => y2 + 1),
5000
+ disabled: nextYearDisabled,
5001
+ "aria-label": "Próximo ano",
5002
+ children: /* @__PURE__ */ jsx(ChevronRight, { className: "size-icon-sm", "aria-hidden": "true" })
5003
+ }
5004
+ )
5005
+ ] }),
5006
+ /* @__PURE__ */ jsx("div", { className: styles2.grid(), role: "grid", children: monthLabels.map((label, i2) => {
5007
+ const monthDisabled = isMonthDisabled(i2);
5008
+ const isSelected = parsed?.year === viewYear && parsed?.month === i2 + 1;
5009
+ return /* @__PURE__ */ jsx(
5010
+ "button",
5011
+ {
5012
+ type: "button",
5013
+ role: "gridcell",
5014
+ "aria-pressed": isSelected,
5015
+ disabled: monthDisabled,
5016
+ onClick: () => selectMonth(i2),
5017
+ className: monthYearMonthButton({
5018
+ selected: isSelected,
5019
+ disabled: monthDisabled
5020
+ }),
5021
+ children: label
5022
+ },
5023
+ label
5024
+ );
5025
+ }) })
5026
+ ]
5027
+ }
5028
+ )
5029
+ ] });
5030
+ });
5031
+ MonthYearPicker.displayName = "MonthYearPicker";
5032
+ const TooltipProvider = TooltipPrimitive.Provider;
3248
5033
  const TooltipTrigger = TooltipPrimitive.Trigger;
3249
- const TooltipContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(
5034
+ const Tooltip = ({ children, ...props }) => /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsx(TooltipPrimitive.Root, { ...props, children }) });
5035
+ Tooltip.displayName = "Tooltip";
5036
+ const TooltipContent = React.forwardRef(({ className, sideOffset = 6, showArrow = true, children, ...props }, ref) => /* @__PURE__ */ jsx(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsxs(
3250
5037
  TooltipPrimitive.Content,
3251
5038
  {
3252
5039
  ref,
3253
5040
  sideOffset,
3254
5041
  className: cn(
3255
- "z-50 overflow-hidden rounded-radius-md border border-border-default bg-bg-surface px-pad-lg py-pad-sm text-body-sm text-fg-default shadow-sh-lg",
3256
- "animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]",
5042
+ "z-50 max-w-[16rem] select-none",
5043
+ "bg-bg-emphasis text-fg-default",
5044
+ "rounded-radius-md px-pad-lg py-pad-xs",
5045
+ "text-caption-sm",
5046
+ "shadow-sh-md",
5047
+ "origin-[--radix-tooltip-content-transform-origin]",
5048
+ "data-[state=delayed-open]:animate-in data-[state=instant-open]:animate-in data-[state=closed]:animate-out",
5049
+ "data-[state=closed]:fade-out-0 data-[state=delayed-open]:fade-in-0 data-[state=instant-open]:fade-in-0",
5050
+ "data-[state=closed]:zoom-out-95 data-[state=delayed-open]:zoom-in-95 data-[state=instant-open]:zoom-in-95",
5051
+ "data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2",
5052
+ "data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
3257
5053
  className
3258
5054
  ),
3259
- ...props
5055
+ ...props,
5056
+ children: [
5057
+ children,
5058
+ showArrow && /* @__PURE__ */ jsx(
5059
+ TooltipPrimitive.Arrow,
5060
+ {
5061
+ width: 11,
5062
+ height: 5,
5063
+ className: "fill-bg-emphasis"
5064
+ }
5065
+ )
5066
+ ]
3260
5067
  }
3261
- ));
5068
+ ) }));
3262
5069
  TooltipContent.displayName = TooltipPrimitive.Content.displayName;
3263
5070
  const SingleMenuSidebarContext = createContext({
3264
5071
  expanded: true,
@@ -3282,9 +5089,9 @@ function useSingleMenuSidebarState(defaultExpanded, controlledExpanded, onExpand
3282
5089
  const suppressHoverRef = useRef(false);
3283
5090
  const suppressTimerRef = useRef(null);
3284
5091
  const setExpanded = useCallback(
3285
- (v3) => {
3286
- if (!isControlled) setInternal(v3);
3287
- onExpandedChange?.(v3);
5092
+ (v2) => {
5093
+ if (!isControlled) setInternal(v2);
5094
+ onExpandedChange?.(v2);
3288
5095
  },
3289
5096
  [isControlled, onExpandedChange]
3290
5097
  );
@@ -3414,7 +5221,7 @@ const menuItem = tv({
3414
5221
  const styles = {
3415
5222
  // Header
3416
5223
  header: {
3417
- wrapper: "flex h-16 items-center overflow-hidden px-pad-4xl py-pad-md shrink-0",
5224
+ wrapper: "flex h-layout-navbar items-center overflow-hidden px-pad-4xl py-pad-md shrink-0",
3418
5225
  wrapperCollapsed: "justify-center px-0",
3419
5226
  inner: "flex items-center gap-gp-md",
3420
5227
  logo: "shrink-0",
@@ -3543,34 +5350,34 @@ function SingleMenuModuleSelector({
3543
5350
  options,
3544
5351
  onModuleChange
3545
5352
  }) {
3546
- const s3 = styles.module;
5353
+ const s2 = styles.module;
3547
5354
  const triggerContent = /* @__PURE__ */ jsxs(Fragment, { children: [
3548
- /* @__PURE__ */ jsx("div", { className: s3.iconContainer, children: icon }),
3549
- /* @__PURE__ */ jsxs("div", { className: s3.textContainer, children: [
3550
- /* @__PURE__ */ jsx("span", { className: s3.title, children: title2 }),
3551
- /* @__PURE__ */ jsx("span", { className: s3.subtitle, children: subtitle })
5355
+ /* @__PURE__ */ jsx("div", { className: s2.iconContainer, children: icon }),
5356
+ /* @__PURE__ */ jsxs("div", { className: s2.textContainer, children: [
5357
+ /* @__PURE__ */ jsx("span", { className: s2.title, children: title2 }),
5358
+ /* @__PURE__ */ jsx("span", { className: s2.subtitle, children: subtitle })
3552
5359
  ] }),
3553
- /* @__PURE__ */ jsx(ChevronsUpDown, { className: s3.chevron })
5360
+ /* @__PURE__ */ jsx(ChevronsUpDown, { className: s2.chevron })
3554
5361
  ] });
3555
5362
  if (!options || options.length === 0) {
3556
- return /* @__PURE__ */ jsx("div", { className: s3.trigger, children: triggerContent });
5363
+ return /* @__PURE__ */ jsx("div", { className: s2.trigger, children: triggerContent });
3557
5364
  }
3558
5365
  return /* @__PURE__ */ jsxs(DropdownMenu, { children: [
3559
- /* @__PURE__ */ jsx(DropdownMenuTrigger, { className: s3.trigger, children: triggerContent }),
5366
+ /* @__PURE__ */ jsx(DropdownMenuTrigger, { className: s2.trigger, children: triggerContent }),
3560
5367
  /* @__PURE__ */ jsx(DropdownMenuContent, { side: "bottom", sideOffset: 4, align: "start", children: options.map((option) => {
3561
5368
  const isSelected = option.label === title2;
3562
5369
  return /* @__PURE__ */ jsxs(
3563
5370
  DropdownMenuItem,
3564
5371
  {
3565
5372
  className: cn(
3566
- s3.dropdownItem,
3567
- isSelected && s3.dropdownItemSelected
5373
+ s2.dropdownItem,
5374
+ isSelected && s2.dropdownItemSelected
3568
5375
  ),
3569
5376
  onClick: () => onModuleChange?.(option.id),
3570
5377
  children: [
3571
- /* @__PURE__ */ jsx("div", { className: s3.dropdownItemIcon, children: option.icon }),
3572
- /* @__PURE__ */ jsx("span", { className: s3.dropdownItemLabel, children: option.label }),
3573
- isSelected && /* @__PURE__ */ jsx(Check, { className: s3.dropdownItemCheck })
5378
+ /* @__PURE__ */ jsx("div", { className: s2.dropdownItemIcon, children: option.icon }),
5379
+ /* @__PURE__ */ jsx("span", { className: s2.dropdownItemLabel, children: option.label }),
5380
+ isSelected && /* @__PURE__ */ jsx(Check, { className: s2.dropdownItemCheck })
3574
5381
  ]
3575
5382
  },
3576
5383
  option.id
@@ -3583,13 +5390,13 @@ function SingleMenuSearch({
3583
5390
  placeholder = "Buscar",
3584
5391
  onOpen
3585
5392
  }) {
3586
- const s3 = styles.search;
3587
- return /* @__PURE__ */ jsxs("button", { type: "button", onClick: onOpen, className: s3.wrapper, children: [
3588
- /* @__PURE__ */ jsxs("div", { className: s3.inner, children: [
3589
- /* @__PURE__ */ jsx(Search, { className: s3.icon }),
3590
- /* @__PURE__ */ jsx("span", { className: s3.text, children: placeholder })
5393
+ const s2 = styles.search;
5394
+ return /* @__PURE__ */ jsxs("button", { type: "button", onClick: onOpen, className: s2.wrapper, children: [
5395
+ /* @__PURE__ */ jsxs("div", { className: s2.inner, children: [
5396
+ /* @__PURE__ */ jsx(Search, { className: s2.icon }),
5397
+ /* @__PURE__ */ jsx("span", { className: s2.text, children: placeholder })
3591
5398
  ] }),
3592
- /* @__PURE__ */ jsx("div", { className: s3.shortcutBadge, children: /* @__PURE__ */ jsx("span", { className: s3.shortcutText, children: "⌘K" }) })
5399
+ /* @__PURE__ */ jsx("div", { className: s2.shortcutBadge, children: /* @__PURE__ */ jsx("span", { className: s2.shortcutText, children: "⌘K" }) })
3593
5400
  ] });
3594
5401
  }
3595
5402
  SingleMenuSearch.displayName = "SingleMenuSearch";
@@ -3601,8 +5408,8 @@ function SingleMenuCommand({
3601
5408
  onSelect,
3602
5409
  custom
3603
5410
  }) {
3604
- const leaves = categories.filter((c3) => !c3.items?.length);
3605
- const groups = categories.filter((c3) => c3.items?.length);
5411
+ const leaves = categories.filter((c2) => !c2.items?.length);
5412
+ const groups = categories.filter((c2) => c2.items?.length);
3606
5413
  const handle = (id, parentId) => {
3607
5414
  onSelect(id, parentId);
3608
5415
  onOpenChange(false);
@@ -3612,17 +5419,17 @@ function SingleMenuCommand({
3612
5419
  /* @__PURE__ */ jsxs(CommandList, { children: [
3613
5420
  /* @__PURE__ */ jsx(CommandEmpty, { children: "Nenhum resultado." }),
3614
5421
  custom ?? /* @__PURE__ */ jsxs(Fragment, { children: [
3615
- leaves.length > 0 && /* @__PURE__ */ jsx(CommandGroup, { heading: "Menu", children: leaves.map((c3) => /* @__PURE__ */ jsxs(
5422
+ leaves.length > 0 && /* @__PURE__ */ jsx(CommandGroup, { heading: "Menu", children: leaves.map((c2) => /* @__PURE__ */ jsxs(
3616
5423
  CommandItem,
3617
5424
  {
3618
- value: c3.label,
3619
- onSelect: () => handle(c3.id),
5425
+ value: c2.label,
5426
+ onSelect: () => handle(c2.id),
3620
5427
  children: [
3621
- c3.icon,
3622
- /* @__PURE__ */ jsx("span", { children: c3.label })
5428
+ c2.icon,
5429
+ /* @__PURE__ */ jsx("span", { children: c2.label })
3623
5430
  ]
3624
5431
  },
3625
- c3.id
5432
+ c2.id
3626
5433
  )) }),
3627
5434
  groups.map((cat) => /* @__PURE__ */ jsx(CommandGroup, { heading: cat.label, children: cat.items.map((item) => /* @__PURE__ */ jsx(
3628
5435
  CommandItem,
@@ -3646,10 +5453,10 @@ function SingleMenuItem({
3646
5453
  selected = false,
3647
5454
  onClick
3648
5455
  }) {
3649
- const s3 = menuItem({ selected });
3650
- return /* @__PURE__ */ jsxs("button", { type: "button", onClick, className: s3.root(), children: [
3651
- /* @__PURE__ */ jsx("div", { className: s3.border() }),
3652
- /* @__PURE__ */ jsx("span", { className: s3.text(), children: label })
5456
+ const s2 = menuItem({ selected });
5457
+ return /* @__PURE__ */ jsxs("button", { type: "button", onClick, className: s2.root(), children: [
5458
+ /* @__PURE__ */ jsx("div", { className: s2.border() }),
5459
+ /* @__PURE__ */ jsx("span", { className: s2.text(), children: label })
3653
5460
  ] });
3654
5461
  }
3655
5462
  SingleMenuItem.displayName = "SingleMenuItem";
@@ -3670,7 +5477,7 @@ function SingleMenuCategory({
3670
5477
  const containsActive = hasItems && items.some((item) => item.id === activeItemId);
3671
5478
  const selected = !expanded ? hasItems ? isOpen || containsActive : isLeafActive : hasItems ? isOpen : isLeafActive && openCategoryId == null;
3672
5479
  const state = selected ? "selected" : "default";
3673
- const s3 = category({ state, collapsed: !expanded });
5480
+ const s2 = category({ state, collapsed: !expanded });
3674
5481
  const handleToggle = () => {
3675
5482
  if (hasItems) {
3676
5483
  setOpenCategoryId(isOpen ? null : id);
@@ -3689,23 +5496,23 @@ function SingleMenuCategory({
3689
5496
  role: "button",
3690
5497
  tabIndex: 0,
3691
5498
  onClick: handleToggle,
3692
- onKeyDown: (e3) => {
3693
- if (e3.key === "Enter" || e3.key === " ") {
3694
- e3.preventDefault();
5499
+ onKeyDown: (e2) => {
5500
+ if (e2.key === "Enter" || e2.key === " ") {
5501
+ e2.preventDefault();
3695
5502
  handleToggle();
3696
5503
  }
3697
5504
  },
3698
- className: s3.root(),
3699
- children: /* @__PURE__ */ jsx("span", { className: s3.icon(), children: icon })
5505
+ className: s2.root(),
5506
+ children: /* @__PURE__ */ jsx("span", { className: s2.icon(), children: icon })
3700
5507
  }
3701
5508
  ),
3702
5509
  /* @__PURE__ */ jsx(TooltipContent, { side: "right", sideOffset: 8, children: label })
3703
5510
  ] });
3704
5511
  }
3705
5512
  if (!hasItems) {
3706
- return /* @__PURE__ */ jsxs("button", { type: "button", onClick: handleToggle, className: s3.root(), children: [
3707
- /* @__PURE__ */ jsx("span", { className: s3.icon(), children: icon }),
3708
- /* @__PURE__ */ jsx("span", { className: cn(s3.text(), styles.textFadeIn), children: label })
5513
+ return /* @__PURE__ */ jsxs("button", { type: "button", onClick: handleToggle, className: s2.root(), children: [
5514
+ /* @__PURE__ */ jsx("span", { className: s2.icon(), children: icon }),
5515
+ /* @__PURE__ */ jsx("span", { className: cn(s2.text(), styles.textFadeIn), children: label })
3709
5516
  ] });
3710
5517
  }
3711
5518
  return /* @__PURE__ */ jsxs(
@@ -3717,10 +5524,10 @@ function SingleMenuCategory({
3717
5524
  onCategoryClick?.();
3718
5525
  },
3719
5526
  children: [
3720
- /* @__PURE__ */ jsxs(CollapsibleTrigger, { className: s3.root(), children: [
3721
- /* @__PURE__ */ jsx("span", { className: s3.icon(), children: icon }),
3722
- /* @__PURE__ */ jsx("span", { className: cn(s3.text(), styles.textFadeIn), children: label }),
3723
- /* @__PURE__ */ jsx(ChevronDown, { className: cn(s3.chevron(), isOpen && "rotate-180") })
5527
+ /* @__PURE__ */ jsxs(CollapsibleTrigger, { className: s2.root(), children: [
5528
+ /* @__PURE__ */ jsx("span", { className: s2.icon(), children: icon }),
5529
+ /* @__PURE__ */ jsx("span", { className: cn(s2.text(), styles.textFadeIn), children: label }),
5530
+ /* @__PURE__ */ jsx(ChevronDown, { className: cn(s2.chevron(), isOpen && "rotate-180") })
3724
5531
  ] }),
3725
5532
  /* @__PURE__ */ jsx(CollapsibleContent, { children: /* @__PURE__ */ jsx("div", { className: styles.subItemList, children: items.map((item) => /* @__PURE__ */ jsx(
3726
5533
  SingleMenuItem,
@@ -3744,25 +5551,25 @@ function SingleMenuFooter({
3744
5551
  onAction
3745
5552
  }) {
3746
5553
  const { expanded } = useSingleMenuSidebar();
3747
- const s3 = styles.footer;
5554
+ const s2 = styles.footer;
3748
5555
  const triggerContent = /* @__PURE__ */ jsxs(Fragment, { children: [
3749
- /* @__PURE__ */ jsx("div", { className: s3.avatar, children: avatar ?? /* @__PURE__ */ jsx(User, { className: s3.avatarIcon }) }),
5556
+ /* @__PURE__ */ jsx("div", { className: s2.avatar, children: avatar ?? /* @__PURE__ */ jsx(User, { className: s2.avatarIcon }) }),
3750
5557
  expanded && /* @__PURE__ */ jsxs(Fragment, { children: [
3751
- /* @__PURE__ */ jsxs("div", { className: s3.textContainer, children: [
3752
- /* @__PURE__ */ jsx("span", { className: s3.name, children: name }),
3753
- /* @__PURE__ */ jsx("span", { className: s3.email, children: email })
5558
+ /* @__PURE__ */ jsxs("div", { className: s2.textContainer, children: [
5559
+ /* @__PURE__ */ jsx("span", { className: s2.name, children: name }),
5560
+ /* @__PURE__ */ jsx("span", { className: s2.email, children: email })
3754
5561
  ] }),
3755
- /* @__PURE__ */ jsx(ChevronsUpDown, { className: s3.chevron })
5562
+ /* @__PURE__ */ jsx(ChevronsUpDown, { className: s2.chevron })
3756
5563
  ] })
3757
5564
  ] });
3758
5565
  if (!actions || actions.length === 0) {
3759
- return /* @__PURE__ */ jsx("div", { className: s3.wrapper, children: /* @__PURE__ */ jsx("div", { className: cn(s3.button, !expanded && "justify-center px-0"), children: triggerContent }) });
5566
+ return /* @__PURE__ */ jsx("div", { className: s2.wrapper, children: /* @__PURE__ */ jsx("div", { className: cn(s2.button, !expanded && "justify-center px-0"), children: triggerContent }) });
3760
5567
  }
3761
- return /* @__PURE__ */ jsx("div", { className: s3.wrapper, children: /* @__PURE__ */ jsxs(DropdownMenu, { children: [
5568
+ return /* @__PURE__ */ jsx("div", { className: s2.wrapper, children: /* @__PURE__ */ jsxs(DropdownMenu, { children: [
3762
5569
  /* @__PURE__ */ jsx(
3763
5570
  DropdownMenuTrigger,
3764
5571
  {
3765
- className: cn(s3.button, !expanded && "justify-center px-0"),
5572
+ className: cn(s2.button, !expanded && "justify-center px-0"),
3766
5573
  children: triggerContent
3767
5574
  }
3768
5575
  ),
@@ -3773,9 +5580,9 @@ function SingleMenuFooter({
3773
5580
  sideOffset: 8,
3774
5581
  align: expanded ? "end" : "start",
3775
5582
  children: [
3776
- /* @__PURE__ */ jsx(DropdownMenuGroup, { children: /* @__PURE__ */ jsxs(DropdownMenuLabel, { className: s3.dropdownLabel, children: [
3777
- /* @__PURE__ */ jsx("span", { className: s3.dropdownLabelName, children: name }),
3778
- /* @__PURE__ */ jsx("span", { className: s3.dropdownLabelEmail, children: email })
5583
+ /* @__PURE__ */ jsx(DropdownMenuGroup, { children: /* @__PURE__ */ jsxs(DropdownMenuLabel, { className: s2.dropdownLabel, children: [
5584
+ /* @__PURE__ */ jsx("span", { className: s2.dropdownLabelName, children: name }),
5585
+ /* @__PURE__ */ jsx("span", { className: s2.dropdownLabelEmail, children: email })
3779
5586
  ] }) }),
3780
5587
  /* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
3781
5588
  actions.map((action) => /* @__PURE__ */ jsxs(
@@ -3783,9 +5590,9 @@ function SingleMenuFooter({
3783
5590
  {
3784
5591
  variant: action.variant === "destructive" ? "destructive" : "default",
3785
5592
  onClick: () => onAction?.(action.id),
3786
- className: s3.dropdownItem,
5593
+ className: s2.dropdownItem,
3787
5594
  children: [
3788
- action.icon && /* @__PURE__ */ jsx("span", { className: s3.dropdownItemIcon, children: action.icon }),
5595
+ action.icon && /* @__PURE__ */ jsx("span", { className: s2.dropdownItemIcon, children: action.icon }),
3789
5596
  /* @__PURE__ */ jsx("span", { children: action.label })
3790
5597
  ]
3791
5598
  },
@@ -3837,7 +5644,7 @@ function SingleMenuSidebar({
3837
5644
  defaultModuleId ?? modules?.[0]?.id
3838
5645
  );
3839
5646
  const currentModuleId = activeModuleId ?? internalModuleId;
3840
- const activeModule = hasModules ? modules.find((m2) => m2.id === currentModuleId) ?? modules[0] : void 0;
5647
+ const activeModule = hasModules ? modules.find((m) => m.id === currentModuleId) ?? modules[0] : void 0;
3841
5648
  const handleModuleChange = (id) => {
3842
5649
  if (activeModuleId === void 0) setInternalModuleId(id);
3843
5650
  onModuleChange?.(id);
@@ -3846,10 +5653,10 @@ function SingleMenuSidebar({
3846
5653
  icon: activeModule.icon,
3847
5654
  title: activeModule.title,
3848
5655
  subtitle: activeModule.subtitle ?? "",
3849
- options: modules.map((m2) => ({
3850
- id: m2.id,
3851
- label: m2.title,
3852
- icon: m2.icon
5656
+ options: modules.map((m) => ({
5657
+ id: m.id,
5658
+ label: m.title,
5659
+ icon: m.icon
3853
5660
  })),
3854
5661
  onModuleChange: handleModuleChange
3855
5662
  } : module;
@@ -3857,9 +5664,9 @@ function SingleMenuSidebar({
3857
5664
  const [commandOpen, setCommandOpen] = useState(false);
3858
5665
  useEffect(() => {
3859
5666
  if (!showSearch) return;
3860
- const onKey = (e3) => {
3861
- if (e3.key.toLowerCase() === "k" && (e3.metaKey || e3.ctrlKey)) {
3862
- e3.preventDefault();
5667
+ const onKey = (e2) => {
5668
+ if (e2.key.toLowerCase() === "k" && (e2.metaKey || e2.ctrlKey)) {
5669
+ e2.preventDefault();
3863
5670
  setCommandOpen((o2) => !o2);
3864
5671
  }
3865
5672
  };
@@ -3955,150 +5762,1928 @@ function SingleMenuSidebar({
3955
5762
  ] });
3956
5763
  }
3957
5764
  SingleMenuSidebar.displayName = "SingleMenuSidebar";
5765
+ const spinnerStyles = tv({
5766
+ base: ["inline-block shrink-0", "animate-spin motion-reduce:animate-none"],
5767
+ variants: {
5768
+ size: {
5769
+ sm: "size-icon-sm",
5770
+ md: "size-icon-md",
5771
+ lg: "size-icon-lg"
5772
+ },
5773
+ color: {
5774
+ current: "text-current",
5775
+ default: "text-fg-default",
5776
+ muted: "text-fg-muted",
5777
+ brand: "text-fg-brand",
5778
+ "on-brand": "text-fg-on-brand"
5779
+ }
5780
+ },
5781
+ defaultVariants: {
5782
+ size: "md",
5783
+ color: "muted"
5784
+ }
5785
+ });
5786
+ const Spinner = forwardRef(function Spinner2({ size, color, label = "Carregando", className, ...rest }, ref) {
5787
+ const decorative = rest["aria-hidden"] === true || rest["aria-hidden"] === "true";
5788
+ return /* @__PURE__ */ jsxs(
5789
+ "svg",
5790
+ {
5791
+ ref,
5792
+ viewBox: "0 0 24 24",
5793
+ fill: "none",
5794
+ role: decorative ? void 0 : "status",
5795
+ "aria-label": decorative ? void 0 : label,
5796
+ className: spinnerStyles({ size, color, className }),
5797
+ ...rest,
5798
+ children: [
5799
+ /* @__PURE__ */ jsx(
5800
+ "circle",
5801
+ {
5802
+ cx: "12",
5803
+ cy: "12",
5804
+ r: "9",
5805
+ stroke: "currentColor",
5806
+ strokeWidth: "3",
5807
+ className: "opacity-20"
5808
+ }
5809
+ ),
5810
+ /* @__PURE__ */ jsx(
5811
+ "path",
5812
+ {
5813
+ d: "M21 12a9 9 0 0 0-9-9",
5814
+ stroke: "currentColor",
5815
+ strokeWidth: "3",
5816
+ strokeLinecap: "round"
5817
+ }
5818
+ )
5819
+ ]
5820
+ }
5821
+ );
5822
+ });
5823
+ Spinner.displayName = "Spinner";
5824
+ class Adder {
5825
+ constructor() {
5826
+ this._partials = new Float64Array(32);
5827
+ this._n = 0;
5828
+ }
5829
+ add(x2) {
5830
+ const p3 = this._partials;
5831
+ let i2 = 0;
5832
+ for (let j = 0; j < this._n && j < 32; j++) {
5833
+ const y2 = p3[j], hi = x2 + y2, lo = Math.abs(x2) < Math.abs(y2) ? x2 - (hi - y2) : y2 - (hi - x2);
5834
+ if (lo) p3[i2++] = lo;
5835
+ x2 = hi;
5836
+ }
5837
+ p3[i2] = x2;
5838
+ this._n = i2 + 1;
5839
+ return this;
5840
+ }
5841
+ valueOf() {
5842
+ const p3 = this._partials;
5843
+ let n2 = this._n, x2, y2, lo, hi = 0;
5844
+ if (n2 > 0) {
5845
+ hi = p3[--n2];
5846
+ while (n2 > 0) {
5847
+ x2 = hi;
5848
+ y2 = p3[--n2];
5849
+ hi = x2 + y2;
5850
+ lo = y2 - (hi - x2);
5851
+ if (lo) break;
5852
+ }
5853
+ if (n2 > 0 && (lo < 0 && p3[n2 - 1] < 0 || lo > 0 && p3[n2 - 1] > 0)) {
5854
+ y2 = lo * 2;
5855
+ x2 = hi + y2;
5856
+ if (y2 == x2 - hi) hi = x2;
5857
+ }
5858
+ }
5859
+ return hi;
5860
+ }
5861
+ }
5862
+ function* flatten(arrays) {
5863
+ for (const array of arrays) {
5864
+ yield* array;
5865
+ }
5866
+ }
5867
+ function merge(arrays) {
5868
+ return Array.from(flatten(arrays));
5869
+ }
5870
+ var epsilon = 1e-6;
5871
+ var pi = Math.PI;
5872
+ var halfPi = pi / 2;
5873
+ var quarterPi = pi / 4;
5874
+ var tau = pi * 2;
5875
+ var degrees = 180 / pi;
5876
+ var radians = pi / 180;
5877
+ var abs = Math.abs;
5878
+ var atan = Math.atan;
5879
+ var atan2 = Math.atan2;
5880
+ var cos = Math.cos;
5881
+ var exp = Math.exp;
5882
+ var log = Math.log;
5883
+ var sin = Math.sin;
5884
+ var sign = Math.sign || function(x2) {
5885
+ return x2 > 0 ? 1 : x2 < 0 ? -1 : 0;
5886
+ };
5887
+ var sqrt = Math.sqrt;
5888
+ var tan = Math.tan;
5889
+ function acos(x2) {
5890
+ return x2 > 1 ? 0 : x2 < -1 ? pi : Math.acos(x2);
5891
+ }
5892
+ function asin(x2) {
5893
+ return x2 > 1 ? halfPi : x2 < -1 ? -halfPi : Math.asin(x2);
5894
+ }
5895
+ function noop() {
5896
+ }
5897
+ function streamGeometry(geometry, stream) {
5898
+ if (geometry && streamGeometryType.hasOwnProperty(geometry.type)) {
5899
+ streamGeometryType[geometry.type](geometry, stream);
5900
+ }
5901
+ }
5902
+ var streamObjectType = {
5903
+ Feature: function(object2, stream) {
5904
+ streamGeometry(object2.geometry, stream);
5905
+ },
5906
+ FeatureCollection: function(object2, stream) {
5907
+ var features = object2.features, i2 = -1, n2 = features.length;
5908
+ while (++i2 < n2) streamGeometry(features[i2].geometry, stream);
5909
+ }
5910
+ };
5911
+ var streamGeometryType = {
5912
+ Sphere: function(object2, stream) {
5913
+ stream.sphere();
5914
+ },
5915
+ Point: function(object2, stream) {
5916
+ object2 = object2.coordinates;
5917
+ stream.point(object2[0], object2[1], object2[2]);
5918
+ },
5919
+ MultiPoint: function(object2, stream) {
5920
+ var coordinates = object2.coordinates, i2 = -1, n2 = coordinates.length;
5921
+ while (++i2 < n2) object2 = coordinates[i2], stream.point(object2[0], object2[1], object2[2]);
5922
+ },
5923
+ LineString: function(object2, stream) {
5924
+ streamLine(object2.coordinates, stream, 0);
5925
+ },
5926
+ MultiLineString: function(object2, stream) {
5927
+ var coordinates = object2.coordinates, i2 = -1, n2 = coordinates.length;
5928
+ while (++i2 < n2) streamLine(coordinates[i2], stream, 0);
5929
+ },
5930
+ Polygon: function(object2, stream) {
5931
+ streamPolygon(object2.coordinates, stream);
5932
+ },
5933
+ MultiPolygon: function(object2, stream) {
5934
+ var coordinates = object2.coordinates, i2 = -1, n2 = coordinates.length;
5935
+ while (++i2 < n2) streamPolygon(coordinates[i2], stream);
5936
+ },
5937
+ GeometryCollection: function(object2, stream) {
5938
+ var geometries = object2.geometries, i2 = -1, n2 = geometries.length;
5939
+ while (++i2 < n2) streamGeometry(geometries[i2], stream);
5940
+ }
5941
+ };
5942
+ function streamLine(coordinates, stream, closed) {
5943
+ var i2 = -1, n2 = coordinates.length - closed, coordinate;
5944
+ stream.lineStart();
5945
+ while (++i2 < n2) coordinate = coordinates[i2], stream.point(coordinate[0], coordinate[1], coordinate[2]);
5946
+ stream.lineEnd();
5947
+ }
5948
+ function streamPolygon(coordinates, stream) {
5949
+ var i2 = -1, n2 = coordinates.length;
5950
+ stream.polygonStart();
5951
+ while (++i2 < n2) streamLine(coordinates[i2], stream, 1);
5952
+ stream.polygonEnd();
5953
+ }
5954
+ function geoStream(object2, stream) {
5955
+ if (object2 && streamObjectType.hasOwnProperty(object2.type)) {
5956
+ streamObjectType[object2.type](object2, stream);
5957
+ } else {
5958
+ streamGeometry(object2, stream);
5959
+ }
5960
+ }
5961
+ function spherical(cartesian2) {
5962
+ return [atan2(cartesian2[1], cartesian2[0]), asin(cartesian2[2])];
5963
+ }
5964
+ function cartesian(spherical2) {
5965
+ var lambda = spherical2[0], phi = spherical2[1], cosPhi = cos(phi);
5966
+ return [cosPhi * cos(lambda), cosPhi * sin(lambda), sin(phi)];
5967
+ }
5968
+ function cartesianDot(a10, b3) {
5969
+ return a10[0] * b3[0] + a10[1] * b3[1] + a10[2] * b3[2];
5970
+ }
5971
+ function cartesianCross(a10, b3) {
5972
+ return [a10[1] * b3[2] - a10[2] * b3[1], a10[2] * b3[0] - a10[0] * b3[2], a10[0] * b3[1] - a10[1] * b3[0]];
5973
+ }
5974
+ function cartesianAddInPlace(a10, b3) {
5975
+ a10[0] += b3[0], a10[1] += b3[1], a10[2] += b3[2];
5976
+ }
5977
+ function cartesianScale(vector, k) {
5978
+ return [vector[0] * k, vector[1] * k, vector[2] * k];
5979
+ }
5980
+ function cartesianNormalizeInPlace(d3) {
5981
+ var l = sqrt(d3[0] * d3[0] + d3[1] * d3[1] + d3[2] * d3[2]);
5982
+ d3[0] /= l, d3[1] /= l, d3[2] /= l;
5983
+ }
5984
+ function compose(a10, b3) {
5985
+ function compose2(x2, y2) {
5986
+ return x2 = a10(x2, y2), b3(x2[0], x2[1]);
5987
+ }
5988
+ if (a10.invert && b3.invert) compose2.invert = function(x2, y2) {
5989
+ return x2 = b3.invert(x2, y2), x2 && a10.invert(x2[0], x2[1]);
5990
+ };
5991
+ return compose2;
5992
+ }
5993
+ function rotationIdentity(lambda, phi) {
5994
+ if (abs(lambda) > pi) lambda -= Math.round(lambda / tau) * tau;
5995
+ return [lambda, phi];
5996
+ }
5997
+ rotationIdentity.invert = rotationIdentity;
5998
+ function rotateRadians(deltaLambda, deltaPhi, deltaGamma) {
5999
+ return (deltaLambda %= tau) ? deltaPhi || deltaGamma ? compose(rotationLambda(deltaLambda), rotationPhiGamma(deltaPhi, deltaGamma)) : rotationLambda(deltaLambda) : deltaPhi || deltaGamma ? rotationPhiGamma(deltaPhi, deltaGamma) : rotationIdentity;
6000
+ }
6001
+ function forwardRotationLambda(deltaLambda) {
6002
+ return function(lambda, phi) {
6003
+ lambda += deltaLambda;
6004
+ if (abs(lambda) > pi) lambda -= Math.round(lambda / tau) * tau;
6005
+ return [lambda, phi];
6006
+ };
6007
+ }
6008
+ function rotationLambda(deltaLambda) {
6009
+ var rotation2 = forwardRotationLambda(deltaLambda);
6010
+ rotation2.invert = forwardRotationLambda(-deltaLambda);
6011
+ return rotation2;
6012
+ }
6013
+ function rotationPhiGamma(deltaPhi, deltaGamma) {
6014
+ var cosDeltaPhi = cos(deltaPhi), sinDeltaPhi = sin(deltaPhi), cosDeltaGamma = cos(deltaGamma), sinDeltaGamma = sin(deltaGamma);
6015
+ function rotation2(lambda, phi) {
6016
+ var cosPhi = cos(phi), x2 = cos(lambda) * cosPhi, y2 = sin(lambda) * cosPhi, z2 = sin(phi), k = z2 * cosDeltaPhi + x2 * sinDeltaPhi;
6017
+ return [
6018
+ atan2(y2 * cosDeltaGamma - k * sinDeltaGamma, x2 * cosDeltaPhi - z2 * sinDeltaPhi),
6019
+ asin(k * cosDeltaGamma + y2 * sinDeltaGamma)
6020
+ ];
6021
+ }
6022
+ rotation2.invert = function(lambda, phi) {
6023
+ var cosPhi = cos(phi), x2 = cos(lambda) * cosPhi, y2 = sin(lambda) * cosPhi, z2 = sin(phi), k = z2 * cosDeltaGamma - y2 * sinDeltaGamma;
6024
+ return [
6025
+ atan2(y2 * cosDeltaGamma + z2 * sinDeltaGamma, x2 * cosDeltaPhi + k * sinDeltaPhi),
6026
+ asin(k * cosDeltaPhi - x2 * sinDeltaPhi)
6027
+ ];
6028
+ };
6029
+ return rotation2;
6030
+ }
6031
+ function rotation(rotate) {
6032
+ rotate = rotateRadians(rotate[0] * radians, rotate[1] * radians, rotate.length > 2 ? rotate[2] * radians : 0);
6033
+ function forward(coordinates) {
6034
+ coordinates = rotate(coordinates[0] * radians, coordinates[1] * radians);
6035
+ return coordinates[0] *= degrees, coordinates[1] *= degrees, coordinates;
6036
+ }
6037
+ forward.invert = function(coordinates) {
6038
+ coordinates = rotate.invert(coordinates[0] * radians, coordinates[1] * radians);
6039
+ return coordinates[0] *= degrees, coordinates[1] *= degrees, coordinates;
6040
+ };
6041
+ return forward;
6042
+ }
6043
+ function circleStream(stream, radius, delta, direction, t0, t1) {
6044
+ if (!delta) return;
6045
+ var cosRadius = cos(radius), sinRadius = sin(radius), step = direction * delta;
6046
+ if (t0 == null) {
6047
+ t0 = radius + direction * tau;
6048
+ t1 = radius - step / 2;
6049
+ } else {
6050
+ t0 = circleRadius(cosRadius, t0);
6051
+ t1 = circleRadius(cosRadius, t1);
6052
+ if (direction > 0 ? t0 < t1 : t0 > t1) t0 += direction * tau;
6053
+ }
6054
+ for (var point, t2 = t0; direction > 0 ? t2 > t1 : t2 < t1; t2 -= step) {
6055
+ point = spherical([cosRadius, -sinRadius * cos(t2), -sinRadius * sin(t2)]);
6056
+ stream.point(point[0], point[1]);
6057
+ }
6058
+ }
6059
+ function circleRadius(cosRadius, point) {
6060
+ point = cartesian(point), point[0] -= cosRadius;
6061
+ cartesianNormalizeInPlace(point);
6062
+ var radius = acos(-point[1]);
6063
+ return ((-point[2] < 0 ? -radius : radius) + tau - epsilon) % tau;
6064
+ }
6065
+ function clipBuffer() {
6066
+ var lines = [], line;
6067
+ return {
6068
+ point: function(x2, y2, m) {
6069
+ line.push([x2, y2, m]);
6070
+ },
6071
+ lineStart: function() {
6072
+ lines.push(line = []);
6073
+ },
6074
+ lineEnd: noop,
6075
+ rejoin: function() {
6076
+ if (lines.length > 1) lines.push(lines.pop().concat(lines.shift()));
6077
+ },
6078
+ result: function() {
6079
+ var result = lines;
6080
+ lines = [];
6081
+ line = null;
6082
+ return result;
6083
+ }
6084
+ };
6085
+ }
6086
+ function pointEqual(a10, b3) {
6087
+ return abs(a10[0] - b3[0]) < epsilon && abs(a10[1] - b3[1]) < epsilon;
6088
+ }
6089
+ function Intersection(point, points, other, entry) {
6090
+ this.x = point;
6091
+ this.z = points;
6092
+ this.o = other;
6093
+ this.e = entry;
6094
+ this.v = false;
6095
+ this.n = this.p = null;
6096
+ }
6097
+ function clipRejoin(segments, compareIntersection2, startInside, interpolate, stream) {
6098
+ var subject = [], clip2 = [], i2, n2;
6099
+ segments.forEach(function(segment) {
6100
+ if ((n3 = segment.length - 1) <= 0) return;
6101
+ var n3, p0 = segment[0], p1 = segment[n3], x2;
6102
+ if (pointEqual(p0, p1)) {
6103
+ if (!p0[2] && !p1[2]) {
6104
+ stream.lineStart();
6105
+ for (i2 = 0; i2 < n3; ++i2) stream.point((p0 = segment[i2])[0], p0[1]);
6106
+ stream.lineEnd();
6107
+ return;
6108
+ }
6109
+ p1[0] += 2 * epsilon;
6110
+ }
6111
+ subject.push(x2 = new Intersection(p0, segment, null, true));
6112
+ clip2.push(x2.o = new Intersection(p0, null, x2, false));
6113
+ subject.push(x2 = new Intersection(p1, segment, null, false));
6114
+ clip2.push(x2.o = new Intersection(p1, null, x2, true));
6115
+ });
6116
+ if (!subject.length) return;
6117
+ clip2.sort(compareIntersection2);
6118
+ link(subject);
6119
+ link(clip2);
6120
+ for (i2 = 0, n2 = clip2.length; i2 < n2; ++i2) {
6121
+ clip2[i2].e = startInside = !startInside;
6122
+ }
6123
+ var start = subject[0], points, point;
6124
+ while (1) {
6125
+ var current = start, isSubject = true;
6126
+ while (current.v) if ((current = current.n) === start) return;
6127
+ points = current.z;
6128
+ stream.lineStart();
6129
+ do {
6130
+ current.v = current.o.v = true;
6131
+ if (current.e) {
6132
+ if (isSubject) {
6133
+ for (i2 = 0, n2 = points.length; i2 < n2; ++i2) stream.point((point = points[i2])[0], point[1]);
6134
+ } else {
6135
+ interpolate(current.x, current.n.x, 1, stream);
6136
+ }
6137
+ current = current.n;
6138
+ } else {
6139
+ if (isSubject) {
6140
+ points = current.p.z;
6141
+ for (i2 = points.length - 1; i2 >= 0; --i2) stream.point((point = points[i2])[0], point[1]);
6142
+ } else {
6143
+ interpolate(current.x, current.p.x, -1, stream);
6144
+ }
6145
+ current = current.p;
6146
+ }
6147
+ current = current.o;
6148
+ points = current.z;
6149
+ isSubject = !isSubject;
6150
+ } while (!current.v);
6151
+ stream.lineEnd();
6152
+ }
6153
+ }
6154
+ function link(array) {
6155
+ if (!(n2 = array.length)) return;
6156
+ var n2, i2 = 0, a10 = array[0], b3;
6157
+ while (++i2 < n2) {
6158
+ a10.n = b3 = array[i2];
6159
+ b3.p = a10;
6160
+ a10 = b3;
6161
+ }
6162
+ a10.n = b3 = array[0];
6163
+ b3.p = a10;
6164
+ }
6165
+ function longitude(point) {
6166
+ return abs(point[0]) <= pi ? point[0] : sign(point[0]) * ((abs(point[0]) + pi) % tau - pi);
6167
+ }
6168
+ function polygonContains(polygon, point) {
6169
+ var lambda = longitude(point), phi = point[1], sinPhi = sin(phi), normal = [sin(lambda), -cos(lambda), 0], angle = 0, winding = 0;
6170
+ var sum = new Adder();
6171
+ if (sinPhi === 1) phi = halfPi + epsilon;
6172
+ else if (sinPhi === -1) phi = -halfPi - epsilon;
6173
+ for (var i2 = 0, n2 = polygon.length; i2 < n2; ++i2) {
6174
+ if (!(m = (ring = polygon[i2]).length)) continue;
6175
+ var ring, m, point0 = ring[m - 1], lambda0 = longitude(point0), phi0 = point0[1] / 2 + quarterPi, sinPhi0 = sin(phi0), cosPhi0 = cos(phi0);
6176
+ for (var j = 0; j < m; ++j, lambda0 = lambda1, sinPhi0 = sinPhi1, cosPhi0 = cosPhi1, point0 = point1) {
6177
+ var point1 = ring[j], lambda1 = longitude(point1), phi1 = point1[1] / 2 + quarterPi, sinPhi1 = sin(phi1), cosPhi1 = cos(phi1), delta = lambda1 - lambda0, sign2 = delta >= 0 ? 1 : -1, absDelta = sign2 * delta, antimeridian = absDelta > pi, k = sinPhi0 * sinPhi1;
6178
+ sum.add(atan2(k * sign2 * sin(absDelta), cosPhi0 * cosPhi1 + k * cos(absDelta)));
6179
+ angle += antimeridian ? delta + sign2 * tau : delta;
6180
+ if (antimeridian ^ lambda0 >= lambda ^ lambda1 >= lambda) {
6181
+ var arc = cartesianCross(cartesian(point0), cartesian(point1));
6182
+ cartesianNormalizeInPlace(arc);
6183
+ var intersection = cartesianCross(normal, arc);
6184
+ cartesianNormalizeInPlace(intersection);
6185
+ var phiArc = (antimeridian ^ delta >= 0 ? -1 : 1) * asin(intersection[2]);
6186
+ if (phi > phiArc || phi === phiArc && (arc[0] || arc[1])) {
6187
+ winding += antimeridian ^ delta >= 0 ? 1 : -1;
6188
+ }
6189
+ }
6190
+ }
6191
+ }
6192
+ return (angle < -epsilon || angle < epsilon && sum < -1e-12) ^ winding & 1;
6193
+ }
6194
+ function clip(pointVisible, clipLine2, interpolate, start) {
6195
+ return function(sink) {
6196
+ var line = clipLine2(sink), ringBuffer = clipBuffer(), ringSink = clipLine2(ringBuffer), polygonStarted = false, polygon, segments, ring;
6197
+ var clip2 = {
6198
+ point,
6199
+ lineStart,
6200
+ lineEnd,
6201
+ polygonStart: function() {
6202
+ clip2.point = pointRing;
6203
+ clip2.lineStart = ringStart;
6204
+ clip2.lineEnd = ringEnd;
6205
+ segments = [];
6206
+ polygon = [];
6207
+ },
6208
+ polygonEnd: function() {
6209
+ clip2.point = point;
6210
+ clip2.lineStart = lineStart;
6211
+ clip2.lineEnd = lineEnd;
6212
+ segments = merge(segments);
6213
+ var startInside = polygonContains(polygon, start);
6214
+ if (segments.length) {
6215
+ if (!polygonStarted) sink.polygonStart(), polygonStarted = true;
6216
+ clipRejoin(segments, compareIntersection, startInside, interpolate, sink);
6217
+ } else if (startInside) {
6218
+ if (!polygonStarted) sink.polygonStart(), polygonStarted = true;
6219
+ sink.lineStart();
6220
+ interpolate(null, null, 1, sink);
6221
+ sink.lineEnd();
6222
+ }
6223
+ if (polygonStarted) sink.polygonEnd(), polygonStarted = false;
6224
+ segments = polygon = null;
6225
+ },
6226
+ sphere: function() {
6227
+ sink.polygonStart();
6228
+ sink.lineStart();
6229
+ interpolate(null, null, 1, sink);
6230
+ sink.lineEnd();
6231
+ sink.polygonEnd();
6232
+ }
6233
+ };
6234
+ function point(lambda, phi) {
6235
+ if (pointVisible(lambda, phi)) sink.point(lambda, phi);
6236
+ }
6237
+ function pointLine(lambda, phi) {
6238
+ line.point(lambda, phi);
6239
+ }
6240
+ function lineStart() {
6241
+ clip2.point = pointLine;
6242
+ line.lineStart();
6243
+ }
6244
+ function lineEnd() {
6245
+ clip2.point = point;
6246
+ line.lineEnd();
6247
+ }
6248
+ function pointRing(lambda, phi) {
6249
+ ring.push([lambda, phi]);
6250
+ ringSink.point(lambda, phi);
6251
+ }
6252
+ function ringStart() {
6253
+ ringSink.lineStart();
6254
+ ring = [];
6255
+ }
6256
+ function ringEnd() {
6257
+ pointRing(ring[0][0], ring[0][1]);
6258
+ ringSink.lineEnd();
6259
+ var clean = ringSink.clean(), ringSegments = ringBuffer.result(), i2, n2 = ringSegments.length, m, segment, point2;
6260
+ ring.pop();
6261
+ polygon.push(ring);
6262
+ ring = null;
6263
+ if (!n2) return;
6264
+ if (clean & 1) {
6265
+ segment = ringSegments[0];
6266
+ if ((m = segment.length - 1) > 0) {
6267
+ if (!polygonStarted) sink.polygonStart(), polygonStarted = true;
6268
+ sink.lineStart();
6269
+ for (i2 = 0; i2 < m; ++i2) sink.point((point2 = segment[i2])[0], point2[1]);
6270
+ sink.lineEnd();
6271
+ }
6272
+ return;
6273
+ }
6274
+ if (n2 > 1 && clean & 2) ringSegments.push(ringSegments.pop().concat(ringSegments.shift()));
6275
+ segments.push(ringSegments.filter(validSegment));
6276
+ }
6277
+ return clip2;
6278
+ };
6279
+ }
6280
+ function validSegment(segment) {
6281
+ return segment.length > 1;
6282
+ }
6283
+ function compareIntersection(a10, b3) {
6284
+ return ((a10 = a10.x)[0] < 0 ? a10[1] - halfPi - epsilon : halfPi - a10[1]) - ((b3 = b3.x)[0] < 0 ? b3[1] - halfPi - epsilon : halfPi - b3[1]);
6285
+ }
6286
+ const clipAntimeridian = clip(
6287
+ function() {
6288
+ return true;
6289
+ },
6290
+ clipAntimeridianLine,
6291
+ clipAntimeridianInterpolate,
6292
+ [-pi, -halfPi]
6293
+ );
6294
+ function clipAntimeridianLine(stream) {
6295
+ var lambda0 = NaN, phi0 = NaN, sign0 = NaN, clean;
6296
+ return {
6297
+ lineStart: function() {
6298
+ stream.lineStart();
6299
+ clean = 1;
6300
+ },
6301
+ point: function(lambda1, phi1) {
6302
+ var sign1 = lambda1 > 0 ? pi : -pi, delta = abs(lambda1 - lambda0);
6303
+ if (abs(delta - pi) < epsilon) {
6304
+ stream.point(lambda0, phi0 = (phi0 + phi1) / 2 > 0 ? halfPi : -halfPi);
6305
+ stream.point(sign0, phi0);
6306
+ stream.lineEnd();
6307
+ stream.lineStart();
6308
+ stream.point(sign1, phi0);
6309
+ stream.point(lambda1, phi0);
6310
+ clean = 0;
6311
+ } else if (sign0 !== sign1 && delta >= pi) {
6312
+ if (abs(lambda0 - sign0) < epsilon) lambda0 -= sign0 * epsilon;
6313
+ if (abs(lambda1 - sign1) < epsilon) lambda1 -= sign1 * epsilon;
6314
+ phi0 = clipAntimeridianIntersect(lambda0, phi0, lambda1, phi1);
6315
+ stream.point(sign0, phi0);
6316
+ stream.lineEnd();
6317
+ stream.lineStart();
6318
+ stream.point(sign1, phi0);
6319
+ clean = 0;
6320
+ }
6321
+ stream.point(lambda0 = lambda1, phi0 = phi1);
6322
+ sign0 = sign1;
6323
+ },
6324
+ lineEnd: function() {
6325
+ stream.lineEnd();
6326
+ lambda0 = phi0 = NaN;
6327
+ },
6328
+ clean: function() {
6329
+ return 2 - clean;
6330
+ }
6331
+ };
6332
+ }
6333
+ function clipAntimeridianIntersect(lambda0, phi0, lambda1, phi1) {
6334
+ var cosPhi0, cosPhi1, sinLambda0Lambda1 = sin(lambda0 - lambda1);
6335
+ return abs(sinLambda0Lambda1) > epsilon ? atan((sin(phi0) * (cosPhi1 = cos(phi1)) * sin(lambda1) - sin(phi1) * (cosPhi0 = cos(phi0)) * sin(lambda0)) / (cosPhi0 * cosPhi1 * sinLambda0Lambda1)) : (phi0 + phi1) / 2;
6336
+ }
6337
+ function clipAntimeridianInterpolate(from, to, direction, stream) {
6338
+ var phi;
6339
+ if (from == null) {
6340
+ phi = direction * halfPi;
6341
+ stream.point(-pi, phi);
6342
+ stream.point(0, phi);
6343
+ stream.point(pi, phi);
6344
+ stream.point(pi, 0);
6345
+ stream.point(pi, -phi);
6346
+ stream.point(0, -phi);
6347
+ stream.point(-pi, -phi);
6348
+ stream.point(-pi, 0);
6349
+ stream.point(-pi, phi);
6350
+ } else if (abs(from[0] - to[0]) > epsilon) {
6351
+ var lambda = from[0] < to[0] ? pi : -pi;
6352
+ phi = direction * lambda / 2;
6353
+ stream.point(-lambda, phi);
6354
+ stream.point(0, phi);
6355
+ stream.point(lambda, phi);
6356
+ } else {
6357
+ stream.point(to[0], to[1]);
6358
+ }
6359
+ }
6360
+ function clipCircle(radius) {
6361
+ var cr = cos(radius), delta = 2 * radians, smallRadius = cr > 0, notHemisphere = abs(cr) > epsilon;
6362
+ function interpolate(from, to, direction, stream) {
6363
+ circleStream(stream, radius, delta, direction, from, to);
6364
+ }
6365
+ function visible(lambda, phi) {
6366
+ return cos(lambda) * cos(phi) > cr;
6367
+ }
6368
+ function clipLine2(stream) {
6369
+ var point0, c0, v0, v00, clean;
6370
+ return {
6371
+ lineStart: function() {
6372
+ v00 = v0 = false;
6373
+ clean = 1;
6374
+ },
6375
+ point: function(lambda, phi) {
6376
+ var point1 = [lambda, phi], point2, v2 = visible(lambda, phi), c2 = smallRadius ? v2 ? 0 : code(lambda, phi) : v2 ? code(lambda + (lambda < 0 ? pi : -pi), phi) : 0;
6377
+ if (!point0 && (v00 = v0 = v2)) stream.lineStart();
6378
+ if (v2 !== v0) {
6379
+ point2 = intersect(point0, point1);
6380
+ if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2))
6381
+ point1[2] = 1;
6382
+ }
6383
+ if (v2 !== v0) {
6384
+ clean = 0;
6385
+ if (v2) {
6386
+ stream.lineStart();
6387
+ point2 = intersect(point1, point0);
6388
+ stream.point(point2[0], point2[1]);
6389
+ } else {
6390
+ point2 = intersect(point0, point1);
6391
+ stream.point(point2[0], point2[1], 2);
6392
+ stream.lineEnd();
6393
+ }
6394
+ point0 = point2;
6395
+ } else if (notHemisphere && point0 && smallRadius ^ v2) {
6396
+ var t2;
6397
+ if (!(c2 & c0) && (t2 = intersect(point1, point0, true))) {
6398
+ clean = 0;
6399
+ if (smallRadius) {
6400
+ stream.lineStart();
6401
+ stream.point(t2[0][0], t2[0][1]);
6402
+ stream.point(t2[1][0], t2[1][1]);
6403
+ stream.lineEnd();
6404
+ } else {
6405
+ stream.point(t2[1][0], t2[1][1]);
6406
+ stream.lineEnd();
6407
+ stream.lineStart();
6408
+ stream.point(t2[0][0], t2[0][1], 3);
6409
+ }
6410
+ }
6411
+ }
6412
+ if (v2 && (!point0 || !pointEqual(point0, point1))) {
6413
+ stream.point(point1[0], point1[1]);
6414
+ }
6415
+ point0 = point1, v0 = v2, c0 = c2;
6416
+ },
6417
+ lineEnd: function() {
6418
+ if (v0) stream.lineEnd();
6419
+ point0 = null;
6420
+ },
6421
+ // Rejoin first and last segments if there were intersections and the first
6422
+ // and last points were visible.
6423
+ clean: function() {
6424
+ return clean | (v00 && v0) << 1;
6425
+ }
6426
+ };
6427
+ }
6428
+ function intersect(a10, b3, two) {
6429
+ var pa = cartesian(a10), pb = cartesian(b3);
6430
+ var n1 = [1, 0, 0], n2 = cartesianCross(pa, pb), n2n2 = cartesianDot(n2, n2), n1n2 = n2[0], determinant = n2n2 - n1n2 * n1n2;
6431
+ if (!determinant) return !two && a10;
6432
+ var c1 = cr * n2n2 / determinant, c2 = -cr * n1n2 / determinant, n1xn2 = cartesianCross(n1, n2), A3 = cartesianScale(n1, c1), B2 = cartesianScale(n2, c2);
6433
+ cartesianAddInPlace(A3, B2);
6434
+ var u2 = n1xn2, w2 = cartesianDot(A3, u2), uu = cartesianDot(u2, u2), t2 = w2 * w2 - uu * (cartesianDot(A3, A3) - 1);
6435
+ if (t2 < 0) return;
6436
+ var t3 = sqrt(t2), q2 = cartesianScale(u2, (-w2 - t3) / uu);
6437
+ cartesianAddInPlace(q2, A3);
6438
+ q2 = spherical(q2);
6439
+ if (!two) return q2;
6440
+ var lambda0 = a10[0], lambda1 = b3[0], phi0 = a10[1], phi1 = b3[1], z2;
6441
+ if (lambda1 < lambda0) z2 = lambda0, lambda0 = lambda1, lambda1 = z2;
6442
+ var delta2 = lambda1 - lambda0, polar = abs(delta2 - pi) < epsilon, meridian = polar || delta2 < epsilon;
6443
+ if (!polar && phi1 < phi0) z2 = phi0, phi0 = phi1, phi1 = z2;
6444
+ if (meridian ? polar ? phi0 + phi1 > 0 ^ q2[1] < (abs(q2[0] - lambda0) < epsilon ? phi0 : phi1) : phi0 <= q2[1] && q2[1] <= phi1 : delta2 > pi ^ (lambda0 <= q2[0] && q2[0] <= lambda1)) {
6445
+ var q1 = cartesianScale(u2, (-w2 + t3) / uu);
6446
+ cartesianAddInPlace(q1, A3);
6447
+ return [q2, spherical(q1)];
6448
+ }
6449
+ }
6450
+ function code(lambda, phi) {
6451
+ var r2 = smallRadius ? radius : pi - radius, code2 = 0;
6452
+ if (lambda < -r2) code2 |= 1;
6453
+ else if (lambda > r2) code2 |= 2;
6454
+ if (phi < -r2) code2 |= 4;
6455
+ else if (phi > r2) code2 |= 8;
6456
+ return code2;
6457
+ }
6458
+ return clip(visible, clipLine2, interpolate, smallRadius ? [0, -radius] : [-pi, radius - pi]);
6459
+ }
6460
+ function clipLine(a10, b3, x02, y02, x12, y12) {
6461
+ var ax = a10[0], ay = a10[1], bx = b3[0], by = b3[1], t0 = 0, t1 = 1, dx = bx - ax, dy = by - ay, r2;
6462
+ r2 = x02 - ax;
6463
+ if (!dx && r2 > 0) return;
6464
+ r2 /= dx;
6465
+ if (dx < 0) {
6466
+ if (r2 < t0) return;
6467
+ if (r2 < t1) t1 = r2;
6468
+ } else if (dx > 0) {
6469
+ if (r2 > t1) return;
6470
+ if (r2 > t0) t0 = r2;
6471
+ }
6472
+ r2 = x12 - ax;
6473
+ if (!dx && r2 < 0) return;
6474
+ r2 /= dx;
6475
+ if (dx < 0) {
6476
+ if (r2 > t1) return;
6477
+ if (r2 > t0) t0 = r2;
6478
+ } else if (dx > 0) {
6479
+ if (r2 < t0) return;
6480
+ if (r2 < t1) t1 = r2;
6481
+ }
6482
+ r2 = y02 - ay;
6483
+ if (!dy && r2 > 0) return;
6484
+ r2 /= dy;
6485
+ if (dy < 0) {
6486
+ if (r2 < t0) return;
6487
+ if (r2 < t1) t1 = r2;
6488
+ } else if (dy > 0) {
6489
+ if (r2 > t1) return;
6490
+ if (r2 > t0) t0 = r2;
6491
+ }
6492
+ r2 = y12 - ay;
6493
+ if (!dy && r2 < 0) return;
6494
+ r2 /= dy;
6495
+ if (dy < 0) {
6496
+ if (r2 > t1) return;
6497
+ if (r2 > t0) t0 = r2;
6498
+ } else if (dy > 0) {
6499
+ if (r2 < t0) return;
6500
+ if (r2 < t1) t1 = r2;
6501
+ }
6502
+ if (t0 > 0) a10[0] = ax + t0 * dx, a10[1] = ay + t0 * dy;
6503
+ if (t1 < 1) b3[0] = ax + t1 * dx, b3[1] = ay + t1 * dy;
6504
+ return true;
6505
+ }
6506
+ var clipMax = 1e9, clipMin = -clipMax;
6507
+ function clipRectangle(x02, y02, x12, y12) {
6508
+ function visible(x2, y2) {
6509
+ return x02 <= x2 && x2 <= x12 && y02 <= y2 && y2 <= y12;
6510
+ }
6511
+ function interpolate(from, to, direction, stream) {
6512
+ var a10 = 0, a13 = 0;
6513
+ if (from == null || (a10 = corner(from, direction)) !== (a13 = corner(to, direction)) || comparePoint(from, to) < 0 ^ direction > 0) {
6514
+ do
6515
+ stream.point(a10 === 0 || a10 === 3 ? x02 : x12, a10 > 1 ? y12 : y02);
6516
+ while ((a10 = (a10 + direction + 4) % 4) !== a13);
6517
+ } else {
6518
+ stream.point(to[0], to[1]);
6519
+ }
6520
+ }
6521
+ function corner(p3, direction) {
6522
+ return abs(p3[0] - x02) < epsilon ? direction > 0 ? 0 : 3 : abs(p3[0] - x12) < epsilon ? direction > 0 ? 2 : 1 : abs(p3[1] - y02) < epsilon ? direction > 0 ? 1 : 0 : direction > 0 ? 3 : 2;
6523
+ }
6524
+ function compareIntersection2(a10, b3) {
6525
+ return comparePoint(a10.x, b3.x);
6526
+ }
6527
+ function comparePoint(a10, b3) {
6528
+ var ca = corner(a10, 1), cb = corner(b3, 1);
6529
+ return ca !== cb ? ca - cb : ca === 0 ? b3[1] - a10[1] : ca === 1 ? a10[0] - b3[0] : ca === 2 ? a10[1] - b3[1] : b3[0] - a10[0];
6530
+ }
6531
+ return function(stream) {
6532
+ var activeStream = stream, bufferStream = clipBuffer(), segments, polygon, ring, x__, y__, v__, x_, y_, v_, first, clean;
6533
+ var clipStream = {
6534
+ point,
6535
+ lineStart,
6536
+ lineEnd,
6537
+ polygonStart,
6538
+ polygonEnd
6539
+ };
6540
+ function point(x2, y2) {
6541
+ if (visible(x2, y2)) activeStream.point(x2, y2);
6542
+ }
6543
+ function polygonInside() {
6544
+ var winding = 0;
6545
+ for (var i2 = 0, n2 = polygon.length; i2 < n2; ++i2) {
6546
+ for (var ring2 = polygon[i2], j = 1, m = ring2.length, point2 = ring2[0], a03, a13, b0 = point2[0], b1 = point2[1]; j < m; ++j) {
6547
+ a03 = b0, a13 = b1, point2 = ring2[j], b0 = point2[0], b1 = point2[1];
6548
+ if (a13 <= y12) {
6549
+ if (b1 > y12 && (b0 - a03) * (y12 - a13) > (b1 - a13) * (x02 - a03)) ++winding;
6550
+ } else {
6551
+ if (b1 <= y12 && (b0 - a03) * (y12 - a13) < (b1 - a13) * (x02 - a03)) --winding;
6552
+ }
6553
+ }
6554
+ }
6555
+ return winding;
6556
+ }
6557
+ function polygonStart() {
6558
+ activeStream = bufferStream, segments = [], polygon = [], clean = true;
6559
+ }
6560
+ function polygonEnd() {
6561
+ var startInside = polygonInside(), cleanInside = clean && startInside, visible2 = (segments = merge(segments)).length;
6562
+ if (cleanInside || visible2) {
6563
+ stream.polygonStart();
6564
+ if (cleanInside) {
6565
+ stream.lineStart();
6566
+ interpolate(null, null, 1, stream);
6567
+ stream.lineEnd();
6568
+ }
6569
+ if (visible2) {
6570
+ clipRejoin(segments, compareIntersection2, startInside, interpolate, stream);
6571
+ }
6572
+ stream.polygonEnd();
6573
+ }
6574
+ activeStream = stream, segments = polygon = ring = null;
6575
+ }
6576
+ function lineStart() {
6577
+ clipStream.point = linePoint;
6578
+ if (polygon) polygon.push(ring = []);
6579
+ first = true;
6580
+ v_ = false;
6581
+ x_ = y_ = NaN;
6582
+ }
6583
+ function lineEnd() {
6584
+ if (segments) {
6585
+ linePoint(x__, y__);
6586
+ if (v__ && v_) bufferStream.rejoin();
6587
+ segments.push(bufferStream.result());
6588
+ }
6589
+ clipStream.point = point;
6590
+ if (v_) activeStream.lineEnd();
6591
+ }
6592
+ function linePoint(x2, y2) {
6593
+ var v2 = visible(x2, y2);
6594
+ if (polygon) ring.push([x2, y2]);
6595
+ if (first) {
6596
+ x__ = x2, y__ = y2, v__ = v2;
6597
+ first = false;
6598
+ if (v2) {
6599
+ activeStream.lineStart();
6600
+ activeStream.point(x2, y2);
6601
+ }
6602
+ } else {
6603
+ if (v2 && v_) activeStream.point(x2, y2);
6604
+ else {
6605
+ var a10 = [x_ = Math.max(clipMin, Math.min(clipMax, x_)), y_ = Math.max(clipMin, Math.min(clipMax, y_))], b3 = [x2 = Math.max(clipMin, Math.min(clipMax, x2)), y2 = Math.max(clipMin, Math.min(clipMax, y2))];
6606
+ if (clipLine(a10, b3, x02, y02, x12, y12)) {
6607
+ if (!v_) {
6608
+ activeStream.lineStart();
6609
+ activeStream.point(a10[0], a10[1]);
6610
+ }
6611
+ activeStream.point(b3[0], b3[1]);
6612
+ if (!v2) activeStream.lineEnd();
6613
+ clean = false;
6614
+ } else if (v2) {
6615
+ activeStream.lineStart();
6616
+ activeStream.point(x2, y2);
6617
+ clean = false;
6618
+ }
6619
+ }
6620
+ }
6621
+ x_ = x2, y_ = y2, v_ = v2;
6622
+ }
6623
+ return clipStream;
6624
+ };
6625
+ }
6626
+ const identity$1 = (x2) => x2;
6627
+ var areaSum = new Adder(), areaRingSum = new Adder(), x00$2, y00$2, x0$3, y0$3;
6628
+ var areaStream = {
6629
+ point: noop,
6630
+ lineStart: noop,
6631
+ lineEnd: noop,
6632
+ polygonStart: function() {
6633
+ areaStream.lineStart = areaRingStart;
6634
+ areaStream.lineEnd = areaRingEnd;
6635
+ },
6636
+ polygonEnd: function() {
6637
+ areaStream.lineStart = areaStream.lineEnd = areaStream.point = noop;
6638
+ areaSum.add(abs(areaRingSum));
6639
+ areaRingSum = new Adder();
6640
+ },
6641
+ result: function() {
6642
+ var area = areaSum / 2;
6643
+ areaSum = new Adder();
6644
+ return area;
6645
+ }
6646
+ };
6647
+ function areaRingStart() {
6648
+ areaStream.point = areaPointFirst;
6649
+ }
6650
+ function areaPointFirst(x2, y2) {
6651
+ areaStream.point = areaPoint;
6652
+ x00$2 = x0$3 = x2, y00$2 = y0$3 = y2;
6653
+ }
6654
+ function areaPoint(x2, y2) {
6655
+ areaRingSum.add(y0$3 * x2 - x0$3 * y2);
6656
+ x0$3 = x2, y0$3 = y2;
6657
+ }
6658
+ function areaRingEnd() {
6659
+ areaPoint(x00$2, y00$2);
6660
+ }
6661
+ var x0$2 = Infinity, y0$2 = x0$2, x1 = -x0$2, y1 = x1;
6662
+ var boundsStream = {
6663
+ point: boundsPoint,
6664
+ lineStart: noop,
6665
+ lineEnd: noop,
6666
+ polygonStart: noop,
6667
+ polygonEnd: noop,
6668
+ result: function() {
6669
+ var bounds = [[x0$2, y0$2], [x1, y1]];
6670
+ x1 = y1 = -(y0$2 = x0$2 = Infinity);
6671
+ return bounds;
6672
+ }
6673
+ };
6674
+ function boundsPoint(x2, y2) {
6675
+ if (x2 < x0$2) x0$2 = x2;
6676
+ if (x2 > x1) x1 = x2;
6677
+ if (y2 < y0$2) y0$2 = y2;
6678
+ if (y2 > y1) y1 = y2;
6679
+ }
6680
+ var X0 = 0, Y0 = 0, Z0 = 0, X1 = 0, Y1 = 0, Z1 = 0, X22 = 0, Y22 = 0, Z22 = 0, x00$1, y00$1, x0$1, y0$1;
6681
+ var centroidStream = {
6682
+ point: centroidPoint,
6683
+ lineStart: centroidLineStart,
6684
+ lineEnd: centroidLineEnd,
6685
+ polygonStart: function() {
6686
+ centroidStream.lineStart = centroidRingStart;
6687
+ centroidStream.lineEnd = centroidRingEnd;
6688
+ },
6689
+ polygonEnd: function() {
6690
+ centroidStream.point = centroidPoint;
6691
+ centroidStream.lineStart = centroidLineStart;
6692
+ centroidStream.lineEnd = centroidLineEnd;
6693
+ },
6694
+ result: function() {
6695
+ var centroid = Z22 ? [X22 / Z22, Y22 / Z22] : Z1 ? [X1 / Z1, Y1 / Z1] : Z0 ? [X0 / Z0, Y0 / Z0] : [NaN, NaN];
6696
+ X0 = Y0 = Z0 = X1 = Y1 = Z1 = X22 = Y22 = Z22 = 0;
6697
+ return centroid;
6698
+ }
6699
+ };
6700
+ function centroidPoint(x2, y2) {
6701
+ X0 += x2;
6702
+ Y0 += y2;
6703
+ ++Z0;
6704
+ }
6705
+ function centroidLineStart() {
6706
+ centroidStream.point = centroidPointFirstLine;
6707
+ }
6708
+ function centroidPointFirstLine(x2, y2) {
6709
+ centroidStream.point = centroidPointLine;
6710
+ centroidPoint(x0$1 = x2, y0$1 = y2);
6711
+ }
6712
+ function centroidPointLine(x2, y2) {
6713
+ var dx = x2 - x0$1, dy = y2 - y0$1, z2 = sqrt(dx * dx + dy * dy);
6714
+ X1 += z2 * (x0$1 + x2) / 2;
6715
+ Y1 += z2 * (y0$1 + y2) / 2;
6716
+ Z1 += z2;
6717
+ centroidPoint(x0$1 = x2, y0$1 = y2);
6718
+ }
6719
+ function centroidLineEnd() {
6720
+ centroidStream.point = centroidPoint;
6721
+ }
6722
+ function centroidRingStart() {
6723
+ centroidStream.point = centroidPointFirstRing;
6724
+ }
6725
+ function centroidRingEnd() {
6726
+ centroidPointRing(x00$1, y00$1);
6727
+ }
6728
+ function centroidPointFirstRing(x2, y2) {
6729
+ centroidStream.point = centroidPointRing;
6730
+ centroidPoint(x00$1 = x0$1 = x2, y00$1 = y0$1 = y2);
6731
+ }
6732
+ function centroidPointRing(x2, y2) {
6733
+ var dx = x2 - x0$1, dy = y2 - y0$1, z2 = sqrt(dx * dx + dy * dy);
6734
+ X1 += z2 * (x0$1 + x2) / 2;
6735
+ Y1 += z2 * (y0$1 + y2) / 2;
6736
+ Z1 += z2;
6737
+ z2 = y0$1 * x2 - x0$1 * y2;
6738
+ X22 += z2 * (x0$1 + x2);
6739
+ Y22 += z2 * (y0$1 + y2);
6740
+ Z22 += z2 * 3;
6741
+ centroidPoint(x0$1 = x2, y0$1 = y2);
6742
+ }
6743
+ function PathContext(context) {
6744
+ this._context = context;
6745
+ }
6746
+ PathContext.prototype = {
6747
+ _radius: 4.5,
6748
+ pointRadius: function(_3) {
6749
+ return this._radius = _3, this;
6750
+ },
6751
+ polygonStart: function() {
6752
+ this._line = 0;
6753
+ },
6754
+ polygonEnd: function() {
6755
+ this._line = NaN;
6756
+ },
6757
+ lineStart: function() {
6758
+ this._point = 0;
6759
+ },
6760
+ lineEnd: function() {
6761
+ if (this._line === 0) this._context.closePath();
6762
+ this._point = NaN;
6763
+ },
6764
+ point: function(x2, y2) {
6765
+ switch (this._point) {
6766
+ case 0: {
6767
+ this._context.moveTo(x2, y2);
6768
+ this._point = 1;
6769
+ break;
6770
+ }
6771
+ case 1: {
6772
+ this._context.lineTo(x2, y2);
6773
+ break;
6774
+ }
6775
+ default: {
6776
+ this._context.moveTo(x2 + this._radius, y2);
6777
+ this._context.arc(x2, y2, this._radius, 0, tau);
6778
+ break;
6779
+ }
6780
+ }
6781
+ },
6782
+ result: noop
6783
+ };
6784
+ var lengthSum = new Adder(), lengthRing, x00, y00, x0, y0;
6785
+ var lengthStream = {
6786
+ point: noop,
6787
+ lineStart: function() {
6788
+ lengthStream.point = lengthPointFirst;
6789
+ },
6790
+ lineEnd: function() {
6791
+ if (lengthRing) lengthPoint(x00, y00);
6792
+ lengthStream.point = noop;
6793
+ },
6794
+ polygonStart: function() {
6795
+ lengthRing = true;
6796
+ },
6797
+ polygonEnd: function() {
6798
+ lengthRing = null;
6799
+ },
6800
+ result: function() {
6801
+ var length = +lengthSum;
6802
+ lengthSum = new Adder();
6803
+ return length;
6804
+ }
6805
+ };
6806
+ function lengthPointFirst(x2, y2) {
6807
+ lengthStream.point = lengthPoint;
6808
+ x00 = x0 = x2, y00 = y0 = y2;
6809
+ }
6810
+ function lengthPoint(x2, y2) {
6811
+ x0 -= x2, y0 -= y2;
6812
+ lengthSum.add(sqrt(x0 * x0 + y0 * y0));
6813
+ x0 = x2, y0 = y2;
6814
+ }
6815
+ let cacheDigits, cacheAppend, cacheRadius, cacheCircle;
6816
+ class PathString {
6817
+ constructor(digits) {
6818
+ this._append = digits == null ? append : appendRound(digits);
6819
+ this._radius = 4.5;
6820
+ this._ = "";
6821
+ }
6822
+ pointRadius(_3) {
6823
+ this._radius = +_3;
6824
+ return this;
6825
+ }
6826
+ polygonStart() {
6827
+ this._line = 0;
6828
+ }
6829
+ polygonEnd() {
6830
+ this._line = NaN;
6831
+ }
6832
+ lineStart() {
6833
+ this._point = 0;
6834
+ }
6835
+ lineEnd() {
6836
+ if (this._line === 0) this._ += "Z";
6837
+ this._point = NaN;
6838
+ }
6839
+ point(x2, y2) {
6840
+ switch (this._point) {
6841
+ case 0: {
6842
+ this._append`M${x2},${y2}`;
6843
+ this._point = 1;
6844
+ break;
6845
+ }
6846
+ case 1: {
6847
+ this._append`L${x2},${y2}`;
6848
+ break;
6849
+ }
6850
+ default: {
6851
+ this._append`M${x2},${y2}`;
6852
+ if (this._radius !== cacheRadius || this._append !== cacheAppend) {
6853
+ const r2 = this._radius;
6854
+ const s2 = this._;
6855
+ this._ = "";
6856
+ this._append`m0,${r2}a${r2},${r2} 0 1,1 0,${-2 * r2}a${r2},${r2} 0 1,1 0,${2 * r2}z`;
6857
+ cacheRadius = r2;
6858
+ cacheAppend = this._append;
6859
+ cacheCircle = this._;
6860
+ this._ = s2;
6861
+ }
6862
+ this._ += cacheCircle;
6863
+ break;
6864
+ }
6865
+ }
6866
+ }
6867
+ result() {
6868
+ const result = this._;
6869
+ this._ = "";
6870
+ return result.length ? result : null;
6871
+ }
6872
+ }
6873
+ function append(strings) {
6874
+ let i2 = 1;
6875
+ this._ += strings[0];
6876
+ for (const j = strings.length; i2 < j; ++i2) {
6877
+ this._ += arguments[i2] + strings[i2];
6878
+ }
6879
+ }
6880
+ function appendRound(digits) {
6881
+ const d3 = Math.floor(digits);
6882
+ if (!(d3 >= 0)) throw new RangeError(`invalid digits: ${digits}`);
6883
+ if (d3 > 15) return append;
6884
+ if (d3 !== cacheDigits) {
6885
+ const k = 10 ** d3;
6886
+ cacheDigits = d3;
6887
+ cacheAppend = function append2(strings) {
6888
+ let i2 = 1;
6889
+ this._ += strings[0];
6890
+ for (const j = strings.length; i2 < j; ++i2) {
6891
+ this._ += Math.round(arguments[i2] * k) / k + strings[i2];
6892
+ }
6893
+ };
6894
+ }
6895
+ return cacheAppend;
6896
+ }
6897
+ function geoPath(projection2, context) {
6898
+ let digits = 3, pointRadius = 4.5, projectionStream, contextStream;
6899
+ function path(object2) {
6900
+ if (object2) {
6901
+ if (typeof pointRadius === "function") contextStream.pointRadius(+pointRadius.apply(this, arguments));
6902
+ geoStream(object2, projectionStream(contextStream));
6903
+ }
6904
+ return contextStream.result();
6905
+ }
6906
+ path.area = function(object2) {
6907
+ geoStream(object2, projectionStream(areaStream));
6908
+ return areaStream.result();
6909
+ };
6910
+ path.measure = function(object2) {
6911
+ geoStream(object2, projectionStream(lengthStream));
6912
+ return lengthStream.result();
6913
+ };
6914
+ path.bounds = function(object2) {
6915
+ geoStream(object2, projectionStream(boundsStream));
6916
+ return boundsStream.result();
6917
+ };
6918
+ path.centroid = function(object2) {
6919
+ geoStream(object2, projectionStream(centroidStream));
6920
+ return centroidStream.result();
6921
+ };
6922
+ path.projection = function(_3) {
6923
+ if (!arguments.length) return projection2;
6924
+ projectionStream = _3 == null ? (projection2 = null, identity$1) : (projection2 = _3).stream;
6925
+ return path;
6926
+ };
6927
+ path.context = function(_3) {
6928
+ if (!arguments.length) return context;
6929
+ contextStream = _3 == null ? (context = null, new PathString(digits)) : new PathContext(context = _3);
6930
+ if (typeof pointRadius !== "function") contextStream.pointRadius(pointRadius);
6931
+ return path;
6932
+ };
6933
+ path.pointRadius = function(_3) {
6934
+ if (!arguments.length) return pointRadius;
6935
+ pointRadius = typeof _3 === "function" ? _3 : (contextStream.pointRadius(+_3), +_3);
6936
+ return path;
6937
+ };
6938
+ path.digits = function(_3) {
6939
+ if (!arguments.length) return digits;
6940
+ if (_3 == null) digits = null;
6941
+ else {
6942
+ const d3 = Math.floor(_3);
6943
+ if (!(d3 >= 0)) throw new RangeError(`invalid digits: ${_3}`);
6944
+ digits = d3;
6945
+ }
6946
+ if (context === null) contextStream = new PathString(digits);
6947
+ return path;
6948
+ };
6949
+ return path.projection(projection2).digits(digits).context(context);
6950
+ }
6951
+ function transformer(methods) {
6952
+ return function(stream) {
6953
+ var s2 = new TransformStream();
6954
+ for (var key in methods) s2[key] = methods[key];
6955
+ s2.stream = stream;
6956
+ return s2;
6957
+ };
6958
+ }
6959
+ function TransformStream() {
6960
+ }
6961
+ TransformStream.prototype = {
6962
+ constructor: TransformStream,
6963
+ point: function(x2, y2) {
6964
+ this.stream.point(x2, y2);
6965
+ },
6966
+ sphere: function() {
6967
+ this.stream.sphere();
6968
+ },
6969
+ lineStart: function() {
6970
+ this.stream.lineStart();
6971
+ },
6972
+ lineEnd: function() {
6973
+ this.stream.lineEnd();
6974
+ },
6975
+ polygonStart: function() {
6976
+ this.stream.polygonStart();
6977
+ },
6978
+ polygonEnd: function() {
6979
+ this.stream.polygonEnd();
6980
+ }
6981
+ };
6982
+ function fit(projection2, fitBounds, object2) {
6983
+ var clip2 = projection2.clipExtent && projection2.clipExtent();
6984
+ projection2.scale(150).translate([0, 0]);
6985
+ if (clip2 != null) projection2.clipExtent(null);
6986
+ geoStream(object2, projection2.stream(boundsStream));
6987
+ fitBounds(boundsStream.result());
6988
+ if (clip2 != null) projection2.clipExtent(clip2);
6989
+ return projection2;
6990
+ }
6991
+ function fitExtent(projection2, extent, object2) {
6992
+ return fit(projection2, function(b3) {
6993
+ var w2 = extent[1][0] - extent[0][0], h = extent[1][1] - extent[0][1], k = Math.min(w2 / (b3[1][0] - b3[0][0]), h / (b3[1][1] - b3[0][1])), x2 = +extent[0][0] + (w2 - k * (b3[1][0] + b3[0][0])) / 2, y2 = +extent[0][1] + (h - k * (b3[1][1] + b3[0][1])) / 2;
6994
+ projection2.scale(150 * k).translate([x2, y2]);
6995
+ }, object2);
6996
+ }
6997
+ function fitSize(projection2, size, object2) {
6998
+ return fitExtent(projection2, [[0, 0], size], object2);
6999
+ }
7000
+ function fitWidth(projection2, width, object2) {
7001
+ return fit(projection2, function(b3) {
7002
+ var w2 = +width, k = w2 / (b3[1][0] - b3[0][0]), x2 = (w2 - k * (b3[1][0] + b3[0][0])) / 2, y2 = -k * b3[0][1];
7003
+ projection2.scale(150 * k).translate([x2, y2]);
7004
+ }, object2);
7005
+ }
7006
+ function fitHeight(projection2, height, object2) {
7007
+ return fit(projection2, function(b3) {
7008
+ var h = +height, k = h / (b3[1][1] - b3[0][1]), x2 = -k * b3[0][0], y2 = (h - k * (b3[1][1] + b3[0][1])) / 2;
7009
+ projection2.scale(150 * k).translate([x2, y2]);
7010
+ }, object2);
7011
+ }
7012
+ var maxDepth = 16, cosMinDistance = cos(30 * radians);
7013
+ function resample(project, delta2) {
7014
+ return +delta2 ? resample$1(project, delta2) : resampleNone(project);
7015
+ }
7016
+ function resampleNone(project) {
7017
+ return transformer({
7018
+ point: function(x2, y2) {
7019
+ x2 = project(x2, y2);
7020
+ this.stream.point(x2[0], x2[1]);
7021
+ }
7022
+ });
7023
+ }
7024
+ function resample$1(project, delta2) {
7025
+ function resampleLineTo(x02, y02, lambda0, a03, b0, c0, x12, y12, lambda1, a13, b1, c1, depth, stream) {
7026
+ var dx = x12 - x02, dy = y12 - y02, d22 = dx * dx + dy * dy;
7027
+ if (d22 > 4 * delta2 && depth--) {
7028
+ var a10 = a03 + a13, b3 = b0 + b1, c2 = c0 + c1, m = sqrt(a10 * a10 + b3 * b3 + c2 * c2), phi2 = asin(c2 /= m), lambda2 = abs(abs(c2) - 1) < epsilon || abs(lambda0 - lambda1) < epsilon ? (lambda0 + lambda1) / 2 : atan2(b3, a10), p3 = project(lambda2, phi2), x2 = p3[0], y2 = p3[1], dx2 = x2 - x02, dy2 = y2 - y02, dz = dy * dx2 - dx * dy2;
7029
+ if (dz * dz / d22 > delta2 || abs((dx * dx2 + dy * dy2) / d22 - 0.5) > 0.3 || a03 * a13 + b0 * b1 + c0 * c1 < cosMinDistance) {
7030
+ resampleLineTo(x02, y02, lambda0, a03, b0, c0, x2, y2, lambda2, a10 /= m, b3 /= m, c2, depth, stream);
7031
+ stream.point(x2, y2);
7032
+ resampleLineTo(x2, y2, lambda2, a10, b3, c2, x12, y12, lambda1, a13, b1, c1, depth, stream);
7033
+ }
7034
+ }
7035
+ }
7036
+ return function(stream) {
7037
+ var lambda00, x002, y002, a00, b00, c00, lambda0, x02, y02, a03, b0, c0;
7038
+ var resampleStream = {
7039
+ point,
7040
+ lineStart,
7041
+ lineEnd,
7042
+ polygonStart: function() {
7043
+ stream.polygonStart();
7044
+ resampleStream.lineStart = ringStart;
7045
+ },
7046
+ polygonEnd: function() {
7047
+ stream.polygonEnd();
7048
+ resampleStream.lineStart = lineStart;
7049
+ }
7050
+ };
7051
+ function point(x2, y2) {
7052
+ x2 = project(x2, y2);
7053
+ stream.point(x2[0], x2[1]);
7054
+ }
7055
+ function lineStart() {
7056
+ x02 = NaN;
7057
+ resampleStream.point = linePoint;
7058
+ stream.lineStart();
7059
+ }
7060
+ function linePoint(lambda, phi) {
7061
+ var c2 = cartesian([lambda, phi]), p3 = project(lambda, phi);
7062
+ resampleLineTo(x02, y02, lambda0, a03, b0, c0, x02 = p3[0], y02 = p3[1], lambda0 = lambda, a03 = c2[0], b0 = c2[1], c0 = c2[2], maxDepth, stream);
7063
+ stream.point(x02, y02);
7064
+ }
7065
+ function lineEnd() {
7066
+ resampleStream.point = point;
7067
+ stream.lineEnd();
7068
+ }
7069
+ function ringStart() {
7070
+ lineStart();
7071
+ resampleStream.point = ringPoint;
7072
+ resampleStream.lineEnd = ringEnd;
7073
+ }
7074
+ function ringPoint(lambda, phi) {
7075
+ linePoint(lambda00 = lambda, phi), x002 = x02, y002 = y02, a00 = a03, b00 = b0, c00 = c0;
7076
+ resampleStream.point = linePoint;
7077
+ }
7078
+ function ringEnd() {
7079
+ resampleLineTo(x02, y02, lambda0, a03, b0, c0, x002, y002, lambda00, a00, b00, c00, maxDepth, stream);
7080
+ resampleStream.lineEnd = lineEnd;
7081
+ lineEnd();
7082
+ }
7083
+ return resampleStream;
7084
+ };
7085
+ }
7086
+ var transformRadians = transformer({
7087
+ point: function(x2, y2) {
7088
+ this.stream.point(x2 * radians, y2 * radians);
7089
+ }
7090
+ });
7091
+ function transformRotate(rotate) {
7092
+ return transformer({
7093
+ point: function(x2, y2) {
7094
+ var r2 = rotate(x2, y2);
7095
+ return this.stream.point(r2[0], r2[1]);
7096
+ }
7097
+ });
7098
+ }
7099
+ function scaleTranslate(k, dx, dy, sx, sy) {
7100
+ function transform2(x2, y2) {
7101
+ x2 *= sx;
7102
+ y2 *= sy;
7103
+ return [dx + k * x2, dy - k * y2];
7104
+ }
7105
+ transform2.invert = function(x2, y2) {
7106
+ return [(x2 - dx) / k * sx, (dy - y2) / k * sy];
7107
+ };
7108
+ return transform2;
7109
+ }
7110
+ function scaleTranslateRotate(k, dx, dy, sx, sy, alpha) {
7111
+ if (!alpha) return scaleTranslate(k, dx, dy, sx, sy);
7112
+ var cosAlpha = cos(alpha), sinAlpha = sin(alpha), a10 = cosAlpha * k, b3 = sinAlpha * k, ai2 = cosAlpha / k, bi = sinAlpha / k, ci = (sinAlpha * dy - cosAlpha * dx) / k, fi = (sinAlpha * dx + cosAlpha * dy) / k;
7113
+ function transform2(x2, y2) {
7114
+ x2 *= sx;
7115
+ y2 *= sy;
7116
+ return [a10 * x2 - b3 * y2 + dx, dy - b3 * x2 - a10 * y2];
7117
+ }
7118
+ transform2.invert = function(x2, y2) {
7119
+ return [sx * (ai2 * x2 - bi * y2 + ci), sy * (fi - bi * x2 - ai2 * y2)];
7120
+ };
7121
+ return transform2;
7122
+ }
7123
+ function projection(project) {
7124
+ return projectionMutator(function() {
7125
+ return project;
7126
+ })();
7127
+ }
7128
+ function projectionMutator(projectAt) {
7129
+ var project, k = 150, x2 = 480, y2 = 250, lambda = 0, phi = 0, deltaLambda = 0, deltaPhi = 0, deltaGamma = 0, rotate, alpha = 0, sx = 1, sy = 1, theta = null, preclip = clipAntimeridian, x02 = null, y02, x12, y12, postclip = identity$1, delta2 = 0.5, projectResample, projectTransform, projectRotateTransform, cache, cacheStream;
7130
+ function projection2(point) {
7131
+ return projectRotateTransform(point[0] * radians, point[1] * radians);
7132
+ }
7133
+ function invert(point) {
7134
+ point = projectRotateTransform.invert(point[0], point[1]);
7135
+ return point && [point[0] * degrees, point[1] * degrees];
7136
+ }
7137
+ projection2.stream = function(stream) {
7138
+ return cache && cacheStream === stream ? cache : cache = transformRadians(transformRotate(rotate)(preclip(projectResample(postclip(cacheStream = stream)))));
7139
+ };
7140
+ projection2.preclip = function(_3) {
7141
+ return arguments.length ? (preclip = _3, theta = void 0, reset()) : preclip;
7142
+ };
7143
+ projection2.postclip = function(_3) {
7144
+ return arguments.length ? (postclip = _3, x02 = y02 = x12 = y12 = null, reset()) : postclip;
7145
+ };
7146
+ projection2.clipAngle = function(_3) {
7147
+ return arguments.length ? (preclip = +_3 ? clipCircle(theta = _3 * radians) : (theta = null, clipAntimeridian), reset()) : theta * degrees;
7148
+ };
7149
+ projection2.clipExtent = function(_3) {
7150
+ return arguments.length ? (postclip = _3 == null ? (x02 = y02 = x12 = y12 = null, identity$1) : clipRectangle(x02 = +_3[0][0], y02 = +_3[0][1], x12 = +_3[1][0], y12 = +_3[1][1]), reset()) : x02 == null ? null : [[x02, y02], [x12, y12]];
7151
+ };
7152
+ projection2.scale = function(_3) {
7153
+ return arguments.length ? (k = +_3, recenter()) : k;
7154
+ };
7155
+ projection2.translate = function(_3) {
7156
+ return arguments.length ? (x2 = +_3[0], y2 = +_3[1], recenter()) : [x2, y2];
7157
+ };
7158
+ projection2.center = function(_3) {
7159
+ return arguments.length ? (lambda = _3[0] % 360 * radians, phi = _3[1] % 360 * radians, recenter()) : [lambda * degrees, phi * degrees];
7160
+ };
7161
+ projection2.rotate = function(_3) {
7162
+ return arguments.length ? (deltaLambda = _3[0] % 360 * radians, deltaPhi = _3[1] % 360 * radians, deltaGamma = _3.length > 2 ? _3[2] % 360 * radians : 0, recenter()) : [deltaLambda * degrees, deltaPhi * degrees, deltaGamma * degrees];
7163
+ };
7164
+ projection2.angle = function(_3) {
7165
+ return arguments.length ? (alpha = _3 % 360 * radians, recenter()) : alpha * degrees;
7166
+ };
7167
+ projection2.reflectX = function(_3) {
7168
+ return arguments.length ? (sx = _3 ? -1 : 1, recenter()) : sx < 0;
7169
+ };
7170
+ projection2.reflectY = function(_3) {
7171
+ return arguments.length ? (sy = _3 ? -1 : 1, recenter()) : sy < 0;
7172
+ };
7173
+ projection2.precision = function(_3) {
7174
+ return arguments.length ? (projectResample = resample(projectTransform, delta2 = _3 * _3), reset()) : sqrt(delta2);
7175
+ };
7176
+ projection2.fitExtent = function(extent, object2) {
7177
+ return fitExtent(projection2, extent, object2);
7178
+ };
7179
+ projection2.fitSize = function(size, object2) {
7180
+ return fitSize(projection2, size, object2);
7181
+ };
7182
+ projection2.fitWidth = function(width, object2) {
7183
+ return fitWidth(projection2, width, object2);
7184
+ };
7185
+ projection2.fitHeight = function(height, object2) {
7186
+ return fitHeight(projection2, height, object2);
7187
+ };
7188
+ function recenter() {
7189
+ var center = scaleTranslateRotate(k, 0, 0, sx, sy, alpha).apply(null, project(lambda, phi)), transform2 = scaleTranslateRotate(k, x2 - center[0], y2 - center[1], sx, sy, alpha);
7190
+ rotate = rotateRadians(deltaLambda, deltaPhi, deltaGamma);
7191
+ projectTransform = compose(project, transform2);
7192
+ projectRotateTransform = compose(rotate, projectTransform);
7193
+ projectResample = resample(projectTransform, delta2);
7194
+ return reset();
7195
+ }
7196
+ function reset() {
7197
+ cache = cacheStream = null;
7198
+ return projection2;
7199
+ }
7200
+ return function() {
7201
+ project = projectAt.apply(this, arguments);
7202
+ projection2.invert = project.invert && invert;
7203
+ return recenter();
7204
+ };
7205
+ }
7206
+ function mercatorRaw(lambda, phi) {
7207
+ return [lambda, log(tan((halfPi + phi) / 2))];
7208
+ }
7209
+ mercatorRaw.invert = function(x2, y2) {
7210
+ return [x2, 2 * atan(exp(y2)) - halfPi];
7211
+ };
7212
+ function geoMercator() {
7213
+ return mercatorProjection(mercatorRaw).scale(961 / tau);
7214
+ }
7215
+ function mercatorProjection(project) {
7216
+ var m = projection(project), center = m.center, scale = m.scale, translate = m.translate, clipExtent = m.clipExtent, x02 = null, y02, x12, y12;
7217
+ m.scale = function(_3) {
7218
+ return arguments.length ? (scale(_3), reclip()) : scale();
7219
+ };
7220
+ m.translate = function(_3) {
7221
+ return arguments.length ? (translate(_3), reclip()) : translate();
7222
+ };
7223
+ m.center = function(_3) {
7224
+ return arguments.length ? (center(_3), reclip()) : center();
7225
+ };
7226
+ m.clipExtent = function(_3) {
7227
+ return arguments.length ? (_3 == null ? x02 = y02 = x12 = y12 = null : (x02 = +_3[0][0], y02 = +_3[0][1], x12 = +_3[1][0], y12 = +_3[1][1]), reclip()) : x02 == null ? null : [[x02, y02], [x12, y12]];
7228
+ };
7229
+ function reclip() {
7230
+ var k = pi * scale(), t2 = m(rotation(m.rotate()).invert([0, 0]));
7231
+ return clipExtent(x02 == null ? [[t2[0] - k, t2[1] - k], [t2[0] + k, t2[1] + k]] : project === mercatorRaw ? [[Math.max(t2[0] - k, x02), y02], [Math.min(t2[0] + k, x12), y12]] : [[x02, Math.max(t2[1] - k, y02)], [x12, Math.min(t2[1] + k, y12)]]);
7232
+ }
7233
+ return reclip();
7234
+ }
7235
+ function identity(x2) {
7236
+ return x2;
7237
+ }
7238
+ function transform(transform2) {
7239
+ if (transform2 == null) return identity;
7240
+ var x02, y02, kx = transform2.scale[0], ky = transform2.scale[1], dx = transform2.translate[0], dy = transform2.translate[1];
7241
+ return function(input, i2) {
7242
+ if (!i2) x02 = y02 = 0;
7243
+ var j = 2, n2 = input.length, output = new Array(n2);
7244
+ output[0] = (x02 += input[0]) * kx + dx;
7245
+ output[1] = (y02 += input[1]) * ky + dy;
7246
+ while (j < n2) output[j] = input[j], ++j;
7247
+ return output;
7248
+ };
7249
+ }
7250
+ function reverse(array, n2) {
7251
+ var t2, j = array.length, i2 = j - n2;
7252
+ while (i2 < --j) t2 = array[i2], array[i2++] = array[j], array[j] = t2;
7253
+ }
7254
+ function topojsonFeature(topology, o2) {
7255
+ if (typeof o2 === "string") o2 = topology.objects[o2];
7256
+ return o2.type === "GeometryCollection" ? { type: "FeatureCollection", features: o2.geometries.map(function(o3) {
7257
+ return feature(topology, o3);
7258
+ }) } : feature(topology, o2);
7259
+ }
7260
+ function feature(topology, o2) {
7261
+ var id = o2.id, bbox = o2.bbox, properties = o2.properties == null ? {} : o2.properties, geometry = object(topology, o2);
7262
+ return id == null && bbox == null ? { type: "Feature", properties, geometry } : bbox == null ? { type: "Feature", id, properties, geometry } : { type: "Feature", id, bbox, properties, geometry };
7263
+ }
7264
+ function object(topology, o2) {
7265
+ var transformPoint = transform(topology.transform), arcs = topology.arcs;
7266
+ function arc(i2, points) {
7267
+ if (points.length) points.pop();
7268
+ for (var a10 = arcs[i2 < 0 ? ~i2 : i2], k = 0, n2 = a10.length; k < n2; ++k) {
7269
+ points.push(transformPoint(a10[k], k));
7270
+ }
7271
+ if (i2 < 0) reverse(points, n2);
7272
+ }
7273
+ function point(p3) {
7274
+ return transformPoint(p3);
7275
+ }
7276
+ function line(arcs2) {
7277
+ var points = [];
7278
+ for (var i2 = 0, n2 = arcs2.length; i2 < n2; ++i2) arc(arcs2[i2], points);
7279
+ if (points.length < 2) points.push(points[0]);
7280
+ return points;
7281
+ }
7282
+ function ring(arcs2) {
7283
+ var points = line(arcs2);
7284
+ while (points.length < 4) points.push(points[0]);
7285
+ return points;
7286
+ }
7287
+ function polygon(arcs2) {
7288
+ return arcs2.map(ring);
7289
+ }
7290
+ function geometry(o3) {
7291
+ var type = o3.type, coordinates;
7292
+ switch (type) {
7293
+ case "GeometryCollection":
7294
+ return { type, geometries: o3.geometries.map(geometry) };
7295
+ case "Point":
7296
+ coordinates = point(o3.coordinates);
7297
+ break;
7298
+ case "MultiPoint":
7299
+ coordinates = o3.coordinates.map(point);
7300
+ break;
7301
+ case "LineString":
7302
+ coordinates = line(o3.arcs);
7303
+ break;
7304
+ case "MultiLineString":
7305
+ coordinates = o3.arcs.map(line);
7306
+ break;
7307
+ case "Polygon":
7308
+ coordinates = polygon(o3.arcs);
7309
+ break;
7310
+ case "MultiPolygon":
7311
+ coordinates = o3.arcs.map(polygon);
7312
+ break;
7313
+ default:
7314
+ return null;
7315
+ }
7316
+ return { type, coordinates };
7317
+ }
7318
+ return geometry(o2);
7319
+ }
7320
+ const choroplethStyles = tv({
7321
+ slots: {
7322
+ root: "relative w-full",
7323
+ svg: "block h-auto w-full",
7324
+ // Traço das divisas — `fg-muted` (mid-gray VISÍVEL nos DOIS temas: L≈0.50
7325
+ // no light, L≈0.70 no dark). `border-default` era L≈0.91 no light → as
7326
+ // divisas sumiam no fundo branco e só estados de alta penetração apareciam
7327
+ // ("só 2 pontos"). hover reforça no próprio path (inline).
7328
+ path: [
7329
+ "stroke-fg-muted",
7330
+ "transition-[fill,stroke] duration-150",
7331
+ "hover:stroke-fg-brand"
7332
+ ],
7333
+ // Camada de ancoragem do tooltip (não intercepta o mouse).
7334
+ tooltipLayer: "pointer-events-none absolute inset-0",
7335
+ tooltipAnchor: "absolute",
7336
+ tooltipName: "font-semibold text-fg-default",
7337
+ tooltipValue: "text-fg-muted",
7338
+ legend: "mt-gp-md flex flex-col gap-gp-xs",
7339
+ legendTitle: "text-caption-sm font-semibold text-fg-muted",
7340
+ legendBar: "h-gp-md w-full rounded-radius-full",
7341
+ legendScale: "flex items-center justify-between text-caption-xs text-fg-muted tabular-nums"
7342
+ }
7343
+ });
7344
+ function isTopology(g) {
7345
+ return !Array.isArray(g) && g.type === "Topology";
7346
+ }
7347
+ function isFeatureCollection(g) {
7348
+ return !Array.isArray(g) && g.type === "FeatureCollection";
7349
+ }
7350
+ function normalizeFeatures(geography, topologyObject) {
7351
+ if (Array.isArray(geography)) return geography;
7352
+ if (isTopology(geography)) {
7353
+ if (!topologyObject) return [];
7354
+ const obj = geography.objects[topologyObject];
7355
+ if (!obj) return [];
7356
+ const out = topojsonFeature(geography, obj);
7357
+ if (out.type === "FeatureCollection") return out.features;
7358
+ return [out];
7359
+ }
7360
+ if (isFeatureCollection(geography)) return geography.features;
7361
+ return [];
7362
+ }
7363
+ const ChoroplethMap = forwardRef(
7364
+ function ChoroplethMap2({
7365
+ geography,
7366
+ topologyObject,
7367
+ values,
7368
+ getFeatureId,
7369
+ getFeatureName,
7370
+ colorScale,
7371
+ scaleToken = "brand",
7372
+ domain,
7373
+ projection: projection2,
7374
+ width = 800,
7375
+ height = 600,
7376
+ strokeWidth = 0.5,
7377
+ showLegend = true,
7378
+ legendTitle,
7379
+ formatValue,
7380
+ renderTooltip,
7381
+ onFeatureClick,
7382
+ ariaLabel = "Mapa",
7383
+ className
7384
+ }, ref) {
7385
+ const styles2 = choroplethStyles();
7386
+ const features = useMemo(
7387
+ () => normalizeFeatures(geography, topologyObject),
7388
+ [geography, topologyObject]
7389
+ );
7390
+ const geometry = useMemo(() => {
7391
+ const proj = projection2 ?? geoMercator().fitSize(
7392
+ [width, height],
7393
+ {
7394
+ type: "FeatureCollection",
7395
+ features
7396
+ }
7397
+ );
7398
+ const pathGen = geoPath(proj);
7399
+ return features.map((f) => ({
7400
+ feature: f,
7401
+ d: pathGen(f) ?? "",
7402
+ centroid: pathGen.centroid(f)
7403
+ }));
7404
+ }, [features, projection2, width, height]);
7405
+ const getId = (f) => {
7406
+ if (getFeatureId) return getFeatureId(f);
7407
+ if (f.id != null) return f.id;
7408
+ const p3 = f.properties ?? {};
7409
+ return p3.id ?? p3.ID ?? "";
7410
+ };
7411
+ const getName = (f) => {
7412
+ if (getFeatureName) return getFeatureName(f);
7413
+ const p3 = f.properties ?? {};
7414
+ return String(p3.name ?? p3.nome ?? p3.NOME ?? p3.Name ?? getId(f));
7415
+ };
7416
+ const numeric = Object.values(values).filter(
7417
+ (v2) => typeof v2 === "number" && Number.isFinite(v2)
7418
+ );
7419
+ const min = domain ? domain[0] : numeric.length ? Math.min(...numeric) : 0;
7420
+ const max = domain ? domain[1] : numeric.length ? Math.max(...numeric) : 0;
7421
+ const scaleVar = `var(--color-bg-${scaleToken})`;
7422
+ const surfaceVar = "var(--color-bg-surface)";
7423
+ const noDataVar = "var(--color-bg-muted)";
7424
+ const fillFor = (value) => {
7425
+ if (value === void 0 || !Number.isFinite(value)) return noDataVar;
7426
+ if (colorScale) return colorScale(value, { min, max });
7427
+ const range = max - min;
7428
+ const t2 = range > 0 ? (value - min) / range : 1;
7429
+ const clamped = Math.max(0, Math.min(1, t2));
7430
+ const pct = 12 + clamped * 88;
7431
+ return `color-mix(in srgb, ${scaleVar} ${pct}%, ${surfaceVar})`;
7432
+ };
7433
+ const fmt = formatValue ?? ((v2) => new Intl.NumberFormat("pt-BR").format(v2));
7434
+ const [hover, setHover] = useState(null);
7435
+ const legendGradient = `linear-gradient(to right, ${surfaceVar}, ${scaleVar})`;
7436
+ return /* @__PURE__ */ jsxs("div", { ref, className: styles2.root({ className }), children: [
7437
+ /* @__PURE__ */ jsx(
7438
+ "svg",
7439
+ {
7440
+ viewBox: `0 0 ${width} ${height}`,
7441
+ className: styles2.svg(),
7442
+ role: "img",
7443
+ "aria-label": ariaLabel,
7444
+ onMouseLeave: () => setHover(null),
7445
+ children: geometry.map(({ feature: feature2, d: d3, centroid }, index) => {
7446
+ const id = getId(feature2);
7447
+ const value = values[id];
7448
+ return /* @__PURE__ */ jsx(
7449
+ "path",
7450
+ {
7451
+ d: d3,
7452
+ fill: fillFor(value),
7453
+ strokeWidth,
7454
+ className: styles2.path(),
7455
+ style: onFeatureClick ? { cursor: "pointer" } : void 0,
7456
+ onMouseEnter: () => setHover({
7457
+ id,
7458
+ name: getName(feature2),
7459
+ value,
7460
+ feature: feature2,
7461
+ ax: centroid[0] / width * 100,
7462
+ ay: centroid[1] / height * 100
7463
+ }),
7464
+ onClick: onFeatureClick ? () => onFeatureClick({
7465
+ id,
7466
+ name: getName(feature2),
7467
+ value,
7468
+ feature: feature2
7469
+ }) : void 0
7470
+ },
7471
+ `${id}-${index}`
7472
+ );
7473
+ })
7474
+ }
7475
+ ),
7476
+ /* @__PURE__ */ jsx("div", { className: styles2.tooltipLayer(), children: /* @__PURE__ */ jsxs(Tooltip, { open: hover != null, onOpenChange: () => {
7477
+ }, disableHoverableContent: true, children: [
7478
+ /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
7479
+ "span",
7480
+ {
7481
+ "aria-hidden": "true",
7482
+ className: styles2.tooltipAnchor(),
7483
+ style: { left: `${hover?.ax ?? 0}%`, top: `${hover?.ay ?? 0}%` }
7484
+ }
7485
+ ) }),
7486
+ /* @__PURE__ */ jsx(
7487
+ TooltipContent,
7488
+ {
7489
+ showArrow: false,
7490
+ className: "border border-border-default bg-bg-surface-elevated shadow-sh-lg",
7491
+ children: hover && (renderTooltip ? renderTooltip(hover) : /* @__PURE__ */ jsxs("div", { children: [
7492
+ /* @__PURE__ */ jsx("div", { className: styles2.tooltipName(), children: hover.name }),
7493
+ /* @__PURE__ */ jsx("div", { className: styles2.tooltipValue(), children: hover.value != null && Number.isFinite(hover.value) ? fmt(hover.value) : "Sem dados" })
7494
+ ] }))
7495
+ }
7496
+ )
7497
+ ] }) }),
7498
+ showLegend && numeric.length > 0 && /* @__PURE__ */ jsxs("div", { className: styles2.legend(), children: [
7499
+ legendTitle && /* @__PURE__ */ jsx("span", { className: styles2.legendTitle(), children: legendTitle }),
7500
+ /* @__PURE__ */ jsx(
7501
+ "div",
7502
+ {
7503
+ className: styles2.legendBar(),
7504
+ style: { background: legendGradient },
7505
+ "aria-hidden": "true"
7506
+ }
7507
+ ),
7508
+ /* @__PURE__ */ jsxs("div", { className: styles2.legendScale(), children: [
7509
+ /* @__PURE__ */ jsx("span", { children: fmt(min) }),
7510
+ /* @__PURE__ */ jsx("span", { children: fmt(max) })
7511
+ ] })
7512
+ ] })
7513
+ ] });
7514
+ }
7515
+ );
7516
+ ChoroplethMap.displayName = "ChoroplethMap";
3958
7517
  export {
3959
- j as AddViewModal,
7518
+ n as AddViewModal,
3960
7519
  A as AlertModal,
3961
7520
  A2 as AppShell,
3962
- k as Avatar,
3963
- B3 as Badge,
7521
+ Avatar,
7522
+ Badge,
3964
7523
  B as BulkActionButton,
3965
- l as BulkActionsBar,
7524
+ o as BulkActionsBar,
3966
7525
  Button,
3967
7526
  ButtonGroup,
3968
7527
  CardCheckbox,
3969
7528
  Chip,
3970
- a10 as ChipGroup,
3971
- b2 as ChipGroupItem,
3972
- C as ColsPanel,
3973
- m as ColsPopover,
3974
- n as Combobox,
3975
- o as DEFAULT_FILTER_OPERATORS,
7529
+ d2 as ChipGroup,
7530
+ e as ChipGroupItem,
7531
+ ChoroplethMap,
7532
+ ColorPicker,
7533
+ q as ColsPanel,
7534
+ r as ColsPopover,
7535
+ s as Combobox,
7536
+ ConversationListItem,
7537
+ DEFAULT_COLOR_PRESETS,
7538
+ t as DEFAULT_FILTER_OPERATORS,
7539
+ DEFAULT_MESSAGE_VARIABLES,
3976
7540
  D as DataTable,
3977
- q as DataTableActionsCell,
3978
- r as DataTableEditCell,
3979
- s as DataTableEmpty,
3980
- t as DataTableFloatingBulkBar,
3981
- u as DataTableLoading,
3982
- v as DataTableNoResults,
3983
- w as DataTableTotalizerRow,
3984
- x as FLOATING_PANEL_SIZE_PX,
3985
- y as FilterPanel,
7541
+ u as DataTableActionsCell,
7542
+ v as DataTableEditCell,
7543
+ w as DataTableEmpty,
7544
+ x as DataTableFloatingBulkBar,
7545
+ y as DataTableLoading,
7546
+ z as DataTableNoResults,
7547
+ E as DataTableTotalizerRow,
7548
+ DatePicker,
7549
+ DateSeparatorChip,
7550
+ EmptyState,
7551
+ G as FLOATING_PANEL_SIZE_PX,
7552
+ FileUploadField,
7553
+ H as FilterPanel,
3986
7554
  FilterPopover,
3987
7555
  d as FloatingPanel,
3988
- z as FloatingPanelField,
3989
- E as FloatingPanelSection,
3990
- G as FooterTable,
3991
- H as FooterTableSkeleton,
3992
- a as FormField,
3993
- I as FormFieldCheckbox,
7556
+ I as FloatingPanelField,
7557
+ J as FloatingPanelSection,
7558
+ K as FooterTable,
7559
+ L as FooterTableSkeleton,
7560
+ FormField,
7561
+ M as FormFieldCheckbox,
3994
7562
  F as FormFieldInput,
3995
7563
  b as FormFieldSelect,
3996
- J as FormFieldSwitch,
7564
+ N as FormFieldSwitch,
3997
7565
  c as FormFieldTextarea,
3998
7566
  H2 as Header,
3999
- s2 as HeaderBreadcrumb,
4000
- t2 as HeaderMessages,
4001
- u2 as HeaderNotifications,
4002
- v2 as HeaderSearch,
4003
- w2 as HeaderThemeSwitcher,
7567
+ F2 as HeaderBreadcrumb,
7568
+ G2 as HeaderMessages,
7569
+ I2 as HeaderNotifications,
7570
+ J2 as HeaderSearch,
7571
+ K2 as HeaderThemeSwitcher,
4004
7572
  Icon,
4005
- I3 as Input,
4006
- I2 as InputGroup,
4007
- x2 as InputGroupAddon,
4008
- y2 as InputGroupButton,
4009
- z2 as InputGroupInput,
4010
- B2 as InputGroupText,
4011
- E2 as InputGroupTextarea,
4012
- K as Kanban,
4013
- Kpi,
4014
- KpiDelta,
4015
- KpiGroup,
4016
- M2 as MenuSidebar,
7573
+ Input,
7574
+ L2 as InputGroup,
7575
+ M2 as InputGroupAddon,
7576
+ N2 as InputGroupButton,
7577
+ O2 as InputGroupInput,
7578
+ Q2 as InputGroupText,
7579
+ R2 as InputGroupTextarea,
7580
+ O as Kanban,
7581
+ a as Kpi,
7582
+ b2 as KpiDelta,
7583
+ K3 as KpiGroup,
7584
+ MarkdownText,
7585
+ S2 as MenuSidebar,
7586
+ MessageAck,
7587
+ MessageBubble,
7588
+ MessageComposer,
7589
+ Reply as MessageReplyIcon,
7590
+ MessageVariablesPicker,
4017
7591
  Modal,
4018
- M as MoreMenu,
4019
- F2 as MoreMenuCheckboxItem,
7592
+ MonthYearPicker,
7593
+ Q as MoreMenu,
7594
+ T as MoreMenuCheckboxItem,
4020
7595
  DropdownMenuItem as MoreMenuItem,
4021
7596
  DropdownMenuLabel as MoreMenuLabel,
4022
- G2 as MoreMenuRadioGroup,
4023
- J2 as MoreMenuRadioItem,
7597
+ U2 as MoreMenuRadioGroup,
7598
+ V2 as MoreMenuRadioItem,
4024
7599
  DropdownMenuSeparator as MoreMenuSeparator,
4025
- P3 as PageHeader,
7600
+ P2 as PageHeader,
4026
7601
  P as Panel,
4027
- L as PanelBody,
7602
+ R as PanelBody,
4028
7603
  S as PanelCloseAction,
4029
- N as PanelContent,
4030
- O as PanelFooter,
4031
- Q as PanelHeader,
4032
- R as PanelRoot,
4033
- U as PanelTrigger,
4034
- V as SELECTION_COLUMN_WIDTH,
4035
- S2 as SidebarBrandIcon,
4036
- K2 as SidebarItem,
4037
- L2 as SidebarPanel,
4038
- N2 as SidebarPill,
4039
- O2 as SidebarRail,
4040
- P2 as SidebarSection,
4041
- Q2 as SidebarSubgroup,
7604
+ U as PanelContent,
7605
+ V as PanelFooter,
7606
+ W as PanelHeader,
7607
+ X as PanelRoot,
7608
+ Y as PanelTrigger,
7609
+ Z as SELECTION_COLUMN_WIDTH,
7610
+ W2 as SidebarBrandIcon,
7611
+ X2 as SidebarItem,
7612
+ Y2 as SidebarPanel,
7613
+ Z2 as SidebarPill,
7614
+ _2 as SidebarRail,
7615
+ $2 as SidebarSection,
7616
+ a02 as SidebarSubgroup,
4042
7617
  SingleMenuSidebar,
4043
- W as SortPanel,
4044
- X as SortPopover,
4045
- Y as TABLE_HEADER_HEIGHT,
4046
- T2 as Table,
4047
- a11 as TableBody,
4048
- b3 as TableCardRow,
4049
- c2 as TableCell,
4050
- d3 as TableHead,
4051
- e2 as TableHeadCell,
4052
- f2 as TableRow,
4053
- Z as TableToolbar,
4054
- _ as TableToolbarViews,
4055
- $ as ToolbarApplied,
4056
- a0 as ToolbarDivider,
7618
+ _ as SortPanel,
7619
+ $ as SortPopover,
7620
+ Spinner,
7621
+ a0 as TABLE_HEADER_HEIGHT,
7622
+ a1 as Table,
7623
+ a2 as TableBody,
7624
+ a3 as TableCardRow,
7625
+ a4 as TableCell,
7626
+ a5 as TableHead,
7627
+ a6 as TableHeadCell,
7628
+ a7 as TableRow,
7629
+ a8 as TableToolbar,
7630
+ a9 as TableToolbarViews,
7631
+ aa as ToolbarApplied,
7632
+ ab as ToolbarDivider,
4057
7633
  ToolbarFilterControl,
4058
7634
  ToolbarMobileDialog,
4059
7635
  ToolbarMobileSection,
4060
7636
  ToolbarMobileSheet,
4061
- a1 as ToolbarSaveButton,
4062
- a2 as ToolbarSearch,
4063
- a3 as ToolbarSegmented,
4064
- a4 as ToolbarSettingsMenu,
7637
+ ac as ToolbarSaveButton,
7638
+ ad as ToolbarSearch,
7639
+ ae as ToolbarSegmented,
7640
+ af as ToolbarSettingsMenu,
4065
7641
  ToolbarSimpleFilterDrawer,
4066
- a5 as ToolbarTabs,
7642
+ ag as ToolbarTabs,
4067
7643
  ToolbarToolButton,
4068
- U2 as UserMenu,
4069
- a6 as ViewsPopover,
7644
+ a12 as UserMenu,
7645
+ ah as ViewsPopover,
4070
7646
  actionColumn,
4071
- a7 as avatarVariants,
4072
- g as badgeVariants,
4073
- d2 as buttonVariants,
7647
+ ai as avatarVariants,
7648
+ badgeVariants,
7649
+ a22 as buttonVariants,
4074
7650
  cardCheckbox,
4075
- e as chipCount,
4076
- f as chipVariants,
4077
- a8 as columnTypeRegistry,
7651
+ a32 as chipCount,
7652
+ a42 as chipVariants,
7653
+ colorPickerStyles,
7654
+ aj as columnTypeRegistry,
7655
+ conversationListItemStyles,
4078
7656
  currencyColumn,
4079
7657
  customColumn,
4080
7658
  dateColumn,
7659
+ dateSeparatorChipStyles,
4081
7660
  emailColumn,
4082
- a9 as floatingPanelStyles,
7661
+ emptyStateStyles,
7662
+ ak as floatingPanelStyles,
4083
7663
  iconStyles,
4084
7664
  icons,
4085
- R2 as inputGroupVariants,
7665
+ a52 as inputGroupVariants,
4086
7666
  i as inputVariants,
4087
7667
  isFilterEntryActive,
7668
+ markdownTextStyles,
7669
+ messageAckStyles,
7670
+ messageBubbleStyles,
7671
+ messageComposerStyles,
7672
+ messageVariablesPickerStyles,
4088
7673
  numberColumn,
4089
7674
  p2 as pageHeaderStyles,
4090
- aa as panelContainer,
7675
+ al as panelContainer,
4091
7676
  phoneColumn,
4092
7677
  p as presetView,
4093
- ab as savedViewsMockService,
7678
+ am as savedViewsMockService,
4094
7679
  statusColumn,
4095
7680
  textColumn,
4096
- u3 as useColumnResize,
4097
- ac as useColumnWidths,
4098
- T as useControllable,
4099
- ad as useDataTableContext,
4100
- ae as useFloatingPanelResize,
4101
- V2 as useMediaQuery,
7681
+ an as useColumnResize,
7682
+ ao as useColumnWidths,
7683
+ a62 as useControllable,
7684
+ ap as useDataTableContext,
7685
+ aq as useFloatingPanelResize,
7686
+ a72 as useMediaQuery,
4102
7687
  useToolbarFilterControl,
4103
7688
  useToolbarFilters,
4104
7689
  useToolbarSort