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

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 (198) 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-3b4c7425.entry.js +1 -0
  7. package/dist/bn-template-engine/p-4426d484.entry.js +1 -0
  8. package/dist/bn-template-engine/p-51f8dc9e.entry.js +1 -0
  9. package/dist/bn-template-engine/p-53d4e690.entry.js +1 -0
  10. package/dist/bn-template-engine/p-5KQYRQLK.js +1 -0
  11. package/dist/bn-template-engine/p-7337e03d.entry.js +1 -0
  12. package/dist/bn-template-engine/{p-0f1504f3.entry.js → p-75e97c87.entry.js} +1 -1
  13. package/dist/bn-template-engine/p-7a560278.entry.js +1 -0
  14. package/dist/bn-template-engine/p-BYBpC0EO.js +1 -0
  15. package/dist/bn-template-engine/p-BfXY5dsy.js +1 -0
  16. package/dist/bn-template-engine/p-BgnHJQ9Q.js +1 -0
  17. package/dist/bn-template-engine/{p-B4ySv9KQ.js → p-Bhd_WSML.js} +1 -1
  18. package/dist/bn-template-engine/p-Bka-Z6jo.js +1 -0
  19. package/dist/bn-template-engine/p-Bnhh02CF.js +1 -0
  20. package/dist/bn-template-engine/p-C7dQL8CS.js +1 -0
  21. package/dist/bn-template-engine/p-CL1RYuNU.js +1 -0
  22. package/dist/bn-template-engine/p-CYwd_ZNM.js +1 -0
  23. package/dist/bn-template-engine/p-ChlK-T9I.js +1 -0
  24. package/dist/bn-template-engine/p-DHezf8pZ.js +1 -0
  25. package/dist/bn-template-engine/{p-DVMu6dEy.js → p-DlppAFq9.js} +1 -1
  26. package/dist/bn-template-engine/p-DvDDgmcV.js +1 -0
  27. package/dist/bn-template-engine/p-DvvwfRQG.js +1 -0
  28. package/dist/bn-template-engine/{p-DG-1MR_T.js → p-P7pGJBgc.js} +1 -1
  29. package/dist/bn-template-engine/p-abc0067c.entry.js +1 -0
  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} +1074 -30
  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 +981 -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/Label.js +11 -0
  82. package/dist/collection/components/bn-chart-structure/utils/elements/StackedBar.js +8 -6
  83. package/dist/collection/components/bn-chart-structure/utils/model/styles/StructureChartStyle.js +4 -0
  84. package/dist/collection/components/bn-chart-time/bn-chart-time.js +28 -4
  85. package/dist/collection/components/bn-chart-time/utils/TimeChart.js +3 -3
  86. package/dist/collection/components/bn-chart-time/utils/elements/StackedColumn.js +3 -4
  87. package/dist/collection/components/bn-chart-time/utils/model/styles/TimeChartStyle.js +4 -0
  88. package/dist/collection/components/bn-dataset/bn-dataset.js +49 -2
  89. package/dist/collection/components/bn-datasource/bn-datasource.js +46 -3
  90. package/dist/collection/components/bn-table/bn-table.js +20 -21
  91. package/dist/collection/components/bn-table/ibcs-table.js +2 -2
  92. package/dist/collection/components/bn-table/utils/elements/CellBarChart.js +58 -41
  93. package/dist/collection/stores/componentStyles.js +2 -0
  94. package/dist/collection/utils/constants.js +8 -5
  95. package/dist/collection/utils/contentDecoder.js +28 -0
  96. package/dist/collection/utils/stackColors.js +2 -2
  97. package/dist/collection/utils/validate.js +1 -1
  98. package/dist/components/DataFormatDigits.js +1 -1
  99. package/dist/components/Order.js +1 -1
  100. package/dist/components/SVGVariancesStyleGroup.js +1 -1
  101. package/dist/components/bn-chart-structure.js +1 -1
  102. package/dist/components/bn-chart-time.js +1 -1
  103. package/dist/components/bn-dataset.js +1 -1
  104. package/dist/components/bn-datasource.js +1 -1
  105. package/dist/components/bn-table.js +1 -1
  106. package/dist/components/contentDecoder.js +1 -0
  107. package/dist/components/context-protocol.js +1 -1
  108. package/dist/components/emotion-hash.esm.js +1 -0
  109. package/dist/components/ibcs-chart-structure2.js +1 -1
  110. package/dist/components/ibcs-chart-time2.js +1 -1
  111. package/dist/components/ibcs-table2.js +1 -1
  112. package/dist/components/ibcs-title2.js +1 -1
  113. package/dist/components/ibcsRuleSet.js +1 -1
  114. package/dist/components/validate.js +1 -1
  115. package/dist/components/withStyled.js +1 -1
  116. package/dist/esm/{DataFormatDigits--qIbKvXa.js → DataFormatDigits-oSZ1hBKE.js} +1 -1
  117. package/dist/esm/{DateStringFactory-XWdUjsn8.js → DateStringFactory-CSGz6TDk.js} +1 -1
  118. package/dist/esm/{Order-sqjrku2z.js → Order-Bnhh02CF.js} +9 -6
  119. package/dist/esm/{SVGVariancesStyleGroup-ibg3sLjM.js → SVGVariancesStyleGroup-CqTjrZYg.js} +2 -13
  120. package/dist/esm/bn-asset.entry.js +5 -4
  121. package/dist/esm/bn-body_4.entry.js +11 -9
  122. package/dist/esm/bn-card.entry.js +5 -4
  123. package/dist/esm/{ibcs-chart-structure.entry.js → bn-chart-structure_5.entry.js} +1064 -24
  124. package/dist/esm/bn-chart-time.entry.js +38 -12
  125. package/dist/esm/bn-component-style.entry.js +5 -4
  126. package/dist/esm/bn-dataset.entry.js +35 -6
  127. package/dist/esm/bn-grid.entry.js +9 -7
  128. package/dist/esm/bn-image.entry.js +9 -7
  129. package/dist/esm/bn-internationalization.entry.js +5 -4
  130. package/dist/esm/bn-layout-card.entry.js +3 -2
  131. package/dist/esm/bn-layout-page.entry.js +2 -1
  132. package/dist/esm/bn-message.entry.js +5 -4
  133. package/dist/esm/bn-table.entry.js +979 -0
  134. package/dist/esm/bn-template-engine.js +1 -1
  135. package/dist/esm/bn-template.entry.js +3 -2
  136. package/dist/esm/bn-text.entry.js +11 -9
  137. package/dist/esm/bn-tree.entry.js +9 -7
  138. package/dist/esm/contentDecoder-oMmxz6nJ.js +416 -0
  139. package/dist/esm/{context-protocol-Bz5klD-F.js → context-protocol-BHnQsVsr.js} +2 -0
  140. package/dist/esm/editor-companion.entry.js +1 -1
  141. package/dist/esm/emotion-hash.esm-BYBpC0EO.js +55 -0
  142. package/dist/esm/ibcs-chart-time.entry.js +15 -11
  143. package/dist/esm/{bn-context_5.entry.js → ibcs-table.entry.js} +69 -1236
  144. package/dist/esm/{StringAdapter-BCLJpQQ8.js → ibcsRuleSet-K4ytuA1f.js} +10 -10
  145. package/dist/esm/index-DHezf8pZ.js +65 -0
  146. package/dist/esm/loader.js +1 -1
  147. package/dist/esm/{scaling-C6K8FYSF.js → scaling-Cehc74IE.js} +2 -2
  148. package/dist/esm/{withHasError-B3QX2emi.js → utils-DvvwfRQG.js} +1 -69
  149. package/dist/esm/{withBodyObserver-DczL5ia8.js → withBodyObserver-FQ8NwCIz.js} +1 -1
  150. package/dist/esm/{withComponentStatus-DodoSXe-.js → withComponentStatus-DWjDYtZ7.js} +1 -1
  151. package/dist/esm/{withComponentStyle-BerJY64r.js → withComponentStyle-9uP_hcDq.js} +2 -2
  152. package/dist/esm/withHasError-FyY5mQ_3.js +70 -0
  153. package/dist/esm/{withStyled-D1fAWJ3g.js → withStyled--qQWquTH.js} +6 -59
  154. package/dist/esm/{withTranslation-mimbJdER.js → withTranslation-BqD0Kp7b.js} +2 -2
  155. package/dist/types/components/bn-chart-structure/bn-chart-structure.d.ts +155 -109
  156. package/dist/types/components/bn-chart-structure/utils/StructureChart.d.ts +7 -0
  157. package/dist/types/components/bn-chart-structure/utils/elements/Label.d.ts +2 -0
  158. package/dist/types/components/bn-chart-structure/utils/model/styles/StructureChartStyle.d.ts +1 -0
  159. package/dist/types/components/bn-chart-time/utils/model/styles/TimeChartStyle.d.ts +1 -0
  160. package/dist/types/components/bn-dataset/bn-dataset.d.ts +6 -0
  161. package/dist/types/components/bn-datasource/bn-datasource.d.ts +8 -0
  162. package/dist/types/components/bn-table/bn-table.d.ts +10 -8
  163. package/dist/types/components/bn-table/utils/elements/CellBarChart.d.ts +0 -2
  164. package/dist/types/components.d.ts +102 -38
  165. package/dist/types/stores/componentStyles.d.ts +2 -0
  166. package/dist/types/utils/constants.d.ts +8 -5
  167. package/dist/types/utils/contentDecoder.d.ts +12 -0
  168. package/package.json +2 -1
  169. package/dist/bn-template-engine/p-05a82a77.entry.js +0 -1
  170. package/dist/bn-template-engine/p-1970906d.entry.js +0 -1
  171. package/dist/bn-template-engine/p-1dbd339c.entry.js +0 -1
  172. package/dist/bn-template-engine/p-2e68cf09.entry.js +0 -1
  173. package/dist/bn-template-engine/p-31cc6a2d.entry.js +0 -1
  174. package/dist/bn-template-engine/p-37881d05.entry.js +0 -1
  175. package/dist/bn-template-engine/p-3b894997.entry.js +0 -1
  176. package/dist/bn-template-engine/p-50e49732.entry.js +0 -1
  177. package/dist/bn-template-engine/p-6c7c0455.entry.js +0 -1
  178. package/dist/bn-template-engine/p-6da93eae.entry.js +0 -1
  179. package/dist/bn-template-engine/p-701e1578.entry.js +0 -1
  180. package/dist/bn-template-engine/p-8tsCnxIz.js +0 -1
  181. package/dist/bn-template-engine/p-997b2fe4.entry.js +0 -1
  182. package/dist/bn-template-engine/p-BL8gyUwE.js +0 -1
  183. package/dist/bn-template-engine/p-BSfqOkN_.js +0 -1
  184. package/dist/bn-template-engine/p-CRLgp9-v.js +0 -1
  185. package/dist/bn-template-engine/p-CYjZRKdI.js +0 -1
  186. package/dist/bn-template-engine/p-DRikHQE-.js +0 -1
  187. package/dist/bn-template-engine/p-DtdQCMzj.js +0 -1
  188. package/dist/bn-template-engine/p-a90f1cbe.entry.js +0 -1
  189. package/dist/bn-template-engine/p-b7bec050.entry.js +0 -1
  190. package/dist/bn-template-engine/p-d7f0cbaf.entry.js +0 -1
  191. package/dist/bn-template-engine/p-dfb61aa5.entry.js +0 -1
  192. package/dist/bn-template-engine/p-ece17f84.entry.js +0 -1
  193. package/dist/bn-template-engine/p-f27995c9.entry.js +0 -1
  194. package/dist/bn-template-engine/p-fd427179.entry.js +0 -1
  195. package/dist/bn-template-engine/p-sqjrku2z.js +0 -1
  196. package/dist/bn-template-engine/p-tzFCK9qn.js +0 -1
  197. package/dist/cjs/bn-chart-structure.cjs.entry.js +0 -700
  198. package/dist/esm/bn-chart-structure.entry.js +0 -698
