monobill-mintui 0.6.612 → 0.6.613

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 (623) hide show
  1. package/README.md +76 -302
  2. package/bin/component-dependencies.json +131 -0
  3. package/bin/mint-ui.js +446 -0
  4. package/dist/alert.css +3 -0
  5. package/dist/back-button.css +3 -0
  6. package/dist/bottom-navigation.css +3 -0
  7. package/dist/button.css +3 -0
  8. package/dist/card.css +3 -0
  9. package/dist/chart.css +3 -0
  10. package/dist/checkbox.css +3 -0
  11. package/dist/chip.css +3 -0
  12. package/dist/choice.css +3 -0
  13. package/dist/clickable.css +3 -0
  14. package/dist/collapsible.css +3 -0
  15. package/dist/components/alert/Alert.d.ts +1 -32
  16. package/dist/components/alert/Alert.d.ts.map +10 -1
  17. package/dist/components/alert/browser.js +167 -0
  18. package/dist/components/alert/index.cjs +1 -0
  19. package/dist/components/alert/index.d.ts +1 -3
  20. package/dist/components/alert/index.d.ts.map +10 -1
  21. package/dist/components/alert/index.js +155 -0
  22. package/dist/components/back-button/BackButton.d.ts +1 -18
  23. package/dist/components/back-button/BackButton.d.ts.map +10 -1
  24. package/dist/components/back-button/browser.js +241 -0
  25. package/dist/components/back-button/index.cjs +1 -0
  26. package/dist/components/back-button/index.d.ts +1 -3
  27. package/dist/components/back-button/index.d.ts.map +10 -1
  28. package/dist/components/back-button/index.js +229 -0
  29. package/dist/components/bottom-navigation/BottomNavigation.d.ts +1 -10
  30. package/dist/components/bottom-navigation/BottomNavigation.d.ts.map +10 -1
  31. package/dist/components/bottom-navigation/browser.js +97 -0
  32. package/dist/components/bottom-navigation/index.cjs +1 -0
  33. package/dist/components/bottom-navigation/index.d.ts +2 -5
  34. package/dist/components/bottom-navigation/index.d.ts.map +10 -1
  35. package/dist/components/bottom-navigation/index.js +85 -0
  36. package/dist/components/button/Button.d.ts +1 -57
  37. package/dist/components/button/Button.d.ts.map +10 -1
  38. package/dist/components/button/browser.js +18 -0
  39. package/dist/components/button/index.cjs +1 -0
  40. package/dist/components/button/index.d.ts +1 -3
  41. package/dist/components/button/index.d.ts.map +10 -1
  42. package/dist/components/button/index.js +6 -0
  43. package/dist/components/card/Card.d.ts +1 -17
  44. package/dist/components/card/Card.d.ts.map +10 -1
  45. package/dist/components/card/browser.js +25 -0
  46. package/dist/components/card/index.cjs +1 -0
  47. package/dist/components/card/index.d.ts +1 -3
  48. package/dist/components/card/index.d.ts.map +10 -1
  49. package/dist/components/card/index.js +13 -0
  50. package/dist/components/chart/Chart.d.ts +1 -291
  51. package/dist/components/chart/Chart.d.ts.map +10 -1
  52. package/dist/components/chart/browser.js +1331 -0
  53. package/dist/components/chart/index.cjs +37 -0
  54. package/dist/components/chart/index.d.ts +1 -3
  55. package/dist/components/chart/index.d.ts.map +10 -1
  56. package/dist/components/chart/index.js +1319 -0
  57. package/dist/components/checkbox/Checkbox.d.ts +1 -41
  58. package/dist/components/checkbox/Checkbox.d.ts.map +10 -1
  59. package/dist/components/checkbox/browser.js +162 -0
  60. package/dist/components/checkbox/index.cjs +1 -0
  61. package/dist/components/checkbox/index.d.ts +1 -3
  62. package/dist/components/checkbox/index.d.ts.map +10 -1
  63. package/dist/components/checkbox/index.js +150 -0
  64. package/dist/components/chip/Chip.d.ts +1 -16
  65. package/dist/components/chip/Chip.d.ts.map +10 -1
  66. package/dist/components/chip/browser.js +17 -0
  67. package/dist/components/chip/index.cjs +1 -0
  68. package/dist/components/chip/index.d.ts +1 -3
  69. package/dist/components/chip/index.d.ts.map +10 -1
  70. package/dist/components/chip/index.js +5 -0
  71. package/dist/components/choice/Choice.d.ts +1 -27
  72. package/dist/components/choice/Choice.d.ts.map +10 -1
  73. package/dist/components/choice/browser.js +272 -0
  74. package/dist/components/choice/index.cjs +1 -0
  75. package/dist/components/choice/index.d.ts +1 -5
  76. package/dist/components/choice/index.d.ts.map +10 -1
  77. package/dist/components/choice/index.js +260 -0
  78. package/dist/components/chunks/button-B0Yt0MX1.js +380 -0
  79. package/dist/components/chunks/button-BlbLHMts.js +1 -0
  80. package/dist/components/chunks/caret-down-BN9cl4o4.js +1 -0
  81. package/dist/components/chunks/caret-down-Ch6IfR7r.js +9 -0
  82. package/dist/components/chunks/caret-right-CDUwqoen.js +1 -0
  83. package/dist/components/chunks/caret-right-CVOgr4nk.js +9 -0
  84. package/dist/components/chunks/caret-up-3XCuTXSE.js +1 -0
  85. package/dist/components/chunks/caret-up-D_6oa7o1.js +9 -0
  86. package/dist/components/chunks/chip-B04bJM4r.js +1 -0
  87. package/dist/components/chunks/chip-B9whjEvW.js +54 -0
  88. package/dist/components/chunks/close-5tYlQdkk.js +1 -0
  89. package/dist/components/chunks/close-Dg6U0IjZ.js +10 -0
  90. package/dist/components/chunks/icon-C0OLmjDY.js +1 -0
  91. package/dist/components/chunks/icon-CyzR9aVl.js +1 -0
  92. package/dist/components/chunks/icon-dG8sLTBn.js +27 -0
  93. package/dist/components/chunks/icon-gQAtsERy.js +1324 -0
  94. package/dist/components/chunks/input-8bbXzpa5.js +334 -0
  95. package/dist/components/chunks/input-BoiREc6Y.js +1 -0
  96. package/dist/components/chunks/link-BxhPnVaz.js +1 -0
  97. package/dist/components/chunks/link-DKgtBYK6.js +38 -0
  98. package/dist/components/chunks/modal-B8gNdwEl.js +153 -0
  99. package/dist/components/chunks/modal-WYWvk2lZ.js +1 -0
  100. package/dist/components/chunks/popover-BeaGf_JC.js +1 -0
  101. package/dist/components/chunks/popover-gviDCspV.js +188 -0
  102. package/dist/components/chunks/register-element-BFYmIynH.js +53 -0
  103. package/dist/components/chunks/register-element-tCL_F1YI.js +1 -0
  104. package/dist/components/chunks/search-ANUKQi0r.js +9 -0
  105. package/dist/components/chunks/search-B3egXuw4.js +1 -0
  106. package/dist/components/chunks/spinner-BsaFHuS6.js +108 -0
  107. package/dist/components/chunks/spinner-DbTohC6i.js +63 -0
  108. package/dist/components/chunks/stack-D1uh4L79.js +1 -0
  109. package/dist/components/chunks/stack-DyQfjPDh.js +53 -0
  110. package/dist/components/chunks/table-BgboosRK.js +65 -0
  111. package/dist/components/chunks/table-DDUNUwGd.js +1 -0
  112. package/dist/components/chunks/text-BHkEs8U5.js +67 -0
  113. package/dist/components/chunks/text-BmHZbBMo.js +1 -0
  114. package/dist/components/clickable/Clickable.d.ts +1 -14
  115. package/dist/components/clickable/Clickable.d.ts.map +10 -1
  116. package/dist/components/clickable/browser.js +78 -0
  117. package/dist/components/clickable/index.cjs +1 -0
  118. package/dist/components/clickable/index.d.ts +1 -3
  119. package/dist/components/clickable/index.d.ts.map +10 -1
  120. package/dist/components/clickable/index.js +66 -0
  121. package/dist/components/collapsible/Collapsible.d.ts +1 -28
  122. package/dist/components/collapsible/Collapsible.d.ts.map +10 -1
  123. package/dist/components/collapsible/browser.js +170 -0
  124. package/dist/components/collapsible/index.cjs +1 -0
  125. package/dist/components/collapsible/index.d.ts +1 -3
  126. package/dist/components/collapsible/index.d.ts.map +10 -1
  127. package/dist/components/collapsible/index.js +158 -0
  128. package/dist/components/confirm-action/ConfirmAction.d.ts +1 -27
  129. package/dist/components/confirm-action/ConfirmAction.d.ts.map +10 -1
  130. package/dist/components/confirm-action/browser.js +130 -0
  131. package/dist/components/confirm-action/index.cjs +1 -0
  132. package/dist/components/confirm-action/index.d.ts +2 -3
  133. package/dist/components/confirm-action/index.d.ts.map +10 -1
  134. package/dist/components/confirm-action/index.js +118 -0
  135. package/dist/components/date-picker/DatePicker.d.ts +1 -130
  136. package/dist/components/date-picker/DatePicker.d.ts.map +10 -1
  137. package/dist/components/date-picker/browser.js +1288 -0
  138. package/dist/components/date-picker/index.cjs +1 -0
  139. package/dist/components/date-picker/index.d.ts +1 -3
  140. package/dist/components/date-picker/index.d.ts.map +10 -1
  141. package/dist/components/date-picker/index.js +1276 -0
  142. package/dist/components/dropzone/Dropzone.d.ts +1 -59
  143. package/dist/components/dropzone/Dropzone.d.ts.map +10 -1
  144. package/dist/components/dropzone/browser.js +355 -0
  145. package/dist/components/dropzone/index.cjs +1 -0
  146. package/dist/components/dropzone/index.d.ts +1 -3
  147. package/dist/components/dropzone/index.d.ts.map +10 -1
  148. package/dist/components/dropzone/index.js +343 -0
  149. package/dist/components/form/Form.d.ts +1 -133
  150. package/dist/components/form/Form.d.ts.map +10 -1
  151. package/dist/components/form/browser.js +1002 -0
  152. package/dist/components/form/index.cjs +1 -0
  153. package/dist/components/form/index.d.ts +1 -3
  154. package/dist/components/form/index.d.ts.map +10 -1
  155. package/dist/components/form/index.js +990 -0
  156. package/dist/components/grid/Grid.d.ts +1 -16
  157. package/dist/components/grid/Grid.d.ts.map +10 -1
  158. package/dist/components/grid/browser.js +24 -0
  159. package/dist/components/grid/index.cjs +1 -0
  160. package/dist/components/grid/index.d.ts +1 -3
  161. package/dist/components/grid/index.d.ts.map +10 -1
  162. package/dist/components/grid/index.js +12 -0
  163. package/dist/components/icon/Icon.d.ts +1 -16
  164. package/dist/components/icon/Icon.d.ts.map +10 -1
  165. package/dist/components/icon/browser.js +16 -0
  166. package/dist/components/icon/index.cjs +1 -0
  167. package/dist/components/icon/index.d.ts +2 -3
  168. package/dist/components/icon/index.d.ts.map +10 -1
  169. package/dist/components/icon/index.js +4 -0
  170. package/dist/components/input/Input.d.ts +1 -68
  171. package/dist/components/input/Input.d.ts.map +10 -1
  172. package/dist/components/input/browser.js +17 -0
  173. package/dist/components/input/index.cjs +1 -0
  174. package/dist/components/input/index.d.ts +1 -3
  175. package/dist/components/input/index.d.ts.map +10 -1
  176. package/dist/components/input/index.js +5 -0
  177. package/dist/components/link/Link.d.ts +1 -16
  178. package/dist/components/link/Link.d.ts.map +10 -1
  179. package/dist/components/link/browser.js +16 -0
  180. package/dist/components/link/index.cjs +1 -0
  181. package/dist/components/link/index.d.ts +1 -3
  182. package/dist/components/link/index.d.ts.map +10 -1
  183. package/dist/components/link/index.js +4 -0
  184. package/dist/components/modal/Modal.d.ts +1 -38
  185. package/dist/components/modal/Modal.d.ts.map +10 -1
  186. package/dist/components/modal/browser.js +21 -0
  187. package/dist/components/modal/index.cjs +1 -0
  188. package/dist/components/modal/index.d.ts +1 -3
  189. package/dist/components/modal/index.d.ts.map +10 -1
  190. package/dist/components/modal/index.js +9 -0
  191. package/dist/components/navigation/Navigation.d.ts +1 -0
  192. package/dist/components/navigation/Navigation.d.ts.map +10 -0
  193. package/dist/components/navigation/browser.js +198 -0
  194. package/dist/components/navigation/index.cjs +1 -0
  195. package/dist/components/navigation/index.d.ts +1 -0
  196. package/dist/components/navigation/index.d.ts.map +10 -0
  197. package/dist/components/navigation/index.js +186 -0
  198. package/dist/components/off-canvas/OffCanvas.d.ts +1 -46
  199. package/dist/components/off-canvas/OffCanvas.d.ts.map +10 -1
  200. package/dist/components/off-canvas/browser.js +192 -0
  201. package/dist/components/off-canvas/index.cjs +1 -0
  202. package/dist/components/off-canvas/index.d.ts +1 -3
  203. package/dist/components/off-canvas/index.d.ts.map +10 -1
  204. package/dist/components/off-canvas/index.js +180 -0
  205. package/dist/components/page/Page.d.ts +1 -37
  206. package/dist/components/page/Page.d.ts.map +10 -1
  207. package/dist/components/page/browser.js +74 -0
  208. package/dist/components/page/index.cjs +16 -0
  209. package/dist/components/page/index.d.ts +1 -3
  210. package/dist/components/page/index.d.ts.map +10 -1
  211. package/dist/components/page/index.js +62 -0
  212. package/dist/components/popover/Popover.d.ts +1 -64
  213. package/dist/components/popover/Popover.d.ts.map +10 -1
  214. package/dist/components/popover/browser.js +17 -0
  215. package/dist/components/popover/index.cjs +1 -0
  216. package/dist/components/popover/index.d.ts +1 -3
  217. package/dist/components/popover/index.d.ts.map +10 -1
  218. package/dist/components/popover/index.js +5 -0
  219. package/dist/components/resource-table/ResourceTable.d.ts +1 -327
  220. package/dist/components/resource-table/ResourceTable.d.ts.map +10 -1
  221. package/dist/components/resource-table/browser.js +1457 -0
  222. package/dist/components/resource-table/index.cjs +2 -0
  223. package/dist/components/resource-table/index.d.ts +1 -4
  224. package/dist/components/resource-table/index.d.ts.map +10 -1
  225. package/dist/components/resource-table/index.js +1445 -0
  226. package/dist/components/search/Search.d.ts +1 -151
  227. package/dist/components/search/Search.d.ts.map +10 -1
  228. package/dist/components/search/browser.js +681 -0
  229. package/dist/components/search/index.cjs +1 -0
  230. package/dist/components/search/index.d.ts +1 -3
  231. package/dist/components/search/index.d.ts.map +10 -1
  232. package/dist/components/search/index.js +669 -0
  233. package/dist/components/select/Select.d.ts +1 -37
  234. package/dist/components/select/Select.d.ts.map +10 -1
  235. package/dist/components/select/browser.js +285 -0
  236. package/dist/components/select/index.cjs +1 -0
  237. package/dist/components/select/index.d.ts +1 -3
  238. package/dist/components/select/index.d.ts.map +10 -1
  239. package/dist/components/select/index.js +273 -0
  240. package/dist/components/side-navigation/SideNavigation.d.ts +1 -52
  241. package/dist/components/side-navigation/SideNavigation.d.ts.map +10 -1
  242. package/dist/components/side-navigation/browser.js +466 -0
  243. package/dist/components/side-navigation/index.cjs +1 -0
  244. package/dist/components/side-navigation/index.d.ts +5 -8
  245. package/dist/components/side-navigation/index.d.ts.map +10 -1
  246. package/dist/components/side-navigation/index.js +454 -0
  247. package/dist/components/sortable/Sortable.d.ts +1 -62
  248. package/dist/components/sortable/Sortable.d.ts.map +10 -1
  249. package/dist/components/sortable/browser.js +340 -0
  250. package/dist/components/sortable/index.cjs +1 -0
  251. package/dist/components/sortable/index.d.ts +1 -3
  252. package/dist/components/sortable/index.d.ts.map +10 -1
  253. package/dist/components/sortable/index.js +328 -0
  254. package/dist/components/spinner/Spinner.d.ts +1 -13
  255. package/dist/components/spinner/Spinner.d.ts.map +10 -1
  256. package/dist/components/spinner/browser.js +16 -0
  257. package/dist/components/spinner/index.cjs +1 -0
  258. package/dist/components/spinner/index.d.ts +1 -3
  259. package/dist/components/spinner/index.d.ts.map +10 -1
  260. package/dist/components/spinner/index.js +4 -0
  261. package/dist/components/stack/Stack.d.ts +1 -23
  262. package/dist/components/stack/Stack.d.ts.map +10 -1
  263. package/dist/components/stack/browser.js +16 -0
  264. package/dist/components/stack/index.cjs +1 -0
  265. package/dist/components/stack/index.d.ts +1 -3
  266. package/dist/components/stack/index.d.ts.map +10 -1
  267. package/dist/components/stack/index.js +4 -0
  268. package/dist/components/switch/Switch.d.ts +1 -33
  269. package/dist/components/switch/Switch.d.ts.map +10 -1
  270. package/dist/components/switch/browser.js +203 -0
  271. package/dist/components/switch/index.cjs +1 -0
  272. package/dist/components/switch/index.d.ts +1 -3
  273. package/dist/components/switch/index.d.ts.map +10 -1
  274. package/dist/components/switch/index.js +191 -0
  275. package/dist/components/table/Table.d.ts +1 -11
  276. package/dist/components/table/Table.d.ts.map +10 -1
  277. package/dist/components/table/browser.js +16 -0
  278. package/dist/components/table/index.cjs +1 -0
  279. package/dist/components/table/index.d.ts +1 -3
  280. package/dist/components/table/index.d.ts.map +10 -1
  281. package/dist/components/table/index.js +4 -0
  282. package/dist/components/tabs/Tabs.d.ts +1 -20
  283. package/dist/components/tabs/Tabs.d.ts.map +10 -1
  284. package/dist/components/tabs/browser.js +251 -0
  285. package/dist/components/tabs/index.cjs +1 -0
  286. package/dist/components/tabs/index.d.ts +4 -9
  287. package/dist/components/tabs/index.d.ts.map +10 -1
  288. package/dist/components/tabs/index.js +239 -0
  289. package/dist/components/tags/Tags.d.ts +1 -82
  290. package/dist/components/tags/Tags.d.ts.map +10 -1
  291. package/dist/components/tags/browser.js +416 -0
  292. package/dist/components/tags/index.cjs +1 -0
  293. package/dist/components/tags/index.d.ts +1 -3
  294. package/dist/components/tags/index.d.ts.map +10 -1
  295. package/dist/components/tags/index.js +404 -0
  296. package/dist/components/text/Text.d.ts +1 -25
  297. package/dist/components/text/Text.d.ts.map +10 -1
  298. package/dist/components/text/browser.js +16 -0
  299. package/dist/components/text/index.cjs +1 -0
  300. package/dist/components/text/index.d.ts +1 -3
  301. package/dist/components/text/index.d.ts.map +10 -1
  302. package/dist/components/text/index.js +4 -0
  303. package/dist/components/time-picker/TimePicker.d.ts +1 -61
  304. package/dist/components/time-picker/TimePicker.d.ts.map +10 -1
  305. package/dist/components/time-picker/browser.js +366 -0
  306. package/dist/components/time-picker/index.cjs +1 -0
  307. package/dist/components/time-picker/index.d.ts +1 -3
  308. package/dist/components/time-picker/index.d.ts.map +10 -1
  309. package/dist/components/time-picker/index.js +354 -0
  310. package/dist/components/toast/Toast.d.ts +1 -21
  311. package/dist/components/toast/Toast.d.ts.map +10 -1
  312. package/dist/components/toast/browser.js +147 -0
  313. package/dist/components/toast/index.cjs +3 -0
  314. package/dist/components/toast/index.d.ts +3 -3
  315. package/dist/components/toast/index.d.ts.map +10 -1
  316. package/dist/components/toast/index.js +135 -0
  317. package/dist/confirm-action.css +3 -0
  318. package/dist/date-picker.css +3 -0
  319. package/dist/dropzone.css +3 -0
  320. package/dist/form.css +3 -0
  321. package/dist/grid.css +3 -0
  322. package/dist/icon.css +3 -0
  323. package/dist/icons/ai.svg +5 -6
  324. package/dist/icons/bank.svg +1 -1
  325. package/dist/icons/barcode.svg +1 -1
  326. package/dist/icons/basket.svg +1 -1
  327. package/dist/icons/building.svg +1 -1
  328. package/dist/icons/buildings.svg +1 -1
  329. package/dist/icons/calendar.svg +1 -1
  330. package/dist/icons/cash.svg +3 -0
  331. package/dist/icons/check.svg +1 -1
  332. package/dist/icons/close.svg +1 -1
  333. package/dist/icons/coupon.svg +3 -0
  334. package/dist/icons/delivery-location.svg +3 -0
  335. package/dist/icons/desktop.svg +3 -0
  336. package/dist/icons/dollar-sign.svg +1 -1
  337. package/dist/icons/edit.svg +1 -1
  338. package/dist/icons/gift.svg +3 -0
  339. package/dist/icons/grip-lines.svg +2 -2
  340. package/dist/icons/heart.svg +3 -0
  341. package/dist/icons/installments.svg +3 -0
  342. package/dist/icons/inventory.svg +3 -0
  343. package/dist/icons/invoice.svg +3 -0
  344. package/dist/icons/loyalty-points.svg +3 -0
  345. package/dist/icons/membership.svg +3 -0
  346. package/dist/icons/mobile.svg +3 -0
  347. package/dist/icons/order-tracking.svg +7 -0
  348. package/dist/icons/out-of-stock.svg +3 -0
  349. package/dist/icons/package.svg +3 -0
  350. package/dist/icons/percent-discount.svg +3 -0
  351. package/dist/icons/pickup.svg +3 -0
  352. package/dist/icons/plus.svg +1 -1
  353. package/dist/icons/price-label.svg +3 -0
  354. package/dist/icons/product-review.svg +3 -0
  355. package/dist/icons/receipt.svg +3 -0
  356. package/dist/icons/refund.svg +3 -0
  357. package/dist/icons/remove.svg +1 -1
  358. package/dist/icons/return.svg +3 -0
  359. package/dist/icons/sale-burst.svg +3 -0
  360. package/dist/icons/secure-checkout.svg +3 -0
  361. package/dist/icons/shopping-bag.svg +3 -0
  362. package/dist/icons/shopping-cart.svg +3 -0
  363. package/dist/icons/storefront.svg +3 -0
  364. package/dist/icons/support.svg +3 -0
  365. package/dist/icons/tablet.svg +3 -0
  366. package/dist/icons/wallet.svg +3 -0
  367. package/dist/icons/warehouse.svg +3 -0
  368. package/dist/index.cjs +83 -79
  369. package/dist/index.css +253 -0
  370. package/dist/index.d.ts +94 -91
  371. package/dist/index.d.ts.map +10 -1
  372. package/dist/index.js +10695 -10239
  373. package/dist/input.css +3 -0
  374. package/dist/link.css +3 -0
  375. package/dist/mintui-elements.d.ts +156 -0
  376. package/dist/mintui-elements.d.ts.map +10 -0
  377. package/dist/modal.css +3 -0
  378. package/dist/navigation.css +3 -0
  379. package/dist/off-canvas.css +3 -0
  380. package/dist/page.css +3 -0
  381. package/dist/popover.css +3 -0
  382. package/dist/resource-table.css +3 -0
  383. package/dist/search.css +3 -0
  384. package/dist/select.css +3 -0
  385. package/dist/side-navigation.css +3 -0
  386. package/dist/sortable.css +3 -0
  387. package/dist/spinner.css +3 -0
  388. package/dist/stack.css +3 -0
  389. package/dist/switch.css +3 -0
  390. package/dist/table.css +3 -0
  391. package/dist/tabs.css +3 -0
  392. package/dist/tags.css +3 -0
  393. package/dist/text.css +3 -0
  394. package/dist/theme.css +101 -0
  395. package/dist/time-picker.css +3 -0
  396. package/dist/toast.css +3 -0
  397. package/package.json +379 -30
  398. package/dist/components/bottom-navigation/BottomNavItem.d.ts +0 -14
  399. package/dist/components/bottom-navigation/BottomNavItem.d.ts.map +0 -1
  400. package/dist/components/choice/ChoiceOption.d.ts +0 -30
  401. package/dist/components/choice/ChoiceOption.d.ts.map +0 -1
  402. package/dist/components/confirm-action/ConfirmActionApi.d.ts +0 -17
  403. package/dist/components/confirm-action/ConfirmActionApi.d.ts.map +0 -1
  404. package/dist/components/icon/build-icons.d.ts +0 -2
  405. package/dist/components/icon/build-icons.d.ts.map +0 -1
  406. package/dist/components/icon/icons/ai.d.ts +0 -3
  407. package/dist/components/icon/icons/ai.d.ts.map +0 -1
  408. package/dist/components/icon/icons/archive.d.ts +0 -3
  409. package/dist/components/icon/icons/archive.d.ts.map +0 -1
  410. package/dist/components/icon/icons/arrow-down.d.ts +0 -3
  411. package/dist/components/icon/icons/arrow-down.d.ts.map +0 -1
  412. package/dist/components/icon/icons/arrow-left.d.ts +0 -3
  413. package/dist/components/icon/icons/arrow-left.d.ts.map +0 -1
  414. package/dist/components/icon/icons/arrow-right.d.ts +0 -3
  415. package/dist/components/icon/icons/arrow-right.d.ts.map +0 -1
  416. package/dist/components/icon/icons/arrow-up.d.ts +0 -3
  417. package/dist/components/icon/icons/arrow-up.d.ts.map +0 -1
  418. package/dist/components/icon/icons/attach.d.ts +0 -3
  419. package/dist/components/icon/icons/attach.d.ts.map +0 -1
  420. package/dist/components/icon/icons/bank.d.ts +0 -3
  421. package/dist/components/icon/icons/bank.d.ts.map +0 -1
  422. package/dist/components/icon/icons/barcode.d.ts +0 -3
  423. package/dist/components/icon/icons/barcode.d.ts.map +0 -1
  424. package/dist/components/icon/icons/basket.d.ts +0 -3
  425. package/dist/components/icon/icons/basket.d.ts.map +0 -1
  426. package/dist/components/icon/icons/bookmark.d.ts +0 -3
  427. package/dist/components/icon/icons/bookmark.d.ts.map +0 -1
  428. package/dist/components/icon/icons/building.d.ts +0 -3
  429. package/dist/components/icon/icons/building.d.ts.map +0 -1
  430. package/dist/components/icon/icons/buildings.d.ts +0 -3
  431. package/dist/components/icon/icons/buildings.d.ts.map +0 -1
  432. package/dist/components/icon/icons/bullhorn.d.ts +0 -3
  433. package/dist/components/icon/icons/bullhorn.d.ts.map +0 -1
  434. package/dist/components/icon/icons/calendar-day.d.ts +0 -3
  435. package/dist/components/icon/icons/calendar-day.d.ts.map +0 -1
  436. package/dist/components/icon/icons/calendar-empty.d.ts +0 -3
  437. package/dist/components/icon/icons/calendar-empty.d.ts.map +0 -1
  438. package/dist/components/icon/icons/calendar-week.d.ts +0 -3
  439. package/dist/components/icon/icons/calendar-week.d.ts.map +0 -1
  440. package/dist/components/icon/icons/calendar.d.ts +0 -3
  441. package/dist/components/icon/icons/calendar.d.ts.map +0 -1
  442. package/dist/components/icon/icons/caret-down.d.ts +0 -3
  443. package/dist/components/icon/icons/caret-down.d.ts.map +0 -1
  444. package/dist/components/icon/icons/caret-left.d.ts +0 -3
  445. package/dist/components/icon/icons/caret-left.d.ts.map +0 -1
  446. package/dist/components/icon/icons/caret-right.d.ts +0 -3
  447. package/dist/components/icon/icons/caret-right.d.ts.map +0 -1
  448. package/dist/components/icon/icons/caret-up.d.ts +0 -3
  449. package/dist/components/icon/icons/caret-up.d.ts.map +0 -1
  450. package/dist/components/icon/icons/chart-bar.d.ts +0 -3
  451. package/dist/components/icon/icons/chart-bar.d.ts.map +0 -1
  452. package/dist/components/icon/icons/chart-line.d.ts +0 -3
  453. package/dist/components/icon/icons/chart-line.d.ts.map +0 -1
  454. package/dist/components/icon/icons/chat.d.ts +0 -3
  455. package/dist/components/icon/icons/chat.d.ts.map +0 -1
  456. package/dist/components/icon/icons/check.d.ts +0 -3
  457. package/dist/components/icon/icons/check.d.ts.map +0 -1
  458. package/dist/components/icon/icons/clock.d.ts +0 -3
  459. package/dist/components/icon/icons/clock.d.ts.map +0 -1
  460. package/dist/components/icon/icons/close.d.ts +0 -3
  461. package/dist/components/icon/icons/close.d.ts.map +0 -1
  462. package/dist/components/icon/icons/copy.d.ts +0 -3
  463. package/dist/components/icon/icons/copy.d.ts.map +0 -1
  464. package/dist/components/icon/icons/credit-card.d.ts +0 -3
  465. package/dist/components/icon/icons/credit-card.d.ts.map +0 -1
  466. package/dist/components/icon/icons/delete.d.ts +0 -3
  467. package/dist/components/icon/icons/delete.d.ts.map +0 -1
  468. package/dist/components/icon/icons/desktop-screen.d.ts +0 -3
  469. package/dist/components/icon/icons/desktop-screen.d.ts.map +0 -1
  470. package/dist/components/icon/icons/documentation.d.ts +0 -3
  471. package/dist/components/icon/icons/documentation.d.ts.map +0 -1
  472. package/dist/components/icon/icons/dollar-sign.d.ts +0 -3
  473. package/dist/components/icon/icons/dollar-sign.d.ts.map +0 -1
  474. package/dist/components/icon/icons/download.d.ts +0 -3
  475. package/dist/components/icon/icons/download.d.ts.map +0 -1
  476. package/dist/components/icon/icons/duplicate.d.ts +0 -3
  477. package/dist/components/icon/icons/duplicate.d.ts.map +0 -1
  478. package/dist/components/icon/icons/edit.d.ts +0 -3
  479. package/dist/components/icon/icons/edit.d.ts.map +0 -1
  480. package/dist/components/icon/icons/ellipsis.d.ts +0 -3
  481. package/dist/components/icon/icons/ellipsis.d.ts.map +0 -1
  482. package/dist/components/icon/icons/error.d.ts +0 -3
  483. package/dist/components/icon/icons/error.d.ts.map +0 -1
  484. package/dist/components/icon/icons/external-link.d.ts +0 -3
  485. package/dist/components/icon/icons/external-link.d.ts.map +0 -1
  486. package/dist/components/icon/icons/eye.d.ts +0 -3
  487. package/dist/components/icon/icons/eye.d.ts.map +0 -1
  488. package/dist/components/icon/icons/file.d.ts +0 -3
  489. package/dist/components/icon/icons/file.d.ts.map +0 -1
  490. package/dist/components/icon/icons/filter.d.ts +0 -3
  491. package/dist/components/icon/icons/filter.d.ts.map +0 -1
  492. package/dist/components/icon/icons/folder.d.ts +0 -3
  493. package/dist/components/icon/icons/folder.d.ts.map +0 -1
  494. package/dist/components/icon/icons/gavel.d.ts +0 -3
  495. package/dist/components/icon/icons/gavel.d.ts.map +0 -1
  496. package/dist/components/icon/icons/globe.d.ts +0 -3
  497. package/dist/components/icon/icons/globe.d.ts.map +0 -1
  498. package/dist/components/icon/icons/grid.d.ts +0 -3
  499. package/dist/components/icon/icons/grid.d.ts.map +0 -1
  500. package/dist/components/icon/icons/grip-lines.d.ts +0 -3
  501. package/dist/components/icon/icons/grip-lines.d.ts.map +0 -1
  502. package/dist/components/icon/icons/help.d.ts +0 -3
  503. package/dist/components/icon/icons/help.d.ts.map +0 -1
  504. package/dist/components/icon/icons/home.d.ts +0 -3
  505. package/dist/components/icon/icons/home.d.ts.map +0 -1
  506. package/dist/components/icon/icons/image.d.ts +0 -3
  507. package/dist/components/icon/icons/image.d.ts.map +0 -1
  508. package/dist/components/icon/icons/index.cjs +0 -34
  509. package/dist/components/icon/icons/index.d.ts +0 -92
  510. package/dist/components/icon/icons/index.d.ts.map +0 -1
  511. package/dist/components/icon/icons/index.js +0 -752
  512. package/dist/components/icon/icons/info.d.ts +0 -3
  513. package/dist/components/icon/icons/info.d.ts.map +0 -1
  514. package/dist/components/icon/icons/language.d.ts +0 -3
  515. package/dist/components/icon/icons/language.d.ts.map +0 -1
  516. package/dist/components/icon/icons/line-chart.d.ts +0 -3
  517. package/dist/components/icon/icons/line-chart.d.ts.map +0 -1
  518. package/dist/components/icon/icons/link.d.ts +0 -3
  519. package/dist/components/icon/icons/link.d.ts.map +0 -1
  520. package/dist/components/icon/icons/list.d.ts +0 -3
  521. package/dist/components/icon/icons/list.d.ts.map +0 -1
  522. package/dist/components/icon/icons/location.d.ts +0 -3
  523. package/dist/components/icon/icons/location.d.ts.map +0 -1
  524. package/dist/components/icon/icons/lock.d.ts +0 -3
  525. package/dist/components/icon/icons/lock.d.ts.map +0 -1
  526. package/dist/components/icon/icons/login.d.ts +0 -3
  527. package/dist/components/icon/icons/login.d.ts.map +0 -1
  528. package/dist/components/icon/icons/logout.d.ts +0 -3
  529. package/dist/components/icon/icons/logout.d.ts.map +0 -1
  530. package/dist/components/icon/icons/mail.d.ts +0 -3
  531. package/dist/components/icon/icons/mail.d.ts.map +0 -1
  532. package/dist/components/icon/icons/map.d.ts +0 -3
  533. package/dist/components/icon/icons/map.d.ts.map +0 -1
  534. package/dist/components/icon/icons/menu.d.ts +0 -3
  535. package/dist/components/icon/icons/menu.d.ts.map +0 -1
  536. package/dist/components/icon/icons/moon.d.ts +0 -3
  537. package/dist/components/icon/icons/moon.d.ts.map +0 -1
  538. package/dist/components/icon/icons/notifications.d.ts +0 -3
  539. package/dist/components/icon/icons/notifications.d.ts.map +0 -1
  540. package/dist/components/icon/icons/paste.d.ts +0 -3
  541. package/dist/components/icon/icons/paste.d.ts.map +0 -1
  542. package/dist/components/icon/icons/pin.d.ts +0 -3
  543. package/dist/components/icon/icons/pin.d.ts.map +0 -1
  544. package/dist/components/icon/icons/plus.d.ts +0 -3
  545. package/dist/components/icon/icons/plus.d.ts.map +0 -1
  546. package/dist/components/icon/icons/print.d.ts +0 -3
  547. package/dist/components/icon/icons/print.d.ts.map +0 -1
  548. package/dist/components/icon/icons/refresh.d.ts +0 -3
  549. package/dist/components/icon/icons/refresh.d.ts.map +0 -1
  550. package/dist/components/icon/icons/remove.d.ts +0 -3
  551. package/dist/components/icon/icons/remove.d.ts.map +0 -1
  552. package/dist/components/icon/icons/save.d.ts +0 -3
  553. package/dist/components/icon/icons/save.d.ts.map +0 -1
  554. package/dist/components/icon/icons/search.d.ts +0 -3
  555. package/dist/components/icon/icons/search.d.ts.map +0 -1
  556. package/dist/components/icon/icons/settings.d.ts +0 -3
  557. package/dist/components/icon/icons/settings.d.ts.map +0 -1
  558. package/dist/components/icon/icons/share.d.ts +0 -3
  559. package/dist/components/icon/icons/share.d.ts.map +0 -1
  560. package/dist/components/icon/icons/sort-arrows.d.ts +0 -3
  561. package/dist/components/icon/icons/sort-arrows.d.ts.map +0 -1
  562. package/dist/components/icon/icons/sort.d.ts +0 -3
  563. package/dist/components/icon/icons/sort.d.ts.map +0 -1
  564. package/dist/components/icon/icons/star.d.ts +0 -3
  565. package/dist/components/icon/icons/star.d.ts.map +0 -1
  566. package/dist/components/icon/icons/success.d.ts +0 -3
  567. package/dist/components/icon/icons/success.d.ts.map +0 -1
  568. package/dist/components/icon/icons/sun.d.ts +0 -3
  569. package/dist/components/icon/icons/sun.d.ts.map +0 -1
  570. package/dist/components/icon/icons/table.d.ts +0 -3
  571. package/dist/components/icon/icons/table.d.ts.map +0 -1
  572. package/dist/components/icon/icons/tag.d.ts +0 -3
  573. package/dist/components/icon/icons/tag.d.ts.map +0 -1
  574. package/dist/components/icon/icons/trash.d.ts +0 -3
  575. package/dist/components/icon/icons/trash.d.ts.map +0 -1
  576. package/dist/components/icon/icons/truck.d.ts +0 -3
  577. package/dist/components/icon/icons/truck.d.ts.map +0 -1
  578. package/dist/components/icon/icons/unlock.d.ts +0 -3
  579. package/dist/components/icon/icons/unlock.d.ts.map +0 -1
  580. package/dist/components/icon/icons/upload.d.ts +0 -3
  581. package/dist/components/icon/icons/upload.d.ts.map +0 -1
  582. package/dist/components/icon/icons/user-add.d.ts +0 -3
  583. package/dist/components/icon/icons/user-add.d.ts.map +0 -1
  584. package/dist/components/icon/icons/user.d.ts +0 -3
  585. package/dist/components/icon/icons/user.d.ts.map +0 -1
  586. package/dist/components/icon/icons/users.d.ts +0 -3
  587. package/dist/components/icon/icons/users.d.ts.map +0 -1
  588. package/dist/components/icon/icons/video.d.ts +0 -3
  589. package/dist/components/icon/icons/video.d.ts.map +0 -1
  590. package/dist/components/icon/icons/warning.d.ts +0 -3
  591. package/dist/components/icon/icons/warning.d.ts.map +0 -1
  592. package/dist/components/icon/registry.d.ts +0 -15
  593. package/dist/components/icon/registry.d.ts.map +0 -1
  594. package/dist/components/resource-table/ResourceTableContextMenu.d.ts +0 -40
  595. package/dist/components/resource-table/ResourceTableContextMenu.d.ts.map +0 -1
  596. package/dist/components/side-navigation/SideNavigationActionHeader.d.ts +0 -2
  597. package/dist/components/side-navigation/SideNavigationActionHeader.d.ts.map +0 -1
  598. package/dist/components/side-navigation/SideNavigationActionLinks.d.ts +0 -9
  599. package/dist/components/side-navigation/SideNavigationActionLinks.d.ts.map +0 -1
  600. package/dist/components/side-navigation/SideNavigationActionMenu.d.ts +0 -26
  601. package/dist/components/side-navigation/SideNavigationActionMenu.d.ts.map +0 -1
  602. package/dist/components/side-navigation/SideNavigationLink.d.ts +0 -38
  603. package/dist/components/side-navigation/SideNavigationLink.d.ts.map +0 -1
  604. package/dist/components/side-navigation/SideNavigationLinks.d.ts +0 -38
  605. package/dist/components/side-navigation/SideNavigationLinks.d.ts.map +0 -1
  606. package/dist/components/tabs/Tab.d.ts +0 -19
  607. package/dist/components/tabs/Tab.d.ts.map +0 -1
  608. package/dist/components/tabs/TabContent.d.ts +0 -13
  609. package/dist/components/tabs/TabContent.d.ts.map +0 -1
  610. package/dist/components/tabs/TabList.d.ts +0 -12
  611. package/dist/components/tabs/TabList.d.ts.map +0 -1
  612. package/dist/components/toast/ToastApi.d.ts +0 -21
  613. package/dist/components/toast/ToastApi.d.ts.map +0 -1
  614. package/dist/components/top-navigation/TopNavigation.d.ts +0 -65
  615. package/dist/components/top-navigation/TopNavigation.d.ts.map +0 -1
  616. package/dist/components/top-navigation/index.d.ts +0 -4
  617. package/dist/components/top-navigation/index.d.ts.map +0 -1
  618. package/dist/icons/truck.svg +0 -13
  619. package/dist/search-CM-OgatF.js +0 -179
  620. package/dist/search-C_vLUsm7.cjs +0 -1
  621. package/dist/styles.css +0 -3
  622. package/tailwind.preset.cjs +0 -75
  623. package/tailwind.preset.js +0 -97
