@vireo-ai/trellis-ui 0.1.49 → 0.1.51

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 (190) hide show
  1. package/package.json +1 -1
  2. package/packages/client/src/components/data-grid/styles.css +30 -9
  3. package/packages/client/src/components/field/styles.css +29 -3
  4. package/packages/client/src/components/import-flow/styles.css +20 -0
  5. package/packages/client/src/components/import-mapper/styles.css +8 -0
  6. package/packages/client/src/components/tabs/styles.css +1 -1
  7. package/packages/client/src/styles/components.css +2 -0
  8. package/packages/client/src/styles/generated/theme-fonts.css +1 -1
  9. package/packages/client/src/styles/generated/theme-palette.css +8 -1
  10. package/packages/client/src/styles/generated/theme-runtime.css +1 -1
  11. package/packages/client/src/styles/generated-sources.css +1 -1
  12. package/packages/client/src/styles/recipes/option.css +4 -0
  13. package/packages/client/types/assets/full-runtime.generated.d.ts +1 -1
  14. package/packages/client/types/components/data-grid/contract.d.ts +1 -0
  15. package/packages/client/types/components/data-grid/index.d.ts +3 -3
  16. package/packages/client/types/components/data-grid/model.d.ts +4 -2
  17. package/packages/client/types/components/date-picker/contract.d.ts +15 -6
  18. package/packages/client/types/components/date-picker/machine.d.ts +4 -2
  19. package/packages/client/types/components/entry.generated.d.ts +2 -0
  20. package/packages/client/types/components/formset/contract.d.ts +10 -0
  21. package/packages/client/types/components/formset/entry.generated.d.ts +5 -0
  22. package/packages/client/types/components/formset/index.d.ts +41 -0
  23. package/packages/client/types/components/formset/machine.d.ts +22 -0
  24. package/packages/client/types/components/formset/runtime-docs.d.ts +2 -0
  25. package/packages/client/types/components/heading/contract.d.ts +4 -2
  26. package/packages/client/types/components/import-flow/contract.d.ts +13 -0
  27. package/packages/client/types/components/import-flow/index.d.ts +2 -0
  28. package/packages/client/types/components/import-mapper/entry.generated.d.ts +5 -0
  29. package/packages/client/types/components/import-mapper/index.d.ts +25 -0
  30. package/packages/client/types/components/menu/contract.d.ts +2 -2
  31. package/packages/client/types/components/runtime.d.ts +2 -0
  32. package/packages/client/types/components/select/contract.d.ts +1 -0
  33. package/packages/client/types/components/select/machine.d.ts +3 -0
  34. package/packages/client/types/components/sidebar/contract.d.ts +8 -2
  35. package/packages/client/types/components/text/contract.d.ts +4 -2
  36. package/packages/client/types/components/virtualizer/index.d.ts +4 -1
  37. package/packages/client/types/motion/index.d.ts +1 -0
  38. package/packages/client/types/motion/registry.d.ts +2 -1
  39. package/packages/client/types/runtime/cursor-data-source.d.ts +19 -1
  40. package/packages/client/types/runtime/engine/stream.d.ts +1 -0
  41. package/packages/client/types/runtime/focus-handoff.d.ts +1 -0
  42. package/packages/client/types/runtime/virtualizer-schema.d.ts +1 -0
  43. package/packages/server/trellis_ui/static/trellis_ui/assets/css/trellis.css +111 -12
  44. package/packages/server/trellis_ui/static/trellis_ui/assets/css/trellis.min.css +1 -1
  45. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/build-metadata.json +458 -385
  46. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/capabilities/motion.js +1 -1
  47. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/capabilities/shortcut.js +1 -1
  48. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/capabilities/sortable.js +1 -1
  49. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{alpine-machine-BS13dbK4.js → alpine-machine-BTDXpEr6.js} +2 -2
  50. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{alpine-machine-BS13dbK4.js.map → alpine-machine-BTDXpEr6.js.map} +1 -1
  51. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/capability-motion-DRILCSFH.js +2 -0
  52. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{capability-motion-DoZROkFD.js.map → capability-motion-DRILCSFH.js.map} +1 -1
  53. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{capability-shortcut-BoDF_wQX.js → capability-shortcut-CGpfLNL-.js} +2 -2
  54. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{capability-shortcut-BoDF_wQX.js.map → capability-shortcut-CGpfLNL-.js.map} +1 -1
  55. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/capability-sortable-CpSdQwYp.js +3 -0
  56. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/capability-sortable-CpSdQwYp.js.map +1 -0
  57. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{controller-qWtZCkAC.js → controller-xDNH-xzt.js} +2 -2
  58. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{controller-qWtZCkAC.js.map → controller-xDNH-xzt.js.map} +1 -1
  59. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/core-DnQs1xY6.js +2 -0
  60. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{core-BgbZXaDN.js.map → core-DnQs1xY6.js.map} +1 -1
  61. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/cursor-data-source-5pQvlhmK.js +2 -0
  62. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/cursor-data-source-5pQvlhmK.js.map +1 -0
  63. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-B_e0djHK.js → entry.generated-2QEJDMe-.js} +2 -2
  64. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-B_e0djHK.js.map → entry.generated-2QEJDMe-.js.map} +1 -1
  65. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-CkBblBv9.js → entry.generated-AFRarPro.js} +2 -2
  66. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-CkBblBv9.js.map → entry.generated-AFRarPro.js.map} +1 -1
  67. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-D6qaa8bk.js → entry.generated-BB7wWQfT.js} +2 -2
  68. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-D6qaa8bk.js.map → entry.generated-BB7wWQfT.js.map} +1 -1
  69. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-BiyFgA-e.js +2 -0
  70. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-BiyFgA-e.js.map +1 -0
  71. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-f6HGqvQY.js → entry.generated-BqEMECZx.js} +2 -2
  72. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-f6HGqvQY.js.map → entry.generated-BqEMECZx.js.map} +1 -1
  73. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-C07Tn0r-.js +2 -0
  74. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-C07Tn0r-.js.map +1 -0
  75. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-CZWpqP88.js → entry.generated-C2gP0OfV.js} +2 -2
  76. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-CZWpqP88.js.map → entry.generated-C2gP0OfV.js.map} +1 -1
  77. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-CPzThz_M.js +2 -0
  78. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-CPzThz_M.js.map +1 -0
  79. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-CRj4-Ef1.js +2 -0
  80. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-CRj4-Ef1.js.map +1 -0
  81. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-CeD3bUBI.js +2 -0
  82. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-CeD3bUBI.js.map +1 -0
  83. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-Cj1CmH13.js → entry.generated-CirM6w9Q.js} +2 -2
  84. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-Cj1CmH13.js.map → entry.generated-CirM6w9Q.js.map} +1 -1
  85. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-CRhvZ0DI.js → entry.generated-D3am_GtI.js} +2 -2
  86. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-CRhvZ0DI.js.map → entry.generated-D3am_GtI.js.map} +1 -1
  87. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-D7qa64eM.js +2 -0
  88. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-ZcYuKSSI.js.map → entry.generated-D7qa64eM.js.map} +1 -1
  89. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-D_FlEfdN.js +2 -0
  90. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-D_FlEfdN.js.map +1 -0
  91. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-DbC4gkeV.js +2 -0
  92. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-DbC4gkeV.js.map +1 -0
  93. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-dyQ_HJ8D.js → entry.generated-DwYIFLsE.js} +2 -2
  94. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-dyQ_HJ8D.js.map → entry.generated-DwYIFLsE.js.map} +1 -1
  95. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry2.generated-QspMEPHx.js → entry.generated-QspMEPHx.js} +1 -1
  96. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-QspMEPHx.js.map +1 -0
  97. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-B_q7LVNv.js → entry.generated-TbFjT_mY.js} +2 -2
  98. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-B_q7LVNv.js.map → entry.generated-TbFjT_mY.js.map} +1 -1
  99. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-BhtgeSTa.js → entry.generated-cnWgB3wz.js} +2 -2
  100. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-BhtgeSTa.js.map → entry.generated-cnWgB3wz.js.map} +1 -1
  101. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry2.generated-CPbvsglm.js → entry.generated-gxr2-89M.js} +2 -2
  102. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-gxr2-89M.js.map +1 -0
  103. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-Cekl4pYo.js → entry.generated-wEt8LYAv.js} +2 -2
  104. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-Cekl4pYo.js.map → entry.generated-wEt8LYAv.js.map} +1 -1
  105. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry2.generated-BSal0xp9.js +2 -0
  106. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry2.generated-BSal0xp9.js.map +1 -0
  107. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry2.generated-D26Cigu5.js +2 -0
  108. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry2.generated-D26Cigu5.js.map +1 -0
  109. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry2.generated-DCbmWkHV.js +2 -0
  110. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry2.generated-DCbmWkHV.js.map +1 -0
  111. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry2.generated-JcxejQr4.js +2 -0
  112. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry2.generated-JcxejQr4.js.map +1 -0
  113. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/focus-handoff-BE3g0swK.js +2 -0
  114. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/focus-handoff-BE3g0swK.js.map +1 -0
  115. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{form-control-BkVb2Qed.js → form-control-DjbUb602.js} +2 -2
  116. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/form-control-DjbUb602.js.map +1 -0
  117. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/morph-Cq3V_23_.js +2 -0
  118. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/morph-Cq3V_23_.js.map +1 -0
  119. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/motion-B4uuk1JX.js +3 -0
  120. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{motion-BQk-uLaI.js.map → motion-B4uuk1JX.js.map} +1 -1
  121. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{semantic-observer-BUswpsNx.js → semantic-observer-CdRbZHir.js} +2 -2
  122. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{semantic-observer-BUswpsNx.js.map → semantic-observer-CdRbZHir.js.map} +1 -1
  123. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/ui-FOJhyz8V.js +4 -0
  124. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/ui-FOJhyz8V.js.map +1 -0
  125. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/accordion.js +1 -1
  126. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/checkbox.js +1 -1
  127. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/data-grid.js +1 -1
  128. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/date-picker.js +1 -1
  129. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/direct-upload.js +1 -1
  130. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/dropdown.js +1 -1
  131. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/field.js +1 -1
  132. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/file-upload.js +1 -1
  133. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/formset.js +1 -0
  134. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/import-mapper.js +1 -0
  135. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/index.js +1 -1
  136. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/index.js.map +1 -1
  137. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/input.js +1 -1
  138. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/keybinding.js +1 -1
  139. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/modal.js +1 -1
  140. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/panels.js +1 -1
  141. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/radio.js +1 -1
  142. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/scroll-area.js +1 -1
  143. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/select.js +1 -1
  144. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/sidebar.js +1 -1
  145. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/slider.js +1 -1
  146. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/switch.js +1 -1
  147. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/table.js +1 -1
  148. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/tabs.js +1 -1
  149. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/toast.js +1 -1
  150. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/tooltip.js +1 -1
  151. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/virtualizer.js +1 -1
  152. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/core.js +1 -1
  153. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/index.js +1 -1
  154. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/index.js.map +1 -1
  155. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/logical-entry-manifest.json +225 -182
  156. package/packages/server/trellis_ui/static/trellis_ui/assets/js/trellis.js +9 -9
  157. package/packages/server/trellis_ui/static/trellis_ui/assets/js/trellis.min.js +9 -9
  158. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/capability-motion-DoZROkFD.js +0 -2
  159. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/capability-sortable-DtSghTO8.js +0 -3
  160. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/capability-sortable-DtSghTO8.js.map +0 -1
  161. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/core-BgbZXaDN.js +0 -2
  162. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-1meMFJbq.js +0 -2
  163. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-1meMFJbq.js.map +0 -1
  164. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-B-wVMxe6.js +0 -2
  165. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-B-wVMxe6.js.map +0 -1
  166. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-BYDBzadH.js +0 -2
  167. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-BYDBzadH.js.map +0 -1
  168. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-CJuVLJw9.js +0 -2
  169. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-CJuVLJw9.js.map +0 -1
  170. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-CQGhCt9y.js +0 -2
  171. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-CQGhCt9y.js.map +0 -1
  172. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-Des-gEaR.js +0 -2
  173. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-Des-gEaR.js.map +0 -1
  174. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-OqzkZfIu.js +0 -2
  175. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-OqzkZfIu.js.map +0 -1
  176. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-ZcYuKSSI.js +0 -2
  177. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-u0Ueamvw.js +0 -2
  178. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-u0Ueamvw.js.map +0 -1
  179. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry2.generated-CPbvsglm.js.map +0 -1
  180. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry2.generated-Dzq4GSqn.js +0 -2
  181. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry2.generated-Dzq4GSqn.js.map +0 -1
  182. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry2.generated-QspMEPHx.js.map +0 -1
  183. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/focus-handoff-DzEyK-Fp.js +0 -2
  184. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/focus-handoff-DzEyK-Fp.js.map +0 -1
  185. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/form-control-BkVb2Qed.js.map +0 -1
  186. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/motion-BQk-uLaI.js +0 -3
  187. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/ui-DuGUQhxd.js +0 -4
  188. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/ui-DuGUQhxd.js.map +0 -1
  189. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/virtualizer-CSk2RJEN.js +0 -2
  190. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/virtualizer-CSk2RJEN.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entry2.generated-BSal0xp9.js","names":[],"sources":["../../../../../../../../client/src/components/tooltip/contract.ts","../../../../../../../../client/src/components/tooltip/machine.ts","../../../../../../../../client/src/components/tooltip/styles.ts","../../../../../../../../client/src/components/tooltip/index.ts","../../../../../../../../client/src/components/tooltip/entry.generated.ts"],"sourcesContent":["import {attribute, bool, number, oneOf, string, type SchemaToProps} from '../../runtime';\nimport {\n ALIGNMENTS,\n ELEVATION_REFERENCES,\n POSITIONS,\n SURFACE_REFERENCES,\n type Alignment,\n type ElevationReference,\n type Position,\n type SurfaceReference,\n} from '../common';\n\nconst TOOLTIP_COLORS = ['neutral', 'accent', 'success', 'warning', 'danger'] as const;\nconst TOOLTIP_VARIANTS = ['surface', 'soft', 'solid'] as const;\n\nconst tooltipSchema = {\n side: oneOf(POSITIONS, 'bottom' as Position),\n align: oneOf(ALIGNMENTS, 'center' as Alignment),\n offset: number.clamp(-100, 100).default(0),\n gap: number.clamp(0, 50).default(8),\n openDelay: number.clamp(0, 5000).default(400),\n closeDelay: number.clamp(0, 5000).default(150),\n color: oneOf(TOOLTIP_COLORS, 'neutral'),\n variant: oneOf(TOOLTIP_VARIANTS, 'surface'),\n surface: oneOf(SURFACE_REFERENCES, '2' as SurfaceReference),\n elevation: oneOf(ELEVATION_REFERENCES, '4' as ElevationReference),\n disabled: bool,\n class: string,\n};\n\nconst tooltipDirectiveSchema = {\n side: attribute(tooltipSchema.side, 'ui-tooltip-side'),\n align: attribute(tooltipSchema.align, 'ui-tooltip-align'),\n offset: attribute(tooltipSchema.offset, 'ui-tooltip-offset'),\n gap: attribute(tooltipSchema.gap, 'ui-tooltip-gap'),\n openDelay: attribute(tooltipSchema.openDelay, 'ui-tooltip-open-delay'),\n closeDelay: attribute(tooltipSchema.closeDelay, 'ui-tooltip-close-delay'),\n color: attribute(tooltipSchema.color, 'ui-tooltip-color'),\n variant: attribute(tooltipSchema.variant, 'ui-tooltip-variant'),\n surface: attribute(tooltipSchema.surface, 'ui-tooltip-surface'),\n elevation: attribute(tooltipSchema.elevation, 'ui-tooltip-elevation'),\n disabled: attribute(tooltipSchema.disabled, 'ui-tooltip-disabled'),\n};\n\ntype TooltipProps = SchemaToProps<typeof tooltipSchema>;\ntype TooltipDirectiveProps = SchemaToProps<typeof tooltipDirectiveSchema>;\ntype TooltipColor = typeof TOOLTIP_COLORS[number];\ntype TooltipVariant = typeof TOOLTIP_VARIANTS[number];\n\nexport {\n TOOLTIP_COLORS,\n TOOLTIP_VARIANTS,\n tooltipDirectiveSchema,\n tooltipSchema,\n};\nexport type {TooltipColor, TooltipDirectiveProps, TooltipProps, TooltipVariant};\n","import {createMachine, type Machine, type MachineEventObject} from '../../runtime/state-machine';\nimport {defineHook, type TransitionHookDefinition} from '../../runtime/transition-coordinator';\nimport type {TooltipProps} from './contract';\n\ntype TooltipReason = 'pointer' | 'focus' | 'escape' | 'activation' | 'scroll' | 'blur' | 'disabled' | 'replacement';\ntype TooltipContext = {transition: {reason: TooltipReason; instant: boolean}};\ntype TooltipTransitionData = {reason: TooltipReason; instant: boolean};\ntype TooltipMachineEffects = {\n prepareOpen(): void;\n finishOpen(): void;\n prepareClose(): void;\n finishClose(): void;\n syncProps(): void;\n};\n\nconst transitionData = ({context}: {context: TooltipContext}): TooltipTransitionData => context.transition;\nconst openingHook = defineHook({\n name: 'opening', state: 'opening', project: transitionData, onDone: 'OPENING_DONE', onError: 'OPENING_ERROR',\n} satisfies TransitionHookDefinition<TooltipContext, TooltipProps, TooltipTransitionData, 'opening'>);\nconst closingHook = defineHook({\n name: 'closing', state: 'closing', project: transitionData, onDone: 'CLOSING_DONE', onError: 'CLOSING_ERROR',\n} satisfies TransitionHookDefinition<TooltipContext, TooltipProps, TooltipTransitionData, 'closing'>);\nconst tooltipHooks = [openingHook, closingHook] as const;\n\nconst reasonFrom = (event: MachineEventObject): TooltipReason => {\n const reason = event.reason;\n return reason === 'focus' || reason === 'escape' || reason === 'activation' || reason === 'scroll'\n || reason === 'blur' || reason === 'disabled' || reason === 'replacement' ? reason : 'pointer';\n};\n\nconst createTooltipMachine = (\n props: TooltipProps,\n effects: TooltipMachineEffects,\n): Machine<TooltipContext, TooltipProps> => createMachine<TooltipContext, TooltipProps>({\n initial: 'closed',\n states: {\n closed: {tags: ['closed'], on: {\n OPEN: {target: 'opening', guard: 'canOpen', reduce: 'transition', effects: 'prepareOpen'},\n PROPS_CHANGED: {reduce: 'replaceProps', effects: 'syncProps'},\n }},\n opening: {tags: ['visible', 'expanded', 'transitioning'], on: {\n OPENING_DONE: {target: 'open', effects: 'finishOpen'},\n OPENING_ERROR: {target: 'open', effects: 'finishOpen'},\n CLOSE: {target: 'closing', reduce: 'transition', effects: 'prepareClose'},\n PROPS_CHANGED: [\n {target: 'closing', guard: 'becomesDisabled', reduce: 'replacePropsDisabled', effects: ['syncProps', 'prepareClose']},\n {reduce: 'replaceProps', effects: 'syncProps'},\n ],\n }},\n open: {tags: ['visible', 'expanded', 'open'], on: {\n CLOSE: {target: 'closing', reduce: 'transition', effects: 'prepareClose'},\n PROPS_CHANGED: [\n {target: 'closing', guard: 'becomesDisabled', reduce: 'replacePropsDisabled', effects: ['syncProps', 'prepareClose']},\n {reduce: 'replaceProps', effects: 'syncProps'},\n ],\n }},\n closing: {tags: ['visible', 'transitioning'], on: {\n CLOSING_DONE: {target: 'closed', effects: 'finishClose'},\n CLOSING_ERROR: {target: 'closed', effects: 'finishClose'},\n OPEN: {target: 'opening', guard: 'canOpen', reduce: 'transition', effects: 'prepareOpen'},\n PROPS_CHANGED: {reduce: 'replaceProps', effects: 'syncProps'},\n }},\n },\n}, {\n context: {transition: {reason: 'pointer', instant: false}},\n props,\n reducers: {\n transition: ({context, props: currentProps, event}) => ({\n context: {transition: {reason: reasonFrom(event), instant: event.instant === true}},\n props: currentProps,\n }),\n replaceProps: ({context, props: currentProps, event}) => ({\n context,\n props: (event.props as TooltipProps | undefined) ?? currentProps,\n }),\n replacePropsDisabled: ({context, props: currentProps, event}) => ({\n context: {transition: {reason: 'disabled', instant: true}},\n props: (event.props as TooltipProps | undefined) ?? currentProps,\n }),\n },\n guards: {\n canOpen: ({props: currentProps}) => !currentProps.disabled,\n becomesDisabled: ({event}) => (event.props as TooltipProps | undefined)?.disabled === true,\n },\n effects,\n});\n\nexport {createTooltipMachine, tooltipHooks};\nexport type {TooltipContext, TooltipMachineEffects, TooltipReason, TooltipTransitionData};\n","import {defineStyles} from '../../runtime';\nimport {POPOVER_GEOMETRY_CLASSES} from '../common';\n\nconst tooltipStyles = defineStyles({definition: {\n component: 'ui.tooltip',\n parts: {\n root: {base: 'contents'},\n content: {\n base: [\n POPOVER_GEOMETRY_CLASSES,\n 'pointer-events-auto min-h-control-md max-w-72 auto-cols-max grid-flow-col items-center gap-2 rounded-overlay-sm px-2 py-1',\n 'font-body text-1 [font-weight:var(--font-weight-normal)]',\n 'data-[state=closed]:pointer-events-none data-[state=closed]:opacity-0',\n ],\n variants: {\n color: {neutral: '', accent: '', success: '', warning: '', danger: ''},\n variant: {surface: '', soft: '', solid: ''},\n },\n defaults: {color: 'neutral', variant: 'surface'},\n },\n shortcut: {base: 'ml-1 inline-flex items-center gap-1 text-[var(--ui-semantic-surface-ink-muted)]'},\n },\n}});\n\nexport {tooltipStyles};\n","import type Alpine from 'alpinejs';\n\nimport {\n createAlpineMachine,\n defineAlpineData,\n type SchemaToProps,\n type TransitionForHook,\n type TrellisAlpineComponent,\n} from '@client/runtime';\nimport {createAnchoredPopoverSurface, type AnchoredPopoverSurface} from '@client/runtime/anchored-popover';\nimport type {CodecFn} from '@client/runtime/codecs';\nimport {mergeBindings, type BindingObject} from '@client/runtime/merge-bindings';\nimport {declareMorphAttributes} from '@client/runtime/morph';\nimport {observeSemanticChanges} from '@client/runtime/semantic-observer';\nimport {resolveStyle} from '@client/runtime/styles';\nimport {addListener, dispatch, type CleanupStack} from '@client/utils';\nimport {createKeybindingController} from '../keybinding/controller';\nimport {keybindingStyles} from '../keybinding/styles';\nimport {\n tooltipDirectiveSchema,\n type TooltipDirectiveProps,\n type TooltipProps,\n tooltipSchema,\n} from './contract';\nimport {\n createTooltipMachine,\n tooltipHooks,\n type TooltipContext,\n type TooltipReason,\n} from './machine';\nimport {tooltipStyles} from './styles';\n\ntype TooltipTransitionName = (typeof tooltipHooks)[number]['name'];\ntype TooltipTransition<TName extends TooltipTransitionName = TooltipTransitionName> = TransitionForHook<\n Extract<(typeof tooltipHooks)[number], {name: TName}>,\n HTMLElement\n>;\ntype PopoverElement = HTMLElement & {showPopover(): void; hidePopover(): void};\ntype TooltipSchema = Record<string, CodecFn<unknown>>;\ntype TooltipBridge = ReturnType<typeof createAlpineMachine<TooltipContext, typeof tooltipSchema, typeof tooltipHooks>>;\n\ntype TooltipController = {\n bridge: TooltipBridge;\n connect(snapshot?: {current: TooltipBridge['snapshot']['current']}): void;\n destroy(): void;\n sync(): void;\n close(reason: TooltipReason, instant?: boolean): void;\n};\n\ntype TooltipWarmStore = {active: TooltipController | null};\nconst warmStores = new WeakMap<Document, TooltipWarmStore>();\nconst warmStore = (document: Document): TooltipWarmStore => {\n let store = warmStores.get(document);\n if (!store) {\n store = {active: null};\n warmStores.set(document, store);\n }\n return store;\n};\n\nconst appendDescription = (trigger: HTMLElement, id: string): void => {\n const tokens = new Set((trigger.getAttribute('aria-describedby') ?? '').split(/\\s+/).filter(Boolean));\n tokens.add(id);\n trigger.setAttribute('aria-describedby', [...tokens].join(' '));\n};\n\nconst removeDescription = (trigger: HTMLElement, id: string): void => {\n const tokens = (trigger.getAttribute('aria-describedby') ?? '').split(/\\s+/).filter((token) => token && token !== id);\n if (tokens.length) trigger.setAttribute('aria-describedby', tokens.join(' '));\n else trigger.removeAttribute('aria-describedby');\n};\n\nconst createTooltipController = <TSchema extends TooltipSchema>({\n owner,\n trigger,\n content,\n schema,\n syncShortcut,\n}: {\n owner: () => HTMLElement & Alpine.ElementWithXAttributes;\n trigger: () => HTMLElement;\n content: () => PopoverElement;\n schema: TSchema;\n syncShortcut?: (value: string) => void;\n}): TooltipController => {\n let cleanup: CleanupStack = [];\n let popover: AnchoredPopoverSurface | null = null;\n let openTimer: ReturnType<typeof setTimeout> | null = null;\n let closeTimer: ReturnType<typeof setTimeout> | null = null;\n let describedById = '';\n let pointerOnTrigger = false;\n let pointerOnContent = false;\n\n const clearTimer = (timer: 'open' | 'close'): void => {\n const current = timer === 'open' ? openTimer : closeTimer;\n if (current !== null) clearTimeout(current);\n if (timer === 'open') openTimer = null;\n else closeTimer = null;\n };\n const props = (): Readonly<TooltipProps> => bridge.getSnapshot().props as TooltipProps;\n const visible = (): boolean => bridge.hasTag('visible');\n const syncSurface = (): void => {\n const value = props();\n const surface = content();\n surface.dataset.state = bridge.hasTag('expanded') ? 'open' : 'closed';\n surface.setAttribute('data-ui-semantic-surface', '');\n surface.dataset.color = value.color;\n surface.dataset.variant = value.variant;\n surface.dataset.uiSurface = value.surface;\n surface.dataset.uiElevation = value.elevation;\n surface.className = resolveStyle({\n part: tooltipStyles.parts.content,\n props: value,\n className: surface.dataset.class,\n });\n syncShortcut?.(trigger().dataset.uiTooltipShortcut ?? '');\n popover?.sync();\n };\n const finishClose = (): void => {\n popover?.close();\n content().hidden = true;\n syncSurface();\n const store = warmStore(owner().ownerDocument);\n if (store.active === controller) store.active = null;\n dispatch({el: owner(), name: 'ui:close'});\n };\n const effects = {\n prepareOpen(): void {\n content().hidden = false;\n popover?.open();\n syncSurface();\n },\n finishOpen(): void {\n syncSurface();\n dispatch({el: owner(), name: 'ui:open'});\n },\n prepareClose(): void { syncSurface(); },\n finishClose,\n syncProps(): void {\n syncSurface();\n if (props().disabled && visible()) controller.close('disabled', true);\n },\n };\n const machineBridge = createAlpineMachine({\n schema,\n hooks: tooltipHooks,\n createMachine: ({props: machineProps}) => createTooltipMachine(machineProps as TooltipProps, effects) as never,\n });\n const bridge = machineBridge as unknown as TooltipBridge;\n\n const open = (reason: TooltipReason, instant = false): void => {\n clearTimer('open');\n clearTimer('close');\n if (props().disabled || bridge.hasTag('expanded')) return;\n const store = warmStore(owner().ownerDocument);\n const warm = store.active !== null && store.active !== controller;\n if (store.active && store.active !== controller) store.active.close('replacement', true);\n store.active = controller;\n bridge.send({type: 'OPEN', reason, instant: instant || warm});\n };\n const close = (reason: TooltipReason, instant = false): void => {\n clearTimer('open');\n clearTimer('close');\n if (!visible()) return;\n bridge.send({type: 'CLOSE', reason, instant});\n };\n const scheduleOpen = (): void => {\n clearTimer('close');\n if (visible() || props().disabled) return;\n const delay = warmStore(owner().ownerDocument).active ? 0 : props().openDelay;\n clearTimer('open');\n openTimer = setTimeout(() => open('pointer', delay === 0), delay);\n };\n const scheduleClose = (): void => {\n clearTimer('open');\n if (!visible()) return;\n clearTimer('close');\n closeTimer = setTimeout(() => close('pointer'), props().closeDelay);\n };\n\n const controller: TooltipController = {\n bridge,\n connect(snapshot): void {\n bridge.connect(owner(), snapshot);\n describedById = content().id || `ui-tooltip-${crypto.randomUUID()}`;\n content().id = describedById;\n content().setAttribute('role', 'tooltip');\n content().setAttribute('popover', 'manual');\n content().setAttribute('data-ui-tooltip-content', '');\n content().hidden = true;\n trigger().setAttribute('data-ui-tooltip-trigger', '');\n appendDescription(trigger(), describedById);\n declareMorphAttributes(\n trigger(),\n 'aria-describedby',\n 'data-ui-tooltip-trigger',\n );\n popover = createAnchoredPopoverSurface({\n reference: trigger,\n floating: content,\n position: () => props().side,\n align: () => props().align,\n gap: () => props().gap,\n offset: () => props().offset,\n });\n syncSurface();\n cleanup = [\n addListener({target: trigger(), event: 'pointerenter', handler: () => {\n pointerOnTrigger = true;\n scheduleOpen();\n }}),\n addListener({target: trigger(), event: 'pointermove', handler: scheduleOpen}),\n addListener({target: trigger(), event: 'pointerleave', handler: () => {\n pointerOnTrigger = false;\n if (!pointerOnContent) scheduleClose();\n }}),\n addListener({target: content(), event: 'pointerenter', handler: () => {\n pointerOnContent = true;\n clearTimer('close');\n }}),\n addListener({target: content(), event: 'pointerleave', handler: () => {\n pointerOnContent = false;\n if (!pointerOnTrigger) scheduleClose();\n }}),\n addListener({target: trigger(), event: 'focusin', handler: () => open('focus', true)}),\n addListener({target: trigger(), event: 'focusout', handler: () => {\n if (!pointerOnTrigger && !pointerOnContent) close('blur', true);\n }}),\n addListener({target: trigger(), event: 'pointerdown', handler: () => close('activation', true)}),\n addListener({target: trigger(), event: 'click', handler: () => close('activation', true)}),\n addListener({target: owner().ownerDocument, event: 'keydown', handler: (event) => {\n if (event instanceof KeyboardEvent && event.key === 'Escape' && visible()) close('escape', true);\n }}),\n addListener({target: owner().ownerDocument, event: 'scroll', options: {capture: true}, handler: () => {\n if (visible()) close('scroll', true);\n }}),\n observeSemanticChanges({\n targets: trigger(),\n read: () => trigger().dataset.uiTooltipShortcut ?? '',\n onChange: syncSurface,\n observer: {attributes: true, attributeFilter: ['data-ui-tooltip-shortcut']},\n }),\n ];\n },\n close,\n sync: syncSurface,\n destroy(): void {\n clearTimer('open');\n clearTimer('close');\n cleanup.forEach((dispose) => dispose());\n cleanup = [];\n const store = warmStore(owner().ownerDocument);\n if (store.active === controller) store.active = null;\n popover?.destroy();\n popover = null;\n removeDescription(trigger(), describedById);\n trigger().removeAttribute('data-ui-tooltip-trigger');\n bridge.disconnect();\n },\n };\n return controller;\n};\n\ntype TooltipData = TooltipBridge & {\n readonly root: BindingObject;\n readonly content: BindingObject;\n init(): void;\n destroy(): void;\n};\n\nconst UiTooltip = (): TrellisAlpineComponent<TooltipData> => {\n let rootEl: (HTMLElement & Alpine.ElementWithXAttributes) | null = null;\n let controller: TooltipController | null = null;\n const root = (): HTMLElement & Alpine.ElementWithXAttributes => {\n if (!rootEl) throw new Error('Tooltip has not been initialized.');\n return rootEl;\n };\n const content = (): PopoverElement => {\n const el = root().querySelector<HTMLElement>(':scope > [data-ui-tooltip-content]');\n if (!(el instanceof HTMLElement)) throw new Error('Tooltip requires ui.tooltip.content.');\n return el as PopoverElement;\n };\n const trigger = (): HTMLElement => {\n const el = Array.from(root().children).find((child) => child instanceof HTMLElement && child !== content());\n if (!(el instanceof HTMLElement)) throw new Error('Tooltip requires an interactive trigger before its content.');\n return el;\n };\n const bridge = createAlpineMachine({\n schema: tooltipSchema,\n hooks: tooltipHooks,\n createMachine: ({props}) => createTooltipMachine(props, {\n prepareOpen() {}, finishOpen() {}, prepareClose() {}, finishClose() {}, syncProps() {},\n }),\n }) as TooltipBridge;\n const component: TrellisAlpineComponent<TooltipData> = {\n ...bridge,\n init(): void {\n rootEl = this.$el;\n controller = createTooltipController({owner: root, trigger, content, schema: tooltipSchema});\n controller.connect(this.snapshot);\n },\n destroy(): void {\n controller?.destroy();\n controller = null;\n rootEl = null;\n },\n get root(): BindingObject {\n return mergeBindings({inputs: [\n resolveStyle({part: tooltipStyles.parts.root, props: this.snapshot.current?.props ?? {}}),\n {'data-ui-tooltip-root': ''},\n ]});\n },\n get content(): BindingObject {\n return {'data-ui-tooltip-content': ''};\n },\n };\n return component;\n};\n\nconst registerTooltipDirective = (AlpineInstance: Alpine.Alpine): void => {\n AlpineInstance.addInitSelector(() => '[x-ui-tooltip]');\n AlpineInstance.directive('ui-tooltip', AlpineInstance.skipDuringClone((el, {expression}, utilities) => {\n if (!(el instanceof HTMLElement)) return;\n const content = el.ownerDocument.createElement('div') as PopoverElement;\n const label = el.ownerDocument.createElement('span');\n label.setAttribute('data-ui-tooltip-label', '');\n content.append(label);\n const shortcut = el.ownerDocument.createElement('span');\n shortcut.setAttribute('data-ui-keybinding', '');\n shortcut.setAttribute('aria-hidden', 'true');\n shortcut.className = resolveStyle({\n part: keybindingStyles.parts.root,\n className: resolveStyle({part: tooltipStyles.parts.shortcut}),\n });\n content.append(shortcut);\n const keybinding = createKeybindingController(shortcut);\n el.insertAdjacentElement('afterend', content);\n const owner = () => el as HTMLElement & Alpine.ElementWithXAttributes;\n const controller = createTooltipController({\n owner,\n trigger: () => el,\n content: () => content,\n schema: tooltipDirectiveSchema,\n syncShortcut: (value) => keybinding.setValue(value),\n });\n controller.connect();\n declareMorphAttributes(el, 'data-ui-tooltip-disabled', 'data-ui-tooltip-shortcut');\n const evaluator = utilities.evaluateLater(expression);\n utilities.effect(() => evaluator((value) => {\n const text = typeof value === 'string' ? value.trim() : '';\n label.textContent = text;\n el.toggleAttribute('data-ui-tooltip-disabled', !text);\n controller.sync();\n }));\n utilities.cleanup(() => {\n controller.destroy();\n keybinding.destroy();\n content.remove();\n });\n })).before('ui-transition');\n};\n\nconst registerTooltip = (AlpineInstance: Alpine.Alpine): void => {\n defineAlpineData('UiTooltip', UiTooltip)(AlpineInstance);\n registerTooltipDirective(AlpineInstance);\n};\n\nexport {registerTooltip, registerTooltipDirective, UiTooltip};\nexport type {TooltipData, TooltipDirectiveProps, TooltipTransition};\n","// Generated by scripts/generate_component_entries.mjs from packages/client/component-entries.json.\n// Do not edit by hand.\nimport type {Alpine as AlpineType} from 'alpinejs';\nimport {registerMotionCapability} from '../../capabilities/motion';\nimport {registerShortcutCapability} from '../../capabilities/shortcut';\nimport {registerTooltip as registerComponent} from './index';\n\nconst registered = new WeakSet<AlpineType>();\n\nconst registerTooltip = (AlpineInstance: AlpineType): void => {\n if (registered.has(AlpineInstance)) return;\n registered.add(AlpineInstance);\n registerMotionCapability(AlpineInstance);\n registerShortcutCapability(AlpineInstance);\n registerComponent(AlpineInstance);\n};\n\nexport {registerTooltip};\nexport default registerTooltip;\nexport * from './index';\n"],"mappings":"gtBAeA,IAAM,EAAgB,CAClB,KAAM,EAAM,EAAW,QAAoB,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3V_23_.js";import{t as r}from"./capability-motion-DRILCSFH.js";import{a as i,f as a,l as o,n as s}from"./codecs-Cb1ns_47.js";import{i as ee,r as c,s as l,t as te}from"./dom-qAeVl7dc.js";import{i as u,t as ne}from"./alpine-machine-BTDXpEr6.js";import{t as d}from"./alpine-data-CytyCyfk.js";import{n as f,t as p}from"./styles-TfvwVPGw.js";import{t as m}from"./merge-bindings-C8ewA_FD.js";import{t as h}from"./machine-Dqut4h89.js";import{i as re}from"./focus-scope-DtaPVNl5.js";import{t as ie}from"./semantic-observer-CdRbZHir.js";import{t as ae}from"./drag-and-drop-DHq3udf7.js";import{t as g}from"./capability-resizable-Bga8TngJ.js";var _=(e,t)=>{let n=getComputedStyle(e).getPropertyValue(`--breakpoint-${t}`),r=Number.parseFloat(n);return Number.isFinite(r)?r:1/0},v=[`horizontal`,`vertical`],y=[`div`,`section`,`aside`,`main`,`nav`],b=[`1`,`2`,`3`,`4`,`5`,`6`,`fill`],x=[`none`,`start`,`end`],S=[`toggle`,`expand`,`collapse`],oe={id:a.default(`ui-panels`),orientation:o(v,`horizontal`),persist:s,divider:s.default(!0),class:a},se={id:a,as:o(y,`section`),size:o(b,`fill`),resize:o(x,`none`),collapsible:s,defaultCollapsed:s,class:a},C={target:a,action:o(S,`toggle`),icon:a.default(`menu`),label:a.default(`Expand`),class:a},ce=[u({name:`opening`,state:`changing`,projectEach:e=>e.context.change.openingIds.map(e=>({panelId:e})),onDone:`CHANGE_DONE`,onError:`CHANGE_ERROR`,sends:{expand:e=>({type:`EXPAND`,panelId:e}),collapse:e=>({type:`COLLAPSE`,panelId:e}),toggle:e=>({type:`TOGGLE`,panelId:e})}}),u({name:`closing`,state:`changing`,projectEach:e=>e.context.change.closingIds.map(e=>({panelId:e})),onDone:`CHANGE_DONE`,onError:`CHANGE_ERROR`,sends:{expand:e=>({type:`EXPAND`,panelId:e}),collapse:e=>({type:`COLLAPSE`,panelId:e}),toggle:e=>({type:`TOGGLE`,panelId:e})}}),u({name:`sizing`,state:`sizing`,projectEach:e=>e.context.sizing.changes,onDone:`SIZE_DONE`,onError:`SIZE_ERROR`}),u({name:`persisting`,state:`persisting`,project:e=>({groupId:e.props.id,collapsed:[...e.context.layout.collapsedIds],sizes:{...e.context.layout.committedSizes}}),onDone:`PERSIST_DONE`,onError:`PERSIST_ERROR`})],w=e=>Array.isArray(e)?e.filter(e=>typeof e==`string`):[],T=e=>typeof e.panelId==`string`?e.panelId:``,E=e=>typeof e==`number`&&Number.isFinite(e)?e:null,D=e=>(Array.isArray(e.changes)?e.changes:[e]).flatMap(e=>{if(typeof e!=`object`||!e)return[];let t=e,n=typeof t.panelId==`string`?t.panelId:``,r=E(t.from),i=E(t.to),a=t.reset===!0;return n&&r!==null&&i!==null&&(r!==i||a)?[{panelId:n,from:r,to:i,...a?{reset:!0}:{}}]:[]}),O=(e,t)=>typeof e.props==`object`&&e.props!==null?e.props:t,k=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]),A=e=>{let t=T(e.event),n=e.context.layout.collapsedIds;switch(e.event.type){case`COLLAPSE`:return e.context.collection.collapsibleIds.includes(t)&&!n.includes(t)?e.context.collection.ids.filter(e=>n.includes(e)||e===t):n;case`EXPAND`:return n.filter(e=>e!==t);case`TOGGLE`:return e.context.collection.collapsibleIds.includes(t)?n.includes(t)?n.filter(e=>e!==t):e.context.collection.ids.filter(e=>n.includes(e)||e===t):n;default:return n}},j=e=>{let t=T(e.event);return e.context.collection.ids.includes(t)&&!k(e.context.layout.collapsedIds,A(e))},M=e=>{let t=T(e.event);return e.context.collection.resizableIds.includes(t)&&!e.context.layout.collapsedIds.includes(t)&&E(e.event.size)!==null},N=e=>{let t=D(e.event);return t.length>0&&t.every(({panelId:t})=>e.context.collection.sizableIds.includes(t)&&!e.context.layout.collapsedIds.includes(t))},P=e=>{let t=D(e.event);return t.length>0&&t.every(({panelId:t})=>e.context.collection.sizableIds.includes(t)&&e.context.layout.collapsedIds.includes(t))},le=e=>{let t=w(e.event.ids);return t.length>0&&t.every(t=>e.context.collection.sizableIds.includes(t)&&e.context.layout.collapsedIds.includes(t)&&Object.hasOwn(e.context.layout.committedSizes,t))},F=e=>{let t=D(e.event),n={...e.context.layout.committedSizes};return t.forEach(({panelId:e,to:t,reset:r})=>{r?delete n[e]:n[e]=t}),{context:{...e.context,layout:{...e.context.layout,committedSizes:n},sizing:{changes:t}}}},I=e=>{let t=D(e.event);return{context:{...e.context,layout:{...e.context.layout,committedSizes:{...e.context.layout.committedSizes,...Object.fromEntries(t.map(({panelId:e,to:t})=>[e,t]))}}}}},L=e=>{let t={...e.context.layout.committedSizes};return w(e.event.ids).forEach(e=>delete t[e]),{context:{...e.context,layout:{...e.context.layout,committedSizes:t}}}},R=e=>{let t=A(e),n=e.context.layout.collapsedIds;return{context:{...e.context,layout:{...e.context.layout,collapsedIds:t},change:{openingIds:n.filter(e=>!t.includes(e)),closingIds:t.filter(e=>!n.includes(e))}}}},z=e=>{let t=w(e.event.ids),n=w(e.event.collapsibleIds).filter(e=>t.includes(e)),r=w(e.event.sizableIds).filter(e=>t.includes(e)),i=w(e.event.resizableIds).filter(e=>t.includes(e)),a=w(e.event.authoredCollapsedIds).filter(e=>n.includes(e)),o=new Set(e.context.collection.ids),s=t.filter(t=>(e.context.layout.collapsedIds.includes(t)||!o.has(t)&&a.includes(t))&&n.includes(t)),ee=Object.fromEntries(Object.entries(e.context.layout.committedSizes).filter(([e])=>t.includes(e)&&r.includes(e))),c=t.includes(e.context.resize.activeId)&&i.includes(e.context.resize.activeId);return{context:{...e.context,collection:{ids:t,collapsibleIds:n,sizableIds:r,resizableIds:i},layout:{collapsedIds:s,committedSizes:ee},authored:{collapsedIds:a},resize:c?e.context.resize:{activeId:``,initialSize:null,previewSize:null}}}},ue=e=>{let t=w(e.event.ids),n=w(e.event.resizableIds);return!t.includes(e.context.resize.activeId)||!n.includes(e.context.resize.activeId)},de=({props:e,context:t,effects:n})=>h({initial:`stable`,on:{DOM_INVALIDATED:{effects:`sync`}},states:{stable:{tags:[`stable`],on:{COLLAPSE:{target:`changing`,guard:j,reduce:R,effects:`prepareChange`},EXPAND:{target:`changing`,guard:j,reduce:R,effects:`prepareChange`},TOGGLE:{target:`changing`,guard:j,reduce:R,effects:`prepareChange`},SIZE:{target:`sizing`,guard:N,reduce:F,effects:`prepareSizing`},RESTORE_HIDDEN_SIZES:{guard:P,reduce:I},RESET_HIDDEN_SIZES:{target:`persisting`,guard:le,reduce:L,effects:[`sync`,`persist`]},RESIZE_START:{target:`resizing`,guard:M,reduce:`startResize`,effects:`beginResize`},PANELS_CHANGED:{reduce:z,effects:`sync`},PROPS_CHANGED:{reduce:`replaceProps`,effects:`sync`}}},changing:{tags:[`changing`,`transitioning`],on:{CHANGE_DONE:{target:`persisting`,effects:[`finishChange`,`persist`]},CHANGE_ERROR:{target:`persisting`,effects:[`finishChange`,`persist`]},COLLAPSE:{target:`changing`,guard:j,reduce:R,effects:`prepareChange`},EXPAND:{target:`changing`,guard:j,reduce:R,effects:`prepareChange`},TOGGLE:{target:`changing`,guard:j,reduce:R,effects:`prepareChange`},PANELS_CHANGED:{reduce:z,effects:`sync`},PROPS_CHANGED:{reduce:`replaceProps`,effects:`sync`}}},sizing:{tags:[`sizing`,`transitioning`],on:{SIZE_DONE:{target:`persisting`,effects:[`finishSizing`,`persist`]},SIZE_ERROR:{target:`persisting`,effects:[`finishSizing`,`persist`]},SIZE:{target:`sizing`,guard:N,reduce:F,effects:`prepareSizing`},RESIZE_START:{target:`resizing`,guard:M,reduce:`startResize`,effects:`beginResize`},PANELS_CHANGED:{reduce:z,effects:`sync`},PROPS_CHANGED:{reduce:`replaceProps`,effects:`sync`}}},resizing:{tags:[`resizing`],on:{RESIZE:{guard:`activeResize`,reduce:`previewResize`,effects:`previewResize`},RESIZE_END:{target:`persisting`,guard:`activeResize`,reduce:`commitResize`,effects:[`commitResize`,`persist`]},RESIZE_CANCEL:{target:`stable`,reduce:`clearResize`,effects:`cancelResize`},PANELS_CHANGED:[{target:`stable`,guard:ue,reduce:z,effects:[`cancelResize`,`sync`]},{reduce:z,effects:`sync`}],PROPS_CHANGED:{reduce:`replaceProps`,effects:`sync`}}},persisting:{tags:[`persisting`],on:{PERSIST_DONE:`stable`,PERSIST_ERROR:`stable`,COLLAPSE:{target:`changing`,guard:j,reduce:R,effects:`prepareChange`},EXPAND:{target:`changing`,guard:j,reduce:R,effects:`prepareChange`},TOGGLE:{target:`changing`,guard:j,reduce:R,effects:`prepareChange`},SIZE:{target:`sizing`,guard:N,reduce:F,effects:`prepareSizing`},PANELS_CHANGED:{reduce:z,effects:`sync`},PROPS_CHANGED:{reduce:`replaceProps`,effects:`sync`}}}}},{props:e,context:t,reducers:{replaceProps:e=>({props:O(e.event,e.props)}),startResize:e=>{let t=E(e.event.size);return{context:{...e.context,resize:{activeId:T(e.event),initialSize:t,previewSize:t}}}},previewResize:e=>({context:{...e.context,resize:{...e.context.resize,previewSize:E(e.event.size)}}}),commitResize:e=>{let t=T(e.event),n=E(e.event.size);if(n!==null)return{context:{...e.context,layout:{...e.context.layout,committedSizes:{...e.context.layout.committedSizes,[t]:n}},resize:{activeId:``,initialSize:null,previewSize:null}}}},clearResize:e=>({context:{...e.context,resize:{activeId:``,initialSize:null,previewSize:null}}})},guards:{activeResize:e=>T(e.event)===e.context.resize.activeId&&E(e.event.size)!==null},effects:{prepareChange:n.prepareChange,finishChange:n.finishChange,sync:n.sync,beginResize:n.beginResize,previewResize:n.previewResize,commitResize:n.commitResize,cancelResize:n.cancelResize,prepareSizing:n.prepareSizing,finishSizing:n.finishSizing,persist:n.persist}}),B=p({definition:{component:`ui.panels`,parts:{root:{base:`relative flex h-full min-h-0 w-full min-w-0`,variants:{orientation:{horizontal:`flex-row`,vertical:`flex-col`}},defaults:{orientation:`horizontal`}},panel:{base:`relative min-w-0 overflow-hidden`,variants:{orientation:{horizontal:`h-full`,vertical:`w-full`},divider:{true:``,false:``},resize:{none:``,start:``,end:``}},defaults:{orientation:`horizontal`,divider:!0,resize:`none`}},expanded:{base:`h-full min-h-0 w-full min-w-0`},collapsed:{base:`flex h-full min-h-0 w-full min-w-0 items-center justify-center overflow-hidden`},resizeHandle:{base:[`absolute z-20 touch-none border-transparent outline-none`,`hover:border-intent-neutral-edge-hover focus-visible:ui-focus-ring-inset`,`data-resizing:border-intent-neutral-edge-strong`],variants:{orientation:{horizontal:`inset-y-0 w-panel-resize-handle cursor-col-resize`,vertical:`inset-x-0 h-panel-resize-handle cursor-row-resize`},edge:{start:``,end:``}},defaults:{orientation:`horizontal`,edge:`end`}},toggle:{base:`inline-flex size-control-md items-center justify-center outline-none focus-visible:ui-focus-ring-inset`},toggleIcon:{base:`size-icon-md shrink-0`}}}}),V=new Set,H=e=>e instanceof CustomEvent&&e.detail&&typeof e.detail==`object`?e.detail:{},fe=(()=>{let e=!1;return()=>{if(e||typeof document>`u`)return;let t=e=>t=>{let n=H(t);n.__panelsNotification||!n.panelId||V.forEach(t=>{n.groupId&&n.groupId!==t.id||t.hasPanel(n.panelId)&&t.perform(n.action??e,n.panelId,n.trigger)})};document.addEventListener(`ui:panel-collapse`,t(`collapse`)),document.addEventListener(`ui:panel-expand`,t(`expand`)),document.addEventListener(`ui:panel-toggle`,t(`toggle`)),document.addEventListener(`ui:panel-size`,e=>{let t=H(e);t.__panelsNotification||!t.panelId||!Number.isFinite(t.size)||V.forEach(e=>{t.groupId&&t.groupId!==e.id||e.hasPanel(t.panelId)&&e.resize(t.panelId,t.size)})}),document.addEventListener(`ui:panels-reset`,e=>{let t=H(e);t.__panelsNotification||V.forEach(e=>{t.groupId&&t.groupId!==e.id||t.panelId&&!e.hasPanel(t.panelId)||e.reset(t.panelId)})}),e=!0}})(),U=e=>`trellis-ui:panels:${e}:v1`,pe=e=>typeof e!=`object`||!e||Array.isArray(e)?{}:Object.fromEntries(Object.entries(e).filter(e=>typeof e[1]==`number`&&Number.isFinite(e[1]))),W=()=>{let r=null,a=null,o=null,s=`wide`,u=[],d=new Set,p=new Set,h=new Map,g=new Map,v=new Map,y=new Map,b=()=>{if(!r)throw Error(`Panels has not been initialized.`);return r},x=e=>e.closest(`[data-ui-panels]`)===b(),S=()=>Array.from(b().children).flatMap(e=>{if(!(e instanceof HTMLElement)||!e.hasAttribute(`data-ui-panel`))return[];let t=e.querySelector(`:scope > [data-ui-panel-expanded]`);return!t||!x(t)?[]:[{panel:e,expanded:t,collapsed:e.querySelector(`:scope > [data-ui-panel-collapsed]`),handle:e.querySelector(`:scope > [data-ui-panel-resize-handle]`),props:i({el:e,schema:se})}]}),C=e=>S().find(t=>t.props.id===e)??null,w=()=>Q.getCommittedSnapshot().context,T=()=>Q.getCommittedSnapshot().props,E=e=>w().layout.collapsedIds.includes(e),D=()=>T().orientation===`horizontal`&&s===`stacked`,O=()=>D()?`vertical`:T().orientation,k=()=>b().dataset.orientation===`vertical`?`vertical`:`horizontal`,A=e=>{let t=e.getBoundingClientRect();return k()===`horizontal`?t.width:t.height},j=()=>{let e=S(),t=e.map(({props:e})=>e.id);if(t.some(e=>!e))throw Error(`Every Panel requires a stable id.`);if(new Set(t).size!==t.length)throw Error(`Panel ids must be unique within a Panels group.`);if(e.length>0&&!e.some(({props:e})=>e.size===`fill`))throw Error(`A Panels group requires at least one size="fill" Panel.`);if(e.some(({props:e})=>e.size===`fill`&&e.resize!==`none`))throw Error(`A size="fill" Panel cannot own a resize handle.`);return{ids:e.map(({props:e})=>e.id).filter(Boolean),collapsibleIds:e.filter(({props:e})=>e.id&&e.collapsible).map(({props:e})=>e.id),sizableIds:e.filter(({props:e})=>e.id&&e.size!==`fill`).map(({props:e})=>e.id),resizableIds:e.filter(({props:e})=>e.id&&e.size!==`fill`&&e.resize!==`none`).map(({props:e})=>e.id),authoredCollapsedIds:e.filter(({props:e})=>e.id&&e.collapsible&&e.defaultCollapsed).map(({props:e})=>e.id)}},M=e=>{let t=document.createElement(`div`);t.style.cssText=`position:absolute;visibility:hidden;pointer-events:none;inset:0 auto auto 0;`,k()===`horizontal`?t.style.width=`var(${e})`:t.style.height=`var(${e})`,b().append(t);let n=A(t);return t.remove(),n},N=e=>e.props.size===`fill`?{minimum:0,maximum:1/0}:{minimum:M(`--spacing-panel-${e.props.size}-min`),maximum:M(`--spacing-panel-${e.props.size}-max`)},P=(e,t)=>{let{minimum:n,maximum:r}=N(e);return Math.min(r,Math.max(n,t))},le=()=>{let e=j();return{collection:{ids:e.ids,collapsibleIds:e.collapsibleIds,sizableIds:e.sizableIds,resizableIds:e.resizableIds},layout:{collapsedIds:[...e.authoredCollapsedIds],committedSizes:{}},authored:{collapsedIds:e.authoredCollapsedIds},change:{openingIds:[],closingIds:[]},resize:{activeId:``,initialSize:null,previewSize:null},sizing:{changes:[]}}},F=(e,t,n)=>{k()===`horizontal`?(e.style.minWidth=t,e.style.maxWidth=n,e.style.minHeight=``,e.style.maxHeight=``):(e.style.minHeight=t,e.style.maxHeight=n,e.style.minWidth=``,e.style.maxWidth=``)},I=e=>{e.style.flex=``,e.style.minWidth=``,e.style.maxWidth=``,e.style.minHeight=``,e.style.maxHeight=``},L=(e,t)=>{if(D()){I(e.panel);return}if(t!==void 0){e.panel.style.flex=`0 0 ${t}px`,F(e.panel,`0px`,`none`);return}if(E(e.props.id)){if(w().authored.collapsedIds.includes(e.props.id)){I(e.panel);return}let t=e.collapsed?`var(--spacing-panel-collapsed)`:`0px`;e.panel.style.flex=`0 0 ${t}`,F(e.panel,t,t);return}if(e.props.size===`fill`){I(e.panel);return}let n=w().resize.activeId===e.props.id?w().resize.previewSize:w().layout.committedSizes[e.props.id];if(n==null){I(e.panel);return}let r=`${P(e,n)}px`;e.panel.style.flex=`0 1 ${r}`,F(e.panel,`var(--spacing-panel-${e.props.size}-min)`,`var(--spacing-panel-${e.props.size}-max)`)},R=(e,t)=>{e.toggleAttribute(`inert`,t),e.setAttribute(`aria-hidden`,t?`true`:`false`)},z=e=>{let t=T(),n=O(),r=E(e.props.id),i=Q.hasTag(`changing`)&&w().change.openingIds.includes(e.props.id),a=Q.hasTag(`changing`)&&w().change.closingIds.includes(e.props.id),o=!(r&&!a),s=r&&!a&&!i&&e.collapsed!==null;if(e.panel.dataset.state=r?`collapsed`:`expanded`,e.panel.dataset.orientation=n,e.panel.dataset.size=e.props.size,e.panel.dataset.resize=e.props.resize,e.panel.className=f({part:B.parts.panel,props:{orientation:n,divider:t.divider,resize:e.props.resize},className:e.props.class}),l({el:e.panel,attr:`data-collapsible`,present:e.props.collapsible}),l({el:e.panel,attr:`data-resizing`,present:w().resize.activeId===e.props.id}),L(e),e.expanded.hidden=!o,R(e.expanded,!o),e.collapsed&&(e.collapsed.hidden=!s,R(e.collapsed,!s)),e.handle){let t=D()||r||e.props.size===`fill`||e.props.resize===`none`;e.handle.dataset.orientation=n,e.handle.dataset.resizeEdge=e.props.resize,e.handle.setAttribute(`aria-label`,`Resize ${e.props.id} panel`),e.handle.toggleAttribute(`data-resize-disabled`,t),e.handle.hidden=D(),e.handle.className=f({part:B.parts.resizeHandle,props:{orientation:n,edge:e.props.resize},className:e.handle.dataset.class??``})}},ue=e=>{e.forEach((t,r)=>{let i=e[r+1],a=t.props.resize===`end`||i?.props.resize===`start`;n(t.panel,`data-divider`),l({el:t.panel,attr:`data-divider`,present:T().divider&&i!==void 0&&!a})})},H=e=>{let t=e.dataset.target||``;if(!t){let t=e.closest(`[data-ui-panel]`),n=t?.closest(`[data-ui-panels]`),r=[...V].find(e=>e.id===n?.id),i=t&&r===$?C(t.id):null;return i&&r?{record:i,controller:r}:null}let n=e.dataset.groupId||e.closest(`[data-ui-panels]`)?.id,r=[...V].filter(e=>!n||e.id===n).find(e=>e.hasPanel(t)),i=r===$?C(t):null;return i&&r?{record:i,controller:r}:null},W=()=>{document.querySelectorAll(`[data-ui-panel-toggle]`).forEach(e=>{let t=H(e);if(!t||t.controller!==$)return;let n=E(t.record.props.id);e.dataset.target=t.record.props.id,e.dataset.groupId=T().id,e.dataset.state=n?`collapsed`:`expanded`,e.setAttribute(`aria-controls`,t.record.panel.id),e.setAttribute(`aria-expanded`,n?`false`:`true`),e.toggleAttribute(`disabled`,!t.record.props.collapsible)})},G=()=>{let e=T(),t=O();b().dataset.responsiveMode=s,b().dataset.layoutOrientation=t,b().style.flexDirection=t===`horizontal`?`row`:`column`,b().className=f({part:B.parts.root,props:{...e,orientation:t},className:e.class}),l({el:b(),attr:`data-resizing`,present:Q.hasTag(`resizing`)}),l({el:b(),attr:`data-transitioning`,present:Q.hasTag(`transitioning`)});let n=S();n.forEach(z),ue(n),W()},me=(e,t=!1)=>{let n=document.activeElement;if(!t&&(!(n instanceof HTMLElement)||!e.collapsed?.contains(n)))return;let r=v.get(e.props.id);r?.isConnected&&e.expanded.contains(r)?r.focus({preventScroll:!0}):(e.expanded.tabIndex=-1,e.expanded.focus({preventScroll:!0}))},K=(e,t=!1)=>{let n=document.activeElement;if(!t&&(!(n instanceof HTMLElement)||!e.expanded.contains(n)))return;let r=e.collapsed?re(e.collapsed)[0]:void 0,i=y.get(e.props.id),a=i?.isConnected&&!e.panel.contains(i)?i:void 0;r?r.focus({preventScroll:!0}):a?a.focus({preventScroll:!0}):(b().tabIndex=-1,b().focus({preventScroll:!0}))},he=()=>{let e=[...w().change.openingIds,...w().change.closingIds],t=new Set(w().change.openingIds.filter(e=>{let t=C(e),n=document.activeElement;return t!==null&&t.collapsed!==null&&n instanceof HTMLElement&&t.collapsed.contains(n)})),n=new Map(e.flatMap(e=>{let t=C(e);if(!t)return[];if(w().change.closingIds.includes(e)){let n=document.activeElement;n instanceof HTMLElement&&t.expanded.contains(n)&&v.set(e,n)}return[[e,A(t.panel)]]}));G(),w().change.openingIds.forEach(e=>{let n=C(e);n&&me(n,t.has(e))}),e.forEach(e=>{let t=C(e),r=n.get(e);if(!t||r===void 0)return;let i=A(t.panel);g.set(e,{from:r,to:i}),L(t,r)})},ge=()=>{let e=[...w().change.openingIds],t=[...w().change.closingIds],n=new Set(t.filter(e=>{let t=C(e),n=document.activeElement;return t!==null&&n instanceof HTMLElement&&t.expanded.contains(n)}));S().forEach(e=>L(e)),G(),t.forEach(e=>{let t=C(e);t&&K(t,n.has(e))}),e.forEach(e=>q(`ui:panel-expand`,e)),t.forEach(e=>q(`ui:panel-collapse`,e)),[...e,...t].forEach(e=>g.delete(e))},q=(e,t,n={})=>{c({el:b(),name:e,detail:{groupId:T().id,panelId:t,__panelsNotification:!0,...n}})},_e=()=>{let e=w().layout;if(T().persist)try{localStorage.setItem(U(T().id),JSON.stringify({collapsed:e.collapsedIds,sizes:e.committedSizes}))}catch{}c({el:b(),name:`ui:panels-layout-change`,detail:{groupId:T().id,collapsed:[...e.collapsedIds],sizes:{...e.committedSizes},__panelsNotification:!0}})},J=e=>{if(!r)return;if(Q.hasTag(`stable`)){e();return}let t=window.setTimeout(()=>{d.delete(t),J(e)},16);d.add(t)},Y=(e,t)=>{let n=e.find(e=>t(e)!==E(e));n&&(Q.send({type:t(n)?`COLLAPSE`:`EXPAND`,panelId:n}),J(()=>Y(e,t)))},ve=()=>{if(!T().persist)return;let e;try{e=JSON.parse(localStorage.getItem(U(T().id))??`null`)}catch{return}if(typeof e!=`object`||!e)return;let t=j(),n=new Set((Array.isArray(e.collapsed)?e.collapsed:[]).filter(e=>typeof e==`string`&&t.collapsibleIds.includes(e))),r=pe(e.sizes),i=()=>{Y(t.collapsibleIds,e=>n.has(e))},a=()=>{let e=t.sizableIds.flatMap(e=>{let t=C(e),n=r[e];if(!t||n===void 0)return[];let i=A(t.panel),a=P(t,n);return Math.abs(i-a)<.5?[]:[{panelId:e,from:i,to:a}]});if(D()){e.length>0&&Q.send({type:`RESTORE_HIDDEN_SIZES`,changes:e}),i();return}let n=e.filter(({panelId:e})=>E(e)),a=e.filter(({panelId:e})=>!E(e));if(n.length>0&&Q.send({type:`RESTORE_HIDDEN_SIZES`,changes:n}),a.length>0){Q.send({type:`SIZE`,changes:a}),J(i);return}i()},o=t.collapsibleIds.filter(e=>E(e)&&!n.has(e));o.length>0?(Y(o,()=>!1),J(a)):a()},ye=()=>{let e=requestAnimationFrame(()=>{p.delete(e);let t=requestAnimationFrame(()=>{p.delete(t),ve()});p.add(t)});p.add(e)},be=e=>{let t=j(),n=e?t.ids.filter(t=>t===e):t.ids;if(n.length===0)return;let r=()=>{Y(n.filter(e=>t.collapsibleIds.includes(e)),e=>w().authored.collapsedIds.includes(e))},i=n.filter(e=>t.sizableIds.includes(e)&&Object.hasOwn(w().layout.committedSizes,e));if(D()){i.length>0?(Q.send({type:`RESET_HIDDEN_SIZES`,ids:i}),J(r)):r();return}let a=i.filter(E);a.length>0&&Q.send({type:`RESET_HIDDEN_SIZES`,ids:a});let o=i.filter(e=>!E(e)).flatMap(e=>{let t=C(e);return!t||t.props.size===`fill`?[]:[{panelId:e,from:A(t.panel),to:M(`--spacing-panel-${t.props.size}`),reset:!0}]});if(o.length>0){Q.send({type:`SIZE`,changes:o}),J(r);return}r()},xe=()=>{w().sizing.changes.forEach(({panelId:e,from:t})=>{let n=C(e);n&&L(n,t)})},Se=()=>{w().sizing.changes.forEach(({panelId:e,to:t})=>{let n=C(e);n&&(L(n),q(`ui:panel-resize-end`,e,{size:t}))}),G()},Ce=e=>{if(O()===`vertical`)return e===`start`?`negative`:`positive`;let t=ee({el:b()});return e===`start`?t?`positive`:`negative`:t?`negative`:`positive`},X=()=>{let e=new Set(S().map(({panel:e})=>e));h.forEach((t,n)=>{e.has(n)||(t(),h.delete(n))}),S().forEach(e=>{if(h.has(e.panel)||!e.handle||e.props.size===`fill`||e.props.resize===`none`)return;let t=N(e),n=M(`--spacing-panel-resize-handle`),r=M(`--spacing-panel-resize-handle-coarse`);h.set(e.panel,ae({element:e.panel,handle:e.handle,axis:O()===`horizontal`?`x`:`y`,direction:Ce(e.props.resize),min:t.minimum,max:t.maximum,mode:`onChange`,hitArea:n,coarseHitArea:r,disabled:()=>D()||E(e.props.id),onStart:t=>Q.send({type:`RESIZE_START`,panelId:e.props.id,size:Z(t)}),onResize:t=>Q.send({type:`RESIZE`,panelId:e.props.id,size:Z(t)}),onEnd:t=>Q.send({type:`RESIZE_END`,panelId:e.props.id,size:Z(t)})}))})},we=()=>{h.forEach(e=>e()),h.clear(),X()},Z=e=>O()===`horizontal`?e.previewWidth:e.previewHeight,Te=e=>{let t=T().orientation===`horizontal`&&e<_(b(),`sm`)?`stacked`:`wide`;t!==s&&(s=t,G(),we())},Q=ne({schema:oe,hooks:ce,resolveTransitionElement:({data:e})=>{let t=e?.panelId;return t?C(t)?.panel??null:b()},createMachine:({props:e})=>de({props:e,context:le(),effects:{prepareChange:he,finishChange:ge,sync:()=>{G(),we()},beginResize:()=>{G()},previewResize:()=>{let e=w().resize.activeId,t=C(e);t&&L(t);let n=w().resize.previewSize;n!==null&&q(`ui:panel-resize`,e,{size:n})},commitResize:e=>{G();let t=typeof e.event.panelId==`string`?e.event.panelId:``,n=w().layout.committedSizes[t];t&&n!==void 0&&q(`ui:panel-resize-end`,t,{size:n})},cancelResize:G,prepareSizing:xe,finishSizing:Se,persist:_e}})}),Ee=()=>{let e=j();Q.send({type:`PANELS_CHANGED`,...e}),X()},De=()=>{a=ie({targets:b(),read:j,onChange:Ee,observer:{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`id`,`data-size`,`data-resize`,`data-collapsible`,`data-default-collapsed`]}})},$;return $={...Q,get id(){return b().id||T().id},get orientation(){return O()},get collapsed(){return[...w().layout.collapsedIds]},get sizes(){return{...w().layout.committedSizes}},get root(){let e=this.snapshot.current?.props??T();return m({inputs:[f({part:B.parts.root,props:e,className:e.class}),{"data-ui-panels":``}]})},init(){r=this.$el,Q.connect(this.$el,this.snapshot),b().id||=T().id,s=T().orientation===`horizontal`&&b().getBoundingClientRect().width<_(b(),`sm`)?`stacked`:`wide`,V.add($),fe(),G(),X(),o=new ResizeObserver(e=>{Te(e[0]?.contentRect.width??b().clientWidth)}),o.observe(b()),De(),T().persist&&ye(),u.push(te({target:b(),event:`keydown`,handler:()=>W()}))},destroy(){V.delete($),a?.(),a=null,o?.disconnect(),o=null,h.forEach(e=>e()),h.clear(),u.forEach(e=>e()),u=[],d.forEach(e=>window.clearTimeout(e)),d.clear(),p.forEach(e=>cancelAnimationFrame(e)),p.clear(),Q.disconnect(),r=null},transitionPanel(n){let r=n.data.panelId,i=C(r),a=g.get(r);return!i||!a||a.from===a.to?(i&&L(i,a?.to),e()):t(n,{target:i.panel,keyframes:{flexBasis:[`${a.from}px`,`${a.to}px`]},role:`layout`,cleanup:()=>L(i)})},transitionPanelSize(n){let{panelId:r,from:i,to:a}=n.data,o=C(r);return!o||i===a?(o&&L(o),e()):t(n,{target:o.panel,keyframes:{flexBasis:[`${i}px`,`${a}px`]},role:`layoutQuick`,cleanup:()=>L(o)})},hasPanel(e){return C(e)!==null},isCollapsed:E,collapse(e){Q.send({type:`COLLAPSE`,panelId:e})},expand(e){Q.send({type:`EXPAND`,panelId:e})},toggle(e){Q.send({type:`TOGGLE`,panelId:e})},resize(e,t){let n=C(e);if(D()||!n||n.props.size===`fill`||E(e)||!Number.isFinite(t))return;let r=A(n.panel),i=P(n,t);Math.abs(r-i)<.5||Q.send({type:`SIZE`,panelId:e,from:r,to:i})},reset(e){be(e)},perform(e,t,n){n&&y.set(t,n),{collapse:this.collapse,expand:this.expand,toggle:this.toggle}[e](t)},syncToggles:W},$},G=()=>{let e={};return{get props(){return e},init(){e=i({el:this.$el,schema:C})},destroy(){},get root(){return m({inputs:[f({part:B.parts.toggle,props:{},className:e.class}),{"data-ui-panel-toggle":``,":data-target":()=>e.target||void 0,":data-action":()=>e.action,"@click":e=>this.trigger(e)}]})},trigger(t){t?.preventDefault();let n=this.$el,r=n.closest(`[data-ui-panel]`),i=r?.closest(`[data-ui-panels]`),a=e.target||r?.id||``;a&&document.dispatchEvent(new CustomEvent(`ui:panel-toggle`,{detail:{panelId:a,groupId:i?.id,action:e.action,trigger:n}}))}}},me=e=>{d(`UiPanels`,W)(e),d(`UiPanelToggle`,G)(e)},K=new WeakSet,he=e=>{K.has(e)||(K.add(e),r(e),g(e),me(e))};export{G as n,W as r,he as t};