@@ -1 +1 @@
1
- import{h as t,proxyCustomElement as e,HTMLElement as o,Host as n,transformTag as s}from"@stencil/core/internal/client";import{F as r,Q as i,V as a,I as l,S as c}from"./ibcsRuleSet.js";import{I as h,D as u,i as d,j as p,k as f,e as m,M as $}from"./Order.js";import{a as v}from"./alasql.min.js";import{D as g,S as R,a as w,b}from"./DataFormatDigits.js";import{w as S}from"./withComponentStyle.js";var E,O,y,M,U;!function(t){t[t.ALL=-1]="ALL"}(E||(E={})),function(t){t[t.UP_TO_DATE=0]="UP_TO_DATE",t[t.DIRTY=1]="DIRTY"}(O||(O={})),function(t){t.LIST="list",t.SUM="sum",t.SUMNOTOTAL="sumnototal",t.OPT="opt",t.OPTNOTOTAL="optnototal"}(y||(y={})),function(t){t.ASC="asc",t.DESC="desc"}(M||(M={})),function(t){t.HEADER="HEADER",t.GROUPHEAD="GROUPHEAD",t.SEPERATORLINE="SEPERATORLINE",t.SUM="SUM",t.GROUPSUM="GROUP_SUM",t.DRILLELEMENT="DRILLELEMENT",t.STANDARD="STANDARD",t.PARTELEMENT="PARTELEMENT",t.ENTRY="ENTRY"}(U||(U={}));class G{constructor(t,e,o,n,s,r,i,a,l){this.prefixStyle="prefix",this.isBarChart=!1,this.key=t,this.index=e,this.value=o,this.prefix=r||"",this.cssStyle=n||"",this.prefixStyle=i||"prefix",this.type=s,this.mark=void 0,this.colSpan=a||1,this.measureScale=l||1}getAsHeaderList(){if(null==this.value)return[""];const t=[];for(const e of this.value.toString().split("<br/>"))t.push(e);return t}draw(t){let e=this.value;if("undefined"===e||void 0===e||null==e)return"";if(Number.isNaN(Number(e)))return e;if(""===this.type||void 0===this.type||null==this.type)return e;let o=t.percent,n=t.percent;return"decimal"===this.type&&(e=+e/this.measureScale,o=t.decimal,n=t.decimal),r.number(Number(e),this.type,o,n)}drawPrefix(){return null==this.prefix?"":this.prefix}}class T{constructor(t,e,o){this.index=t,this.groupindex=e,this.type=o,this.cssStyle=this.initCssStyle(),this.elements=[]}initCssStyle(){switch(this.type){case U.HEADER:return"groupheader";case U.SEPERATORLINE:return"";case U.DRILLELEMENT:return"ofit";case U.PARTELEMENT:return"partof";case U.STANDARD:return"";case U.SUM:return"sum";default:return""}}getCells(){return this.elements}createElement(t,e,o,n,s,r,i,a,l,c=!1,h){let u=r;"category"===e&&null!=a&&(u=`category-${a.toString()}`),this.type===U.HEADER?u="headerlabel":this.type===U.SEPERATORLINE&&(u=e),this.type===U.PARTELEMENT&&("percent"===n&&(t="-"),"category"!==e&&"operation"!==e&&(n="percent",u="")),"-"===t&&(u="");let d="prefix-first";i&&(d="prefix-second"),o&&(u=`${u} ${o}`);const p=new G(e,this.elements.length,t,u,n,s,d,1,l);p.isBarChart=c,p.columnStats=h,this.elements.push(p)}}const _={positive:{stroke:"#008f96",fill:"#008f96",fillpattern:"solid"},negative:{stroke:"#ff0000",fill:"#ff0000",fillpattern:"solid"},neutral:{stroke:"#808080",fill:"#808080",fillpattern:"outlined"},scenarios:{ac:{stroke:"#404040",fill:"#404040",fillpattern:"solid"},pp:{stroke:"#A6A6A6",fill:"#A6A6A6",fillpattern:"solid"},fc:{stroke:"#404040",fill:"#ffffff",fillpattern:"hatched"},pl:{stroke:"#404040",fill:"#ffffff",fillpattern:"outlined"}},fontColor:"#000000",fontSize:11,fontFamily:"'Noto Sans', sans-serif",unitScaling:.01,percentageScaling:.5,scaleFactor:1},C="#666666";function N(t,e){return`pattern-${t}-${e.replace("#","")}`}const L=({styles:e})=>{const o=e.scaleFactor,n=6*o,s=[{id:N("pos",e.positive.stroke),stroke:e.positive.stroke,fill:e.positive.fill},{id:N("neg",e.negative.stroke),stroke:e.negative.stroke,fill:e.negative.fill},{id:N("neu",e.neutral.stroke),stroke:e.neutral.stroke,fill:e.neutral.fill}];return t("defs",null,s.map((e=>t("pattern",{id:e.id,patternUnits:"userSpaceOnUse",width:n,height:n},t("rect",{width:n,height:n,fill:"#ffffff"}),t("line",{x1:"0",y1:n,x2:n,y2:"0",stroke:e.stroke,"stroke-width":1.5*o})))))};function P(t,e,o=1){let n,s;const r=t>=0?"+":"";if(e)return n=100*t,r+Math.round(n).toString()+"%";{let e;return n=t/o,s=Math.abs(n),e=s>=1e9?(n/1e9).toFixed(s>=1e10?0:1)+"B":s>=1e6?(n/1e6).toFixed(s>=1e7?0:1)+"M":s>=1e3?(n/1e3).toFixed(s>=1e4?0:1)+"K":n.toFixed(s>=10?0:1),e=e.replace(/\.0([KMB]?)$/,"$1"),r+e}}function x(t){const e=t.slice(0,2).toLowerCase();return["ac","pp","fc","pl"].includes(e)}function A(t){const e=t.slice(0,2).toLowerCase();return"pp"===e?"pp":"fc"===e?"fc":"pl"===e?"pl":"ac"}function D(t,e,o,n){return x(t)?function(t,e){const o=A(t);return e.scenarios[o]}(t,n):function(t,e,o){const n=t>=0;return e?n?o.positive:o.negative:n?o.negative:o.positive}(e,o,n)}function k(t){return t.median<=0?t.absMax:Math.min(3*t.median,t.absMax)}const B=e=>{const{value:o,scenario:n,columnStats:s,height:r,isPositiveGood:i,formattedValue:a,measureScale:l,maxBarWidth:c=3,styles:h=_}=e,u=h.scaleFactor,d=38*u,p=c*h.fontSize*u,f=s.min<0,m=s.max>0,$=f?p:0,v=(f?d:0)+($+(m?p:0))+(m?d:0),g=2*u,R=r-2*g,w=(f?d:0)+$,b=k(s),S=Math.abs(o),E=S>b,O=Math.min(b>0?S/b:0,1)*p,y=o>=0,M=y?w:w-O,U=g,G=D(n,o,i,h),T=function(t,e){const o=t.fillpattern;return"hatched"===o?`url(#${N(e,t.stroke)})`:"outlined"===o?"transparent":t.fill}(G,x(n)?A(n):i?y?"pos":"neg":y?"neg":"pos"),{stroke:B,strokeWidth:F}="outlined"===(Y=G).fillpattern?{stroke:Y.stroke,strokeWidth:1.5}:{stroke:"none",strokeWidth:0};var Y;const W=a||P(o,!1,l),H=y?w+O+4*u:w-O-4*u,I=y?"start":"end",z=r/2;return t("svg",{width:v,height:r,class:"cell-bar-chart absolute-variance",style:{overflow:"visible"}},t(L,{styles:h}),t("line",{x1:w,y1:0,x2:w,y2:r,stroke:C,"stroke-width":1*u}),O>0&&t("rect",{x:M,y:U,width:O,height:R,fill:T,stroke:B,"stroke-width":F*u}),E&&y&&t("polygon",{points:`${w+p},${z} ${w+p-6*u},${z-3*u} ${w+p-6*u},${z+3*u}`,fill:"transparent"===G.fill?G.stroke:G.fill}),E&&!y&&t("polygon",{points:`${w-p},${z} ${w-p+6*u},${z-3*u} ${w-p+6*u},${z+3*u}`,fill:"transparent"===G.fill?G.stroke:G.fill}),t("text",{x:H,y:r/2,dy:"0.35em","text-anchor":I,fill:h.fontColor,"font-size":h.fontSize,"font-family":h.fontFamily},W))},F=e=>{const{value:o,scenario:n,columnStats:s,height:r,isPositiveGood:i,formattedValue:a,measureScale:l,maxBarWidth:c=3,styles:h=_}=e,u=h.scaleFactor,d=Math.round(.67*c*h.fontSize)*u,p=5*u,f=s.min<0?d+p:0,m=f+(s.max>0?d+p:0),$=m+45*u,v=f,g=r/2,R=k(s),w=Math.abs(o),b=w>R,S=Math.min(R>0?w/R:0,1)*d,E=o>=0,O=E?v+S:v-S,y=D(n,o,i,h),M=3*u,U=a||P(o,!0,l),G=m+4*u;return t("svg",{width:$,height:r,class:"cell-bar-chart relative-variance",style:{overflow:"visible"}},t("line",{x1:v,y1:0,x2:v,y2:r,stroke:C,"stroke-width":1*u}),!b&&t("circle",{cx:O,cy:g,r:M,fill:h.fontColor}),t("line",{x1:v,y1:g,x2:O,y2:g,stroke:y.fill,"stroke-width":2*u}),b&&E&&t("polygon",{points:`${v+d},${g} ${v+d-6*u},${g-3*u} ${v+d-6*u},${g+3*u}`,fill:y.fill}),b&&!E&&t("polygon",{points:`${v-d},${g} ${v-d+6*u},${g-3*u} ${v-d+6*u},${g+3*u}`,fill:y.fill}),t("text",{x:G,y:r/2,dy:"0.35em","text-anchor":"start",fill:h.fontColor,"font-size":h.fontSize,"font-style":"italic","font-family":h.fontFamily},U))},Y=e=>{const{value:o,columnStats:n,isRelative:s,styles:r=_}=e;return null==o||isNaN(o)||!n||0===n.absMax?t("span",{class:"bar-chart-empty",style:{color:r.fontColor,fontStyle:"italic"}},"-"):t(s?F:B,Object.assign({},e))};class W{constructor(t){v.fn.transformOperator=function(t){return"-"===t?-1:1},this.groups=[i.CATEGORY,i.CATEGORYINDEX],y.OPT!==t.type&&y.OPTNOTOTAL!==t.type||this.groups.unshift(i.OPERATION),t.grouped&&(this.groups.push(i.ROWGROUP),this.groups.push(i.ROWGROUPINDEX))}toString(){return this.groups.map((t=>`${t}`)).toString()}noCategory(){return this.groups.filter((t=>t!==i.CATEGORY))}toArray(){return this.groups}}class H{constructor(t,e){this.hasPartOf=!1,this.config=t,this.i18n=e}execute(t){if(0===t.length)return[];const e=[],o=[],n=[],s=this.config.scenarios.map((t=>this.translateScenarioSQL(t,!1,this.config.type))).toString(),r=this.config.scenarios.map((t=>this.translateScenarioSQL(t,!0,this.config.type))).toString(),a=this.getRelativeScenarios(),l=new W(this.config),c=this.config.grouped?[i.ROWGROUP,i.ROWGROUPINDEX]:[];let h=["",""];return this.config.sortOrder.hierarchy.length>0&&(h=this.createOrderString(this.config.sortOrder)),this.hasPartOf=this.checkConfigForPartOf(),v(`SELECT COUNT(DISTINCT ${i.CATEGORY}) as ${i.TOTALROWCOUNT} ${c.length>0?","+c:""}\n FROM ? ${c.length>0?"GROUP BY "+c:""} \n ORDER BY ${h[0]}`,[t]).forEach((t=>{const n=t.rowGroup&&t.rowGroup.length>0?`WHERE ${i.ROWGROUP} = '${t.rowGroup}'`:"";let a="";this.config.limit&&(a=`LIMIT ${this.config.limit}`),this.createGroupHeaderRow(t,e),this.createDataRow(e,t,l,s,n,h,a),this.createRestRow(t,e,l,s,n,h),this.createGroupSumRow(e,o,t,r,h)})),this.createTotalSumRow(e,o,r),e.forEach((e=>{try{n.push(v(e,[t]))}catch(t){console.error("DataQuery: SQL query execution failed",e,t)}})),this.detectNaNCells(this.config.scenarios,n),this.createThereOfDrillRows(s,h,t,n),this.createPartOfDrillRows(s,h,o,t,n),this.createThereOfDrillColumns(this.config.categoryThereOf,t,n),this.calculateColumnGroupRest(n,this.config.categoryThereOf),this.calculateRelativeVariances(n,a),n}detectNaNCells(t,e){e.forEach((e=>{e.map((e=>(t.forEach((t=>{const o=new a(t);!0===o.isValid?0!==e[o.base+"_cnt"]&&0!==e[o.delta+"_cnt"]||(e[t]=Number.NaN):0===e[t+"_cnt"]&&(e[t]=Number.NaN)})),e)))}))}createPartOfDrillRows(t,e,o,n,s){if(null==this.config.partOf||0===this.config.partOf.length||this.config.type===y.LIST||null==n||0===n.length)return;const r=this.createPartOfQuery(t,e);let a=[];r.forEach((function(t){a.push(...v(t,[n]))}));const l=this.exctractScenarioNames(t),c=[];o.forEach((function(t){c.push(...v(t,[n]))}));const h=new Map;c.forEach((t=>h.set(t[i.ROWGROUP],t))),a=this.reduceResDrillByCategoryGroups(a,l),a.forEach((function(t){l.forEach((e=>{try{t[e]=t[e]/h.get(t[i.ROWGROUP])[e]}catch(o){console.error("DataQuery: partOf drill row calculation failed",e,o),t[e]=Number.NaN}}))})),this.injectDrillRowsToResultRows(a,s)}createRestRow(t,e,o,n,s,r){t.totalRowCnt-this.config.limit>0&&0!==this.config.limit&&e.push(`SELECT ${i.ROWNR}, 1 as ${i.ROWGROUPINDEX} , 'ENTRY' as ${i.TYPE}, 'NO_GROUP' as ${i.ROWGROUP}, 'REST' as ${i.CATEGORY} , SUM(ac1) as ac1, SUM(pp1) as pp1, SUM(dpp1_ac1_pos) as dpp1_ac1_pos, SUM(drpp1_ac1_pos) as drpp1_ac1_pos, SUM(dr_pp1) as dr_pp1 FROM (SELECT ROWNUM() AS ${i.ROWNR}, ${e.length} as ${i.ROWGROUPINDEX} , 'ENTRY' as ${i.TYPE}, '${t.rowGroup||"NO_GROUP"}' as ${i.ROWGROUP}, ${o} ${n.length>0?",".concat(n):""} FROM ? ${s} GROUP BY ${o} ORDER BY ${r[0]}) t WHERE t.rowNr > ${this.config.limit}`)}createDataRow(t,e,o,n,s,r,a){t.push(`SELECT ROWNUM() AS ${i.ROWNR},\n ${t.length} as ${i.ROWGROUPINDEX},\n 'ENTRY' as ${i.TYPE},\n '${e.rowGroup||"NO_GROUP"}' as ${i.ROWGROUP},\n '${i.CATEGORYINDEX}',\n ${o} ${n.length>0?",".concat(n):""}\n FROM ? ${s}\n GROUP BY ${o}\n ORDER BY ${r[0]} ${a}`)}createGroupHeaderRow(t,e){!0===this.config.grouped&&e.push(`SELECT ROWNUM() AS ${i.ROWNR},\n ${e.length} as ${i.ROWGROUPINDEX},\n 'GROUPHEAD' as ${i.TYPE},\n '${t.rowGroup}' as ${i.ROWGROUP} ${this.config.showGroupTitle?`,'${t.rowGroup}' as ${i.CATEGORY}`:""}\n FROM ?\n GROUP BY '1'`)}createGroupSumRow(t,e,o,n,s){!0!==this.config.grouped||y.SUM!==this.config.type&&y.SUMNOTOTAL!==this.config.type&&y.OPT!==this.config.type&&y.OPTNOTOTAL!==this.config.type||(t.push(`SELECT ${t.length} as ${i.ROWGROUPINDEX},\n '=' as ${i.OPERATION},\n '${o.rowGroup}' as ${i.ROWGROUP},\n ROWNUM() AS ${i.ROWNR},\n 'GROUP_SUM' as ${i.TYPE} ${n.length>0?",".concat(n):""}\n FROM ?\n WHERE ${i.ROWGROUP} = '${o.rowGroup}'\n ORDER BY ${s[0]} `),e.push(`SELECT ${t.length} as ${i.ROWGROUPINDEX},\n '=' as ${i.OPERATION},\n '${o.rowGroup}' as ${i.ROWGROUP},\n ROWNUM() AS ${i.ROWNR},\n 'GROUP_SUM' as ${i.TYPE} ${n.length>0?",".concat(n):""}\n FROM ?\n WHERE ${i.ROWGROUP} = '${o.rowGroup}'\n ORDER BY ${s[0]} `))}createTotalSumRow(t,e,o){if(y.SUM===this.config.type||y.OPT===this.config.type){const e=`${this.hasPartOf&&!1===this.config.grouped?`${this.i18n.get("SUM_TOTAL")||"SUM_TOTAL"} `:""}${this.config.title}`;t.push(`SELECT ${t.length} as ${i.ROWGROUPINDEX},\n '${e}' as ${i.ROWGROUP},\n '=' as ${i.OPERATION},\n 'SUM' as ${i.TYPE} ${o.length>0?",".concat(o):""}\n FROM ? `)}e.push(`SELECT ${t.length} as ${i.ROWGROUPINDEX},\n 'SUM_TOTAL' as ${i.ROWGROUP},\n '=' as ${i.OPERATION},\n 'SUM' as ${i.TYPE} ${o.length>0?",".concat(o):""}\n FROM ? `)}reduceResDrillByCategoryGroups(t,e){const o=new Map;return t.forEach((function(t){const n=t.rowNr+t.rowGroup+t.type+t.category;if(o.has(n)){const s=o.get(n);e.forEach((e=>{try{s[e]+=t[e]}catch(t){console.error("DataQuery: drill row aggregation failed",e,t)}}))}else o.set(n,t)})),[...o.values()]}injectDrillRowsToResultRows(t,e){const o=new Map;if(!0===this.config.grouped)t.forEach((function(t){e.forEach((function(e){const n=e.findIndex((e=>e.category===t.category&&e.rowGroup===t.rowGroup));if(n>=0){if(o.has(`${t.category}_${t.rowGroup}`)){const e=o.get(`${t.category}_${t.rowGroup}`)||0;o.set(`${t.category}_${t.rowGroup}`,e+1)}else o.set(`${t.category}_${t.rowGroup}`,1);t[i.ROWNR]=o.get(`${t.category}_${t.rowGroup}`),e.splice(n+t[i.ROWNR],0,t)}}))}));else{const n=this.findDuplicateSubCategories(t);t.forEach((function(t){e.forEach((function(e){const s=e.findIndex((e=>null!=e.category&&e.category===t.category));if(s>=0){if(o.has(`${t.category}`)){const e=o.get(`${t.category}`)||0;o.set(`${t.category}`,e+1)}else o.set(`${t.category}`,1);(1===t[i.ROWNR]||n.includes(t.subCategory))&&(t.subCategory=`${t.subCategory} (${t.rowGroup})`),e.splice(s+t[i.ROWNR],0,t)}}))}))}}createThereOfDrillRows(t,e,o,n){if(void 0===this.config.thereOf||0===this.config.thereOf.length)return;const s=[],r=[];this.config.thereOf.forEach((o=>{let n=!0,r="1 <> 1 OR ( ";null!=o.category&&0!==o.category.length&&o.category.trim()&&(r+=` ${i.CATEGORY} = '${o.category}'`,n=!1),null!=o.rowGroup&&0!==o.rowGroup.length&&o.rowGroup.trim()&&(r+=` ${n?"":"AND"} ${i.ROWGROUP} = '${o.rowGroup}'`,n=!1),null!=o.subCategory&&0!==o.subCategory.length&&o.subCategory.trim()&&(r+=` ${n?"":"AND"} ${i.SUBCATEGORY} = '${o.subCategory}'`),r+=")",s.push(`SELECT ROWNUM() AS ${i.ROWNR},\n null as operation,\n 'DRILLELEMENT' as ${i.TYPE},\n ${i.CATEGORY},\n ${i.SUBCATEGORY},\n ${i.ROWGROUP} as ${i.ROWGROUP},\n ${t}\n FROM ?\n WHERE ${r}\n GROUP BY ${i.ROWGROUP}, ${i.CATEGORY}, ${i.SUBCATEGORY}\n ORDER BY ${e[1]}`)})),s.forEach((function(t){r.push(...v(t,[o]))})),this.injectDrillRowsToResultRows(r,n)}calculateRelativeVariances(t,e){t.forEach((t=>{t.forEach((t=>{"GROUPHEAD"!==t[i.TYPE]&&e.forEach(((e,o)=>{t[o]=t[o]/t[e]}))}))}))}calculateColumnGroupRest(t,e){if(null==e||0===e.size)return;const o=new Map,n=new Map;e.forEach(((t,e)=>{const s=t,r=[];for(const t of s)r.push(`${e}##${t.name}`);o.set(e,r),n.set(`${e}##REST`,!1)})),t.forEach((t=>{t.forEach((t=>{"GROUPHEAD"!==t[i.TYPE]&&o.forEach(((e,o)=>{let s=0;e.forEach((e=>{void 0!==t[e]&&(s+=t[e])})),t[`${o}##REST`]=t[o]-s,0!==t[`${o}##REST`]&&n.set(`${o}##REST`,!0)}))}))}));const s=Array.from(n.entries()).filter((([t,e])=>!e)).map((([t])=>t));t.forEach((t=>{t.forEach((t=>{for(const e of s)delete t[e]}))}))}getRelativeScenarios(){const t=new Map;return this.config.scenarios.forEach((e=>{const o=this.createRelativeScenario(e);null!=o&&t.set(o.key,o.value)})),t}translateScenarioSQL(t,e,o){const n=new a(t);return y.OPT===o||y.OPTNOTOTAL===o?n.isValid?"dr"===n.type?`SUM(${n.base} - ${n.delta}) as ${t}, SUM(${n.delta}) as dr_${n.delta}`:`SUM(${n.base} - ${n.delta}) as ${t}`:e?`SUM(${t} * transformOperator(operation)) as ${t}, COUNT(ISNULL(${t})) as ${t}_cnt`:`SUM(${t}) as ${t}, COUNT(ISNULL(${t})) as ${t}_cnt`:n.isValid?"dr"===n.type?`SUM((${n.base} * transformOperator(operation)) - (${n.delta} * transformOperator(operation))) as ${t}, SUM(${n.delta} * transformOperator(operation)) as dr_${n.delta}`:`SUM((${n.base} * transformOperator(operation))- (${n.delta} * transformOperator(operation))) as ${t}`:`SUM(${t} * transformOperator(operation)) as ${t}, COUNT(ISNULL(${t})) as ${t}_cnt`}createOrderString(t){return[`${t.hierarchy.toString()} ${t.direction}`,`${t.hierarchy.toString()} ${M.ASC===t.direction?M.DESC:M.ASC}`]}createRelativeScenario(t){const e=new a(t);return e.isValid&&"dr"===e.type?{key:`${t}`,value:`dr_${e.delta}`}:null}exctractScenarioNames(t){const e=[];return t.split(",").forEach((t=>t.length>=2?e.push(t.split("as")[1].trim()):null)),e}findDuplicateSubCategories(t){const e=t.map((t=>({count:1,subCategory:t.subCategory}))).reduce(((t,e)=>(t[e.subCategory]=(t[e.subCategory]||0)+e.count,t)),{});return Object.keys(e).filter((t=>e[t]>1))}createPartOfQuery(t,e){var o;const n=[];let s="1 <> 1 ",r=` ${i.ROWGROUP}`,a="ROWNUM()";return null===(o=this.config.partOf)||void 0===o||o.forEach((t=>{s+=`OR (${i.CATEGORY} = '${t.category}'`,null!=t.rowGroup&&0!==t.rowGroup.length&&t.rowGroup.trim()&&(s+=`and ${i.ROWGROUP} = '${t.rowGroup}'`),!1===this.config.grouped&&(r=` 'SUM_TOTAL' as ${i.ROWGROUP} `,a="1"),s+=")"})),n.push(`SELECT ${a} AS ${i.ROWNR},\n 'PARTELEMENT' as ${i.TYPE},\n ${i.CATEGORY},\n ${r},\n ${t}\n FROM ?\n WHERE ${s}\n GROUP BY ${i.ROWGROUP}, ${i.CATEGORY}, ${i.TYPE}\n ORDER BY ${e[1]}`),n}checkConfigForPartOf(){return null!=this.config.partOf&&0!==this.config.partOf.length}createThereOfDrillColumns(t,e,o){if(null==t||0===t.size)return;const n=[],s=[];t.forEach(((t,e)=>{let o="1 <> 1 ";t.forEach((t=>{o+=` or columnGroup = '${t.name}' `})),n.push(`SELECT 'ENTRY' as rowlevel,\n 'COLUMNGROUP' as columnlevel,\n rowGroup,\n category,\n columnGroup,\n '${e}' as scenario,\n sum(${e} * transformOperator(operation)) as val\n FROM ?\n WHERE ${o}\n GROUP BY rowlevel, rowGroup, category, columnGroup, scenario`),n.push(`SELECT 'ENTRY' as rowlevel,\n 'SUBGROUP' as columnlevel,\n rowGroup,\n category,\n columnGroup,\n columnSubGroup,\n '${e}' as scenario,\n sum(${e} * transformOperator(operation)) as val\n FROM ?\n WHERE ${o}\n GROUP BY rowlevel, rowGroup, category, columnGroup, columnSubGroup, scenario`),n.push(`SELECT 'DRILLELEMENT' as rowlevel,\n 'COLUMNGROUP' as columnlevel,\n rowGroup,\n category,\n subCategory,\n columnGroup,\n '${e}' as scenario,\n sum(${e} * transformOperator(operation)) as val\n FROM ?\n WHERE ${o}\n GROUP BY rowlevel, rowGroup, category, subCategory, columnGroup, scenario`),n.push(`SELECT 'DRILLELEMENT' as rowlevel,\n 'SUBGROUP' as columnlevel,\n rowGroup,\n category,\n subCategory,\n columnGroup,\n columnSubGroup,\n '${e}' as scenario,\n sum(${e} * transformOperator(operation)) as val\n FROM ?\n WHERE ${o}\n GROUP BY rowlevel, rowGroup, category, subCategory, columnGroup, columnSubGroup, scenario`),n.push(`SELECT 'GROUP_SUM' as rowlevel,\n 'COLUMNGROUP' as columnlevel,\n rowGroup,\n columnGroup,\n '${e}' as scenario,\n sum(${e} * transformOperator(operation)) as val\n FROM ?\n WHERE ${o}\n GROUP BY rowlevel, rowGroup, columnGroup, scenario`),n.push(`SELECT 'GROUP_SUM' as rowlevel,\n 'SUBGROUP' as columnlevel,\n rowGroup,\n columnGroup,\n columnSubGroup,\n '${e}' as scenario,\n sum(${e} * transformOperator(operation)) as val\n FROM ?\n WHERE ${o}\n GROUP BY rowlevel, rowGroup, columnGroup, columnSubGroup, scenario`),n.push(`SELECT 'SUM' as rowlevel,\n 'COLUMNGROUP' as columnlevel,\n columnGroup,\n '${e}' as scenario,\n sum(${e} * transformOperator(operation)) as val\n FROM ?\n WHERE ${o}\n GROUP BY rowlevel, columnGroup, scenario`),n.push(`SELECT 'SUM' as rowlevel,\n 'SUBGROUP' as columnlevel,\n columnGroup,\n columnSubGroup,\n '${e}' as scenario,\n sum(${e} * transformOperator(operation)) as val\n FROM ?\n WHERE ${o}\n GROUP BY rowlevel, columnGroup, columnSubGroup, scenario`)}));for(const t of n)s.push(...v(t,[e]));this.injectDrillColumnsToResultRows(s,o)}injectDrillColumnsToResultRows(t,e){const o="##";for(const n of t)for(const t of e)for(const e of t)e.type===n.rowlevel&&("ENTRY"===n.rowlevel?"COLUMNGROUP"===n.columnlevel&&e.category===n.category?e[n.scenario+o+n.columnGroup]=n.val:"SUBGROUP"===n.columnlevel&&e.category===n.category&&(e[n.scenario+o+n.columnGroup+o+n.columnSubGroup]=n.val):"DRILLELEMENT"===n.rowlevel?"COLUMNGROUP"===n.columnlevel&&e.category===n.category&&e.subCategory===n.subCategory?e[n.scenario+o+n.columnGroup]=n.val:"SUBGROUP"===n.columnlevel&&e.category===n.category&&e.subCategory===n.subCategory?e[n.scenario+o+n.columnGroup+o+n.columnSubGroup]=n.val:"COLUMNGROUP"===n.columnlevel&&e.category===n.category&&e.subCategory===`${n.subCategory} (${n.rowGroup})`?e[n.scenario+o+n.columnGroup]=n.val:"SUBGROUP"===n.columnlevel&&e.category===n.category&&e.subCategory===`${n.subCategory} (${n.rowGroup})`&&(e[n.scenario+o+n.columnGroup+o+n.columnSubGroup]=n.val):("SUM"===n.rowlevel||"GROUP_SUM"===n.rowlevel)&&("COLUMNGROUP"===n.columnlevel&&e.category===n.category&&e.subCategory===n.subCategory&&(e[n.scenario+o+n.columnGroup]=n.val),"SUBGROUP"===n.columnlevel&&e.category===n.category&&e.subCategory===n.subCategory&&(e[n.scenario+o+n.columnGroup+o+n.columnSubGroup]=n.val)))}}class I{constructor(){this.normalizedHeader=[]}createHeader(t,e,o,n,s,i){const a=[];this.normalizedHeader=this.normalizeHeader(t,e);const l=new T(0,0,U.HEADER),c=new T(1,0,U.SEPERATORLINE);for(const t of this.normalizedHeader)l.createElement(r.translateScenarioLabel(t.name,o),t.type,this.createColumnType(t),null,this.setHeaderPrefix(t,o,n,s,i),null,null,null,null),c.createElement(null,t.type,this.createColumnType(t),null,null,null,null,null,null);return a.push(l),a.push(c),a}setHeaderPrefix(t,e,o,n,s){let i="";return"category"===t.name&&s&&(0===o.prefix.length&&0===n.length||(i=r.translateScenarioLabel("in",e)+" "+o.prefix+n)),t.order&&(i+=r.translateScenarioLabel("ORDER_"+t.order,e)),i}normalizeHeader(t,e){let o=[{name:i.CATEGORY,group:i.CATEGORY,type:i.CATEGORY,order:void 0}];return y.OPT!==t&&y.OPTNOTOTAL!==t||(o=[{name:i.OPERATION,group:i.OPERATION,type:i.OPERATION,order:void 0},{name:i.CATEGORY,group:i.CATEGORY,type:i.CATEGORY,order:void 0}]),[...o,...e]}createBodyRows(t,e,o){const n=[];let s=-1;const r=new H(t,e).execute(o),i=this.calculateColumnStatistics(r,t.barColumns);for(const o of r)s+=1,n.push(...this.createRow(t.i18n,e,t.scenariosUnitType,o,s,-1,t.categoryWidth,t.measureScale,t.barColumns,i));return n}calculateColumnStatistics(t,e){const o=new Map;if(!e||0===e.length)return o;const n=new Map;for(const t of e)o.set(t,{min:1/0,max:-1/0,absMax:0,median:0}),n.set(t,[]);for(const s of t)for(const t of s)for(const s of e){const e=this.extractColumnValue(t,s);if(null!==e&&!isNaN(e)){const t=o.get(s);t.min=Math.min(t.min,e),t.max=Math.max(t.max,e),n.get(s).push(Math.abs(e))}}for(const[t,e]of o){e.min!==1/0&&e.max!==-1/0||(e.min=0,e.max=0),e.absMax=Math.max(Math.abs(e.min),Math.abs(e.max));const s=n.get(t);if(s.length>0){s.sort(((t,e)=>t-e));const t=Math.floor(s.length/2);e.median=s.length%2==0?(s[t-1]+s[t])/2:s[t]}o.set(t,e)}return o}extractColumnValue(t,e){if(void 0!==t[e]){const o=Number(t[e]);return isNaN(o)?null:o}for(const o of Object.keys(t))if(o===e||o.endsWith("##"+e)||o===e+"##"+e){const e=Number(t[o]);if(!isNaN(e))return e}return null}createRow(t,e,o,n,s,r,a,l,c,h){var u;const d=[];for(const p of n){const f=p[i.ROWGROUP],m=p[i.SUBCATEGORY],$=p[i.TYPE],v=p[i.ROWNR]>=2,g=this.createDetailRow($,r+=1,s,n.length);for(const n of this.normalizedHeader){const s=this.getRawDataRowElement(p,n),r=null!==(u=null==c?void 0:c.includes(n.type))&&void 0!==u&&u,i=r?null==h?void 0:h.get(n.type):void 0;g.createElement(this.translateSumCellLabel(t,e,s,f,m,$,n.type),n.type,this.createColumnType(n),this.setCellType(n.type,o),this.translateCellPrefix(e,$,n.type),this.translateScenarioCSS(n.type,s),v,a,null==l?void 0:l.value,r,i)}d.push(g)}return d}getRawDataRowElement(t,e){return e.name===e.group&&e.name===e.type?t[e.name]:e.name===e.group&&e.name!==e.type?t[e.type+"##"+e.name]:t[e.type+"##"+e.group+"##"+e.name]}createDetailRow(t,e,o,n){switch(t){case U.GROUPHEAD:return new T(e,o,U.HEADER);case U.SUM:case U.GROUPSUM:return new T(n+2,o,U.SUM);case U.DRILLELEMENT:return new T(n+2,o,U.DRILLELEMENT);case U.PARTELEMENT:return new T(n+2,o,U.PARTELEMENT);default:return new T(e,o,U.STANDARD)}}translateSumCellLabel(t,e,o,n,s,r,i){return!1===Number.isNaN(Number(o))||this.isOperationColumn(i)?o:this.isGroupHeadCategory(r,i)||this.isEntryCategory(r,i)?t===h.ALL?`${e.get(o)||o}`:o:this.isDrillElementCategory(r,i)?t===h.ALL?`${e.get(s)||s}`:`${s}`:this.isPartElementCategory(r,i)?t===h.ALL||"SUM_TOTAL"===n?`${e.get(n)||n}`:`${n}`:this.isSumElementCategory(r,i)?t===h.ALL||"SUM_TOTAL"===n?`${e.get(n)||n}`:n:"GROUPHEAD"===r&&null==o?o:Number.isNaN(Number(o))?"-":Number(o)}isOperationColumn(t){return"operation"===t}translateScenarioCSS(t,e){const o=new a(t);let n="pos";return e<0&&(n="neg"),o.isValid?n+"_"+o.direction+("dr"===o.type?" relative_variance":""):t}setCellType(t,e){if("category"===t)return"";let o;const n=new a(t);return e===u.PERCENT?(o="percent",n.isValid&&"d"===n.type&&(o="decimal")):(o="decimal",n.isValid&&"dr"===n.type&&(o="percent")),o}isDrillElementCategory(t,e){return"DRILLELEMENT"===t&&"category"===e}isPartElementCategory(t,e){return"PARTELEMENT"===t&&"category"===e}isSumElementCategory(t,e){return("GROUP_SUM"===t||"SUM"===t)&&"category"===e}isEntryCategory(t,e){return"ENTRY"===t&&"category"===e}isGroupHeadCategory(t,e){return"GROUPHEAD"===t&&"category"===e}translateCellPrefix(t,e,o){return this.isOperationColumn(o)||this.isGroupHeadCategory(e,o)||this.isEntryCategory(e,o)?null:this.isDrillElementCategory(e,o)?`${t.get("there_of")} `:this.isPartElementCategory(e,o)?`${t.get("part_of")} `:null}createColumnType(t){return t.name===t.group&&t.name===t.type?"base":t.name===t.group?"columnGroup":"columnSubGroup"}}class z{constructor(t,e,o){this.data=[],this.headerRows=[],this.bodyRows=[],this.ruleSet=t||new l,this.dataSetFactory=new I,this.config=this.initConfig(o),this.i18n=this.initI18n(new Map),this.setData(e,o.filter),this.state=O.DIRTY}setI18n(t){this.i18n=this.initI18n(t)}initI18n(t){const e=new Map([["",""],["SEPERATOR_WS",", "],["in","in"],["ORDER_asc","↑"],["ORDER_desc","↓"],["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"],["in","in"],["category"," "],["operation"," "],["there_of","davon"],["part_of","in % von"],["ibcssymbol_delta_ac","Δ{%}"],["ibcssymbol_delta_generic","Δ({%})"],["ibcssymbol_delta_ac_relative","Δ{%}%"],["ibcssymbol_delta_generic_relative","Δ({%})%"],["SUM_TOTAL","❖"]]);return this.state=O.DIRTY,new Map([...e,...t||new Map])}initConfig(t){this.state=O.DIRTY;const e=t,o=this;return t.scenarios.sort(((t,e)=>o.ruleSet.getScenarioSorIndex(t)-o.ruleSet.getScenarioSorIndex(e))),e}setConfig(t){this.config=this.initConfig(t)}setData(t,e){if(null==t)return;if(null!=e&&e.length>0)try{this.data=v(`SELECT * FROM ? WHERE ${e}`,[t])}catch(o){console.error("Table: filter query failed, using unfiltered data",e,o),this.data=t}else this.data=t;const o=this.normalizeScenarios(this.config.scenarios,this.config.categoryThereOf,this.config.sortOrder);this.headerRows=this.dataSetFactory.createHeader(this.config.type,o,this.i18n,this.config.measureScale,this.config.measureUnit,this.config.showMeasureScale),this.bodyRows=this.dataSetFactory.createBodyRows(this.config,this.i18n,this.data),this.state=O.UP_TO_DATE}update(){const t=this.normalizeScenarios(this.config.scenarios,this.config.categoryThereOf,this.config.sortOrder);this.headerRows=this.dataSetFactory.createHeader(this.config.type,t,this.i18n,this.config.measureScale,this.config.measureUnit,this.config.showMeasureScale),this.bodyRows=this.dataSetFactory.createBodyRows(this.config,this.i18n,this.data),this.state=O.UP_TO_DATE}getHeader(){return this.state===O.DIRTY&&this.update(),this.headerRows}getBody(){return this.state===O.DIRTY&&this.update(),this.bodyRows}normalizeScenarios(t,e,o){var n;const s=[];for(const r of t){if(null==e?void 0:e.has(r)){const t=e.get(r);for(const e of t){s.push({name:e.name,group:e.name,type:r,order:void 0});for(const t of e.subGroups)s.push({name:t,group:e.name,type:r,order:void 0})}s.push({name:"REST",group:"REST",type:r,order:void 0})}let t;(null===(n=null==o?void 0:o.hierarchy)||void 0===n?void 0:n.at(0))===r&&(t=o.direction),s.push({name:r,group:r,type:r,order:t})}return s}hasNoData(){return 0===this.data.length}}class j{constructor(){this.title="",this.scenarios=[],this.scenariosUnitType=u.DECIMAL,this.grouped=!1,this.showGroupTitle=!0,this.thereOf=[],this.categoryThereOf=new Map,this.partOf=[],this.sortOrder=new f(new c).default(),this.type=y.LIST,this.limit=0,this.i18n=h.ALL,this.categoryWidth=m.W25,this.measureScale=new R,this.measureUnit="",this.measureType=$.VOLUME,this.showMeasureScale=!0,this.filter="",this.barColumns=[]}}class V{constructor(t,e,o,n){this.tableDrillGroupAdapter=t,this.stringAdapter=e,this.orderAdapter=o,this.dataSet=n}adapt(t){const e=new j;return d.isString(t.title)&&(e.title=t.title),d.isArray(t.scenarios)&&(e.scenarios=p.adaptArray(t.scenarios,this.stringAdapter)),d.isExisting(t.scenariosUnitType)&&(e.scenariosUnitType=t.scenariosUnitType),d.isBoolean(t.grouped)&&(e.grouped=t.grouped),d.isBoolean(t.showGroupTitle)&&(e.showGroupTitle=t.showGroupTitle),d.isBoolean(t.showMeasureScale)&&(e.showMeasureScale=t.showMeasureScale),d.isArray(t.thereOf)&&(e.thereOf=p.adaptArray(t.thereOf,this.tableDrillGroupAdapter)),d.isExisting(t.categoryThereOf)&&(e.categoryThereOf=t.categoryThereOf),d.isArray(t.partOf)&&(e.partOf=p.adaptArray(t.partOf,this.tableDrillGroupAdapter)),d.isExisting(t.order)&&(e.sortOrder=this.orderAdapter.adapt(t.order)),d.isExisting(t.type)&&(e.type=t.type),d.isNumber(t.limit)&&(e.limit=t.limit),d.isExisting(t.i18n)&&(e.i18n=t.i18n),d.isExisting(t.categoryWidth)&&(e.categoryWidth=t.categoryWidth),d.isExisting(t.measureScale)&&(e.measureScale=g.calculateMeasureScale(this.dataSet,e.scenarios,t.measureScale)),d.isExisting(t.measureType)&&(e.measureType=t.measureType),d.isString(t.measureUnit)&&(e.measureUnit=t.measureUnit),d.isString(t.filter)&&(e.filter=t.filter.trim()),d.isArray(t.barColumns)&&(e.barColumns=t.barColumns),e}default(){return new j}}class Q{constructor(){this.rowGroup="",this.category="",this.subCategory="",this.partOf=""}}class q{constructor(){}adapt(t){const e=new Q;return d.isString(t.rowGroup)&&(e.rowGroup=t.rowGroup),d.isString(t.category)&&(e.category=t.category),d.isString(t.subCategory)&&(e.subCategory=t.subCategory),d.isString(t.partOf)&&(e.partOf=t.partOf),e}default(){return new Q}}class K{constructor(){this.operation="+"}addRowGroup(t,e){this.rowGroup=t,this.rowGroupIndex=e}addCategory(t,e){this.category=t,this.categoryIndex=e}addSubCategory(t,e){this.subCategory=t,this.subCategoryIndex=e}addColumnGroup(t,e){this.columnGroup=t,this.columnGroupIndex=e}addSubColumnGroup(t,e){this.columnSubGroup=t,this.columnSubGroupIndex=e}}class J{constructor(){}adapt(t){const e=new K;return d.isOperator(t.operation)&&(e.operation=t.operation),d.isNumber(t.rowGroupIndex)&&d.isString(t.rowGroup)&&e.addRowGroup(t.rowGroup,t.rowGroupIndex),d.isNumber(t.categoryIndex)&&d.isString(t.category)&&e.addCategory(t.category,t.categoryIndex),d.isNumber(t.subCategoryIndex)&&d.isString(t.subCategory)&&e.addSubCategory(t.subCategory,t.subCategoryIndex),d.isNumber(t.columnGroupIndex)&&d.isString(t.columnGroup)&&e.addColumnGroup(t.columnGroup,t.columnGroupIndex),d.isNumber(t.columnSubGroupIndex)&&d.isString(t.columnSubGroup)&&e.addSubColumnGroup(t.columnSubGroup,t.columnSubGroupIndex),this.setActualValues(t,e),this.setPlanValues(t,e),this.setPreviousPeriodValues(t,e),this.setForecastValues(t,e),e}default(){return new K}setActualValues(t,e){d.isNumber(t.ac1)&&(e.ac1=t.ac1),d.isNumber(t.ac2)&&(e.ac2=t.ac2),d.isNumber(t.ac3)&&(e.ac3=t.ac3),d.isNumber(t.ac4)&&(e.ac4=t.ac4)}setPlanValues(t,e){d.isNumber(t.pp1)&&(e.pp1=t.pp1),d.isNumber(t.pp2)&&(e.pp2=t.pp2),d.isNumber(t.pp3)&&(e.pp3=t.pp3),d.isNumber(t.pp4)&&(e.pp4=t.pp4)}setPreviousPeriodValues(t,e){d.isNumber(t.pl1)&&(e.pl1=t.pl1),d.isNumber(t.pl2)&&(e.pl2=t.pl2),d.isNumber(t.pl3)&&(e.pl3=t.pl3),d.isNumber(t.pl4)&&(e.pl4=t.pl4)}setForecastValues(t,e){d.isNumber(t.fc1)&&(e.fc1=t.fc1),d.isNumber(t.fc2)&&(e.fc2=t.fc2),d.isNumber(t.fc3)&&(e.fc3=t.fc3),d.isNumber(t.fc4)&&(e.fc4=t.fc4)}}const X=e(class extends o{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.data=[],this.tableTitle="SUM_TOTAL",this.scenarios=[],this.scenariosDataFormat=u.DECIMAL,this.grouped=!1,this.limit=0,this.showGroupTitle=!0,this.thereof=[],this.partof=[],this.order={hierarchy:[],direction:M.ASC},this.categorythereof=new Map,this.type=y.LIST,this.categoryWidth=m.INF,this.dataFormatDigits={percent:2,decimal:1},this.i18n=new Map,this.i18nMode=h.ALL,this.measureScale="_",this.measureUnit="",this.showMeasureScale=!0,this.measureType=$.VOLUME,this.filter="",this.barColumns=[],this.barColumnMaxWidth=30,this.unitScaling=.01,this.percentageScaling=.5,this.scaleFactor=1,this.componentDataFormatDigits=new w,this.componentStyle=S(this)}render(){return t(n,null,(()=>{if(void 0!==this.table){if(this.table.hasNoData()){const e=this.i18n.get("NO_DATA")||"==No Data==";return t("p",{class:"warning"},e)}return t("table",null,t("thead",null,this.table.getHeader().map((e=>t("tr",{class:e.cssStyle},e.getCells().map((e=>t("th",{colSpan:e.colSpan,class:e.cssStyle},e.getAsHeaderList().map(((o,n,s)=>t("span",null,n===s.length-1?t("span",{class:" "===o?"table-footer":""},o,e.drawPrefix()," "):t("span",null,o,e.drawPrefix(),t("br",null)))))))))))),t("tbody",null,this.table.getBody().map((e=>t("tr",{class:e.cssStyle},null==e?void 0:e.getCells().map((e=>t("td",{colSpan:e.colSpan,class:e.type?`${e.cssStyle} ${e.type}`:e.cssStyle},null!=e.prefix?t("span",{class:e.cssStyle+" "+e.prefixStyle},e.drawPrefix()):"",e.isBarChart&&e.columnStats?t(Y,{value:e.value,scenario:e.key,columnStats:e.columnStats,height:18*this.scaleFactor,isRelative:e.key.startsWith("dr"),isPositiveGood:e.key.endsWith("_pos"),measureScale:e.measureScale,maxBarWidth:this.barColumnMaxWidth,styles:this.barChartStyles}):e.draw(this.componentDataFormatDigits)))))))))}})())}componentWillRender(){const t=this.prepareConfig(),e=this.prepareData();this.componentDataFormatDigits=(new b).adapt(this.dataFormatDigits),this.barChartStyles=this.prepareBarChartStyles(),this.table=new z(new l,e,t),this.table.setI18n(this.i18n)}prepareConfig(){return new V(new q,new c,new f(new c),this.data).adapt({title:this.tableTitle,scenarios:this.scenarios,scenariosUnitType:this.scenariosDataFormat,grouped:this.grouped,showGroupTitle:this.showGroupTitle,thereOf:this.thereof,partOf:this.partof,categoryThereOf:this.categorythereof,order:this.order,type:this.type,limit:this.limit,i18n:this.i18nMode,categoryWidth:this.categoryWidth,measureScale:this.measureScale,measureUnit:this.measureUnit,measureType:this.measureType,showMeasureScale:this.showMeasureScale,filter:this.filter,barColumns:this.barColumns})}prepareData(){return p.adaptArray(this.data,new J)}prepareBarChartStyles(){return this.componentStyle((t=>{var e,o,n,s,r,i,a,l,c,h,u,d,p,f,m,$,v,g,R,w,b,S,E,O,y,M;const U=null===(e=t["bn-chart-time"])||void 0===e?void 0:e.varianceStyles,G=null===(o=t["bn-chart-time"])||void 0===o?void 0:o.barStyles;return{positive:{stroke:(null===(n=null==U?void 0:U.pos)||void 0===n?void 0:n.stroke)||"#008f96",fill:(null===(s=null==U?void 0:U.pos)||void 0===s?void 0:s.fill)||"#008f96",fillpattern:(null===(r=null==U?void 0:U.pos)||void 0===r?void 0:r.fillpattern)||"solid"},negative:{stroke:(null===(i=null==U?void 0:U.neg)||void 0===i?void 0:i.stroke)||"#ff0000",fill:(null===(a=null==U?void 0:U.neg)||void 0===a?void 0:a.fill)||"#ff0000",fillpattern:(null===(l=null==U?void 0:U.neg)||void 0===l?void 0:l.fillpattern)||"solid"},neutral:{stroke:(null===(c=null==U?void 0:U.neu)||void 0===c?void 0:c.stroke)||"#808080",fill:(null===(h=null==U?void 0:U.neu)||void 0===h?void 0:h.fill)||"#808080",fillpattern:(null===(u=null==U?void 0:U.neu)||void 0===u?void 0:u.fillpattern)||"outlined"},scenarios:{ac:{stroke:(null===(d=null==G?void 0:G.ac)||void 0===d?void 0:d.stroke)||"#404040",fill:(null===(p=null==G?void 0:G.ac)||void 0===p?void 0:p.fill)||"#404040",fillpattern:(null===(f=null==G?void 0:G.ac)||void 0===f?void 0:f.fillpattern)||"solid"},pp:{stroke:(null===(m=null==G?void 0:G.pp)||void 0===m?void 0:m.stroke)||"#A6A6A6",fill:(null===($=null==G?void 0:G.pp)||void 0===$?void 0:$.fill)||"#A6A6A6",fillpattern:(null===(v=null==G?void 0:G.pp)||void 0===v?void 0:v.fillpattern)||"solid"},fc:{stroke:(null===(g=null==G?void 0:G.fc)||void 0===g?void 0:g.stroke)||"#404040",fill:(null===(R=null==G?void 0:G.fc)||void 0===R?void 0:R.fill)||"#ffffff",fillpattern:(null===(w=null==G?void 0:G.fc)||void 0===w?void 0:w.fillpattern)||"hatched"},pl:{stroke:(null===(b=null==G?void 0:G.pl)||void 0===b?void 0:b.stroke)||"#404040",fill:(null===(S=null==G?void 0:G.pl)||void 0===S?void 0:S.fill)||"#ffffff",fillpattern:(null===(E=null==G?void 0:G.pl)||void 0===E?void 0:E.fillpattern)||"outlined"}},fontColor:(null===(O=t.global)||void 0===O?void 0:O.fontColor)||"#000000",fontSize:.85*((null===(y=t.global)||void 0===y?void 0:y.fontSizePx)||13.3333)*this.scaleFactor,fontFamily:(null===(M=t.global)||void 0===M?void 0:M.fontFamily)||"'Noto Sans', sans-serif",unitScaling:this.unitScaling,percentageScaling:this.percentageScaling,scaleFactor:this.scaleFactor}}))}get element(){return this}static get style(){return':host{position:relative;display:inline-block}table{background-color:var(--bn-font-background, white);font-size:var(--bn-font-size, 1em);color:var(--bn-font-color, black);font-family:var(--bn-font-family, "Noto Sans", "Helvetica Neue", Helvetica, sans-serif);border-spacing:0.3em 0}thead{border-style:none}tr:first-child td{border-top:none;padding-top:0.5em}td.ac1,td.ac2,td.ac3,td.ac4,td.pp1,td.pp2,td.pp3,td.pp4,td.pl1,td.pl2,td.pl3,td.pl4,td.fc1,td.fc2,td.fc3,td.fc4,td.share,td.variance,td.pos_pos,td.pos_neg,td.neg_pos,td.neg_neg,td.pos_neutral,td.neg_neutral{text-align:right}.category-w100{min-width:100em;max-width:100em}.category-w50{min-width:50em;max-width:50em}.category-w25{min-width:25em;max-width:25em}.category-w20{min-width:20em;max-width:20em}.category-w15{min-width:15em;max-width:15em}.category-w10{min-width:10em;max-width:10em}.category-w5{min-width:5em;max-width:5em}.prefix-second{color:transparent;font-style:normal}.prefix-first{font-style:normal}th{border-bottom:0.1em solid black;text-align:right;font-weight:normal;vertical-align:text-top}td.columnGroup,th.columnGroup{font-size:0.6em}td.columnSubGroup,th.columnSubGroup{font-size:0.6em;border-spacing:0em 0;font-style:italic}td.base,th.base{font-style:normal}th.ofit,td.ofit,tr.ofit,th.partof,td.partof,tr.partof{font-size:0.6em;font-style:italic}td.ofit,td.partof{font-size:0.6em;font-style:italic}th.ofit td,tr.ofit td,th.partof td,tr.partof td{border-top:0em solid black;padding-left:1em}th.ofit share,th.partof share,tr.share td{border-top:0em solid black}th.share,tr.share,td.share{font-size:0.6em;font-style:italic}th.filler{border-bottom:0em solid black;text-align:right}td.filler{border-top:0em none !important;border-bottom:0em none;text-align:right}th.group{text-align:center;border-spacing:1em 0}th.headerlabel{border-bottom:0em none black;padding-bottom:0em}td.variance:after{content:"%"}td.relative_variance{font-style:italic}td.percent{font-style:italic;text-align:right}td.decimal{text-align:right}td.pos_pos{color:#008f96}td.neg_pos{color:#ff0000}td.pos_neg{color:#ff0000}td.neg_neg{color:#008f96}td.pos_pos:before{content:"+"}td.pos_neg:before{content:"+"}td.pos_neu:before{content:"+"}th.ac1,th.ac2,th.ac3,th.ac4{padding-top:0em;border-bottom:0.3em solid black}th.pp1,th.pp2,th.pp3,th.pp4{padding-top:0em;border-bottom:0.3em solid grey}th.pl1,th.pl2,th.pl3,th.pl4{padding-top:0em;border-bottom:0.3em double black}th.fc1,th.fc2,th.fc3,th.fc4{border-bottom:0.3em solid;border-image:repeating-linear-gradient(-45deg, white, white, black, white, white 0.3em) 2}td.colsum{font-weight:bold}th.colsum{padding-top:0em;font-weight:bold}tr.sum td{border-top:0.1em solid black;font-weight:bold;padding-bottom:0.5em}tr.groupheader td{border-top:0em dotted #ddd;padding-top:0.5em;font-weight:bold;font-style:italic}tr.begingroup td{border-top:0em dotted #ddd;padding-top:0.5em}th.begin-group{padding-left:0.75em}th.end-group{padding-left:0.75em}td{box-sizing:border-box;-webkit-box-sizing:border-box;border-top:0.1em dashed #ddd;padding-left:0.5em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.table-footer{font-size:0.6em}.cell-bar-chart{display:inline-block;vertical-align:middle}.bar-chart-empty{color:#999}td:has(.cell-bar-chart){padding:0 0.25em;vertical-align:middle}td:has(.cell-bar-chart).pos_pos:before,td:has(.cell-bar-chart).pos_neg:before,td:has(.cell-bar-chart).pos_neu:before{content:none}td:has(.cell-bar-chart).variance:after{content:none}'}},[1,"ibcs-table",{data:[16],tableTitle:[1,"table-title"],scenarios:[16],scenariosDataFormat:[1,"scenarios-data-format"],grouped:[4],limit:[2],showGroupTitle:[4,"show-group-title"],thereof:[16],partof:[16],order:[16],categorythereof:[16],type:[1],categoryWidth:[1,"category-width"],dataFormatDigits:[16],i18n:[1040],i18nMode:[1,"i18n-mode"],measureScale:[1,"measure-scale"],measureUnit:[1,"measure-unit"],showMeasureScale:[4,"show-measure-scale"],measureType:[1,"measure-type"],filter:[1],barColumns:[16],barColumnMaxWidth:[2,"bar-column-max-width"],unitScaling:[2,"unit-scaling"],percentageScaling:[2,"percentage-scaling"],scaleFactor:[2,"scale-factor"]}]);function Z(){"undefined"!=typeof customElements&&["ibcs-table"].forEach((t=>{"ibcs-table"===t&&(customElements.get(s(t))||customElements.define(s(t),X))}))}export{X as I,y as T,Z as d}
1
+ import{h as t,proxyCustomElement as e,HTMLElement as o,Host as n,transformTag as s}from"@stencil/core/internal/client";import{F as r,Q as i,V as l,I as a,S as c}from"./ibcsRuleSet.js";import{I as h,D as u,j as d,k as f,l as p,e as m,M as $}from"./Order.js";import{a as v}from"./alasql.min.js";import{D as g,S as R,a as w,b}from"./DataFormatDigits.js";import{w as S}from"./withComponentStyle.js";var E,O,y,M,U;!function(t){t[t.ALL=-1]="ALL"}(E||(E={})),function(t){t[t.UP_TO_DATE=0]="UP_TO_DATE",t[t.DIRTY=1]="DIRTY"}(O||(O={})),function(t){t.LIST="list",t.SUM="sum",t.SUMNOTOTAL="sumnototal",t.OPT="opt",t.OPTNOTOTAL="optnototal"}(y||(y={})),function(t){t.ASC="asc",t.DESC="desc"}(M||(M={})),function(t){t.HEADER="HEADER",t.GROUPHEAD="GROUPHEAD",t.SEPERATORLINE="SEPERATORLINE",t.SUM="SUM",t.GROUPSUM="GROUP_SUM",t.DRILLELEMENT="DRILLELEMENT",t.STANDARD="STANDARD",t.PARTELEMENT="PARTELEMENT",t.ENTRY="ENTRY"}(U||(U={}));class G{constructor(t,e,o,n,s,r,i,l,a){this.prefixStyle="prefix",this.isBarChart=!1,this.key=t,this.index=e,this.value=o,this.prefix=r||"",this.cssStyle=n||"",this.prefixStyle=i||"prefix",this.type=s,this.mark=void 0,this.colSpan=l||1,this.measureScale=a||1}getAsHeaderList(){if(null==this.value)return[""];const t=[];for(const e of this.value.toString().split("<br/>"))t.push(e);return t}draw(t){let e=this.value;if("undefined"===e||void 0===e||null==e)return"";if(Number.isNaN(Number(e)))return e;if(""===this.type||void 0===this.type||null==this.type)return e;let o=t.percent,n=t.percent;return"decimal"===this.type&&(e=+e/this.measureScale,o=t.decimal,n=t.decimal),r.number(Number(e),this.type,o,n)}drawPrefix(){return null==this.prefix?"":this.prefix}}class T{constructor(t,e,o){this.index=t,this.groupindex=e,this.type=o,this.cssStyle=this.initCssStyle(),this.elements=[]}initCssStyle(){switch(this.type){case U.HEADER:return"groupheader";case U.SEPERATORLINE:return"";case U.DRILLELEMENT:return"ofit";case U.PARTELEMENT:return"partof";case U.STANDARD:return"";case U.SUM:return"sum";default:return""}}getCells(){return this.elements}createElement(t,e,o,n,s,r,i,l,a,c=!1,h){let u=r;"category"===e&&null!=l&&(u=`category-${l.toString()}`),this.type===U.HEADER?u="headerlabel":this.type===U.SEPERATORLINE&&(u=e),this.type===U.PARTELEMENT&&("percent"===n&&(t="-"),"category"!==e&&"operation"!==e&&(n="percent",u="")),"-"===t&&(u="");let d="prefix-first";i&&(d="prefix-second"),o&&(u=`${u} ${o}`);const f=new G(e,this.elements.length,t,u,n,s,d,1,a);f.isBarChart=c,f.columnStats=h,this.elements.push(f)}}const _={positive:{stroke:"#008f96",fill:"#008f96",fillpattern:"solid"},negative:{stroke:"#ff0000",fill:"#ff0000",fillpattern:"solid"},neutral:{stroke:"#808080",fill:"#808080",fillpattern:"outlined"},scenarios:{ac:{stroke:"#404040",fill:"#404040",fillpattern:"solid"},pp:{stroke:"#A6A6A6",fill:"#A6A6A6",fillpattern:"solid"},fc:{stroke:"#404040",fill:"#ffffff",fillpattern:"hatched"},pl:{stroke:"#404040",fill:"#ffffff",fillpattern:"outlined"}},fontColor:"#000000",fontSize:11,fontFamily:"'Noto Sans', sans-serif",unitScaling:.01,percentageScaling:.5,scaleFactor:1},C="#666666";function L(t,e){return`pattern-${t}-${e.replace("#","")}`}const N=({styles:e})=>{const o=e.scaleFactor,n=6*o,s=[{id:L("pos",e.positive.stroke),stroke:e.positive.stroke,fill:e.positive.fill},{id:L("neg",e.negative.stroke),stroke:e.negative.stroke,fill:e.negative.fill},{id:L("neu",e.neutral.stroke),stroke:e.neutral.stroke,fill:e.neutral.fill}];return t("defs",null,s.map((e=>t("pattern",{id:e.id,patternUnits:"userSpaceOnUse",width:n,height:n},t("rect",{width:n,height:n,fill:"#ffffff"}),t("line",{x1:"0",y1:n,x2:n,y2:"0",stroke:e.stroke,"stroke-width":1.5*o})))))};function P(t,e,o=1){let n,s;const r=t>=0?"+":"";if(e)return n=100*t,r+Math.round(n).toString()+"%";{let e;return n=t/o,s=Math.abs(n),e=s>=1e9?(n/1e9).toFixed(s>=1e10?0:1)+"B":s>=1e6?(n/1e6).toFixed(s>=1e7?0:1)+"M":s>=1e3?(n/1e3).toFixed(s>=1e4?0:1)+"K":n.toFixed(s>=10?0:1),e=e.replace(/\.0([KMB]?)$/,"$1"),r+e}}function x(t){const e=t.slice(0,2).toLowerCase();return["ac","pp","fc","pl"].includes(e)}function k(t){const e=t.slice(0,2).toLowerCase();return"pp"===e?"pp":"fc"===e?"fc":"pl"===e?"pl":"ac"}function A(t,e,o,n){return x(t)?function(t,e){const o=k(t);return e.scenarios[o]}(t,n):function(t,e,o){const n=t>=0;return e?n?o.positive:o.negative:n?o.negative:o.positive}(e,o,n)}const D=e=>{const{value:o,scenario:n,columnStats:s,height:r,isPositiveGood:i,formattedValue:l,measureScale:a,maxBarWidth:c=10,styles:h=_}=e,u=h.scaleFactor,d=h.fontSize,f=38*u,p=c*d,m=4*u,$=.15*p,v=p-m-$,g=Math.abs(o)*h.unitScaling*d,R=g>v,w=Math.max(0,s.absMax*h.unitScaling*d-v),b=Math.max(0,g-v),S=w>0?b/w*$:0,E=s.min<0,O=s.max>0,y=E?p:0,M=(E?f:0)+(y+(O?p:0))+(O?f:0),U=2*u,G=r-2*U,T=(E?f:0)+y,D=U,B=o>=0,F=A(n,o,i,h),Y=function(t,e){const o=t.fillpattern;return"hatched"===o?`url(#${L(e,t.stroke)})`:"outlined"===o?"transparent":t.fill}(F,x(n)?k(n):i?B?"pos":"neg":B?"neg":"pos"),{stroke:W,strokeWidth:H}="outlined"===(I=F).fillpattern?{stroke:I.stroke,strokeWidth:1.5}:{stroke:"none",strokeWidth:0};var I;const z=l||P(o,!1,a),j=R?v:g,V=R?v+m+S:g,Q=B?T+V+4*u:T-V-4*u,q=B?"start":"end";return t("svg",{width:M,height:r,class:"cell-bar-chart absolute-variance",style:{overflow:"visible"}},t(N,{styles:h}),t("line",{x1:T,y1:0,x2:T,y2:r,stroke:C,"stroke-width":1*u}),j>0&&t("rect",{x:B?T:T-j,y:D,width:j,height:G,fill:Y,stroke:W,"stroke-width":H*u}),R&&S>0&&t("rect",{x:B?T+v+m:T-v-m-S,y:D,width:S,height:G,fill:Y,stroke:W,"stroke-width":H*u}),R&&function(e,o,n,s,r){const i=e+o/2,l=.35*o,a=s/3,c=.3*o;let h=`M ${i-l} ${n}`;for(let t=0;t<3;t++)h+=` L ${i-l-c} ${n+a*(t+.5)} L ${i-l} ${n+a*(t+1)}`;let u=`M ${i+l} ${n}`;for(let t=0;t<3;t++)u+=` L ${i+l+c} ${n+a*(t+.5)} L ${i+l} ${n+a*(t+1)}`;return[t("rect",{x:e,y:n-1,width:o,height:s+2,fill:"#ffffff"}),t("path",{d:h,fill:"none",stroke:"#000000","stroke-width":1*r}),t("path",{d:u,fill:"none",stroke:"#000000","stroke-width":1*r})]}(B?T+v:T-v-m,m,D,G,u),t("text",{x:Q,y:r/2,dy:"0.35em","text-anchor":q,fill:h.fontColor,"font-size":d,"font-family":h.fontFamily},z))},B=e=>{const{value:o,scenario:n,columnStats:s,height:r,isPositiveGood:i,formattedValue:l,measureScale:a,maxBarWidth:c=10,styles:h=_}=e,u=h.scaleFactor,d=h.fontSize,f=Math.round(.67*c*d),p=5*u,m=s.min<0?f+p:0,$=m+(s.max>0?f+p:0),v=$+45*u,g=m,R=r/2,w=100*Math.abs(o)*h.percentageScaling*d,b=w>f,S=Math.min(w,f),E=o>=0,O=E?g+S:g-S,y=A(n,o,i,h),M=3*u,U=l||P(o,!0,a),G=$+4*u;return t("svg",{width:v,height:r,class:"cell-bar-chart relative-variance",style:{overflow:"visible"}},t("line",{x1:g,y1:0,x2:g,y2:r,stroke:C,"stroke-width":1*u}),!b&&t("circle",{cx:O,cy:R,r:M,fill:h.fontColor}),t("line",{x1:g,y1:R,x2:O,y2:R,stroke:y.fill,"stroke-width":2*u}),b&&E&&t("polygon",{points:`${g+f},${R} ${g+f-6*u},${R-3*u} ${g+f-6*u},${R+3*u}`,fill:y.fill}),b&&!E&&t("polygon",{points:`${g-f},${R} ${g-f+6*u},${R-3*u} ${g-f+6*u},${R+3*u}`,fill:y.fill}),t("text",{x:G,y:r/2,dy:"0.35em","text-anchor":"start",fill:h.fontColor,"font-size":d,"font-style":"italic","font-family":h.fontFamily},U))},F=e=>{const{value:o,columnStats:n,isRelative:s,styles:r=_}=e;return null==o||isNaN(o)||!n||0===n.absMax?t("span",{class:"bar-chart-empty",style:{color:r.fontColor,fontStyle:"italic"}},"-"):t(s?B:D,Object.assign({},e))};class Y{constructor(t){v.fn.transformOperator=function(t){return"-"===t?-1:1},this.groups=[i.CATEGORY,i.CATEGORYINDEX],y.OPT!==t.type&&y.OPTNOTOTAL!==t.type||this.groups.unshift(i.OPERATION),t.grouped&&(this.groups.push(i.ROWGROUP),this.groups.push(i.ROWGROUPINDEX))}toString(){return this.groups.map((t=>`${t}`)).toString()}noCategory(){return this.groups.filter((t=>t!==i.CATEGORY))}toArray(){return this.groups}}class W{constructor(t,e){this.hasPartOf=!1,this.config=t,this.i18n=e}execute(t){if(0===t.length)return[];const e=[],o=[],n=[],s=this.config.scenarios.map((t=>this.translateScenarioSQL(t,!1,this.config.type))).toString(),r=this.config.scenarios.map((t=>this.translateScenarioSQL(t,!0,this.config.type))).toString(),l=this.getRelativeScenarios(),a=new Y(this.config),c=this.config.grouped?[i.ROWGROUP,i.ROWGROUPINDEX]:[];let h=["",""];return this.config.sortOrder.hierarchy.length>0&&(h=this.createOrderString(this.config.sortOrder)),this.hasPartOf=this.checkConfigForPartOf(),v(`SELECT COUNT(DISTINCT ${i.CATEGORY}) as ${i.TOTALROWCOUNT} ${c.length>0?","+c:""}\n FROM ? ${c.length>0?"GROUP BY "+c:""} \n ORDER BY ${h[0]}`,[t]).forEach((t=>{const n=t.rowGroup&&t.rowGroup.length>0?`WHERE ${i.ROWGROUP} = '${t.rowGroup}'`:"";let l="";this.config.limit&&(l=`LIMIT ${this.config.limit}`),this.createGroupHeaderRow(t,e),this.createDataRow(e,t,a,s,n,h,l),this.createRestRow(t,e,a,s,n,h),this.createGroupSumRow(e,o,t,r,h)})),this.createTotalSumRow(e,o,r),e.forEach((e=>{try{n.push(v(e,[t]))}catch(t){console.error("DataQuery: SQL query execution failed",e,t)}})),this.detectNaNCells(this.config.scenarios,n),this.createThereOfDrillRows(s,h,t,n),this.createPartOfDrillRows(s,h,o,t,n),this.createThereOfDrillColumns(this.config.categoryThereOf,t,n),this.calculateColumnGroupRest(n,this.config.categoryThereOf),this.calculateRelativeVariances(n,l),n}detectNaNCells(t,e){e.forEach((e=>{e.map((e=>(t.forEach((t=>{const o=new l(t);!0===o.isValid?0!==e[o.base+"_cnt"]&&0!==e[o.delta+"_cnt"]||(e[t]=Number.NaN):0===e[t+"_cnt"]&&(e[t]=Number.NaN)})),e)))}))}createPartOfDrillRows(t,e,o,n,s){if(null==this.config.partOf||0===this.config.partOf.length||this.config.type===y.LIST||null==n||0===n.length)return;const r=this.createPartOfQuery(t,e);let l=[];r.forEach((function(t){l.push(...v(t,[n]))}));const a=this.exctractScenarioNames(t),c=[];o.forEach((function(t){c.push(...v(t,[n]))}));const h=new Map;c.forEach((t=>h.set(t[i.ROWGROUP],t))),l=this.reduceResDrillByCategoryGroups(l,a),l.forEach((function(t){a.forEach((e=>{try{t[e]=t[e]/h.get(t[i.ROWGROUP])[e]}catch(o){console.error("DataQuery: partOf drill row calculation failed",e,o),t[e]=Number.NaN}}))})),this.injectDrillRowsToResultRows(l,s)}createRestRow(t,e,o,n,s,r){t.totalRowCnt-this.config.limit>0&&0!==this.config.limit&&e.push(`SELECT ${i.ROWNR}, 1 as ${i.ROWGROUPINDEX} , 'ENTRY' as ${i.TYPE}, 'NO_GROUP' as ${i.ROWGROUP}, 'REST' as ${i.CATEGORY} , SUM(ac1) as ac1, SUM(pp1) as pp1, SUM(dpp1_ac1_pos) as dpp1_ac1_pos, SUM(drpp1_ac1_pos) as drpp1_ac1_pos, SUM(dr_pp1) as dr_pp1 FROM (SELECT ROWNUM() AS ${i.ROWNR}, ${e.length} as ${i.ROWGROUPINDEX} , 'ENTRY' as ${i.TYPE}, '${t.rowGroup||"NO_GROUP"}' as ${i.ROWGROUP}, ${o} ${n.length>0?",".concat(n):""} FROM ? ${s} GROUP BY ${o} ORDER BY ${r[0]}) t WHERE t.rowNr > ${this.config.limit}`)}createDataRow(t,e,o,n,s,r,l){t.push(`SELECT ROWNUM() AS ${i.ROWNR},\n ${t.length} as ${i.ROWGROUPINDEX},\n 'ENTRY' as ${i.TYPE},\n '${e.rowGroup||"NO_GROUP"}' as ${i.ROWGROUP},\n '${i.CATEGORYINDEX}',\n ${o} ${n.length>0?",".concat(n):""}\n FROM ? ${s}\n GROUP BY ${o}\n ORDER BY ${r[0]} ${l}`)}createGroupHeaderRow(t,e){!0===this.config.grouped&&e.push(`SELECT ROWNUM() AS ${i.ROWNR},\n ${e.length} as ${i.ROWGROUPINDEX},\n 'GROUPHEAD' as ${i.TYPE},\n '${t.rowGroup}' as ${i.ROWGROUP} ${this.config.showGroupTitle?`,'${t.rowGroup}' as ${i.CATEGORY}`:""}\n FROM ?\n GROUP BY '1'`)}createGroupSumRow(t,e,o,n,s){!0!==this.config.grouped||y.SUM!==this.config.type&&y.SUMNOTOTAL!==this.config.type&&y.OPT!==this.config.type&&y.OPTNOTOTAL!==this.config.type||(t.push(`SELECT ${t.length} as ${i.ROWGROUPINDEX},\n '=' as ${i.OPERATION},\n '${o.rowGroup}' as ${i.ROWGROUP},\n ROWNUM() AS ${i.ROWNR},\n 'GROUP_SUM' as ${i.TYPE} ${n.length>0?",".concat(n):""}\n FROM ?\n WHERE ${i.ROWGROUP} = '${o.rowGroup}'\n ORDER BY ${s[0]} `),e.push(`SELECT ${t.length} as ${i.ROWGROUPINDEX},\n '=' as ${i.OPERATION},\n '${o.rowGroup}' as ${i.ROWGROUP},\n ROWNUM() AS ${i.ROWNR},\n 'GROUP_SUM' as ${i.TYPE} ${n.length>0?",".concat(n):""}\n FROM ?\n WHERE ${i.ROWGROUP} = '${o.rowGroup}'\n ORDER BY ${s[0]} `))}createTotalSumRow(t,e,o){if(y.SUM===this.config.type||y.OPT===this.config.type){const e=`${this.hasPartOf&&!1===this.config.grouped?`${this.i18n.get("SUM_TOTAL")||"SUM_TOTAL"} `:""}${this.config.title}`;t.push(`SELECT ${t.length} as ${i.ROWGROUPINDEX},\n '${e}' as ${i.ROWGROUP},\n '=' as ${i.OPERATION},\n 'SUM' as ${i.TYPE} ${o.length>0?",".concat(o):""}\n FROM ? `)}e.push(`SELECT ${t.length} as ${i.ROWGROUPINDEX},\n 'SUM_TOTAL' as ${i.ROWGROUP},\n '=' as ${i.OPERATION},\n 'SUM' as ${i.TYPE} ${o.length>0?",".concat(o):""}\n FROM ? `)}reduceResDrillByCategoryGroups(t,e){const o=new Map;return t.forEach((function(t){const n=t.rowNr+t.rowGroup+t.type+t.category;if(o.has(n)){const s=o.get(n);e.forEach((e=>{try{s[e]+=t[e]}catch(t){console.error("DataQuery: drill row aggregation failed",e,t)}}))}else o.set(n,t)})),[...o.values()]}injectDrillRowsToResultRows(t,e){const o=new Map;if(!0===this.config.grouped)t.forEach((function(t){e.forEach((function(e){const n=e.findIndex((e=>e.category===t.category&&e.rowGroup===t.rowGroup));if(n>=0){if(o.has(`${t.category}_${t.rowGroup}`)){const e=o.get(`${t.category}_${t.rowGroup}`)||0;o.set(`${t.category}_${t.rowGroup}`,e+1)}else o.set(`${t.category}_${t.rowGroup}`,1);t[i.ROWNR]=o.get(`${t.category}_${t.rowGroup}`),e.splice(n+t[i.ROWNR],0,t)}}))}));else{const n=this.findDuplicateSubCategories(t);t.forEach((function(t){e.forEach((function(e){const s=e.findIndex((e=>null!=e.category&&e.category===t.category));if(s>=0){if(o.has(`${t.category}`)){const e=o.get(`${t.category}`)||0;o.set(`${t.category}`,e+1)}else o.set(`${t.category}`,1);(1===t[i.ROWNR]||n.includes(t.subCategory))&&(t.subCategory=`${t.subCategory} (${t.rowGroup})`),e.splice(s+t[i.ROWNR],0,t)}}))}))}}createThereOfDrillRows(t,e,o,n){if(void 0===this.config.thereOf||0===this.config.thereOf.length)return;const s=[],r=[];this.config.thereOf.forEach((o=>{let n=!0,r="1 <> 1 OR ( ";null!=o.category&&0!==o.category.length&&o.category.trim()&&(r+=` ${i.CATEGORY} = '${o.category}'`,n=!1),null!=o.rowGroup&&0!==o.rowGroup.length&&o.rowGroup.trim()&&(r+=` ${n?"":"AND"} ${i.ROWGROUP} = '${o.rowGroup}'`,n=!1),null!=o.subCategory&&0!==o.subCategory.length&&o.subCategory.trim()&&(r+=` ${n?"":"AND"} ${i.SUBCATEGORY} = '${o.subCategory}'`),r+=")",s.push(`SELECT ROWNUM() AS ${i.ROWNR},\n null as operation,\n 'DRILLELEMENT' as ${i.TYPE},\n ${i.CATEGORY},\n ${i.SUBCATEGORY},\n ${i.ROWGROUP} as ${i.ROWGROUP},\n ${t}\n FROM ?\n WHERE ${r}\n GROUP BY ${i.ROWGROUP}, ${i.CATEGORY}, ${i.SUBCATEGORY}\n ORDER BY ${e[1]}`)})),s.forEach((function(t){r.push(...v(t,[o]))})),this.injectDrillRowsToResultRows(r,n)}calculateRelativeVariances(t,e){t.forEach((t=>{t.forEach((t=>{"GROUPHEAD"!==t[i.TYPE]&&e.forEach(((e,o)=>{t[o]=t[o]/t[e]}))}))}))}calculateColumnGroupRest(t,e){if(null==e||0===e.size)return;const o=new Map,n=new Map;e.forEach(((t,e)=>{const s=t,r=[];for(const t of s)r.push(`${e}##${t.name}`);o.set(e,r),n.set(`${e}##REST`,!1)})),t.forEach((t=>{t.forEach((t=>{"GROUPHEAD"!==t[i.TYPE]&&o.forEach(((e,o)=>{let s=0;e.forEach((e=>{void 0!==t[e]&&(s+=t[e])})),t[`${o}##REST`]=t[o]-s,0!==t[`${o}##REST`]&&n.set(`${o}##REST`,!0)}))}))}));const s=Array.from(n.entries()).filter((([t,e])=>!e)).map((([t])=>t));t.forEach((t=>{t.forEach((t=>{for(const e of s)delete t[e]}))}))}getRelativeScenarios(){const t=new Map;return this.config.scenarios.forEach((e=>{const o=this.createRelativeScenario(e);null!=o&&t.set(o.key,o.value)})),t}translateScenarioSQL(t,e,o){const n=new l(t);return y.OPT===o||y.OPTNOTOTAL===o?n.isValid?"dr"===n.type?`SUM(${n.base} - ${n.delta}) as ${t}, SUM(${n.delta}) as dr_${n.delta}`:`SUM(${n.base} - ${n.delta}) as ${t}`:e?`SUM(${t} * transformOperator(operation)) as ${t}, COUNT(ISNULL(${t})) as ${t}_cnt`:`SUM(${t}) as ${t}, COUNT(ISNULL(${t})) as ${t}_cnt`:n.isValid?"dr"===n.type?`SUM((${n.base} * transformOperator(operation)) - (${n.delta} * transformOperator(operation))) as ${t}, SUM(${n.delta} * transformOperator(operation)) as dr_${n.delta}`:`SUM((${n.base} * transformOperator(operation))- (${n.delta} * transformOperator(operation))) as ${t}`:`SUM(${t} * transformOperator(operation)) as ${t}, COUNT(ISNULL(${t})) as ${t}_cnt`}createOrderString(t){return[`${t.hierarchy.toString()} ${t.direction}`,`${t.hierarchy.toString()} ${M.ASC===t.direction?M.DESC:M.ASC}`]}createRelativeScenario(t){const e=new l(t);return e.isValid&&"dr"===e.type?{key:`${t}`,value:`dr_${e.delta}`}:null}exctractScenarioNames(t){const e=[];return t.split(",").forEach((t=>t.length>=2?e.push(t.split("as")[1].trim()):null)),e}findDuplicateSubCategories(t){const e=t.map((t=>({count:1,subCategory:t.subCategory}))).reduce(((t,e)=>(t[e.subCategory]=(t[e.subCategory]||0)+e.count,t)),{});return Object.keys(e).filter((t=>e[t]>1))}createPartOfQuery(t,e){var o;const n=[];let s="1 <> 1 ",r=` ${i.ROWGROUP}`,l="ROWNUM()";return null===(o=this.config.partOf)||void 0===o||o.forEach((t=>{s+=`OR (${i.CATEGORY} = '${t.category}'`,null!=t.rowGroup&&0!==t.rowGroup.length&&t.rowGroup.trim()&&(s+=`and ${i.ROWGROUP} = '${t.rowGroup}'`),!1===this.config.grouped&&(r=` 'SUM_TOTAL' as ${i.ROWGROUP} `,l="1"),s+=")"})),n.push(`SELECT ${l} AS ${i.ROWNR},\n 'PARTELEMENT' as ${i.TYPE},\n ${i.CATEGORY},\n ${r},\n ${t}\n FROM ?\n WHERE ${s}\n GROUP BY ${i.ROWGROUP}, ${i.CATEGORY}, ${i.TYPE}\n ORDER BY ${e[1]}`),n}checkConfigForPartOf(){return null!=this.config.partOf&&0!==this.config.partOf.length}createThereOfDrillColumns(t,e,o){if(null==t||0===t.size)return;const n=[],s=[];t.forEach(((t,e)=>{let o="1 <> 1 ";t.forEach((t=>{o+=` or columnGroup = '${t.name}' `})),n.push(`SELECT 'ENTRY' as rowlevel,\n 'COLUMNGROUP' as columnlevel,\n rowGroup,\n category,\n columnGroup,\n '${e}' as scenario,\n sum(${e} * transformOperator(operation)) as val\n FROM ?\n WHERE ${o}\n GROUP BY rowlevel, rowGroup, category, columnGroup, scenario`),n.push(`SELECT 'ENTRY' as rowlevel,\n 'SUBGROUP' as columnlevel,\n rowGroup,\n category,\n columnGroup,\n columnSubGroup,\n '${e}' as scenario,\n sum(${e} * transformOperator(operation)) as val\n FROM ?\n WHERE ${o}\n GROUP BY rowlevel, rowGroup, category, columnGroup, columnSubGroup, scenario`),n.push(`SELECT 'DRILLELEMENT' as rowlevel,\n 'COLUMNGROUP' as columnlevel,\n rowGroup,\n category,\n subCategory,\n columnGroup,\n '${e}' as scenario,\n sum(${e} * transformOperator(operation)) as val\n FROM ?\n WHERE ${o}\n GROUP BY rowlevel, rowGroup, category, subCategory, columnGroup, scenario`),n.push(`SELECT 'DRILLELEMENT' as rowlevel,\n 'SUBGROUP' as columnlevel,\n rowGroup,\n category,\n subCategory,\n columnGroup,\n columnSubGroup,\n '${e}' as scenario,\n sum(${e} * transformOperator(operation)) as val\n FROM ?\n WHERE ${o}\n GROUP BY rowlevel, rowGroup, category, subCategory, columnGroup, columnSubGroup, scenario`),n.push(`SELECT 'GROUP_SUM' as rowlevel,\n 'COLUMNGROUP' as columnlevel,\n rowGroup,\n columnGroup,\n '${e}' as scenario,\n sum(${e} * transformOperator(operation)) as val\n FROM ?\n WHERE ${o}\n GROUP BY rowlevel, rowGroup, columnGroup, scenario`),n.push(`SELECT 'GROUP_SUM' as rowlevel,\n 'SUBGROUP' as columnlevel,\n rowGroup,\n columnGroup,\n columnSubGroup,\n '${e}' as scenario,\n sum(${e} * transformOperator(operation)) as val\n FROM ?\n WHERE ${o}\n GROUP BY rowlevel, rowGroup, columnGroup, columnSubGroup, scenario`),n.push(`SELECT 'SUM' as rowlevel,\n 'COLUMNGROUP' as columnlevel,\n columnGroup,\n '${e}' as scenario,\n sum(${e} * transformOperator(operation)) as val\n FROM ?\n WHERE ${o}\n GROUP BY rowlevel, columnGroup, scenario`),n.push(`SELECT 'SUM' as rowlevel,\n 'SUBGROUP' as columnlevel,\n columnGroup,\n columnSubGroup,\n '${e}' as scenario,\n sum(${e} * transformOperator(operation)) as val\n FROM ?\n WHERE ${o}\n GROUP BY rowlevel, columnGroup, columnSubGroup, scenario`)}));for(const t of n)s.push(...v(t,[e]));this.injectDrillColumnsToResultRows(s,o)}injectDrillColumnsToResultRows(t,e){const o="##";for(const n of t)for(const t of e)for(const e of t)e.type===n.rowlevel&&("ENTRY"===n.rowlevel?"COLUMNGROUP"===n.columnlevel&&e.category===n.category?e[n.scenario+o+n.columnGroup]=n.val:"SUBGROUP"===n.columnlevel&&e.category===n.category&&(e[n.scenario+o+n.columnGroup+o+n.columnSubGroup]=n.val):"DRILLELEMENT"===n.rowlevel?"COLUMNGROUP"===n.columnlevel&&e.category===n.category&&e.subCategory===n.subCategory?e[n.scenario+o+n.columnGroup]=n.val:"SUBGROUP"===n.columnlevel&&e.category===n.category&&e.subCategory===n.subCategory?e[n.scenario+o+n.columnGroup+o+n.columnSubGroup]=n.val:"COLUMNGROUP"===n.columnlevel&&e.category===n.category&&e.subCategory===`${n.subCategory} (${n.rowGroup})`?e[n.scenario+o+n.columnGroup]=n.val:"SUBGROUP"===n.columnlevel&&e.category===n.category&&e.subCategory===`${n.subCategory} (${n.rowGroup})`&&(e[n.scenario+o+n.columnGroup+o+n.columnSubGroup]=n.val):("SUM"===n.rowlevel||"GROUP_SUM"===n.rowlevel)&&("COLUMNGROUP"===n.columnlevel&&e.category===n.category&&e.subCategory===n.subCategory&&(e[n.scenario+o+n.columnGroup]=n.val),"SUBGROUP"===n.columnlevel&&e.category===n.category&&e.subCategory===n.subCategory&&(e[n.scenario+o+n.columnGroup+o+n.columnSubGroup]=n.val)))}}class H{constructor(){this.normalizedHeader=[]}createHeader(t,e,o,n,s,i){const l=[];this.normalizedHeader=this.normalizeHeader(t,e);const a=new T(0,0,U.HEADER),c=new T(1,0,U.SEPERATORLINE);for(const t of this.normalizedHeader)a.createElement(r.translateScenarioLabel(t.name,o),t.type,this.createColumnType(t),null,this.setHeaderPrefix(t,o,n,s,i),null,null,null,null),c.createElement(null,t.type,this.createColumnType(t),null,null,null,null,null,null);return l.push(a),l.push(c),l}setHeaderPrefix(t,e,o,n,s){let i="";return"category"===t.name&&s&&(0===o.prefix.length&&0===n.length||(i=r.translateScenarioLabel("in",e)+" "+o.prefix+n)),t.order&&(i+=r.translateScenarioLabel("ORDER_"+t.order,e)),i}normalizeHeader(t,e){let o=[{name:i.CATEGORY,group:i.CATEGORY,type:i.CATEGORY,order:void 0}];return y.OPT!==t&&y.OPTNOTOTAL!==t||(o=[{name:i.OPERATION,group:i.OPERATION,type:i.OPERATION,order:void 0},{name:i.CATEGORY,group:i.CATEGORY,type:i.CATEGORY,order:void 0}]),[...o,...e]}createBodyRows(t,e,o){const n=[];let s=-1;const r=new W(t,e).execute(o),i=this.calculateColumnStatistics(r,t.barColumns);for(const o of r)s+=1,n.push(...this.createRow(t.i18n,e,t.scenariosUnitType,o,s,-1,t.categoryWidth,t.measureScale,t.barColumns,i));return n}calculateColumnStatistics(t,e){const o=new Map;if(!e||0===e.length)return o;const n=new Map;for(const t of e)o.set(t,{min:1/0,max:-1/0,absMax:0,median:0}),n.set(t,[]);for(const s of t)for(const t of s)for(const s of e){const e=this.extractColumnValue(t,s);if(null!==e&&!isNaN(e)){const t=o.get(s);t.min=Math.min(t.min,e),t.max=Math.max(t.max,e),n.get(s).push(Math.abs(e))}}for(const[t,e]of o){e.min!==1/0&&e.max!==-1/0||(e.min=0,e.max=0),e.absMax=Math.max(Math.abs(e.min),Math.abs(e.max));const s=n.get(t);if(s.length>0){s.sort(((t,e)=>t-e));const t=Math.floor(s.length/2);e.median=s.length%2==0?(s[t-1]+s[t])/2:s[t]}o.set(t,e)}return o}extractColumnValue(t,e){if(void 0!==t[e]){const o=Number(t[e]);return isNaN(o)?null:o}for(const o of Object.keys(t))if(o===e||o.endsWith("##"+e)||o===e+"##"+e){const e=Number(t[o]);if(!isNaN(e))return e}return null}createRow(t,e,o,n,s,r,l,a,c,h){var u;const d=[];for(const f of n){const p=f[i.ROWGROUP],m=f[i.SUBCATEGORY],$=f[i.TYPE],v=f[i.ROWNR]>=2,g=this.createDetailRow($,r+=1,s,n.length);for(const n of this.normalizedHeader){const s=this.getRawDataRowElement(f,n),r=null!==(u=null==c?void 0:c.includes(n.type))&&void 0!==u&&u,i=r?null==h?void 0:h.get(n.type):void 0;g.createElement(this.translateSumCellLabel(t,e,s,p,m,$,n.type),n.type,this.createColumnType(n),this.setCellType(n.type,o),this.translateCellPrefix(e,$,n.type),this.translateScenarioCSS(n.type,s),v,l,null==a?void 0:a.value,r,i)}d.push(g)}return d}getRawDataRowElement(t,e){return e.name===e.group&&e.name===e.type?t[e.name]:e.name===e.group&&e.name!==e.type?t[e.type+"##"+e.name]:t[e.type+"##"+e.group+"##"+e.name]}createDetailRow(t,e,o,n){switch(t){case U.GROUPHEAD:return new T(e,o,U.HEADER);case U.SUM:case U.GROUPSUM:return new T(n+2,o,U.SUM);case U.DRILLELEMENT:return new T(n+2,o,U.DRILLELEMENT);case U.PARTELEMENT:return new T(n+2,o,U.PARTELEMENT);default:return new T(e,o,U.STANDARD)}}translateSumCellLabel(t,e,o,n,s,r,i){return!1===Number.isNaN(Number(o))||this.isOperationColumn(i)?o:this.isGroupHeadCategory(r,i)||this.isEntryCategory(r,i)?t===h.ALL?`${e.get(o)||o}`:o:this.isDrillElementCategory(r,i)?t===h.ALL?`${e.get(s)||s}`:`${s}`:this.isPartElementCategory(r,i)?t===h.ALL||"SUM_TOTAL"===n?`${e.get(n)||n}`:`${n}`:this.isSumElementCategory(r,i)?t===h.ALL||"SUM_TOTAL"===n?`${e.get(n)||n}`:n:"GROUPHEAD"===r&&null==o?o:Number.isNaN(Number(o))?"-":Number(o)}isOperationColumn(t){return"operation"===t}translateScenarioCSS(t,e){const o=new l(t);let n="pos";return e<0&&(n="neg"),o.isValid?n+"_"+o.direction+("dr"===o.type?" relative_variance":""):t}setCellType(t,e){if("category"===t)return"";let o;const n=new l(t);return e===u.PERCENT?(o="percent",n.isValid&&"d"===n.type&&(o="decimal")):(o="decimal",n.isValid&&"dr"===n.type&&(o="percent")),o}isDrillElementCategory(t,e){return"DRILLELEMENT"===t&&"category"===e}isPartElementCategory(t,e){return"PARTELEMENT"===t&&"category"===e}isSumElementCategory(t,e){return("GROUP_SUM"===t||"SUM"===t)&&"category"===e}isEntryCategory(t,e){return"ENTRY"===t&&"category"===e}isGroupHeadCategory(t,e){return"GROUPHEAD"===t&&"category"===e}translateCellPrefix(t,e,o){return this.isOperationColumn(o)||this.isGroupHeadCategory(e,o)||this.isEntryCategory(e,o)?null:this.isDrillElementCategory(e,o)?`${t.get("there_of")} `:this.isPartElementCategory(e,o)?`${t.get("part_of")} `:null}createColumnType(t){return t.name===t.group&&t.name===t.type?"base":t.name===t.group?"columnGroup":"columnSubGroup"}}class I{constructor(t,e,o){this.data=[],this.headerRows=[],this.bodyRows=[],this.ruleSet=t||new a,this.dataSetFactory=new H,this.config=this.initConfig(o),this.i18n=this.initI18n(new Map),this.setData(e,o.filter),this.state=O.DIRTY}setI18n(t){this.i18n=this.initI18n(t)}initI18n(t){const e=new Map([["",""],["SEPERATOR_WS",", "],["in","in"],["ORDER_asc","↑"],["ORDER_desc","↓"],["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"],["in","in"],["category"," "],["operation"," "],["there_of","davon"],["part_of","in % von"],["ibcssymbol_delta_ac","Δ{%}"],["ibcssymbol_delta_generic","Δ({%})"],["ibcssymbol_delta_ac_relative","Δ{%}%"],["ibcssymbol_delta_generic_relative","Δ({%})%"],["SUM_TOTAL","❖"]]);return this.state=O.DIRTY,new Map([...e,...t||new Map])}initConfig(t){this.state=O.DIRTY;const e=t,o=this;return t.scenarios.sort(((t,e)=>o.ruleSet.getScenarioSorIndex(t)-o.ruleSet.getScenarioSorIndex(e))),e}setConfig(t){this.config=this.initConfig(t)}setData(t,e){if(null==t)return;if(null!=e&&e.length>0)try{this.data=v(`SELECT * FROM ? WHERE ${e}`,[t])}catch(o){console.error("Table: filter query failed, using unfiltered data",e,o),this.data=t}else this.data=t;const o=this.normalizeScenarios(this.config.scenarios,this.config.categoryThereOf,this.config.sortOrder);this.headerRows=this.dataSetFactory.createHeader(this.config.type,o,this.i18n,this.config.measureScale,this.config.measureUnit,this.config.showMeasureScale),this.bodyRows=this.dataSetFactory.createBodyRows(this.config,this.i18n,this.data),this.state=O.UP_TO_DATE}update(){const t=this.normalizeScenarios(this.config.scenarios,this.config.categoryThereOf,this.config.sortOrder);this.headerRows=this.dataSetFactory.createHeader(this.config.type,t,this.i18n,this.config.measureScale,this.config.measureUnit,this.config.showMeasureScale),this.bodyRows=this.dataSetFactory.createBodyRows(this.config,this.i18n,this.data),this.state=O.UP_TO_DATE}getHeader(){return this.state===O.DIRTY&&this.update(),this.headerRows}getBody(){return this.state===O.DIRTY&&this.update(),this.bodyRows}normalizeScenarios(t,e,o){var n;const s=[];for(const r of t){if(null==e?void 0:e.has(r)){const t=e.get(r);for(const e of t){s.push({name:e.name,group:e.name,type:r,order:void 0});for(const t of e.subGroups)s.push({name:t,group:e.name,type:r,order:void 0})}s.push({name:"REST",group:"REST",type:r,order:void 0})}let t;(null===(n=null==o?void 0:o.hierarchy)||void 0===n?void 0:n.at(0))===r&&(t=o.direction),s.push({name:r,group:r,type:r,order:t})}return s}hasNoData(){return 0===this.data.length}}class z{constructor(){this.title="",this.scenarios=[],this.scenariosUnitType=u.DECIMAL,this.grouped=!1,this.showGroupTitle=!0,this.thereOf=[],this.categoryThereOf=new Map,this.partOf=[],this.sortOrder=new p(new c).default(),this.type=y.LIST,this.limit=0,this.i18n=h.ALL,this.categoryWidth=m.W25,this.measureScale=new R,this.measureUnit="",this.measureType=$.VOLUME,this.showMeasureScale=!0,this.filter="",this.barColumns=[]}}class j{constructor(t,e,o,n){this.tableDrillGroupAdapter=t,this.stringAdapter=e,this.orderAdapter=o,this.dataSet=n}adapt(t){const e=new z;return d.isString(t.title)&&(e.title=t.title),d.isArray(t.scenarios)&&(e.scenarios=f.adaptArray(t.scenarios,this.stringAdapter)),d.isExisting(t.scenariosUnitType)&&(e.scenariosUnitType=t.scenariosUnitType),d.isBoolean(t.grouped)&&(e.grouped=t.grouped),d.isBoolean(t.showGroupTitle)&&(e.showGroupTitle=t.showGroupTitle),d.isBoolean(t.showMeasureScale)&&(e.showMeasureScale=t.showMeasureScale),d.isArray(t.thereOf)&&(e.thereOf=f.adaptArray(t.thereOf,this.tableDrillGroupAdapter)),d.isExisting(t.categoryThereOf)&&(e.categoryThereOf=t.categoryThereOf),d.isArray(t.partOf)&&(e.partOf=f.adaptArray(t.partOf,this.tableDrillGroupAdapter)),d.isExisting(t.order)&&(e.sortOrder=this.orderAdapter.adapt(t.order)),d.isExisting(t.type)&&(e.type=t.type),d.isNumber(t.limit)&&(e.limit=t.limit),d.isExisting(t.i18n)&&(e.i18n=t.i18n),d.isExisting(t.categoryWidth)&&(e.categoryWidth=t.categoryWidth),d.isExisting(t.measureScale)&&(e.measureScale=g.calculateMeasureScale(this.dataSet,e.scenarios,t.measureScale)),d.isExisting(t.measureType)&&(e.measureType=t.measureType),d.isString(t.measureUnit)&&(e.measureUnit=t.measureUnit),d.isString(t.filter)&&(e.filter=t.filter.trim()),d.isArray(t.barColumns)&&(e.barColumns=t.barColumns),e}default(){return new z}}class V{constructor(){this.rowGroup="",this.category="",this.subCategory="",this.partOf=""}}class Q{constructor(){}adapt(t){const e=new V;return d.isString(t.rowGroup)&&(e.rowGroup=t.rowGroup),d.isString(t.category)&&(e.category=t.category),d.isString(t.subCategory)&&(e.subCategory=t.subCategory),d.isString(t.partOf)&&(e.partOf=t.partOf),e}default(){return new V}}class q{constructor(){this.operation="+"}addRowGroup(t,e){this.rowGroup=t,this.rowGroupIndex=e}addCategory(t,e){this.category=t,this.categoryIndex=e}addSubCategory(t,e){this.subCategory=t,this.subCategoryIndex=e}addColumnGroup(t,e){this.columnGroup=t,this.columnGroupIndex=e}addSubColumnGroup(t,e){this.columnSubGroup=t,this.columnSubGroupIndex=e}}class K{constructor(){}adapt(t){const e=new q;return d.isOperator(t.operation)&&(e.operation=t.operation),d.isNumber(t.rowGroupIndex)&&d.isString(t.rowGroup)&&e.addRowGroup(t.rowGroup,t.rowGroupIndex),d.isNumber(t.categoryIndex)&&d.isString(t.category)&&e.addCategory(t.category,t.categoryIndex),d.isNumber(t.subCategoryIndex)&&d.isString(t.subCategory)&&e.addSubCategory(t.subCategory,t.subCategoryIndex),d.isNumber(t.columnGroupIndex)&&d.isString(t.columnGroup)&&e.addColumnGroup(t.columnGroup,t.columnGroupIndex),d.isNumber(t.columnSubGroupIndex)&&d.isString(t.columnSubGroup)&&e.addSubColumnGroup(t.columnSubGroup,t.columnSubGroupIndex),this.setActualValues(t,e),this.setPlanValues(t,e),this.setPreviousPeriodValues(t,e),this.setForecastValues(t,e),e}default(){return new q}setActualValues(t,e){d.isNumber(t.ac1)&&(e.ac1=t.ac1),d.isNumber(t.ac2)&&(e.ac2=t.ac2),d.isNumber(t.ac3)&&(e.ac3=t.ac3),d.isNumber(t.ac4)&&(e.ac4=t.ac4)}setPlanValues(t,e){d.isNumber(t.pp1)&&(e.pp1=t.pp1),d.isNumber(t.pp2)&&(e.pp2=t.pp2),d.isNumber(t.pp3)&&(e.pp3=t.pp3),d.isNumber(t.pp4)&&(e.pp4=t.pp4)}setPreviousPeriodValues(t,e){d.isNumber(t.pl1)&&(e.pl1=t.pl1),d.isNumber(t.pl2)&&(e.pl2=t.pl2),d.isNumber(t.pl3)&&(e.pl3=t.pl3),d.isNumber(t.pl4)&&(e.pl4=t.pl4)}setForecastValues(t,e){d.isNumber(t.fc1)&&(e.fc1=t.fc1),d.isNumber(t.fc2)&&(e.fc2=t.fc2),d.isNumber(t.fc3)&&(e.fc3=t.fc3),d.isNumber(t.fc4)&&(e.fc4=t.fc4)}}const J=e(class extends o{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.data=[],this.tableTitle="SUM_TOTAL",this.scenarios=[],this.scenariosDataFormat=u.DECIMAL,this.grouped=!1,this.limit=0,this.showGroupTitle=!0,this.thereof=[],this.partof=[],this.order={hierarchy:[],direction:M.ASC},this.categorythereof=new Map,this.type=y.LIST,this.categoryWidth=m.INF,this.dataFormatDigits={percent:2,decimal:1},this.i18n=new Map,this.i18nMode=h.ALL,this.measureScale="_",this.measureUnit="",this.showMeasureScale=!0,this.measureType=$.VOLUME,this.filter="",this.barColumns=[],this.barColumnMaxWidth=30,this.unitScaling=.01,this.percentageScaling=.5,this.scaleFactor=1,this.componentDataFormatDigits=new w,this.componentStyle=S(this)}render(){return t(n,null,(()=>{if(void 0!==this.table){if(this.table.hasNoData()){const e=this.i18n.get("NO_DATA")||"==No Data==";return t("p",{class:"warning"},e)}return t("table",null,t("thead",null,this.table.getHeader().map((e=>t("tr",{class:e.cssStyle},e.getCells().map((e=>t("th",{colSpan:e.colSpan,class:e.cssStyle},e.getAsHeaderList().map(((o,n,s)=>t("span",null,n===s.length-1?t("span",{class:" "===o?"table-footer":""},o,e.drawPrefix()," "):t("span",null,o,e.drawPrefix(),t("br",null)))))))))))),t("tbody",null,this.table.getBody().map((e=>t("tr",{class:e.cssStyle},null==e?void 0:e.getCells().map((o=>t("td",{colSpan:o.colSpan,class:o.type?`${o.cssStyle} ${o.type}`:o.cssStyle},null!=o.prefix?t("span",{class:o.cssStyle+" "+o.prefixStyle},o.drawPrefix()):"",o.isBarChart&&o.columnStats&&e.type!==U.SUM?t(F,{value:o.value,scenario:o.key,columnStats:o.columnStats,height:18*this.scaleFactor,isRelative:o.key.startsWith("dr"),isPositiveGood:o.key.endsWith("_pos"),measureScale:o.measureScale,maxBarWidth:this.barColumnMaxWidth,styles:this.barChartStyles}):o.draw(this.componentDataFormatDigits)))))))))}})())}componentWillRender(){const t=this.prepareConfig(),e=this.prepareData();this.componentDataFormatDigits=(new b).adapt(this.dataFormatDigits),this.barChartStyles=this.prepareBarChartStyles(),this.table=new I(new a,e,t),this.table.setI18n(this.i18n)}prepareConfig(){return new j(new Q,new c,new p(new c),this.data).adapt({title:this.tableTitle,scenarios:this.scenarios,scenariosUnitType:this.scenariosDataFormat,grouped:this.grouped,showGroupTitle:this.showGroupTitle,thereOf:this.thereof,partOf:this.partof,categoryThereOf:this.categorythereof,order:this.order,type:this.type,limit:this.limit,i18n:this.i18nMode,categoryWidth:this.categoryWidth,measureScale:this.measureScale,measureUnit:this.measureUnit,measureType:this.measureType,showMeasureScale:this.showMeasureScale,filter:this.filter,barColumns:this.barColumns})}prepareData(){return f.adaptArray(this.data,new K)}prepareBarChartStyles(){return this.componentStyle((t=>{var e,o,n,s,r,i,l,a,c,h,u,d,f,p,m,$,v,g,R,w,b,S,E,O,y,M;const U=null===(e=t["bn-chart-time"])||void 0===e?void 0:e.varianceStyles,G=null===(o=t["bn-chart-time"])||void 0===o?void 0:o.barStyles;return{positive:{stroke:(null===(n=null==U?void 0:U.pos)||void 0===n?void 0:n.stroke)||"#008f96",fill:(null===(s=null==U?void 0:U.pos)||void 0===s?void 0:s.fill)||"#008f96",fillpattern:(null===(r=null==U?void 0:U.pos)||void 0===r?void 0:r.fillpattern)||"solid"},negative:{stroke:(null===(i=null==U?void 0:U.neg)||void 0===i?void 0:i.stroke)||"#ff0000",fill:(null===(l=null==U?void 0:U.neg)||void 0===l?void 0:l.fill)||"#ff0000",fillpattern:(null===(a=null==U?void 0:U.neg)||void 0===a?void 0:a.fillpattern)||"solid"},neutral:{stroke:(null===(c=null==U?void 0:U.neu)||void 0===c?void 0:c.stroke)||"#808080",fill:(null===(h=null==U?void 0:U.neu)||void 0===h?void 0:h.fill)||"#808080",fillpattern:(null===(u=null==U?void 0:U.neu)||void 0===u?void 0:u.fillpattern)||"outlined"},scenarios:{ac:{stroke:(null===(d=null==G?void 0:G.ac)||void 0===d?void 0:d.stroke)||"#404040",fill:(null===(f=null==G?void 0:G.ac)||void 0===f?void 0:f.fill)||"#404040",fillpattern:(null===(p=null==G?void 0:G.ac)||void 0===p?void 0:p.fillpattern)||"solid"},pp:{stroke:(null===(m=null==G?void 0:G.pp)||void 0===m?void 0:m.stroke)||"#A6A6A6",fill:(null===($=null==G?void 0:G.pp)||void 0===$?void 0:$.fill)||"#A6A6A6",fillpattern:(null===(v=null==G?void 0:G.pp)||void 0===v?void 0:v.fillpattern)||"solid"},fc:{stroke:(null===(g=null==G?void 0:G.fc)||void 0===g?void 0:g.stroke)||"#404040",fill:(null===(R=null==G?void 0:G.fc)||void 0===R?void 0:R.fill)||"#ffffff",fillpattern:(null===(w=null==G?void 0:G.fc)||void 0===w?void 0:w.fillpattern)||"hatched"},pl:{stroke:(null===(b=null==G?void 0:G.pl)||void 0===b?void 0:b.stroke)||"#404040",fill:(null===(S=null==G?void 0:G.pl)||void 0===S?void 0:S.fill)||"#ffffff",fillpattern:(null===(E=null==G?void 0:G.pl)||void 0===E?void 0:E.fillpattern)||"outlined"}},fontColor:(null===(O=t.global)||void 0===O?void 0:O.fontColor)||"#000000",fontSize:.85*((null===(y=t.global)||void 0===y?void 0:y.fontSizePx)||13.3333)*this.scaleFactor,fontFamily:(null===(M=t.global)||void 0===M?void 0:M.fontFamily)||"'Noto Sans', sans-serif",unitScaling:this.unitScaling,percentageScaling:this.percentageScaling,scaleFactor:this.scaleFactor}}))}get element(){return this}static get style(){return':host{position:relative;display:inline-block}table{background-color:var(--bn-font-background, white);font-size:var(--bn-font-size, 1em);color:var(--bn-font-color, black);font-family:var(--bn-font-family, "Noto Sans", "Helvetica Neue", Helvetica, sans-serif);border-spacing:0.3em 0}thead{border-style:none}tr:first-child td{border-top:none;padding-top:0.5em}td.ac1,td.ac2,td.ac3,td.ac4,td.pp1,td.pp2,td.pp3,td.pp4,td.pl1,td.pl2,td.pl3,td.pl4,td.fc1,td.fc2,td.fc3,td.fc4,td.share,td.variance,td.pos_pos,td.pos_neg,td.neg_pos,td.neg_neg,td.pos_neutral,td.neg_neutral{text-align:right}.category-w100{min-width:100em;max-width:100em}.category-w50{min-width:50em;max-width:50em}.category-w25{min-width:25em;max-width:25em}.category-w20{min-width:20em;max-width:20em}.category-w15{min-width:15em;max-width:15em}.category-w10{min-width:10em;max-width:10em}.category-w5{min-width:5em;max-width:5em}.prefix-second{color:transparent;font-style:normal}.prefix-first{font-style:normal}th{border-bottom:0.1em solid black;text-align:right;font-weight:normal;vertical-align:text-top}td.columnGroup,th.columnGroup{font-size:0.6em}td.columnSubGroup,th.columnSubGroup{font-size:0.6em;border-spacing:0em 0;font-style:italic}td.base,th.base{font-style:normal}th.ofit,td.ofit,tr.ofit,th.partof,td.partof,tr.partof{font-size:0.6em;font-style:italic}td.ofit,td.partof{font-size:0.6em;font-style:italic}th.ofit td,tr.ofit td,th.partof td,tr.partof td{border-top:0em solid black;padding-left:1em}th.ofit share,th.partof share,tr.share td{border-top:0em solid black}th.share,tr.share,td.share{font-size:0.6em;font-style:italic}th.filler{border-bottom:0em solid black;text-align:right}td.filler{border-top:0em none !important;border-bottom:0em none;text-align:right}th.group{text-align:center;border-spacing:1em 0}th.headerlabel{border-bottom:0em none black;padding-bottom:0em}td.variance:after{content:"%"}td.relative_variance{font-style:italic}td.percent{font-style:italic;text-align:right}td.decimal{text-align:right}td.pos_pos{color:#008f96}td.neg_pos{color:#ff0000}td.pos_neg{color:#ff0000}td.neg_neg{color:#008f96}td.pos_pos:before{content:"+"}td.pos_neg:before{content:"+"}td.pos_neu:before{content:"+"}th.ac1,th.ac2,th.ac3,th.ac4{padding-top:0em;border-bottom:0.3em solid black}th.pp1,th.pp2,th.pp3,th.pp4{padding-top:0em;border-bottom:0.3em solid grey}th.pl1,th.pl2,th.pl3,th.pl4{padding-top:0em;border-bottom:0.3em double black}th.fc1,th.fc2,th.fc3,th.fc4{border-bottom:0.3em solid;border-image:repeating-linear-gradient(-45deg, white, white, black, white, white 0.3em) 2}td.colsum{font-weight:bold}th.colsum{padding-top:0em;font-weight:bold}tr.sum td{border-top:0.1em solid black;font-weight:bold;padding-bottom:0.5em}tr.groupheader td{border-top:0em dotted #ddd;padding-top:0.5em;font-weight:bold;font-style:italic}tr.begingroup td{border-top:0em dotted #ddd;padding-top:0.5em}th.begin-group{padding-left:0.75em}th.end-group{padding-left:0.75em}td{box-sizing:border-box;-webkit-box-sizing:border-box;border-top:0.1em dashed #ddd;padding-left:0.5em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.table-footer{font-size:0.6em}.cell-bar-chart{display:inline-block;vertical-align:middle}.bar-chart-empty{color:#999}td:has(.cell-bar-chart){padding:0 0.25em;vertical-align:middle}td:has(.cell-bar-chart).pos_pos:before,td:has(.cell-bar-chart).pos_neg:before,td:has(.cell-bar-chart).pos_neu:before{content:none}td:has(.cell-bar-chart).variance:after{content:none}'}},[1,"ibcs-table",{data:[16],tableTitle:[1,"table-title"],scenarios:[16],scenariosDataFormat:[1,"scenarios-data-format"],grouped:[4],limit:[2],showGroupTitle:[4,"show-group-title"],thereof:[16],partof:[16],order:[16],categorythereof:[16],type:[1],categoryWidth:[1,"category-width"],dataFormatDigits:[16],i18n:[1040],i18nMode:[1,"i18n-mode"],measureScale:[1,"measure-scale"],measureUnit:[1,"measure-unit"],showMeasureScale:[4,"show-measure-scale"],measureType:[1,"measure-type"],filter:[1],barColumns:[16],barColumnMaxWidth:[2,"bar-column-max-width"],unitScaling:[2,"unit-scaling"],percentageScaling:[2,"percentage-scaling"],scaleFactor:[2,"scale-factor"]}]);function X(){"undefined"!=typeof customElements&&["ibcs-table"].forEach((t=>{"ibcs-table"===t&&(customElements.get(s(t))||customElements.define(s(t),J))}))}export{J as I,y as T,X as d}
@@ -1 +1 @@
1
- import{proxyCustomElement as t,HTMLElement as s,h as i,transformTag as e}from"@stencil/core/internal/client";import{I as n,i as r,j as a,f as o,b as c,k as h}from"./Order.js";import{b as l,D as u,a as d}from"./DateStringFactory.js";import{F as p,I as f,S as b}from"./ibcsRuleSet.js";class m{constructor(){}createMeasures(t,s,i){if(this.allMeasuresUseSameUnit(t)){const e=t.length;let r="",a="";for(let o=0;o<e;o++){let c="";o>0&&(c=s.get("SEPERATOR_WS")),e>1&&o===e-1&&(c=s.get("CONNECTOR_WS")),i===n.ALL?(r=(s.get(r)||r)+c+(s.get(t[o].name)||t[o].name),a=s.get(t[o].unit)||t[o].unit):(r=r+c+t[o].name,a=t[o].unit)}return[{name:r,unit:a}]}return t}createDimension(t,s,i,e,n){let r="";return void 0!==s&&(r=(new l).getDateLinkString(s.start,s.end,s.link,s.format,n)),r+t.map((t=>{let s="";return null!=i&&null!=i.hierarchy&&i.hierarchy.find((s=>s===t))&&(s=e.get("asc"===i.direction?"ORDER_asc":"ORDER_desc")),"".concat(" ",p.translateScenarioLabel(t,e),s)})).toString()}allMeasuresUseSameUnit(t){const s=new Map;return t.forEach((function(t){s.set(t.unit,!0)})),1===s.size}}class w{constructor(){this.businessunit="",this.measures=[],this.scenarios=[],this.i18nMode=n.ALL,this.intervalSpanLimit=32}}class _{constructor(t,s,i,e){this.measureEntryAdapter=t,this.timePeriodAdapter=s,this.orderAdapter=i,this.stringAdapter=e}adapt(t){const s=new w;return r.isString(t.businessunit)&&(s.businessunit=t.businessunit),r.isArray(t.measures)&&(s.measures=a.adaptArray(t.measures,this.measureEntryAdapter)),r.isArray(t.scenarios)&&(s.scenarios=a.adaptArray(t.scenarios,this.stringAdapter)),r.isExisting(t.timeperiod)&&(s.timeperiod=this.timePeriodAdapter.adapt(t.timeperiod)),r.isNumber(t.intervalSpanLimit)&&(s.intervalSpanLimit=t.intervalSpanLimit),r.isExisting(t.i18nMode)&&(s.i18nMode=t.i18nMode),r.isExisting(t.order)&&(s.order=this.orderAdapter.adapt(t.order)),s}default(){return new w}}var v;!function(t){t[t.UP_TO_DATE=0]="UP_TO_DATE",t[t.DIRTY=1]="DIRTY"}(v||(v={}));class y{constructor(t){this.i18n=new Map,this.unit="",this.measures=[],this.dimension="",this.config=new w,this.state=v.DIRTY,this.ruleSet=t||new f,this.dataSetFactory=new m,this.state=v.DIRTY,this.setI18n(new Map)}setI18n(t){this.state=v.DIRTY;const s=new Map([["SEPERATOR_WS",", "],["in","in"],["ORDER_asc","↑"],["ORDER_desc","↓"],["ac1","AC"],["pp1","PY"],["fc1","FC"],["pl1","PL"],["ac2","AC2"],["pp2","PY2"],["fc2","FC2"],["pl2","PL2"],["ac3","AC3"],["pp3","PY3"],["fc3","FC3"],["pp3","PL3"],["ac4","AC4"],["py4","PY4"],["fc4","FC4"],["pp4","PL4"],["category"," "],["operation"," "],["there_of","davon"],["part_of","in % von"],["ibcssymbol_delta_ac","Δ{%}"],["ibcssymbol_delta_generic","Δ({%})"],["ibcssymbol_delta_ac_relative","Δ{%}%"],["ibcssymbol_delta_generic_relative","Δ({%})%"],["SUM_TOTAL","❖"],["CONNECTOR_WS"," und "]]);this.i18n=new Map([...s,...t||new Map])}update(){return v.DIRTY===this.state&&(this.unit=this.config.businessunit,this.measures=this.dataSetFactory.createMeasures(this.config.measures,this.i18n,this.config.i18nMode),this.dimension=this.dataSetFactory.createDimension(this.config.scenarios,this.config.timeperiod,this.config.order,this.i18n,this.config.intervalSpanLimit),this.state=v.UP_TO_DATE),this}setConfig(t){this.config=this.initConfig(t)}initConfig(t){this.state=v.DIRTY;const s=t,i=this;return t.scenarios.sort(((t,s)=>i.ruleSet.getScenarioSorIndex(t)-i.ruleSet.getScenarioSorIndex(s))),s}}class R{constructor(t="",s=""){this.name=t,this.unit=s}}class E{construnctor(){}adapt(t){const s=new R;return r.isString(t.name)&&(s.name=t.name),r.isString(t.unit)&&(s.unit=t.unit),s}default(){return new R("","")}}class S{constructor(t=o.now(),s=o.now(),i=u.AUTO,e=d.AUTO){this.start=t,this.end=s,this.format=i,this.link=e}}class C{construnctor(){}adapt(t){const s=new S;return r.isDate(t.start)&&(s.start=t.start),r.isDate(t.end)&&(s.end=t.end),r.isExisting(t.format)&&(s.format=t.format),r.isExisting(t.link)&&(s.link=t.link),s}default(){return new S}}const O=t(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.businessUnit="",this.scenarios=[],this.measures=[],this.intervalSpanLimit=28,this.order={hierarchy:[],direction:c.ASC},this.i18n=new Map,this.i18nMode=n.ALL,this.title=new y(new f)}async setBusinessUnit(t){this.businessUnit=t}async setProps(t){Object.keys(t).forEach((s=>{this[s]=t[s]}))}render(){return i("div",{key:"08439c867ae47a9ee17ef8280801896a823c8826"},i("div",{key:"bb5b7325de2ae2f2e0bdba8d7f7f36511835efa9"},this.title.unit),i("div",{key:"3edb730c95280ca0c47db70e32dd8e471747d989"},this.title.measures.map(((t,s)=>i("span",null,this.isFirstElement(s)?this.title.i18n.get("SEPERATOR_WS"):"",i("span",{class:"measure"},t.name)," ",t.unit?this.title.i18n.get("in"):""," ",t.unit)))),i("div",{key:"3bae51f2fddef6b2195d1c24915512b6255c9a75"},this.title.dimension))}componentWillLoad(){const t=this.prepareConfig();this.title=new y(new f),this.title.setI18n(this.i18n),this.title.setConfig(t)}componentWillUpdate(){const t=this.prepareConfig();this.title.setI18n(this.i18n),this.title.setConfig(t)}componentWillRender(){this.title.update()}isFirstElement(t){return 0!==t}prepareConfig(){return new _(new E,new C,new h(new b),new b).adapt({businessunit:this.businessUnit,measures:this.measures,scenarios:this.scenarios,timeperiod:this.timeperiod,intervalSpanLimit:this.intervalSpanLimit,i18nMode:this.i18nMode,order:this.order})}static get style(){return':host{display:block;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000)}.measure{font-weight:bold}div{background-color:var(--bn-font-background, white);color:var(--bn-font-color, black)}'}},[1,"ibcs-title",{businessUnit:[1537,"business-unit"],scenarios:[16],measures:[16],timeperiod:[16],intervalSpanLimit:[2,"interval-span-limit"],order:[16],i18n:[1040],i18nMode:[1,"i18n-mode"],setBusinessUnit:[64],setProps:[64]}]);function P(){"undefined"!=typeof customElements&&["ibcs-title"].forEach((t=>{"ibcs-title"===t&&(customElements.get(e(t))||customElements.define(e(t),O))}))}export{O as I,P as d}
1
+ import{proxyCustomElement as t,HTMLElement as s,h as i,transformTag as e}from"@stencil/core/internal/client";import{I as n,j as r,k as a,f as o,b as c,l as h}from"./Order.js";import{b as l,D as u,a as d}from"./DateStringFactory.js";import{F as p,I as f,S as b}from"./ibcsRuleSet.js";class m{constructor(){}createMeasures(t,s,i){if(this.allMeasuresUseSameUnit(t)){const e=t.length;let r="",a="";for(let o=0;o<e;o++){let c="";o>0&&(c=s.get("SEPERATOR_WS")),e>1&&o===e-1&&(c=s.get("CONNECTOR_WS")),i===n.ALL?(r=(s.get(r)||r)+c+(s.get(t[o].name)||t[o].name),a=s.get(t[o].unit)||t[o].unit):(r=r+c+t[o].name,a=t[o].unit)}return[{name:r,unit:a}]}return t}createDimension(t,s,i,e,n){let r="";return void 0!==s&&(r=(new l).getDateLinkString(s.start,s.end,s.link,s.format,n)),r+t.map((t=>{let s="";return null!=i&&null!=i.hierarchy&&i.hierarchy.find((s=>s===t))&&(s=e.get("asc"===i.direction?"ORDER_asc":"ORDER_desc")),"".concat(" ",p.translateScenarioLabel(t,e),s)})).toString()}allMeasuresUseSameUnit(t){const s=new Map;return t.forEach((function(t){s.set(t.unit,!0)})),1===s.size}}class w{constructor(){this.businessunit="",this.measures=[],this.scenarios=[],this.i18nMode=n.ALL,this.intervalSpanLimit=32}}class _{constructor(t,s,i,e){this.measureEntryAdapter=t,this.timePeriodAdapter=s,this.orderAdapter=i,this.stringAdapter=e}adapt(t){const s=new w;return r.isString(t.businessunit)&&(s.businessunit=t.businessunit),r.isArray(t.measures)&&(s.measures=a.adaptArray(t.measures,this.measureEntryAdapter)),r.isArray(t.scenarios)&&(s.scenarios=a.adaptArray(t.scenarios,this.stringAdapter)),r.isExisting(t.timeperiod)&&(s.timeperiod=this.timePeriodAdapter.adapt(t.timeperiod)),r.isNumber(t.intervalSpanLimit)&&(s.intervalSpanLimit=t.intervalSpanLimit),r.isExisting(t.i18nMode)&&(s.i18nMode=t.i18nMode),r.isExisting(t.order)&&(s.order=this.orderAdapter.adapt(t.order)),s}default(){return new w}}var v;!function(t){t[t.UP_TO_DATE=0]="UP_TO_DATE",t[t.DIRTY=1]="DIRTY"}(v||(v={}));class y{constructor(t){this.i18n=new Map,this.unit="",this.measures=[],this.dimension="",this.config=new w,this.state=v.DIRTY,this.ruleSet=t||new f,this.dataSetFactory=new m,this.state=v.DIRTY,this.setI18n(new Map)}setI18n(t){this.state=v.DIRTY;const s=new Map([["SEPERATOR_WS",", "],["in","in"],["ORDER_asc","↑"],["ORDER_desc","↓"],["ac1","AC"],["pp1","PY"],["fc1","FC"],["pl1","PL"],["ac2","AC2"],["pp2","PY2"],["fc2","FC2"],["pl2","PL2"],["ac3","AC3"],["pp3","PY3"],["fc3","FC3"],["pp3","PL3"],["ac4","AC4"],["py4","PY4"],["fc4","FC4"],["pp4","PL4"],["category"," "],["operation"," "],["there_of","davon"],["part_of","in % von"],["ibcssymbol_delta_ac","Δ{%}"],["ibcssymbol_delta_generic","Δ({%})"],["ibcssymbol_delta_ac_relative","Δ{%}%"],["ibcssymbol_delta_generic_relative","Δ({%})%"],["SUM_TOTAL","❖"],["CONNECTOR_WS"," und "]]);this.i18n=new Map([...s,...t||new Map])}update(){return v.DIRTY===this.state&&(this.unit=this.config.businessunit,this.measures=this.dataSetFactory.createMeasures(this.config.measures,this.i18n,this.config.i18nMode),this.dimension=this.dataSetFactory.createDimension(this.config.scenarios,this.config.timeperiod,this.config.order,this.i18n,this.config.intervalSpanLimit),this.state=v.UP_TO_DATE),this}setConfig(t){this.config=this.initConfig(t)}initConfig(t){this.state=v.DIRTY;const s=t,i=this;return t.scenarios.sort(((t,s)=>i.ruleSet.getScenarioSorIndex(t)-i.ruleSet.getScenarioSorIndex(s))),s}}class R{constructor(t="",s=""){this.name=t,this.unit=s}}class E{construnctor(){}adapt(t){const s=new R;return r.isString(t.name)&&(s.name=t.name),r.isString(t.unit)&&(s.unit=t.unit),s}default(){return new R("","")}}class S{constructor(t=o.now(),s=o.now(),i=u.AUTO,e=d.AUTO){this.start=t,this.end=s,this.format=i,this.link=e}}class C{construnctor(){}adapt(t){const s=new S;return r.isDate(t.start)&&(s.start=t.start),r.isDate(t.end)&&(s.end=t.end),r.isExisting(t.format)&&(s.format=t.format),r.isExisting(t.link)&&(s.link=t.link),s}default(){return new S}}const O=t(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.businessUnit="",this.scenarios=[],this.measures=[],this.intervalSpanLimit=28,this.order={hierarchy:[],direction:c.ASC},this.i18n=new Map,this.i18nMode=n.ALL,this.title=new y(new f)}async setBusinessUnit(t){this.businessUnit=t}async setProps(t){Object.keys(t).forEach((s=>{this[s]=t[s]}))}render(){return i("div",{key:"08439c867ae47a9ee17ef8280801896a823c8826"},i("div",{key:"bb5b7325de2ae2f2e0bdba8d7f7f36511835efa9"},this.title.unit),i("div",{key:"3edb730c95280ca0c47db70e32dd8e471747d989"},this.title.measures.map(((t,s)=>i("span",null,this.isFirstElement(s)?this.title.i18n.get("SEPERATOR_WS"):"",i("span",{class:"measure"},t.name)," ",t.unit?this.title.i18n.get("in"):""," ",t.unit)))),i("div",{key:"3bae51f2fddef6b2195d1c24915512b6255c9a75"},this.title.dimension))}componentWillLoad(){const t=this.prepareConfig();this.title=new y(new f),this.title.setI18n(this.i18n),this.title.setConfig(t)}componentWillUpdate(){const t=this.prepareConfig();this.title.setI18n(this.i18n),this.title.setConfig(t)}componentWillRender(){this.title.update()}isFirstElement(t){return 0!==t}prepareConfig(){return new _(new E,new C,new h(new b),new b).adapt({businessunit:this.businessUnit,measures:this.measures,scenarios:this.scenarios,timeperiod:this.timeperiod,intervalSpanLimit:this.intervalSpanLimit,i18nMode:this.i18nMode,order:this.order})}static get style(){return':host{display:block;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000)}.measure{font-weight:bold}div{background-color:var(--bn-font-background, white);color:var(--bn-font-color, black)}'}},[1,"ibcs-title",{businessUnit:[1537,"business-unit"],scenarios:[16],measures:[16],timeperiod:[16],intervalSpanLimit:[2,"interval-span-limit"],order:[16],i18n:[1040],i18nMode:[1,"i18n-mode"],setBusinessUnit:[64],setProps:[64]}]);function P(){"undefined"!=typeof customElements&&["ibcs-title"].forEach((t=>{"ibcs-title"===t&&(customElements.get(e(t))||customElements.define(e(t),O))}))}export{O as I,P as d}
@@ -1 +1 @@
1
- import{j as t}from"./Order.js";import{g as r}from"./_commonjsHelpers.js";class i{adapt(r){return t.adaptDefaultString(r)}default(){return""}}class e{constructor(t){this.type="",this.base="",this.delta="",this.direction="",this.isValid=!1;const r=/(d|dr)(pl\d|ac\d|fc\d|pp\d)_(pl\d|ac\d|fc\d|pp\d)_(pos|neg|neu)/;if(r.test(t)){const i=r.exec(t);null!=i&&(this.type=String(i[1]),this.base=String(i[2]),this.delta=String(i[3]),this.direction=String(i[4]),this.isValid=!0)}}}var s;!function(t){t.OPERATION="operation",t.ROWGROUP="rowGroup",t.ROWGROUPINDEX="rowGroupIndex",t.CURRENTROW="currentRow",t.CATEGORY="category",t.CATEGORYINDEX="categoryIndex",t.SUBCATEGORY="subCategory",t.SUBCATEGORYINDEX="subCategoryIndex",t.COLUMNGROUP="columnGroup",t.COLUMNGROUPINDEX="columnIndex",t.COLUMNSUBGROUP="columnSubGroup",t.COLUMNSUBGROUPINDEX="columnSubGroupIndex",t.AC1="ac1",t.AC2="ac2",t.AC3="ac3",t.AC4="ac4",t.PP1="pp1",t.PP2="pp2",t.PP3="pp3",t.PP4="pp4",t.FC1="fc1",t.FC2="fc2",t.FC3="fc3",t.FC4="fc4",t.PL1="pl1",t.PL2="pl2",t.PL3="pl3",t.PL4="pl4",t.TOTALROWCOUNT="totalRowCnt",t.ROWNR="rowNr",t.TYPE="type"}(s||(s={}));var n,o={},a=r(function(){if(n)return o;n=1;var t={};return Object.defineProperty(o,"__esModule",{value:!0}),o.default=function(r,i){void 0===i&&(i={});var e=JSON.stringify({text:r,options:i});if(t[e])return t[e];i.font=i.font||"Times",i.fontSize=i.fontSize||"16px",i.fontWeight=i.fontWeight||"normal",i.width=i.width||"auto";var s=function(t,r){var i=document.createElement("div"),e=document.createTextNode(t);return i.appendChild(e),i.style.fontFamily=r.font,i.style.fontSize=r.fontSize,i.style.fontWeight=r.fontWeight,i.style.position="absolute",i.style.visibility="hidden",i.style.left="-999px",i.style.top="-999px",i.style.width=r.width,i.style.height="auto",document.body.appendChild(i),i}(r,i),n={width:s.offsetWidth,height:s.offsetHeight};return function(t){t.parentNode.removeChild(t)}(s),t[e]=n,n},o}());class c{static number(t,r="decimal",i=1,e=0,s=1){return(t/s).toLocaleString("de-DE",{style:r,useGrouping:!0,maximumFractionDigits:i,minimumFractionDigits:e}).replace(/\s+(%)/g,"$1").replace(/\s/g,this.postfixSeperator).replace(/\./g,this.tsdDelimiter)}static translateScenarioLabel(t,r){if(null==t)return"";const i=new e(t);if(!i.isValid)return`${r.get(t)||t}`;let n,o;return s.AC1===i.base?(n=r.get("dr"===i.type?"ibcssymbol_delta_ac_relative":"ibcssymbol_delta_ac"),o=r.get(i.delta)||i.delta):(n=r.get("dr"===i.type?"ibcssymbol_delta_generic_relative":"ibcssymbol_delta_generic"),o=`${r.get(i.base)||i.base} - ${r.get(i.delta)||i.delta}`),void 0===n&&(n="{%}"),`${n.replace("{%}",o)}`}static getMaxWidthOfArrayItems(t,r,i){return a(t.map((t=>c.translateScenarioLabel(t,r))).reduce(((t,r)=>t.length<r.length?r:t),""),{font:i.fontStyles.font,fontSize:i.fontStyles.size+"px"}).width}}c.tsdDelimiter=".",c.postfixSeperator=",";class d{constructor(){this._dateFormat={year:"YYYY",quarter:"Q[Q] YYYY",month:"MMM YYYY",locale:"[KW]WW YYYY",day:"DD.MM.YYYY"},this._dateLinkFormat={avg:"Ø[DATE]",interval:"[DATE]..[DATE]",start:".[DATE]",end:"[DATE].",ytd:"_[DATE]",ytg:"[DATE]_",cum:"[DATE]_[DATE]",mat:"~[DATE]",none:"[DATE]"},this._scenarioMap=new Map,this._fallBackScenario={name:"Series",group:"Series",colorIndex:10,sortIndex:120},this.createScenarioMapEntry("ac","AC",10,400),this.createScenarioMapEntry("fc","FC",30,300),this.createScenarioMapEntry("pl","PL",50,200),this.createScenarioMapEntry("bu","BU",50,200),this.createScenarioMapEntry("pp","PP",20,100),this.createScenarioMapEntry("py","PY",20,100),this.createScenarioMapEntry("dac","dAC",10,1400),this.createScenarioMapEntry("dfc","dFC",30,1300),this.createScenarioMapEntry("dpl","dPL",50,1200),this.createScenarioMapEntry("dbu","dBU",50,1200),this.createScenarioMapEntry("dpp","dPP",20,1100),this.createScenarioMapEntry("dpy","dPY",20,1100),this.createScenarioMapEntry("drac","drAC",10,2400),this.createScenarioMapEntry("drfc","drFC",30,2300),this.createScenarioMapEntry("drpl","drPL",50,2200),this.createScenarioMapEntry("drbu","drBU",50,2200),this.createScenarioMapEntry("drpp","drPP",20,2100),this.createScenarioMapEntry("drpy","drPY",20,2100)}createScenarioMapEntry(t,r,i,e){const s=r,n=i;[1,2,3,4].forEach((i=>{this._scenarioMap.set(t+i,{name:r+i,group:s,colorIndex:n,sortIndex:e+10*i})}))}getScenario(t){return this._scenarioMap.has(t)?this._scenarioMap.get(t):this._fallBackScenario}getScenarioGroup(t){return this._scenarioMap.has(t)?this._scenarioMap.get(t).name:this._fallBackScenario.name}getScenarioColorIndex(t){return this._scenarioMap.has(t)?this._scenarioMap.get(t).colorIndex:this._fallBackScenario.colorIndex}getScenarioSorIndex(t){const r=this.normalizeVarianceScenario(t);return this._scenarioMap.has(r)?this._scenarioMap.get(r).sortIndex:this._fallBackScenario.sortIndex}normalizeVarianceScenario(t){if(null==t)return"";const r=new e(t);return r.isValid?r.type+r.delta:t}}export{a as C,c as F,d as I,s as Q,i as S,e as V}
1
+ import{k as t}from"./Order.js";import{g as r}from"./_commonjsHelpers.js";class i{adapt(r){return t.adaptDefaultString(r)}default(){return""}}class e{constructor(t){this.type="",this.base="",this.delta="",this.direction="",this.isValid=!1;const r=/(d|dr)(pl\d|ac\d|fc\d|pp\d)_(pl\d|ac\d|fc\d|pp\d)_(pos|neg|neu)/;if(r.test(t)){const i=r.exec(t);null!=i&&(this.type=String(i[1]),this.base=String(i[2]),this.delta=String(i[3]),this.direction=String(i[4]),this.isValid=!0)}}}var s;!function(t){t.OPERATION="operation",t.ROWGROUP="rowGroup",t.ROWGROUPINDEX="rowGroupIndex",t.CURRENTROW="currentRow",t.CATEGORY="category",t.CATEGORYINDEX="categoryIndex",t.SUBCATEGORY="subCategory",t.SUBCATEGORYINDEX="subCategoryIndex",t.COLUMNGROUP="columnGroup",t.COLUMNGROUPINDEX="columnIndex",t.COLUMNSUBGROUP="columnSubGroup",t.COLUMNSUBGROUPINDEX="columnSubGroupIndex",t.AC1="ac1",t.AC2="ac2",t.AC3="ac3",t.AC4="ac4",t.PP1="pp1",t.PP2="pp2",t.PP3="pp3",t.PP4="pp4",t.FC1="fc1",t.FC2="fc2",t.FC3="fc3",t.FC4="fc4",t.PL1="pl1",t.PL2="pl2",t.PL3="pl3",t.PL4="pl4",t.TOTALROWCOUNT="totalRowCnt",t.ROWNR="rowNr",t.TYPE="type"}(s||(s={}));var n,o={},a=r(function(){if(n)return o;n=1;var t={};return Object.defineProperty(o,"__esModule",{value:!0}),o.default=function(r,i){void 0===i&&(i={});var e=JSON.stringify({text:r,options:i});if(t[e])return t[e];i.font=i.font||"Times",i.fontSize=i.fontSize||"16px",i.fontWeight=i.fontWeight||"normal",i.width=i.width||"auto";var s=function(t,r){var i=document.createElement("div"),e=document.createTextNode(t);return i.appendChild(e),i.style.fontFamily=r.font,i.style.fontSize=r.fontSize,i.style.fontWeight=r.fontWeight,i.style.position="absolute",i.style.visibility="hidden",i.style.left="-999px",i.style.top="-999px",i.style.width=r.width,i.style.height="auto",document.body.appendChild(i),i}(r,i),n={width:s.offsetWidth,height:s.offsetHeight};return function(t){t.parentNode.removeChild(t)}(s),t[e]=n,n},o}());class c{static number(t,r="decimal",i=1,e=0,s=1){return(t/s).toLocaleString("de-DE",{style:r,useGrouping:!0,maximumFractionDigits:i,minimumFractionDigits:e}).replace(/\s+(%)/g,"$1").replace(/\s/g,this.postfixSeperator).replace(/\./g,this.tsdDelimiter)}static translateScenarioLabel(t,r){if(null==t)return"";const i=new e(t);if(!i.isValid)return`${r.get(t)||t}`;let n,o;return s.AC1===i.base?(n=r.get("dr"===i.type?"ibcssymbol_delta_ac_relative":"ibcssymbol_delta_ac"),o=r.get(i.delta)||i.delta):(n=r.get("dr"===i.type?"ibcssymbol_delta_generic_relative":"ibcssymbol_delta_generic"),o=`${r.get(i.base)||i.base} - ${r.get(i.delta)||i.delta}`),void 0===n&&(n="{%}"),`${n.replace("{%}",o)}`}static getMaxWidthOfArrayItems(t,r,i){return a(t.map((t=>c.translateScenarioLabel(t,r))).reduce(((t,r)=>t.length<r.length?r:t),""),{font:i.fontStyles.font,fontSize:i.fontStyles.size+"px"}).width}}c.tsdDelimiter=".",c.postfixSeperator=",";class d{constructor(){this._dateFormat={year:"YYYY",quarter:"Q[Q] YYYY",month:"MMM YYYY",locale:"[KW]WW YYYY",day:"DD.MM.YYYY"},this._dateLinkFormat={avg:"Ø[DATE]",interval:"[DATE]..[DATE]",start:".[DATE]",end:"[DATE].",ytd:"_[DATE]",ytg:"[DATE]_",cum:"[DATE]_[DATE]",mat:"~[DATE]",none:"[DATE]"},this._scenarioMap=new Map,this._fallBackScenario={name:"Series",group:"Series",colorIndex:10,sortIndex:120},this.createScenarioMapEntry("ac","AC",10,400),this.createScenarioMapEntry("fc","FC",30,300),this.createScenarioMapEntry("pl","PL",50,200),this.createScenarioMapEntry("bu","BU",50,200),this.createScenarioMapEntry("pp","PP",20,100),this.createScenarioMapEntry("py","PY",20,100),this.createScenarioMapEntry("dac","dAC",10,1400),this.createScenarioMapEntry("dfc","dFC",30,1300),this.createScenarioMapEntry("dpl","dPL",50,1200),this.createScenarioMapEntry("dbu","dBU",50,1200),this.createScenarioMapEntry("dpp","dPP",20,1100),this.createScenarioMapEntry("dpy","dPY",20,1100),this.createScenarioMapEntry("drac","drAC",10,2400),this.createScenarioMapEntry("drfc","drFC",30,2300),this.createScenarioMapEntry("drpl","drPL",50,2200),this.createScenarioMapEntry("drbu","drBU",50,2200),this.createScenarioMapEntry("drpp","drPP",20,2100),this.createScenarioMapEntry("drpy","drPY",20,2100)}createScenarioMapEntry(t,r,i,e){const s=r,n=i;[1,2,3,4].forEach((i=>{this._scenarioMap.set(t+i,{name:r+i,group:s,colorIndex:n,sortIndex:e+10*i})}))}getScenario(t){return this._scenarioMap.has(t)?this._scenarioMap.get(t):this._fallBackScenario}getScenarioGroup(t){return this._scenarioMap.has(t)?this._scenarioMap.get(t).name:this._fallBackScenario.name}getScenarioColorIndex(t){return this._scenarioMap.has(t)?this._scenarioMap.get(t).colorIndex:this._fallBackScenario.colorIndex}getScenarioSorIndex(t){const r=this.normalizeVarianceScenario(t);return this._scenarioMap.has(r)?this._scenarioMap.get(r).sortIndex:this._fallBackScenario.sortIndex}normalizeVarianceScenario(t){if(null==t)return"";const r=new e(t);return r.isValid?r.type+r.delta:t}}export{a as C,c as F,d as I,s as Q,i as S,e as V}
@@ -1 +1 @@
1
- import{S as n,a as r,A as t,O as u,b as e,c as o,T as a,D as i,d as s,M as c,e as l}from"./Order.js";import{D as f,a as d}from"./DateStringFactory.js";function v(n){return null==n||""===n||"null"===n}function S(r){return v(r)||"auto"===r.trim().toLowerCase()?[]:b((null==r?void 0:r.split(",").filter((r=>!(r.toUpperCase().trim()in n)))).toString())}function b(t){return v(t)?[]:t.replace(";",",").split(",").filter((t=>{var u,e,o;const a=t.split("_"),i=null===(u=a[0])||void 0===u?void 0:u.replace(/^dr|^d/,"").toUpperCase().trim(),s=null===(e=a[1])||void 0===e?void 0:e.toUpperCase().trim(),c=null===(o=a[2])||void 0===o?void 0:o.toUpperCase().trim();return 3!==a.length||!(i in n)||!(s in n)||!(c in r)}))}function m(n){return v(n)||"auto"===n.trim().toLowerCase()?[]:b(n.split(",").filter((n=>!(n.toUpperCase()in u))).toString())}function y(n){return!v(n)&&Number.isInteger(Number(n))}function N(n){return!v(n)&&!Number.isNaN(Number(n))}function O(n){return!v(n)&&(null==n?void 0:n.toUpperCase())in e}function J(n){return"auto"===(null==n?void 0:n.toLowerCase())||(null==n?void 0:n.toUpperCase())in t}function p(n){if(v(n))return[];try{const r=JSON.parse(n);if(r instanceof Array)return r.filter((n=>!(n.hasOwnProperty("name")&&n.hasOwnProperty("unit"))))}catch(n){console.error("validateMeasureList: failed to parse JSON",n)}return["Invalid JSON structure"]}function g(n){const r=Date.parse(n);return Number.isInteger(r)}function h(n){return(null==n?void 0:n.toUpperCase())in d}function k(n){return(null==n?void 0:n.toUpperCase())in f}function A(n){return(null==n?void 0:n.toUpperCase())in o}function T(n){return!v(n)&&(null==n?void 0:n.toUpperCase())in i}function j(n){return!v(n)&&["true","false",!0,!1].some((r=>r===n))}function G(n){return!v(n)&&(null==n?void 0:n.toUpperCase())in s}function w(n){if(v(n))return[];try{const r=JSON.parse(n);if(r instanceof Array)return r.filter((n=>!(n.hasOwnProperty("rowGroup")&&n.hasOwnProperty("category")&&n.hasOwnProperty("subCategory"))))}catch(n){console.error("validateThereOfJsonStr: failed to parse JSON",n)}return["Invalid JSON structure"]}function D(n){if(v(n))return[];try{const r=JSON.parse(n);if(r instanceof Array)return r.filter((n=>!(n.hasOwnProperty("rowGroup")&&n.hasOwnProperty("category"))))}catch(n){console.error("validatePartOfJsonStr: failed to parse JSON",n)}return["Invalid JSON structure"]}function E(n){return(null==n?void 0:n.trim().toUpperCase())in c}function I(n){return["_","k","M","G","T","P","E","Z","Y","m","μ","n","p","P","f","a","z","y"].includes(null==n?void 0:n.trim())||["GREATEST","LEAST"].includes(null==n?void 0:n.trim().toUpperCase())}function M(n){return(null==n?void 0:n.toUpperCase().trim())in l}function P(n){return(null==n?void 0:n.toUpperCase().trim())in a}function $(n){if(v(n))return[];try{return JSON.parse(n).filter((n=>!(n.hasOwnProperty("scenario")&&n.hasOwnProperty("name")&&n.hasOwnProperty("subGroups"))))}catch(n){console.error("validateColumnThereOfJsonStr: failed to parse JSON",n)}return["Invalid JSON structure"]}function q(n){if(v(n))return[];try{const r=JSON.parse(n);if("object"!=typeof r||null===r||Array.isArray(r))return["stack: must be a JSON object"];const t=[];if(r.hasOwnProperty("by")){const n=["scenario","category","subcategory","rowgroup"];n.includes(r.by)||t.push(`stack: 'by' must be one of: ${n.join(", ")}`)}else t.push("stack: 'by' is required");if(r.hasOwnProperty("mode")){const n=["absolute","relative","absolute-relative"];n.includes(r.mode)||t.push(`stack: 'mode' must be one of: ${n.join(", ")}`)}if(r.hasOwnProperty("order")){const n=["asc","desc","dataset"];n.includes(r.order)||t.push(`stack: 'order' must be one of: ${n.join(", ")}`)}return t}catch(n){return["stack: invalid JSON"]}}export{b as a,m as b,O as c,p as d,g as e,k as f,h as g,N as h,v as i,J as j,y as k,j as l,I as m,q as n,A as o,P as p,T as q,G as r,w as s,D as t,E as u,S as v,M as w,$ as x}
1
+ import{S as n,a as r,A as t,O as u,b as e,c as o,T as a,D as i,d as s,M as c,e as l}from"./Order.js";import{D as f,a as d}from"./DateStringFactory.js";function v(n){return null==n||""===n||"null"===n}function S(r){return v(r)||"auto"===r.trim().toLowerCase()?[]:m((null==r?void 0:r.split(",").filter((r=>!(r.toUpperCase().trim()in n)))).toString())}function m(t){return v(t)?[]:t.replace(";",",").split(",").filter((t=>{var u,e,o;const a=t.split("_"),i=null===(u=a[0])||void 0===u?void 0:u.replace(/^dr|^d/,"").toUpperCase().trim(),s=null===(e=a[1])||void 0===e?void 0:e.toUpperCase().trim(),c=null===(o=a[2])||void 0===o?void 0:o.toUpperCase().trim();return 3!==a.length||!(i in n)||!(s in n)||!(c in r)}))}function b(n){return v(n)||"auto"===n.trim().toLowerCase()?[]:m(n.split(",").filter((n=>!(n.toUpperCase()in u))).toString())}function N(n){return!v(n)&&Number.isInteger(Number(n))}function O(n){return!v(n)&&!Number.isNaN(Number(n))}function y(n){return!v(n)&&(null==n?void 0:n.toUpperCase())in e}function J(n){return"auto"===(null==n?void 0:n.toLowerCase())||(null==n?void 0:n.toUpperCase())in t}function p(n){if(v(n))return[];try{const r=JSON.parse(n);if(r instanceof Array)return r.filter((n=>!(n.hasOwnProperty("name")&&n.hasOwnProperty("unit"))))}catch(n){console.error("validateMeasureList: failed to parse JSON",n)}return["Invalid JSON structure"]}function h(n){const r=Date.parse(n);return Number.isInteger(r)}function k(n){return(null==n?void 0:n.toUpperCase())in d}function A(n){return(null==n?void 0:n.toUpperCase())in f}function T(n){return(null==n?void 0:n.toUpperCase())in o}function g(n){return!v(n)&&(null==n?void 0:n.toUpperCase())in i}function j(n){return!v(n)&&["true","false",!0,!1].some((r=>r===n))}function G(n){return!v(n)&&(null==n?void 0:n.toUpperCase())in s}function D(n){if(v(n))return[];try{const r=JSON.parse(n);if(r instanceof Array)return r.filter((n=>!(n.hasOwnProperty("rowGroup")&&n.hasOwnProperty("category")&&n.hasOwnProperty("subCategory"))))}catch(n){console.error("validateThereOfJsonStr: failed to parse JSON",n)}return["Invalid JSON structure"]}function E(n){if(v(n))return[];try{const r=JSON.parse(n);if(r instanceof Array)return r.filter((n=>!(n.hasOwnProperty("rowGroup")&&n.hasOwnProperty("category"))))}catch(n){console.error("validatePartOfJsonStr: failed to parse JSON",n)}return["Invalid JSON structure"]}function I(n){return(null==n?void 0:n.trim().toUpperCase())in c}function w(n){return["_","k","M","G","T","P","E","Z","Y","m","μ","n","p","P","f","a","z","y"].includes(null==n?void 0:n.trim())||["GREATEST","LEAST"].includes(null==n?void 0:n.trim().toUpperCase())}function M(n){return(null==n?void 0:n.toUpperCase().trim())in l}function P(n){return(null==n?void 0:n.toUpperCase().trim())in a}function $(n){if(v(n))return[];try{return JSON.parse(n).filter((n=>!(n.hasOwnProperty("scenario")&&n.hasOwnProperty("name")&&n.hasOwnProperty("subGroups"))))}catch(n){console.error("validateColumnThereOfJsonStr: failed to parse JSON",n)}return["Invalid JSON structure"]}function q(n){if(v(n))return[];try{const r=JSON.parse(n);if("object"!=typeof r||null===r||Array.isArray(r))return["stack: must be a JSON object"];const t=[];if(r.hasOwnProperty("by")){const n=["scenarios","dimensions"];n.includes(r.by)||t.push(`stack: 'by' must be one of: ${n.join(", ")}`)}else t.push("stack: 'by' is required");if(r.hasOwnProperty("mode")){const n=["absolute","relative","absolute-relative"];n.includes(r.mode)||t.push(`stack: 'mode' must be one of: ${n.join(", ")}`)}if(r.hasOwnProperty("order")){const n=["asc","desc","dataset"];n.includes(r.order)||t.push(`stack: 'order' must be one of: ${n.join(", ")}`)}return t}catch(n){return["stack: invalid JSON"]}}export{m as a,b,y as c,p as d,h as e,A as f,k as g,O as h,v as i,J as j,N as k,j as l,w as m,q as n,T as o,P as p,g as q,G as r,D as s,E as t,I as u,S as v,M as w,$ as x}
@@ -1 +1 @@
1
- import{h as t}from"./validate.js";import{forceUpdate as s,getElement as e}from"@stencil/core/internal/client";import{r as a}from"./utils.js";class r{constructor(){this.cache=new Map,this.tag=r.makeStyleTag()}static makeStyleTag(){const t=document.createElement("style");return t.type="text/css",t.setAttribute("data-bn-computed-style",""),t.append(document.createTextNode("")),(document.head||document.querySelector("head")).append(t),t}apply(t){t.forEach((t=>this.cache.set(t.className,t.style))),this.tag.innerHTML=Array.from(this.cache.values()).map((t=>t)).join("\n")}}const o=new r,n=s=>t(s)?`${s}px`:s,c={width:{className:"w",cssName:"width",attrName:"width",transform:n},height:{className:"h",cssName:"height",attrName:"height",transform:n},position:{className:"pst",cssName:"position",attrName:"position"},top:{className:"top",cssName:"top",attrName:"top",transform:n},right:{className:"rgt",cssName:"right",attrName:"right",transform:n},bottom:{className:"btm",cssName:"bottom",attrName:"bottom",transform:n},left:{className:"lft",cssName:"left",attrName:"left",transform:n},"font-size":{className:"fts",cssName:"font-size",attrName:"font-size",transform:n},"grid-column":{className:"gdc",cssName:"grid-column",attrName:"grid-column"},"grid-row":{className:"gdr",cssName:"grid-row",attrName:"grid-row"}},m=Object.keys(c);function i(t,s){const e=function(t,s){const e=function(t){for(var s,e=0,a=0,r=t.length;r>=4;++a,r-=4)s=1540483477*(65535&(s=255&t.charCodeAt(a)|(255&t.charCodeAt(++a))<<8|(255&t.charCodeAt(++a))<<16|(255&t.charCodeAt(++a))<<24))+(59797*(s>>>16)<<16),e=1540483477*(65535&(s^=s>>>24))+(59797*(s>>>16)<<16)^1540483477*(65535&e)+(59797*(e>>>16)<<16);switch(r){case 3:e^=(255&t.charCodeAt(a+2))<<16;case 2:e^=(255&t.charCodeAt(a+1))<<8;case 1:e=1540483477*(65535&(e^=255&t.charCodeAt(a)))+(59797*(e>>>16)<<16)}return(((e=1540483477*(65535&(e^=e>>>13))+(59797*(e>>>16)<<16))^e>>>15)>>>0).toString(36)}(s);return`bn-c-${t.className}_${e}`}(t,s),a=function(t,s,e){return`.${s} {${t.cssName}: ${e};}`}(t,e,s);return{className:e,style:a}}const l=t=>{const s=new Map;return m.forEach((e=>{const a=t.getAttribute(e);a&&(["top","left","right","bottom"].includes(e)&&s.set("position",i(c.position,"absolute")),s.set(e,i(c[e],(c[e].transform||function(t){return t})(a))))})),s},f=new MutationObserver((t=>{for(const e of t){const t=e.target,a=l(t);o.apply(a);const r=Array.from(a.values()).map((t=>t.className));t.className=t.className.split(" ").filter((t=>!t.startsWith("bn-c-"))).concat(...r).join(" "),s(t)}})),N=t=>{const s=t.connectedCallback,r=t.disconnectedCallback;t.connectedCallback=()=>{const r=e(t);if(!r)throw new Error("Can't find element field in component undefined");(t=>{const s=l(t);o.apply(s);const e=Array.from(s.values()).map((t=>t.className));t.className=t.className.split(" ").filter((t=>!t.startsWith("bn-c-"))).concat(...e).join(" "),f.observe(t,{attributes:!0,attributeFilter:m,childList:!1,subtree:!1})})(r),a(s,t)},t.disconnectedCallback=()=>{a(r,t)}};export{N as w}
1
+ import{m as t}from"./emotion-hash.esm.js";import{h as s}from"./validate.js";import{forceUpdate as e,getElement as a}from"@stencil/core/internal/client";import{r as o}from"./utils.js";class r{constructor(){this.cache=new Map,this.tag=r.makeStyleTag()}static makeStyleTag(){const t=document.createElement("style");return t.type="text/css",t.setAttribute("data-bn-computed-style",""),t.append(document.createTextNode("")),(document.head||document.querySelector("head")).append(t),t}apply(t){t.forEach((t=>this.cache.set(t.className,t.style))),this.tag.innerHTML=Array.from(this.cache.values()).map((t=>t)).join("\n")}}const n=new r,m=t=>s(t)?`${t}px`:t,c={width:{className:"w",cssName:"width",attrName:"width",transform:m},height:{className:"h",cssName:"height",attrName:"height",transform:m},position:{className:"pst",cssName:"position",attrName:"position"},top:{className:"top",cssName:"top",attrName:"top",transform:m},right:{className:"rgt",cssName:"right",attrName:"right",transform:m},bottom:{className:"btm",cssName:"bottom",attrName:"bottom",transform:m},left:{className:"lft",cssName:"left",attrName:"left",transform:m},"font-size":{className:"fts",cssName:"font-size",attrName:"font-size",transform:m},"grid-column":{className:"gdc",cssName:"grid-column",attrName:"grid-column"},"grid-row":{className:"gdr",cssName:"grid-row",attrName:"grid-row"}},i=Object.keys(c);function l(s,e){const a=function(s,e){const a=t(e);return`bn-c-${s.className}_${a}`}(s,e),o=function(t,s,e){return`.${s} {${t.cssName}: ${e};}`}(s,a,e);return{className:a,style:o}}const N=t=>{const s=new Map;return i.forEach((e=>{const a=t.getAttribute(e);a&&(["top","left","right","bottom"].includes(e)&&s.set("position",l(c.position,"absolute")),s.set(e,l(c[e],(c[e].transform||function(t){return t})(a))))})),s},f=new MutationObserver((t=>{for(const s of t){const t=s.target,a=N(t);n.apply(a);const o=Array.from(a.values()).map((t=>t.className));t.className=t.className.split(" ").filter((t=>!t.startsWith("bn-c-"))).concat(...o).join(" "),e(t)}})),u=t=>{const s=t.connectedCallback,e=t.disconnectedCallback;t.connectedCallback=()=>{const e=a(t);if(!e)throw new Error("Can't find element field in component undefined");(t=>{const s=N(t);n.apply(s);const e=Array.from(s.values()).map((t=>t.className));t.className=t.className.split(" ").filter((t=>!t.startsWith("bn-c-"))).concat(...e).join(" "),f.observe(t,{attributes:!0,attributeFilter:i,childList:!1,subtree:!1})})(e),o(s,t)},t.disconnectedCallback=()=>{o(e,t)}};export{u as w}
@@ -1,5 +1,5 @@
1
1
  import { a as alasql } from './alasql.min-CWu4NkIt.js';
