@bino-bi/bn-template-engine 1.0.0-next.28 → 1.0.0-next.30

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 (449) hide show
  1. package/dist/bn-template-engine/bn-template-engine.esm.js +1 -1
  2. package/dist/bn-template-engine/p-132ad556.entry.js +1 -0
  3. package/dist/bn-template-engine/p-17d71782.entry.js +1 -0
  4. package/dist/bn-template-engine/p-40ba7f43.entry.js +1 -0
  5. package/dist/bn-template-engine/p-467871f3.entry.js +1 -0
  6. package/dist/bn-template-engine/p-64803a42.entry.js +1 -0
  7. package/dist/bn-template-engine/p-B8AjeKja.js +1 -0
  8. package/dist/bn-template-engine/p-CCZcKl0Q.js +2 -0
  9. package/dist/bn-template-engine/p-CrT83eO4.js +1 -0
  10. package/dist/bn-template-engine/p-D_DzKxRV.js +1 -0
  11. package/dist/bn-template-engine/p-Z2rUaSh_.js +1 -0
  12. package/dist/bn-template-engine/p-c41c0a1b.entry.js +1 -0
  13. package/dist/bn-template-engine/p-yc69rwuH.js +1 -0
  14. package/dist/cjs/{bn-asset_28.cjs.entry.js → bn-annotation-layer_30.cjs.entry.js} +27566 -26774
  15. package/dist/cjs/bn-grid.cjs.entry.js +11 -63
  16. package/dist/cjs/bn-image.cjs.entry.js +5 -6
  17. package/dist/cjs/bn-internationalization.cjs.entry.js +11 -7
  18. package/dist/cjs/bn-ruleset.cjs.entry.js +7 -8
  19. package/dist/cjs/bn-template-engine.cjs.js +2 -2
  20. package/dist/cjs/bn-text.cjs.entry.js +18 -18
  21. package/dist/cjs/{diagnostics-Cq-qDtXq.js → diagnostics-C4Ggts3w.js} +50 -2
  22. package/dist/cjs/{index-C1Z9vO7z.js → index-DGis1BzT.js} +0 -1
  23. package/dist/cjs/loader.cjs.js +2 -2
  24. package/dist/cjs/{withBodyObserver-CaPUjuC5.js → withBodyObserver-BK4idxqG.js} +2 -2
  25. package/dist/cjs/{context-protocol-C0rKepqu.js → withHasError-CqvcS23z.js} +462 -14
  26. package/dist/cjs/{withStyled-vSfogp9J.js → withStyled-70D4Isgt.js} +22 -35
  27. package/dist/cjs/{sanitizeHtml-Yx1xn6i_.js → withTranslation-C6Pye2CM.js} +148 -129
  28. package/dist/collection/collection-manifest.json +11 -11
  29. package/dist/collection/components/bn-annotation-layer/bn-annotation-layer.css +24 -0
  30. package/dist/collection/components/bn-annotation-layer/bn-annotation-layer.js +430 -0
  31. package/dist/collection/components/bn-annotation-layer/utils/marks.js +161 -0
  32. package/dist/collection/components/bn-annotation-layer/utils/matchPoint.js +25 -0
  33. package/dist/collection/components/bn-annotation-list/bn-annotation-list.css +46 -0
  34. package/dist/collection/components/bn-annotation-list/bn-annotation-list.js +112 -0
  35. package/dist/collection/components/bn-asset/bn-asset.js +1 -1
  36. package/dist/collection/components/bn-body/bn-body.js +24 -1
  37. package/dist/collection/components/bn-card/bn-card.js +24 -1
  38. package/dist/collection/components/bn-chart-bubble/{ibcs-chart-bubble.js → bn-chart-bubble-renderer/bn-chart-bubble-renderer.js} +153 -59
  39. package/dist/collection/components/bn-chart-bubble/bn-chart-bubble.js +70 -13
  40. package/dist/collection/components/bn-chart-bubble/utils/BubbleChart.js +29 -21
  41. package/dist/collection/components/bn-chart-bullet/{ibcs-chart-bullet.js → bn-chart-bullet-renderer/bn-chart-bullet-renderer.js} +127 -53
  42. package/dist/collection/components/bn-chart-bullet/bn-chart-bullet.js +83 -20
  43. package/dist/collection/components/bn-chart-bullet/utils/BulletChart.js +26 -17
  44. package/dist/collection/components/bn-chart-bullet/utils/model/BulletChartStyle.js +4 -4
  45. package/dist/collection/components/bn-chart-scatter/{ibcs-chart-scatter.js → bn-chart-scatter-renderer/bn-chart-scatter-renderer.js} +132 -53
  46. package/dist/collection/components/bn-chart-scatter/bn-chart-scatter.js +69 -12
  47. package/dist/collection/components/bn-chart-scatter/utils/ScatterChart.js +26 -14
  48. package/dist/collection/components/bn-chart-structure/{ibcs-chart-structure.js → bn-chart-structure-renderer/bn-chart-structure-renderer.js} +159 -66
  49. package/dist/collection/components/bn-chart-structure/bn-chart-structure.js +115 -95
  50. package/dist/collection/components/bn-chart-structure/utils/StructureChart.js +44 -15
  51. package/dist/collection/components/bn-chart-structure/utils/elements/Axis.js +1 -1
  52. package/dist/collection/components/bn-chart-structure/utils/elements/Bar.js +6 -2
  53. package/dist/collection/components/bn-chart-structure/utils/elements/Label.js +11 -0
  54. package/dist/collection/components/bn-chart-structure/utils/elements/Marker.js +5 -1
  55. package/dist/collection/components/bn-chart-structure/utils/elements/Needle.js +4 -1
  56. package/dist/collection/components/bn-chart-structure/utils/elements/StackedBar.js +6 -2
  57. package/dist/collection/components/bn-chart-time/{ibcs-chart-time.js → bn-chart-time-renderer/bn-chart-time-renderer.js} +188 -150
  58. package/dist/collection/components/bn-chart-time/bn-chart-time.js +140 -405
  59. package/dist/collection/components/bn-chart-time/utils/TimeChart.js +55 -15
  60. package/dist/collection/components/bn-chart-time/utils/elements/Column.js +5 -1
  61. package/dist/collection/components/bn-chart-time/utils/elements/Label.js +14 -0
  62. package/dist/collection/components/bn-chart-time/utils/elements/LineSeries.js +18 -12
  63. package/dist/collection/components/bn-chart-time/utils/elements/Marker.js +5 -1
  64. package/dist/collection/components/bn-chart-time/utils/elements/Needle.js +4 -1
  65. package/dist/collection/components/bn-chart-time/utils/elements/StackedColumn.js +6 -2
  66. package/dist/collection/components/bn-chart-time/utils/factories/ScenarioFactory.js +2 -2
  67. package/dist/collection/components/bn-chart-time/utils/model/TimeChartComponentConfig.js +2 -18
  68. package/dist/collection/components/bn-component-style/bn-component-style.js +3 -3
  69. package/dist/collection/components/bn-context/bn-context.js +24 -5
  70. package/dist/collection/components/bn-dataset/bn-dataset.js +8 -8
  71. package/dist/collection/components/bn-datasource/bn-datasource.js +8 -8
  72. package/dist/collection/components/bn-footer/bn-footer.css +1 -15
  73. package/dist/collection/components/bn-footer/bn-footer.js +17 -34
  74. package/dist/collection/components/bn-grid/bn-grid.js +38 -71
  75. package/dist/collection/components/bn-image/bn-image.js +21 -2
  76. package/dist/collection/components/bn-internationalization/bn-internationalization.js +7 -1
  77. package/dist/collection/components/bn-layout-card/bn-layout-card.js +3 -32
  78. package/dist/collection/components/bn-layout-page/bn-layout-page.js +3 -32
  79. package/dist/collection/components/bn-message/bn-message.js +20 -2
  80. package/dist/collection/components/bn-page/bn-page.js +22 -3
  81. package/dist/collection/components/bn-ruleset/bn-ruleset.js +3 -3
  82. package/dist/collection/components/bn-scaling-group/bn-scaling-group.js +9 -9
  83. package/dist/collection/components/bn-table/{ibcs-table.js → bn-table-renderer/bn-table-renderer.js} +230 -83
  84. package/dist/collection/components/bn-table/bn-table.js +134 -157
  85. package/dist/collection/components/bn-table/utils/Table.js +3 -3
  86. package/dist/collection/components/bn-table/utils/elements/TableRow.js +1 -1
  87. package/dist/collection/components/bn-table/utils/factories/tableDataSetFactory.js +38 -4
  88. package/dist/collection/components/bn-table/utils/helper/DataQuery.js +3 -1
  89. package/dist/collection/components/bn-table/utils/helper/barColumnGeometry.js +2 -2
  90. package/dist/collection/components/bn-text/bn-text.js +66 -8
  91. package/dist/collection/components/bn-title/{ibcs-title/ibcs-title.js → bn-title-renderer/bn-title-renderer.js} +59 -83
  92. package/dist/collection/components/bn-title/{ibcs-title → bn-title-renderer}/utils/Title.js +2 -2
  93. package/dist/collection/components/bn-title/{ibcs-title → bn-title-renderer}/utils/factories/TitleDataSetFactory.js +1 -1
  94. package/dist/collection/components/bn-title/bn-title.js +58 -14
  95. package/dist/collection/components/bn-tree/bn-tree.js +30 -28
  96. package/dist/collection/index.js +0 -1
  97. package/dist/collection/schemas.js +1 -0
  98. package/dist/collection/stores/componentStyles.js +10 -6
  99. package/dist/collection/stores/createScopedStores.js +3 -1
  100. package/dist/collection/stores/internationalization.js +10 -6
  101. package/dist/collection/utils/annotations.js +66 -0
  102. package/dist/collection/utils/autoFit.js +2 -2
  103. package/dist/collection/utils/emptyState.js +1 -1
  104. package/dist/collection/utils/ibcsRuleSet.js +42 -0
  105. package/dist/collection/utils/layoutState/dataPoint.js +59 -0
  106. package/dist/collection/utils/layoutState/geometry.js +46 -0
  107. package/dist/collection/utils/layoutState/index.js +1 -0
  108. package/dist/collection/utils/layoutState/svgChartElements.js +113 -11
  109. package/dist/collection/utils/layoutTemplate.js +0 -2
  110. package/dist/collection/utils/scaling.js +9 -0
  111. package/dist/collection/utils/validate.js +0 -7
  112. package/dist/collection/utils/withComponentStyle.js +14 -18
  113. package/dist/collection/utils/withDataset.js +22 -11
  114. package/dist/collection/utils/withHasError.js +17 -2
  115. package/dist/collection/utils/withRuleSet.js +7 -7
  116. package/dist/collection/utils/withTranslation.js +14 -14
  117. package/dist/collection/utils/xy/XYFrame.js +13 -3
  118. package/dist/collection/utils/xy/model/ScaleFactorsXYChart.js +8 -9
  119. package/dist/collection/utils/xy/pointKey.js +10 -0
  120. package/dist/components/{ibcs-chart-bullet.d.ts → bn-annotation-layer.d.ts} +4 -4
  121. package/dist/components/bn-annotation-layer.js +1 -0
  122. package/dist/components/{ibcs-chart-scatter.d.ts → bn-annotation-list.d.ts} +4 -4
  123. package/dist/components/bn-annotation-list.js +1 -0
  124. package/dist/components/bn-asset.js +1 -1
  125. package/dist/components/bn-body.js +1 -1
  126. package/dist/components/bn-card.js +1 -1
  127. package/dist/components/bn-chart-bubble-renderer.d.ts +11 -0
  128. package/dist/components/bn-chart-bubble-renderer.js +1 -0
  129. package/dist/components/bn-chart-bubble.js +1 -1
  130. package/dist/components/bn-chart-bullet-renderer.d.ts +11 -0
  131. package/dist/components/bn-chart-bullet-renderer.js +1 -0
  132. package/dist/components/bn-chart-bullet.js +1 -1
  133. package/dist/components/bn-chart-scatter-renderer.d.ts +11 -0
  134. package/dist/components/bn-chart-scatter-renderer.js +1 -0
  135. package/dist/components/bn-chart-scatter.js +1 -1
  136. package/dist/components/bn-chart-structure-renderer.d.ts +11 -0
  137. package/dist/components/bn-chart-structure-renderer.js +1 -0
  138. package/dist/components/bn-chart-structure.js +1 -1
  139. package/dist/components/{bn-template.d.ts → bn-chart-time-renderer.d.ts} +4 -4
  140. package/dist/components/bn-chart-time-renderer.js +1 -0
  141. package/dist/components/bn-chart-time.js +1 -1
  142. package/dist/components/bn-component-style.js +1 -1
  143. package/dist/components/bn-context.js +1 -1
  144. package/dist/components/bn-dataset.js +1 -1
  145. package/dist/components/bn-datasource.js +1 -1
  146. package/dist/components/bn-footer.js +1 -1
  147. package/dist/components/bn-grid.js +1 -1
  148. package/dist/components/bn-image.js +1 -1
  149. package/dist/components/bn-internationalization.js +1 -1
  150. package/dist/components/bn-layout-card.js +1 -1
  151. package/dist/components/bn-layout-page.js +1 -1
  152. package/dist/components/bn-message.js +1 -1
  153. package/dist/components/bn-page.js +1 -1
  154. package/dist/components/bn-ruleset.js +1 -1
  155. package/dist/components/bn-scaling-group.js +1 -1
  156. package/dist/components/{ibcs-chart-bubble.d.ts → bn-table-renderer.d.ts} +4 -4
  157. package/dist/components/bn-table-renderer.js +1 -0
  158. package/dist/components/bn-table.js +1 -1
  159. package/dist/components/bn-text.js +1 -1
  160. package/dist/components/{editor-companion.d.ts → bn-title-renderer.d.ts} +4 -4
  161. package/dist/components/bn-title-renderer.js +1 -0
  162. package/dist/components/bn-title.js +1 -1
  163. package/dist/components/bn-tree.js +1 -1
  164. package/dist/components/index.js +1 -1
  165. package/dist/components/p-B1nL0yOa.js +1 -0
  166. package/dist/components/p-B7uwck1J.js +1 -0
  167. package/dist/components/p-BDS_jiow.js +1 -0
  168. package/dist/components/p-BIIDTtcR.js +1 -0
  169. package/dist/components/p-BQMKgvEC.js +1 -0
  170. package/dist/components/p-BSV_vyqs.js +1 -0
  171. package/dist/components/p-BVKLCz2k.js +1 -0
  172. package/dist/components/p-BWBHlztH.js +1 -0
  173. package/dist/components/p-BXrPfAvP.js +1 -0
  174. package/dist/components/p-Ba9PUiBp.js +1 -0
  175. package/dist/components/p-BpCL2bfw.js +1 -0
  176. package/dist/components/p-BpsXOtoW.js +1 -0
  177. package/dist/components/p-Bs-YxJEt.js +1 -0
  178. package/dist/components/p-CGI6XIaK.js +1 -0
  179. package/dist/components/p-CMM8vtHW.js +1 -0
  180. package/dist/components/p-COqIkH1M.js +1 -0
  181. package/dist/components/p-CYwd_ZNM.js +1 -0
  182. package/dist/components/p-CkW23yp2.js +1 -0
  183. package/dist/components/p-CtBM3KFY.js +1 -0
  184. package/dist/{bn-template-engine/p-DFmSrSnf.js → components/p-CurWSJkH.js} +1 -1
  185. package/dist/components/p-CxPSvrcF.js +1 -0
  186. package/dist/components/p-D2Epww9R.js +1 -0
  187. package/dist/components/p-D5-dYgK_.js +1 -0
  188. package/dist/components/p-D6YGOYV1.js +2 -0
  189. package/dist/components/p-DEHnizot.js +1 -0
  190. package/dist/components/p-DIyUaSBg.js +1 -0
  191. package/dist/components/p-DPLcGhVt.js +1 -0
  192. package/dist/components/p-DUHp_9X-.js +1 -0
  193. package/dist/components/p-DYG9FH_u.js +1 -0
  194. package/dist/components/p-DdGnuNtc.js +1 -0
  195. package/dist/components/p-Dlb4ncGF.js +1 -0
  196. package/dist/components/p-Dm55bMs2.js +1 -0
  197. package/dist/components/p-Dq1AzGKX.js +1 -0
  198. package/dist/components/p-Dq4KMCDU.js +1 -0
  199. package/dist/components/p-DsOaqeTN.js +1 -0
  200. package/dist/components/p-Ds_BSK8v.js +1 -0
  201. package/dist/components/p-LZ9lAY8T.js +1 -0
  202. package/dist/components/p-U3zkcEJZ.js +1 -0
  203. package/dist/components/p-WzaayhTX.js +1 -0
  204. package/dist/components/p-X9hpquOX.js +1 -0
  205. package/dist/components/p-Xb6Ilq8u.js +1 -0
  206. package/dist/components/p-ey23VlID.js +1 -0
  207. package/dist/components/p-jbp6YiHf.js +1 -0
  208. package/dist/components/p-oJjMz8JF.js +1 -0
  209. package/dist/components/p-xhiPDAZa.js +1 -0
  210. package/dist/components/p-xpguaboj.js +1 -0
  211. package/dist/esm/{bn-asset_28.entry.js → bn-annotation-layer_30.entry.js} +24689 -23899
  212. package/dist/esm/bn-grid.entry.js +11 -63
  213. package/dist/esm/bn-image.entry.js +4 -5
  214. package/dist/esm/bn-internationalization.entry.js +9 -5
  215. package/dist/esm/bn-ruleset.entry.js +6 -7
  216. package/dist/esm/bn-template-engine.js +3 -3
  217. package/dist/esm/bn-text.entry.js +12 -12
  218. package/dist/esm/{diagnostics-vw6TKMiT.js → diagnostics-Cyqy1zDT.js} +48 -2
  219. package/dist/esm/{index-C5UYpZUU.js → index-CCZcKl0Q.js} +1 -1
  220. package/dist/esm/loader.js +3 -3
  221. package/dist/esm/{withBodyObserver-DD_-r04o.js → withBodyObserver-JcRB9OPQ.js} +2 -2
  222. package/dist/esm/{context-protocol-CdTp19uA.js → withHasError-l3cMN-oP.js} +458 -14
  223. package/dist/esm/{withStyled-BDEyKd_H.js → withStyled-DGOiR00Q.js} +17 -29
  224. package/dist/esm/{sanitizeHtml-C5bFtARM.js → withTranslation-BpO8BC5B.js} +144 -126
  225. package/dist/schemas/axis.schema.json +52 -0
  226. package/dist/schemas/i18n.schema.json +31 -0
  227. package/dist/schemas/partof.schema.json +33 -0
  228. package/dist/schemas/ruleset.schema.json +59 -0
  229. package/dist/schemas/stack.schema.json +51 -0
  230. package/dist/schemas/theme.schema.json +604 -0
  231. package/dist/schemas/thereof.schema.json +34 -0
  232. package/dist/types/components/bn-annotation-layer/bn-annotation-layer.d.ts +81 -0
  233. package/dist/types/components/bn-annotation-layer/utils/marks.d.ts +69 -0
  234. package/dist/types/components/bn-annotation-layer/utils/matchPoint.d.ts +17 -0
  235. package/dist/types/components/bn-annotation-list/bn-annotation-list.d.ts +35 -0
  236. package/dist/types/components/bn-body/bn-body.d.ts +5 -0
  237. package/dist/types/components/bn-card/bn-card.d.ts +5 -0
  238. package/dist/types/components/bn-chart-bubble/bn-chart-bubble-renderer/bn-chart-bubble-renderer.d.ts +97 -0
  239. package/dist/types/components/bn-chart-bubble/bn-chart-bubble.d.ts +20 -2
  240. package/dist/types/components/bn-chart-bullet/bn-chart-bullet-renderer/bn-chart-bullet-renderer.d.ts +81 -0
  241. package/dist/types/components/bn-chart-bullet/bn-chart-bullet.d.ts +21 -3
  242. package/dist/types/components/bn-chart-bullet/utils/BulletChart.d.ts +2 -0
  243. package/dist/types/components/bn-chart-bullet/utils/model/BulletChartStyle.d.ts +2 -2
  244. package/dist/types/components/bn-chart-scatter/bn-chart-scatter-renderer/bn-chart-scatter-renderer.d.ts +85 -0
  245. package/dist/types/components/bn-chart-scatter/bn-chart-scatter.d.ts +20 -2
  246. package/dist/types/components/bn-chart-structure/{ibcs-chart-structure.d.ts → bn-chart-structure-renderer/bn-chart-structure-renderer.d.ts} +43 -13
  247. package/dist/types/components/bn-chart-structure/bn-chart-structure.d.ts +29 -17
  248. package/dist/types/components/bn-chart-structure/utils/StructureChart.d.ts +7 -0
  249. package/dist/types/components/bn-chart-structure/utils/elements/Label.d.ts +5 -0
  250. package/dist/types/components/bn-chart-structure/utils/elements/Marker.d.ts +1 -0
  251. package/dist/types/components/bn-chart-structure/utils/elements/StackedBar.d.ts +2 -1
  252. package/dist/types/components/bn-chart-structure/utils/model/DataPoint.d.ts +3 -0
  253. package/dist/types/components/bn-chart-time/{ibcs-chart-time.d.ts → bn-chart-time-renderer/bn-chart-time-renderer.d.ts} +50 -17
  254. package/dist/types/components/bn-chart-time/bn-chart-time.d.ts +36 -66
  255. package/dist/types/components/bn-chart-time/utils/TimeChart.d.ts +7 -0
  256. package/dist/types/components/bn-chart-time/utils/elements/Label.d.ts +5 -0
  257. package/dist/types/components/bn-chart-time/utils/elements/LineSeries.d.ts +5 -1
  258. package/dist/types/components/bn-chart-time/utils/elements/Marker.d.ts +1 -0
  259. package/dist/types/components/bn-chart-time/utils/elements/StackedColumn.d.ts +2 -1
  260. package/dist/types/components/bn-chart-time/utils/factories/ScenarioFactory.d.ts +1 -1
  261. package/dist/types/components/bn-chart-time/utils/model/DataPoint.d.ts +3 -0
  262. package/dist/types/components/bn-chart-time/utils/model/TimeChartComponentConfig.d.ts +2 -8
  263. package/dist/types/components/bn-context/bn-context.d.ts +7 -1
  264. package/dist/types/components/bn-dataset/bn-dataset.d.ts +2 -2
  265. package/dist/types/components/bn-datasource/bn-datasource.d.ts +2 -2
  266. package/dist/types/components/bn-footer/bn-footer.d.ts +5 -7
  267. package/dist/types/components/bn-grid/bn-grid.d.ts +8 -6
  268. package/dist/types/components/bn-image/bn-image.d.ts +4 -0
  269. package/dist/types/components/bn-layout-card/bn-layout-card.d.ts +0 -1
  270. package/dist/types/components/bn-layout-page/bn-layout-page.d.ts +0 -1
  271. package/dist/types/components/bn-message/bn-message.d.ts +5 -0
  272. package/dist/types/components/bn-page/bn-page.d.ts +5 -0
  273. package/dist/types/components/bn-table/{ibcs-table.d.ts → bn-table-renderer/bn-table-renderer.d.ts} +49 -12
  274. package/dist/types/components/bn-table/bn-table.d.ts +48 -49
  275. package/dist/types/components/bn-table/utils/elements/Cell.d.ts +2 -0
  276. package/dist/types/components/bn-table/utils/elements/CellBarChart.d.ts +2 -1
  277. package/dist/types/components/bn-table/utils/elements/TableRow.d.ts +3 -0
  278. package/dist/types/components/bn-table/utils/factories/tableDataSetFactory.d.ts +9 -2
  279. package/dist/types/components/bn-text/bn-text.d.ts +19 -1
  280. package/dist/types/components/bn-title/{ibcs-title/ibcs-title.d.ts → bn-title-renderer/bn-title-renderer.d.ts} +15 -4
  281. package/dist/types/components/bn-title/bn-title.d.ts +15 -3
  282. package/dist/types/components/bn-tree/bn-tree.d.ts +6 -2
  283. package/dist/types/components.d.ts +2070 -2406
  284. package/dist/types/context/context-protocol.d.ts +2 -0
  285. package/dist/types/context/scopedDb.d.ts +9 -12
  286. package/dist/types/index.d.ts +0 -1
  287. package/dist/types/schemas.d.ts +50 -0
  288. package/dist/types/stores/componentStyles.d.ts +8 -0
  289. package/dist/types/stores/createScopedStores.d.ts +1 -0
  290. package/dist/types/stores/internationalization.d.ts +3 -2
  291. package/dist/types/stores/ruleSets.d.ts +15 -3
  292. package/dist/types/utils/annotations.d.ts +45 -0
  293. package/dist/types/utils/autoFit.d.ts +2 -2
  294. package/dist/types/utils/emptyState.d.ts +1 -1
  295. package/dist/types/utils/ibcsRuleSet.d.ts +16 -0
  296. package/dist/types/utils/layoutState/dataPoint.d.ts +13 -0
  297. package/dist/types/utils/layoutState/geometry.d.ts +12 -0
  298. package/dist/types/utils/layoutState/index.d.ts +1 -0
  299. package/dist/types/utils/layoutState/svgChartElements.d.ts +9 -6
  300. package/dist/types/utils/layoutState/types.d.ts +29 -0
  301. package/dist/types/utils/model/ChartStyles.d.ts +2 -1
  302. package/dist/types/utils/scaling.d.ts +2 -0
  303. package/dist/types/utils/validate.d.ts +0 -1
  304. package/dist/types/utils/withComponentStyle.d.ts +4 -4
  305. package/dist/types/utils/withDataset.d.ts +3 -3
  306. package/dist/types/utils/withHasError.d.ts +22 -1
  307. package/dist/types/utils/withRuleSet.d.ts +3 -2
  308. package/dist/types/utils/withTranslation.d.ts +1 -2
  309. package/dist/types/utils/xy/model/ScaleFactorsXYChart.d.ts +6 -7
  310. package/dist/types/utils/xy/pointKey.d.ts +9 -0
  311. package/package.json +24 -8
  312. package/readme.md +14 -8
  313. package/dist/bn-template-engine/assets/bar.png +0 -0
  314. package/dist/bn-template-engine/assets/matrix.png +0 -0
  315. package/dist/bn-template-engine/p-5075771a.entry.js +0 -1
  316. package/dist/bn-template-engine/p-5d516435.entry.js +0 -1
  317. package/dist/bn-template-engine/p-5e90e728.entry.js +0 -1
  318. package/dist/bn-template-engine/p-9ef7e132.entry.js +0 -1
  319. package/dist/bn-template-engine/p-9f7a1980.entry.js +0 -1
  320. package/dist/bn-template-engine/p-BeXgxHkW.js +0 -1
  321. package/dist/bn-template-engine/p-C5UYpZUU.js +0 -2
  322. package/dist/bn-template-engine/p-CH0bpt_k.js +0 -1
  323. package/dist/bn-template-engine/p-DI3efDSV.js +0 -1
  324. package/dist/bn-template-engine/p-DXLTTILG.js +0 -1
  325. package/dist/bn-template-engine/p-DtP4jqG5.js +0 -1
  326. package/dist/bn-template-engine/p-a8281b71.entry.js +0 -1
  327. package/dist/bn-template-engine/p-b31277e7.entry.js +0 -1
  328. package/dist/bn-template-engine/p-b396ac84.entry.js +0 -1
  329. package/dist/cjs/bn-template.cjs.entry.js +0 -18
  330. package/dist/cjs/editor-companion.cjs.entry.js +0 -56
  331. package/dist/cjs/withHasError-qGW_yqIv.js +0 -426
  332. package/dist/collection/components/bn-footer/assets/bar.png +0 -0
  333. package/dist/collection/components/bn-footer/assets/matrix.png +0 -0
  334. package/dist/collection/components/bn-message/assets/bar.png +0 -0
  335. package/dist/collection/components/bn-message/assets/matrix.png +0 -0
  336. package/dist/collection/components/bn-template/bn-template.js +0 -38
  337. package/dist/collection/components/editor-companion/editor-companion.css +0 -3
  338. package/dist/collection/components/editor-companion/editor-companion.js +0 -137
  339. package/dist/collection/utils/templateId.js +0 -12
  340. package/dist/collection/utils/testing/fakeGroup.js +0 -21
  341. package/dist/collection/utils/testing/hostFont.js +0 -20
  342. package/dist/collection/utils/testing/mutationObserver.js +0 -44
  343. package/dist/collection/utils/testing/structureChart.js +0 -26
  344. package/dist/collection/utils/testing/timeChart.js +0 -28
  345. package/dist/components/AxisConfig.js +0 -1
  346. package/dist/components/CompareUtil.js +0 -1
  347. package/dist/components/DataFormatDigits.js +0 -1
  348. package/dist/components/DateStringFactory.js +0 -1
  349. package/dist/components/LabelCollisionManager.js +0 -1
  350. package/dist/components/Order.js +0 -1
  351. package/dist/components/SVGStyle.js +0 -1
  352. package/dist/components/SVGVariancesStyleGroup.js +0 -1
  353. package/dist/components/StringAdapter.js +0 -1
  354. package/dist/components/VarianceMeasure.js +0 -1
  355. package/dist/components/XYChartDataRow.js +0 -1
  356. package/dist/components/bn-body2.js +0 -1
  357. package/dist/components/bn-card2.js +0 -1
  358. package/dist/components/bn-footer2.js +0 -1
  359. package/dist/components/bn-message2.js +0 -1
  360. package/dist/components/bn-page2.js +0 -1
  361. package/dist/components/bn-template.js +0 -1
  362. package/dist/components/bn-title2.js +0 -1
  363. package/dist/components/checkXYOverflow.js +0 -1
  364. package/dist/components/contentDecoder.js +0 -1
  365. package/dist/components/context-protocol.js +0 -1
  366. package/dist/components/editor-companion.js +0 -1
  367. package/dist/components/formatter.js +0 -1
  368. package/dist/components/geometry.js +0 -1
  369. package/dist/components/ibcs-chart-bubble.js +0 -1
  370. package/dist/components/ibcs-chart-bubble2.js +0 -1
  371. package/dist/components/ibcs-chart-bullet.js +0 -1
  372. package/dist/components/ibcs-chart-bullet2.js +0 -1
  373. package/dist/components/ibcs-chart-scatter.js +0 -1
  374. package/dist/components/ibcs-chart-scatter2.js +0 -1
  375. package/dist/components/ibcs-chart-structure.d.ts +0 -11
  376. package/dist/components/ibcs-chart-structure.js +0 -1
  377. package/dist/components/ibcs-chart-structure2.js +0 -1
  378. package/dist/components/ibcs-chart-time.d.ts +0 -11
  379. package/dist/components/ibcs-chart-time.js +0 -1
  380. package/dist/components/ibcs-chart-time2.js +0 -1
  381. package/dist/components/ibcs-table.d.ts +0 -11
  382. package/dist/components/ibcs-table.js +0 -1
  383. package/dist/components/ibcs-table2.js +0 -1
  384. package/dist/components/ibcs-title.d.ts +0 -11
  385. package/dist/components/ibcs-title.js +0 -1
  386. package/dist/components/ibcs-title2.js +0 -1
  387. package/dist/components/layoutTemplate.js +0 -1
  388. package/dist/components/luxon.js +0 -1
  389. package/dist/components/scaling.js +0 -1
  390. package/dist/components/svg.esm.js +0 -1
  391. package/dist/components/svgChartElements.js +0 -1
  392. package/dist/components/types.js +0 -1
  393. package/dist/components/validate.js +0 -1
  394. package/dist/components/withBodyObserver.js +0 -1
  395. package/dist/components/withComponentStatus.js +0 -1
  396. package/dist/components/withComponentStyle.js +0 -1
  397. package/dist/components/withDataset.js +0 -1
  398. package/dist/components/withHasError.js +0 -1
  399. package/dist/components/withRuleSet.js +0 -1
  400. package/dist/components/withScalingGroup.js +0 -1
  401. package/dist/components/withStyled.js +0 -1
  402. package/dist/components/withTranslation.js +0 -1
  403. package/dist/esm/bn-template.entry.js +0 -16
  404. package/dist/esm/editor-companion.entry.js +0 -54
  405. package/dist/esm/withHasError-73WV2SP5.js +0 -422
  406. package/dist/types/components/bn-chart-bubble/ibcs-chart-bubble.d.ts +0 -59
  407. package/dist/types/components/bn-chart-bullet/ibcs-chart-bullet.d.ts +0 -53
  408. package/dist/types/components/bn-chart-scatter/ibcs-chart-scatter.d.ts +0 -54
  409. package/dist/types/components/bn-template/bn-template.d.ts +0 -10
  410. package/dist/types/components/editor-companion/editor-companion.d.ts +0 -20
  411. package/dist/types/utils/templateId.d.ts +0 -9
  412. package/dist/types/utils/testing/fakeGroup.d.ts +0 -8
  413. package/dist/types/utils/testing/hostFont.d.ts +0 -16
  414. package/dist/types/utils/testing/mutationObserver.d.ts +0 -5
  415. package/dist/types/utils/testing/structureChart.d.ts +0 -5
  416. package/dist/types/utils/testing/timeChart.d.ts +0 -5
  417. /package/dist/collection/components/bn-chart-bubble/{ibcs-chart-bubble.css → bn-chart-bubble-renderer/bn-chart-bubble-renderer.css} +0 -0
  418. /package/dist/collection/components/bn-chart-bullet/{ibcs-chart-bullet.css → bn-chart-bullet-renderer/bn-chart-bullet-renderer.css} +0 -0
  419. /package/dist/collection/components/bn-chart-scatter/{ibcs-chart-scatter.css → bn-chart-scatter-renderer/bn-chart-scatter-renderer.css} +0 -0
  420. /package/dist/collection/components/bn-chart-time/{ibcs-chart-time.css → bn-chart-time-renderer/bn-chart-time-renderer.css} +0 -0
  421. /package/dist/collection/components/bn-table/{ibcs-table.css → bn-table-renderer/bn-table-renderer.css} +0 -0
  422. /package/dist/collection/components/bn-title/{ibcs-title/ibcs-title.css → bn-title-renderer/bn-title-renderer.css} +0 -0
  423. /package/dist/collection/components/bn-title/{ibcs-title → bn-title-renderer}/utils/factories/index.js +0 -0
  424. /package/dist/collection/components/bn-title/{ibcs-title → bn-title-renderer}/utils/model/MeasureEntriy.js +0 -0
  425. /package/dist/collection/components/bn-title/{ibcs-title → bn-title-renderer}/utils/model/TimePeriod.js +0 -0
  426. /package/dist/collection/components/bn-title/{ibcs-title → bn-title-renderer}/utils/model/TitleConfig.js +0 -0
  427. /package/dist/collection/components/bn-title/{ibcs-title → bn-title-renderer}/utils/model/index.js +0 -0
  428. /package/dist/components/{stackColors.js → p-4q8nRcWC.js} +0 -0
  429. /package/dist/components/{merge.js → p-B2NXsfMz.js} +0 -0
  430. /package/dist/components/{layoutObserver.js → p-B6kka9sT.js} +0 -0
  431. /package/dist/components/{NumericScale.js → p-BJmwHV0a.js} +0 -0
  432. /package/dist/components/{stackLayout.js → p-BTnRaHPb.js} +0 -0
  433. /package/dist/components/{emotion-hash.esm.js → p-BYBpC0EO.js} +0 -0
  434. /package/dist/components/{diagnostics.js → p-CckAR27O.js} +0 -0
  435. /package/dist/components/{SiPrefix.js → p-CeE4_3wQ.js} +0 -0
  436. /package/dist/components/{queryError.js → p-ClruFZD_.js} +0 -0
  437. /package/dist/components/{sanitizeHtml.js → p-CyUmrWfW.js} +0 -0
  438. /package/dist/components/{TableAttribute.js → p-DCPLGEs_.js} +0 -0
  439. /package/dist/components/{parentDimensions.js → p-DD1zlev_.js} +0 -0
  440. /package/dist/components/{pageFormats.js → p-DM7fwmH4.js} +0 -0
  441. /package/dist/components/{emptyState.js → p-DakXa7Dp.js} +0 -0
  442. /package/dist/components/{relativeVariance.js → p-fCjsrD7I.js} +0 -0
  443. /package/dist/types/components/bn-title/{ibcs-title → bn-title-renderer}/utils/Title.d.ts +0 -0
  444. /package/dist/types/components/bn-title/{ibcs-title → bn-title-renderer}/utils/factories/TitleDataSetFactory.d.ts +0 -0
  445. /package/dist/types/components/bn-title/{ibcs-title → bn-title-renderer}/utils/factories/index.d.ts +0 -0
  446. /package/dist/types/components/bn-title/{ibcs-title → bn-title-renderer}/utils/model/MeasureEntriy.d.ts +0 -0
  447. /package/dist/types/components/bn-title/{ibcs-title → bn-title-renderer}/utils/model/TimePeriod.d.ts +0 -0
  448. /package/dist/types/components/bn-title/{ibcs-title → bn-title-renderer}/utils/model/TitleConfig.d.ts +0 -0
  449. /package/dist/types/components/bn-title/{ibcs-title → bn-title-renderer}/utils/model/index.d.ts +0 -0