@@ -0,0 +1,1445 @@
1
+ import '../../theme.css'
2
+ import '../../table.css'
3
+ import '../../input.css'
4
+ import '../../icon.css'
5
+ import '../../button.css'
6
+ import '../../spinner.css'
7
+ import '../../popover.css'
8
+ import '../../stack.css'
9
+ import '../../resource-table.css'
10
+ import "../chunks/icon-gQAtsERy.js";
11
+ import { t as e } from "../chunks/register-element-BFYmIynH.js";
12
+ import "../chunks/icon-C0OLmjDY.js";
13
+ import "../chunks/spinner-BsaFHuS6.js";
14
+ import "../chunks/button-B0Yt0MX1.js";
15
+ import "../chunks/input-8bbXzpa5.js";
16
+ import "../chunks/caret-up-D_6oa7o1.js";
17
+ import "../chunks/caret-down-Ch6IfR7r.js";
18
+ import "../chunks/popover-gviDCspV.js";
19
+ import "../chunks/search-ANUKQi0r.js";
20
+ import "../chunks/table-BgboosRK.js";
21
+ //#region src/components/resource-table/utility-aliases.js
22
+ var t = {
23
+ "-mr-1": "rtu-8956a4275",
24
+ "-translate-y-1/2": "rtu-36b381be4",
25
+ "[&>*]:m-0": "rtu-7b41b3d11",
26
+ "[&>*]:max-w-full": "rtu-ba23a8c34",
27
+ "[&>*]:min-h-0": "rtu-860618883",
28
+ "[&>*]:min-w-0": "rtu-85a48d872",
29
+ "[&>*]:p-0": "rtu-299511c44",
30
+ "[&>*]:w-full": "rtu-d26168286",
31
+ "[&>span]:flex": "rtu-684665eca",
32
+ "[&>span]:h-full": "rtu-e4b40d71e",
33
+ "[&>span]:items-stretch": "rtu-d7d251fc2",
34
+ "[&>span]:justify-stretch": "rtu-86ed0d205",
35
+ "[&>span]:min-h-0": "rtu-f145dfde7",
36
+ "[&>span]:min-w-0": "rtu-0a6cfb970",
37
+ "[&>span]:w-full": "rtu-85ca68177",
38
+ "[&_img]:!block": "rtu-83fb557c2",
39
+ "[&_img]:!border-0": "rtu-2288f2d07",
40
+ "[&_img]:!box-border": "rtu-9253a17e4",
41
+ "[&_img]:!h-full": "rtu-07505e4a3",
42
+ "[&_img]:!m-0": "rtu-52565be3c",
43
+ "[&_img]:!max-h-full": "rtu-9b7f93d32",
44
+ "[&_img]:!max-w-full": "rtu-690df1880",
45
+ "[&_img]:!min-h-0": "rtu-a6c91024c",
46
+ "[&_img]:!min-w-0": "rtu-249d05caa",
47
+ "[&_img]:!object-center": "rtu-c24cf3532",
48
+ "[&_img]:!object-cover": "rtu-5c4ff5239",
49
+ "[&_img]:!p-0": "rtu-45a528345",
50
+ "[&_img]:!rounded-none": "rtu-6b1008ffa",
51
+ "[&_img]:!w-full": "rtu-ce262d06f",
52
+ "[-webkit-overflow-scrolling:touch]": "rtu-66a5833b4",
53
+ absolute: "rtu-da4dbfbc4",
54
+ "align-baseline": "rtu-8d378d3b6",
55
+ "animate-pulse": "rtu-d59b97947",
56
+ "animate-spin": "rtu-afbdd13a3",
57
+ "bg-gray-100": "rtu-d260f3e1b",
58
+ "bg-gray-200": "rtu-fcf159058",
59
+ "bg-white": "rtu-5e10cdb8f",
60
+ block: "rtu-0214b4b35",
61
+ border: "rtu-ca6bcd4b6",
62
+ "border-0": "rtu-119b2aa0b",
63
+ "border-2": "rtu-65935df57",
64
+ "border-b": "rtu-65fdbade2",
65
+ "border-collapse": "rtu-4583f90cd",
66
+ "border-gray-200": "rtu-534158080",
67
+ "border-gray-300": "rtu-5ab1f191a",
68
+ "border-t": "rtu-b950dda29",
69
+ "border-t-gray-700": "rtu-2f99a0daf",
70
+ "box-border": "rtu-7906320e4",
71
+ "cursor-pointer": "rtu-345168367",
72
+ "dark:bg-mint-canvas": "rtu-91530d570",
73
+ "dark:bg-mint-hover": "rtu-f3646e34b",
74
+ "dark:bg-mint-nav": "rtu-ef1a5fba7",
75
+ "dark:bg-white/15": "rtu-2a035a254",
76
+ "dark:border-gray-600": "rtu-17b5ca3ec",
77
+ "dark:border-mint-divider": "rtu-785e12750",
78
+ "dark:border-t-gray-200": "rtu-d1e9bc81b",
79
+ "dark:hover:bg-gray-800": "rtu-c211aa745",
80
+ "dark:hover:bg-mint-elevated": "rtu-e02bea78e",
81
+ "dark:text-gray-400": "rtu-cd05fca6d",
82
+ "dark:text-gray-500": "rtu-cae7d218d",
83
+ "dark:text-gray-600": "rtu-916f092fc",
84
+ "dark:text-red-400": "rtu-150dc4530",
85
+ "dark:text-white": "rtu-889e4e871",
86
+ fixed: "rtu-7bc555991",
87
+ flex: "rtu-60fbb7713",
88
+ "flex-1": "rtu-36e579c0b",
89
+ "flex-col": "rtu-8dddea077",
90
+ "flex-nowrap": "rtu-51ecff099",
91
+ "font-normal": "rtu-8ecebc9f8",
92
+ "font-semibold": "rtu-e83a7042b",
93
+ "gap-0.5": "rtu-a3899220f",
94
+ "gap-1": "rtu-44ee8ba0a",
95
+ "gap-2": "rtu-77a2a20e9",
96
+ "gap-3": "rtu-1004c0c39",
97
+ "h-3": "rtu-6a60c09e6",
98
+ "h-4": "rtu-11e59c6d5",
99
+ "h-full": "rtu-668b21aa5",
100
+ hidden: "rtu-99d72c7fc",
101
+ "hover:bg-gray-50": "rtu-6c0fe2c8e",
102
+ "inline-block": "rtu-bb0c4bfc5",
103
+ "inline-flex": "rtu-52083e7da",
104
+ "items-center": "rtu-3960ffc24",
105
+ "items-start": "rtu-60541e1e2",
106
+ "items-stretch": "rtu-a13d486c1",
107
+ "justify-between": "rtu-8ef2268ef",
108
+ "justify-center": "rtu-86843cf1e",
109
+ "justify-end": "rtu-77c08e015",
110
+ "leading-snug": "rtu-e25ca6535",
111
+ "left-3": "rtu-22e59b722",
112
+ "list-none": "rtu-b20d79b23",
113
+ "m-0": "rtu-74f9876a6",
114
+ "max-w-[95%]": "rtu-80fa57ccf",
115
+ "max-w-none": "rtu-2191c1456",
116
+ "max-w-xs": "rtu-3acf64d53",
117
+ "mb-3": "rtu-1bb883263",
118
+ "md:block": "rtu-9d60be3a6",
119
+ "md:border-t-0": "rtu-f6099fc6b",
120
+ "md:flex": "rtu-7651aeb99",
121
+ "md:hidden": "rtu-e477a6af4",
122
+ "md:justify-end": "rtu-70ce0294b",
123
+ "md:mt-4": "rtu-ef9aeb563",
124
+ "md:pt-0": "rtu-30dec114f",
125
+ "md:py-0": "rtu-3957f1b8e",
126
+ "min-h-0": "rtu-fb7302e53",
127
+ "min-w-0": "rtu-7e0b7cdf1",
128
+ "min-w-[11rem]": "rtu-46b2fd2eb",
129
+ "ml-2": "rtu-c68af9986",
130
+ "mr-0": "rtu-719fceda9",
131
+ "mr-2": "rtu-d2347e849",
132
+ "overflow-hidden": "rtu-2cd02d11d",
133
+ "overflow-x-auto": "rtu-1384f66f4",
134
+ "overflow-x-hidden": "rtu-e271e6ae1",
135
+ "overflow-y-auto": "rtu-92bf82f49",
136
+ "overflow-y-hidden": "rtu-b70fd23f6",
137
+ "overscroll-x-contain": "rtu-63ccdaaca",
138
+ "p-0": "rtu-8a539c7fe",
139
+ "p-1": "rtu-eb6a3cef9",
140
+ "p-3.5": "rtu-56796a90b",
141
+ "p-4": "rtu-8e63407b5",
142
+ "pb-3.5": "rtu-2d1f72154",
143
+ "pl-0": "rtu-d569803f7",
144
+ "pointer-events-none": "rtu-a4326536b",
145
+ "pr-4": "rtu-ba64a7c03",
146
+ "pt-3": "rtu-ce335a8e4",
147
+ "px-1": "rtu-d8e0e382c",
148
+ "px-2": "rtu-d5eab218a",
149
+ "px-3.5": "rtu-e0d9cc7f0",
150
+ "px-4": "rtu-f0faeb26d",
151
+ "py-0.5": "rtu-465609a24",
152
+ "py-2": "rtu-03b4dd7f1",
153
+ "py-3": "rtu-1b2d54a3f",
154
+ "py-3.5": "rtu-69e76918f",
155
+ "py-8": "rtu-a1f611f02",
156
+ rounded: "rtu-07389a777",
157
+ "rounded-full": "rtu-ac204c108",
158
+ "rounded-md": "rtu-421ac2be5",
159
+ "rounded-t-none": "rtu-79ee0e356",
160
+ "shrink-0": "rtu-012fbd121",
161
+ sticky: "rtu-3e0fd166d",
162
+ table: "rtu-c3ee137d4",
163
+ "table-fixed": "rtu-604d60250",
164
+ "text-center": "rtu-ca6bf6303",
165
+ "text-gray-300": "rtu-5ed47f375",
166
+ "text-gray-400": "rtu-a572cdde6",
167
+ "text-gray-500": "rtu-5a630e0cf",
168
+ "text-gray-900": "rtu-ba48f7479",
169
+ "text-left": "rtu-2eba0d65d",
170
+ "text-red-500": "rtu-e3f51cc69",
171
+ "text-sm": "rtu-fc7473ca0",
172
+ "text-xs": "rtu-359090c2d",
173
+ "top-0": "rtu-2167406b2",
174
+ "top-1/2": "rtu-d694ba66e",
175
+ truncate: "rtu-f283ea9be",
176
+ "w-4": "rtu-dc7972ebf",
177
+ "w-40": "rtu-84789e8a2",
178
+ "w-full": "rtu-6da6a3c3f",
179
+ "w-max": "rtu-2f935d2ee",
180
+ "z-10": "rtu-236812d64",
181
+ "z-20": "rtu-145745bf5",
182
+ "z-30": "rtu-0f2fff0ae"
183
+ }, n = class extends HTMLElement {
184
+ static get observedAttributes() {
185
+ return [
186
+ "configuration",
187
+ "loading",
188
+ "virtual-scroll",
189
+ "virtual-scroll-root",
190
+ "virtual-row-height",
191
+ "virtual-max-height",
192
+ "fixed-header",
193
+ "fixed-controls"
194
+ ];
195
+ }
196
+ _isExternalLoading() {
197
+ let e = this.getAttribute("loading");
198
+ return e !== null && e !== "false";
199
+ }
200
+ constructor() {
201
+ super(), this._configuration = null, this._rows = [], this._search = "", this._currentPage = 1, this._perPage = 15, this._totalRows = 0, this._lastPage = 0, this._offset = 0, this._loaded = !1, this._fetching = !1, this._loading = !1, this._loadingPage = null, this._fetchError = null, this._searching = !1, this._sorting = !1, this._sortingColumn = null, this._type = "provided", this._searchTimeoutId = null, this._sortTimeoutId = null, this._searchColumns = [], this._exportColumns = {}, this._columns = [], this._tableId = "", this._searchInput = null, this._tableContainer = null, this._paginationContainer = null, this._skeletonContainer = null, this._inMintCard = !1, this._virtualBodyScrollEl = null, this._virtualScrollHandler = null, this._virtualWindowRaf = null, this._virtualLastRangeStart = -1, this._virtualLastRangeEnd = -1, this._virtualLastRangeCacheSig = "", this._virtualResizeObserver = null, this._virtualWindowResizeHandler = null, this._virtualRowCache = /* @__PURE__ */ new Map(), this._virtualRangeFetching = !1, this._mobileListMql = null, this._boundMobileListMqlListener = null, this._virtualFetchGeneration = 0, this._virtualAjaxPrefetchTimer = null, this._fixedChromeResizeObserver = null, this._utilityClassObserver = null;
202
+ }
203
+ get inMintCard() {
204
+ return this._inMintCard;
205
+ }
206
+ get configuration() {
207
+ return this._configuration;
208
+ }
209
+ set configuration(e) {
210
+ e && typeof e == "object" && !Array.isArray(e) ? (this._configuration = e, this._tableId = this._configuration.id || `mint-resource-table-${Date.now()}`, this._perPage = this._configuration.perPage || 15, this._type = typeof this._configuration.data == "string" ? "ajax" : "provided", this._loaded = !1, this._currentPage = 1, this._offset = 0, this._type === "provided" && Array.isArray(this._configuration.data) && (this._rows = [...this._configuration.data], this._totalRows = this._configuration.data.length), this._initializeColumns(), this.isConnected && this.render()) : e == null ? this._configuration = null : this._parseConfiguration();
211
+ }
212
+ connectedCallback() {
213
+ this.classList.add("box-border", "m-0", "p-0", "border-0", "align-baseline", "block", "w-full"), this._utilityClassObserver = new MutationObserver(() => this._replaceUtilityClasses()), this._utilityClassObserver.observe(this, {
214
+ attributes: !0,
215
+ attributeFilter: ["class"],
216
+ childList: !0,
217
+ subtree: !0
218
+ }), this._inMintCard = this.parentElement?.tagName?.toLowerCase() === "mint-card", this._configuration || this._parseConfiguration(), this._initializeColumns(), this._loadPageFromUrl(), this._attachRowClickHandler(), this.render();
219
+ }
220
+ disconnectedCallback() {
221
+ this._searchTimeoutId && clearTimeout(this._searchTimeoutId), this._detachVirtualScroll(), this._detachFixedChromeResize(), this._detachMobileListMql(), this._utilityClassObserver?.disconnect(), this._utilityClassObserver = null, this._rowClickHandler &&= (this.removeEventListener("click", this._rowClickHandler, !0), null), this._scrollHandler &&= (window.removeEventListener("scroll", this._scrollHandler), null);
222
+ }
223
+ attributeChangedCallback(e, t, n) {
224
+ e === "configuration" && t !== n ? (!this._configuration || typeof n == "string") && (this._parseConfiguration(), this.render()) : t !== n && (e === "loading" || e === "virtual-scroll" || e === "virtual-scroll-root" || e === "virtual-row-height" || e === "virtual-max-height" || e === "fixed-header" || e === "fixed-controls") && this._configuration && this.isConnected && this.render();
225
+ }
226
+ refresh() {
227
+ this._configuration && (this._type === "ajax" ? this._fetchData(void 0, !0, this._perPage, this._offset) : (Array.isArray(this._configuration.data) && (this._rows = [...this._configuration.data], this._totalRows = this._rows.length), this.render()));
228
+ }
229
+ setData(e) {
230
+ if (this._configuration) {
231
+ if (this._configuration.data = e, this._type = typeof e == "string" ? "ajax" : "provided", this._currentPage = 1, this._offset = 0, this._fetchError = null, this._searching = !1, this._loadingPage = null, this._sortTimeoutId &&= (clearTimeout(this._sortTimeoutId), null), this._searchTimeoutId &&= (clearTimeout(this._searchTimeoutId), null), this._virtualScrollActive() && (this._virtualRowCache.clear(), this._virtualInvalidate()), this._type === "ajax") {
232
+ this._rows = [], this._totalRows = 0, this._lastPage = 0, this._loaded = !1, this._fetching = !1, this._loading = !1, this._fetchData(void 0, !0, this._perPage, 0);
233
+ return;
234
+ }
235
+ this._rows = Array.isArray(e) ? [...e] : [], this._totalRows = this._rows.length, this._lastPage = Math.max(1, Math.ceil(this._totalRows / this._perPage)), this._loaded = !0, this._fetching = !1, this._loading = !1, this.render();
236
+ }
237
+ }
238
+ _parseConfiguration() {
239
+ let e = this.getAttribute("configuration");
240
+ if (!e) {
241
+ console.error("mint-resource-table: configuration attribute is required");
242
+ return;
243
+ }
244
+ try {
245
+ this._configuration = JSON.parse(e), this._tableId = this._configuration.id || `mint-resource-table-${Date.now()}`, this._perPage = this._configuration.perPage || 15, this._type = typeof this._configuration.data == "string" ? "ajax" : "provided", this._loaded = !1, this._currentPage = this._getPageFromUrl() || 1, this._offset = (this._currentPage - 1) * this._perPage, this._type === "provided" && Array.isArray(this._configuration.data) && (this._rows = [...this._configuration.data], this._totalRows = this._configuration.data.length), this._initializeColumns();
246
+ } catch (e) {
247
+ console.error("mint-resource-table: Invalid configuration JSON", e);
248
+ }
249
+ }
250
+ _initializeColumns() {
251
+ this._configuration && (this._searchColumns = [], this._exportColumns = {}, this._columns = [], this._configuration.columns.forEach((e) => {
252
+ e.searchable && e.data && this._searchColumns.push(e.data), e.export && e.data && (this._exportColumns[e.data] = e.label), e.data && this._columns.push(e.data);
253
+ }), this._configuration.sortBy || (this._configuration.sortBy = "id"), this._configuration.sort || (this._configuration.sort = "asc"));
254
+ }
255
+ async _fetchData(e, t = !0, n, r) {
256
+ if (!this._configuration) return;
257
+ let i = e || (typeof this._configuration.data == "string" ? this._configuration.data : null);
258
+ if (!i || this._fetching || this._loading) return;
259
+ t && (this._fetching = !0, this._loaded ? this._updatePagination() : this.render()), this._loading = !0;
260
+ let a = n || this._perPage, o = r === void 0 ? this._offset : r;
261
+ this._virtualScrollActive() && this._type === "ajax" && o === 0 && (this._virtualFetchGeneration++, this._virtualRowCache.clear(), this._virtualInvalidate());
262
+ try {
263
+ let e = new URLSearchParams({
264
+ perPage: a.toString(),
265
+ offset: o.toString(),
266
+ search: this._search,
267
+ sortBy: this._configuration.sortBy || "id",
268
+ sort: this._configuration.sort || "asc",
269
+ searchColumns: this._searchColumns.join(","),
270
+ columns: this._columns.join(",")
271
+ }), t = {};
272
+ this._configuration.headers && (t.headers = this._configuration.headers);
273
+ let n = await fetch(`${i}?${e.toString()}`, t);
274
+ if (!n.ok) throw Error(`HTTP error! status: ${n.status}`);
275
+ let r = await n.json(), s = r.content?.rows || [], c = r.content?.total || 0, l = s;
276
+ this._configuration.predefinedData ? (l = [...this._configuration.predefinedData, ...s], this._totalRows = c + this._configuration.predefinedData.length) : this._totalRows = c, this._rows = l;
277
+ let u = Math.floor(o / a) + 1;
278
+ r.content?.current_page !== void 0 && r.content.current_page === u ? this._currentPage = r.content.current_page : this._currentPage = u, this._offset = (this._currentPage - 1) * a, this._lastPage = r.content?.last_page || 1, this._fetching = !1, this._loaded = !0, this._loading = !1, this._fetchError = null, this._searching = !1;
279
+ let d = this._sorting;
280
+ d && this._updateSortIcons(), this._sorting = !1, this._sortingColumn = null, d && this._updateSortIcons(), this.dispatchEvent(new CustomEvent("loaded", { detail: { rows: this._rows } })), this._updateSearchIcon();
281
+ let f = `tbody[data-mint-rt-tbody="${this._tableId}"]`, p = !!this.querySelector(f);
282
+ if (this._virtualScrollActive() && this._type === "ajax") p || this.render(), s.forEach((e, t) => {
283
+ this._virtualRowCache.set(o + t, e);
284
+ }), this._virtualInvalidate(), o === 0 ? queueMicrotask(() => this._scrollVirtualTableTopIntoView()) : this._scheduleVirtualWindowSync(), this._loadingPage, this._loadingPage = null, this._updatePagination(), setTimeout(() => {
285
+ let e = this._paginationMountedRoot();
286
+ e && e.querySelectorAll("mint-button[data-action=\"page\"]").forEach((e) => {
287
+ "render" in e && typeof e.render == "function" && e.render();
288
+ });
289
+ }, 0);
290
+ else if (this.querySelector(`#${this._tableId}`)?.closest("table")?.querySelector("tbody")) {
291
+ if (d) {
292
+ let e = this._loading, t = this._fetching;
293
+ this._loading = !1, this._fetching = !1, this._updateTableBody(), this._loading = e, this._fetching = t;
294
+ } else this._updateTableBody();
295
+ this._loadingPage, this._loadingPage = null, this._updatePagination(), setTimeout(() => {
296
+ let e = this._paginationMountedRoot();
297
+ e && e.querySelectorAll("mint-button[data-action=\"page\"]").forEach((e) => {
298
+ "render" in e && typeof e.render == "function" && e.render();
299
+ });
300
+ }, 0);
301
+ } else this.render();
302
+ } catch (e) {
303
+ this._fetching = !1, this._loading = !1, this._loadingPage = null, this._loaded = !0, this._searching = !1, this._fetchError = e instanceof Error ? e.message : "Failed to fetch data", console.error("mint-resource-table: Error fetching data", e), this._updateSearchIcon(), this.querySelector(`#${this._tableId}`)?.closest("table")?.querySelector("tbody") ? (this._updateTableBody(), this._loadingPage = null, this._updatePagination()) : this.render();
304
+ }
305
+ }
306
+ _getRows() {
307
+ if (!this._configuration) return [];
308
+ if (this._type === "ajax") return this._rows;
309
+ let e = [...this._rows], t = this._configuration.sortBy || "id", n = this._configuration.sort || "asc";
310
+ if (this._search) {
311
+ let t = this._search.toLowerCase().trim().split(/\s+/);
312
+ e = e.filter((e) => {
313
+ let n = Object.values(e).map((e) => String(e).toLowerCase()).join(" ");
314
+ return t.every((e) => n.includes(e));
315
+ });
316
+ }
317
+ if (e.sort((e, r) => {
318
+ let i = e[t], a = r[t];
319
+ if (i == null && a == null) return 0;
320
+ if (i == null) return 1;
321
+ if (a == null) return -1;
322
+ let o = typeof i == "number" ? i : typeof i == "string" && !isNaN(Number(i)) && i.trim() !== "" ? Number(i) : null, s = typeof a == "number" ? a : typeof a == "string" && !isNaN(Number(a)) && a.trim() !== "" ? Number(a) : null;
323
+ if (o !== null && s !== null) {
324
+ let e = o - s;
325
+ return n === "asc" ? e : -e;
326
+ }
327
+ let c = i instanceof Date ? i : typeof i == "string" ? new Date(i) : null, l = a instanceof Date ? a : typeof a == "string" ? new Date(a) : null;
328
+ if (c && l && !isNaN(c.getTime()) && !isNaN(l.getTime())) {
329
+ let e = c.getTime() - l.getTime();
330
+ return n === "asc" ? e : -e;
331
+ }
332
+ let u = String(i).localeCompare(String(a), void 0, {
333
+ numeric: !0,
334
+ sensitivity: "base"
335
+ });
336
+ return n === "asc" ? u : -u;
337
+ }), this._perPage) {
338
+ let t = Math.ceil(e.length / this._perPage);
339
+ this._lastPage = t, e.forEach((e, t) => {
340
+ e.page = Math.ceil((t + 1) / this._perPage);
341
+ }), this._currentPage > t && t > 0 && (this._currentPage = t);
342
+ }
343
+ return e.filter((e) => !this._perPage || e.page === this._currentPage);
344
+ }
345
+ _getAllFilteredRowsSorted() {
346
+ if (!this._configuration || this._type !== "provided") return [];
347
+ let e = [...this._rows], t = this._configuration.sortBy || "id", n = this._configuration.sort || "asc";
348
+ if (this._search) {
349
+ let t = this._search.toLowerCase().trim().split(/\s+/);
350
+ e = e.filter((e) => {
351
+ let n = Object.values(e).map((e) => String(e).toLowerCase()).join(" ");
352
+ return t.every((e) => n.includes(e));
353
+ });
354
+ }
355
+ return e.sort((e, r) => {
356
+ let i = e[t], a = r[t];
357
+ if (i == null && a == null) return 0;
358
+ if (i == null) return 1;
359
+ if (a == null) return -1;
360
+ let o = typeof i == "number" ? i : typeof i == "string" && !isNaN(Number(i)) && i.trim() !== "" ? Number(i) : null, s = typeof a == "number" ? a : typeof a == "string" && !isNaN(Number(a)) && a.trim() !== "" ? Number(a) : null;
361
+ if (o !== null && s !== null) {
362
+ let e = o - s;
363
+ return n === "asc" ? e : -e;
364
+ }
365
+ let c = i instanceof Date ? i : typeof i == "string" ? new Date(i) : null, l = a instanceof Date ? a : typeof a == "string" ? new Date(a) : null;
366
+ if (c && l && !isNaN(c.getTime()) && !isNaN(l.getTime())) {
367
+ let e = c.getTime() - l.getTime();
368
+ return n === "asc" ? e : -e;
369
+ }
370
+ let u = String(i).localeCompare(String(a), void 0, {
371
+ numeric: !0,
372
+ sensitivity: "base"
373
+ });
374
+ return n === "asc" ? u : -u;
375
+ }), e;
376
+ }
377
+ _virtualInvalidate() {
378
+ this._virtualLastRangeStart = -1, this._virtualLastRangeEnd = -1, this._virtualLastRangeCacheSig = "";
379
+ }
380
+ _getRowDataForEventIndex(e) {
381
+ if (this._configuration) {
382
+ if (!this._virtualScrollActive()) return this._getRows()[e];
383
+ if (this._type === "provided") return this._getAllFilteredRowsSorted()[e];
384
+ if (this._type === "ajax") return this._virtualRowCache.get(e);
385
+ }
386
+ }
387
+ getRowByIndex(e) {
388
+ return this._getRowDataForEventIndex(e);
389
+ }
390
+ _virtualScrollActive() {
391
+ return this._configuration ? (this.getAttribute("virtual-scroll") || "").toLowerCase().trim() === "true" : !1;
392
+ }
393
+ _virtualScrollRoot() {
394
+ let e = (this.getAttribute("virtual-scroll-root") || "").toLowerCase().trim();
395
+ return e === "table-body" || e === "body" || this._configuration?.virtualScrollRoot === "table-body" ? "table-body" : "document";
396
+ }
397
+ _virtualBodyScrollDisablesDocumentFixedChrome() {
398
+ return this._virtualScrollActive() && this._virtualScrollRoot() === "table-body";
399
+ }
400
+ _fixedHeader() {
401
+ if (this._virtualBodyScrollDisablesDocumentFixedChrome() || !this.hasAttribute("fixed-header")) return !1;
402
+ let e = (this.getAttribute("fixed-header") || "").toLowerCase().trim();
403
+ return e !== "false" && e !== "0";
404
+ }
405
+ _fixedControls() {
406
+ if (this._virtualBodyScrollDisablesDocumentFixedChrome() || !this.hasAttribute("fixed-controls")) return !1;
407
+ let e = (this.getAttribute("fixed-controls") || "").toLowerCase().trim();
408
+ return e !== "false" && e !== "0";
409
+ }
410
+ _virtualRowHeightPx() {
411
+ let e = parseInt(this.getAttribute("virtual-row-height") || "", 10);
412
+ if (!isNaN(e) && e > 0) return e;
413
+ let t = this._configuration?.virtualRowHeight;
414
+ return typeof t == "number" && t > 0 ? t : 48;
415
+ }
416
+ _virtualRowHeightPxForSync(e) {
417
+ let t = this._virtualRowHeightPx();
418
+ if (!this._configuration) return t;
419
+ if (e) {
420
+ let e = this._mobileThumbnailColumn();
421
+ if (e) {
422
+ let n = this._thumbnailMobilePx(e);
423
+ return Math.max(t, n + 36);
424
+ }
425
+ return Math.max(t, 80);
426
+ }
427
+ let n = this._mobileThumbnailColumn();
428
+ if (n) {
429
+ let e = this._thumbnailDesktopPx(n);
430
+ return Math.max(t, e + 28);
431
+ }
432
+ return t;
433
+ }
434
+ _virtualMaxHeightCss() {
435
+ let e = this.getAttribute("virtual-max-height");
436
+ if (e && e.trim()) return e.trim();
437
+ let t = this._configuration?.virtualMaxHeight;
438
+ return t && String(t).trim() ? String(t).trim() : "min(70dvh, 28rem)";
439
+ }
440
+ _virtualColspan() {
441
+ return this._configuration ? Math.max(1, this._configuration.columns.filter((e) => !e.hidden).length) : 1;
442
+ }
443
+ _ensureMobileListMql() {
444
+ typeof window > "u" || !window.matchMedia || this._mobileListMql || (this._mobileListMql = window.matchMedia("(max-width: 767px)"), this._boundMobileListMqlListener = () => {
445
+ this._configuration && this.isConnected && this.render();
446
+ }, this._mobileListMql.addEventListener("change", this._boundMobileListMqlListener));
447
+ }
448
+ _detachMobileListMql() {
449
+ this._mobileListMql && this._boundMobileListMqlListener && this._mobileListMql.removeEventListener("change", this._boundMobileListMqlListener), this._mobileListMql = null, this._boundMobileListMqlListener = null;
450
+ }
451
+ _useMobileListLayout() {
452
+ return !!this._mobileListMql?.matches;
453
+ }
454
+ _paginationHostPlaceholderHtml() {
455
+ if (!this._configuration?.perPage || this._virtualScrollActive()) return "";
456
+ let e = this._lastPage || Math.ceil(this._rows.length / this._perPage);
457
+ if ((this._lastPage > 0 ? this._lastPage : e) <= 1) return "";
458
+ let t = [
459
+ "mint-rt-pagination-host",
460
+ "w-full min-w-0 overflow-x-auto overflow-y-hidden overscroll-x-contain",
461
+ "flex justify-center [-webkit-overflow-scrolling:touch] md:justify-end",
462
+ this._inMintCard ? "border-t border-gray-200 px-3.5 pb-3.5 pt-3 dark:border-mint-divider md:border-t-0 md:pt-0" : "border-t border-gray-200 px-2 py-3 dark:border-mint-divider md:border-t-0 md:py-0 md:mt-4"
463
+ ].join(" ");
464
+ return `<div id="mint-rt-pagination-host-${this._tableId}" data-mint-rt-pagination-wrap="" class="${t}"></div>`;
465
+ }
466
+ _getPaginationHostEl() {
467
+ return this.querySelector(`#mint-rt-pagination-host-${this._tableId}`);
468
+ }
469
+ _paginationMountedRoot() {
470
+ return this._getPaginationHostEl() || this.querySelector("nav[data-mint-rt-pagination-nav]")?.parentElement || this.querySelector("nav")?.closest(".flex.justify-end");
471
+ }
472
+ _paginationPageButtonLi(e) {
473
+ let t = this._currentPage === e, n = this._loadingPage === e;
474
+ return `<li class="shrink-0"><mint-button variant="solid" size="sm"${t ? " active=\"true\"" : ""}${this._loading || this._fetching ? " disabled=\"true\"" : ""}${n ? " loading=\"true\"" : ""} data-action="page" data-page="${e}">${n ? "" : `${e}`}</mint-button></li>`;
475
+ }
476
+ _paginationHtmlCompactMiddle(e) {
477
+ let t = "", n = this._currentPage;
478
+ if (e <= 5) {
479
+ for (let n = 1; n <= e; n++) t += this._paginationPageButtonLi(n);
480
+ return t;
481
+ }
482
+ let r = [...new Set([
483
+ 1,
484
+ e,
485
+ n - 1,
486
+ n,
487
+ n + 1
488
+ ].map((t) => Math.min(e, Math.max(1, t))))].sort((e, t) => e - t), i = 0;
489
+ for (let e of r) i > 0 && e - i > 1 && (t += "<li class=\"shrink-0\"><span class=\"px-1 text-gray-500 dark:text-gray-400\" aria-hidden=\"true\">…</span></li>"), t += this._paginationPageButtonLi(e), i = e;
490
+ return t;
491
+ }
492
+ _paginationHtmlDesktopMiddle(e) {
493
+ let t = "", n = e >= 10, r = Math.max(1, this._currentPage - 1), i = Math.min(e, this._currentPage + 1);
494
+ if (n) {
495
+ for (let e = 1; e <= 3; e++) t += this._paginationPageButtonLi(e);
496
+ let n = i <= 3, a = r >= e - 2;
497
+ if (!n && !a) {
498
+ r > 4 && (t += "<li class=\"shrink-0\"><span class=\"px-2\">...</span></li>");
499
+ for (let e = r; e <= i; e++) e <= 3 || (t += this._paginationPageButtonLi(e));
500
+ i < e - 3 && (t += "<li class=\"shrink-0\"><span class=\"px-2\">...</span></li>");
501
+ } else (n && !a || !n && a && e - 2 > 4) && (t += "<li class=\"shrink-0\"><span class=\"px-2\">...</span></li>");
502
+ for (let o = e - 2; o <= e; o++) o <= 3 || !n && !a && o >= r && o <= i || (t += this._paginationPageButtonLi(o));
503
+ } else for (let n = 1; n <= e; n++) t += this._paginationPageButtonLi(n);
504
+ return t;
505
+ }
506
+ _buildPaginationNavMarkup(e) {
507
+ let t = this._currentPage === 1 || this._loading || this._fetching, n = "<nav data-mint-rt-pagination-nav=\"\" class=\"w-max max-w-none shrink-0\" aria-label=\"Pagination\">";
508
+ n += "<ul class=\"flex flex-nowrap items-center gap-1\">", n += `<li class="shrink-0"><mint-button variant="solid" size="sm" icon="caret-left" ${t ? "disabled=\"true\"" : ""} data-action="page-prev"></mint-button></li>`, n += this._useMobileListLayout() ? this._paginationHtmlCompactMiddle(e) : this._paginationHtmlDesktopMiddle(e);
509
+ let r = this._currentPage >= e || this._loading || this._fetching;
510
+ return n += `<li class="shrink-0"><mint-button variant="solid" size="sm" icon="caret-right" ${r ? "disabled=\"true\"" : ""} data-action="page-next"></mint-button></li>`, n += "</ul></nav>", n;
511
+ }
512
+ _hasSortableColumns() {
513
+ return !!this._configuration?.columns.some((e) => !e.hidden && e.sortable && e.data);
514
+ }
515
+ _getMobileSortTriggerIconName() {
516
+ return "sort-arrows";
517
+ }
518
+ _mobileSortPopoverAffordanceInnerHtml(e) {
519
+ return e === "spinner" ? "<span class=\"inline-block h-4 w-4 shrink-0 animate-spin rounded-full border-2 border-gray-300 border-t-gray-700 dark:border-gray-600 dark:border-t-gray-200\" aria-hidden=\"true\"></span>" : e === "caret-up" || e === "caret-down" ? `<mint-icon name="${e}" class="h-4 w-4 shrink-0 text-gray-500 dark:text-gray-400"></mint-icon>` : "";
520
+ }
521
+ _buildMobileSortPopoverInnerHtml() {
522
+ if (!this._configuration) return "";
523
+ let e = "<div class=\"flex w-full min-w-[11rem] flex-col gap-0.5 p-1\">";
524
+ return this._configuration.columns.forEach((t, n) => {
525
+ if (t.hidden || !t.sortable || !t.data) return;
526
+ let r = t.raw ? t.label : this._escapeHtml(t.label), i = this._getSortClass(t), a = this._mobileSortPopoverAffordanceInnerHtml(i), o = ` type="button" variant="ghost" tone="neutral" size="sm" full-width="true" align="left" data-action="mobile-sort" data-column-key="${n}"`;
527
+ e += `<mint-button${o}>`, e += "<span class=\"flex w-full min-w-0 flex-1 items-center justify-between gap-2\">", e += `<span class="min-w-0 flex-1 truncate text-left">${r}</span>`, e += `<span class="inline-flex shrink-0 items-center justify-end" data-mint-rt-mobile-sort-affordance="">${a}</span>`, e += "</span></mint-button>";
528
+ }), e += "</div>", e;
529
+ }
530
+ _syncMobileSortPopoverIcons() {
531
+ if (!this._configuration) return;
532
+ let e = this.querySelector(`#mint-rt-mobile-sort-popover-${this._tableId}`);
533
+ e && this._configuration.columns.forEach((t, n) => {
534
+ if (t.hidden || !t.sortable || !t.data) return;
535
+ let r = e.querySelector(`[data-action="mobile-sort"][data-column-key="${n}"]`);
536
+ if (!r || r.tagName !== "MINT-BUTTON") return;
537
+ let i = r.querySelector("[data-mint-rt-mobile-sort-affordance]");
538
+ if (!i) return;
539
+ let a = this._getSortClass(t);
540
+ i.innerHTML = this._mobileSortPopoverAffordanceInnerHtml(a), i.querySelectorAll("mint-icon").forEach((e) => {
541
+ let t = e;
542
+ typeof t.render == "function" && t.render();
543
+ });
544
+ });
545
+ }
546
+ _closeMobileSortPopover() {
547
+ let e = this.querySelector(`#mint-rt-mobile-sort-popover-${this._tableId}`);
548
+ e && typeof e.close == "function" ? e.close() : e && e.removeAttribute("open");
549
+ }
550
+ _buildMobileSortToolbarHtml() {
551
+ if (!this._hasSortableColumns()) return "";
552
+ let e = `mint-rt-mobile-sort-btn-${this._tableId}`, t = `mint-rt-mobile-sort-popover-${this._tableId}`, n = this._sorting ? " loading=\"true\"" : "", r = ` icon="${this._escapeHtml(this._getMobileSortTriggerIconName())}"`, i = "<div class=\"flex shrink-0 items-center md:hidden\">";
553
+ return i += `<mint-button id="${e}" data-mint-rt-toolbar="mobile-sort" variant="solid" tone="neutral" size="sm"${n}${r}></mint-button>`, i += `<mint-popover id="${t}" trigger-id="${e}" direction="down" padding="0">`, i += this._buildMobileSortPopoverInnerHtml(), i += "</mint-popover></div>", i;
554
+ }
555
+ _stripHtml(e) {
556
+ if (!e) return "";
557
+ let t = document.createElement("div");
558
+ return t.innerHTML = e, (t.textContent || t.innerText || "").replace(/\s+/g, " ").trim();
559
+ }
560
+ _visibleDataColumns() {
561
+ return this._configuration ? this._configuration.columns.filter((e) => !e.hidden) : [];
562
+ }
563
+ _mobileThumbnailColumn() {
564
+ return this._visibleDataColumns().find((e) => e.thumbnail) || null;
565
+ }
566
+ _thumbnailDesktopPx(e) {
567
+ let t = typeof e.thumbnailDesktopPx == "number" && e.thumbnailDesktopPx > 0 ? e.thumbnailDesktopPx : void 0, n = this._configuration, r = n && typeof n.thumbnailDesktopPx == "number" && n.thumbnailDesktopPx > 0 ? n.thumbnailDesktopPx : void 0;
568
+ return Math.round(t ?? r ?? 40);
569
+ }
570
+ _thumbnailMobilePx(e) {
571
+ let t = typeof e.thumbnailMobilePx == "number" && e.thumbnailMobilePx > 0 ? e.thumbnailMobilePx : void 0, n = this._configuration, r = n && typeof n.thumbnailMobilePx == "number" && n.thumbnailMobilePx > 0 ? n.thumbnailMobilePx : void 0;
572
+ return Math.round(t ?? r ?? 56);
573
+ }
574
+ _wrapThumbnailDesktopBox(e, t) {
575
+ let n = this._thumbnailDesktopPx(t);
576
+ return `<div class="flex shrink-0 items-stretch overflow-hidden rounded-md border border-gray-200 bg-gray-100 p-0 dark:border-mint-divider dark:bg-mint-hover [&>*]:m-0 [&>*]:min-h-0 [&>*]:min-w-0 [&>*]:w-full [&>*]:max-w-full [&>*]:p-0 [&>span]:flex [&>span]:h-full [&>span]:w-full [&>span]:min-h-0 [&>span]:min-w-0 [&>span]:items-stretch [&>span]:justify-stretch [&_img]:!m-0 [&_img]:!box-border [&_img]:!block [&_img]:!h-full [&_img]:!w-full [&_img]:!min-h-0 [&_img]:!min-w-0 [&_img]:!max-h-full [&_img]:!max-w-full [&_img]:!border-0 [&_img]:!p-0 [&_img]:!rounded-none [&_img]:!object-cover [&_img]:!object-center" style="${`width:${n}px;height:${n}px;min-width:${n}px;min-height:${n}px`}">${e}</div>`;
577
+ }
578
+ _mobilePrimaryColumn() {
579
+ let e = this._visibleDataColumns();
580
+ return e.find((e) => e.primary) || e.find((e) => (e.data || typeof e.format == "function") && !e.thumbnail && !e.actions) || e[0] || null;
581
+ }
582
+ _mobileActionsDropdownColumn() {
583
+ return this._visibleDataColumns().find((e) => e.actions && e.actionStyle !== "buttons") || null;
584
+ }
585
+ _columnPlainSummaryText(e, t) {
586
+ if (!(!e.show || e.show(this, t)) || e.actions || e.action) return "";
587
+ try {
588
+ if (e.raw) {
589
+ if (typeof e.format == "function") return this._stripHtml(e.format(this, t));
590
+ if (e.data) return String(t[e.data] ?? "");
591
+ } else {
592
+ if (typeof e.format == "function") return this._stripHtml(e.format(this, t));
593
+ if (e.data) return String(t[e.data] ?? "");
594
+ }
595
+ } catch {
596
+ return "";
597
+ }
598
+ return "";
599
+ }
600
+ _buildTableCellInnerHtml(e, t, n, r = "table") {
601
+ if (!this._configuration) return "";
602
+ let i = n, a = "";
603
+ if (!(!e.show || e.show(this, t))) return "";
604
+ if (e.raw) if (e.action) {
605
+ if (!e.action.show || e.action.show(this, t)) {
606
+ let n = typeof e.action.label == "function" ? e.action.label(this, t) : e.action.label;
607
+ a += `<mint-button variant="solid" data-action="column-action" data-row-index="${i}" data-column-key="${this._configuration.columns.indexOf(e)}">${this._escapeHtml(String(n))}</mint-button>`;
608
+ }
609
+ } else if (e.actions) if (e.actionStyle !== "buttons") {
610
+ let n = `actions-popover-${this._tableId}-${i}`, r = `actions-button-${this._tableId}-${i}`;
611
+ a += `<mint-button id="${r}" variant="ghost" icon="ellipsis">`, a += "</mint-button>", a += `<mint-popover id="${n}" trigger-id="${r}" direction="down">`, a += "<div class=\"mint-resource-action-menu\">", e.actions.forEach((n, r) => {
612
+ if (!n.show || n.show(this, t)) {
613
+ let o = typeof n.label == "function" ? n.label(this, t) : n.label, s = n.icon ? ` icon="${this._escapeHtml(n.icon)}"` : "", c = n.variant ? this._escapeHtml(n.variant) : "ghost", l = n.tone ? ` tone="${this._escapeHtml(n.tone)}"` : "";
614
+ a += `<mint-button variant="${c}" full-width="true" align="left" data-action="row-action" data-row-index="${i}" data-action-index="${r}" data-column-key="${this._configuration.columns.indexOf(e)}"${s}${l}>${this._escapeHtml(String(o ?? ""))}</mint-button>`;
615
+ }
616
+ }), a += "</div>", a += "</mint-popover>";
617
+ } else e.actions.forEach((n, r) => {
618
+ if (!n.show || n.show(this, t)) {
619
+ let o = n.label ? typeof n.label == "function" ? n.label(this, t) : n.label : "", s = n.icon ? ` icon="${this._escapeHtml(n.icon)}"` : "", c = n.variant ? ` variant="${this._escapeHtml(n.variant)}"` : " variant=\"ghost\"", l = n.tone ? ` tone="${this._escapeHtml(n.tone)}"` : "";
620
+ a += `<mint-button${c} class="${n.classes || ""}" data-action="row-action" data-row-index="${i}" data-action-index="${r}" data-column-key="${this._configuration.columns.indexOf(e)}"${s}${l}>`, o && (a += this._escapeHtml(String(o))), a += "</mint-button>";
621
+ }
622
+ });
623
+ else typeof e.format == "function" ? a += e.format(this, t) : e.data && (a += this._escapeHtml(String(t[e.data] || "")));
624
+ else if (e.action) (!e.action.show || e.action.show(this, t)) && (a += `<mint-button variant="solid" data-action="column-action" data-row-index="${i}" data-column-key="${this._configuration.columns.indexOf(e)}">${e.action.label}</mint-button>`);
625
+ else if (e.actions) if (e.actionStyle !== "buttons") {
626
+ let n = `actions-popover-${this._tableId}-${i}`, r = `actions-button-${this._tableId}-${i}`;
627
+ a += `<mint-button id="${r}" variant="ghost" icon="ellipsis">`, a += "</mint-button>", a += `<mint-popover id="${n}" trigger-id="${r}" direction="down">`, a += "<div class=\"mint-resource-action-menu\">", e.actions.forEach((n, r) => {
628
+ if (!n.show || n.show(this, t)) {
629
+ let o = typeof n.label == "function" ? n.label(this, t) : n.label, s = n.icon ? ` icon="${this._escapeHtml(n.icon)}"` : "", c = n.variant ? this._escapeHtml(n.variant) : "ghost", l = n.tone ? ` tone="${this._escapeHtml(n.tone)}"` : "";
630
+ a += `<mint-button variant="${c}" full-width="true" align="left" data-action="row-action" data-row-index="${i}" data-action-index="${r}" data-column-key="${this._configuration.columns.indexOf(e)}"${s}${l}>${this._escapeHtml(String(o ?? ""))}</mint-button>`;
631
+ }
632
+ }), a += "</div>", a += "</mint-popover>";
633
+ } else e.actions.forEach((n, r) => {
634
+ if (!n.show || n.show(this, t)) {
635
+ let o = n.label ? typeof n.label == "function" ? n.label(this, t) : n.label : "", s = n.icon ? ` icon="${this._escapeHtml(n.icon)}"` : "", c = n.variant ? ` variant="${this._escapeHtml(n.variant)}"` : " variant=\"ghost\"", l = n.tone ? ` tone="${this._escapeHtml(n.tone)}"` : "";
636
+ a += `<mint-button${c} class="${n.classes || ""}" data-action="row-action" data-row-index="${i}" data-action-index="${r}" data-column-key="${this._configuration.columns.indexOf(e)}"${s}${l}>`, o && (a += this._escapeHtml(String(o))), a += "</mint-button>";
637
+ }
638
+ });
639
+ else typeof e.format == "function" ? a += this._escapeHtml(e.format(this, t)) : e.data && (a += this._escapeHtml(String(t[e.data] || "")));
640
+ return r === "table" && e.thumbnail && a && !e.actions && !e.action ? this._wrapThumbnailDesktopBox(a, e) : a;
641
+ }
642
+ _buildMobileListItemHtml(e, t, n, r = !1) {
643
+ if (!this._configuration) return "";
644
+ let i = t, a = typeof this._configuration.onRowClick == "function", o = this._mobileThumbnailColumn(), s = this._mobilePrimaryColumn(), c = this._mobileActionsDropdownColumn(), l = o ? this._buildTableCellInnerHtml(o, e, i, "mobile") : "", u = s ? this._buildTableCellInnerHtml(s, e, i, "mobile") : "", d = c ? this._buildTableCellInnerHtml(c, e, i, "mobile") : "", f = [], p = this._configuration.mobileShowLabels === !0;
645
+ for (let t of this._configuration.columns) {
646
+ if (t.hidden || o && t === o || s && t === s || c && t === c) continue;
647
+ let n = this._columnPlainSummaryText(t, e);
648
+ if (n) if (p) {
649
+ let e = this._stripHtml(String(t.label || "")).trim();
650
+ e ? f.push(`${this._escapeHtml(e)}: ${this._escapeHtml(n)}`) : f.push(this._escapeHtml(n));
651
+ } else f.push(this._escapeHtml(n));
652
+ }
653
+ let m = f.join("<span class=\"text-gray-300 dark:text-gray-600\" aria-hidden=\"true\"> · </span>"), h = [
654
+ "list-none",
655
+ ...r ? [] : [
656
+ "border-b",
657
+ "border-gray-200",
658
+ "dark:border-mint-divider"
659
+ ],
660
+ "bg-white",
661
+ "dark:bg-mint-canvas",
662
+ a ? "cursor-pointer hover:bg-gray-50 dark:hover:bg-mint-elevated" : ""
663
+ ].filter(Boolean).join(" "), g = `<div class="flex items-center gap-3 py-3 pr-4${o ? " pl-0" : " pl-4"}">`;
664
+ if (o) {
665
+ let e = this._thumbnailMobilePx(o), t = `width:${e}px;height:${e}px;min-width:${e}px;min-height:${e}px`;
666
+ g += `<div class="flex shrink-0 items-stretch overflow-hidden rounded-md border border-gray-200 bg-gray-100 p-0 dark:border-mint-divider dark:bg-mint-hover [&>*]:m-0 [&>*]:min-h-0 [&>*]:min-w-0 [&>*]:w-full [&>*]:max-w-full [&>*]:p-0 [&>span]:flex [&>span]:h-full [&>span]:w-full [&>span]:min-h-0 [&>span]:min-w-0 [&>span]:items-stretch [&>span]:justify-stretch [&_img]:!m-0 [&_img]:!box-border [&_img]:!block [&_img]:!h-full [&_img]:!w-full [&_img]:!min-h-0 [&_img]:!min-w-0 [&_img]:!max-h-full [&_img]:!max-w-full [&_img]:!border-0 [&_img]:!p-0 [&_img]:!rounded-none [&_img]:!object-cover [&_img]:!object-center" style="${t}">${l}</div>`;
667
+ }
668
+ g += "<div class=\"flex min-w-0 flex-1 flex-col justify-center gap-1\">", g += "<div class=\"flex items-start justify-between gap-2\">", g += `<div class="min-w-0 text-sm font-semibold leading-snug text-gray-900 dark:text-white">${u}</div>`, d && (g += `<div class="shrink-0 -mr-1">${d}</div>`), g += "</div>", m && (g += `<div class="text-xs font-normal leading-snug text-gray-500 dark:text-gray-400">${m}</div>`), g += "</div></div>";
669
+ let _ = typeof n == "number" && n > 0 ? ` style="box-sizing:border-box;min-height:${n}px;max-height:${n}px;height:${n}px;overflow:hidden"` : "";
670
+ return `<li data-row-index="${i}" ${a ? "data-row-clickable=\"true\" " : ""}class="${h}"${_}>${g}</li>`;
671
+ }
672
+ _buildMobileListPlaceholderLi(e, t, n = !1) {
673
+ let r = this._mobileThumbnailColumn(), i = r ? this._thumbnailMobilePx(r) : 56, a = `width:${i}px;height:${i}px;min-width:${i}px;min-height:${i}px`;
674
+ return `<li data-row-index="${e}" data-mint-rt-placeholder="true" class="list-none${n ? "" : " border-b border-gray-200 dark:border-mint-divider"} bg-white dark:bg-mint-canvas" style="box-sizing:border-box;min-height:${t}px;max-height:${t}px;height:${t}px;overflow:hidden"><div class="flex h-full min-h-0 items-center gap-3 py-3 pl-0 pr-4"><div class="shrink-0 overflow-hidden rounded-md bg-gray-200 dark:bg-white/15" style="${a}"></div><div class="flex min-h-0 min-w-0 flex-1 flex-col justify-center gap-1 py-0.5"><div class="h-4 w-40 rounded bg-gray-200 dark:bg-white/15"></div><div class="h-3 w-full max-w-xs rounded bg-gray-200 dark:bg-white/15"></div></div></div></li>`;
675
+ }
676
+ _renderColgroupHtml() {
677
+ if (!this._configuration) return "";
678
+ let e = this._configuration.columns.filter((e) => !e.hidden), t = [], n = 0;
679
+ for (let r of e) {
680
+ let e = r.width == null ? "" : String(r.width).trim();
681
+ e ? /^\d+(\.\d+)?$/.test(e) ? (n += parseFloat(e), t.push("px")) : t.push("lit") : t.push("flex");
682
+ }
683
+ let r = t.filter((e) => e === "flex").length, i = t.includes("lit"), a = "";
684
+ r > 0 && !i && (a = n > 0 ? `width:calc((100% - ${n}px) / ${r});min-width:0` : `width:${100 / r}%;min-width:0`);
685
+ let o = "<colgroup>";
686
+ return e.forEach((e, n) => {
687
+ let r = e.width == null ? "" : String(e.width).trim(), i = t[n], s = "";
688
+ i === "px" ? s = ` style="width:${r}px;min-width:0"` : i === "lit" ? s = ` style="width:${this._escapeHtml(r)};min-width:0"` : a && (s = ` style="${a}"`), o += `<col${s} />`;
689
+ }), o += "</colgroup>", o;
690
+ }
691
+ _buildDataRowHtml(e, t, n, r = !1) {
692
+ if (!this._configuration) return "";
693
+ let i = t, a = n, o = `box-sizing:border-box;min-height:${a}px;max-height:${a}px;height:${a}px;overflow:hidden`, s = "", c = typeof this._configuration.onRowClick == "function", l = c ? "cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800" : "", u = c ? " data-row-clickable=\"true\"" : "", d = l ? ` class="${l}"` : "";
694
+ return s += `<tr data-row-index="${i}"${r ? " data-mint-rt-last-row=\"\"" : ""}${u}${d} style="${o}">`, this._configuration.columns.forEach((t) => {
695
+ if (t.hidden) return;
696
+ let n = !t.show || t.show(this, e), r = `${this._getStyle(t)}box-sizing:border-box;max-height:${a}px;overflow:hidden;vertical-align:middle;`;
697
+ s += `<td style="${r}" class="${this._getClasses(t, !0)}">`, s += n ? this._buildTableCellInnerHtml(t, e, i) : "", s += "</td>";
698
+ }), s += "</tr>", s;
699
+ }
700
+ _getVirtualRowCount() {
701
+ return !this._virtualScrollActive() || !this._configuration ? 0 : this._type === "provided" ? this._getAllFilteredRowsSorted().length : this._type === "ajax" ? this._totalRows : 0;
702
+ }
703
+ _getVirtualRowAt(e) {
704
+ return this._type === "provided" ? this._getAllFilteredRowsSorted()[e] ?? null : this._type === "ajax" && this._virtualRowCache.has(e) ? this._virtualRowCache.get(e) : null;
705
+ }
706
+ _buildVirtualPlaceholderRowHtml(e, t, n = !1) {
707
+ if (!this._configuration) return "";
708
+ let r = t, i = `box-sizing:border-box;min-height:${r}px;max-height:${r}px;height:${r}px;overflow:hidden`, a = `<tr data-row-index="${e}" data-mint-rt-placeholder="true"${n ? " data-mint-rt-last-row=\"\"" : ""} class="bg-white dark:bg-mint-canvas" style="${i}">`;
709
+ return this._configuration.columns.forEach((e) => {
710
+ if (e.hidden) return;
711
+ let t = `${this._getStyle(e)}box-sizing:border-box;max-height:${r}px;height:${r}px;overflow:hidden;vertical-align:middle;line-height:0;`;
712
+ if (a += `<td style="${t}" class="${this._getClasses(e, !0)}">`, e.thumbnail) {
713
+ let t = this._thumbnailDesktopPx(e);
714
+ a += `<div class="rounded-md bg-gray-200 dark:bg-white/15" style="width:${t}px;height:${t}px;max-width:100%;box-sizing:border-box"></div>`;
715
+ } else a += "<div class=\"h-4 max-w-[95%] rounded bg-gray-200 dark:bg-white/15\"></div>";
716
+ a += "</td>";
717
+ }), a += "</tr>", a;
718
+ }
719
+ _virtualScrollStickyOverlapPx(e) {
720
+ let t = 0;
721
+ if (this._fixedControls()) {
722
+ let e = this.querySelector(`#mint-rt-fixed-controls-${this._tableId}`);
723
+ if (e) t += Math.ceil(e.getBoundingClientRect().height);
724
+ else {
725
+ let e = getComputedStyle(this).getPropertyValue("--mint-rt-fixed-controls-h").trim(), n = parseFloat(e);
726
+ isNaN(n) || (t += Math.ceil(n));
727
+ }
728
+ }
729
+ if (this._fixedHeader() && e) {
730
+ let n = e.querySelector("thead");
731
+ n && (t += Math.ceil(n.getBoundingClientRect().height));
732
+ }
733
+ return t;
734
+ }
735
+ _scrollVirtualTableTopIntoView() {
736
+ if (!(!this._virtualScrollActive() || !this.isConnected)) {
737
+ if (this._virtualScrollRoot() === "table-body") {
738
+ let e = this._virtualBodyScrollEl?.isConnected ? this._virtualBodyScrollEl : this.querySelector(`#mint-rt-vscroll-${this._tableId}`);
739
+ this._useMobileListLayout() && e && e.querySelector(`ul[data-mint-rt-mobile-list="${this._tableId}"]`);
740
+ let t = e?.querySelector("mint-table.table-section") || e?.querySelector("mint-table"), n = t?.querySelector(`#${this._tableId}`)?.closest("table") || t?.querySelector("table");
741
+ this._virtualScrollStickyOverlapPx(n), e && (e.scrollTop = 0, this._virtualBodyScrollEl = e, this._virtualInvalidate(), this._scheduleVirtualWindowSync());
742
+ return;
743
+ }
744
+ this._virtualInvalidate(), this._scheduleVirtualWindowSync();
745
+ }
746
+ }
747
+ _scheduleVirtualWindowSync() {
748
+ this._virtualScrollActive() && this._virtualWindowRaf === null && (this._virtualWindowRaf = window.requestAnimationFrame(() => {
749
+ this._virtualWindowRaf = null, this._syncVirtualWindow();
750
+ }));
751
+ }
752
+ _syncVirtualWindow() {
753
+ if (!this._virtualScrollActive() || !this._configuration) return;
754
+ let e = this._useMobileListLayout(), t = this.querySelector(`tbody[data-mint-rt-tbody="${this._tableId}"]`), n = this.querySelector(`ul[data-mint-rt-mobile-list="${this._tableId}"]`), r = e ? n : t;
755
+ if (!r) return;
756
+ let i = this._getVirtualRowCount(), a = this._virtualRowHeightPxForSync(e), o = this._virtualColspan();
757
+ if (i === 0) {
758
+ e ? this._fetchError ? r.innerHTML = `<li class="list-none px-4 py-8 text-center text-sm text-red-500 dark:text-red-400">Failed to load data: ${this._escapeHtml(this._fetchError)}</li>` : r.innerHTML = "<li class=\"list-none px-4 py-8 text-center text-sm\">No records found.</li>" : this._fetchError ? r.innerHTML = `<tr><td colspan="${o}" class="text-center py-8 text-red-500 dark:text-red-400">Failed to load data: ${this._escapeHtml(this._fetchError)}</td></tr>` : r.innerHTML = `<tr><td colspan="${o}" class="text-center py-8">No records found.</td></tr>`, this._virtualLastRangeStart = -1, this._virtualLastRangeEnd = -1, this._virtualLastRangeCacheSig = "";
759
+ return;
760
+ }
761
+ let s = 0, c = window.innerHeight;
762
+ if (this._virtualScrollRoot() === "table-body") {
763
+ let e = this._virtualBodyScrollEl;
764
+ if ((!e || !e.isConnected) && (e = this.querySelector(`#mint-rt-vscroll-${this._tableId}`), this._virtualBodyScrollEl = e), !e) return;
765
+ s = e.scrollTop, c = e.clientHeight || 400;
766
+ } else {
767
+ let e = r.getBoundingClientRect();
768
+ s = Math.max(0, -e.top);
769
+ }
770
+ let l = Math.min(Math.max(0, Math.floor(s / a)), Math.max(0, i - 1)), u = Math.ceil(c / a) + 16, d = Math.max(0, l - 8), f = Math.min(i, l + u), p = "";
771
+ if (this._type === "ajax") for (let e = d; e < f; e++) p += this._virtualRowCache.has(e) ? "1" : "0";
772
+ if (d === this._virtualLastRangeStart && f === this._virtualLastRangeEnd && (this._type !== "ajax" || p === this._virtualLastRangeCacheSig)) return;
773
+ this._virtualLastRangeStart = d, this._virtualLastRangeEnd = f, this._virtualLastRangeCacheSig = p;
774
+ let m = d * a, h = Math.max(0, (i - f) * a), g = "";
775
+ if (e) {
776
+ g += `<li aria-hidden="true" class="pointer-events-none m-0 block list-none border-0 p-0" style="height:${m}px"></li>`;
777
+ for (let e = d; e < f; e++) {
778
+ let t = this._getVirtualRowAt(e), n = i > 0 && e === i - 1;
779
+ t ? g += this._buildMobileListItemHtml(t, e, a, n) : g += this._buildMobileListPlaceholderLi(e, a, n);
780
+ }
781
+ g += `<li aria-hidden="true" class="pointer-events-none m-0 block list-none border-0 p-0" style="height:${h}px"></li>`;
782
+ } else {
783
+ g += `<tr data-mint-rt-spacer="top" aria-hidden="true"><td colspan="${o}" style="height:${m}px;padding:0;border:0;line-height:0;font-size:0"></td></tr>`;
784
+ for (let e = d; e < f; e++) {
785
+ let t = this._getVirtualRowAt(e), n = i > 0 && e === i - 1;
786
+ t ? g += this._buildDataRowHtml(t, e, a, n) : g += this._buildVirtualPlaceholderRowHtml(e, a, n);
787
+ }
788
+ g += `<tr data-mint-rt-spacer="bottom" aria-hidden="true"><td colspan="${o}" style="height:${h}px;padding:0;border:0;line-height:0;font-size:0"></td></tr>`;
789
+ }
790
+ if (r.innerHTML = g, this.querySelectorAll(`tbody[data-mint-rt-tbody="${this._tableId}"] mint-button[data-action], ul[data-mint-rt-mobile-list="${this._tableId}"] mint-button[data-action]`).forEach((e) => {
791
+ e.render && e.render();
792
+ }), this._attachTableEventListeners(), this._attachRowClickHandler(), this._type === "ajax" && this._virtualScrollActive() && this._scheduleVirtualAjaxPrefetch(d, f), this._virtualScrollRoot() === "table-body" && !e) {
793
+ let e = this._virtualBodyScrollEl;
794
+ e?.isConnected && requestAnimationFrame(() => {
795
+ if (!e.isConnected) return;
796
+ let t = Math.max(0, e.scrollHeight - e.clientHeight);
797
+ e.scrollTop > t && (e.scrollTop = t);
798
+ });
799
+ }
800
+ }
801
+ _detachVirtualScroll() {
802
+ this._virtualScrollHandler &&= (window.removeEventListener("scroll", this._virtualScrollHandler), this._virtualBodyScrollEl?.removeEventListener("scroll", this._virtualScrollHandler), null), this._virtualWindowResizeHandler &&= (window.removeEventListener("resize", this._virtualWindowResizeHandler), null), this._virtualResizeObserver &&= (this._virtualResizeObserver.disconnect(), null), this._virtualBodyScrollEl = null, this._virtualWindowRaf !== null && (window.cancelAnimationFrame(this._virtualWindowRaf), this._virtualWindowRaf = null), this._virtualLastRangeStart = -1, this._virtualLastRangeEnd = -1, this._virtualLastRangeCacheSig = "", this._virtualAjaxPrefetchTimer !== null && (window.clearTimeout(this._virtualAjaxPrefetchTimer), this._virtualAjaxPrefetchTimer = null), this._virtualRangeFetching = !1;
803
+ }
804
+ _scheduleVirtualAjaxPrefetch(e, t) {
805
+ if (this._type !== "ajax" || !this._virtualScrollActive() || !this._configuration) return;
806
+ let n = !1;
807
+ for (let r = e; r < t; r++) if (!this._virtualRowCache.has(r)) {
808
+ n = !0;
809
+ break;
810
+ }
811
+ if (!n) return;
812
+ this._virtualAjaxPrefetchTimer !== null && window.clearTimeout(this._virtualAjaxPrefetchTimer);
813
+ let r = e, i = t;
814
+ this._virtualAjaxPrefetchTimer = window.setTimeout(() => {
815
+ this._virtualAjaxPrefetchTimer = null, this._fetchVirtualAjaxRange(r, i - r);
816
+ }, 60);
817
+ }
818
+ async _fetchVirtualAjaxRange(e, t) {
819
+ if (!this._configuration || this._type !== "ajax" || !this._virtualScrollActive()) return;
820
+ let n = typeof this._configuration.data == "string" ? this._configuration.data : null;
821
+ if (!n || t <= 0 || this._virtualRangeFetching || e < 0 || e >= this._totalRows) return;
822
+ this._virtualRangeFetching = !0;
823
+ let r = this._virtualFetchGeneration, i = Math.min(e, Math.max(0, this._totalRows - 1)), a = Math.min(150, Math.max(this._perPage, t, 15), Math.max(1, this._totalRows - i));
824
+ try {
825
+ let e = new URLSearchParams({
826
+ perPage: a.toString(),
827
+ offset: i.toString(),
828
+ search: this._search,
829
+ sortBy: this._configuration.sortBy || "id",
830
+ sort: this._configuration.sort || "asc",
831
+ searchColumns: this._searchColumns.join(","),
832
+ columns: this._columns.join(",")
833
+ }), t = {};
834
+ this._configuration.headers && (t.headers = this._configuration.headers);
835
+ let o = await fetch(`${n}?${e.toString()}`, t);
836
+ if (!o.ok) throw Error(`HTTP error! status: ${o.status}`);
837
+ let s = await o.json();
838
+ if (r !== this._virtualFetchGeneration) return;
839
+ (s.content?.rows || []).forEach((e, t) => {
840
+ let n = i + t;
841
+ n < this._totalRows && this._virtualRowCache.set(n, e);
842
+ });
843
+ } catch (e) {
844
+ console.error("mint-resource-table: virtual range fetch failed", e);
845
+ } finally {
846
+ this._virtualRangeFetching = !1, r === this._virtualFetchGeneration && (this._virtualInvalidate(), this._scheduleVirtualWindowSync());
847
+ }
848
+ }
849
+ _detachFixedChromeResize() {
850
+ this._fixedChromeResizeObserver?.disconnect(), this._fixedChromeResizeObserver = null, this.style.removeProperty("--mint-rt-fixed-controls-h");
851
+ }
852
+ _syncFixedControlsChromeHeight() {
853
+ if (!this._fixedHeader() || !this._fixedControls()) return;
854
+ this._fixedChromeResizeObserver?.disconnect(), this._fixedChromeResizeObserver = null;
855
+ let e = this.querySelector(`#mint-rt-fixed-controls-${this._tableId}`);
856
+ if (!e) return;
857
+ let t = () => {
858
+ let t = Math.ceil(e.getBoundingClientRect().height);
859
+ this.style.setProperty("--mint-rt-fixed-controls-h", `${t}px`);
860
+ };
861
+ t(), this._fixedChromeResizeObserver = new ResizeObserver(t), this._fixedChromeResizeObserver.observe(e);
862
+ }
863
+ _attachVirtualScrollListeners() {
864
+ if (this._detachVirtualScroll(), !this._virtualScrollActive()) return;
865
+ let e = () => {
866
+ this._scheduleVirtualWindowSync();
867
+ };
868
+ this._virtualScrollHandler = e, this._virtualScrollRoot() === "table-body" ? (this._virtualBodyScrollEl = this.querySelector(`#mint-rt-vscroll-${this._tableId}`), this._virtualBodyScrollEl?.addEventListener("scroll", e, { passive: !0 }), this._virtualBodyScrollEl && typeof ResizeObserver < "u" && (this._virtualResizeObserver = new ResizeObserver(() => this._scheduleVirtualWindowSync()), this._virtualResizeObserver.observe(this._virtualBodyScrollEl))) : window.addEventListener("scroll", e, { passive: !0 }), this._virtualWindowResizeHandler = () => this._scheduleVirtualWindowSync(), window.addEventListener("resize", this._virtualWindowResizeHandler, { passive: !0 }), this._scheduleVirtualWindowSync();
869
+ }
870
+ _toggleSort(e) {
871
+ if (!this._configuration || !e.data || !e.sortable) return;
872
+ let t = e.data;
873
+ if (this._sortTimeoutId !== null && (clearTimeout(this._sortTimeoutId), this._sortTimeoutId = null), this._sorting = !0, this._sortingColumn = e, this._updateSortIcons(), this._type === "ajax") this._sortTimeoutId = window.setTimeout(() => {
874
+ if (this._sortTimeoutId = null, !this._configuration || !t || !e.sortable) return;
875
+ let n = this._configuration.sort || "asc";
876
+ this._configuration.sortBy?.toLowerCase() === t.toLowerCase() && (n = n === "desc" ? "asc" : "desc"), this._configuration.sort = n, this._configuration.sortBy = t, this._updateSortIcons(), this._offset = 0, this._currentPage = 1, this._fetching = !1, this._loading = !1, this._fetchData(void 0, !1, this._perPage, 0);
877
+ }, 10);
878
+ else {
879
+ let e = this._configuration.sort || "asc";
880
+ this._configuration.sortBy?.toLowerCase() === t.toLowerCase() && (e = e === "desc" ? "asc" : "desc"), this._configuration.sort = e, this._configuration.sortBy = t, this._currentPage = 1, this._sorting = !1, this._sortingColumn = null, this._updateSortIcons(), this.render(), this._virtualScrollActive() && queueMicrotask(() => this._scrollVirtualTableTopIntoView());
881
+ }
882
+ }
883
+ _getSortClass(e) {
884
+ return this._sorting && this._sortingColumn === e ? "spinner" : this._configuration?.sortBy?.toLowerCase() === e.data?.toLowerCase() ? this._configuration?.sort?.toLowerCase() === "desc" ? "caret-down" : "caret-up" : "";
885
+ }
886
+ _updateSortIcons() {
887
+ if (!this._configuration) return;
888
+ this._configuration.columns.forEach((e, t) => {
889
+ if (!e.sortable || e.hidden) return;
890
+ let n = this.querySelector(`th[data-column-key="${t}"]`);
891
+ if (!n) return;
892
+ let r = n.querySelector(":scope > div.flex.items-center");
893
+ if (!r) return;
894
+ let i = r.querySelector(":scope > div.ml-2.flex.items-center"), a = this._getSortClass(e), o = () => {
895
+ if (!i) {
896
+ let e = document.createElement("div");
897
+ e.className = "ml-2 flex items-center", r.appendChild(e), i = e;
898
+ }
899
+ return i;
900
+ }, s = () => {
901
+ i &&= (i.remove(), null);
902
+ };
903
+ if (a === "spinner") {
904
+ let e = o();
905
+ if (e.querySelector("mint-icon")?.remove(), !e.querySelector("mint-spinner")) {
906
+ let t = document.createElement("mint-spinner");
907
+ t.className = "w-4 h-4", e.appendChild(t);
908
+ }
909
+ } else if (a === "caret-up" || a === "caret-down") {
910
+ let e = o();
911
+ e.querySelector("mint-spinner")?.remove();
912
+ let t = e.querySelector("mint-icon");
913
+ t || (t = document.createElement("mint-icon"), e.appendChild(t)), t.setAttribute("name", a), t.className = "w-4 h-4";
914
+ } else s();
915
+ }), this._syncMobileSortPopoverIcons();
916
+ let e = this.querySelector(`#mint-rt-mobile-sort-btn-${this._tableId}`);
917
+ e && (e.setAttribute("icon", this._getMobileSortTriggerIconName()), this._sorting ? e.setAttribute("loading", "true") : e.removeAttribute("loading"), typeof e.render == "function" && e.render());
918
+ }
919
+ _showFetchingState() {}
920
+ _triggerSearch() {
921
+ this._searchTimeoutId && clearTimeout(this._searchTimeoutId), this._searching = !0, this._type === "ajax" && this._updateSearchIcon(), this._type !== "ajax" && (this._currentPage = 1), this._updateTableBody(), this._type !== "ajax" && this._updatePagination(), this._searchTimeoutId = window.setTimeout(() => {
922
+ this._type === "ajax" ? (this._offset = 0, this._fetchData(void 0, !1, this._perPage, 0)) : (this._searching = !1, this._virtualScrollActive() && queueMicrotask(() => this._scrollVirtualTableTopIntoView()));
923
+ }, 400);
924
+ }
925
+ _updateSearchIcon() {
926
+ let e = this.querySelector(`#search-${this._tableId}`);
927
+ if (!e) return;
928
+ let t = this._type === "ajax" && (this._searching || this._fetching);
929
+ setTimeout(() => {
930
+ let n = e.querySelector(".relative") || e.querySelector("div");
931
+ if (!n) return;
932
+ let r = n.querySelector("mint-icon"), i = n.querySelector("mint-spinner");
933
+ if (t) {
934
+ if (r && !i) {
935
+ let e = document.createElement("mint-spinner");
936
+ e.className = "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 pointer-events-none", r.replaceWith(e);
937
+ } else if (!r && !i) {
938
+ let e = document.createElement("mint-spinner");
939
+ e.className = "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 pointer-events-none", n.appendChild(e);
940
+ }
941
+ } else if (i) {
942
+ e.getAttribute("icon") || e.setAttribute("icon", "search");
943
+ let t = document.createElement("mint-icon");
944
+ t.setAttribute("name", "search"), t.className = "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 dark:text-gray-500 pointer-events-none", i.replaceWith(t);
945
+ }
946
+ }, 0);
947
+ }
948
+ _updateTableBody() {
949
+ if (!this._configuration) return;
950
+ let e = this.querySelector(`tbody[data-mint-rt-tbody="${this._tableId}"]`), t = this.querySelector(`#${this._tableId}`)?.closest("table")?.querySelector("tbody");
951
+ if (this._virtualScrollActive() && (this._type === "provided" || this._type === "ajax")) {
952
+ if (!(e || t)) {
953
+ this.render();
954
+ return;
955
+ }
956
+ let n = this.querySelector(`#search-${this._tableId}`), r = document.activeElement === n || n?.querySelector("input") === document.activeElement, i = this._search;
957
+ if ((this._fetching || this._loading) && !this._loaded && !this._sorting) return;
958
+ if (this._virtualInvalidate(), this._syncVirtualWindow(), r && n) {
959
+ let e = n.querySelector("input") || n._element;
960
+ e ? (e.value = i, setTimeout(() => {
961
+ e.focus(), e.setSelectionRange(i.length, i.length);
962
+ }, 0)) : n.value !== void 0 && (n.value = i, setTimeout(() => {
963
+ n.focus();
964
+ }, 0));
965
+ }
966
+ return;
967
+ }
968
+ let n = this._getRows(), r = t;
969
+ if (!r) {
970
+ this.render();
971
+ return;
972
+ }
973
+ let i = this.querySelector(`#search-${this._tableId}`), a = document.activeElement === i || i?.querySelector("input") === document.activeElement, o = this._search, s = "", c = "";
974
+ if ((this._fetching || this._loading) && !this._loaded && !this._sorting) return;
975
+ n.forEach((e, t) => {
976
+ c += this._buildMobileListItemHtml(e, t, void 0, t === n.length - 1);
977
+ let r = typeof this._configuration.onRowClick == "function", i = r ? "cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800" : "";
978
+ s += `<tr data-row-index="${t}" ${r ? "data-row-clickable=\"true\"" : ""}${i ? ` class="${i}"` : ""}>`, this._configuration.columns.forEach((n) => {
979
+ if (n.hidden) return;
980
+ let r = !n.show || n.show(this, e);
981
+ s += `<td style="${this._getStyle(n)}" class="${this._getClasses(n, !0)}">`, r && (s += this._buildTableCellInnerHtml(n, e, t, "table")), s += "</td>";
982
+ }), s += "</tr>";
983
+ }), n.length === 0 && (this._fetchError ? (s += `<tr><td colspan="${this._configuration.columns.filter((e) => !e.hidden).length}" class="text-center py-8 text-red-500 dark:text-red-400">Failed to load data: ${this._escapeHtml(this._fetchError)}</td></tr>`, c += `<li class="list-none px-4 py-8 text-center text-sm text-red-500 dark:text-red-400">Failed to load data: ${this._escapeHtml(this._fetchError)}</li>`) : (s += `<tr><td colspan="${this._configuration.columns.filter((e) => !e.hidden).length}" class="text-center py-8">No records found.</td></tr>`, c += "<li class=\"list-none px-4 py-8 text-center text-sm\">No records found.</li>")), r.innerHTML = s;
984
+ let l = this.querySelector(`ul[data-mint-rt-mobile-list="${this._tableId}"]`);
985
+ if (l && (l.innerHTML = c), this._attachTableEventListeners(), this._attachRowClickHandler(), a && i) {
986
+ let e = i.querySelector("input") || i._element;
987
+ e ? (e.value = o, setTimeout(() => {
988
+ e.focus(), e.setSelectionRange(o.length, o.length);
989
+ }, 0)) : i.value !== void 0 && (i.value = o, setTimeout(() => {
990
+ i.focus();
991
+ }, 0));
992
+ }
993
+ }
994
+ _updatePagination() {
995
+ if (!this._configuration) return;
996
+ let e = this._lastPage || Math.ceil(this._rows.length / this._perPage), t = () => {
997
+ let e = this.querySelector("mint-table"), t = e?.nextElementSibling;
998
+ e && t && t.id !== `mint-rt-pagination-host-${this._tableId}` && !t.classList.contains("mint-rt-pagination-host") && t.querySelector?.("[data-action=\"page\"]") && t.remove();
999
+ };
1000
+ if (!this._configuration.perPage || e <= 1 || this._virtualScrollActive()) {
1001
+ this._getPaginationHostEl()?.replaceChildren(), t();
1002
+ return;
1003
+ }
1004
+ let n = this._getPaginationHostEl();
1005
+ if (!n) {
1006
+ let e = this.querySelector(`[data-mint-rt-mobile-list="${this._tableId}"]`) || this.querySelector("mint-table");
1007
+ if (!e) {
1008
+ this.render();
1009
+ return;
1010
+ }
1011
+ n = document.createElement("div"), n.id = `mint-rt-pagination-host-${this._tableId}`, n.setAttribute("data-mint-rt-pagination-wrap", ""), n.className = "mint-rt-pagination-host w-full min-w-0 overflow-x-auto overflow-y-hidden overscroll-x-contain flex justify-center [-webkit-overflow-scrolling:touch] md:justify-end " + (this._inMintCard ? "border-t border-gray-200 px-3.5 pb-3.5 pt-3 dark:border-mint-divider md:border-t-0 md:pt-0" : "border-t border-gray-200 px-2 py-3 dark:border-mint-divider md:border-t-0 md:py-0 md:mt-4"), e.insertAdjacentElement("afterend", n);
1012
+ }
1013
+ let r = this._buildPaginationNavMarkup(e);
1014
+ n.innerHTML = r, setTimeout(() => {
1015
+ this._attachPaginationListeners(), n.querySelectorAll("mint-button[data-action=\"page\"]").forEach((e) => {
1016
+ let t = e.getAttribute("data-page"), n = t && this._loadingPage === parseInt(t), r = e._button || e.querySelector("button");
1017
+ if (r) if (n) {
1018
+ let e = [], t = document.createTreeWalker(r, NodeFilter.SHOW_TEXT, null), n;
1019
+ for (; n = t.nextNode();) e.push(n);
1020
+ e.forEach((e) => e.parentNode?.removeChild(e));
1021
+ let i = r.querySelector(".mint-button-content");
1022
+ if (i) {
1023
+ let e = i.textContent?.trim();
1024
+ e && /^\d+$/.test(e) && i.remove();
1025
+ }
1026
+ let a = r.querySelector("span.mr-2");
1027
+ a && a.querySelector("mint-spinner") && (a.classList.remove("mr-2"), a.classList.add("mr-0"));
1028
+ } else {
1029
+ let e = r.textContent?.trim();
1030
+ if (!e || !/^\d+$/.test(e)) {
1031
+ let e = t || "", n = r.querySelector("mint-spinner");
1032
+ r.innerHTML = "", n && r.appendChild(n), r.appendChild(document.createTextNode(e));
1033
+ }
1034
+ }
1035
+ if ("render" in e && typeof e.render == "function" && (e.render(), n && r)) {
1036
+ let e = r.querySelector("span.mr-2");
1037
+ e && e.querySelector("mint-spinner") && (e.classList.remove("mr-2"), e.classList.add("mr-0"));
1038
+ }
1039
+ }), n.querySelectorAll("mint-button[data-action=\"page-prev\"], mint-button[data-action=\"page-next\"]").forEach((e) => {
1040
+ "render" in e && typeof e.render == "function" && e.render();
1041
+ }), this._loadingPage !== null && !this._loading && !this._fetching && this._updatePagination();
1042
+ }, 0);
1043
+ }
1044
+ _goToPage(e) {
1045
+ let t = this._lastPage || Math.ceil(this._rows.length / this._perPage);
1046
+ e > t && (e = t), e < 1 && (e = 1), e !== this._currentPage && (this._currentPage = e, this._offset = (e - 1) * this._perPage, this._updatePageInUrl(e), this._type === "ajax" ? (this._loadingPage = e, this._updatePagination(), this._fetchData()) : this.render());
1047
+ }
1048
+ _handleButtonClick(e) {
1049
+ if (this._configuration) switch (e.type) {
1050
+ case "export": break;
1051
+ case "print":
1052
+ window.print();
1053
+ break;
1054
+ case "csv":
1055
+ this._downloadCSV();
1056
+ break;
1057
+ default:
1058
+ e.onClick && e.onClick(this);
1059
+ break;
1060
+ }
1061
+ }
1062
+ _downloadCSV() {
1063
+ if (!this._configuration) return;
1064
+ let e = this.querySelector(`#${this._tableId}`) || this.querySelector("table");
1065
+ if (!e) return;
1066
+ let t = "data:text/csv;charset=utf-8,", n = (e) => {
1067
+ let n = [];
1068
+ e.querySelectorAll("th, td").forEach((e) => {
1069
+ let t = e.getAttribute("colspan");
1070
+ if (t) for (let e = 0; e < parseInt(t, 10) - 1; e++) n.push("");
1071
+ n.push("\"" + e.textContent?.trim().replace(/"/g, "\"\"") + "\"");
1072
+ }), t += n.join(",") + "\n";
1073
+ };
1074
+ e.querySelectorAll("tr").forEach((e) => n(e));
1075
+ let r = encodeURI(t), i = document.createElement("a");
1076
+ i.setAttribute("href", r), i.setAttribute("download", `${this._configuration.export_name || this._tableId}.csv`), document.body.appendChild(i), i.click(), document.body.removeChild(i);
1077
+ }
1078
+ _getStyle(e) {
1079
+ let t = "";
1080
+ return (e.nowrap || e.actions) && (t += "white-space: nowrap;"), e.offsetLeft && (t += `left: ${e.offsetLeft} !important;`), e.offsetRight && (t += `right: ${e.offsetRight} !important;`), e.width && (t += `min-width: ${e.width}px; max-width: ${e.width}px;`), t;
1081
+ }
1082
+ _getClasses(e, t = !1) {
1083
+ let n = [];
1084
+ return e.class && n.push(e.class.trim()), e.sortable && !t && n.push("cursor-pointer"), e.stickLeft && n.push("sticky-left"), e.stickRight && n.push("sticky-right"), n.join(" ");
1085
+ }
1086
+ _replaceUtilityClasses() {
1087
+ let e = t, n = [this, ...Array.from(this.querySelectorAll("[class]"))];
1088
+ for (let t of n) for (let n of Array.from(t.classList)) {
1089
+ let r = e[n];
1090
+ r && t.classList.replace(n, r);
1091
+ }
1092
+ }
1093
+ _renderTheadHtml(e, t, n = !1, r = !1) {
1094
+ if (!this._configuration) return "";
1095
+ let i = ["bg-white", "dark:bg-mint-nav"];
1096
+ e && (i.push("sticky", "z-30"), r ? i.push("top-[var(--mint-rt-fixed-controls-h,0px)]") : i.push("top-0")), t && i.push("border-b", "border-gray-200", "dark:border-mint-divider");
1097
+ let a = `<thead class="${i.join(" ")}"><tr>`;
1098
+ return this._configuration.columns.forEach((e, t) => {
1099
+ if (e.hidden) return;
1100
+ let r = n ? "" : ` width="${e.width || ""}"`, i = e.sortable ? " data-mint-rt-sortable=\"\"" : "";
1101
+ if (a += `<th${r} style="${this._getStyle(e)}" class="${this._getClasses(e)}" data-column-key="${t}"${i}>`, e.showLabel !== !1) {
1102
+ if (a += "<div class=\"flex items-center\">", a += `<div class="flex-1">${e.raw ? e.label : this._escapeHtml(e.label)}</div>`, e.sortable) {
1103
+ let t = this._getSortClass(e);
1104
+ t === "spinner" ? a += "<div class=\"ml-2 flex items-center\"><mint-spinner class=\"w-4 h-4\"></mint-spinner></div>" : (t === "caret-up" || t === "caret-down") && (a += `<div class="ml-2 flex items-center"><mint-icon name="${t}" class="w-4 h-4"></mint-icon></div>`);
1105
+ }
1106
+ a += "</div>";
1107
+ }
1108
+ a += "</th>";
1109
+ }), a += "</tr></thead>", a;
1110
+ }
1111
+ render() {
1112
+ if (!this._configuration) {
1113
+ this.innerHTML = "<div class=\"p-4 text-red-500\">Error: Invalid configuration</div>", this._replaceUtilityClasses();
1114
+ return;
1115
+ }
1116
+ this._ensureMobileListMql();
1117
+ let e = String(this._configuration.id || "").trim();
1118
+ e && (this.id = e), this._detachVirtualScroll(), this._detachFixedChromeResize(), this._virtualScrollActive() || this._virtualRowCache.clear();
1119
+ let t = !this._loaded || this._rows.length > 0 || this._search.length > 0 || this._searching, n = this._getRows();
1120
+ this._lastPage || Math.ceil(this._rows.length / this._perPage);
1121
+ let r = this._isExternalLoading(), i = "";
1122
+ if (t) {
1123
+ let e = this._fixedControls(), t = [
1124
+ "flex",
1125
+ "items-center",
1126
+ "min-w-0",
1127
+ this._inMintCard ? "p-3.5" : "mb-3",
1128
+ e ? "sticky top-0 z-20 bg-white dark:bg-mint-nav border-b border-gray-200 dark:border-mint-divider" : ""
1129
+ ].filter(Boolean).join(" ");
1130
+ if (i += `<div id="mint-rt-fixed-controls-${this._tableId}" class="${t}">`, i += "<div class=\"flex min-w-0 flex-1 items-center gap-2\">", i += this._buildMobileSortToolbarHtml(), this._configuration.showSearch !== !1) {
1131
+ let e = `search-${this._tableId}`, t = this._escapeHtml(this._configuration.searchPlaceholder || "Search...");
1132
+ i += `<mint-input id="${e}" type="search" label="" placeholder="${t}" class="min-w-0 flex-1" icon="search" value="${this._escapeHtml(this._search)}"></mint-input>`;
1133
+ }
1134
+ i += "<div class=\"hidden shrink-0 items-center gap-2 md:flex\">", this._configuration.buttons && this._configuration.buttons.forEach((e) => {
1135
+ let t = e.icon ? ` icon="${this._escapeHtml(e.icon)}"` : "", n = e.tone ? ` tone="${this._escapeHtml(e.tone)}"` : "";
1136
+ i += `<mint-button variant="solid" class="${e.class || ""}" data-button-type="${e.type || "custom"}"${t}${n}>`, e.label && (i += this._escapeHtml(e.label)), i += "</mint-button>";
1137
+ }), i += "</div>", i += "</div>", i += "</div>";
1138
+ }
1139
+ if ((this._type === "ajax" && !this._loaded || this._type === "provided" && r) && !this._fetchError && !this._sorting) {
1140
+ let e = this._fixedHeader() ? " data-mint-rt-scroll-inner=\"\"" : "", t = this._fixedHeader() && this._fixedControls(), n = this._fixedHeader() ? t ? "sticky top-[var(--mint-rt-fixed-controls-h,0px)] z-30 " : "sticky top-0 z-30 " : "sticky top-0 z-10 ";
1141
+ i += "<div class=\"min-w-0\">", i += "<mint-table class=\"table-section" + (this._inMintCard ? " rounded-t-none" : "") + "\"" + e + ">", i += `<table id="${this._tableId}">`, i += "<thead class=\"" + n + "bg-white dark:bg-mint-nav border-b border-gray-200 dark:border-mint-divider\"><tr>", this._configuration.columns.forEach((e, t) => {
1142
+ if (e.hidden) return;
1143
+ let n = e.sortable ? " data-mint-rt-sortable=\"\"" : "";
1144
+ if (i += `<th width="${e.width || ""}" style="${this._getStyle(e)}" class="${this._getClasses(e)}" data-column-key="${t}"${n}>`, e.showLabel !== !1) {
1145
+ if (i += "<div class=\"flex items-center\">", i += `<div class="flex-1">${e.raw ? e.label : this._escapeHtml(e.label)}</div>`, e.sortable) {
1146
+ let t = this._getSortClass(e);
1147
+ t === "spinner" ? i += "<div class=\"ml-2 flex items-center\"><mint-spinner class=\"w-4 h-4\"></mint-spinner></div>" : (t === "caret-up" || t === "caret-down") && (i += `<div class="ml-2 flex items-center"><mint-icon name="${t}" class="w-4 h-4"></mint-icon></div>`);
1148
+ }
1149
+ i += "</div>";
1150
+ }
1151
+ i += "</th>";
1152
+ }), i += "</tr></thead>", i += "<tbody>";
1153
+ for (let e = 0; e < 4; e++) i += "<tr>", this._configuration.columns.forEach((e) => {
1154
+ if (!e.hidden) {
1155
+ if (i += `<td style="${this._getStyle(e)}" class="${this._getClasses(e, !0)}">`, e.thumbnail) {
1156
+ let t = this._thumbnailDesktopPx(e);
1157
+ i += `<div class="rounded-md bg-gray-200 dark:bg-white/15 animate-pulse" style="width:${t}px;height:${t}px;box-sizing:border-box"></div>`;
1158
+ } else i += "<div class=\"h-4 max-w-[95%] rounded bg-gray-200 dark:bg-white/15 animate-pulse\"></div>";
1159
+ i += "</td>";
1160
+ }
1161
+ }), i += "</tr>";
1162
+ i += "</tbody>", i += "</table>", i += "</mint-table>", i += "</div>", i += this._paginationHostPlaceholderHtml();
1163
+ } else if (n.length > 0 || this._search.length > 0 || this._searching || this._fetchError) {
1164
+ let e = this._virtualScrollActive() && (this._type === "provided" || this._type === "ajax" && this._loaded && !this._fetchError), t = e && this._virtualScrollRoot() === "table-body", a = this._escapeHtml(this._virtualMaxHeightCss()), o = t || this._fixedHeader(), s = this._fixedHeader() && this._fixedControls(), c = o ? " data-mint-rt-scroll-inner=\"\"" : "", l = "table-section" + (this._inMintCard ? " rounded-t-none" : ""), u = `m-0 min-h-0 w-full list-none border-collapse overflow-x-hidden bg-white ${this._inMintCard ? "px-3.5 py-3.5" : "py-3"} dark:bg-mint-canvas md:hidden`, d = "";
1165
+ if (t) {
1166
+ let e = this._renderColgroupHtml();
1167
+ i += `<div id="mint-rt-vscroll-${this._tableId}" class="overflow-y-auto overflow-x-auto min-h-0 w-full" style="max-height: ${a}; scrollbar-gutter: stable; overscroll-behavior-x: contain; overscroll-behavior-y: none; overflow-anchor: none;">`, i += "<div class=\"hidden min-h-0 min-w-0 md:block\">", i += `<mint-table class="${l}"${c}>`, i += `<table id="${this._tableId}" class="w-full min-w-0 table-fixed">`, i += e, i += this._renderTheadHtml(!0, !0, !0, s);
1168
+ } else i += "<div class=\"hidden min-h-0 min-w-0 md:block\">", i += `<mint-table class="${l}"${c}>`, i += `<table id="${this._tableId}">`, e && (i += this._renderColgroupHtml()), i += this._renderTheadHtml(!0, !0, !!e, s);
1169
+ if (i += "<tbody" + (e ? ` data-mint-rt-tbody="${this._tableId}"` : "") + ">", !this._fetching && !this._loading && !r && !e && n.forEach((e, t) => {
1170
+ d += this._buildMobileListItemHtml(e, t, void 0, t === n.length - 1);
1171
+ let r = typeof this._configuration.onRowClick == "function", a = r ? "cursor-pointer hover:bg-gray-50 dark:hover:bg-mint-elevated" : "";
1172
+ i += `<tr data-row-index="${t}" ${r ? "data-row-clickable=\"true\"" : ""}${a ? ` class="${a}"` : ""}>`, this._configuration.columns.forEach((n) => {
1173
+ if (n.hidden) return;
1174
+ let r = !n.show || n.show(this, e);
1175
+ i += `<td style="${this._getStyle(n)}" class="${this._getClasses(n, !0)}">`, r && (i += this._buildTableCellInnerHtml(n, e, t, "table")), i += "</td>";
1176
+ }), i += "</tr>";
1177
+ }), !this._fetching && !this._loading && !r && n.length === 0 && !e) if (this._fetchError) {
1178
+ let e = this._configuration.columns.filter((e) => !e.hidden).length;
1179
+ i += `<tr><td colspan="${e}" class="text-center py-8 text-red-500 dark:text-red-400">Failed to load data: ${this._escapeHtml(this._fetchError)}</td></tr>`, d += `<li class="list-none px-4 py-8 text-center text-sm text-red-500 dark:text-red-400">Failed to load data: ${this._escapeHtml(this._fetchError)}</li>`;
1180
+ } else {
1181
+ let e = this._configuration.columns.filter((e) => !e.hidden).length;
1182
+ i += `<tr><td colspan="${e}" class="text-center py-8">No records found.</td></tr>`, d += "<li class=\"list-none px-4 py-8 text-center text-sm\">No records found.</li>";
1183
+ }
1184
+ i += "</tbody>", i += "</table>", i += "</mint-table>", i += "</div>", i += `<ul class="${u}" data-mint-rt-mobile-list="${this._tableId}">${e ? "" : d}</ul>`, e || (i += this._paginationHostPlaceholderHtml()), t && (i += "</div>");
1185
+ } else i += "<slot name=\"empty\"></slot>";
1186
+ this._fixedHeader() ? this.setAttribute("data-mint-rt-fixed-header", "") : this.removeAttribute("data-mint-rt-fixed-header"), this._fixedControls() ? this.setAttribute("data-mint-rt-fixed-controls", "") : this.removeAttribute("data-mint-rt-fixed-controls"), this.innerHTML = i, this._replaceUtilityClasses(), this._updatePagination(), this.querySelectorAll("mint-button[data-action]").forEach((e) => {
1187
+ e.render && e.render();
1188
+ }), this.querySelectorAll("mint-button[data-mint-rt-toolbar]").forEach((e) => {
1189
+ e.render && e.render();
1190
+ }), this.querySelectorAll("mint-button[data-button-type]").forEach((e) => {
1191
+ e.render && e.render();
1192
+ }), this._attachEventListeners(), this._type === "ajax" && !this._loaded && !this._fetching && !this._loading && this._fetchData();
1193
+ }
1194
+ _attachRowClickHandler() {
1195
+ this._rowClickHandler && this.removeEventListener("click", this._rowClickHandler, !0);
1196
+ let e = (e) => {
1197
+ let t = e.target;
1198
+ if (t.tagName === "MINT-BUTTON" || t.tagName === "BUTTON" || t.closest("mint-button") || t.closest("button") || t.closest("mint-popover") || t.closest("[data-action]")) return;
1199
+ let n = t.closest("tr[data-row-clickable=\"true\"]") || t.closest("li[data-row-clickable=\"true\"]");
1200
+ if (!n) return;
1201
+ let r = n.getAttribute("data-row-index");
1202
+ if (!r) return;
1203
+ let i = parseInt(r), a = this._getRowDataForEventIndex(i);
1204
+ !a || !this._configuration?.onRowClick || (this._configuration.onRowClick.length === 1 ? this._configuration.onRowClick(a) : this._configuration.onRowClick(this, a));
1205
+ };
1206
+ this.addEventListener("click", e, !0), this._rowClickHandler = e;
1207
+ }
1208
+ _attachPaginationListeners() {
1209
+ this.querySelectorAll("[data-action=\"page\"]").forEach((e) => {
1210
+ e.addEventListener("click", () => {
1211
+ if (e.getAttribute("active") === "true") return;
1212
+ let t = parseInt(e.getAttribute("data-page") || "1");
1213
+ t !== this._currentPage && this._goToPage(t);
1214
+ });
1215
+ }), this.querySelectorAll("[data-action=\"page-prev\"]").forEach((e) => {
1216
+ e.addEventListener("click", () => {
1217
+ this._goToPage(this._currentPage - 1);
1218
+ });
1219
+ }), this.querySelectorAll("[data-action=\"page-next\"]").forEach((e) => {
1220
+ e.addEventListener("click", () => {
1221
+ this._goToPage(this._currentPage + 1);
1222
+ });
1223
+ });
1224
+ }
1225
+ _attachTableEventListeners() {
1226
+ this.querySelectorAll("[data-action=\"row-action\"]").forEach((e) => {
1227
+ e.addEventListener("click", () => {
1228
+ let t = parseInt(e.getAttribute("data-row-index") || "0"), n = parseInt(e.getAttribute("data-action-index") || "0"), r = parseInt(e.getAttribute("data-column-key") || "0"), i = this._getRowDataForEventIndex(t), a = this._configuration?.columns[r];
1229
+ a && a.actions && a.actions[n] && i !== void 0 && a.actions[n].onClick(this, i);
1230
+ });
1231
+ }), this.querySelectorAll("[data-action=\"column-action\"]").forEach((e) => {
1232
+ e.addEventListener("click", () => {
1233
+ let t = parseInt(e.getAttribute("data-row-index") || "0"), n = parseInt(e.getAttribute("data-column-key") || "0"), r = this._getRowDataForEventIndex(t), i = this._configuration?.columns[n];
1234
+ i && i.action && r !== void 0 && i.action.onClick(this, r);
1235
+ });
1236
+ });
1237
+ }
1238
+ _attachEventListeners() {
1239
+ let e = this.querySelector(`#search-${this._tableId}`);
1240
+ if (e) {
1241
+ let t = e.querySelector("input") || e._element;
1242
+ t ? t.addEventListener("input", (e) => {
1243
+ this._search = e.target.value, this._triggerSearch();
1244
+ }) : e.addEventListener("input", (t) => {
1245
+ this._search = e.value || t.target.value || "", this._triggerSearch();
1246
+ });
1247
+ }
1248
+ this._attachTableEventListeners(), this._attachRowClickHandler(), this.querySelectorAll("th[data-column-key]").forEach((e) => {
1249
+ e.addEventListener("click", () => {
1250
+ let t = parseInt(e.getAttribute("data-column-key") || "0"), n = this._configuration?.columns[t];
1251
+ n && this._toggleSort(n);
1252
+ });
1253
+ }), this.querySelectorAll("[data-action=\"mobile-sort\"]").forEach((e) => {
1254
+ e.addEventListener("click", (t) => {
1255
+ t.stopPropagation();
1256
+ let n = parseInt(e.getAttribute("data-column-key") || "0", 10), r = this._configuration?.columns[n];
1257
+ r && (this._closeMobileSortPopover(), this._toggleSort(r));
1258
+ });
1259
+ }), this.querySelectorAll("[data-button-type]").forEach((e) => {
1260
+ e.addEventListener("click", () => {
1261
+ let t = e.getAttribute("data-button-type"), n = this._configuration?.buttons?.find((e) => (e.type || "custom") === t);
1262
+ n && this._handleButtonClick(n);
1263
+ });
1264
+ }), this._attachPaginationListeners(), this._virtualScrollActive() && (this._type === "provided" || this._type === "ajax") && this._attachVirtualScrollListeners(), this._fixedHeader() && this._fixedControls() && queueMicrotask(() => {
1265
+ this._syncFixedControlsChromeHeight(), requestAnimationFrame(() => this._syncFixedControlsChromeHeight());
1266
+ });
1267
+ }
1268
+ _escapeHtml(e) {
1269
+ let t = document.createElement("div");
1270
+ return t.textContent = e, t.innerHTML;
1271
+ }
1272
+ _getPageFromUrl() {
1273
+ if (!this._tableId) return null;
1274
+ let e = new URLSearchParams(window.location.search).get(`mui.${this._tableId}`);
1275
+ if (!e) return null;
1276
+ let t = parseInt(e, 10);
1277
+ return isNaN(t) || t < 1 ? null : t;
1278
+ }
1279
+ _updatePageInUrl(e) {
1280
+ if (!this._tableId) return;
1281
+ let t = new URL(window.location.href), n = t.searchParams;
1282
+ n.set(`mui.${this._tableId}`, e.toString()), e === 1 && n.set(`mui.${this._tableId}`, "1"), window.history.replaceState({}, "", t.toString());
1283
+ }
1284
+ _loadPageFromUrl() {
1285
+ if (!this._configuration || !this._tableId) return;
1286
+ let e = this._getPageFromUrl();
1287
+ e !== null && (this._currentPage = e, this._offset = (this._currentPage - 1) * this._perPage);
1288
+ }
1289
+ };
1290
+ customElements.get("mint-resource-table") || e("mint-resource-table", n);
1291
+ //#endregion
1292
+ //#region src/components/resource-table/ResourceTableContextMenu.ts
1293
+ var r = 550, i = 12, a = { passive: !0 }, o = class extends HTMLElement {
1294
+ constructor(...e) {
1295
+ super(...e), this._table = null, this._anchor = null, this._popover = null, this._menuRoot = null, this._baseId = "", this._touchTimer = null, this._touchStart = null, this._slotObserver = null, this._scrollCloseTargets = [], this._onScrollClose = () => {
1296
+ this._closePopover();
1297
+ }, this._onContextMenu = (e) => {
1298
+ let t = e, n = this._rowTargetFromEventTarget(t.target);
1299
+ n && (t.preventDefault(), this._openAtRowIndex(n.index, t.clientX, t.clientY));
1300
+ }, this._onTouchStart = (e) => {
1301
+ let t = e;
1302
+ if (!t.touches.length) return;
1303
+ let n = this._rowTargetFromEventTarget(t.target);
1304
+ if (!n) return;
1305
+ let r = t.touches[0];
1306
+ this._touchStart = {
1307
+ x: r.clientX,
1308
+ y: r.clientY,
1309
+ rowIndex: n.index
1310
+ }, this._touchTimer !== null && (window.clearTimeout(this._touchTimer), this._touchTimer = null);
1311
+ let i = this._longPressMs();
1312
+ this._touchTimer = window.setTimeout(() => {
1313
+ this._touchTimer = null, this._touchStart &&= (this._openAtRowIndex(this._touchStart.rowIndex, this._touchStart.x, this._touchStart.y), null);
1314
+ }, i);
1315
+ }, this._onTouchMove = (e) => {
1316
+ if (!this._touchStart || this._touchTimer === null) return;
1317
+ let t = e.touches[0];
1318
+ if (!t) return;
1319
+ let n = t.clientX - this._touchStart.x, r = t.clientY - this._touchStart.y;
1320
+ n * n + r * r > i * i && (this._clearTouchTimer(), this._touchStart = null);
1321
+ }, this._onTouchEnd = () => {
1322
+ this._clearTouchTimer(), this._touchStart = null;
1323
+ };
1324
+ }
1325
+ static get observedAttributes() {
1326
+ return ["for", "long-press-ms"];
1327
+ }
1328
+ connectedCallback() {
1329
+ this.classList.add("contents"), this._baseId = this.id?.trim() || `mint-rt-ctx-${Math.random().toString(36).slice(2, 10)}`, this._anchor = document.createElement("div"), this._anchor.id = `${this._baseId}-anchor`, this._anchor.setAttribute("aria-hidden", "true"), this._anchor.className = "pointer-events-none fixed z-0 h-px w-px overflow-hidden p-0 m-0 border-0 opacity-0", document.body.appendChild(this._anchor), this._popover = document.createElement("mint-popover"), this._popover.setAttribute("data-mint-rt-ctx-internal", ""), this._popover.id = `${this._baseId}-popover`, this._popover.setAttribute("trigger-id", this._anchor.id), this._popover.setAttribute("direction", "down"), this._popover.setAttribute("padding", "0"), this._popover.setAttribute("distance", "6px"), this._menuRoot = document.createElement("div"), this._menuRoot.className = "flex min-w-[11rem] flex-col gap-0.5 py-1", this._popover.appendChild(this._menuRoot), this.appendChild(this._popover), this._slotObserver = new MutationObserver(() => {
1330
+ this._hideMenuSlotSources();
1331
+ }), this._slotObserver.observe(this, { childList: !0 }), queueMicrotask(() => {
1332
+ this._hideMenuSlotSources(), this._bindTable();
1333
+ });
1334
+ }
1335
+ disconnectedCallback() {
1336
+ this._slotObserver?.disconnect(), this._slotObserver = null, this._unbindTable(), this._anchor?.remove(), this._anchor = null, this._popover?.remove(), this._popover = null, this._menuRoot = null;
1337
+ }
1338
+ attributeChangedCallback() {
1339
+ this.isConnected && this._bindTable();
1340
+ }
1341
+ _longPressMs() {
1342
+ let e = parseInt(this.getAttribute("long-press-ms") || "", 10);
1343
+ return !Number.isNaN(e) && e > 100 ? e : r;
1344
+ }
1345
+ _resolveTable() {
1346
+ let e = this.getAttribute("for")?.trim();
1347
+ if (e) {
1348
+ let t = document.getElementById(e);
1349
+ return t && t.tagName === "MINT-RESOURCE-TABLE" ? t : null;
1350
+ }
1351
+ let t = this.previousElementSibling;
1352
+ return t && t.tagName === "MINT-RESOURCE-TABLE" ? t : this.parentElement?.querySelector?.("mint-resource-table") ?? null;
1353
+ }
1354
+ _hideMenuSlotSources() {
1355
+ for (let e of Array.from(this.children)) e === this._popover || e.hasAttribute("data-mint-rt-ctx-internal") || e.setAttribute("hidden", "");
1356
+ }
1357
+ _bindTable() {
1358
+ this._unbindTable(), this._table = this._resolveTable(), this._table && (this._table.addEventListener("contextmenu", this._onContextMenu, !0), this._table.addEventListener("touchstart", this._onTouchStart, { passive: !0 }), this._table.addEventListener("touchmove", this._onTouchMove, { passive: !0 }), this._table.addEventListener("touchend", this._onTouchEnd, { passive: !0 }), this._table.addEventListener("touchcancel", this._onTouchEnd, { passive: !0 }));
1359
+ }
1360
+ _unbindTable() {
1361
+ this._closePopover(), this._table &&= (this._table.removeEventListener("contextmenu", this._onContextMenu, !0), this._table.removeEventListener("touchstart", this._onTouchStart), this._table.removeEventListener("touchmove", this._onTouchMove), this._table.removeEventListener("touchend", this._onTouchEnd), this._table.removeEventListener("touchcancel", this._onTouchEnd), null);
1362
+ }
1363
+ _rowTargetFromEventTarget(e) {
1364
+ if (!e || !this._table) return null;
1365
+ let t = e.closest?.("tr[data-row-index], li[data-row-index]");
1366
+ if (!t || !this._table.contains(t) || t.hasAttribute("data-mint-rt-spacer") || t.getAttribute("data-mint-rt-placeholder") === "true") return null;
1367
+ let n = t.getAttribute("data-row-index");
1368
+ if (n == null) return null;
1369
+ let r = parseInt(n, 10);
1370
+ return Number.isNaN(r) ? null : { index: r };
1371
+ }
1372
+ _clearTouchTimer() {
1373
+ this._touchTimer !== null && (window.clearTimeout(this._touchTimer), this._touchTimer = null);
1374
+ }
1375
+ _positionAnchor(e, t) {
1376
+ this._anchor && (this._anchor.style.left = `${Math.round(e)}px`, this._anchor.style.top = `${Math.round(t)}px`);
1377
+ }
1378
+ _slotTemplateElements() {
1379
+ return Array.from(this.children).filter((e) => e !== this._popover && e instanceof HTMLElement && !e.hasAttribute("data-mint-rt-ctx-internal"));
1380
+ }
1381
+ _elementIsScrollContainer(e) {
1382
+ let t = getComputedStyle(e);
1383
+ return t.overflowX === "auto" || t.overflowX === "scroll" || t.overflowY === "auto" || t.overflowY === "scroll";
1384
+ }
1385
+ _collectScrollCloseTargets(e) {
1386
+ let t = [], n = /* @__PURE__ */ new Set(), r = (e) => {
1387
+ !e || n.has(e) || (n.add(e), t.push(e));
1388
+ };
1389
+ r(window), e.querySelectorAll("[id^=\"mint-rt-vscroll-\"]").forEach((e) => {
1390
+ this._elementIsScrollContainer(e) && r(e);
1391
+ });
1392
+ let i = e.querySelector("mint-table");
1393
+ for (; i && i !== e;) this._elementIsScrollContainer(i) && r(i), i = i.parentElement;
1394
+ return this._elementIsScrollContainer(e) && r(e), t;
1395
+ }
1396
+ _detachScrollCloseListeners() {
1397
+ for (let e of this._scrollCloseTargets) e.removeEventListener("scroll", this._onScrollClose, a);
1398
+ this._scrollCloseTargets = [];
1399
+ }
1400
+ _attachScrollCloseListeners(e) {
1401
+ this._detachScrollCloseListeners(), this._scrollCloseTargets = this._collectScrollCloseTargets(e);
1402
+ for (let e of this._scrollCloseTargets) e.addEventListener("scroll", this._onScrollClose, a);
1403
+ }
1404
+ _closePopover() {
1405
+ if (this._detachScrollCloseListeners(), !this._popover?.hasAttribute("open")) return;
1406
+ let e = this._popover;
1407
+ typeof e.close == "function" ? e.close() : this._popover.removeAttribute("open");
1408
+ }
1409
+ _openAtRowIndex(e, t, n) {
1410
+ this._closePopover();
1411
+ let r = this._resolveTable();
1412
+ if (!r || typeof r.getRowByIndex != "function" || !this._popover || !this._menuRoot) return;
1413
+ let i = this._popover, a = this._menuRoot, o = r.getRowByIndex(e);
1414
+ if (o === void 0) return;
1415
+ let s = this._slotTemplateElements();
1416
+ if (!s.length) return;
1417
+ this._positionAnchor(t, n), a.innerHTML = "", s.forEach((t) => {
1418
+ if (t.hasAttribute("data-mint-rt-ctx-if-selection") && !(window.getSelection?.()?.toString?.()?.trim() ?? "")) return;
1419
+ let n = t.cloneNode(!0);
1420
+ n.removeAttribute("hidden"), n.addEventListener("click", (t) => {
1421
+ t.stopPropagation();
1422
+ let r = n.getAttribute("data-context-action") || n.querySelector?.("[data-context-action]")?.getAttribute("data-context-action") || "", i = window.getSelection?.()?.toString?.()?.trim() ?? "";
1423
+ this.dispatchEvent(new CustomEvent("context-action", {
1424
+ bubbles: !0,
1425
+ composed: !0,
1426
+ detail: {
1427
+ action: r,
1428
+ row: o,
1429
+ rowIndex: e,
1430
+ selectedText: i
1431
+ }
1432
+ })), this._closePopover();
1433
+ }), a.appendChild(n);
1434
+ let r = n;
1435
+ typeof r.render == "function" && queueMicrotask(() => r.render());
1436
+ }), i.removeAttribute("open"), i.offsetHeight, i.setAttribute("open", "true");
1437
+ let c = i;
1438
+ typeof c.render == "function" && queueMicrotask(() => c.render());
1439
+ let l = this._resolveTable();
1440
+ l && this._attachScrollCloseListeners(l);
1441
+ }
1442
+ };
1443
+ customElements.get("mint-resource-table-context-menu") || e("mint-resource-table-context-menu", o);
1444
+ //#endregion
1445
+ export { n as default };