2
+ //# sourceMappingURL=entry2.generated-D26Cigu5.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entry2.generated-D26Cigu5.js","names":[],"sources":["../../../../../../../../client/src/runtime/composition-breakpoint.ts","../../../../../../../../client/src/components/panels/contract.ts","../../../../../../../../client/src/components/panels/machine.ts","../../../../../../../../client/src/components/panels/styles.ts","../../../../../../../../client/src/components/panels/index.ts","../../../../../../../../client/src/components/panels/entry.generated.ts"],"sourcesContent":["type CompositionBreakpoint = 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n\nconst compositionBreakpointPixels = (\n reference: HTMLElement,\n breakpoint: CompositionBreakpoint,\n): number => {\n const value = getComputedStyle(reference).getPropertyValue(`--breakpoint-${breakpoint}`);\n const pixels = Number.parseFloat(value);\n return Number.isFinite(pixels) ? pixels : Number.POSITIVE_INFINITY;\n};\n\nexport {compositionBreakpointPixels};\nexport type {CompositionBreakpoint};\n","import {bool, oneOf, string, type SchemaToProps} from '../../runtime';\n\nconst PANELS_ORIENTATIONS = ['horizontal', 'vertical'] as const;\nconst PANEL_AS_VALUES = ['div', 'section', 'aside', 'main', 'nav'] as const;\nconst PANEL_SIZES = ['1', '2', '3', '4', '5', '6', 'fill'] as const;\nconst PANEL_RESIZE_EDGES = ['none', 'start', 'end'] as const;\nconst PANEL_TOGGLE_ACTIONS = ['toggle', 'expand', 'collapse'] as const;\n\nconst panelsSchema = {\n id: string.default('ui-panels'),\n orientation: oneOf(PANELS_ORIENTATIONS, 'horizontal'),\n persist: bool,\n divider: bool.default(true),\n class: string,\n};\n\nconst panelSchema = {\n id: string,\n as: oneOf(PANEL_AS_VALUES, 'section'),\n size: oneOf(PANEL_SIZES, 'fill'),\n resize: oneOf(PANEL_RESIZE_EDGES, 'none'),\n collapsible: bool,\n defaultCollapsed: bool,\n class: string,\n};\n\nconst panelToggleSchema = {\n target: string,\n action: oneOf(PANEL_TOGGLE_ACTIONS, 'toggle'),\n icon: string.default('menu'),\n label: string.default('Expand'),\n class: string,\n};\n\ntype PanelsOrientation = typeof PANELS_ORIENTATIONS[number];\ntype PanelAs = typeof PANEL_AS_VALUES[number];\ntype PanelSize = typeof PANEL_SIZES[number];\ntype PanelResizeEdge = typeof PANEL_RESIZE_EDGES[number];\ntype PanelToggleAction = typeof PANEL_TOGGLE_ACTIONS[number];\ntype PanelsProps = SchemaToProps<typeof panelsSchema>;\ntype PanelProps = SchemaToProps<typeof panelSchema>;\ntype PanelToggleProps = SchemaToProps<typeof panelToggleSchema>;\n\nexport {\n PANEL_AS_VALUES,\n PANEL_RESIZE_EDGES,\n PANEL_SIZES,\n PANEL_TOGGLE_ACTIONS,\n PANELS_ORIENTATIONS,\n panelSchema,\n panelToggleSchema,\n panelsSchema,\n};\nexport type {\n PanelAs,\n PanelProps,\n PanelResizeEdge,\n PanelSize,\n PanelToggleAction,\n PanelToggleProps,\n PanelsOrientation,\n PanelsProps,\n};\n","import {createMachine, type Machine, type MachineEventObject, type MachineScope} from '../../runtime/state-machine';\nimport {defineHook, type TransitionHookDefinition} from '../../runtime/transition-coordinator';\nimport type {PanelsProps} from './contract';\n\ntype PanelsContext = {\n collection: {\n ids: string[];\n collapsibleIds: string[];\n sizableIds: string[];\n resizableIds: string[];\n };\n layout: {\n collapsedIds: string[];\n committedSizes: Record<string, number>;\n };\n authored: {collapsedIds: string[]};\n change: {\n openingIds: string[];\n closingIds: string[];\n };\n resize: {\n activeId: string;\n initialSize: number | null;\n previewSize: number | null;\n };\n sizing: {\n changes: PanelSizingTransitionData[];\n };\n};\n\ntype PanelTransitionData = {panelId: string};\ntype PanelSizingTransitionData = {panelId: string; from: number; to: number; reset?: boolean};\ntype PanelsPersistTransitionData = {\n groupId: string;\n collapsed: string[];\n sizes: Record<string, number>;\n};\n\ntype PanelsMachineEffects = {\n prepareChange(scope: MachineScope<PanelsContext, PanelsProps>): void;\n finishChange(scope: MachineScope<PanelsContext, PanelsProps>): void;\n sync(scope: MachineScope<PanelsContext, PanelsProps>): void;\n beginResize(scope: MachineScope<PanelsContext, PanelsProps>): void;\n previewResize(scope: MachineScope<PanelsContext, PanelsProps>): void;\n commitResize(scope: MachineScope<PanelsContext, PanelsProps>): void;\n cancelResize(scope: MachineScope<PanelsContext, PanelsProps>): void;\n prepareSizing(scope: MachineScope<PanelsContext, PanelsProps>): void;\n finishSizing(scope: MachineScope<PanelsContext, PanelsProps>): void;\n persist(scope: MachineScope<PanelsContext, PanelsProps>): void;\n};\n\ntype CreatePanelsMachineOptions = {\n props: PanelsProps;\n context: PanelsContext;\n effects: PanelsMachineEffects;\n};\n\nconst openingHook = defineHook({\n name: 'opening',\n state: 'changing',\n projectEach: (snapshot) => snapshot.context.change.openingIds.map((panelId) => ({panelId})),\n onDone: 'CHANGE_DONE',\n onError: 'CHANGE_ERROR',\n sends: {\n expand: (panelId: string) => ({type: 'EXPAND', panelId}),\n collapse: (panelId: string) => ({type: 'COLLAPSE', panelId}),\n toggle: (panelId: string) => ({type: 'TOGGLE', panelId}),\n },\n} satisfies TransitionHookDefinition<PanelsContext, PanelsProps, PanelTransitionData, 'opening'>);\n\nconst closingHook = defineHook({\n name: 'closing',\n state: 'changing',\n projectEach: (snapshot) => snapshot.context.change.closingIds.map((panelId) => ({panelId})),\n onDone: 'CHANGE_DONE',\n onError: 'CHANGE_ERROR',\n sends: {\n expand: (panelId: string) => ({type: 'EXPAND', panelId}),\n collapse: (panelId: string) => ({type: 'COLLAPSE', panelId}),\n toggle: (panelId: string) => ({type: 'TOGGLE', panelId}),\n },\n} satisfies TransitionHookDefinition<PanelsContext, PanelsProps, PanelTransitionData, 'closing'>);\n\nconst sizingHook = defineHook({\n name: 'sizing',\n state: 'sizing',\n projectEach: (snapshot) => snapshot.context.sizing.changes,\n onDone: 'SIZE_DONE',\n onError: 'SIZE_ERROR',\n} satisfies TransitionHookDefinition<PanelsContext, PanelsProps, PanelSizingTransitionData, 'sizing'>);\n\nconst persistingHook = defineHook({\n name: 'persisting',\n state: 'persisting',\n project: (snapshot) => ({\n groupId: snapshot.props.id,\n collapsed: [...snapshot.context.layout.collapsedIds],\n sizes: {...snapshot.context.layout.committedSizes},\n }),\n onDone: 'PERSIST_DONE',\n onError: 'PERSIST_ERROR',\n} satisfies TransitionHookDefinition<PanelsContext, PanelsProps, PanelsPersistTransitionData, 'persisting'>);\n\nconst panelsHooks = [openingHook, closingHook, sizingHook, persistingHook] as const;\n\nconst strings = (value: unknown): string[] => Array.isArray(value)\n ? value.filter((item): item is string => typeof item === 'string')\n : [];\nconst panelId = (event: MachineEventObject): string => typeof event.panelId === 'string' ? event.panelId : '';\nconst finiteSize = (value: unknown): number | null => typeof value === 'number' && Number.isFinite(value) ? value : null;\nconst sizingChanges = (event: MachineEventObject): PanelSizingTransitionData[] => {\n const candidates = Array.isArray(event.changes) ? event.changes : [event];\n return candidates.flatMap((candidate) => {\n if (typeof candidate !== 'object' || candidate === null) return [];\n const change = candidate as Record<string, unknown>;\n const id = typeof change.panelId === 'string' ? change.panelId : '';\n const from = finiteSize(change.from);\n const to = finiteSize(change.to);\n const reset = change.reset === true;\n return id && from !== null && to !== null && (from !== to || reset)\n ? [{panelId: id, from, to, ...(reset ? {reset: true} : {})}]\n : [];\n });\n};\nconst propsFrom = (event: MachineEventObject, fallback: PanelsProps): PanelsProps => (\n typeof event.props === 'object' && event.props !== null ? event.props as PanelsProps : fallback\n);\nconst sameStrings = (left: readonly string[], right: readonly string[]): boolean => (\n left.length === right.length && left.every((value, index) => value === right[index])\n);\n\nconst requestedCollapsed = (scope: MachineScope<PanelsContext, PanelsProps>): string[] => {\n const id = panelId(scope.event);\n const current = scope.context.layout.collapsedIds;\n switch (scope.event.type) {\n case 'COLLAPSE':\n return scope.context.collection.collapsibleIds.includes(id) && !current.includes(id)\n ? scope.context.collection.ids.filter((item) => current.includes(item) || item === id)\n : current;\n case 'EXPAND':\n return current.filter((item) => item !== id);\n case 'TOGGLE':\n if (!scope.context.collection.collapsibleIds.includes(id)) return current;\n return current.includes(id)\n ? current.filter((item) => item !== id)\n : scope.context.collection.ids.filter((item) => current.includes(item) || item === id);\n default:\n return current;\n }\n};\n\nconst changeAllowed = (scope: MachineScope<PanelsContext, PanelsProps>): boolean => {\n const id = panelId(scope.event);\n return scope.context.collection.ids.includes(id)\n && !sameStrings(scope.context.layout.collapsedIds, requestedCollapsed(scope));\n};\n\nconst resizeAllowed = (scope: MachineScope<PanelsContext, PanelsProps>): boolean => {\n const id = panelId(scope.event);\n return scope.context.collection.resizableIds.includes(id)\n && !scope.context.layout.collapsedIds.includes(id)\n && finiteSize(scope.event.size) !== null;\n};\n\nconst sizingAllowed = (scope: MachineScope<PanelsContext, PanelsProps>): boolean => {\n const changes = sizingChanges(scope.event);\n return changes.length > 0 && changes.every(({panelId: id}) => (\n scope.context.collection.sizableIds.includes(id)\n && !scope.context.layout.collapsedIds.includes(id)\n ));\n};\n\nconst hiddenSizingAllowed = (scope: MachineScope<PanelsContext, PanelsProps>): boolean => {\n const changes = sizingChanges(scope.event);\n return changes.length > 0 && changes.every(({panelId: id}) => (\n scope.context.collection.sizableIds.includes(id)\n && scope.context.layout.collapsedIds.includes(id)\n ));\n};\n\nconst hiddenResetAllowed = (scope: MachineScope<PanelsContext, PanelsProps>): boolean => {\n const ids = strings(scope.event.ids);\n return ids.length > 0 && ids.every((id) => (\n scope.context.collection.sizableIds.includes(id)\n && scope.context.layout.collapsedIds.includes(id)\n && Object.hasOwn(scope.context.layout.committedSizes, id)\n ));\n};\n\nconst applySizing = (scope: MachineScope<PanelsContext, PanelsProps>) => {\n const changes = sizingChanges(scope.event);\n const committedSizes = {...scope.context.layout.committedSizes};\n changes.forEach(({panelId: id, to, reset}) => {\n if (reset) delete committedSizes[id];\n else committedSizes[id] = to;\n });\n return {context: {\n ...scope.context,\n layout: {\n ...scope.context.layout,\n committedSizes,\n },\n sizing: {changes},\n }};\n};\n\nconst commitHiddenSizes = (scope: MachineScope<PanelsContext, PanelsProps>) => {\n const changes = sizingChanges(scope.event);\n return {context: {\n ...scope.context,\n layout: {\n ...scope.context.layout,\n committedSizes: {\n ...scope.context.layout.committedSizes,\n ...Object.fromEntries(changes.map(({panelId: id, to}) => [id, to])),\n },\n },\n }};\n};\n\nconst resetHiddenSizes = (scope: MachineScope<PanelsContext, PanelsProps>) => {\n const committedSizes = {...scope.context.layout.committedSizes};\n strings(scope.event.ids).forEach((id) => delete committedSizes[id]);\n return {context: {\n ...scope.context,\n layout: {...scope.context.layout, committedSizes},\n }};\n};\n\nconst applyChange = (scope: MachineScope<PanelsContext, PanelsProps>) => {\n const collapsedIds = requestedCollapsed(scope);\n const previous = scope.context.layout.collapsedIds;\n return {context: {\n ...scope.context,\n layout: {...scope.context.layout, collapsedIds},\n change: {\n openingIds: previous.filter((id) => !collapsedIds.includes(id)),\n closingIds: collapsedIds.filter((id) => !previous.includes(id)),\n },\n }};\n};\n\nconst reconcile = (scope: MachineScope<PanelsContext, PanelsProps>) => {\n const ids = strings(scope.event.ids);\n const collapsibleIds = strings(scope.event.collapsibleIds).filter((id) => ids.includes(id));\n const sizableIds = strings(scope.event.sizableIds).filter((id) => ids.includes(id));\n const resizableIds = strings(scope.event.resizableIds).filter((id) => ids.includes(id));\n const authoredCollapsedIds = strings(scope.event.authoredCollapsedIds).filter((id) => collapsibleIds.includes(id));\n const known = new Set(scope.context.collection.ids);\n const collapsedIds = ids.filter((id) => (\n scope.context.layout.collapsedIds.includes(id) || (!known.has(id) && authoredCollapsedIds.includes(id))\n ) && collapsibleIds.includes(id));\n const committedSizes = Object.fromEntries(Object.entries(scope.context.layout.committedSizes).filter(([id]) => (\n ids.includes(id) && sizableIds.includes(id)\n )));\n const activeExists = ids.includes(scope.context.resize.activeId) && resizableIds.includes(scope.context.resize.activeId);\n return {context: {\n ...scope.context,\n collection: {ids, collapsibleIds, sizableIds, resizableIds},\n layout: {collapsedIds, committedSizes},\n authored: {collapsedIds: authoredCollapsedIds},\n resize: activeExists\n ? scope.context.resize\n : {activeId: '', initialSize: null, previewSize: null},\n }};\n};\n\nconst activeRemoved = (scope: MachineScope<PanelsContext, PanelsProps>): boolean => {\n const ids = strings(scope.event.ids);\n const resizableIds = strings(scope.event.resizableIds);\n return !ids.includes(scope.context.resize.activeId) || !resizableIds.includes(scope.context.resize.activeId);\n};\n\nconst createPanelsMachine = ({\n props,\n context,\n effects,\n}: CreatePanelsMachineOptions): Machine<PanelsContext, PanelsProps> => createMachine<PanelsContext, PanelsProps>({\n initial: 'stable',\n on: {\n DOM_INVALIDATED: {effects: 'sync'},\n },\n states: {\n stable: {\n tags: ['stable'],\n on: {\n COLLAPSE: {target: 'changing', guard: changeAllowed, reduce: applyChange, effects: 'prepareChange'},\n EXPAND: {target: 'changing', guard: changeAllowed, reduce: applyChange, effects: 'prepareChange'},\n TOGGLE: {target: 'changing', guard: changeAllowed, reduce: applyChange, effects: 'prepareChange'},\n SIZE: {target: 'sizing', guard: sizingAllowed, reduce: applySizing, effects: 'prepareSizing'},\n RESTORE_HIDDEN_SIZES: {guard: hiddenSizingAllowed, reduce: commitHiddenSizes},\n RESET_HIDDEN_SIZES: {\n target: 'persisting',\n guard: hiddenResetAllowed,\n reduce: resetHiddenSizes,\n effects: ['sync', 'persist'],\n },\n RESIZE_START: {target: 'resizing', guard: resizeAllowed, reduce: 'startResize', effects: 'beginResize'},\n PANELS_CHANGED: {reduce: reconcile, effects: 'sync'},\n PROPS_CHANGED: {reduce: 'replaceProps', effects: 'sync'},\n },\n },\n changing: {\n tags: ['changing', 'transitioning'],\n on: {\n CHANGE_DONE: {target: 'persisting', effects: ['finishChange', 'persist']},\n CHANGE_ERROR: {target: 'persisting', effects: ['finishChange', 'persist']},\n COLLAPSE: {target: 'changing', guard: changeAllowed, reduce: applyChange, effects: 'prepareChange'},\n EXPAND: {target: 'changing', guard: changeAllowed, reduce: applyChange, effects: 'prepareChange'},\n TOGGLE: {target: 'changing', guard: changeAllowed, reduce: applyChange, effects: 'prepareChange'},\n PANELS_CHANGED: {reduce: reconcile, effects: 'sync'},\n PROPS_CHANGED: {reduce: 'replaceProps', effects: 'sync'},\n },\n },\n sizing: {\n tags: ['sizing', 'transitioning'],\n on: {\n SIZE_DONE: {target: 'persisting', effects: ['finishSizing', 'persist']},\n SIZE_ERROR: {target: 'persisting', effects: ['finishSizing', 'persist']},\n SIZE: {target: 'sizing', guard: sizingAllowed, reduce: applySizing, effects: 'prepareSizing'},\n RESIZE_START: {target: 'resizing', guard: resizeAllowed, reduce: 'startResize', effects: 'beginResize'},\n PANELS_CHANGED: {reduce: reconcile, effects: 'sync'},\n PROPS_CHANGED: {reduce: 'replaceProps', effects: 'sync'},\n },\n },\n resizing: {\n tags: ['resizing'],\n on: {\n RESIZE: {guard: 'activeResize', reduce: 'previewResize', effects: 'previewResize'},\n RESIZE_END: {target: 'persisting', guard: 'activeResize', reduce: 'commitResize', effects: ['commitResize', 'persist']},\n RESIZE_CANCEL: {target: 'stable', reduce: 'clearResize', effects: 'cancelResize'},\n PANELS_CHANGED: [\n {target: 'stable', guard: activeRemoved, reduce: reconcile, effects: ['cancelResize', 'sync']},\n {reduce: reconcile, effects: 'sync'},\n ],\n PROPS_CHANGED: {reduce: 'replaceProps', effects: 'sync'},\n },\n },\n persisting: {\n tags: ['persisting'],\n on: {\n PERSIST_DONE: 'stable',\n PERSIST_ERROR: 'stable',\n COLLAPSE: {target: 'changing', guard: changeAllowed, reduce: applyChange, effects: 'prepareChange'},\n EXPAND: {target: 'changing', guard: changeAllowed, reduce: applyChange, effects: 'prepareChange'},\n TOGGLE: {target: 'changing', guard: changeAllowed, reduce: applyChange, effects: 'prepareChange'},\n SIZE: {target: 'sizing', guard: sizingAllowed, reduce: applySizing, effects: 'prepareSizing'},\n PANELS_CHANGED: {reduce: reconcile, effects: 'sync'},\n PROPS_CHANGED: {reduce: 'replaceProps', effects: 'sync'},\n },\n },\n },\n}, {\n props,\n context,\n reducers: {\n replaceProps: (scope) => ({props: propsFrom(scope.event, scope.props)}),\n startResize: (scope) => {\n const size = finiteSize(scope.event.size);\n return {context: {\n ...scope.context,\n resize: {activeId: panelId(scope.event), initialSize: size, previewSize: size},\n }};\n },\n previewResize: (scope) => ({context: {\n ...scope.context,\n resize: {...scope.context.resize, previewSize: finiteSize(scope.event.size)},\n }}),\n commitResize: (scope) => {\n const id = panelId(scope.event);\n const size = finiteSize(scope.event.size);\n if (size === null) return;\n return {context: {\n ...scope.context,\n layout: {\n ...scope.context.layout,\n committedSizes: {...scope.context.layout.committedSizes, [id]: size},\n },\n resize: {activeId: '', initialSize: null, previewSize: null},\n }};\n },\n clearResize: (scope) => ({context: {\n ...scope.context,\n resize: {activeId: '', initialSize: null, previewSize: null},\n }}),\n },\n guards: {\n activeResize: (scope) => panelId(scope.event) === scope.context.resize.activeId\n && finiteSize(scope.event.size) !== null,\n },\n effects: {\n prepareChange: effects.prepareChange,\n finishChange: effects.finishChange,\n sync: effects.sync,\n beginResize: effects.beginResize,\n previewResize: effects.previewResize,\n commitResize: effects.commitResize,\n cancelResize: effects.cancelResize,\n prepareSizing: effects.prepareSizing,\n finishSizing: effects.finishSizing,\n persist: effects.persist,\n },\n});\n\nexport {createPanelsMachine, panelsHooks};\nexport type {\n CreatePanelsMachineOptions,\n PanelsContext,\n PanelsMachineEffects,\n PanelsPersistTransitionData,\n PanelSizingTransitionData,\n PanelTransitionData,\n};\n","import {defineStyles} from '../../runtime';\n\nconst panelsStyles = defineStyles({definition: {\n component: 'ui.panels',\n parts: {\n root: {\n base: 'relative flex h-full min-h-0 w-full min-w-0',\n variants: {\n orientation: {\n horizontal: 'flex-row',\n vertical: 'flex-col',\n },\n },\n defaults: {orientation: 'horizontal'},\n },\n panel: {\n base: 'relative min-w-0 overflow-hidden',\n variants: {\n orientation: {\n horizontal: 'h-full',\n vertical: 'w-full',\n },\n divider: {\n true: '',\n false: '',\n },\n resize: {\n none: '',\n start: '',\n end: '',\n },\n },\n defaults: {orientation: 'horizontal', divider: true, resize: 'none'},\n },\n expanded: {base: 'h-full min-h-0 w-full min-w-0'},\n collapsed: {base: 'flex h-full min-h-0 w-full min-w-0 items-center justify-center overflow-hidden'},\n resizeHandle: {\n base: [\n 'absolute z-20 touch-none border-transparent outline-none',\n 'hover:border-intent-neutral-edge-hover focus-visible:ui-focus-ring-inset',\n 'data-resizing:border-intent-neutral-edge-strong',\n ],\n variants: {\n orientation: {\n horizontal: 'inset-y-0 w-panel-resize-handle cursor-col-resize',\n vertical: 'inset-x-0 h-panel-resize-handle cursor-row-resize',\n },\n edge: {\n start: '',\n end: '',\n },\n },\n defaults: {orientation: 'horizontal', edge: 'end'},\n },\n toggle: {base: 'inline-flex size-control-md items-center justify-center outline-none focus-visible:ui-focus-ring-inset'},\n toggleIcon: {base: 'size-icon-md shrink-0'},\n },\n}});\n\nexport {panelsStyles};\n","import type Alpine from 'alpinejs';\n\nimport {\n type AlpineMachine,\n createAlpineMachine,\n createResizable,\n decodeProps,\n defineAlpineData,\n focusableElements,\n isRtl,\n mergeBindings,\n observeSemanticChanges,\n resolveStyle,\n type BindingObject,\n type CleanupStack,\n type ResizeDirection,\n type ResizeEvent,\n type TransitionForHook,\n type TrellisAlpineComponent,\n} from '@client/runtime';\nimport {animateSize, type MotionHandle, type MotionTransitionSubject} from '@client/motion';\nimport {noopHandle} from '@client/motion/animate';\nimport {compositionBreakpointPixels} from '@client/runtime/composition-breakpoint';\nimport {declareMorphAttributes} from '@client/runtime/morph';\nimport {addListener, asBool, dispatch, setPresence} from '@client/utils';\nimport {\n panelSchema,\n panelToggleSchema,\n panelsSchema,\n type PanelProps,\n type PanelResizeEdge,\n type PanelToggleAction,\n type PanelToggleProps,\n type PanelsOrientation,\n type PanelsProps,\n} from './contract';\nimport {\n createPanelsMachine,\n panelsHooks,\n type PanelsContext,\n type PanelsPersistTransitionData,\n type PanelSizingTransitionData,\n type PanelTransitionData,\n} from './machine';\nimport {panelsStyles} from './styles';\n\ntype PanelsTransitionName = (typeof panelsHooks)[number]['name'];\ntype PanelsTransition<TName extends PanelsTransitionName = PanelsTransitionName> = TransitionForHook<\n Extract<(typeof panelsHooks)[number], {name: TName}>,\n HTMLElement\n>;\n\ntype PanelRecord = {\n panel: HTMLElement;\n expanded: HTMLElement;\n collapsed: HTMLElement | null;\n handle: HTMLElement | null;\n props: PanelProps;\n};\n\ntype PanelCollectionState = {\n ids: string[];\n collapsibleIds: string[];\n sizableIds: string[];\n resizableIds: string[];\n authoredCollapsedIds: string[];\n};\n\ntype PanelEventDetail = {\n panelId?: string;\n groupId?: string;\n size?: number;\n action?: PanelToggleAction;\n trigger?: HTMLElement | null;\n __panelsNotification?: boolean;\n};\n\ntype PanelTransitionGeometry = {from: number; to: number};\ntype PanelsResponsiveMode = 'stacked' | 'wide';\ntype PanelMotionTransition = MotionTransitionSubject & Readonly<{\n data: PanelTransitionData;\n}>;\ntype PanelSizingMotionTransition = MotionTransitionSubject & Readonly<{\n data: PanelSizingTransitionData;\n}>;\n\ntype PanelsController = {\n readonly id: string;\n hasPanel(panelId: string): boolean;\n perform(action: PanelToggleAction, panelId: string, trigger?: HTMLElement | null): void;\n resize(panelId: string, size: number): void;\n reset(panelId?: string): void;\n syncToggles(): void;\n};\n\n/** Public Alpine API for `ui.panels`. @public */\ninterface UiPanelsApi {\n /** Stable group id used by explicit controls, named events, and persistence. */\n readonly id: string;\n /** Current main axis along which direct panels negotiate space. */\n readonly orientation: 'horizontal' | 'vertical';\n /** Stable ids of panels whose collapsed representation is active. */\n readonly collapsed: readonly string[];\n /** User-committed pixel measures keyed by stable panel id. */\n readonly sizes: Readonly<Record<string, number>>;\n /** Returns whether a named panel is currently collapsed. */\n isCollapsed(id: string): boolean;\n /** Collapses a named collapsible panel. */\n collapse(id: string): void;\n /** Expands a named collapsed panel. */\n expand(id: string): void;\n /** Reverses the collapsed state of a named collapsible panel. */\n toggle(id: string): void;\n /** Moves an expanded bounded panel to a clamped pixel size through the sizing transition. */\n resize(id: string, size: number): void;\n /** Restores one panel or the whole group to its authored layout. */\n reset(id?: string): void;\n}\n\ntype PanelsData = AlpineMachine<PanelsContext, PanelsProps, typeof panelsHooks> & UiPanelsApi & {\n readonly root: BindingObject;\n init(): void;\n destroy(): void;\n perform(action: PanelToggleAction, panelId: string, trigger?: HTMLElement | null): void;\n syncToggles(): void;\n hasPanel(panelId: string): boolean;\n transitionPanel(transition: PanelMotionTransition): MotionHandle;\n transitionPanelSize(transition: PanelSizingMotionTransition): MotionHandle;\n};\n\nconst controllers = new Set<PanelsController>();\n\nconst eventDetail = (event: Event): PanelEventDetail => (\n event instanceof CustomEvent && event.detail && typeof event.detail === 'object'\n ? event.detail as PanelEventDetail\n : {}\n);\n\nconst registerDocumentListeners = (() => {\n let registered = false;\n return (): void => {\n if (registered || typeof document === 'undefined') return;\n const route = (action: PanelToggleAction) => (event: Event): void => {\n const detail = eventDetail(event);\n if (detail.__panelsNotification || !detail.panelId) return;\n controllers.forEach((controller) => {\n if (detail.groupId && detail.groupId !== controller.id) return;\n if (!controller.hasPanel(detail.panelId!)) return;\n controller.perform(detail.action ?? action, detail.panelId!, detail.trigger);\n });\n };\n document.addEventListener('ui:panel-collapse', route('collapse'));\n document.addEventListener('ui:panel-expand', route('expand'));\n document.addEventListener('ui:panel-toggle', route('toggle'));\n document.addEventListener('ui:panel-size', (event) => {\n const detail = eventDetail(event);\n if (detail.__panelsNotification || !detail.panelId || !Number.isFinite(detail.size)) return;\n controllers.forEach((controller) => {\n if (detail.groupId && detail.groupId !== controller.id) return;\n if (!controller.hasPanel(detail.panelId!)) return;\n controller.resize(detail.panelId!, detail.size!);\n });\n });\n document.addEventListener('ui:panels-reset', (event) => {\n const detail = eventDetail(event);\n if (detail.__panelsNotification) return;\n controllers.forEach((controller) => {\n if (detail.groupId && detail.groupId !== controller.id) return;\n if (detail.panelId && !controller.hasPanel(detail.panelId)) return;\n controller.reset(detail.panelId);\n });\n });\n registered = true;\n };\n})();\n\nconst storageKey = (id: string): string => `trellis-ui:panels:${id}:v1`;\nconst numericRecord = (value: unknown): Record<string, number> => {\n if (typeof value !== 'object' || value === null || Array.isArray(value)) return {};\n return Object.fromEntries(Object.entries(value).filter((entry): entry is [string, number] => (\n typeof entry[1] === 'number' && Number.isFinite(entry[1])\n )));\n};\n\nconst UiPanels = (): TrellisAlpineComponent<PanelsData> => {\n let rootEl: (HTMLElement & Alpine.ElementWithXAttributes) | null = null;\n let disconnectObserver: (() => void) | null = null;\n let resizeObserver: ResizeObserver | null = null;\n let responsiveMode: PanelsResponsiveMode = 'wide';\n let cleanup: CleanupStack = [];\n const deferredTimers = new Set<number>();\n const restoreFrames = new Set<number>();\n const resizeCleanups = new Map<HTMLElement, () => void>();\n const transitionGeometry = new Map<string, PanelTransitionGeometry>();\n const rememberedFocus = new Map<string, HTMLElement>();\n const activeTriggers = new Map<string, HTMLElement>();\n\n const root = (): HTMLElement & Alpine.ElementWithXAttributes => {\n if (!rootEl) throw new Error('Panels has not been initialized.');\n return rootEl;\n };\n const owns = (element: Element): boolean => element.closest('[data-ui-panels]') === root();\n const records = (): PanelRecord[] => Array.from(root().children).flatMap((child) => {\n if (!(child instanceof HTMLElement) || !child.hasAttribute('data-ui-panel')) return [];\n const expanded = child.querySelector<HTMLElement>(':scope > [data-ui-panel-expanded]');\n if (!expanded || !owns(expanded)) return [];\n return [{\n panel: child,\n expanded,\n collapsed: child.querySelector<HTMLElement>(':scope > [data-ui-panel-collapsed]'),\n handle: child.querySelector<HTMLElement>(':scope > [data-ui-panel-resize-handle]'),\n props: decodeProps({el: child, schema: panelSchema}),\n }];\n });\n const recordFor = (id: string): PanelRecord | null => records().find((record) => record.props.id === id) ?? null;\n const context = (): Readonly<PanelsContext> => bridge.getCommittedSnapshot().context;\n const currentProps = (): Readonly<PanelsProps> => bridge.getCommittedSnapshot().props;\n const isCollapsed = (id: string): boolean => context().layout.collapsedIds.includes(id);\n const isResponsiveStacked = (): boolean => (\n currentProps().orientation === 'horizontal' && responsiveMode === 'stacked'\n );\n const effectiveOrientation = (): PanelsOrientation => (\n isResponsiveStacked() ? 'vertical' : currentProps().orientation\n );\n const renderedOrientation = (): PanelsOrientation => root().dataset.orientation === 'vertical' ? 'vertical' : 'horizontal';\n const mainSize = (element: Element): number => {\n const rect = element.getBoundingClientRect();\n return renderedOrientation() === 'horizontal' ? rect.width : rect.height;\n };\n\n const collectionState = (): PanelCollectionState => {\n const items = records();\n const ids = items.map(({props}) => props.id);\n if (ids.some((id) => !id)) throw new Error('Every Panel requires a stable id.');\n if (new Set(ids).size !== ids.length) throw new Error('Panel ids must be unique within a Panels group.');\n if (items.length > 0 && !items.some(({props}) => props.size === 'fill')) {\n throw new Error('A Panels group requires at least one size=\"fill\" Panel.');\n }\n if (items.some(({props}) => props.size === 'fill' && props.resize !== 'none')) {\n throw new Error('A size=\"fill\" Panel cannot own a resize handle.');\n }\n return {\n ids: items.map(({props}) => props.id).filter(Boolean),\n collapsibleIds: items.filter(({props}) => props.id && props.collapsible).map(({props}) => props.id),\n sizableIds: items.filter(({props}) => props.id && props.size !== 'fill').map(({props}) => props.id),\n resizableIds: items.filter(({props}) => (\n props.id && props.size !== 'fill' && props.resize !== 'none'\n )).map(({props}) => props.id),\n authoredCollapsedIds: items.filter(({props}) => (\n props.id && props.collapsible && props.defaultCollapsed\n )).map(({props}) => props.id),\n };\n };\n\n const cssLength = (token: string): number => {\n const probe = document.createElement('div');\n probe.style.cssText = 'position:absolute;visibility:hidden;pointer-events:none;inset:0 auto auto 0;';\n if (renderedOrientation() === 'horizontal') probe.style.width = `var(${token})`;\n else probe.style.height = `var(${token})`;\n root().append(probe);\n const value = mainSize(probe);\n probe.remove();\n return value;\n };\n\n const boundsFor = (record: PanelRecord): {minimum: number; maximum: number} => {\n if (record.props.size === 'fill') return {minimum: 0, maximum: Number.POSITIVE_INFINITY};\n return {\n minimum: cssLength(`--spacing-panel-${record.props.size}-min`),\n maximum: cssLength(`--spacing-panel-${record.props.size}-max`),\n };\n };\n\n const clampPanelSize = (record: PanelRecord, value: number): number => {\n const {minimum, maximum} = boundsFor(record);\n return Math.min(maximum, Math.max(minimum, value));\n };\n\n const initialContext = (): PanelsContext => {\n const collection = collectionState();\n return {\n collection: {\n ids: collection.ids,\n collapsibleIds: collection.collapsibleIds,\n sizableIds: collection.sizableIds,\n resizableIds: collection.resizableIds,\n },\n layout: {collapsedIds: [...collection.authoredCollapsedIds], committedSizes: {}},\n authored: {collapsedIds: collection.authoredCollapsedIds},\n change: {openingIds: [], closingIds: []},\n resize: {activeId: '', initialSize: null, previewSize: null},\n sizing: {changes: []},\n };\n };\n\n const setMainConstraints = (element: HTMLElement, minimum: string, maximum: string): void => {\n if (renderedOrientation() === 'horizontal') {\n element.style.minWidth = minimum;\n element.style.maxWidth = maximum;\n element.style.minHeight = '';\n element.style.maxHeight = '';\n } else {\n element.style.minHeight = minimum;\n element.style.maxHeight = maximum;\n element.style.minWidth = '';\n element.style.maxWidth = '';\n }\n };\n\n const clearGeometry = (element: HTMLElement): void => {\n element.style.flex = '';\n element.style.minWidth = '';\n element.style.maxWidth = '';\n element.style.minHeight = '';\n element.style.maxHeight = '';\n };\n\n const applyGeometry = (record: PanelRecord, transitionSize?: number): void => {\n if (isResponsiveStacked()) {\n clearGeometry(record.panel);\n return;\n }\n if (transitionSize !== undefined) {\n record.panel.style.flex = `0 0 ${transitionSize}px`;\n setMainConstraints(record.panel, '0px', 'none');\n return;\n }\n if (isCollapsed(record.props.id)) {\n if (context().authored.collapsedIds.includes(record.props.id)) {\n clearGeometry(record.panel);\n return;\n }\n const collapsedSize = record.collapsed ? 'var(--spacing-panel-collapsed)' : '0px';\n record.panel.style.flex = `0 0 ${collapsedSize}`;\n setMainConstraints(record.panel, collapsedSize, collapsedSize);\n return;\n }\n if (record.props.size === 'fill') {\n clearGeometry(record.panel);\n return;\n }\n const committed = context().resize.activeId === record.props.id\n ? context().resize.previewSize\n : context().layout.committedSizes[record.props.id];\n if (committed === undefined || committed === null) {\n clearGeometry(record.panel);\n return;\n }\n const basis = `${clampPanelSize(record, committed)}px`;\n record.panel.style.flex = `0 1 ${basis}`;\n setMainConstraints(\n record.panel,\n `var(--spacing-panel-${record.props.size}-min)`,\n `var(--spacing-panel-${record.props.size}-max)`,\n );\n };\n\n const setInert = (element: HTMLElement, inert: boolean): void => {\n element.toggleAttribute('inert', inert);\n element.setAttribute('aria-hidden', inert ? 'true' : 'false');\n };\n\n const syncPanel = (record: PanelRecord): void => {\n const props = currentProps();\n const orientation = effectiveOrientation();\n const collapsed = isCollapsed(record.props.id);\n const opening = bridge.hasTag('changing') && context().change.openingIds.includes(record.props.id);\n const closing = bridge.hasTag('changing') && context().change.closingIds.includes(record.props.id);\n const finalCollapsed = collapsed && !closing;\n const showExpanded = !finalCollapsed;\n const showCollapsed = collapsed && !closing && !opening && record.collapsed !== null;\n\n record.panel.dataset.state = collapsed ? 'collapsed' : 'expanded';\n record.panel.dataset.orientation = orientation;\n record.panel.dataset.size = record.props.size;\n record.panel.dataset.resize = record.props.resize;\n record.panel.className = resolveStyle({\n part: panelsStyles.parts.panel,\n props: {orientation, divider: props.divider, resize: record.props.resize},\n className: record.props.class,\n });\n setPresence({el: record.panel, attr: 'data-collapsible', present: record.props.collapsible});\n setPresence({el: record.panel, attr: 'data-resizing', present: context().resize.activeId === record.props.id});\n applyGeometry(record);\n\n record.expanded.hidden = !showExpanded;\n setInert(record.expanded, !showExpanded);\n if (record.collapsed) {\n record.collapsed.hidden = !showCollapsed;\n setInert(record.collapsed, !showCollapsed);\n }\n if (record.handle) {\n const disabled = isResponsiveStacked()\n || collapsed\n || record.props.size === 'fill'\n || record.props.resize === 'none';\n record.handle.dataset.orientation = orientation;\n record.handle.dataset.resizeEdge = record.props.resize;\n record.handle.setAttribute('aria-label', `Resize ${record.props.id} panel`);\n record.handle.toggleAttribute('data-resize-disabled', disabled);\n record.handle.hidden = isResponsiveStacked();\n record.handle.className = resolveStyle({\n part: panelsStyles.parts.resizeHandle,\n props: {orientation, edge: record.props.resize},\n className: record.handle.dataset.class ?? '',\n });\n }\n };\n\n const syncDividers = (items: PanelRecord[]): void => {\n items.forEach((record, index) => {\n const next = items[index + 1];\n const interactive = record.props.resize === 'end' || next?.props.resize === 'start';\n declareMorphAttributes(record.panel, 'data-divider');\n setPresence({\n el: record.panel,\n attr: 'data-divider',\n present: currentProps().divider && next !== undefined && !interactive,\n });\n });\n };\n\n const targetForToggle = (toggle: HTMLElement): {record: PanelRecord; controller: PanelsController} | null => {\n const explicit = toggle.dataset.target || '';\n if (!explicit) {\n const panel = toggle.closest<HTMLElement>('[data-ui-panel]');\n const group = panel?.closest<HTMLElement>('[data-ui-panels]');\n const controller = [...controllers].find((item) => item.id === group?.id);\n const record = panel && controller === component ? recordFor(panel.id) : null;\n return record && controller ? {record, controller} : null;\n }\n const groupId = toggle.dataset.groupId || toggle.closest<HTMLElement>('[data-ui-panels]')?.id;\n const candidates = [...controllers].filter((item) => !groupId || item.id === groupId);\n const controller = candidates.find((item) => item.hasPanel(explicit));\n const record = controller === component ? recordFor(explicit) : null;\n return record && controller ? {record, controller} : null;\n };\n\n const syncToggles = (): void => {\n document.querySelectorAll<HTMLElement>('[data-ui-panel-toggle]').forEach((toggle) => {\n const target = targetForToggle(toggle);\n if (!target || target.controller !== component) return;\n const collapsed = isCollapsed(target.record.props.id);\n toggle.dataset.target = target.record.props.id;\n toggle.dataset.groupId = currentProps().id;\n toggle.dataset.state = collapsed ? 'collapsed' : 'expanded';\n toggle.setAttribute('aria-controls', target.record.panel.id);\n toggle.setAttribute('aria-expanded', collapsed ? 'false' : 'true');\n toggle.toggleAttribute('disabled', !target.record.props.collapsible);\n });\n };\n\n const syncAll = (): void => {\n const props = currentProps();\n const orientation = effectiveOrientation();\n root().dataset.responsiveMode = responsiveMode;\n root().dataset.layoutOrientation = orientation;\n root().style.flexDirection = orientation === 'horizontal' ? 'row' : 'column';\n root().className = resolveStyle({\n part: panelsStyles.parts.root,\n props: {...props, orientation},\n className: props.class,\n });\n setPresence({el: root(), attr: 'data-resizing', present: bridge.hasTag('resizing')});\n setPresence({el: root(), attr: 'data-transitioning', present: bridge.hasTag('transitioning')});\n const items = records();\n items.forEach(syncPanel);\n syncDividers(items);\n syncToggles();\n };\n\n const focusExpanded = (record: PanelRecord, force = false): void => {\n const active = document.activeElement;\n if (!force && (!(active instanceof HTMLElement) || !record.collapsed?.contains(active))) return;\n const remembered = rememberedFocus.get(record.props.id);\n if (remembered?.isConnected && record.expanded.contains(remembered)) remembered.focus({preventScroll: true});\n else {\n record.expanded.tabIndex = -1;\n record.expanded.focus({preventScroll: true});\n }\n };\n\n const focusCollapsed = (record: PanelRecord, force = false): void => {\n const active = document.activeElement;\n if (!force && (!(active instanceof HTMLElement) || !record.expanded.contains(active))) return;\n const collapsedTarget = record.collapsed ? focusableElements(record.collapsed)[0] : undefined;\n const external = activeTriggers.get(record.props.id);\n const fallback = external?.isConnected && !record.panel.contains(external) ? external : undefined;\n if (collapsedTarget) collapsedTarget.focus({preventScroll: true});\n else if (fallback) fallback.focus({preventScroll: true});\n else {\n root().tabIndex = -1;\n root().focus({preventScroll: true});\n }\n };\n\n const prepareChange = (): void => {\n const changed = [...context().change.openingIds, ...context().change.closingIds];\n const openingNeedsFocus = new Set(context().change.openingIds.filter((id) => {\n const record = recordFor(id);\n const active = document.activeElement;\n return record !== null\n && record.collapsed !== null\n && active instanceof HTMLElement\n && record.collapsed.contains(active);\n }));\n const from = new Map(changed.flatMap((id) => {\n const record = recordFor(id);\n if (!record) return [];\n if (context().change.closingIds.includes(id)) {\n const active = document.activeElement;\n if (active instanceof HTMLElement && record.expanded.contains(active)) rememberedFocus.set(id, active);\n }\n return [[id, mainSize(record.panel)] as const];\n }));\n syncAll();\n context().change.openingIds.forEach((id) => {\n const record = recordFor(id);\n if (record) focusExpanded(record, openingNeedsFocus.has(id));\n });\n changed.forEach((id) => {\n const record = recordFor(id);\n const start = from.get(id);\n if (!record || start === undefined) return;\n const target = mainSize(record.panel);\n transitionGeometry.set(id, {from: start, to: target});\n applyGeometry(record, start);\n });\n };\n\n const finishChange = (): void => {\n const opening = [...context().change.openingIds];\n const closing = [...context().change.closingIds];\n const closingNeedsFocus = new Set(closing.filter((id) => {\n const record = recordFor(id);\n const active = document.activeElement;\n return record !== null && active instanceof HTMLElement && record.expanded.contains(active);\n }));\n records().forEach((record) => applyGeometry(record));\n syncAll();\n closing.forEach((id) => {\n const record = recordFor(id);\n if (record) focusCollapsed(record, closingNeedsFocus.has(id));\n });\n opening.forEach((panelId) => emitPanelEvent('ui:panel-expand', panelId));\n closing.forEach((panelId) => emitPanelEvent('ui:panel-collapse', panelId));\n [...opening, ...closing].forEach((id) => transitionGeometry.delete(id));\n };\n\n const emitPanelEvent = (name: string, panelId: string, detail: Record<string, unknown> = {}): void => {\n dispatch({el: root(), name, detail: {\n groupId: currentProps().id,\n panelId,\n __panelsNotification: true,\n ...detail,\n }});\n };\n\n const persist = (): void => {\n const layout = context().layout;\n if (currentProps().persist) {\n try {\n localStorage.setItem(storageKey(currentProps().id), JSON.stringify({\n collapsed: layout.collapsedIds,\n sizes: layout.committedSizes,\n }));\n } catch {\n // Persistence is optional; layout state remains committed in memory.\n }\n }\n dispatch({el: root(), name: 'ui:panels-layout-change', detail: {\n groupId: currentProps().id,\n collapsed: [...layout.collapsedIds],\n sizes: {...layout.committedSizes},\n __panelsNotification: true,\n }});\n };\n\n const runWhenStable = (callback: () => void): void => {\n if (!rootEl) return;\n if (bridge.hasTag('stable')) {\n callback();\n return;\n }\n const timer = window.setTimeout(() => {\n deferredTimers.delete(timer);\n runWhenStable(callback);\n }, 16);\n deferredTimers.add(timer);\n };\n\n const reconcileCollapsedState = (\n ids: readonly string[],\n wantsCollapsed: (id: string) => boolean,\n ): void => {\n const next = ids.find((id) => wantsCollapsed(id) !== isCollapsed(id));\n if (!next) return;\n bridge.send({type: wantsCollapsed(next) ? 'COLLAPSE' : 'EXPAND', panelId: next});\n runWhenStable(() => reconcileCollapsedState(ids, wantsCollapsed));\n };\n\n const restorePersistedLayout = (): void => {\n if (!currentProps().persist) return;\n let stored: {collapsed?: unknown; sizes?: unknown};\n try {\n stored = JSON.parse(localStorage.getItem(storageKey(currentProps().id)) ?? 'null') as {\n collapsed?: unknown;\n sizes?: unknown;\n };\n } catch {\n return;\n }\n if (typeof stored !== 'object' || stored === null) return;\n\n const collection = collectionState();\n const desiredCollapsed = new Set(\n (Array.isArray(stored.collapsed) ? stored.collapsed : [])\n .filter((id): id is string => typeof id === 'string' && collection.collapsibleIds.includes(id)),\n );\n const desiredSizes = numericRecord(stored.sizes);\n\n const restoreCollapsedState = (): void => {\n reconcileCollapsedState(collection.collapsibleIds, (id) => desiredCollapsed.has(id));\n };\n\n const restoreSizes = (): void => {\n const changes = collection.sizableIds.flatMap((id): PanelSizingTransitionData[] => {\n const record = recordFor(id);\n const storedSize = desiredSizes[id];\n if (!record || storedSize === undefined) return [];\n const from = mainSize(record.panel);\n const to = clampPanelSize(record, storedSize);\n return Math.abs(from - to) < 0.5 ? [] : [{panelId: id, from, to}];\n });\n if (isResponsiveStacked()) {\n if (changes.length > 0) bridge.send({type: 'RESTORE_HIDDEN_SIZES', changes});\n restoreCollapsedState();\n return;\n }\n const hidden = changes.filter(({panelId: id}) => isCollapsed(id));\n const visible = changes.filter(({panelId: id}) => !isCollapsed(id));\n if (hidden.length > 0) bridge.send({type: 'RESTORE_HIDDEN_SIZES', changes: hidden});\n if (visible.length > 0) {\n bridge.send({type: 'SIZE', changes: visible});\n runWhenStable(restoreCollapsedState);\n return;\n }\n restoreCollapsedState();\n };\n\n const opening = collection.collapsibleIds.filter((id) => isCollapsed(id) && !desiredCollapsed.has(id));\n if (opening.length > 0) {\n reconcileCollapsedState(opening, () => false);\n runWhenStable(restoreSizes);\n } else restoreSizes();\n };\n\n const schedulePersistedRestore = (): void => {\n const first = requestAnimationFrame(() => {\n restoreFrames.delete(first);\n const second = requestAnimationFrame(() => {\n restoreFrames.delete(second);\n restorePersistedLayout();\n });\n restoreFrames.add(second);\n });\n restoreFrames.add(first);\n };\n\n const resetLayout = (panelId?: string): void => {\n const collection = collectionState();\n const targetIds = panelId ? collection.ids.filter((id) => id === panelId) : collection.ids;\n if (targetIds.length === 0) return;\n\n const restoreCollapsedState = (): void => {\n reconcileCollapsedState(\n targetIds.filter((id) => collection.collapsibleIds.includes(id)),\n (id) => context().authored.collapsedIds.includes(id),\n );\n };\n\n const sizedIds = targetIds.filter((id) => (\n collection.sizableIds.includes(id) && Object.hasOwn(context().layout.committedSizes, id)\n ));\n if (isResponsiveStacked()) {\n if (sizedIds.length > 0) {\n bridge.send({type: 'RESET_HIDDEN_SIZES', ids: sizedIds});\n runWhenStable(restoreCollapsedState);\n } else restoreCollapsedState();\n return;\n }\n const hiddenIds = sizedIds.filter(isCollapsed);\n if (hiddenIds.length > 0) bridge.send({type: 'RESET_HIDDEN_SIZES', ids: hiddenIds});\n\n const visible = sizedIds.filter((id) => !isCollapsed(id)).flatMap((id): PanelSizingTransitionData[] => {\n const record = recordFor(id);\n if (!record || record.props.size === 'fill') return [];\n return [{\n panelId: id,\n from: mainSize(record.panel),\n to: cssLength(`--spacing-panel-${record.props.size}`),\n reset: true,\n }];\n });\n if (visible.length > 0) {\n bridge.send({type: 'SIZE', changes: visible});\n runWhenStable(restoreCollapsedState);\n return;\n }\n restoreCollapsedState();\n };\n\n const prepareSizing = (): void => {\n context().sizing.changes.forEach(({panelId: id, from}) => {\n const record = recordFor(id);\n if (record) applyGeometry(record, from);\n });\n };\n\n const finishSizing = (): void => {\n context().sizing.changes.forEach(({panelId: id, to}) => {\n const record = recordFor(id);\n if (!record) return;\n applyGeometry(record);\n emitPanelEvent('ui:panel-resize-end', id, {size: to});\n });\n syncAll();\n };\n\n const resizeDirection = (edge: PanelResizeEdge): ResizeDirection => {\n if (effectiveOrientation() === 'vertical') return edge === 'start' ? 'negative' : 'positive';\n const rtl = isRtl({el: root()});\n return edge === 'start' ? rtl ? 'positive' : 'negative' : rtl ? 'negative' : 'positive';\n };\n\n const initializeResizeHandles = (): void => {\n const currentPanels = new Set(records().map(({panel}) => panel));\n resizeCleanups.forEach((dispose, panel) => {\n if (currentPanels.has(panel)) return;\n dispose();\n resizeCleanups.delete(panel);\n });\n records().forEach((record) => {\n if (resizeCleanups.has(record.panel) || !record.handle || record.props.size === 'fill' || record.props.resize === 'none') return;\n const bounds = boundsFor(record);\n const handleSize = cssLength('--spacing-panel-resize-handle');\n const coarseHandleSize = cssLength('--spacing-panel-resize-handle-coarse');\n resizeCleanups.set(record.panel, createResizable({\n element: record.panel,\n handle: record.handle,\n axis: effectiveOrientation() === 'horizontal' ? 'x' : 'y',\n direction: resizeDirection(record.props.resize),\n min: bounds.minimum,\n max: bounds.maximum,\n mode: 'onChange',\n hitArea: handleSize,\n coarseHitArea: coarseHandleSize,\n disabled: () => isResponsiveStacked() || isCollapsed(record.props.id),\n onStart: (event) => bridge.send({type: 'RESIZE_START', panelId: record.props.id, size: resizeValue(event)}),\n onResize: (event) => bridge.send({type: 'RESIZE', panelId: record.props.id, size: resizeValue(event)}),\n onEnd: (event) => bridge.send({type: 'RESIZE_END', panelId: record.props.id, size: resizeValue(event)}),\n }));\n });\n };\n\n const reinitializeResizeHandles = (): void => {\n resizeCleanups.forEach((dispose) => dispose());\n resizeCleanups.clear();\n initializeResizeHandles();\n };\n\n const resizeValue = (event: ResizeEvent): number => effectiveOrientation() === 'horizontal'\n ? event.previewWidth\n : event.previewHeight;\n\n const reconcileResponsiveMode = (width: number): void => {\n const next: PanelsResponsiveMode = currentProps().orientation === 'horizontal'\n && width < compositionBreakpointPixels(root(), 'sm')\n ? 'stacked'\n : 'wide';\n if (next === responsiveMode) return;\n responsiveMode = next;\n syncAll();\n reinitializeResizeHandles();\n };\n\n const bridge = createAlpineMachine({\n schema: panelsSchema,\n hooks: panelsHooks,\n resolveTransitionElement: ({data}) => {\n const panelId = (data as PanelTransitionData | undefined)?.panelId;\n return panelId ? recordFor(panelId)?.panel ?? null : root();\n },\n createMachine: ({props}) => createPanelsMachine({\n props,\n context: initialContext(),\n effects: {\n prepareChange,\n finishChange,\n sync: () => {\n syncAll();\n reinitializeResizeHandles();\n },\n beginResize: () => {\n syncAll();\n },\n previewResize: () => {\n const id = context().resize.activeId;\n const record = recordFor(id);\n if (record) applyGeometry(record);\n const size = context().resize.previewSize;\n if (size !== null) emitPanelEvent('ui:panel-resize', id, {size});\n },\n commitResize: (scope) => {\n syncAll();\n const id = typeof scope.event.panelId === 'string' ? scope.event.panelId : '';\n const size = context().layout.committedSizes[id];\n if (id && size !== undefined) emitPanelEvent('ui:panel-resize-end', id, {size});\n },\n cancelResize: syncAll,\n prepareSizing,\n finishSizing,\n persist,\n },\n }),\n });\n\n const sendPanelsChanged = (): void => {\n const collection = collectionState();\n bridge.send({type: 'PANELS_CHANGED', ...collection});\n initializeResizeHandles();\n };\n\n const setupObserver = (): void => {\n disconnectObserver = observeSemanticChanges({\n targets: root(),\n read: collectionState,\n onChange: sendPanelsChanged,\n observer: {\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: [\n 'id', 'data-size', 'data-resize', 'data-collapsible', 'data-default-collapsed',\n ],\n },\n });\n };\n\n let component!: TrellisAlpineComponent<PanelsData>;\n component = {\n ...bridge,\n get id() { return root().id || currentProps().id; },\n get orientation() { return effectiveOrientation(); },\n get collapsed() { return [...context().layout.collapsedIds]; },\n get sizes() { return {...context().layout.committedSizes}; },\n get root(): BindingObject {\n const props = this.snapshot.current?.props ?? currentProps();\n return mergeBindings({inputs: [\n resolveStyle({part: panelsStyles.parts.root, props, className: props.class}),\n {'data-ui-panels': ''},\n ]});\n },\n init(): void {\n rootEl = this.$el;\n bridge.connect(this.$el, this.snapshot);\n root().id ||= currentProps().id;\n responsiveMode = currentProps().orientation === 'horizontal'\n && root().getBoundingClientRect().width < compositionBreakpointPixels(root(), 'sm')\n ? 'stacked'\n : 'wide';\n controllers.add(component);\n registerDocumentListeners();\n syncAll();\n initializeResizeHandles();\n resizeObserver = new ResizeObserver((entries) => {\n reconcileResponsiveMode(entries[0]?.contentRect.width ?? root().clientWidth);\n });\n resizeObserver.observe(root());\n setupObserver();\n if (currentProps().persist) schedulePersistedRestore();\n cleanup.push(addListener({target: root(), event: 'keydown', handler: () => syncToggles()}));\n },\n destroy(): void {\n controllers.delete(component);\n disconnectObserver?.();\n disconnectObserver = null;\n resizeObserver?.disconnect();\n resizeObserver = null;\n resizeCleanups.forEach((dispose) => dispose());\n resizeCleanups.clear();\n cleanup.forEach((dispose) => dispose());\n cleanup = [];\n deferredTimers.forEach((timer) => window.clearTimeout(timer));\n deferredTimers.clear();\n restoreFrames.forEach((frame) => cancelAnimationFrame(frame));\n restoreFrames.clear();\n bridge.disconnect();\n rootEl = null;\n },\n transitionPanel(transition: PanelMotionTransition): MotionHandle {\n const id = transition.data.panelId;\n const record = recordFor(id);\n const geometry = transitionGeometry.get(id);\n if (!record || !geometry || geometry.from === geometry.to) {\n if (record) applyGeometry(record, geometry?.to);\n return noopHandle();\n }\n return animateSize(transition, {\n target: record.panel,\n keyframes: {flexBasis: [`${geometry.from}px`, `${geometry.to}px`]},\n role: 'layout',\n cleanup: () => applyGeometry(record),\n });\n },\n transitionPanelSize(transition: PanelSizingMotionTransition): MotionHandle {\n const {panelId: id, from, to} = transition.data;\n const record = recordFor(id);\n if (!record || from === to) {\n if (record) applyGeometry(record);\n return noopHandle();\n }\n return animateSize(transition, {\n target: record.panel,\n keyframes: {flexBasis: [`${from}px`, `${to}px`]},\n role: 'layoutQuick',\n cleanup: () => applyGeometry(record),\n });\n },\n hasPanel(id: string): boolean { return recordFor(id) !== null; },\n isCollapsed,\n collapse(id: string): void { bridge.send({type: 'COLLAPSE', panelId: id}); },\n expand(id: string): void { bridge.send({type: 'EXPAND', panelId: id}); },\n toggle(id: string): void { bridge.send({type: 'TOGGLE', panelId: id}); },\n resize(id: string, size: number): void {\n const record = recordFor(id);\n if (\n isResponsiveStacked()\n || !record\n || record.props.size === 'fill'\n || isCollapsed(id)\n || !Number.isFinite(size)\n ) return;\n const from = mainSize(record.panel);\n const to = clampPanelSize(record, size);\n if (Math.abs(from - to) < 0.5) return;\n bridge.send({type: 'SIZE', panelId: id, from, to});\n },\n reset(id?: string): void { resetLayout(id); },\n perform(action: PanelToggleAction, id: string, trigger?: HTMLElement | null): void {\n if (trigger) activeTriggers.set(id, trigger);\n ({collapse: this.collapse, expand: this.expand, toggle: this.toggle})[action](id);\n },\n syncToggles,\n };\n\n return component;\n};\n\nconst UiPanelToggle = (): TrellisAlpineComponent<{\n props: PanelToggleProps;\n readonly root: BindingObject;\n trigger(event?: Event): void;\n}> => {\n let props = {} as PanelToggleProps;\n return {\n get props() { return props; },\n init() { props = decodeProps({el: this.$el, schema: panelToggleSchema}); },\n destroy() {},\n get root() {\n return mergeBindings({inputs: [\n resolveStyle({part: panelsStyles.parts.toggle, props: {}, className: props.class}),\n {\n 'data-ui-panel-toggle': '',\n ':data-target': () => props.target || undefined,\n ':data-action': () => props.action,\n '@click': (event: Event) => this.trigger(event),\n },\n ]});\n },\n trigger(event?: Event) {\n event?.preventDefault();\n const button = this.$el as HTMLElement;\n const closestPanel = button.closest<HTMLElement>('[data-ui-panel]');\n const closestGroup = closestPanel?.closest<HTMLElement>('[data-ui-panels]');\n const target = props.target || closestPanel?.id || '';\n if (!target) return;\n document.dispatchEvent(new CustomEvent('ui:panel-toggle', {detail: {\n panelId: target,\n groupId: closestGroup?.id,\n action: props.action,\n trigger: button,\n }}));\n },\n };\n};\n\nconst registerPanels = (AlpineInstance: Alpine.Alpine): void => {\n defineAlpineData('UiPanels', UiPanels)(AlpineInstance);\n defineAlpineData('UiPanelToggle', UiPanelToggle)(AlpineInstance);\n};\n\nexport {registerPanels, UiPanels, UiPanelToggle};\nexport type {\n PanelEventDetail,\n PanelsData,\n PanelsPersistTransitionData,\n PanelSizingTransitionData,\n PanelsTransition,\n UiPanelsApi,\n};\n","// Generated by scripts/generate_component_entries.mjs from packages/client/component-entries.json.\n// Do not edit by hand.\nimport type {Alpine as AlpineType} from 'alpinejs';\nimport {registerMotionCapability} from '../../capabilities/motion';\nimport {registerResizableCapability} from '../../capabilities/resizable';\nimport {registerPanels as registerComponent} from './index';\n\nconst registered = new WeakSet<AlpineType>();\n\nconst registerPanels = (AlpineInstance: AlpineType): void => {\n if (registered.has(AlpineInstance)) return;\n registered.add(AlpineInstance);\n registerMotionCapability(AlpineInstance);\n registerResizableCapability(AlpineInstance);\n registerComponent(AlpineInstance);\n};\n\nexport {registerPanels};\nexport default registerPanels;\nexport * from './index';\n"],"mappings":"gsBAEA,IAAM,GACF,EACA,IACS,CACT,IAAM,EAAQ,iBAAiB,CAAS,EAAE,iBAAiB,gBAAgB,GAAY,EACjF,EAAS,OAAO,WAAW,CAAK,EACtC,OAAO,OAAO,SAAS,CAAM,EAAI,EAAS,GAC9C,ECPM,EAAsB,CAAC,aAAc,UAAU,EAC/C,EAAkB,CAAC,MAAO,UAAW,QAAS,OAAQ,KAAK,EAC3D,EAAc,CAAC,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,MAAM,EACnD,EAAqB,CAAC,OAAQ,QAAS,KAAK,EAC5C,EAAuB,CAAC,SAAU,SAAU,UAAU,EAEtD,GAAe,CACjB,GAAI,EAAO,QAAQ,WAAW,EAC9B,YAAa,EAAM,EAAqB,YAAY,EACpD,QAAS,EACT,QAAS,EAAK,QAAQ,EAAI,EAC1B,MAAO,CACX,EAEM,GAAc,CAChB,GAAI,EACJ,GAAI,EAAM,EAAiB,SAAS,EACpC,KAAM,EAAM,EAAa,MAAM,EAC/B,OAAQ,EAAM,EAAoB,MAAM,EACxC,YAAa,EACb,iBAAkB,EAClB,MAAO,CACX,EAEM,EAAoB,CACtB,OAAQ,EACR,OAAQ,EAAM,EAAsB,QAAQ,EAC5C,KAAM,EAAO,QAAQ,MAAM,EAC3B,MAAO,EAAO,QAAQ,QAAQ,EAC9B,MAAO,CACX,ECuEM,GAAc,CA9CA,EAAW,CAC3B,KAAM,UACN,MAAO,WACP,YAAc,GAAa,EAAS,QAAQ,OAAO,WAAW,IAAK,IAAa,CAAC,SAAO,EAAE,EAC1F,OAAQ,cACR,QAAS,eACT,MAAO,CACH,OAAS,IAAqB,CAAC,KAAM,SAAU,SAAO,GACtD,SAAW,IAAqB,CAAC,KAAM,WAAY,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"}
@@ -0,0 +1,2 @@
1
+ import{t as e}from"./alpine-data-CytyCyfk.js";import{n as t,t as n}from"./cursor-data-source-5pQvlhmK.js";var r=e=>{let r=null,i=t(e,{cursor:n(()=>{if(!r)throw Error(`Cursor Virtualizer is not mounted.`);return r})}),a=i.init;return i.init=function(){r=this.$el,a.call(this)},i},i=n=>{e(`UiVirtualizer`,()=>t(n))(n),e(`UiCursorVirtualizer`,()=>r(n))(n)},a=new WeakSet,o=e=>{a.has(e)||(a.add(e),i(e))};export{r as n,o as t};
2
+ //# sourceMappingURL=entry2.generated-DCbmWkHV.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entry2.generated-DCbmWkHV.js","names":[],"sources":["../../../../../../../../client/src/components/virtualizer/index.ts","../../../../../../../../client/src/components/virtualizer/entry.generated.ts"],"sourcesContent":["import type Alpine from 'alpinejs';\n\nimport {defineAlpineData, type TrellisAlpineComponent} from '@client/runtime';\nimport {UiVirtualizer} from '../../runtime/virtualizer';\nimport type {\n UiVirtualizerApi,\n VirtualizerData,\n} from '../../runtime/virtualizer';\nimport {serverCursorOptions, type ServerCursorResponse} from '../../runtime/cursor-data-source';\n\nconst UiCursorVirtualizer = (\n AlpineInstance: Alpine.Alpine,\n): TrellisAlpineComponent<VirtualizerData<null>> & UiVirtualizerApi<null> => {\n let root: HTMLElement | null = null;\n const component = UiVirtualizer<null, ServerCursorResponse>(AlpineInstance, {\n cursor: serverCursorOptions(() => {\n if (!root) throw new Error('Cursor Virtualizer is not mounted.');\n return root;\n }),\n });\n const init = component.init;\n component.init = function initCursorVirtualizer(): void {\n root = (this as typeof this & {$el: HTMLElement}).$el;\n init.call(this);\n };\n return component;\n};\n\nconst registerVirtualizer = (AlpineInstance: Alpine.Alpine): void => {\n defineAlpineData('UiVirtualizer', () => UiVirtualizer(AlpineInstance))(AlpineInstance);\n defineAlpineData('UiCursorVirtualizer', () => UiCursorVirtualizer(AlpineInstance))(AlpineInstance);\n};\n\nexport {registerVirtualizer, UiCursorVirtualizer, UiVirtualizer};\nexport type {\n CursorDataSource,\n CursorFirstArgs,\n CursorMoveArgs,\n CursorPage,\n CursorResponseAdapter,\n CursorRenderPayload,\n CursorSeekArgs,\n SoughtCursorPage,\n CursorVirtualizerOptions,\n ResetOptions,\n SetUrlOptions,\n UiVirtualizerApi,\n VirtualizerOptions,\n VirtualizerData,\n VirtualScrollAlign,\n} from '../../runtime/virtualizer';\n","// Generated by scripts/generate_component_entries.mjs from packages/client/component-entries.json.\n// Do not edit by hand.\nimport type {Alpine as AlpineType} from 'alpinejs';\n\nimport {registerVirtualizer as registerComponent} from './index';\n\nconst registered = new WeakSet<AlpineType>();\n\nconst registerVirtualizer = (AlpineInstance: AlpineType): void => {\n if (registered.has(AlpineInstance)) return;\n registered.add(AlpineInstance);\n\n registerComponent(AlpineInstance);\n};\n\nexport {registerVirtualizer};\nexport default registerVirtualizer;\nexport * from './index';\n"],"mappings":"0GAUA,IAAM,EACF,GACyE,CACzE,IAAI,EAA2B,KACzB,EAAY,EAA0C,EAAgB,CACxE,OAAQ,MAA0B,CAC9B,GAAI,CAAC,EAAM,MAAU,MAAM,oCAAoC,EAC/D,OAAO,CACX,CAAC,CACL,CAAC,EACK,EAAO,EAAU,KAKvB,MAJA,GAAU,KAAO,UAAuC,CACpD,EAAQ,KAA0C,IAClD,EAAK,KAAK,IAAI,CAClB,EACO,CACX,EAEM,EAAuB,GAAwC,CACjE,EAAiB,oBAAuB,EAAc,CAAc,CAAC,EAAE,CAAc,EACrF,EAAiB,0BAA6B,EAAoB,CAAc,CAAC,EAAE,CAAc,CACrG,ECzBM,EAAa,IAAI,QAEjB,EAAuB,GAAqC,CAC1D,EAAW,IAAI,CAAc,IACjC,EAAW,IAAI,CAAc,EAE7B,EAAkB,CAAc,EACpC"}
@@ -0,0 +1,2 @@
1
+ import{t as e}from"./capability-motion-DRILCSFH.js";import{c as t,f as n,l as r,n as i,o as a,s as o,u as s}from"./codecs-Cb1ns_47.js";import{a as c,s as l}from"./alpine-machine-BTDXpEr6.js";import{n as u}from"./dom-invalidation-Dw6clnS4.js";import{t as d}from"./fragment-Bl3Rq38L.js";import{t as f}from"./alpine-data-CytyCyfk.js";import{a as ee,i as p,n as te,r as ne,t as re}from"./cursor-data-source-5pQvlhmK.js";import{t as ie}from"./drag-and-drop-DHq3udf7.js";import{t as m}from"./capability-sortable-CpSdQwYp.js";import{L as h,y as g}from"./common-Dfj6NCjU.js";import{t as _}from"./capability-resizable-Bga8TngJ.js";var v=[`none`,`single`,`multiple`],y=[`compact`,`default`,`comfortable`],b=[`none`,`row`,`grid`],x=[`onChange`,`onEnd`],S=[``,`left`,`right`],C=[`none`,`ascending`,`descending`,`other`],w=[`start`,`center`,`end`],T={fetchUrl:n,cursor:i,query:o(null),totalRows:t.min(0).default(0),rowHeight:t.min(2**-52).default(36),bufferSize:t.min(1).default(50),overscan:t.min(0).default(0),initialIndex:t.min(0).default(0),startParam:n.default(`start`),countParam:n.default(`count`),totalParam:n.default(`total`),totalHeader:n.default(`X-Trellis-Total-Items`),assetsHeader:n.default(`X-Trellis-Assets`),metaSelector:n.default(`template[data-ui-virtualizer-meta]`),selection:r(v,`none`),selectionValue:o({mode:`ids`,ids:[]}),selectOnRowClick:i,rowKey:n.default(`id`),stickyHeader:i.default(!0),resizableColumns:i.default(!0),reorderableColumns:i.default(!0),sortableColumns:i.default(!0),minColumnWidth:t.min(0).default(60),defaultColumnWidth:t.min(2**-52).default(180),maxColumnWidth:o(null),resizeMode:r(x,`onChange`),color:r(h,`neutral`),interaction:r(g,`edge`),dragPreviewPosition:n.trim.default(`preserve`),density:r(y,`default`),border:r(b,`row`),empty:n.default(`No rows found.`),class:n,controlsClass:n,viewportClass:n,headerClass:n,rowClass:n,cellClass:n,footerClass:n,emptyClass:n};t.min(2**-52).default(180),t.min(0).default(60),o(null),r(S,``),r(C,`none`),i.default(!0),i.default(!0),r(w,`start`),o([]),o([]),t.min(0).default(0),n.default(`id`),n.default(`ui.data-grid.row`),n.default(`ui.data-grid.cell`),t.min(0).default(0),t.min(1).default(1),r(w,`start`);var E=(e,t,n)=>{let r=e.getAttribute(t);if(r===null||r.trim()===``)return n;let i=Number(r);return Number.isFinite(i)?i:n},D=(e,t,n)=>{let r=e.getAttribute(t);if(r===null||r.trim()===``)return n;let i=Number(r);return Number.isFinite(i)&&i>0?i:null},O=(e,t,n)=>{if(!e.hasAttribute(t))return n;let r=e.getAttribute(t)??``;return r===``||[`true`,`1`,`yes`,`on`].includes(r.toLowerCase())},ae=(e,t)=>{let n=new Set;return e.flatMap(e=>{let r=(e.dataset.column??``).trim();if(!r)throw Error(`Data Grid columns require a non-empty key.`);if(e.hasAttribute(`data-hidden`))return[];if(n.has(r))throw Error(`Data Grid column key "${r}" is duplicated.`);n.add(r);let i=Math.max(0,E(e,`data-min-width`,t.minWidth)),a=D(e,`data-max-width`,t.maxWidth),o=E(e,`data-width`,t.width),s=Math.min(a??1/0,Math.max(i,o)),c=e.dataset.pinned===`left`||e.dataset.pinned===`right`?e.dataset.pinned:null,l=[`ascending`,`descending`,`other`].includes(e.dataset.sort??``)?e.dataset.sort:`none`,u=[`center`,`end`].includes(e.dataset.align??``)?e.dataset.align:`start`;return[{key:r,label:e.dataset.label??e.textContent?.trim()??r,width:s,minWidth:i,maxWidth:a,hidden:!1,pinned:c,sortable:O(e,`data-sortable`,!1),sort:l,resizable:O(e,`data-resizable`,t.resizable),reorderable:O(e,`data-reorderable`,t.reorderable),align:u,cellClass:e.dataset.cellClass??``,element:e}]})},oe=e=>e.map(({width:e})=>`${e}px`).join(` `),k=e=>e.map(({element:e,...t})=>t),A=e=>{let t=new Map,n=new Map,r=0;return e.forEach(e=>{e.pinned===`left`&&(t.set(e.key,r),r+=e.width)}),r=0,[...e].reverse().forEach(e=>{e.pinned===`right`&&(n.set(e.key,r),r+=e.width)}),{left:t,right:n}},j=e=>globalThis.CSS?.escape?globalThis.CSS.escape(e):e.replace(/[^a-zA-Z0-9_-]/g,e=>`\\${e}`),se=(e,t)=>{let n=A(t),r=`z-index:2;background-color:var(--ui-surface-color);`;return t.map((t,i)=>{let a=`[data-ui-data-grid-scope="${j(e)}"]`,o=`[data-column="${j(t.key)}"]`,s=`${a} [data-ui-data-grid-column-header]${o},${a} [data-ui-data-grid-cell]${o}`,c=t.pinned===`left`?`position:sticky;left:${n.left.get(t.key)??0}px;${r}`:t.pinned===`right`?`position:sticky;right:${n.right.get(t.key)??0}px;${r}`:``;return`${s}{grid-column:${i+1};${c}}`}).join(``)},M=(e,t)=>{if(t===`multiple`&&typeof e==`object`&&e&&e.mode===`query`){let t=e;if(typeof t.token==`string`&&Number.isFinite(t.total))return{mode:`query`,token:t.token,total:Math.max(0,Math.floor(t.total??0)),except:[...new Set(Array.isArray(t.except)?t.except.filter(e=>typeof e==`string`):[])]}}let n=typeof e==`object`&&e&&e.mode===`ids`&&Array.isArray(e.ids)?e.ids.filter(e=>typeof e==`string`):[],r=[...new Set(n)];return{mode:`ids`,ids:t===`single`?r.slice(0,1):t===`none`?[]:r}},N=(e,t)=>e.mode===`query`?!e.except.includes(t):e.ids.includes(t),ce=(e,t,n,r)=>{let i=M(e,n);if(n===`none`)return{selection:i,added:[],removed:[]};let a=N(i,t),o=r??!a;if(a===o)return{selection:i,added:[],removed:[]};if(i.mode===`query`){let e=o?i.except.filter(e=>e!==t):[...i.except,t];return{selection:{...i,except:e},added:o?[t]:[],removed:o?[]:[t]}}return{selection:{mode:`ids`,ids:n===`single`&&o?[t]:o?[...i.ids,t]:i.ids.filter(e=>e!==t)},added:o?[t]:[],removed:o?[]:[t]}},le=(e,t,n)=>{let r=e.findIndex(e=>e.key===t);if(r<0||!e[r]?.reorderable)return null;let i=e[r]?.pinned??null;if(!e.flatMap((e,t)=>e.pinned===i?[t]:[]).includes(n))return null;let a=[...e],[o]=a.splice(r,1);return o?(a.splice(n,0,o),a):null},P=(e,t=0)=>Math.max(t,Math.floor(Number.isFinite(e)?e:t)),ue=`a,button,input,select,textarea,[contenteditable],[role="button"],[role="link"]`,F=e=>{let t=null,n=null,r=null,i=null,o=null,f=null,m=[],h=[],g=0,_={mode:`ids`,ids:[]},v=``,y=null,b=0,x=0,S=!1,C=null,w=!1,E=null,D=null,O=null,A=[],j=null,F=null,I=null,L=!1,R=!1,z=new Map,B=[],de=new WeakMap,fe=new WeakMap,V=ne(p),H=(e,n)=>{t?.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,detail:n}))},pe=(e,t,n)=>{let r=n.get(e)??[];r.length&&e.classList.remove(...r);let i=[...new Set(t.split(/\s+/).filter(Boolean))];i.length&&e.classList.add(...i),n.set(e,i)},me=()=>({width:$.props.defaultColumnWidth,minWidth:$.props.minColumnWidth,maxWidth:$.props.maxColumnWidth,resizable:$.props.resizableColumns,reorderable:$.props.reorderableColumns}),he=()=>ae(Array.from(t?.querySelectorAll(`[data-ui-data-grid-column-header]`)??[]),me()),ge=e=>{let t=e.element.querySelector(`[data-ui-data-grid-column-label]`),n=e.element.querySelector(`[data-ui-data-grid-sort-button]`);if(t)if(e.sortable&&!n){let n=document.createElement(`button`);n.type=`button`,n.setAttribute(`data-ui-data-grid-sort-button`,``),n.className=e.element.dataset.sortButtonClass??``;let r=document.createElement(`span`);r.setAttribute(`data-ui-data-grid-sort-indicator`,``),r.setAttribute(`aria-hidden`,`true`),t.replaceWith(n),n.append(t,r)}else !e.sortable&&n&&n.replaceWith(t)},U=()=>Array.from(t?.querySelectorAll(`[data-ui-data-grid-row]`)??[]),_e=e=>{i?.style.setProperty(`width`,`${e.getBoundingClientRect().width}px`)},W=()=>{U().forEach(e=>{let t=e.dataset.rowKey??``,n=$.props.selection!==`none`&&t!==``&&N(_,t);e.toggleAttribute(`data-selected`,n),$.props.selection===`none`?e.removeAttribute(`aria-selected`):e.setAttribute(`aria-selected`,String(n))})},G=()=>{if(!t||!f)return;t.style.setProperty(`--ui-data-grid-template`,oe(m));let e=t.dataset.uiDataGridScope??``;f.textContent=se(e,m),r?.setAttribute(`aria-colcount`,String(m.length));let n=t.querySelector(`[data-ui-data-grid-header-row]`);n&&_e(n);let i=n?.querySelector(`[data-ui-data-grid-column-indicator]`);i&&n?.append(i),U().forEach(e=>{let t=Array.from(e.children).filter(e=>e instanceof HTMLElement&&e.hasAttribute(`data-ui-data-grid-cell`)),n=new Map(t.flatMap(e=>e instanceof HTMLElement&&e.hasAttribute(`data-ui-data-grid-cell`)?[[e.dataset.column??``,e]]:[]));m.forEach(({key:t})=>{let r=n.get(t);r&&(r.hidden=!1,e.append(r))});let r=new Set(m.map(({key:e})=>e));t.forEach(t=>{r.has(t.dataset.column??``)||(t.hidden=!0,t.removeAttribute(`aria-colindex`),t.removeAttribute(`data-pinned`),e.append(t))})}),m.forEach((e,t)=>{ge(e),e.element.setAttribute(`aria-colindex`,String(t+1)),e.pinned?e.element.dataset.pinned=e.pinned:e.element.removeAttribute(`data-pinned`),e.sortable?e.element.setAttribute(`aria-sort`,e.sort):e.element.removeAttribute(`aria-sort`),e.element.dataset.disabled=String(!e.reorderable||!$.props.reorderableColumns);let n=e.element.querySelector(`[data-ui-data-grid-column-label-owned]`);n&&(n.textContent=e.label);let r=e.element.querySelector(`[data-ui-data-grid-column-preview-label]`);r&&(r.textContent=e.label);let i=e.element.querySelector(`[data-ui-data-grid-sort-indicator]`);i&&(i.textContent=e.sort===`ascending`?`↑`:e.sort===`descending`?`↓`:``),e.element.querySelector(`[data-ui-data-grid-resize-handle]`)?.setAttribute(`aria-label`,`Resize ${e.label||e.key} column`)}),U().forEach(e=>pe(e,$.props.rowClass,de)),t.querySelectorAll(`[data-ui-data-grid-cell]`).forEach(e=>{let t=m.findIndex(({key:t})=>t===e.dataset.column);if(t>=0){let n=m[t];e.setAttribute(`aria-colindex`,String(t+1)),e.dataset.align=n.align,pe(e,`${$.props.cellClass} ${n.cellClass}`,fe),n.pinned?e.dataset.pinned=n.pinned:e.removeAttribute(`data-pinned`)}})},ve=(e,t)=>{let n=new Map(e.map(e=>[e.key,e])),r=new Map(t.map(e=>[e.key,e]));return{previous:e,columns:t,added:t.filter(({key:e})=>!n.has(e)).map(({key:e})=>e),removed:e.filter(({key:e})=>!r.has(e)).map(({key:e})=>e),changed:t.flatMap(e=>{let t=n.get(e.key);if(!t)return[];let r=Object.keys(e).filter(n=>n!==`key`&&!l(t[n],e[n]));return r.length?[{key:e.key,fields:r}]:[]})}},ye=()=>{if(L=!1,!t||S)return;let e=he(),n=k(e),r=!l(A,n),i=m.length!==e.length||m.some((t,n)=>t.element!==e[n]?.element),a=i||m.some((t,n)=>{let r=e[n];return!r||t.key!==r.key||t.resizable!==r.resizable||t.minWidth!==r.minWidth||t.maxWidth!==r.maxWidth});if(r||i||R){let t=A;m=e,A=n;let i=a||R;R=!1,G(),i&&Ee(),r&&H(`ui:data-grid-columns-change`,ve(t,n))}if($.props.totalRows!==g&&(J($.props.totalRows),E&&(t.dataset.totalItems=String(g))),E){let e=t.hasAttribute(`data-query`)?$.props.query:D;l(O,e)||(O=c(e),E.setQuery(e))}},K=()=>{L||(L=!0,queueMicrotask(ye))},q=()=>{!t||!o||(E||(t.toggleAttribute(`data-loading`,x>0),t.toggleAttribute(`data-empty`,g===0)),t.dataset.selection=$.props.selection,r?.setAttribute(`aria-rowcount`,String(g+1)),t.style.setProperty(`--ui-data-grid-row-height`,`${$.props.rowHeight}px`),t.style.setProperty(`--ui-data-grid-total-height`,`${Math.max(g*$.props.rowHeight,$.props.rowHeight)}px`),(!E||g>0)&&(o.style.height=`var(--ui-data-grid-total-height)`),W())},J=e=>{let t=P(e);t!==g&&(g=t,q(),H(`ui:data-grid-total-change`,{totalRows:g}))},be=e=>p.compute({axes:{y:{total:g,itemSize:$.props.rowHeight,viewportSize:$.props.bufferSize*$.props.rowHeight,scrollOffset:e*$.props.rowHeight,buffer:0}}}),xe=e=>{if(g===0)return[];let t=P($.props.bufferSize,1),n=Math.min(g-1,Math.floor(Math.max(0,e)/$.props.rowHeight)),r=Math.floor(n/t)*t,i=Math.floor((g-1)/t)*t,a=[r-t,r,r+t].map(e=>Math.min(i,Math.max(0,e)));return r===0&&i>t?a.splice(0,3,0,t,Math.min(i,t*2)):r===i&&i>t&&a.splice(0,3,Math.max(0,i-t*2),i-t,i),[...new Set(a)].map(be)},Se=e=>{let t=e.axes.y;if(!t)throw Error(`Data Grid requires a vertical virtual window.`);let n=new URL($.props.fetchUrl,document.baseURI);return n.searchParams.set($.props.startParam,String(t.start)),n.searchParams.set($.props.countParam,String(t.count)),n.searchParams.set($.props.totalParam,String(t.total)),/^[a-z][a-z\d+.-]*:/i.test($.props.fetchUrl)||$.props.fetchUrl.startsWith(`//`)?n.href:`${n.pathname}${n.search}${n.hash}`},Ce=()=>{if(x=Math.max(0,x-1),q(),x>0||y===null||S)return;let e=y;y=null,Y(e)},we=async(n,r,i)=>{let a=r.axes.y;if(!a)return;let o=new AbortController;z.set(n.key,o),x+=1,q(),t?.removeAttribute(`data-error`),H(`ui:data-grid-load-start`,{window:r});try{let s=globalThis.crypto?.randomUUID?.()??`${Date.now()}-${i.requestGeneration}`,c=await fetch(Se(r),{method:`GET`,headers:{Accept:`text/html`,"X-Trellis-Virtualizer":`true`,"X-Trellis-Request-ID":s},signal:o.signal});if(!c.ok&&c.status!==204){V.fail(i),t?.setAttribute(`data-error`,``),H(`ui:data-grid-error`,{window:r,status:c.status});return}let l=await ee(c,$.props);if(V.pending(n.key)!==i||S||!await d(e,n.element,l.html,{assets:l.assets,shouldReplace:()=>V.pending(n.key)===i&&!S})||(l.totalItems!==null&&J(l.totalItems),!V.commit(i,r)))return;n.element.style.height=`${a.count*$.props.rowHeight}px`,n.element.style.transform=`translateY(${a.translateOffset}px)`,G(),W(),H(`ui:data-grid-load`,{window:r,start:a.start,count:a.count,end:a.start+a.count})}catch(e){if(o.signal.aborted)return;V.fail(i),t?.setAttribute(`data-error`,``),H(`ui:data-grid-error`,{window:r,status:0,error:e})}finally{z.get(n.key)===o&&z.delete(n.key),Ce()}},Y=t=>{if(E||$.props.cursor)return;if(x>0){y=t;return}let n=xe(t),r=Math.min(Math.max(0,g-1),Math.floor(Math.max(0,t)/$.props.rowHeight)),i=n.find(e=>{let t=e.axes.y;return t&&r>=t.start&&r<t.start+t.count})??n[0];if(i&&v!==i.key){v=i.key;let e=i.axes.y;H(`ui:data-grid-range`,{start:e.start,count:e.count,end:e.start+e.count,window:i})}if(n.length===0){h.forEach(t=>void d(e,t.element,``));return}let a=new Set;n.forEach(e=>{let t=h.find(t=>V.mounted(t.key)?.key===e.key);t&&a.add(t)});let o=h.filter(e=>!a.has(e));n.forEach(e=>{if(h.some(t=>V.mounted(t.key)?.key===e.key))return;let t=o.shift();if(!t)return;let n=V.begin(t.key,e);n&&we(t,e,n)})},X=()=>{z.forEach(e=>e.abort()),z.clear(),x=0,y=null,v=``,V.invalidate(),h.forEach(t=>{t.element.style.height=``,t.element.style.transform=``,d(e,t.element,``)}),q()},Z=(e,n)=>{_=M(e,$.props.selection),w=!0,$.props.selectionValue=_,t&&s({el:t,schema:T,key:`selectionValue`,value:_}),w=!1,W(),H(`ui:data-grid-selection-change`,{selection:_,added:n?.added??[],removed:n?.removed??[]})},Q=(e,t)=>{let n=ce(_,String(e),$.props.selection,t);n.added.length===0&&n.removed.length===0||Z(n.selection,n)},Te=(e,t,n)=>{e.width=Math.min(e.maxWidth??1/0,Math.max(e.minWidth,t)),e.element.dataset.width=String(e.width),A=k(m),G(),H(`ui:data-grid-column-resize`,{column:e.key,width:e.width,phase:n})},Ee=()=>{B.splice(0).forEach(e=>e()),m.forEach(e=>{let t=e.element.querySelector(`[data-ui-data-grid-resize-handle]`);if(!t)return;let n=e.resizable&&$.props.resizableColumns;if(t.hidden=!e.resizable,n?t.removeAttribute(`aria-disabled`):t.setAttribute(`aria-disabled`,`true`),t.tabIndex=n?0:-1,!n)return;let r=t=>Te(e,t.previewWidth,t.phase);B.push(ie({element:e.element,handle:t,axis:`x`,min:e.minWidth,max:e.maxWidth,mode:$.props.resizeMode,disabled:()=>!$.props.resizableColumns||!e.resizable,onStart:r,onResize:r,onEnd:r}))})},$={get supportsSeek(){return E?.supportsSeek??!1},props:null,init(){t=this.$el,S=!1;let e=globalThis.crypto?.randomUUID?.()??`grid-${Date.now()}-${Math.random().toString(36).slice(2)}`;if(t.dataset.uiDataGridScope=e,t.querySelector(`[data-ui-data-grid-header-row]`)?.setAttribute(`data-sortable-scope`,e),this.props=a({el:t,schema:T,onChange:(e,t)=>{if(w)return;let n=t.map(({key:e})=>e);(n.includes(`selectionValue`)||n.includes(`selection`))&&(_=M(this.props.selectionValue,this.props.selection),W()),n.some(e=>[`resizableColumns`,`reorderableColumns`,`minColumnWidth`,`defaultColumnWidth`,`maxColumnWidth`].includes(e))&&(R=!0),n.some(e=>[`query`,`totalRows`,`resizableColumns`,`reorderableColumns`,`minColumnWidth`,`defaultColumnWidth`,`maxColumnWidth`].includes(e))&&K(),n.some(e=>[`fetchUrl`,`rowHeight`,`bufferSize`].includes(e))&&this.reload()}}),g=P(this.props.totalRows),_=M(this.props.selectionValue,this.props.selection),n=t.querySelector(`[data-ui-data-grid-viewport]`)??t.querySelector(`[data-ui-scroll-area-viewport]`),r=t.querySelector(`[data-ui-data-grid-inner]`),i=t.querySelector(`[data-ui-data-grid-body]`),o=t.querySelector(`[data-ui-data-grid-spacer]`),f=t.querySelector(`style[data-ui-data-grid-layout]`),h=Array.from(t.querySelectorAll(`[data-ui-data-grid-block]`)).slice(0,3).map((e,t)=>({element:e,key:`block-${t+1}`})),!n||!r||!i||!o||!f||h.length!==3)throw Error(`Data Grid requires one viewport, table owner, body, spacer, layout style, and three row blocks.`);n.setAttribute(`data-ui-data-grid-viewport`,``),m=he(),A=k(m),G(),Ee();let s=t.querySelector(`[data-ui-data-grid-header-row]`);s&&(typeof ResizeObserver<`u`&&(F=new ResizeObserver(()=>_e(s)),F.observe(s)),j=new MutationObserver(K),j.observe(s,{attributes:!0,childList:!0,subtree:!0,attributeFilter:[`data-column`,`data-label`,`data-width`,`data-min-width`,`data-max-width`,`data-hidden`,`data-pinned`,`data-sortable`,`data-sort`,`data-resizable`,`data-reorderable`,`data-align`,`data-cell-class`,`hidden`]})),I=u(t,{invalidateDom:K}),C=new AbortController,n.addEventListener(`scroll`,()=>{b||=requestAnimationFrame(()=>{b=0,n&&Y(n.scrollTop)})},{passive:!0,signal:C.signal}),t.addEventListener(`click`,e=>{let n=e.target,r=n.closest(`[data-ui-data-grid-sort-button]`);if(r&&this.props.sortableColumns){let t=r.closest(`[data-ui-data-grid-column-header]`),n=m.find(({key:e})=>e===t?.dataset.column);if(n?.sortable){let t=n.sort===`ascending`?`descending`:`ascending`;H(`ui:data-grid-sort`,{column:n.key,direction:t,additive:e.shiftKey})}return}let i=n.closest(`[data-ui-data-grid-row]`);if(!i||!t?.contains(i))return;let a=i.dataset.rowKey??``;this.props.selectOnRowClick&&!n.closest(ue)&&Q(a),H(`ui:data-grid-row-activate`,{rowKey:a,row:i})},{signal:C.signal}),t.addEventListener(`dblclick`,e=>{let t=e.target.closest(`[data-ui-data-grid-cell]`),n=t?.closest(`[data-ui-data-grid-row]`);t&&n&&H(`ui:data-grid-cell-activate`,{rowKey:n.dataset.rowKey??``,column:t.dataset.column??``,cell:t})},{signal:C.signal}),t.addEventListener(`ui:sortable-drop`,(e=>{let t=e.detail?.source;if(t?.type!==`data-grid-column`)return;let n=Number(e.detail?.index??e.detail?.anchor?.index);Number.isInteger(n)&&this.reorderColumn(String(t.id),n)}),{signal:C.signal}),t.addEventListener(`ui:virtualizer-total-change`,(e=>{!E||e.target!==t||J(Number(e.detail?.totalItems??0))}),{signal:C.signal}),t.addEventListener(`ui:virtualizer-load-start`,(e=>{!E||e.target!==t||H(`ui:data-grid-load-start`,{mode:`cursor`})}),{signal:C.signal}),t.addEventListener(`ui:virtualizer-load`,(e=>{!E||e.target!==t||(G(),W(),H(`ui:data-grid-load`,{...e.detail,mode:`cursor`}))}),{signal:C.signal}),t.addEventListener(`ui:virtualizer-error`,(e=>{!E||e.target!==t||H(`ui:data-grid-error`,{...e.detail,mode:`cursor`})}),{signal:C.signal}),n.style.overscrollBehavior=`contain`,n.style.overflowAnchor=`none`,n.scrollTop=p.scrollTo({total:g,itemSize:this.props.rowHeight,viewportSize:n.clientHeight,scrollOffset:0,buffer:this.props.bufferSize},{axis:`y`,index:this.props.initialIndex}),q(),this.props.cursor?this.useCursor(re(()=>{if(!t)throw Error(`Data Grid is not mounted.`);return t})):Y(n.scrollTop)},destroy(){S=!0,b&&cancelAnimationFrame(b),C?.abort(),C=null,j?.disconnect(),j=null,F?.disconnect(),F=null,I?.(),I=null,B.splice(0).forEach(e=>e()),E?.destroy(),E=null,X(),this.props.disconnect(),t=null,n=null,r=null,i=null,o=null,f=null,m=[],A=[],h=[]},scrollToIndex(e,t=`start`){if(E){E.scrollToIndex(e,t);return}n&&(n.scrollTop=p.scrollTo({total:g,itemSize:this.props.rowHeight,viewportSize:n.clientHeight,scrollOffset:n.scrollTop,buffer:this.props.bufferSize},{axis:`y`,index:e,align:t}),Y(n.scrollTop))},setTotalRows(e){t&&s({el:t,schema:T,key:`totalRows`,value:P(e)})},setQuery(e){t&&s({el:t,schema:T,key:`query`,value:e})},useCursor(r){if(!t||!n||!o)return;E?.destroy(),E=null,X(),t.dataset.totalItems=String(g),t.dataset.itemSize=String(this.props.rowHeight),o.setAttribute(`data-ui-virtualizer-spacer`,``),h.forEach(({element:e})=>e.setAttribute(`data-ui-virtualizer-block`,``)),D=r.query;let i=t.hasAttribute(`data-query`)?this.props.query:D;O=c(i);let a=te(e,{cursor:{...r,query:i}});E=a,Object.assign(a,{$el:t}),a.init()},setUrl(e,n={}){w=!0,this.props.fetchUrl=String(e),t&&s({el:t,schema:T,key:`fetchUrl`,value:String(e)}),w=!1,n.reset??!0?this.reset():this.reload()},reset(e={}){if(E){E.reset({scrollTop:e.scrollTop??0});return}this.reload({scrollTop:e.scrollTop??0})},reload(e={}){if(E){E.reload(e);return}let t=e.scrollTop??n?.scrollTop??0;X(),n&&(n.scrollTop=Math.max(0,t)),Y(t)},resizeColumn(e,t){let n=m.find(t=>t.key===e);n&&Te(n,Number(t),`end`)},reorderColumn(e,n){let r=m.findIndex(t=>t.key===e),i=le(m,e,P(n));if(!i)return;m=i,A=k(m);let a=t?.querySelector(`[data-ui-data-grid-header-row]`),o=a?.querySelector(`[data-ui-data-grid-column-indicator]`)??null;m.forEach(e=>a?.insertBefore(e.element,o)),G(),H(`ui:data-grid-column-reorder`,{column:e,from:r,to:P(n),columns:m.map(({key:e})=>e)})},selectRow(e){Q(String(e),!0)},deselectRow(e){Q(String(e),!1)},toggleRow(e){Q(String(e))},setSelection(e){Z(e)},selectQuery(e,t,n=[]){Z({mode:`query`,token:String(e),total:P(t),except:n.map(String)})},clearSelection(){Z({mode:`ids`,ids:[]})}};return $},I=e=>{f(`UiDataGrid`,()=>F(e))(e)},L=new WeakSet,R=t=>{L.has(t)||(L.add(t),_(t),e(t),m(t),I(t))};export{F as n,R as t};
2
+ //# sourceMappingURL=entry2.generated-JcxejQr4.js.map