@@ -1 +1 @@
1
- import{proxyCustomElement as t,HTMLElement as e,h as s,Fragment as a,Host as i,transformTag as r}from"@stencil/core/internal/client";import{s as o}from"./pageFormats.js";import{w as n}from"./withComponentStatus.js";import{w as l}from"./withHasError.js";import{a as m,b as d,c as h,t as c,i as b,C as p,d as u}from"./layoutTemplate.js";import{d as g}from"./bn-body2.js";import{d as f}from"./bn-footer2.js";import{d as y}from"./bn-message2.js";import{d as k}from"./bn-page2.js";import{d as v}from"./bn-title2.js";import{d as w}from"./ibcs-title2.js";const x=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.messageText="",this.messageImage="",this.titleBusinessUnit="",this.titleOrder="category",this.titleOrderDirection="asc",this.titleDateFormat="none",this.titleDateLink="none",this.footerDisplayPageNumber=!0,this.pageLayout="full",this.pageCustomTemplate='"a b" "c d"',this.pageGridGap="0",this.pageFitToContent=!1,n(this),this.errors=l(this)}getCommonStyles(){let t="100%";return!0===this.pageFitToContent&&(t="fit-content"),{display:"grid",height:t,width:"100%",gap:this.pageGridGap+"px"}}getRowCount(t){return m(this.getTemplateAreas(t)).length||1}getGridTemplateRows(t){const e=this.getRowCount(t);return this.pageFitToContent?Array(e).fill("auto").join(" "):Array(e).fill("minmax(0, 1fr)").join(" ")}getLayoutStyle(){return Object.assign(Object.assign({},this.getCommonStyles()),{"grid-template-areas":this.getTemplateAreas(this.pageLayout),"grid-template-columns":this.getGridTemplateColumns(this.pageLayout),"grid-template-rows":this.getGridTemplateRows(this.pageLayout)})}createDivAreaStyles(t){return t.map((t=>({display:"flex",overflow:"hidden","grid-area":t})))}getSlots(t){const e=this.createDivAreaStyles(t);return s(a,null,e.map(((t,e)=>s("div",{style:t},s("slot",{name:"slot-"+e})))))}extractSlotNames(t){return d(t)}getTemplateAreas(t){return h(t,this.pageCustomTemplate)}getGridTemplateColumns(t){return b(t)?c(this.getTemplateAreas(t)):"1fr"}async getNumberOfSlot(t){const e=this.getTemplateAreas(t);return this.extractSlotNames(e).length}mirror(t,e){null==e?this.element.hasAttribute(t)&&this.element.removeAttribute(t):this.element.getAttribute(t)!==e&&this.element.setAttribute(t,e)}componentWillRender(){this.mirror("page-format",this.pageFormat),this.mirror("page-orientation",this.pageOrientation);const t=this.pageLayout===p?u(this.pageCustomTemplate):void 0;t?this.errors.addOrReplace({id:"ERR_pageCustomTemplate",type:"warning",message:"pageCustomTemplate: "+t}):this.errors.remove("ERR_pageCustomTemplate")}rotation(){var t;const e=null===(t=this.element.closest("bn-context"))||void 0===t?void 0:t.getAttribute("render-orientation"),s=o(this.pageFormat,this.pageOrientation,e);if(s.turned)return{host:{width:s.width,height:s.height},page:{transform:"rotate(-90deg) translate(-100%)",transformOrigin:"top left"}}}render(){var t;const e=this.getLayoutStyle(),a=this.extractSlotNames(e["grid-template-areas"]),r=this.rotation();return s(i,{key:"ab0aa5ecfd46b0cd8dfbf14d51adfc269c539e75",style:null==r?void 0:r.host},s("bn-page",{key:"fe6c5e57a982b1ac45215a9673e78e3b692e4877",styles:this.styles,"selected-style":this.selectedStyle,format:this.pageFormat,orientation:this.pageOrientation,style:null==r?void 0:r.page},s("bn-message",{key:"d8b71030848157c6ae53fa2923d89fd528946e6c",text:this.messageText,image:this.messageImage}),s("bn-title",{key:"77cca44524b0414868b953c83df711445bdf2d55","i18n-namespace":null!==(t=this.i18nNamespace)&&void 0!==t?t:this.titleNamespace,ruleset:this.ruleset,"business-unit":this.titleBusinessUnit,scenarios:this.titleScenarios,variances:this.titleVariances,order:this.titleOrder,"order-direction":this.titleOrderDirection,measures:this.titleMeasures,"date-start":this.titleDateStart,"date-end":this.titleDateEnd,"date-format":this.titleDateFormat,"date-link":this.titleDateLink}),s("bn-body",{key:"f701dd8428a20babaffff8410c76d8a3cc05f1e3"},s("div",{key:"379a923754c6517e9834a4ab9aed6b956c3593a8",style:e,"data-bn-fit-content":this.pageFitToContent?this.getRowCount(this.pageLayout)+"":null},this.getSlots(a))),s("bn-footer",{key:"a1373cbbd4a81c34d86d48a56d7bf1a9f5baa543",text:this.footerText,"page-number":this.pageNumber,"display-page-number":this.footerDisplayPageNumber})))}get element(){return this}static get style(){return':host{background:var(--bn-font-background, white);color:var(--bn-font-color, black);font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);display:block;overflow:hidden}::slotted(*){flex:1 1 auto;min-width:0}'}},[257,"bn-layout-page",{styles:[1],selectedStyle:[1,"selected-style"],ruleset:[1],messageText:[1,"message-text"],messageImage:[1,"message-image"],titleBusinessUnit:[1,"title-business-unit"],titleScenarios:[1,"title-scenarios"],titleVariances:[1,"title-variances"],titleOrder:[1,"title-order"],titleOrderDirection:[1,"title-order-direction"],titleMeasures:[1,"title-measures"],titleDateStart:[1,"title-date-start"],titleDateEnd:[1,"title-date-end"],titleDateFormat:[1,"title-date-format"],titleDateLink:[1,"title-date-link"],titleNamespace:[1,"title-namespace"],i18nNamespace:[513,"i18n-namespace"],pageFormat:[1,"page-format"],pageOrientation:[1,"page-orientation"],pageNumber:[1,"page-number"],footerText:[1,"footer-text"],footerDisplayPageNumber:[4,"footer-display-page-number"],pageLayout:[1,"page-layout"],pageCustomTemplate:[1,"page-custom-template"],pageGridGap:[1,"page-grid-gap"],pageFitToContent:[4,"page-fit-to-content"],getNumberOfSlot:[64]}]),E=x,j=function(){"undefined"!=typeof customElements&&["bn-layout-page","bn-body","bn-footer","bn-message","bn-page","bn-title","ibcs-title"].forEach((t=>{switch(t){case"bn-layout-page":customElements.get(r(t))||customElements.define(r(t),x);break;case"bn-body":customElements.get(r(t))||g();break;case"bn-footer":customElements.get(r(t))||f();break;case"bn-message":customElements.get(r(t))||y();break;case"bn-page":customElements.get(r(t))||k();break;case"bn-title":customElements.get(r(t))||v();break;case"ibcs-title":customElements.get(r(t))||w()}}))};export{E as BnLayoutPage,j as defineCustomElement}
1
+ import{p as t,H as e,h as s,F as a,a as i,t as r}from"./p-D6YGOYV1.js";import{s as o}from"./p-DM7fwmH4.js";import{w as n}from"./p-DEHnizot.js";import{w as l}from"./p-CGI6XIaK.js";import{a as m,b as h,c,t as d,i as p,C as f,d as b}from"./p-Dq4KMCDU.js";import{d as u}from"./p-WzaayhTX.js";import{d as g}from"./p-BSV_vyqs.js";import{d as y}from"./p-Ds_BSK8v.js";import{d as k}from"./p-BWBHlztH.js";import{d as v}from"./p-U3zkcEJZ.js";import{d as w}from"./p-BpCL2bfw.js";const x=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.messageText="",this.messageImage="",this.titleBusinessUnit="",this.titleOrder="category",this.titleOrderDirection="asc",this.titleDateFormat="none",this.titleDateLink="none",this.footerDisplayPageNumber=!0,this.pageLayout="full",this.pageCustomTemplate='"a b" "c d"',this.pageGridGap="0",this.pageFitToContent=!1,n(this),this.errors=l(this)}getCommonStyles(){let t="100%";return!0===this.pageFitToContent&&(t="fit-content"),{display:"grid",height:t,width:"100%",gap:this.pageGridGap+"px"}}getRowCount(t){return m(this.getTemplateAreas(t)).length||1}getGridTemplateRows(t){const e=this.getRowCount(t);return this.pageFitToContent?Array(e).fill("auto").join(" "):Array(e).fill("minmax(0, 1fr)").join(" ")}getLayoutStyle(){return Object.assign(Object.assign({},this.getCommonStyles()),{"grid-template-areas":this.getTemplateAreas(this.pageLayout),"grid-template-columns":this.getGridTemplateColumns(this.pageLayout),"grid-template-rows":this.getGridTemplateRows(this.pageLayout)})}createDivAreaStyles(t){return t.map((t=>({display:"flex",overflow:"hidden","grid-area":t})))}getSlots(t){const e=this.createDivAreaStyles(t);return s(a,null,e.map(((t,e)=>s("div",{style:t},s("slot",{name:"slot-"+e})))))}extractSlotNames(t){return h(t)}getTemplateAreas(t){return c(t,this.pageCustomTemplate)}getGridTemplateColumns(t){return p(t)?d(this.getTemplateAreas(t)):"1fr"}mirror(t,e){null==e?this.element.hasAttribute(t)&&this.element.removeAttribute(t):this.element.getAttribute(t)!==e&&this.element.setAttribute(t,e)}componentWillRender(){this.mirror("page-format",this.pageFormat),this.mirror("page-orientation",this.pageOrientation);const t=this.pageLayout===f?b(this.pageCustomTemplate):void 0;t?this.errors.addOrReplace({id:"WARN_pageCustomTemplate",type:"warning",message:"pageCustomTemplate: "+t}):this.errors.remove("WARN_pageCustomTemplate")}rotation(){var t;const e=null===(t=this.element.closest("bn-context"))||void 0===t?void 0:t.getAttribute("render-orientation"),s=o(this.pageFormat,this.pageOrientation,e);if(s.turned)return{host:{width:s.width,height:s.height},page:{transform:"rotate(-90deg) translate(-100%)",transformOrigin:"top left"}}}render(){var t;const e=this.getLayoutStyle(),a=this.extractSlotNames(e["grid-template-areas"]),r=this.rotation();return s(i,{key:"a0553f8e1fcb8c16e5f1119adf3287f47431a032",style:null==r?void 0:r.host},s("bn-page",{key:"f29c2a88180e49ebda60f858e82d3836be79c275",styles:this.styles,"selected-style":this.selectedStyle,format:this.pageFormat,orientation:this.pageOrientation,style:null==r?void 0:r.page},s("bn-message",{key:"114f2a708fbd24a287870773450a7372417f966c",text:this.messageText,image:this.messageImage}),s("bn-title",{key:"0413e2645444d2410114bce588ab41aaf8c645ac","i18n-namespace":null!==(t=this.i18nNamespace)&&void 0!==t?t:this.titleNamespace,ruleset:this.ruleset,"business-unit":this.titleBusinessUnit,scenarios:this.titleScenarios,variances:this.titleVariances,order:this.titleOrder,"order-direction":this.titleOrderDirection,measures:this.titleMeasures,"date-start":this.titleDateStart,"date-end":this.titleDateEnd,"date-format":this.titleDateFormat,"date-link":this.titleDateLink}),s("bn-body",{key:"0ca2389cec30412f58995abc6ec5fb921895da8b"},s("div",{key:"a3718ddafecff39d38bf608b4e28f4bc04139c45",style:e,"data-bn-fit-content":this.pageFitToContent?this.getRowCount(this.pageLayout)+"":null},this.getSlots(a)),s("slot",{key:"9e6a0d1077e33e95f4cba0398f62cf5579b52eb8",name:"annotations"})),s("bn-footer",{key:"c19b05ac728b4a51e02c53903da2d436d72e19c5",text:this.footerText,"page-number":this.pageNumber,"display-page-number":this.footerDisplayPageNumber})))}get element(){return this}static get style(){return':host{background:var(--bn-font-background, white);color:var(--bn-font-color, black);font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);display:block;overflow:hidden}::slotted(*){flex:1 1 auto;min-width:0}'}},[257,"bn-layout-page",{styles:[1],selectedStyle:[1,"selected-style"],ruleset:[1],messageText:[1,"message-text"],messageImage:[1,"message-image"],titleBusinessUnit:[1,"title-business-unit"],titleScenarios:[1,"title-scenarios"],titleVariances:[1,"title-variances"],titleOrder:[1,"title-order"],titleOrderDirection:[1,"title-order-direction"],titleMeasures:[1,"title-measures"],titleDateStart:[1,"title-date-start"],titleDateEnd:[1,"title-date-end"],titleDateFormat:[1,"title-date-format"],titleDateLink:[1,"title-date-link"],titleNamespace:[1,"title-namespace"],i18nNamespace:[513,"i18n-namespace"],pageFormat:[1,"page-format"],pageOrientation:[1,"page-orientation"],pageNumber:[1,"page-number"],footerText:[1,"footer-text"],footerDisplayPageNumber:[4,"footer-display-page-number"],pageLayout:[1,"page-layout"],pageCustomTemplate:[1,"page-custom-template"],pageGridGap:[1,"page-grid-gap"],pageFitToContent:[4,"page-fit-to-content"]}]),j=x,D=function(){"undefined"!=typeof customElements&&["bn-layout-page","bn-body","bn-footer","bn-message","bn-page","bn-title","bn-title-renderer"].forEach((t=>{switch(t){case"bn-layout-page":customElements.get(r(t))||customElements.define(r(t),x);break;case"bn-body":customElements.get(r(t))||u();break;case"bn-footer":customElements.get(r(t))||g();break;case"bn-message":customElements.get(r(t))||y();break;case"bn-page":customElements.get(r(t))||k();break;case"bn-title":customElements.get(r(t))||v();break;case"bn-title-renderer":customElements.get(r(t))||w()}}))};export{j as BnLayoutPage,D as defineCustomElement}
@@ -1 +1 @@
1
- import{F as s,d as o}from"./bn-message2.js";const a=s,e=o;export{a as BnMessage,e as defineCustomElement}
1
+ import{F as s,d as o}from"./p-Ds_BSK8v.js";const p=s,r=o;export{p as BnMessage,r as defineCustomElement}
@@ -1 +1 @@
1
- import{P as o,d as s}from"./bn-page2.js";const a=o,p=s;export{a as BnPage,p as defineCustomElement}
1
+ import{P as o,d as s}from"./p-BWBHlztH.js";const t=o,p=s;export{t as BnPage,p as defineCustomElement}
@@ -1 +1 @@
1
- import{proxyCustomElement as t,HTMLElement as e,h as s,Host as r,transformTag as o}from"@stencil/core/internal/client";import{w as n}from"./withBodyObserver.js";import{g as i}from"./context-protocol.js";import{w as c}from"./withComponentStatus.js";import{w as a}from"./withHasError.js";const m=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.name="_default",c(this),this.errors=a(this),n(this,(t=>{this.stores||(this.stores=i(this.element));try{const e=JSON.parse(t);this.stores.ruleSets.set(this.name,e),this.errors.remove("JSON_PARSE")}catch(t){this.errors.addOrReplace({id:"JSON_PARSE",type:"error",message:"bn-ruleset: Failed to parse JSON body - "+t.message}),console.error(t)}}))}render(){return s(r,{key:"e5edadc4e95e62fc5c75190661f0aaab84e933b5"})}get element(){return this}static get style(){return"bn-ruleset{display:none}"}},[0,"bn-ruleset",{name:[1]}]),l=m,h=function(){"undefined"!=typeof customElements&&["bn-ruleset"].forEach((t=>{"bn-ruleset"===t&&(customElements.get(o(t))||customElements.define(o(t),m))}))};export{l as BnRuleset,h as defineCustomElement}
1
+ import{p as t,H as s,h as e,a as r,t as o}from"./p-D6YGOYV1.js";import{w as i}from"./p-CurWSJkH.js";import{g as n}from"./p-BVKLCz2k.js";import{w as a}from"./p-DEHnizot.js";import{w as c}from"./p-CGI6XIaK.js";const m=t(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.name="_default",a(this),this.errors=c(this),i(this,(t=>{this.stores||(this.stores=n(this.element));try{const s=JSON.parse(t);this.stores.ruleSets.set(this.name,s),this.errors.remove("ERR_body")}catch(t){this.errors.addOrReplace({id:"ERR_body",type:"error",message:"bn-ruleset: Failed to parse JSON body - "+t.message}),console.error(t)}}))}render(){return e(r,{key:"de03c25692178ed0f97c1e0d914396cba7c53cc3"})}get element(){return this}static get style(){return"bn-ruleset{display:none}"}},[0,"bn-ruleset",{name:[1]}]),p=m,u=function(){"undefined"!=typeof customElements&&["bn-ruleset"].forEach((t=>{"bn-ruleset"===t&&(customElements.get(o(t))||customElements.define(o(t),m))}))};export{p as BnRuleset,u as defineCustomElement}
@@ -1 +1 @@
1
- import{proxyCustomElement as e,HTMLElement as i,h as t,Host as s,transformTag as n}from"@stencil/core/internal/client";import{g as a}from"./context-protocol.js";import{a as r,f as o}from"./scaling.js";import{w as u}from"./withComponentStatus.js";import{w as h}from"./withHasError.js";const l=e(class extends i{constructor(e){super(),!1!==e&&this.__registerHost(),u(this),this.errors=h(this)}connectedCallback(){this.stores=a(this.element),this.pushToStore()}disconnectedCallback(){this.removeEntryIfOurs(this.storedName)}onNameChange(e,i){const t=null==i?void 0:(""+i).trim();t&&t!==(null==e?void 0:(""+e).trim())&&this.removeEntryIfOurs(t),this.pushToStore()}onValueChange(){this.pushToStore()}removeEntryIfOurs(e){e&&this.stores&&(this.storedName===e&&this.stores.scalingGroups.state[e]===this.storedValue&&this.stores.scalingGroups.set(e,void 0),this.storedName===e&&(this.storedName=void 0,this.storedValue=void 0))}pushToStore(){var e;if(!this.stores)return;const i=null===(e=this.name)||void 0===e?void 0:(""+e).trim(),t=r(i);if("auto"===t.kind)return void this.errors.addOrReplace({id:"ERR_reserved_name",type:"warning",message:'bn-scaling-group: name "auto" is reserved and cannot be used.'});if(this.errors.remove("ERR_reserved_name"),!i)return void this.errors.addOrReplace({id:"ERR_empty_name",type:"warning",message:"bn-scaling-group: name is required."});if(this.errors.remove("ERR_empty_name"),"number"===t.kind)return void this.errors.addOrReplace({id:"ERR_numeric_name",type:"warning",message:`bn-scaling-group: name "${i}" is not allowed - it would be ambiguous with a numeric scaling value.`});this.errors.remove("ERR_numeric_name");const s=r(this.value);if("number"!==s.kind)return void this.errors.addOrReplace({id:"ERR_invalid_value",type:"warning",message:`bn-scaling-group: invalid value "${this.value}" - must be a positive number, optionally with k/M/G/T suffix.`});this.errors.remove("ERR_invalid_value");const n=this.stores.scalingGroups.state[i];void 0===n||n===s.value||this.storedName===i&&this.storedValue===n?this.errors.remove("WARN_duplicate_group"):this.errors.addOrReplace({id:"WARN_duplicate_group",type:"warning",message:`bn-scaling-group: "${i}" is already registered with a different value (${o(n)}); overwriting.`}),this.storedName&&this.storedName!==i&&this.removeEntryIfOurs(this.storedName),this.stores.scalingGroups.set(i,s.value),this.storedName=i,this.storedValue=s.value}render(){return t(s,{key:"ffdeed9b4a44d43a51950fd400325a5298468f34"})}get element(){return this}static get watchers(){return{name:[{onNameChange:0}],value:[{onValueChange:0}]}}static get style(){return"bn-scaling-group{display:none}"}},[0,"bn-scaling-group",{name:[1],value:[8]},void 0,{name:[{onNameChange:0}],value:[{onValueChange:0}]}]),m=l,d=function(){"undefined"!=typeof customElements&&["bn-scaling-group"].forEach((e=>{"bn-scaling-group"===e&&(customElements.get(n(e))||customElements.define(n(e),l))}))};export{m as BnScalingGroup,d as defineCustomElement}
1
+ import{p as e,H as i,h as s,a as t,t as n}from"./p-D6YGOYV1.js";import{g as a}from"./p-BVKLCz2k.js";import{a as r,f as o}from"./p-Xb6Ilq8u.js";import{w as u}from"./p-DEHnizot.js";import{w as h}from"./p-CGI6XIaK.js";const l=e(class extends i{constructor(e){super(),!1!==e&&this.__registerHost(),u(this),this.errors=h(this)}connectedCallback(){this.stores=a(this.element),this.pushToStore()}disconnectedCallback(){this.removeEntryIfOurs(this.storedName)}onNameChange(e,i){const s=null==i?void 0:(""+i).trim();s&&s!==(null==e?void 0:(""+e).trim())&&this.removeEntryIfOurs(s),this.pushToStore()}onValueChange(){this.pushToStore()}removeEntryIfOurs(e){e&&this.stores&&(this.storedName===e&&this.stores.scalingGroups.state[e]===this.storedValue&&this.stores.scalingGroups.set(e,void 0),this.storedName===e&&(this.storedName=void 0,this.storedValue=void 0))}pushToStore(){var e;if(!this.stores)return;const i=null===(e=this.name)||void 0===e?void 0:(""+e).trim(),s=r(i);if("auto"===s.kind)return void this.errors.addOrReplace({id:"WARN_reserved_name",type:"warning",message:'bn-scaling-group: name "auto" is reserved and cannot be used.'});if(this.errors.remove("WARN_reserved_name"),!i)return void this.errors.addOrReplace({id:"WARN_empty_name",type:"warning",message:"bn-scaling-group: name is required."});if(this.errors.remove("WARN_empty_name"),"number"===s.kind)return void this.errors.addOrReplace({id:"WARN_numeric_name",type:"warning",message:`bn-scaling-group: name "${i}" is not allowed - it would be ambiguous with a numeric scaling value.`});this.errors.remove("WARN_numeric_name");const t=r(this.value);if("number"!==t.kind)return void this.errors.addOrReplace({id:"WARN_invalid_value",type:"warning",message:`bn-scaling-group: invalid value "${this.value}" - must be a positive number, optionally with k/M/G/T suffix.`});this.errors.remove("WARN_invalid_value");const n=this.stores.scalingGroups.state[i];void 0===n||n===t.value||this.storedName===i&&this.storedValue===n?this.errors.remove("WARN_duplicate_group"):this.errors.addOrReplace({id:"WARN_duplicate_group",type:"warning",message:`bn-scaling-group: "${i}" is already registered with a different value (${o(n)}); overwriting.`}),this.storedName&&this.storedName!==i&&this.removeEntryIfOurs(this.storedName),this.stores.scalingGroups.set(i,t.value),this.storedName=i,this.storedValue=t.value}render(){return s(t,{key:"db1fe7bbe3d3caf76ad32eac64f944eef10b1ccd"})}get element(){return this}static get watchers(){return{name:[{onNameChange:0}],value:[{onValueChange:0}]}}static get style(){return"bn-scaling-group{display:none}"}},[0,"bn-scaling-group",{name:[1],value:[8]},void 0,{name:[{onNameChange:0}],value:[{onValueChange:0}]}]),m=l,d=function(){"undefined"!=typeof customElements&&["bn-scaling-group"].forEach((e=>{"bn-scaling-group"===e&&(customElements.get(n(e))||customElements.define(n(e),l))}))};export{m as BnScalingGroup,d as defineCustomElement}
@@ -1,9 +1,9 @@
1
1
  import type { Components, JSX } from "../types/components";
