@bino-bi/bn-template-engine 1.0.0-alpha.3 → 1.0.0-alpha.4

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 (195) hide show
  1. package/dist/bn-template-engine/bn-template-engine.esm.js +1 -1
  2. package/dist/bn-template-engine/p-1265d8d3.entry.js +1 -0
  3. package/dist/bn-template-engine/p-15516dac.entry.js +1 -0
  4. package/dist/bn-template-engine/p-1c716641.entry.js +1 -0
  5. package/dist/bn-template-engine/p-27cc8dc0.entry.js +1 -0
  6. package/dist/bn-template-engine/p-4426d484.entry.js +1 -0
  7. package/dist/bn-template-engine/p-51f8dc9e.entry.js +1 -0
  8. package/dist/bn-template-engine/p-53d4e690.entry.js +1 -0
  9. package/dist/bn-template-engine/p-5KQYRQLK.js +1 -0
  10. package/dist/bn-template-engine/p-745f4596.entry.js +1 -0
  11. package/dist/bn-template-engine/{p-0f1504f3.entry.js → p-75e97c87.entry.js} +1 -1
  12. package/dist/bn-template-engine/p-7a560278.entry.js +1 -0
  13. package/dist/bn-template-engine/p-7ea7c325.entry.js +1 -0
  14. package/dist/bn-template-engine/p-945cc95d.entry.js +1 -0
  15. package/dist/bn-template-engine/p-BYBpC0EO.js +1 -0
  16. package/dist/bn-template-engine/p-BfXY5dsy.js +1 -0
  17. package/dist/bn-template-engine/p-BgnHJQ9Q.js +1 -0
  18. package/dist/bn-template-engine/{p-B4ySv9KQ.js → p-Bhd_WSML.js} +1 -1
  19. package/dist/bn-template-engine/p-Bka-Z6jo.js +1 -0
  20. package/dist/bn-template-engine/p-Bnhh02CF.js +1 -0
  21. package/dist/bn-template-engine/p-C7dQL8CS.js +1 -0
  22. package/dist/bn-template-engine/p-CL1RYuNU.js +1 -0
  23. package/dist/bn-template-engine/p-CYwd_ZNM.js +1 -0
  24. package/dist/bn-template-engine/p-ChlK-T9I.js +1 -0
  25. package/dist/bn-template-engine/p-DHezf8pZ.js +1 -0
  26. package/dist/bn-template-engine/{p-DVMu6dEy.js → p-DlppAFq9.js} +1 -1
  27. package/dist/bn-template-engine/p-DvDDgmcV.js +1 -0
  28. package/dist/bn-template-engine/p-DvvwfRQG.js +1 -0
  29. package/dist/bn-template-engine/{p-DG-1MR_T.js → p-P7pGJBgc.js} +1 -1
  30. package/dist/bn-template-engine/p-b34eaf86.entry.js +1 -0
  31. package/dist/bn-template-engine/p-bdb8b44c.entry.js +1 -0
  32. package/dist/bn-template-engine/p-c44fcb8e.entry.js +1 -0
  33. package/dist/bn-template-engine/p-c7e1a49b.entry.js +1 -0
  34. package/dist/bn-template-engine/p-d9003041.entry.js +1 -0
  35. package/dist/bn-template-engine/p-daa7ffa3.entry.js +1 -0
  36. package/dist/bn-template-engine/p-e084f50a.entry.js +1 -0
  37. package/dist/bn-template-engine/p-eaba6658.entry.js +1 -0
  38. package/dist/bn-template-engine/{p-C0yAPzJz.js → p-u8igQLRZ.js} +1 -1
  39. package/dist/cjs/{DataFormatDigits-DAmZzqbD.js → DataFormatDigits-DKcOeLNK.js} +1 -1
  40. package/dist/cjs/{DateStringFactory-CcluhpGI.js → DateStringFactory-CSKvbS8K.js} +1 -1
  41. package/dist/cjs/{Order-BKoDS21t.js → Order-iG11HI4R.js} +8 -5
  42. package/dist/cjs/{SVGVariancesStyleGroup-DYYAU-81.js → SVGVariancesStyleGroup-K-Tw6lOD.js} +1 -14
  43. package/dist/cjs/bn-asset.cjs.entry.js +5 -4
  44. package/dist/cjs/bn-body_4.cjs.entry.js +15 -13
  45. package/dist/cjs/bn-card.cjs.entry.js +5 -4
  46. package/dist/cjs/{ibcs-chart-structure.cjs.entry.js → bn-chart-structure_5.cjs.entry.js} +1058 -28
  47. package/dist/cjs/bn-chart-time.cjs.entry.js +38 -12
  48. package/dist/cjs/bn-component-style.cjs.entry.js +5 -4
  49. package/dist/cjs/bn-dataset.cjs.entry.js +38 -9
  50. package/dist/cjs/bn-grid.cjs.entry.js +9 -7
  51. package/dist/cjs/bn-image.cjs.entry.js +9 -7
  52. package/dist/cjs/bn-internationalization.cjs.entry.js +5 -4
  53. package/dist/cjs/bn-layout-card.cjs.entry.js +3 -2
  54. package/dist/cjs/bn-layout-page.cjs.entry.js +2 -1
  55. package/dist/cjs/bn-message.cjs.entry.js +5 -4
  56. package/dist/cjs/bn-table.cjs.entry.js +979 -0
  57. package/dist/cjs/bn-template-engine.cjs.js +1 -1
  58. package/dist/cjs/bn-template.cjs.entry.js +3 -2
  59. package/dist/cjs/bn-text.cjs.entry.js +11 -9
  60. package/dist/cjs/bn-tree.cjs.entry.js +9 -7
  61. package/dist/cjs/contentDecoder-JxOldq1e.js +419 -0
  62. package/dist/cjs/{context-protocol-CRPmux5D.js → context-protocol-DRQWrwsA.js} +2 -0
  63. package/dist/cjs/editor-companion.cjs.entry.js +1 -1
  64. package/dist/cjs/emotion-hash.esm-nbbEQ0Dn.js +57 -0
  65. package/dist/cjs/ibcs-chart-time.cjs.entry.js +22 -18
  66. package/dist/cjs/{bn-context_5.cjs.entry.js → ibcs-table.cjs.entry.js} +122 -1293
  67. package/dist/cjs/{StringAdapter-Bneo8T4k.js → ibcsRuleSet-DgUoXOfd.js} +10 -10
  68. package/dist/cjs/index-Dm85hG6t.js +65 -0
  69. package/dist/cjs/loader.cjs.js +1 -1
  70. package/dist/cjs/{scaling-D8sIIKft.js → scaling-9Tz595RQ.js} +7 -7
  71. package/dist/cjs/{withHasError-B8gHkfV2.js → utils-CwHIVbbL.js} +1 -69
  72. package/dist/cjs/{withBodyObserver-C6gLgq_e.js → withBodyObserver-CKpSD8UT.js} +3 -3
  73. package/dist/cjs/{withComponentStatus-_x4LQZ0N.js → withComponentStatus-Bw70BhO0.js} +5 -5
  74. package/dist/cjs/{withComponentStyle-DMtic_9Y.js → withComponentStyle-aIbTCtfj.js} +5 -5
  75. package/dist/cjs/withHasError-D7ue5vAv.js +72 -0
  76. package/dist/cjs/{withStyled-CW30Bh6c.js → withStyled-CS1Yp4sv.js} +8 -61
  77. package/dist/cjs/{withTranslation-CWPAIRjh.js → withTranslation-rwgyITqe.js} +5 -5
  78. package/dist/collection/components/bn-chart-structure/bn-chart-structure.js +226 -99
  79. package/dist/collection/components/bn-chart-structure/ibcs-chart-structure.js +13 -3
  80. package/dist/collection/components/bn-chart-structure/utils/StructureChart.js +94 -11
  81. package/dist/collection/components/bn-chart-structure/utils/elements/StackedBar.js +3 -4
  82. package/dist/collection/components/bn-chart-structure/utils/model/styles/StructureChartStyle.js +4 -0
  83. package/dist/collection/components/bn-chart-time/bn-chart-time.js +28 -4
  84. package/dist/collection/components/bn-chart-time/utils/TimeChart.js +3 -3
  85. package/dist/collection/components/bn-chart-time/utils/elements/StackedColumn.js +3 -4
  86. package/dist/collection/components/bn-chart-time/utils/model/styles/TimeChartStyle.js +4 -0
  87. package/dist/collection/components/bn-dataset/bn-dataset.js +49 -2
  88. package/dist/collection/components/bn-datasource/bn-datasource.js +46 -3
  89. package/dist/collection/components/bn-table/bn-table.js +9 -12
  90. package/dist/collection/components/bn-table/utils/elements/CellBarChart.js +58 -41
  91. package/dist/collection/stores/componentStyles.js +2 -0
  92. package/dist/collection/utils/constants.js +8 -5
  93. package/dist/collection/utils/contentDecoder.js +28 -0
  94. package/dist/collection/utils/stackColors.js +2 -2
  95. package/dist/collection/utils/validate.js +1 -1
  96. package/dist/components/DataFormatDigits.js +1 -1
  97. package/dist/components/Order.js +1 -1
  98. package/dist/components/SVGVariancesStyleGroup.js +1 -1
  99. package/dist/components/bn-chart-structure.js +1 -1
  100. package/dist/components/bn-chart-time.js +1 -1
  101. package/dist/components/bn-dataset.js +1 -1
  102. package/dist/components/bn-datasource.js +1 -1
  103. package/dist/components/bn-table.js +1 -1
  104. package/dist/components/contentDecoder.js +1 -0
  105. package/dist/components/context-protocol.js +1 -1
  106. package/dist/components/emotion-hash.esm.js +1 -0
  107. package/dist/components/ibcs-chart-structure2.js +1 -1
  108. package/dist/components/ibcs-chart-time2.js +1 -1
  109. package/dist/components/ibcs-table2.js +1 -1
  110. package/dist/components/ibcs-title2.js +1 -1
  111. package/dist/components/ibcsRuleSet.js +1 -1
  112. package/dist/components/validate.js +1 -1
  113. package/dist/components/withStyled.js +1 -1
  114. package/dist/esm/{DataFormatDigits--qIbKvXa.js → DataFormatDigits-oSZ1hBKE.js} +1 -1
  115. package/dist/esm/{DateStringFactory-XWdUjsn8.js → DateStringFactory-CSGz6TDk.js} +1 -1
  116. package/dist/esm/{Order-sqjrku2z.js → Order-Bnhh02CF.js} +9 -6
  117. package/dist/esm/{SVGVariancesStyleGroup-ibg3sLjM.js → SVGVariancesStyleGroup-CqTjrZYg.js} +2 -13
  118. package/dist/esm/bn-asset.entry.js +5 -4
  119. package/dist/esm/bn-body_4.entry.js +11 -9
  120. package/dist/esm/bn-card.entry.js +5 -4
  121. package/dist/esm/{ibcs-chart-structure.entry.js → bn-chart-structure_5.entry.js} +1048 -22
  122. package/dist/esm/bn-chart-time.entry.js +38 -12
  123. package/dist/esm/bn-component-style.entry.js +5 -4
  124. package/dist/esm/bn-dataset.entry.js +35 -6
  125. package/dist/esm/bn-grid.entry.js +9 -7
  126. package/dist/esm/bn-image.entry.js +9 -7
  127. package/dist/esm/bn-internationalization.entry.js +5 -4
  128. package/dist/esm/bn-layout-card.entry.js +3 -2
  129. package/dist/esm/bn-layout-page.entry.js +2 -1
  130. package/dist/esm/bn-message.entry.js +5 -4
  131. package/dist/esm/bn-table.entry.js +977 -0
  132. package/dist/esm/bn-template-engine.js +1 -1
  133. package/dist/esm/bn-template.entry.js +3 -2
  134. package/dist/esm/bn-text.entry.js +11 -9
  135. package/dist/esm/bn-tree.entry.js +9 -7
  136. package/dist/esm/contentDecoder-oMmxz6nJ.js +416 -0
  137. package/dist/esm/{context-protocol-Bz5klD-F.js → context-protocol-BHnQsVsr.js} +2 -0
  138. package/dist/esm/editor-companion.entry.js +1 -1
  139. package/dist/esm/emotion-hash.esm-BYBpC0EO.js +55 -0
  140. package/dist/esm/ibcs-chart-time.entry.js +15 -11
  141. package/dist/esm/{bn-context_5.entry.js → ibcs-table.entry.js} +68 -1235
  142. package/dist/esm/{StringAdapter-BCLJpQQ8.js → ibcsRuleSet-K4ytuA1f.js} +10 -10
  143. package/dist/esm/index-DHezf8pZ.js +65 -0
  144. package/dist/esm/loader.js +1 -1
  145. package/dist/esm/{scaling-C6K8FYSF.js → scaling-Cehc74IE.js} +2 -2
  146. package/dist/esm/{withHasError-B3QX2emi.js → utils-DvvwfRQG.js} +1 -69
  147. package/dist/esm/{withBodyObserver-DczL5ia8.js → withBodyObserver-FQ8NwCIz.js} +1 -1
  148. package/dist/esm/{withComponentStatus-DodoSXe-.js → withComponentStatus-DWjDYtZ7.js} +1 -1
  149. package/dist/esm/{withComponentStyle-BerJY64r.js → withComponentStyle-9uP_hcDq.js} +2 -2
  150. package/dist/esm/withHasError-FyY5mQ_3.js +70 -0
  151. package/dist/esm/{withStyled-D1fAWJ3g.js → withStyled--qQWquTH.js} +6 -59
  152. package/dist/esm/{withTranslation-mimbJdER.js → withTranslation-BqD0Kp7b.js} +2 -2
  153. package/dist/types/components/bn-chart-structure/bn-chart-structure.d.ts +155 -109
  154. package/dist/types/components/bn-chart-structure/utils/StructureChart.d.ts +7 -0
  155. package/dist/types/components/bn-chart-structure/utils/model/styles/StructureChartStyle.d.ts +1 -0
  156. package/dist/types/components/bn-chart-time/utils/model/styles/TimeChartStyle.d.ts +1 -0
  157. package/dist/types/components/bn-dataset/bn-dataset.d.ts +6 -0
  158. package/dist/types/components/bn-datasource/bn-datasource.d.ts +8 -0
  159. package/dist/types/components/bn-table/bn-table.d.ts +3 -3
  160. package/dist/types/components/bn-table/utils/elements/CellBarChart.d.ts +0 -2
  161. package/dist/types/components.d.ts +100 -36
  162. package/dist/types/stores/componentStyles.d.ts +2 -0
  163. package/dist/types/utils/constants.d.ts +8 -5
  164. package/dist/types/utils/contentDecoder.d.ts +12 -0
  165. package/package.json +2 -1
  166. package/dist/bn-template-engine/p-05a82a77.entry.js +0 -1
  167. package/dist/bn-template-engine/p-1970906d.entry.js +0 -1
  168. package/dist/bn-template-engine/p-1dbd339c.entry.js +0 -1
  169. package/dist/bn-template-engine/p-2e68cf09.entry.js +0 -1
  170. package/dist/bn-template-engine/p-31cc6a2d.entry.js +0 -1
  171. package/dist/bn-template-engine/p-37881d05.entry.js +0 -1
  172. package/dist/bn-template-engine/p-3b894997.entry.js +0 -1
  173. package/dist/bn-template-engine/p-50e49732.entry.js +0 -1
  174. package/dist/bn-template-engine/p-6c7c0455.entry.js +0 -1
  175. package/dist/bn-template-engine/p-6da93eae.entry.js +0 -1
  176. package/dist/bn-template-engine/p-701e1578.entry.js +0 -1
  177. package/dist/bn-template-engine/p-8tsCnxIz.js +0 -1
  178. package/dist/bn-template-engine/p-997b2fe4.entry.js +0 -1
  179. package/dist/bn-template-engine/p-BL8gyUwE.js +0 -1
  180. package/dist/bn-template-engine/p-BSfqOkN_.js +0 -1
  181. package/dist/bn-template-engine/p-CRLgp9-v.js +0 -1
  182. package/dist/bn-template-engine/p-CYjZRKdI.js +0 -1
  183. package/dist/bn-template-engine/p-DRikHQE-.js +0 -1
  184. package/dist/bn-template-engine/p-DtdQCMzj.js +0 -1
  185. package/dist/bn-template-engine/p-a90f1cbe.entry.js +0 -1
  186. package/dist/bn-template-engine/p-b7bec050.entry.js +0 -1
  187. package/dist/bn-template-engine/p-d7f0cbaf.entry.js +0 -1
  188. package/dist/bn-template-engine/p-dfb61aa5.entry.js +0 -1
  189. package/dist/bn-template-engine/p-ece17f84.entry.js +0 -1
  190. package/dist/bn-template-engine/p-f27995c9.entry.js +0 -1
  191. package/dist/bn-template-engine/p-fd427179.entry.js +0 -1
  192. package/dist/bn-template-engine/p-sqjrku2z.js +0 -1
  193. package/dist/bn-template-engine/p-tzFCK9qn.js +0 -1
  194. package/dist/cjs/bn-chart-structure.cjs.entry.js +0 -700
  195. package/dist/esm/bn-chart-structure.entry.js +0 -698
