@bino-bi/bn-template-engine 1.0.0-alpha.13 → 1.0.0-alpha.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/dist/bn-template-engine/bn-template-engine.esm.js +1 -1
  2. package/dist/bn-template-engine/{p-637e3b8f.entry.js → p-19f49fbc.entry.js} +1 -1
  3. package/dist/bn-template-engine/p-209b3fd9.entry.js +1 -0
  4. package/dist/bn-template-engine/{p-67eae33e.entry.js → p-3465fcdc.entry.js} +1 -1
  5. package/dist/bn-template-engine/{p-82023539.entry.js → p-67746414.entry.js} +1 -1
  6. package/dist/bn-template-engine/p-BPDZcex5.js +1 -0
  7. package/dist/bn-template-engine/{p-DHheVOfP.js → p-Tx6omDWp.js} +1 -1
  8. package/dist/bn-template-engine/{p-52097456.entry.js → p-d724ab88.entry.js} +1 -1
  9. package/dist/bn-template-engine/p-efd3b67a.entry.js +1 -0
  10. package/dist/bn-template-engine/{p-46699464.entry.js → p-ff659485.entry.js} +1 -1
  11. package/dist/bn-template-engine/p-z9bPNFYF.js +1 -0
  12. package/dist/cjs/bn-asset_21.cjs.entry.js +348 -75
  13. package/dist/cjs/bn-grid.cjs.entry.js +2 -2
  14. package/dist/cjs/bn-image.cjs.entry.js +2 -2
  15. package/dist/cjs/bn-internationalization.cjs.entry.js +1 -1
  16. package/dist/cjs/bn-template-engine.cjs.js +1 -1
  17. package/dist/cjs/bn-text.cjs.entry.js +3 -3
  18. package/dist/cjs/bn-tree.cjs.entry.js +2 -2
  19. package/dist/cjs/{context-protocol-Op7uUwN3.js → context-protocol-Cn5PL928.js} +14 -0
  20. package/dist/cjs/editor-companion.cjs.entry.js +1 -1
  21. package/dist/cjs/loader.cjs.js +1 -1
  22. package/dist/cjs/{scaling-57N4Cxb_.js → scaling-DM2UILdF.js} +58 -17
  23. package/dist/cjs/{withStyled-C2kmGAK3.js → withStyled-Dx3uRw9g.js} +72 -1
  24. package/dist/collection/components/bn-chart-structure/utils/StructureChart.js +28 -10
  25. package/dist/collection/components/bn-chart-structure/utils/helper/ElementPositions.js +46 -4
  26. package/dist/collection/components/bn-chart-time/bn-chart-time.js +39 -1
  27. package/dist/collection/components/bn-chart-time/utils/TimeChart.js +40 -10
  28. package/dist/collection/components/bn-dataset/bn-dataset.js +25 -13
  29. package/dist/collection/components/bn-datasource/bn-datasource.js +23 -12
  30. package/dist/collection/components/bn-layout-card/bn-layout-card.css +5 -0
  31. package/dist/collection/components/bn-layout-card/bn-layout-card.js +6 -3
  32. package/dist/collection/components/bn-layout-page/bn-layout-page.css +5 -0
  33. package/dist/collection/components/bn-layout-page/bn-layout-page.js +6 -3
  34. package/dist/collection/components/bn-table/bn-table.js +75 -7
  35. package/dist/collection/components/bn-table/ibcs-table.js +27 -0
  36. package/dist/collection/components/bn-table/utils/Table.js +2 -2
  37. package/dist/collection/components/bn-table/utils/factories/tableDataSetFactory.js +28 -5
  38. package/dist/collection/components/bn-table/utils/helper/DataQuery.js +46 -6
  39. package/dist/collection/components/bn-table/utils/model/TableAttribute.js +46 -0
  40. package/dist/collection/components/bn-table/utils/model/TableComponentConfig.js +5 -0
  41. package/dist/collection/context/scopedDb.js +14 -0
  42. package/dist/collection/utils/parentDimensions.js +57 -16
  43. package/dist/collection/utils/validate.js +23 -0
  44. package/dist/components/DateStringFactory.js +1 -1
  45. package/dist/components/Order.js +1 -1
  46. package/dist/components/bn-chart-structure.js +1 -1
  47. package/dist/components/bn-chart-time.js +1 -1
  48. package/dist/components/bn-dataset.js +1 -1
  49. package/dist/components/bn-datasource.js +1 -1
  50. package/dist/components/bn-layout-card.js +1 -1
  51. package/dist/components/bn-layout-page.js +1 -1
  52. package/dist/components/bn-table.js +1 -1
  53. package/dist/components/bn-title2.js +1 -1
  54. package/dist/components/context-protocol.js +1 -1
  55. package/dist/components/ibcs-chart-structure2.js +1 -1
  56. package/dist/components/ibcs-chart-time2.js +1 -1
  57. package/dist/components/ibcs-table2.js +1 -1
  58. package/dist/components/ibcs-title2.js +1 -1
  59. package/dist/components/scaling.js +1 -1
  60. package/dist/components/validate.js +1 -1
  61. package/dist/esm/bn-asset_21.entry.js +348 -75
  62. package/dist/esm/bn-grid.entry.js +2 -2
  63. package/dist/esm/bn-image.entry.js +2 -2
  64. package/dist/esm/bn-internationalization.entry.js +1 -1
  65. package/dist/esm/bn-template-engine.js +1 -1
  66. package/dist/esm/bn-text.entry.js +3 -3
  67. package/dist/esm/bn-tree.entry.js +2 -2
  68. package/dist/esm/{context-protocol-BDhzNbeD.js → context-protocol-BB-4Onmw.js} +14 -0
  69. package/dist/esm/editor-companion.entry.js +1 -1
  70. package/dist/esm/loader.js +1 -1
  71. package/dist/esm/{scaling-La1Ow72h.js → scaling-h4KcBet3.js} +58 -17
  72. package/dist/esm/{withStyled-Bl9cSoRW.js → withStyled-BBvU2f-A.js} +71 -2
  73. package/dist/types/components/bn-chart-structure/utils/StructureChart.d.ts +4 -0
  74. package/dist/types/components/bn-chart-structure/utils/helper/ElementPositions.d.ts +16 -1
  75. package/dist/types/components/bn-chart-time/bn-chart-time.d.ts +13 -0
  76. package/dist/types/components/bn-chart-time/utils/TimeChart.d.ts +4 -0
  77. package/dist/types/components/bn-dataset/bn-dataset.d.ts +15 -7
  78. package/dist/types/components/bn-datasource/bn-datasource.d.ts +13 -6
  79. package/dist/types/components/bn-layout-card/bn-layout-card.d.ts +1 -0
  80. package/dist/types/components/bn-layout-page/bn-layout-page.d.ts +1 -0
  81. package/dist/types/components/bn-table/bn-table.d.ts +13 -0
  82. package/dist/types/components/bn-table/ibcs-table.d.ts +2 -0
  83. package/dist/types/components/bn-table/utils/factories/tableDataSetFactory.d.ts +3 -1
  84. package/dist/types/components/bn-table/utils/helper/DataQuery.d.ts +11 -0
  85. package/dist/types/components/bn-table/utils/model/TableAttribute.d.ts +22 -0
  86. package/dist/types/components/bn-table/utils/model/TableComponentConfig.d.ts +3 -0
  87. package/dist/types/components.d.ts +45 -20
  88. package/dist/types/utils/validate.d.ts +6 -0
  89. package/package.json +1 -1
  90. package/dist/bn-template-engine/p-3c827826.entry.js +0 -1
  91. package/dist/bn-template-engine/p-BVFHvEXF.js +0 -1
  92. package/dist/bn-template-engine/p-CQnZV3JG.js +0 -1
  93. package/dist/bn-template-engine/p-ab3ea8cf.entry.js +0 -1