2
2
 
3
- interface IbcsChartBubble extends Components.IbcsChartBubble, HTMLElement {}
4
- export const IbcsChartBubble: {
5
- prototype: IbcsChartBubble;
6
- new (): IbcsChartBubble;
3
+ interface BnTableRenderer extends Components.BnTableRenderer, HTMLElement {}
4
+ export const BnTableRenderer: {
5
+ prototype: BnTableRenderer;
6
+ new (): BnTableRenderer;
7
7
  };
8
8
  /**
9
9
  * Used to define this component and all nested components recursively.
@@ -0,0 +1 @@
1
+ import{B as o,d as s}from"./p-B7uwck1J.js";const p=o,r=s;export{p as BnTableRenderer,r as defineCustomElement}
@@ -1 +1 @@
1
- import{proxyCustomElement as t,HTMLElement as i,writeTask as e,h as a,Host as s,transformTag as r,forceUpdate as n}from"@stencil/core/internal/client";import{h as o,a as l}from"./context-protocol.js";import{v as h,a as d,i as u,q as p,r as c,s as v,l as m,t as g,h as f,u as y,w as b,b as w,c as S,x as O,m as T,y as R,z as D,f as _,A as E}from"./validate.js";import{w as M}from"./withDataset.js";import{w as A}from"./withComponentStatus.js";import{w as C}from"./withScalingGroup.js";import{w as F,a as x,i as N}from"./withTranslation.js";import{w as U}from"./withStyled.js";import{w as j}from"./withComponentStyle.js";import{w as G}from"./withRuleSet.js";import{w as W}from"./withHasError.js";import{g as P}from"./parentDimensions.js";import{f as I,r as L,p as k}from"./scaling.js";import{o as $}from"./layoutObserver.js";import{D as z,I as J,d as B,M as V,B as q,T as H}from"./CompareUtil.js";import{a as Y,b as Z,T as K,d as Q}from"./ibcs-table2.js";import{p as X}from"./TableAttribute.js";import{a as tt,O as it}from"./Order.js";import{L as et}from"./types.js";import{o as at,m as st}from"./geometry.js";import{r as rt,a as nt}from"./diagnostics.js";import{s as ot}from"./emptyState.js";const lt=t(class extends i{validateScaling(t){if(null==t||""===t||"none"===t||"auto"===t)return void this.errors.remove("ERR_scale");const i=Number(t);isNaN(i)||i<=0?this.errors.addOrReplace({id:"ERR_scale",type:"warning",message:`Invalid scale value: "${t}". Use "none", "auto", or a positive number.`}):this.errors.remove("ERR_scale")}constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.layoutObserver=null,this._lastScaledParentWidth=0,this.datasetName="",this.dataVersion=0,this.datasetMeta=null,this.appliedScaleFactor=1,this.hasBlankSetnames=!1,this.sumTitle="",this.filter="",this.measureUnit="",this.barColumnWidth="w10",this.unitScaling="100",this.percentageScaling="2",this.pixelPerUnitGroupMap=new Map,this.dataFormat="decimal",this.grouped="false",this.showMeasureScale="false",this.showGroupTitle="true",this.type="list",this.limit=0,this.thereof="[]",this.partof="[]",this.order="category",this.orderDirection="asc",this.measureType="volume",this.measureScale="greatest",this.dataFormatDigitsDecimal=1,this.dataFormatDigitsPercent=2,this.categoryWidth="w15",this.columnthereof=null,this.interval="none",this.tableAttributes="",this._autoScaleGuard=!1,this.autoUnitWarningActive=!1,this.autoPctWarningActive=!1,this.handleAutoScalingReport=t=>{var i,e,a,s;this.lastAutoScalingReport={unit:null!==(i=t.unit)&&void 0!==i?i:null===(e=this.lastAutoScalingReport)||void 0===e?void 0:e.unit,percentage:null!==(a=t.percentage)&&void 0!==a?a:null===(s=this.lastAutoScalingReport)||void 0===s?void 0:s.percentage};const r=(t,i)=>void 0===i||Math.abs(t-i)>.001*Math.abs(t);if(void 0!==t.unit&&t.unit>0&&this.autoUnitWarningActive){const i=1/t.unit;r(i,this.lastReportedUnitsPerEm)&&(this.lastReportedUnitsPerEm=i,this.errors.addOrReplace({id:"AUTO_unitScaling",type:"warning",message:`unit-scaling: invalid value "${this.unitScaling}" - auto-fitted to 1 em ≈ ${I(i)} units.`}))}if(void 0!==t.percentage&&t.percentage>0&&this.autoPctWarningActive){const i=1/t.percentage;r(i,this.lastReportedPpPerEm)&&(this.lastReportedPpPerEm=i,this.errors.addOrReplace({id:"AUTO_percentageScaling",type:"warning",message:`percentage-scaling: invalid value "${this.percentageScaling}" - auto-fitted to 1 em ≈ ${I(i)} percentage points.`}))}},U(this),A(this),this.errors=W(this),C(this),this.componentStyle=j(this),this.ruleSetConfig=G(this),M(this,((t,i)=>{this.datasetName=(null==t?void 0:t.startsWith("$"))?t.substring(1):t||"",this.dataVersion=this.dataVersion+1,this.hasBlankSetnames=Array.isArray(i)&&i.some((t=>{var i;return u(null!==(i=null==t?void 0:t.setname)&&void 0!==i?i:null==t?void 0:t.setName)}))}),((t,i)=>{this.datasetMeta=i})),this.t=F(this).t,this.resolveInherited=x(this,[{propName:"scenarios",ancestorAttr:"title-scenarios"},{propName:"variances",ancestorAttr:"title-variances"},{propName:"order",ancestorAttr:"title-order"},{propName:"orderDirection",ancestorAttr:"title-order-direction"}],this.errors)}validateFilter(t){const i="ERR_filter";o(t)?this.errors.addOrReplace({id:i,type:"error",message:"filter: double backticks are not allowed."}):this.errors.remove(i)}validateScenario(t){const i="ERR_scenarios";if(N(t))return void this.errors.remove(i);const e=h(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"scenarios: invalid value(s) '"+(null==e?void 0:""+e)+"' are not supported."}):this.errors.remove(i)}validateVariances(t){const i="ERR_variances";if(N(t))return void this.errors.remove(i);const e=d(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"variances: invalid value(s) '"+JSON.stringify(e)+"' are not supported."}):this.errors.remove(i)}validateBarColumns(t){const i="ERR_barColumns";if(u(t))return void this.errors.remove(i);const e=p(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"barColumns: invalid value(s) '"+JSON.stringify(e)+"' are not supported."}):this.errors.remove(i)}validateBarColumnWidth(t){const i="ERR_barColumnWidth";c(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"barColumnWidth: invalid value '"+t+"' is not supported."})}validateUnitScaling(t){const i="ERR_unitScaling";"invalid"===L(t,this.pixelPerUnitGroupMap).kind?this.errors.addOrReplace({id:i,type:"warning",message:"unitScaling: invalid value '"+t+"' is not supported."}):this.errors.remove(i)}validatePercentageScaling(t){const i="ERR_percentageScaling";"invalid"===L(t,this.pixelPerUnitGroupMap).kind?this.errors.addOrReplace({id:i,type:"warning",message:"percentageScaling: invalid value '"+t+"' is not supported."}):this.errors.remove(i)}validateDataFormat(t){const i="ERR_dataFormat";v(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"dataFormat: invalid value(s) '"+(null==t?void 0:""+t)+"' are not supported."})}validateGrouped(t){const i="ERR_grouped";m(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"grouped: invalid value(s) '"+(null==t?void 0:""+t)+"' are not supported."})}validateShowMeasureScale(t){const i="ERR_showMeasureScale";m(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"showMeasureScale: invalid value(s) '"+(null==t?void 0:""+t)+"' are not supported."})}validateShowGroupTitle(t){const i="ERR_showGroupTitle";m(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"showGroupTitle: invalid value(s) '"+(null==t?void 0:""+t)+"' are not supported."})}validateType(t){const i="ERR_type";g(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"type: invalid value(s) '"+(null==t?void 0:""+t)+"' are not supported."})}validateLimit(t){const i="ERR_limit";f(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"order: invalid value '"+(null==t?void 0:""+t)+"' is not supported."})}validateThereOf(t){const i="ERR_thereof",e=y(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"ThereOf: invalid value(s) '"+JSON.stringify(e)+"' are not supported."}):this.errors.remove(i)}validatePartOf(t){const i="ERR_partof",e=b(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"partof: invalid value(s) '"+JSON.stringify(e)+"' are not supported."}):this.errors.remove(i)}validateOrderList(t){const i="ERR_order";if(N(t))return void this.errors.remove(i);const e=w(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"order: invalid value(s) '"+JSON.stringify(e)+"' are not supported."}):this.errors.remove(i)}validateOrderDirection(t){const i="ERR_orderDirection";N(t)||S(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"orderDirection: invalid value '"+(null==t?void 0:""+t)+"' is not supported."})}validateMeasureType(t){const i="ERR_measureType";O(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"measureType: invalid value '"+(null==t?void 0:""+t)+"' is not supported."})}validateMeasureScale(t){const i="ERR_measureScale";T(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"measureScale: invalid value '"+(null==t?void 0:""+t)+"' is not supported."})}validateDataFormatDigitsDecimal(t){const i="ERR_dataFormatDigitsDecimal";f(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"dataFormatDigitsDecimal: invalid value(s) '"+t+"' are not supported."})}validateDateFormatDigitsPercent(t){const i="ERR_dataFormatDigitsPercent";f(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"dataFormatDigitsPercent: invalid value(s) '"+t+"' are not supported."})}validateCategoryWidth(t){const i="ERR_categoryWidth";R(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"categoryWidth: invalid value(s) '"+t+"' are not supported."})}validateColumnThereOf(t){const i=D(t),e="ERR_categorythereof";i.length>0?this.errors.addOrReplace({id:e,type:"warning",message:"columnthereof: invalid value(s) '"+JSON.stringify(i)+"' are not supported."}):this.errors.remove(e)}validateInterval(t){const i="ERR_interval",e=null==t?void 0:t.trim().toLowerCase();u(t)||e===Y||e===Z||_(e)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"interval: invalid value '"+t+"' is not supported."})}validateTableAttributes(t){const i="ERR_attributes",e=E(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"attributes: invalid value(s) '"+JSON.stringify(e)+"' are not supported."}):this.errors.remove(i)}componentWillLoad(){this.validateFilter(this.filter),this.validateScenario(this.scenarios),this.validateVariances(this.variances),this.validateDataFormat(this.dataFormat),this.validateGrouped(this.grouped),this.validateShowGroupTitle(this.showGroupTitle),this.validateType(this.type),this.validateLimit(this.limit),this.validateThereOf(this.thereof),this.validatePartOf(this.partof),this.validateOrderDirection(this.orderDirection),this.validateOrderList(this.order),this.validateDataFormatDigitsDecimal(this.dataFormatDigitsDecimal),this.validateDateFormatDigitsPercent(this.dataFormatDigitsPercent),this.validateCategoryWidth(this.categoryWidth),this.validateMeasureType(this.measureType),this.validateMeasureScale(this.measureScale),this.validateColumnThereOf(this.columnthereof),this.validateInterval(this.interval),this.validateTableAttributes(this.tableAttributes),this.validateShowMeasureScale(this.showMeasureScale),this.validateBarColumns(this.barColumns),this.validateBarColumnWidth(this.barColumnWidth),this.validateUnitScaling(this.unitScaling),this.validatePercentageScaling(this.percentageScaling),this.validateScaling(this.scale)}componentDidLoad(){this.layoutObserver=$(this.element,(()=>{if(this._autoScaleGuard)return;const{width:t}=P(this.element);t>0&&Math.abs(t-this._lastScaledParentWidth)>2&&(this._lastScaledParentWidth=t,n(this))}))}disconnectedCallback(){var t;null===(t=this.layoutObserver)||void 0===t||t.disconnect(),this.layoutObserver=null}componentDidRender(){ot(this.element,"ibcs-table");const{mode:t}=k(this.scale);if("auto"!==t&&"empty"!==t)return this._autoScaleGuard=!1,void this.checkOverflow();if(this._autoScaleGuard)return this._autoScaleGuard=!1,void this.checkOverflow();const i=this.element,{width:a}=P(i);if(a<=0)return void this.checkOverflow();this._lastScaledParentWidth=a;const s=this.componentStyle((t=>{var i;return(null===(i=t.global)||void 0===i?void 0:i.fontSizePx)||13.3333})),r=i.scrollWidth,n=this.appliedScaleFactor;if(r<=a+1)return this.errors.remove("AUTO_scale"),void this.checkOverflow();const o=Math.max(.3,n*(a-1)/r);Math.abs(o-n)<.001||(i.style.setProperty("--bn-font-size",s*o+"px"),"empty"===t?this.errors.addOrReplace({id:"AUTO_scale",type:"warning",message:"Auto-scaled table by factor "+o.toFixed(3)}):this.errors.remove("AUTO_scale"),this._autoScaleGuard=!0,e((()=>{this.appliedScaleFactor=o}))),this.checkOverflow()}checkOverflow(){const t="WARN_overflow",i=P(this.element),e=this.element.scrollWidth,a=this.element.scrollHeight,s=i.width>0&&e>i.width+1,r=i.height>0&&a>i.height+1;if(!s&&!r)return void this.errors.remove(t);const{mode:n}=k(this.scale),o="auto"!==n&&"empty"!==n,l=[];s&&l.push(`width (${Math.round(e)}px > ${Math.round(i.width)}px)`),r&&l.push(`height (${Math.round(a)}px > ${Math.round(i.height)}px)`),this.errors.addOrReplace({id:t,type:o?"error":"warning",message:`Table exceeds available ${l.join(" and ")}. Give the component more space, reduce rows (e.g. limit), or set a smaller scale.`})}prepareDataFormat(){var t;return z[null===(t=this.dataFormat)||void 0===t?void 0:t.toUpperCase()]}prepareGrouped(){return"true"===this.grouped}prepareShowGroupTitle(){return"true"===this.showGroupTitle}prepareTableType(){var t;return K[null===(t=this.type)||void 0===t?void 0:t.toUpperCase()]}prepareLimit(){return Math.floor(Number(this.limit)||0)}prepareThereOf(){if(null==this.thereof||""===this.thereof.trim())return[];try{return JSON.parse(this.thereof)}catch(t){return[]}}preparePartOf(){if(null==this.partof||""===this.partof.trim())return[];try{return JSON.parse(this.partof)}catch(t){return[]}}prepareOrder(){var t;const i=this.resolveInherited("order",this.order,"category").value,e=this.resolveInherited("orderDirection",this.orderDirection,"asc").value,a="auto"===(null==i?void 0:i.trim().toLowerCase());let s=i;return a&&(null===(t=this.datasetMeta)||void 0===t?void 0:t.suggestedOrder)&&(s=this.datasetMeta.suggestedOrder),{hierarchy:s.split(",").map((t=>it[null==t?void 0:t.toUpperCase()])),direction:tt[null==e?void 0:e.toUpperCase()]}}prepareI18nMode(){return J.META}prepareI18n(){const t=l,i=new Map(["in","category","operation","there_of","part_of","SUM_TOTAL","no-data","REST"].map((t=>[t,this.t(".".concat(t))]))),e=new Map(t.map((t=>[t,this.t("global.".concat(t))])));return new Map([...e.entries(),...i.entries()])}prepareDataFormatDigits(){return{percent:this.dataFormatDigitsPercent,decimal:this.dataFormatDigitsDecimal}}prepareScenarios(){var t,i,e,a,s,r,n,o,l,h,d;const p=this.resolveInherited("scenarios",this.scenarios),c=this.resolveInherited("variances",this.variances);if(p.inherited||c.inherited){this.errors.remove("AUTO_scenarios");let a=[];return u(p.value)?p.unresolved&&(a=a.concat(null!==(i=null===(t=this.datasetMeta)||void 0===t?void 0:t.availableScenarios)&&void 0!==i?i:[])):a=a.concat(p.value.split(",")),(null===(e=c.value)||void 0===e?void 0:e.trim().length)>0&&(a=a.concat(c.value.split(","))),a.map((t=>t.trim()))}const v="auto"===(null===(a=p.value)||void 0===a?void 0:a.trim().toLowerCase()),m=v||p.unresolved;if((u(p.value)||v)&&u(c.value))return(null===(r=null===(s=this.datasetMeta)||void 0===s?void 0:s.availableScenarios)||void 0===r?void 0:r.length)>0?(m?this.errors.remove("AUTO_scenarios"):this.errors.addOrReplace({id:"AUTO_scenarios",type:"warning",message:"scenarios: not set, auto-detected: "+this.datasetMeta.availableScenarios.join(",")}),this.datasetMeta.availableScenarios):[];let g=[];return v||u(p.value)?(null===(o=null===(n=this.datasetMeta)||void 0===n?void 0:n.availableScenarios)||void 0===o?void 0:o.length)>0&&(m?this.errors.remove("AUTO_scenarios"):this.errors.addOrReplace({id:"AUTO_scenarios",type:"warning",message:"scenarios: not set, auto-detected: "+this.datasetMeta.availableScenarios.join(",")}),g=g.concat(this.datasetMeta.availableScenarios)):(this.errors.remove("AUTO_scenarios"),g=g.concat(null===(l=p.value)||void 0===l?void 0:l.split(","))),(null===(h=c.value)||void 0===h?void 0:h.trim().length)>0&&(g=g.concat(null===(d=c.value)||void 0===d?void 0:d.split(","))),g.map((t=>t.trim()))}prepareCategoryWidth(){var t;return u(this.categoryWidth)?B.INF:B[null===(t=this.categoryWidth)||void 0===t?void 0:t.toUpperCase()]}prepareMeasureScale(){return u(this.measureScale)?"GREATEST":["_","k","M","G","T","P","E","Z","Y","m","μ","n","p","P","f","a","z","y"].includes(this.measureScale.trim())||"LEAST"===this.measureScale.trim().toUpperCase()?this.measureScale.trim():"GREATEST"}prepareMeasureType(){var t;return u(this.measureType)?V.VOLUME:V[null===(t=this.measureType)||void 0===t?void 0:t.toUpperCase()]}prepareColumnThereOf(){if(null==this.columnthereof||""===this.columnthereof.trim())return new Map;const t=new Map;try{const i=JSON.parse(this.columnthereof);for(const[e,a]of Object.entries(i))!1===t.has(a.scenario)&&t.set(a.scenario,[]),t.get(a.scenario).push(a)}catch(t){return new Map}return t}prepareInterval(){var t;const i="ERR_intervalConflict",e="ERR_intervalNoDate",a="ERR_intervalSetname",s=u(this.interval)?Y:this.interval.trim().toLowerCase();return s!==Y&&s!==Z&&!_(s)||s===Y?(this.errors.remove(i),this.errors.remove(e),this.errors.remove(a),Y):null!=this.columnthereof&&""!==this.columnthereof.trim()?(this.errors.addOrReplace({id:i,type:"warning",message:"interval: cannot be combined with columnthereof, interval is ignored."}),this.errors.remove(e),this.errors.remove(a),Y):(this.errors.remove(i),s===Z?(this.hasBlankSetnames?this.errors.addOrReplace({id:a,type:"warning",message:"interval: rows with blank setname found, they are grouped under '-'."}):this.errors.remove(a),this.errors.remove(e),Z):(this.errors.remove(a),this.datasetMeta&&!(null===(t=this.datasetMeta.dateRange)||void 0===t?void 0:t.hasData)?(this.errors.addOrReplace({id:e,type:"warning",message:"interval: dataset has no date values, interval is ignored."}),Y):(this.errors.remove(e),s)))}prepareAttributes(){if(null==this.tableAttributes||""===this.tableAttributes.trim())return[];try{const t=JSON.parse(this.tableAttributes);return null===t||"object"!=typeof t||t instanceof Array?[]:Object.entries(t).map((([t,i],e)=>"string"==typeof i?X(t,"attr_"+e,i):null)).filter((t=>null!==t))}catch(t){return[]}}prepareSumTitle(){return""===this.sumTitle||null==this.sumTitle?"SUM_TOTAL":this.sumTitle}prepareShowMeasureScale(){return"true"===this.showMeasureScale}prepareMeasureUnit(){return""===this.measureUnit||null==this.measureUnit?"":this.measureUnit}prepareFilter(){return 0===this.filter.length?"":this.filter}prepareBarColumnWidth(){var t;const i=null===(t=this.barColumnWidth)||void 0===t?void 0:t.toUpperCase(),e=H[i];return e?q[e]:q[H.W10]}prepareBarColumns(){return u(this.barColumns)?[]:this.barColumns.split(",").map((t=>t.trim()))}prepareUnitScaling(){const t=L(this.unitScaling,this.pixelPerUnitGroupMap);return"value"===t.kind?(this.errors.remove("AUTO_unitScaling"),this.autoUnitWarningActive=!1,this.lastReportedUnitsPerEm=void 0,1/t.value):"auto"===t.kind?(this.errors.remove("AUTO_unitScaling"),this.autoUnitWarningActive=!1,this.lastReportedUnitsPerEm=void 0,0):(this.autoUnitWarningActive=!0,this.errors.addOrReplace({id:"AUTO_unitScaling",type:"warning",message:`unit-scaling: invalid value "${t.raw}" - auto-fitting to the bar column width.`}),0)}preparePercentageScaling(){const t=L(this.percentageScaling,this.pixelPerUnitGroupMap);return"value"===t.kind?(this.errors.remove("AUTO_percentageScaling"),this.autoPctWarningActive=!1,this.lastReportedPpPerEm=void 0,1/t.value):"auto"===t.kind?(this.errors.remove("AUTO_percentageScaling"),this.autoPctWarningActive=!1,this.lastReportedPpPerEm=void 0,0):(this.autoPctWarningActive=!0,this.errors.addOrReplace({id:"AUTO_percentageScaling",type:"warning",message:`percentage-scaling: invalid value "${t.raw}" - auto-fitting to the pin area.`}),0)}getDataStructure(){return{ITableDataRow:{setName:{type:"string",isOptional:!1,description:""},date:{type:"string",isOptional:!1,description:""},operation:{type:"string",isOptional:!1,description:""},rowGroup:{type:"string",isOptional:!1,description:""},rowGroupIndex:{type:"number",isOptional:!1,description:""},category:{type:"string",isOptional:!1,description:""},categoryIndex:{type:"number",isOptional:!1,description:""},subCategory:{type:"string",isOptional:!1,description:""},subCategoryIndex:{type:"number",isOptional:!1,description:""},columnGroup:{type:"string",isOptional:!1,description:""},columnGroupIndex:{type:"number",isOptional:!1,description:""},columnSubGroup:{type:"string",isOptional:!1,description:""},columnSubGroupIndex:{type:"number",isOptional:!1,description:""},ac1:{type:"number",isOptional:!1,description:""},ac2:{type:"number",isOptional:!1,description:""},ac3:{type:"number",isOptional:!1,description:""},ac4:{type:"number",isOptional:!1,description:""},pp1:{type:"number",isOptional:!1,description:""},pp2:{type:"number",isOptional:!1,description:""},pp3:{type:"number",isOptional:!1,description:""},pp4:{type:"number",isOptional:!1,description:""},fc1:{type:"number",isOptional:!1,description:""},fc2:{type:"number",isOptional:!1,description:""},fc3:{type:"number",isOptional:!1,description:""},fc4:{type:"number",isOptional:!1,description:""},pl1:{type:"number",isOptional:!1,description:""},pl2:{type:"number",isOptional:!1,description:""},pl3:{type:"number",isOptional:!1,description:""},pl4:{type:"number",isOptional:!1,description:""}}}}async getLayoutState(t){var i,e,a,s;const r=null!==(i=null==t?void 0:t.detail)&&void 0!==i?i:"summary",n=at(this.element),o=this.getEffectiveScaleFactor(),l=Number.isFinite(o)&&o>0?o:1,h=this.componentStyle((t=>{var i;return(null===(i=t.global)||void 0===i?void 0:i.fontSizePx)||13.3333}))*l,d={version:et,tag:this.element.localName,id:nt(this.element),slot:null!==(e=this.element.getAttribute("slot"))&&void 0!==e?e:void 0,rect:st(this.element,n),em:{fontSizePx:h,appliedScaleFactor:l},regions:[],metadata:{},diagnostics:rt(this.element),scaling:this.resolveScalingInfo(h)},u=null===(a=this.element.shadowRoot)||void 0===a?void 0:a.querySelector("ibcs-table");if(u){const t=null!==(s=u.scenarios)&&void 0!==s?s:[];if(d.metadata.scenarios=t.filter((t=>!t.startsWith("d"))),d.metadata.variances=t.filter((t=>t.startsWith("d"))),"function"==typeof u.getLayoutDetail){const t=await u.getLayoutDetail(n,r);d.regions=t.regions,d.metadata=Object.assign(Object.assign({},d.metadata),t.metadata),d.diagnostics=[...d.diagnostics,...t.diagnostics],t.elements&&(d.elements=t.elements),t.table&&(d.table=t.table)}}return d}resolveScalingInfo(t){var i,e;const a={},s=L(this.unitScaling,this.pixelPerUnitGroupMap);if("value"===s.kind)a.unitMode="fixed",a.unitsPerEm=s.value,a.unitPxPerUnit=t/s.value;else{a.unitMode="auto";const e=null===(i=this.lastAutoScalingReport)||void 0===i?void 0:i.unit;void 0!==e&&e>0&&(a.unitsPerEm=1/e,a.unitPxPerUnit=e*t)}const r=L(this.percentageScaling,this.pixelPerUnitGroupMap);if("value"===r.kind)a.percentageMode="fixed",a.percentagePointsPerEm=r.value,a.percentagePxPerPoint=t/r.value;else{a.percentageMode="auto";const i=null===(e=this.lastAutoScalingReport)||void 0===e?void 0:e.percentage;void 0!==i&&i>0&&(a.percentagePointsPerEm=1/i,a.percentagePxPerPoint=i*t)}return a}getEffectiveScaleFactor(){const{mode:t,factor:i}=k(this.scale);return"factor"===t?i:"auto"===t||"empty"===t?this.appliedScaleFactor:1}getFontStyles(){const t=this.getEffectiveScaleFactor();return this.componentStyle((i=>{var e,a,s,r;const n=(null===(e=i.global)||void 0===e?void 0:e.fontSizePx)||13.3333;return{"--bn-font-family":(null===(a=i.global)||void 0===a?void 0:a.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":n*t+"px","--bn-font-color":(null===(s=i.global)||void 0===s?void 0:s.fontColor)||"#000000","--bn-font-background":(null===(r=i.global)||void 0===r?void 0:r.fontBackgroundColor)||"#ffffff"}}))}render(){const t=this.getFontStyles(),i=this.getEffectiveScaleFactor();return a(s,{key:"ba76b60711ca2b8fb83226d3473aefdc394036f8",style:t},a("div",{key:"425f6a33db9d0baffd4edcffe4a986b4e114886c"},a("ibcs-table",{key:"4b7c445d24314f515a1432e88f54ec4b52bd76d2",tableName:this.datasetName,dataVersion:this.dataVersion,sumTitle:this.prepareSumTitle(),scenarios:this.prepareScenarios(),scenariosDataFormat:this.prepareDataFormat(),grouped:this.prepareGrouped(),limit:this.prepareLimit(),showGroupTitle:this.prepareShowGroupTitle(),thereof:this.prepareThereOf(),partof:this.preparePartOf(),order:this.prepareOrder(),categorythereof:this.prepareColumnThereOf(),attributeColumns:this.prepareAttributes(),type:this.prepareTableType(),categoryWidth:this.prepareCategoryWidth(),dataFormatDigits:this.prepareDataFormatDigits(),i18n:this.prepareI18n(),i18nMode:this.prepareI18nMode(),measureScale:this.prepareMeasureScale(),measureType:this.prepareMeasureType(),measureUnit:this.prepareMeasureUnit(),showMeasureScale:this.prepareShowMeasureScale(),filter:this.prepareFilter(),barColumns:this.prepareBarColumns(),interval:this.prepareInterval(),barColumnMaxWidth:this.prepareBarColumnWidth(),unitScaling:this.prepareUnitScaling(),percentageScaling:this.preparePercentageScaling(),reportAutoScaling:this.handleAutoScalingReport,errors:this.errors,scaleFactor:i,ruleSetConfig:this.ruleSetConfig(),selectedStyle:this.selectedStyle})))}get element(){return this}static get watchers(){return{scale:[{validateScaling:0}],filter:[{validateFilter:0}],scenarios:[{validateScenario:0}],variances:[{validateVariances:0}],barColumns:[{validateBarColumns:0}],barColumnWidth:[{validateBarColumnWidth:0}],unitScaling:[{validateUnitScaling:0}],percentageScaling:[{validatePercentageScaling:0}],dataFormat:[{validateDataFormat:0}],grouped:[{validateGrouped:0}],showMeasureScale:[{validateShowMeasureScale:0}],showGroupTitle:[{validateShowGroupTitle:0}],type:[{validateType:0}],limit:[{validateLimit:0}],thereof:[{validateThereOf:0}],partof:[{validatePartOf:0}],order:[{validateOrderList:0}],orderDirection:[{validateOrderDirection:0}],measureType:[{validateMeasureType:0}],measureScale:[{validateMeasureScale:0}],dataFormatDigitsDecimal:[{validateDataFormatDigitsDecimal:0}],dataFormatDigitsPercent:[{validateDateFormatDigitsPercent:0}],categoryWidth:[{validateCategoryWidth:0}],columnthereof:[{validateColumnThereOf:0}],interval:[{validateInterval:0}],tableAttributes:[{validateTableAttributes:0}]}}static get style(){return':host(.no-data){display:block;box-sizing:border-box;width:100%;height:100%}:host(.no-data)>div{float:none;width:100%;height:100%}:host(.no-data) .no-data~.no-data{display:none}.empty-state{box-sizing:border-box;display:flex;align-items:center;justify-content:center;float:none;width:100%;height:100%;min-height:3em;margin:0;padding:0.5em;overflow:hidden;border:0.1em dashed #ddd;color:#808080;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);font-style:normal;text-align:center}:host{display:inline-block;position:relative;overflow:hidden;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000)}'}},[1,"bn-table",{scale:[1],ruleset:[513],selectedStyle:[1,"selected-style"],sumTitle:[1,"sum-title"],filter:[1],measureUnit:[1,"measure-unit"],scenarios:[1],variances:[1],barColumns:[1,"bar-columns"],barColumnWidth:[1,"bar-column-width"],unitScaling:[8,"unit-scaling"],percentageScaling:[8,"percentage-scaling"],dataFormat:[1,"data-format"],grouped:[1],showMeasureScale:[1,"show-measure-scale"],showGroupTitle:[1,"show-group-title"],type:[1],limit:[2],thereof:[1],partof:[1],order:[1],orderDirection:[1,"order-direction"],measureType:[1,"measure-type"],measureScale:[1,"measure-scale"],dataFormatDigitsDecimal:[2,"data-format-digits-decimal"],dataFormatDigitsPercent:[2,"data-format-digits-percent"],categoryWidth:[1,"category-width"],columnthereof:[1],interval:[1],tableAttributes:[1,"attributes"],datasetName:[32],dataVersion:[32],datasetMeta:[32],appliedScaleFactor:[32],hasBlankSetnames:[32],getLayoutState:[64]},void 0,{scale:[{validateScaling:0}],filter:[{validateFilter:0}],scenarios:[{validateScenario:0}],variances:[{validateVariances:0}],barColumns:[{validateBarColumns:0}],barColumnWidth:[{validateBarColumnWidth:0}],unitScaling:[{validateUnitScaling:0}],percentageScaling:[{validatePercentageScaling:0}],dataFormat:[{validateDataFormat:0}],grouped:[{validateGrouped:0}],showMeasureScale:[{validateShowMeasureScale:0}],showGroupTitle:[{validateShowGroupTitle:0}],type:[{validateType:0}],limit:[{validateLimit:0}],thereof:[{validateThereOf:0}],partof:[{validatePartOf:0}],order:[{validateOrderList:0}],orderDirection:[{validateOrderDirection:0}],measureType:[{validateMeasureType:0}],measureScale:[{validateMeasureScale:0}],dataFormatDigitsDecimal:[{validateDataFormatDigitsDecimal:0}],dataFormatDigitsPercent:[{validateDateFormatDigitsPercent:0}],categoryWidth:[{validateCategoryWidth:0}],columnthereof:[{validateColumnThereOf:0}],interval:[{validateInterval:0}],tableAttributes:[{validateTableAttributes:0}]}]),ht=lt,dt=function(){"undefined"!=typeof customElements&&["bn-table","ibcs-table"].forEach((t=>{switch(t){case"bn-table":customElements.get(r(t))||customElements.define(r(t),lt);break;case"ibcs-table":customElements.get(r(t))||Q()}}))};export{ht as BnTable,dt as defineCustomElement}
1
+ import{p as t,H as i,w as e,h as a,a as s,t as r,f as n}from"./p-D6YGOYV1.js";import{h as o,a as l}from"./p-BVKLCz2k.js";import{v as h,a as d,i as p,p as c,q as u,r as v,s as m,h as g,t as f,u as y,b,c as S,w as O,l as w,x as T,y as A,f as D,z as N}from"./p-DYG9FH_u.js";import{w as _}from"./p-BXrPfAvP.js";import{w as W}from"./p-DEHnizot.js";import{w as C}from"./p-BDS_jiow.js";import{w as F,a as M,i as R}from"./p-DsOaqeTN.js";import{w as j}from"./p-DdGnuNtc.js";import{w as x}from"./p-jbp6YiHf.js";import{r as U}from"./p-xpguaboj.js";import{w as P}from"./p-CkW23yp2.js";import{w as k,r as G}from"./p-CGI6XIaK.js";import{g as I}from"./p-DD1zlev_.js";import{f as B,r as L,p as E}from"./p-Xb6Ilq8u.js";import{o as z}from"./p-B6kka9sT.js";import{D as $,I as J,d as V,M as Y,B as X,T as q}from"./p-BQMKgvEC.js";import{I as H,a as K,T as Q,d as Z}from"./p-B7uwck1J.js";import{p as tt}from"./p-DCPLGEs_.js";import{a as it,O as et}from"./p-CxPSvrcF.js";import{LAYOUT_STATE_VERSION as at}from"./index.js";import{o as st,m as rt}from"./p-B1nL0yOa.js";import{r as nt,a as ot}from"./p-CckAR27O.js";import{s as lt}from"./p-DakXa7Dp.js";const ht=t(class extends i{validateScaling(t){if(null==t||""===t||"none"===t||"auto"===t)return void this.errors.remove("WARN_scale");const i=Number(t);isNaN(i)||i<=0?this.errors.addOrReplace({id:"WARN_scale",type:"warning",message:`Invalid scale value: "${t}". Use "none", "auto", or a positive number.`}):this.errors.remove("WARN_scale")}constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.layoutObserver=null,this._lastScaledParentWidth=0,this.datasetName="",this.dataVersion=0,this.datasetMeta=null,this.appliedScaleFactor=1,this.hasBlankSetnames=!1,this.sumTitle="",this.filter="",this.measureUnit="",this.barColumnWidth="w10",this.unitScaling="100",this.percentageScaling="2",this.pixelPerUnitGroupMap=new Map,this.dataFormat="decimal",this.grouped=!1,this.showMeasureScale=!1,this.showGroupTitle=!0,this.type="list",this.limit=0,this.thereof="[]",this.partof="[]",this.order="category",this.orderDirection="asc",this.measureType="volume",this.measureScale="greatest",this.dataFormatDigitsDecimal=1,this.dataFormatDigitsPercent=2,this.categoryWidth="w15",this.columnthereof=null,this.interval="none",this.tableAttributes="",this._autoScaleGuard=!1,this.autoUnitWarningActive=!1,this.autoPctWarningActive=!1,this.handleAutoScalingReport=t=>{var i,e,a,s;this.lastAutoScalingReport={unit:null!==(i=t.unit)&&void 0!==i?i:null===(e=this.lastAutoScalingReport)||void 0===e?void 0:e.unit,percentage:null!==(a=t.percentage)&&void 0!==a?a:null===(s=this.lastAutoScalingReport)||void 0===s?void 0:s.percentage};const r=(t,i)=>void 0===i||Math.abs(t-i)>.001*Math.abs(t);if(void 0!==t.unit&&t.unit>0&&this.autoUnitWarningActive){const i=1/t.unit;r(i,this.lastReportedUnitsPerEm)&&(this.lastReportedUnitsPerEm=i,this.errors.addOrReplace({id:"AUTO_unitScaling",type:"warning",message:`unit-scaling: invalid value "${this.unitScaling}" - auto-fitted to 1 em ≈ ${B(i)} units.`}))}if(void 0!==t.percentage&&t.percentage>0&&this.autoPctWarningActive){const i=1/t.percentage;r(i,this.lastReportedPpPerEm)&&(this.lastReportedPpPerEm=i,this.errors.addOrReplace({id:"AUTO_percentageScaling",type:"warning",message:`percentage-scaling: invalid value "${this.percentageScaling}" - auto-fitted to 1 em ≈ ${B(i)} percentage points.`}))}},j(this),W(this),this.errors=k(this),C(this),this.componentStyle=x(this),this.ruleSetConfig=P(this),_(this,((t,i)=>{this.datasetName=(null==t?void 0:t.startsWith("$"))?t.substring(1):t||"",this.dataVersion=this.dataVersion+1,this.hasBlankSetnames=Array.isArray(i)&&i.some((t=>{var i;return p(null!==(i=null==t?void 0:t.setname)&&void 0!==i?i:null==t?void 0:t.setName)}))}),((t,i)=>{this.datasetMeta=i})),this.t=F(this).t,this.resolveInherited=M(this,[{propName:"scenarios",ancestorAttr:"title-scenarios"},{propName:"variances",ancestorAttr:"title-variances"},{propName:"order",ancestorAttr:"title-order"},{propName:"orderDirection",ancestorAttr:"title-order-direction"}],this.errors)}validateFilter(t){const i="ERR_filter";o(t)?this.errors.addOrReplace({id:i,type:"error",message:"filter: double backticks are not allowed."}):this.errors.remove(i)}validateScenario(t){const i="WARN_scenarios";if(R(t))return void this.errors.remove(i);const e=h(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"scenarios: invalid value(s) '"+(null==e?void 0:""+e)+"' are not supported."}):this.errors.remove(i)}validateVariances(t){const i="WARN_variances";if(R(t))return void this.errors.remove(i);const e=d(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"variances: invalid value(s) '"+JSON.stringify(e)+"' are not supported."}):this.errors.remove(i)}validateBarColumns(t){const i="WARN_barColumns";if(p(t))return void this.errors.remove(i);const e=c(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"barColumns: invalid value(s) '"+JSON.stringify(e)+"' are not supported."}):this.errors.remove(i)}validateBarColumnWidth(t){const i="WARN_barColumnWidth";u(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"barColumnWidth: invalid value '"+t+"' is not supported."})}validateUnitScaling(t){const i="WARN_unitScaling";"invalid"===L(t,this.pixelPerUnitGroupMap).kind?this.errors.addOrReplace({id:i,type:"warning",message:"unitScaling: invalid value '"+t+"' is not supported."}):this.errors.remove(i)}validatePercentageScaling(t){const i="WARN_percentageScaling";"invalid"===L(t,this.pixelPerUnitGroupMap).kind?this.errors.addOrReplace({id:i,type:"warning",message:"percentageScaling: invalid value '"+t+"' is not supported."}):this.errors.remove(i)}validateDataFormat(t){const i="WARN_dataFormat";v(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"dataFormat: invalid value(s) '"+(null==t?void 0:""+t)+"' are not supported."})}validateType(t){const i="WARN_type";m(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"type: invalid value(s) '"+(null==t?void 0:""+t)+"' are not supported."})}validateLimit(t){const i="WARN_limit";g(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"order: invalid value '"+(null==t?void 0:""+t)+"' is not supported."})}validateThereOf(t){const i="WARN_thereof",e=f(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"ThereOf: invalid value(s) '"+JSON.stringify(e)+"' are not supported."}):this.errors.remove(i)}validatePartOf(t){const i="WARN_partof",e=y(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"partof: invalid value(s) '"+JSON.stringify(e)+"' are not supported."}):this.errors.remove(i)}validateOrderList(t){const i="WARN_order";if(R(t))return void this.errors.remove(i);const e=b(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"order: invalid value(s) '"+JSON.stringify(e)+"' are not supported."}):this.errors.remove(i)}validateOrderDirection(t){const i="WARN_orderDirection";R(t)||S(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"orderDirection: invalid value '"+(null==t?void 0:""+t)+"' is not supported."})}validateMeasureType(t){const i="WARN_measureType";O(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"measureType: invalid value '"+(null==t?void 0:""+t)+"' is not supported."})}validateMeasureScale(t){const i="WARN_measureScale";w(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"measureScale: invalid value '"+(null==t?void 0:""+t)+"' is not supported."})}validateDataFormatDigitsDecimal(t){const i="WARN_dataFormatDigitsDecimal";g(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"dataFormatDigitsDecimal: invalid value(s) '"+t+"' are not supported."})}validateDateFormatDigitsPercent(t){const i="WARN_dataFormatDigitsPercent";g(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"dataFormatDigitsPercent: invalid value(s) '"+t+"' are not supported."})}validateCategoryWidth(t){const i="WARN_categoryWidth";T(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"categoryWidth: invalid value(s) '"+t+"' are not supported."})}validateColumnThereOf(t){const i=A(t),e="WARN_columnthereof";i.length>0?this.errors.addOrReplace({id:e,type:"warning",message:"columnthereof: invalid value(s) '"+JSON.stringify(i)+"' are not supported."}):this.errors.remove(e)}validateInterval(t){const i="WARN_interval",e=null==t?void 0:t.trim().toLowerCase();p(t)||e===H||e===K||D(e)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"interval: invalid value '"+t+"' is not supported."})}validateTableAttributes(t){const i="WARN_attributes",e=N(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"attributes: invalid value(s) '"+JSON.stringify(e)+"' are not supported."}):this.errors.remove(i)}componentWillLoad(){this.validateFilter(this.filter),this.validateScenario(this.scenarios),this.validateVariances(this.variances),this.validateDataFormat(this.dataFormat),this.validateType(this.type),this.validateLimit(this.limit),this.validateThereOf(this.thereof),this.validatePartOf(this.partof),this.validateOrderDirection(this.orderDirection),this.validateOrderList(this.order),this.validateDataFormatDigitsDecimal(this.dataFormatDigitsDecimal),this.validateDateFormatDigitsPercent(this.dataFormatDigitsPercent),this.validateCategoryWidth(this.categoryWidth),this.validateMeasureType(this.measureType),this.validateMeasureScale(this.measureScale),this.validateColumnThereOf(this.columnthereof),this.validateInterval(this.interval),this.validateTableAttributes(this.tableAttributes),this.validateBarColumns(this.barColumns),this.validateBarColumnWidth(this.barColumnWidth),this.validateUnitScaling(this.unitScaling),this.validatePercentageScaling(this.percentageScaling),this.validateScaling(this.scale)}componentDidLoad(){this.layoutObserver=z(this.element,(()=>{if(this._autoScaleGuard)return;const{width:t}=I(this.element);t>0&&Math.abs(t-this._lastScaledParentWidth)>2&&(this._lastScaledParentWidth=t,n(this))}))}disconnectedCallback(){var t;null===(t=this.layoutObserver)||void 0===t||t.disconnect(),this.layoutObserver=null}componentDidRender(){lt(this.element,"bn-table-renderer");const{mode:t}=E(this.scale);if("auto"!==t&&"empty"!==t)return this._autoScaleGuard=!1,void this.checkOverflow();if(this._autoScaleGuard)return this._autoScaleGuard=!1,void this.checkOverflow();const i=this.element,{width:a}=I(i);if(a<=0)return void this.checkOverflow();this._lastScaledParentWidth=a;const s=this.componentStyle((t=>{var i;return(null===(i=t.global)||void 0===i?void 0:i.fontSizePx)||13.3333})),r=i.scrollWidth,n=this.appliedScaleFactor;if(r<=a+1)return this.errors.remove("AUTO_scale"),void this.checkOverflow();const o=Math.max(.3,n*(a-1)/r);Math.abs(o-n)<.001||(i.style.setProperty("--bn-font-size",s*o+"px"),"empty"===t?this.errors.addOrReplace({id:"AUTO_scale",type:"warning",message:"Auto-scaled table by factor "+o.toFixed(3)}):this.errors.remove("AUTO_scale"),this._autoScaleGuard=!0,e((()=>{this.appliedScaleFactor=o}))),this.checkOverflow()}checkOverflow(){const t=I(this.element),i=this.element.scrollWidth,e=this.element.scrollHeight,a=t.width>0&&i>t.width+1,s=t.height>0&&e>t.height+1;if(!a&&!s)return void G(this.errors,null);const{mode:r}=E(this.scale),n="auto"!==r&&"empty"!==r,o=[];a&&o.push(`width (${Math.round(i)}px > ${Math.round(t.width)}px)`),s&&o.push(`height (${Math.round(e)}px > ${Math.round(t.height)}px)`),G(this.errors,`Table exceeds available ${o.join(" and ")}. Give the component more space, reduce rows (e.g. limit), or set a smaller scale.`,n)}prepareDataFormat(){var t;return $[null===(t=this.dataFormat)||void 0===t?void 0:t.toUpperCase()]}prepareGrouped(){return this.grouped}prepareShowGroupTitle(){return this.showGroupTitle}prepareTableType(){var t;return Q[null===(t=this.type)||void 0===t?void 0:t.toUpperCase()]}prepareLimit(){return Math.floor(Number(this.limit)||0)}prepareThereOf(){if(null==this.thereof||""===this.thereof.trim())return[];try{return JSON.parse(this.thereof)}catch(t){return[]}}preparePartOf(){if(null==this.partof||""===this.partof.trim())return[];try{return JSON.parse(this.partof)}catch(t){return[]}}prepareOrder(){var t;const i=this.resolveInherited("order",this.order,"category").value,e=this.resolveInherited("orderDirection",this.orderDirection,"asc").value,a="auto"===(null==i?void 0:i.trim().toLowerCase());let s=i;return a&&(null===(t=this.datasetMeta)||void 0===t?void 0:t.suggestedOrder)&&(s=this.datasetMeta.suggestedOrder),{hierarchy:s.split(",").map((t=>et[null==t?void 0:t.toUpperCase()])),direction:it[null==e?void 0:e.toUpperCase()]}}prepareI18nMode(){return J.META}prepareI18n(){const t=l,i=new Map(["in","category","operation","thereof","part_of","SUM_TOTAL","no-data","REST"].map((t=>[t,this.t(".".concat(t))]))),e=new Map(t.map((t=>[t,this.t("global.".concat(t))])));return new Map([...e.entries(),...i.entries(),...U(this.ruleSetConfig("user"))])}prepareDataFormatDigits(){return{percent:this.dataFormatDigitsPercent,decimal:this.dataFormatDigitsDecimal}}prepareScenarios(){var t,i,e,a,s,r,n,o,l,h,d;const c=this.resolveInherited("scenarios",this.scenarios),u=this.resolveInherited("variances",this.variances);if(c.inherited||u.inherited){this.errors.remove("AUTO_scenarios");let a=[];return p(c.value)?c.unresolved&&(a=a.concat(null!==(i=null===(t=this.datasetMeta)||void 0===t?void 0:t.availableScenarios)&&void 0!==i?i:[])):a=a.concat(c.value.split(",")),(null===(e=u.value)||void 0===e?void 0:e.trim().length)>0&&(a=a.concat(u.value.split(","))),a.map((t=>t.trim()))}const v="auto"===(null===(a=c.value)||void 0===a?void 0:a.trim().toLowerCase()),m=v||c.unresolved;if((p(c.value)||v)&&p(u.value))return(null===(r=null===(s=this.datasetMeta)||void 0===s?void 0:s.availableScenarios)||void 0===r?void 0:r.length)>0?(m?this.errors.remove("AUTO_scenarios"):this.errors.addOrReplace({id:"AUTO_scenarios",type:"warning",message:"scenarios: not set, auto-detected: "+this.datasetMeta.availableScenarios.join(",")}),this.datasetMeta.availableScenarios):[];let g=[];return v||p(c.value)?(null===(o=null===(n=this.datasetMeta)||void 0===n?void 0:n.availableScenarios)||void 0===o?void 0:o.length)>0&&(m?this.errors.remove("AUTO_scenarios"):this.errors.addOrReplace({id:"AUTO_scenarios",type:"warning",message:"scenarios: not set, auto-detected: "+this.datasetMeta.availableScenarios.join(",")}),g=g.concat(this.datasetMeta.availableScenarios)):(this.errors.remove("AUTO_scenarios"),g=g.concat(null===(l=c.value)||void 0===l?void 0:l.split(","))),(null===(h=u.value)||void 0===h?void 0:h.trim().length)>0&&(g=g.concat(null===(d=u.value)||void 0===d?void 0:d.split(","))),g.map((t=>t.trim()))}prepareCategoryWidth(){var t;return p(this.categoryWidth)?V.INF:V[null===(t=this.categoryWidth)||void 0===t?void 0:t.toUpperCase()]}prepareMeasureScale(){return p(this.measureScale)?"GREATEST":["_","k","M","G","T","P","E","Z","Y","m","μ","n","p","P","f","a","z","y"].includes(this.measureScale.trim())||"LEAST"===this.measureScale.trim().toUpperCase()?this.measureScale.trim():"GREATEST"}prepareMeasureType(){var t;return p(this.measureType)?Y.VOLUME:Y[null===(t=this.measureType)||void 0===t?void 0:t.toUpperCase()]}prepareColumnThereOf(){if(null==this.columnthereof||""===this.columnthereof.trim())return new Map;const t=new Map;try{const i=JSON.parse(this.columnthereof);for(const[e,a]of Object.entries(i))!1===t.has(a.scenario)&&t.set(a.scenario,[]),t.get(a.scenario).push(a)}catch(t){return new Map}return t}prepareInterval(){var t;const i="WARN_intervalConflict",e="WARN_intervalNoDate",a="WARN_intervalSetname",s=p(this.interval)?H:this.interval.trim().toLowerCase();return s!==H&&s!==K&&!D(s)||s===H?(this.errors.remove(i),this.errors.remove(e),this.errors.remove(a),H):null!=this.columnthereof&&""!==this.columnthereof.trim()?(this.errors.addOrReplace({id:i,type:"warning",message:"interval: cannot be combined with columnthereof, interval is ignored."}),this.errors.remove(e),this.errors.remove(a),H):(this.errors.remove(i),s===K?(this.hasBlankSetnames?this.errors.addOrReplace({id:a,type:"warning",message:"interval: rows with blank setname found, they are grouped under '-'."}):this.errors.remove(a),this.errors.remove(e),K):(this.errors.remove(a),this.datasetMeta&&!(null===(t=this.datasetMeta.dateRange)||void 0===t?void 0:t.hasData)?(this.errors.addOrReplace({id:e,type:"warning",message:"interval: dataset has no date values, interval is ignored."}),H):(this.errors.remove(e),s)))}prepareAttributes(){if(null==this.tableAttributes||""===this.tableAttributes.trim())return[];try{const t=JSON.parse(this.tableAttributes);return null===t||"object"!=typeof t||t instanceof Array?[]:Object.entries(t).map((([t,i],e)=>"string"==typeof i?tt(t,"attr_"+e,i):null)).filter((t=>null!==t))}catch(t){return[]}}prepareSumTitle(){return""===this.sumTitle||null==this.sumTitle?"SUM_TOTAL":this.sumTitle}prepareShowMeasureScale(){return this.showMeasureScale}prepareMeasureUnit(){return""===this.measureUnit||null==this.measureUnit?"":this.measureUnit}prepareFilter(){return 0===this.filter.length?"":this.filter}prepareBarColumnWidth(){var t;const i=null===(t=this.barColumnWidth)||void 0===t?void 0:t.toUpperCase(),e=q[i];return e?X[e]:X[q.W10]}prepareBarColumns(){return p(this.barColumns)?[]:this.barColumns.split(",").map((t=>t.trim()))}prepareUnitScaling(){const t=L(this.unitScaling,this.pixelPerUnitGroupMap);return"value"===t.kind?(this.errors.remove("AUTO_unitScaling"),this.autoUnitWarningActive=!1,this.lastReportedUnitsPerEm=void 0,1/t.value):"auto"===t.kind?(this.errors.remove("AUTO_unitScaling"),this.autoUnitWarningActive=!1,this.lastReportedUnitsPerEm=void 0,0):(this.autoUnitWarningActive=!0,this.errors.addOrReplace({id:"AUTO_unitScaling",type:"warning",message:`unit-scaling: invalid value "${t.raw}" - auto-fitting to the bar column width.`}),0)}preparePercentageScaling(){const t=L(this.percentageScaling,this.pixelPerUnitGroupMap);return"value"===t.kind?(this.errors.remove("AUTO_percentageScaling"),this.autoPctWarningActive=!1,this.lastReportedPpPerEm=void 0,1/t.value):"auto"===t.kind?(this.errors.remove("AUTO_percentageScaling"),this.autoPctWarningActive=!1,this.lastReportedPpPerEm=void 0,0):(this.autoPctWarningActive=!0,this.errors.addOrReplace({id:"AUTO_percentageScaling",type:"warning",message:`percentage-scaling: invalid value "${t.raw}" - auto-fitting to the pin area.`}),0)}getDataStructure(){return{ITableDataRow:{setName:{type:"string",isOptional:!1,description:""},date:{type:"string",isOptional:!1,description:""},operation:{type:"string",isOptional:!1,description:""},rowGroup:{type:"string",isOptional:!1,description:""},rowGroupIndex:{type:"number",isOptional:!1,description:""},category:{type:"string",isOptional:!1,description:""},categoryIndex:{type:"number",isOptional:!1,description:""},subCategory:{type:"string",isOptional:!1,description:""},subCategoryIndex:{type:"number",isOptional:!1,description:""},columnGroup:{type:"string",isOptional:!1,description:""},columnGroupIndex:{type:"number",isOptional:!1,description:""},columnSubGroup:{type:"string",isOptional:!1,description:""},columnSubGroupIndex:{type:"number",isOptional:!1,description:""},ac1:{type:"number",isOptional:!1,description:""},ac2:{type:"number",isOptional:!1,description:""},ac3:{type:"number",isOptional:!1,description:""},ac4:{type:"number",isOptional:!1,description:""},pp1:{type:"number",isOptional:!1,description:""},pp2:{type:"number",isOptional:!1,description:""},pp3:{type:"number",isOptional:!1,description:""},pp4:{type:"number",isOptional:!1,description:""},fc1:{type:"number",isOptional:!1,description:""},fc2:{type:"number",isOptional:!1,description:""},fc3:{type:"number",isOptional:!1,description:""},fc4:{type:"number",isOptional:!1,description:""},pl1:{type:"number",isOptional:!1,description:""},pl2:{type:"number",isOptional:!1,description:""},pl3:{type:"number",isOptional:!1,description:""},pl4:{type:"number",isOptional:!1,description:""}}}}async getLayoutState(t){var i,e,a,s;const r=null!==(i=null==t?void 0:t.detail)&&void 0!==i?i:"summary",n=st(this.element),o=this.getEffectiveScaleFactor(),l=Number.isFinite(o)&&o>0?o:1,h=this.componentStyle((t=>{var i;return(null===(i=t.global)||void 0===i?void 0:i.fontSizePx)||13.3333}))*l,d={version:at,tag:this.element.localName,id:ot(this.element),slot:null!==(e=this.element.getAttribute("slot"))&&void 0!==e?e:void 0,rect:rt(this.element,n),em:{fontSizePx:h,appliedScaleFactor:l},regions:[],metadata:{},diagnostics:nt(this.element),scaling:this.resolveScalingInfo(h)},p=null===(a=this.element.shadowRoot)||void 0===a?void 0:a.querySelector("bn-table-renderer");if(p){const t=null!==(s=p.scenarios)&&void 0!==s?s:[];if(d.metadata.scenarios=t.filter((t=>!t.startsWith("d"))),d.metadata.variances=t.filter((t=>t.startsWith("d"))),"function"==typeof p.getLayoutDetail){const t=await p.getLayoutDetail(n,r);d.regions=t.regions,d.metadata=Object.assign(Object.assign({},d.metadata),t.metadata),d.diagnostics=[...d.diagnostics,...t.diagnostics],t.elements&&(d.elements=t.elements),t.table&&(d.table=t.table)}}return d}resolveScalingInfo(t){var i,e;const a={},s=L(this.unitScaling,this.pixelPerUnitGroupMap);if("value"===s.kind)a.unitMode="fixed",a.unitsPerEm=s.value,a.unitPxPerUnit=t/s.value;else{a.unitMode="auto";const e=null===(i=this.lastAutoScalingReport)||void 0===i?void 0:i.unit;void 0!==e&&e>0&&(a.unitsPerEm=1/e,a.unitPxPerUnit=e*t)}const r=L(this.percentageScaling,this.pixelPerUnitGroupMap);if("value"===r.kind)a.percentageMode="fixed",a.percentagePointsPerEm=r.value,a.percentagePxPerPoint=t/r.value;else{a.percentageMode="auto";const i=null===(e=this.lastAutoScalingReport)||void 0===e?void 0:e.percentage;void 0!==i&&i>0&&(a.percentagePointsPerEm=1/i,a.percentagePxPerPoint=i*t)}return a}getEffectiveScaleFactor(){const{mode:t,factor:i}=E(this.scale);return"factor"===t?i:"auto"===t||"empty"===t?this.appliedScaleFactor:1}getFontStyles(){const t=this.getEffectiveScaleFactor();return this.componentStyle((i=>{var e,a,s,r;const n=(null===(e=i.global)||void 0===e?void 0:e.fontSizePx)||13.3333;return{"--bn-font-family":(null===(a=i.global)||void 0===a?void 0:a.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":n*t+"px","--bn-font-color":(null===(s=i.global)||void 0===s?void 0:s.fontColor)||"#000000","--bn-font-background":(null===(r=i.global)||void 0===r?void 0:r.fontBackgroundColor)||"#ffffff"}}))}render(){const t=this.getFontStyles(),i=this.getEffectiveScaleFactor();return a(s,{key:"1ff079411e15668767cd158aeab1456c75808ea2",style:t},a("div",{key:"db4ff9921de92fef2acefeb33454a29e9087bf58"},a("bn-table-renderer",{key:"5bbdba321b5f73207fed36dc0bf9b4ebffa52e85",tableName:this.datasetName,dataVersion:this.dataVersion,sumTitle:this.prepareSumTitle(),scenarios:this.prepareScenarios(),scenariosDataFormat:this.prepareDataFormat(),grouped:this.prepareGrouped(),limit:this.prepareLimit(),showGroupTitle:this.prepareShowGroupTitle(),thereof:this.prepareThereOf(),partof:this.preparePartOf(),order:this.prepareOrder(),categorythereof:this.prepareColumnThereOf(),attributeColumns:this.prepareAttributes(),type:this.prepareTableType(),categoryWidth:this.prepareCategoryWidth(),dataFormatDigits:this.prepareDataFormatDigits(),i18n:this.prepareI18n(),i18nMode:this.prepareI18nMode(),measureScale:this.prepareMeasureScale(),measureType:this.prepareMeasureType(),measureUnit:this.prepareMeasureUnit(),showMeasureScale:this.prepareShowMeasureScale(),filter:this.prepareFilter(),barColumns:this.prepareBarColumns(),interval:this.prepareInterval(),barColumnMaxWidth:this.prepareBarColumnWidth(),unitScaling:this.prepareUnitScaling(),percentageScaling:this.preparePercentageScaling(),reportAutoScaling:this.handleAutoScalingReport,errors:this.errors,scaleFactor:i,ruleSetConfig:this.ruleSetConfig(),selectedStyle:this.selectedStyle})))}get element(){return this}static get watchers(){return{scale:[{validateScaling:0}],filter:[{validateFilter:0}],scenarios:[{validateScenario:0}],variances:[{validateVariances:0}],barColumns:[{validateBarColumns:0}],barColumnWidth:[{validateBarColumnWidth:0}],unitScaling:[{validateUnitScaling:0}],percentageScaling:[{validatePercentageScaling:0}],dataFormat:[{validateDataFormat:0}],type:[{validateType:0}],limit:[{validateLimit:0}],thereof:[{validateThereOf:0}],partof:[{validatePartOf:0}],order:[{validateOrderList:0}],orderDirection:[{validateOrderDirection:0}],measureType:[{validateMeasureType:0}],measureScale:[{validateMeasureScale:0}],dataFormatDigitsDecimal:[{validateDataFormatDigitsDecimal:0}],dataFormatDigitsPercent:[{validateDateFormatDigitsPercent:0}],categoryWidth:[{validateCategoryWidth:0}],columnthereof:[{validateColumnThereOf:0}],interval:[{validateInterval:0}],tableAttributes:[{validateTableAttributes:0}]}}static get style(){return':host(.no-data){display:block;box-sizing:border-box;width:100%;height:100%}:host(.no-data)>div{float:none;width:100%;height:100%}:host(.no-data) .no-data~.no-data{display:none}.empty-state{box-sizing:border-box;display:flex;align-items:center;justify-content:center;float:none;width:100%;height:100%;min-height:3em;margin:0;padding:0.5em;overflow:hidden;border:0.1em dashed #ddd;color:#808080;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);font-style:normal;text-align:center}:host{display:inline-block;position:relative;overflow:hidden;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000)}'}},[1,"bn-table",{datasets:[513],i18nNamespace:[513,"i18n-namespace"],scale:[1],ruleset:[513],selectedStyle:[513,"selected-style"],sumTitle:[1,"sum-title"],filter:[1],measureUnit:[1,"measure-unit"],scenarios:[1],variances:[1],barColumns:[1,"bar-columns"],barColumnWidth:[1,"bar-column-width"],unitScaling:[8,"unit-scaling"],percentageScaling:[8,"percentage-scaling"],dataFormat:[1,"data-format"],grouped:[4],showMeasureScale:[4,"show-measure-scale"],showGroupTitle:[4,"show-group-title"],type:[1],limit:[2],thereof:[1],partof:[1],order:[1],orderDirection:[1,"order-direction"],measureType:[1,"measure-type"],measureScale:[1,"measure-scale"],dataFormatDigitsDecimal:[2,"data-format-digits-decimal"],dataFormatDigitsPercent:[2,"data-format-digits-percent"],categoryWidth:[1,"category-width"],columnthereof:[1],interval:[1],tableAttributes:[1,"attributes"],datasetName:[32],dataVersion:[32],datasetMeta:[32],appliedScaleFactor:[32],hasBlankSetnames:[32],getLayoutState:[64]},void 0,{scale:[{validateScaling:0}],filter:[{validateFilter:0}],scenarios:[{validateScenario:0}],variances:[{validateVariances:0}],barColumns:[{validateBarColumns:0}],barColumnWidth:[{validateBarColumnWidth:0}],unitScaling:[{validateUnitScaling:0}],percentageScaling:[{validatePercentageScaling:0}],dataFormat:[{validateDataFormat:0}],type:[{validateType:0}],limit:[{validateLimit:0}],thereof:[{validateThereOf:0}],partof:[{validatePartOf:0}],order:[{validateOrderList:0}],orderDirection:[{validateOrderDirection:0}],measureType:[{validateMeasureType:0}],measureScale:[{validateMeasureScale:0}],dataFormatDigitsDecimal:[{validateDataFormatDigitsDecimal:0}],dataFormatDigitsPercent:[{validateDateFormatDigitsPercent:0}],categoryWidth:[{validateCategoryWidth:0}],columnthereof:[{validateColumnThereOf:0}],interval:[{validateInterval:0}],tableAttributes:[{validateTableAttributes:0}]}]),dt=ht,pt=function(){"undefined"!=typeof customElements&&["bn-table","bn-table-renderer"].forEach((t=>{switch(t){case"bn-table":customElements.get(r(t))||customElements.define(r(t),ht);break;case"bn-table-renderer":customElements.get(r(t))||Z()}}))};export{dt as BnTable,pt as defineCustomElement}
@@ -1 +1 @@
1
- import{proxyCustomElement as t,HTMLElement as n,forceUpdate as i,h as o,Host as e,transformTag as s}from"@stencil/core/internal/client";import{w as l}from"./withDataset.js";import{w as a}from"./withTranslation.js";import{w as r}from"./withComponentStatus.js";import{w as d}from"./withStyled.js";import{w as c}from"./withComponentStyle.js";import{w as u}from"./withHasError.js";import{g as v}from"./parentDimensions.js";import{p as h}from"./scaling.js";import{s as f}from"./sanitizeHtml.js";const m="[A-Za-z_$\\u00C0-\\uFFFF][\\w$\\u00C0-\\uFFFF]*",p="'[^'\\\\]*'|\"[^\"\\\\]*\"",b=`(?:this\\.)?data(?:\\.(${m})|\\[\\s*(${p})\\s*\\])\\[\\s*(\\d+)\\s*\\]\\.(${m})`,g=RegExp(`\\$\\{\\s*(?:${b}|t\\(\\s*(${p})\\s*(?:,\\s*\\{([^{}]*)\\}\\s*)?\\))\\s*\\}`,"g"),w=RegExp(`\\s*(?:(${m})|(${p}))\\s*:\\s*(?:(${p})|(-?\\d+(?:\\.\\d+)?)|(${b}))\\s*(?:,|$)`,"y"),y=t=>(t+"").replace(/[&<>"'\t\n\f\r ]/g,(t=>`&#${t.charCodeAt(0)};`)),$=(t,n)=>"object"==typeof t&&null!==t&&Object.prototype.hasOwnProperty.call(t,n)?t[n]:void 0,_=t=>t.slice(1,-1);const R=t(class extends n{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.refit=()=>{i(this)},this.data={},d(this),r(this),this.errors=u(this),this.t=a(this).t,l(this,((t,n)=>{this.data=Object.assign(Object.assign({},this.data),{[t]:n})})),this.componentStyle=c(this)}connectedCallback(){var t;null===(t=document.fonts)||void 0===t||t.addEventListener("loadingdone",this.refit)}disconnectedCallback(){var t;null===(t=document.fonts)||void 0===t||t.removeEventListener("loadingdone",this.refit)}validateValue(t){"string"!=typeof t||""===t?this.errors.addOrReplace({id:"no_value",type:"warning",message:"Empty value"}):this.errors.remove("no_value")}validateScaling(t){if(null==t||""===t||"none"===t||"auto"===t)return void this.errors.remove("ERR_scale");const n=Number(t);isNaN(n)||n<=0?this.errors.addOrReplace({id:"ERR_scale",type:"warning",message:`Invalid scale value: "${t}". Use "none", "auto", or a positive number.`}):this.errors.remove("ERR_scale")}componentWillLoad(){this.validateValue(this.value),this.validateScaling(this.scale)}prepareStyle(){return this.componentStyle((t=>{var n,i,o,e,s,l,a,r,d,c,u,v,h,f,m,p,b,g,w,y,$,_;return{fontStyles:{font:`${null!==(e=null!==(i=null===(n=t["bn-text"])||void 0===n?void 0:n.fontSizePx)&&void 0!==i?i:null===(o=t.global)||void 0===o?void 0:o.fontSizePx)&&void 0!==e?e:13.3333}px ${null!==(r=null!==(l=null===(s=t["bn-text"])||void 0===s?void 0:s.fontFamily)&&void 0!==l?l:null===(a=t.global)||void 0===a?void 0:a.fontFamily)&&void 0!==r?r:"'Noto Sans', sans-serif"}`,size:null!==(v=null!==(c=null===(d=t["bn-text"])||void 0===d?void 0:d.fontSizePx)&&void 0!==c?c:null===(u=t.global)||void 0===u?void 0:u.fontSizePx)&&void 0!==v?v:13.3333,color:null!==(p=null!==(f=null===(h=t["bn-text"])||void 0===h?void 0:h.fontColor)&&void 0!==f?f:null===(m=t.global)||void 0===m?void 0:m.fontColor)&&void 0!==p?p:"#000000",background:null!==(y=null!==(g=null===(b=t["bn-text"])||void 0===b?void 0:b.fontBackgroundColor)&&void 0!==g?g:null===(w=t.global)||void 0===w?void 0:w.fontBackgroundColor)&&void 0!==y?y:"#ffffff",leading:null!==(_=null===($=t["bn-text"])||void 0===$?void 0:$.leading)&&void 0!==_?_:1.8}}}))}applyScaling(t){const n=this.element,{mode:i,factor:o}=h(this.scale),{width:e,height:s}=v(n),l=n.scrollHeight>n.clientHeight+1?n.clientHeight:s,a=e,r=a>0&&n.scrollWidth>a+1,d=l>0&&n.scrollHeight>l+1,c=r||d;if(a<=0&&l<=0)return;if("none"===i){if(c){const t=[];r&&t.push(`w:${n.scrollWidth}>${Math.round(a)}`),d&&t.push(`h:${n.scrollHeight}>${Math.round(l)}`),this.errors.addOrReplace({id:"WARN_overflow",type:"warning",message:`Content overflows container (${t.join(", ")})`})}else this.errors.remove("WARN_overflow");return}if("factor"===i){if(c){const t=[];r&&t.push(`w:${n.scrollWidth}>${Math.round(a)}`),d&&t.push(`h:${n.scrollHeight}>${Math.round(l)}`),this.errors.addOrReplace({id:"WARN_overflow",type:"warning",message:`Content overflows with factor ${o} (${t.join(", ")})`})}else this.errors.remove("WARN_overflow");return}n.style.setProperty("--bn-font-size",t+"px");const u=n.scrollWidth,f=n.scrollHeight,m=n.clientHeight,p=f>m+1?m:s,b=a<=0||u<=a+1,g=p<=0||f<=p+1;if(b&&g)return void this.errors.remove("AUTO_scale");const w=Math.min(1,!b&&a>0?a/u:1,!g&&p>0?p/f:1);n.style.setProperty("--bn-font-size",t*w+"px"),"empty"===i?this.errors.addOrReplace({id:"AUTO_scale",type:"warning",message:"Auto-scaled font by factor "+w.toFixed(3)}):this.errors.remove("AUTO_scale")}componentDidRender(){var t;const{html:n,unknown:i}=function(t,n,i){const o=[],e=t=>{o.includes(t)||o.push(t)},s=(t,i,o,s,l)=>{const a=$($($(n,null!=i?i:_(o)),Number(s)+""),l);return void 0===a&&e(t),a};return{html:t.replace(g,((t,n,o,l,a,r,d)=>{const c=t.slice(2,-1).trim();try{if(void 0===r){const t=s(c,n,o,l,a);return null==t?"":y(t)}const e=void 0===d?void 0:(t=>{const n={};for(w.lastIndex=0;""!==t.slice(w.lastIndex).trim();){const i=w.exec(t);if(!i)return null;const[,o,e,l,a,r,d,c,u,v]=i;n[null!=o?o:_(e)]=void 0!==l?_(l):void 0!==a?Number(a):s(r,d,c,u,v)}return n})(d);return null===e?t:y(i(_(r),e))}catch(t){return e(c),""}})),unknown:o}}(null!==(t=this.value)&&void 0!==t?t:"",this.data,this.t);i.length>0?this.errors.addOrReplace({id:"WARN_value_path",type:"warning",message:"Unknown template path: "+i.join(", ")}):this.errors.remove("WARN_value_path"),this.container.innerHTML=f(n),this.applyScaling(this.prepareStyle().fontStyles.size)}render(){const{fontStyles:t}=this.prepareStyle(),{mode:n,factor:i}=h(this.scale),s="factor"===n?t.size*i+"px":t.size+"px",l={"--bn-font-family":t.font.substring(t.font.indexOf("px ")+3),"--bn-font-size":s,"--bn-font-color":t.color,"--bn-font-background":t.background};return o(e,{key:"a09d93b0c15d8172bc739406df52b1dab6a48842",style:l},o("div",{key:"725fd0ce4b5500c3b5c2d31ef4d0f7072bb2670d"},o("span",{key:"cb5bf2eaca4bfb936d58821c375be131084a75e2",class:"container",ref:t=>{this.container=t}})))}get element(){return this}static get watchers(){return{value:[{validateValue:0}],scale:[{validateScaling:0}]}}static get style(){return':host{padding:0.5em;display:inline-block;position:relative;overflow:hidden;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000);background-color:var(--bn-font-background, white)}span.container p{margin:0}'}},[1,"bn-text",{value:[1],scale:[1],data:[32]},void 0,{value:[{validateValue:0}],scale:[{validateScaling:0}]}]),x=R,j=function(){"undefined"!=typeof customElements&&["bn-text"].forEach((t=>{"bn-text"===t&&(customElements.get(s(t))||customElements.define(s(t),R))}))};export{x as BnText,j as defineCustomElement}
1
+ import{p as t,H as e,f as n,h as o,a as i,t as s}from"./p-D6YGOYV1.js";import{w as a}from"./p-BXrPfAvP.js";import{w as l}from"./p-DsOaqeTN.js";import{w as r}from"./p-DEHnizot.js";import{w as d}from"./p-DdGnuNtc.js";import{w as c}from"./p-jbp6YiHf.js";import{w as u}from"./p-CGI6XIaK.js";import{g as f}from"./p-DD1zlev_.js";import{p as v}from"./p-Xb6Ilq8u.js";import{s as h}from"./p-CyUmrWfW.js";const p="[A-Za-z_$\\u00C0-\\uFFFF][\\w$\\u00C0-\\uFFFF]*",m="'[^'\\\\]*'|\"[^\"\\\\]*\"",b=`(?:this\\.)?data(?:\\.(${p})|\\[\\s*(${m})\\s*\\])\\[\\s*(\\d+)\\s*\\]\\.(${p})`,g=RegExp(`\\$\\{\\s*(?:${b}|t\\(\\s*(${m})\\s*(?:,\\s*\\{([^{}]*)\\}\\s*)?\\))\\s*\\}`,"g"),y=RegExp(`\\s*(?:(${p})|(${m}))\\s*:\\s*(?:(${m})|(-?\\d+(?:\\.\\d+)?)|(${b}))\\s*(?:,|$)`,"y"),w=t=>(t+"").replace(/[&<>"'\t\n\f\r ]/g,(t=>`&#${t.charCodeAt(0)};`)),$=(t,e)=>"object"==typeof t&&null!==t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0,N=t=>t.slice(1,-1);const _=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.refit=()=>{n(this)},this.data={},d(this),r(this),this.errors=u(this),this.t=l(this).t,a(this,((t,e)=>{this.data=""===t?{}:Object.assign(Object.assign({},this.data),{[t]:e})})),this.componentStyle=c(this)}connectedCallback(){var t;null===(t=document.fonts)||void 0===t||t.addEventListener("loadingdone",this.refit)}disconnectedCallback(){var t;null===(t=document.fonts)||void 0===t||t.removeEventListener("loadingdone",this.refit)}validateValue(t){"string"!=typeof t||""===t?this.errors.addOrReplace({id:"WARN_value",type:"warning",message:"Empty value"}):this.errors.remove("WARN_value")}validateScaling(t){if(null==t||""===t||"none"===t||"auto"===t)return void this.errors.remove("WARN_scale");const e=Number(t);isNaN(e)||e<=0?this.errors.addOrReplace({id:"WARN_scale",type:"warning",message:`Invalid scale value: "${t}". Use "none", "auto", or a positive number.`}):this.errors.remove("WARN_scale")}componentWillLoad(){this.validateValue(this.value),this.validateScaling(this.scale)}prepareStyle(){return this.componentStyle((t=>{var e,n,o,i,s,a,l,r,d,c,u,f,v,h,p,m,b,g,y,w,$,N;return{fontStyles:{font:`${null!==(i=null!==(n=null===(e=t["bn-text"])||void 0===e?void 0:e.fontSizePx)&&void 0!==n?n:null===(o=t.global)||void 0===o?void 0:o.fontSizePx)&&void 0!==i?i:13.3333}px ${null!==(r=null!==(a=null===(s=t["bn-text"])||void 0===s?void 0:s.fontFamily)&&void 0!==a?a:null===(l=t.global)||void 0===l?void 0:l.fontFamily)&&void 0!==r?r:"'Noto Sans', sans-serif"}`,size:null!==(f=null!==(c=null===(d=t["bn-text"])||void 0===d?void 0:d.fontSizePx)&&void 0!==c?c:null===(u=t.global)||void 0===u?void 0:u.fontSizePx)&&void 0!==f?f:13.3333,color:null!==(m=null!==(h=null===(v=t["bn-text"])||void 0===v?void 0:v.fontColor)&&void 0!==h?h:null===(p=t.global)||void 0===p?void 0:p.fontColor)&&void 0!==m?m:"#000000",background:null!==(w=null!==(g=null===(b=t["bn-text"])||void 0===b?void 0:b.fontBackgroundColor)&&void 0!==g?g:null===(y=t.global)||void 0===y?void 0:y.fontBackgroundColor)&&void 0!==w?w:"#ffffff",leading:null!==(N=null===($=t["bn-text"])||void 0===$?void 0:$.leading)&&void 0!==N?N:1.8}}}))}applyScaling(t){const e=this.element,{mode:n,factor:o}=v(this.scale),{width:i,height:s}=f(e),a=e.scrollHeight>e.clientHeight+1?e.clientHeight:s,l=i,r=l>0&&e.scrollWidth>l+1,d=a>0&&e.scrollHeight>a+1,c=r||d;if(l<=0&&a<=0)return;if("none"===n){if(c){const t=[];r&&t.push(`w:${e.scrollWidth}>${Math.round(l)}`),d&&t.push(`h:${e.scrollHeight}>${Math.round(a)}`),this.errors.addOrReplace({id:"WARN_overflow",type:"warning",message:`Content overflows container (${t.join(", ")})`})}else this.errors.remove("WARN_overflow");return}if("factor"===n){if(c){const t=[];r&&t.push(`w:${e.scrollWidth}>${Math.round(l)}`),d&&t.push(`h:${e.scrollHeight}>${Math.round(a)}`),this.errors.addOrReplace({id:"WARN_overflow",type:"warning",message:`Content overflows with factor ${o} (${t.join(", ")})`})}else this.errors.remove("WARN_overflow");return}e.style.setProperty("--bn-font-size",t+"px");const u=e.scrollWidth,h=e.scrollHeight,p=e.clientHeight,m=h>p+1?p:s,b=l<=0||u<=l+1,g=m<=0||h<=m+1;if(b&&g)return void this.errors.remove("AUTO_scale");const y=Math.min(1,!b&&l>0?l/u:1,!g&&m>0?m/h:1);e.style.setProperty("--bn-font-size",t*y+"px"),"empty"===n?this.errors.addOrReplace({id:"AUTO_scale",type:"warning",message:"Auto-scaled font by factor "+y.toFixed(3)}):this.errors.remove("AUTO_scale")}componentDidRender(){var t;const{html:e,unknown:n}=function(t,e,n){const o=[],i=t=>{o.includes(t)||o.push(t)},s=(t,n,o,s,a)=>{const l=$($($(e,null!=n?n:N(o)),Number(s)+""),a);return void 0===l&&i(t),l};return{html:t.replace(g,((t,e,o,a,l,r,d)=>{const c=t.slice(2,-1).trim();try{if(void 0===r){const t=s(c,e,o,a,l);return null==t?"":w(t)}const i=void 0===d?void 0:(t=>{const e={};for(y.lastIndex=0;""!==t.slice(y.lastIndex).trim();){const n=y.exec(t);if(!n)return null;const[,o,i,a,l,r,d,c,u,f]=n;e[null!=o?o:N(i)]=void 0!==a?N(a):void 0!==l?Number(l):s(r,d,c,u,f)}return e})(d);return null===i?t:w(n(N(r),i))}catch(t){return i(c),""}})),unknown:o}}(null!==(t=this.value)&&void 0!==t?t:"",this.data,this.t);n.length>0?this.errors.addOrReplace({id:"WARN_value_path",type:"warning",message:"Unknown template path: "+n.join(", ")}):this.errors.remove("WARN_value_path"),this.container.innerHTML=h(e),this.applyScaling(this.prepareStyle().fontStyles.size)}render(){const{fontStyles:t}=this.prepareStyle(),{mode:e,factor:n}=v(this.scale),s="factor"===e?t.size*n+"px":t.size+"px",a={"--bn-font-family":t.font.substring(t.font.indexOf("px ")+3),"--bn-font-size":s,"--bn-font-color":t.color,"--bn-font-background":t.background};return o(i,{key:"47eaf1468ffc8b8de7e77f2b0aff4b927f8b0471",style:a},o("div",{key:"1f592c2fd0a4af77047c56ee043f6bdd84dfb2d2"},o("span",{key:"ecad3e6ea36dfa495ef78183fc6c3979eb9d5be2",class:"container",ref:t=>{this.container=t}})))}get element(){return this}static get watchers(){return{value:[{validateValue:0}],scale:[{validateScaling:0}]}}static get style(){return':host{padding:0.5em;display:inline-block;position:relative;overflow:hidden;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000);background-color:var(--bn-font-background, white)}span.container p{margin:0}'}},[1,"bn-text",{datasets:[513],selectedStyle:[513,"selected-style"],i18nNamespace:[513,"i18n-namespace"],value:[1],scale:[1],data:[32]},void 0,{value:[{validateValue:0}],scale:[{validateScaling:0}]}]),A=_,j=function(){"undefined"!=typeof customElements&&["bn-text"].forEach((t=>{"bn-text"===t&&(customElements.get(s(t))||customElements.define(s(t),_))}))};export{A as BnText,j as defineCustomElement}
@@ -1,9 +1,9 @@
1
1
  import type { Components, JSX } from "../types/components";
2
2
 
3
- interface EditorCompanion extends Components.EditorCompanion, HTMLElement {}
4
- export const EditorCompanion: {
5
- prototype: EditorCompanion;
6
- new (): EditorCompanion;
3
+ interface BnTitleRenderer extends Components.BnTitleRenderer, HTMLElement {}
4
+ export const BnTitleRenderer: {
5
+ prototype: BnTitleRenderer;
6
+ new (): BnTitleRenderer;
7
7
  };
8
8
  /**
9
9
  * Used to define this component and all nested components recursively.
@@ -0,0 +1 @@
1
+ import{B as o,d as p}from"./p-BpCL2bfw.js";const s=o,r=p;export{s as BnTitleRenderer,r as defineCustomElement}
@@ -1 +1 @@
1
- import{T as t,d as o}from"./bn-title2.js";const s=t,r=o;export{s as BnTitle,r as defineCustomElement}
1
+ import{T as o,d as s}from"./p-U3zkcEJZ.js";const p=o,r=s;export{p as BnTitle,r as defineCustomElement}
@@ -1 +1 @@
1
- import{proxyCustomElement as t,HTMLElement as e,h as n,Host as i,transformTag as s}from"@stencil/core/internal/client";import{o,l as r}from"./validate.js";import{L as a}from"./types.js";import{o as l,m as d}from"./geometry.js";import{r as c,a as u}from"./diagnostics.js";import{w as h}from"./withComponentStatus.js";import{w as f}from"./withStyled.js";import{w as g}from"./withComponentStyle.js";import{w as p}from"./withHasError.js";import{g as v,a as m}from"./parentDimensions.js";import{o as y}from"./layoutObserver.js";const b=["*","/","+","-","x","÷","none"];function w(t){switch(t){case"*":case"x":return"×";case"/":case"÷":return"÷";case"+":return"+";case"-":return"−";default:return""}}function x(t,e,n){return t.find((t=>t.from===e&&t.to===n))}function $(t){return 2*(t-1)+1}function S(t){return 2*(t-1)+1}function k(t){return t<=1?1:2*(t-1)+1}function R(t){return k(t)}function M(t,e){const n=t.getBoundingClientRect(),i=n.left-e.left,s=n.top-e.top;return{left:i,top:s,width:n.width,height:n.height,centerX:i+n.width/2,centerY:s+n.height/2}}function L(t,e,n){switch(n){case"ltr":return e?{x:t.left+t.width,y:t.centerY}:{x:t.left,y:t.centerY};case"rtl":return e?{x:t.left,y:t.centerY}:{x:t.left+t.width,y:t.centerY};case"ttb":return e?{x:t.centerX,y:t.top+t.height}:{x:t.centerX,y:t.top};case"btt":return e?{x:t.centerX,y:t.top}:{x:t.centerX,y:t.top+t.height}}}function C(t,e,n,i,s=8){const o=-(i-1)*s/2+n*s;switch(e){case"ltr":return{x:t.left,y:t.centerY+o};case"rtl":return{x:t.left+t.width,y:t.centerY+o};case"ttb":return{x:t.centerX+o,y:t.top};case"btt":return{x:t.centerX+o,y:t.top+t.height}}}function E(t,e,n,i,s){switch(n){case"straight":return function(t,e){return{path:`M ${t.x} ${t.y} L ${e.x} ${e.y}`,midpoint:{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}}(t,e);case"curved":return function(t,e,n){let i,s;if("ltr"===n||"rtl"===n){const n=(t.x+e.x)/2;i={x:n,y:t.y},s={x:n,y:e.y}}else{const n=(t.y+e.y)/2;i={x:t.x,y:n},s={x:e.x,y:n}}return{path:`M ${t.x} ${t.y} C ${i.x} ${i.y}, ${s.x} ${s.y}, ${e.x} ${e.y}`,midpoint:{x:.125*t.x+.375*i.x+.375*s.x+.125*e.x,y:.125*t.y+.375*i.y+.375*s.y+.125*e.y}}}(t,e,i);default:return function(t,e,n,i){let s,o;if("ltr"===n||"rtl"===n){const n=null!=i?i:t.x+.7*(e.x-t.x);s=`M ${t.x} ${t.y} L ${n} ${t.y} L ${n} ${e.y} L ${e.x} ${e.y}`,o={x:n,y:(t.y+e.y)/2}}else{const n=null!=i?i:t.y+.7*(e.y-t.y);s=`M ${t.x} ${t.y} L ${t.x} ${n} L ${e.x} ${n} L ${e.x} ${e.y}`,o={x:(t.x+e.x)/2,y:n}}return{path:s,midpoint:o}}(t,e,i,s)}}function j(t,e,n){let i,s,o;switch(n){case"ltr":i=t.left+t.width,s=e.map((t=>t.left)),o=1;break;case"rtl":i=t.left,s=e.map((t=>t.left+t.width)),o=-1;break;case"ttb":i=t.top+t.height,s=e.map((t=>t.top)),o=1;break;case"btt":i=t.top,s=e.map((t=>t.top+t.height)),o=-1}const r=s.map((t=>(t-i)*o)).filter((t=>t>=0));if(0!==r.length)return i+Math.min(...r)*o*.7}function A(t,e,n,i){return"ltr"===i||"rtl"===i?{x:t,y:(e.centerY+n.centerY)/2}:{x:(e.centerX+n.centerX)/2,y:t}}function N(t,e,n){var i,s;return Object.assign({stroke:null!==(i=null==n?void 0:n.color)&&void 0!==i?i:t,strokeWidth:null!==(s=null==n?void 0:n.width)&&void 0!==s?s:e},(null==n?void 0:n.dasharray)?{strokeDasharray:n.dasharray}:{})}const O=t(class extends e{validateEdgesProp(t){const e="ERR_edges",n=function(t){const e=[];if(!t||""===t.trim())return e.push("edges: value is required"),e;let n;try{n=JSON.parse(t)}catch(t){return e.push("edges: invalid JSON structure"),e}if(!Array.isArray(n))return e.push("edges: must be an array"),e;if(0===n.length)return e.push("edges: array must not be empty"),e;const i=new Set,s=new Set,o=new Map;n.forEach(((t,n)=>{if("object"!=typeof t||null===t)return void e.push(`edges[${n}]: must be an object`);const r=t;if("string"!=typeof r.from||""===r.from.trim()?e.push(`edges[${n}]: 'from' is required and must be a non-empty string`):i.add(r.from),"string"!=typeof r.to||""===r.to.trim()?e.push(`edges[${n}]: 'to' is required and must be a non-empty string`):(i.add(r.to),s.add(r.to),"string"==typeof r.from&&o.set(r.from,[...o.get(r.from)||[],r.to])),void 0!==r.operator&&("string"==typeof r.operator&&b.includes(r.operator)||e.push(`edges[${n}]: 'operator' must be one of: ${b.join(", ")}`)),void 0!==r.label&&"string"!=typeof r.label&&e.push(`edges[${n}]: 'label' must be a string`),void 0!==r.style)if("object"!=typeof r.style||null===r.style)e.push(`edges[${n}]: 'style' must be an object`);else{const t=r.style;void 0!==t.color&&"string"!=typeof t.color&&e.push(`edges[${n}]: 'style.color' must be a string`),void 0!==t.width&&"number"!=typeof t.width&&e.push(`edges[${n}]: 'style.width' must be a number`),void 0!==t.dasharray&&"string"!=typeof t.dasharray&&e.push(`edges[${n}]: 'style.dasharray' must be a string`)}}));const r=Array.from(i).filter((t=>!s.has(t)));return 0===r.length?e.push("edges: tree has no root node (circular reference detected)"):r.length>1?e.push("edges: tree has multiple root nodes: "+r.join(", ")):e.push(...function(t,e,n){const i=[],s=new Set,o=new Set,r=t=>{o.add(t),s.add(t);for(const n of e.get(t)||[])s.has(n)?i.push(`edges: circular reference, the edge from '${t}' to '${n}' leads back`):o.has(n)||r(n);s.delete(t)};r(t);const a=Array.from(n).filter((t=>!o.has(t)));return a.length>0&&i.push(`edges: nodes not connected to the root '${t}': ${a.join(", ")}`),i}(r[0],o,i)),e}(t);n.length>0?(this.errors.addOrReplace({id:e,type:"error",message:"edges: "+n.join("; ")}),this.treeConfig=null):(this.errors.remove(e),this.treeConfig=function(t){if(!t||""===t.trim())return null;try{const e=JSON.parse(t);if(!Array.isArray(e))return null;const n=e,i=function(t){const e=new Map;for(const n of t){const t=e.get(n.from)||[];t.push(n.to),e.set(n.from,t)}return e}(n),s=function(t){const e=new Set;for(const n of t)e.add(n.from),e.add(n.to);return e}(n),o=function(t,e){const n=new Set;for(const e of t)n.add(e.to);const i=Array.from(e).filter((t=>!n.has(t)));return 1===i.length?i[0]:null}(n,s);return{edges:n,adjacencyList:i,rootNode:o,allNodes:s}}catch(t){return console.error("parseTreeConfig: failed to parse tree configuration",t),null}}(t)),this.recalculateLayout()}validateDirection(t){const e="ERR_direction",n=["ltr","rtl","ttb","btt"];n.includes(t)?this.errors.remove(e):this.errors.addOrReplace({id:e,type:"warning",message:`direction: invalid value '${t}', must be one of: ${n.join(", ")}`}),this.recalculateLayout()}validateLevelSpacing(t){const e="ERR_levelSpacing";!o(t)||t<0?this.errors.addOrReplace({id:e,type:"warning",message:`level-spacing: invalid value '${t}', must be a non-negative number`}):this.errors.remove(e),this.recalculateLayout()}validateNodeSpacing(t){const e="ERR_nodeSpacing";!o(t)||t<0?this.errors.addOrReplace({id:e,type:"warning",message:`node-spacing: invalid value '${t}', must be a non-negative number`}):this.errors.remove(e),this.recalculateLayout()}validateEdgeStyle(t){const e="ERR_edgeStyle",n=["straight","orthogonal","curved"];n.includes(t)?this.errors.remove(e):this.errors.addOrReplace({id:e,type:"warning",message:`edge-style: invalid value '${t}', must be one of: ${n.join(", ")}`})}validateShowOperators(t){const e="ERR_showOperators";r(t)?this.errors.remove(e):this.errors.addOrReplace({id:e,type:"warning",message:`show-operators: invalid value '${t}', must be 'true' or 'false'`})}constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.treeConfig=null,this.layout=null,this.nodeRects=new Map,this.svgWidth=0,this.svgHeight=0,this.resizeObserver=null,this.gridContainer=null,this.observed=new Set,this.parentObserver=null,this.direction="ltr",this.levelSpacing=60,this.nodeSpacing=20,this.edgeStyle="orthogonal",this.showOperators="true",f(this),h(this),this.errors=p(this),this.componentStyle=g(this)}async getLayoutState(t){var e,n,i,s,o,r,h,f,g,p,v;const m=null!==(e=null==t?void 0:t.detail)&&void 0!==e?e:"summary",y=l(this.element),b=this.componentStyle((t=>{var e;return(null===(e=t.global)||void 0===e?void 0:e.fontSizePx)||13.3333})),w={version:a,tag:this.element.localName,id:u(this.element),slot:null!==(n=this.element.getAttribute("slot"))&&void 0!==n?n:void 0,rect:d(this.element,y),em:{fontSizePx:b,appliedScaleFactor:1},regions:[],metadata:{nodeCount:null!==(s=null===(i=this.treeConfig)||void 0===i?void 0:i.allNodes.size)&&void 0!==s?s:0,edgeCount:null!==(r=null===(o=this.treeConfig)||void 0===o?void 0:o.edges.length)&&void 0!==r?r:0},diagnostics:c(this.element)},x=null===(h=this.element.shadowRoot)||void 0===h?void 0:h.querySelector(".tree-grid");if(x&&w.regions.push({id:"grid",rect:d(x,y)}),"full"!==m||!this.treeConfig)return w;const $=[];for(const t of this.treeConfig.allNodes){const e=this.element.querySelector(`[slot="${t}"]`);if(!e)continue;const n={kind:"node",nodeId:t,rect:d(e,y)};$.push(n)}const S=Array.from(null!==(g=null===(f=this.element.shadowRoot)||void 0===f?void 0:f.querySelectorAll("svg.edge-layer path"))&&void 0!==g?g:[]);let k=0;for(const t of this.treeConfig.edges){if(!this.nodeRects.get(t.from)||!this.nodeRects.get(t.to))continue;const e=S[k++];if(!e)break;const n={kind:"edge",from:t.from,to:t.to,operator:t.operator,path:null!==(p=e.getAttribute("d"))&&void 0!==p?p:void 0,rect:d(e,y)};$.push(n)}return null===(v=this.element.shadowRoot)||void 0===v||v.querySelectorAll("svg.edge-layer g.operator-group").forEach((t=>{var e,n;const i=null!==(n=null===(e=t.textContent)||void 0===e?void 0:e.trim())&&void 0!==n?n:"";if(!i)return;const s={kind:"label",role:"operator",text:i,rect:d(t,y)};$.push(s)})),w.elements=$,w}getTreeStyle(){return this.componentStyle((t=>({edgeColor:t["bn-tree"].edgeColor,edgeWidth:t["bn-tree"].edgeWidth,operatorCircleRadius:t["bn-tree"].operatorCircleRadius,operatorFontSize:t.global.fontSizePx*t["bn-tree"].operatorFontSizeScale,operatorColor:t["bn-tree"].operatorColor})))}componentWillLoad(){this.validateEdgesProp(this.edges),this.validateDirection(this.direction),this.validateLevelSpacing(this.levelSpacing),this.validateNodeSpacing(this.nodeSpacing),this.validateEdgeStyle(this.edgeStyle),this.validateShowOperators(this.showOperators)}connectedCallback(){this.observeLayout(),this.updateNodeRects()}componentDidLoad(){var t;null===(t=this.element.shadowRoot)||void 0===t||t.addEventListener("slotchange",(()=>{this.observeLayout(),this.updateNodeRects()})),requestAnimationFrame((()=>{this.updateNodeRects()}))}componentDidRender(){this.observeLayout(),this.updateNodeRects()}disconnectedCallback(){var t;this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),this.observed.clear(),null===(t=this.parentObserver)||void 0===t||t.disconnect(),this.parentObserver=null}observeLayout(){var t,e,n;const i=null!==(e=null===(t=this.element.shadowRoot)||void 0===t?void 0:t.querySelector(".tree-grid"))&&void 0!==e?e:null;if(i!==this.gridContainer&&(null===(n=this.resizeObserver)||void 0===n||n.disconnect(),this.observed.clear(),this.gridContainer=i),i){this.resizeObserver||(this.resizeObserver=new ResizeObserver((()=>{this.updateNodeRects()}))),this.parentObserver||(this.parentObserver=y(this.element,(()=>this.checkOverflow())));for(const t of[i,...Array.from(this.element.querySelectorAll("[slot]"))])this.observed.has(t)||(this.resizeObserver.observe(t),this.observed.add(t))}}recalculateLayout(){this.layout=this.treeConfig?function(t,e,n,i){if(!t.rootNode)return{positions:new Map,gridTemplateColumns:"",gridTemplateRows:"",maxLevel:0,maxIndex:0};const s=function(t){const e=new Map;if(!t.rootNode)return e;const n=[{node:t.rootNode,level:0}],i=new Set;for(;n.length>0;){const{node:s,level:o}=n.shift();if(i.has(s))continue;i.add(s),e.set(s,o);const r=t.adjacencyList.get(s)||[];for(const t of r)i.has(t)||n.push({node:t,level:o+1})}return e}(t),o=function(t){const e=new Map;if(!t.rootNode)return e;let n=0;return function i(s){const o=e.get(s);if(o)return o;const r=t.adjacencyList.get(s)||[];if(e.set(s,{startIndex:n,endIndex:n}),0===r.length){const t={startIndex:n,endIndex:n};return e.set(s,t),n++,t}let a=1/0,l=-1/0;for(const t of r){const e=i(t);a=Math.min(a,e.startIndex),l=Math.max(l,e.endIndex)}const d={startIndex:a,endIndex:l};return e.set(s,d),d}(t.rootNode),e}(t),r=function(t,e,n,i){var s,o;const r=new Map,a=Math.max(...Array.from(e.values()));for(const l of t.allNodes){const d=null!==(s=e.get(l))&&void 0!==s?s:0,c=null!==(o=n.get(l))&&void 0!==o?o:{startIndex:0,endIndex:0};let u,h,f=1,g=1;const p=c.endIndex-c.startIndex+1,v=Array.from(t.allNodes).some((t=>{var i;const s=n.get(t);return t!==l&&void 0!==s&&(null!==(i=e.get(t))&&void 0!==i?i:0)===d&&s.startIndex<=c.endIndex&&c.startIndex<=s.endIndex})),m=v?1:p;switch(i){case"ltr":u=d+1,h=c.startIndex+1,f=p;break;case"rtl":u=a-d+1,h=c.startIndex+1,f=p;break;case"ttb":h=d+1,u=c.startIndex+1,g=m;break;case"btt":h=a-d+1,u=c.startIndex+1,g=m}r.set(l,{nodeId:l,level:d,index:c.startIndex,gridColumn:u,gridRow:h,gridRowSpan:f,gridColumnSpan:g})}return r}(t,s,o,e),a=Math.max(...Array.from(s.values())),l=Math.max(...Array.from(o.values()).map((t=>t.endIndex))),{gridTemplateColumns:d,gridTemplateRows:c}=function(t,e,n,i,s){const o=t+1,r=e+1;if("ltr"===n||"rtl"===n){const t=[];for(let e=0;e<o;e++)t.push("auto"),e<o-1&&t.push(i+"px");const e=[];for(let t=0;t<r;t++)e.push("auto"),t<r-1&&e.push(s+"px");return{gridTemplateColumns:t.join(" "),gridTemplateRows:e.join(" ")}}{const t=[];for(let e=0;e<o;e++)t.push("auto"),e<o-1&&t.push(i+"px");const e=[];for(let t=0;t<r;t++)e.push("auto"),t<r-1&&e.push(s+"px");return{gridTemplateColumns:e.join(" "),gridTemplateRows:t.join(" ")}}}(a,l,e,n,i);return{positions:r,gridTemplateColumns:d,gridTemplateRows:c,maxLevel:a,maxIndex:l}}(this.treeConfig,this.direction,this.levelSpacing,this.nodeSpacing):null}updateNodeRects(){var t;if(!this.treeConfig||!this.gridContainer)return void(null===(t=this.errors)||void 0===t||t.remove("WARN_overflow"));const e=this.gridContainer.getBoundingClientRect(),n=new Map;for(const t of this.treeConfig.allNodes){const i=this.element.querySelector(`[slot="${t}"]`);i&&n.set(t,M(i,e))}(function(t,e){if(t.size!==e.size)return!1;for(const[n,i]of t){const t=e.get(n);if(!t||t.left!==i.left||t.top!==i.top||t.width!==i.width||t.height!==i.height)return!1}return!0})(this.nodeRects,n)||(this.nodeRects=n),this.svgWidth=e.width,this.svgHeight=e.height,this.checkOverflow()}checkOverflow(){var t,e;const n="WARN_overflow",i=v(this.element),s=(null===(t=this.gridContainer)||void 0===t?void 0:t.scrollWidth)||0,o=(null===(e=this.gridContainer)||void 0===e?void 0:e.scrollHeight)||0,r=[];i.width>0&&s>i.width+1&&r.push(`width (${Math.round(s)}px > ${Math.round(i.width)}px)`);const a=m(this.element,o);a>1&&r.push(`height (${Math.round(o)}px > ${Math.round(o-a)}px)`),0!==r.length?this.errors.addOrReplace({id:n,type:"warning",message:`Tree exceeds available ${r.join(" and ")} and will be cut off. Reduce level-spacing, node-spacing or the node content, or enlarge the container.`}):this.errors.remove(n)}getSlotStyle(t){if(!this.layout)return{};const e=this.layout.positions.get(t);return e?"ltr"===this.direction||"rtl"===this.direction?{"grid-column":$(e.gridColumn)+"","grid-row":`${S(e.gridRow)} / span ${k(e.gridRowSpan)}`,"align-self":"center"}:{"grid-row":S(e.gridRow)+"","grid-column":`${$(e.gridColumn)} / span ${R(e.gridColumnSpan)}`,"justify-self":"center"}:{}}renderEdges(){var t;if(!this.treeConfig||0===this.nodeRects.size)return null;const e=this.getTreeStyle(),i=[],s=[],o=new Map;for(const t of this.treeConfig.edges){const e=o.get(t.to)||[];e.push(t.from),o.set(t.to,e)}const r=new Map;for(const[t,e]of this.treeConfig.adjacencyList.entries()){const n=this.nodeRects.get(t),i=e.map((t=>this.nodeRects.get(t))).filter((t=>void 0!==t)),s=n?j(n,i,this.direction):void 0;void 0!==s&&r.set(t,s)}for(const t of this.treeConfig.edges){const s=this.nodeRects.get(t.from),a=this.nodeRects.get(t.to);if(!s||!a)continue;const l=L(s,!0,this.direction),d=o.get(t.to)||[];let c;if(d.length>1){const e=d.indexOf(t.from);c=C(a,this.direction,e,d.length)}else c=L(a,!1,this.direction);const{path:u}=E(l,c,this.edgeStyle,this.direction,r.get(t.from)),h=N(e.edgeColor,e.edgeWidth,t.style);i.push(n("path",{key:`edge-${t.from}-${t.to}`,d:u,fill:"none",stroke:h.stroke,"stroke-width":h.strokeWidth,"stroke-dasharray":h.strokeDasharray}))}if("true"===this.showOperators)for(const[i,o]of this.treeConfig.adjacencyList.entries()){const a=r.get(i);if(void 0!==a)for(let r=0;r<o.length-1;r++){const l=o[r],d=o[r+1],c=x(this.treeConfig.edges,i,l);if(!(null==c?void 0:c.operator)||"none"===c.operator)continue;const u=this.nodeRects.get(l),h=this.nodeRects.get(d);if(!u||!h)continue;const f=null!==(t=c.label)&&void 0!==t?t:w(c.operator),g=A(a,u,h,this.direction);s.push(n("g",{key:`operator-${i}-${l}`,class:"operator-group"},n("circle",{cx:g.x,cy:g.y,r:e.operatorCircleRadius,fill:"white",stroke:e.edgeColor,"stroke-width":e.edgeWidth}),n("text",{x:g.x,y:g.y,"text-anchor":"middle","dominant-baseline":"central",style:{fontSize:e.operatorFontSize+"px",fill:e.operatorColor,fontWeight:"bold"}},f)))}}return n("svg",{class:"edge-layer",width:this.svgWidth,height:this.svgHeight,style:{position:"absolute",top:"0",left:"0",pointerEvents:"none"}},i,s)}renderSlots(){return this.treeConfig&&this.layout?Array.from(this.treeConfig.allNodes).map((t=>n("div",{key:t,class:"tree-node",style:this.getSlotStyle(t)},n("slot",{name:t})))):null}getFontStyles(){return this.componentStyle((t=>{var e,n,i,s;return{"--bn-font-family":(null===(e=t.global)||void 0===e?void 0:e.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":((null===(n=t.global)||void 0===n?void 0:n.fontSizePx)||13.3333)+"px","--bn-font-color":(null===(i=t.global)||void 0===i?void 0:i.fontColor)||"#000000","--bn-font-background":(null===(s=t.global)||void 0===s?void 0:s.fontBackgroundColor)||"#ffffff"}}))}render(){const t=this.getFontStyles();return n(i,{style:t},this.treeConfig&&this.layout?n("div",{class:"tree-container"},n("div",{class:"tree-grid",style:{display:"grid","grid-template-columns":this.layout.gridTemplateColumns,"grid-template-rows":this.layout.gridTemplateRows,position:"relative"}},this.renderEdges(),this.renderSlots())):n("div",{class:"tree-container tree-error"},n("slot",null)))}get element(){return this}static get watchers(){return{edges:[{validateEdgesProp:0}],direction:[{validateDirection:0}],levelSpacing:[{validateLevelSpacing:0}],nodeSpacing:[{validateNodeSpacing:0}],edgeStyle:[{validateEdgeStyle:0}],showOperators:[{validateShowOperators:0}]}}static get style(){return':host{display:inline-block;position:relative;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000)}.tree-container{position:relative;display:inline-block}.tree-grid{position:relative;display:grid;align-items:center}.tree-node{position:relative;z-index:1;border:1px solid #404040;background:var(--bn-font-background, white)}.edge-layer{position:absolute;top:0;left:0;z-index:0;pointer-events:none;overflow:visible}.tree-error{display:flex;flex-wrap:wrap;gap:20px}'}},[257,"bn-tree",{edges:[1],direction:[1],levelSpacing:[2,"level-spacing"],nodeSpacing:[2,"node-spacing"],edgeStyle:[1,"edge-style"],i18nNamespace:[513,"i18n-namespace"],showOperators:[1,"show-operators"],treeConfig:[32],layout:[32],nodeRects:[32],svgWidth:[32],svgHeight:[32],getLayoutState:[64]},void 0,{edges:[{validateEdgesProp:0}],direction:[{validateDirection:0}],levelSpacing:[{validateLevelSpacing:0}],nodeSpacing:[{validateNodeSpacing:0}],edgeStyle:[{validateEdgeStyle:0}],showOperators:[{validateShowOperators:0}]}]),T=O,I=function(){"undefined"!=typeof customElements&&["bn-tree"].forEach((t=>{"bn-tree"===t&&(customElements.get(s(t))||customElements.define(s(t),O))}))};export{T as BnTree,I as defineCustomElement}
1
+ import{p as t,H as e,h as n,a as i,t as s}from"./p-D6YGOYV1.js";import{n as o}from"./p-DYG9FH_u.js";import{LAYOUT_STATE_VERSION as r}from"./index.js";import{o as l,m as a}from"./p-B1nL0yOa.js";import{r as d,a as c}from"./p-CckAR27O.js";import{w as u}from"./p-DEHnizot.js";import{w as h}from"./p-DdGnuNtc.js";import{w as f}from"./p-jbp6YiHf.js";import{w as p}from"./p-CGI6XIaK.js";import{g,a as v}from"./p-DD1zlev_.js";import{o as y}from"./p-B6kka9sT.js";const m=["*","/","+","-","x","÷","none"];function b(t){switch(t){case"*":case"x":return"×";case"/":case"÷":return"÷";case"+":return"+";case"-":return"−";default:return""}}function x(t,e,n){return t.find((t=>t.from===e&&t.to===n))}function $(t){return 2*(t-1)+1}function w(t){return 2*(t-1)+1}function S(t){return t<=1?1:2*(t-1)+1}function k(t){return S(t)}function M(t,e){const n=t.getBoundingClientRect(),i=n.left-e.left,s=n.top-e.top;return{left:i,top:s,width:n.width,height:n.height,centerX:i+n.width/2,centerY:s+n.height/2}}function R(t,e,n){switch(n){case"ltr":return e?{x:t.left+t.width,y:t.centerY}:{x:t.left,y:t.centerY};case"rtl":return e?{x:t.left,y:t.centerY}:{x:t.left+t.width,y:t.centerY};case"ttb":return e?{x:t.centerX,y:t.top+t.height}:{x:t.centerX,y:t.top};case"btt":return e?{x:t.centerX,y:t.top}:{x:t.centerX,y:t.top+t.height}}}function A(t,e,n,i,s=8){const o=-(i-1)*s/2+n*s;switch(e){case"ltr":return{x:t.left,y:t.centerY+o};case"rtl":return{x:t.left+t.width,y:t.centerY+o};case"ttb":return{x:t.centerX+o,y:t.top};case"btt":return{x:t.centerX+o,y:t.top+t.height}}}function L(t,e,n,i,s){switch(n){case"straight":return function(t,e){return{path:`M ${t.x} ${t.y} L ${e.x} ${e.y}`,midpoint:{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}}(t,e);case"curved":return function(t,e,n){let i,s;if("ltr"===n||"rtl"===n){const n=(t.x+e.x)/2;i={x:n,y:t.y},s={x:n,y:e.y}}else{const n=(t.y+e.y)/2;i={x:t.x,y:n},s={x:e.x,y:n}}return{path:`M ${t.x} ${t.y} C ${i.x} ${i.y}, ${s.x} ${s.y}, ${e.x} ${e.y}`,midpoint:{x:.125*t.x+.375*i.x+.375*s.x+.125*e.x,y:.125*t.y+.375*i.y+.375*s.y+.125*e.y}}}(t,e,i);default:return function(t,e,n,i){let s,o;if("ltr"===n||"rtl"===n){const n=null!=i?i:t.x+.7*(e.x-t.x);s=`M ${t.x} ${t.y} L ${n} ${t.y} L ${n} ${e.y} L ${e.x} ${e.y}`,o={x:n,y:(t.y+e.y)/2}}else{const n=null!=i?i:t.y+.7*(e.y-t.y);s=`M ${t.x} ${t.y} L ${t.x} ${n} L ${e.x} ${n} L ${e.x} ${e.y}`,o={x:(t.x+e.x)/2,y:n}}return{path:s,midpoint:o}}(t,e,i,s)}}function j(t,e,n){let i,s,o;switch(n){case"ltr":i=t.left+t.width,s=e.map((t=>t.left)),o=1;break;case"rtl":i=t.left,s=e.map((t=>t.left+t.width)),o=-1;break;case"ttb":i=t.top+t.height,s=e.map((t=>t.top)),o=1;break;case"btt":i=t.top,s=e.map((t=>t.top+t.height)),o=-1}const r=s.map((t=>(t-i)*o)).filter((t=>t>=0));if(0!==r.length)return i+Math.min(...r)*o*.7}function C(t,e,n,i){return"ltr"===i||"rtl"===i?{x:t,y:(e.centerY+n.centerY)/2}:{x:(e.centerX+n.centerX)/2,y:t}}function N(t,e,n){var i,s;return Object.assign({stroke:null!==(i=null==n?void 0:n.color)&&void 0!==i?i:t,strokeWidth:null!==(s=null==n?void 0:n.width)&&void 0!==s?s:e},(null==n?void 0:n.dasharray)?{strokeDasharray:n.dasharray}:{})}const I=t(class extends e{validateEdgesProp(t){const e="ERR_edges",n=function(t){const e=[];if(!t||""===t.trim())return e.push("edges: value is required"),e;let n;try{n=JSON.parse(t)}catch(t){return e.push("edges: invalid JSON structure"),e}if(!Array.isArray(n))return e.push("edges: must be an array"),e;if(0===n.length)return e.push("edges: array must not be empty"),e;const i=new Set,s=new Set,o=new Map;n.forEach(((t,n)=>{if("object"!=typeof t||null===t)return void e.push(`edges[${n}]: must be an object`);const r=t;if("string"!=typeof r.from||""===r.from.trim()?e.push(`edges[${n}]: 'from' is required and must be a non-empty string`):i.add(r.from),"string"!=typeof r.to||""===r.to.trim()?e.push(`edges[${n}]: 'to' is required and must be a non-empty string`):(i.add(r.to),s.add(r.to),"string"==typeof r.from&&o.set(r.from,[...o.get(r.from)||[],r.to])),void 0!==r.operator&&("string"==typeof r.operator&&m.includes(r.operator)||e.push(`edges[${n}]: 'operator' must be one of: ${m.join(", ")}`)),void 0!==r.label&&"string"!=typeof r.label&&e.push(`edges[${n}]: 'label' must be a string`),void 0!==r.style)if("object"!=typeof r.style||null===r.style)e.push(`edges[${n}]: 'style' must be an object`);else{const t=r.style;void 0!==t.color&&"string"!=typeof t.color&&e.push(`edges[${n}]: 'style.color' must be a string`),void 0!==t.width&&"number"!=typeof t.width&&e.push(`edges[${n}]: 'style.width' must be a number`),void 0!==t.dasharray&&"string"!=typeof t.dasharray&&e.push(`edges[${n}]: 'style.dasharray' must be a string`)}}));const r=Array.from(i).filter((t=>!s.has(t)));return 0===r.length?e.push("edges: tree has no root node (circular reference detected)"):r.length>1?e.push("edges: tree has multiple root nodes: "+r.join(", ")):e.push(...function(t,e,n){const i=[],s=new Set,o=new Set,r=t=>{o.add(t),s.add(t);for(const n of e.get(t)||[])s.has(n)?i.push(`edges: circular reference, the edge from '${t}' to '${n}' leads back`):o.has(n)||r(n);s.delete(t)};r(t);const l=Array.from(n).filter((t=>!o.has(t)));return l.length>0&&i.push(`edges: nodes not connected to the root '${t}': ${l.join(", ")}`),i}(r[0],o,i)),e}(t);n.length>0?(this.errors.addOrReplace({id:e,type:"error",message:"edges: "+n.join("; ")}),this.treeConfig=null):(this.errors.remove(e),this.treeConfig=function(t){if(!t||""===t.trim())return null;try{const e=JSON.parse(t);if(!Array.isArray(e))return null;const n=e,i=function(t){const e=new Map;for(const n of t){const t=e.get(n.from)||[];t.push(n.to),e.set(n.from,t)}return e}(n),s=function(t){const e=new Set;for(const n of t)e.add(n.from),e.add(n.to);return e}(n),o=function(t,e){const n=new Set;for(const e of t)n.add(e.to);const i=Array.from(e).filter((t=>!n.has(t)));return 1===i.length?i[0]:null}(n,s);return{edges:n,adjacencyList:i,rootNode:o,allNodes:s}}catch(t){return console.error("parseTreeConfig: failed to parse tree configuration",t),null}}(t)),this.recalculateLayout()}validateDirection(t){const e="WARN_direction",n=["ltr","rtl","ttb","btt"];n.includes(t)?this.errors.remove(e):this.errors.addOrReplace({id:e,type:"warning",message:`direction: invalid value '${t}', must be one of: ${n.join(", ")}`}),this.recalculateLayout()}validateLevelSpacing(t){const e="WARN_levelSpacing";!o(t)||t<0?this.errors.addOrReplace({id:e,type:"warning",message:`level-spacing: invalid value '${t}', must be a non-negative number`}):this.errors.remove(e),this.recalculateLayout()}validateNodeSpacing(t){const e="WARN_nodeSpacing";!o(t)||t<0?this.errors.addOrReplace({id:e,type:"warning",message:`node-spacing: invalid value '${t}', must be a non-negative number`}):this.errors.remove(e),this.recalculateLayout()}validateEdgeStyle(t){const e="WARN_edgeStyle",n=["straight","orthogonal","curved"];n.includes(t)?this.errors.remove(e):this.errors.addOrReplace({id:e,type:"warning",message:`edge-style: invalid value '${t}', must be one of: ${n.join(", ")}`})}constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.treeConfig=null,this.layout=null,this.nodeRects=new Map,this.svgWidth=0,this.svgHeight=0,this.resizeObserver=null,this.gridContainer=null,this.observed=new Set,this.parentObserver=null,this.direction="ltr",this.levelSpacing=60,this.nodeSpacing=20,this.edgeStyle="orthogonal",this.showOperators=!0,h(this),u(this),this.errors=p(this),this.componentStyle=f(this)}async getLayoutState(t){var e,n,i,s,o,u,h,f,p,g,v;const y=null!==(e=null==t?void 0:t.detail)&&void 0!==e?e:"summary",m=l(this.element),b=this.componentStyle((t=>{var e;return(null===(e=t.global)||void 0===e?void 0:e.fontSizePx)||13.3333})),x={version:r,tag:this.element.localName,id:c(this.element),slot:null!==(n=this.element.getAttribute("slot"))&&void 0!==n?n:void 0,rect:a(this.element,m),em:{fontSizePx:b,appliedScaleFactor:1},regions:[],metadata:{nodeCount:null!==(s=null===(i=this.treeConfig)||void 0===i?void 0:i.allNodes.size)&&void 0!==s?s:0,edgeCount:null!==(u=null===(o=this.treeConfig)||void 0===o?void 0:o.edges.length)&&void 0!==u?u:0},diagnostics:d(this.element)},$=null===(h=this.element.shadowRoot)||void 0===h?void 0:h.querySelector(".tree-grid");if($&&x.regions.push({id:"grid",rect:a($,m)}),"full"!==y||!this.treeConfig)return x;const w=[];for(const t of this.treeConfig.allNodes){const e=this.element.querySelector(`[slot="${t}"]`);if(!e)continue;const n={kind:"node",nodeId:t,rect:a(e,m)};w.push(n)}const S=Array.from(null!==(p=null===(f=this.element.shadowRoot)||void 0===f?void 0:f.querySelectorAll("svg.edge-layer path"))&&void 0!==p?p:[]);let k=0;for(const t of this.treeConfig.edges){if(!this.nodeRects.get(t.from)||!this.nodeRects.get(t.to))continue;const e=S[k++];if(!e)break;const n={kind:"edge",from:t.from,to:t.to,operator:t.operator,path:null!==(g=e.getAttribute("d"))&&void 0!==g?g:void 0,rect:a(e,m)};w.push(n)}return null===(v=this.element.shadowRoot)||void 0===v||v.querySelectorAll("svg.edge-layer g.operator-group").forEach((t=>{var e,n;const i=null!==(n=null===(e=t.textContent)||void 0===e?void 0:e.trim())&&void 0!==n?n:"";if(!i)return;const s={kind:"label",role:"operator",text:i,rect:a(t,m)};w.push(s)})),x.elements=w,x}getTreeStyle(){return this.componentStyle((t=>({edgeColor:t["bn-tree"].edgeColor,edgeWidth:t["bn-tree"].edgeWidth,operatorCircleRadius:t["bn-tree"].operatorCircleRadius,operatorFontSize:t.global.fontSizePx*t["bn-tree"].operatorFontSizeScale,operatorColor:t["bn-tree"].operatorColor})))}componentWillLoad(){this.validateEdgesProp(this.edges),this.validateDirection(this.direction),this.validateLevelSpacing(this.levelSpacing),this.validateNodeSpacing(this.nodeSpacing),this.validateEdgeStyle(this.edgeStyle)}connectedCallback(){this.observeLayout(),this.updateNodeRects()}componentDidLoad(){var t;null===(t=this.element.shadowRoot)||void 0===t||t.addEventListener("slotchange",(()=>{this.observeLayout(),this.updateNodeRects()})),requestAnimationFrame((()=>{this.updateNodeRects()}))}componentDidRender(){this.observeLayout(),this.updateNodeRects()}disconnectedCallback(){var t;this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),this.observed.clear(),null===(t=this.parentObserver)||void 0===t||t.disconnect(),this.parentObserver=null}observeLayout(){var t,e,n;const i=null!==(e=null===(t=this.element.shadowRoot)||void 0===t?void 0:t.querySelector(".tree-grid"))&&void 0!==e?e:null;if(i!==this.gridContainer&&(null===(n=this.resizeObserver)||void 0===n||n.disconnect(),this.observed.clear(),this.gridContainer=i),i){this.resizeObserver||(this.resizeObserver=new ResizeObserver((()=>{this.updateNodeRects()}))),this.parentObserver||(this.parentObserver=y(this.element,(()=>this.checkOverflow())));for(const t of[i,...Array.from(this.element.querySelectorAll("[slot]"))])this.observed.has(t)||(this.resizeObserver.observe(t),this.observed.add(t))}}recalculateLayout(){this.layout=this.treeConfig?function(t,e,n,i){if(!t.rootNode)return{positions:new Map,gridTemplateColumns:"",gridTemplateRows:"",maxLevel:0,maxIndex:0};const s=function(t){const e=new Map;if(!t.rootNode)return e;const n=[{node:t.rootNode,level:0}],i=new Set;for(;n.length>0;){const{node:s,level:o}=n.shift();if(i.has(s))continue;i.add(s),e.set(s,o);const r=t.adjacencyList.get(s)||[];for(const t of r)i.has(t)||n.push({node:t,level:o+1})}return e}(t),o=function(t){const e=new Map;if(!t.rootNode)return e;let n=0;return function i(s){const o=e.get(s);if(o)return o;const r=t.adjacencyList.get(s)||[];if(e.set(s,{startIndex:n,endIndex:n}),0===r.length){const t={startIndex:n,endIndex:n};return e.set(s,t),n++,t}let l=1/0,a=-1/0;for(const t of r){const e=i(t);l=Math.min(l,e.startIndex),a=Math.max(a,e.endIndex)}const d={startIndex:l,endIndex:a};return e.set(s,d),d}(t.rootNode),e}(t),r=function(t,e,n,i){var s,o;const r=new Map,l=Math.max(...Array.from(e.values()));for(const a of t.allNodes){const d=null!==(s=e.get(a))&&void 0!==s?s:0,c=null!==(o=n.get(a))&&void 0!==o?o:{startIndex:0,endIndex:0};let u,h,f=1,p=1;const g=c.endIndex-c.startIndex+1,v=Array.from(t.allNodes).some((t=>{var i;const s=n.get(t);return t!==a&&void 0!==s&&(null!==(i=e.get(t))&&void 0!==i?i:0)===d&&s.startIndex<=c.endIndex&&c.startIndex<=s.endIndex})),y=v?1:g;switch(i){case"ltr":u=d+1,h=c.startIndex+1,f=g;break;case"rtl":u=l-d+1,h=c.startIndex+1,f=g;break;case"ttb":h=d+1,u=c.startIndex+1,p=y;break;case"btt":h=l-d+1,u=c.startIndex+1,p=y}r.set(a,{nodeId:a,level:d,index:c.startIndex,gridColumn:u,gridRow:h,gridRowSpan:f,gridColumnSpan:p})}return r}(t,s,o,e),l=Math.max(...Array.from(s.values())),a=Math.max(...Array.from(o.values()).map((t=>t.endIndex))),{gridTemplateColumns:d,gridTemplateRows:c}=function(t,e,n,i,s){const o=t+1,r=e+1;if("ltr"===n||"rtl"===n){const t=[];for(let e=0;e<o;e++)t.push("auto"),e<o-1&&t.push(i+"px");const e=[];for(let t=0;t<r;t++)e.push("auto"),t<r-1&&e.push(s+"px");return{gridTemplateColumns:t.join(" "),gridTemplateRows:e.join(" ")}}{const t=[];for(let e=0;e<o;e++)t.push("auto"),e<o-1&&t.push(i+"px");const e=[];for(let t=0;t<r;t++)e.push("auto"),t<r-1&&e.push(s+"px");return{gridTemplateColumns:e.join(" "),gridTemplateRows:t.join(" ")}}}(l,a,e,n,i);return{positions:r,gridTemplateColumns:d,gridTemplateRows:c,maxLevel:l,maxIndex:a}}(this.treeConfig,this.direction,this.levelSpacing,this.nodeSpacing):null}updateNodeRects(){var t;if(!this.treeConfig||!this.gridContainer)return void(null===(t=this.errors)||void 0===t||t.remove("WARN_overflow"));const e=this.gridContainer.getBoundingClientRect(),n=new Map;for(const t of this.treeConfig.allNodes){const i=this.element.querySelector(`[slot="${t}"]`);i&&n.set(t,M(i,e))}(function(t,e){if(t.size!==e.size)return!1;for(const[n,i]of t){const t=e.get(n);if(!t||t.left!==i.left||t.top!==i.top||t.width!==i.width||t.height!==i.height)return!1}return!0})(this.nodeRects,n)||(this.nodeRects=n),this.svgWidth=e.width,this.svgHeight=e.height,this.checkOverflow()}checkOverflow(){var t,e;const n="WARN_overflow",i=g(this.element),s=(null===(t=this.gridContainer)||void 0===t?void 0:t.scrollWidth)||0,o=(null===(e=this.gridContainer)||void 0===e?void 0:e.scrollHeight)||0,r=[];i.width>0&&s>i.width+1&&r.push(`width (${Math.round(s)}px > ${Math.round(i.width)}px)`);const l=v(this.element,o);l>1&&r.push(`height (${Math.round(o)}px > ${Math.round(o-l)}px)`),0!==r.length?this.errors.addOrReplace({id:n,type:"warning",message:`Tree exceeds available ${r.join(" and ")} and will be cut off. Reduce level-spacing, node-spacing or the node content, or enlarge the container.`}):this.errors.remove(n)}getSlotStyle(t){if(!this.layout)return{};const e=this.layout.positions.get(t);return e?"ltr"===this.direction||"rtl"===this.direction?{"grid-column":$(e.gridColumn)+"","grid-row":`${w(e.gridRow)} / span ${S(e.gridRowSpan)}`,"align-self":"center"}:{"grid-row":w(e.gridRow)+"","grid-column":`${$(e.gridColumn)} / span ${k(e.gridColumnSpan)}`,"justify-self":"center"}:{}}renderEdges(){var t;if(!this.treeConfig||0===this.nodeRects.size)return null;const e=this.getTreeStyle(),i=[],s=[],o=new Map;for(const t of this.treeConfig.edges){const e=o.get(t.to)||[];e.push(t.from),o.set(t.to,e)}const r=new Map;for(const[t,e]of this.treeConfig.adjacencyList.entries()){const n=this.nodeRects.get(t),i=e.map((t=>this.nodeRects.get(t))).filter((t=>void 0!==t)),s=n?j(n,i,this.direction):void 0;void 0!==s&&r.set(t,s)}for(const t of this.treeConfig.edges){const s=this.nodeRects.get(t.from),l=this.nodeRects.get(t.to);if(!s||!l)continue;const a=R(s,!0,this.direction),d=o.get(t.to)||[];let c;if(d.length>1){const e=d.indexOf(t.from);c=A(l,this.direction,e,d.length)}else c=R(l,!1,this.direction);const{path:u}=L(a,c,this.edgeStyle,this.direction,r.get(t.from)),h=N(e.edgeColor,e.edgeWidth,t.style);i.push(n("path",{key:`edge-${t.from}-${t.to}`,d:u,fill:"none",stroke:h.stroke,"stroke-width":h.strokeWidth,"stroke-dasharray":h.strokeDasharray}))}if(this.showOperators)for(const[i,o]of this.treeConfig.adjacencyList.entries()){const l=r.get(i);if(void 0!==l)for(let r=0;r<o.length-1;r++){const a=o[r],d=o[r+1],c=x(this.treeConfig.edges,i,a);if(!(null==c?void 0:c.operator)||"none"===c.operator)continue;const u=this.nodeRects.get(a),h=this.nodeRects.get(d);if(!u||!h)continue;const f=null!==(t=c.label)&&void 0!==t?t:b(c.operator),p=C(l,u,h,this.direction);s.push(n("g",{key:`operator-${i}-${a}`,class:"operator-group"},n("circle",{cx:p.x,cy:p.y,r:e.operatorCircleRadius,fill:"white",stroke:e.edgeColor,"stroke-width":e.edgeWidth}),n("text",{x:p.x,y:p.y,"text-anchor":"middle","dominant-baseline":"central",style:{fontSize:e.operatorFontSize+"px",fill:e.operatorColor,fontWeight:"bold"}},f)))}}return n("svg",{class:"edge-layer",width:this.svgWidth,height:this.svgHeight,style:{position:"absolute",top:"0",left:"0",pointerEvents:"none"}},i,s)}renderSlots(){return this.treeConfig&&this.layout?Array.from(this.treeConfig.allNodes).map((t=>n("div",{key:t,class:"tree-node",style:this.getSlotStyle(t)},n("slot",{name:t})))):null}getFontStyles(){return this.componentStyle((t=>{var e,n,i,s;return{"--bn-font-family":(null===(e=t.global)||void 0===e?void 0:e.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":((null===(n=t.global)||void 0===n?void 0:n.fontSizePx)||13.3333)+"px","--bn-font-color":(null===(i=t.global)||void 0===i?void 0:i.fontColor)||"#000000","--bn-font-background":(null===(s=t.global)||void 0===s?void 0:s.fontBackgroundColor)||"#ffffff"}}))}render(){const t=this.getFontStyles();return n(i,{style:t},this.treeConfig&&this.layout?n("div",{class:"tree-container"},n("div",{class:"tree-grid",style:{display:"grid","grid-template-columns":this.layout.gridTemplateColumns,"grid-template-rows":this.layout.gridTemplateRows,position:"relative"}},this.renderEdges(),this.renderSlots())):n("div",{class:"tree-container tree-error"},n("slot",null)))}get element(){return this}static get watchers(){return{edges:[{validateEdgesProp:0}],direction:[{validateDirection:0}],levelSpacing:[{validateLevelSpacing:0}],nodeSpacing:[{validateNodeSpacing:0}],edgeStyle:[{validateEdgeStyle:0}]}}static get style(){return':host{display:inline-block;position:relative;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000)}.tree-container{position:relative;display:inline-block}.tree-grid{position:relative;display:grid;align-items:center}.tree-node{position:relative;z-index:1;border:1px solid #404040;background:var(--bn-font-background, white)}.edge-layer{position:absolute;top:0;left:0;z-index:0;pointer-events:none;overflow:visible}.tree-error{display:flex;flex-wrap:wrap;gap:20px}'}},[257,"bn-tree",{selectedStyle:[513,"selected-style"],edges:[1],direction:[1],levelSpacing:[2,"level-spacing"],nodeSpacing:[2,"node-spacing"],edgeStyle:[1,"edge-style"],i18nNamespace:[513,"i18n-namespace"],showOperators:[4,"show-operators"],treeConfig:[32],layout:[32],nodeRects:[32],svgWidth:[32],svgHeight:[32],getLayoutState:[64]},void 0,{edges:[{validateEdgesProp:0}],direction:[{validateDirection:0}],levelSpacing:[{validateLevelSpacing:0}],nodeSpacing:[{validateNodeSpacing:0}],edgeStyle:[{validateEdgeStyle:0}]}]),T=I,E=function(){"undefined"!=typeof customElements&&["bn-tree"].forEach((t=>{"bn-tree"===t&&(customElements.get(s(t))||customElements.define(s(t),I))}))};export{T as BnTree,E as defineCustomElement}
@@ -1 +1 @@
1
- export{getAssetPath,render,setAssetPath,setNonce,setPlatformOptions}from"@stencil/core/internal/client";export{L as LAYOUT_STATE_VERSION}from"./types.js";
1
+ export{b as getAssetPath,r as render,s as setAssetPath,c as setNonce,d as setPlatformOptions}from"./p-D6YGOYV1.js";const t=1;export{t as LAYOUT_STATE_VERSION}
@@ -0,0 +1 @@
1
+ import{f as t}from"./p-BVKLCz2k.js";const n=t=>Math.round(100*t)/100;function o(t){return{x:n(t.left),y:n(t.top),width:n(t.width),height:n(t.height)}}function e(t,o){const e=n(t.width),i=n(t.height);return{context:{x:n(t.left-o.context.x),y:n(t.top-o.context.y),width:e,height:i},component:{x:n(t.left-o.component.x),y:n(t.top-o.component.y),width:e,height:i}}}function i(t,n){return e(t.getBoundingClientRect(),n)}function r(t){const n=getComputedStyle(t,"::before").content;if(!n||"none"===n||"normal"===n)return 0;const o=t.ownerDocument.createElement("canvas").getContext("2d");if(!o)return 0;const{fontStyle:e,fontWeight:i,fontSize:r,fontFamily:c}=getComputedStyle(t);return o.font=`${e} ${i} ${r} ${c}`,o.measureText(n.replace(/^"|"$/g,"")).width}function c(t,n){var o,i;const r=null===(i=null===(o=t.ownerDocument)||void 0===o?void 0:o.createRange)||void 0===i?void 0:i.call(o);if(!r)return;const c=t.getBoundingClientRect(),s=t.querySelector("svg text");let f;if(s)f=s.getBoundingClientRect();else{r.selectNodeContents(t);const n=t.querySelector(".prefix-second");n&&r.setStartAfter(n),f=r.getBoundingClientRect()}const u=Math.max(f.left,c.left),h=Math.max(f.top,c.top),a=Math.min(f.right,c.right)-u,d=Math.min(f.bottom,c.bottom)-h;return a>0&&d>0?e({left:u,top:h,width:a,height:d},n):void 0}function s(n){const o=n.getBoundingClientRect(),e=t(n),i=e?e.getBoundingClientRect():o;return{context:{x:i.left,y:i.top},component:{x:o.left,y:o.top}}}export{c as a,r as b,i as m,s as o,o as t}