@@ -1 +1 @@
1
- import{proxyCustomElement as e,HTMLElement as i,h as t,Host as a,transformTag as s}from"@stencil/core/internal/client";import{v as r,a as n,h as l,k as o,j as d,b as h,c,f as p,n as u,o as v,l as m,m as g,i as y}from"./validate.js";import{w as S,g as b,p as w}from"./scaling.js";import{w as f,a as O}from"./withHasError.js";import{w as x}from"./withTranslation.js";import{a as M}from"./context-protocol.js";import{w as R}from"./withStyled.js";import{w as L}from"./withComponentStyle.js";import{b as _,O as A,c as T,g as E,h as C,C as I}from"./Order.js";import{F as U}from"./ibcsRuleSet.js";import{D as k}from"./DateStringFactory.js";import{d as W}from"./ibcs-chart-time2.js";var D;!function(e){e.ROWGROUP="rowGroup",e.ROWGROUPINDEX="rowGroupIndex",e.CATEGORY="category",e.CATEGORYINDEX="categoryIndex",e.SUBCATEGORY="subCategory",e.SUBCATEGORYINDEX="subCategoryIndex"}(D||(D={}));const F=e(class extends i{validateScenario(e){const i=r(e),t="ERR_scenarios";i.length>0?this.errors.addOrReplace({id:t,type:"warning",message:"scenarios: invalid value(s) '"+JSON.stringify(i)+"' are not supported."}):this.errors.remove(t)}validateVariances(e){const i="ERR_variances",t=n(e);t.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"variances: invalid value(s) '"+JSON.stringify(t)+"' are not supported."}):this.errors.remove(i)}validateLeftSync(e){const i="ERR_syncSpaceLeft";l(e)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"syncSpaceLeft: invalid value(s) '"+e+"' are not supported."})}validateLimit(e){const i="ERR_limit";o(e)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"limit: invalid value '"+(null==e?void 0:""+e)+"' is not supported."})}validateUnitScaling(e){const i="ERR_unitScaling";l(e)||this.pixelPerUnitGroupMap.has(e)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"unitScaling: invalid value(s) '"+e+"' are not supported."})}validatePercentageScaling(e){const i="ERR_percentageScaling";l(e)||this.pixelPerUnitGroupMap.has(e)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"percentageScaling: invalid value(s) '"+e+"' are not supported."})}validateLevel(e){const i="ERR_level";d(e)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"level: invalid value(s) '"+e+"' are not supported."})}validateOrderList(e){const i="ERR_order",t=h(e);t.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"order: invalid value(s) '"+JSON.stringify(t)+"' are not supported."}):this.errors.remove(i)}validateOrderDirection(e){const i="ERR_orderDirection";c(e)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"orderDirection: invalid value '"+(null==e?void 0:""+e)+"' is not supported."})}validateDateInterval(e){const i="ERR_dateInterval";p(e)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"dateInterval: invalid value '"+(null==e?void 0:""+e)+"' is not supported."})}validateChartMode(e){const i="ERR_chartMode";["bar","line","auto"].includes(null==e?void 0:e.toLowerCase())?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"chartMode: invalid value '"+(null==e?void 0:""+e)+"' is not supported. Valid values are: bar, line, auto."})}validateMaxBars(e){const i="ERR_maxBars";!o(e)||e<1?this.errors.addOrReplace({id:i,type:"warning",message:"maxBars: invalid value '"+(null==e?void 0:""+e)+"' is not supported. Must be a positive integer."}):this.errors.remove(i)}validateStack(e){const i="ERR_stack",t=u(e);t.length>0?this.errors.addOrReplace({id:i,type:"warning",message:t.join("; ")}):this.errors.remove(i)}validateScaling(e){if(null==e||""===e||"none"===e||"auto"===e)return void this.errors.remove("ERR_scale");const i=Number(e);isNaN(i)||i<=0?this.errors.addOrReplace({id:"ERR_scale",type:"warning",message:`Invalid scale value: "${e}". Use "none", "auto", or a positive number.`}):this.errors.remove("ERR_scale")}validateAxisLabelsMode(e){const i="ERR_axisLabelsMode";v(e)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"axisLabelsMode: invalid value '"+(null==e?void 0:""+e)+"' is not supported."})}validateLineFullWidth(e){const i="ERR_lineFullWidth";m(e)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"lineFullWidth: invalid value(s) '"+(null==e?void 0:""+e)+"' are not supported."})}validateShowCategories(e){const i="ERR_showCategories";m(e)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"showCategories: invalid value(s) '"+(null==e?void 0:""+e)+"' are not supported."})}validateMeasureScale(e){const i="ERR_measureScale";g(e)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"measureScale: invalid value '"+(null==e?void 0:""+e)+"' is not supported."})}validateShowMeasureScale(e){const i="ERR_grouped";m(e)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"showMeasureScale: invalid value(s) '"+(null==e?void 0:""+e)+"' are not supported."})}validateShowOverlayAvg(e){const i="ERR_grouped";m(e)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"showOverlayAvg: invalid value(s) '"+(null==e?void 0:""+e)+"' are not supported."})}validateShowOverlayMedian(e){const i="ERR_grouped";m(e)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"showOverlayMedian: invalid value(s) '"+(null==e?void 0:""+e)+"' are not supported."})}constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.data=[],this.datasetMeta=null,this.appliedScaleFactor=1,this.chartTitle="",this.filter="",this.syncSpaceLeft=-1,this.limit=0,this.chartMode="bar",this.maxBars=28,this.stack="",this.intervalSpanLimit=28,this.lineFullWidth="true",this.showCategories="true",this.measureScale="greatest",this.showMeasureScale="false",this.showOverlayAvg="true",this.showOverlayMedian="false",this.measureUnit="",this.pixelPerUnitGroupMap=new Map,this._autoScaleGuard=!1,R(this),f(this),S(this,((e,i)=>{this.data=i||[]}),((e,i)=>{this.datasetMeta=i})),this.chartTemplate=this.chartTemplate.bind(this),this.errors=O(this),this.componentStyle=L(this),this.t=x(this).t}componentWillLoad(){this.validateScenario(this.scenarios),this.validateVariances(this.variances),this.validateUnitScaling(this.unitScaling),this.validateLimit(this.limit),this.validateLevel(this.level),this.validateOrderDirection(this.orderDirection),this.validateOrderList(this.order),this.validateLeftSync(this.syncSpaceLeft),this.validateDateInterval(this.dateInterval),this.validateAxisLabelsMode(this.axisLabelsMode),this.validateLineFullWidth(this.lineFullWidth),this.validateShowCategories(this.showCategories),this.validateMeasureScale(this.measureScale),this.validateShowMeasureScale(this.showMeasureScale),this.validateShowOverlayAvg(this.showOverlayAvg),this.validateShowOverlayMedian(this.showOverlayMedian),this.validateChartMode(this.chartMode),this.validateMaxBars(this.maxBars),this.validateStack(this.stack),this.validateScaling(this.scale)}componentDidRender(){var e,i;const{mode:t}=w(this.scale);if("auto"!==t&&"empty"!==t){this._autoScaleGuard=!1;const e=b(this.element),i="WARN_overflow";return void(e.width>0&&this.element.scrollWidth>e.width+1?this.errors.addOrReplace({id:i,type:"warning",message:"Chart exceeds available space and will be cut off. Check unit-scaling value."}):this.errors.remove(i))}if(this._autoScaleGuard)return void(this._autoScaleGuard=!1);const a=this.element,{width:s}=b(a);if(s<=0)return;const r=this.componentStyle((e=>{var i;return(null===(i=e.global)||void 0===i?void 0:i.fontSizePx)||13.3333}));a.style.setProperty("--bn-font-size",r+"px");const n=null===(e=a.shadowRoot)||void 0===e?void 0:e.querySelector(".container"),l=null!==(i=null==n?void 0:n.scrollWidth)&&void 0!==i?i:a.scrollWidth;if(l<=s+1)return this.errors.remove("AUTO_scale"),void(1!==this.appliedScaleFactor&&(this._autoScaleGuard=!0,this.appliedScaleFactor=1));const o=(s-1)/l;a.style.setProperty("--bn-font-size",r*o+"px"),"empty"===t?this.errors.addOrReplace({id:"AUTO_scale",type:"warning",message:"Auto-scaled chart by factor "+o.toFixed(3)}):this.errors.remove("AUTO_scale"),Math.abs(o-this.appliedScaleFactor)>.001&&(this._autoScaleGuard=!0,this.appliedScaleFactor=o)}prepareDimension(){const e=b(this.element),i=this.prepareScenarios(),t=this.prepareVariances();return this.canvasWidthSegmented=e.width/(i.length+t.length||1),{width:this.canvasWidthSegmented,height:e.height}}prepareScenarios(){var e,i,t,a;const s="auto"===(null===(e=this.scenarios)||void 0===e?void 0:e.trim().toLowerCase());return y(this.scenarios)||s?(null===(t=null===(i=this.datasetMeta)||void 0===i?void 0:i.availableScenarios)||void 0===t?void 0:t.length)>0?(s?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):[]:(this.errors.remove("AUTO_scenarios"),null===(a=this.scenarios)||void 0===a?void 0:a.split(",").map((e=>e.trim())))}prepareAvg(){return"true"===this.showOverlayAvg}prepareMedian(){return"true"===this.showOverlayMedian}prepareVariances(){var e;return y(this.variances)?[]:null===(e=this.variances)||void 0===e?void 0:e.split(",").map((e=>e.trim()))}prepareHideAxisLabels(e){return e>=1||"true"!==this.showCategories}prepareI18n(){const e=M,i=new Map([].map((e=>[e,this.t(".".concat(e))]))),t=new Map(e.map((e=>[e,this.t("global.".concat(e))])));return new Map([...t.entries(),...i.entries()])}preparePixelPerUnit(){var e;if(this.pixelPerUnitGroupMap.has(this.unitScaling))return this.errors.remove("AUTO_unitScaling"),this.pixelPerUnitGroupMap.get(this.unitScaling);if("auto"===(null===(e=this.unitScaling)||void 0===e?void 0:(""+e).trim().toLowerCase()))return this.errors.remove("AUTO_unitScaling"),0;const i=Number(this.unitScaling);return!isNaN(i)&&i>0?(this.errors.remove("AUTO_unitScaling"),i):(this.errors.addOrReplace({id:"AUTO_unitScaling",type:"warning",message:"unit-scaling: not set, auto-calculated to fit available space."}),0)}preparePixelPerPercentage(){return this.pixelPerUnitGroupMap.has(this.percentageScaling)?this.pixelPerUnitGroupMap.get(this.percentageScaling):100*Number(this.percentageScaling)}prepareLevel(){var e,i,t;const a="auto"===(null===(e=this.level)||void 0===e?void 0:e.trim().toLowerCase());return y(this.level)||a?(null===(i=this.datasetMeta)||void 0===i?void 0:i.suggestedLevel)?(a?this.errors.remove("AUTO_level"):this.errors.addOrReplace({id:"AUTO_level",type:"warning",message:"level: not set, auto-detected: "+this.datasetMeta.suggestedLevel}),D[this.datasetMeta.suggestedLevel.toUpperCase()]):void 0:(this.errors.remove("AUTO_level"),D[null===(t=this.level)||void 0===t?void 0:t.toUpperCase()])}prepareOrder(){var e,i,t,a,s,r;let n=(y(this.level)||"auto"===(null===(e=this.level)||void 0===e?void 0:e.trim().toLowerCase()))&&(null===(i=this.datasetMeta)||void 0===i?void 0:i.suggestedLevel)?this.datasetMeta.suggestedLevel:this.level;const l="auto"===(null===(t=this.order)||void 0===t?void 0:t.trim().toLowerCase());return y(this.order)||l?(null===(a=this.datasetMeta)||void 0===a?void 0:a.suggestedLevel)&&(l?this.errors.remove("AUTO_order"):this.errors.addOrReplace({id:"AUTO_order",type:"warning",message:"order: not set, auto-detected: "+n})):(this.errors.remove("AUTO_order"),"levelindex"===(null===(s=this.order)||void 0===s?void 0:s.toLocaleLowerCase())&&(n+="Index")),{hierarchy:[A[null==n?void 0:n.toUpperCase()]],direction:_[null===(r=this.orderDirection)||void 0===r?void 0:r.toUpperCase()]}}prepareStyle(){const e=this.getEffectiveScaleFactor();return this.componentStyle((i=>{const t=i.global.fontSizePx*e;return{scaleFactors:{scenarioOffset:i["bn-chart-time"].scaleFactors.scenarioOffset,scenarioLabelToColumn:i["bn-chart-time"].scaleFactors.scenarioLabelToColumn,labelToColumn:.3,labelToColum:i["bn-chart-time"].scaleFactors.labelToColum,labelToAxis:i["bn-chart-time"].scaleFactors.labelToAxis,needleWidth:i["bn-chart-time"].scaleFactors.needleWidth,needleHeadWidth:i["bn-chart-time"].scaleFactors.needleHeadWidth,columnWidth:i["bn-chart-time"].scaleFactors.columnWidth,varianceAxisLineWidth:i["bn-chart-time"].scaleFactors.varianceAxisLineWidth,axisLineWidth:i["bn-chart-time"].scaleFactors.axisLineWidth,auxiliaryLineWidth:i["bn-chart-time"].scaleFactors.auxiliaryLineWidth,scenarioLineWidth:i["bn-chart-time"].scaleFactors.scenarioLineWidth,markerWidth:i["bn-chart-time"].scaleFactors.markerWidth,markerOffset:i["bn-chart-time"].scaleFactors.markerOffset,categoryWidth:i["bn-chart-time"].scaleFactors.categoryWidth,axisTickLength:i["bn-chart-time"].scaleFactors.axisTickLength},fontStyles:{font:`${t}px ${i.global.fontFamily}`,size:t,color:i.global.fontColor,background:i.global.fontBackgroundColor,leading:1.8},axisStyles:i["bn-chart-time"].axisStyles,barStyles:i["bn-chart-time"].barStyles,varianceStyles:i["bn-chart-time"].varianceStyles,padding:i["bn-chart-time"].padding,pattern:null}}))}prepareLeftSideOffset(e,i){return this.syncSpaceLeft>-1?this.syncSpaceLeft:U.getMaxWidthOfArrayItems([...this.prepareVariances(),...this.prepareScenarios(),this.chartTitle],e,i)}prepareChartTitle(e){return e>=1?"":this.chartTitle}prepareLimit(){return Math.floor(Number(this.limit)||0)}prepareDateInterval(){var e,i,t;const a="auto"===(null===(e=this.dateInterval)||void 0===e?void 0:e.trim().toLowerCase());return y(this.dateInterval)||a?(null===(i=this.datasetMeta)||void 0===i?void 0:i.suggestedDateInterval)?(a?this.errors.remove("AUTO_dateInterval"):this.errors.addOrReplace({id:"AUTO_dateInterval",type:"warning",message:"dateInterval: not set, auto-detected: "+this.datasetMeta.suggestedDateInterval}),k[this.datasetMeta.suggestedDateInterval.toUpperCase()]):a?k.AUTO:void 0:(this.errors.remove("AUTO_dateInterval"),k[null===(t=this.dateInterval)||void 0===t?void 0:t.toUpperCase()])}prepareIntervalSpanLimit(){return this.intervalSpanLimit}prepareAxisLabelsMode(){var e;return T[null===(e=this.axisLabelsMode)||void 0===e?void 0:e.toUpperCase()]}prepareFilter(){return 0===this.filter.length?"":this.filter}getDataStructure(){return{ITimeChartDataRow:{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:""}}}}prepareMeasureScale(){return y(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"}prepareShowMeasureScale(e){return 0===e&&"true"===this.showMeasureScale}prepareMeasureUnit(){return""===this.measureUnit||null==this.measureUnit?"":this.measureUnit}prepareStackConfig(){if(y(this.stack))return null;try{const e=JSON.parse(this.stack);return{by:e.by,mode:e.mode||C.ABSOLUTE,order:e.order||E.DATASET}}catch(e){return null}}prepareLineFullWidth(){return"true"===this.lineFullWidth}prepareChartMode(){var e;const i=null===(e=this.chartMode)||void 0===e?void 0:e.toLowerCase();return"line"===i?I.LINE:"auto"===i?I.AUTO:I.BAR}prepareMaxBars(){return Math.floor(Number(this.maxBars)||28)}chartTemplate(e,i){const a=this.prepareI18n(),s=this.prepareStyle(),r=b(this.element).width,n=this.getEffectiveScaleFactor(),l=this.preparePixelPerUnit(),o=this.preparePixelPerPercentage();return t("ibcs-chart-time",{data:this.data,chartTitle:this.prepareChartTitle(i),scenarios:this.prepareScenarios(),variances:[e],hideAxisLabels:this.prepareHideAxisLabels(i),pixelPerUnit:l>0?l*n:0,pixelPerPercentage:o>0?o*n:0,limit:this.prepareLimit(),leftSideOffsetForHorizontalSync:this.prepareLeftSideOffset(a,s),styles:s,i18n:a,order:this.prepareOrder(),level:this.prepareLevel(),dateInterval:this.prepareDateInterval(),intervalSpanLimit:this.prepareIntervalSpanLimit(),axisLabelsMode:this.prepareAxisLabelsMode(),filter:this.prepareFilter(),"measure-scale":this.prepareMeasureScale(),"measure-unit":this.prepareMeasureUnit(),showOverlayAvg:this.prepareAvg(),showOverlayMedian:this.prepareMedian(),showMeasureScale:this.prepareShowMeasureScale(i),chartMode:this.prepareChartMode(),maxBars:this.prepareMaxBars(),stackConfig:this.prepareStackConfig(),lineFullWidth:this.prepareLineFullWidth(),containerWidth:r,parentDimensions:this.prepareDimension()})}getEffectiveScaleFactor(){const{mode:e,factor:i}=w(this.scale);return"factor"===e?i:"auto"===e||"empty"===e?this.appliedScaleFactor:1}getFontStyles(){const e=this.getEffectiveScaleFactor();return this.componentStyle((i=>{var t,a,s,r;const n=(null===(t=i.global)||void 0===t?void 0:t.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*e+"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(){let e=[""];const i=this.prepareVariances();i.length>0&&(e=[...e,...i]);const s=this.getFontStyles();return t(a,{key:"ed9bf10764443d9b4be0bf05dbbcd858d271993a",style:s},t("div",{key:"c2bda702b470a4ddba2da84d81908d96ce893c8e",class:"container"},e.map(this.chartTemplate)))}get element(){return this}static get watchers(){return{scenarios:[{validateScenario:0}],variances:[{validateVariances:0}],syncSpaceLeft:[{validateLeftSync:0}],limit:[{validateLimit:0}],unitScaling:[{validateUnitScaling:0}],percentageScaling:[{validatePercentageScaling:0}],level:[{validateLevel:0}],order:[{validateOrderList:0}],orderDirection:[{validateOrderDirection:0}],dateInterval:[{validateDateInterval:0}],chartMode:[{validateChartMode:0}],maxBars:[{validateMaxBars:0}],stack:[{validateStack:0}],scale:[{validateScaling:0}],axisLabelsMode:[{validateAxisLabelsMode:0}],lineFullWidth:[{validateLineFullWidth:0}],showCategories:[{validateShowCategories:0}],measureScale:[{validateMeasureScale:0}],showMeasureScale:[{validateShowMeasureScale:0}],showOverlayAvg:[{validateShowOverlayAvg:0}],showOverlayMedian:[{validateShowOverlayMedian:0}]}}static get style(){return":host{display:inline-block;position:relative;overflow:visible;}.container{display:flex;flex-direction:column-reverse}.background-image{display:flex;flex-wrap:wrap;justify-content:flex-end}"}},[1,"bn-chart-time",{chartTitle:[1,"chart-title"],filter:[1],scenarios:[1],variances:[1],syncSpaceLeft:[2,"sync-space-left"],limit:[2],unitScaling:[8,"unit-scaling"],percentageScaling:[8,"percentage-scaling"],level:[1],order:[1],orderDirection:[1,"order-direction"],dateInterval:[1,"date-interval"],chartMode:[1,"chart-mode"],maxBars:[2,"max-bars"],stack:[1],scale:[1],intervalSpanLimit:[2,"interval-span-limit"],axisLabelsMode:[1,"axis-labels-mode"],lineFullWidth:[1,"line-full-width"],showCategories:[1,"show-categories"],measureScale:[1,"measure-scale"],showMeasureScale:[1,"show-measure-scale"],showOverlayAvg:[1,"show-overlay-avg"],showOverlayMedian:[1,"show-overlay-median"],measureUnit:[1,"measure-unit"],data:[32],datasetMeta:[32],appliedScaleFactor:[32]},void 0,{scenarios:[{validateScenario:0}],variances:[{validateVariances:0}],syncSpaceLeft:[{validateLeftSync:0}],limit:[{validateLimit:0}],unitScaling:[{validateUnitScaling:0}],percentageScaling:[{validatePercentageScaling:0}],level:[{validateLevel:0}],order:[{validateOrderList:0}],orderDirection:[{validateOrderDirection:0}],dateInterval:[{validateDateInterval:0}],chartMode:[{validateChartMode:0}],maxBars:[{validateMaxBars:0}],stack:[{validateStack:0}],scale:[{validateScaling:0}],axisLabelsMode:[{validateAxisLabelsMode:0}],lineFullWidth:[{validateLineFullWidth:0}],showCategories:[{validateShowCategories:0}],measureScale:[{validateMeasureScale:0}],showMeasureScale:[{validateShowMeasureScale:0}],showOverlayAvg:[{validateShowOverlayAvg:0}],showOverlayMedian:[{validateShowOverlayMedian:0}]}]),N=F,j=function(){"undefined"!=typeof customElements&&["bn-chart-time","ibcs-chart-time"].forEach((e=>{switch(e){case"bn-chart-time":customElements.get(s(e))||customElements.define(s(e),F);break;case"ibcs-chart-time":customElements.get(s(e))||W()}}))};export{N as BnChartTime,j as defineCustomElement}
1
+ import{proxyCustomElement as e,HTMLElement as i,h as t,Host as s,transformTag as a}from"@stencil/core/internal/client";import{v as r,a as n,h as l,k as o,j as d,b as h,c,f as p,n as u,o as v,l as m,m as g,i as y}from"./validate.js";import{w as S,g as w,p as f}from"./scaling.js";import{w as b,a as O}from"./withHasError.js";import{w as x}from"./withTranslation.js";import{a as M}from"./context-protocol.js";import{w as R}from"./withStyled.js";import{w as _}from"./withComponentStyle.js";import{b as L,O as A,c as T,g as E,h as C,i as k,C as I}from"./Order.js";import{F as U}from"./ibcsRuleSet.js";import{D as W}from"./DateStringFactory.js";import{d as D}from"./ibcs-chart-time2.js";var N;!function(e){e.ROWGROUP="rowGroup",e.ROWGROUPINDEX="rowGroupIndex",e.CATEGORY="category",e.CATEGORYINDEX="categoryIndex",e.SUBCATEGORY="subCategory",e.SUBCATEGORYINDEX="subCategoryIndex"}(N||(N={}));const F=e(class extends i{validateScenario(e){const i=r(e),t="ERR_scenarios";i.length>0?this.errors.addOrReplace({id:t,type:"warning",message:"scenarios: invalid value(s) '"+JSON.stringify(i)+"' are not supported."}):this.errors.remove(t)}validateVariances(e){const i="ERR_variances",t=n(e);t.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"variances: invalid value(s) '"+JSON.stringify(t)+"' are not supported."}):this.errors.remove(i)}validateLeftSync(e){const i="ERR_syncSpaceLeft";l(e)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"syncSpaceLeft: invalid value(s) '"+e+"' are not supported."})}validateLimit(e){const i="ERR_limit";o(e)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"limit: invalid value '"+(null==e?void 0:""+e)+"' is not supported."})}validateUnitScaling(e){const i="ERR_unitScaling";l(e)||this.pixelPerUnitGroupMap.has(e)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"unitScaling: invalid value(s) '"+e+"' are not supported."})}validatePercentageScaling(e){const i="ERR_percentageScaling";l(e)||this.pixelPerUnitGroupMap.has(e)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"percentageScaling: invalid value(s) '"+e+"' are not supported."})}validateLevel(e){const i="ERR_level";d(e)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"level: invalid value(s) '"+e+"' are not supported."})}validateOrderList(e){const i="ERR_order",t=h(e);t.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"order: invalid value(s) '"+JSON.stringify(t)+"' are not supported."}):this.errors.remove(i)}validateOrderDirection(e){const i="ERR_orderDirection";c(e)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"orderDirection: invalid value '"+(null==e?void 0:""+e)+"' is not supported."})}validateDateInterval(e){const i="ERR_dateInterval";p(e)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"dateInterval: invalid value '"+(null==e?void 0:""+e)+"' is not supported."})}validateChartMode(e){const i="ERR_chartMode";["bar","line","auto"].includes(null==e?void 0:e.toLowerCase())?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"chartMode: invalid value '"+(null==e?void 0:""+e)+"' is not supported. Valid values are: bar, line, auto."})}validateMaxBars(e){const i="ERR_maxBars";!o(e)||e<1?this.errors.addOrReplace({id:i,type:"warning",message:"maxBars: invalid value '"+(null==e?void 0:""+e)+"' is not supported. Must be a positive integer."}):this.errors.remove(i)}validateStack(e){const i="ERR_stack",t=u(e);t.length>0?this.errors.addOrReplace({id:i,type:"warning",message:t.join("; ")}):this.errors.remove(i)}validateScaling(e){if(null==e||""===e||"none"===e||"auto"===e)return void this.errors.remove("ERR_scale");const i=Number(e);isNaN(i)||i<=0?this.errors.addOrReplace({id:"ERR_scale",type:"warning",message:`Invalid scale value: "${e}". Use "none", "auto", or a positive number.`}):this.errors.remove("ERR_scale")}validateAxisLabelsMode(e){const i="ERR_axisLabelsMode";v(e)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"axisLabelsMode: invalid value '"+(null==e?void 0:""+e)+"' is not supported."})}validateLineFullWidth(e){const i="ERR_lineFullWidth";m(e)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"lineFullWidth: invalid value(s) '"+(null==e?void 0:""+e)+"' are not supported."})}validateShowCategories(e){const i="ERR_showCategories";m(e)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"showCategories: invalid value(s) '"+(null==e?void 0:""+e)+"' are not supported."})}validateMeasureScale(e){const i="ERR_measureScale";g(e)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"measureScale: invalid value '"+(null==e?void 0:""+e)+"' is not supported."})}validateShowMeasureScale(e){const i="ERR_grouped";m(e)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"showMeasureScale: invalid value(s) '"+(null==e?void 0:""+e)+"' are not supported."})}validateShowOverlayAvg(e){const i="ERR_grouped";m(e)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"showOverlayAvg: invalid value(s) '"+(null==e?void 0:""+e)+"' are not supported."})}validateShowOverlayMedian(e){const i="ERR_grouped";m(e)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"showOverlayMedian: invalid value(s) '"+(null==e?void 0:""+e)+"' are not supported."})}constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.data=[],this.datasetMeta=null,this.appliedScaleFactor=1,this.chartTitle="",this.filter="",this.syncSpaceLeft=-1,this.limit=0,this.chartMode="bar",this.maxBars=28,this.stack="",this.intervalSpanLimit=28,this.lineFullWidth="true",this.showCategories="true",this.measureScale="greatest",this.showMeasureScale="false",this.showOverlayAvg="true",this.showOverlayMedian="false",this.measureUnit="",this.pixelPerUnitGroupMap=new Map,this._autoScaleGuard=!1,R(this),b(this),S(this,((e,i)=>{this.data=i||[]}),((e,i)=>{this.datasetMeta=i})),this.chartTemplate=this.chartTemplate.bind(this),this.errors=O(this),this.componentStyle=_(this),this.t=x(this).t}componentWillLoad(){this.validateScenario(this.scenarios),this.validateVariances(this.variances),this.validateUnitScaling(this.unitScaling),this.validateLimit(this.limit),this.validateLevel(this.level),this.validateOrderDirection(this.orderDirection),this.validateOrderList(this.order),this.validateLeftSync(this.syncSpaceLeft),this.validateDateInterval(this.dateInterval),this.validateAxisLabelsMode(this.axisLabelsMode),this.validateLineFullWidth(this.lineFullWidth),this.validateShowCategories(this.showCategories),this.validateMeasureScale(this.measureScale),this.validateShowMeasureScale(this.showMeasureScale),this.validateShowOverlayAvg(this.showOverlayAvg),this.validateShowOverlayMedian(this.showOverlayMedian),this.validateChartMode(this.chartMode),this.validateMaxBars(this.maxBars),this.validateStack(this.stack),this.validateScaling(this.scale)}componentDidRender(){var e,i;const{mode:t}=f(this.scale);if("auto"!==t&&"empty"!==t){this._autoScaleGuard=!1;const e=w(this.element),i="WARN_overflow";return void(e.width>0&&this.element.scrollWidth>e.width+1?this.errors.addOrReplace({id:i,type:"warning",message:"Chart exceeds available space and will be cut off. Check unit-scaling value."}):this.errors.remove(i))}if(this._autoScaleGuard)return void(this._autoScaleGuard=!1);const s=this.element,{width:a}=w(s);if(a<=0)return;const r=this.componentStyle((e=>{var i;return(null===(i=e.global)||void 0===i?void 0:i.fontSizePx)||13.3333}));s.style.setProperty("--bn-font-size",r+"px");const n=null===(e=s.shadowRoot)||void 0===e?void 0:e.querySelector(".container"),l=null!==(i=null==n?void 0:n.scrollWidth)&&void 0!==i?i:s.scrollWidth;if(l<=a+1)return this.errors.remove("AUTO_scale"),void(1!==this.appliedScaleFactor&&(this._autoScaleGuard=!0,this.appliedScaleFactor=1));const o=(a-1)/l;s.style.setProperty("--bn-font-size",r*o+"px"),"empty"===t?this.errors.addOrReplace({id:"AUTO_scale",type:"warning",message:"Auto-scaled chart by factor "+o.toFixed(3)}):this.errors.remove("AUTO_scale"),Math.abs(o-this.appliedScaleFactor)>.001&&(this._autoScaleGuard=!0,this.appliedScaleFactor=o)}prepareDimension(){const e=w(this.element),i=this.prepareScenarios(),t=this.prepareVariances();return this.canvasWidthSegmented=e.width/(i.length+t.length||1),{width:this.canvasWidthSegmented,height:e.height}}prepareScenarios(){var e,i,t,s;const a="auto"===(null===(e=this.scenarios)||void 0===e?void 0:e.trim().toLowerCase());return y(this.scenarios)||a?(null===(t=null===(i=this.datasetMeta)||void 0===i?void 0:i.availableScenarios)||void 0===t?void 0:t.length)>0?(a?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):[]:(this.errors.remove("AUTO_scenarios"),null===(s=this.scenarios)||void 0===s?void 0:s.split(",").map((e=>e.trim())))}prepareAvg(){return"true"===this.showOverlayAvg}prepareMedian(){return"true"===this.showOverlayMedian}prepareVariances(){var e;return y(this.variances)?[]:null===(e=this.variances)||void 0===e?void 0:e.split(",").map((e=>e.trim()))}prepareHideAxisLabels(e){return e>=1||"true"!==this.showCategories}prepareI18n(){const e=M,i=new Map([].map((e=>[e,this.t(".".concat(e))]))),t=new Map(e.map((e=>[e,this.t("global.".concat(e))])));return new Map([...t.entries(),...i.entries()])}preparePixelPerUnit(){var e;if(this.pixelPerUnitGroupMap.has(this.unitScaling))return this.errors.remove("AUTO_unitScaling"),this.pixelPerUnitGroupMap.get(this.unitScaling);if("auto"===(null===(e=this.unitScaling)||void 0===e?void 0:(""+e).trim().toLowerCase()))return this.errors.remove("AUTO_unitScaling"),0;const i=Number(this.unitScaling);return!isNaN(i)&&i>0?(this.errors.remove("AUTO_unitScaling"),i):(this.errors.addOrReplace({id:"AUTO_unitScaling",type:"warning",message:"unit-scaling: not set, auto-calculated to fit available space."}),0)}preparePixelPerPercentage(){return this.pixelPerUnitGroupMap.has(this.percentageScaling)?this.pixelPerUnitGroupMap.get(this.percentageScaling):100*Number(this.percentageScaling)}prepareLevel(){var e,i,t;const s="auto"===(null===(e=this.level)||void 0===e?void 0:e.trim().toLowerCase());return y(this.level)||s?(null===(i=this.datasetMeta)||void 0===i?void 0:i.suggestedLevel)?(s?this.errors.remove("AUTO_level"):this.errors.addOrReplace({id:"AUTO_level",type:"warning",message:"level: not set, auto-detected: "+this.datasetMeta.suggestedLevel}),N[this.datasetMeta.suggestedLevel.toUpperCase()]):void 0:(this.errors.remove("AUTO_level"),N[null===(t=this.level)||void 0===t?void 0:t.toUpperCase()])}prepareOrder(){var e,i,t,s,a,r;let n=(y(this.level)||"auto"===(null===(e=this.level)||void 0===e?void 0:e.trim().toLowerCase()))&&(null===(i=this.datasetMeta)||void 0===i?void 0:i.suggestedLevel)?this.datasetMeta.suggestedLevel:this.level;const l="auto"===(null===(t=this.order)||void 0===t?void 0:t.trim().toLowerCase());return y(this.order)||l?(null===(s=this.datasetMeta)||void 0===s?void 0:s.suggestedLevel)&&(l?this.errors.remove("AUTO_order"):this.errors.addOrReplace({id:"AUTO_order",type:"warning",message:"order: not set, auto-detected: "+n})):(this.errors.remove("AUTO_order"),"levelindex"===(null===(a=this.order)||void 0===a?void 0:a.toLocaleLowerCase())&&(n+="Index")),{hierarchy:[A[null==n?void 0:n.toUpperCase()]],direction:L[null===(r=this.orderDirection)||void 0===r?void 0:r.toUpperCase()]}}prepareStyle(){const e=this.getEffectiveScaleFactor();return this.componentStyle((i=>{const t=i.global.fontSizePx*e;return{scaleFactors:{scenarioOffset:i["bn-chart-time"].scaleFactors.scenarioOffset,scenarioLabelToColumn:i["bn-chart-time"].scaleFactors.scenarioLabelToColumn,labelToColumn:.3,labelToColum:i["bn-chart-time"].scaleFactors.labelToColum,labelToAxis:i["bn-chart-time"].scaleFactors.labelToAxis,needleWidth:i["bn-chart-time"].scaleFactors.needleWidth,needleHeadWidth:i["bn-chart-time"].scaleFactors.needleHeadWidth,columnWidth:i["bn-chart-time"].scaleFactors.columnWidth,varianceAxisLineWidth:i["bn-chart-time"].scaleFactors.varianceAxisLineWidth,axisLineWidth:i["bn-chart-time"].scaleFactors.axisLineWidth,auxiliaryLineWidth:i["bn-chart-time"].scaleFactors.auxiliaryLineWidth,scenarioLineWidth:i["bn-chart-time"].scaleFactors.scenarioLineWidth,markerWidth:i["bn-chart-time"].scaleFactors.markerWidth,markerOffset:i["bn-chart-time"].scaleFactors.markerOffset,categoryWidth:i["bn-chart-time"].scaleFactors.categoryWidth,axisTickLength:i["bn-chart-time"].scaleFactors.axisTickLength},fontStyles:{font:`${t}px ${i.global.fontFamily}`,size:t,color:i.global.fontColor,background:i.global.fontBackgroundColor,leading:1.8},axisStyles:i["bn-chart-time"].axisStyles,barStyles:i["bn-chart-time"].barStyles,varianceStyles:i["bn-chart-time"].varianceStyles,stackColors:i["bn-chart-time"].stackColors,padding:i["bn-chart-time"].padding,pattern:null}}))}prepareLeftSideOffset(e,i){return this.syncSpaceLeft>-1?this.syncSpaceLeft:U.getMaxWidthOfArrayItems([...this.prepareVariances(),...this.prepareScenarios(),this.chartTitle],e,i)}prepareChartTitle(e){return e>=1?"":this.chartTitle}prepareLimit(){return Math.floor(Number(this.limit)||0)}prepareDateInterval(){var e,i,t;const s="auto"===(null===(e=this.dateInterval)||void 0===e?void 0:e.trim().toLowerCase());return y(this.dateInterval)||s?(null===(i=this.datasetMeta)||void 0===i?void 0:i.suggestedDateInterval)?(s?this.errors.remove("AUTO_dateInterval"):this.errors.addOrReplace({id:"AUTO_dateInterval",type:"warning",message:"dateInterval: not set, auto-detected: "+this.datasetMeta.suggestedDateInterval}),W[this.datasetMeta.suggestedDateInterval.toUpperCase()]):s?W.AUTO:void 0:(this.errors.remove("AUTO_dateInterval"),W[null===(t=this.dateInterval)||void 0===t?void 0:t.toUpperCase()])}prepareIntervalSpanLimit(){return this.intervalSpanLimit}prepareAxisLabelsMode(){var e;return T[null===(e=this.axisLabelsMode)||void 0===e?void 0:e.toUpperCase()]}prepareFilter(){return 0===this.filter.length?"":this.filter}getDataStructure(){return{ITimeChartDataRow:{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:""}}}}prepareMeasureScale(){return y(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"}prepareShowMeasureScale(e){return 0===e&&"true"===this.showMeasureScale}prepareMeasureUnit(){return""===this.measureUnit||null==this.measureUnit?"":this.measureUnit}prepareStackConfig(){if(y(this.stack))return this.errors.remove("WARN_stack_dimensions_scenarios"),null;try{const e=JSON.parse(this.stack),i=e.by,t="WARN_stack_dimensions_scenarios";if(i===E.DIMENSIONS){const e=this.prepareScenarios();e.length>1?this.errors.addOrReplace({id:t,type:"warning",message:`stack by dimensions: only the first scenario "${e[0]}" is used, the rest (${e.slice(1).join(", ")}) are discarded.`}):this.errors.remove(t)}else this.errors.remove(t);return{by:i,mode:e.mode||k.ABSOLUTE,order:e.order||C.DATASET}}catch(e){return this.errors.remove("WARN_stack_dimensions_scenarios"),null}}prepareLineFullWidth(){return"true"===this.lineFullWidth}prepareChartMode(){var e;const i=null===(e=this.chartMode)||void 0===e?void 0:e.toLowerCase();return"line"===i?I.LINE:"auto"===i?I.AUTO:I.BAR}prepareMaxBars(){return Math.floor(Number(this.maxBars)||28)}chartTemplate(e,i){const s=this.prepareI18n(),a=this.prepareStyle(),r=w(this.element).width,n=this.getEffectiveScaleFactor(),l=this.preparePixelPerUnit(),o=this.preparePixelPerPercentage(),d=this.prepareStackConfig(),h=this.prepareScenarios(),c=(null==d?void 0:d.by)===E.DIMENSIONS?h.slice(0,1):h;return t("ibcs-chart-time",{data:this.data,chartTitle:this.prepareChartTitle(i),scenarios:c,variances:[e],hideAxisLabels:this.prepareHideAxisLabels(i),pixelPerUnit:l>0?l*n:0,pixelPerPercentage:o>0?o*n:0,limit:this.prepareLimit(),leftSideOffsetForHorizontalSync:this.prepareLeftSideOffset(s,a),styles:a,i18n:s,order:this.prepareOrder(),level:this.prepareLevel(),dateInterval:this.prepareDateInterval(),intervalSpanLimit:this.prepareIntervalSpanLimit(),axisLabelsMode:this.prepareAxisLabelsMode(),filter:this.prepareFilter(),"measure-scale":this.prepareMeasureScale(),"measure-unit":this.prepareMeasureUnit(),showOverlayAvg:this.prepareAvg(),showOverlayMedian:this.prepareMedian(),showMeasureScale:this.prepareShowMeasureScale(i),chartMode:this.prepareChartMode(),maxBars:this.prepareMaxBars(),stackConfig:d,lineFullWidth:this.prepareLineFullWidth(),containerWidth:r,parentDimensions:this.prepareDimension()})}getEffectiveScaleFactor(){const{mode:e,factor:i}=f(this.scale);return"factor"===e?i:"auto"===e||"empty"===e?this.appliedScaleFactor:1}getFontStyles(){const e=this.getEffectiveScaleFactor();return this.componentStyle((i=>{var t,s,a,r;const n=(null===(t=i.global)||void 0===t?void 0:t.fontSizePx)||13.3333;return{"--bn-font-family":(null===(s=i.global)||void 0===s?void 0:s.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":n*e+"px","--bn-font-color":(null===(a=i.global)||void 0===a?void 0:a.fontColor)||"#000000","--bn-font-background":(null===(r=i.global)||void 0===r?void 0:r.fontBackgroundColor)||"#ffffff"}}))}render(){let e=[""];const i=this.prepareVariances();i.length>0&&(e=[...e,...i]);const a=this.getFontStyles();return t(s,{key:"ecbf96e2d037a7dad9b3380bcc28b6e010ac867c",style:a},t("div",{key:"c556b86aac629e59c601986650d1a4857a2ee068",class:"container"},e.map(this.chartTemplate)))}get element(){return this}static get watchers(){return{scenarios:[{validateScenario:0}],variances:[{validateVariances:0}],syncSpaceLeft:[{validateLeftSync:0}],limit:[{validateLimit:0}],unitScaling:[{validateUnitScaling:0}],percentageScaling:[{validatePercentageScaling:0}],level:[{validateLevel:0}],order:[{validateOrderList:0}],orderDirection:[{validateOrderDirection:0}],dateInterval:[{validateDateInterval:0}],chartMode:[{validateChartMode:0}],maxBars:[{validateMaxBars:0}],stack:[{validateStack:0}],scale:[{validateScaling:0}],axisLabelsMode:[{validateAxisLabelsMode:0}],lineFullWidth:[{validateLineFullWidth:0}],showCategories:[{validateShowCategories:0}],measureScale:[{validateMeasureScale:0}],showMeasureScale:[{validateShowMeasureScale:0}],showOverlayAvg:[{validateShowOverlayAvg:0}],showOverlayMedian:[{validateShowOverlayMedian:0}]}}static get style(){return":host{display:inline-block;position:relative;overflow:visible;}.container{display:flex;flex-direction:column-reverse}.background-image{display:flex;flex-wrap:wrap;justify-content:flex-end}"}},[1,"bn-chart-time",{chartTitle:[1,"chart-title"],filter:[1],scenarios:[1],variances:[1],syncSpaceLeft:[2,"sync-space-left"],limit:[2],unitScaling:[8,"unit-scaling"],percentageScaling:[8,"percentage-scaling"],level:[1],order:[1],orderDirection:[1,"order-direction"],dateInterval:[1,"date-interval"],chartMode:[1,"chart-mode"],maxBars:[2,"max-bars"],stack:[1],scale:[1],intervalSpanLimit:[2,"interval-span-limit"],axisLabelsMode:[1,"axis-labels-mode"],lineFullWidth:[1,"line-full-width"],showCategories:[1,"show-categories"],measureScale:[1,"measure-scale"],showMeasureScale:[1,"show-measure-scale"],showOverlayAvg:[1,"show-overlay-avg"],showOverlayMedian:[1,"show-overlay-median"],measureUnit:[1,"measure-unit"],data:[32],datasetMeta:[32],appliedScaleFactor:[32]},void 0,{scenarios:[{validateScenario:0}],variances:[{validateVariances:0}],syncSpaceLeft:[{validateLeftSync:0}],limit:[{validateLimit:0}],unitScaling:[{validateUnitScaling:0}],percentageScaling:[{validatePercentageScaling:0}],level:[{validateLevel:0}],order:[{validateOrderList:0}],orderDirection:[{validateOrderDirection:0}],dateInterval:[{validateDateInterval:0}],chartMode:[{validateChartMode:0}],maxBars:[{validateMaxBars:0}],stack:[{validateStack:0}],scale:[{validateScaling:0}],axisLabelsMode:[{validateAxisLabelsMode:0}],lineFullWidth:[{validateLineFullWidth:0}],showCategories:[{validateShowCategories:0}],measureScale:[{validateMeasureScale:0}],showMeasureScale:[{validateShowMeasureScale:0}],showOverlayAvg:[{validateShowOverlayAvg:0}],showOverlayMedian:[{validateShowOverlayMedian:0}]}]),j=F,P=function(){"undefined"!=typeof customElements&&["bn-chart-time","ibcs-chart-time"].forEach((e=>{switch(e){case"bn-chart-time":customElements.get(a(e))||customElements.define(a(e),F);break;case"ibcs-chart-time":customElements.get(a(e))||D()}}))};export{j as BnChartTime,P as defineCustomElement}
@@ -1 +1 @@
1
- import{getElement as t,proxyCustomElement as s,HTMLElement as e,h as a,Host as n,transformTag as o}from"@stencil/core/internal/client";import{g as r,c as i}from"./context-protocol.js";import{r as c}from"./utils.js";import{w as u}from"./withBodyObserver.js";import{a as l}from"./alasql.min.js";import{w as h,a as m}from"./withHasError.js";const d=["ac1","ac2","ac3","ac4","pp1","pp2","pp3","pp4","fc1","fc2","fc3","fc4","pl1","pl2","pl3","pl4"],f=["rowGroup","category","subCategory","columnGroup","columnSubGroup"];function p(t){return"number"==typeof t&&!isNaN(t)&&isFinite(t)}function g(t){const s=Array.from(t);return{distinctValues:s,count:s.length,hasData:s.length>0}}const y=s(class extends e{constructor(s){super(),!1!==s&&this.__registerHost(),this.datasources="",this.static=!1,h(this),this.errors=m(this),this.database=new l.Database,((s,e)=>{let a,n,o=[];const u=new MutationObserver((a=>{a.forEach((a=>{"datasources"===a.attributeName&&(o=(t(s).getAttribute("datasources")||"").split(","),o.forEach((t=>{e(t,n.datasources.get(t))})))}))})),l=s.connectedCallback;s.connectedCallback=()=>{const i=t(s);n=r(i),o=(i.getAttribute("datasources")||"").split(","),o.forEach((t=>{e(t,n.datasources.get(t))})),u.observe(i,{attributes:!0,attributeFilter:["datasources"]}),a=n.datasources.on("set",((t,s)=>{o.includes(t)&&e(t,s)})),c(l,s)};const h=s.disconnectedCallback;s.disconnectedCallback=()=>{u.disconnect(),c(a),i(t(s)),c(h,s)}})(this,((t,s)=>{this.database.tables[t]={data:s},this.executeQuery()})),u(this,(t=>{this.query=t,this.executeQuery()}))}executeQuery(){if(this.stores||(this.stores=r(this.element)),this.query&&this.name){let t;if(this.static)try{t=JSON.parse(this.query)}catch(s){console.error("Failed to parse static dataset",s),t=[]}else t=this.database.exec(this.query);this.latestResult!==t&&(this.latestResult=t,this.stores.datasets.set(this.name,t),this.stores.datasetsMeta.set(this.name,function(t){const s={};for(const t of f)s[t]=new Set;const e={};for(const t of d)e[t]={hasData:!1,min:null,max:null};const a=new Set;let n=null,o=null;const r=Array.isArray(t)?t:[];for(let t=0;t<r.length;t++){const i=r[t];if(null==i)continue;for(const t of f){const e=i[t];null!=e&&""!==e&&s[t].add(e+"")}for(const t of d){const s=i[t];if(p(s)){const a=e[t];a.hasData=!0,(null===a.min||s<a.min)&&(a.min=s),(null===a.max||s>a.max)&&(a.max=s)}}const c=i.date;if(null!=c&&""!==c){const t=c+"";a.add(t),(null===n||t<n)&&(n=t),(null===o||t>o)&&(o=t)}}const i=d.map((t=>({key:t,hasData:e[t].hasData,min:e[t].min,max:e[t].max}))),c=i.filter((t=>t.hasData)).map((t=>t.key)),u=g(s.rowGroup),l=g(s.category),h=g(s.subCategory),m=g(s.columnGroup),y=g(s.columnSubGroup),b={min:n,max:o,hasData:a.size>0,distinctCount:a.size};let w="category";return h.hasData?w="subCategory":l.hasData?w="category":u.hasData&&(w="rowGroup"),{rowCount:r.length,scenarios:i,availableScenarios:c,rowGroup:u,category:l,subCategory:h,columnGroup:m,columnSubGroup:y,dateRange:b,suggestedLevel:w,suggestedOrder:w,suggestedDateInterval:b.hasData?"auto":null,calculatedAt:Date.now()}}(t)))}}nameUpdated(){this.executeQuery()}render(){return a(n,{key:"0aecc50d8aa488f49d6630fec9f0755d306f213e"})}get element(){return this}static get watchers(){return{name:[{nameUpdated:0}]}}static get style(){return"bn-dataset{display:none}"}},[0,"bn-dataset",{name:[1],datasources:[1],static:[4]},void 0,{name:[{nameUpdated:0}]}]),b=y,w=function(){"undefined"!=typeof customElements&&["bn-dataset"].forEach((t=>{"bn-dataset"===t&&(customElements.get(o(t))||customElements.define(o(t),y))}))};export{b as BnDataset,w as defineCustomElement}
1
+ import{getElement as t,proxyCustomElement as s,HTMLElement as e,h as o,Host as a,transformTag as n}from"@stencil/core/internal/client";import{g as r,c as i}from"./context-protocol.js";import{r as c}from"./utils.js";import{w as u}from"./withBodyObserver.js";import{a as l}from"./alasql.min.js";import{w as h,a as d}from"./withHasError.js";import{d as m,c as p}from"./contentDecoder.js";const f=["ac1","ac2","ac3","ac4","pp1","pp2","pp3","pp4","fc1","fc2","fc3","fc4","pl1","pl2","pl3","pl4"],b=["rowGroup","category","subCategory","columnGroup","columnSubGroup"];function g(t){return"number"==typeof t&&!isNaN(t)&&isFinite(t)}function y(t){const s=Array.from(t);return{distinctValues:s,count:s.length,hasData:s.length>0}}const w=s(class extends e{constructor(s){super(),!1!==s&&this.__registerHost(),this.datasources="",this.static=!1,this.raw=!0,this.lastBodyHash=null,h(this),this.errors=d(this),this.database=new l.Database,((s,e)=>{let o,a,n=[];const u=new MutationObserver((o=>{o.forEach((o=>{"datasources"===o.attributeName&&(n=(t(s).getAttribute("datasources")||"").split(","),n.forEach((t=>{e(t,a.datasources.get(t))})))}))})),l=s.connectedCallback;s.connectedCallback=()=>{const i=t(s);a=r(i),n=(i.getAttribute("datasources")||"").split(","),n.forEach((t=>{e(t,a.datasources.get(t))})),u.observe(i,{attributes:!0,attributeFilter:["datasources"]}),o=a.datasources.on("set",((t,s)=>{n.includes(t)&&e(t,s)})),c(l,s)};const h=s.disconnectedCallback;s.disconnectedCallback=()=>{u.disconnect(),c(o),i(t(s)),c(h,s)}})(this,((t,s)=>{this.database.tables[t]={data:s},this.executeQuery()})),u(this,(t=>{let s,e;if(!this.raw&&this.static)try{const o=m(t);s=o.hash,e=o.json}catch(s){return void console.error("Error decoding compressed dataset",s,(t+"").slice(0,200))}else s=p(t),e=t;s!==this.lastBodyHash&&(this.lastBodyHash=s,this.query=e,this.executeQuery())}))}executeQuery(){if(this.stores||(this.stores=r(this.element)),this.query&&this.name){let t;if(this.static)try{t=JSON.parse(this.query)}catch(s){console.error("Failed to parse static dataset",s),t=[]}else t=this.database.exec(this.query);this.latestResult!==t&&(this.latestResult=t,this.stores.datasets.set(this.name,t),this.stores.datasetsMeta.set(this.name,function(t){const s={};for(const t of b)s[t]=new Set;const e={};for(const t of f)e[t]={hasData:!1,min:null,max:null};const o=new Set;let a=null,n=null;const r=Array.isArray(t)?t:[];for(let t=0;t<r.length;t++){const i=r[t];if(null==i)continue;for(const t of b){const e=i[t];null!=e&&""!==e&&s[t].add(e+"")}for(const t of f){const s=i[t];if(g(s)){const o=e[t];o.hasData=!0,(null===o.min||s<o.min)&&(o.min=s),(null===o.max||s>o.max)&&(o.max=s)}}const c=i.date;if(null!=c&&""!==c){const t=c+"";o.add(t),(null===a||t<a)&&(a=t),(null===n||t>n)&&(n=t)}}const i=f.map((t=>({key:t,hasData:e[t].hasData,min:e[t].min,max:e[t].max}))),c=i.filter((t=>t.hasData)).map((t=>t.key)),u=y(s.rowGroup),l=y(s.category),h=y(s.subCategory),d=y(s.columnGroup),m=y(s.columnSubGroup),p={min:a,max:n,hasData:o.size>0,distinctCount:o.size};let w="category";return h.hasData?w="subCategory":l.hasData?w="category":u.hasData&&(w="rowGroup"),{rowCount:r.length,scenarios:i,availableScenarios:c,rowGroup:u,category:l,subCategory:h,columnGroup:d,columnSubGroup:m,dateRange:p,suggestedLevel:w,suggestedOrder:w,suggestedDateInterval:p.hasData?"auto":null,calculatedAt:Date.now()}}(t)))}}nameUpdated(){this.executeQuery()}render(){return o(a,{key:"3e8b6fbc52b5b5cbe0ae88d7aa1d259f86d63e1b"})}get element(){return this}static get watchers(){return{name:[{nameUpdated:0}]}}static get style(){return"bn-dataset{display:none}"}},[0,"bn-dataset",{name:[1],datasources:[1],static:[4],raw:[4]},void 0,{name:[{nameUpdated:0}]}]),v=w,x=function(){"undefined"!=typeof customElements&&["bn-dataset"].forEach((t=>{"bn-dataset"===t&&(customElements.get(n(t))||customElements.define(n(t),w))}))};export{v as BnDataset,x as defineCustomElement}
@@ -1 +1 @@
1
- import{proxyCustomElement as t,HTMLElement as s,h as e,Host as r,transformTag as o}from"@stencil/core/internal/client";import{w as n}from"./withBodyObserver.js";import{g as c}from"./context-protocol.js";import{w as i,a}from"./withHasError.js";const h=t(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),i(this),this.errors=a(this),n(this,(t=>{this.stores||(this.stores=c(this.element));try{const s=JSON.parse(t);this.stores.datasources.set(this.name,s)}catch(s){console.error("Error parsing datasource",s,t),this.stores.datasources.set(this.name,[])}}))}render(){return e(r,{key:"e47e62c941bb7954cabe331cb500a7d2fdd7c487"})}get element(){return this}static get style(){return"bn-datasource{display:none}"}},[0,"bn-datasource",{name:[1]}]),m=h,u=function(){"undefined"!=typeof customElements&&["bn-datasource"].forEach((t=>{"bn-datasource"===t&&(customElements.get(o(t))||customElements.define(o(t),h))}))};export{m as BnDatasource,u as defineCustomElement}
1
+ import{proxyCustomElement as t,HTMLElement as s,h as e,Host as r,transformTag as o}from"@stencil/core/internal/client";import{w as i}from"./withBodyObserver.js";import{g as n}from"./context-protocol.js";import{w as c,a}from"./withHasError.js";import{c as h,d as m}from"./contentDecoder.js";const d=t(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.raw=!0,this.lastHash=null,c(this),this.errors=a(this),i(this,(t=>{this.stores||(this.stores=n(this.element));try{let s,e;if(this.raw)s=h(t),e=t;else{const r=m(t);s=r.hash,e=r.json}if(s===this.lastHash)return;this.lastHash=s;const r=JSON.parse(e);this.stores.datasources.set(this.name,r)}catch(s){console.error("Error parsing datasource",s,(t+"").slice(0,200)),this.stores.datasources.set(this.name,[])}}))}render(){return e(r,{key:"43b691b07f63d12ad6c835dfb5d5bf6053b3bbf4"})}get element(){return this}static get style(){return"bn-datasource{display:none}"}},[0,"bn-datasource",{name:[1],raw:[4]}]),u=d,l=function(){"undefined"!=typeof customElements&&["bn-datasource"].forEach((t=>{"bn-datasource"===t&&(customElements.get(o(t))||customElements.define(o(t),d))}))};export{u as BnDatasource,l as defineCustomElement}
@@ -1 +1 @@
1
- import{proxyCustomElement as t,HTMLElement as i,h as e,Host as a,transformTag as s}from"@stencil/core/internal/client";import{v as r,a as n,i as o,p as l,h as d,q as h,l as p,r as u,k as c,s as v,t as m,b as g,c as y,u as f,m as b,w as S,x as w}from"./validate.js";import{w as O,g as T,p as R}from"./scaling.js";import{w as D,a as _}from"./withHasError.js";import{a as E}from"./context-protocol.js";import{w as M}from"./withTranslation.js";import{w as C}from"./withStyled.js";import{w as F}from"./withComponentStyle.js";import{D as G,b as W,O as P,I as N,e as U,M as A,B as x,T as L}from"./Order.js";import{T as j,d as I}from"./ibcs-table2.js";const k=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.data=[],this.datasetMeta=null,this.appliedScaleFactor=1,this.tableTitle="",this.filter="",this.measureUnit="",this.barColumnWidth="w30",this.unitScaling=.01,this.percentageScaling=.5,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._autoScaleGuard=!1,C(this),D(this),this.errors=_(this),this.componentStyle=F(this),O(this,((t,i)=>{this.data=i||[]}),((t,i)=>{this.datasetMeta=i})),this.t=M(this).t}validateScenario(t){const i="ERR_scenarios",e=r(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",e=n(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(o(t))return void this.errors.remove(i);const e=n(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";l(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";d(t)||this.pixelPerUnitGroupMap.has(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"unitScaling: invalid value '"+t+"' is not supported."})}validatePercentageScaling(t){const i="ERR_percentageScaling";d(t)||this.pixelPerUnitGroupMap.has(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"percentageScaling: invalid value '"+t+"' is not supported."})}validateDataFormat(t){const i="ERR_dataFormat";h(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";p(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_grouped";p(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";p(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";u(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";c(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=v(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=m(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",e=g(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";y(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";f(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";b(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";c(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";c(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";S(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=w(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)}componentWillLoad(){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.validateShowMeasureScale(this.showMeasureScale),this.validateBarColumns(this.barColumns),this.validateBarColumnWidth(this.barColumnWidth),this.validateUnitScaling(this.unitScaling),this.validatePercentageScaling(this.percentageScaling),this.validateScaling(this.scale)}disconnectedCallback(){this.unsubscribe()}componentDidRender(){var t,i;const{mode:e}=R(this.scale);if("auto"!==e&&"empty"!==e)return void(this._autoScaleGuard=!1);if(this._autoScaleGuard)return void(this._autoScaleGuard=!1);const a=this.element,{width:s}=T(a);if(s<=0)return;const r=this.componentStyle((t=>{var i;return(null===(i=t.global)||void 0===i?void 0:i.fontSizePx)||13.3333}));a.style.setProperty("--bn-font-size",r+"px");const n=null===(t=a.shadowRoot)||void 0===t?void 0:t.querySelector("div"),o=null!==(i=null==n?void 0:n.scrollWidth)&&void 0!==i?i:a.scrollWidth;if(o<=s+1)return this.errors.remove("AUTO_scale"),void(1!==this.appliedScaleFactor&&(this._autoScaleGuard=!0,this.appliedScaleFactor=1));const l=(s-1)/o;a.style.setProperty("--bn-font-size",r*l+"px"),"empty"===e?this.errors.addOrReplace({id:"AUTO_scale",type:"warning",message:"Auto-scaled table by factor "+l.toFixed(3)}):this.errors.remove("AUTO_scale"),Math.abs(l-this.appliedScaleFactor)>.001&&(this._autoScaleGuard=!0,this.appliedScaleFactor=l)}prepareDataFormat(){var t;return G[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 j[null===(t=this.type)||void 0===t?void 0:t.toUpperCase()]}prepareLimit(){return Math.floor(Number(this.limit)||0)}prepareThereOf(){return null==this.thereof||""===this.thereof.trim()?[]:JSON.parse(this.thereof)}preparePartOf(){return null==this.partof||""===this.partof.trim()?[]:JSON.parse(this.partof)}prepareOrder(){var t,i,e;const a="auto"===(null===(t=this.order)||void 0===t?void 0:t.trim().toLowerCase());let s=this.order;return a&&(null===(i=this.datasetMeta)||void 0===i?void 0:i.suggestedOrder)&&(s=this.datasetMeta.suggestedOrder),{hierarchy:s.split(",").map((t=>P[null==t?void 0:t.toUpperCase()])),direction:W[null===(e=this.orderDirection)||void 0===e?void 0:e.toUpperCase()]}}prepareI18nMode(){return N.META}prepareI18n(){const t=E,i=new Map(["in","category","operation","there_of","part_of","SUM_TOTAL"].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,l;const d="auto"===(null===(t=this.scenarios)||void 0===t?void 0:t.trim().toLowerCase());if((o(this.scenarios)||d)&&o(this.variances))return(null===(e=null===(i=this.datasetMeta)||void 0===i?void 0:i.availableScenarios)||void 0===e?void 0:e.length)>0?(d?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 h=[];return d||o(this.scenarios)?(null===(s=null===(a=this.datasetMeta)||void 0===a?void 0:a.availableScenarios)||void 0===s?void 0:s.length)>0&&(d?this.errors.remove("AUTO_scenarios"):this.errors.addOrReplace({id:"AUTO_scenarios",type:"warning",message:"scenarios: not set, auto-detected: "+this.datasetMeta.availableScenarios.join(",")}),h=h.concat(this.datasetMeta.availableScenarios)):(this.errors.remove("AUTO_scenarios"),h=h.concat(null===(r=this.scenarios)||void 0===r?void 0:r.split(","))),(null===(n=this.variances)||void 0===n?void 0:n.trim().length)>0&&(h=h.concat(null===(l=this.variances)||void 0===l?void 0:l.split(","))),h.map((t=>t.trim()))}prepareCategoryWidth(){var t;return o(this.categoryWidth)?U.INF:U[null===(t=this.categoryWidth)||void 0===t?void 0:t.toUpperCase()]}prepareMeasureScale(){return o(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 o(this.measureType)?A.VOLUME:A[null===(t=this.measureType)||void 0===t?void 0:t.toUpperCase()]}prepareColumnThereOf(){if(null==this.columnthereof||""===this.columnthereof.trim())return new Map;const t=JSON.parse(this.columnthereof),i=new Map;for(const[e,a]of Object.entries(t))!1===i.has(a.scenario)&&i.set(a.scenario,[]),i.get(a.scenario).push(a);return i}prepareTableTitle(){return""===this.tableTitle||null==this.tableTitle?"SUM_TOTAL":this.tableTitle}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=L[i];return e?x[e]:x[L.W30]}prepareBarColumns(){return o(this.barColumns)?[]:this.barColumns.split(",").map((t=>t.trim()))}prepareUnitScaling(){return this.pixelPerUnitGroupMap.has(this.unitScaling)?this.pixelPerUnitGroupMap.get(this.unitScaling):Number(this.unitScaling)}preparePercentageScaling(){return this.pixelPerUnitGroupMap.has(this.percentageScaling)?this.pixelPerUnitGroupMap.get(this.percentageScaling):Number(this.percentageScaling)}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:""}}}}getEffectiveScaleFactor(){const{mode:t,factor:i}=R(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 e(a,{key:"b379c18d4d92805e91404917ffb096e582b9bec2",style:t},e("div",{key:"a45679a84d85b856f0e01615952c0ccfe05108f9"},e("ibcs-table",{key:"0b375fca9ab9422bc61a4d0ba75eaf30eedfa77d",data:this.data,"table-title":this.prepareTableTitle(),scenarios:this.prepareScenarios(),"scenarios-data-format":this.prepareDataFormat(),grouped:this.prepareGrouped(),limit:this.prepareLimit(),showGroupTitle:this.prepareShowGroupTitle(),thereof:this.prepareThereOf(),partof:this.preparePartOf(),order:this.prepareOrder(),categorythereof:this.prepareColumnThereOf(),type:this.prepareTableType(),"category-width":this.prepareCategoryWidth(),dataFormatDigits:this.prepareDataFormatDigits(),i18n:this.prepareI18n(),"i18n-mode":this.prepareI18nMode(),"measure-scale":this.prepareMeasureScale(),"measure-type":this.prepareMeasureType(),"measure-unit":this.prepareMeasureUnit(),showMeasureScale:this.prepareShowMeasureScale(),filter:this.prepareFilter(),barColumns:this.prepareBarColumns(),barColumnMaxWidth:this.prepareBarColumnWidth(),unitScaling:this.prepareUnitScaling(),percentageScaling:this.preparePercentageScaling(),scaleFactor:i})))}get element(){return this}static get watchers(){return{scale:[{validateScaling: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}]}}static get style(){return":host{display:inline-block;position:relative;overflow:hidden}"}},[1,"bn-table",{scale:[1],tableTitle:[1,"table-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],data:[32],datasetMeta:[32],appliedScaleFactor:[32]},void 0,{scale:[{validateScaling: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}]}]),B=k,J=function(){"undefined"!=typeof customElements&&["bn-table","ibcs-table"].forEach((t=>{switch(t){case"bn-table":customElements.get(s(t))||customElements.define(s(t),k);break;case"ibcs-table":customElements.get(s(t))||I()}}))};export{B as BnTable,J as defineCustomElement}
1
+ import{proxyCustomElement as t,HTMLElement as i,h as e,Host as a,transformTag as s}from"@stencil/core/internal/client";import{v as r,a as n,i as o,p as l,h as d,q as h,l as p,r as u,k as c,s as v,t as m,b as g,c as y,u as f,m as b,w as S,x as w}from"./validate.js";import{w as O,g as T,p as R}from"./scaling.js";import{w as D,a as _}from"./withHasError.js";import{a as E}from"./context-protocol.js";import{w as M}from"./withTranslation.js";import{w as C}from"./withStyled.js";import{w as F}from"./withComponentStyle.js";import{D as G,b as W,O as P,I as N,e as U,M as A,B as x,T as L}from"./Order.js";import{T as j,d as I}from"./ibcs-table2.js";const k=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.data=[],this.datasetMeta=null,this.appliedScaleFactor=1,this.tableTitle="",this.filter="",this.measureUnit="",this.barColumnWidth="w10",this.unitScaling=.01,this.percentageScaling=.5,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._autoScaleGuard=!1,C(this),D(this),this.errors=_(this),this.componentStyle=F(this),O(this,((t,i)=>{this.data=i||[]}),((t,i)=>{this.datasetMeta=i})),this.t=M(this).t}validateScenario(t){const i="ERR_scenarios",e=r(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",e=n(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(o(t))return void this.errors.remove(i);const e=n(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";l(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";d(t)||this.pixelPerUnitGroupMap.has(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"unitScaling: invalid value '"+t+"' is not supported."})}validatePercentageScaling(t){const i="ERR_percentageScaling";d(t)||this.pixelPerUnitGroupMap.has(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"percentageScaling: invalid value '"+t+"' is not supported."})}validateDataFormat(t){const i="ERR_dataFormat";h(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";p(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_grouped";p(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";p(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";u(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";c(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=v(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=m(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",e=g(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";y(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";f(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";b(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";c(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";c(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";S(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=w(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)}componentWillLoad(){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.validateShowMeasureScale(this.showMeasureScale),this.validateBarColumns(this.barColumns),this.validateBarColumnWidth(this.barColumnWidth),this.validateUnitScaling(this.unitScaling),this.validatePercentageScaling(this.percentageScaling),this.validateScaling(this.scale)}disconnectedCallback(){this.unsubscribe()}componentDidRender(){var t,i;const{mode:e}=R(this.scale);if("auto"!==e&&"empty"!==e)return void(this._autoScaleGuard=!1);if(this._autoScaleGuard)return void(this._autoScaleGuard=!1);const a=this.element,{width:s}=T(a);if(s<=0)return;const r=this.componentStyle((t=>{var i;return(null===(i=t.global)||void 0===i?void 0:i.fontSizePx)||13.3333}));a.style.setProperty("--bn-font-size",r+"px");const n=null===(t=a.shadowRoot)||void 0===t?void 0:t.querySelector("div"),o=null!==(i=null==n?void 0:n.scrollWidth)&&void 0!==i?i:a.scrollWidth;if(o<=s+1)return this.errors.remove("AUTO_scale"),void(1!==this.appliedScaleFactor&&(this._autoScaleGuard=!0,this.appliedScaleFactor=1));const l=(s-1)/o;a.style.setProperty("--bn-font-size",r*l+"px"),"empty"===e?this.errors.addOrReplace({id:"AUTO_scale",type:"warning",message:"Auto-scaled table by factor "+l.toFixed(3)}):this.errors.remove("AUTO_scale"),Math.abs(l-this.appliedScaleFactor)>.001&&(this._autoScaleGuard=!0,this.appliedScaleFactor=l)}prepareDataFormat(){var t;return G[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 j[null===(t=this.type)||void 0===t?void 0:t.toUpperCase()]}prepareLimit(){return Math.floor(Number(this.limit)||0)}prepareThereOf(){return null==this.thereof||""===this.thereof.trim()?[]:JSON.parse(this.thereof)}preparePartOf(){return null==this.partof||""===this.partof.trim()?[]:JSON.parse(this.partof)}prepareOrder(){var t,i,e;const a="auto"===(null===(t=this.order)||void 0===t?void 0:t.trim().toLowerCase());let s=this.order;return a&&(null===(i=this.datasetMeta)||void 0===i?void 0:i.suggestedOrder)&&(s=this.datasetMeta.suggestedOrder),{hierarchy:s.split(",").map((t=>P[null==t?void 0:t.toUpperCase()])),direction:W[null===(e=this.orderDirection)||void 0===e?void 0:e.toUpperCase()]}}prepareI18nMode(){return N.META}prepareI18n(){const t=E,i=new Map(["in","category","operation","there_of","part_of","SUM_TOTAL"].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,l;const d="auto"===(null===(t=this.scenarios)||void 0===t?void 0:t.trim().toLowerCase());if((o(this.scenarios)||d)&&o(this.variances))return(null===(e=null===(i=this.datasetMeta)||void 0===i?void 0:i.availableScenarios)||void 0===e?void 0:e.length)>0?(d?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 h=[];return d||o(this.scenarios)?(null===(s=null===(a=this.datasetMeta)||void 0===a?void 0:a.availableScenarios)||void 0===s?void 0:s.length)>0&&(d?this.errors.remove("AUTO_scenarios"):this.errors.addOrReplace({id:"AUTO_scenarios",type:"warning",message:"scenarios: not set, auto-detected: "+this.datasetMeta.availableScenarios.join(",")}),h=h.concat(this.datasetMeta.availableScenarios)):(this.errors.remove("AUTO_scenarios"),h=h.concat(null===(r=this.scenarios)||void 0===r?void 0:r.split(","))),(null===(n=this.variances)||void 0===n?void 0:n.trim().length)>0&&(h=h.concat(null===(l=this.variances)||void 0===l?void 0:l.split(","))),h.map((t=>t.trim()))}prepareCategoryWidth(){var t;return o(this.categoryWidth)?U.INF:U[null===(t=this.categoryWidth)||void 0===t?void 0:t.toUpperCase()]}prepareMeasureScale(){return o(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 o(this.measureType)?A.VOLUME:A[null===(t=this.measureType)||void 0===t?void 0:t.toUpperCase()]}prepareColumnThereOf(){if(null==this.columnthereof||""===this.columnthereof.trim())return new Map;const t=JSON.parse(this.columnthereof),i=new Map;for(const[e,a]of Object.entries(t))!1===i.has(a.scenario)&&i.set(a.scenario,[]),i.get(a.scenario).push(a);return i}prepareTableTitle(){return""===this.tableTitle||null==this.tableTitle?"SUM_TOTAL":this.tableTitle}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=L[i];return e?x[e]:x[L.W10]}prepareBarColumns(){return o(this.barColumns)?[]:this.barColumns.split(",").map((t=>t.trim()))}prepareUnitScaling(){return this.pixelPerUnitGroupMap.has(this.unitScaling)?this.pixelPerUnitGroupMap.get(this.unitScaling):Number(this.unitScaling)}preparePercentageScaling(){return this.pixelPerUnitGroupMap.has(this.percentageScaling)?this.pixelPerUnitGroupMap.get(this.percentageScaling):Number(this.percentageScaling)}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:""}}}}getEffectiveScaleFactor(){const{mode:t,factor:i}=R(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 e(a,{key:"788f67af1bbc37c0ffe1467503e0708ec52a7f53",style:t},e("div",{key:"3f9bcc8cddc8bbdf88681ca3d0ee35e67aa1a04f"},e("ibcs-table",{key:"74657d8bca08c78313db7f497c0d7267eee97d00",data:this.data,"table-title":this.prepareTableTitle(),scenarios:this.prepareScenarios(),"scenarios-data-format":this.prepareDataFormat(),grouped:this.prepareGrouped(),limit:this.prepareLimit(),showGroupTitle:this.prepareShowGroupTitle(),thereof:this.prepareThereOf(),partof:this.preparePartOf(),order:this.prepareOrder(),categorythereof:this.prepareColumnThereOf(),type:this.prepareTableType(),"category-width":this.prepareCategoryWidth(),dataFormatDigits:this.prepareDataFormatDigits(),i18n:this.prepareI18n(),"i18n-mode":this.prepareI18nMode(),"measure-scale":this.prepareMeasureScale(),"measure-type":this.prepareMeasureType(),"measure-unit":this.prepareMeasureUnit(),showMeasureScale:this.prepareShowMeasureScale(),filter:this.prepareFilter(),barColumns:this.prepareBarColumns(),barColumnMaxWidth:this.prepareBarColumnWidth(),unitScaling:this.prepareUnitScaling(),percentageScaling:this.preparePercentageScaling(),scaleFactor:i})))}get element(){return this}static get watchers(){return{scale:[{validateScaling: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}]}}static get style(){return":host{display:inline-block;position:relative;overflow:hidden}"}},[1,"bn-table",{scale:[1],tableTitle:[1,"table-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],data:[32],datasetMeta:[32],appliedScaleFactor:[32]},void 0,{scale:[{validateScaling: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}]}]),B=k,J=function(){"undefined"!=typeof customElements&&["bn-table","ibcs-table"].forEach((t=>{switch(t){case"bn-table":customElements.get(s(t))||customElements.define(s(t),k);break;case"ibcs-table":customElements.get(s(t))||I()}}))};export{B as BnTable,J as defineCustomElement}
@@ -0,0 +1 @@
1
+ import{m as r}from"./emotion-hash.esm.js";var n=Uint8Array,e=Uint16Array,a=Int32Array,i=new n([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),o=new n([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),t=new n([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),f=function(r,n){for(var i=new e(31),o=0;o<31;++o)i[o]=n+=1<<r[o-1];var t=new a(i[30]);for(o=1;o<30;++o)for(var f=i[o];f<i[o+1];++f)t[f]=f-i[o]<<5|o;return{b:i,r:t}},v=f(i,2),l=v.b,u=v.r;l[28]=258,u[258]=28;for(var c=f(o,0).b,s=new e(32768),w=0;w<32768;++w){var d=(43690&w)>>1|(21845&w)<<1;s[w]=((65280&(d=(61680&(d=(52428&d)>>2|(13107&d)<<2))>>4|(3855&d)<<4))>>8|(255&d)<<8)>>1}var h=function(r,n,a){for(var i=r.length,o=0,t=new e(n);o<i;++o)r[o]&&++t[r[o]-1];var f,v=new e(n);for(o=1;o<n;++o)v[o]=v[o-1]+t[o-1]<<1;if(a){f=new e(1<<n);var l=15-n;for(o=0;o<i;++o)if(r[o])for(var u=o<<4|r[o],c=n-r[o],w=v[r[o]-1]++<<c,d=w|(1<<c)-1;w<=d;++w)f[s[w]>>l]=u}else for(f=new e(i),o=0;o<i;++o)r[o]&&(f[o]=s[v[r[o]-1]++]>>15-r[o]);return f},m=new n(288);for(w=0;w<144;++w)m[w]=8;for(w=144;w<256;++w)m[w]=9;for(w=256;w<280;++w)m[w]=7;for(w=280;w<288;++w)m[w]=8;var p=new n(32);for(w=0;w<32;++w)p[w]=5;var b=h(m,9,1),g=h(p,5,1),k=function(r){for(var n=r[0],e=1;e<r.length;++e)r[e]>n&&(n=r[e]);return n},y=function(r,n,e){var a=n/8|0;return(r[a]|r[a+1]<<8)>>(7&n)&e},x=function(r,n){var e=n/8|0;return(r[e]|r[e+1]<<8|r[e+2]<<16)>>(7&n)},E=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],A=function(r,n,e){var a=new Error(n||E[r]);if(a.code=r,Error.captureStackTrace&&Error.captureStackTrace(a,A),!e)throw a;return a},T=new n(0);function U(r,e){var a,f,v=function(r){31==r[0]&&139==r[1]&&8==r[2]||A(6,"invalid gzip data");var n=r[3],e=10;4&n&&(e+=2+(r[10]|r[11]<<8));for(var a=(n>>3&1)+(n>>4&1);a>0;a-=!r[e++]);return e+(2&n)}(r);return v+8>r.length&&A(6,"invalid gzip data"),function(r,e,a,f){var v=r.length;if(!v||e.f&&!e.l)return a||new n(0);var u=!a,s=u||2!=e.i;u&&(a=new n(3*v));var w,d,m=function(r){var e=a.length;if(r>e){var i=new n(Math.max(2*e,r));i.set(a),a=i}},p=e.f||0,E=e.p||0,T=e.b||0,U=e.l,z=e.d,D=e.m,j=e.n,F=8*v;do{if(!U){p=y(r,E,1);var I=y(r,E+1,3);if(E+=3,!I){var M=r[(P=4+((E+7)/8|0))-4]|r[P-3]<<8,O=P+M;if(O>v){A(0);break}s&&m(T+M),a.set(r.subarray(P,O),T),e.b=T+=M,e.p=E=8*O,e.f=p;continue}if(1==I)U=b,z=g,D=9,j=5;else if(2==I){var q=y(r,E,31)+257,B=y(r,E+10,15)+4,C=q+y(r,E+5,31)+1;E+=14;for(var G=new n(C),H=new n(19),J=0;J<B;++J)H[t[J]]=y(r,E+3*J,7);E+=3*B;var K=k(H),L=(1<<K)-1,N=h(H,K,1);for(J=0;J<C;){var P,Q=N[y(r,E,L)];if(E+=15&Q,(P=Q>>4)<16)G[J++]=P;else{var R=0,S=0;for(16==P?(S=3+y(r,E,3),E+=2,R=G[J-1]):17==P?(S=3+y(r,E,7),E+=3):18==P&&(S=11+y(r,E,127),E+=7);S--;)G[J++]=R}}var V=G.subarray(0,q),W=G.subarray(q);D=k(V),j=k(W),U=h(V,D,1),z=h(W,j,1)}else A(1);if(E>F){A(0);break}}s&&m(T+131072);for(var X=(1<<D)-1,Y=(1<<j)-1,Z=E;;Z=E){var $=(R=U[x(r,E)&X])>>4;if((E+=15&R)>F){A(0);break}if(R||A(2),$<256)a[T++]=$;else{if(256==$){Z=E,U=null;break}var _=$-254;$>264&&(_=y(r,E,(1<<(er=i[J=$-257]))-1)+l[J],E+=er);var rr=z[x(r,E)&Y],nr=rr>>4;if(rr||A(3),E+=15&rr,W=c[nr],nr>3){var er=o[nr];W+=x(r,E)&(1<<er)-1,E+=er}if(E>F){A(0);break}s&&m(T+131072);var ar=T+_;if(T<W){var ir=0-W,or=Math.min(W,ar);for(ir+T<0&&A(3);T<or;++T)a[T]=f[ir+T]}for(;T<ar;++T)a[T]=a[T-W]}}e.l=U,e.p=Z,e.b=T,e.f=p,U&&(p=1,e.m=D,e.d=z,e.n=j)}while(!p);return T!=a.length&&u?(w=a,(null==(d=T)||d>w.length)&&(d=w.length),new n(w.subarray(0,d))):a.subarray(0,T)}(r.subarray(v,-8),{i:2},new n(((a=r)[(f=a.length)-4]|a[f-3]<<8|a[f-2]<<16|a[f-1]<<24)>>>0),e)}var z="undefined"!=typeof TextDecoder&&new TextDecoder;try{z.decode(T,{stream:!0})}catch(r){}function D(n){return r(n)}function j(r){const n=r.indexOf(":");if(-1===n)throw new Error("Invalid compressed format: missing ':' separator");const e=r.slice(0,n),a=r.slice(n+1),i=atob(a),o=new Uint8Array(i.length);for(let r=0;r<i.length;r++)o[r]=i.charCodeAt(r);const t=U(o);return{hash:e,json:(new TextDecoder).decode(t)}}export{D as c,j as d}
@@ -1 +1 @@
1
- import*as e from"@stencil/core/internal/client";const t=(()=>{let e;return(...t)=>{e&&clearTimeout(e),e=setTimeout((()=>{e=0,(e=>{for(let t of e.keys()){const n=e.get(t).filter((e=>{const t=e.deref();return t&&(!("isConnected"in(n=t))||n.isConnected);var n}));e.set(t,n)}})(...t)}),2e3)}})(),n=e.forceUpdate,o=e.getRenderingRef,i=(e,t)=>{const n=e.indexOf(t);n>=0&&(e[n]=e[e.length-1],e.length--)},r=(e,r)=>{const a=((e,t=(e,t)=>e!==t)=>{const n=()=>{return("function"==typeof(t=e)?t():t)??{};var t},o=n();let r=new Map(Object.entries(o));const a="undefined"!=typeof Proxy,s=a?null:{},l={dispose:[],get:[],set:[],reset:[]},f=new Map,c=()=>{r=new Map(Object.entries(n())),a||_(),l.reset.forEach((e=>e()))},d=e=>(l.get.forEach((t=>t(e))),r.get(e)),p=(e,n)=>{const o=r.get(e);t(n,o,e)&&(r.set(e,n),a||u(e),l.set.forEach((t=>t(e,n,o))))},b=a?new Proxy(o,{get:(e,t)=>d(t),ownKeys:()=>Array.from(r.keys()),getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0}),has:(e,t)=>r.has(t),set:(e,t,n)=>(p(t,n),!0)}):(_(),s),h=(e,t)=>(l[e].push(t),()=>{i(l[e],t)});function u(e){!a&&s&&(Object.prototype.hasOwnProperty.call(s,e)||Object.defineProperty(s,e,{configurable:!0,enumerable:!0,get:()=>d(e),set(t){p(e,t)}}))}function _(){if(a||!s)return;const e=new Set(r.keys());for(const t of Object.keys(s))e.has(t)||delete s[t];for(const t of e)u(t)}return{state:b,get:d,set:p,on:h,onChange:(e,t)=>{const o=(n,o)=>{n===e&&t(o)},i=()=>{const o=n();t(o[e])},r=h("set",o),a=h("reset",i);return f.set(t,{setHandler:o,resetHandler:i,propName:e}),()=>{r(),a(),f.delete(t)}},use:(...e)=>{const t=e.reduce(((e,t)=>(t.set&&e.push(h("set",t.set)),t.get&&e.push(h("get",t.get)),t.reset&&e.push(h("reset",t.reset)),t.dispose&&e.push(h("dispose",t.dispose)),e)),[]);return()=>t.forEach((e=>e()))},dispose:()=>{l.dispose.forEach((e=>e())),c()},reset:c,forceUpdate:e=>{const t=r.get(e);l.set.forEach((n=>n(e,t,t)))},removeListener:(e,t)=>{const n=f.get(t);n&&n.propName===e&&(i(l.set,n.setHandler),i(l.reset,n.resetHandler),f.delete(t))}}})(e,r);return a.use((()=>{if("function"!=typeof o||"function"!=typeof n)return{};const e=n,i=o,r=new Map;return{dispose:()=>r.clear(),get:e=>{const t=i();t&&((e,t,n)=>{let o=e.get(t);o||(o=[],e.set(t,o)),o.some((e=>e.deref()===n))||o.push(new WeakRef(n))})(r,e,t)},set:n=>{const o=r.get(n);if(o){const t=o.filter((t=>{const n=t.deref();return!!n&&e(n)}));r.set(n,t)}t(r)},reset:()=>{r.forEach((t=>{t.forEach((t=>{const n=t.deref();n&&e(n)}))})),t(r)}}})()),a},a={global:{fontFamily:"'Noto Sans', sans-serif",fontSizePx:13.3333,fontColor:"#000000",fontBackgroundColor:"#ffffff"},"bn-text":{},"bn-chart-time":{scaleFactors:{scenarioOffset:.3,scenarioLabelToColumn:.3,labelToColumn:.3,labelToAxis:.3,needleWidth:.3,needleHeadWidth:.6,columnWidth:2,varianceAxisLineWidth:.3,axisLineWidth:.1,auxiliaryLineWidth:.1,scenarioLineWidth:.2,markerWidth:.7,markerOffset:0,categoryWidth:3,axisTickLength:.3},axisStyles:{ac:{stroke:"#121212",fill:"#121212",width:.1},fc:{stroke:"#121212",fill:"#ffffff",width:.1,dasharray:"10 5 5 5"},pp:{stroke:"#606060",fill:"#606060",width:.1},pl:{stroke:"#121212",fill:"#ffffff",width:.1}},barStyles:{ac:{stroke:"#404040",fill:"#404040",width:.1},fc:{stroke:"#404040",fill:"#ffffff",width:.5,fillpattern:"fc"},pp:{stroke:"#A6A6A6",fill:"#A6A6A6",width:.1},pl:{stroke:"#404040",fill:"#ffffff",width:.1}},varianceStyles:{pos:{stroke:"#008f96",fill:"#008f96",width:.1},neg:{stroke:"#ff0000",fill:"#ff0000",width:.1},neu:{stroke:"#808080",fill:"#808080",width:.1}},padding:{top:10,left:10,right:10,bottom:10}},"bn-chart-structure":{scaleFactors:{scenarioOffset:.3,scenarioLabelToBar:.1,labelToBar:.3,labelToAxis:.3,needleWidth:.3,needleHeadWidth:.6,barWidth:1.2,varianceAxisLineWidth:.3,axisLineWidth:.1,auxiliaryLineWidth:.1,scenarioLineWidth:.2,markerWidth:.7,markerOffset:0,categoryWidth:1.9,axisTickLength:.3},axisStyles:{ac:{stroke:"#121212",fill:"#121212",width:.1},fc:{stroke:"#121212",fill:"#ffffff",width:.1,dasharray:"10 5 5 5"},pp:{stroke:"#606060",fill:"#606060",width:.1},pl:{stroke:"#121212",fill:"#ffffff",width:.1}},barStyles:{ac:{stroke:"#404040",fill:"#404040",width:.1},fc:{stroke:"#404040",fill:"#ffffff",width:.5,fillpattern:"fc"},pp:{stroke:"#A6A6A6",fill:"#A6A6A6",width:.1},pl:{stroke:"#404040",fill:"#ffffff",width:.1}},varianceStyles:{pos:{stroke:"#008f96",fill:"#008f96",width:.1},neg:{stroke:"#ff0000",fill:"#ff0000",width:.1},neu:{stroke:"#808080",fill:"#808080",width:.1}},padding:{top:10,left:10,right:10,bottom:10}},"bn-tree":{edgeColor:"#404040",edgeWidth:1,operatorCircleRadius:10,operatorFontSizeScale:.9,operatorColor:"#404040"},"bn-grid":{headerBackground:"transparent",borderColor:"#A6A6A6",borderWidth:1,cellPadding:4}};function s(e,t,n=null){n=n||{},t=t?t+".":"";for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&("object"==typeof e[o]&&null!==e[o]?s(e[o],t+o,n):n[t+o]=e[o]);return n}const l=["ORDER_asc","ORDER_desc","ac1","pp1","fc1","pl1","ac2","pp2","fc2","pl2","ac3","pp3","fc3","pl3","ac4","pp4","fc4","pl4","ibcssymbol_delta_ac","ibcssymbol_delta_generic","ibcssymbol_delta_ac_relative","ibcssymbol_delta_generic_relative"],f=s({global:{ac1:"AC",pp1:"PY",fc1:"FC",pl1:"PL",ac2:"AC2",pp2:"PY2",fc2:"FC2",pl2:"PL2",ac3:"AC3",pp3:"PY3",fc3:"FC3",pl3:"PL3",ac4:"AC4",pp4:"PY4",fc4:"FC4",pl4:"PL4",ORDER_asc:"↑",ORDER_desc:"↓",ibcssymbol_delta_ac:"Δ{%}",ibcssymbol_delta_generic:"Δ({%})",ibcssymbol_delta_ac_relative:"Δ{%}%",ibcssymbol_delta_generic_relative:"Δ({%})%"},"bn-title":{SEPERATOR_WS:", ",CONNECTOR_WS:" und ",in:"in"},"bn-chart":{},"bn-table":{in:"in",category:" ",operation:" ",there_of:"davon",part_of:"in % von",SUM_TOTAL:"❖",REST:"REST"}}),c=s({global:{ac1:"AC",pp1:"PY",fc1:"FC",pl1:"PL",ac2:"AC2",pp2:"PY2",fc2:"FC2",pl2:"PL2",ac3:"AC3",pp3:"PY3",fc3:"FC3",pl3:"PL3",ac4:"AC4",pp4:"PY4",fc4:"FC4",pl4:"PL4",ORDER_asc:"↑",ORDER_desc:"↓",ibcssymbol_delta_ac:"Δ{%}",ibcssymbol_delta_generic:"Δ({%})",ibcssymbol_delta_ac_relative:"Δ{%}%",ibcssymbol_delta_generic_relative:"Δ({%})%"},"bn-title":{SEPERATOR_WS:", ",CONNECTOR_WS:" and ",in:"in"},"bn-chart":{},"bn-table":{category:" ",operation:" ",there_of:"there of",part_of:"in % of",SUM_TOTAL:"❖",REST:"REST"}}),d=Object.keys(f||{}),p={_system:{de:f,en:c}},b=new WeakMap;function h(e){let t=b.get(e);return t||(t={datasources:r({}),datasets:r({}),datasetsMeta:r({}),componentStyles:r({_system:a}),internationalization:r(Object.assign({},p)),assets:r({}),context:r({locale:"en"})},b.set(e,t)),t}const u=new WeakMap;function _(e){const t=u.get(e);if(t)return t;const n=function(e){var t;let n=e.parentNode;for(;n;){if(n instanceof HTMLElement&&"bn-context"===(null===(t=n.nodeName)||void 0===t?void 0:t.toLowerCase()))return n;if(n.parentNode)n=n.parentNode;else{if(!(n instanceof ShadowRoot))break;n=n.host}}}(e);if(!n)throw new Error(`[bn] <${e.localName}> must be inside a <bn-context>. No ancestor <bn-context> found.`);const o=h(n);return u.set(e,o),o}function y(e){u.delete(e)}export{d as B,l as a,h as b,y as c,s as f,_ as g}
1
+ import*as e from"@stencil/core/internal/client";const t=(()=>{let e;return(...t)=>{e&&clearTimeout(e),e=setTimeout((()=>{e=0,(e=>{for(let t of e.keys()){const o=e.get(t).filter((e=>{const t=e.deref();return t&&(!("isConnected"in(o=t))||o.isConnected);var o}));e.set(t,o)}})(...t)}),2e3)}})(),o=e.forceUpdate,n=e.getRenderingRef,i=(e,t)=>{const o=e.indexOf(t);o>=0&&(e[o]=e[e.length-1],e.length--)},r=(e,r)=>{const a=((e,t=(e,t)=>e!==t)=>{const o=()=>{return("function"==typeof(t=e)?t():t)??{};var t},n=o();let r=new Map(Object.entries(n));const a="undefined"!=typeof Proxy,s=a?null:{},l={dispose:[],get:[],set:[],reset:[]},c=new Map,f=()=>{r=new Map(Object.entries(o())),a||_(),l.reset.forEach((e=>e()))},d=e=>(l.get.forEach((t=>t(e))),r.get(e)),p=(e,o)=>{const n=r.get(e);t(o,n,e)&&(r.set(e,o),a||u(e),l.set.forEach((t=>t(e,o,n))))},b=a?new Proxy(n,{get:(e,t)=>d(t),ownKeys:()=>Array.from(r.keys()),getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0}),has:(e,t)=>r.has(t),set:(e,t,o)=>(p(t,o),!0)}):(_(),s),h=(e,t)=>(l[e].push(t),()=>{i(l[e],t)});function u(e){!a&&s&&(Object.prototype.hasOwnProperty.call(s,e)||Object.defineProperty(s,e,{configurable:!0,enumerable:!0,get:()=>d(e),set(t){p(e,t)}}))}function _(){if(a||!s)return;const e=new Set(r.keys());for(const t of Object.keys(s))e.has(t)||delete s[t];for(const t of e)u(t)}return{state:b,get:d,set:p,on:h,onChange:(e,t)=>{const n=(o,n)=>{o===e&&t(n)},i=()=>{const n=o();t(n[e])},r=h("set",n),a=h("reset",i);return c.set(t,{setHandler:n,resetHandler:i,propName:e}),()=>{r(),a(),c.delete(t)}},use:(...e)=>{const t=e.reduce(((e,t)=>(t.set&&e.push(h("set",t.set)),t.get&&e.push(h("get",t.get)),t.reset&&e.push(h("reset",t.reset)),t.dispose&&e.push(h("dispose",t.dispose)),e)),[]);return()=>t.forEach((e=>e()))},dispose:()=>{l.dispose.forEach((e=>e())),f()},reset:f,forceUpdate:e=>{const t=r.get(e);l.set.forEach((o=>o(e,t,t)))},removeListener:(e,t)=>{const o=c.get(t);o&&o.propName===e&&(i(l.set,o.setHandler),i(l.reset,o.resetHandler),c.delete(t))}}})(e,r);return a.use((()=>{if("function"!=typeof n||"function"!=typeof o)return{};const e=o,i=n,r=new Map;return{dispose:()=>r.clear(),get:e=>{const t=i();t&&((e,t,o)=>{let n=e.get(t);n||(n=[],e.set(t,n)),n.some((e=>e.deref()===o))||n.push(new WeakRef(o))})(r,e,t)},set:o=>{const n=r.get(o);if(n){const t=n.filter((t=>{const o=t.deref();return!!o&&e(o)}));r.set(o,t)}t(r)},reset:()=>{r.forEach((t=>{t.forEach((t=>{const o=t.deref();o&&e(o)}))})),t(r)}}})()),a},a={global:{fontFamily:"'Noto Sans', sans-serif",fontSizePx:13.3333,fontColor:"#000000",fontBackgroundColor:"#ffffff"},"bn-text":{},"bn-chart-time":{scaleFactors:{scenarioOffset:.3,scenarioLabelToColumn:.3,labelToColumn:.3,labelToAxis:.3,needleWidth:.3,needleHeadWidth:.6,columnWidth:2,varianceAxisLineWidth:.3,axisLineWidth:.1,auxiliaryLineWidth:.1,scenarioLineWidth:.2,markerWidth:.7,markerOffset:0,categoryWidth:3,axisTickLength:.3},axisStyles:{ac:{stroke:"#121212",fill:"#121212",width:.1},fc:{stroke:"#121212",fill:"#ffffff",width:.1,dasharray:"10 5 5 5"},pp:{stroke:"#606060",fill:"#606060",width:.1},pl:{stroke:"#121212",fill:"#ffffff",width:.1}},barStyles:{ac:{stroke:"#404040",fill:"#404040",width:.1},fc:{stroke:"#404040",fill:"#ffffff",width:.5,fillpattern:"fc"},pp:{stroke:"#A6A6A6",fill:"#A6A6A6",width:.1},pl:{stroke:"#404040",fill:"#ffffff",width:.1}},varianceStyles:{pos:{stroke:"#008f96",fill:"#008f96",width:.1},neg:{stroke:"#ff0000",fill:"#ff0000",width:.1},neu:{stroke:"#808080",fill:"#808080",width:.1}},stackColors:["#000000","#c0c0c0","#808080"],padding:{top:10,left:10,right:10,bottom:10}},"bn-chart-structure":{scaleFactors:{scenarioOffset:.3,scenarioLabelToBar:.1,labelToBar:.3,labelToAxis:.3,needleWidth:.3,needleHeadWidth:.6,barWidth:1.2,varianceAxisLineWidth:.3,axisLineWidth:.1,auxiliaryLineWidth:.1,scenarioLineWidth:.2,markerWidth:.7,markerOffset:0,categoryWidth:1.9,axisTickLength:.3},axisStyles:{ac:{stroke:"#121212",fill:"#121212",width:.1},fc:{stroke:"#121212",fill:"#ffffff",width:.1,dasharray:"10 5 5 5"},pp:{stroke:"#606060",fill:"#606060",width:.1},pl:{stroke:"#121212",fill:"#ffffff",width:.1}},barStyles:{ac:{stroke:"#404040",fill:"#404040",width:.1},fc:{stroke:"#404040",fill:"#ffffff",width:.5,fillpattern:"fc"},pp:{stroke:"#A6A6A6",fill:"#A6A6A6",width:.1},pl:{stroke:"#404040",fill:"#ffffff",width:.1}},varianceStyles:{pos:{stroke:"#008f96",fill:"#008f96",width:.1},neg:{stroke:"#ff0000",fill:"#ff0000",width:.1},neu:{stroke:"#808080",fill:"#808080",width:.1}},stackColors:["#000000","#c0c0c0","#808080"],padding:{top:10,left:10,right:10,bottom:10}},"bn-tree":{edgeColor:"#404040",edgeWidth:1,operatorCircleRadius:10,operatorFontSizeScale:.9,operatorColor:"#404040"},"bn-grid":{headerBackground:"transparent",borderColor:"#A6A6A6",borderWidth:1,cellPadding:4}};function s(e,t,o=null){o=o||{},t=t?t+".":"";for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&("object"==typeof e[n]&&null!==e[n]?s(e[n],t+n,o):o[t+n]=e[n]);return o}const l=["ORDER_asc","ORDER_desc","ac1","pp1","fc1","pl1","ac2","pp2","fc2","pl2","ac3","pp3","fc3","pl3","ac4","pp4","fc4","pl4","ibcssymbol_delta_ac","ibcssymbol_delta_generic","ibcssymbol_delta_ac_relative","ibcssymbol_delta_generic_relative"],c=s({global:{ac1:"AC",pp1:"PY",fc1:"FC",pl1:"PL",ac2:"AC2",pp2:"PY2",fc2:"FC2",pl2:"PL2",ac3:"AC3",pp3:"PY3",fc3:"FC3",pl3:"PL3",ac4:"AC4",pp4:"PY4",fc4:"FC4",pl4:"PL4",ORDER_asc:"↑",ORDER_desc:"↓",ibcssymbol_delta_ac:"Δ{%}",ibcssymbol_delta_generic:"Δ({%})",ibcssymbol_delta_ac_relative:"Δ{%}%",ibcssymbol_delta_generic_relative:"Δ({%})%"},"bn-title":{SEPERATOR_WS:", ",CONNECTOR_WS:" und ",in:"in"},"bn-chart":{},"bn-table":{in:"in",category:" ",operation:" ",there_of:"davon",part_of:"in % von",SUM_TOTAL:"❖",REST:"REST"}}),f=s({global:{ac1:"AC",pp1:"PY",fc1:"FC",pl1:"PL",ac2:"AC2",pp2:"PY2",fc2:"FC2",pl2:"PL2",ac3:"AC3",pp3:"PY3",fc3:"FC3",pl3:"PL3",ac4:"AC4",pp4:"PY4",fc4:"FC4",pl4:"PL4",ORDER_asc:"↑",ORDER_desc:"↓",ibcssymbol_delta_ac:"Δ{%}",ibcssymbol_delta_generic:"Δ({%})",ibcssymbol_delta_ac_relative:"Δ{%}%",ibcssymbol_delta_generic_relative:"Δ({%})%"},"bn-title":{SEPERATOR_WS:", ",CONNECTOR_WS:" and ",in:"in"},"bn-chart":{},"bn-table":{category:" ",operation:" ",there_of:"there of",part_of:"in % of",SUM_TOTAL:"❖",REST:"REST"}}),d=Object.keys(c||{}),p={_system:{de:c,en:f}},b=new WeakMap;function h(e){let t=b.get(e);return t||(t={datasources:r({}),datasets:r({}),datasetsMeta:r({}),componentStyles:r({_system:a}),internationalization:r(Object.assign({},p)),assets:r({}),context:r({locale:"en"})},b.set(e,t)),t}const u=new WeakMap;function _(e){const t=u.get(e);if(t)return t;const o=function(e){var t;let o=e.parentNode;for(;o;){if(o instanceof HTMLElement&&"bn-context"===(null===(t=o.nodeName)||void 0===t?void 0:t.toLowerCase()))return o;if(o.parentNode)o=o.parentNode;else{if(!(o instanceof ShadowRoot))break;o=o.host}}}(e);if(!o)throw new Error(`[bn] <${e.localName}> must be inside a <bn-context>. No ancestor <bn-context> found.`);const n=h(o);return u.set(e,n),n}function y(e){u.delete(e)}export{d as B,l as a,h as b,y as c,s as f,_ as g}
@@ -0,0 +1 @@
1
+ function a(a){for(var c,e=0,r=0,s=a.length;s>=4;++r,s-=4)c=1540483477*(65535&(c=255&a.charCodeAt(r)|(255&a.charCodeAt(++r))<<8|(255&a.charCodeAt(++r))<<16|(255&a.charCodeAt(++r))<<24))+(59797*(c>>>16)<<16),e=1540483477*(65535&(c^=c>>>24))+(59797*(c>>>16)<<16)^1540483477*(65535&e)+(59797*(e>>>16)<<16);switch(s){case 3:e^=(255&a.charCodeAt(r+2))<<16;case 2:e^=(255&a.charCodeAt(r+1))<<8;case 1:e=1540483477*(65535&(e^=255&a.charCodeAt(r)))+(59797*(e>>>16)<<16)}return(((e=1540483477*(65535&(e^=e>>>13))+(59797*(e>>>16)<<16))^e>>>15)>>>0).toString(36)}export{a as m}