@bino-bi/bn-template-engine 1.0.0-next.39 → 1.0.0-next.41

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-2dd69cb9.entry.js +1 -0
  3. package/dist/bn-template-engine/{p-9a61f59d.entry.js → p-8b28c9bd.entry.js} +1 -1
  4. package/dist/bn-template-engine/{p-DyupX-Z-.js → p-BjozxTTW.js} +1 -1
  5. package/dist/bn-template-engine/p-EcC0qLtU.js +1 -0
  6. package/dist/bn-template-engine/{p-eea538f1.entry.js → p-a4b76176.entry.js} +1 -1
  7. package/dist/bn-template-engine/{p-93b8387f.entry.js → p-ce764078.entry.js} +1 -1
  8. package/dist/cjs/bn-annotation-layer_30.cjs.entry.js +785 -378
  9. package/dist/cjs/bn-grid.cjs.entry.js +1 -1
  10. package/dist/cjs/bn-image.cjs.entry.js +1 -1
  11. package/dist/cjs/bn-template-engine.cjs.js +1 -1
  12. package/dist/cjs/bn-text.cjs.entry.js +2 -2
  13. package/dist/cjs/loader.cjs.js +1 -1
  14. package/dist/cjs/{withStyled-DfE0aW7D.js → withStyled-BZb6snOx.js} +74 -0
  15. package/dist/cjs/{withTranslation-0gkn9xoC.js → withTranslation-FxXGUB3H.js} +1 -1
  16. package/dist/collection/components/bn-chart-structure/utils/StructureChart.js +4 -1
  17. package/dist/collection/components/bn-chart-structure/utils/elements/Label.js +3 -1
  18. package/dist/collection/components/bn-chart-time/utils/elements/Label.js +3 -1
  19. package/dist/collection/components/bn-table/bn-table-renderer/bn-table-renderer.css +25 -1
  20. package/dist/collection/components/bn-table/bn-table-renderer/bn-table-renderer.js +156 -11
  21. package/dist/collection/components/bn-table/bn-table.js +134 -5
  22. package/dist/collection/components/bn-table/utils/elements/Cell.js +10 -1
  23. package/dist/collection/components/bn-table/utils/elements/CellBarChart.js +25 -10
  24. package/dist/collection/components/bn-table/utils/elements/WaterfallBar.js +50 -12
  25. package/dist/collection/components/bn-table/utils/factories/tableDataSetFactory.js +44 -14
  26. package/dist/collection/components/bn-table/utils/helper/DataQuery.js +63 -2
  27. package/dist/collection/components/bn-table/utils/helper/WaterfallCalculator.js +123 -11
  28. package/dist/collection/components/bn-table/utils/helper/barColumnGeometry.js +57 -9
  29. package/dist/collection/components/bn-table/utils/model/TableComponentConfig.js +16 -1
  30. package/dist/collection/components/bn-table/utils/model/index.js +6 -0
  31. package/dist/collection/utils/validate.js +4 -0
  32. package/dist/components/bn-chart-bubble-renderer.js +1 -1
  33. package/dist/components/bn-chart-bubble.js +1 -1
  34. package/dist/components/bn-chart-bullet.js +1 -1
  35. package/dist/components/bn-chart-scatter-renderer.js +1 -1
  36. package/dist/components/bn-chart-scatter.js +1 -1
  37. package/dist/components/bn-chart-structure-renderer.js +1 -1
  38. package/dist/components/bn-chart-structure.js +1 -1
  39. package/dist/components/bn-chart-time-renderer.js +1 -1
  40. package/dist/components/bn-chart-time.js +1 -1
  41. package/dist/components/bn-grid.js +1 -1
  42. package/dist/components/bn-image.js +1 -1
  43. package/dist/components/bn-layout-card.js +1 -1
  44. package/dist/components/bn-layout-page.js +1 -1
  45. package/dist/components/bn-page.js +1 -1
  46. package/dist/components/bn-table-renderer.js +1 -1
  47. package/dist/components/bn-table.js +1 -1
  48. package/dist/components/bn-text.js +1 -1
  49. package/dist/components/bn-title.js +1 -1
  50. package/dist/components/bn-tree.js +1 -1
  51. package/dist/components/p-1B_s8oPY.js +1 -0
  52. package/dist/components/{p-BqUB56k1.js → p-B4L069XF.js} +1 -1
  53. package/dist/components/p-BZXiWkDS.js +1 -0
  54. package/dist/components/p-BiSytXUy.js +1 -0
  55. package/dist/components/p-Bn7J1pgl.js +1 -0
  56. package/dist/components/{p-BmOWXYHF.js → p-CEf5X8MZ.js} +1 -1
  57. package/dist/components/p-CGySoYRH.js +1 -0
  58. package/dist/components/{p-Cyf5ZEXs.js → p-CUSAlS2o.js} +1 -1
  59. package/dist/components/p-CvEdUq8i.js +1 -0
  60. package/dist/components/{p-OquycEMA.js → p-D40Am1Ap.js} +1 -1
  61. package/dist/components/{p-B4Cf0cVi.js → p-DM4Up10X.js} +1 -1
  62. package/dist/components/{p-Bo_R7f_T.js → p-DwuXVo2h.js} +1 -1
  63. package/dist/components/{p-DTmqMQpw.js → p-Y9bth2Y_.js} +1 -1
  64. package/dist/components/{p-BU_53KVT.js → p-xIWChKGS.js} +1 -1
  65. package/dist/esm/bn-annotation-layer_30.entry.js +903 -496
  66. package/dist/esm/bn-grid.entry.js +1 -1
  67. package/dist/esm/bn-image.entry.js +1 -1
  68. package/dist/esm/bn-template-engine.js +1 -1
  69. package/dist/esm/bn-text.entry.js +2 -2
  70. package/dist/esm/loader.js +1 -1
  71. package/dist/esm/{withStyled-CIoJ86RM.js → withStyled-CzzXg64f.js} +77 -4
  72. package/dist/esm/{withTranslation-BX9T3dfm.js → withTranslation-Daq2JXkv.js} +1 -1
  73. package/dist/types/components/bn-table/bn-table-renderer/bn-table-renderer.d.ts +20 -1
  74. package/dist/types/components/bn-table/bn-table.d.ts +49 -1
  75. package/dist/types/components/bn-table/utils/elements/Cell.d.ts +3 -0
  76. package/dist/types/components/bn-table/utils/elements/CellBarChart.d.ts +26 -0
  77. package/dist/types/components/bn-table/utils/elements/WaterfallBar.d.ts +22 -2
  78. package/dist/types/components/bn-table/utils/helper/DataQuery.d.ts +13 -0
  79. package/dist/types/components/bn-table/utils/helper/WaterfallCalculator.d.ts +30 -2
  80. package/dist/types/components/bn-table/utils/helper/barColumnGeometry.d.ts +24 -4
  81. package/dist/types/components/bn-table/utils/model/TableComponentConfig.d.ts +7 -1
  82. package/dist/types/components/bn-table/utils/model/index.d.ts +5 -0
  83. package/dist/types/components.d.ts +49 -4
  84. package/dist/types/utils/validate.d.ts +1 -0
  85. package/package.json +1 -1
  86. package/dist/bn-template-engine/p-8c84d57e.entry.js +0 -1
  87. package/dist/bn-template-engine/p-BVU4bIsi.js +0 -1
  88. package/dist/components/p-BsJOvfIg.js +0 -1
  89. package/dist/components/p-DCPLGEs_.js +0 -1
  90. package/dist/components/p-DT04Cka0.js +0 -1
  91. package/dist/components/p-Dm6EAaJ9.js +0 -1
  92. package/dist/components/p-dRPJiQB6.js +0 -1
  93. package/dist/components/p-tkB96Ena.js +0 -1