2
- import { e as CompareUtil } from './Order-sqjrku2z.js';
2
+ import { g as CompareUtil } from './Order-Bnhh02CF.js';
3
3
 
4
4
  /** SI metric prefix for number scaling (e.g. prefix="M", value=1000000 divides displayed values by one million). */
5
5
  class SiPrefix {
@@ -1,4 +1,4 @@
1
- import { D as DateTime } from './Order-sqjrku2z.js';
1
+ import { D as DateTime } from './Order-Bnhh02CF.js';
2
2
 
3
3
  /** Granularity levels for date intervals, from YEAR down to MILLISECOND. AUTO triggers auto-detection. */
4
4
  var DateDistance;
@@ -154,13 +154,16 @@ var ChartMode;
154
154
  ChartMode["LINE"] = "line";
155
155
  ChartMode["AUTO"] = "auto";
156
156
  })(ChartMode || (ChartMode = {}));
157
- /** Dimension used to split bars into stacked segments within a single data point. */
157
+ /**
158
+ * Stacking dimension for multi-segment bar charts.
159
+ * - SCENARIOS: stack the scenarios from the `scenarios` prop end-to-end
160
+ * - DIMENSIONS: stack by the next-lower hierarchy level derived from the `level` prop
161
+ * (rowGroup → category, category → subCategory)
162
+ */
158
163
  var StackBy;