@@ -1 +0,0 @@
1
- import{g as t,f as e}from"./p-B_d-jp99.js";import{g as r,c as n,D as s}from"./p-DHheVOfP.js";import{r as a}from"./p-B4JfKvVT.js";const i=t=>{if("object"==typeof t&&null!==t){if("function"==typeof Object.getPrototypeOf){const e=Object.getPrototypeOf(t);return e===Object.prototype||null===e}return"[object Object]"===Object.prototype.toString.call(t)}return!1},o=(t,e)=>e,c=(t,e)=>[...new Set([...t,...e])],u=(t,e)=>{const r=(t=>{return{arrayMergeType:"combine",arrayMerge:(e=t?t.arrayMergeType:"combine","overwrite"===e?o:c),...t};var e})(e);return t.reduce(((t,e)=>(Object.keys(e).forEach((n=>{Array.isArray(t[n])&&Array.isArray(e[n])?r&&r.arrayMerge&&(t[n]=r.arrayMerge(t[n],e[n])):t[n]=i(t[n])&&i(e[n])?u([t[n],e[n]],r):e[n]})),t)),{})},l=s=>{let i,o,c,l;const d=()=>{const t=o.componentStyles.state;l=u([t._system||{},t._default||{},t[c]||{}])},f=new MutationObserver((r=>{r.forEach((r=>{"selected-style"===r.attributeName&&(c=t(s).getAttribute("selected-style"),d(),e(s))}))})),m=s.connectedCallback;s.connectedCallback=()=>{const n=t(s);o=r(n),l=o.componentStyles.state._system,f.observe(n,{attributes:!0,attributeFilter:["selected-style"]}),c=t(s).getAttribute("selected-style"),d(),i=o.componentStyles.on("set",(r=>{r===c&&(c=t(s).getAttribute("selected-style"),d(),e(t(s)))})),a(m,s)};const h=s.disconnectedCallback;return s.disconnectedCallback=()=>{f.disconnect(),a(i),n(t(s)),a(h,s)},t=>t(l)};var d,f,m,h,y,p,b,g;!function(t){t.ALL="all",t.META="meta"}(d||(d={})),function(t){t.CURRENCY="currency",t.VOLUME="volume"}(f||(f={})),function(t){t.AC1="ac1",t.AC2="ac2",t.AC3="ac3",t.AC4="ac4",t.PP1="pp1",t.PP2="pp2",t.PP3="pp3",t.PP4="pp4",t.FC1="fc1",t.FC2="fc2",t.FC3="fc3",t.FC4="fc4",t.PL1="pl1",t.PL2="pl2",t.PL3="pl3",t.PL4="pl4"}(m||(m={})),function(t){t.POS="pos",t.NEG="neg",t.NEU="neu"}(h||(h={})),function(t){t.DECIMAL="decimal",t.PERCENT="percent"}(y||(y={})),function(t){t.LIST="list",t.SUM="sum",t.SUMNOTOTAL="sumnototal",t.OPT="opt",t.OPTNOTOTAL="optnototal"}(p||(p={})),function(t){t.INF="inf",t.W100="w100",t.W50="w50",t.W25="w25",t.W20="w20",t.W15="w15",t.W10="w10",t.W5="w5"}(b||(b={})),function(t){t.W5="w5",t.W10="w10",t.W15="w15",t.W20="w20",t.W25="w25",t.W30="w30",t.W40="w40",t.W60="w60",t.W80="w80",t.W100="w100"}(g||(g={}));const w={[g.W5]:5,[g.W10]:10,[g.W15]:15,[g.W20]:20,[g.W25]:25,[g.W30]:30,[g.W40]:40,[g.W60]:60,[g.W80]:80,[g.W100]:100};var N,v,S,D,k,T,O,A,M,F,J;!function(t){t.ROWGROUP="rowGroup",t.ROWGROUPINDEX="rowGroupIndex",t.CATEGORY="category",t.CATEGORYINDEX="categoryIndex",t.SUBCATEGORY="subCategory",t.SUBCATEGORYINDEX="subCategoryIndex"}(N||(N={})),function(t){t.SMART="smart",t.LONG="long",t.SHORT="short"}(v||(v={})),function(t){t.COLUMN="column",t.LINE="line",t.WATERFALL="waterfall"}(S||(S={})),function(t){t.BAR="bar",t.LINE="line",t.AUTO="auto"}(D||(D={})),function(t){t.SCENARIOS="scenarios",t.DIMENSIONS="dimensions"}(k||(k={})),function(t){t.ABSOLUTE="absolute",t.RELATIVE="relative",t.ABSOLUTE_RELATIVE="absolute-relative"}(T||(T={})),function(t){t.ASC="asc",t.DESC="desc",t.DATASET="dataset"}(O||(O={})),function(t){t.YEAR="year",t.QUARTER="quarter",t.MONTH="month",t.WEEK="week",t.DAY="day",t.HOUR="hour",t.MINUTE="minute",t.SECOND="second",t.MILLISECOND="millisecond",t.NONE="fallback",t.AUTO="auto"}(A||(A={})),function(t){t.AVG="avg",t.INTERVAL="interval",t.START="start",t.END="end",t.YTD="ytd",t.YTG="ytg",t.CUM="cum",t.MAT="mat",t.NONE="none",t.AUTO="auto"}(M||(M={}));class E{constructor(){this._dateFormat={year:"yyyy",quarter:"q'Q' yyyy",month:"LLL yyyy",week:"'KW'WW yyyy",day:"dd.MM.yyyy",hour:"TT",minute:"TT",second:"TT",millisecond:"TT:SSS",fallback:"dd.MM.yyyy"},this._dateFormatShort={year:"yy",quarter:"q'Q'",month:"LLL",week:"'KW'WW",day:"dd",hour:"hh'h'",minute:"mm'm'",second:"ss's'",millisecond:"SSS'ms'",fallback:"dd.MM.yyyy"},this._dateLinkFormat={avg:"Ø[LINK]",interval:"[DATE]..[DATE2]",start:".[DATE]",end:"[DATE].",ytd:"_[DATE]",ytg:"[DATE]_",cum:"[DATE]_[DATE2]",mat:"~[DATE]",none:"[DATE]"},this.locale="de",this.dateFormat=this._dateFormat,this.dateLinkFormat=this._dateLinkFormat,this.dateFormatShort=this._dateFormatShort}setDateLinkFormat(t){this.dateLinkFormat=t}setDateFormat(t){this.dateFormat=t}setDateFormatShort(t){this.dateFormatShort=t}setLocale(t){this.locale=t}getDateString(t,e){return t.setLocale(this.locale).toFormat(this.dateFormat[e]||this.dateFormat.fallback)}getSmartDateString(t,e){switch(e){case A.DAY:return this.getFormatedDayDate(t);case A.MONTH:return this.getFormatedMonthDate(t);case A.QUARTER:return this.getFormatedQuarterDate(t);case A.WEEK:return this.getFormatedWeekDate(t);case A.HOUR:return this.getFormatedHourDate(t);case A.MINUTE:return this.getFormatedMinuteDate(t);case A.SECOND:return this.getFormatedSecondDate(t);case A.MILLISECOND:return this.getFormatedMilliSecondDate(t);default:return this.getDateString(t,e)}}calculateDistanceType(t,e,r=32){if(null==e)return A.DAY;const n="number"==typeof t?s.fromMillis(t):t,a="number"==typeof e?s.fromMillis(e):e;return 0===a.diff(n).as("milliseconds")?A.DAY:a.diff(n).as("milliseconds")<r?A.MILLISECOND:a.diff(n).as("seconds")<r?A.SECOND:a.diff(n).as("minutes")<r?A.MINUTE:a.diff(n).as("hours")<r?A.HOUR:a.diff(n).as("days")<r?A.DAY:a.diff(n).as("weeks")<r?A.WEEK:a.diff(n).as("months")<r?A.MONTH:a.diff(n).as("quarters")<r?A.QUARTER:A.YEAR}datesBetween(t,e,r,n){const s=this.convertDateDistanceToMomentunitOfTime(r),a=t.startOf(s),i=e.endOf(s);let o=i.diff(a).as(s);const c=[];o>=n&&(o=n);let u=a;do{c.push(u),u=u.plus(this.createDiratonLike(s,1))}while(u<=i&&c.length<o);return c}getDateLinkString(t,e,r,n,a){if(null==t&&null==e)return"";if(null==t&&r!==M.END&&r!==M.YTD)return"";if(null==e&&(M.INTERVAL===r||M.CUM===r||M.END===r||M.YTD===r))return"";const i=t||s.now(),o=e;n===A.AUTO&&(n=this.calculateDistanceType(i,o,a));let c=this.getDateString(i,n),u="",l=M.NONE;return null!=o&&(u=this.getDateString(o,n),l=M.INTERVAL,c===u&&r===M.INTERVAL&&(r=M.NONE),c===u&&r===M.AVG&&(l=M.NONE),M.END!==r&&M.YTD!==r||(c=u),(r===M.INTERVAL||r===M.CUM||M.AVG)&&(n===A.QUARTER?i.quarter===o.quarter&&i.year===o.year?u=u.replace(" "+o.year,""):i.year===o.year&&(c=c.replace(" "+i.year,"")):n===A.MONTH?i.month===o.month&&i.year===o.year?u=u.replace(" "+o.year,""):i.year===o.year&&(c=c.replace(" "+i.year,"")):n===A.WEEK&&(i.weekNumber===o.weekNumber&&i.year===o.year?u=u.replace(" "+o.year,""):i.year===o.year&&(c=c.replace(" "+i.year,""))))),this.dateLinkFormat[r].replace("[LINK]",this.dateLinkFormat[l]).replace("[DATE]",c).replace("[DATE2]",u)}getShortDateString(t,e){return t.setLocale(this.locale).toFormat(this.dateFormatShort[e]||this.dateFormatShort.fallback)}getFormatedDayDate(t){let e=this.dateFormatShort.day;return this.isFirstInMonth(t)&&(e+=" "+this.dateFormatShort.month),this.isJanuary(t)&&(e+=" "+this.dateFormatShort.year),t.setLocale(this.locale).toFormat(e)}getFormatedMonthDate(t){let e=this.dateFormatShort.month;return this.isJanuary(t)&&(e+=" "+this.dateFormatShort.year),t.setLocale(this.locale).toFormat(e)}getFormatedQuarterDate(t){let e=this.dateFormatShort.quarter;return this.isFirstQuarter(t)&&(e+=" "+this.dateFormatShort.year),t.setLocale(this.locale).toFormat(e)}getFormatedWeekDate(t){let e=this.dateFormatShort.week;return this.isFirstWeek(t)&&(e+=" "+this.dateFormatShort.year),t.setLocale(this.locale).toFormat(e)}getFormatedHourDate(t){let e=this.dateFormatShort.hour;return this.isFirstHour(t)&&(e+=" "+this.dateFormatShort.day),t.setLocale(this.locale).toFormat(e)}getFormatedMinuteDate(t){let e=this.dateFormatShort.minute;return this.isFirstMinute(t)&&(e=this.dateFormatShort.hour+":"+e),t.setLocale(this.locale).toFormat(e)}getFormatedSecondDate(t){let e=this.dateFormatShort.second;return this.isFirstSecond(t)&&(e=this.dateFormatShort.minute+":"+e),t.setLocale(this.locale).toFormat(e)}getFormatedMilliSecondDate(t){let e=this.dateFormatShort.millisecond;return this.isFirstMilliSecond(t)&&(e=this.dateFormatShort.second+":"+e),t.setLocale(this.locale).toFormat(e)}isFirstInMonth(t){return 1===t.day}isJanuary(t){return 1===t.month}isFirstQuarter(t){return 1===t.quarter}isFirstWeek(t){return 1===t.weekNumber}isFirstHour(t){return 0===t.hour}isFirstMinute(t){return 0===t.minute}isFirstSecond(t){return 0===t.second}isFirstMilliSecond(t){return 0===t.millisecond}convertDateDistanceToMomentunitOfTime(t){let e;switch(t){case A.YEAR:e="year";break;case A.MONTH:e="month";break;case A.QUARTER:e="quarter";break;case A.WEEK:e="week";break;case A.DAY:e="day";break;case A.HOUR:e="hour";break;case A.MINUTE:e="minute";break;case A.SECOND:e="second";break;case A.MILLISECOND:e="millisecond";break;default:e="day"}return e}createDiratonLike(t,e){switch(t){case"year":return{years:e};case"month":return{months:e};case"quarter":return{quarters:e};case"week":return{weeks:e};case"day":default:return{days:e};case"hour":return{hours:e};case"minute":return{minutes:e};case"second":return{seconds:e};case"millisecond":return{milliseconds:e}}}}class j{static isExisting(t){return null!=t}static isString(t){return"string"==typeof t}static isNumber(t){return"number"==typeof t&&!Number.isNaN(t)}static isBoolean(t){return"boolean"==typeof t}static isArray(t){return Array.isArray(t)}static isObject(t){return"object"==typeof t&&null!==t}static isOperator(t){return"+"===t||"-"===t}static isDate(t){return t instanceof s&&t.isValid}}class L{static adaptDefaultString(t){return j.isString(t)?t.trim():""}static adaptArray(t,e){const r=[];return j.isArray(t)&&t.forEach((t=>{r.push(e.adapt(t))})),r}}!function(t){t.ASC="asc",t.DESC="desc"}(F||(F={})),function(t){t.ROWGROUP="rowGroup",t.ROWGROUPINDEX="rowGroupIndex",t.CATEGORY="category",t.CATEGORYINDEX="categoryIndex",t.SUBCATEGORY="subCategory",t.SUBCATEGORYINDEX="subCategoryIndex",t.AC1="ac1",t.AC2="ac2",t.AC3="ac3",t.AC4="ac4",t.PP1="pp1",t.PP2="pp2",t.PP3="pp3",t.PP4="pp4",t.FC1="fc1",t.FC2="fc2",t.FC3="fc3",t.FC4="fc4",t.PL1="pl1",t.PL2="pl2",t.PL3="pl3",t.PL4="pl4"}(J||(J={}));class I{constructor(t=["category"],e=F.ASC){this.hierarchy=t,this.direction=e}}class q{constructor(t){this.stringAdapter=t}adapt(t){var e;const r=L.adaptArray(t.hierarchy,this.stringAdapter),n=F[null===(e=t.direction)||void 0===e?void 0:e.toUpperCase()]||F.ASC;return new I(r.map((t=>J[t.toUpperCase()]||J.CATEGORY)),n)}default(){return new I(["category"],F.ASC)}}function x(t){return null==t||""===t||"null"===t}function G(t){return x(t)||"auto"===t.trim().toLowerCase()?[]:$((null==t?void 0:t.split(",").filter((t=>!(t.toUpperCase().trim()in m)))).toString())}function $(t){return x(t)?[]:t.replace(";",",").split(",").filter((t=>{var e,r,n;const s=t.split("_"),a=null===(e=s[0])||void 0===e?void 0:e.replace(/^dr|^d/,"").toUpperCase().trim(),i=null===(r=s[1])||void 0===r?void 0:r.toUpperCase().trim(),o=null===(n=s[2])||void 0===n?void 0:n.toUpperCase().trim();return 3!==s.length||!(a in m)||!(i in m)||!(o in h)}))}function C(t){return x(t)||"auto"===t.trim().toLowerCase()?[]:$(t.split(",").filter((t=>!(t.toUpperCase()in J))).toString())}function W(t){return!x(t)&&Number.isInteger(Number(t))}function _(t){return!x(t)&&!Number.isNaN(Number(t))}function K(t){return!x(t)&&(null==t?void 0:t.toUpperCase())in F}function z(t){return"auto"===(null==t?void 0:t.toLowerCase())||(null==t?void 0:t.toUpperCase())in N}function B(t){if(x(t))return[];try{const e=JSON.parse(t);if(e instanceof Array)return e.filter((t=>!(t.hasOwnProperty("name")&&t.hasOwnProperty("unit"))))}catch(t){console.error("validateMeasureList: failed to parse JSON",t)}return["Invalid JSON structure"]}function P(t){const e=Date.parse(t);return Number.isInteger(e)}function Q(t){return(null==t?void 0:t.toUpperCase())in M}function H(t){return(null==t?void 0:t.toUpperCase())in A}function R(t){return(null==t?void 0:t.toUpperCase())in v}function V(t){return!x(t)&&(null==t?void 0:t.toUpperCase())in y}function U(t){return!x(t)&&["true","false",!0,!1].some((e=>e===t))}function Y(t){return!x(t)&&(null==t?void 0:t.toUpperCase())in p}function Z(t){if(x(t))return[];try{const e=JSON.parse(t);if(e instanceof Array)return e.filter((t=>!(t.hasOwnProperty("rowGroup")&&t.hasOwnProperty("category")&&t.hasOwnProperty("subCategory"))))}catch(t){console.error("validateThereOfJsonStr: failed to parse JSON",t)}return["Invalid JSON structure"]}function X(t){if(x(t))return[];try{const e=JSON.parse(t);if(e instanceof Array)return e.filter((t=>!(t.hasOwnProperty("rowGroup")&&t.hasOwnProperty("category"))))}catch(t){console.error("validatePartOfJsonStr: failed to parse JSON",t)}return["Invalid JSON structure"]}function tt(t){return(null==t?void 0:t.trim().toUpperCase())in f}function et(t){return["_","k","M","G","T","P","E","Z","Y","m","μ","n","p","P","f","a","z","y"].includes(null==t?void 0:t.trim())||["GREATEST","LEAST"].includes(null==t?void 0:t.trim().toUpperCase())}function rt(t){return(null==t?void 0:t.toUpperCase().trim())in b}function nt(t){return(null==t?void 0:t.toUpperCase().trim())in g}function st(t){if(x(t))return[];try{return JSON.parse(t).filter((t=>!(t.hasOwnProperty("scenario")&&t.hasOwnProperty("name")&&t.hasOwnProperty("subGroups"))))}catch(t){console.error("validateColumnThereOfJsonStr: failed to parse JSON",t)}return["Invalid JSON structure"]}function at(t){if(x(t))return[];try{const e=JSON.parse(t);if("object"!=typeof e||null===e||Array.isArray(e))return["stack: must be a JSON object"];const r=[];if(e.hasOwnProperty("by")){const t=["scenarios","dimensions"];t.includes(e.by)||r.push(`stack: 'by' must be one of: ${t.join(", ")}`)}else r.push("stack: 'by' is required");if(e.hasOwnProperty("mode")){const t=["absolute","relative","absolute-relative"];t.includes(e.mode)||r.push(`stack: 'mode' must be one of: ${t.join(", ")}`)}if(e.hasOwnProperty("order")){const t=["asc","desc","dataset"];t.includes(e.order)||r.push(`stack: 'order' must be one of: ${t.join(", ")}`)}return r}catch(t){return["stack: invalid JSON"]}}class it{constructor(){this.cache=new Map,this.tag=it.makeStyleTag()}static makeStyleTag(){const t=document.createElement("style");return t.type="text/css",t.setAttribute("data-bn-computed-style",""),t.append(document.createTextNode("")),(document.head||document.querySelector("head")).append(t),t}apply(t){t.forEach((t=>this.cache.set(t.className,t.style))),this.tag.innerHTML=Array.from(this.cache.values()).map((t=>t)).join("\n")}}const ot=new it;function ct(t){for(var e,r=0,n=0,s=t.length;s>=4;++n,s-=4)e=1540483477*(65535&(e=255&t.charCodeAt(n)|(255&t.charCodeAt(++n))<<8|(255&t.charCodeAt(++n))<<16|(255&t.charCodeAt(++n))<<24))+(59797*(e>>>16)<<16),r=1540483477*(65535&(e^=e>>>24))+(59797*(e>>>16)<<16)^1540483477*(65535&r)+(59797*(r>>>16)<<16);switch(s){case 3:r^=(255&t.charCodeAt(n+2))<<16;case 2:r^=(255&t.charCodeAt(n+1))<<8;case 1:r=1540483477*(65535&(r^=255&t.charCodeAt(n)))+(59797*(r>>>16)<<16)}return(((r=1540483477*(65535&(r^=r>>>13))+(59797*(r>>>16)<<16))^r>>>15)>>>0).toString(36)}const ut=t=>_(t)?`${t}px`:t,lt={width:{className:"w",cssName:"width",attrName:"width",transform:ut},height:{className:"h",cssName:"height",attrName:"height",transform:ut},position:{className:"pst",cssName:"position",attrName:"position"},top:{className:"top",cssName:"top",attrName:"top",transform:ut},right:{className:"rgt",cssName:"right",attrName:"right",transform:ut},bottom:{className:"btm",cssName:"bottom",attrName:"bottom",transform:ut},left:{className:"lft",cssName:"left",attrName:"left",transform:ut},"font-size":{className:"fts",cssName:"font-size",attrName:"font-size",transform:ut},"grid-column":{className:"gdc",cssName:"grid-column",attrName:"grid-column"},"grid-row":{className:"gdr",cssName:"grid-row",attrName:"grid-row"}},dt=Object.keys(lt);function ft(t,e){const r=function(t,e){const r=ct(e);return`bn-c-${t.className}_${r}`}(t,e),n=function(t,e,r){return`.${e} {${t.cssName}: ${r};}`}(t,r,e);return{className:r,style:n}}const mt=t=>{const e=new Map;return dt.forEach((r=>{const n=t.getAttribute(r);n&&(["top","left","right","bottom"].includes(r)&&e.set("position",ft(lt.position,"absolute")),e.set(r,ft(lt[r],(lt[r].transform||function(t){return t})(n))))})),e},ht=new MutationObserver((t=>{for(const r of t){const t=r.target,n=mt(t);ot.apply(n);const s=Array.from(n.values()).map((t=>t.className));t.className=t.className.split(" ").filter((t=>!t.startsWith("bn-c-"))).concat(...s).join(" "),e(t)}})),yt=e=>{const r=e.connectedCallback,n=e.disconnectedCallback;e.connectedCallback=()=>{const n=t(e);if(!n)throw new Error("Can't find element field in component undefined");(t=>{const e=mt(t);ot.apply(e);const r=Array.from(e.values()).map((t=>t.className));t.className=t.className.split(" ").filter((t=>!t.startsWith("bn-c-"))).concat(...r).join(" "),ht.observe(t,{attributes:!0,attributeFilter:dt,childList:!1,subtree:!1})})(n),a(r,e)},e.disconnectedCallback=()=>{a(n,e)}};export{N as A,rt as B,D as C,A as D,st as E,y as F,w as G,g as H,d as I,B as J,P as K,Q as L,f as M,M as N,F as O,L as P,j as Q,q as R,k as S,b as T,E as U,l as a,_ as b,$ as c,z as d,C as e,K as f,W as g,et as h,U as i,at as j,x as k,J as l,O as m,T as n,H as o,R as p,v as q,ct as r,nt as s,V as t,Y as u,G as v,yt as w,Z as x,X as y,tt as z}
@@ -1 +0,0 @@
1
- import{g as t,c as e}from"./p-DHheVOfP.js";import{r as o}from"./p-B4JfKvVT.js";import{g as n,f as a}from"./p-B_d-jp99.js";const s=(t,e)=>{const o=[],n=[];for(const a of e)(t(a)?o:n).push(a);return[o,n]},r="WARN_use_dataset",i=(t,e)=>{const o=t.errors;if(o)if(e.length>0){const t=e.map((t=>t.substring(1))).join(", ");o.addOrReplace({id:r,type:"warning",message:`Using datasource(s) "${t}" directly. Prefer using a dataset (bn-dataset) for query support and metadata.`})}else o.remove(r)},l=(a,r,l)=>{let c,u,d=[],f=[],p=[];const m=(t,e)=>{const o=e?t.substring(1):t;let n;try{n=u.db.db.exec(`SELECT * FROM \`${o}\``)}catch(t){n=[]}r(t,n)},h=()=>{d.forEach((t=>t())),d=[],f.forEach((t=>{t&&(d.push(u.db.subscribe(t,(()=>m(t,!1)))),m(t,!1),(t=>{if(l){const e=u.datasetsMeta.get(t);e&&l(t,e)}})(t))})),p.forEach((t=>{t&&(d.push(u.db.subscribe(t.substring(1),(()=>m(t,!0)))),m(t,!0))}))},v=new MutationObserver((t=>{t.forEach((t=>{"datasets"===t.attributeName&&([p,f]=s((t=>t.startsWith("$")),n(a).getAttribute("datasets").split(",")),i(a,p),h())}))})),g=a.connectedCallback;a.connectedCallback=()=>{const e=n(a);u=t(e),[p,f]=s((t=>t.startsWith("$")),(e.getAttribute("datasets")||"").split(",")),i(a,p),h(),v.observe(e,{attributes:!0,attributeFilter:["datasets"]}),l&&(c=u.datasetsMeta.on("set",((t,e)=>{f.includes(t)&&l(t,e)}))),o(g,a)};const w=a.disconnectedCallback;return a.disconnectedCallback=()=>{v.disconnect(),d.forEach((t=>t())),d=[],o(c),e(n(a)),o(w,a)},t=>{f=t,h()}},c=s=>{let r,i,l;const c=new MutationObserver((t=>{t.forEach((t=>{"namespace"===t.attributeName&&(i=n(s).getAttribute("namespace"),a(s))}))})),u=s.connectedCallback;s.connectedCallback=()=>{const e=n(s);l=t(e),c.observe(e,{attributes:!0,attributeFilter:["namespace"]}),i=n(s).getAttribute("namespace"),r=l.internationalization.on("set",(t=>{t===i&&a(s)})),o(u,s)};const d=s.disconnectedCallback;return s.disconnectedCallback=()=>{c.disconnect(),o(r),e(n(s)),o(d,s)},{t:(t,e)=>{var o,a;t.startsWith(".")&&(t=n(s).localName+t);const r=l.internationalization.state,c=l.context.state.locale;let u=i;return null==(null===(a=null===(o=r[u])||void 0===o?void 0:o[c])||void 0===a?void 0:a[t])&&(u="_system"),r[u][c][t].replace(/{{([\s\S]+?)}}/g,((t,o)=>{var n;return null!==(n=null==e?void 0:e[o.trim()])&&void 0!==n?n:""}))}}};function u(t,e=!1){const o=d(t);if(!o)return e&&console.log("[parentDims] no layout parent found for",t.tagName),{width:0,height:0};const n=getComputedStyle(o),a=o.clientWidth-parseFloat(n.paddingLeft)-parseFloat(n.paddingRight),s=function(t,e=!1){let o=d(t),n=0;for(;o;){const t=getComputedStyle(o),a=t.overflowY;if(e&&console.log(`[height:${n}]`,o.tagName,o.className||"(no class)",`overflow=${a} clientH=${o.clientHeight} h=${t.height}`),"hidden"===a||"scroll"===a||"auto"===a){const a=o.clientHeight-parseFloat(t.paddingTop)-parseFloat(t.paddingBottom);return e&&console.log(`[height] FOUND constrained at depth ${n}: ${Math.round(a)}px`),a}if("none"!==t.maxHeight){const e=parseFloat(t.maxHeight);if(!isNaN(e)&&e>0)return Math.min(e,o.clientHeight-parseFloat(t.paddingTop)-parseFloat(t.paddingBottom))}o=f(o),n++}return e&&console.log("[height] NO constrained ancestor → viewport fallback"),"undefined"!=typeof window?window.innerHeight:0}(t,e);return e&&console.log("[parentDims]",t.tagName,"→ layoutParent:",o.tagName,o.className||"(no class)",`clientW=${o.clientWidth} → w=${Math.round(a)}, h=${Math.round(s)}`,"overflow:",n.overflow),{width:Math.max(0,a),height:Math.max(0,s)}}function d(t){var e;const o=t.parentElement;return(null===(e=null==o?void 0:o.assignedSlot)||void 0===e?void 0:e.parentElement)?o.assignedSlot.parentElement:o}function f(t){var e;return(null===(e=t.assignedSlot)||void 0===e?void 0:e.parentElement)?t.assignedSlot.parentElement:t.parentElement}function p(t){if(null==t||""===t)return{mode:"empty"};if("none"===t)return{mode:"none"};if("auto"===t)return{mode:"auto"};const e=Number(t);return!isNaN(e)&&e>0?{mode:"factor",factor:e}:{mode:"empty"}}export{l as a,u as g,p,c as w}
@@ -1 +0,0 @@
1
- import{r as t,h as e,H as i,g as o}from"./p-B_d-jp99.js";import{w as n,a as s,g as a,p as r}from"./p-CQnZV3JG.js";import{w as l,a as d}from"./p-B4JfKvVT.js";import{w as c,a as h}from"./p-BVFHvEXF.js";import"./p-DHheVOfP.js";const v=new Set(["br","b","i","strong","em","span","p","div","table","tr","td","th","thead","tbody","tfoot","ul","ol","li","h1","h2","h3","h4","h5","h6","sub","sup","small","hr","a","img"]),f=new Set(["class","style","colspan","rowspan","href","title","src","alt","width","height"]),u=/\b(__proto__|globalThis)\b|\.constructor\b/;function p(t){const e=document.createElement("div");return e.innerHTML=t,b(e),e.innerHTML}function b(t){for(const e of Array.from(t.childNodes)){if(e.nodeType!==Node.ELEMENT_NODE)continue;const i=e;if(v.has(i.tagName.toLowerCase())){for(const t of Array.from(i.attributes)){const e=t.name.toLowerCase();e.startsWith("on")||!f.has(e)?i.removeAttribute(t.name):"href"!==e&&"src"!==e||!/^\s*javascript:/i.test(t.value)?"style"===e&&/expression|javascript/i.test(t.value)&&i.removeAttribute(t.name):i.removeAttribute(t.name)}b(i)}else t.replaceChild(document.createTextNode(i.textContent||""),i)}}const m=class{constructor(e){t(this,e),this.data={},c(this),l(this),this.errors=d(this),this.t=n(this).t,s(this,((t,e)=>{this.data=Object.assign(Object.assign({},this.data),{[t]:e})})),this.componentStyle=h(this)}validateValue(t){"string"!=typeof t||""===t?this.errors.addOrReplace({id:"no_value",type:"warning",message:"Empty value"}):this.errors.remove("no_value")}validateScaling(t){if(null==t||""===t||"none"===t||"auto"===t)return void this.errors.remove("ERR_scale");const e=Number(t);isNaN(e)||e<=0?this.errors.addOrReplace({id:"ERR_scale",type:"warning",message:`Invalid scale value: "${t}". Use "none", "auto", or a positive number.`}):this.errors.remove("ERR_scale")}componentWillLoad(){this.validateValue(this.value),this.validateScaling(this.scale)}evalTemplate(t){if(!t)return"";if(u.test(t))return this.errors.addOrReplace({id:"ERR_value_eval",type:"error",message:"Template contains forbidden pattern"}),"";try{const e=new Proxy({data:this.data,t:this.t},{has:()=>!0,get:(t,e)=>e===Symbol.unscopables?void 0:t[e],set:()=>!0}),i=new Function("sandbox","with(sandbox){try{return`"+t+'`}catch(e){return""}}').call(e,e);return this.errors.remove("ERR_value_eval"),null!=i?String(i):""}catch(t){return this.errors.addOrReplace({id:"ERR_value_eval",type:"error",message:`Template evaluation failed: ${t instanceof Error?t.message:String(t)}`}),""}}prepareStyle(){return this.componentStyle((t=>{var e,i,o,n,s,a,r,l,d,c,h,v,f,u,p,b,m,g,y,w,_,$;return{fontStyles:{font:`${null!==(n=null!==(i=null===(e=t["bn-text"])||void 0===e?void 0:e.fontSizePx)&&void 0!==i?i:null===(o=t.global)||void 0===o?void 0:o.fontSizePx)&&void 0!==n?n:13.3333}px ${null!==(l=null!==(a=null===(s=t["bn-text"])||void 0===s?void 0:s.fontFamily)&&void 0!==a?a:null===(r=t.global)||void 0===r?void 0:r.fontFamily)&&void 0!==l?l:"'Noto Sans', sans-serif"}`,size:null!==(v=null!==(c=null===(d=t["bn-text"])||void 0===d?void 0:d.fontSizePx)&&void 0!==c?c:null===(h=t.global)||void 0===h?void 0:h.fontSizePx)&&void 0!==v?v:13.3333,color:null!==(b=null!==(u=null===(f=t["bn-text"])||void 0===f?void 0:f.fontColor)&&void 0!==u?u:null===(p=t.global)||void 0===p?void 0:p.fontColor)&&void 0!==b?b:"#000000",background:null!==(w=null!==(g=null===(m=t["bn-text"])||void 0===m?void 0:m.fontBackgroundColor)&&void 0!==g?g:null===(y=t.global)||void 0===y?void 0:y.fontBackgroundColor)&&void 0!==w?w:"#ffffff",leading:null!==($=null===(_=t["bn-text"])||void 0===_?void 0:_.leading)&&void 0!==$?$:1.8}}}))}applyScaling(t){const e=this.element,{mode:i,factor:o}=r(this.scale),{width:n,height:s}=a(e),l=e.scrollHeight>e.clientHeight+1?e.clientHeight:s,d=n,c=d>0&&e.scrollWidth>d+1,h=l>0&&e.scrollHeight>l+1,v=c||h;if(d<=0&&l<=0)return;if("none"===i){if(v){const t=[];c&&t.push(`w:${e.scrollWidth}>${Math.round(d)}`),h&&t.push(`h:${e.scrollHeight}>${Math.round(l)}`),this.errors.addOrReplace({id:"WARN_overflow",type:"warning",message:`Content overflows container (${t.join(", ")})`})}else this.errors.remove("WARN_overflow");return}if("factor"===i){if(v){const t=[];c&&t.push(`w:${e.scrollWidth}>${Math.round(d)}`),h&&t.push(`h:${e.scrollHeight}>${Math.round(l)}`),this.errors.addOrReplace({id:"WARN_overflow",type:"warning",message:`Content overflows with factor ${o} (${t.join(", ")})`})}else this.errors.remove("WARN_overflow");return}e.style.setProperty("--bn-font-size",`${t}px`);const f=e.scrollWidth,u=e.scrollHeight,p=e.clientHeight,b=u>p+1?p:s,m=d<=0||f<=d+1,g=b<=0||u<=b+1;if(m&&g)return void this.errors.remove("AUTO_scale");const y=Math.min(1,!m&&d>0?d/f:1,!g&&b>0?b/u:1);e.style.setProperty("--bn-font-size",t*y+"px"),"empty"===i?this.errors.addOrReplace({id:"AUTO_scale",type:"warning",message:`Auto-scaled font by factor ${y.toFixed(3)}`}):this.errors.remove("AUTO_scale")}componentDidRender(){this.container.innerHTML=p(this.evalTemplate(this.value)),this.applyScaling(this.prepareStyle().fontStyles.size)}render(){const{fontStyles:t}=this.prepareStyle(),{mode:o,factor:n}=r(this.scale),s="factor"===o?t.size*n+"px":`${t.size}px`,a={"--bn-font-family":t.font.substring(t.font.indexOf("px ")+3),"--bn-font-size":s,"--bn-font-color":t.color,"--bn-font-background":t.background};return e(i,{key:"086c3caad1f7c502e26ebbd1bf7d9044782333ab",style:a},e("div",{key:"584938536bedd3de7a6390ce9d57fb568a69191b"},e("span",{key:"b545bd809b32d2d0cac2310bd1003dab39bebc8a",class:"container",ref:t=>{this.container=t}})))}get element(){return o(this)}static get watchers(){return{value:[{validateValue:0}],scale:[{validateScaling:0}]}}};m.style=':host{padding:0.5em;display:inline-block;position:relative;overflow:hidden;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000);background-color:var(--bn-font-background, white)}span.container p{margin:0}';export{m as bn_text}