@@ -1 +1 @@
1
- import{r as t,h as s,a as i,g as o}from"./p-CCZcKl0Q.js";import{w as n,a as e}from"./p-BVU4bIsi.js";import{w as r,a,g as l}from"./p-D0tNATZq.js";const h=class{constructor(s){t(this,s),n(this),r(this),this.errors=a(this),this.componentStyle=e(this)}connectedCallback(){this.stores=l(this.element)}getFontStyles(){return this.componentStyle((t=>{var s,i,o,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===(o=t.global)||void 0===o?void 0:o.fontColor)||"#000000","--bn-font-background":(null===(n=t.global)||void 0===n?void 0:n.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:"b303581057c183cc27eb13cfdc389c6b008e9172",style:this.getFontStyles()},null!=this.source&&""!==this.source?s("img",{src:this.prepareAssetUrl(this.source)}):"")}get element(){return o(this)}};h.style=":host{display:inline-block;position:relative;overflow:hidden}img{max-width:100%;height:auto}";export{h as bn_image}
1
+ import{r as t,h as s,a as i,g as o}from"./p-CCZcKl0Q.js";import{w as n,a as e}from"./p-EcC0qLtU.js";import{w as r,a,g as l}from"./p-D0tNATZq.js";const h=class{constructor(s){t(this,s),n(this),r(this),this.errors=a(this),this.componentStyle=e(this)}connectedCallback(){this.stores=l(this.element)}getFontStyles(){return this.componentStyle((t=>{var s,i,o,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===(o=t.global)||void 0===o?void 0:o.fontColor)||"#000000","--bn-font-background":(null===(n=t.global)||void 0===n?void 0:n.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:"b303581057c183cc27eb13cfdc389c6b008e9172",style:this.getFontStyles()},null!=this.source&&""!==this.source?s("img",{src:this.prepareAssetUrl(this.source)}):"")}get element(){return o(this)}};h.style=":host{display:inline-block;position:relative;overflow:hidden}img{max-width:100%;height:auto}";export{h as bn_image}
@@ -1 +1 @@
1
- import{g as t,r as n,c as e,R as o}from"./p-D0tNATZq.js";import{g as r,f as i}from"./p-CCZcKl0Q.js";import{i as s}from"./p-BVU4bIsi.js";const a=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","code","pre","blockquote","del"]),l=new Set(["class","style","colspan","rowspan","href","title","src","alt","width","height"]),u=new Set(["http:","https:","mailto:"]),c=/^\s*text-align:\s*(left|center|right)\s*;?\s*$/i;function d(t){if(!t)return"";const n=(new DOMParser).parseFromString(t,"text/html").body;return f(n),n.innerHTML}function f(t){for(const n of Array.from(t.childNodes)){if(n.nodeType===Node.TEXT_NODE)continue;const e=n;if(n.nodeType!==Node.ELEMENT_NODE||!a.has(e.localName)){t.removeChild(n);continue}for(const t of Array.from(e.attributes)){const n=t.name.toLowerCase();l.has(n)&&("href"!==n&&"src"!==n||v(n,t.value))||e.removeAttribute(t.name)}const o=e.getAttribute("style");null===o||c.test(o)||e.removeAttribute("style"),f(e)}}function v(t,n){try{const{protocol:e}=new URL(n,"http://a");return u.has(e)||"src"===t&&"data:"===e}catch(t){return!1}}function h(t,n=!1){const e=p(t);if(!e)return n&&console.log("[parentDims] no layout parent found for",t.tagName),{width:0,height:0};const o=getComputedStyle(e),r=e.clientWidth-parseFloat(o.paddingLeft)-parseFloat(o.paddingRight),i=function(t,n=!1){let e=p(t),o=0,r=null,i=1;for(;e;){if(e.hasAttribute("data-bn-fit-content")){n&&console.log(`[height:${o}]`,e.tagName,"fit-content region → discarding inner candidate"),r=null;const t=parseInt(e.getAttribute("data-bn-fit-content"),10);!isNaN(t)&&t>1&&(i*=t),e=m(e),o++;continue}const t=getComputedStyle(e),s=t.overflowY;if(n&&console.log(`[height:${o}]`,e.tagName,e.className||"(no class)",`overflow=${s} clientH=${e.clientHeight} h=${t.height}`),null===r)if("hidden"===s||"scroll"===s||"auto"===s)r=e.clientHeight-parseFloat(t.paddingTop)-parseFloat(t.paddingBottom),n&&console.log(`[height] candidate at depth ${o}: ${Math.round(r)}px`);else if("none"!==t.maxHeight){const n=parseFloat(t.maxHeight);!isNaN(n)&&n>0&&(r=Math.min(n,e.clientHeight-parseFloat(t.paddingTop)-parseFloat(t.paddingBottom)))}e=m(e),o++}return null!==r?r/i:(n&&console.log("[height] NO constrained ancestor → viewport fallback"),"undefined"!=typeof window?window.innerHeight/i:0)}(t,n);return n&&console.log("[parentDims]",t.tagName,"→ layoutParent:",e.tagName,e.className||"(no class)",`clientW=${e.clientWidth} → w=${Math.round(r)}, h=${Math.round(i)}`,"overflow:",o.overflow),{width:Math.max(0,r),height:Math.max(0,i)}}function p(t){var n;const e=t.parentElement;return(null===(n=null==e?void 0:e.assignedSlot)||void 0===n?void 0:n.parentElement)?e.assignedSlot.parentElement:e}function m(t){var n;if(null===(n=t.assignedSlot)||void 0===n?void 0:n.parentElement)return t.assignedSlot.parentElement;if(t.parentElement)return t.parentElement;const e=t.getRootNode();return e instanceof ShadowRoot?e.host:null}function b(t,n){const e=t.getBoundingClientRect(),o=t.offsetHeight>0?e.height/t.offsetHeight:0;if(!(o>0)||Math.abs(o-(t.offsetWidth>0?e.width/t.offsetWidth:0))>.01*o)return 0;const r=e.top+n*o;let i=0;for(let n=t;n;n=m(n)){const t=getComputedStyle(n).overflowY;if("hidden"===t||"clip"===t)i=Math.max(i,r-n.getBoundingClientRect().bottom);else if(("auto"===t||"scroll"===t)&&n.scrollHeight>n.clientHeight+1)break}return i/o}const g=(t,n)=>Math.round(t*n*100)/100;function w(t){if(null==t||""===t)return{mode:"empty"};if("none"===t)return{mode:"none"};if("auto"===t)return{mode:"auto"};const n=Number(t);return!isNaN(n)&&n>0?{mode:"factor",factor:n}:{mode:"empty"}}const y={k:1e3,K:1e3,M:1e6,G:1e9,T:1e12},$=/^(\d+(?:\.\d+)?|\.\d+)\s*([kKMGT])?$/;function M(t){var n;if("number"==typeof t)return Number.isFinite(t)&&t>0?{kind:"number",value:t}:{kind:"invalid",raw:String(t)};const e=null!==(n=null==t?void 0:t.toString().trim())&&void 0!==n?n:"";if("auto"===e.toLowerCase())return{kind:"auto"};const o=$.exec(e);if(o){const t=Number(o[1])*(o[2]?y[o[2]]:1);if(Number.isFinite(t)&&t>0)return{kind:"number",value:t}}return{kind:"invalid",raw:e}}function k(t,n){const e=M(t);if("auto"===e.kind)return{kind:"auto"};if("string"==typeof t){const e=t.trim();if(n.has(e))return{kind:"value",value:n.get(e)}}return"number"===e.kind?{kind:"value",value:e.value}:{kind:"invalid",raw:e.raw}}const N=[[1e12,"T"],[1e9,"G"],[1e6,"M"],[1e3,"k"]];function S(t){if(!Number.isFinite(t)||t<=0)return String(t);const n=t=>String(Number(t.toPrecision(3)));for(const[e,o]of N)if(t>=e)return`${n(t/e)}${o}`;return n(t)}const F="WARN_datasets",R=(o,i,s)=>{let a,l,u=[],c=[],d=[],f="";const v=()=>{const t=f;f=o.datasets||"",""!==t&&t!==f&&i("",[]),[d,c]=((t,n)=>{const e=[],o=[];for(const t of n)(r=t,r.startsWith("$")?e:o).push(t);var r;return[e,o]})(0,f.split(",")),((t,n)=>{const e=t.errors;if(e)if(n.length>0){const t=n.map((t=>t.substring(1))).join(", ");e.addOrReplace({id:F,type:"warning",message:`Using datasource(s) "${t}" directly. Prefer using a dataset (bn-dataset) for query support and metadata.`})}else e.remove(F)})(o,d),p()},h=(t,n)=>{const e=n?t.substring(1):t;let o;try{o=l.db.db.exec(`SELECT * FROM \`${e}\``)}catch(t){o=[]}i(t,o)},p=()=>{u.forEach((t=>t())),u=[],c.forEach((t=>{t&&(u.push(l.db.subscribe(t,(()=>h(t,!1)))),h(t,!1),(t=>{if(s){const n=l.datasetsMeta.get(t);n&&s(t,n)}})(t))})),d.forEach((t=>{t&&(u.push(l.db.subscribe(t.substring(1),(()=>h(t,!0)))),h(t,!0))}))},m=new MutationObserver((t=>{t.forEach((t=>{"datasets"===t.attributeName&&(o.datasets||"")!==f&&v()}))})),b=o.connectedCallback;o.connectedCallback=()=>{const e=r(o);l=t(e),v(),m.observe(e,{attributes:!0,attributeFilter:["datasets"]}),s&&(a=l.datasetsMeta.on("set",((t,n)=>{c.includes(t)&&s(t,n)}))),n(b,o)};const g=o.disconnectedCallback;return o.disconnectedCallback=()=>{m.disconnect(),u.forEach((t=>t())),u=[],n(a),e(r(o)),n(g,o)},t=>{c=t,p()}},O="inherited-page",C="bn-layout-page";function T(t){return"inherited-closest"===t||t===O}function j(t,n){const e=[];let o=t.parentNode;for(;o;){const t=o.nodeName.toLowerCase();if(t===C){e.push(o);break}if("bn-layout-card"===t&&n!==O&&e.push(o),o.parentNode)o=o.parentNode;else{if(!(o instanceof ShadowRoot))break;o=o.host}}return e}function A(t,n){var e;const o=t=>{const e=t.getAttribute(n),o=null==e?void 0:e.trim();return s(o)||T(o)?void 0:e};for(const r of t){if((null===(e=r.getAttribute(n))||void 0===e?void 0:e.trim())===O){const n=t.find((t=>t.nodeName.toLowerCase()===C)),e=n&&o(n);if(void 0!==e)return e;continue}const i=o(r);if(void 0!==i)return i}}const x=(t,e,o)=>{const s=new Map,a=new Map;let l=null;const u=()=>{var n;const o=r(t);s.clear(),a.clear(),l&&(l.disconnect(),l=null);const c=new Map;for(const r of e){const e=t[r.propName];if("string"!=typeof e||!T(e))continue;a.set(r.propName,e);const i=j(o,e),l=A(i,r.ancestorAttr);void 0!==l&&s.set(r.propName,l);for(const t of i)c.set(t,[...null!==(n=c.get(t))&&void 0!==n?n:[],r.ancestorAttr])}if(c.size>0){l=new MutationObserver((()=>{u(),i(t)}));for(const[t,n]of c)l.observe(t,{attributes:!0,attributeFilter:n})}},c=t.connectedCallback;t.connectedCallback=()=>{u(),n(c,t)};const d=t.disconnectedCallback;t.disconnectedCallback=()=>{l&&(l.disconnect(),l=null),s.clear(),a.clear(),n(d,t)};const f=t=>{var n;return null===(n=e.find((n=>n.propName===t)))||void 0===n?void 0:n.ancestorAttr.replace(/-(\w)/g,((t,n)=>n.toUpperCase()))};return(t,n,e)=>{const r=`WARN_inherited_${t}`,i=T(n);i&&a.get(t)!==n&&u();const l=i?s.get(t):void 0;return i&&void 0===l?(null==o||o.addOrReplace({id:r,type:"warning",message:`${t}: '${n}' could not be resolved, no surrounding ${n===O?"page":"card or page"} sets ${f(t)}`}),{value:e,inherited:!1,unresolved:!0}):(null==o||o.remove(r),{value:null!=l?l:n,inherited:void 0!==l,unresolved:!1})}},D=s=>{let a,l,u,c,d=null;const f=()=>{const t=r(s);if(d&&(d.disconnect(),d=null),u=s.i18nNamespace,l=u,null!=l)return;const n=function(t){let n=t.parentNode;for(;n;){if(n instanceof HTMLElement&&n.hasAttribute("i18n-namespace"))return n;if(n.parentNode)n=n.parentNode;else{if(!(n instanceof ShadowRoot))break;n=n.host}}}(t);n&&(l=n.getAttribute("i18n-namespace"),d=new MutationObserver((()=>{f(),i(s)})),d.observe(n,{attributes:!0,attributeFilter:["i18n-namespace"]}))},v=s.connectedCallback;s.connectedCallback=()=>{const e=r(s);c=t(e),f(),a=c.internationalization.on("set",(t=>{t!==l&&"_system"!==t||i(s)})),n(v,s)};const h=s.disconnectedCallback;return s.disconnectedCallback=()=>{d&&(d.disconnect(),d=null),n(a),e(r(s)),n(h,s)},{t:(t,n)=>{var e,i,a,d,v;void 0!==c&&s.i18nNamespace!==u&&f(),t.startsWith(".")&&(t=r(s).localName+t),Object.prototype.hasOwnProperty.call(o,t)&&(t=o[t]);const h=c.internationalization.state,p=c.context.state.locale,m=null!==(a=null===(i=null===(e=h[l])||void 0===e?void 0:e[p])||void 0===i?void 0:i[t])&&void 0!==a?a:null===(v=null===(d=h._system)||void 0===d?void 0:d[p])||void 0===v?void 0:v[t];return null==m?t:m.replace(/{{([\s\S]+?)}}/g,((t,e)=>{var o;return null!==(o=null==n?void 0:n[e.trim()])&&void 0!==o?o:""}))}}};export{R as a,b,g as c,k as d,S as e,j as f,h as g,x as h,T as i,M as j,w as p,A as r,d as s,D as w}
1
+ import{g as t,r as n,c as e,R as o}from"./p-D0tNATZq.js";import{g as r,f as i}from"./p-CCZcKl0Q.js";import{i as s}from"./p-EcC0qLtU.js";const a=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","code","pre","blockquote","del"]),l=new Set(["class","style","colspan","rowspan","href","title","src","alt","width","height"]),u=new Set(["http:","https:","mailto:"]),c=/^\s*text-align:\s*(left|center|right)\s*;?\s*$/i;function d(t){if(!t)return"";const n=(new DOMParser).parseFromString(t,"text/html").body;return f(n),n.innerHTML}function f(t){for(const n of Array.from(t.childNodes)){if(n.nodeType===Node.TEXT_NODE)continue;const e=n;if(n.nodeType!==Node.ELEMENT_NODE||!a.has(e.localName)){t.removeChild(n);continue}for(const t of Array.from(e.attributes)){const n=t.name.toLowerCase();l.has(n)&&("href"!==n&&"src"!==n||v(n,t.value))||e.removeAttribute(t.name)}const o=e.getAttribute("style");null===o||c.test(o)||e.removeAttribute("style"),f(e)}}function v(t,n){try{const{protocol:e}=new URL(n,"http://a");return u.has(e)||"src"===t&&"data:"===e}catch(t){return!1}}function h(t,n=!1){const e=p(t);if(!e)return n&&console.log("[parentDims] no layout parent found for",t.tagName),{width:0,height:0};const o=getComputedStyle(e),r=e.clientWidth-parseFloat(o.paddingLeft)-parseFloat(o.paddingRight),i=function(t,n=!1){let e=p(t),o=0,r=null,i=1;for(;e;){if(e.hasAttribute("data-bn-fit-content")){n&&console.log(`[height:${o}]`,e.tagName,"fit-content region → discarding inner candidate"),r=null;const t=parseInt(e.getAttribute("data-bn-fit-content"),10);!isNaN(t)&&t>1&&(i*=t),e=m(e),o++;continue}const t=getComputedStyle(e),s=t.overflowY;if(n&&console.log(`[height:${o}]`,e.tagName,e.className||"(no class)",`overflow=${s} clientH=${e.clientHeight} h=${t.height}`),null===r)if("hidden"===s||"scroll"===s||"auto"===s)r=e.clientHeight-parseFloat(t.paddingTop)-parseFloat(t.paddingBottom),n&&console.log(`[height] candidate at depth ${o}: ${Math.round(r)}px`);else if("none"!==t.maxHeight){const n=parseFloat(t.maxHeight);!isNaN(n)&&n>0&&(r=Math.min(n,e.clientHeight-parseFloat(t.paddingTop)-parseFloat(t.paddingBottom)))}e=m(e),o++}return null!==r?r/i:(n&&console.log("[height] NO constrained ancestor → viewport fallback"),"undefined"!=typeof window?window.innerHeight/i:0)}(t,n);return n&&console.log("[parentDims]",t.tagName,"→ layoutParent:",e.tagName,e.className||"(no class)",`clientW=${e.clientWidth} → w=${Math.round(r)}, h=${Math.round(i)}`,"overflow:",o.overflow),{width:Math.max(0,r),height:Math.max(0,i)}}function p(t){var n;const e=t.parentElement;return(null===(n=null==e?void 0:e.assignedSlot)||void 0===n?void 0:n.parentElement)?e.assignedSlot.parentElement:e}function m(t){var n;if(null===(n=t.assignedSlot)||void 0===n?void 0:n.parentElement)return t.assignedSlot.parentElement;if(t.parentElement)return t.parentElement;const e=t.getRootNode();return e instanceof ShadowRoot?e.host:null}function b(t,n){const e=t.getBoundingClientRect(),o=t.offsetHeight>0?e.height/t.offsetHeight:0;if(!(o>0)||Math.abs(o-(t.offsetWidth>0?e.width/t.offsetWidth:0))>.01*o)return 0;const r=e.top+n*o;let i=0;for(let n=t;n;n=m(n)){const t=getComputedStyle(n).overflowY;if("hidden"===t||"clip"===t)i=Math.max(i,r-n.getBoundingClientRect().bottom);else if(("auto"===t||"scroll"===t)&&n.scrollHeight>n.clientHeight+1)break}return i/o}const g=(t,n)=>Math.round(t*n*100)/100;function w(t){if(null==t||""===t)return{mode:"empty"};if("none"===t)return{mode:"none"};if("auto"===t)return{mode:"auto"};const n=Number(t);return!isNaN(n)&&n>0?{mode:"factor",factor:n}:{mode:"empty"}}const y={k:1e3,K:1e3,M:1e6,G:1e9,T:1e12},$=/^(\d+(?:\.\d+)?|\.\d+)\s*([kKMGT])?$/;function M(t){var n;if("number"==typeof t)return Number.isFinite(t)&&t>0?{kind:"number",value:t}:{kind:"invalid",raw:String(t)};const e=null!==(n=null==t?void 0:t.toString().trim())&&void 0!==n?n:"";if("auto"===e.toLowerCase())return{kind:"auto"};const o=$.exec(e);if(o){const t=Number(o[1])*(o[2]?y[o[2]]:1);if(Number.isFinite(t)&&t>0)return{kind:"number",value:t}}return{kind:"invalid",raw:e}}function k(t,n){const e=M(t);if("auto"===e.kind)return{kind:"auto"};if("string"==typeof t){const e=t.trim();if(n.has(e))return{kind:"value",value:n.get(e)}}return"number"===e.kind?{kind:"value",value:e.value}:{kind:"invalid",raw:e.raw}}const N=[[1e12,"T"],[1e9,"G"],[1e6,"M"],[1e3,"k"]];function S(t){if(!Number.isFinite(t)||t<=0)return String(t);const n=t=>String(Number(t.toPrecision(3)));for(const[e,o]of N)if(t>=e)return`${n(t/e)}${o}`;return n(t)}const F="WARN_datasets",R=(o,i,s)=>{let a,l,u=[],c=[],d=[],f="";const v=()=>{const t=f;f=o.datasets||"",""!==t&&t!==f&&i("",[]),[d,c]=((t,n)=>{const e=[],o=[];for(const t of n)(r=t,r.startsWith("$")?e:o).push(t);var r;return[e,o]})(0,f.split(",")),((t,n)=>{const e=t.errors;if(e)if(n.length>0){const t=n.map((t=>t.substring(1))).join(", ");e.addOrReplace({id:F,type:"warning",message:`Using datasource(s) "${t}" directly. Prefer using a dataset (bn-dataset) for query support and metadata.`})}else e.remove(F)})(o,d),p()},h=(t,n)=>{const e=n?t.substring(1):t;let o;try{o=l.db.db.exec(`SELECT * FROM \`${e}\``)}catch(t){o=[]}i(t,o)},p=()=>{u.forEach((t=>t())),u=[],c.forEach((t=>{t&&(u.push(l.db.subscribe(t,(()=>h(t,!1)))),h(t,!1),(t=>{if(s){const n=l.datasetsMeta.get(t);n&&s(t,n)}})(t))})),d.forEach((t=>{t&&(u.push(l.db.subscribe(t.substring(1),(()=>h(t,!0)))),h(t,!0))}))},m=new MutationObserver((t=>{t.forEach((t=>{"datasets"===t.attributeName&&(o.datasets||"")!==f&&v()}))})),b=o.connectedCallback;o.connectedCallback=()=>{const e=r(o);l=t(e),v(),m.observe(e,{attributes:!0,attributeFilter:["datasets"]}),s&&(a=l.datasetsMeta.on("set",((t,n)=>{c.includes(t)&&s(t,n)}))),n(b,o)};const g=o.disconnectedCallback;return o.disconnectedCallback=()=>{m.disconnect(),u.forEach((t=>t())),u=[],n(a),e(r(o)),n(g,o)},t=>{c=t,p()}},C="inherited-page",O="bn-layout-page";function T(t){return"inherited-closest"===t||t===C}function j(t,n){const e=[];let o=t.parentNode;for(;o;){const t=o.nodeName.toLowerCase();if(t===O){e.push(o);break}if("bn-layout-card"===t&&n!==C&&e.push(o),o.parentNode)o=o.parentNode;else{if(!(o instanceof ShadowRoot))break;o=o.host}}return e}function A(t,n){var e;const o=t=>{const e=t.getAttribute(n),o=null==e?void 0:e.trim();return s(o)||T(o)?void 0:e};for(const r of t){if((null===(e=r.getAttribute(n))||void 0===e?void 0:e.trim())===C){const n=t.find((t=>t.nodeName.toLowerCase()===O)),e=n&&o(n);if(void 0!==e)return e;continue}const i=o(r);if(void 0!==i)return i}}const q=(t,e,o)=>{const s=new Map,a=new Map;let l=null;const u=()=>{var n;const o=r(t);s.clear(),a.clear(),l&&(l.disconnect(),l=null);const c=new Map;for(const r of e){const e=t[r.propName];if("string"!=typeof e||!T(e))continue;a.set(r.propName,e);const i=j(o,e),l=A(i,r.ancestorAttr);void 0!==l&&s.set(r.propName,l);for(const t of i)c.set(t,[...null!==(n=c.get(t))&&void 0!==n?n:[],r.ancestorAttr])}if(c.size>0){l=new MutationObserver((()=>{u(),i(t)}));for(const[t,n]of c)l.observe(t,{attributes:!0,attributeFilter:n})}},c=t.connectedCallback;t.connectedCallback=()=>{u(),n(c,t)};const d=t.disconnectedCallback;t.disconnectedCallback=()=>{l&&(l.disconnect(),l=null),s.clear(),a.clear(),n(d,t)};const f=t=>{var n;return null===(n=e.find((n=>n.propName===t)))||void 0===n?void 0:n.ancestorAttr.replace(/-(\w)/g,((t,n)=>n.toUpperCase()))};return(t,n,e)=>{const r=`WARN_inherited_${t}`,i=T(n);i&&a.get(t)!==n&&u();const l=i?s.get(t):void 0;return i&&void 0===l?(null==o||o.addOrReplace({id:r,type:"warning",message:`${t}: '${n}' could not be resolved, no surrounding ${n===C?"page":"card or page"} sets ${f(t)}`}),{value:e,inherited:!1,unresolved:!0}):(null==o||o.remove(r),{value:null!=l?l:n,inherited:void 0!==l,unresolved:!1})}},x=s=>{let a,l,u,c,d=null;const f=()=>{const t=r(s);if(d&&(d.disconnect(),d=null),u=s.i18nNamespace,l=u,null!=l)return;const n=function(t){let n=t.parentNode;for(;n;){if(n instanceof HTMLElement&&n.hasAttribute("i18n-namespace"))return n;if(n.parentNode)n=n.parentNode;else{if(!(n instanceof ShadowRoot))break;n=n.host}}}(t);n&&(l=n.getAttribute("i18n-namespace"),d=new MutationObserver((()=>{f(),i(s)})),d.observe(n,{attributes:!0,attributeFilter:["i18n-namespace"]}))},v=s.connectedCallback;s.connectedCallback=()=>{const e=r(s);c=t(e),f(),a=c.internationalization.on("set",(t=>{t!==l&&"_system"!==t||i(s)})),n(v,s)};const h=s.disconnectedCallback;return s.disconnectedCallback=()=>{d&&(d.disconnect(),d=null),n(a),e(r(s)),n(h,s)},{t:(t,n)=>{var e,i,a,d,v;void 0!==c&&s.i18nNamespace!==u&&f(),t.startsWith(".")&&(t=r(s).localName+t),Object.prototype.hasOwnProperty.call(o,t)&&(t=o[t]);const h=c.internationalization.state,p=c.context.state.locale,m=null!==(a=null===(i=null===(e=h[l])||void 0===e?void 0:e[p])||void 0===i?void 0:i[t])&&void 0!==a?a:null===(v=null===(d=h._system)||void 0===d?void 0:d[p])||void 0===v?void 0:v[t];return null==m?t:m.replace(/{{([\s\S]+?)}}/g,((t,e)=>{var o;return null!==(o=null==n?void 0:n[e.trim()])&&void 0!==o?o:""}))}}};export{R as a,b,g as c,k as d,S as e,j as f,h as g,q as h,T as i,M as j,w as p,A as r,d as s,x as w}
@@ -0,0 +1 @@
1
+ import{g as t,f as n}from"./p-CCZcKl0Q.js";import{g as e,r,c as s,D as a}from"./p-D0tNATZq.js";const i=t=>{if("object"==typeof t&&null!==t){if("function"==typeof Object.getPrototypeOf){const n=Object.getPrototypeOf(t);return n===Object.prototype||null===n}return"[object Object]"===Object.prototype.toString.call(t)}return!1},o=(t,n)=>n,u=(t,n)=>[...new Set([...t,...n])],c=(t,n)=>{const e=(t=>{return{arrayMergeType:"combine",arrayMerge:(n=t?t.arrayMergeType:"combine","overwrite"===n?o:u),...t};var n})(n);return t.reduce(((t,n)=>(Object.keys(n).forEach((r=>{Array.isArray(t[r])&&Array.isArray(n[r])?e&&e.arrayMerge&&(t[r]=e.arrayMerge(t[r],n[r])):t[r]=i(t[r])&&i(n[r])?c([t[r],n[r]],e):n[r]})),t)),{})},l=a=>{let i,o,u,l;const f=()=>{const t=o.componentStyles.state;l=c([t._system||{},t._default||{},t[u]||{}],{arrayMergeType:"overwrite"})},d=a.connectedCallback;a.connectedCallback=()=>{const s=t(a);o=e(s),l=o.componentStyles.state._system,u=a.selectedStyle,f(),i=o.componentStyles.on("set",(e=>{e!==u&&"_default"!==e||(u=a.selectedStyle,f(),n(t(a)))})),r(d,a)};const h=a.disconnectedCallback;return a.disconnectedCallback=()=>{r(i),s(t(a)),r(h,a)},t=>(void 0!==o&&a.selectedStyle!==u&&(u=a.selectedStyle,f()),t(l))};var f,d,h,m,y,p,b,v;!function(t){t.ALL="all",t.META="meta"}(f||(f={})),function(t){t.CURRENCY="currency",t.VOLUME="volume"}(d||(d={})),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"}(h||(h={})),function(t){t.POS="pos",t.NEG="neg",t.NEU="neu",t.OP="op",t.OPINV="opinv"}(m||(m={})),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"}(v||(v={}));const g={[v.W5]:5,[v.W10]:10,[v.W15]:15,[v.W20]:20,[v.W25]:25,[v.W30]:30,[v.W40]:40,[v.W60]:60,[v.W80]:80,[v.W100]:100};var N,w,k,S,D,O;!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"}(w||(w={})),function(t){t.COLUMN="column",t.LINE="line",t.WATERFALL="waterfall"}(k||(k={})),function(t){t.BAR="bar",t.LINE="line",t.AUTO="auto"}(S||(S={})),function(t){t.SCENARIOS="scenarios",t.DIMENSIONS="dimensions"}(D||(D={})),function(t){t.ABSOLUTE="absolute",t.RELATIVE="relative",t.ABSOLUTE_RELATIVE="absolute-relative"}(O||(O={}));const T=100;var A,M,E,j,$,J,L;!function(t){t.ASC="asc",t.DESC="desc",t.DATASET="dataset"}(A||(A={})),function(t){t[t.ALL=-1]="ALL"}(M||(M={})),function(t){t[t.UP_TO_DATE=0]="UP_TO_DATE",t[t.DIRTY=1]="DIRTY"}(E||(E={})),function(t){t.LIST="list",t.SUM="sum",t.SUMNOTOTAL="sumnototal",t.OPT="opt",t.OPTNOTOTAL="optnototal"}(j||(j={})),function(t){t.BELOW="below",t.ABOVE="above"}($||($={})),function(t){t.ASC="asc",t.DESC="desc"}(J||(J={})),function(t){t.HEADER="HEADER",t.GROUPHEAD="GROUPHEAD",t.SEPERATORLINE="SEPERATORLINE",t.SUM="SUM",t.GROUPSUM="GROUP_SUM",t.DRILLELEMENT="DRILLELEMENT",t.STANDARD="STANDARD",t.PARTELEMENT="PARTELEMENT",t.ENTRY="ENTRY"}(L||(L={}));const F=/^\s*(set|first|last|min|max|avg|sum|lit)\(\s*(.*?)\s*\)\s*$/,I=/^[A-Za-z_][A-Za-z0-9_]*$/,_=["min","max","avg","sum"];class W{constructor(t,n,e,r){this.label=t,this.alias=n,this.fn=e,this.arg=r}get isNumeric(){return _.includes(this.fn)}}function x(t){if("string"!=typeof t)return!1;const n=F.exec(t);if(!n)return!1;const[,e,r]=n;return"lit"===e?r.length>0:I.test(r)}function q(t,n,e){if(!x(e))return null;const[,r,s]=F.exec(e);return new W(t,n,r,s)}var G,R,C,z;!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"}(G||(G={})),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"}(R||(R={}));class P{constructor(){this._dateFormat={year:"yyyy",quarter:"q'Q' yyyy",month:"LLL yyyy",week:"'KW'WW kkkk",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.dateFormatPinned=!1,this.dateFormatShortPinned=!1,this.dateFormat=this._dateFormat,this.dateLinkFormat=this._dateLinkFormat,this.dateFormatShort=this._dateFormatShort}setDateLinkFormat(t){this.dateLinkFormat=t}setDateFormat(t){this.dateFormat=t,this.dateFormatPinned=!0}setDateFormatShort(t){this.dateFormatShort=t,this.dateFormatShortPinned=!0}setLocale(t){this.locale=t,this.dateFormatPinned||(this.dateFormat=Object.assign(Object.assign({},this._dateFormat),P.LOCALE_DATE_FORMAT[t]||{})),this.dateFormatShortPinned||(this.dateFormatShort=Object.assign(Object.assign({},this._dateFormatShort),P.LOCALE_DATE_FORMAT_SHORT[t]||{}))}getDateString(t,n){return t.setLocale(this.locale).toFormat(this.dateFormat[n]||this.dateFormat.fallback)}getSmartDateString(t,n){switch(n){case G.DAY:return this.getFormatedDayDate(t);case G.MONTH:return this.getFormatedMonthDate(t);case G.QUARTER:return this.getFormatedQuarterDate(t);case G.WEEK:return this.getFormatedWeekDate(t);case G.HOUR:return this.getFormatedHourDate(t);case G.MINUTE:return this.getFormatedMinuteDate(t);case G.SECOND:return this.getFormatedSecondDate(t);case G.MILLISECOND:return this.getFormatedMilliSecondDate(t);default:return this.getDateString(t,n)}}calculateDistanceType(t,n,e=32){if(null==n)return G.DAY;const r="number"==typeof t?a.fromMillis(t):t,s="number"==typeof n?a.fromMillis(n):n;return 0===s.diff(r).as("milliseconds")?G.DAY:s.diff(r).as("milliseconds")<e?G.MILLISECOND:s.diff(r).as("seconds")<e?G.SECOND:s.diff(r).as("minutes")<e?G.MINUTE:s.diff(r).as("hours")<e?G.HOUR:s.diff(r).as("days")<e?G.DAY:s.diff(r).as("weeks")<e?G.WEEK:s.diff(r).as("months")<e?G.MONTH:s.diff(r).as("quarters")<e?G.QUARTER:G.YEAR}datesBetween(t,n,e){const r=this.convertDateDistanceToMomentunitOfTime(e),s=t.startOf(r),a=n.endOf(r),i=[];let o=s;do{i.push(o),o=o.plus(this.createDiratonLike(r,1))}while(o<=a);return i}countBetween(t,n,e){const r=this.convertDateDistanceToMomentunitOfTime(e);return Math.floor(n.startOf(r).diff(t.startOf(r),r).as(r))+1}getDateLinkString(t,n,e,r,s){if(null==t&&null==n)return"";if(null==t&&e!==R.END&&e!==R.YTD)return"";if(null==n&&(R.INTERVAL===e||R.CUM===e||R.END===e||R.YTD===e))return"";const i=t||a.now(),o=n;r===G.AUTO&&(r=this.calculateDistanceType(i,o,s));let u=this.getDateString(i,r),c="",l=R.NONE;return null!=o&&(c=this.getDateString(o,r),l=R.INTERVAL,u===c&&e===R.INTERVAL&&(e=R.NONE),u===c&&e===R.AVG&&(l=R.NONE),R.END!==e&&R.YTD!==e||(u=c),e!==R.INTERVAL&&e!==R.CUM&&e!==R.AVG||(r===G.QUARTER?i.quarter===o.quarter&&i.year===o.year?c=c.replace(" "+o.year,""):i.year===o.year&&(u=u.replace(" "+i.year,"")):r===G.MONTH?i.month===o.month&&i.year===o.year?c=c.replace(" "+o.year,""):i.year===o.year&&(u=u.replace(" "+i.year,"")):r===G.WEEK&&(i.weekNumber===o.weekNumber&&i.weekYear===o.weekYear?c=c.replace(" "+o.weekYear,""):i.weekYear===o.weekYear&&(u=u.replace(" "+i.weekYear,""))))),this.dateLinkFormat[e].replace("[LINK]",this.dateLinkFormat[l]).replace("[DATE]",u).replace("[DATE2]",c)}getShortDateString(t,n){return t.setLocale(this.locale).toFormat(this.dateFormatShort[n]||this.dateFormatShort.fallback)}getFormatedDayDate(t){let n=this.dateFormatShort.day;return this.isFirstInMonth(t)&&(n+=" "+this.dateFormatShort.month),this.isJanuary(t)&&(n+=" "+this.dateFormatShort.year),t.setLocale(this.locale).toFormat(n)}getFormatedMonthDate(t){let n=this.dateFormatShort.month;return this.isJanuary(t)&&(n+=" "+this.dateFormatShort.year),t.setLocale(this.locale).toFormat(n)}getFormatedQuarterDate(t){let n=this.dateFormatShort.quarter;return this.isFirstQuarter(t)&&(n+=" "+this.dateFormatShort.year),t.setLocale(this.locale).toFormat(n)}getFormatedWeekDate(t){let n=this.dateFormatShort.week;return this.isFirstWeek(t)&&(n+=" kk"),t.setLocale(this.locale).toFormat(n)}getFormatedHourDate(t){let n=this.dateFormatShort.hour;return this.isFirstHour(t)&&(n+=" "+this.dateFormatShort.day),t.setLocale(this.locale).toFormat(n)}getFormatedMinuteDate(t){let n=this.dateFormatShort.minute;return this.isFirstMinute(t)&&(n=this.dateFormatShort.hour+":"+n),t.setLocale(this.locale).toFormat(n)}getFormatedSecondDate(t){let n=this.dateFormatShort.second;return this.isFirstSecond(t)&&(n=this.dateFormatShort.minute+":"+n),t.setLocale(this.locale).toFormat(n)}getFormatedMilliSecondDate(t){let n=this.dateFormatShort.millisecond;return this.isFirstMilliSecond(t)&&(n=this.dateFormatShort.second+":"+n),t.setLocale(this.locale).toFormat(n)}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 n;switch(t){case G.YEAR:n="year";break;case G.MONTH:n="month";break;case G.QUARTER:n="quarter";break;case G.WEEK:n="week";break;case G.DAY:n="day";break;case G.HOUR:n="hour";break;case G.MINUTE:n="minute";break;case G.SECOND:n="second";break;case G.MILLISECOND:n="millisecond";break;default:n="day"}return n}createDiratonLike(t,n){switch(t){case"year":return{years:n};case"month":return{months:n};case"quarter":return{quarters:n};case"week":return{weeks:n};case"day":default:return{days:n};case"hour":return{hours:n};case"minute":return{minutes:n};case"second":return{seconds:n};case"millisecond":return{milliseconds:n}}}}P.LOCALE_DATE_FORMAT={en:{week:"'W'WW kkkk",day:"MM/dd/yyyy",fallback:"MM/dd/yyyy"}},P.LOCALE_DATE_FORMAT_SHORT={en:{week:"'W'WW",fallback:"MM/dd/yyyy"}};class K{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 a&&t.isValid}}class Q{static adaptDefaultString(t){return K.isString(t)?t.trim():""}static adaptArray(t,n){const e=[];return K.isArray(t)&&t.forEach((t=>{e.push(n.adapt(t))})),e}}!function(t){t.ASC="asc",t.DESC="desc"}(C||(C={})),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"}(z||(z={}));class U{constructor(t=["category"],n=C.ASC){this.hierarchy=t,this.direction=n}}const Z=[z.ROWGROUP,z.ROWGROUPINDEX,z.CATEGORY,z.CATEGORYINDEX,z.SUBCATEGORY,z.SUBCATEGORYINDEX],H=/^(?:ac|fc|pp|pl)[1-4]$/,B=/^(dr|d)((?:ac|fc|pp|pl)[1-4])_((?:ac|fc|pp|pl)[1-4])(?:_(?:pos|neg|neu|opinv|op))?$/;function Y(t){if(null==t)return;const n=t.indexOf("@"),e=(n<0?t:t.slice(0,n)).trim().toLowerCase(),r=n<0?void 0:t.slice(n+1).trim();if(""===r)return;const s=z[e.toUpperCase()];if(null!=s&&Z.includes(s))return void 0===r?{kind:"dim",column:s}:void 0;if(H.test(e))return{kind:"scenario",column:e,bucket:r};const a=B.exec(e);if(null!=a){const[,t,n,e]=a;return{kind:"variance",column:`${t}${n}_${e}`,type:t,base:n,delta:e,bucket:r}}}function V(t){const n=Y(t);if(null!=n)return void 0===n.bucket?n.column:`${n.column}@${n.bucket}`}class X{constructor(t,n=!1){this.stringAdapter=t,this.allowMeasures=n}adapt(t){var n;const e=Q.adaptArray(t.hierarchy,this.stringAdapter),r=C[null===(n=t.direction)||void 0===n?void 0:n.toUpperCase()]||C.ASC;return new U(e.map((t=>(this.allowMeasures?V(t):z[t.toUpperCase()])||z.CATEGORY)),r)}default(){return new U(["category"],C.ASC)}}const tt="n/a";function nt(t,n){if(!(Math.abs(n)<=1e-9*Math.abs(t)))return t/Math.abs(n)}const et=/^(dr|d)((?:ac|pp|fc|pl)[1-4])_((?:ac|pp|fc|pl)[1-4])(?:_(pos|neg|neu|op|opinv))?$/;class rt{constructor(t,n,e){this.type=t,this.base=n,this.delta=e}static parse(t){const n=et.exec(t);return null===n?null:new rt(n[1],n[2],n[3])}compute(t,n){var e;return null==t||null==n?null:"dr"===this.type?0===n?null:null!==(e=nt(t-n,n))&&void 0!==e?e:null:t-n}}function st(t){const n=t.trim();if(Object.values(h).includes(n))return{kind:"scenario",slot:n};const e=rt.parse(n);return null!==e?{kind:"variance",measure:e}:null}function at(t){return t.replace(/\d+$/,"")}function it(t){return t.replace(/^[a-z]+/,"")}function ot(t){var n;return"dr"===(null===(n=rt.parse(t.trim()))||void 0===n?void 0:n.type)}function ut(t){if(!ot(t.measure))return t;const n=t=>void 0===t?void 0:t/100;return Object.assign(Object.assign({},t),{min:n(t.min),max:n(t.max),refLine:n(t.refLine),highlight:t.highlight&&{from:n(t.highlight.from),to:n(t.highlight.to)}})}function ct(t){return null==t||""===t||"null"===t}function lt(t){return ct(t)||"auto"===t.trim().toLowerCase()?[]:ft((null==t?void 0:t.split(",").filter((t=>!(t.toUpperCase().trim()in h)))).toString())}function ft(t){return ct(t)?[]:t.replace(";",",").split(",").filter((t=>{var n,e,r;const s=t.split("_"),a=null===(n=s[0])||void 0===n?void 0:n.replace(/^dr|^d/,"").toUpperCase().trim(),i=null===(e=s[1])||void 0===e?void 0:e.toUpperCase().trim(),o=null===(r=s[2])||void 0===r?void 0:r.toUpperCase().trim();return 3!==s.length||!(a in h)||!(i in h)||!(o in m)}))}function dt(t){return ct(t)?[]:ft(t.split(",").filter((t=>!(t.toUpperCase().trim()in h))).toString())}function ht(t){return ct(t)||"auto"===t.trim().toLowerCase()?[]:ft(t.split(",").filter((t=>!(t.toUpperCase()in z))).toString())}function mt(t){return ct(t)||"auto"===t.trim().toLowerCase()?[]:t.split(",").filter((t=>void 0===Y(t)))}function yt(t){return!ct(t)&&Number.isInteger(Number(t))}function pt(t){return!ct(t)&&!Number.isNaN(Number(t))}function bt(t){return!ct(t)&&(null==t?void 0:t.toUpperCase())in C}function vt(t){return"auto"===(null==t?void 0:t.toLowerCase())||(null==t?void 0:t.toUpperCase())in N}function gt(t){if(ct(t))return[];try{const n=JSON.parse(t);if(n instanceof Array)return n.filter((t=>!(t.hasOwnProperty("name")&&t.hasOwnProperty("unit"))))}catch(t){console.error("validateMeasureList: failed to parse JSON",t)}return["Invalid JSON structure"]}function Nt(t){const n=Date.parse(t);return Number.isInteger(n)}function wt(t){return(null==t?void 0:t.toUpperCase())in R}function kt(t){return(null==t?void 0:t.toUpperCase())in G}function St(t){return(null==t?void 0:t.toUpperCase())in w}function Dt(t){return!ct(t)&&(null==t?void 0:t.toUpperCase())in y}function Ot(t){return!ct(t)&&(null==t?void 0:t.toUpperCase())in p}function Tt(t){return(null==t?void 0:t.toUpperCase())in $}function At(t){if(ct(t))return[];try{const n=JSON.parse(t);if(n instanceof Array)return n.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 Mt(t){if(ct(t))return[];try{const n=JSON.parse(t);if(null!==n&&"object"==typeof n&&!(n instanceof Array))return Object.entries(n).filter((([,t])=>"string"!=typeof t||!x(t))).map((([t,n])=>`${t}: ${n}`))}catch(t){console.error("validateAttributesJsonStr: failed to parse JSON",t)}return["Invalid JSON structure"]}function Et(t){if(ct(t))return[];try{const n=JSON.parse(t);if(n instanceof Array)return n.filter((t=>!(t.hasOwnProperty("rowGroup")&&t.hasOwnProperty("category"))))}catch(t){console.error("validatePartOfJsonStr: failed to parse JSON",t)}return["Invalid JSON structure"]}function jt(t){return(null==t?void 0:t.trim().toUpperCase())in d}function $t(t){return["_","k","M","G","T","P","E","Z","Y","m","my","μ","n","p","f","a","z","y"].includes(null==t?void 0:t.trim())||["GREATEST","LEAST"].includes(null==t?void 0:t.trim().toUpperCase())}function Jt(t){return(null==t?void 0:t.toUpperCase().trim())in b}function Lt(t){return(null==t?void 0:t.toUpperCase().trim())in v}function Ft(t){if(ct(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 It(t){if(ct(t))return[];try{const n=JSON.parse(t);if("object"!=typeof n||null===n||Array.isArray(n))return["stack: must be a JSON object"];const e=[];if(n.hasOwnProperty("by")){const t=["scenarios","dimensions"];t.includes(n.by)||e.push(`stack: 'by' must be one of: ${t.join(", ")}`)}else e.push("stack: 'by' is required");if(n.hasOwnProperty("mode")){const t=["absolute","relative","absolute-relative"];t.includes(n.mode)||e.push(`stack: 'mode' must be one of: ${t.join(", ")}`)}if(n.hasOwnProperty("order")){const t=["asc","desc","dataset"];t.includes(n.order)||e.push(`stack: 'order' must be one of: ${t.join(", ")}`)}return e}catch(t){return["stack: invalid JSON"]}}function _t(t){return!ct(t)&&null!==st(t)}class Wt{constructor(){this.cache=new Map,this.tag=Wt.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.textContent=Array.from(this.cache.values()).map((t=>t)).join("\n")}}const xt=new Wt;function qt(t){for(var n,e=0,r=0,s=t.length;s>=4;++r,s-=4)n=1540483477*(65535&(n=255&t.charCodeAt(r)|(255&t.charCodeAt(++r))<<8|(255&t.charCodeAt(++r))<<16|(255&t.charCodeAt(++r))<<24))+(59797*(n>>>16)<<16),e=1540483477*(65535&(n^=n>>>24))+(59797*(n>>>16)<<16)^1540483477*(65535&e)+(59797*(e>>>16)<<16);switch(s){case 3:e^=(255&t.charCodeAt(r+2))<<16;case 2:e^=(255&t.charCodeAt(r+1))<<8;case 1:e=1540483477*(65535&(e^=255&t.charCodeAt(r)))+(59797*(e>>>16)<<16)}return(((e=1540483477*(65535&(e^=e>>>13))+(59797*(e>>>16)<<16))^e>>>15)>>>0).toString(36)}const Gt=t=>pt(t)?`${t}px`:t,Rt={width:{className:"w",cssName:"width",attrName:"width",transform:Gt},height:{className:"h",cssName:"height",attrName:"height",transform:Gt},position:{className:"pst",cssName:"position",attrName:"position"},top:{className:"top",cssName:"top",attrName:"top",transform:Gt},right:{className:"rgt",cssName:"right",attrName:"right",transform:Gt},bottom:{className:"btm",cssName:"bottom",attrName:"bottom",transform:Gt},left:{className:"lft",cssName:"left",attrName:"left",transform:Gt},"font-size":{className:"fts",cssName:"font-size",attrName:"font-size",transform:Gt},"grid-column":{className:"gdc",cssName:"grid-column",attrName:"grid-column"},"grid-row":{className:"gdr",cssName:"grid-row",attrName:"grid-row"}},Ct=Object.keys(Rt);function zt(t,n,e){return`.${n} {${t.cssName}: ${e};}`}function Pt(t,n){const e=document.createElement("div").style;e.setProperty(t.cssName,n);const r=e.getPropertyValue(t.cssName);if(e.cssText=`${t.cssName}:${r};--bn-end:1`,!r||r.includes("<")||"1"!==e.getPropertyValue("--bn-end"))return;const s=function(t,n){const e=qt(n);return`bn-c-${t.className}_${e}`}(t,n);return{className:s,style:zt(t,s,r)}}const Kt=t=>{const n=new Map;return Ct.forEach((e=>{const r=t.getAttribute(e);if(r){["top","left","right","bottom"].includes(e)&&n.set("position",Pt(Rt.position,"absolute"));const t=Pt(Rt[e],(Rt[e].transform||function(t){return t})(r));t&&n.set(e,t)}})),n},Qt=new MutationObserver((t=>{for(const e of t){const t=e.target,r=Kt(t);xt.apply(r);const s=Array.from(r.values()).map((t=>t.className));t.className=t.className.split(" ").filter((t=>!t.startsWith("bn-c-"))).concat(...s).join(" "),n(t)}})),Ut=n=>{const e=n.connectedCallback,s=n.disconnectedCallback;n.connectedCallback=()=>{const s=t(n);if(!s)throw new Error("Can't find element field in component undefined");(t=>{const n=Kt(t);xt.apply(n);const e=Array.from(n.values()).map((t=>t.className));t.className=t.className.split(" ").filter((t=>!t.startsWith("bn-c-"))).concat(...e).join(" "),Qt.observe(t,{attributes:!0,attributeFilter:Ct,childList:!1,subtree:!1})})(s),r(e,n)},n.disconnectedCallback=()=>{r(s,n)}};export{j as $,N as A,kt as B,K as C,St as D,G as E,w as F,S as G,P as H,qt as I,dt as J,Lt as K,Dt as L,Ot as M,tt as N,C as O,At as P,Tt as Q,T as R,D as S,Et as T,mt as U,jt as V,Jt as W,Ft as X,Mt as Y,y as Z,$ as _,l as a,V as a0,f as a1,b as a2,d as a3,q as a4,g as a5,v as a6,L as a7,I as a8,Y as a9,h as aa,J as ab,E as ac,gt as ad,Nt as ae,wt as af,R as ag,yt as b,_t as c,it as d,ut as e,ot as f,bt as g,U as h,ct as i,z as j,lt as k,ft as l,c as m,vt as n,$t as o,It as p,A as q,st as r,at as s,O as t,Q as u,ht as v,Ut as w,X as x,nt as y,pt as z}
@@ -1 +1 @@
1
- import{r as t,h as i,a as e,g as s}from"./p-CCZcKl0Q.js";import{LAYOUT_STATE_VERSION as o}from"./index.esm.js";import{l as n,o as l,r,m as a,a as d}from"./p-qpZjVnX5.js";import{w as h,a as c}from"./p-D0tNATZq.js";import{w as u,a as v}from"./p-BVU4bIsi.js";function f(t){if(!t||""===t.trim()||"[]"===t)return[];try{const i=JSON.parse(t);return Array.isArray(i)?i.map(((t,i)=>{var e,s,o;return"string"==typeof t?{label:t,id:String(i)}:"object"==typeof t&&null!==t?{label:null!==(s=null!==(e=t.label)&&void 0!==e?e:t.name)&&void 0!==s?s:String(i),id:null!==(o=t.id)&&void 0!==o?o:String(i)}:{label:String(t),id:String(i)}})):[]}catch(t){return console.error("parseHeaders: failed to parse JSON",t),[]}}function g(t,i){return`${t.id}-${i.id}`}function p(t){if(!t||""===t.trim()||"[]"===t)return[];try{const i=JSON.parse(t);if(!Array.isArray(i))return["Headers must be an array"];const e=[],s=new Set;return i.forEach(((t,i)=>{"object"==typeof t&&null!==t&&void 0!==t.id&&("string"!=typeof t.id?e.push(`Header[${i}]: 'id' must be a string`):s.has(t.id)?e.push(`Header[${i}]: duplicate id '${t.id}'`):s.add(t.id),void 0!==t.label&&"string"!=typeof t.label&&e.push(`Header[${i}]: 'label' must be a string`))})),e}catch(t){return console.error("validateHeadersJson: failed to parse JSON",t),["Invalid JSON structure"]}}const b=["auto","equal"],m=["top","center","bottom","baseline"],y=["left","center","right","baseline"],w={top:"flex-start",center:"center",bottom:"flex-end",baseline:"flex-start"},x={left:"stretch",center:"center",right:"flex-end",baseline:"stretch"},S=t=>Math.round(100*t)/100,C=new Set(["bn-asset","bn-component-style","bn-dataset","bn-datasource","bn-internationalization","bn-ruleset","bn-scaling-group"]),$=new Set(["bn-layout-card"]),H={top:"--bn-baseline-offset-top",left:"--bn-baseline-offset-left",right:"--bn-baseline-offset-right"},j=class{validateRowHeaders(t){const i="ERR_rowHeaders",e=p(t);e.length>0?this.errors.addOrReplace({id:i,type:"error",message:`row-headers: ${e.join("; ")}`}):this.errors.remove(i),this.updateGridConfig()}validateColumnHeaders(t){const i="ERR_columnHeaders",e=p(t);e.length>0?this.errors.addOrReplace({id:i,type:"error",message:`column-headers: ${e.join("; ")}`}):this.errors.remove(i),this.updateGridConfig()}validateCellHeight(t){this.resolvedHeight=this.validateChoice("cell-height","ERR_cellHeight",t,b,"auto")}validateCellWidth(t){this.resolvedWidth=this.validateChoice("cell-width","ERR_cellWidth",t,b,"auto")}validateCellVerticalAlign(t){this.resolvedVertical=this.validateChoice("cell-vertical-align","ERR_cellVerticalAlign",t,m,"top"),this.schedule()}validateCellHorizontalAlign(t){this.resolvedHorizontal=this.validateChoice("cell-horizontal-align","ERR_cellHorizontalAlign",t,y,"left"),this.schedule()}validateCellCaptions(t){const i=function(t){if(void 0===t||""===t.trim())return{};let i;try{i=JSON.parse(t)}catch(t){return}if("object"!=typeof i||null===i||Array.isArray(i))return;const e={};for(const[t,s]of Object.entries(i)){if("string"!=typeof s)return;""!==s&&(e[t]=s)}return e}(t);i?this.errors.remove("ERR_cellCaptions"):this.errors.addOrReplace({id:"ERR_cellCaptions",type:"error",message:"cell-captions: not a JSON object from slot name to text."}),this.captions=null!=i?i:{}}constructor(i){t(this,i),this.gridConfig={rows:[],columns:[]},this.resolvedHeight="auto",this.resolvedWidth="auto",this.resolvedVertical="top",this.resolvedHorizontal="left",this.captions={},this.offsets={},this.frames=new Map,this.observed=new WeakSet,this.scheduled=!1,this.run=0,this.adjustments=0,this.chartTitle="",this.rowHeaders="[]",this.columnHeaders="[]",this.showRowHeaders=!0,this.showColumnHeaders=!0,this.showBorders=!0,this.rowHeaderWidth="auto",this.cellGap="0px",this.cellHeight="auto",this.cellWidth="auto",this.cellVerticalAlign="top",this.cellHorizontalAlign="left",this.cellCaptions="",this.schedule=()=>{if(!this.isBaselineMode())return this.run++,Object.keys(this.offsets).length>0&&(this.offsets={}),void this.applyFrameOffsets();this.scheduled||(this.scheduled=!0,this.holdStatus(new Promise((t=>{requestAnimationFrame((()=>{this.scheduled=!1,this.align().catch((t=>console.error("bn-grid: aligning the baselines failed",t))).finally(t)}))}))))},u(this),this.holdStatus=h(this),this.errors=c(this),this.componentStyle=v(this)}connectedCallback(){var t;this.observed=new WeakSet,this.resizeObserver=new ResizeObserver(this.schedule),this.mutationObserver=new MutationObserver(this.schedule),this.mutationObserver.observe(this.element,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["slot"]}),null===(t=document.fonts)||void 0===t||t.addEventListener("loadingdone",this.schedule)}disconnectedCallback(){var t,i,e;null===(t=this.resizeObserver)||void 0===t||t.disconnect(),null===(i=this.mutationObserver)||void 0===i||i.disconnect(),null===(e=document.fonts)||void 0===e||e.removeEventListener("loadingdone",this.schedule),this.run++}componentDidRender(){this.schedule()}validateChoice(t,i,e,s,o){return null==e||""===e?(this.errors.remove(i),o):s.includes(e)?(this.errors.remove(i),e):(this.errors.addOrReplace({id:i,type:"error",message:`${t}: "${e}" is not one of ${s.join(", ")}.`}),o)}isBaselineMode(){return"baseline"===this.resolvedVertical||"baseline"===this.resolvedHorizontal}contentIn(t){const i=Array.from(this.element.children).find((i=>i.getAttribute("slot")===t));if(!i)return{};const e=[i,...Array.from(i.querySelectorAll("*"))],s=e.find((t=>t.localName.startsWith("bn-")&&!C.has(t.localName)&&!$.has(t.localName))),o=s?e.find((t=>$.has(t.localName)&&t.contains(s))):void 0;return{visual:s,frame:o}}applyFrameOffsets(){this.frames.forEach(((t,i)=>{const e=this.offsets[i];Object.keys(H).forEach((i=>{const s=null==e?void 0:e[i];s?t.style.setProperty(H[i],`${s}px`):t.style.removeProperty(H[i])}))}))}async align(){var t;const i=++this.run;if(!this.element.isConnected||!this.isBaselineMode())return;const{rows:e,columns:s}=this.gridConfig,o=e.flatMap(((t,i)=>s.map(((e,s)=>({slot:g(t,e),row:i,column:s}))))),l=o.map((({slot:t})=>this.contentIn(t))),r=l.map((t=>t.visual));if(await Promise.all(r.map((t=>{var i;return null===(i=null==t?void 0:t.componentOnReady)||void 0===i?void 0:i.call(t)}))),i!==this.run)return;r.forEach((t=>t&&this.observe(t)));const a=await Promise.all(r.map((t=>"function"==typeof(null==t?void 0:t.getBaseline)?t.getBaseline().catch((()=>({}))):Promise.resolve({}))));if(i!==this.run)return;const d=n(this.element),h=new Map;null===(t=this.element.shadowRoot)||void 0===t||t.querySelectorAll(".grid-slot").forEach((t=>{var i;h.set(null!==(i=t.getAttribute("data-slot"))&&void 0!==i?i:"",t)})),this.frames=new Map,l.forEach((({frame:t},i)=>t&&this.frames.set(o[i].slot,t)));const c=function(t,i,e){const s={};for(const i of t)s[i.slot]={};const o=(i,e,o,n)=>{var l;const r=new Map;for(const e of t)r.set(e[i],[...null!==(l=r.get(e[i]))&&void 0!==l?l:[],e]);for(const t of r.values()){const i=t.map((t=>{const i=e(t);return void 0===i?void 0:i-o(t)})),l=i.filter((t=>void 0!==t)),r=l.length>0?Math.max(...l):0,a=i.map((t=>void 0===t?void 0:S(r-t))),d=Math.max(0,...a.filter((t=>void 0!==t)));t.forEach(((t,i)=>n(s[t.slot],a[i],d)))}};return i&&o("row",(t=>t.y),(t=>t.top),((t,i)=>{void 0===i?t.bottom=!0:t.top=i})),e&&o("column",(t=>t.x),(t=>t.left),((t,i,e)=>{void 0!==i&&(t.left=i);const s=S(e-(null!=i?i:0));s>0&&(t.right=s)})),s}(o.map((({slot:t,row:i,column:e},s)=>{const o=r[s],n=a[s],c=l[s].frame,u=null!=c?c:h.get(t),v=t=>parseFloat((null==u?void 0:u.style.getPropertyValue(t))||"0")||0,f=c?{slot:t,row:i,column:e,top:v(H.top),left:v(H.left)}:{slot:t,row:i,column:e,top:v("padding-top"),left:v("margin-left")};if(o){const t=d.toLocal(o.getBoundingClientRect());void 0!==n.y&&(f.y=t.y+n.y),void 0!==n.x&&(f.x=t.x+n.x)}return f})),"baseline"===this.resolvedVertical,"baseline"===this.resolvedHorizontal);if(function(t,i){var e,s,o,n,l,r,a,d;const h=new Set([...Object.keys(t),...Object.keys(i)]);for(const c of h){const h=null!==(e=t[c])&&void 0!==e?e:{},u=null!==(s=i[c])&&void 0!==s?s:{};if(Boolean(h.bottom)!==Boolean(u.bottom))return!1;if(Math.abs((null!==(o=h.top)&&void 0!==o?o:0)-(null!==(n=u.top)&&void 0!==n?n:0))>=.5)return!1;if(Math.abs((null!==(l=h.left)&&void 0!==l?l:0)-(null!==(r=u.left)&&void 0!==r?r:0))>=.5)return!1;if(Math.abs((null!==(a=h.right)&&void 0!==a?a:0)-(null!==(d=u.right)&&void 0!==d?d:0))>=.5)return!1}return!0}(c,this.offsets))this.adjustments=0;else{if(this.adjustments>=5)return console.warn("bn-grid: the baselines did not settle; the cells keep their last alignment."),void(this.adjustments=0);this.adjustments++,this.offsets=c,this.applyFrameOffsets(),this.schedule()}}observe(t){var i;this.observed.has(t)||(this.observed.add(t),null===(i=this.resizeObserver)||void 0===i||i.observe(t));const e=t=>{var i;t&&(this.observed.has(t)||(this.observed.add(t),null===(i=this.mutationObserver)||void 0===i||i.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["x1","y1","x2","y2","x","y","width","height","transform","style","class"]})),t.querySelectorAll("*").forEach((t=>e(t.shadowRoot))))};e(t.shadowRoot)}async getLayoutState(t){var i,e,s,n;const h=null!==(i=null==t?void 0:t.detail)&&void 0!==i?i:"summary",c=l(this.element),u=this.componentStyle((t=>{var i;return(null===(i=t.global)||void 0===i?void 0:i.fontSizePx)||13.3333})),{rows:v,columns:f}=this.gridConfig,g={version:o,tag:this.element.localName,id:d(this.element),slot:null!==(e=this.element.getAttribute("slot"))&&void 0!==e?e:void 0,rect:a(this.element,c),em:{fontSizePx:u,appliedScaleFactor:1},regions:[],metadata:{title:this.chartTitle||void 0,rowCount:v.length,columnCount:f.length,cellCount:v.length*f.length},diagnostics:r(this.element)},p=null===(s=this.element.shadowRoot)||void 0===s?void 0:s.querySelector(".grid-container");if(p&&g.regions.push({id:"grid",rect:a(p,c)}),"full"!==h||!p)return g;const b=[],m=t=>b.push(t),y=p.querySelector(".grid-title");return y&&m({kind:"gridTitle",label:(null===(n=y.textContent)||void 0===n?void 0:n.trim())||void 0,rect:a(y,c)}),p.querySelectorAll(".grid-header-col").forEach(((t,i)=>{var e,s;m({kind:"gridHeader",columnId:null===(e=f[i])||void 0===e?void 0:e.id,label:(null===(s=t.textContent)||void 0===s?void 0:s.trim())||void 0,rect:a(t,c)})})),p.querySelectorAll(".grid-header-row").forEach(((t,i)=>{var e,s;m({kind:"gridHeader",rowId:null===(e=v[i])||void 0===e?void 0:e.id,label:(null===(s=t.textContent)||void 0===s?void 0:s.trim())||void 0,rect:a(t,c)})})),p.querySelectorAll(".grid-cell").forEach(((t,i)=>{var e,s,o,n;m({kind:"gridCell",rowId:f.length>0?null===(e=v[Math.floor(i/f.length)])||void 0===e?void 0:e.id:void 0,columnId:f.length>0?null===(s=f[i%f.length])||void 0===s?void 0:s.id:void 0,slot:null!==(n=null===(o=t.querySelector("slot"))||void 0===o?void 0:o.getAttribute("name"))&&void 0!==n?n:void 0,rect:a(t,c)})})),p.querySelectorAll(".grid-caption").forEach((t=>{var i,e,s,o;m({kind:"gridCaption",slot:null!==(s=null===(e=null===(i=t.parentElement)||void 0===i?void 0:i.querySelector("slot"))||void 0===e?void 0:e.getAttribute("name"))&&void 0!==s?s:void 0,label:(null===(o=t.textContent)||void 0===o?void 0:o.trim())||void 0,rect:a(t,c)})})),g.elements=b,g}getGridStyle(){return this.componentStyle((t=>t["bn-grid"]))}componentWillLoad(){this.validateRowHeaders(this.rowHeaders),this.validateColumnHeaders(this.columnHeaders),this.validateCellHeight(this.cellHeight),this.validateCellWidth(this.cellWidth),this.validateCellVerticalAlign(this.cellVerticalAlign),this.validateCellHorizontalAlign(this.cellHorizontalAlign),this.validateCellCaptions(this.cellCaptions)}updateGridConfig(){var t;this.gridConfig=(t=this.columnHeaders,{rows:f(this.rowHeaders),columns:f(t)})}shouldShowRowHeaders(){return this.showRowHeaders&&this.gridConfig.rows.length>0}shouldShowColumnHeaders(){return this.showColumnHeaders&&this.gridConfig.columns.length>0}shouldShowBorders(){return this.showBorders}getGridTemplateColumns(){const t=[];this.shouldShowRowHeaders()&&t.push(this.rowHeaderWidth);const i=this.gridConfig.columns.length||1;for(let e=0;e<i;e++)t.push("equal"===this.resolvedWidth?"minmax(0, 1fr)":"auto");return t.join(" ")}getGridTemplateRows(){const t=[];this.chartTitle&&t.push("auto"),this.shouldShowColumnHeaders()&&t.push("auto");const i=this.gridConfig.rows.length||1;for(let e=0;e<i;e++)t.push("equal"===this.resolvedHeight?"1fr":"auto");return t.join(" ")}renderTitle(){if(!this.chartTitle)return null;const t=(this.shouldShowRowHeaders()?1:0)+this.gridConfig.columns.length;return i("div",{class:"grid-title",style:{"grid-column":`1 / span ${t}`,"grid-row":"1"}},this.chartTitle)}renderColumnHeaders(){if(!this.shouldShowColumnHeaders())return null;const t=this.getGridStyle(),e=this.shouldShowBorders()?`${t.borderWidth}px solid ${t.borderColor}`:"none",s=this.shouldShowRowHeaders()?2:1,o=this.chartTitle?2:1;return this.gridConfig.columns.map(((n,l)=>{const r=l>0;return i("div",{key:`col-header-${n.id}`,class:"grid-header grid-header-col",style:{"grid-column":String(s+l),"grid-row":String(o),"border-left":r?e:"none",padding:`${t.cellPadding}px`,"padding-left":r?`${t.cellPadding+4}px`:`${t.cellPadding}px`}},n.label)}))}renderDataCells(){const t=this.getGridStyle(),e=this.shouldShowBorders()?`${t.borderWidth}px solid ${t.borderColor}`:"none",s=this.shouldShowRowHeaders()?2:1,o=(this.chartTitle?1:0)+(this.shouldShowColumnHeaders()?1:0)+1,n=[];return this.gridConfig.rows.length>0&&this.gridConfig.columns.length>0&&this.gridConfig.rows.forEach(((l,r)=>{if(this.shouldShowRowHeaders()){const s=r>0;n.push(i("div",{key:`row-header-${l.id}`,class:"grid-header grid-header-row",style:{"grid-column":"1","grid-row":String(o+r),"border-top":s?e:"none",padding:`${t.cellPadding}px`,"padding-top":s?`${t.cellPadding+4}px`:`${t.cellPadding}px`}},l.label))}this.gridConfig.columns.forEach(((a,d)=>{const h=g(l,a),c=d>0,u=r>0;n.push(i("div",{key:`cell-${h}`,class:"grid-cell",style:Object.assign({"grid-column":String(s+d),"grid-row":String(o+r),"border-left":c?e:"none","border-top":u?e:"none","padding-left":c?`${t.cellPadding+4}px`:"0","padding-top":u?`${t.cellPadding+4}px`:"0"},this.cellAlignStyle())},this.renderCellContent(h,t)))}))})),n}cellAlignStyle(){return"top"===this.resolvedVertical&&"left"===this.resolvedHorizontal?{}:{display:"flex","flex-direction":"column","justify-content":w[this.resolvedVertical],"align-items":x[this.resolvedHorizontal]}}renderCellContent(t,e){var s;const o=this.captions[t],n=void 0!==o?i("div",{class:"grid-caption",style:{"font-size":`${e.captionFontSize}px`,"font-weight":String(e.captionFontWeight),color:e.captionColor,"margin-bottom":`${e.captionGap}px`,"align-self":"flex-start"}},o):null,l={};"top"===this.resolvedVertical&&"left"===this.resolvedHorizontal||(l["align-self"]="stretch","center"!==this.resolvedHorizontal&&"right"!==this.resolvedHorizontal||(l.display="flex",l["flex-direction"]="column",l["align-items"]=x[this.resolvedHorizontal])),"center"===this.resolvedVertical?(l["margin-top"]="auto",l["margin-bottom"]="auto"):"bottom"===this.resolvedVertical&&(l["margin-top"]="auto");const r=this.frames.has(t)?{bottom:null===(s=this.offsets[t])||void 0===s?void 0:s.bottom}:this.offsets[t];return(null==r?void 0:r.bottom)&&(l["margin-top"]="auto"),(null==r?void 0:r.top)&&(l["padding-top"]=`${r.top}px`),(null==r?void 0:r.left)&&(l["margin-left"]=`${r.left}px`),(null==r?void 0:r.right)&&(l["margin-right"]=`${r.right}px`),[n,i("div",{class:"grid-slot","data-slot":t,style:l},i("slot",{name:t}))]}getFontStyles(){return this.componentStyle((t=>{var i,e,s,o;return{"--bn-font-family":(null===(i=t.global)||void 0===i?void 0:i.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":`${(null===(e=t.global)||void 0===e?void 0:e.fontSizePx)||13.3333}px`,"--bn-font-color":(null===(s=t.global)||void 0===s?void 0:s.fontColor)||"#000000","--bn-font-background":(null===(o=t.global)||void 0===o?void 0:o.fontBackgroundColor)||"#ffffff"}}))}render(){const t="equal"===this.resolvedWidth,s=Object.assign(Object.assign({display:t?"grid":"inline-grid"},t?{width:"100%"}:{}),{"grid-template-columns":this.getGridTemplateColumns(),"grid-template-rows":this.getGridTemplateRows(),gap:this.cellGap});return i(e,{key:"643b4d675bac89c542618e7d6ec5f2c0ef8d6d6c",style:t?Object.assign(Object.assign({},this.getFontStyles()),{display:"block"}):this.getFontStyles()},i("div",{key:"4bc671a6868b313c809f37aeb2f32ca30c7e9142",class:"grid-container",style:s},this.renderTitle(),this.renderColumnHeaders(),this.renderDataCells()),i("slot",{key:"5e66d95c65a0bad59d3816cf0009bb88fbe53f9c"}))}get element(){return s(this)}static get watchers(){return{rowHeaders:[{validateRowHeaders:0}],columnHeaders:[{validateColumnHeaders:0}],cellHeight:[{validateCellHeight:0}],cellWidth:[{validateCellWidth:0}],cellVerticalAlign:[{validateCellVerticalAlign:0}],cellHorizontalAlign:[{validateCellHorizontalAlign:0}],cellCaptions:[{validateCellCaptions:0}]}}};j.style=':host{display:inline-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)}.grid-container{display:inline-grid;box-sizing:border-box}.grid-title{font-weight:normal;padding-bottom:8px}.grid-header{display:flex;align-items:flex-end;box-sizing:border-box}.grid-header-row{justify-content:flex-end;padding-right:8px}.grid-header-col{white-space:nowrap;justify-content:flex-start}.grid-cell{position:relative;box-sizing:border-box}';export{j as bn_grid}
1
+ import{r as t,h as i,a as e,g as s}from"./p-CCZcKl0Q.js";import{LAYOUT_STATE_VERSION as o}from"./index.esm.js";import{l as n,o as l,r,m as a,a as d}from"./p-qpZjVnX5.js";import{w as h,a as c}from"./p-D0tNATZq.js";import{w as u,a as v}from"./p-EcC0qLtU.js";function f(t){if(!t||""===t.trim()||"[]"===t)return[];try{const i=JSON.parse(t);return Array.isArray(i)?i.map(((t,i)=>{var e,s,o;return"string"==typeof t?{label:t,id:String(i)}:"object"==typeof t&&null!==t?{label:null!==(s=null!==(e=t.label)&&void 0!==e?e:t.name)&&void 0!==s?s:String(i),id:null!==(o=t.id)&&void 0!==o?o:String(i)}:{label:String(t),id:String(i)}})):[]}catch(t){return console.error("parseHeaders: failed to parse JSON",t),[]}}function g(t,i){return`${t.id}-${i.id}`}function p(t){if(!t||""===t.trim()||"[]"===t)return[];try{const i=JSON.parse(t);if(!Array.isArray(i))return["Headers must be an array"];const e=[],s=new Set;return i.forEach(((t,i)=>{"object"==typeof t&&null!==t&&void 0!==t.id&&("string"!=typeof t.id?e.push(`Header[${i}]: 'id' must be a string`):s.has(t.id)?e.push(`Header[${i}]: duplicate id '${t.id}'`):s.add(t.id),void 0!==t.label&&"string"!=typeof t.label&&e.push(`Header[${i}]: 'label' must be a string`))})),e}catch(t){return console.error("validateHeadersJson: failed to parse JSON",t),["Invalid JSON structure"]}}const b=["auto","equal"],m=["top","center","bottom","baseline"],y=["left","center","right","baseline"],w={top:"flex-start",center:"center",bottom:"flex-end",baseline:"flex-start"},x={left:"stretch",center:"center",right:"flex-end",baseline:"stretch"},C=t=>Math.round(100*t)/100,S=new Set(["bn-asset","bn-component-style","bn-dataset","bn-datasource","bn-internationalization","bn-ruleset","bn-scaling-group"]),$=new Set(["bn-layout-card"]),H={top:"--bn-baseline-offset-top",left:"--bn-baseline-offset-left",right:"--bn-baseline-offset-right"},j=class{validateRowHeaders(t){const i="ERR_rowHeaders",e=p(t);e.length>0?this.errors.addOrReplace({id:i,type:"error",message:`row-headers: ${e.join("; ")}`}):this.errors.remove(i),this.updateGridConfig()}validateColumnHeaders(t){const i="ERR_columnHeaders",e=p(t);e.length>0?this.errors.addOrReplace({id:i,type:"error",message:`column-headers: ${e.join("; ")}`}):this.errors.remove(i),this.updateGridConfig()}validateCellHeight(t){this.resolvedHeight=this.validateChoice("cell-height","ERR_cellHeight",t,b,"auto")}validateCellWidth(t){this.resolvedWidth=this.validateChoice("cell-width","ERR_cellWidth",t,b,"auto")}validateCellVerticalAlign(t){this.resolvedVertical=this.validateChoice("cell-vertical-align","ERR_cellVerticalAlign",t,m,"top"),this.schedule()}validateCellHorizontalAlign(t){this.resolvedHorizontal=this.validateChoice("cell-horizontal-align","ERR_cellHorizontalAlign",t,y,"left"),this.schedule()}validateCellCaptions(t){const i=function(t){if(void 0===t||""===t.trim())return{};let i;try{i=JSON.parse(t)}catch(t){return}if("object"!=typeof i||null===i||Array.isArray(i))return;const e={};for(const[t,s]of Object.entries(i)){if("string"!=typeof s)return;""!==s&&(e[t]=s)}return e}(t);i?this.errors.remove("ERR_cellCaptions"):this.errors.addOrReplace({id:"ERR_cellCaptions",type:"error",message:"cell-captions: not a JSON object from slot name to text."}),this.captions=null!=i?i:{}}constructor(i){t(this,i),this.gridConfig={rows:[],columns:[]},this.resolvedHeight="auto",this.resolvedWidth="auto",this.resolvedVertical="top",this.resolvedHorizontal="left",this.captions={},this.offsets={},this.frames=new Map,this.observed=new WeakSet,this.scheduled=!1,this.run=0,this.adjustments=0,this.chartTitle="",this.rowHeaders="[]",this.columnHeaders="[]",this.showRowHeaders=!0,this.showColumnHeaders=!0,this.showBorders=!0,this.rowHeaderWidth="auto",this.cellGap="0px",this.cellHeight="auto",this.cellWidth="auto",this.cellVerticalAlign="top",this.cellHorizontalAlign="left",this.cellCaptions="",this.schedule=()=>{if(!this.isBaselineMode())return this.run++,Object.keys(this.offsets).length>0&&(this.offsets={}),void this.applyFrameOffsets();this.scheduled||(this.scheduled=!0,this.holdStatus(new Promise((t=>{requestAnimationFrame((()=>{this.scheduled=!1,this.align().catch((t=>console.error("bn-grid: aligning the baselines failed",t))).finally(t)}))}))))},u(this),this.holdStatus=h(this),this.errors=c(this),this.componentStyle=v(this)}connectedCallback(){var t;this.observed=new WeakSet,this.resizeObserver=new ResizeObserver(this.schedule),this.mutationObserver=new MutationObserver(this.schedule),this.mutationObserver.observe(this.element,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["slot"]}),null===(t=document.fonts)||void 0===t||t.addEventListener("loadingdone",this.schedule)}disconnectedCallback(){var t,i,e;null===(t=this.resizeObserver)||void 0===t||t.disconnect(),null===(i=this.mutationObserver)||void 0===i||i.disconnect(),null===(e=document.fonts)||void 0===e||e.removeEventListener("loadingdone",this.schedule),this.run++}componentDidRender(){this.schedule()}validateChoice(t,i,e,s,o){return null==e||""===e?(this.errors.remove(i),o):s.includes(e)?(this.errors.remove(i),e):(this.errors.addOrReplace({id:i,type:"error",message:`${t}: "${e}" is not one of ${s.join(", ")}.`}),o)}isBaselineMode(){return"baseline"===this.resolvedVertical||"baseline"===this.resolvedHorizontal}contentIn(t){const i=Array.from(this.element.children).find((i=>i.getAttribute("slot")===t));if(!i)return{};const e=[i,...Array.from(i.querySelectorAll("*"))],s=e.find((t=>t.localName.startsWith("bn-")&&!S.has(t.localName)&&!$.has(t.localName))),o=s?e.find((t=>$.has(t.localName)&&t.contains(s))):void 0;return{visual:s,frame:o}}applyFrameOffsets(){this.frames.forEach(((t,i)=>{const e=this.offsets[i];Object.keys(H).forEach((i=>{const s=null==e?void 0:e[i];s?t.style.setProperty(H[i],`${s}px`):t.style.removeProperty(H[i])}))}))}async align(){var t;const i=++this.run;if(!this.element.isConnected||!this.isBaselineMode())return;const{rows:e,columns:s}=this.gridConfig,o=e.flatMap(((t,i)=>s.map(((e,s)=>({slot:g(t,e),row:i,column:s}))))),l=o.map((({slot:t})=>this.contentIn(t))),r=l.map((t=>t.visual));if(await Promise.all(r.map((t=>{var i;return null===(i=null==t?void 0:t.componentOnReady)||void 0===i?void 0:i.call(t)}))),i!==this.run)return;r.forEach((t=>t&&this.observe(t)));const a=await Promise.all(r.map((t=>"function"==typeof(null==t?void 0:t.getBaseline)?t.getBaseline().catch((()=>({}))):Promise.resolve({}))));if(i!==this.run)return;const d=n(this.element),h=new Map;null===(t=this.element.shadowRoot)||void 0===t||t.querySelectorAll(".grid-slot").forEach((t=>{var i;h.set(null!==(i=t.getAttribute("data-slot"))&&void 0!==i?i:"",t)})),this.frames=new Map,l.forEach((({frame:t},i)=>t&&this.frames.set(o[i].slot,t)));const c=function(t,i,e){const s={};for(const i of t)s[i.slot]={};const o=(i,e,o,n)=>{var l;const r=new Map;for(const e of t)r.set(e[i],[...null!==(l=r.get(e[i]))&&void 0!==l?l:[],e]);for(const t of r.values()){const i=t.map((t=>{const i=e(t);return void 0===i?void 0:i-o(t)})),l=i.filter((t=>void 0!==t)),r=l.length>0?Math.max(...l):0,a=i.map((t=>void 0===t?void 0:C(r-t))),d=Math.max(0,...a.filter((t=>void 0!==t)));t.forEach(((t,i)=>n(s[t.slot],a[i],d)))}};return i&&o("row",(t=>t.y),(t=>t.top),((t,i)=>{void 0===i?t.bottom=!0:t.top=i})),e&&o("column",(t=>t.x),(t=>t.left),((t,i,e)=>{void 0!==i&&(t.left=i);const s=C(e-(null!=i?i:0));s>0&&(t.right=s)})),s}(o.map((({slot:t,row:i,column:e},s)=>{const o=r[s],n=a[s],c=l[s].frame,u=null!=c?c:h.get(t),v=t=>parseFloat((null==u?void 0:u.style.getPropertyValue(t))||"0")||0,f=c?{slot:t,row:i,column:e,top:v(H.top),left:v(H.left)}:{slot:t,row:i,column:e,top:v("padding-top"),left:v("margin-left")};if(o){const t=d.toLocal(o.getBoundingClientRect());void 0!==n.y&&(f.y=t.y+n.y),void 0!==n.x&&(f.x=t.x+n.x)}return f})),"baseline"===this.resolvedVertical,"baseline"===this.resolvedHorizontal);if(function(t,i){var e,s,o,n,l,r,a,d;const h=new Set([...Object.keys(t),...Object.keys(i)]);for(const c of h){const h=null!==(e=t[c])&&void 0!==e?e:{},u=null!==(s=i[c])&&void 0!==s?s:{};if(Boolean(h.bottom)!==Boolean(u.bottom))return!1;if(Math.abs((null!==(o=h.top)&&void 0!==o?o:0)-(null!==(n=u.top)&&void 0!==n?n:0))>=.5)return!1;if(Math.abs((null!==(l=h.left)&&void 0!==l?l:0)-(null!==(r=u.left)&&void 0!==r?r:0))>=.5)return!1;if(Math.abs((null!==(a=h.right)&&void 0!==a?a:0)-(null!==(d=u.right)&&void 0!==d?d:0))>=.5)return!1}return!0}(c,this.offsets))this.adjustments=0;else{if(this.adjustments>=5)return console.warn("bn-grid: the baselines did not settle; the cells keep their last alignment."),void(this.adjustments=0);this.adjustments++,this.offsets=c,this.applyFrameOffsets(),this.schedule()}}observe(t){var i;this.observed.has(t)||(this.observed.add(t),null===(i=this.resizeObserver)||void 0===i||i.observe(t));const e=t=>{var i;t&&(this.observed.has(t)||(this.observed.add(t),null===(i=this.mutationObserver)||void 0===i||i.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["x1","y1","x2","y2","x","y","width","height","transform","style","class"]})),t.querySelectorAll("*").forEach((t=>e(t.shadowRoot))))};e(t.shadowRoot)}async getLayoutState(t){var i,e,s,n;const h=null!==(i=null==t?void 0:t.detail)&&void 0!==i?i:"summary",c=l(this.element),u=this.componentStyle((t=>{var i;return(null===(i=t.global)||void 0===i?void 0:i.fontSizePx)||13.3333})),{rows:v,columns:f}=this.gridConfig,g={version:o,tag:this.element.localName,id:d(this.element),slot:null!==(e=this.element.getAttribute("slot"))&&void 0!==e?e:void 0,rect:a(this.element,c),em:{fontSizePx:u,appliedScaleFactor:1},regions:[],metadata:{title:this.chartTitle||void 0,rowCount:v.length,columnCount:f.length,cellCount:v.length*f.length},diagnostics:r(this.element)},p=null===(s=this.element.shadowRoot)||void 0===s?void 0:s.querySelector(".grid-container");if(p&&g.regions.push({id:"grid",rect:a(p,c)}),"full"!==h||!p)return g;const b=[],m=t=>b.push(t),y=p.querySelector(".grid-title");return y&&m({kind:"gridTitle",label:(null===(n=y.textContent)||void 0===n?void 0:n.trim())||void 0,rect:a(y,c)}),p.querySelectorAll(".grid-header-col").forEach(((t,i)=>{var e,s;m({kind:"gridHeader",columnId:null===(e=f[i])||void 0===e?void 0:e.id,label:(null===(s=t.textContent)||void 0===s?void 0:s.trim())||void 0,rect:a(t,c)})})),p.querySelectorAll(".grid-header-row").forEach(((t,i)=>{var e,s;m({kind:"gridHeader",rowId:null===(e=v[i])||void 0===e?void 0:e.id,label:(null===(s=t.textContent)||void 0===s?void 0:s.trim())||void 0,rect:a(t,c)})})),p.querySelectorAll(".grid-cell").forEach(((t,i)=>{var e,s,o,n;m({kind:"gridCell",rowId:f.length>0?null===(e=v[Math.floor(i/f.length)])||void 0===e?void 0:e.id:void 0,columnId:f.length>0?null===(s=f[i%f.length])||void 0===s?void 0:s.id:void 0,slot:null!==(n=null===(o=t.querySelector("slot"))||void 0===o?void 0:o.getAttribute("name"))&&void 0!==n?n:void 0,rect:a(t,c)})})),p.querySelectorAll(".grid-caption").forEach((t=>{var i,e,s,o;m({kind:"gridCaption",slot:null!==(s=null===(e=null===(i=t.parentElement)||void 0===i?void 0:i.querySelector("slot"))||void 0===e?void 0:e.getAttribute("name"))&&void 0!==s?s:void 0,label:(null===(o=t.textContent)||void 0===o?void 0:o.trim())||void 0,rect:a(t,c)})})),g.elements=b,g}getGridStyle(){return this.componentStyle((t=>t["bn-grid"]))}componentWillLoad(){this.validateRowHeaders(this.rowHeaders),this.validateColumnHeaders(this.columnHeaders),this.validateCellHeight(this.cellHeight),this.validateCellWidth(this.cellWidth),this.validateCellVerticalAlign(this.cellVerticalAlign),this.validateCellHorizontalAlign(this.cellHorizontalAlign),this.validateCellCaptions(this.cellCaptions)}updateGridConfig(){var t;this.gridConfig=(t=this.columnHeaders,{rows:f(this.rowHeaders),columns:f(t)})}shouldShowRowHeaders(){return this.showRowHeaders&&this.gridConfig.rows.length>0}shouldShowColumnHeaders(){return this.showColumnHeaders&&this.gridConfig.columns.length>0}shouldShowBorders(){return this.showBorders}getGridTemplateColumns(){const t=[];this.shouldShowRowHeaders()&&t.push(this.rowHeaderWidth);const i=this.gridConfig.columns.length||1;for(let e=0;e<i;e++)t.push("equal"===this.resolvedWidth?"minmax(0, 1fr)":"auto");return t.join(" ")}getGridTemplateRows(){const t=[];this.chartTitle&&t.push("auto"),this.shouldShowColumnHeaders()&&t.push("auto");const i=this.gridConfig.rows.length||1;for(let e=0;e<i;e++)t.push("equal"===this.resolvedHeight?"1fr":"auto");return t.join(" ")}renderTitle(){if(!this.chartTitle)return null;const t=(this.shouldShowRowHeaders()?1:0)+this.gridConfig.columns.length;return i("div",{class:"grid-title",style:{"grid-column":`1 / span ${t}`,"grid-row":"1"}},this.chartTitle)}renderColumnHeaders(){if(!this.shouldShowColumnHeaders())return null;const t=this.getGridStyle(),e=this.shouldShowBorders()?`${t.borderWidth}px solid ${t.borderColor}`:"none",s=this.shouldShowRowHeaders()?2:1,o=this.chartTitle?2:1;return this.gridConfig.columns.map(((n,l)=>{const r=l>0;return i("div",{key:`col-header-${n.id}`,class:"grid-header grid-header-col",style:{"grid-column":String(s+l),"grid-row":String(o),"border-left":r?e:"none",padding:`${t.cellPadding}px`,"padding-left":r?`${t.cellPadding+4}px`:`${t.cellPadding}px`}},n.label)}))}renderDataCells(){const t=this.getGridStyle(),e=this.shouldShowBorders()?`${t.borderWidth}px solid ${t.borderColor}`:"none",s=this.shouldShowRowHeaders()?2:1,o=(this.chartTitle?1:0)+(this.shouldShowColumnHeaders()?1:0)+1,n=[];return this.gridConfig.rows.length>0&&this.gridConfig.columns.length>0&&this.gridConfig.rows.forEach(((l,r)=>{if(this.shouldShowRowHeaders()){const s=r>0;n.push(i("div",{key:`row-header-${l.id}`,class:"grid-header grid-header-row",style:{"grid-column":"1","grid-row":String(o+r),"border-top":s?e:"none",padding:`${t.cellPadding}px`,"padding-top":s?`${t.cellPadding+4}px`:`${t.cellPadding}px`}},l.label))}this.gridConfig.columns.forEach(((a,d)=>{const h=g(l,a),c=d>0,u=r>0;n.push(i("div",{key:`cell-${h}`,class:"grid-cell",style:Object.assign({"grid-column":String(s+d),"grid-row":String(o+r),"border-left":c?e:"none","border-top":u?e:"none","padding-left":c?`${t.cellPadding+4}px`:"0","padding-top":u?`${t.cellPadding+4}px`:"0"},this.cellAlignStyle())},this.renderCellContent(h,t)))}))})),n}cellAlignStyle(){return"top"===this.resolvedVertical&&"left"===this.resolvedHorizontal?{}:{display:"flex","flex-direction":"column","justify-content":w[this.resolvedVertical],"align-items":x[this.resolvedHorizontal]}}renderCellContent(t,e){var s;const o=this.captions[t],n=void 0!==o?i("div",{class:"grid-caption",style:{"font-size":`${e.captionFontSize}px`,"font-weight":String(e.captionFontWeight),color:e.captionColor,"margin-bottom":`${e.captionGap}px`,"align-self":"flex-start"}},o):null,l={};"top"===this.resolvedVertical&&"left"===this.resolvedHorizontal||(l["align-self"]="stretch","center"!==this.resolvedHorizontal&&"right"!==this.resolvedHorizontal||(l.display="flex",l["flex-direction"]="column",l["align-items"]=x[this.resolvedHorizontal])),"center"===this.resolvedVertical?(l["margin-top"]="auto",l["margin-bottom"]="auto"):"bottom"===this.resolvedVertical&&(l["margin-top"]="auto");const r=this.frames.has(t)?{bottom:null===(s=this.offsets[t])||void 0===s?void 0:s.bottom}:this.offsets[t];return(null==r?void 0:r.bottom)&&(l["margin-top"]="auto"),(null==r?void 0:r.top)&&(l["padding-top"]=`${r.top}px`),(null==r?void 0:r.left)&&(l["margin-left"]=`${r.left}px`),(null==r?void 0:r.right)&&(l["margin-right"]=`${r.right}px`),[n,i("div",{class:"grid-slot","data-slot":t,style:l},i("slot",{name:t}))]}getFontStyles(){return this.componentStyle((t=>{var i,e,s,o;return{"--bn-font-family":(null===(i=t.global)||void 0===i?void 0:i.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":`${(null===(e=t.global)||void 0===e?void 0:e.fontSizePx)||13.3333}px`,"--bn-font-color":(null===(s=t.global)||void 0===s?void 0:s.fontColor)||"#000000","--bn-font-background":(null===(o=t.global)||void 0===o?void 0:o.fontBackgroundColor)||"#ffffff"}}))}render(){const t="equal"===this.resolvedWidth,s=Object.assign(Object.assign({display:t?"grid":"inline-grid"},t?{width:"100%"}:{}),{"grid-template-columns":this.getGridTemplateColumns(),"grid-template-rows":this.getGridTemplateRows(),gap:this.cellGap});return i(e,{key:"643b4d675bac89c542618e7d6ec5f2c0ef8d6d6c",style:t?Object.assign(Object.assign({},this.getFontStyles()),{display:"block"}):this.getFontStyles()},i("div",{key:"4bc671a6868b313c809f37aeb2f32ca30c7e9142",class:"grid-container",style:s},this.renderTitle(),this.renderColumnHeaders(),this.renderDataCells()),i("slot",{key:"5e66d95c65a0bad59d3816cf0009bb88fbe53f9c"}))}get element(){return s(this)}static get watchers(){return{rowHeaders:[{validateRowHeaders:0}],columnHeaders:[{validateColumnHeaders:0}],cellHeight:[{validateCellHeight:0}],cellWidth:[{validateCellWidth:0}],cellVerticalAlign:[{validateCellVerticalAlign:0}],cellHorizontalAlign:[{validateCellHorizontalAlign:0}],cellCaptions:[{validateCellCaptions:0}]}}};j.style=':host{display:inline-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)}.grid-container{display:inline-grid;box-sizing:border-box}.grid-title{font-weight:normal;padding-bottom:8px}.grid-header{display:flex;align-items:flex-end;box-sizing:border-box}.grid-header-row{justify-content:flex-end;padding-right:8px}.grid-header-col{white-space:nowrap;justify-content:flex-start}.grid-cell{position:relative;box-sizing:border-box}';export{j as bn_grid}
@@ -1 +1 @@
1
- import{r as t,f as n,h as i,a as o,g as s}from"./p-CCZcKl0Q.js";import{w as e,a,g as l,p as r,s as d}from"./p-DyupX-Z-.js";import{w as u,a as c}from"./p-D0tNATZq.js";import{w as f,a as v}from"./p-BVU4bIsi.js";const h="[A-Za-z_$\\u00C0-\\uFFFF][\\w$\\u00C0-\\uFFFF]*",p="'[^'\\\\]*'|\"[^\"\\\\]*\"",b=`(?:this\\.)?data(?:\\.(${h})|\\[\\s*(${p})\\s*\\])\\[\\s*(\\d+)\\s*\\]\\.(${h})`,g=new RegExp(`\\$\\{\\s*(?:${b}|t\\(\\s*(${p})\\s*(?:,\\s*\\{([^{}]*)\\}\\s*)?\\))\\s*\\}`,"g"),m=new RegExp(`\\s*(?:(${h})|(${p}))\\s*:\\s*(?:(${p})|(-?\\d+(?:\\.\\d+)?)|(${b}))\\s*(?:,|$)`,"y"),$=t=>String(t).replace(/[&<>"'\t\n\f\r ]/g,(t=>`&#${t.charCodeAt(0)};`)),w=(t,n)=>"object"==typeof t&&null!==t&&Object.prototype.hasOwnProperty.call(t,n)?t[n]:void 0,y=t=>t.slice(1,-1);const N=class{constructor(i){t(this,i),this.refit=()=>{n(this)},this.data={},f(this),u(this),this.errors=c(this),this.t=e(this).t,a(this,((t,n)=>{this.data=""===t?{}:Object.assign(Object.assign({},this.data),{[t]:n})})),this.componentStyle=v(this)}connectedCallback(){var t;null===(t=document.fonts)||void 0===t||t.addEventListener("loadingdone",this.refit)}disconnectedCallback(){var t;null===(t=document.fonts)||void 0===t||t.removeEventListener("loadingdone",this.refit)}validateValue(t){"string"!=typeof t||""===t?this.errors.addOrReplace({id:"WARN_value",type:"warning",message:"Empty value"}):this.errors.remove("WARN_value")}validateScaling(t){if(null==t||""===t||"none"===t||"auto"===t)return void this.errors.remove("WARN_scale");const n=Number(t);isNaN(n)||n<=0?this.errors.addOrReplace({id:"WARN_scale",type:"warning",message:`Invalid scale value: "${t}". Use "none", "auto", or a positive number.`}):this.errors.remove("WARN_scale")}componentWillLoad(){this.validateValue(this.value),this.validateScaling(this.scale)}prepareStyle(){return this.componentStyle((t=>{var n,i,o,s,e,a,l,r,d,u,c,f,v,h,p,b,g,m,$,w,y,N;return{fontStyles:{font:`${null!==(s=null!==(i=null===(n=t["bn-text"])||void 0===n?void 0:n.fontSizePx)&&void 0!==i?i:null===(o=t.global)||void 0===o?void 0:o.fontSizePx)&&void 0!==s?s:13.3333}px ${null!==(r=null!==(a=null===(e=t["bn-text"])||void 0===e?void 0:e.fontFamily)&&void 0!==a?a:null===(l=t.global)||void 0===l?void 0:l.fontFamily)&&void 0!==r?r:"'Noto Sans', sans-serif"}`,size:null!==(f=null!==(u=null===(d=t["bn-text"])||void 0===d?void 0:d.fontSizePx)&&void 0!==u?u:null===(c=t.global)||void 0===c?void 0:c.fontSizePx)&&void 0!==f?f:13.3333,color:null!==(b=null!==(h=null===(v=t["bn-text"])||void 0===v?void 0:v.fontColor)&&void 0!==h?h:null===(p=t.global)||void 0===p?void 0:p.fontColor)&&void 0!==b?b:"#000000",background:null!==(w=null!==(m=null===(g=t["bn-text"])||void 0===g?void 0:g.fontBackgroundColor)&&void 0!==m?m:null===($=t.global)||void 0===$?void 0:$.fontBackgroundColor)&&void 0!==w?w:"#ffffff",leading:null!==(N=null===(y=t["bn-text"])||void 0===y?void 0:y.leading)&&void 0!==N?N:1.8}}}))}applyScaling(t){const n=this.element,{mode:i,factor:o}=r(this.scale),{width:s,height:e}=l(n),a=n.scrollHeight>n.clientHeight+1?n.clientHeight:e,d=s,u=d>0&&n.scrollWidth>d+1,c=a>0&&n.scrollHeight>a+1,f=u||c;if(d<=0&&a<=0)return;if("none"===i){if(f){const t=[];u&&t.push(`w:${n.scrollWidth}>${Math.round(d)}`),c&&t.push(`h:${n.scrollHeight}>${Math.round(a)}`),this.errors.addOrReplace({id:"WARN_overflow",type:"warning",message:`Content overflows container (${t.join(", ")})`})}else this.errors.remove("WARN_overflow");return}if("factor"===i){if(f){const t=[];u&&t.push(`w:${n.scrollWidth}>${Math.round(d)}`),c&&t.push(`h:${n.scrollHeight}>${Math.round(a)}`),this.errors.addOrReplace({id:"WARN_overflow",type:"warning",message:`Content overflows with factor ${o} (${t.join(", ")})`})}else this.errors.remove("WARN_overflow");return}n.style.setProperty("--bn-font-size",`${t}px`);const v=n.scrollWidth,h=n.scrollHeight,p=n.clientHeight,b=h>p+1?p:e,g=d<=0||v<=d+1,m=b<=0||h<=b+1;if(g&&m)return void this.errors.remove("AUTO_scale");const $=Math.min(1,!g&&d>0?d/v:1,!m&&b>0?b/h:1);n.style.setProperty("--bn-font-size",t*$+"px"),"empty"===i?this.errors.addOrReplace({id:"AUTO_scale",type:"warning",message:`Auto-scaled font by factor ${$.toFixed(3)}`}):this.errors.remove("AUTO_scale")}componentDidRender(){var t;const{html:n,unknown:i}=function(t,n,i){const o=[],s=t=>{o.includes(t)||o.push(t)},e=(t,i,o,e,a)=>{const l=w(w(w(n,null!=i?i:y(o)),String(Number(e))),a);return void 0===l&&s(t),l};return{html:t.replace(g,((t,n,o,a,l,r,d)=>{const u=t.slice(2,-1).trim();try{if(void 0===r){const t=e(u,n,o,a,l);return null==t?"":$(t)}const s=void 0===d?void 0:(t=>{const n={};for(m.lastIndex=0;""!==t.slice(m.lastIndex).trim();){const i=m.exec(t);if(!i)return null;const[,o,s,a,l,r,d,u,c,f]=i;n[null!=o?o:y(s)]=void 0!==a?y(a):void 0!==l?Number(l):e(r,d,u,c,f)}return n})(d);return null===s?t:$(i(y(r),s))}catch(t){return s(u),""}})),unknown:o}}(null!==(t=this.value)&&void 0!==t?t:"",this.data,this.t);i.length>0?this.errors.addOrReplace({id:"WARN_value_path",type:"warning",message:`Unknown template path: ${i.join(", ")}`}):this.errors.remove("WARN_value_path"),this.container.innerHTML=d(n),this.applyScaling(this.prepareStyle().fontStyles.size)}render(){const{fontStyles:t}=this.prepareStyle(),{mode:n,factor:s}=r(this.scale),e="factor"===n?t.size*s+"px":`${t.size}px`,a={"--bn-font-family":t.font.substring(t.font.indexOf("px ")+3),"--bn-font-size":e,"--bn-font-color":t.color,"--bn-font-background":t.background};return i(o,{key:"47eaf1468ffc8b8de7e77f2b0aff4b927f8b0471",style:a},i("div",{key:"1f592c2fd0a4af77047c56ee043f6bdd84dfb2d2"},i("span",{key:"ecad3e6ea36dfa495ef78183fc6c3979eb9d5be2",class:"container",ref:t=>{this.container=t}})))}get element(){return s(this)}static get watchers(){return{value:[{validateValue:0}],scale:[{validateScaling:0}]}}};N.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{N as bn_text}
1
+ import{r as t,f as n,h as i,a as o,g as s}from"./p-CCZcKl0Q.js";import{w as e,a,g as l,p as r,s as d}from"./p-BjozxTTW.js";import{w as c,a as u}from"./p-D0tNATZq.js";import{w as f,a as v}from"./p-EcC0qLtU.js";const h="[A-Za-z_$\\u00C0-\\uFFFF][\\w$\\u00C0-\\uFFFF]*",p="'[^'\\\\]*'|\"[^\"\\\\]*\"",g=`(?:this\\.)?data(?:\\.(${h})|\\[\\s*(${p})\\s*\\])\\[\\s*(\\d+)\\s*\\]\\.(${h})`,b=new RegExp(`\\$\\{\\s*(?:${g}|t\\(\\s*(${p})\\s*(?:,\\s*\\{([^{}]*)\\}\\s*)?\\))\\s*\\}`,"g"),m=new RegExp(`\\s*(?:(${h})|(${p}))\\s*:\\s*(?:(${p})|(-?\\d+(?:\\.\\d+)?)|(${g}))\\s*(?:,|$)`,"y"),$=t=>String(t).replace(/[&<>"'\t\n\f\r ]/g,(t=>`&#${t.charCodeAt(0)};`)),w=(t,n)=>"object"==typeof t&&null!==t&&Object.prototype.hasOwnProperty.call(t,n)?t[n]:void 0,y=t=>t.slice(1,-1);const N=class{constructor(i){t(this,i),this.refit=()=>{n(this)},this.data={},f(this),c(this),this.errors=u(this),this.t=e(this).t,a(this,((t,n)=>{this.data=""===t?{}:Object.assign(Object.assign({},this.data),{[t]:n})})),this.componentStyle=v(this)}connectedCallback(){var t;null===(t=document.fonts)||void 0===t||t.addEventListener("loadingdone",this.refit)}disconnectedCallback(){var t;null===(t=document.fonts)||void 0===t||t.removeEventListener("loadingdone",this.refit)}validateValue(t){"string"!=typeof t||""===t?this.errors.addOrReplace({id:"WARN_value",type:"warning",message:"Empty value"}):this.errors.remove("WARN_value")}validateScaling(t){if(null==t||""===t||"none"===t||"auto"===t)return void this.errors.remove("WARN_scale");const n=Number(t);isNaN(n)||n<=0?this.errors.addOrReplace({id:"WARN_scale",type:"warning",message:`Invalid scale value: "${t}". Use "none", "auto", or a positive number.`}):this.errors.remove("WARN_scale")}componentWillLoad(){this.validateValue(this.value),this.validateScaling(this.scale)}prepareStyle(){return this.componentStyle((t=>{var n,i,o,s,e,a,l,r,d,c,u,f,v,h,p,g,b,m,$,w,y,N;return{fontStyles:{font:`${null!==(s=null!==(i=null===(n=t["bn-text"])||void 0===n?void 0:n.fontSizePx)&&void 0!==i?i:null===(o=t.global)||void 0===o?void 0:o.fontSizePx)&&void 0!==s?s:13.3333}px ${null!==(r=null!==(a=null===(e=t["bn-text"])||void 0===e?void 0:e.fontFamily)&&void 0!==a?a:null===(l=t.global)||void 0===l?void 0:l.fontFamily)&&void 0!==r?r:"'Noto Sans', sans-serif"}`,size:null!==(f=null!==(c=null===(d=t["bn-text"])||void 0===d?void 0:d.fontSizePx)&&void 0!==c?c:null===(u=t.global)||void 0===u?void 0:u.fontSizePx)&&void 0!==f?f:13.3333,color:null!==(g=null!==(h=null===(v=t["bn-text"])||void 0===v?void 0:v.fontColor)&&void 0!==h?h:null===(p=t.global)||void 0===p?void 0:p.fontColor)&&void 0!==g?g:"#000000",background:null!==(w=null!==(m=null===(b=t["bn-text"])||void 0===b?void 0:b.fontBackgroundColor)&&void 0!==m?m:null===($=t.global)||void 0===$?void 0:$.fontBackgroundColor)&&void 0!==w?w:"#ffffff",leading:null!==(N=null===(y=t["bn-text"])||void 0===y?void 0:y.leading)&&void 0!==N?N:1.8}}}))}applyScaling(t){const n=this.element,{mode:i,factor:o}=r(this.scale),{width:s,height:e}=l(n),a=n.scrollHeight>n.clientHeight+1?n.clientHeight:e,d=s,c=d>0&&n.scrollWidth>d+1,u=a>0&&n.scrollHeight>a+1,f=c||u;if(d<=0&&a<=0)return;if("none"===i){if(f){const t=[];c&&t.push(`w:${n.scrollWidth}>${Math.round(d)}`),u&&t.push(`h:${n.scrollHeight}>${Math.round(a)}`),this.errors.addOrReplace({id:"WARN_overflow",type:"warning",message:`Content overflows container (${t.join(", ")})`})}else this.errors.remove("WARN_overflow");return}if("factor"===i){if(f){const t=[];c&&t.push(`w:${n.scrollWidth}>${Math.round(d)}`),u&&t.push(`h:${n.scrollHeight}>${Math.round(a)}`),this.errors.addOrReplace({id:"WARN_overflow",type:"warning",message:`Content overflows with factor ${o} (${t.join(", ")})`})}else this.errors.remove("WARN_overflow");return}n.style.setProperty("--bn-font-size",`${t}px`);const v=n.scrollWidth,h=n.scrollHeight,p=n.clientHeight,g=h>p+1?p:e,b=d<=0||v<=d+1,m=g<=0||h<=g+1;if(b&&m)return void this.errors.remove("AUTO_scale");const $=Math.min(1,!b&&d>0?d/v:1,!m&&g>0?g/h:1);n.style.setProperty("--bn-font-size",t*$+"px"),"empty"===i?this.errors.addOrReplace({id:"AUTO_scale",type:"warning",message:`Auto-scaled font by factor ${$.toFixed(3)}`}):this.errors.remove("AUTO_scale")}componentDidRender(){var t;const{html:n,unknown:i}=function(t,n,i){const o=[],s=t=>{o.includes(t)||o.push(t)},e=(t,i,o,e,a)=>{const l=w(w(w(n,null!=i?i:y(o)),String(Number(e))),a);return void 0===l&&s(t),l};return{html:t.replace(b,((t,n,o,a,l,r,d)=>{const c=t.slice(2,-1).trim();try{if(void 0===r){const t=e(c,n,o,a,l);return null==t?"":$(t)}const s=void 0===d?void 0:(t=>{const n={};for(m.lastIndex=0;""!==t.slice(m.lastIndex).trim();){const i=m.exec(t);if(!i)return null;const[,o,s,a,l,r,d,c,u,f]=i;n[null!=o?o:y(s)]=void 0!==a?y(a):void 0!==l?Number(l):e(r,d,c,u,f)}return n})(d);return null===s?t:$(i(y(r),s))}catch(t){return s(c),""}})),unknown:o}}(null!==(t=this.value)&&void 0!==t?t:"",this.data,this.t);i.length>0?this.errors.addOrReplace({id:"WARN_value_path",type:"warning",message:`Unknown template path: ${i.join(", ")}`}):this.errors.remove("WARN_value_path"),this.container.innerHTML=d(n),this.applyScaling(this.prepareStyle().fontStyles.size)}render(){const{fontStyles:t}=this.prepareStyle(),{mode:n,factor:s}=r(this.scale),e="factor"===n?t.size*s+"px":`${t.size}px`,a={"--bn-font-family":t.font.substring(t.font.indexOf("px ")+3),"--bn-font-size":e,"--bn-font-color":t.color,"--bn-font-background":t.background};return i(o,{key:"47eaf1468ffc8b8de7e77f2b0aff4b927f8b0471",style:a},i("div",{key:"1f592c2fd0a4af77047c56ee043f6bdd84dfb2d2"},i("span",{key:"ecad3e6ea36dfa495ef78183fc6c3979eb9d5be2",class:"container",ref:t=>{this.container=t}})))}get element(){return s(this)}static get watchers(){return{value:[{validateValue:0}],scale:[{validateScaling:0}]}}};N.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{N as bn_text}