159
164
  (function (StackBy) {
160
- StackBy["SCENARIO"] = "scenario";
161
- StackBy["CATEGORY"] = "category";
162
- StackBy["SUBCATEGORY"] = "subcategory";
163
- StackBy["ROWGROUP"] = "rowgroup";
165
+ StackBy["SCENARIOS"] = "scenarios";
166
+ StackBy["DIMENSIONS"] = "dimensions";
164
167
  })(StackBy || (StackBy = {}));
165
168
  /**
166
169
  * How stacked values are presented.
@@ -8433,4 +8436,4 @@ class OrderAdapter {
8433
8436
  }
8434
8437
  }
8435
8438
 
8436
- export { AggregationLevel as A, BAR_COLUMN_WIDTH_EM as B, ChartMode as C, DateTime as D, I18nMode as I, MeasureType as M, OrderDirection as O, StackOrder as S, TableBarColumnWidth as T, OrderColumn as a, StackMode as b, AxisLabelsMode as c, AdapterUtils as d, CompareUtil as e, Scenarios as f, Sentiments as g, DataFormat as h, TableType as i, TableCategoryWidth as j, OrderAdapter as k, StackBy as l };
8439
+ export { AxisLabelsMode as A, BAR_COLUMN_WIDTH_EM as B, ChartMode as C, DateTime as D, I18nMode as I, MeasureType as M, OrderDirection as O, StackBy as S, TableCategoryWidth as T, OrderColumn as a, StackOrder as b, StackMode as c, DataFormat as d, TableBarColumnWidth as e, AdapterUtils as f, CompareUtil as g, Scenarios as h, Sentiments as i, AggregationLevel as j, TableType as k, OrderAdapter as l };
@@ -1,4 +1,4 @@
1
- import { e as CompareUtil } from './Order-sqjrku2z.js';
1
+ import { g as CompareUtil } from './Order-Bnhh02CF.js';
2
2
 
3
3
  const methods$1 = {};
4
4
  const names = [];
@@ -7723,9 +7723,6 @@ registerMorphableType([
7723
7723
  makeMorphable();
7724
7724
 
7725
7725
  /** Default fill colors cycled through for stacked chart segments. */
