@bino-bi/bn-template-engine 1.0.0-alpha.0 → 1.0.0-alpha.2
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.
- package/dist/bn-template-engine/bn-template-engine.esm.js +1 -1
- package/dist/bn-template-engine/{p-_LBTIfNN.js → p--PSoPbDM.js} +1 -1
- package/dist/bn-template-engine/p-05a82a77.entry.js +1 -0
- package/dist/bn-template-engine/p-0ca8dc17.entry.js +1 -0
- package/dist/bn-template-engine/p-0f1504f3.entry.js +1 -0
- package/dist/bn-template-engine/p-1d9a3be9.entry.js +1 -0
- package/dist/bn-template-engine/p-35638ad0.entry.js +1 -0
- package/dist/bn-template-engine/p-37881d05.entry.js +1 -0
- package/dist/bn-template-engine/{p-65f8962a.entry.js → p-3b894997.entry.js} +1 -1
- package/dist/bn-template-engine/p-50e49732.entry.js +1 -0
- package/dist/bn-template-engine/p-60a7fc59.entry.js +1 -0
- package/dist/bn-template-engine/{p-ad94cf63.entry.js → p-6c7c0455.entry.js} +1 -1
- package/dist/bn-template-engine/p-6da93eae.entry.js +1 -0
- package/dist/bn-template-engine/p-701e1578.entry.js +1 -0
- package/dist/bn-template-engine/p-BSfqOkN_.js +1 -0
- package/dist/bn-template-engine/{p--TeDldm8.js → p-CRLgp9-v.js} +1 -1
- package/dist/bn-template-engine/p-CYjZRKdI.js +1 -0
- package/dist/bn-template-engine/{p-Cp4MVxCu.js → p-CvXqez4D.js} +1 -1
- package/dist/bn-template-engine/p-DG-1MR_T.js +1 -0
- package/dist/bn-template-engine/{p-CnI71OA9.js → p-DRikHQE-.js} +1 -1
- package/dist/bn-template-engine/p-DVMu6dEy.js +1 -0
- package/dist/bn-template-engine/p-DVo6aZUE.js +1 -0
- package/dist/bn-template-engine/p-DdexOqTs.js +1 -0
- package/dist/bn-template-engine/p-DgfL-ffj.js +1 -0
- package/dist/bn-template-engine/p-DyRaC0MB.js +1 -0
- package/dist/bn-template-engine/p-JNHhIe7t.js +2 -0
- package/dist/bn-template-engine/p-a95ccc16.entry.js +1 -0
- package/dist/bn-template-engine/p-b7bec050.entry.js +1 -0
- package/dist/bn-template-engine/p-bc59ea5c.entry.js +1 -0
- package/dist/bn-template-engine/p-d279b578.entry.js +1 -0
- package/dist/bn-template-engine/p-dd9dd407.entry.js +1 -0
- package/dist/bn-template-engine/p-e102a490.entry.js +1 -0
- package/dist/bn-template-engine/p-f27995c9.entry.js +1 -0
- package/dist/bn-template-engine/p-f89e55c6.entry.js +1 -0
- package/dist/bn-template-engine/{p-CY1RzLjU.js → p-tzFCK9qn.js} +1 -1
- package/dist/cjs/{DataFormatDigits-DmTbhF8q.js → DataFormatDigits-CbIVfGEH.js} +1 -1
- package/dist/cjs/{DateStringFactory-Dn0aRj2Y.js → DateStringFactory-CfkXYAMN.js} +4 -5
- package/dist/cjs/{luxon-8hyy5YD7.js → Order-DtpbD8mQ.js} +282 -0
- package/dist/cjs/{SVGVariancesStyleGroup-Czizhngt.js → SVGVariancesStyleGroup-D-rTWlDo.js} +1 -1
- package/dist/cjs/{StringAdapter-0EbYMkR0.js → StringAdapter-ByCHdlDO.js} +1 -1
- package/dist/cjs/bn-asset.cjs.entry.js +5 -6
- package/dist/cjs/{bn-body_3.cjs.entry.js → bn-body_4.cjs.entry.js} +360 -27
- package/dist/cjs/bn-card.cjs.entry.js +5 -6
- package/dist/cjs/bn-chart-structure.cjs.entry.js +17 -22
- package/dist/cjs/bn-chart-time.cjs.entry.js +38 -51
- package/dist/cjs/bn-component-style.cjs.entry.js +5 -6
- package/dist/cjs/bn-context_5.cjs.entry.js +36 -40
- package/dist/cjs/bn-dataset.cjs.entry.js +5 -6
- package/dist/cjs/bn-grid.cjs.entry.js +8 -11
- package/dist/cjs/bn-image.cjs.entry.js +8 -11
- package/dist/cjs/bn-internationalization.cjs.entry.js +5 -6
- package/dist/cjs/bn-layout-card.cjs.entry.js +3 -3
- package/dist/cjs/bn-layout-page.cjs.entry.js +2 -2
- package/dist/cjs/bn-message.cjs.entry.js +6 -7
- package/dist/cjs/bn-template-engine.cjs.js +2 -2
- package/dist/cjs/bn-template.cjs.entry.js +4 -5
- package/dist/cjs/bn-text.cjs.entry.js +12 -16
- package/dist/cjs/bn-tree.cjs.entry.js +8 -11
- package/dist/cjs/{context-protocol-BkYHFkXE.js → context-protocol-CRPmux5D.js} +1 -1
- package/dist/cjs/editor-companion.cjs.entry.js +3 -3
- package/dist/cjs/ibcs-chart-structure.cjs.entry.js +31 -33
- package/dist/cjs/ibcs-chart-time.cjs.entry.js +42 -44
- package/dist/cjs/{index-CScBFiS1.js → index-Cjw0q6gP.js} +1 -2
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{withDataset-ZdN-RRTx.js → scaling-D8sIIKft.js} +68 -3
- package/dist/cjs/{withBodyObserver-B0_W1VOf.js → withBodyObserver-C6gLgq_e.js} +2 -2
- package/dist/cjs/{componentRegister-C17UFNPh.js → withComponentStatus-_x4LQZ0N.js} +43 -6
- package/dist/cjs/{withComponentStyle-C6KHnZHt.js → withComponentStyle-DMtic_9Y.js} +3 -3
- package/dist/cjs/{withHasError-Dspb3lIV.js → withHasError-B8gHkfV2.js} +1 -1
- package/dist/cjs/{withStyled-Bf-stJTR.js → withStyled-BBtMesx3.js} +14 -63
- package/dist/cjs/{withTranslation-Cz0M5maV.js → withTranslation-CWPAIRjh.js} +3 -3
- package/dist/collection/collection-manifest.json +1 -10
- package/dist/collection/components/bn-chart-structure/bn-chart-structure.js +2 -3
- package/dist/collection/components/bn-chart-time/bn-chart-time.js +21 -30
- package/dist/collection/components/bn-message/bn-message.js +1 -1
- package/dist/collection/components/bn-page/bn-page.js +1 -1
- package/dist/collection/components/bn-table/bn-table.js +1 -1
- package/dist/collection/components/bn-template/bn-template.js +1 -1
- package/dist/collection/components/bn-text/bn-text.js +1 -1
- package/dist/collection/components/bn-title/bn-title.js +1 -9
- package/dist/collection/components/bn-title/ibcs-title/ibcs-title.js +1 -1
- package/dist/collection/components/editor-companion/editor-companion.js +1 -1
- package/dist/collection/utils/DateStringFactory.js +0 -1
- package/dist/components/DateStringFactory.js +1 -1
- package/dist/components/bn-chart-structure.js +1 -1
- package/dist/components/bn-chart-time.js +1 -1
- package/dist/components/bn-message2.js +1 -1
- package/dist/components/bn-page2.js +1 -1
- package/dist/components/bn-table.js +1 -1
- package/dist/components/bn-template.js +1 -1
- package/dist/components/bn-text.js +1 -1
- package/dist/components/bn-title2.js +1 -1
- package/dist/components/editor-companion.js +1 -1
- package/dist/components/ibcs-title2.js +1 -1
- package/dist/components/scaling.js +1 -1
- package/dist/components/validate.js +1 -1
- package/dist/components/withHasError.js +1 -1
- package/dist/esm/{DataFormatDigits-Dt6gpIiZ.js → DataFormatDigits-DYdbRX-1.js} +1 -1
- package/dist/esm/{DateStringFactory-_Qiv0IvF.js → DateStringFactory-DRcbojUT.js} +1 -2
- package/dist/esm/{luxon-DbyXf6dF.js → Order-DdexOqTs.js} +280 -1
- package/dist/esm/{SVGVariancesStyleGroup-DlWgvpzs.js → SVGVariancesStyleGroup-D0Cwprv1.js} +1 -1
- package/dist/esm/{StringAdapter-BLvo1Krl.js → StringAdapter-CTL-Dvzp.js} +1 -1
- package/dist/esm/bn-asset.entry.js +5 -6
- package/dist/esm/{bn-body_3.entry.js → bn-body_4.entry.js} +356 -24
- package/dist/esm/bn-card.entry.js +5 -6
- package/dist/esm/bn-chart-structure.entry.js +12 -17
- package/dist/esm/bn-chart-time.entry.js +31 -44
- package/dist/esm/bn-component-style.entry.js +5 -6
- package/dist/esm/bn-context_5.entry.js +15 -19
- package/dist/esm/bn-dataset.entry.js +5 -6
- package/dist/esm/bn-grid.entry.js +8 -11
- package/dist/esm/bn-image.entry.js +8 -11
- package/dist/esm/bn-internationalization.entry.js +5 -6
- package/dist/esm/bn-layout-card.entry.js +3 -3
- package/dist/esm/bn-layout-page.entry.js +2 -2
- package/dist/esm/bn-message.entry.js +6 -7
- package/dist/esm/bn-template-engine.js +3 -3
- package/dist/esm/bn-template.entry.js +4 -5
- package/dist/esm/bn-text.entry.js +11 -15
- package/dist/esm/bn-tree.entry.js +8 -11
- package/dist/esm/{context-protocol-DzeqZxg6.js → context-protocol-Bz5klD-F.js} +1 -1
- package/dist/esm/editor-companion.entry.js +3 -3
- package/dist/esm/ibcs-chart-structure.entry.js +5 -7
- package/dist/esm/ibcs-chart-time.entry.js +6 -8
- package/dist/esm/{index-B27Ax6P_.js → index-JNHhIe7t.js} +2 -2
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{withDataset-BT2VQCsG.js → scaling-C6K8FYSF.js} +67 -4
- package/dist/esm/{withBodyObserver-gZpZiEIK.js → withBodyObserver-DczL5ia8.js} +2 -2
- package/dist/esm/{componentRegister-BtVfu16B.js → withComponentStatus-DodoSXe-.js} +36 -1
- package/dist/esm/{withComponentStyle-NaxfakAG.js → withComponentStyle-BerJY64r.js} +3 -3
- package/dist/esm/{withHasError-C48fTE2k.js → withHasError-B3QX2emi.js} +1 -1
- package/dist/esm/{withStyled-CpUTv74m.js → withStyled-DCipbf2O.js} +5 -51
- package/dist/esm/{withTranslation-Do4GhleK.js → withTranslation-mimbJdER.js} +3 -3
- package/dist/types/components/bn-chart-time/bn-chart-time.d.ts +1 -2
- package/dist/types/components/bn-title/bn-title.d.ts +0 -1
- package/dist/types/components.d.ts +0 -401
- package/package.json +2 -3
- package/readme.md +0 -1
- package/dist/bn-template-engine/assets/gpx/Chasing_Legends.gpx +0 -195076
- package/dist/bn-template-engine/assets/gpx/Fahrt_am_Nachmittag.gpx +0 -142007
- package/dist/bn-template-engine/assets/icons/gpx-finish.png +0 -0
- package/dist/bn-template-engine/assets/icons/gpx-shadow.png +0 -0
- package/dist/bn-template-engine/assets/icons/gpx-start.png +0 -0
- package/dist/bn-template-engine/assets/icons/marker-example.png +0 -0
- package/dist/bn-template-engine/assets/icons/pin-icon-end.png +0 -0
- package/dist/bn-template-engine/assets/icons/pin-icon-start.png +0 -0
- package/dist/bn-template-engine/assets/icons/pin-icon-wpt.png +0 -0
- package/dist/bn-template-engine/assets/icons/pin-shadow.png +0 -0
- package/dist/bn-template-engine/assets/icons/pin.png +0 -0
- package/dist/bn-template-engine/p-0e7dc113.entry.js +0 -1
- package/dist/bn-template-engine/p-264c6bad.entry.js +0 -1
- package/dist/bn-template-engine/p-326a0902.entry.js +0 -1
- package/dist/bn-template-engine/p-38a8bde3.entry.js +0 -1
- package/dist/bn-template-engine/p-577eafcd.entry.js +0 -1
- package/dist/bn-template-engine/p-5905cc43.entry.js +0 -1
- package/dist/bn-template-engine/p-5d155a72.entry.js +0 -1
- package/dist/bn-template-engine/p-6b8d1ebf.entry.js +0 -1
- package/dist/bn-template-engine/p-7995acb2.entry.js +0 -1
- package/dist/bn-template-engine/p-7afe431e.entry.js +0 -1
- package/dist/bn-template-engine/p-8014b1ac.entry.js +0 -1
- package/dist/bn-template-engine/p-80423fc8.entry.js +0 -1
- package/dist/bn-template-engine/p-91e74d42.entry.js +0 -1
- package/dist/bn-template-engine/p-930a9e29.entry.js +0 -1
- package/dist/bn-template-engine/p-93C9jL8R.js +0 -1
- package/dist/bn-template-engine/p-93ff8584.entry.js +0 -1
- package/dist/bn-template-engine/p-B0m0U4wJ.js +0 -1
- package/dist/bn-template-engine/p-B27Ax6P_.js +0 -2
- package/dist/bn-template-engine/p-B79VcHiT.js +0 -1
- package/dist/bn-template-engine/p-BBd0ZVLL.js +0 -1
- package/dist/bn-template-engine/p-BFatTBqh.js +0 -1
- package/dist/bn-template-engine/p-BQp6ZPYW.js +0 -1
- package/dist/bn-template-engine/p-BhEQy-2D.js +0 -1
- package/dist/bn-template-engine/p-BtVfu16B.js +0 -1
- package/dist/bn-template-engine/p-CfWnag33.js +0 -1
- package/dist/bn-template-engine/p-DbyXf6dF.js +0 -1
- package/dist/bn-template-engine/p-TdL-LRR9.js +0 -1
- package/dist/bn-template-engine/p-a342cd3c.entry.js +0 -1
- package/dist/bn-template-engine/p-bc37d750.entry.js +0 -1
- package/dist/bn-template-engine/p-c9f050bf.entry.js +0 -1
- package/dist/bn-template-engine/p-d07a0ca3.entry.js +0 -1
- package/dist/bn-template-engine/p-e5f372af.entry.js +0 -1
- package/dist/bn-template-engine/p-e620028c.entry.js +0 -1
- package/dist/bn-template-engine/p-e81e116a.entry.js +0 -1
- package/dist/bn-template-engine/p-eca98070.entry.js +0 -1
- package/dist/bn-template-engine/p-ee6de950.entry.js +0 -1
- package/dist/bn-template-engine/p-efe0ef1e.entry.js +0 -1
- package/dist/bn-template-engine/p-f034f1b8.entry.js +0 -1
- package/dist/bn-template-engine/p-f1c1a8a3.entry.js +0 -1
- package/dist/bn-template-engine/p-fe573a1a.entry.js +0 -1
- package/dist/bn-template-engine/p-kMyLevYy.js +0 -1
- package/dist/cjs/Order-B4NIqQWe.js +0 -129
- package/dist/cjs/bn-map.cjs.entry.js +0 -425
- package/dist/cjs/constants-DHqQXSSd.js +0 -158
- package/dist/cjs/ibcs-map.cjs.entry.js +0 -1075
- package/dist/cjs/ibcs-title.cjs.entry.js +0 -352
- package/dist/cjs/scaling-B23eOtsC.js +0 -67
- package/dist/cjs/test-runner-card.cjs.entry.js +0 -27
- package/dist/cjs/test-runner-chart-time.cjs.entry.js +0 -230
- package/dist/cjs/test-runner-chart.cjs.entry.js +0 -326
- package/dist/cjs/test-runner-map.cjs.entry.js +0 -1862
- package/dist/cjs/test-runner-table.cjs.entry.js +0 -477
- package/dist/cjs/test-runner-time.cjs.entry.js +0 -381
- package/dist/cjs/test-runner-title.cjs.entry.js +0 -115
- package/dist/cjs/withComponentStatus-BrxL7usr.js +0 -39
- package/dist/collection/components/bn-map/bn-map.css +0 -4
- package/dist/collection/components/bn-map/bn-map.js +0 -725
- package/dist/collection/components/bn-map/ibcs-map/assets/gpx/Chasing_Legends.gpx +0 -195076
- package/dist/collection/components/bn-map/ibcs-map/assets/gpx/Fahrt_am_Nachmittag.gpx +0 -142007
- package/dist/collection/components/bn-map/ibcs-map/assets/icons/gpx-finish.png +0 -0
- package/dist/collection/components/bn-map/ibcs-map/assets/icons/gpx-shadow.png +0 -0
- package/dist/collection/components/bn-map/ibcs-map/assets/icons/gpx-start.png +0 -0
- package/dist/collection/components/bn-map/ibcs-map/assets/icons/marker-example.png +0 -0
- package/dist/collection/components/bn-map/ibcs-map/assets/icons/pin-icon-end.png +0 -0
- package/dist/collection/components/bn-map/ibcs-map/assets/icons/pin-icon-start.png +0 -0
- package/dist/collection/components/bn-map/ibcs-map/assets/icons/pin-icon-wpt.png +0 -0
- package/dist/collection/components/bn-map/ibcs-map/assets/icons/pin-shadow.png +0 -0
- package/dist/collection/components/bn-map/ibcs-map/assets/icons/pin.png +0 -0
- package/dist/collection/components/bn-map/ibcs-map/ibcs-map.css +0 -674
- package/dist/collection/components/bn-map/ibcs-map/ibcs-map.js +0 -744
- package/dist/collection/components/bn-map/ibcs-map/utils/model/GeoJsonLayer.js +0 -9
- package/dist/collection/components/bn-map/ibcs-map/utils/model/GpxLayer.js +0 -13
- package/dist/collection/components/bn-map/ibcs-map/utils/model/Marker.js +0 -11
- package/dist/collection/components/bn-map/ibcs-map/utils/model/index.js +0 -2
- package/dist/collection/test-runner/test-runner-card.js +0 -36
- package/dist/collection/test-runner/test-runner-chart-time.js +0 -234
- package/dist/collection/test-runner/test-runner-chart.js +0 -364
- package/dist/collection/test-runner/test-runner-map.js +0 -1901
- package/dist/collection/test-runner/test-runner-table.js +0 -469
- package/dist/collection/test-runner/test-runner-time.js +0 -399
- package/dist/collection/test-runner/test-runner-title.js +0 -108
- package/dist/components/bn-map.d.ts +0 -11
- package/dist/components/bn-map.js +0 -1
- package/dist/components/componentRegister.js +0 -1
- package/dist/components/ibcs-map.d.ts +0 -11
- package/dist/components/ibcs-map.js +0 -1
- package/dist/components/ibcs-map2.js +0 -1
- package/dist/components/test-runner-card.d.ts +0 -11
- package/dist/components/test-runner-card.js +0 -1
- package/dist/components/test-runner-chart-time.d.ts +0 -11
- package/dist/components/test-runner-chart-time.js +0 -1
- package/dist/components/test-runner-chart.d.ts +0 -11
- package/dist/components/test-runner-chart.js +0 -1
- package/dist/components/test-runner-map.d.ts +0 -11
- package/dist/components/test-runner-map.js +0 -1
- package/dist/components/test-runner-table.d.ts +0 -11
- package/dist/components/test-runner-table.js +0 -1
- package/dist/components/test-runner-time.d.ts +0 -11
- package/dist/components/test-runner-time.js +0 -1
- package/dist/components/test-runner-title.d.ts +0 -11
- package/dist/components/test-runner-title.js +0 -1
- package/dist/components/withDataset.js +0 -1
- package/dist/esm/Order-B4fpLe_f.js +0 -125
- package/dist/esm/bn-map.entry.js +0 -423
- package/dist/esm/constants-kMyLevYy.js +0 -158
- package/dist/esm/ibcs-map.entry.js +0 -1073
- package/dist/esm/ibcs-title.entry.js +0 -350
- package/dist/esm/scaling-BBd0ZVLL.js +0 -64
- package/dist/esm/test-runner-card.entry.js +0 -25
- package/dist/esm/test-runner-chart-time.entry.js +0 -228
- package/dist/esm/test-runner-chart.entry.js +0 -324
- package/dist/esm/test-runner-map.entry.js +0 -1860
- package/dist/esm/test-runner-table.entry.js +0 -475
- package/dist/esm/test-runner-time.entry.js +0 -379
- package/dist/esm/test-runner-title.entry.js +0 -113
- package/dist/esm/withComponentStatus-elELReKt.js +0 -37
- package/dist/types/components/bn-map/bn-map.d.ts +0 -122
- package/dist/types/components/bn-map/ibcs-map/ibcs-map.d.ts +0 -73
- package/dist/types/components/bn-map/ibcs-map/utils/model/GeoJsonLayer.d.ts +0 -8
- package/dist/types/components/bn-map/ibcs-map/utils/model/GpxLayer.d.ts +0 -11
- package/dist/types/components/bn-map/ibcs-map/utils/model/Marker.d.ts +0 -9
- package/dist/types/components/bn-map/ibcs-map/utils/model/index.d.ts +0 -2
- package/dist/types/test-runner/test-runner-card.d.ts +0 -3
- package/dist/types/test-runner/test-runner-chart-time.d.ts +0 -3
- package/dist/types/test-runner/test-runner-chart.d.ts +0 -3
- package/dist/types/test-runner/test-runner-map.d.ts +0 -3
- package/dist/types/test-runner/test-runner-table.d.ts +0 -3
- package/dist/types/test-runner/test-runner-time.d.ts +0 -3
- package/dist/types/test-runner/test-runner-title.d.ts +0 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,h as i,H as s,g as h}from"./p-JNHhIe7t.js";import{S as e,g as n,a as r,b as o,c as l,I as a,F as c,d as u,e as d,f,P as p}from"./p-CvXqez4D.js";import{e as w,D as v,b,c as g,C as m,k as L,d as P,j as S,A as y,O as k}from"./p-DdexOqTs.js";import{C as M,F as C,V as x}from"./p-1jFf17Vj.js";import{S as A,D as O,b as T}from"./p-DVo6aZUE.js";import{a as D}from"./p-BYmPQYxx.js";import{D as $,b as _}from"./p-DgfL-ffj.js";import{I as E,S as Y}from"./p--PSoPbDM.js";import"./p-BFTU3MAI.js";class N{constructor(){this.scenarioOffset=.3,this.scenarioLabelToColumn=.3,this.labelToColumn=.3,this.labelToAxis=.3,this.needleWidth=.3,this.needleHeadWidth=.6,this.columnWidth=2,this.varianceAxisLineWidth=.3,this.axisLineWidth=.1,this.auxiliaryLineWidth=.1,this.scenarioLineWidth=.2,this.markerWidth=.7,this.markerOffset=0,this.categoryWidth=3,this.axisTickLength=.3}}class R{adapt(t){const i=new N;return w.isNumber(t.scenarioOffset)&&(i.scenarioOffset=t.scenarioOffset),w.isNumber(t.scenarioLabelToColumn)&&(i.scenarioLabelToColumn=t.scenarioLabelToColumn),w.isNumber(t.labelToColumn)&&(i.labelToColumn=t.labelToColumn),w.isNumber(t.labelToAxis)&&(i.labelToAxis=t.labelToAxis),w.isNumber(t.needleWidth)&&(i.needleWidth=t.needleWidth),w.isNumber(t.needleHeadWidth)&&(i.needleHeadWidth=t.needleHeadWidth),w.isNumber(t.columnWidth)&&(i.columnWidth=t.columnWidth),w.isNumber(t.varianceAxisLineWidth)&&(i.varianceAxisLineWidth=t.varianceAxisLineWidth),w.isNumber(t.axisLineWidth)&&(i.axisLineWidth=t.axisLineWidth),w.isNumber(t.auxiliaryLineWidth)&&(i.auxiliaryLineWidth=t.auxiliaryLineWidth),w.isNumber(t.scenarioLineWidth)&&(i.scenarioLineWidth=t.scenarioLineWidth),w.isNumber(t.markerWidth)&&(i.markerWidth=t.markerWidth),w.isNumber(t.markerOffset)&&(i.markerOffset=t.markerOffset),w.isNumber(t.categoryWidth)&&(i.categoryWidth=t.categoryWidth),w.isNumber(t.axisTickLength)&&(i.axisTickLength=t.axisTickLength),i}default(){return new N}}class H{constructor(t,i,s,h,e,n,r){this.categoryPosition={x:0,y:0},this.spacings=new N,this.categoriesBoxOffset={width:0,height:0},this.padding=t,this.scaleFactors=i,this.fontStlye=s,this.dataLabelHeight=this.caluculateDataLabelHeight(),this.axisPosition={x:0,y:0},this.columnValue={min:h,max:e},this.numberOfColumns=n,this.leftSideLabelLength=r,this.calculateSpacings(),this.calculateCategoryPosition(),this.calculateAxisPosition()}caluculateDataLabelHeight(){return 1.1*M("123456789",{font:this.fontStlye.font,fontSize:this.fontStlye.size+"px"}).height}getColumnCenterPositionX(t){return this.categoryPosition.y+this.spacings.scenarioOffset+t*this.spacings.categoryWidth+this.leftSideLabelLength+.5*this.spacings.columnWidth}getAxisPositionY(t){let i=this.columnValue.max.getScaledUnit();return t&&(i=this.columnValue.max.getScaledPercentUnit()+this.getNeedleWidth()),i+this.dataLabelHeight+this.spacings.labelToAxis+this.padding.top}getAxisPositionX(){return this.padding.left+this.leftSideLabelLength}getColumnPositionX(t,i){return i?this.getColumnCenterPositionX(t):this.getColumnCenterPositionX(t)-this.spacings.scenarioOffset}getColumnPositionY(){return this.columnValue.max.getScaledUnit()+this.dataLabelHeight+this.spacings.labelToColumn+this.padding.top}getNeedlePositionY(){return this.columnValue.max.getScaledPercentUnit()+this.dataLabelHeight+this.spacings.labelToColumn+this.getNeedleWidth()+this.padding.top}getMarkerPositionX(t,i){return i?this.getColumnCenterPositionX(t)-this.spacings.markerOffset-.5*this.getColumnWidth():this.getColumnCenterPositionX(t)+this.spacings.markerOffset+.5*this.getColumnWidth()}getMarkerPositionY(){return this.getColumnPositionY()}getAxisTitlePositionX(t){const i=t.width();return this.axisPosition.x-i}getAxisTitlePositionY(t,i){let s=this.columnValue.max.getScaledUnit();return i&&(s=this.columnValue.max.getScaledPercentUnit()),t?s+this.dataLabelHeight+this.spacings.labelToAxis:s}getColumnDataLabelPositionY(t){const i=this.spacings.labelToColumn;return t<0?this.getColumnPositionY()+Math.abs(t)+i:this.getColumnPositionY()-t-i}getNeedleDataLabelPositionY(t){const i=this.spacings.labelToColumn;return t<0?this.getNeedlePositionY()+Math.abs(t)+i+2*this.getNeedleWidth():this.getNeedlePositionY()-t-i-2*this.getNeedleWidth()}getAxisEndPositionX(){return this.getAxisPositionX()+(this.numberOfColumns+.5)*this.spacings.categoryWidth}getColumnWidth(){return this.spacings.columnWidth}getNeedleWidth(){return this.spacings.needleWidth}getNeedleHeadWidth(){return this.spacings.needleHeadWidth}getScenarioLabelPositionOffsetX(t){return t?.5*this.getColumnWidth()+this.spacings.scenarioLabelToColumn:-(.5*this.getColumnWidth()+this.spacings.scenarioLabelToColumn)}calculateSpacings(){this.spacings={scenarioOffset:this.fontStlye.size*this.scaleFactors.scenarioOffset,scenarioLabelToColumn:this.fontStlye.size*this.scaleFactors.scenarioLabelToColumn,markerOffset:this.fontStlye.size*this.scaleFactors.markerOffset,labelToColumn:this.fontStlye.size*this.scaleFactors.labelToColumn,labelToAxis:this.fontStlye.size*this.scaleFactors.labelToAxis,needleWidth:this.fontStlye.size*this.scaleFactors.needleWidth,needleHeadWidth:this.fontStlye.size*this.scaleFactors.needleHeadWidth,columnWidth:this.fontStlye.size*this.scaleFactors.columnWidth,varianceAxisLineWidth:this.fontStlye.size*this.scaleFactors.varianceAxisLineWidth,axisLineWidth:this.fontStlye.size*this.scaleFactors.axisLineWidth,auxiliaryLineWidth:this.fontStlye.size*this.scaleFactors.auxiliaryLineWidth,scenarioLineWidth:this.fontStlye.size*this.scaleFactors.scenarioLineWidth,markerWidth:this.fontStlye.size*this.scaleFactors.markerWidth,categoryWidth:this.fontStlye.size*this.scaleFactors.categoryWidth,axisTickLength:this.fontStlye.size*this.scaleFactors.axisTickLength}}calculateCategoryPosition(){this.categoryPosition={x:this.padding.left+.5*this.spacings.columnWidth,y:this.padding.top}}calculateAxisPosition(){this.axisPosition={x:this.getAxisPositionX(),y:this.getAxisPositionY(!1)}}getMarkerScenarioLabelPositionOffsetX(t){return t?this.spacings.labelToColumn-this.fontStlye.size:this.spacings.labelToColumn+.5*this.spacings.markerWidth}}class F{constructor(t){this.top=t.top,this.bottom=t.bottom,this.left=t.left,this.right=t.right}addBoxTopLeft(t){return this.top+=t.height|this.top,this.left+=t.width|this.top,this}}class j{constructor(t){const i=1*t,s=.7*t;this.bgOffset=(i-s)/2,this.markerUp={top:s/2+",0",left:"0,"+s,right:s+","+s},this.markerUpBackground={top:i/2+",0",left:"0,"+i,right:i+","+i},this.markerDown={bottom:s/2+","+s,left:"0,0",right:s+",0"},this.markerDownBackground={bottom:i/2+","+i,left:"0,0",right:i+",0"},this.markerRight={bottom:"0,"+s,top:"0,0",right:s+","+s/2},this.markerRightBackground={bottom:"0,"+i,top:"0,0",right:i+","+i/2},this.markerLeft={bottom:s+","+s,top:s+",0",left:"0,"+s/2},this.markerLeftBackground={bottom:i+","+i,top:i+",0",Left:"0,"+i/2}}upMarkerPatternStrings(){return{background:this.markerUpBackground.left+" "+this.markerUpBackground.right+" "+this.markerUpBackground.top+" "+this.markerUpBackground.left,foreground:this.markerUp.left+" "+this.markerUp.right+" "+this.markerUp.top+" "+this.markerUp.left,bgOffset:this.bgOffset}}downMarkerPatternStrings(){return{background:this.markerDownBackground.left+" "+this.markerDownBackground.right+" "+this.markerDownBackground.bottom+" "+this.markerDownBackground.left,foreground:this.markerDown.left+" "+this.markerDown.right+" "+this.markerDown.bottom+" "+this.markerDown.left,bgOffset:this.bgOffset}}rightMarkerPatternStrings(){return{background:this.markerRightBackground.top+" "+this.markerRightBackground.right+" "+this.markerRightBackground.bottom+" "+this.markerRightBackground.top,foreground:this.markerRight.top+" "+this.markerRight.right+" "+this.markerRight.bottom+" "+this.markerRight.top,bgOffset:this.bgOffset}}leftMarkerPatternStrings(){return{background:this.markerLeftBackground.top+" "+this.markerLeftBackground.Left+" "+this.markerLeftBackground.bottom+" "+this.markerLeftBackground.top,foreground:this.markerLeft.top+" "+this.markerLeft.left+" "+this.markerLeft.bottom+" "+this.markerLeft.top,bgOffset:this.bgOffset}}createPatternMapForStructureBar(){const t=new Map;return t.set("marker-up",this.upMarkerPatternStrings()),t.set("marker-down",this.downMarkerPatternStrings()),t.set("marker-right",this.rightMarkerPatternStrings()),t.set("marker-left",this.leftMarkerPatternStrings()),t}}class V{constructor(t){this.container=new e,this.pattern=this.createFCPattern(this.container.group(),t),this.styles=t;let i=10;null!=t&&null!=t.fontStyles&&t.fontStyles.size&&(i=t.fontStyles.size),this.bgOffset=(1*i-.7*i)/2}createFCPattern(t,i){const s=i;return t.pattern(10,10,(function(t){t.rect(10,10).fill(s.barStyles.fc.fill),t.line(0,5,5,0).stroke({width:s.barStyles.fc.width,color:s.barStyles.fc.stroke,linecap:"square"}),t.line(5,10,10,5).stroke({width:s.barStyles.fc.width,color:s.barStyles.fc.stroke,linecap:"square"})})).id("pattern-time-fc")}getFCPolygonPattern(){return{background:"",foreground:"",bgOffset:0,pattern:this.pattern}}toString(){return this.container.svg()}}var X;!function(t){t[t.Left=0]="Left",t[t.Center=1]="Center",t[t.Right=2]="Right",t[t.Top=3]="Top",t[t.Bottom=4]="Bottom"}(X||(X={}));class I{constructor(t,i,s,h,e,n,r,o){this.ID_SCENARIOLABEL="Label",this.CSS_CATEGORIES="categories",this.isRelativeLabel=!1,this.segmentFillColor=null,this.x=i,this.y=s,this.value=e,this.group=t.group().id(this.createElementID(t.toString(),h)),this.styles=n,this.isVarianceLabel=!1,this.verticalHookLocation=r||X.Top,this.horizontalHookLocation=o||X.Left}setToVarianceLabel(){return this.isVarianceLabel=!0,this}setToRelativeVarianceLabel(){return this.isVarianceLabel=!0,this.isRelativeLabel=!0,this}setSegmentFill(t){return this.segmentFillColor=t,this}updateGroup(t){return this.group=t,this}draw(t=!0,i={percent:2,decimal:1},s=new A){if(this.isEmpty())return this;const h=this.group;let e,n="";if(!1===Number.isNaN(Number(this.value))){let t="percent",h=i.percent,r=i.percent,o=1;!1===this.isRelativeLabel&&(h=i.decimal,r=i.decimal,o=s.value,t="decimal"),e=C.number(Number(this.value),t,h,r,o),this.isVarianceLabel&&Number(this.value)>=0&&(n="+")}else e=""+this.value;const r=this.drawLabel(h,n+e);return!1===t&&(r.addClass("hide"),h.addClass("hide")),this}isEmpty(){return null==this.value||""===this.value}setPos(t,i){return this.x=t,this.y=i,this}forceStringTypeDraw(){return this.drawLabel(this.group,""+this.value),this}drawLabel(t,i){const s=this.styles.fontStyles.background||"#ffffff";let h="start";const e=t.text(i);e.move(this.x,this.y);const r=e.bbox().w,o=e.bbox().h;let l=0,a=0;const c=e.x();let u=e.y();return this.horizontalHookLocation===X.Left?(h="left",l=e.x()):this.horizontalHookLocation===X.Center?(h="middle",l=e.x()-(r+2)/2):this.horizontalHookLocation===X.Right&&(h="end",l=e.x()-r),this.verticalHookLocation===X.Center?(u=e.y()-1.2*o/2,a=u+.2*o):this.verticalHookLocation===X.Top?(u-=o/4,a=u+.2*o):this.verticalHookLocation===X.Bottom&&(u-=o,a=u+.2*o),e.move(c,u),e.font({anchor:h}),null!=this.segmentFillColor?e.fill(n(this.segmentFillColor)):t.rect(r+2,.8*o).stroke(s).fill(s).opacity(.9).move(l-1,a).insertBefore(e),e}createElementID(t,i){return t+"_"+i+"_"+this.ID_SCENARIOLABEL}}const W={ac:1,pp:2,fc:3,pl:4};var G,B,U;!function(t){t[t.Above=0]="Above",t[t.Below=1]="Below",t[t.Left=2]="Left",t[t.Right=3]="Right"}(G||(G={}));class z{constructor(){this.labels=[],this.scenarioLabels=[]}clear(){this.labels=[],this.scenarioLabels=[]}register(t){this.labels.push(t)}hasCollision(t){return this.labels.some((i=>this.intersects(t,i)))}getOptimalPlacement(t,i,s,h,e,n,r,o){const l=W[r]||99,a=n/2;for(const n of o){const r=this.calculatePlacementForDirection(t,i,s,h,e,a,8,n);if(!this.hasCollision(r.bounds))return r}for(const n of o){const r=this.calculatePlacementForDirection(t,i,s,h,e,a,8,n);if(!this.collidesWithHigherPriority(r.bounds,l))return r}return null}calculatePlacementForDirection(t,i,s,h,e,n,r,o){let l,a,c,u,d,f;switch(o){case G.Above:l=t,a=i-n-r,c=X.Bottom,u=X.Center,d=t-s/2,f=i-n-r-h;break;case G.Below:l=t,a=i+n+r,c=X.Top,u=X.Center,d=t-s/2,f=i+n+r-h/4;break;case G.Left:l=t-n-r,a=i,c=X.Center,u=X.Right,d=t-n-r-s,f=i-.6*h;break;case G.Right:l=t+n+r,a=i,c=X.Center,u=X.Left,d=t+n+r,f=i-.6*h}return{labelX:l,labelY:a,verticalHook:c,horizontalHook:u,bounds:{x:d,y:f,width:s,height:h,pointIndex:e,preferredHook:c}}}collidesWithHigherPriority(t,i){return this.labels.some((s=>!!s.scenarioType&&((W[s.scenarioType]||99)<i&&this.intersects(t,s))))}shouldHideScenarioLabel(t,i,s,h=20){const e=W[s]||99;return!(e<=1)&&this.scenarioLabels.some((s=>{if((W[s.scenarioType]||99)>=e)return!1;const n=Math.abs(i-s.y),r=Math.abs(t-s.x);return n<h&&r<h}))}registerScenarioLabel(t,i,s){this.scenarioLabels.push({x:t,y:i,scenarioType:s})}intersects(t,i){return!(t.x+t.width<i.x||i.x+i.width<t.x||t.y+t.height<i.y||i.y+i.height<t.y)}getLabelCount(){return this.labels.length}}class q{constructor(t,i,s,h){this.value=t,this.scenario=i,this.pixelPerUnit=s||1,this.variance="neg"===h||h===B.NEG?B.NEG:"pos"===h||h===B.POS?B.POS:B.NEU}isEmpty(){return void 0===this.value||null==this.scenario}getScaledUnit(){return null==this.value?0:this.value*this.pixelPerUnit}getScaledPercentUnit(){return null==this.value?0:this.value>1.45?1.45*this.pixelPerUnit:this.value<-1.45?-1.45*this.pixelPerUnit:this.value*this.pixelPerUnit}getVarianceStyle(){return null==this.value||this.value>=0?this.variance:B.NEU===this.variance?B.NEU:B.POS===this.variance?B.NEG:B.POS}isClipped(){return null!=this.value&&Math.abs(this.value)>1.45}getClippedValue(){return 145}getScenario(){var t;return null===(t=this.scenario)||void 0===t?void 0:t.slice(0,2)}}class K{constructor(){this.operation="+"}addRowGroup(t,i){this.rowGroup=t,this.rowGroupIndex=i}addCategory(t,i){this.category=t,this.categoryIndex=i}addSubCategory(t,i){this.subCategory=t,this.subCategoryIndex=i}addColumnGroup(t,i){this.columnGroup=t,this.columnGroupIndex=i}addSubColumnGroup(t,i){this.columnSubGroup=t,this.columnSubGroupIndex=i}}class Z{constructor(){}adapt(t){const i=new K;return w.isString(t.date)&&(i.date=this.parseDateString(t.date)),w.isOperator(t.operation)&&(i.operation=t.operation),w.isNumber(t.rowGroupIndex)&&w.isString(t.rowGroup)&&i.addRowGroup(t.rowGroup,t.rowGroupIndex),w.isNumber(t.categoryIndex)&&w.isString(t.category)&&i.addCategory(t.category,t.categoryIndex),w.isNumber(t.subCategoryIndex)&&w.isString(t.subCategory)&&i.addSubCategory(t.subCategory,t.subCategoryIndex),w.isNumber(t.columnGroupIndex)&&w.isString(t.columnGroup)&&i.addColumnGroup(t.columnGroup,t.columnGroupIndex),w.isNumber(t.columnSubGroupIndex)&&w.isString(t.columnSubGroup)&&i.addSubColumnGroup(t.columnSubGroup,t.columnSubGroupIndex),this.setActualValues(t,i),this.setPlanValues(t,i),this.setPreviousPeriodValues(t,i),this.setForecastValues(t,i),i}parseDateString(t){const i=v.fromISO(t);if(i.isValid)return i;console.warn(`TimeChartDataRow: invalid date value '${t}' — skipping row`)}default(){return new K}setActualValues(t,i){w.isNumber(t.ac1)&&(i.ac1=t.ac1),w.isNumber(t.ac2)&&(i.ac2=t.ac2),w.isNumber(t.ac3)&&(i.ac3=t.ac3),w.isNumber(t.ac4)&&(i.ac4=t.ac4)}setPlanValues(t,i){w.isNumber(t.pl1)&&(i.pl1=t.pl1),w.isNumber(t.pl2)&&(i.pl2=t.pl2),w.isNumber(t.pl3)&&(i.pl3=t.pl3),w.isNumber(t.pl4)&&(i.pl4=t.pl4)}setPreviousPeriodValues(t,i){w.isNumber(t.pp1)&&(i.pp1=t.pp1),w.isNumber(t.pp2)&&(i.pp2=t.pp2),w.isNumber(t.pp3)&&(i.pp3=t.pp3),w.isNumber(t.pp4)&&(i.pp4=t.pp4)}setForecastValues(t,i){w.isNumber(t.fc1)&&(i.fc1=t.fc1),w.isNumber(t.fc2)&&(i.fc2=t.fc2),w.isNumber(t.fc3)&&(i.fc3=t.fc3),w.isNumber(t.fc4)&&(i.fc4=t.fc4)}}class J{constructor(t,i,s,h,e,n){this.scaleFactors=t,this.fontStyles=i,this.axisStyles=s,this.barStyles=h,this.varianceStyles=e,this.padding=n,this.pattern=new Map}}class Q{constructor(t,i,s,h,e){this.scaleFactorsStructureChartAdapter=t,this.fontStyleAdapter=i,this.svgStyleGroupAdapter=s,this.svgVariancesStyleGroupAdapter=h,this.paddingadapter=e}adapt(t){const i=new J(this.scaleFactorsStructureChartAdapter.default(),this.fontStyleAdapter.default(),this.svgStyleGroupAdapter.default(),this.svgStyleGroupAdapter.default(),this.svgVariancesStyleGroupAdapter.default(),this.paddingadapter.default());return w.isExisting(t)&&(w.isExisting(t.scaleFactors)&&(i.scaleFactors=this.scaleFactorsStructureChartAdapter.adapt(t.scaleFactors)),w.isExisting(t.fontStyles)&&(i.fontStyles=this.fontStyleAdapter.adapt(t.fontStyles)),w.isExisting(t.axisStyles)&&(i.axisStyles=this.svgStyleGroupAdapter.adapt(t.axisStyles)),w.isExisting(t.barStyles)&&(i.barStyles=this.svgStyleGroupAdapter.adapt(t.barStyles)),w.isExisting(t.varianceStyles)&&(i.varianceStyles=this.svgVariancesStyleGroupAdapter.adapt(t.varianceStyles)),w.isExisting(t.padding)&&(i.padding=this.paddingadapter.adapt(t.padding)),i.pattern=new j(i.fontStyles.size).createPatternMapForStructureBar()),i}default(){return new J(this.scaleFactorsStructureChartAdapter.default(),this.fontStyleAdapter.default(),this.svgStyleGroupAdapter.default(),this.svgStyleGroupAdapter.default(),this.svgVariancesStyleGroupAdapter.default(),this.paddingadapter.default())}}!function(t){t.AC1="ac1",t.PP1="pp1",t.FC1="fc1",t.PL1="pl1",t.AC2="ac2",t.PP2="pp2",t.FC2="fc2",t.PL2="pl2",t.AC3="ac3",t.PP3="pp3",t.FC3="fc3",t.PL3="pl3",t.AC4="ac4",t.PP4="pp4",t.FC4="fc4",t.PL4="pl4",t.POS="pos",t.NEG="neg",t.NEU="neu"}(B||(B={})),function(t){t.LIST="LIST",t.SUM="SUM",t.OPT="OPT"}(U||(U={}));class tt{constructor(t,i,s){this.ID_AXIS="axis",this.CSS_AXIS_TITLE="categories",this.scenarioType=t.scenarioType,this.labelText=t.labelText||null,this.isRelative=t.isRelative||!1,this.position=i,this.svgGroup=s.group().id(this.ID_AXIS)}drawAxisTitle(t,i){null==i&&(i=""),t.text(i).addClass(this.CSS_AXIS_TITLE).attr("text-anchor","middle").move(this.position.getAxisTitlePositionX(t),this.position.getAxisTitlePositionY(!0,this.isRelative))}draw(){return this.labelText&&this.drawAxisTitle(this.svgGroup,this.labelText),this.svgGroup.line(this.position.getAxisPositionX(),this.position.getAxisPositionY(this.isRelative),this.position.getAxisEndPositionX(),this.position.getAxisPositionY(this.isRelative)).addClass(this.ID_AXIS+"-"+this.convertScenarioType()),this}convertScenarioType(){return void 0===this.scenarioType||null==this.scenarioType?"default":`${this.scenarioType}`.slice(0,2)}}class it{constructor(t,i,s,h,e,n,r,o=null){this.ID_DATA_PREFIX="DATA",this.ID_SCENARIO_PREFIX="SCENARIO",this.ID_RECT="RECT",this.FALLBACK_COLOUR="#000000",this.label=null,this.scenarioLabel=null,this.isVarianceColumn=!1,this.overflowConfig=null,this.isOverflowing=!1,this.overdriveHeight=0,this.dimensions={columnLength:0,xPos:0,yPos:0,labelYPos:0,scenarioLabelXPos:0,scenarioLabelYPos:0,clipped:!1},this.hasData=!1,this.dataPoint=s,this.index=h,this.isPrimaryColumn=e,this.position=t,this.columnBarStyles=i.barStyles,this.overflowConfig=o,this.scenarioGroup=n,this.styles=i,this.columnGroup=n.group().id(n.toString()+"_"+this.ID_RECT),!0!==(null==s?void 0:s.isEmpty())&&(this.hasData=!0,this.dimensions=this.createDimensions(s,h,e),this.label=this.getDataLabel(s),this.scenarioLabel=this.getScenarioLabel(r))}setAsVariance(){var t;return this.isVarianceColumn=!0,null===(t=this.label)||void 0===t||t.setToVarianceLabel(),this}updateLabelGroup(t){var i;return this.isEmpty()||null===(i=this.label)||void 0===i||i.updateGroup(t),this}draw(t={percent:2,decimal:1},i=new A){if(this.isEmpty())return this;const s=this.getScenarioStyle(),h=this.convertToSVGStyle(s,"stroke"),e=this.getFillStyle(s);null!=this.columnGroup&&(this.isOverflowing&&this.overflowConfig?this.drawOverdriveBar(e,h):this.columnGroup.rect(this.position.getColumnWidth(),this.dimensions.columnLength).fill(e).stroke(h).y(this.dimensions.yPos).cx(this.dimensions.xPos)),this.drawColumnDataLabel(t,i),this.drawScenarioLabel()}drawOverdriveBar(t,i){if(!this.columnGroup||!this.overflowConfig)return;const s=this.position.getColumnPositionY(),h=this.position.getColumnWidth(),e=this.dimensions.columnLength,{breakGap:n}=this.overflowConfig,r=s-e;this.columnGroup.rect(h,e).fill(t).stroke(i).y(r).cx(this.dimensions.xPos);const o=r-n-this.overdriveHeight;this.columnGroup.rect(h,this.overdriveHeight).fill(t).stroke(i).y(o).cx(this.dimensions.xPos),this.drawBreakIndicator(r,n)}drawBreakIndicator(t,i){if(!this.columnGroup)return;const s=this.position.getColumnWidth(),h=this.dimensions.xPos-s/2,e=t-i/2,n=.35*i,r=s/3;let o=`M ${h} ${e-n}`;for(let t=0;t<3;t++)o+=` L ${h+r*(t+.5)} ${e-n-.3*i} L ${h+r*(t+1)} ${e-n}`;let l=`M ${h} ${e+n}`;for(let t=0;t<3;t++)l+=` L ${h+r*(t+.5)} ${e+n+.3*i} L ${h+r*(t+1)} ${e+n}`;this.columnGroup.rect(s+2,i).fill("#ffffff").stroke("none").y(t-i).cx(this.dimensions.xPos),this.columnGroup.path(o).fill("none").stroke({color:"#000000",width:1}),this.columnGroup.path(l).fill("none").stroke({color:"#000000",width:1})}createDimensions(t,i,s){const h=t.getScaledUnit();if(this.overflowConfig&&h>0){const e="ac"===t.getScenario()?this.overflowConfig.cutHeight:this.overflowConfig.cutHeight-this.overflowConfig.scenarioCutOffset;if(h>e){this.isOverflowing=!0;const{breakGap:t,overdriveZoneHeight:n,maxOverflow:r}=this.overflowConfig;this.overdriveHeight=r>0?(h-e)/r*n:0;const o=e+t+this.overdriveHeight,l=this.position.getColumnPositionY();return{clipped:!1,columnLength:e,xPos:this.position.getColumnPositionX(i,s),yPos:l-e,labelYPos:l-o-this.position.spacings.labelToColumn,scenarioLabelXPos:this.position.getColumnPositionX(i,s)+this.position.getScenarioLabelPositionOffsetX(s),scenarioLabelYPos:l-.5*e}}}return h<0?{clipped:!1,columnLength:Math.abs(h),xPos:this.position.getColumnPositionX(i,s),yPos:this.position.getColumnPositionY(),labelYPos:this.position.getColumnDataLabelPositionY(h),scenarioLabelXPos:this.position.getColumnPositionX(i,s)+this.position.getScenarioLabelPositionOffsetX(s),scenarioLabelYPos:this.position.getColumnPositionY()+.5*Math.abs(h)}:{clipped:!1,columnLength:h,xPos:this.position.getColumnPositionX(i,s),yPos:this.position.getColumnPositionY()-h,labelYPos:this.position.getColumnDataLabelPositionY(h),scenarioLabelXPos:this.position.getColumnPositionX(i,s)+this.position.getScenarioLabelPositionOffsetX(s),scenarioLabelYPos:this.position.getColumnPositionY()-.5*Math.abs(h)}}getDataLabel(t){let i=X.Bottom;null!=t.value&&t.value<0&&(i=X.Top);const s=this.isOverflowing?this.dimensions.labelYPos:this.position.getColumnDataLabelPositionY(this.dataPoint.getScaledUnit());return new I(this.scenarioGroup,this.position.getColumnCenterPositionX(this.index),s,this.ID_DATA_PREFIX,t.value,this.styles,i,X.Center)}getScenarioLabel(t){return new I(this.scenarioGroup,-1,-1,this.ID_SCENARIO_PREFIX,t,this.styles,X.Center,this.isPrimaryColumn?X.Left:X.Right)}convertToSVGStyle(t,i){return null==t&&(t=[]),t.color=t[i]||this.FALLBACK_COLOUR,Object.assign({},t)}drawScenarioLabel(){null==this.scenarioLabel||this.scenarioLabel.isEmpty()||this.isVarianceColumn||this.scenarioLabel.setPos(this.dimensions.scenarioLabelXPos,this.dimensions.scenarioLabelYPos).draw(!0)}drawColumnDataLabel(t,i=new A){var s;null===(s=this.label)||void 0===s||s.draw(this.isPrimaryColumn,t,i)}getFillStyle(t){var i,s,h,e;const n=this.columnBarStyles[this.dataPoint.getScenario()];return(null==n?void 0:n.fillpattern)&&(null===(i=this.styles.pattern.get(n.fillpattern))||void 0===i?void 0:i.pattern)?null===(e=null===(h=null===(s=this.styles)||void 0===s?void 0:s.pattern)||void 0===h?void 0:h.get(n.fillpattern))||void 0===e?void 0:e.pattern:this.convertToSVGStyle(t,"fill")}getScenarioStyle(){var t;return this.isVarianceColumn?null===(t=this.styles)||void 0===t?void 0:t.varianceStyles.getSVGStyle(this.dataPoint.getVarianceStyle()):this.columnBarStyles[this.dataPoint.getScenario()]}isEmpty(){return!1===this.hasData||Number.isNaN(this.dataPoint.value)}}class st{constructor(t,i,s,h,e,n,r,o,l){this.ID_DATA_PREFIX="DATA",this.ID_SCENARIO_PREFIX="SCENARIO",this.FALLBACK_COLOUR="#000000",this.scenarioLabel=null,this._defaultMarkerPattern=null,this.dimensions={columnLength:0,xPos:0,yPos:0,labelYPos:0,scenarioLabelXPos:0,scenarioLabelYPos:0,clipped:!1},this.hasData=!1,this.position=t,this.markerGroup=i||null,this.markerPattern=s||this._defaultMarkerPattern,this.styles=e,this.barStyles=e?e.barStyles:null,this.scenario=h,!0!==(null==n?void 0:n.isEmpty())&&(this.hasData=!0,this.dimensions=this.createMarkerDimensions(n,r,l),this.scenarioLabel=this.getScenarioLabel(o,e,l))}draw(){if(this.isEmpty())return this;const t=this.convertToSVGStyle(this.barStyles[this.getScenario()],"stroke");let i=this.convertToSVGStyle(this.barStyles[this.getScenario()],"fill");const s=this.barStyles[this.getScenario()];if(null!=s&&s.fillpattern){const t=this.styles.pattern.get(s.fillpattern);null!=t&&(i=t.pattern)}return this.markerGroup.polygon(this.markerPattern.background).fill("#ffffff").cy(this.dimensions.yPos-this.dimensions.columnLength).cx(this.dimensions.xPos),this.markerGroup.polygon(this.markerPattern.foreground).fill(i).stroke(t).cy(this.dimensions.yPos-this.dimensions.columnLength).cx(this.dimensions.xPos),null==this.scenarioLabel||this.scenarioLabel.isEmpty()||this.scenarioLabel.setPos(this.dimensions.scenarioLabelXPos,this.dimensions.scenarioLabelYPos).draw(),this}createMarkerDimensions(t,i,s){return t.getScaledUnit()<0?{clipped:!1,labelYPos:0,columnLength:t.getScaledUnit(),xPos:this.position.getMarkerPositionX(i,s),yPos:this.position.getMarkerPositionY(),scenarioLabelXPos:this.position.getMarkerPositionX(i,s)+this.position.getMarkerScenarioLabelPositionOffsetX(s),scenarioLabelYPos:this.position.getMarkerPositionY()+Math.abs(t.getScaledUnit())}:{clipped:!1,labelYPos:0,columnLength:t.getScaledUnit(),xPos:this.position.getMarkerPositionX(i,s),yPos:this.position.getMarkerPositionY(),scenarioLabelXPos:this.position.getMarkerPositionX(i,s)+this.position.getMarkerScenarioLabelPositionOffsetX(s),scenarioLabelYPos:this.position.getMarkerPositionY()-Math.abs(t.getScaledUnit())}}getScenarioLabel(t,i,s){return null==this.markerGroup?null:new I(this.markerGroup,-1,-1,this.ID_DATA_PREFIX,t,i,X.Center,s?X.Right:X.Left)}convertToSVGStyle(t,i){return null==t&&(t=[]),t.color=t[i]||this.FALLBACK_COLOUR,Object.assign({},t)}isEmpty(){return!1===this.hasData}getScenario(){var t;return null===(t=this.scenario)||void 0===t?void 0:t.slice(0,2)}}class ht{constructor(t,i,s,h,e){this.ID_DATA_PREFIX="DATA",this.ID_SCENARIO_PREFIX="SCENARIO",this.ID_RECT="RECT",this.FALLBACK_COLOUR="#000000",this.dataLabel=null,this.dimensions={columnLength:0,xPos:0,yPos:0,labelYPos:0,scenarioLabelXPos:0,scenarioLabelYPos:0,clipped:!1},this.hasData=!1,this.dataPoint=s,this.index=h,this.position=t,this.barStyles=i.barStyles,this.scenarioGroup=e,this.styles=i,this.barGroup=e.group().id(e.toString()+"_"+this.ID_RECT),!0!==(null==s?void 0:s.isEmpty())&&(this.hasData=!0,this.dimensions=this.createDimensions(t,s,h),this.dataLabel=new I(this.scenarioGroup,this.position.getColumnCenterPositionX(this.index),this.position.getNeedleDataLabelPositionY(this.dataPoint.getScaledPercentUnit()),this.ID_DATA_PREFIX,s.value,this.styles,X.Center,X.Center),this.dataLabel.setToRelativeVarianceLabel())}updateLabelGroup(t){var i;return this.isEmpty()||null===(i=this.dataLabel)||void 0===i||i.updateGroup(t),this}draw(){var t;if(this.isEmpty())return this;const i=this.styles.varianceStyles[this.dataPoint.getVarianceStyle()],s=this.convertToSVGStyle(i,"stroke");let h=this.convertToSVGStyle(i,"fill");const e=this.convertToSVGStyle(this.styles.varianceStyles.ac,"stroke"),n=this.convertToSVGStyle(this.styles.varianceStyles.ac,"fill"),r=this.barStyles[this.dataPoint.getScenario()];if(null!=r&&r.fillpattern){const t=this.styles.pattern.get(r.fillpattern);null!=t&&(h=t.pattern)}this.dimensions.clipped?this.createClippedNeedleHead(h,s):this.createNeedleHead(e,n),this.barGroup.rect(this.position.getNeedleWidth(),this.dimensions.columnLength).cx(this.dimensions.xPos).y(this.dimensions.yPos).fill(h).stroke(s),null===(t=this.dataLabel)||void 0===t||t.draw()}createDimensions(t,i,s){return i.getScaledPercentUnit()<0?{labelYPos:0,scenarioLabelXPos:0,scenarioLabelYPos:0,columnLength:Math.abs(i.getScaledPercentUnit()),xPos:t.getColumnCenterPositionX(s),yPos:t.getNeedlePositionY(),clipped:i.isClipped()}:{columnLength:i.getScaledPercentUnit(),xPos:t.getColumnCenterPositionX(s),yPos:t.getNeedlePositionY()-i.getScaledPercentUnit(),labelYPos:0,scenarioLabelXPos:0,scenarioLabelYPos:0,clipped:i.isClipped()}}convertToSVGStyle(t,i){return null==t&&(t=[]),t.color=t[i]||this.FALLBACK_COLOUR,Object.assign({},t)}createClippedNeedleHead(t,i){const s=this.barGroup.polygon("0,0 5,9 -5,9 0,0 0,5 5,13 -5,13 0,5").fill(t).cx(this.dimensions.xPos).cy(this.getHeadYPosition()).fill(t).stroke(i);null!=this.dataPoint.value&&this.dataPoint.value<0&&s.flip("y")}createNeedleHead(t,i){this.barGroup.rect(2*this.position.getNeedleWidth(),this.position.getNeedleHeadWidth()).cx(this.dimensions.xPos).cy(this.getHeadYPosition()).fill(t).stroke(i)}isEmpty(){return!1===this.hasData||Number.isNaN(this.dataPoint.value)}getHeadYPosition(){let t=this.dimensions.yPos;return null!=this.dataPoint.value&&this.dataPoint.value<0&&(t+=this.dimensions.columnLength),t}}const et={ac:{markerFill:"#000000",markerStroke:"#000000",lineColor:"#000000"},pp:{markerFill:"#999999",markerStroke:"#999999",lineColor:"#999999"},fc:{markerFill:"#ffffff",markerStroke:"#000000",lineColor:"#000000",lineDashArray:"4,4"},pl:{markerFill:"#ffffff",markerStroke:"#000000",lineColor:"#000000"}};class nt{constructor(t,i,s,h,e,n,r,o,l=null){this.MARKER_SIZE=8,this.LINE_WIDTH=2,this.ID_LINE_PREFIX="LINE",this.ID_MARKER_PREFIX="MARKER",this.ID_LABEL_PREFIX="LABEL",this.ESTIMATED_LABEL_WIDTH=56,this.ESTIMATED_LABEL_HEIGHT=24,this.position=t,this.styles=i,this.dataPoints=s,this.scenarioGroup=h,this.labelGroup=e,this.scenarioName=n,this.scenarioLabel=r,this.collisionManager=l}draw(t={percent:2,decimal:1},i=new A){return this.drawGeometry(),this.drawLabels(t,i),this}drawGeometry(){if(0===this.dataPoints.length)return this;const t=this.getLineStyle();return this.drawLines(t),this.drawMarkers(t),this}drawLabels(t={percent:2,decimal:1},i=new A){return 0===this.dataPoints.length||(this.drawScenarioLabel(),this.drawValueLabels(t,i)),this}getLineStyle(){var t,i;const s=(null===(i=null===(t=this.scenarioName)||void 0===t?void 0:t.slice(0,2))||void 0===i?void 0:i.toLowerCase())||"ac";return et[s]||et.ac}getScenarioVariant(){var t;const i=parseInt((null===(t=this.scenarioName)||void 0===t?void 0:t.slice(-1))||"1",10);return isNaN(i)?1:Math.min(Math.max(i,1),4)}drawSquareMarker(t,i,s,h){const e=this.MARKER_SIZE/2;t.rect(this.MARKER_SIZE,this.MARKER_SIZE).fill(h.markerFill).stroke({color:h.markerStroke,width:1}).move(i-e,s-e)}drawCircleMarker(t,i,s,h){t.circle(this.MARKER_SIZE).fill(h.markerFill).stroke({color:h.markerStroke,width:1}).center(i,s)}drawTriangleMarker(t,i,s,h){const e=this.MARKER_SIZE/2;t.polygon(`${i},${s-e} ${i-e},${s+e} ${i+e},${s+e}`).fill(h.markerFill).stroke({color:h.markerStroke,width:1})}drawDiamondMarker(t,i,s,h){const e=this.MARKER_SIZE/2;t.polygon(`${i},${s-e} ${i+e},${s} ${i},${s+e} ${i-e},${s}`).fill(h.markerFill).stroke({color:h.markerStroke,width:1})}drawLines(t){const i=this.scenarioGroup.group().id(this.ID_LINE_PREFIX);for(let s=1;s<this.dataPoints.length;s++){const h=this.dataPoints[s-1],e=this.dataPoints[s];if(h.dataPoint.isEmpty()||e.dataPoint.isEmpty())continue;const n=this.position.getColumnCenterPositionX(h.index),r=this.position.getColumnPositionY()-h.dataPoint.getScaledUnit(),o=this.position.getColumnCenterPositionX(e.index),l=this.position.getColumnPositionY()-e.dataPoint.getScaledUnit(),a=i.line([[n,r],[o,l]]).stroke({color:t.lineColor,width:this.LINE_WIDTH,linecap:"round"}).fill("none");t.lineDashArray&&a.attr("stroke-dasharray",t.lineDashArray)}}drawMarkers(t){const i=this.scenarioGroup.group().id(this.ID_MARKER_PREFIX),s=this.getScenarioVariant();for(const h of this.dataPoints){if(h.dataPoint.isEmpty())continue;const e=this.position.getColumnCenterPositionX(h.index),n=this.position.getColumnPositionY()-h.dataPoint.getScaledUnit();switch(s){case 2:this.drawCircleMarker(i,e,n,t);break;case 3:this.drawTriangleMarker(i,e,n,t);break;case 4:this.drawDiamondMarker(i,e,n,t);break;default:this.drawSquareMarker(i,e,n,t)}}}getLabelPositionPriority(t){const i=this.dataPoints[t];let s=null;for(let i=t+1;i<this.dataPoints.length;i++)if(!this.dataPoints[i].dataPoint.isEmpty()){s=this.dataPoints[i];break}let h=null;for(let i=t-1;i>=0;i--)if(!this.dataPoints[i].dataPoint.isEmpty()){h=this.dataPoints[i];break}const e=i.dataPoint.getScaledUnit();return h&&s&&h.dataPoint.getScaledUnit()>e&&s.dataPoint.getScaledUnit()>e?[G.Below,G.Left,G.Right,G.Above]:[G.Above,G.Left,G.Right,G.Below]}getScenarioType(){var t,i;return(null===(i=null===(t=this.scenarioName)||void 0===t?void 0:t.slice(0,2))||void 0===i?void 0:i.toLowerCase())||"ac"}drawValueLabels(t,i){const s=this.getScenarioType();for(let h=0;h<this.dataPoints.length;h++){const e=this.dataPoints[h];if(e.dataPoint.isEmpty()||null===e.dataPoint.value)continue;const n=this.position.getColumnCenterPositionX(e.index),r=this.position.getColumnPositionY()-e.dataPoint.getScaledUnit();let o=n,l=r-this.MARKER_SIZE/2-2,a=X.Bottom,c=X.Center;if(this.collisionManager){const t=this.getLabelPositionPriority(h),i=this.collisionManager.getOptimalPlacement(n,r,this.ESTIMATED_LABEL_WIDTH,this.ESTIMATED_LABEL_HEIGHT,e.index,this.MARKER_SIZE,s,t);if(null===i)continue;o=i.labelX,l=i.labelY,a=i.verticalHook,c=i.horizontalHook;const u=Object.assign(Object.assign({},i.bounds),{scenarioType:s});this.collisionManager.register(u)}new I(this.labelGroup,o,l,this.ID_LABEL_PREFIX,e.dataPoint.value,this.styles,a,c).draw(!0,t,i)}}drawScenarioLabel(){if(!this.scenarioLabel)return;let t=null;for(let i=this.dataPoints.length-1;i>=0;i--)if(!this.dataPoints[i].dataPoint.isEmpty()){t=this.dataPoints[i];break}if(!t)return;const i=this.position.getColumnCenterPositionX(t.index)+this.MARKER_SIZE+4,s=this.position.getColumnPositionY()-t.dataPoint.getScaledUnit(),h=this.getScenarioType();if(this.collisionManager){if(this.collisionManager.shouldHideScenarioLabel(i,s,h))return;this.collisionManager.registerScenarioLabel(i,s,h)}new I(this.labelGroup,i,s,"SCENARIO_LABEL",this.scenarioLabel,this.styles,X.Center,X.Left).forceStringTypeDraw()}}class rt{constructor(t,i,s,h,e,n,r,o,l,a,c){this.hasData=!1,this.position=t,this.styles=i,this.dataPoint=s,this.index=h,this.baselineValue=e,this.segmentIndex=r,this.stackMode=o,this.totalValue=l,this.group=c,this.columnGroup=c.group().id(`stacked_col_${h}_seg_${r}`),!0!==(null==s?void 0:s.isEmpty())&&null!=s.value&&(this.hasData=!0)}draw(t={percent:2,decimal:1},i=new A){if(!this.hasData||null==this.dataPoint.value)return;const s=this.dataPoint.value,h=this.dataPoint.pixelPerUnit;let e,n;const l=this.position.getColumnPositionY();if(this.stackMode===b.RELATIVE){const t=h;e=(0!==this.totalValue?Math.abs(s)/Math.abs(this.totalValue):0)*t,n=l-this.baselineValue/Math.abs(this.totalValue)*t-e}else e=Math.abs(s*h),n=l-this.baselineValue*h-e;const a=this.position.getColumnCenterPositionX(this.index),c=this.position.getColumnWidth(),u=r(this.segmentIndex),d={color:u},f={color:o(this.segmentIndex),width:.5};if(this.columnGroup.rect(c,Math.max(e,.5)).fill(d).stroke(f).y(n).cx(a),e>=18){const h=n+e/2;if(this.stackMode===b.RELATIVE||this.stackMode===b.ABSOLUTE_RELATIVE){const i=(0!==this.totalValue?s/this.totalValue*100:0).toFixed(t.percent)+"%";new I(this.group,a,h,"STACK_SEG",i,this.styles,X.Center,X.Center).setSegmentFill(u).forceStringTypeDraw()}else new I(this.group,a,h,"STACK_SEG",s,this.styles,X.Center,X.Center).setSegmentFill(u).draw(!0,t,i)}}drawTotalLabel(t={percent:2,decimal:1},i=new A){if(this.stackMode===b.RELATIVE)return;const s=this.position.getColumnCenterPositionX(this.index),h=this.position.getColumnPositionY();new I(this.group,s,h-this.totalValue*this.dataPoint.pixelPerUnit-this.position.spacings.labelToColumn,"STACK_TOTAL",this.totalValue,this.styles,X.Bottom,X.Center).draw(!0,t,i)}}const ot={ac:{fill:"#000000",opacity:.3,lineColor:"#000000"},pp:{fill:"#999999",opacity:.3,lineColor:"#999999"},fc:{fill:"#000000",opacity:.2,lineColor:"#000000",dashArray:"4,4"},pl:{fill:"#000000",opacity:.1,lineColor:"#000000"}},lt=[{fill:"#000000",opacity:.3},{fill:"#555555",opacity:.25},{fill:"#999999",opacity:.2},{fill:"#bbbbbb",opacity:.15},{fill:"#dddddd",opacity:.1}];class at{constructor(t,i,s,h,e,n){this.group=t.group().id(`area_fill_${e}`),this.upperPoints=i,this.lowerPoints=s,this.scenarioType=h,this.segmentIndex=e,this.isScenarioStack=n}draw(){if(this.upperPoints.length<2||this.lowerPoints.length<2)return;let t,i,s=`M ${this.upperPoints[0].x},${this.upperPoints[0].y}`;for(let t=1;t<this.upperPoints.length;t++)s+=` L ${this.upperPoints[t].x},${this.upperPoints[t].y}`;for(let t=this.lowerPoints.length-1;t>=0;t--)s+=` L ${this.lowerPoints[t].x},${this.lowerPoints[t].y}`;if(s+=" Z",this.isScenarioStack&&this.scenarioType){const s=this.scenarioType.slice(0,2).toLowerCase(),h=ot[s]||ot.ac;t=h.fill,i=h.opacity}else{const s=Math.min(this.segmentIndex,lt.length-1);t=lt[s].fill,i=lt[s].opacity}this.group.path(s).fill(t).opacity(i).stroke("none")}drawBoundaryLine(){if(this.upperPoints.length<2)return;let t,i="#000000";if(this.isScenarioStack&&this.scenarioType){const s=this.scenarioType.slice(0,2).toLowerCase(),h=ot[s]||ot.ac;i=h.lineColor,t=h.dashArray}const s=this.group.polyline(this.upperPoints.map((t=>[t.x,t.y]))).fill("none").stroke({color:i,width:1.5});t&&s.attr("stroke-dasharray",t)}}class ct{constructor(t,i,s,h,e,n,r,o){this.ID_DATA_PREFIX="DATA",this.ID_SCENARIO_PREFIX="SCENARIO",this.ID_RECT="RECT",this.FALLBACK_COLOUR="#000000",this.label=null,this.scenarioLabel=null,this.isVarianceLine=!1,this.dimensions={columnLength:0,xPos:0,yPos:0,labelYPos:0,scenarioLabelXPos:0,scenarioLabelYPos:0,clipped:!1},this.previousDimensions={columnLength:0,xPos:0,yPos:0,labelYPos:0,scenarioLabelXPos:0,scenarioLabelYPos:0,clipped:!1},this.hasData=!1,this.dataPoint=s,this.index=e,this.isPrimaryLine=n,this.position=t,this.LineBarStyles=i.barStyles,this.scenarioGroup=r,this.styles=i,this.LineGroup=r.group().id(r.toString()+"_"+this.ID_RECT),!0!==(null==s?void 0:s.isEmpty())&&(this.hasData=!0,this.dimensions=this.createDimensions(s,e,n),this.label=this.getDataLabel(s),this.scenarioLabel=this.getScenarioLabel(o)),this.previousDimensions=this.createDimensions(h,e-1,n)}setAsVariance(){var t;return this.isVarianceLine=!0,null===(t=this.label)||void 0===t||t.setToVarianceLabel(),this}updateLabelGroup(t){var i;return this.isEmpty()||null===(i=this.label)||void 0===i||i.updateGroup(t),this}draw(t={percent:2,decimal:1},i=new A){if(this.isEmpty())return this;const s=this.getScenarioStyle(),h=this.getFillStyle(s);null!=this.LineGroup&&this.LineGroup.line([[this.previousDimensions.xPos,this.previousDimensions.yPos],[this.dimensions.xPos,this.dimensions.yPos]]).fill(h).stroke({color:"#f06",width:3,linecap:"round"}),this.drawLineDataLabel(t,i),this.drawScenarioLabel()}createDimensions(t,i,s){return{clipped:!1,columnLength:t.getScaledUnit(),xPos:this.position.getColumnPositionX(i,s),yPos:this.position.getColumnPositionY()-t.getScaledUnit(),labelYPos:this.position.getColumnDataLabelPositionY(t.getScaledUnit()),scenarioLabelXPos:this.position.getColumnPositionX(i,s)+this.position.getScenarioLabelPositionOffsetX(s),scenarioLabelYPos:this.position.getColumnPositionY()-t.getScaledUnit()}}getDataLabel(t){let i=X.Bottom;return null!=t.value&&t.value<0&&(i=X.Top),new I(this.scenarioGroup,this.position.getColumnCenterPositionX(this.index),this.position.getColumnDataLabelPositionY(this.dataPoint.getScaledUnit()),this.ID_DATA_PREFIX,t.value,this.styles,i,X.Center)}getScenarioLabel(t){return new I(this.scenarioGroup,0,0,this.ID_SCENARIO_PREFIX,t,this.styles,X.Bottom,X.Left)}convertToSVGStyle(t,i){return null==t&&(t=[]),t.color=t[i]||this.FALLBACK_COLOUR,Object.assign({},t)}drawScenarioLabel(){null==this.scenarioLabel||this.scenarioLabel.isEmpty()||this.isVarianceLine||this.scenarioLabel.setPos(this.dimensions.scenarioLabelXPos,this.dimensions.scenarioLabelYPos).draw(!0)}drawLineDataLabel(t,i=new A){var s;null===(s=this.label)||void 0===s||s.draw(this.isPrimaryLine,t,i)}getFillStyle(t){var i,s,h,e;const n=this.LineBarStyles[this.dataPoint.getScenario()];return(null==n?void 0:n.fillpattern)&&(null===(i=this.styles.pattern.get(n.fillpattern))||void 0===i?void 0:i.pattern)?null===(e=null===(h=null===(s=this.styles)||void 0===s?void 0:s.pattern)||void 0===h?void 0:h.get(n.fillpattern))||void 0===e?void 0:e.pattern:this.convertToSVGStyle(t,"fill")}getScenarioStyle(){var t;return this.isVarianceLine?null===(t=this.styles)||void 0===t?void 0:t.varianceStyles.getSVGStyle(this.dataPoint.getVarianceStyle()):this.LineBarStyles[this.dataPoint.getScenario()]}isEmpty(){return!1===this.hasData||Number.isNaN(this.dataPoint.value)}}class ut{constructor(t,i,s,h,e){this.pixelPerUnit=1,this.collisionManager=null,this.overflowConfig=null,this.i18n=e;const n=i.group().id("Scenario1"),r=i.group().id("Scenario2").insertBefore(n);this.svgGroups={parent:i,scenario1:n,scenario2:r,scenario3:i.group().id("Scenario3"),scenario4:i.group().id("Scenario4"),scenario1Label:i.group().id("label")},this.styles=s,this.position=t,this.elementCnt=h}setOverflowConfig(t){this.overflowConfig=t}createLine(t,i,s,h){const e=this.svgGroups.scenario1.group().id(""+h),n=this.svgGroups.scenario1Label.group().id(""+h);let r=null;return this.isLastDataPoint(h-1)&&(r=t),new ct(this.position,this.styles,i,s,h,!1,e,r).updateLabelGroup(n)}createPrimaryBar(t,i){const s=this.svgGroups.scenario1.group().id(""+i),h=this.svgGroups.scenario1Label.group().id(""+i);let e=null;return this.isLastDataPoint(i)&&(e=`${this.i18n.get(t.scenario)||t.scenario}`),new it(this.position,this.styles,t,i,!0,s,e,this.overflowConfig).updateLabelGroup(h)}createVarianceBar(t,i){const s=this.svgGroups.scenario1.group().id(""+i),h=this.svgGroups.scenario1Label.group().id(""+i);let e=null;return this.isLastDataPoint(i)&&(e=`${this.i18n.get(t.scenario)||t.scenario}`),new it(this.position,this.styles,t,i,!0,s,e,this.overflowConfig).updateLabelGroup(h).setAsVariance()}createRelativeVarianceBar(t,i){const s=this.svgGroups.scenario1.group().id(""+i),h=this.svgGroups.scenario1Label.group().id(""+i);return new ht(this.position,this.styles,t,i,s).updateLabelGroup(h)}createSecondaryBar(t,i){const s=this.svgGroups.scenario2.group().id(""+i);let h=null;return this.isFirstDataPoint(i)&&(h=`${this.i18n.get(t.scenario)||t.scenario}`),new it(this.position,this.styles,t,i,!1,s,h,this.overflowConfig)}createPrimaryMarker(t,i){const s=this.svgGroups.scenario3.group().id(""+i),h=this.styles.pattern.get("marker-right")||{foreground:"#000000",background:"#ffffff",bgOffset:0};let e=null;return this.isFirstDataPoint(i)&&(e=`${this.i18n.get(t.scenario)||t.scenario}`),new st(this.position,s,h,t.scenario,this.styles,t,i,e,!0)}createSecondaryMarker(t,i){const s=this.svgGroups.scenario4.group().id(""+i),h=this.styles.pattern.get("marker-left")||{foreground:"#000000",background:"#ffffff",bgOffset:0};let e=null;return this.isLastDataPoint(i)&&(e=`${this.i18n.get(t.scenario)||t.scenario}`),new st(this.position,s,h,t.scenario,this.styles,t,i,e,!1)}isLastDataPoint(t){return this.elementCnt-1===t}isFirstDataPoint(t){return 0===t}setCollisionManager(t){this.collisionManager=t}moveLabelsToFront(){this.svgGroups.scenario1Label.front()}createLineSeries(t,i){const s=this.svgGroups.parent.group().id("LineSeries_"+i),h=this.svgGroups.scenario1Label.group().id("LineSeries_Label_"+i),e=`${this.i18n.get(i)||i}`;return new nt(this.position,this.styles,t,s,h,i,e,this.i18n,this.collisionManager)}}var dt,ft;!function(t){t[t.UP_TO_DATE=0]="UP_TO_DATE",t[t.DIRTY=1]="DIRTY"}(dt||(dt={})),function(t){t.RELATIVE="dr",t.ABSOLUTE="d",t.NONE=""}(ft||(ft={}));class pt{constructor(t,i,s,h=0){this.CSS_CATEGORIES="categories",this.dataModel=[],this.variancesDataModel=[],this.title="",this.smallestDataPointValue=new q(0,B.AC1,1,B.NEU),this.highestDataPointValue=new q(0,B.AC1,1,B.NEU),this.smallestVarianceDataPointValue=new q(0,B.AC1,1,B.NEU),this.highestVarianceDataPointValue=new q(0,B.AC1,1,B.NEU),this.pixelPerUnit=1,this.pixelPerPercentage=1,this.hideAxisLabels=!1,this.axisScenario=B.AC1,this.preparedDataSet=[],this.axisCategoryArea={width:0,height:0},this.scenariosArea={width:0,height:0},this.state=dt.DIRTY,this.i18n=new Map,this.leftSideOffsetForHorizontalSync=-1,this.dateInterval=$.DAY,this.locale="de",this.axisLabelsMode=g.SMART,this.intervalSpanLimit=32,this.measureScale=new A,this.measureUnit="",this.dataFormatDigits={percent:2,decimal:1},this.showOverlayMedian=!1,this.showOverlayAvg=!1,this.chartMode=m.BAR,this.maxBars=28,this.stackConfig=null,this.lineFullWidth=!0,this.availableWidth=0,this.overflowConfig=null,this.lastScenarios=[],this.initSQLFunctions(),this.ruleSet=t||new E,this.i18n=this.createI18n(new Map),this.styles=s,this.availableWidth=h,this.setConfig(i),this.position=this.createElementPosition(i.scenarios)}updatePosition(t){this.position=this.createElementPosition(t)}initSQLFunctions(){D.fn.transformOperator=function(t){return"-"===t?-1:1},D.fn.normalizeDate=function(t,i){if(void 0!==t&&t.isValid)return t.startOf(i)}}setStyles(t){this.styles=t}setAvailableWidth(t){this.availableWidth=t}setAvailableHeight(t){this.pixelPerUnit<=0||t<=0?this.overflowConfig=null:null==this.stackConfig&&this.determineEffectiveChartMode()===m.BAR?(this.overflowConfig=this.calculateOverflowConfig(t),this.overflowConfig&&this.updatePosition(this.lastScenarios)):this.overflowConfig=null}calculateOverflowConfig(t){const i=(this.isVarianceChart()?this.highestVarianceDataPointValue:this.highestDataPointValue).getScaledUnit();if(i<=0)return null;const s=this.styles.fontStyles.size,h=1.5*s,e=.3*s,n=t-(this.position.dataLabelHeight+this.position.spacings.labelToColumn+this.position.padding.top+this.position.padding.bottom+this.position.spacings.labelToAxis+s)-h-e,r=.8*s;if(n<=r)return null;const o=n-r;return i<=o?null:{cutHeight:n,overdriveZoneHeight:h,breakGap:e,maxOverflow:i-o,scenarioCutOffset:r}}setConfig(t){var i;this.state=dt.DIRTY,this.sortScenariosbyVisualisationRules(t),this.setData([...t.data],t.filter),this.hideAxisLabels=t.hideAxisLabels||!1,this.pixelPerUnit=t.pixelPerUnit,this.pixelPerPercentage=t.pixelPerPercentage,this.axisLabelsMode=t.axisLabelsMode,this.intervalSpanLimit=t.intervalSpanLimit,this.dateInterval=this.findDateInterval(t.dateInterval),this.dataModel=this.populateModel(t.scenarios,this.dateInterval,t.level,t.sortOrder),this.variancesDataModel=this.populateVarianceModel(t.variances,this.dataModel),this.title=t.title||C.translateScenarioLabel(null===(i=null==t?void 0:t.variances)||void 0===i?void 0:i.toString(),this.i18n),this.smallestDataPointValue=this.findSmallestDataPointValue(this.dataModel),this.smallestVarianceDataPointValue=this.findSmallestDataPointValue(this.variancesDataModel),this.highestDataPointValue=this.findHighestDataPointValue(this.dataModel),this.highestVarianceDataPointValue=this.findHighestDataPointValue(this.variancesDataModel),this.axisScenario=this.setAxisScenario(t.variances),this.leftSideOffsetForHorizontalSync=t.leftSideOffsetForHorizontalSync,this.measureScale=t.measureScale,this.measureUnit=t.measureUnit,this.dataFormatDigits=t.dataFormatDigits,this.showOverlayMedian=t.showOverlayMedian,this.showOverlayAvg=t.showOverlayAvg,this.chartMode=t.chartMode,this.maxBars=t.maxBars,this.stackConfig=t.stackConfig,this.lineFullWidth=t.lineFullWidth,this.lastScenarios=t.scenarios,this.updatePosition(t.scenarios)}getFooter(){return 1===this.measureScale.value&&""===this.measureUnit?" ":C.translateScenarioLabel("in",this.i18n)+" "+this.measureScale.prefix+this.measureUnit}sortScenariosbyVisualisationRules(t){const i=this;t.scenarios.sort(((t,s)=>i.ruleSet.getScenarioSorIndex(t)-i.ruleSet.getScenarioSorIndex(s))).reverse()}setI18n(t){this.i18n=this.createI18n(t)}setData(t,i){if(null!=t)if(this.state=dt.DIRTY,this.preparedDataSet.length=0,null!=i&&i.length>0)try{this.preparedDataSet=D(`SELECT * FROM ? WHERE ${i}`,[t])}catch(s){console.error("TimeChart: filter query failed, using unfiltered data",i,s),this.preparedDataSet=t}else this.preparedDataSet=t}getAllocatedCanvasWidth(){const t=this.position.getAxisEndPositionX(),i=3*this.styles.fontStyles.size,s=Math.max(this.axisCategoryArea.width,this.scenariosArea.width);return Math.max(t+i,s>0?s+this.position.leftSideLabelLength:0)}getAllocatedCanvasHeight(){if(null==this.smallestVarianceDataPointValue.value||null==this.highestVarianceDataPointValue.value||null==this.smallestDataPointValue.value||null==this.highestDataPointValue.value)return 0;const t=this.isVarianceChart()&&this.variancesDataModel.some((t=>t.type===ft.RELATIVE)),i=this.position.getAxisPositionY(t),s=this.position.spacings.labelToAxis+this.position.dataLabelHeight+this.styles.padding.bottom;let h;if(this.isOnSameAxisSide())h=i+s;else{const t=this.isVarianceChart()?this.smallestVarianceDataPointValue:this.smallestDataPointValue;h=i+Math.abs(t.getScaledUnit())+this.position.spacings.labelToColumn+this.position.dataLabelHeight+s}const e=this.isOnSameAxisSide();return Math.max(h,e?this.axisCategoryArea.height+this.scenariosArea.height:this.scenariosArea.height)}toString(){const t=new e;return this.draw(t),t.id("drawCanvas"),t.width(this.getAllocatedCanvasWidth()),t.height(this.getAllocatedCanvasHeight()),t.attr("overflow","visible"),t.svg()}draw(t){this.cleanSVGforRedraw(t),this.state===dt.DIRTY&&(this.state=dt.UP_TO_DATE),this.isVarianceChart()?(this.drawVarianceScenario(this.variancesDataModel,t),this.drawAxisAndLabels(this.variancesDataModel,t)):null!=this.stackConfig?this.determineEffectiveChartMode()===m.LINE?(this.drawStackedAreaScenarios(this.dataModel,t),this.drawAxisAndLabelsForLineChart(this.dataModel,t)):(this.drawStackedScenarios(this.dataModel,t),this.drawStackedHeaders(this.dataModel,t),this.drawAxisAndLabels(this.dataModel,t)):this.determineEffectiveChartMode()===m.LINE?(this.drawLineScenarios(this.dataModel,t),this.drawAxisAndLabelsForLineChart(this.dataModel,t)):(this.drawScenarios(this.dataModel,t),this.drawOverlayLayer(this.dataModel,t),this.drawAxisAndLabels(this.dataModel,t))}determineEffectiveChartMode(){return this.chartMode===m.LINE||this.chartMode===m.AUTO&&this.dataModel.length>this.maxBars?m.LINE:m.BAR}setPattern(t,i){this.styles.pattern.set(t,i)}hasNoData(){return 0===this.dataModel.length}isOnSameAxisSide(){return null!=this.smallestVarianceDataPointValue.value&&null!=this.highestVarianceDataPointValue.value&&null!=this.smallestDataPointValue.value&&null!=this.highestDataPointValue.value&&(this.isVarianceChart()?Math.sign(this.smallestVarianceDataPointValue.value)===Math.sign(this.highestVarianceDataPointValue.value)||0===this.smallestDataPointValue.value&&1===Math.sign(this.highestDataPointValue.value):Math.sign(this.smallestDataPointValue.value)===Math.sign(this.highestDataPointValue.value)||0===this.smallestDataPointValue.value&&1===Math.sign(this.highestDataPointValue.value))}createI18n(t){this.state=dt.DIRTY;const i=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"],["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 new Map([...i,...t])}createElementPosition(t){let i;const s=M(t.filter(((t,i)=>1===i||2===i)).map((t=>C.translateScenarioLabel(t,this.i18n))).reduce(((t,i)=>t.length<i.length?i:t),""),{font:this.styles.fontStyles.font,fontSize:this.styles.fontStyles.size+"px"}).width,h=this.calculateTitleLength(this.leftSideOffsetForHorizontalSync);let e,n;if(i=s>h?s:h,null!=this.position&&(i+=this.position.spacings.labelToColumn),this.leftSideOffsetForHorizontalSync>-1&&(i=this.leftSideOffsetForHorizontalSync),this.isVarianceChart()?(e=this.smallestVarianceDataPointValue,n=this.highestVarianceDataPointValue):(e=this.smallestDataPointValue,n=this.highestDataPointValue),this.overflowConfig){const{cutHeight:t,overdriveZoneHeight:i,breakGap:s}=this.overflowConfig;n=new q(t+i+s,n.scenario,1,n.variance)}let r=this.styles.scaleFactors;const o=this.determineEffectiveChartMode();if(this.lineFullWidth&&this.availableWidth>0&&this.dataModel.length>0&&!this.isVarianceChart()&&o===m.LINE){const t=this.styles.fontStyles.size,s=this.styles.padding,h=this.styles.scaleFactors,e=this.availableWidth-(s.left+s.right+t*h.scenarioOffset+i+t*h.columnWidth);if(e>0){const i=Math.max(e/this.dataModel.length/t,1.2*h.columnWidth),s=new N;Object.assign(s,h),s.categoryWidth=i,r=s}}return new H(new F(this.styles.padding),r,this.styles.fontStyles,e,n,this.dataModel.length,i)}calculateTitleLength(t){let i="_______";i.length<this.title.length&&(i=this.title);const s=M(i,{font:this.styles.fontStyles.font,fontSize:this.styles.fontStyles.size+"px"}).width;return s<t?t:s}setAxisScenario(t){let i=B.AC1;if(null!=t&&t.length>0){const s=new x(t.toString());s.isValid&&(i=s.delta)}return null===i&&(i=B.AC1),i}populateModel(t,i,s,h){var e;if(0===(null===(e=this.preparedDataSet)||void 0===e?void 0:e.length))return[];let n=this.queryDataSet(i,"","");return this.detectNaNCells(t,n),n=this.leftOuterJoinDates(n,i),this.createDataRows(n,t)}detectNaNCells(t,i){i.forEach((i=>(t.forEach((t=>{const s=new x(t);!0===s.isValid?0!==i[s.base+"_cnt"]&&0!==i[s.delta+"_cnt"]||(i[t]=Number.NaN):0===i[t+"_cnt"]&&(i[t]=Number.NaN)})),i)))}findDateInterval(t){var i,s,h;if(t!==$.AUTO)return t;const e=this.queryMinMaxDates();let n=$.DAY;return null!=(null===(i=e[0])||void 0===i?void 0:i.mindate)&&(n=(new _).calculateDistanceType(null===(s=e[0])||void 0===s?void 0:s.mindate,null===(h=e[0])||void 0===h?void 0:h.maxdate,this.intervalSpanLimit)),n}queryMinMaxDates(){var t,i,s,h;const e=D("SELECT MAX(date) as maxdate, MIN(date) as mindate FROM ?",[this.preparedDataSet]);return null!=(null===(t=e[0])||void 0===t?void 0:t.mindate)&&(e[0].mindate=v.fromMillis(null===(i=e[0])||void 0===i?void 0:i.mindate)),null!=(null===(s=e[0])||void 0===s?void 0:s.maxdate)&&(e[0].maxdate=v.fromMillis(null===(h=e[0])||void 0===h?void 0:h.maxdate)),e}queryDataSet(t,i,s){const h=`normalizeDate([date], '${t}' , '${this.locale}') as calcdate`;return D(`SELECT p.calcdate ${i},\n ${["ac1","ac2","ac3","ac4","pp1","pp2","pp3","pp4","fc1","fc2","fc3","fc4","pl1","pl2","pl3","pl4"].map((t=>`SUM(${t} * transformOperator(operation)) as ${t}, COUNT(ISNULL(${t})) as ${t}_cnt`)).join(",")} \n \n FROM (SELECT ${h} ${i},\n ac1,\n ac2,\n ac3,\n ac4,\n pp1,\n pp2,\n pp3,\n pp4,\n fc1,\n fc2,\n fc3,\n fc4,\n pl1,\n pl2,\n pl3,\n pl4\n FROM ?) as p\n GROUP BY calcdate ${s}\n ORDER BY calcdate asc`,[this.preparedDataSet])}createDataRows(t,i){const s=[];return t.forEach(((t,h)=>{s.push({id:h,category:t.category,type:ft.NONE,date:t.calcdate,scenario1:new q(t[i[0]],i[0],this.pixelPerUnit,B.NEU),scenario2:new q(t[i[1]],i[1],this.pixelPerUnit,B.NEU),scenario3:new q(t[i[2]],i[2],this.pixelPerUnit,B.NEU),scenario4:new q(t[i[3]],i[3],this.pixelPerUnit,B.NEU)})})),s}findSmallestDataPointValue(t){const i=this.isVarianceChart()?this.pixelPerPercentage:this.pixelPerUnit;let s=new q(0,"default",i,B.NEU);for(const i of t)for(const t of[i.scenario1,i.scenario2,i.scenario3,i.scenario4])t&&null!=t.value&&t.value<Number(s.value)&&(s=t);return s}findHighestDataPointValue(t){const i=this.isVarianceChart()?this.pixelPerPercentage:this.pixelPerUnit;let s=new q(0,"default",i,B.NEU);for(const i of t)for(const t of[i.scenario1,i.scenario2,i.scenario3,i.scenario4])null!=t&&t.value>Number(s.value)&&(s=t);return s}populateVarianceModel(t,i){const s=[];if(null==t||0===t.length)return s;let h=null;null!=i&&i.length>0&&(h=i[0]);for(const e in t){const n=new x(t[e]);if(n.isValid){const t=this.mapScenarios(n,h),e=n.direction,r="dr"===n.type?this.pixelPerPercentage:this.pixelPerUnit;for(const h in i)s.push({id:Number(h),category:i[h].category,type:"dr"===n.type?ft.RELATIVE:ft.ABSOLUTE,date:i[h].date,scenario1:new q(this.calculateVariance(n,i[h],t),n.delta,r,e),scenario2:new q(null,null,null,null),scenario3:new q(null,null,null,null),scenario4:new q(null,null,null,null)})}}return s}calculateVariance(t,i,s){const h=s.get(t.base),e=s.get(t.delta);return null==h||null==e||null==i[h].value||null==i[e].value?null:t.type===ft.RELATIVE?(i[h].value-i[e].value)/i[e].value:i[h].value-i[e].value}mapScenarios(t,i){const s=new Map;return null==i||["scenario1","scenario2","scenario3","scenario4"].forEach((h=>{i[h].scenario===t.delta?s.set(t.delta,h):i[h].scenario===t.base&&s.set(t.base,h)})),s}cleanSVGforRedraw(t){t.clear()}isVarianceChart(){return this.variancesDataModel&&this.variancesDataModel.length>0}createDateFactory(){return new _}drawAxisAndLabels(t,i){const s=this.createDateFactory(),h=i.group().id("AxisAndDateLables");let e=!1;if(!1===this.hideAxisLabels)t.forEach(((t,i)=>{let n=X.Top,r=this.position.spacings.labelToAxis;t.scenario1.value<0&&(n=X.Bottom,r*=-1),t.type===ft.RELATIVE&&(e=!0);let o=s.getDateString(t.date,this.dateInterval);this.axisLabelsMode===g.SMART?(o=s.getSmartDateString(t.date,this.dateInterval),0===i&&this.dateInterval!==$.YEAR&&(o=s.getShortDateString(t.date,this.dateInterval))):this.axisLabelsMode===g.SHORT&&(o=s.getShortDateString(t.date,this.dateInterval)),new I(h,this.position.getColumnCenterPositionX(i),this.position.getAxisPositionY(e)+r,"",o,this.styles,n,X.Center).forceStringTypeDraw()}));else{const i=null==t?void 0:t[0];i&&i.type===ft.RELATIVE&&(e=!0)}new tt({scenarioType:this.axisScenario,labelText:this.title,isRelative:e},this.position,h).draw(),this.axisCategoryArea={height:h.height(),width:h.width()}}drawScenarios(t,i){const s=i.group().id("Scenarios"),h=new ut(this.position,s,this.styles,t.length,this.i18n);h.setOverflowConfig(this.overflowConfig);let e=!1;t.forEach(((t,i)=>{h.createPrimaryBar(t.scenario1,i).draw(this.dataFormatDigits,this.measureScale),h.createSecondaryBar(t.scenario2,i).draw(),h.createPrimaryMarker(t.scenario3,i).draw(),h.createSecondaryMarker(t.scenario4,i).draw(),!1===t.scenario1.isEmpty()&&(e=!0)}));let n=0;!1===e&&(n=this.isOnSameAxisSide()?this.position.dataLabelHeight:2*this.position.dataLabelHeight),this.scenariosArea={height:s.height()+this.styles.padding.top+this.styles.padding.bottom+n,width:s.width()+this.position.spacings.columnWidth}}drawLineScenarios(t,i){var s,h;const e=i.group().id("LineScenarios"),n=new z,r=new ut(this.position,e,this.styles,t.length,this.i18n);r.setCollisionManager(n);const o=["ac1","pp1","fc1","pl1"],l=[[],[],[],[]];t.forEach(((t,i)=>{["scenario1","scenario2","scenario3","scenario4"].forEach(((s,h)=>{t[s]&&l[h].push({dataPoint:t[s],index:i})}))}));const a=[];for(let t=0;t<l.length;t++){const i=l[t];if(i.length>0&&i.some((t=>!t.dataPoint.isEmpty()))){const e=(null===(h=null===(s=i[0])||void 0===s?void 0:s.dataPoint)||void 0===h?void 0:h.scenario)||o[t],n=e.slice(0,2).toLowerCase();a.push({points:i,scenarioName:e,scenarioType:n})}}a.sort(((t,i)=>(W[i.scenarioType]||99)-(W[t.scenarioType]||99)));const c=[];for(const t of a){const i=r.createLineSeries(t.points,t.scenarioName);c.push({series:i,scenarioType:t.scenarioType})}for(const t of c)t.series.drawGeometry();r.moveLabelsToFront();const u=[...c].sort(((t,i)=>(W[t.scenarioType]||99)-(W[i.scenarioType]||99)));for(const t of u)t.series.drawLabels(this.dataFormatDigits,this.measureScale);const d=this.position.getColumnPositionY();this.scenariosArea={height:Math.max(e.height()+this.styles.padding.top,d)+this.styles.padding.bottom,width:e.width()+this.position.spacings.columnWidth}}drawAxisAndLabelsForLineChart(t,i){const s=this.createDateFactory(),h=i.group().id("AxisAndDateLabelsLine"),e=!1,n=t.length-1;!1===this.hideAxisLabels&&t.forEach(((i,r)=>{if(!this.shouldShowLineChartAxisLabel(t,r))return;let o,l=X.Top,a=this.position.spacings.labelToAxis;i.scenario1.value<0&&(l=X.Bottom,a*=-1),this.lineFullWidth&&this.availableWidth>0?this.axisLabelsMode===g.SMART?(o=s.getSmartDateString(i.date,this.dateInterval),0===r&&this.dateInterval!==$.YEAR&&(o=s.getShortDateString(i.date,this.dateInterval))):o=this.axisLabelsMode===g.SHORT?s.getShortDateString(i.date,this.dateInterval):s.getDateString(i.date,this.dateInterval):o=s.getShortDateString(i.date,this.dateInterval),new I(h,this.position.getColumnCenterPositionX(r),this.position.getAxisPositionY(e)+a,"",o,this.styles,l,X.Center).forceStringTypeDraw(),r>0&&r<n&&this.isYearChange(t,r)&&this.drawYearSeparatorLine(h,r,e)})),new tt({scenarioType:this.axisScenario,labelText:this.title,isRelative:e},this.position,h).draw(),this.axisCategoryArea={height:h.height(),width:h.width()}}shouldShowLineChartAxisLabel(t,i){return!!(this.lineFullWidth&&this.availableWidth>0)||(0===i||i===t.length-1||this.isYearChange(t,i))}isYearChange(t,i){var s,h;if(0===i)return!1;const e=null===(s=t[i])||void 0===s?void 0:s.date,n=null===(h=t[i-1])||void 0===h?void 0:h.date;return!(!e||!n)&&e.year!==n.year}drawYearSeparatorLine(t,i,s){const h=this.position.getColumnCenterPositionX(i)-this.position.spacings.columnWidth/2,e=this.position.columnValue.max.getScaledUnit()+this.position.dataLabelHeight,n=this.position.getAxisPositionY(s)-e,r=this.position.getAxisPositionY(s);t.line([[h,n],[h,r]]).stroke({color:"#999999",width:1,dasharray:"4,4"}).attr("stroke-dasharray","4,4")}drawVarianceScenario(t,i){const s=i.group().id("Scenarios"),h=new ut(this.position,s,this.styles,t.length,this.i18n);return h.setOverflowConfig(this.overflowConfig),t.forEach(((t,i)=>{t.type===ft.RELATIVE?h.createRelativeVarianceBar(t.scenario1,i).draw():h.createVarianceBar(t.scenario1,i).draw(this.dataFormatDigits,this.measureScale)})),this.scenariosArea={height:s.height()+this.styles.padding.top+this.styles.padding.bottom,width:s.width()+this.position.spacings.columnWidth},s}drawStackedScenarios(t,i){if(!this.stackConfig)return;const s=i.group().id("StackedScenarios"),h=this.stackConfig.by===L.SCENARIO;t.forEach(((t,i)=>{const e=["scenario1","scenario2","scenario3","scenario4"],n=[];if(h)for(const i of e){const s=t[i];s&&!s.isEmpty()&&null!=s.value&&n.push({value:s.value,scenario:s.scenario,dataPoint:s})}else{const i=t.scenario1;i&&!i.isEmpty()&&null!=i.value&&n.push({value:i.value,scenario:i.scenario,dataPoint:i})}if(0!==n.length)if((h?new Set(n.map((t=>l(t.scenario)))):new Set).size>1){const t=new Map;for(const i of n){const s=l(i.scenario);t.has(s)||t.set(s,[]),t.get(s).push(i)}const h=[];for(const i of a)t.has(i)&&(h.push({prefix:i,segments:t.get(i)}),t.delete(i));for(const[i,s]of t)h.push({prefix:i,segments:s});h.forEach(((t,e)=>{const n=t.segments.reduce(((t,i)=>t+Math.abs(i.value)),0),r=h.length-1-e;let o=0,l=null;t.segments.forEach((t=>{const h=new rt(this.position,this.styles,t.dataPoint,i,o,t.scenario,r,this.stackConfig.mode,n,!0,s);h.draw(this.dataFormatDigits,this.measureScale),o+=Math.abs(t.value),l=h})),l&&l.drawTotalLabel(this.dataFormatDigits,this.measureScale)}))}else{"asc"===this.stackConfig.order?n.sort(((t,i)=>t.value-i.value)):"desc"===this.stackConfig.order&&n.sort(((t,i)=>i.value-t.value));const t=n.reduce(((t,i)=>t+Math.abs(i.value)),0);let e=0,r=null;n.forEach(((n,o)=>{const l=new rt(this.position,this.styles,n.dataPoint,i,e,n.scenario,o,this.stackConfig.mode,t,h,s);l.draw(this.dataFormatDigits,this.measureScale),e+=Math.abs(n.value),r=l})),r&&r.drawTotalLabel(this.dataFormatDigits,this.measureScale)}})),this.scenariosArea={height:s.height()+this.styles.padding.top+this.styles.padding.bottom,width:s.width()+this.position.spacings.columnWidth}}drawStackedHeaders(t,i){if(!this.stackConfig||0===t.length)return;if(this.stackConfig.by!==L.SCENARIO)return;const s=i.group().id("StackedHeaders"),h=t[0],e=["scenario1","scenario2","scenario3","scenario4"],n=[];for(const t of e){const i=h[t];i&&!i.isEmpty()&&null!=i.value&&n.push({value:i.value,scenario:i.scenario,dataPoint:i})}if(0===n.length)return;const r=new Set(n.map((t=>l(t.scenario)))),o=this.position.getColumnPositionY(),c=this.position.getColumnCenterPositionX(0)-this.position.getColumnWidth()/2-this.position.spacings.labelToColumn;if(r.size>1){const t=new Map;for(const i of n){const s=l(i.scenario);t.has(s)||t.set(s,[]),t.get(s).push(i)}const i=[];for(const s of a)t.has(s)&&(i.push({prefix:s,segments:t.get(s)}),t.delete(s));for(const[s,h]of t)i.push({prefix:s,segments:h});i.forEach((t=>{const i=t.segments.reduce(((t,i)=>t+Math.abs(i.value)),0),h=t.segments[0].dataPoint.pixelPerUnit,e=o-(this.stackConfig.mode===b.RELATIVE?h:i*h)/2,n=this.i18n.get(t.prefix+"1")||t.prefix.toUpperCase();new I(s,c,e,"STACK_HEADER",n,this.styles,X.Center,X.Right).forceStringTypeDraw()}))}else{"asc"===this.stackConfig.order?n.sort(((t,i)=>t.value-i.value)):"desc"===this.stackConfig.order&&n.sort(((t,i)=>i.value-t.value));const t=n.reduce(((t,i)=>t+Math.abs(i.value)),0),i=n[0].dataPoint.pixelPerUnit;let h=0;n.forEach((e=>{let n;n=this.stackConfig.mode===b.RELATIVE?(0!==t?Math.abs(e.value)/t:0)*i:Math.abs(e.value*i);const r=o-h-n/2,l=this.i18n.get(e.scenario)||e.scenario;new I(s,c,r,"STACK_HEADER",l,this.styles,X.Center,X.Right).forceStringTypeDraw(),h+=n}))}}drawStackedAreaScenarios(t,i){if(!this.stackConfig)return;const s=i.group().id("StackedAreaScenarios"),h=this.stackConfig.by===L.SCENARIO,e=this.stackConfig.mode,n=["scenario1","scenario2","scenario3","scenario4"];if(0===(h?n.filter((i=>t.some((t=>t[i]&&!t[i].isEmpty())))).length:1))return;const r=[],o=[],l=[];for(const i of n)t.some((t=>t[i]&&!t[i].isEmpty()))&&l.push(i);for(let i=0;i<l.length;i++){const s=l[i],h=[];for(let n=0;n<t.length;n++){const o=t[n][s],a=o&&!o.isEmpty()&&null!=o.value?o.value:0,c=i>0?r[i-1][n]:0;if(e===b.RELATIVE){const i=l.reduce(((i,s)=>{const h=t[n][s];return i+(h&&!h.isEmpty()&&null!=h.value?Math.abs(h.value):0)}),0),s=0!==i?Math.abs(a)/i:0;h.push(c+s)}else h.push(c+a)}r.push(h);const n=t[0][s];o.push((null==n?void 0:n.scenario)||"ac1")}const a=this.position.getColumnPositionY(),c=this.pixelPerUnit,u=t=>t.map(((t,i)=>({x:this.position.getColumnCenterPositionX(i),y:a-t*c}))),d=t.map(((t,i)=>({x:this.position.getColumnCenterPositionX(i),y:a})));for(let t=0;t<r.length;t++){const i=u(r[t]),e=0===t?d:u(r[t-1]),n=new at(s,i,e,h?o[t]:null,t,h);n.draw(),n.drawBoundaryLine()}this.scenariosArea={height:s.height()+this.styles.padding.top+this.styles.padding.bottom,width:s.width()+this.position.spacings.columnWidth}}drawOverlayLayer(t,i){const s=i.group().id("Overlay"),h=new ut(this.position,s,this.styles,t.length,this.i18n);if(!0===this.showOverlayAvg){let i=null;const s=function(t){const i=t.reduce(((t,i)=>{var s;return t+((null===(s=i.scenario1)||void 0===s?void 0:s.value)||0)}),0),s=t.filter((t=>{var i;return void 0!==(null===(i=t.scenario1)||void 0===i?void 0:i.value)})).length,h=s>0?i/s:0,e=Object.assign(Object.assign({},t[0]),{scenario1:new q(h,t[0].scenario1.scenario,t[0].scenario1.pixelPerUnit,t[0].scenario1.variance)}),n=Object.assign(Object.assign({},t[t.length-1]),{scenario1:new q(h,t[t.length-1].scenario1.scenario,t[t.length-1].scenario1.pixelPerUnit,t[t.length-1].scenario1.variance)});return[e,...t.map((t=>Object.assign(Object.assign({},t),{scenario1:new q(h,t.scenario1.scenario,t.scenario1.pixelPerUnit,t.scenario1.variance)}))),n]}(t);s.forEach(((t,s)=>{null!=i&&h.createLine(`Ø ${this.i18n.get(t.scenario1.scenario)||t.scenario1.scenario}`,t.scenario1,i,s-1).draw(this.dataFormatDigits,this.measureScale),i=t.scenario1}))}if(!0===this.showOverlayMedian){let i=null;const s=function(t){const i=t.map((t=>{var i;return null===(i=t.scenario1)||void 0===i?void 0:i.value})).filter((t=>void 0!==t)).sort(((t,i)=>t-i)),s=i.length%2==0?(i[i.length/2-1]+i[i.length/2])/2:i[Math.floor(i.length/2)],h=Object.assign(Object.assign({},t[0]),{scenario1:new q(s,t[0].scenario1.scenario,t[0].scenario1.pixelPerUnit,t[0].scenario1.variance)}),e=Object.assign(Object.assign({},t[t.length-1]),{scenario1:new q(s,t[t.length-1].scenario1.scenario,t[t.length-1].scenario1.pixelPerUnit,t[t.length-1].scenario1.variance)});return[h,...t.map((t=>Object.assign(Object.assign({},t),{scenario1:new q(s,t.scenario1.scenario,t.scenario1.pixelPerUnit,t.scenario1.variance)}))),e]}(t);s.forEach(((t,s)=>{null!=i&&h.createLine(`Mdn ${this.i18n.get(t.scenario1.scenario)||t.scenario1.scenario}`,t.scenario1,i,s-1).draw(this.dataFormatDigits,this.measureScale),i=t.scenario1}))}}leftOuterJoinDates(t,i){const s=v.max(...t.map((function(t){return t.calcdate}))),h=v.min(...t.map((function(t){return t.calcdate}))),e=(new _).datesBetween(h,s,i,this.intervalSpanLimit),n=new Map;return e.forEach(((t,i)=>{n.set(t.toISO(),{id:i,calcdate:t,category:null,ac1:null,ac2:null,ac3:null,ac4:null,pp1:null,pp2:null,pp3:null,pp4:null,fc1:null,fc2:null,fc3:null,fc4:null,pl1:null,pl2:null,pl3:null,pl4:null,isEmpty:!0})})),t.forEach((t=>{const i=t.calcdate.toISO(),s=n.get(i);s&&s.isEmpty&&n.set(i,{id:s.id,calcdate:t.calcdate,category:t.category,ac1:t.ac1,ac2:t.ac2,ac3:t.ac3,ac4:t.ac4,pp1:t.pp1,pp2:t.pp2,pp3:t.pp3,pp4:t.pp4,fc1:t.fc1,fc2:t.fc2,fc3:t.fc3,fc4:t.fc4,pl1:t.pl1,pl2:t.pl2,pl3:t.pl3,pl4:t.pl4,isEmpty:!1})})),Array.from(n.values())}}class wt{constructor(t,i){this.data=t,this.scenarios=i,this.variances=[],this.title="",this.hideAxisLabels=!1,this.pixelPerUnit=10,this.pixelPerPercentage=50,this.limit=0,this.sortOrder=new S(new Y).default(),this.level=y.CATEGORY,this.leftSideOffsetForHorizontalSync=-1,this.dateInterval=$.AUTO,this.axisLabelsMode=g.SMART,this.intervalSpanLimit=28,this.filter="",this.measureScale=new A,this.measureUnit="",this.showMeasureScale=!0,this.dataFormatDigits={decimal:1,percent:2},this.showOverlayMedian=!0,this.showOverlayAvg=!0,this.chartMode=m.BAR,this.maxBars=28,this.stackConfig=null,this.lineFullWidth=!0}}class vt{constructor(t,i,s,h,e){this.dataRowAdapter=t,this.orderAdapter=i,this.stringAdapter=s,this.dataFormatDigitsAdapter=h,this.dataSet=e}adapt(t){const i=P.adaptArray(t.data,this.dataRowAdapter),s=P.adaptArray(t.scenarios,this.stringAdapter),h=new wt(i,s);return w.isArray(t.variances)&&(h.variances=P.adaptArray(t.variances,this.stringAdapter)),w.isString(t.title)&&(h.title=t.title),w.isBoolean(t.hideAxisLabels)&&(h.hideAxisLabels=t.hideAxisLabels),w.isNumber(t.pixelPerUnit)&&(h.pixelPerUnit=t.pixelPerUnit),w.isNumber(t.pixelPerPercentage)&&(h.pixelPerPercentage=t.pixelPerPercentage),w.isNumber(t.limit)&&(h.limit=t.limit),w.isExisting(t.sortOrder)&&(h.sortOrder=this.orderAdapter.adapt(t.sortOrder)),w.isExisting(t.level)&&(h.level=t.level),w.isExisting(t.dateInterval)&&(h.dateInterval=t.dateInterval),w.isExisting(t.axisLabelsMode)&&(h.axisLabelsMode=t.axisLabelsMode),w.isNumber(t.leftSideOffsetForHorizontalSync)&&(h.leftSideOffsetForHorizontalSync=t.leftSideOffsetForHorizontalSync),w.isNumber(t.intervalSpanLimit)&&(h.intervalSpanLimit=t.intervalSpanLimit),w.isString(t.filter)&&(h.filter=t.filter),w.isExisting(t.measureScale)&&(h.measureScale=O.calculateMeasureScale(this.dataSet,h.scenarios,t.measureScale)),w.isString(t.measureUnit)&&(h.measureUnit=t.measureUnit),w.isBoolean(t.showMeasureScale)&&(h.showMeasureScale=t.showMeasureScale),w.isExisting(t.dataFormatDigits)&&(h.dataFormatDigits=this.dataFormatDigitsAdapter.adapt(t.dataFormatDigits)),w.isBoolean(t.showOverlayAvg)&&(h.showOverlayAvg=t.showOverlayAvg),w.isBoolean(t.showOverlayMedian)&&(h.showOverlayMedian=t.showOverlayMedian),w.isExisting(t.chartMode)&&(h.chartMode=t.chartMode),w.isNumber(t.maxBars)&&(h.maxBars=t.maxBars),w.isExisting(t.stackConfig)&&(h.stackConfig=t.stackConfig),w.isBoolean(t.lineFullWidth)&&(h.lineFullWidth=t.lineFullWidth),h}default(){return new wt([],[])}}const bt=class{constructor(i){t(this,i),this.data=[],this.scenarios=[],this.variances=[],this.hideAxisLabels=!1,this.pixelPerUnit=2,this.pixelPerPercentage=50,this.limit=0,this.leftSideOffsetForHorizontalSync=-1,this.i18n=new Map,this.order={hierarchy:[],direction:k.ASC},this.level=y.CATEGORY,this.dateInterval=$.AUTO,this.intervalSpanLimit=28,this.axisLabelsMode=g.SMART,this.filter="",this.measureScale="_",this.measureUnit="",this.showMeasureScale=!0,this.showOverlayMedian=!1,this.showOverlayAvg=!1,this.chartMode=m.BAR,this.maxBars=28,this.stackConfig=null,this.lineFullWidth=!0,this.containerWidth=0,this.dataFormatDigits={percent:2,decimal:1},this.parentDimensions={width:0,height:0}}render(){var t,h,e;if(void 0===this.chart)return i(s,null);if(this.chart.hasNoData()){const t=this.i18n.get("NO_DATA")||"==No Data==";return i(s,null,i("p",{class:"warning"},t))}return i(s,null,i("div",{innerHTML:null===(t=this.pattern)||void 0===t?void 0:t.toString(),class:"hidePatternContainer"}),i("div",{class:this.showMeasureScale?"footer":"footer-hide"},null===(h=this.chart)||void 0===h?void 0:h.getFooter()),i("div",{innerHTML:null===(e=this.chart)||void 0===e?void 0:e.toString()}))}async componentWillLoad(){var t;const i=this.prepareConfig(),s=this.prepareStyle(),h=this.containerWidth||0;this.chart=new pt(new E,i,s,h),this.chart.setI18n(this.i18n),this.autoFitScaling(i,s),this.chart.setAvailableHeight((null===(t=this.parentDimensions)||void 0===t?void 0:t.height)||0),this.pattern=new V(this.chart.styles),this.chart.setPattern("fc",this.pattern.getFCPolygonPattern())}async componentWillUpdate(){var t;if(null==this.chart)return;const i=this.prepareConfig(),s=this.prepareStyle();this.chart.setI18n(this.i18n),this.chart.setStyles(s),this.chart.setAvailableWidth(this.containerWidth||0),this.chart.setConfig(i),this.autoFitScaling(i,s),this.chart.setAvailableHeight((null===(t=this.parentDimensions)||void 0===t?void 0:t.height)||0),this.pattern=new V(this.chart.styles),this.chart.setPattern("fc",this.pattern.getFCPolygonPattern())}autoFitScaling(t,i){var s;if(t.pixelPerUnit>0)return;const h=null===(s=this.parentDimensions)||void 0===s?void 0:s.height,e=this.containerWidth||0;if(!h||h<=0)return t.pixelPerUnit=1,this.chart=new pt(new E,t,i,e),void this.chart.setI18n(this.i18n);t.pixelPerUnit=1,this.chart=new pt(new E,t,i,e),this.chart.setI18n(this.i18n),this.chart.toString();const n=this.chart.getAllocatedCanvasHeight();n<=0||(t.pixelPerUnit=.9*h/n,this.chart=new pt(new E,t,i,e),this.chart.setI18n(this.i18n))}async componentWillRender(){}componentDidLoad(){}componentDidUpdate(){}prepareConfig(){return new vt(new Z,new S(new Y),new Y,new T,this.data).adapt({data:this.data,scenarios:this.scenarios,variances:this.variances,title:this.chartTitle,hideAxisLabels:this.hideAxisLabels,pixelPerUnit:this.pixelPerUnit,pixelPerPercentage:this.pixelPerPercentage,level:this.level,dateInterval:this.dateInterval,axisLabelsMode:this.axisLabelsMode,limit:this.limit,sortOrder:this.order,leftSideOffsetForHorizontalSync:this.leftSideOffsetForHorizontalSync,intervalSpanLimit:this.intervalSpanLimit,filter:this.filter,measureScale:this.measureScale,measureUnit:this.measureUnit,showMeasureScale:this.showMeasureScale,dataFormatDigits:this.dataFormatDigits,showOverlayMedian:this.showOverlayMedian,showOverlayAvg:this.showOverlayAvg,chartMode:this.chartMode,maxBars:this.maxBars,stackConfig:this.stackConfig,lineFullWidth:this.lineFullWidth})}prepareStyle(){return new Q(new R,new c,new u(new d),new f(new d),new p).adapt(this.styles)}get element(){return h(this)}};bt.style=':host{position:relative;display:inline-block}.categories{text-align:right;font-size:var(--bn-font-size, 1em);font-family:var(--bn-font-family, "Noto Sans", "Helvetica Neue", Helvetica, sans-serif);color:var(--bn-font-color, black)}.label-bg{fill:var(--bn-font-background, white);opacity:0.7}.label-text{text-align:right;font-size:var(--bn-font-size, 1em);font-family:var(--bn-font-family, "Noto Sans", "Helvetica Neue", Helvetica, sans-serif);color:var(--bn-font-color, black)}.axis-title{text-align:center;font-family:var(--bn-font-family, "Noto Sans", "Helvetica Neue", Helvetica, sans-serif);color:var(--bn-font-color, black)}.axis-default{stroke:black;stroke-width:0.1em}.axis-ac{stroke:black;stroke-width:0.1em}.axis-pp{stroke:grey;stroke-width:0.1em}.axis-fc{stroke:black;stroke-dasharray:2;stroke-width:0.1em}.axis-pl{stroke:white;stroke-width:0.1em;outline-offset:0em;outline:0.1em solid black}canvas{image-rendering:-moz-crisp-edges;image-rendering:-webkit-crisp-edges;image-rendering:pixelated;image-rendering:crisp-edges}.measure{font-weight:bold}span{display:inline-block}.hidePatternContainer{height:0;width:0}div{float:left}.hide{opacity:0}.footer{margin:0.2em;font-size:0.6em}.footer-hide{margin:0.2em;font-size:0.6em;opacity:0}';export{bt as ibcs_chart_time}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as t,r as s,h as a,H as e}from"./p-JNHhIe7t.js";import{g as o,c as n}from"./p-DRikHQE-.js";import{r,w as i}from"./p-tzFCK9qn.js";import{w as c}from"./p-DG-1MR_T.js";import{a as u}from"./p-BYmPQYxx.js";import{w as l}from"./p-CYjZRKdI.js";import"./p-BFTU3MAI.js";const p=["ac1","ac2","ac3","ac4","pp1","pp2","pp3","pp4","fc1","fc2","fc3","fc4","pl1","pl2","pl3","pl4"],h=["rowGroup","category","subCategory","columnGroup","columnSubGroup"];function f(t){return"number"==typeof t&&!isNaN(t)&&isFinite(t)}function m(t){const s=Array.from(t);return{distinctValues:s,count:s.length,hasData:s.length>0}}const d=class{constructor(a){s(this,a),this.datasources="",this.static=!1,l(this),this.errors=i(this),this.database=new u.Database,((s,a)=>{let e,i,c=[];const u=new MutationObserver((e=>{e.forEach((e=>{"datasources"===e.attributeName&&(c=(t(s).getAttribute("datasources")||"").split(","),c.forEach((t=>{a(t,i.datasources.get(t))})))}))})),l=s.connectedCallback;s.connectedCallback=()=>{const n=t(s);i=o(n),c=(n.getAttribute("datasources")||"").split(","),c.forEach((t=>{a(t,i.datasources.get(t))})),u.observe(n,{attributes:!0,attributeFilter:["datasources"]}),e=i.datasources.on("set",((t,s)=>{c.includes(t)&&a(t,s)})),r(l,s)};const p=s.disconnectedCallback;s.disconnectedCallback=()=>{u.disconnect(),r(e),n(t(s)),r(p,s)}})(this,((t,s)=>{this.database.tables[t]={data:s},this.executeQuery()})),c(this,(t=>{this.query=t,this.executeQuery()}))}executeQuery(){if(this.stores||(this.stores=o(this.element)),this.query&&this.name){let t;if(this.static)try{t=JSON.parse(this.query)}catch(s){console.error("Failed to parse static dataset",s),t=[]}else t=this.database.exec(this.query);this.latestResult!==t&&(this.latestResult=t,this.stores.datasets.set(this.name,t),this.stores.datasetsMeta.set(this.name,function(t){const s={};for(const t of h)s[t]=new Set;const a={};for(const t of p)a[t]={hasData:!1,min:null,max:null};const e=new Set;let o=null,n=null;const r=Array.isArray(t)?t:[];for(let t=0;t<r.length;t++){const i=r[t];if(null==i)continue;for(const t of h){const a=i[t];null!=a&&""!==a&&s[t].add(String(a))}for(const t of p){const s=i[t];if(f(s)){const e=a[t];e.hasData=!0,(null===e.min||s<e.min)&&(e.min=s),(null===e.max||s>e.max)&&(e.max=s)}}const c=i.date;if(null!=c&&""!==c){const t=String(c);e.add(t),(null===o||t<o)&&(o=t),(null===n||t>n)&&(n=t)}}const i=p.map((t=>({key:t,hasData:a[t].hasData,min:a[t].min,max:a[t].max}))),c=i.filter((t=>t.hasData)).map((t=>t.key)),u=m(s.rowGroup),l=m(s.category),d=m(s.subCategory),g=m(s.columnGroup),y=m(s.columnSubGroup),b={min:o,max:n,hasData:e.size>0,distinctCount:e.size};let w="category";return d.hasData?w="subCategory":l.hasData?w="category":u.hasData&&(w="rowGroup"),{rowCount:r.length,scenarios:i,availableScenarios:c,rowGroup:u,category:l,subCategory:d,columnGroup:g,columnSubGroup:y,dateRange:b,suggestedLevel:w,suggestedOrder:w,suggestedDateInterval:b.hasData?"auto":null,calculatedAt:Date.now()}}(t)))}}nameUpdated(){this.executeQuery()}render(){return a(e,{key:"0aecc50d8aa488f49d6630fec9f0755d306f213e"})}get element(){return t(this)}static get watchers(){return{name:[{nameUpdated:0}]}}};d.style="bn-dataset{display:none}";export{d as bn_dataset}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,h as e,H as n,g as s}from"./p-JNHhIe7t.js";import{i as r,f as i,w as o}from"./p-DyRaC0MB.js";import{w as a}from"./p-CYjZRKdI.js";import{w as l}from"./p-BSfqOkN_.js";import{w as c}from"./p-tzFCK9qn.js";import"./p-DdexOqTs.js";import"./p-DgfL-ffj.js";import"./p-DRikHQE-.js";const d=["*","/","+","-","x","÷","none"];function u(t){switch(t){case"*":case"x":return"×";case"/":case"÷":return"÷";case"+":return"+";case"-":return"−";default:return""}}function h(t,e,n){return t.find((t=>t.from===e&&t.to===n))}function f(t){return 2*(t-1)+1}function p(t){return 2*(t-1)+1}function g(t,e){const n=t.getBoundingClientRect(),s=n.left-e.left,r=n.top-e.top;return{left:s,top:r,width:n.width,height:n.height,centerX:s+n.width/2,centerY:r+n.height/2}}function y(t,e,n){switch(n){case"ltr":return e?{x:t.left+t.width,y:t.centerY}:{x:t.left,y:t.centerY};case"rtl":return e?{x:t.left,y:t.centerY}:{x:t.left+t.width,y:t.centerY};case"ttb":return e?{x:t.centerX,y:t.top+t.height}:{x:t.centerX,y:t.top};case"btt":return e?{x:t.centerX,y:t.top}:{x:t.centerX,y:t.top+t.height}}}function v(t,e,n,s,r=8){const i=-(s-1)*r/2+n*r;switch(e){case"ltr":return{x:t.left,y:t.centerY+i};case"rtl":return{x:t.left+t.width,y:t.centerY+i};case"ttb":return{x:t.centerX+i,y:t.top};case"btt":return{x:t.centerX+i,y:t.top+t.height}}}function m(t,e,n,s){switch(n){case"straight":return function(t,e){return{path:`M ${t.x} ${t.y} L ${e.x} ${e.y}`,midpoint:{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}}(t,e);case"curved":return function(t,e,n){let s,r;if("ltr"===n||"rtl"===n){const n=(t.x+e.x)/2;s={x:n,y:t.y},r={x:n,y:e.y}}else{const n=(t.y+e.y)/2;s={x:t.x,y:n},r={x:e.x,y:n}}return{path:`M ${t.x} ${t.y} C ${s.x} ${s.y}, ${r.x} ${r.y}, ${e.x} ${e.y}`,midpoint:{x:.125*t.x+.375*s.x+.375*r.x+.125*e.x,y:.125*t.y+.375*s.y+.375*r.y+.125*e.y}}}(t,e,s);default:return function(t,e,n){let s,r;if("ltr"===n||"rtl"===n){const n=t.x+.7*(e.x-t.x);s=`M ${t.x} ${t.y} L ${n} ${t.y} L ${n} ${e.y} L ${e.x} ${e.y}`,r={x:n,y:(t.y+e.y)/2}}else{const n=t.y+.7*(e.y-t.y);s=`M ${t.x} ${t.y} L ${t.x} ${n} L ${e.x} ${n} L ${e.x} ${e.y}`,r={x:(t.x+e.x)/2,y:n}}return{path:s,midpoint:r}}(t,e,s)}}function b(t,e,n,s){const r=.7;switch(s){case"ltr":{const s=t.left+t.width;return{x:s+(Math.min(e.left,n.left)-s)*r,y:t.centerY}}case"rtl":{const s=t.left,i=Math.max(e.left+e.width,n.left+n.width);return{x:i+(s-i)*r,y:t.centerY}}case"ttb":{const s=t.top+t.height,i=Math.min(e.top,n.top);return{x:t.centerX,y:s+(i-s)*r}}case"btt":{const s=t.top,i=Math.max(e.top+e.height,n.top+n.height);return{x:t.centerX,y:i+(s-i)*r}}}}function $(t,e,n){var s,r;return Object.assign({stroke:null!==(s=null==n?void 0:n.color)&&void 0!==s?s:t,strokeWidth:null!==(r=null==n?void 0:n.width)&&void 0!==r?r:e},(null==n?void 0:n.dasharray)?{strokeDasharray:n.dasharray}:{})}const x=class{validateEdgesProp(t){const e="ERR_edges",n=function(t){const e=[];if(!t||""===t.trim())return e.push("edges: value is required"),e;let n;try{n=JSON.parse(t)}catch(t){return e.push("edges: invalid JSON structure"),e}if(!Array.isArray(n))return e.push("edges: must be an array"),e;if(0===n.length)return e.push("edges: array must not be empty"),e;const s=new Set,r=new Set;n.forEach(((t,n)=>{if("object"!=typeof t||null===t)return void e.push(`edges[${n}]: must be an object`);const i=t;if("string"!=typeof i.from||""===i.from.trim()?e.push(`edges[${n}]: 'from' is required and must be a non-empty string`):s.add(i.from),"string"!=typeof i.to||""===i.to.trim()?e.push(`edges[${n}]: 'to' is required and must be a non-empty string`):(s.add(i.to),r.add(i.to)),void 0!==i.operator&&("string"==typeof i.operator&&d.includes(i.operator)||e.push(`edges[${n}]: 'operator' must be one of: ${d.join(", ")}`)),void 0!==i.label&&"string"!=typeof i.label&&e.push(`edges[${n}]: 'label' must be a string`),void 0!==i.style)if("object"!=typeof i.style||null===i.style)e.push(`edges[${n}]: 'style' must be an object`);else{const t=i.style;void 0!==t.color&&"string"!=typeof t.color&&e.push(`edges[${n}]: 'style.color' must be a string`),void 0!==t.width&&"number"!=typeof t.width&&e.push(`edges[${n}]: 'style.width' must be a number`),void 0!==t.dasharray&&"string"!=typeof t.dasharray&&e.push(`edges[${n}]: 'style.dasharray' must be a string`)}}));const i=Array.from(s).filter((t=>!r.has(t)));return 0===i.length?e.push("edges: tree has no root node (circular reference detected)"):i.length>1&&e.push(`edges: tree has multiple root nodes: ${i.join(", ")}`),e}(t);n.length>0?(this.errors.addOrReplace({id:e,type:"error",message:`edges: ${n.join("; ")}`}),this.treeConfig=null):(this.errors.remove(e),this.treeConfig=function(t){if(!t||""===t.trim())return null;try{const e=JSON.parse(t);if(!Array.isArray(e))return null;const n=e,s=function(t){const e=new Map;for(const n of t){const t=e.get(n.from)||[];t.push(n.to),e.set(n.from,t)}return e}(n),r=function(t){const e=new Set;for(const n of t)e.add(n.from),e.add(n.to);return e}(n),i=function(t,e){const n=new Set;for(const e of t)n.add(e.to);const s=Array.from(e).filter((t=>!n.has(t)));return 1===s.length?s[0]:null}(n,r);return{edges:n,adjacencyList:s,rootNode:i,allNodes:r}}catch(t){return console.error("parseTreeConfig: failed to parse tree configuration",t),null}}(t)),this.recalculateLayout()}validateDirection(t){const e="ERR_direction",n=["ltr","rtl","ttb","btt"];n.includes(t)?this.errors.remove(e):this.errors.addOrReplace({id:e,type:"warning",message:`direction: invalid value '${t}', must be one of: ${n.join(", ")}`}),this.recalculateLayout()}validateLevelSpacing(t){const e="ERR_levelSpacing";!r(t)||t<0?this.errors.addOrReplace({id:e,type:"warning",message:`level-spacing: invalid value '${t}', must be a non-negative number`}):this.errors.remove(e),this.recalculateLayout()}validateNodeSpacing(t){const e="ERR_nodeSpacing";!r(t)||t<0?this.errors.addOrReplace({id:e,type:"warning",message:`node-spacing: invalid value '${t}', must be a non-negative number`}):this.errors.remove(e),this.recalculateLayout()}validateEdgeStyle(t){const e="ERR_edgeStyle",n=["straight","orthogonal","curved"];n.includes(t)?this.errors.remove(e):this.errors.addOrReplace({id:e,type:"warning",message:`edge-style: invalid value '${t}', must be one of: ${n.join(", ")}`})}validateShowOperators(t){const e="ERR_showOperators";i(t)?this.errors.remove(e):this.errors.addOrReplace({id:e,type:"warning",message:`show-operators: invalid value '${t}', must be 'true' or 'false'`})}constructor(e){t(this,e),this.treeConfig=null,this.layout=null,this.nodeRects=new Map,this.svgWidth=0,this.svgHeight=0,this.resizeObserver=null,this.gridContainer=null,this.direction="ltr",this.levelSpacing=60,this.nodeSpacing=20,this.edgeStyle="orthogonal",this.showOperators="true",o(this),a(this),this.errors=c(this),this.componentStyle=l(this)}getTreeStyle(){return this.componentStyle((t=>({edgeColor:t["bn-tree"].edgeColor,edgeWidth:t["bn-tree"].edgeWidth,operatorCircleRadius:t["bn-tree"].operatorCircleRadius,operatorFontSize:t.global.fontSizePx*t["bn-tree"].operatorFontSizeScale,operatorColor:t["bn-tree"].operatorColor})))}componentWillLoad(){this.validateEdgesProp(this.edges),this.validateDirection(this.direction),this.validateLevelSpacing(this.levelSpacing),this.validateNodeSpacing(this.nodeSpacing),this.validateEdgeStyle(this.edgeStyle),this.validateShowOperators(this.showOperators)}componentDidLoad(){this.setupResizeObserver(),this.updateNodeRects()}disconnectedCallback(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}setupResizeObserver(){var t;this.gridContainer=null===(t=this.element.shadowRoot)||void 0===t?void 0:t.querySelector(".tree-grid"),this.gridContainer&&(this.resizeObserver=new ResizeObserver((()=>{this.updateNodeRects()})),this.resizeObserver.observe(this.gridContainer),this.element.querySelectorAll("[slot]").forEach((t=>{this.resizeObserver.observe(t)})))}recalculateLayout(){this.layout=this.treeConfig?function(t,e,n,s){if(!t.rootNode)return{positions:new Map,gridTemplateColumns:"",gridTemplateRows:"",maxLevel:0,maxIndex:0};const r=function(t){const e=new Map;if(!t.rootNode)return e;const n=[{node:t.rootNode,level:0}],s=new Set;for(;n.length>0;){const{node:r,level:i}=n.shift();if(s.has(r))continue;s.add(r),e.set(r,i);const o=t.adjacencyList.get(r)||[];for(const t of o)s.has(t)||n.push({node:t,level:i+1})}return e}(t),i=function(t){const e=new Map;if(!t.rootNode)return e;let n=0;return function s(r){const i=e.get(r);if(i)return i;const o=t.adjacencyList.get(r)||[];if(0===o.length){const t={startIndex:n,endIndex:n};return e.set(r,t),n++,t}let a=1/0,l=-1/0;for(const t of o){const e=s(t);a=Math.min(a,e.startIndex),l=Math.max(l,e.endIndex)}const c={startIndex:a,endIndex:l};return e.set(r,c),c}(t.rootNode),e}(t),o=function(t,e,n,s){var r,i;const o=new Map,a=Math.max(...Array.from(e.values()));for(const l of t.allNodes){const t=null!==(r=e.get(l))&&void 0!==r?r:0,c=null!==(i=n.get(l))&&void 0!==i?i:{startIndex:0,endIndex:0};let d,u,h;switch(s){case"ltr":d=t+1,u=c.startIndex+1,h=c.endIndex-c.startIndex+1;break;case"rtl":d=a-t+1,u=c.startIndex+1,h=c.endIndex-c.startIndex+1;break;case"ttb":u=t+1,d=c.startIndex+1,h=1;break;case"btt":u=a-t+1,d=c.startIndex+1,h=1}o.set(l,{nodeId:l,level:t,index:c.startIndex,gridColumn:d,gridRow:u,gridRowSpan:h})}return o}(t,r,i,e),a=Math.max(...Array.from(r.values())),l=Math.max(...Array.from(i.values()).map((t=>t.endIndex))),{gridTemplateColumns:c,gridTemplateRows:d}=function(t,e,n,s,r){const i=t+1,o=e+1;if("ltr"===n||"rtl"===n){const t=[];for(let e=0;e<i;e++)t.push("auto"),e<i-1&&t.push(`${s}px`);const e=[];for(let t=0;t<o;t++)e.push("auto"),t<o-1&&e.push(`${r}px`);return{gridTemplateColumns:t.join(" "),gridTemplateRows:e.join(" ")}}{const t=[];for(let e=0;e<i;e++)t.push("auto"),e<i-1&&t.push(`${s}px`);const e=[];for(let t=0;t<o;t++)e.push("auto"),t<o-1&&e.push(`${r}px`);return{gridTemplateColumns:e.join(" "),gridTemplateRows:t.join(" ")}}}(a,l,e,n,s);return{positions:o,gridTemplateColumns:c,gridTemplateRows:d,maxLevel:a,maxIndex:l}}(this.treeConfig,this.direction,this.levelSpacing,this.nodeSpacing):null}updateNodeRects(){if(!this.treeConfig||!this.gridContainer)return;const t=this.gridContainer.getBoundingClientRect(),e=new Map;for(const n of this.treeConfig.allNodes){const s=this.element.querySelector(`[slot="${n}"]`);s&&e.set(n,g(s,t))}this.nodeRects=e,this.svgWidth=t.width,this.svgHeight=t.height}getSlotStyle(t){if(!this.layout)return{};const e=this.layout.positions.get(t);return e?"ltr"===this.direction||"rtl"===this.direction?{"grid-column":String(f(e.gridColumn)),"grid-row":`${p(e.gridRow)} / span ${n=e.gridRowSpan,n<=1?1:2*(n-1)+1}`,"align-self":"center"}:{"grid-row":String(p(e.gridRow)),"grid-column":String(f(e.gridColumn)),"justify-self":"center"}:{};var n}renderEdges(){var t;if(!this.treeConfig||0===this.nodeRects.size)return null;const n=this.getTreeStyle(),s=[],r=[],i=new Map;for(const t of this.treeConfig.edges){const e=i.get(t.to)||[];e.push(t.from),i.set(t.to,e)}for(const t of this.treeConfig.edges){const r=this.nodeRects.get(t.from),o=this.nodeRects.get(t.to);if(!r||!o)continue;const a=y(r,!0,this.direction),l=i.get(t.to)||[];let c;if(l.length>1){const e=l.indexOf(t.from);c=v(o,this.direction,e,l.length)}else c=y(o,!1,this.direction);const{path:d}=m(a,c,this.edgeStyle,this.direction),u=$(n.edgeColor,n.edgeWidth,t.style);s.push(e("path",{key:`edge-${t.from}-${t.to}`,d,fill:"none",stroke:u.stroke,"stroke-width":u.strokeWidth,"stroke-dasharray":u.strokeDasharray}))}if("true"===this.showOperators)for(const[s,i]of this.treeConfig.adjacencyList.entries()){const o=this.nodeRects.get(s);if(o)for(let a=0;a<i.length-1;a++){const l=i[a],c=i[a+1],d=h(this.treeConfig.edges,s,l);if(!(null==d?void 0:d.operator)||"none"===d.operator)continue;const f=this.nodeRects.get(l),p=this.nodeRects.get(c);if(!f||!p)continue;const g=null!==(t=d.label)&&void 0!==t?t:u(d.operator),y=b(o,f,p,this.direction);r.push(e("g",{key:`operator-${s}-${l}`,class:"operator-group"},e("circle",{cx:y.x,cy:y.y,r:n.operatorCircleRadius,fill:"white",stroke:n.edgeColor,"stroke-width":n.edgeWidth}),e("text",{x:y.x,y:y.y,"text-anchor":"middle","dominant-baseline":"central",style:{fontSize:`${n.operatorFontSize}px`,fill:n.operatorColor,fontWeight:"bold"}},g)))}}return e("svg",{class:"edge-layer",width:this.svgWidth,height:this.svgHeight,style:{position:"absolute",top:"0",left:"0",pointerEvents:"none"}},s,r)}renderSlots(){return this.treeConfig&&this.layout?Array.from(this.treeConfig.allNodes).map((t=>e("div",{key:t,class:"tree-node",style:this.getSlotStyle(t)},e("slot",{name:t})))):null}getFontStyles(){return this.componentStyle((t=>{var e,n,s,r;return{"--bn-font-family":(null===(e=t.global)||void 0===e?void 0:e.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":`${(null===(n=t.global)||void 0===n?void 0:n.fontSizePx)||13.3333}px`,"--bn-font-color":(null===(s=t.global)||void 0===s?void 0:s.fontColor)||"#000000","--bn-font-background":(null===(r=t.global)||void 0===r?void 0:r.fontBackgroundColor)||"#ffffff"}}))}render(){const t=this.getFontStyles();return e(n,{style:t},this.treeConfig&&this.layout?e("div",{class:"tree-container"},e("div",{class:"tree-grid",style:{display:"grid","grid-template-columns":this.layout.gridTemplateColumns,"grid-template-rows":this.layout.gridTemplateRows,position:"relative"}},this.renderEdges(),this.renderSlots())):e("div",{class:"tree-container tree-error"},e("slot",null)))}get element(){return s(this)}static get watchers(){return{edges:[{validateEdgesProp:0}],direction:[{validateDirection:0}],levelSpacing:[{validateLevelSpacing:0}],nodeSpacing:[{validateNodeSpacing:0}],edgeStyle:[{validateEdgeStyle:0}],showOperators:[{validateShowOperators:0}]}}};x.style=':host{display:inline-block;position:relative;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000)}.tree-container{position:relative;display:inline-block}.tree-grid{position:relative;display:grid;align-items:center}.tree-node{position:relative;z-index:1;border:1px solid #404040;background:var(--bn-font-background, white)}.edge-layer{position:absolute;top:0;left:0;z-index:0;pointer-events:none;overflow:visible}.tree-error{display:flex;flex-wrap:wrap;gap:20px}';export{x as bn_tree}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,h as s,H as i,g as e,d as n}from"./p-JNHhIe7t.js";import{w as a}from"./p-CYjZRKdI.js";import{w as r}from"./p-BSfqOkN_.js";import{w as o}from"./p-tzFCK9qn.js";import{w as d,v as l,a as h,c,d as u,m as f,n as p,j as v,k as b,o as m}from"./p-DyRaC0MB.js";import{I as g,O as y,D as w,e as R,d as _,j as S}from"./p-DdexOqTs.js";import{w as k}from"./p-CRLgp9-v.js";import{a as E}from"./p-DRikHQE-.js";import{a as D,D as x,b as O}from"./p-DgfL-ffj.js";import{F as C}from"./p-1jFf17Vj.js";import{I as M,S as j}from"./p--PSoPbDM.js";import"./p-BFTU3MAI.js";const z=class{constructor(s){t(this,s),a(this),this.errors=o(this),this.componentStyle=r(this)}getFontStyles(){return this.componentStyle((t=>{var s,i,e,n;return{"--bn-font-family":(null===(s=t.global)||void 0===s?void 0:s.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":`${(null===(i=t.global)||void 0===i?void 0:i.fontSizePx)||13.3333}px`,"--bn-font-color":(null===(e=t.global)||void 0===e?void 0:e.fontColor)||"#000000","--bn-font-background":(null===(n=t.global)||void 0===n?void 0:n.fontBackgroundColor)||"#ffffff"}}))}render(){return s(i,{key:"f43978af1c6658c6fa165093c3ada6b5f3b5986d",style:this.getFontStyles()},s("slot",{key:"b9c97432089676fc373b1d5ee59573ef5681a5c5"}))}get element(){return e(this)}};z.style=':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)}';const F=class{constructor(s){t(this,s),this.pageNumber=null,this.displayPageNumber=!0,a(this),this.errors=o(this),this.componentStyle=r(this)}getFontStyles(){return this.componentStyle((t=>{var s,i,e,n;return{"--bn-font-family":(null===(s=t.global)||void 0===s?void 0:s.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":`${(null===(i=t.global)||void 0===i?void 0:i.fontSizePx)||13.3333}px`,"--bn-font-color":(null===(e=t.global)||void 0===e?void 0:e.fontColor)||"#000000","--bn-font-background":(null===(n=t.global)||void 0===n?void 0:n.fontBackgroundColor)||"#ffffff"}}))}isValidHttpUrl(t){let s;try{s=new URL(t)}catch(t){return!1}return"http:"===s.protocol||"https:"===s.protocol}prepareAssetUrl(t){return this.isValidHttpUrl(t)?t:`./assets/${t}.png`}render(){return s(i,{key:"c445ca8c8abde56b46564932a6fcd079aa1e640d",id:this.displayPageNumber||this.text||this.code?"container-page-footer":"container",style:this.getFontStyles()},s("div",{key:"2e5829597d228c78acbbbf130bfc440092456cb4",id:"footer-text"},null!=this.text?s("span",{class:"note"},this.text):""),s("div",{key:"a2c98bf85fc41fa0aebc35fded0528cd8ba4948f",id:"code"},null!=this.code?s("img",{class:"image",src:n(`${this.prepareAssetUrl(this.code)}`)}):""),s("div",{key:"e879c6ed16996d8b505d64426e2253f3057863f5",id:"page-number"},this.displayPageNumber?s("span",{class:"page"},this.pageNumber):""))}static get assetsDirs(){return["assets"]}get element(){return e(this)}};F.style=':host{padding:0.2em 0.5em;display:flex;flex-direction:row;justify-content:space-between;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(#container-page-footer){box-sizing:border-box;-webkit-box-sizing:border-box;border-top:0.1em solid #ddd}div#footer-text{font-size:0.6em;display:inline}div#code{flex:1;display:inline;text-align:right;padding-right:1em}div#page-number{font-size:0.6em;display:inline}.image{z-index:2;background-color:transparent;border:transparent;height:1.2em;width:auto}';const P=class{constructor(s){t(this,s),this.businessUnit="",this.order="category",this.orderDirection="asc",this.dateFormat="none",this.dateLink="none",d(this),a(this),this.t=k(this).t,this.errors=o(this),this.componentStyle=r(this)}validateScenario(t){const s="ERR_scenarios",i=l(t);i.length>0?this.errors.addOrReplace({id:s,type:"warning",message:"scenarios: invalid value(s) '"+(null==i?void 0:i.toString())+"' are not supported."}):this.errors.remove(s)}validateVariances(t){const s="ERR_variances",i=h(t);i.length>0?this.errors.addOrReplace({id:s,type:"warning",message:"variances: invalid value(s) '"+(null==i?void 0:i.toString())+"' are not supported."}):this.errors.remove(s)}validateOrder(t){const s=c(t),i="ERR_order";s.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"order: invalid value(s) '"+(null==s?void 0:s.toString())+"' are not supported."}):this.errors.remove(i)}validateOrderDirection(t){const s="ERR_orderDirection";u(t)?this.errors.remove(s):this.errors.addOrReplace({id:s,type:"warning",message:"orderDirection: invalid value '"+(null==t?void 0:t.toString())+"' is not supported."})}validateMeasures(t){const s="ERR_measures",i=f(t);i.length>0?this.errors.addOrReplace({id:s,type:"warning",message:"measures: invalid value(s) '"+(null==i?void 0:i.toString())+'\' are not supported. Valid format example: [{"name": "Bruttoumsatz", "unit": "mEUR"}]'}):this.errors.remove(s)}validateDateStart(t){const s="ERR_dateStart";p(t)||v(t)?this.errors.remove(s):this.errors.addOrReplace({id:s,type:"warning",message:"dateStart: invalid value '"+(null==t?void 0:t.toString())+"' is not supported."})}validateDateEnd(t){const s="ERR_dateEnd";p(t)||v(t)?this.errors.remove(s):this.errors.addOrReplace({id:s,type:"warning",message:"dateStart: invalid value '"+(null==t?void 0:t.toString())+"' is not supported."})}validateDateFormat(t){const s="ERR_dateFormat";b(t)||v(t)?this.errors.remove(s):this.errors.addOrReplace({id:s,type:"warning",message:"dateFormat: invalid value '"+(null==t?void 0:t.toString())+"' is not supported."})}validateDateLink(t){const s="ERR_dateLink";m(t)||v(t)?this.errors.remove(s):this.errors.addOrReplace({id:s,type:"warning",message:"dateLink: invalid value '"+(null==t?void 0:t.toString())+"' is not supported."})}componentWillLoad(){this.validateScenario(this.scenarios),this.validateVariances(this.variances),this.validateMeasures(this.measures),this.validateDateStart(this.dateStart),this.validateDateEnd(this.dateEnd),this.validateDateFormat(this.dateFormat),this.validateDateLink(this.dateLink),this.validateOrderDirection(this.orderDirection),this.validateOrder(this.order)}prepareI18n(){const t=E,s=new Map(["SEPERATOR_WS","in","CONNECTOR_WS"].map((t=>[t,this.t(".".concat(t))]))),i=new Map(t.map((t=>[t,this.t("global.".concat(t))])));return new Map([...i.entries(),...s.entries()])}prepareI18nMode(){return g.META}prepareTitleOrder(){var t;return v(this.order)||v(this.orderDirection)?null:{hierarchy:this.order.split(",").map((t=>t.trim())),direction:y[null===(t=this.orderDirection)||void 0===t?void 0:t.toUpperCase()]}}prepareTitleTimePeriod(){var t,s;return v(this.dateStart)&&v(this.dateEnd)||v(this.dateLink)?null:{start:w.fromISO(this.dateStart),end:w.fromISO(this.dateEnd),format:x[null===(t=this.dateFormat)||void 0===t?void 0:t.toUpperCase()],link:D[null===(s=this.dateLink)||void 0===s?void 0:s.toUpperCase()]}}prepareMeasures(){return v(this.measures)?[]:JSON.parse(this.measures)}prepareScenarios(){var t,s,i,e;if(v(this.scenarios)&&v(this.variances))return[];let n=[];return(null===(t=this.scenarios)||void 0===t?void 0:t.trim().length)>0&&(n=n.concat(null===(s=this.scenarios)||void 0===s?void 0:s.split(","))),(null===(i=this.variances)||void 0===i?void 0:i.trim().length)>0&&(n=n.concat(null===(e=this.variances)||void 0===e?void 0:e.split(","))),n.map((t=>t.trim()))}prepareBusinessUnit(){return v(this.businessUnit)||"null"===this.businessUnit?null:this.businessUnit}getFontStyles(){return this.componentStyle((t=>{var s,i,e,n;return{"--bn-font-family":(null===(s=t.global)||void 0===s?void 0:s.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":`${(null===(i=t.global)||void 0===i?void 0:i.fontSizePx)||13.3333}px`,"--bn-font-color":(null===(e=t.global)||void 0===e?void 0:e.fontColor)||"#000000","--bn-font-background":(null===(n=t.global)||void 0===n?void 0:n.fontBackgroundColor)||"#ffffff"}}))}render(){const t=this.getFontStyles();return s(i,{key:"029abd8096c5274f94123da2dc1c1e88e76be922",style:t},s("ibcs-title",{key:"c8b128a6ea36d44d8a0730898b35fa3f944e23ae",businessUnit:this.prepareBusinessUnit(),scenarios:this.prepareScenarios(),measures:this.prepareMeasures(),timeperiod:this.prepareTitleTimePeriod(),order:this.prepareTitleOrder(),i18n:this.prepareI18n(),"i18n-mode":this.prepareI18nMode()}))}get element(){return e(this)}static get watchers(){return{scenarios:[{validateScenario:0}],variances:[{validateVariances:0}],order:[{validateOrder:0}],orderDirection:[{validateOrderDirection:0}],measures:[{validateMeasures:0}],dateStart:[{validateDateStart:0}],dateEnd:[{validateDateEnd:0}],dateFormat:[{validateDateFormat:0}],dateLink:[{validateDateLink:0}]}}};P.style=':host{padding:0.5em;margin-bottom:0.5em;box-sizing:border-box;-webkit-box-sizing:border-box;width:100%;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)}';class T{constructor(){}createMeasures(t,s,i){if(this.allMeasuresUseSameUnit(t)){const e=t.length;let n="",a="";for(let r=0;r<e;r++){let o="";r>0&&(o=s.get("SEPERATOR_WS")),e>1&&r===e-1&&(o=s.get("CONNECTOR_WS")),i===g.ALL?(n=(s.get(n)||n)+o+(s.get(t[r].name)||t[r].name),a=s.get(t[r].unit)||t[r].unit):(n=n+o+t[r].name,a=t[r].unit)}return[{name:n,unit:a}]}return t}createDimension(t,s,i,e,n){let a="";return void 0!==s&&(a=(new O).getDateLinkString(s.start,s.end,s.link,s.format,n)),a+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(" ",C.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 L{constructor(){this.businessunit="",this.measures=[],this.scenarios=[],this.i18nMode=g.ALL,this.intervalSpanLimit=32}}class N{constructor(t,s,i,e){this.measureEntryAdapter=t,this.timePeriodAdapter=s,this.orderAdapter=i,this.stringAdapter=e}adapt(t){const s=new L;return R.isString(t.businessunit)&&(s.businessunit=t.businessunit),R.isArray(t.measures)&&(s.measures=_.adaptArray(t.measures,this.measureEntryAdapter)),R.isArray(t.scenarios)&&(s.scenarios=_.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 L}}var U;!function(t){t[t.UP_TO_DATE=0]="UP_TO_DATE",t[t.DIRTY=1]="DIRTY"}(U||(U={}));class A{constructor(t){this.i18n=new Map,this.unit="",this.measures=[],this.dimension="",this.config=new L,this.state=U.DIRTY,this.ruleSet=t||new M,this.dataSetFactory=new T,this.state=U.DIRTY,this.setI18n(new Map)}setI18n(t){this.state=U.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 U.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=U.UP_TO_DATE),this}setConfig(t){this.config=this.initConfig(t)}initConfig(t){this.state=U.DIRTY;const s=t,i=this;return t.scenarios.sort(((t,s)=>i.ruleSet.getScenarioSorIndex(t)-i.ruleSet.getScenarioSorIndex(s))),s}}class W{constructor(t="",s=""){this.name=t,this.unit=s}}class I{construnctor(){}adapt(t){const s=new W;return R.isString(t.name)&&(s.name=t.name),R.isString(t.unit)&&(s.unit=t.unit),s}default(){return new W("","")}}class B{constructor(t=w.now(),s=w.now(),i=x.AUTO,e=D.AUTO){this.start=t,this.end=s,this.format=i,this.link=e}}class Y{construnctor(){}adapt(t){const s=new B;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 B}}const V=class{constructor(s){t(this,s),this.businessUnit="",this.scenarios=[],this.measures=[],this.intervalSpanLimit=28,this.order={hierarchy:[],direction:y.ASC},this.i18n=new Map,this.i18nMode=g.ALL,this.title=new A(new M)}async setBusinessUnit(t){this.businessUnit=t}async setProps(t){Object.keys(t).forEach((s=>{this[s]=t[s]}))}render(){return s("div",{key:"08439c867ae47a9ee17ef8280801896a823c8826"},s("div",{key:"bb5b7325de2ae2f2e0bdba8d7f7f36511835efa9"},this.title.unit),s("div",{key:"3edb730c95280ca0c47db70e32dd8e471747d989"},this.title.measures.map(((t,i)=>s("span",null,this.isFirstElement(i)?this.title.i18n.get("SEPERATOR_WS"):"",s("span",{class:"measure"},t.name)," ",t.unit?this.title.i18n.get("in"):""," ",t.unit)))),s("div",{key:"3bae51f2fddef6b2195d1c24915512b6255c9a75"},this.title.dimension))}componentWillLoad(){const t=this.prepareConfig();this.title=new A(new M),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 N(new I,new Y,new S(new j),new j).adapt({businessunit:this.businessUnit,measures:this.measures,scenarios:this.scenarios,timeperiod:this.timeperiod,intervalSpanLimit:this.intervalSpanLimit,i18nMode:this.i18nMode,order:this.order})}};V.style=':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)}';export{z as bn_body,F as bn_footer,P as bn_title,V as ibcs_title}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as i,h as t,H as e,g as s}from"./p-JNHhIe7t.js";import{v as a,a as n,i as r,e as o,b as l,c as d,d as h,k as p,h as u,l as c,f as v,g,w as m,j as y}from"./p-DyRaC0MB.js";import{w as f,g as b,p as O}from"./p-DVMu6dEy.js";import{w as S}from"./p-CYjZRKdI.js";import{w}from"./p-CRLgp9-v.js";import{a as R}from"./p-DRikHQE-.js";import{w as x}from"./p-BSfqOkN_.js";import{w as _}from"./p-tzFCK9qn.js";import{O as M,a as A,c as L,S as T,b as E,C as I}from"./p-DdexOqTs.js";import{F as C}from"./p-1jFf17Vj.js";import{D as U}from"./p-DgfL-ffj.js";import"./p-BFTU3MAI.js";var k;!function(i){i.ROWGROUP="rowGroup",i.ROWGROUPINDEX="rowGroupIndex",i.CATEGORY="category",i.CATEGORYINDEX="categoryIndex",i.SUBCATEGORY="subCategory",i.SUBCATEGORYINDEX="subCategoryIndex"}(k||(k={}));const D=class{validateScenario(i){const t=a(i),e="ERR_scenarios";t.length>0?this.errors.addOrReplace({id:e,type:"warning",message:"scenarios: invalid value(s) '"+JSON.stringify(t)+"' are not supported."}):this.errors.remove(e)}validateVariances(i){const t="ERR_variances",e=n(i);e.length>0?this.errors.addOrReplace({id:t,type:"warning",message:"variances: invalid value(s) '"+JSON.stringify(e)+"' are not supported."}):this.errors.remove(t)}validateLeftSync(i){const t="ERR_syncSpaceLeft";r(i)?this.errors.remove(t):this.errors.addOrReplace({id:t,type:"warning",message:"syncSpaceLeft: invalid value(s) '"+i+"' are not supported."})}validateLimit(i){const t="ERR_limit";o(i)?this.errors.remove(t):this.errors.addOrReplace({id:t,type:"warning",message:"limit: invalid value '"+(null==i?void 0:i.toString())+"' is not supported."})}validateUnitScaling(i){const t="ERR_unitScaling";r(i)||this.pixelPerUnitGroupMap.has(i)?this.errors.remove(t):this.errors.addOrReplace({id:t,type:"warning",message:"unitScaling: invalid value(s) '"+i+"' are not supported."})}validatePercentageScaling(i){const t="ERR_percentageScaling";r(i)||this.pixelPerUnitGroupMap.has(i)?this.errors.remove(t):this.errors.addOrReplace({id:t,type:"warning",message:"percentageScaling: invalid value(s) '"+i+"' are not supported."})}validateLevel(i){const t="ERR_level";l(i)?this.errors.remove(t):this.errors.addOrReplace({id:t,type:"warning",message:"level: invalid value(s) '"+i+"' are not supported."})}validateOrderList(i){const t="ERR_order",e=d(i);e.length>0?this.errors.addOrReplace({id:t,type:"warning",message:"order: invalid value(s) '"+JSON.stringify(e)+"' are not supported."}):this.errors.remove(t)}validateOrderDirection(i){const t="ERR_orderDirection";h(i)?this.errors.remove(t):this.errors.addOrReplace({id:t,type:"warning",message:"orderDirection: invalid value '"+(null==i?void 0:i.toString())+"' is not supported."})}validateDateInterval(i){const t="ERR_dateInterval";p(i)?this.errors.remove(t):this.errors.addOrReplace({id:t,type:"warning",message:"dateInterval: invalid value '"+(null==i?void 0:i.toString())+"' is not supported."})}validateChartMode(i){const t="ERR_chartMode";["bar","line","auto"].includes(null==i?void 0:i.toLowerCase())?this.errors.remove(t):this.errors.addOrReplace({id:t,type:"warning",message:"chartMode: invalid value '"+(null==i?void 0:i.toString())+"' is not supported. Valid values are: bar, line, auto."})}validateMaxBars(i){const t="ERR_maxBars";!o(i)||i<1?this.errors.addOrReplace({id:t,type:"warning",message:"maxBars: invalid value '"+(null==i?void 0:i.toString())+"' is not supported. Must be a positive integer."}):this.errors.remove(t)}validateStack(i){const t="ERR_stack",e=u(i);e.length>0?this.errors.addOrReplace({id:t,type:"warning",message:e.join("; ")}):this.errors.remove(t)}validateScaling(i){if(null==i||""===i||"none"===i||"auto"===i)return void this.errors.remove("ERR_scale");const t=Number(i);isNaN(t)||t<=0?this.errors.addOrReplace({id:"ERR_scale",type:"warning",message:`Invalid scale value: "${i}". Use "none", "auto", or a positive number.`}):this.errors.remove("ERR_scale")}validateAxisLabelsMode(i){const t="ERR_axisLabelsMode";c(i)?this.errors.remove(t):this.errors.addOrReplace({id:t,type:"warning",message:"axisLabelsMode: invalid value '"+(null==i?void 0:i.toString())+"' is not supported."})}validateLineFullWidth(i){const t="ERR_lineFullWidth";v(i)?this.errors.remove(t):this.errors.addOrReplace({id:t,type:"warning",message:"lineFullWidth: invalid value(s) '"+(null==i?void 0:i.toString())+"' are not supported."})}validateShowCategories(i){const t="ERR_showCategories";v(i)?this.errors.remove(t):this.errors.addOrReplace({id:t,type:"warning",message:"showCategories: invalid value(s) '"+(null==i?void 0:i.toString())+"' are not supported."})}validateMeasureScale(i){const t="ERR_measureScale";g(i)?this.errors.remove(t):this.errors.addOrReplace({id:t,type:"warning",message:"measureScale: invalid value '"+(null==i?void 0:i.toString())+"' is not supported."})}validateShowMeasureScale(i){const t="ERR_grouped";v(i)?this.errors.remove(t):this.errors.addOrReplace({id:t,type:"warning",message:"showMeasureScale: invalid value(s) '"+(null==i?void 0:i.toString())+"' are not supported."})}validateShowOverlayAvg(i){const t="ERR_grouped";v(i)?this.errors.remove(t):this.errors.addOrReplace({id:t,type:"warning",message:"showOverlayAvg: invalid value(s) '"+(null==i?void 0:i.toString())+"' are not supported."})}validateShowOverlayMedian(i){const t="ERR_grouped";v(i)?this.errors.remove(t):this.errors.addOrReplace({id:t,type:"warning",message:"showOverlayMedian: invalid value(s) '"+(null==i?void 0:i.toString())+"' are not supported."})}constructor(t){i(this,t),this.data=[],this.datasetMeta=null,this.appliedScaleFactor=1,this.chartTitle="",this.filter="",this.syncSpaceLeft=-1,this.limit=0,this.chartMode="bar",this.maxBars=28,this.stack="",this.intervalSpanLimit=28,this.lineFullWidth="true",this.showCategories="true",this.measureScale="greatest",this.showMeasureScale="false",this.showOverlayAvg="true",this.showOverlayMedian="false",this.measureUnit="",this.pixelPerUnitGroupMap=new Map,this._autoScaleGuard=!1,m(this),S(this),f(this,((i,t)=>{this.data=t||[]}),((i,t)=>{this.datasetMeta=t})),this.chartTemplate=this.chartTemplate.bind(this),this.errors=_(this),this.componentStyle=x(this),this.t=w(this).t}componentWillLoad(){this.validateScenario(this.scenarios),this.validateVariances(this.variances),this.validateUnitScaling(this.unitScaling),this.validateLimit(this.limit),this.validateLevel(this.level),this.validateOrderDirection(this.orderDirection),this.validateOrderList(this.order),this.validateLeftSync(this.syncSpaceLeft),this.validateDateInterval(this.dateInterval),this.validateAxisLabelsMode(this.axisLabelsMode),this.validateLineFullWidth(this.lineFullWidth),this.validateShowCategories(this.showCategories),this.validateMeasureScale(this.measureScale),this.validateShowMeasureScale(this.showMeasureScale),this.validateShowOverlayAvg(this.showOverlayAvg),this.validateShowOverlayMedian(this.showOverlayMedian),this.validateChartMode(this.chartMode),this.validateMaxBars(this.maxBars),this.validateStack(this.stack),this.validateScaling(this.scale)}componentDidRender(){var i,t;const{mode:e}=O(this.scale);if("auto"!==e&&"empty"!==e){this._autoScaleGuard=!1;const i=b(this.element),t="WARN_overflow";return void(i.width>0&&this.element.scrollWidth>i.width+1?this.errors.addOrReplace({id:t,type:"warning",message:"Chart exceeds available space and will be cut off. Check unit-scaling value."}):this.errors.remove(t))}if(this._autoScaleGuard)return void(this._autoScaleGuard=!1);const s=this.element,{width:a}=b(s);if(a<=0)return;const n=this.componentStyle((i=>{var t;return(null===(t=i.global)||void 0===t?void 0:t.fontSizePx)||13.3333}));s.style.setProperty("--bn-font-size",`${n}px`);const r=null===(i=s.shadowRoot)||void 0===i?void 0:i.querySelector(".container"),o=null!==(t=null==r?void 0:r.scrollWidth)&&void 0!==t?t:s.scrollWidth;if(o<=a+1)return this.errors.remove("AUTO_scale"),void(1!==this.appliedScaleFactor&&(this._autoScaleGuard=!0,this.appliedScaleFactor=1));const l=(a-1)/o;s.style.setProperty("--bn-font-size",n*l+"px"),"empty"===e?this.errors.addOrReplace({id:"AUTO_scale",type:"warning",message:`Auto-scaled chart by factor ${l.toFixed(3)}`}):this.errors.remove("AUTO_scale"),Math.abs(l-this.appliedScaleFactor)>.001&&(this._autoScaleGuard=!0,this.appliedScaleFactor=l)}prepareDimension(){const i=b(this.element),t=this.prepareScenarios(),e=this.prepareVariances();return this.canvasWidthSegmented=i.width/(t.length+e.length||1),{width:this.canvasWidthSegmented,height:i.height}}prepareScenarios(){var i,t,e,s;const a="auto"===(null===(i=this.scenarios)||void 0===i?void 0:i.trim().toLowerCase());return y(this.scenarios)||a?(null===(e=null===(t=this.datasetMeta)||void 0===t?void 0:t.availableScenarios)||void 0===e?void 0:e.length)>0?(a?this.errors.remove("AUTO_scenarios"):this.errors.addOrReplace({id:"AUTO_scenarios",type:"warning",message:`scenarios: not set, auto-detected: ${this.datasetMeta.availableScenarios.join(",")}`}),this.datasetMeta.availableScenarios):[]:(this.errors.remove("AUTO_scenarios"),null===(s=this.scenarios)||void 0===s?void 0:s.split(",").map((i=>i.trim())))}prepareAvg(){return"true"===this.showOverlayAvg}prepareMedian(){return"true"===this.showOverlayMedian}prepareVariances(){var i;return y(this.variances)?[]:null===(i=this.variances)||void 0===i?void 0:i.split(",").map((i=>i.trim()))}prepareHideAxisLabels(i){return i>=1||"true"!==this.showCategories}prepareI18n(){const i=R,t=new Map([].map((i=>[i,this.t(".".concat(i))]))),e=new Map(i.map((i=>[i,this.t("global.".concat(i))])));return new Map([...e.entries(),...t.entries()])}preparePixelPerUnit(){var i;if(this.pixelPerUnitGroupMap.has(this.unitScaling))return this.errors.remove("AUTO_unitScaling"),this.pixelPerUnitGroupMap.get(this.unitScaling);if("auto"===(null===(i=this.unitScaling)||void 0===i?void 0:i.toString().trim().toLowerCase()))return this.errors.remove("AUTO_unitScaling"),0;const t=Number(this.unitScaling);return!isNaN(t)&&t>0?(this.errors.remove("AUTO_unitScaling"),t):(this.errors.addOrReplace({id:"AUTO_unitScaling",type:"warning",message:"unit-scaling: not set, auto-calculated to fit available space."}),0)}preparePixelPerPercentage(){return this.pixelPerUnitGroupMap.has(this.percentageScaling)?this.pixelPerUnitGroupMap.get(this.percentageScaling):100*Number(this.percentageScaling)}prepareLevel(){var i,t,e;const s="auto"===(null===(i=this.level)||void 0===i?void 0:i.trim().toLowerCase());return y(this.level)||s?(null===(t=this.datasetMeta)||void 0===t?void 0:t.suggestedLevel)?(s?this.errors.remove("AUTO_level"):this.errors.addOrReplace({id:"AUTO_level",type:"warning",message:`level: not set, auto-detected: ${this.datasetMeta.suggestedLevel}`}),k[this.datasetMeta.suggestedLevel.toUpperCase()]):void 0:(this.errors.remove("AUTO_level"),k[null===(e=this.level)||void 0===e?void 0:e.toUpperCase()])}prepareOrder(){var i,t,e,s,a,n;let r=(y(this.level)||"auto"===(null===(i=this.level)||void 0===i?void 0:i.trim().toLowerCase()))&&(null===(t=this.datasetMeta)||void 0===t?void 0:t.suggestedLevel)?this.datasetMeta.suggestedLevel:this.level;const o="auto"===(null===(e=this.order)||void 0===e?void 0:e.trim().toLowerCase());return y(this.order)||o?(null===(s=this.datasetMeta)||void 0===s?void 0:s.suggestedLevel)&&(o?this.errors.remove("AUTO_order"):this.errors.addOrReplace({id:"AUTO_order",type:"warning",message:`order: not set, auto-detected: ${r}`})):(this.errors.remove("AUTO_order"),"levelindex"===(null===(a=this.order)||void 0===a?void 0:a.toLocaleLowerCase())&&(r+="Index")),{hierarchy:[A[null==r?void 0:r.toUpperCase()]],direction:M[null===(n=this.orderDirection)||void 0===n?void 0:n.toUpperCase()]}}prepareStyle(){const i=this.getEffectiveScaleFactor();return this.componentStyle((t=>{const e=t.global.fontSizePx*i;return{scaleFactors:{scenarioOffset:t["bn-chart-time"].scaleFactors.scenarioOffset,scenarioLabelToColumn:t["bn-chart-time"].scaleFactors.scenarioLabelToColumn,labelToColumn:.3,labelToColum:t["bn-chart-time"].scaleFactors.labelToColum,labelToAxis:t["bn-chart-time"].scaleFactors.labelToAxis,needleWidth:t["bn-chart-time"].scaleFactors.needleWidth,needleHeadWidth:t["bn-chart-time"].scaleFactors.needleHeadWidth,columnWidth:t["bn-chart-time"].scaleFactors.columnWidth,varianceAxisLineWidth:t["bn-chart-time"].scaleFactors.varianceAxisLineWidth,axisLineWidth:t["bn-chart-time"].scaleFactors.axisLineWidth,auxiliaryLineWidth:t["bn-chart-time"].scaleFactors.auxiliaryLineWidth,scenarioLineWidth:t["bn-chart-time"].scaleFactors.scenarioLineWidth,markerWidth:t["bn-chart-time"].scaleFactors.markerWidth,markerOffset:t["bn-chart-time"].scaleFactors.markerOffset,categoryWidth:t["bn-chart-time"].scaleFactors.categoryWidth,axisTickLength:t["bn-chart-time"].scaleFactors.axisTickLength},fontStyles:{font:`${e}px ${t.global.fontFamily}`,size:e,color:t.global.fontColor,background:t.global.fontBackgroundColor,leading:1.8},axisStyles:t["bn-chart-time"].axisStyles,barStyles:t["bn-chart-time"].barStyles,varianceStyles:t["bn-chart-time"].varianceStyles,padding:t["bn-chart-time"].padding,pattern:null}}))}prepareLeftSideOffset(i,t){return this.syncSpaceLeft>-1?this.syncSpaceLeft:C.getMaxWidthOfArrayItems([...this.prepareVariances(),...this.prepareScenarios(),this.chartTitle],i,t)}prepareChartTitle(i){return i>=1?"":this.chartTitle}prepareLimit(){return Math.floor(Number(this.limit)||0)}prepareDateInterval(){var i,t,e;const s="auto"===(null===(i=this.dateInterval)||void 0===i?void 0:i.trim().toLowerCase());return y(this.dateInterval)||s?(null===(t=this.datasetMeta)||void 0===t?void 0:t.suggestedDateInterval)?(s?this.errors.remove("AUTO_dateInterval"):this.errors.addOrReplace({id:"AUTO_dateInterval",type:"warning",message:`dateInterval: not set, auto-detected: ${this.datasetMeta.suggestedDateInterval}`}),U[this.datasetMeta.suggestedDateInterval.toUpperCase()]):s?U.AUTO:void 0:(this.errors.remove("AUTO_dateInterval"),U[null===(e=this.dateInterval)||void 0===e?void 0:e.toUpperCase()])}prepareIntervalSpanLimit(){return this.intervalSpanLimit}prepareAxisLabelsMode(){var i;return L[null===(i=this.axisLabelsMode)||void 0===i?void 0:i.toUpperCase()]}prepareFilter(){return 0===this.filter.length?"":this.filter}getDataStructure(){return{ITimeChartDataRow:{setName:{type:"string",isOptional:!1,description:""},date:{type:"string",isOptional:!1,description:""},operation:{type:"string",isOptional:!1,description:""},rowGroup:{type:"string",isOptional:!1,description:""},rowGroupIndex:{type:"number",isOptional:!1,description:""},category:{type:"string",isOptional:!1,description:""},categoryIndex:{type:"number",isOptional:!1,description:""},subCategory:{type:"string",isOptional:!1,description:""},subCategoryIndex:{type:"number",isOptional:!1,description:""},columnGroup:{type:"string",isOptional:!1,description:""},columnGroupIndex:{type:"number",isOptional:!1,description:""},columnSubGroup:{type:"string",isOptional:!1,description:""},columnSubGroupIndex:{type:"number",isOptional:!1,description:""},ac1:{type:"number",isOptional:!1,description:""},ac2:{type:"number",isOptional:!1,description:""},ac3:{type:"number",isOptional:!1,description:""},ac4:{type:"number",isOptional:!1,description:""},pp1:{type:"number",isOptional:!1,description:""},pp2:{type:"number",isOptional:!1,description:""},pp3:{type:"number",isOptional:!1,description:""},pp4:{type:"number",isOptional:!1,description:""},fc1:{type:"number",isOptional:!1,description:""},fc2:{type:"number",isOptional:!1,description:""},fc3:{type:"number",isOptional:!1,description:""},fc4:{type:"number",isOptional:!1,description:""},pl1:{type:"number",isOptional:!1,description:""},pl2:{type:"number",isOptional:!1,description:""},pl3:{type:"number",isOptional:!1,description:""},pl4:{type:"number",isOptional:!1,description:""}}}}prepareMeasureScale(){return y(this.measureScale)?"GREATEST":["_","k","M","G","T","P","E","Z","Y","m","μ","n","p","P","f","a","z","y"].includes(this.measureScale.trim())||"LEAST"===this.measureScale.trim().toUpperCase()?this.measureScale.trim():"GREATEST"}prepareShowMeasureScale(i){return 0===i&&"true"===this.showMeasureScale}prepareMeasureUnit(){return""===this.measureUnit||null==this.measureUnit?"":this.measureUnit}prepareStackConfig(){if(y(this.stack))return null;try{const i=JSON.parse(this.stack);return{by:i.by,mode:i.mode||E.ABSOLUTE,order:i.order||T.DATASET}}catch(i){return null}}prepareLineFullWidth(){return"true"===this.lineFullWidth}prepareChartMode(){var i;const t=null===(i=this.chartMode)||void 0===i?void 0:i.toLowerCase();return"line"===t?I.LINE:"auto"===t?I.AUTO:I.BAR}prepareMaxBars(){return Math.floor(Number(this.maxBars)||28)}chartTemplate(i,e){const s=this.prepareI18n(),a=this.prepareStyle(),n=b(this.element).width,r=this.getEffectiveScaleFactor(),o=this.preparePixelPerUnit(),l=this.preparePixelPerPercentage();return t("ibcs-chart-time",{data:this.data,chartTitle:this.prepareChartTitle(e),scenarios:this.prepareScenarios(),variances:[i],hideAxisLabels:this.prepareHideAxisLabels(e),pixelPerUnit:o>0?o*r:0,pixelPerPercentage:l>0?l*r:0,limit:this.prepareLimit(),leftSideOffsetForHorizontalSync:this.prepareLeftSideOffset(s,a),styles:a,i18n:s,order:this.prepareOrder(),level:this.prepareLevel(),dateInterval:this.prepareDateInterval(),intervalSpanLimit:this.prepareIntervalSpanLimit(),axisLabelsMode:this.prepareAxisLabelsMode(),filter:this.prepareFilter(),"measure-scale":this.prepareMeasureScale(),"measure-unit":this.prepareMeasureUnit(),showOverlayAvg:this.prepareAvg(),showOverlayMedian:this.prepareMedian(),showMeasureScale:this.prepareShowMeasureScale(e),chartMode:this.prepareChartMode(),maxBars:this.prepareMaxBars(),stackConfig:this.prepareStackConfig(),lineFullWidth:this.prepareLineFullWidth(),containerWidth:n,parentDimensions:this.prepareDimension()})}getEffectiveScaleFactor(){const{mode:i,factor:t}=O(this.scale);return"factor"===i?t:"auto"===i||"empty"===i?this.appliedScaleFactor:1}getFontStyles(){const i=this.getEffectiveScaleFactor();return this.componentStyle((t=>{var e,s,a,n;const r=(null===(e=t.global)||void 0===e?void 0:e.fontSizePx)||13.3333;return{"--bn-font-family":(null===(s=t.global)||void 0===s?void 0:s.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":r*i+"px","--bn-font-color":(null===(a=t.global)||void 0===a?void 0:a.fontColor)||"#000000","--bn-font-background":(null===(n=t.global)||void 0===n?void 0:n.fontBackgroundColor)||"#ffffff"}}))}render(){let i=[""];const s=this.prepareVariances();s.length>0&&(i=[...i,...s]);const a=this.getFontStyles();return t(e,{key:"ed9bf10764443d9b4be0bf05dbbcd858d271993a",style:a},t("div",{key:"c2bda702b470a4ddba2da84d81908d96ce893c8e",class:"container"},i.map(this.chartTemplate)))}get element(){return s(this)}static get watchers(){return{scenarios:[{validateScenario:0}],variances:[{validateVariances:0}],syncSpaceLeft:[{validateLeftSync:0}],limit:[{validateLimit:0}],unitScaling:[{validateUnitScaling:0}],percentageScaling:[{validatePercentageScaling:0}],level:[{validateLevel:0}],order:[{validateOrderList:0}],orderDirection:[{validateOrderDirection:0}],dateInterval:[{validateDateInterval:0}],chartMode:[{validateChartMode:0}],maxBars:[{validateMaxBars:0}],stack:[{validateStack:0}],scale:[{validateScaling:0}],axisLabelsMode:[{validateAxisLabelsMode:0}],lineFullWidth:[{validateLineFullWidth:0}],showCategories:[{validateShowCategories:0}],measureScale:[{validateMeasureScale:0}],showMeasureScale:[{validateShowMeasureScale:0}],showOverlayAvg:[{validateShowOverlayAvg:0}],showOverlayMedian:[{validateShowOverlayMedian:0}]}}};D.style=":host{display:inline-block;position:relative;overflow:visible;}.container{display:flex;flex-direction:column-reverse}.background-image{display:flex;flex-wrap:wrap;justify-content:flex-end}";export{D as bn_chart_time}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as i,h as t,H as e,g as s}from"./p-JNHhIe7t.js";import{v as a,a as n,i as r,b as o,c as l,d as h,e as d,f as c,g as p,h as u,w as v,j as g}from"./p-DyRaC0MB.js";import{w as m,g as f,p as y}from"./p-DVMu6dEy.js";import{w as b}from"./p-CYjZRKdI.js";import{w as S}from"./p-CRLgp9-v.js";import{a as w}from"./p-DRikHQE-.js";import{w as O}from"./p-BSfqOkN_.js";import{w as R}from"./p-tzFCK9qn.js";import{A as k,O as x,a as _,S as T,b as A}from"./p-DdexOqTs.js";import"./p-DgfL-ffj.js";const E=class{validateScenario(i){const t=a(i),e="ERR_scenarios";t.length>0?this.errors.addOrReplace({id:e,type:"warning",message:"scenarios: invalid value(s) '"+JSON.stringify(t)+"' are not supported."}):this.errors.remove(e)}validateVariances(i){const t="ERR_variances",e=n(i);e.length>0?this.errors.addOrReplace({id:t,type:"warning",message:"variances: invalid value(s) '"+JSON.stringify(e)+"' are not supported."}):this.errors.remove(t)}validateUnitScaling(i){const t="ERR_unitScaling";r(i)||this.pixelPerUnitGroupMap.has(i)?this.errors.remove(t):this.errors.addOrReplace({id:t,type:"warning",message:"unitScaling: invalid value(s) '"+i+"' are not supported."})}validatePercentageScaling(i){const t="ERR_percentageScaling";r(i)||this.pixelPerUnitGroupMap.has(i)?this.errors.remove(t):this.errors.addOrReplace({id:t,type:"warning",message:"percentageScaling: invalid value(s) '"+i+"' are not supported."})}validateLevel(i){const t="ERR_level";o(i)?this.errors.remove(t):this.errors.addOrReplace({id:t,type:"warning",message:"level: invalid value(s) '"+i+"' are not supported."})}validateOrderList(i){const t=l(i),e="ERR_order";t.length>0?this.errors.addOrReplace({id:e,type:"warning",message:"order: invalid value(s) '"+JSON.stringify(t)+"' are not supported."}):this.errors.remove(e)}validateOrderDirection(i){const t="ERR_orderDirection";h(i)?this.errors.remove(t):this.errors.addOrReplace({id:t,type:"warning",message:"orderDirection: invalid value '"+(null==i?void 0:i.toString())+"' is not supported."})}validateLimit(i){const t="ERR_limit";d(i)?this.errors.remove(t):this.errors.addOrReplace({id:t,type:"warning",message:"limit: invalid value '"+(null==i?void 0:i.toString())+"' is not supported."})}validateShowCategories(i){const t="ERR_showCategories";c(i)?this.errors.remove(t):this.errors.addOrReplace({id:t,type:"warning",message:"showCategories: invalid value(s) '"+(null==i?void 0:i.toString())+"' are not supported."})}validateMeasureScale(i){const t="ERR_measureScale";p(i)?this.errors.remove(t):this.errors.addOrReplace({id:t,type:"warning",message:"measureScale: invalid value '"+(null==i?void 0:i.toString())+"' is not supported."})}validateShowMeasureScale(i){const t="ERR_grouped";c(i)?this.errors.remove(t):this.errors.addOrReplace({id:t,type:"warning",message:"showMeasureScale: invalid value(s) '"+(null==i?void 0:i.toString())+"' are not supported."})}validateStack(i){const t="ERR_stack",e=u(i);e.length>0?this.errors.addOrReplace({id:t,type:"warning",message:e.join("; ")}):this.errors.remove(t)}validateScaling(i){if(null==i||""===i||"none"===i||"auto"===i)return void this.errors.remove("ERR_scale");const t=Number(i);isNaN(t)||t<=0?this.errors.addOrReplace({id:"ERR_scale",type:"warning",message:`Invalid scale value: "${i}". Use "none", "auto", or a positive number.`}):this.errors.remove("ERR_scale")}constructor(t){i(this,t),this.data=[],this.datasetMeta=null,this.appliedScaleFactor=1,this.chartTitle="",this.filter="",this.limit=0,this.showCategories="true",this.measureScale="greatest",this.showMeasureScale="false",this.measureUnit="",this.stack="",this.scenariosArray=[""],this.pixelPerUnitGroupMap=new Map,this._autoScaleGuard=!1,v(this),b(this),m(this,((i,t)=>{this.data=t||[]}),((i,t)=>{this.datasetMeta=t})),this.chartTemplate=this.chartTemplate.bind(this),this.errors=R(this),this.componentStyle=O(this),this.t=S(this).t}componentWillLoad(){this.validateScenario(this.scenarios),this.validateVariances(this.variances),this.validateUnitScaling(this.unitScaling),this.validateLevel(this.level),this.validateOrderDirection(this.orderDirection),this.validateOrderList(this.order),this.validateShowCategories(this.showCategories),this.validateMeasureScale(this.measureScale),this.validateShowMeasureScale(this.showMeasureScale),this.validateStack(this.stack),this.validateScaling(this.scale)}componentDidRender(){var i,t;const{mode:e}=y(this.scale);if("auto"!==e&&"empty"!==e){this._autoScaleGuard=!1;const i=f(this.element),t="WARN_overflow";return void(i.width>0&&this.element.scrollWidth>i.width+1?this.errors.addOrReplace({id:t,type:"warning",message:"Chart exceeds available space and will be cut off. Check unit-scaling value."}):this.errors.remove(t))}if(this._autoScaleGuard)return void(this._autoScaleGuard=!1);const s=this.element,{height:a}=f(s);if(a<=0)return;const n=this.componentStyle((i=>{var t;return(null===(t=i.global)||void 0===t?void 0:t.fontSizePx)||13.3333}));s.style.setProperty("--bn-font-size",`${n}px`);const r=null===(i=s.shadowRoot)||void 0===i?void 0:i.querySelector(".container"),o=null!==(t=null==r?void 0:r.scrollHeight)&&void 0!==t?t:s.scrollHeight;if(o<=a+1)return this.errors.remove("AUTO_scale"),void(1!==this.appliedScaleFactor&&(this._autoScaleGuard=!0,this.appliedScaleFactor=1));const l=(a-1)/o;s.style.setProperty("--bn-font-size",n*l+"px"),"empty"===e?this.errors.addOrReplace({id:"AUTO_scale",type:"warning",message:`Auto-scaled chart by factor ${l.toFixed(3)}`}):this.errors.remove("AUTO_scale"),Math.abs(l-this.appliedScaleFactor)>.001&&(this._autoScaleGuard=!0,this.appliedScaleFactor=l)}prepareDimension(){const i=f(this.element);return this.canvasWidthSegmented=i.width/this.scenariosArray.length,{width:this.canvasWidthSegmented,height:i.height}}prepareScenarios(){var i,t,e,s;const a="auto"===(null===(i=this.scenarios)||void 0===i?void 0:i.trim().toLowerCase());return g(this.scenarios)||a?(null===(e=null===(t=this.datasetMeta)||void 0===t?void 0:t.availableScenarios)||void 0===e?void 0:e.length)>0?(a?this.errors.remove("AUTO_scenarios"):this.errors.addOrReplace({id:"AUTO_scenarios",type:"warning",message:`scenarios: not set, auto-detected: ${this.datasetMeta.availableScenarios.join(",")}`}),this.datasetMeta.availableScenarios):[]:(this.errors.remove("AUTO_scenarios"),null===(s=this.scenarios)||void 0===s?void 0:s.split(",").map((i=>i.trim())))}prepareVariances(){var i;return g(this.variances)?[]:null===(i=this.variances)||void 0===i?void 0:i.split(",").map((i=>i.trim()))}prepareHideCategories(i){return i>=1||"true"!==this.showCategories}prepareI18n(){const i=w,t=new Map([].map((i=>[i,this.t(".".concat(i))]))),e=new Map(i.map((i=>[i,this.t("global.".concat(i))])));return new Map([...e.entries(),...t.entries()])}preparePixelPerUnit(){var i;if(this.pixelPerUnitGroupMap.has(this.unitScaling))return this.errors.remove("AUTO_unitScaling"),this.pixelPerUnitGroupMap.get(this.unitScaling);if("auto"===(null===(i=this.unitScaling)||void 0===i?void 0:i.toString().trim().toLowerCase()))return this.errors.remove("AUTO_unitScaling"),0;const t=Number(this.unitScaling);return!isNaN(t)&&t>0?(this.errors.remove("AUTO_unitScaling"),t):(this.errors.addOrReplace({id:"AUTO_unitScaling",type:"warning",message:"unit-scaling: not set, auto-calculated to fit available space."}),0)}preparePixelPerPercentage(){return this.pixelPerUnitGroupMap.has(this.percentageScaling)?this.pixelPerUnitGroupMap.get(this.percentageScaling):100*Number(this.percentageScaling)}prepareLevel(){var i,t,e;const s="auto"===(null===(i=this.level)||void 0===i?void 0:i.trim().toLowerCase());return g(this.level)||s?(null===(t=this.datasetMeta)||void 0===t?void 0:t.suggestedLevel)?(s?this.errors.remove("AUTO_level"):this.errors.addOrReplace({id:"AUTO_level",type:"warning",message:`level: not set, auto-detected: ${this.datasetMeta.suggestedLevel}`}),k[this.datasetMeta.suggestedLevel.toUpperCase()]):void 0:(this.errors.remove("AUTO_level"),k[null===(e=this.level)||void 0===e?void 0:e.toUpperCase()])}prepareOrder(){var i,t,e;const s="auto"===(null===(i=this.order)||void 0===i?void 0:i.trim().toLowerCase());let a;return g(this.order)||s?(null===(t=this.datasetMeta)||void 0===t?void 0:t.suggestedOrder)?(s?this.errors.remove("AUTO_order"):this.errors.addOrReplace({id:"AUTO_order",type:"warning",message:`order: not set, auto-detected: ${this.datasetMeta.suggestedOrder}`}),a=this.datasetMeta.suggestedOrder):a=this.order:(this.errors.remove("AUTO_order"),a=this.order),{hierarchy:null==a?void 0:a.split(",").map((i=>_[null==i?void 0:i.toUpperCase()])),direction:x[null===(e=this.orderDirection)||void 0===e?void 0:e.toUpperCase()]}}prepareStyle(){const i=this.getEffectiveScaleFactor();return this.componentStyle((t=>{const e=t.global.fontSizePx*i;return{scaleFactors:{scenarioOffset:t["bn-chart-structure"].scaleFactors.scenarioOffset,scenarioLabelToBar:t["bn-chart-structure"].scaleFactors.scenarioLabelToBar,labelToBar:t["bn-chart-structure"].scaleFactors.labelToBar,labelToAxis:t["bn-chart-structure"].scaleFactors.labelToAxis,needleWidth:t["bn-chart-structure"].scaleFactors.needleWidth,needleHeadWidth:t["bn-chart-structure"].scaleFactors.needleHeadWidth,barWidth:t["bn-chart-structure"].scaleFactors.barWidth,varianceAxisLineWidth:t["bn-chart-structure"].scaleFactors.varianceAxisLineWidth,axisLineWidth:t["bn-chart-structure"].scaleFactors.axisLineWidth,auxiliaryLineWidth:t["bn-chart-structure"].scaleFactors.auxiliaryLineWidth,scenarioLineWidth:t["bn-chart-structure"].scaleFactors.scenarioLineWidth,markerWidth:t["bn-chart-structure"].scaleFactors.markerWidth,markerOffset:t["bn-chart-structure"].scaleFactors.markerOffset,categoryWidth:t["bn-chart-structure"].scaleFactors.categoryWidth,axisTickLength:t["bn-chart-structure"].scaleFactors.axisTickLength},fontStyles:{font:`${e}px ${t.global.fontFamily}`,size:e,color:t.global.fontColor,background:t.global.fontBackgroundColor,leading:1.8},axisStyles:t["bn-chart-structure"].axisStyles,barStyles:t["bn-chart-structure"].barStyles,varianceStyles:t["bn-chart-structure"].varianceStyles,padding:t["bn-chart-structure"].padding,pattern:null}}))}prepareChartTitle(i){return i>=1?"":this.chartTitle}prepareStackConfig(){if(g(this.stack))return null;try{const i=JSON.parse(this.stack);return{by:i.by,mode:i.mode||A.ABSOLUTE,order:i.order||T.DATASET}}catch(i){return null}}prepareFilter(){return 0===this.filter.length?"":this.filter}prepareLimit(){return Math.floor(Number(this.limit)||0)}getDataStructure(){return{IStructureChartDataRow:{operation:{type:"string",isOptional:!1,description:""},rowGroup:{type:"string",isOptional:!1,description:""},rowGroupIndex:{type:"number",isOptional:!1,description:""},category:{type:"string",isOptional:!1,description:""},categoryIndex:{type:"number",isOptional:!1,description:""},subCategory:{type:"string",isOptional:!1,description:""},subCategoryIndex:{type:"number",isOptional:!1,description:""},columnGroup:{type:"string",isOptional:!1,description:""},columnGroupIndex:{type:"number",isOptional:!1,description:""},columnSubGroup:{type:"string",isOptional:!1,description:""},columnSubGroupIndex:{type:"number",isOptional:!1,description:""},ac1:{type:"number",isOptional:!1,description:""},ac2:{type:"number",isOptional:!1,description:""},ac3:{type:"number",isOptional:!1,description:""},ac4:{type:"number",isOptional:!1,description:""},pp1:{type:"number",isOptional:!1,description:""},pp2:{type:"number",isOptional:!1,description:""},pp3:{type:"number",isOptional:!1,description:""},pp4:{type:"number",isOptional:!1,description:""},fc1:{type:"number",isOptional:!1,description:""},fc2:{type:"number",isOptional:!1,description:""},fc3:{type:"number",isOptional:!1,description:""},fc4:{type:"number",isOptional:!1,description:""},pl1:{type:"number",isOptional:!1,description:""},pl2:{type:"number",isOptional:!1,description:""},pl3:{type:"number",isOptional:!1,description:""},pl4:{type:"number",isOptional:!1,description:""}}}}prepareMeasureScale(){return g(this.measureScale)?"GREATEST":["_","k","M","G","T","P","E","Z","Y","m","μ","n","p","P","f","a","z","y"].includes(this.measureScale.trim())||"LEAST"===this.measureScale.trim().toUpperCase()?this.measureScale.trim():"GREATEST"}prepareShowMeasureScale(i){return 0===i&&"true"===this.showMeasureScale}prepareMeasureUnit(){return""===this.measureUnit||null==this.measureUnit?"":this.measureUnit}chartTemplate(i,e){const s=this.getEffectiveScaleFactor(),a=this.preparePixelPerUnit(),n=this.preparePixelPerPercentage();return t("ibcs-chart-structure",{data:this.data,chartTitle:this.prepareChartTitle(e),scenarios:this.prepareScenarios(),variances:[i],hideCategories:this.prepareHideCategories(e),pixelPerUnit:a>0?a*s:0,pixelPerPercentage:n>0?n*s:0,limit:this.prepareLimit(),styles:this.prepareStyle(),i18n:this.prepareI18n(),order:this.prepareOrder(),level:this.prepareLevel(),filter:this.prepareFilter(),"measure-scale":this.prepareMeasureScale(),"measure-unit":this.prepareMeasureUnit(),showMeasureScale:this.prepareShowMeasureScale(e),stackConfig:this.prepareStackConfig(),parentDimensions:this.prepareDimension()})}getEffectiveScaleFactor(){const{mode:i,factor:t}=y(this.scale);return"factor"===i?t:"auto"===i||"empty"===i?this.appliedScaleFactor:1}getFontStyles(){const i=this.getEffectiveScaleFactor();return this.componentStyle((t=>{var e,s,a,n;const r=(null===(e=t.global)||void 0===e?void 0:e.fontSizePx)||13.3333;return{"--bn-font-family":(null===(s=t.global)||void 0===s?void 0:s.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":r*i+"px","--bn-font-color":(null===(a=t.global)||void 0===a?void 0:a.fontColor)||"#000000","--bn-font-background":(null===(n=t.global)||void 0===n?void 0:n.fontBackgroundColor)||"#ffffff"}}))}render(){let i=[""];const s=this.prepareVariances();s.length>0&&(i=[...i,...s]);const a=this.getFontStyles();return t(e,{key:"c8ad939fbe92ab4a01af1e5ce17e097dbb5eab56",style:a},t("div",{key:"d786c49dd808c2dd9093ede7100e16ac52f50689",class:"container"},i.map(this.chartTemplate)))}get element(){return s(this)}static get watchers(){return{scenarios:[{validateScenario:0}],variances:[{validateVariances:0}],unitScaling:[{validateUnitScaling:0}],percentageScaling:[{validatePercentageScaling:0}],level:[{validateLevel:0}],order:[{validateOrderList:0}],orderDirection:[{validateOrderDirection:0}],limit:[{validateLimit:0}],showCategories:[{validateShowCategories:0}],measureScale:[{validateMeasureScale:0}],showMeasureScale:[{validateShowMeasureScale:0}],stack:[{validateStack:0}],scale:[{validateScaling:0}]}}};E.style=':host{display:inline-block;position:relative;overflow:hidden}.container{display:flex;flex-direction:row}.background-image{display:flex;flex-wrap:wrap;justify-content:flex-end}.categories{text-align:right;font-size:var(--bn-font-size, 1em);font-family:var(--bn-font-family, "Noto Sans", "Helvetica Neue", Helvetica, sans-serif);color:var(--bn-font-color, black)}.label-bg{fill:var(--bn-font-background, white);opacity:0.7}.label-text{text-align:right;font-size:var(--bn-font-size, 1em);font-family:var(--bn-font-family, "Noto Sans", "Helvetica Neue", Helvetica, sans-serif);color:var(--bn-font-color, black)}.axis-title{text-align:center;font-family:var(--bn-font-family, "Noto Sans", "Helvetica Neue", Helvetica, sans-serif);color:var(--bn-font-color, black)}.axis-ac{stroke:black;stroke-width:0.1em}.axis-pp{stroke:grey;stroke-width:0.1em}.axis-fc{stroke:black;stroke-dasharray:2;stroke-width:0.1em}.axis-pl{stroke:white;stroke-width:0.1em;outline-offset:0em;outline:0.1em solid black}canvas{image-rendering:-moz-crisp-edges;image-rendering:-webkit-crisp-edges;image-rendering:pixelated;image-rendering:crisp-edges}.measure{font-weight:bold}span{display:inline-block}.hidePatternContainer{height:0;width:0}div{float:left}.warning{font-size:0.8em;font-style:italic}.footer{margin:0.2em;font-size:0.6em}.footer-hide{margin:0.2em;font-size:0.6em;opacity:0}';export{E as bn_chart_structure}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,h as e,H as s,g as r}from"./p-JNHhIe7t.js";import{w as o}from"./p-CYjZRKdI.js";import{w as a}from"./p-tzFCK9qn.js";const b=class{constructor(e){t(this,e),o(this),this.errors=a(this)}render(){return e(s,{key:"ef4bc925d3e711445f9533e0b1e59a8942700283"},e("slot",{key:"c338dd99289b256bab83240cf923b23fd62b4ef1"}))}get element(){return r(this)}};export{b as bn_template}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,h as s,H as i,g as o}from"./p-JNHhIe7t.js";import{w as r}from"./p-DyRaC0MB.js";import{w as e}from"./p-CYjZRKdI.js";import{w as n}from"./p-BSfqOkN_.js";import{g as f}from"./p-DRikHQE-.js";import{w as a}from"./p-tzFCK9qn.js";import"./p-DdexOqTs.js";import"./p-DgfL-ffj.js";const l=class{constructor(s){t(this,s),r(this),e(this),this.errors=a(this),this.componentStyle=n(this)}connectedCallback(){this.stores=f(this.element)}getFontStyles(){return this.componentStyle((t=>{var s,i,o,r;return{"--bn-font-family":(null===(s=t.global)||void 0===s?void 0:s.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":`${(null===(i=t.global)||void 0===i?void 0:i.fontSizePx)||13.3333}px`,"--bn-font-color":(null===(o=t.global)||void 0===o?void 0:o.fontColor)||"#000000","--bn-font-background":(null===(r=t.global)||void 0===r?void 0:r.fontBackgroundColor)||"#ffffff"}}))}prepareAssetUrl(t){if(null==t||""===t)return"";const s=this.stores.assets.state;return t.startsWith("asset:")?s[t.substring(6)]:s[t]||t}render(){return s(i,{key:"656f301d5fb1a7650f4c7d0cbb3fe1ef15b8ae92",style:this.getFontStyles()},null!=this.source&&""!==this.source?s("img",{src:this.prepareAssetUrl(this.source)}):"")}get element(){return o(this)}};l.style=":host{display:inline-block;position:relative;overflow:hidden}img{max-width:100%;height:auto}";export{l as bn_image}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as e}from"./p-
|
|
1
|
+
import{g as e}from"./p-JNHhIe7t.js";const r=(e,r)=>{"function"==typeof e&&(r?e.bind(r)():e())};function t(){let e=(new Date).getTime(),r=performance&&performance.now&&1e3*performance.now()||0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(t=>{let x=16*Math.random();return e>0?(x=(e+x)%16|0,e=Math.floor(e/16)):(x=(r+x)%16|0,r=Math.floor(r/16)),("x"===t?x:7&x|8).toString(16)}))}let x=(e=21)=>{let r="",t=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)r+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&t[e]];return r};const n=r=>{const{set:t,modify:n}=(()=>{let t=[];const x=()=>t,n=x=>{const n=t;t=x,n!==x&&(t=>{const x=e(r);0===t.length?x.removeAttribute("has-error"):x.setAttribute("has-error",JSON.stringify(t))})(t)};return{get:x,set:n,setAndGet:e=>{n(e)},getAndSet:e=>{const r=x();return n(e),r},modify:e=>{n(e(x()))}}})();return{clear:()=>{t([])},replace:e=>{t(e.map((e=>(e.id||(e.id=x()),e))))},add:e=>(e.id||(e.id=x()),n((r=>[...r,e])),e.id),addOrReplace:e=>{if(void 0===e.id)throw"missing";return n((r=>[...r.filter((r=>r.id!==e.id)),e])),e.id},remove:e=>{n((r=>r.filter((r=>r.id!==e))))}}};export{t as g,r,n as w}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var alasql_min = require('./alasql.min-C_nHTuEQ.js');
|
|
4
|
-
var Order = require('./Order-
|
|
4
|
+
var Order = require('./Order-DtpbD8mQ.js');
|
|
5
5
|
|
|
6
6
|
/** SI metric prefix for number scaling (e.g. prefix="M", value=1000000 divides displayed values by one million). */
|
|
7
7
|
class SiPrefix {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var Order = require('./Order-DtpbD8mQ.js');
|
|
4
4
|
|
|
5
5
|
/** Granularity levels for date intervals, from YEAR down to MILLISECOND. AUTO triggers auto-detection. */
|
|
6
6
|
exports.DateDistance = void 0;
|
|
@@ -154,8 +154,8 @@ class DateStringFactory {
|
|
|
154
154
|
if (end == null) {
|
|
155
155
|
return exports.DateDistance.DAY;
|
|
156
156
|
}
|
|
157
|
-
const mStart = typeof start == "number" ?
|
|
158
|
-
const mEnd = typeof end == "number" ?
|
|
157
|
+
const mStart = typeof start == "number" ? Order.DateTime.fromMillis(start) : start;
|
|
158
|
+
const mEnd = typeof end == "number" ? Order.DateTime.fromMillis(end) : end;
|
|
159
159
|
if (mEnd.diff(mStart).as("milliseconds") === 0) {
|
|
160
160
|
return exports.DateDistance.DAY;
|
|
161
161
|
}
|
|
@@ -201,7 +201,6 @@ class DateStringFactory {
|
|
|
201
201
|
let span = toDate.diff(fromDate).as(unit);
|
|
202
202
|
const days = [];
|
|
203
203
|
if (span >= spanLimit) {
|
|
204
|
-
console.warn("Clip Span from", span, "to spanLimit", spanLimit);
|
|
205
204
|
span = spanLimit;
|
|
206
205
|
}
|
|
207
206
|
let currentDate = fromDate;
|
|
@@ -243,7 +242,7 @@ class DateStringFactory {
|
|
|
243
242
|
// BinoSystem.warn('NO END N SELECTED');
|
|
244
243
|
return "";
|
|
245
244
|
}
|
|
246
|
-
const date1 = startDateTime ||
|
|
245
|
+
const date1 = startDateTime || Order.DateTime.now();
|
|
247
246
|
const date2 = endDateTime;
|
|
248
247
|
// calculate type value aka. auto-mode
|
|
249
248
|
if (type === exports.DateDistance.AUTO) {
|