7726
- const STACK_FILLS = ["#808080", "#c0c0c0", "#000000"];
7727
- /** Default stroke colors cycled through for stacked chart segments. */
7728
- const STACK_STROKES = ["#808080", "#c0c0c0", "#000000"];
7729
7726
  /**
7730
7727
  * IBCS rendering order: back-to-front (PL behind FC behind PP behind AC).
7731
7728
  * Used to ensure correct visual layering when scenarios overlap.
@@ -7735,14 +7732,6 @@ const IBCS_LAYER_ORDER = ["pl", "fc", "pp", "ac"];
7735
7732
  function getScenarioPrefix(scenario) {
7736
7733
  return scenario.replace(/\d+$/, "");
7737
7734
  }
7738
- /** Returns a fill color for the given stack index, cycling through `STACK_FILLS`. */
7739
- function getStackFill(index) {
7740
- return STACK_FILLS[index % STACK_FILLS.length];
7741
- }
7742
- /** Returns a stroke color for the given stack index, cycling through `STACK_STROKES`. */
7743
- function getStackStroke(index) {
7744
- return STACK_STROKES[index % STACK_STROKES.length];
7745
- }
7746
7735
  /**
7747
7736
  * Returns black or white text color for readable contrast against the given
7748
7737
  * hex background, using the W3C relative luminance formula.
@@ -7958,4 +7947,4 @@ class SVGVariancesStyleGroupAdapter {
7958
7947
  }
7959
7948
  }
7960
7949
 
7961
- export { FontStyleAdapter as F, IBCS_LAYER_ORDER as I, PaddingAdapter as P, Svg as S, getStackFill as a, getStackStroke as b, getScenarioPrefix as c, SVGStyleGroupAdapter as d, SVGStyleAdapter as e, SVGVariancesStyleGroupAdapter as f, getContrastTextColor as g };
7950
+ export { FontStyleAdapter as F, IBCS_LAYER_ORDER as I, PaddingAdapter as P, Svg as S, getScenarioPrefix as a, SVGStyleGroupAdapter as b, SVGStyleAdapter as c, SVGVariancesStyleGroupAdapter as d, getContrastTextColor as g };
@@ -1,8 +1,9 @@
1
1
  import { r as registerInstance, h, H as Host, g as getElement } from './index-JNHhIe7t.js';
2
- import { w as withComponentStatus } from './withComponentStatus-DodoSXe-.js';
3
- import { g as getStores } from './context-protocol-Bz5klD-F.js';
4
- import { w as withBodyObserver } from './withBodyObserver-DczL5ia8.js';
5
- import { w as withHasError } from './withHasError-B3QX2emi.js';
2
+ import { w as withComponentStatus } from './withComponentStatus-DWjDYtZ7.js';
3
+ import { g as getStores } from './context-protocol-BHnQsVsr.js';
4
+ import { w as withBodyObserver } from './withBodyObserver-FQ8NwCIz.js';
5
+ import { w as withHasError } from './withHasError-FyY5mQ_3.js';
6
+ import './utils-DvvwfRQG.js';
6
7
 
7
8
  const bnAssetCss = () => `:host{display:none}`;
8
9
 
@@ -1,14 +1,16 @@
1
1
  import { r as registerInstance, h, H as Host, g as getElement, d as getAssetPath } from './index-JNHhIe7t.js';
2
- import { w as withComponentStatus } from './withComponentStatus-DodoSXe-.js';
3
- import { w as withComponentStyle } from './withComponentStyle-BerJY64r.js';
4
- import { w as withHasError } from './withHasError-B3QX2emi.js';
5
- import { w as withStyled, v as validateScenarioList, a as validateVariancesList, c as validateOrderList, d as isValidDirection, m as validateMeasureList, n as isValidDate, j as isBlankInput, k as isValidDateFormat, o as isValidDateLink } from './withStyled-D1fAWJ3g.js';
6
- import { I as I18nMode, O as OrderDirection, D as DateTime, e as CompareUtil, d as AdapterUtils, k as OrderAdapter } from './Order-sqjrku2z.js';
7
- import { w as withTranslation } from './withTranslation-mimbJdER.js';
8
- import { a as globalLabelKeys } from './context-protocol-Bz5klD-F.js';
9
- import { a as DateLink, D as DateDistance, b as DateStringFactory } from './DateStringFactory-XWdUjsn8.js';
2
+ import { w as withComponentStatus } from './withComponentStatus-DWjDYtZ7.js';
3
+ import { w as withComponentStyle } from './withComponentStyle-9uP_hcDq.js';
4
+ import { w as withHasError } from './withHasError-FyY5mQ_3.js';
5
+ import { w as withStyled, v as validateScenarioList, a as validateVariancesList, d as validateOrderList, e as isValidDirection, u as validateMeasureList, x as isValidDate, l as isBlankInput, f as isValidDateFormat, y as isValidDateLink } from './withStyled--qQWquTH.js';
6
+ import { I as I18nMode, O as OrderDirection, D as DateTime, g as CompareUtil, f as AdapterUtils, l as OrderAdapter } from './Order-Bnhh02CF.js';
7
+ import { w as withTranslation } from './withTranslation-BqD0Kp7b.js';
8
+ import { a as globalLabelKeys } from './context-protocol-BHnQsVsr.js';
9
+ import { a as DateLink, D as DateDistance, b as DateStringFactory } from './DateStringFactory-CSGz6TDk.js';
10
10
  import { F as Formatter } from './formatter-DTMEZ6d8.js';
11
- import { I as IBCSRuleSet, S as StringAdapter } from './StringAdapter-BCLJpQQ8.js';
11
+ import { I as IBCSRuleSet, S as StringAdapter } from './ibcsRuleSet-K4ytuA1f.js';
12
+ import './utils-DvvwfRQG.js';
13
+ import './emotion-hash.esm-BYBpC0EO.js';
12
14
  import './_commonjsHelpers-BFTU3MAI.js';
13
15
 
14
16
  const bnBodyCss = () => `:host{flex:1;position:relative;overflow:hidden;display:block;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000)}`;
@@ -1,8 +1,9 @@
1
1
  import { r as registerInstance, h, H as Host, g as getElement } from './index-JNHhIe7t.js';
2
- import { w as withComponentStatus } from './withComponentStatus-DodoSXe-.js';
3
- import { w as withComponentStyle } from './withComponentStyle-BerJY64r.js';
4
- import { w as withHasError } from './withHasError-B3QX2emi.js';
5
- import './context-protocol-Bz5klD-F.js';
2
+ import { w as withComponentStatus } from './withComponentStatus-DWjDYtZ7.js';
3
+ import { w as withComponentStyle } from './withComponentStyle-9uP_hcDq.js';
4
+ import { w as withHasError } from './withHasError-FyY5mQ_3.js';
5
+ import './utils-DvvwfRQG.js';
6
+ import './context-protocol-BHnQsVsr.js';
6
7
 
7
8
  const bnCardCss = () => `:host{display:flex;flex-direction:column;justify-content:space-between;padding:0.25em;margin:0.5em;background-origin:content-box;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000)}:host(.border){box-sizing:border-box;-webkit-box-sizing:border-box;border:0.1em solid #ddd}div{color:var(--bn-font-color, black)}`;
8
9