scb-wc 0.1.57 → 0.1.59
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.
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{_ as g,b as _,g as v,h as b,y as C}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as f}from"../../vendor/decorate.js";import"../scb-icon-button/scb-icon-button.js";(function(){try{var y=typeof globalThis<"u"?globalThis:window;if(!y.__scb_ce_guard_installed__){y.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(r,s,t){try{customElements.get(r)||e(r,s,t)}catch(
|
|
1
|
+
import{_ as g,b as _,g as v,h as b,y as C}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as f}from"../../vendor/decorate.js";import"../scb-icon-button/scb-icon-button.js";(function(){try{var y=typeof globalThis<"u"?globalThis:window;if(!y.__scb_ce_guard_installed__){y.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(r,s,t){try{customElements.get(r)||e(r,s,t)}catch(a){var l=String(a||"");if(l.indexOf("already been used")===-1&&l.indexOf("NotSupportedError")===-1)throw a}}}}catch{}})();var p,w=88,S=16,m=(p=class extends g{constructor(...e){super(...e),this.dataSorting=!1,this.columnWidthMode="auto",this._sortedColumn=null,this._sortDirection="asc",this._columnWidthFrame=null,this._onSlotChange=()=>{this._attachThListeners()}}render(){return C`
|
|
2
2
|
<div class="scb-table-scroll-wrapper">
|
|
3
3
|
<slot @slotchange=${this._onSlotChange}></slot>
|
|
4
4
|
</div>
|
|
5
|
-
`}firstUpdated(){const e=this.shadowRoot?.querySelector("slot");e&&(e.addEventListener("slotchange",()=>this._attachThListeners()),this._attachThListeners())}updated(e){e.has("dataSorting")&&(this.dataSorting||(this._sortedColumn=null,this._sortDirection="asc"),this._attachThListeners()),e.has("columnWidthMode")&&this._queueColumnWidthUpdate()}disconnectedCallback(){super.disconnectedCallback(),this._columnWidthFrame!==null&&(cancelAnimationFrame(this._columnWidthFrame),this._columnWidthFrame=null)}_getTbody(){const e=this.shadowRoot?.querySelector("slot");if(!e)return null;const r=e.assignedNodes({flatten:!0});for(const s of r)if(s.nodeType===Node.ELEMENT_NODE){const t=s,l=t.tagName.toLowerCase()==="tbody"?t:t.querySelector("tbody");if(l)return l}return null}_getTables(){const e=this.shadowRoot?.querySelector("slot");if(!e)return[];const r=e.assignedNodes({flatten:!0}),s=[];return r.forEach(t=>{if(t.nodeType===Node.ELEMENT_NODE){const l=t;l.tagName.toLowerCase()==="table"&&s.push(l),s.push(...Array.from(l.querySelectorAll("table")))}}),s}_attachThListeners(){const e=this.shadowRoot?.querySelector("slot");if(!e)return;const r=e.assignedNodes({flatten:!0}),s=[],t=[],l=[],
|
|
5
|
+
`}firstUpdated(){const e=this.shadowRoot?.querySelector("slot");e&&(e.addEventListener("slotchange",()=>this._attachThListeners()),this._attachThListeners())}updated(e){e.has("dataSorting")&&(this.dataSorting||(this._sortedColumn=null,this._sortDirection="asc"),this._attachThListeners()),e.has("columnWidthMode")&&this._queueColumnWidthUpdate()}disconnectedCallback(){super.disconnectedCallback(),this._columnWidthFrame!==null&&(cancelAnimationFrame(this._columnWidthFrame),this._columnWidthFrame=null)}_getTbody(){const e=this.shadowRoot?.querySelector("slot");if(!e)return null;const r=e.assignedNodes({flatten:!0});for(const s of r)if(s.nodeType===Node.ELEMENT_NODE){const t=s,l=t.tagName.toLowerCase()==="tbody"?t:t.querySelector("tbody");if(l)return l}return null}_getTables(){const e=this.shadowRoot?.querySelector("slot");if(!e)return[];const r=e.assignedNodes({flatten:!0}),s=[];return r.forEach(t=>{if(t.nodeType===Node.ELEMENT_NODE){const l=t;l.tagName.toLowerCase()==="table"&&s.push(l),s.push(...Array.from(l.querySelectorAll("table")))}}),s}_attachThListeners(){const e=this.shadowRoot?.querySelector("slot");if(!e)return;const r=e.assignedNodes({flatten:!0}),s=[],t=[],l=[],a=[];r.forEach(o=>{o.nodeType===Node.ELEMENT_NODE&&(s.push(...o.querySelectorAll("thead")),t.push(...o.querySelectorAll("th")),l.push(...o.querySelectorAll("td")),a.push(...o.querySelectorAll("tr")))}),s.forEach(o=>{o.style.borderTop="1px solid var(--md-sys-color-on-surface)"}),t.forEach((o,i)=>{o.style.textAlign="left",o.style.padding="12px",o.style.position="relative",o.style.backgroundColor="var(--md-sys-color-surface)",o.style.fontFamily="var(--md-sys-typescale-label-medium-font)",o.style.fontSize="var(--md-sys-typescale-label-medium-size)",o.style.lineHeight="var(--md-sys-typescale-label-medium-line-height)",o.style.fontWeight=" var(--weight-bold)",o.style.letterSpacing="var(--md-sys-typescale-label-medium-tracking)",o.style.verticalAlign="bottom",o.style.borderRight="1px solid var(--md-sys-color-on-surface)",o.style.borderBottom="1px solid var(--md-sys-color-on-surface)";const c=(o.textContent??"").replace(/\s+/g," ").trim();for(;o.firstChild;)o.removeChild(o.firstChild);const u=document.createElement("p");if(u.textContent=c,u.style.margin="0",this.dataSorting){const d=document.createElement("scb-icon-button");d.className="scb-sort-icon",d.onclick=()=>this._onThClick(i),d.setAttribute("variant","standard"),d.setAttribute("size","small"),d.style.alignSelf="end",this._sortedColumn===i?(d.setAttribute("variant","filled-tonal"),d.setAttribute("icon",this._sortDirection==="asc"?"arrow_downward":"arrow_upward")):(d.setAttribute("icon","swap_horiz"),d.style.transform+=" rotate(90deg)");const h=document.createElement("div");h.style.display="flex",h.style.gap="8px",h.style.flexWrap="nowrap",h.style.alignItems="center",h.appendChild(u),h.appendChild(d),o.appendChild(h)}else o.appendChild(u)}),l.forEach(o=>{o.style.padding="12px",o.style.textAlign="left",o.style.borderTop="1px solid var(--md-sys-color-outline-variant)",o.style.verticalAlign="text-top",o.style.backgroundColor="var(--md-sys-color-surface)",o.style.fontFamily="var(--md-sys-typescale-body-medium-font)",o.style.fontSize="var(--md-sys-typescale-body-medium-size)",o.style.lineHeight="var(--md-sys-typescale-body-medium-line-height)",o.style.fontWeight="var(--md-sys-typescale-body-medium-weight)",o.style.letterSpacing="var(--md-sys-typescale-body-medium-tracking)",o.style.borderRight="1px solid var(--md-sys-color-on-surface)",o.style.borderBottom="1px solid var(--md-sys-color-on-surface)",o.style.overflowWrap="break-word",o.style.wordBreak="normal",o.style.hyphens="manual"}),a.forEach(o=>{const i=Array.from(o.cells);i.forEach((c,u)=>{c.style.borderRight=u===i.length-1?"none":"1px solid var(--md-sys-color-on-surface)"})});const n=this._getTbody();n&&Array.from(n.querySelectorAll("tr")).forEach((o,i)=>{const c=i%2===0?"var(--md-sys-color-surface-container)":"var(--md-sys-color-surface)";Array.from(o.cells).forEach(u=>{u.style.backgroundColor=c})}),this._queueColumnWidthUpdate()}_queueColumnWidthUpdate(){this._columnWidthFrame!==null&&cancelAnimationFrame(this._columnWidthFrame),this._columnWidthFrame=requestAnimationFrame(()=>{this._columnWidthFrame=null,this._applyColumnWidthMode()})}_applyColumnWidthMode(){this._getTables().forEach(e=>{if(this._removeGeneratedColGroup(e),e.style.tableLayout="",e.style.width="",e.style.minWidth="",e.style.maxWidth="",this.columnWidthMode!=="header")return;const r=Array.from(e.querySelectorAll("thead tr")),s=r[r.length-1];if(!s)return;const t=Array.from(s.cells).map((a,n)=>{const o=this._measureCellContentWidth(a),i=this._measureColumnReadableBodyWidth(e,n),c=Math.max(o,i);return`${Math.ceil(c>0?Math.max(c,w):0)}px`}),l=t.reduce((a,n)=>a+parseFloat(n),0);this._applyGeneratedColGroup(e,t),e.style.tableLayout="fixed",e.style.width=`${Math.ceil(l)}px`,e.style.minWidth=`${Math.ceil(l)}px`,e.style.maxWidth="none"})}_applyGeneratedColGroup(e,r){const s=document.createElement("colgroup");s.setAttribute("data-scb-generated-column-widths","true"),r.forEach(t=>{const l=document.createElement("col");l.style.width=t,l.style.minWidth=t,s.appendChild(l)}),e.insertBefore(s,e.firstChild)}_removeGeneratedColGroup(e){e.querySelector('colgroup[data-scb-generated-column-widths="true"]')?.remove()}_measureCellContentWidth(e){const r=e.firstElementChild?.cloneNode(!0)??document.createElement("span");e.firstElementChild||(r.textContent=e.textContent??"");const s=window.getComputedStyle(e),t=document.createElement("div");t.style.position="absolute",t.style.left="-99999px",t.style.top="0",t.style.visibility="hidden",t.style.pointerEvents="none",t.style.width="max-content",t.style.maxWidth="none",t.style.whiteSpace="nowrap",t.style.fontFamily=s.fontFamily,t.style.fontSize=s.fontSize,t.style.fontWeight=s.fontWeight,t.style.lineHeight=s.lineHeight,t.style.letterSpacing=s.letterSpacing,r instanceof HTMLElement&&(r.style.width="max-content",r.style.maxWidth="none",r.style.whiteSpace="nowrap"),t.appendChild(r),document.body.appendChild(t);const l=parseFloat(s.paddingLeft||"0"),a=parseFloat(s.paddingRight||"0"),n=t.getBoundingClientRect().width+l+a;return document.body.removeChild(t),n}_measureColumnReadableBodyWidth(e,r){return Array.from(e.querySelectorAll("tbody tr")).reduce((s,t)=>{const l=t.cells[r];if(!l)return s;const a=(l.textContent??"").replace(/\s+/g," ").trim().split(" ").filter(Boolean).reduce((o,i)=>Math.max(o,this._measureCellTextWidth(l,i)),0),n=a>0?a+S:0;return Math.max(s,n)},0)}_measureCellTextWidth(e,r){const s=window.getComputedStyle(e),t=document.createElement("span");t.textContent=r,t.style.position="absolute",t.style.left="-99999px",t.style.top="0",t.style.visibility="hidden",t.style.pointerEvents="none",t.style.whiteSpace="nowrap",t.style.fontFamily=s.fontFamily,t.style.fontSize=s.fontSize,t.style.fontWeight=s.fontWeight,t.style.lineHeight=s.lineHeight,t.style.letterSpacing=s.letterSpacing,document.body.appendChild(t);const l=parseFloat(s.paddingLeft||"0"),a=parseFloat(s.paddingRight||"0"),n=t.getBoundingClientRect().width+l+a;return document.body.removeChild(t),n}_onThClick(e){this.dataSorting&&(this._sortedColumn===e?this._sortDirection=this._sortDirection==="asc"?"desc":"asc":(this._sortedColumn=e,this._sortDirection="asc"),this._sortTable(e,this._sortDirection),this._attachThListeners(),this.dispatchEvent(new CustomEvent("tablesortchange",{detail:{sortedColumn:this._sortedColumn,sortDirection:this._sortDirection},bubbles:!0,composed:!0})))}_sortTable(e,r){const s=this._getTbody();if(!s)return;const t=Array.from(s.querySelectorAll("tr"));t.sort((l,a)=>{const n=this._getCellSortableValue(l.children[e]),o=this._getCellSortableValue(a.children[e]);return this._compareCellValues(n,o,r)}),t.forEach(l=>s.appendChild(l))}_getCellSortableValue(e){if(!e)return"";const r=e,s=this._getSortableAttributeValue(r);if(s)return s;const t=[],l=r.textContent?.replace(/\s+/g," ").trim();return l&&t.push(l),r.querySelectorAll("[data-sort-value], [data-sort], [aria-label], [label], [value], [title]").forEach(a=>{const n=this._getSortableAttributeValue(a);n&&!t.includes(n)&&t.push(n)}),t.join(" ").trim()}_getSortableAttributeValue(e){return(e.getAttribute("data-sort-value")??e.getAttribute("data-sort")??e.getAttribute("aria-label")??e.getAttribute("label")??e.getAttribute("value")??e.getAttribute("title")??"").replace(/\s+/g," ").trim()}_compareCellValues(e,r,s){const t=this._parseSortableNumber(e),l=this._parseSortableNumber(r);if(t!==null&&l!==null)return s==="asc"?t-l:l-t;const a=Date.parse(e.replace(/\s+/g," ")),n=Date.parse(r.replace(/\s+/g," "));if(!isNaN(a)&&!isNaN(n))return s==="asc"?a-n:n-a;const o=e.localeCompare(r,"sv");return s==="asc"?o:-o}_parseSortableNumber(e){const r=e.trim();if(!/^[+-]?(?:\d+|\d{1,3}(?:[\s\u00a0\u202f]\d{3})+)(?:[,.]\d+)?$/.test(r))return null;const s=Number(r.replace(/[\s\u00a0\u202f]/g,"").replace(",","."));return Number.isNaN(s)?null:s}},p.styles=_`
|
|
6
6
|
:host {
|
|
7
7
|
display: block;
|
|
8
8
|
color: var(--md-sys-color-on-surface);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "scb-wc",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.59",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.js",
|
|
@@ -440,5 +440,5 @@
|
|
|
440
440
|
},
|
|
441
441
|
"./mvc/*": "./mvc/*"
|
|
442
442
|
},
|
|
443
|
-
"buildHash": "
|
|
443
|
+
"buildHash": "C411D4B9850AAF29E46D4FEE583757318911FB1612D2C5969C764DD08DE5373B"
|
|
444
444
|
}
|
package/scb-table/scb-table.js
CHANGED
|
@@ -3,7 +3,7 @@ import "../scb-icon-button/scb-icon-button.js";
|
|
|
3
3
|
import { LitElement as t, css as n, html as r } from "lit";
|
|
4
4
|
import { customElement as i, property as a } from "lit/decorators.js";
|
|
5
5
|
//#region src/scb-components/scb-table/scb-table.ts
|
|
6
|
-
var o = class extends t {
|
|
6
|
+
var o = 88, s = 16, c = class extends t {
|
|
7
7
|
constructor(...e) {
|
|
8
8
|
super(...e), this.dataSorting = !1, this.columnWidthMode = "auto", this._sortedColumn = null, this._sortDirection = "asc", this._columnWidthFrame = null, this._onSlotChange = () => {
|
|
9
9
|
this._attachThListeners();
|
|
@@ -142,8 +142,8 @@ var o = class extends t {
|
|
|
142
142
|
let t = Array.from(e.querySelectorAll("thead tr")), n = t[t.length - 1];
|
|
143
143
|
if (!n) return;
|
|
144
144
|
let r = Array.from(n.cells).map((t, n) => {
|
|
145
|
-
let r = this._measureCellContentWidth(t), i = this._measureColumnReadableBodyWidth(e, n);
|
|
146
|
-
return `${Math.ceil(Math.max(
|
|
145
|
+
let r = this._measureCellContentWidth(t), i = this._measureColumnReadableBodyWidth(e, n), a = Math.max(r, i);
|
|
146
|
+
return `${Math.ceil(a > 0 ? Math.max(a, o) : 0)}px`;
|
|
147
147
|
}), i = r.reduce((e, t) => e + parseFloat(t), 0);
|
|
148
148
|
this._applyGeneratedColGroup(e, r), e.style.tableLayout = "fixed", e.style.width = `${Math.ceil(i)}px`, e.style.minWidth = `${Math.ceil(i)}px`, e.style.maxWidth = "none";
|
|
149
149
|
});
|
|
@@ -170,7 +170,7 @@ var o = class extends t {
|
|
|
170
170
|
return Array.from(e.querySelectorAll("tbody tr")).reduce((e, n) => {
|
|
171
171
|
let r = n.cells[t];
|
|
172
172
|
if (!r) return e;
|
|
173
|
-
let i = (r.textContent ?? "").replace(/\s+/g, " ").trim().split(" ").filter(Boolean).reduce((e, t) => Math.max(e, this._measureCellTextWidth(r, t)), 0), a = i > 0 ? i +
|
|
173
|
+
let i = (r.textContent ?? "").replace(/\s+/g, " ").trim().split(" ").filter(Boolean).reduce((e, t) => Math.max(e, this._measureCellTextWidth(r, t)), 0), a = i > 0 ? i + s : 0;
|
|
174
174
|
return Math.max(e, a);
|
|
175
175
|
}, 0);
|
|
176
176
|
}
|
|
@@ -230,9 +230,9 @@ var o = class extends t {
|
|
|
230
230
|
e([a({
|
|
231
231
|
type: Boolean,
|
|
232
232
|
attribute: "data-sorting"
|
|
233
|
-
})],
|
|
233
|
+
})], c.prototype, "dataSorting", void 0), e([a({
|
|
234
234
|
type: String,
|
|
235
235
|
attribute: "column-width-mode"
|
|
236
|
-
})],
|
|
236
|
+
})], c.prototype, "columnWidthMode", void 0), c = e([i("scb-table")], c);
|
|
237
237
|
//#endregion
|
|
238
|
-
export {
|
|
238
|
+
export { c as ScbTable };
|
package/scb-wc.bundle.js
CHANGED
|
@@ -12159,7 +12159,7 @@
|
|
|
12159
12159
|
>
|
|
12160
12160
|
<slot @slotchange=${this._onSlotChange}></slot>
|
|
12161
12161
|
</div>
|
|
12162
|
-
`}connectedCallback(){super.connectedCallback(),typeof ResizeObserver<`u`&&(this.#e=new ResizeObserver(()=>{this.#i()}),this.#e.observe(this))}disconnectedCallback(){this.#e&&=(this.#e.disconnect(),void 0),this.#t&&=(cancelAnimationFrame(this.#t),0),super.disconnectedCallback()}#n(){let e=this.#r(this.spacing),t=this.#r(this.spacingTop)??e,n=this.#r(this.spacingBottom)??e,r=this.#r(this.spacingLeft),i=this.#r(this.spacingRight);t?this.style.setProperty(`--scb-stepper-spacing-block-start`,t):this.style.removeProperty(`--scb-stepper-spacing-block-start`),n?this.style.setProperty(`--scb-stepper-spacing-block-end`,n):this.style.removeProperty(`--scb-stepper-spacing-block-end`),r?this.style.setProperty(`--scb-stepper-spacing-inline-start`,r):this.style.removeProperty(`--scb-stepper-spacing-inline-start`),i?this.style.setProperty(`--scb-stepper-spacing-inline-end`,i):this.style.removeProperty(`--scb-stepper-spacing-inline-end`)}#r(e){if(!e)return;let t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}#i(){this.#t||=requestAnimationFrame(()=>{this.#t=0,this.#a()})}#a(){let e=this._getSteps();e.length!==0&&e.forEach(e=>{let t=e.shadowRoot;if(!t)return;let n=t.querySelector(`.label`),r=t.querySelector(`.scb-step-content`);if(!n)return;if(this.variant!==`horizontal`){n.style.removeProperty(`max-width`),n.style.removeProperty(`white-space`),n.style.removeProperty(`word-break`),n.style.removeProperty(`overflow-wrap`);return}n.style.maxWidth=`none`,n.style.whiteSpace=`nowrap`,n.style.wordBreak=`normal`,n.style.overflowWrap=`normal`;let i=r?.clientWidth??e.clientWidth;i>0&&n.scrollWidth>i&&(n.style.maxWidth=`100%`,n.style.whiteSpace=`normal`,n.style.wordBreak=`break-word`,n.style.overflowWrap=`anywhere`)})}};P([g({type:String,reflect:!0})],Vu.prototype,`type`,void 0),P([g({type:String,reflect:!0})],Vu.prototype,`label`,void 0),P([g({type:Boolean,reflect:!0,attribute:`change-on-completed`})],Vu.prototype,`changeOnCompleted`,void 0),P([g({type:String})],Vu.prototype,`variant`,void 0),P([g({type:String,reflect:!0,attribute:`symbol-variant`})],Vu.prototype,`symbolVariant`,void 0),P([g({type:String,reflect:!0})],Vu.prototype,`spacing`,void 0),P([g({type:String,attribute:`spacing-top`,reflect:!0})],Vu.prototype,`spacingTop`,void 0),P([g({type:String,attribute:`spacing-bottom`,reflect:!0})],Vu.prototype,`spacingBottom`,void 0),P([g({type:String,attribute:`spacing-left`,reflect:!0})],Vu.prototype,`spacingLeft`,void 0),P([g({type:String,attribute:`spacing-right`,reflect:!0})],Vu.prototype,`spacingRight`,void 0),P([g({type:Number,reflect:!0,attribute:`active-index`})],Vu.prototype,`activeIndex`,void 0),Vu=P([a(`scb-stepper`)],Vu),C(),y(),F();var Hu=class extends S{constructor(...e){super(...e),this.dataSorting=!1,this.columnWidthMode=`auto`,this._sortedColumn=null,this._sortDirection=`asc`,this._columnWidthFrame=null,this._onSlotChange=()=>{this._attachThListeners()}}static{this.styles=p`
|
|
12162
|
+
`}connectedCallback(){super.connectedCallback(),typeof ResizeObserver<`u`&&(this.#e=new ResizeObserver(()=>{this.#i()}),this.#e.observe(this))}disconnectedCallback(){this.#e&&=(this.#e.disconnect(),void 0),this.#t&&=(cancelAnimationFrame(this.#t),0),super.disconnectedCallback()}#n(){let e=this.#r(this.spacing),t=this.#r(this.spacingTop)??e,n=this.#r(this.spacingBottom)??e,r=this.#r(this.spacingLeft),i=this.#r(this.spacingRight);t?this.style.setProperty(`--scb-stepper-spacing-block-start`,t):this.style.removeProperty(`--scb-stepper-spacing-block-start`),n?this.style.setProperty(`--scb-stepper-spacing-block-end`,n):this.style.removeProperty(`--scb-stepper-spacing-block-end`),r?this.style.setProperty(`--scb-stepper-spacing-inline-start`,r):this.style.removeProperty(`--scb-stepper-spacing-inline-start`),i?this.style.setProperty(`--scb-stepper-spacing-inline-end`,i):this.style.removeProperty(`--scb-stepper-spacing-inline-end`)}#r(e){if(!e)return;let t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}#i(){this.#t||=requestAnimationFrame(()=>{this.#t=0,this.#a()})}#a(){let e=this._getSteps();e.length!==0&&e.forEach(e=>{let t=e.shadowRoot;if(!t)return;let n=t.querySelector(`.label`),r=t.querySelector(`.scb-step-content`);if(!n)return;if(this.variant!==`horizontal`){n.style.removeProperty(`max-width`),n.style.removeProperty(`white-space`),n.style.removeProperty(`word-break`),n.style.removeProperty(`overflow-wrap`);return}n.style.maxWidth=`none`,n.style.whiteSpace=`nowrap`,n.style.wordBreak=`normal`,n.style.overflowWrap=`normal`;let i=r?.clientWidth??e.clientWidth;i>0&&n.scrollWidth>i&&(n.style.maxWidth=`100%`,n.style.whiteSpace=`normal`,n.style.wordBreak=`break-word`,n.style.overflowWrap=`anywhere`)})}};P([g({type:String,reflect:!0})],Vu.prototype,`type`,void 0),P([g({type:String,reflect:!0})],Vu.prototype,`label`,void 0),P([g({type:Boolean,reflect:!0,attribute:`change-on-completed`})],Vu.prototype,`changeOnCompleted`,void 0),P([g({type:String})],Vu.prototype,`variant`,void 0),P([g({type:String,reflect:!0,attribute:`symbol-variant`})],Vu.prototype,`symbolVariant`,void 0),P([g({type:String,reflect:!0})],Vu.prototype,`spacing`,void 0),P([g({type:String,attribute:`spacing-top`,reflect:!0})],Vu.prototype,`spacingTop`,void 0),P([g({type:String,attribute:`spacing-bottom`,reflect:!0})],Vu.prototype,`spacingBottom`,void 0),P([g({type:String,attribute:`spacing-left`,reflect:!0})],Vu.prototype,`spacingLeft`,void 0),P([g({type:String,attribute:`spacing-right`,reflect:!0})],Vu.prototype,`spacingRight`,void 0),P([g({type:Number,reflect:!0,attribute:`active-index`})],Vu.prototype,`activeIndex`,void 0),Vu=P([a(`scb-stepper`)],Vu),C(),y(),F();var Hu=88,Uu=16,Wu=class extends S{constructor(...e){super(...e),this.dataSorting=!1,this.columnWidthMode=`auto`,this._sortedColumn=null,this._sortDirection=`asc`,this._columnWidthFrame=null,this._onSlotChange=()=>{this._attachThListeners()}}static{this.styles=p`
|
|
12163
12163
|
:host {
|
|
12164
12164
|
display: block;
|
|
12165
12165
|
color: var(--md-sys-color-on-surface);
|
|
@@ -12209,7 +12209,7 @@
|
|
|
12209
12209
|
<div class="scb-table-scroll-wrapper">
|
|
12210
12210
|
<slot @slotchange=${this._onSlotChange}></slot>
|
|
12211
12211
|
</div>
|
|
12212
|
-
`}firstUpdated(){let e=this.shadowRoot?.querySelector(`slot`);e&&(e.addEventListener(`slotchange`,()=>this._attachThListeners()),this._attachThListeners())}updated(e){e.has(`dataSorting`)&&(this.dataSorting||(this._sortedColumn=null,this._sortDirection=`asc`),this._attachThListeners()),e.has(`columnWidthMode`)&&this._queueColumnWidthUpdate()}disconnectedCallback(){super.disconnectedCallback(),this._columnWidthFrame!==null&&(cancelAnimationFrame(this._columnWidthFrame),this._columnWidthFrame=null)}_getTbody(){let e=this.shadowRoot?.querySelector(`slot`);if(!e)return null;let t=e.assignedNodes({flatten:!0});for(let e of t)if(e.nodeType===Node.ELEMENT_NODE){let t=e,n=t.tagName.toLowerCase()===`tbody`?t:t.querySelector(`tbody`);if(n)return n}return null}_getTables(){let e=this.shadowRoot?.querySelector(`slot`);if(!e)return[];let t=e.assignedNodes({flatten:!0}),n=[];return t.forEach(e=>{if(e.nodeType===Node.ELEMENT_NODE){let t=e;t.tagName.toLowerCase()===`table`&&n.push(t),n.push(...Array.from(t.querySelectorAll(`table`)))}}),n}_attachThListeners(){let e=this.shadowRoot?.querySelector(`slot`);if(!e)return;let t=e.assignedNodes({flatten:!0}),n=[],r=[],i=[],a=[];t.forEach(e=>{e.nodeType===Node.ELEMENT_NODE&&(n.push(...e.querySelectorAll(`thead`)),r.push(...e.querySelectorAll(`th`)),i.push(...e.querySelectorAll(`td`)),a.push(...e.querySelectorAll(`tr`)))}),n.forEach(e=>{e.style.borderTop=`1px solid var(--md-sys-color-on-surface)`}),r.forEach((e,t)=>{e.style.textAlign=`left`,e.style.padding=`12px`,e.style.position=`relative`,e.style.backgroundColor=`var(--md-sys-color-surface)`,e.style.fontFamily=`var(--md-sys-typescale-label-medium-font)`,e.style.fontSize=`var(--md-sys-typescale-label-medium-size)`,e.style.lineHeight=`var(--md-sys-typescale-label-medium-line-height)`,e.style.fontWeight=` var(--weight-bold)`,e.style.letterSpacing=`var(--md-sys-typescale-label-medium-tracking)`,e.style.verticalAlign=`bottom`,e.style.borderRight=`1px solid var(--md-sys-color-on-surface)`,e.style.borderBottom=`1px solid var(--md-sys-color-on-surface)`;let n=(e.textContent??``).replace(/\s+/g,` `).trim();for(;e.firstChild;)e.removeChild(e.firstChild);let r=document.createElement(`p`);if(r.textContent=n,r.style.margin=`0`,this.dataSorting){let n=document.createElement(`scb-icon-button`);n.className=`scb-sort-icon`,n.onclick=()=>this._onThClick(t),n.setAttribute(`variant`,`standard`),n.setAttribute(`size`,`small`),n.style.alignSelf=`end`,this._sortedColumn===t?(n.setAttribute(`variant`,`filled-tonal`),n.setAttribute(`icon`,this._sortDirection===`asc`?`arrow_downward`:`arrow_upward`)):(n.setAttribute(`icon`,`swap_horiz`),n.style.transform+=` rotate(90deg)`);let i=document.createElement(`div`);i.style.display=`flex`,i.style.gap=`8px`,i.style.flexWrap=`nowrap`,i.style.alignItems=`center`,i.appendChild(r),i.appendChild(n),e.appendChild(i)}else e.appendChild(r)}),i.forEach(e=>{e.style.padding=`12px`,e.style.textAlign=`left`,e.style.borderTop=`1px solid var(--md-sys-color-outline-variant)`,e.style.verticalAlign=`text-top`,e.style.backgroundColor=`var(--md-sys-color-surface)`,e.style.fontFamily=`var(--md-sys-typescale-body-medium-font)`,e.style.fontSize=`var(--md-sys-typescale-body-medium-size)`,e.style.lineHeight=`var(--md-sys-typescale-body-medium-line-height)`,e.style.fontWeight=`var(--md-sys-typescale-body-medium-weight)`,e.style.letterSpacing=`var(--md-sys-typescale-body-medium-tracking)`,e.style.borderRight=`1px solid var(--md-sys-color-on-surface)`,e.style.borderBottom=`1px solid var(--md-sys-color-on-surface)`,e.style.overflowWrap=`break-word`,e.style.wordBreak=`normal`,e.style.hyphens=`manual`}),a.forEach(e=>{let t=Array.from(e.cells);t.forEach((e,n)=>{e.style.borderRight=n===t.length-1?`none`:`1px solid var(--md-sys-color-on-surface)`})});let o=this._getTbody();o&&Array.from(o.querySelectorAll(`tr`)).forEach((e,t)=>{let n=t%2==0?`var(--md-sys-color-surface-container)`:`var(--md-sys-color-surface)`;Array.from(e.cells).forEach(e=>{e.style.backgroundColor=n})}),this._queueColumnWidthUpdate()}_queueColumnWidthUpdate(){this._columnWidthFrame!==null&&cancelAnimationFrame(this._columnWidthFrame),this._columnWidthFrame=requestAnimationFrame(()=>{this._columnWidthFrame=null,this._applyColumnWidthMode()})}_applyColumnWidthMode(){this._getTables().forEach(e=>{if(this._removeGeneratedColGroup(e),e.style.tableLayout=``,e.style.width=``,e.style.minWidth=``,e.style.maxWidth=``,this.columnWidthMode!==`header`)return;let t=Array.from(e.querySelectorAll(`thead tr`)),n=t[t.length-1];if(!n)return;let r=Array.from(n.cells).map((t,n)=>{let r=this._measureCellContentWidth(t),i=this._measureColumnReadableBodyWidth(e,n);return`${Math.ceil(Math.max(
|
|
12212
|
+
`}firstUpdated(){let e=this.shadowRoot?.querySelector(`slot`);e&&(e.addEventListener(`slotchange`,()=>this._attachThListeners()),this._attachThListeners())}updated(e){e.has(`dataSorting`)&&(this.dataSorting||(this._sortedColumn=null,this._sortDirection=`asc`),this._attachThListeners()),e.has(`columnWidthMode`)&&this._queueColumnWidthUpdate()}disconnectedCallback(){super.disconnectedCallback(),this._columnWidthFrame!==null&&(cancelAnimationFrame(this._columnWidthFrame),this._columnWidthFrame=null)}_getTbody(){let e=this.shadowRoot?.querySelector(`slot`);if(!e)return null;let t=e.assignedNodes({flatten:!0});for(let e of t)if(e.nodeType===Node.ELEMENT_NODE){let t=e,n=t.tagName.toLowerCase()===`tbody`?t:t.querySelector(`tbody`);if(n)return n}return null}_getTables(){let e=this.shadowRoot?.querySelector(`slot`);if(!e)return[];let t=e.assignedNodes({flatten:!0}),n=[];return t.forEach(e=>{if(e.nodeType===Node.ELEMENT_NODE){let t=e;t.tagName.toLowerCase()===`table`&&n.push(t),n.push(...Array.from(t.querySelectorAll(`table`)))}}),n}_attachThListeners(){let e=this.shadowRoot?.querySelector(`slot`);if(!e)return;let t=e.assignedNodes({flatten:!0}),n=[],r=[],i=[],a=[];t.forEach(e=>{e.nodeType===Node.ELEMENT_NODE&&(n.push(...e.querySelectorAll(`thead`)),r.push(...e.querySelectorAll(`th`)),i.push(...e.querySelectorAll(`td`)),a.push(...e.querySelectorAll(`tr`)))}),n.forEach(e=>{e.style.borderTop=`1px solid var(--md-sys-color-on-surface)`}),r.forEach((e,t)=>{e.style.textAlign=`left`,e.style.padding=`12px`,e.style.position=`relative`,e.style.backgroundColor=`var(--md-sys-color-surface)`,e.style.fontFamily=`var(--md-sys-typescale-label-medium-font)`,e.style.fontSize=`var(--md-sys-typescale-label-medium-size)`,e.style.lineHeight=`var(--md-sys-typescale-label-medium-line-height)`,e.style.fontWeight=` var(--weight-bold)`,e.style.letterSpacing=`var(--md-sys-typescale-label-medium-tracking)`,e.style.verticalAlign=`bottom`,e.style.borderRight=`1px solid var(--md-sys-color-on-surface)`,e.style.borderBottom=`1px solid var(--md-sys-color-on-surface)`;let n=(e.textContent??``).replace(/\s+/g,` `).trim();for(;e.firstChild;)e.removeChild(e.firstChild);let r=document.createElement(`p`);if(r.textContent=n,r.style.margin=`0`,this.dataSorting){let n=document.createElement(`scb-icon-button`);n.className=`scb-sort-icon`,n.onclick=()=>this._onThClick(t),n.setAttribute(`variant`,`standard`),n.setAttribute(`size`,`small`),n.style.alignSelf=`end`,this._sortedColumn===t?(n.setAttribute(`variant`,`filled-tonal`),n.setAttribute(`icon`,this._sortDirection===`asc`?`arrow_downward`:`arrow_upward`)):(n.setAttribute(`icon`,`swap_horiz`),n.style.transform+=` rotate(90deg)`);let i=document.createElement(`div`);i.style.display=`flex`,i.style.gap=`8px`,i.style.flexWrap=`nowrap`,i.style.alignItems=`center`,i.appendChild(r),i.appendChild(n),e.appendChild(i)}else e.appendChild(r)}),i.forEach(e=>{e.style.padding=`12px`,e.style.textAlign=`left`,e.style.borderTop=`1px solid var(--md-sys-color-outline-variant)`,e.style.verticalAlign=`text-top`,e.style.backgroundColor=`var(--md-sys-color-surface)`,e.style.fontFamily=`var(--md-sys-typescale-body-medium-font)`,e.style.fontSize=`var(--md-sys-typescale-body-medium-size)`,e.style.lineHeight=`var(--md-sys-typescale-body-medium-line-height)`,e.style.fontWeight=`var(--md-sys-typescale-body-medium-weight)`,e.style.letterSpacing=`var(--md-sys-typescale-body-medium-tracking)`,e.style.borderRight=`1px solid var(--md-sys-color-on-surface)`,e.style.borderBottom=`1px solid var(--md-sys-color-on-surface)`,e.style.overflowWrap=`break-word`,e.style.wordBreak=`normal`,e.style.hyphens=`manual`}),a.forEach(e=>{let t=Array.from(e.cells);t.forEach((e,n)=>{e.style.borderRight=n===t.length-1?`none`:`1px solid var(--md-sys-color-on-surface)`})});let o=this._getTbody();o&&Array.from(o.querySelectorAll(`tr`)).forEach((e,t)=>{let n=t%2==0?`var(--md-sys-color-surface-container)`:`var(--md-sys-color-surface)`;Array.from(e.cells).forEach(e=>{e.style.backgroundColor=n})}),this._queueColumnWidthUpdate()}_queueColumnWidthUpdate(){this._columnWidthFrame!==null&&cancelAnimationFrame(this._columnWidthFrame),this._columnWidthFrame=requestAnimationFrame(()=>{this._columnWidthFrame=null,this._applyColumnWidthMode()})}_applyColumnWidthMode(){this._getTables().forEach(e=>{if(this._removeGeneratedColGroup(e),e.style.tableLayout=``,e.style.width=``,e.style.minWidth=``,e.style.maxWidth=``,this.columnWidthMode!==`header`)return;let t=Array.from(e.querySelectorAll(`thead tr`)),n=t[t.length-1];if(!n)return;let r=Array.from(n.cells).map((t,n)=>{let r=this._measureCellContentWidth(t),i=this._measureColumnReadableBodyWidth(e,n),a=Math.max(r,i);return`${Math.ceil(a>0?Math.max(a,Hu):0)}px`}),i=r.reduce((e,t)=>e+parseFloat(t),0);this._applyGeneratedColGroup(e,r),e.style.tableLayout=`fixed`,e.style.width=`${Math.ceil(i)}px`,e.style.minWidth=`${Math.ceil(i)}px`,e.style.maxWidth=`none`})}_applyGeneratedColGroup(e,t){let n=document.createElement(`colgroup`);n.setAttribute(`data-scb-generated-column-widths`,`true`),t.forEach(e=>{let t=document.createElement(`col`);t.style.width=e,t.style.minWidth=e,n.appendChild(t)}),e.insertBefore(n,e.firstChild)}_removeGeneratedColGroup(e){e.querySelector(`colgroup[data-scb-generated-column-widths="true"]`)?.remove()}_measureCellContentWidth(e){let t=e.firstElementChild?.cloneNode(!0)??document.createElement(`span`);e.firstElementChild||(t.textContent=e.textContent??``);let n=window.getComputedStyle(e),r=document.createElement(`div`);r.style.position=`absolute`,r.style.left=`-99999px`,r.style.top=`0`,r.style.visibility=`hidden`,r.style.pointerEvents=`none`,r.style.width=`max-content`,r.style.maxWidth=`none`,r.style.whiteSpace=`nowrap`,r.style.fontFamily=n.fontFamily,r.style.fontSize=n.fontSize,r.style.fontWeight=n.fontWeight,r.style.lineHeight=n.lineHeight,r.style.letterSpacing=n.letterSpacing,t instanceof HTMLElement&&(t.style.width=`max-content`,t.style.maxWidth=`none`,t.style.whiteSpace=`nowrap`),r.appendChild(t),document.body.appendChild(r);let i=parseFloat(n.paddingLeft||`0`),a=parseFloat(n.paddingRight||`0`),o=r.getBoundingClientRect().width+i+a;return document.body.removeChild(r),o}_measureColumnReadableBodyWidth(e,t){return Array.from(e.querySelectorAll(`tbody tr`)).reduce((e,n)=>{let r=n.cells[t];if(!r)return e;let i=(r.textContent??``).replace(/\s+/g,` `).trim().split(` `).filter(Boolean).reduce((e,t)=>Math.max(e,this._measureCellTextWidth(r,t)),0),a=i>0?i+Uu:0;return Math.max(e,a)},0)}_measureCellTextWidth(e,t){let n=window.getComputedStyle(e),r=document.createElement(`span`);r.textContent=t,r.style.position=`absolute`,r.style.left=`-99999px`,r.style.top=`0`,r.style.visibility=`hidden`,r.style.pointerEvents=`none`,r.style.whiteSpace=`nowrap`,r.style.fontFamily=n.fontFamily,r.style.fontSize=n.fontSize,r.style.fontWeight=n.fontWeight,r.style.lineHeight=n.lineHeight,r.style.letterSpacing=n.letterSpacing,document.body.appendChild(r);let i=parseFloat(n.paddingLeft||`0`),a=parseFloat(n.paddingRight||`0`),o=r.getBoundingClientRect().width+i+a;return document.body.removeChild(r),o}_onThClick(e){this.dataSorting&&(this._sortedColumn===e?this._sortDirection=this._sortDirection===`asc`?`desc`:`asc`:(this._sortedColumn=e,this._sortDirection=`asc`),this._sortTable(e,this._sortDirection),this._attachThListeners(),this.dispatchEvent(new CustomEvent(`tablesortchange`,{detail:{sortedColumn:this._sortedColumn,sortDirection:this._sortDirection},bubbles:!0,composed:!0})))}_sortTable(e,t){let n=this._getTbody();if(!n)return;let r=Array.from(n.querySelectorAll(`tr`));r.sort((n,r)=>{let i=this._getCellSortableValue(n.children[e]),a=this._getCellSortableValue(r.children[e]);return this._compareCellValues(i,a,t)}),r.forEach(e=>n.appendChild(e))}_getCellSortableValue(e){if(!e)return``;let t=e,n=this._getSortableAttributeValue(t);if(n)return n;let r=[],i=t.textContent?.replace(/\s+/g,` `).trim();return i&&r.push(i),t.querySelectorAll(`[data-sort-value], [data-sort], [aria-label], [label], [value], [title]`).forEach(e=>{let t=this._getSortableAttributeValue(e);t&&!r.includes(t)&&r.push(t)}),r.join(` `).trim()}_getSortableAttributeValue(e){return(e.getAttribute(`data-sort-value`)??e.getAttribute(`data-sort`)??e.getAttribute(`aria-label`)??e.getAttribute(`label`)??e.getAttribute(`value`)??e.getAttribute(`title`)??``).replace(/\s+/g,` `).trim()}_compareCellValues(e,t,n){let r=this._parseSortableNumber(e),i=this._parseSortableNumber(t);if(r!==null&&i!==null)return n===`asc`?r-i:i-r;let a=Date.parse(e.replace(/\s+/g,` `)),o=Date.parse(t.replace(/\s+/g,` `));if(!isNaN(a)&&!isNaN(o))return n===`asc`?a-o:o-a;let s=e.localeCompare(t,`sv`);return n===`asc`?s:-s}_parseSortableNumber(e){let t=e.trim();if(!/^[+-]?(?:\d+|\d{1,3}(?:[\s\u00a0\u202f]\d{3})+)(?:[,.]\d+)?$/.test(t))return null;let n=Number(t.replace(/[\s\u00a0\u202f]/g,``).replace(`,`,`.`));return Number.isNaN(n)?null:n}};P([g({type:Boolean,attribute:`data-sorting`})],Wu.prototype,`dataSorting`,void 0),P([g({type:String,attribute:`column-width-mode`})],Wu.prototype,`columnWidthMode`,void 0),Wu=P([a(`scb-table`)],Wu),C(),y(),F();var Gu=class extends S{constructor(...e){super(...e),this.searchTerm=``,this.pagination=!1,this.filteringSearch=!1,this.noScroll=!1,this.pageSize=10,this.currentPage=1,this.totalRows=0,this._sortedColumn=null,this._sortDirection=`asc`,this._filteredRows=null,this._tbodyObserver=null,this._observedTbody=null,this._pendingTableRefresh=!1,this._suppressTbodyObserver=!1,this._onSlotChange=()=>{this._attachTbodyObserver(),this._refreshFromTableContent()},this._onPaginationChange=e=>{let t=e.detail;t&&typeof t.page==`number`&&this._changePage(t.page)}}static{this.styles=p`
|
|
12213
12213
|
:host {
|
|
12214
12214
|
display: block;
|
|
12215
12215
|
color: var(--md-sys-color-on-surface);
|
|
@@ -12284,17 +12284,17 @@
|
|
|
12284
12284
|
></scb-pagination>
|
|
12285
12285
|
`:``}
|
|
12286
12286
|
</div>
|
|
12287
|
-
`}_onSearchInput(e){let t=e.target.value;this.searchTerm=t,this._filterTable(),this.dispatchEvent(new CustomEvent(`tableadvancedchange`,{detail:{searchTerm:this.searchTerm,currentPage:this.currentPage},bubbles:!0,composed:!0}))}_filterTable(){let e=this.shadowRoot.querySelector(`slot`);if(!e)return;let t=e.assignedNodes({flatten:!0}),n=null;if(t.forEach(e=>{if(e.nodeType===Node.ELEMENT_NODE){let t=e.querySelector(`tbody`);t&&(n=t)}}),!n)return;let r=n,i=Array.from(r.querySelectorAll(`tr`)),a=this.searchTerm.trim().toLowerCase();if(!a)this._filteredRows=null,i.forEach(e=>e.style.display=``),this._updateTotalRows(),this._ensureCurrentPageWithinBounds(),this.pagination&&this._paginateTable(),this._sortedColumn!==null&&this._sortTable(this._sortedColumn,this._sortDirection);else{this._filteredRows=i.filter(e=>this._getRowSearchText(e).toLowerCase().includes(a)),i.forEach(e=>e.style.display=`none`);let e=this._filteredRows;this._sortedColumn!==null&&(e=[...e],e.sort((e,t)=>{let n=this._getCellSortableValue(e.children[this._sortedColumn]),r=this._getCellSortableValue(t.children[this._sortedColumn]);return this._compareCellValues(n,r,this._sortDirection)}),this._filteredRows=e),this.totalRows=this._filteredRows.length,this._ensureCurrentPageWithinBounds(),this.pagination?this._paginateTable():this._filteredRows.forEach(e=>e.style.display=``)}}firstUpdated(){let e=this.shadowRoot.querySelector(`slot`);e&&(e.addEventListener(`slotchange`,()=>this._attachThListeners()),this._attachThListeners(),this._attachTbodyObserver(),this._refreshFromTableContent())}updated(e){super.updated(e),(e.has(`searchTerm`)||e.has(`currentPage`)||e.has(`pageSize`)||e.has(`filteringSearch`)||e.has(`pagination`))&&this.updateComplete.then(()=>{this.isConnected&&this._refreshFromTableContent()})}_disconnectTbodyObserver(){this._tbodyObserver&&=(this._tbodyObserver.disconnect(),null),this._observedTbody=null}_attachTbodyObserver(){let e=this._getTbody();if(!e){this._disconnectTbodyObserver();return}this._observedTbody!==e&&(this._disconnectTbodyObserver(),this._observedTbody=e,this._tbodyObserver=new MutationObserver(()=>{this._suppressTbodyObserver||this._scheduleTableRefresh()}),this._tbodyObserver.observe(e,{childList:!0,subtree:!0,characterData:!0}))}_scheduleTableRefresh(){this._pendingTableRefresh||(this._pendingTableRefresh=!0,queueMicrotask(()=>{this._pendingTableRefresh=!1,this._refreshFromTableContent()}))}_refreshFromTableContent(){if(this._attachTbodyObserver(),this.filteringSearch){this._filterTable();return}if(this._updateTotalRows(),this._ensureCurrentPageWithinBounds(),this._sortedColumn!==null){this._sortTable(this._sortedColumn,this._sortDirection);return}this.pagination&&this._paginateTable()}_ensureCurrentPageWithinBounds(){let e=Math.max(1,Math.ceil(this.totalRows/this.pageSize)),t=Math.min(Math.max(1,this.currentPage),e);t!==this.currentPage&&(this.currentPage=t)}_getTbody(){let e=this.shadowRoot.querySelector(`slot`);if(!e)return null;let t=e.assignedNodes({flatten:!0});for(let e of t)if(e.nodeType===Node.ELEMENT_NODE){let t=e.querySelector(`tbody`);if(t)return t}return null}_attachThListeners(){let e=this.shadowRoot.querySelector(`slot`);if(!e)return;let t=e.assignedNodes({flatten:!0}),n=[],r=[],i=[];t.forEach(e=>{e.nodeType===Node.ELEMENT_NODE&&(n.push(...e.querySelectorAll(`th`)),r.push(...e.querySelectorAll(`td`)),i.push(...e.querySelectorAll(`tr`)))}),n.forEach((e,t)=>{e.style.textAlign=`left`,e.style.padding=`16px 0px 16px 32px`,e.style.position=`relative`,e.style.backgroundColor=`var(--md-sys-color-surface)`,e.style.fontFamily=`var(--md-sys-typescale-label-medium-font)`,e.style.fontSize=`var(--md-sys-typescale-label-medium-size)`,e.style.lineHeight=`var(--md-sys-typescale-label-medium-line-height)`,e.style.fontWeight=`var(--md-sys-typescale-label-medium-weight)`,e.style.letterSpacing=`var(--md-sys-typescale-label-medium-tracking)`,e.style.verticalAlign=`bottom`;let n=e.firstChild;if(n&&n.nodeType===Node.TEXT_NODE&&n.textContent?.trim()||n&&n.nodeType===Node.ELEMENT_NODE&&n.tagName.toLowerCase()!==`p`){let i=document.createElement(`p`);i.textContent=n.textContent?n.textContent.trim():``,i.style.margin=`0`,e.replaceChild(i,n),e.querySelectorAll(`scb-icon-button.scb-sort-icon`).forEach(e=>e.remove());let a=document.createElement(`scb-icon-button`);a.className=`scb-sort-icon`,a.onclick=()=>this._onThClick(t),a.setAttribute(`variant`,`standard`),a.setAttribute(`size`,`small`),this._sortedColumn===t?(a.setAttribute(`variant`,`filled-tonal`),a.setAttribute(`icon`,this._sortDirection===`asc`?`arrow_downward`:`arrow_upward`)):(a.setAttribute(`icon`,`swap_horiz`),a.style.transform+=` rotate(90deg)`,a.style.alignSelf=`end`);var r=document.createElement(`div`);r.style.display=`flex`,r.style.gap=`8px`,r.style.flexWrap=`nowrap`,r.style.alignItems=`center`,r.appendChild(i),r.appendChild(a),e.appendChild(r)}}),r.forEach(e=>{e.style.padding=`16px 0px 16px 32px`,e.style.textAlign=`left`,e.style.borderTop=`1px solid var(--md-sys-color-outline-variant)`,e.style.verticalAlign=`text-top`,e.style.backgroundColor=`var(--md-sys-color-surface)`,e.style.fontFamily=`var(--md-sys-typescale-body-medium-font)`,e.style.fontSize=`var(--md-sys-typescale-body-medium-size)`,e.style.lineHeight=`var(--md-sys-typescale-body-medium-line-height)`,e.style.fontWeight=`var(--md-sys-typescale-body-medium-weight)`,e.style.letterSpacing=`var(--md-sys-typescale-body-medium-tracking)`}),i.forEach((e,t)=>{t%2==1&&e.querySelectorAll(`td`).forEach(e=>{e.style.backgroundColor=`var(--scb-background-row)`});let n=e.querySelectorAll(`th`);n.length>0&&n.forEach((e,t)=>{t===0&&(e.style.paddingLeft=`24px`),t===n.length-1?e.style.paddingRight=`24px`:e.style.paddingRight=``});let r=e.querySelectorAll(`td`);r.length>0&&r.forEach((e,t)=>{t===0&&(e.style.paddingLeft=`24px`),t===r.length-1?e.style.paddingRight=`24px`:e.style.paddingRight=``})}),this.pagination&&this._paginateTable()}_onThClick(e){this._sortedColumn===e?this._sortDirection=this._sortDirection===`asc`?`desc`:`asc`:(this._sortedColumn=e,this._sortDirection=`asc`),this._sortTable(e,this._sortDirection),this._attachThListeners()}_sortTable(e,t){let n=this.shadowRoot.querySelector(`slot`);if(!n)return;let r=n.assignedNodes({flatten:!0}),i=null;if(r.forEach(e=>{if(e.nodeType===Node.ELEMENT_NODE){let t=e.querySelector(`tbody`);t&&(i=t)}}),!i)return;let a;a=this._filteredRows?[...this._filteredRows]:Array.from(i.querySelectorAll(`tr`)),a.sort((n,r)=>{let i=this._getCellSortableValue(n.children[e]),a=this._getCellSortableValue(r.children[e]);return this._compareCellValues(i,a,t)});let o=this._tbodyObserver!==null;o&&this._disconnectTbodyObserver();try{a.forEach(e=>i.appendChild(e))}finally{o&&this._attachTbodyObserver()}this._filteredRows&&(this._filteredRows=a,this.totalRows=this._filteredRows.length),this.pagination&&this._paginateTable()}_getRowSearchText(e){return Array.from(e.cells).map(e=>this._getCellSortableValue(e)).join(` `)}_getCellSortableValue(e){if(!e)return``;let t=e,n=this._getSortableAttributeValue(t);if(n)return n;let r=[],i=t.textContent?.replace(/\s+/g,` `).trim();return i&&r.push(i),t.querySelectorAll(`[data-sort-value], [data-sort], [aria-label], [label], [value], [title]`).forEach(e=>{let t=this._getSortableAttributeValue(e);t&&!r.includes(t)&&r.push(t)}),r.join(` `).trim()}_getSortableAttributeValue(e){return(e.getAttribute(`data-sort-value`)??e.getAttribute(`data-sort`)??e.getAttribute(`aria-label`)??e.getAttribute(`label`)??e.getAttribute(`value`)??e.getAttribute(`title`)??``).replace(/\s+/g,` `).trim()}_compareCellValues(e,t,n){let r=this._parseSortableNumber(e),i=this._parseSortableNumber(t);if(r!==null&&i!==null)return n===`asc`?r-i:i-r;let a=Date.parse(e.replace(/\s+/g,` `)),o=Date.parse(t.replace(/\s+/g,` `));if(!isNaN(a)&&!isNaN(o))return n===`asc`?a-o:o-a;let s=e.localeCompare(t,`sv`);return n===`asc`?s:-s}_parseSortableNumber(e){let t=e.trim();if(!/^[+-]?(?:\d+|\d{1,3}(?:[\s\u00a0\u202f]\d{3})+)(?:[,.]\d+)?$/.test(t))return null;let n=Number(t.replace(/[\s\u00a0\u202f]/g,``).replace(`,`,`.`));return Number.isNaN(n)?null:n}_updateTotalRows(){let e=this.shadowRoot.querySelector(`slot`);if(!e)return;let t=e.assignedNodes({flatten:!0}),n=null;t.forEach(e=>{if(e.nodeType===Node.ELEMENT_NODE){let t=e.querySelector(`tbody`);t&&(n=t)}}),n&&(this.totalRows=n.querySelectorAll(`tr`).length,this._ensureCurrentPageWithinBounds())}_paginateTable(){let e=this.shadowRoot.querySelector(`slot`);if(!e)return;let t=e.assignedNodes({flatten:!0}),n=null;if(t.forEach(e=>{if(e.nodeType===Node.ELEMENT_NODE){let t=e.querySelector(`tbody`);t&&(n=t)}}),!n)return;let r;r=this._filteredRows?this._filteredRows:Array.from(n.querySelectorAll(`tr`)),Array.from(n.querySelectorAll(`tr`)).forEach(e=>e.style.display=`none`);let i=(this.currentPage-1)*this.pageSize,a=i+this.pageSize;r.slice(i,a).forEach(e=>e.style.display=``)}_changePage(e){let t=Math.ceil(this.totalRows/this.pageSize);e<1||e>t||(this.currentPage=e,this._paginateTable(),this.dispatchEvent(new CustomEvent(`tableadvancedchange`,{detail:{searchTerm:this.searchTerm,currentPage:this.currentPage},bubbles:!0,composed:!0})),this.requestUpdate())}};P([g({type:String})],Uu.prototype,`searchTerm`,void 0),P([g({type:Boolean,attribute:`with-pagination`})],Uu.prototype,`pagination`,void 0),P([g({type:Boolean,attribute:`with-filtering-search`})],Uu.prototype,`filteringSearch`,void 0),P([g({type:Boolean,attribute:`no-scroll`})],Uu.prototype,`noScroll`,void 0),P([g({type:Number,attribute:`page-size`})],Uu.prototype,`pageSize`,void 0),P([g({type:Number})],Uu.prototype,`currentPage`,void 0),P([g({type:Number})],Uu.prototype,`totalRows`,void 0),Uu=P([a(`scb-table-advanced`)],Uu),y(),C(),k(),F();var Wu=class extends tc{constructor(...e){super(...e),this.iconOnly=!1,this.inlineIcon=!1,this._onActivate=()=>{let e=this.textContent?.trim()??``;this.dispatchEvent(new CustomEvent(`activate`,{detail:{label:e},bubbles:!0,composed:!0}))}}connectedCallback(){super.connectedCallback(),this.setAttribute(`role`,`tab`)}get icon(){return this._icon}set icon(e){let t=this._icon;t!==e&&(this._icon=e,this.requestUpdate(`icon`,t),this.updateIconSlot())}firstUpdated(e){super.firstUpdated(e),this.addEventListener(`click`,this._onActivate),this._icon&&this.updateIconSlot()}updated(){if(super.updated(),this.setAttribute(`aria-selected`,this.active?`true`:`false`),this.iconOnly&&!this.hasAttribute(`aria-label`)){let e=this.textContent?.trim()??``;e&&this.setAttribute(`aria-label`,e)}}static{this.styles=[...tc.styles,p`
|
|
12287
|
+
`}_onSearchInput(e){let t=e.target.value;this.searchTerm=t,this._filterTable(),this.dispatchEvent(new CustomEvent(`tableadvancedchange`,{detail:{searchTerm:this.searchTerm,currentPage:this.currentPage},bubbles:!0,composed:!0}))}_filterTable(){let e=this.shadowRoot.querySelector(`slot`);if(!e)return;let t=e.assignedNodes({flatten:!0}),n=null;if(t.forEach(e=>{if(e.nodeType===Node.ELEMENT_NODE){let t=e.querySelector(`tbody`);t&&(n=t)}}),!n)return;let r=n,i=Array.from(r.querySelectorAll(`tr`)),a=this.searchTerm.trim().toLowerCase();if(!a)this._filteredRows=null,i.forEach(e=>e.style.display=``),this._updateTotalRows(),this._ensureCurrentPageWithinBounds(),this.pagination&&this._paginateTable(),this._sortedColumn!==null&&this._sortTable(this._sortedColumn,this._sortDirection);else{this._filteredRows=i.filter(e=>this._getRowSearchText(e).toLowerCase().includes(a)),i.forEach(e=>e.style.display=`none`);let e=this._filteredRows;this._sortedColumn!==null&&(e=[...e],e.sort((e,t)=>{let n=this._getCellSortableValue(e.children[this._sortedColumn]),r=this._getCellSortableValue(t.children[this._sortedColumn]);return this._compareCellValues(n,r,this._sortDirection)}),this._filteredRows=e),this.totalRows=this._filteredRows.length,this._ensureCurrentPageWithinBounds(),this.pagination?this._paginateTable():this._filteredRows.forEach(e=>e.style.display=``)}}firstUpdated(){let e=this.shadowRoot.querySelector(`slot`);e&&(e.addEventListener(`slotchange`,()=>this._attachThListeners()),this._attachThListeners(),this._attachTbodyObserver(),this._refreshFromTableContent())}updated(e){super.updated(e),(e.has(`searchTerm`)||e.has(`currentPage`)||e.has(`pageSize`)||e.has(`filteringSearch`)||e.has(`pagination`))&&this.updateComplete.then(()=>{this.isConnected&&this._refreshFromTableContent()})}_disconnectTbodyObserver(){this._tbodyObserver&&=(this._tbodyObserver.disconnect(),null),this._observedTbody=null}_attachTbodyObserver(){let e=this._getTbody();if(!e){this._disconnectTbodyObserver();return}this._observedTbody!==e&&(this._disconnectTbodyObserver(),this._observedTbody=e,this._tbodyObserver=new MutationObserver(()=>{this._suppressTbodyObserver||this._scheduleTableRefresh()}),this._tbodyObserver.observe(e,{childList:!0,subtree:!0,characterData:!0}))}_scheduleTableRefresh(){this._pendingTableRefresh||(this._pendingTableRefresh=!0,queueMicrotask(()=>{this._pendingTableRefresh=!1,this._refreshFromTableContent()}))}_refreshFromTableContent(){if(this._attachTbodyObserver(),this.filteringSearch){this._filterTable();return}if(this._updateTotalRows(),this._ensureCurrentPageWithinBounds(),this._sortedColumn!==null){this._sortTable(this._sortedColumn,this._sortDirection);return}this.pagination&&this._paginateTable()}_ensureCurrentPageWithinBounds(){let e=Math.max(1,Math.ceil(this.totalRows/this.pageSize)),t=Math.min(Math.max(1,this.currentPage),e);t!==this.currentPage&&(this.currentPage=t)}_getTbody(){let e=this.shadowRoot.querySelector(`slot`);if(!e)return null;let t=e.assignedNodes({flatten:!0});for(let e of t)if(e.nodeType===Node.ELEMENT_NODE){let t=e.querySelector(`tbody`);if(t)return t}return null}_attachThListeners(){let e=this.shadowRoot.querySelector(`slot`);if(!e)return;let t=e.assignedNodes({flatten:!0}),n=[],r=[],i=[];t.forEach(e=>{e.nodeType===Node.ELEMENT_NODE&&(n.push(...e.querySelectorAll(`th`)),r.push(...e.querySelectorAll(`td`)),i.push(...e.querySelectorAll(`tr`)))}),n.forEach((e,t)=>{e.style.textAlign=`left`,e.style.padding=`16px 0px 16px 32px`,e.style.position=`relative`,e.style.backgroundColor=`var(--md-sys-color-surface)`,e.style.fontFamily=`var(--md-sys-typescale-label-medium-font)`,e.style.fontSize=`var(--md-sys-typescale-label-medium-size)`,e.style.lineHeight=`var(--md-sys-typescale-label-medium-line-height)`,e.style.fontWeight=`var(--md-sys-typescale-label-medium-weight)`,e.style.letterSpacing=`var(--md-sys-typescale-label-medium-tracking)`,e.style.verticalAlign=`bottom`;let n=e.firstChild;if(n&&n.nodeType===Node.TEXT_NODE&&n.textContent?.trim()||n&&n.nodeType===Node.ELEMENT_NODE&&n.tagName.toLowerCase()!==`p`){let i=document.createElement(`p`);i.textContent=n.textContent?n.textContent.trim():``,i.style.margin=`0`,e.replaceChild(i,n),e.querySelectorAll(`scb-icon-button.scb-sort-icon`).forEach(e=>e.remove());let a=document.createElement(`scb-icon-button`);a.className=`scb-sort-icon`,a.onclick=()=>this._onThClick(t),a.setAttribute(`variant`,`standard`),a.setAttribute(`size`,`small`),this._sortedColumn===t?(a.setAttribute(`variant`,`filled-tonal`),a.setAttribute(`icon`,this._sortDirection===`asc`?`arrow_downward`:`arrow_upward`)):(a.setAttribute(`icon`,`swap_horiz`),a.style.transform+=` rotate(90deg)`,a.style.alignSelf=`end`);var r=document.createElement(`div`);r.style.display=`flex`,r.style.gap=`8px`,r.style.flexWrap=`nowrap`,r.style.alignItems=`center`,r.appendChild(i),r.appendChild(a),e.appendChild(r)}}),r.forEach(e=>{e.style.padding=`16px 0px 16px 32px`,e.style.textAlign=`left`,e.style.borderTop=`1px solid var(--md-sys-color-outline-variant)`,e.style.verticalAlign=`text-top`,e.style.backgroundColor=`var(--md-sys-color-surface)`,e.style.fontFamily=`var(--md-sys-typescale-body-medium-font)`,e.style.fontSize=`var(--md-sys-typescale-body-medium-size)`,e.style.lineHeight=`var(--md-sys-typescale-body-medium-line-height)`,e.style.fontWeight=`var(--md-sys-typescale-body-medium-weight)`,e.style.letterSpacing=`var(--md-sys-typescale-body-medium-tracking)`}),i.forEach((e,t)=>{t%2==1&&e.querySelectorAll(`td`).forEach(e=>{e.style.backgroundColor=`var(--scb-background-row)`});let n=e.querySelectorAll(`th`);n.length>0&&n.forEach((e,t)=>{t===0&&(e.style.paddingLeft=`24px`),t===n.length-1?e.style.paddingRight=`24px`:e.style.paddingRight=``});let r=e.querySelectorAll(`td`);r.length>0&&r.forEach((e,t)=>{t===0&&(e.style.paddingLeft=`24px`),t===r.length-1?e.style.paddingRight=`24px`:e.style.paddingRight=``})}),this.pagination&&this._paginateTable()}_onThClick(e){this._sortedColumn===e?this._sortDirection=this._sortDirection===`asc`?`desc`:`asc`:(this._sortedColumn=e,this._sortDirection=`asc`),this._sortTable(e,this._sortDirection),this._attachThListeners()}_sortTable(e,t){let n=this.shadowRoot.querySelector(`slot`);if(!n)return;let r=n.assignedNodes({flatten:!0}),i=null;if(r.forEach(e=>{if(e.nodeType===Node.ELEMENT_NODE){let t=e.querySelector(`tbody`);t&&(i=t)}}),!i)return;let a;a=this._filteredRows?[...this._filteredRows]:Array.from(i.querySelectorAll(`tr`)),a.sort((n,r)=>{let i=this._getCellSortableValue(n.children[e]),a=this._getCellSortableValue(r.children[e]);return this._compareCellValues(i,a,t)});let o=this._tbodyObserver!==null;o&&this._disconnectTbodyObserver();try{a.forEach(e=>i.appendChild(e))}finally{o&&this._attachTbodyObserver()}this._filteredRows&&(this._filteredRows=a,this.totalRows=this._filteredRows.length),this.pagination&&this._paginateTable()}_getRowSearchText(e){return Array.from(e.cells).map(e=>this._getCellSortableValue(e)).join(` `)}_getCellSortableValue(e){if(!e)return``;let t=e,n=this._getSortableAttributeValue(t);if(n)return n;let r=[],i=t.textContent?.replace(/\s+/g,` `).trim();return i&&r.push(i),t.querySelectorAll(`[data-sort-value], [data-sort], [aria-label], [label], [value], [title]`).forEach(e=>{let t=this._getSortableAttributeValue(e);t&&!r.includes(t)&&r.push(t)}),r.join(` `).trim()}_getSortableAttributeValue(e){return(e.getAttribute(`data-sort-value`)??e.getAttribute(`data-sort`)??e.getAttribute(`aria-label`)??e.getAttribute(`label`)??e.getAttribute(`value`)??e.getAttribute(`title`)??``).replace(/\s+/g,` `).trim()}_compareCellValues(e,t,n){let r=this._parseSortableNumber(e),i=this._parseSortableNumber(t);if(r!==null&&i!==null)return n===`asc`?r-i:i-r;let a=Date.parse(e.replace(/\s+/g,` `)),o=Date.parse(t.replace(/\s+/g,` `));if(!isNaN(a)&&!isNaN(o))return n===`asc`?a-o:o-a;let s=e.localeCompare(t,`sv`);return n===`asc`?s:-s}_parseSortableNumber(e){let t=e.trim();if(!/^[+-]?(?:\d+|\d{1,3}(?:[\s\u00a0\u202f]\d{3})+)(?:[,.]\d+)?$/.test(t))return null;let n=Number(t.replace(/[\s\u00a0\u202f]/g,``).replace(`,`,`.`));return Number.isNaN(n)?null:n}_updateTotalRows(){let e=this.shadowRoot.querySelector(`slot`);if(!e)return;let t=e.assignedNodes({flatten:!0}),n=null;t.forEach(e=>{if(e.nodeType===Node.ELEMENT_NODE){let t=e.querySelector(`tbody`);t&&(n=t)}}),n&&(this.totalRows=n.querySelectorAll(`tr`).length,this._ensureCurrentPageWithinBounds())}_paginateTable(){let e=this.shadowRoot.querySelector(`slot`);if(!e)return;let t=e.assignedNodes({flatten:!0}),n=null;if(t.forEach(e=>{if(e.nodeType===Node.ELEMENT_NODE){let t=e.querySelector(`tbody`);t&&(n=t)}}),!n)return;let r;r=this._filteredRows?this._filteredRows:Array.from(n.querySelectorAll(`tr`)),Array.from(n.querySelectorAll(`tr`)).forEach(e=>e.style.display=`none`);let i=(this.currentPage-1)*this.pageSize,a=i+this.pageSize;r.slice(i,a).forEach(e=>e.style.display=``)}_changePage(e){let t=Math.ceil(this.totalRows/this.pageSize);e<1||e>t||(this.currentPage=e,this._paginateTable(),this.dispatchEvent(new CustomEvent(`tableadvancedchange`,{detail:{searchTerm:this.searchTerm,currentPage:this.currentPage},bubbles:!0,composed:!0})),this.requestUpdate())}};P([g({type:String})],Gu.prototype,`searchTerm`,void 0),P([g({type:Boolean,attribute:`with-pagination`})],Gu.prototype,`pagination`,void 0),P([g({type:Boolean,attribute:`with-filtering-search`})],Gu.prototype,`filteringSearch`,void 0),P([g({type:Boolean,attribute:`no-scroll`})],Gu.prototype,`noScroll`,void 0),P([g({type:Number,attribute:`page-size`})],Gu.prototype,`pageSize`,void 0),P([g({type:Number})],Gu.prototype,`currentPage`,void 0),P([g({type:Number})],Gu.prototype,`totalRows`,void 0),Gu=P([a(`scb-table-advanced`)],Gu),y(),C(),k(),F();var Ku=class extends tc{constructor(...e){super(...e),this.iconOnly=!1,this.inlineIcon=!1,this._onActivate=()=>{let e=this.textContent?.trim()??``;this.dispatchEvent(new CustomEvent(`activate`,{detail:{label:e},bubbles:!0,composed:!0}))}}connectedCallback(){super.connectedCallback(),this.setAttribute(`role`,`tab`)}get icon(){return this._icon}set icon(e){let t=this._icon;t!==e&&(this._icon=e,this.requestUpdate(`icon`,t),this.updateIconSlot())}firstUpdated(e){super.firstUpdated(e),this.addEventListener(`click`,this._onActivate),this._icon&&this.updateIconSlot()}updated(){if(super.updated(),this.setAttribute(`aria-selected`,this.active?`true`:`false`),this.iconOnly&&!this.hasAttribute(`aria-label`)){let e=this.textContent?.trim()??``;e&&this.setAttribute(`aria-label`,e)}}static{this.styles=[...tc.styles,p`
|
|
12288
12288
|
/* Icon-only: dölj textslot */
|
|
12289
12289
|
:host([icon-only]) slot:not([name='icon']) {
|
|
12290
12290
|
display: none;
|
|
12291
12291
|
}
|
|
12292
|
-
`]}updateIconSlot(){let e=this.querySelector(`md-icon[slot="icon"]`);if(!this._icon){e?.remove();return}if(e)e.textContent=this._icon;else{let e=document.createElement(`md-icon`);e.setAttribute(`slot`,`icon`),e.textContent=this._icon,this.appendChild(e)}}};P([g({type:String})],
|
|
12292
|
+
`]}updateIconSlot(){let e=this.querySelector(`md-icon[slot="icon"]`);if(!this._icon){e?.remove();return}if(e)e.textContent=this._icon;else{let e=document.createElement(`md-icon`);e.setAttribute(`slot`,`icon`),e.textContent=this._icon,this.appendChild(e)}}};P([g({type:String})],Ku.prototype,`icon`,null),P([g({type:Boolean,reflect:!0,attribute:`icon-only`})],Ku.prototype,`iconOnly`,void 0),P([g({type:Boolean,reflect:!0,attribute:`inline-icon`})],Ku.prototype,`inlineIcon`,void 0),Ku=P([a(`scb-primary-tab`)],Ku),y(),C(),k(),F();var qu=class extends ic{constructor(...e){super(...e),this.iconOnly=!1,this._onActivate=()=>{let e=this.textContent?.trim()??``;this.dispatchEvent(new CustomEvent(`activate`,{detail:{label:e},bubbles:!0,composed:!0}))}}connectedCallback(){super.connectedCallback(),this.setAttribute(`role`,`tab`)}get icon(){return this._icon}set icon(e){let t=this._icon;t!==e&&(this._icon=e,this.requestUpdate(`icon`,t),this.updateIconSlot())}firstUpdated(e){if(super.firstUpdated(e),this.iconOnly&&!this.hasAttribute(`aria-label`)){let e=this.textContent?.trim()??``;e&&this.setAttribute(`aria-label`,e)}this.addEventListener(`click`,this._onActivate),this._icon&&this.updateIconSlot()}updated(){if(super.updated(),this.iconOnly&&!this.hasAttribute(`aria-label`)){let e=this.textContent?.trim()??``;e&&this.setAttribute(`aria-label`,e)}}static{this.styles=[...ic.styles,p`
|
|
12293
12293
|
/* Icon-only: göm all text utom slot="icon" */
|
|
12294
12294
|
:host([icon-only]) slot:not([name='icon']) {
|
|
12295
12295
|
display: none;
|
|
12296
12296
|
}
|
|
12297
|
-
`]}updateIconSlot(){let e=this.querySelector(`md-icon[slot="icon"]`);if(!this._icon){e?.remove();return}if(e)e.textContent=this._icon;else{let e=document.createElement(`md-icon`);e.setAttribute(`slot`,`icon`),e.textContent=this._icon,this.appendChild(e)}}};P([g({type:String})],
|
|
12297
|
+
`]}updateIconSlot(){let e=this.querySelector(`md-icon[slot="icon"]`);if(!this._icon){e?.remove();return}if(e)e.textContent=this._icon;else{let e=document.createElement(`md-icon`);e.setAttribute(`slot`,`icon`),e.textContent=this._icon,this.appendChild(e)}}};P([g({type:String})],qu.prototype,`icon`,null),P([g({type:Boolean,reflect:!0,attribute:`icon-only`})],qu.prototype,`iconOnly`,void 0),qu=P([a(`scb-secondary-tab`)],qu),y(),C(),F();var Ju=class extends cc{constructor(...e){super(...e),this.ariaLabel=``,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this._isDispatching=!1,this._onChange=e=>{if(!e.composed&&!this._isDispatching){e.stopPropagation(),this._isDispatching=!0;let t=e.target.activeTabIndex;this.dispatchEvent(new CustomEvent(`change`,{detail:{activeTabIndex:t},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`tabschange`,{detail:{activeTabIndex:t},bubbles:!0,composed:!0})),this._isDispatching=!1}}}static{this.styles=[...cc.styles,p`
|
|
12298
12298
|
:host {
|
|
12299
12299
|
/*Containerfärg */
|
|
12300
12300
|
--md-primary-tab-container-color: var(--md-sys-color-surface);
|
|
@@ -12321,7 +12321,7 @@
|
|
|
12321
12321
|
margin-inline-start: var(--scb-tabs-spacing-inline-start, 0);
|
|
12322
12322
|
margin-inline-end: var(--scb-tabs-spacing-inline-end, 0);
|
|
12323
12323
|
}
|
|
12324
|
-
`]}connectedCallback(){super.connectedCallback(),this.setAttribute(`role`,`tablist`)}firstUpdated(e){super.firstUpdated(e),this.addEventListener(`change`,this._onChange),this.#e()}updated(e){super.updated(e),(e.has(`spacing`)||e.has(`spacingTop`)||e.has(`spacingBottom`)||e.has(`spacingLeft`)||e.has(`spacingRight`))&&this.#e()}#e(){let e=this.#t(this.spacing),t=this.#t(this.spacingTop)??e,n=this.#t(this.spacingBottom)??e,r=this.#t(this.spacingLeft),i=this.#t(this.spacingRight);t?this.style.setProperty(`--scb-tabs-spacing-block-start`,t):this.style.removeProperty(`--scb-tabs-spacing-block-start`),n?this.style.setProperty(`--scb-tabs-spacing-block-end`,n):this.style.removeProperty(`--scb-tabs-spacing-block-end`),r?this.style.setProperty(`--scb-tabs-spacing-inline-start`,r):this.style.removeProperty(`--scb-tabs-spacing-inline-start`),i?this.style.setProperty(`--scb-tabs-spacing-inline-end`,i):this.style.removeProperty(`--scb-tabs-spacing-inline-end`)}#t(e){if(!e)return;let t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}};P([g({type:String,reflect:!0,attribute:`aria-label`})],
|
|
12324
|
+
`]}connectedCallback(){super.connectedCallback(),this.setAttribute(`role`,`tablist`)}firstUpdated(e){super.firstUpdated(e),this.addEventListener(`change`,this._onChange),this.#e()}updated(e){super.updated(e),(e.has(`spacing`)||e.has(`spacingTop`)||e.has(`spacingBottom`)||e.has(`spacingLeft`)||e.has(`spacingRight`))&&this.#e()}#e(){let e=this.#t(this.spacing),t=this.#t(this.spacingTop)??e,n=this.#t(this.spacingBottom)??e,r=this.#t(this.spacingLeft),i=this.#t(this.spacingRight);t?this.style.setProperty(`--scb-tabs-spacing-block-start`,t):this.style.removeProperty(`--scb-tabs-spacing-block-start`),n?this.style.setProperty(`--scb-tabs-spacing-block-end`,n):this.style.removeProperty(`--scb-tabs-spacing-block-end`),r?this.style.setProperty(`--scb-tabs-spacing-inline-start`,r):this.style.removeProperty(`--scb-tabs-spacing-inline-start`),i?this.style.setProperty(`--scb-tabs-spacing-inline-end`,i):this.style.removeProperty(`--scb-tabs-spacing-inline-end`)}#t(e){if(!e)return;let t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}};P([g({type:String,reflect:!0,attribute:`aria-label`})],Ju.prototype,`ariaLabel`,void 0),P([g({type:String,reflect:!0})],Ju.prototype,`spacing`,void 0),P([g({type:String,attribute:`spacing-top`,reflect:!0})],Ju.prototype,`spacingTop`,void 0),P([g({type:String,attribute:`spacing-bottom`,reflect:!0})],Ju.prototype,`spacingBottom`,void 0),P([g({type:String,attribute:`spacing-left`,reflect:!0})],Ju.prototype,`spacingLeft`,void 0),P([g({type:String,attribute:`spacing-right`,reflect:!0})],Ju.prototype,`spacingRight`,void 0),Ju=P([a(`scb-tabs`)],Ju),C(),y(),rl(),Ec(),w(),k(),E(),F();var Yu,Xu=class extends S{static{Yu=this}constructor(...e){super(...e),this.expanded=!1,this.size=`medium`,this.label=``,this.supportingText=``,this.itemHref=`#`,this.noDivider=!1,this._unique=Yu._uid(),this._overflowVisibleTimer=null,this._slotHasContent=!1,this._trailingSlotHasContent=!1,this._onSlotChange=()=>{let e=this.renderRoot.querySelector(`slot:not([name])`),t=!!e&&e.assignedElements({flatten:!0}).length>0;this._slotHasContent!==t&&(this._slotHasContent=t,this.requestUpdate()),!this._slotHasContent&&this.expanded&&(this.expanded=!1),this._applyInertByExpanded()},this._toggleAccordion=()=>{if(!this._slotHasContent)return;let e=!this.expanded;this.setExpanded(e)},this._onKeyDown=e=>{let t=this.closest(`scb-toc`),n=Array.from(t?.querySelectorAll(`scb-toc-item`)||[]).map(e=>({host:e,label:e.renderRoot.querySelector(`.toc-item-label`)||null})).filter(e=>!!e.label),r=n.findIndex(e=>e.host===this);if(r<0)return;let i=e.currentTarget?.classList?.contains(`toc-chevron-button`)??!1;switch(e.key){case`Enter`:case` `:if(!i)return;e.preventDefault(),this._toggleAccordion();break;case`ArrowDown`:e.preventDefault(),r<n.length-1&&n[r+1].label.focus();break;case`ArrowUp`:e.preventDefault(),r>0&&n[r-1].label.focus();break;case`Home`:e.preventDefault(),n.length&&n[0].label.focus();break;case`End`:e.preventDefault(),n.length&&n[n.length-1].label.focus();break}}}setExpanded(e){this.expanded!==e&&(this.expanded=e)}static{this._uidPrefix=`uid-${Math.random().toString(36).slice(2)}`}static{this._uidSeq=0}static _uid(){return globalThis.crypto?.randomUUID?.()??`${Yu._uidPrefix}-${++Yu._uidSeq}`}static{this.styles=[p`
|
|
12325
12325
|
:host {
|
|
12326
12326
|
display: block;
|
|
12327
12327
|
--scb-toc-transition-duration: var(--motion-duration-short, 150ms);
|
|
@@ -12623,7 +12623,7 @@
|
|
|
12623
12623
|
|
|
12624
12624
|
${this.noDivider?``:b`<scb-divider></scb-divider>`}
|
|
12625
12625
|
</div>
|
|
12626
|
-
`}};P([g({type:Boolean,reflect:!0})],
|
|
12626
|
+
`}};P([g({type:Boolean,reflect:!0})],Xu.prototype,`expanded`,void 0),P([g({type:String,reflect:!0})],Xu.prototype,`size`,void 0),P([g({type:String,reflect:!0})],Xu.prototype,`label`,void 0),P([g({type:String,attribute:`supporting-text`})],Xu.prototype,`supportingText`,void 0),P([g({type:String,attribute:`item-href`})],Xu.prototype,`itemHref`,void 0),P([g({type:Boolean,attribute:`no-divider`})],Xu.prototype,`noDivider`,void 0),Xu=Yu=P([a(`scb-toc-item`)],Xu),C(),y(),F();var Zu=class extends S{constructor(...e){super(...e),this.singleOpen=!1,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0}static{this.styles=[p`
|
|
12627
12627
|
:host {
|
|
12628
12628
|
display: block;
|
|
12629
12629
|
/* Vertikalt avstånd styrs av spacing-attributen via CSS-variabler */
|
|
@@ -12641,8 +12641,8 @@
|
|
|
12641
12641
|
<div class="scb-toc-list" role="list">
|
|
12642
12642
|
<slot @slotchange=${this.#t}></slot>
|
|
12643
12643
|
</div>
|
|
12644
|
-
`}_getDirectItems(){return Array.from(this.children).filter(e=>e.tagName===`SCB-TOC-ITEM`)}#e(e){if(!this.singleOpen)return;let t=e;if(!t.detail?.expanded)return;let n=t.target;!n||n.tagName!==`SCB-TOC-ITEM`||this._getDirectItems().forEach(e=>{e!==n&&e.expanded&&e.setExpanded(!1)})}#t(){this.singleOpen&&this.#n()}#n(){if(!this.singleOpen)return;let e=this._getDirectItems().filter(e=>e.expanded);e.length<=1||e.slice(1).forEach(e=>e.setExpanded(!1))}#r(){let e=this.#i(this.spacing),t=this.#i(this.spacingTop)??e,n=this.#i(this.spacingBottom)??e,r=this.#i(this.spacingLeft),i=this.#i(this.spacingRight);t?this.style.setProperty(`--scb-toc-spacing-block-start`,t):this.style.removeProperty(`--scb-toc-spacing-block-start`),n?this.style.setProperty(`--scb-toc-spacing-block-end`,n):this.style.removeProperty(`--scb-toc-spacing-block-end`),r?this.style.setProperty(`--scb-toc-spacing-inline-start`,r):this.style.removeProperty(`--scb-toc-spacing-inline-start`),i?this.style.setProperty(`--scb-toc-spacing-inline-end`,i):this.style.removeProperty(`--scb-toc-spacing-inline-end`)}#i(e){if(!e)return;let t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}};P([g({type:Boolean,attribute:`single-open`,reflect:!0})],
|
|
12645
|
-
`)}`;return new Blob([i],{type:`text/csv;charset=utf-8;`})}async function
|
|
12644
|
+
`}_getDirectItems(){return Array.from(this.children).filter(e=>e.tagName===`SCB-TOC-ITEM`)}#e(e){if(!this.singleOpen)return;let t=e;if(!t.detail?.expanded)return;let n=t.target;!n||n.tagName!==`SCB-TOC-ITEM`||this._getDirectItems().forEach(e=>{e!==n&&e.expanded&&e.setExpanded(!1)})}#t(){this.singleOpen&&this.#n()}#n(){if(!this.singleOpen)return;let e=this._getDirectItems().filter(e=>e.expanded);e.length<=1||e.slice(1).forEach(e=>e.setExpanded(!1))}#r(){let e=this.#i(this.spacing),t=this.#i(this.spacingTop)??e,n=this.#i(this.spacingBottom)??e,r=this.#i(this.spacingLeft),i=this.#i(this.spacingRight);t?this.style.setProperty(`--scb-toc-spacing-block-start`,t):this.style.removeProperty(`--scb-toc-spacing-block-start`),n?this.style.setProperty(`--scb-toc-spacing-block-end`,n):this.style.removeProperty(`--scb-toc-spacing-block-end`),r?this.style.setProperty(`--scb-toc-spacing-inline-start`,r):this.style.removeProperty(`--scb-toc-spacing-inline-start`),i?this.style.setProperty(`--scb-toc-spacing-inline-end`,i):this.style.removeProperty(`--scb-toc-spacing-inline-end`)}#i(e){if(!e)return;let t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}};P([g({type:Boolean,attribute:`single-open`,reflect:!0})],Zu.prototype,`singleOpen`,void 0),P([g({type:String,reflect:!0})],Zu.prototype,`spacing`,void 0),P([g({type:String,attribute:`spacing-top`,reflect:!0})],Zu.prototype,`spacingTop`,void 0),P([g({type:String,attribute:`spacing-bottom`,reflect:!0})],Zu.prototype,`spacingBottom`,void 0),P([g({type:String,attribute:`spacing-left`,reflect:!0})],Zu.prototype,`spacingLeft`,void 0),P([g({type:String,attribute:`spacing-right`,reflect:!0})],Zu.prototype,`spacingRight`,void 0),Zu=P([a(`scb-toc`)],Zu);var Qu=e=>{let t=getComputedStyle(e).backgroundColor;return t&&t!==`rgba(0, 0, 0, 0)`?t:`#ffffff`};function $u({lang:e,title:t}){let n=e===`en`?`visualization`:`visualisering`;return(t||n).normalize(`NFD`).replace(/[\u0300-\u036f]/g,``).toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)||n}function ed(e,t){let n=t===`csv`?e.lang===`en`?`-table`:`-tabell`:``;return`${$u(e)}${n}.${t}`}function td(e=document){return e}function nd(e=document){let t=td(e);return t.fullscreenElement||t.webkitFullscreenElement||null}function rd(e){return!!(e.requestFullscreen||e.webkitRequestFullscreen)}async function id(e,t=document){if(!rd(e))return;let n=td(t),r=nd(t);if(r===e){n.exitFullscreen?await n.exitFullscreen():n.webkitExitFullscreen&&await n.webkitExitFullscreen();return}r&&(n.exitFullscreen?await n.exitFullscreen():n.webkitExitFullscreen&&await n.webkitExitFullscreen()),e.requestFullscreen?await e.requestFullscreen():e.webkitRequestFullscreen&&await e.webkitRequestFullscreen()}async function ad(e,t=document){let n=t.createElement(`iframe`);n.setAttribute(`aria-hidden`,`true`),n.style.position=`fixed`,n.style.right=`0`,n.style.bottom=`0`,n.style.width=`0`,n.style.height=`0`,n.style.border=`0`,n.style.visibility=`hidden`,t.body.appendChild(n);let r=()=>{n.remove()},i=n.contentDocument,a=n.contentWindow;if(!i||!a){r();return}i.open(),i.write(e),i.close();let o=Array.from(i.images||[]);await Promise.all(o.map(e=>e.complete?Promise.resolve():new Promise(t=>{e.addEventListener(`load`,()=>t(null),{once:!0}),e.addEventListener(`error`,()=>t(null),{once:!0})})));let s=()=>{a.removeEventListener(`afterprint`,s),r()};a.addEventListener(`afterprint`,s,{once:!0}),setTimeout(()=>{a.focus(),a.print(),setTimeout(r,1e3)},50)}async function od(e,t){e.setAttribute(`data-scb-viz-force-light`,``),await new Promise(e=>requestAnimationFrame(()=>e(null)));try{return await t()}finally{e.removeAttribute(`data-scb-viz-force-light`)}}function sd(e,t){let n=t===`en`?`,`:`;`,r=e=>`"${String(e??``).replace(/\r?\n/g,` `).replace(/"/g,`""`)}"`,i=`\uFEFF${e.map(e=>e.map(r).join(n)).join(`\r
|
|
12645
|
+
`)}`;return new Blob([i],{type:`text/csv;charset=utf-8;`})}async function cd(e,t,n){let r=await dd(e,t);return r?gd(r,n===`jpeg`?`image/jpeg`:`image/png`,n===`jpeg`?.92:void 0):null}async function ld(e,t,n){let r=await dd(e,t);return r?r.toDataURL(n===`jpeg`?`image/jpeg`:`image/png`,n===`jpeg`?.92:void 0):null}function ud(e,t,n=document){let r=URL.createObjectURL(e),i=n.createElement(`a`);i.href=r,i.download=t,n.body.appendChild(i),i.click(),i.remove(),setTimeout(()=>URL.revokeObjectURL(r),0)}async function dd(e,t){let n=Qu(t);if(e instanceof HTMLCanvasElement){let t=e.width||Math.round(e.getBoundingClientRect().width),r=e.height||Math.round(e.getBoundingClientRect().height);if(!t||!r)return null;let i=document.createElement(`canvas`);i.width=t,i.height=r;let a=i.getContext(`2d`);return a?(a.fillStyle=n,a.fillRect(0,0,t,r),a.drawImage(e,0,0,t,r),i):null}if(e instanceof HTMLImageElement){let t=e.naturalWidth||e.width,r=e.naturalHeight||e.height;return!t||!r?null:md(e.currentSrc||e.src,t,r,n)}let{width:r,height:i,serialized:a}=fd(e);if(!r||!i||!a)return null;let o=new Blob([a],{type:`image/svg+xml;charset=utf-8`}),s=URL.createObjectURL(o);try{return await md(s,r,i,n)}finally{URL.revokeObjectURL(s)}}function fd(e){let t=e.cloneNode(!0),n=e.getBoundingClientRect(),r=e.viewBox?.baseVal,i=Math.round(r?.width||n.width||Number(e.getAttribute(`width`))||0),a=Math.round(r?.height||n.height||Number(e.getAttribute(`height`))||0);return t.setAttribute(`xmlns`,`http://www.w3.org/2000/svg`),t.setAttribute(`xmlns:xlink`,`http://www.w3.org/1999/xlink`),!t.getAttribute(`width`)&&i&&t.setAttribute(`width`,String(i)),!t.getAttribute(`height`)&&a&&t.setAttribute(`height`,String(a)),!t.getAttribute(`viewBox`)&&i&&a&&t.setAttribute(`viewBox`,`0 0 ${i} ${a}`),pd(e,t),t.querySelectorAll(`.highcharts-tooltip, .highcharts-contextmenu, .highcharts-a11y-proxy-container, .highcharts-a11y-dummy-point`).forEach(e=>e.remove()),{width:i,height:a,serialized:new XMLSerializer().serializeToString(t)}}function pd(e,t){let n=getComputedStyle(e),r=``;for(let e=0;e<n.length;e+=1){let t=n[e],i=n.getPropertyValue(t);i&&(r+=`${t}:${i};`)}r&&t.setAttribute(`style`,r);let i=Array.from(e.children),a=Array.from(t.children);for(let e=0;e<i.length;e+=1){let t=i[e],n=a[e];t&&n&&pd(t,n)}}async function md(e,t,n,r){let i=Math.max(1,Math.min(2,window.devicePixelRatio||1)),a=Math.max(1,Math.round(t)),o=Math.max(1,Math.round(n)),s=document.createElement(`canvas`);s.width=Math.max(1,Math.round(a*i)),s.height=Math.max(1,Math.round(o*i));let c=s.getContext(`2d`);if(!c)return null;let l=await hd(e);return l?(c.scale(i,i),c.fillStyle=r,c.fillRect(0,0,a,o),c.drawImage(l,0,0,a,o),s):null}function hd(e){return new Promise(t=>{let n=new Image;n.crossOrigin=`anonymous`,n.onload=()=>t(n),n.onerror=()=>t(null),n.src=e})}function gd(e,t,n){return new Promise(r=>{e.toBlob(e=>r(e),t,n)})}function _d(e,t){return`<table class="scb-viz-print-table">${e.headers.length?`<thead><tr>${e.headers.map((n,r)=>`<th scope="col" class="${e.alignments[r]===`right`?`align-right`:`align-left`}"><span class="scb-viz-print-table-heading-text">${n.html||t(n.text)}</span></th>`).join(``)}</tr></thead>`:``}${`<tbody>${e.rows.map((n,r)=>{let i=e.rowHeaderRows[r]===!0;return`<tr>${n.map((n,r)=>{let a=e.alignments[r]===`right`?`align-right`:`align-left`,o=n.html||t(n.text);return r===0&&i?`<th scope="row" class="${a}">${o}</th>`:`<td class="${a}">${o}</td>`}).join(``)}</tr>`}).join(``)}</tbody>`}</table>`}function vd(e){let t=[];if(e.description&&t.push(`
|
|
12646
12646
|
<section class="print-section">
|
|
12647
12647
|
<h2>${e.escapeHtml(e.descriptionLabel)}</h2>
|
|
12648
12648
|
<div class="body-text-rich">${e.renderRichTextHtml(e.description)}</div>
|
|
@@ -12669,7 +12669,7 @@
|
|
|
12669
12669
|
<h2>${e.escapeHtml(e.moreAboutStatsLabel)}</h2>
|
|
12670
12670
|
${n.join(``)}
|
|
12671
12671
|
</section>
|
|
12672
|
-
`)}return t.join(``)}function
|
|
12672
|
+
`)}return t.join(``)}function yd(e){let t=e.escapeHtml;return`<!doctype html>
|
|
12673
12673
|
<html lang="${t(e.lang||`sv`)}">
|
|
12674
12674
|
<head>
|
|
12675
12675
|
<meta charset="utf-8">
|
|
@@ -12739,7 +12739,7 @@
|
|
|
12739
12739
|
${e.footerHtml||``}
|
|
12740
12740
|
</article>
|
|
12741
12741
|
</body>
|
|
12742
|
-
</html>`}var
|
|
12742
|
+
</html>`}var bd=(e,t,n=`1.25`)=>{let r=document.createElementNS(e,`path`);return r.setAttribute(`d`,t),r.setAttribute(`class`,`scb-viz-highcharts-pattern__mark`),r.setAttribute(`stroke-width`,n),r.setAttribute(`stroke-linecap`,`square`),r},xd=(e,t,n,r)=>{let i=document.createElementNS(e,`circle`);return i.setAttribute(`cx`,t),i.setAttribute(`cy`,n),i.setAttribute(`r`,r),i.setAttribute(`class`,`scb-viz-highcharts-pattern__mark--dot`),i},Sd=(e,t,n,r,i)=>{let a=document.createElementNS(e,`rect`);return a.setAttribute(`x`,t),a.setAttribute(`y`,n),a.setAttribute(`width`,r),a.setAttribute(`height`,i),a.setAttribute(`class`,`scb-viz-highcharts-pattern__mark--square`),a},Cd={dashStyles:[`Solid`,`ShortDash`,`ShortDot`,`ShortDashDot`,`ShortDashDotDot`,`Dot`,`LongDash`,`LongDashDot`,`Dash`,`DashDot`],markerSymbols:[`circle`,`diamond`,`square`,`triangle`,`triangle-down`],defaultPatternKind:`grid`,patterns:[{kind:`diagonal`,appendMarks:(e,t)=>{e.appendChild(bd(t,`M-2,8 l10,-10 M0,10 l10,-10 M8,12 l4,-4`))}},{kind:`dots`,appendMarks:(e,t)=>{e.appendChild(xd(t,`2`,`2`,`1.2`)),e.appendChild(xd(t,`7`,`7`,`1.2`))}},{kind:`cross`,appendMarks:(e,t)=>{e.appendChild(bd(t,`M0,0 L10,10 M10,0 L0,10`))}},{kind:`vertical`,appendMarks:(e,t)=>{e.appendChild(bd(t,`M2,0 L2,10 M7,0 L7,10`))}},{kind:`horizontal`,appendMarks:(e,t)=>{e.appendChild(bd(t,`M0,2 L10,2 M0,7 L10,7`))}},{kind:`grid`,appendMarks:(e,t)=>{e.appendChild(bd(t,`M0,0 L10,0 M0,5 L10,5 M0,10 L10,10`,`1`))}},{kind:`diagonal-reverse`,appendMarks:(e,t)=>{e.appendChild(bd(t,`M0,0 L10,10 M-2,2 L8,12 M2,-2 L12,8`))}},{kind:`dots-dense`,appendMarks:(e,t)=>{e.appendChild(xd(t,`2`,`2`,`1`)),e.appendChild(xd(t,`7`,`2`,`1`)),e.appendChild(xd(t,`2`,`7`,`1`)),e.appendChild(xd(t,`7`,`7`,`1`))}},{kind:`checker`,appendMarks:(e,t)=>{e.appendChild(Sd(t,`0`,`0`,`4`,`4`)),e.appendChild(Sd(t,`5`,`5`,`4`,`4`))}},{kind:`zigzag`,appendMarks:(e,t)=>{e.appendChild(bd(t,`M-2,8 L2,4 L6,8 L10,4 L14,8 M-2,3 L2,-1 L6,3 L10,-1 L14,3`))}}]};function wd(){return Cd.patterns.map(({kind:e})=>e)}function Td(e){return Cd.patterns.find(({kind:t})=>t===e)||Cd.patterns.find(({kind:e})=>e===Cd.defaultPatternKind)||Cd.patterns[0]}function Ed(e,t,n){let r=Td(n);return r?.appendMarks(e,t),r?.kind||n}function Dd(e){let t=Cd.dashStyles,n=Cd.markerSymbols,r=wd();return{dashStyle:t[e%t.length],markerSymbol:n[e%n.length],patternKind:r[e%r.length]}}function Od(e){return Dd(e)}function kd(e,t){let n=``,r=t&&t.options&&typeof t.options==`object`?t.options:{},i=t&&t.userOptions&&typeof t.userOptions==`object`?t.userOptions:{},a=e&&e.options&&typeof e.options==`object`?e.options:{},o=a.custom&&typeof a.custom==`object`?a.custom:{},s=e&&e.custom&&typeof e.custom==`object`?e.custom:{};return r.chart&&typeof r.chart.id==`string`?n=r.chart.id:i.chart&&typeof i.chart.id==`string`&&(n=i.chart.id),n=String(n||``).trim().toLowerCase(),n===`grouped-column`||n===`grouped-bar`||r.custom&&r.custom.scbVizGroupedClustered===!0||o.scbVizGroupedCategory===!0||o.scbVizGroupedCategoryLegend===!0||s.scbVizGroupedCategory===!0||s.scbVizGroupedCategoryLegend===!0||e&&e._scbVizGroupedCategoryLegendItem===!0?!0:Ad(e)}function Ad(e){return Array.isArray(e?.points)&&e.points.some(e=>{let t=e&&e.custom&&typeof e.custom==`object`?e.custom:{};return typeof t.scbVizGroup==`string`&&t.scbVizGroup.trim()})}function jd(e){let t=[e?.colorIndex,e?.options?.colorIndex,e?.userOptions?.colorIndex,e?.series?.colorIndex,e?.series?.options?.colorIndex].find(e=>Number.isInteger(e));return Number.isInteger(t)?Number(t):null}function Md(e){return!e||typeof e!=`object`?{indexByKey:{},nextIndex:0}:((!e.scbVizGroupedSeriesDifferentiationStore||typeof e.scbVizGroupedSeriesDifferentiationStore!=`object`)&&(e.scbVizGroupedSeriesDifferentiationStore={indexByKey:{},nextIndex:0}),e.scbVizGroupedSeriesDifferentiationStore)}function Nd(e,t){let n=jd(e);if(Number.isInteger(n))return`color:${n}`;let r=e?.custom&&typeof e.custom==`object`&&typeof e.custom.scbVizGroup==`string`?e.custom.scbVizGroup.trim():``;if(r)return`group:${r}`;let i=typeof e?.name==`string`?e.name.trim():``;if(i)return`name:${i}`;let a=typeof e?.series?.name==`string`?e.series.name.trim():``;return a?`series:${a}`:`fallback:${t}`}function Pd(e,t,n){let r=jd(e);if(typeof r==`number`&&Number.isInteger(r))return r;let i=Md(t),a=Nd(e,n);return Object.prototype.hasOwnProperty.call(i.indexByKey,a)||(i.indexByKey[a]=i.nextIndex,i.nextIndex+=1),i.indexByKey[a]}function Fd(e,t,n){let r=Pd(e,t,n);return{variantIndex:r,...Od(r)}}function Id(e){return e.getCurrentPrintableView()!==`diagram`||!e.chart?.series?.length||!e.isHighchartsStyledMode(e.chart)?!1:e.chart.series.some(t=>e.getSeriesDifferentiationGroup(t,e.chart)!==null)}function Ld(e){let t=e?.element??e;return t instanceof SVGElement?t:null}function Rd(e){return!!(e?.styledMode||e?.renderer?.styledMode||e?.options?.chart?.styledMode)}function zd(e){if(e?.container instanceof SVGSVGElement)return e.container;let t=e?.renderTo?.querySelector(`svg`)??e?.container?.querySelector?.(`svg`);return t instanceof SVGSVGElement?t:null}function Bd(e,t){let n=Ld(e);return Array.from(n?.classList??[]).find(e=>/^highcharts-color-\d+$/.test(e))??`highcharts-color-${t}`}function Vd(e,t){let n=Ld(e);n&&(n.setAttribute(`data-scb-viz-role`,t.role),t.dashStyle?n.setAttribute(`data-scb-viz-dash-style`,t.dashStyle):n.removeAttribute(`data-scb-viz-dash-style`),t.patternKind?n.setAttribute(`data-scb-viz-pattern-kind`,t.patternKind):n.removeAttribute(`data-scb-viz-pattern-kind`))}function Hd(e){let t=Ld(e);t&&(t.removeAttribute(`data-scb-viz-role`),t.removeAttribute(`data-scb-viz-dash-style`),t.removeAttribute(`data-scb-viz-pattern-kind`))}function Ud(e,t){let n=Ld(e);if(!n||!t)return;let r=Array.from(n.classList).find(e=>/^highcharts-color-\d+$/.test(e));r!==t&&(r&&(n.classList.remove(r),n.setAttribute(`data-scb-viz-prev-color-class`,r)),n.classList.add(t),n.setAttribute(`data-scb-viz-added-color-class`,t))}function Wd(e){let t=Ld(e);if(!t)return;let n=t.getAttribute(`data-scb-viz-added-color-class`),r=t.getAttribute(`data-scb-viz-prev-color-class`);n&&(t.classList.remove(n),t.removeAttribute(`data-scb-viz-added-color-class`)),r&&(t.classList.add(r),t.removeAttribute(`data-scb-viz-prev-color-class`))}function Gd(e){let t=[],n=[],r=Ld(e?.legendItem?.group),i=(e,t)=>{let n=Ld(t);!n||e.includes(n)||e.push(n)};if(i(t,e?.legendLine),i(t,e?.legendItem?.line),i(n,e?.legendSymbol),i(n,e?.legendItem?.symbol),i(n,e?.legendArea),i(n,e?.legendItem?.area),r){let e=r.querySelector(`.highcharts-graph, .highcharts-legend-graph, line`);e&&i(t,e),r.querySelectorAll(`rect, circle, .highcharts-point, .highcharts-area, .highcharts-legend-symbol, path`).forEach(e=>{i(n,e)})}return{graphTargets:t,fillTargets:n.filter(e=>!t.includes(e))}}function Kd(e,t,n){let r=zd(e);if(!r)return;let i=`http://www.w3.org/2000/svg`,a=r.querySelector(`defs`);a instanceof SVGDefsElement||(a=document.createElementNS(i,`defs`),r.insertBefore(a,r.firstChild));let o=`scb-viz-pattern-${t}-${n}`;if(a.querySelector(`#${o}`))return;let s=document.createElementNS(i,`pattern`);s.setAttribute(`id`,o),s.setAttribute(`patternUnits`,`userSpaceOnUse`),s.setAttribute(`width`,`10`),s.setAttribute(`height`,`10`),s.classList.add(t);let c=document.createElementNS(i,`rect`);c.setAttribute(`x`,`0`),c.setAttribute(`y`,`0`),c.setAttribute(`width`,`10`),c.setAttribute(`height`,`10`),c.setAttribute(`class`,`scb-viz-highcharts-pattern__background`),s.appendChild(c),Ed(s,i,n),a.appendChild(s)}function qd(e){return e&&typeof e==`object`&&`html`in e&&`text`in e?{html:typeof e.html==`string`?e.html:``,text:typeof e.text==`string`?e.text:``}:{html:``,text:e==null?``:String(e)}}function Jd(e){if(!e)return;let t=e.assignedElements({flatten:!0}),n=[];t.forEach(e=>{if(e.tagName===`TABLE`){n.push(e);return}e.querySelectorAll(`table`).forEach(e=>n.push(e))});let r=n[0];if(!r)return;let i=[],a=[],o=[],s=e=>e?(e.textContent??``).replace(/\s+/g,` `).trim():``,c=e=>e?{html:(e.innerHTML??``).trim(),text:s(e)}:{html:``,text:``},l=r.querySelector(`thead tr`);l&&Array.from(l.querySelectorAll(`th, td`)).forEach(e=>{i.push(c(e))});let u=Array.from(r.querySelectorAll(`tbody tr`)),d=u.length>0?u:Array.from(r.querySelectorAll(`tr`)).filter(e=>e.closest(`thead`)===null);if(d.forEach(e=>{let t=Array.from(e.querySelectorAll(`th, td`));if(t.length===0)return;o.push(t[0].tagName===`TH`&&e.closest(`thead`)===null&&e.closest(`tfoot`)===null);let n=[];t.forEach(e=>n.push(c(e))),a.push(n)}),!l&&a.length>0){let e=a[0],t=d[0],n=Array.from(t?.querySelectorAll(`th, td`)??[]);n.length>0&&n.every(e=>e.tagName===`TH`)&&t?.closest(`tbody`)===null&&(i.splice(0,i.length,...e),a.shift(),o.shift())}return{headers:i.length>0?i:void 0,rows:a,rowHeaderRows:o.length>0?o:void 0}}function Yd(e,t){let n=Math.max(e.headers?.length??0,...e.rows.map(e=>e.length)),r=[];for(let i=0;i<n;i+=1){if(i===0){r.push(`left`);continue}let n=e.rows.map(e=>qd(e[i]).text).filter(e=>e!==``&&e!=null),a=n.length>0&&n.every(e=>t(e)!==null);r.push(a?`right`:`left`)}return r}function Xd(e,t){let n=t.normalizeCell??qd,r=t.formatCell??(e=>n(e)),i=t.inferAlignments(e),a=Math.max(e.headers?.length??0,...e.rows.map(e=>e.length));return{alignments:i,colCount:a,headers:(e.headers??[]).map(e=>n(e)),rows:e.rows.map(e=>{let t=e.map((e,t)=>r(e,t,i));for(;t.length<a;)t.push({html:``,text:``});return t}),rowHeaderRows:e.rowHeaderRows??[]}}function Zd(e,t=qd){let n=[];return e.headers?.length&&n.push(e.headers.map(e=>t(e).text)),e.rows.forEach(e=>{n.push(e.map(e=>t(e).text))}),n}Kt();var Qd=class extends vl{};Qd.directiveName=`unsafeSVG`,Qd.resultType=2;var $d=Wt(Qd);C(),y(),rl(),F();var ef=`<svg version="1.1" id="Lager_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
12743
12743
|
viewBox="0 0 727.3 87.3" style="enable-background:new 0 0 727.3 87.3;" xml:space="preserve" fill="currentColor">
|
|
12744
12744
|
<style type="text/css">
|
|
12745
12745
|
.st0{clip-path:url(#SVGID_00000118375311472882578510000008414848687067442345_);}
|
|
@@ -12854,7 +12854,7 @@
|
|
|
12854
12854
|
<path d="M688.2,24.4h5.8v6h-5.8V24.4z M688.2,36.6h5.8v30.1h-5.8V36.6z"/>
|
|
12855
12855
|
<path d="M701.8,24.4h5.8v26.3h0.1l11.2-14.1h7l-10,11.7l11.4,18.3H720l-7.7-14l-4.6,5.4v8.7h-5.8V24.4H701.8z"/>
|
|
12856
12856
|
</svg>
|
|
12857
|
-
|
|
12857
|
+
`,tf=0,$=class extends S{constructor(...e){super(...e),this.variant=`Standard`,this.selectedChip=`Diagram`,this.title=``,this.subtitle=``,this.description=``,this.comment=``,this.source=``,this.footnote=``,this.lang=`sv`,this.imageHref=``,this.officialStatistics=!1,this.disableToggle=!1,this.contentMaxWidth=``,this.containerMaxWidth=``,this.contentHeight=``,this.toggleHeightMode=`stable`,this._actionsMenuOpen=!1,this._seriesDifferentiationEnabled=!1,this._isFullscreen=!1,this._seriesDifferentiationSnapshots=new WeakMap,this._diagramReflowFrame=0,this._chartConfigSyncFrame=0,this._fullscreenDiagramSizingFrame=0,this._fullscreenDiagramHeight=``,this._instanceId=`scb-viz-${++tf}`,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this._onDocumentFullscreenChange=()=>{this._syncFullscreenState()},this._onWindowResize=()=>{this._isFullscreen&&this.#c()},this._onToggleFullscreenClick=async()=>{this._closeActionsMenu(),await this._toggleFullscreen()},this._onDocumentPointerDown=e=>{if(!this._actionsMenuOpen)return;let t=e.composedPath(),n=this.shadowRoot?.querySelector(`.actions-menu`);n&&t.includes(n)||this._closeActionsMenu()},this._onDocumentKeyDown=e=>{this._actionsMenuOpen&&e.key===`Escape`&&(e.preventDefault(),this._closeActionsMenu(),this._focusMenuButton())},this._onPrintClick=async()=>{this._closeActionsMenu(),await this.#x()},this._onDownloadPngClick=async()=>{this._canExportRaster()&&(this._closeActionsMenu(),await this.#_(`png`))},this._onDownloadJpgClick=async()=>{this._canExportRaster()&&(this._closeActionsMenu(),await this.#_(`jpeg`))},this._onDownloadCsvClick=()=>{this._canExportCsv()&&(this._closeActionsMenu(),this.#S())},this._onToggleSeriesDifferentiationClick=()=>{this._seriesDifferentiationEnabled=!this._seriesDifferentiationEnabled,this._closeActionsMenu(),this.#g()}}get descriptionLabel(){return this.lang===`en`?`Description of the chart`:`Beskrivning av diagrammet`}get moreAboutStatsLabel(){return this.lang===`en`?`More about the statistics`:`Mer om statistiken`}get commentLabel(){return this.lang===`en`?`Comments`:`Kommentar`}get sourceLabel(){return this.lang===`en`?`Source`:`Källa`}get footnoteLabel(){return this.lang===`en`?`Footnotes`:`Fotnot`}get officialStatisticsLabel(){return this.lang===`en`?`Official statistics of Sweden`:`Sveriges officiella statistik`}get officialStatisticsTitle(){return this.lang===`en`?`Part of Official statistics of Sweden`:`Tillhör Sveriges officiella statistik`}get officialStatisticsAlt(){return this.lang===`en`?`Read more about Official statistics of Sweden`:`Läs mer om Sveriges officiella statistik`}get actionsMenuLabel(){return this.lang===`en`?`Open menu`:`Öppna meny`}get printLabel(){return this.lang===`en`?`Print`:`Skriv ut`}get downloadPngLabel(){return this.lang===`en`?`Download PNG`:`Ladda ner PNG`}get downloadJpgLabel(){return this.lang===`en`?`Download JPG`:`Ladda ner JPG`}get downloadCsvLabel(){return this.lang===`en`?`Download CSV`:`Ladda ner CSV`}get enableSeriesDifferentiationLabel(){return this.lang===`en`?`Show symbols and patterns`:`Visa symboler och mönster`}get disableSeriesDifferentiationLabel(){return this.lang===`en`?`Hide symbols and patterns`:`Dölj symboler och mönster`}get enterFullscreenLabel(){return this.lang===`en`?`View fullscreen`:`Visa i helskärm`}get exitFullscreenLabel(){return this.lang===`en`?`Exit fullscreen`:`Avsluta helskärm`}_getImageAltText(){return this.lang===`en`?`Chart image`:`Diagrambild`}_getTitleId(){return this.title?`${this._instanceId}-title`:void 0}_getSubtitleId(){return this.subtitle?`${this._instanceId}-subtitle`:void 0}_getDescriptionId(){return this.description?`${this._instanceId}-description`:void 0}_getContentAriaLabelledBy(){let e=[this._getTitleId(),this._getSubtitleId()].filter(Boolean);return e.length?e.join(` `):void 0}_getContentAriaDescribedBy(){let e=[this._getDescriptionId()].filter(Boolean);return e.length?e.join(` `):void 0}static{this.styles=p`
|
|
12858
12858
|
:host {
|
|
12859
12859
|
display: block;
|
|
12860
12860
|
box-sizing: border-box;
|
|
@@ -13469,7 +13469,7 @@
|
|
|
13469
13469
|
width: calc(100% / var(--scb-viz-print-scale, 1));
|
|
13470
13470
|
}
|
|
13471
13471
|
}
|
|
13472
|
-
`}connectedCallback(){super.connectedCallback(),document.addEventListener(`pointerdown`,this._onDocumentPointerDown,!0),document.addEventListener(`keydown`,this._onDocumentKeyDown),document.addEventListener(`fullscreenchange`,this._onDocumentFullscreenChange),document.addEventListener(`webkitfullscreenchange`,this._onDocumentFullscreenChange),window.addEventListener(`resize`,this._onWindowResize),window.visualViewport?.addEventListener(`resize`,this._onWindowResize)}firstUpdated(e){this._readTableDataFromSlot(),this.#C(),this.#T(),this.#u(),this._syncChipClass(),this.#e(),this.#r(),this._syncFullscreenState(),this.#c()}updated(e){super.updated(e),(e.has(`selectedChip`)||e.has(`variant`))&&(this._syncChipClass(),this._closeActionsMenu()),e.has(`selectedChip`)&&this._dispatchSelectedChipChanged(),(e.has(`spacing`)||e.has(`spacingTop`)||e.has(`spacingBottom`)||e.has(`spacingLeft`)||e.has(`spacingRight`))&&this.#C(),e.has(`containerMaxWidth`)&&this.#T(),e.has(`variant`)&&this.#e(),(e.has(`contentMaxWidth`)||e.has(`contentHeight`)||e.has(`toggleHeightMode`)||e.has(`variant`))&&this.#u(),(e.has(`selectedChip`)||e.has(`variant`)||e.has(`contentMaxWidth`)||e.has(`contentHeight`)||e.has(`toggleHeightMode`)||e.has(`_isFullscreen`))&&this.#r(),(e.has(`selectedChip`)||e.has(`variant`))&&this._seriesDifferentiationEnabled&&requestAnimationFrame(()=>{this.#g()}),(e.has(`valueFormat`)||e.has(`timeFormat`)||e.has(`yAxisSettings`)||e.has(`selectedChip`)||e.has(`variant`))&&this.#f(),(e.has(`title`)||e.has(`subtitle`)||e.has(`description`)||e.has(`comment`)||e.has(`source`)||e.has(`footnote`)||e.has(`officialStatistics`)||e.has(`selectedChip`)||e.has(`variant`)||e.has(`_isFullscreen`))&&this.#c()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener(`pointerdown`,this._onDocumentPointerDown,!0),document.removeEventListener(`keydown`,this._onDocumentKeyDown),document.removeEventListener(`fullscreenchange`,this._onDocumentFullscreenChange),document.removeEventListener(`webkitfullscreenchange`,this._onDocumentFullscreenChange),window.removeEventListener(`resize`,this._onWindowResize),window.visualViewport?.removeEventListener(`resize`,this._onWindowResize),this.#t(),this.#n(),this.#d(),this.#s()}_refreshTableDataFromSlot(e){this._readTableDataFromSlot(e||void 0),this.requestUpdate()}_onTableSlotChange(e){let t=e.target;t&&(this._refreshTableDataFromSlot(t),requestAnimationFrame(()=>{this._refreshTableDataFromSlot(t)}))}_onDiagramSlotChange(){this.#u(),this.#r(),this.#f(),this._seriesDifferentiationEnabled&&requestAnimationFrame(()=>{this.#g()}),this.requestUpdate()}#e(){if(this.#t(),typeof ResizeObserver>`u`)return;let e=this.shadowRoot?.querySelector(`.diagram-content`);e&&(this._diagramResizeObserver=new ResizeObserver(()=>{this.#r()}),this._diagramResizeObserver.observe(this),this._diagramResizeObserver.observe(e))}#t(){this._diagramResizeObserver?.disconnect(),this._diagramResizeObserver=void 0}#n(){this._diagramReflowFrame&&=(cancelAnimationFrame(this._diagramReflowFrame),0)}#r(){this.variant!==`Standard`||this.selectedChip!==`Diagram`||(this.#n(),this._diagramReflowFrame=requestAnimationFrame(()=>{this._diagramReflowFrame=requestAnimationFrame(()=>{this._diagramReflowFrame=0,this.#o()})}))}#i(e){let t=e?.getAttribute(`data-highcharts-chart`);if(!t)return;let n=Number.parseInt(t,10);return Number.isNaN(n)?void 0:n}#a(e){for(let t of e){let e=this.#i(t);if(e!==void 0)return e;let n=t.querySelector(`[data-highcharts-chart]`),r=this.#i(n);if(r!==void 0)return r}}#o(){if(this.variant!==`Standard`||this.selectedChip!==`Diagram`)return;let e=this.shadowRoot?.querySelector(`slot[name="diagram"]`);if(!e)return;let t=e.assignedElements({flatten:!0});if(t.length===0)return;let n=this.#a(t);if(n===void 0)return;let r=window.Highcharts?.charts?.[n];r&&(r.setSize?.(null,null,!1),r.reflow?.(),this._seriesDifferentiationEnabled&&this.#g())}_normalizeRenderableCell(e){return Gd(e)}_readTableDataFromSlot(e){let t=e||this.shadowRoot?.querySelector(`slot[name="table"]`);this._slottedTableData=Kd(t)}_inferTableAlignments(e){return qd(e,e=>this._parseTableNumericValue(e))}_parseTableNumericValue(e){if(e==null)return null;if(typeof e==`number`)return Number.isFinite(e)?e:null;let t=String(e).replace(/[ \s]+/g,``).trim();if(!t)return null;t.endsWith(`%`)&&(t=t.slice(0,-1));let n=t.lastIndexOf(`,`),r=t.lastIndexOf(`.`);if(n>-1&&r>-1?t=n>r?t.replace(/\./g,``).replace(`,`,`.`):t.replace(/,/g,``):n>-1&&(t=t.replace(`,`,`.`)),!/^-?\d+(?:\.\d+)?$/.test(t))return null;let i=Number(t);return Number.isFinite(i)?i:null}_formatTableCell(e,t,n){let r=this._normalizeRenderableCell(e);if(r.html)return r;let i=r.text;if(!i)return r;if(t===0){let e=this._normalizeTimeFormat(this.timeFormat),t=this._formatCategoryTimeLabel(i,e);return t===null?r:{html:``,text:t}}if(n[t]!==`right`)return r;if(this._shouldPreserveSourceValueFormatting(this.valueFormat)){let e=this._localizeAutomaticNumericText(i);return e===null?r:{html:``,text:e}}let a=this._parseTableNumericValue(i);if(a===null)return r;let o=this._normalizeValueFormat(this.valueFormat),s=this._formatValueForDisplay(a,o,!0);return s===null?r:{html:``,text:s}}#s(){this._fullscreenDiagramSizingFrame&&=(cancelAnimationFrame(this._fullscreenDiagramSizingFrame),0)}#c(){this.#s(),this._fullscreenDiagramSizingFrame=requestAnimationFrame(()=>{this._fullscreenDiagramSizingFrame=requestAnimationFrame(()=>{this._fullscreenDiagramSizingFrame=0,this.#l()})})}_getViewportHeight(){return Math.round(window.visualViewport?.height||window.innerHeight||document.documentElement.clientHeight||0)}_readCssLength(e){let t=Number.parseFloat(e||`0`);return Number.isFinite(t)?t:0}_getElementOuterHeight(e){let t=this.shadowRoot?.querySelector(e);if(!t)return 0;let n=getComputedStyle(t);return t.getBoundingClientRect().height+this._readCssLength(n.marginTop)+this._readCssLength(n.marginBottom)}_getFullscreenDiagramHeight(){if(!this._isFullscreen||this.variant!==`Standard`||this.selectedChip!==`Diagram`)return``;let e=this._getViewportHeight();if(!e)return``;let t=getComputedStyle(this),n=this._readCssLength(t.paddingTop)+this._readCssLength(t.paddingBottom)+this._getElementOuterHeight(`.header`)+this._getElementOuterHeight(`.actions-row`)+this._getElementOuterHeight(`.footer`)+16,r=Math.floor(e-n);return!Number.isFinite(r)||r<=0?``:`${Math.max(320,r)}px`}#l(){let e=this._getFullscreenDiagramHeight();this._fullscreenDiagramHeight!==e&&(this._fullscreenDiagramHeight=e,this.#u(),this.#r())}_getResolvedContentMaxWidth(){return this.contentMaxWidth?.trim()||``}_getResolvedDiagramHeight(){return this._fullscreenDiagramHeight||this.contentHeight?.trim()||``}_getResolvedDiagramScrollerWidth(){return this._getResolvedContentMaxWidth()}_getResolvedToggleHeightMode(){return this.toggleHeightMode===`auto`?`auto`:`stable`}_getResolvedStandardContentHeight(){return this._getResolvedDiagramHeight()||`600px`}#u(){let e=this.variant===`Standard`?this._getResolvedDiagramHeight():``,t=this.variant===`Standard`&&this._getResolvedToggleHeightMode()===`stable`?this._getResolvedStandardContentHeight():``;this.variant===`Standard`?this.style.setProperty(`--scb-viz-diagram-min-height`,e||`600px`):this.style.removeProperty(`--scb-viz-diagram-min-height`),e?(this.style.setProperty(`--scb-viz-diagram-height`,e),this.style.setProperty(`--scb-viz-diagram-overflow`,`hidden`)):(this.style.removeProperty(`--scb-viz-diagram-height`),this.style.removeProperty(`--scb-viz-diagram-overflow`)),t?this.style.setProperty(`--scb-viz-standard-content-height`,t):this.style.removeProperty(`--scb-viz-standard-content-height`)}_getResolvedTableData(){return this.tableData??this._slottedTableData}_getResolvedTableView(e){return Jd(e,{inferAlignments:e=>this._inferTableAlignments(e),normalizeCell:e=>this._normalizeRenderableCell(e),formatCell:(e,t,n)=>this._formatTableCell(e,t,n)})}_getDiagramAssignedElements(){let e=this.shadowRoot?.querySelector(`slot[name="diagram"]`);return e?e.assignedElements({flatten:!0}):[]}_findExportableVisualElement(e){for(let t of e){if(t instanceof SVGSVGElement||t instanceof HTMLCanvasElement||t instanceof HTMLImageElement)return t;let e=t.querySelector(`svg, canvas, img`);if(e instanceof SVGSVGElement||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement)return e}return null}_getExportableVisualElement(){if(this.variant===`Table`)return null;if(this.variant===`Image`){let e=this.shadowRoot?.querySelector(`.image-content img`);return e instanceof HTMLImageElement?e:null}return this._findExportableVisualElement(this._getDiagramAssignedElements())}#d(){this._chartConfigSyncFrame&&=(cancelAnimationFrame(this._chartConfigSyncFrame),0)}#f(){this.#d(),this._chartConfigSyncFrame=requestAnimationFrame(()=>{this._chartConfigSyncFrame=requestAnimationFrame(()=>{this._chartConfigSyncFrame=0,this.#p()})})}_getDefaultValueFormat(){return{type:`number`,scale:`auto`,decimals:0,decimalSeparator:this.lang===`en`?`.`:`,`}}_normalizeValueFormat(e){let t=this._getDefaultValueFormat(),n=e&&typeof e==`object`?e:{};return{type:[`number`,`currency`,`percent`].includes(String(n.type))?String(n.type):t.type,scale:[`auto`,`raw`,`thousands`,`millions`,`billions`].includes(String(n.scale))?String(n.scale):t.scale,decimals:Number.isFinite(Number(n.decimals))?Math.max(0,Math.min(20,Number(n.decimals))):t.decimals,decimalSeparator:String(n.decimalSeparator)===`.`?`.`:String(n.decimalSeparator)===`,`?`,`:t.decimalSeparator}}_shouldPreserveSourceValueFormatting(e){let t=this._normalizeValueFormat(e);return t.type===`number`&&t.scale===`auto`}_normalizeTimeFormat(e){let t={mode:`raw`,display:`raw`},n=e&&typeof e==`object`?e:{},r=[`raw`,`year`,`monthCode`,`quarterCode`,`weekCode`,`tertialCode`],i=typeof n.mode==`string`?n.mode:t.mode,a=typeof n.display==`string`?n.display:t.display;r.includes(i)||(i=t.mode);let o={raw:[`raw`],year:[`raw`,`year`],monthCode:[`raw`,`iso-month`,`short-month`,`long-month`],quarterCode:[`raw`,`quarter-compact`,`quarter-short`,`quarter-long`],weekCode:[`raw`,`week-compact`,`week-long`],tertialCode:[`raw`,`tertial-compact`,`tertial-short`,`tertial-long`]};return o[i].includes(a)||(a=o[i][0]),i===`raw`&&(a=`raw`),{mode:i,display:a}}_normalizeYAxisSettings(e){let t=e&&typeof e==`object`?e:{},n=Number.isFinite(Number(t.referenceLineValue))?Number(t.referenceLineValue):null;return{startAtZero:!!t.startAtZero,referenceLineEnabled:!!t.referenceLineEnabled&&Number.isFinite(n),referenceLineValue:n,referenceLineLabel:typeof t.referenceLineLabel==`string`?t.referenceLineLabel:``}}_getShortMonthNames(){return[`jan`,`feb`,`mar`,`apr`,`maj`,`jun`,`jul`,`aug`,`sep`,`okt`,`nov`,`dec`]}_getLongMonthNames(){return[`januari`,`februari`,`mars`,`april`,`maj`,`juni`,`juli`,`augusti`,`september`,`oktober`,`november`,`december`]}_formatCategoryTimeLabel(e,t){if(!e||t.mode===`raw`||t.display===`raw`)return null;if(t.mode===`year`){let t=/^\s*(\d{4})\s*$/.exec(e);return t?t[1]:null}if(t.mode===`monthCode`){let n=/^\s*(\d{4})M(0?[1-9]|1[0-2])\s*$/i.exec(e);if(!n)return null;let r=Number(n[2])-1,i=n[1],a=String(r+1).padStart(2,`0`);return t.display===`iso-month`?`${i}-${a}`:t.display===`short-month`?`${this._getShortMonthNames()[r]} ${i}`:t.display===`long-month`?`${this._getLongMonthNames()[r]} ${i}`:e}if(t.mode===`quarterCode`){let n=/^\s*(\d{4})(?:K(V)?|Q)(0?[1-4])\s*$/i.exec(e);if(!n)return null;let r=Number(n[3]),i=n[1];return t.display===`quarter-compact`?`${i} K${r}`:t.display===`quarter-short`?`kv ${r} ${i}`:t.display===`quarter-long`?`${[`första`,`andra`,`tredje`,`fjärde`][r-1]} kvartalet ${i}`:e}if(t.mode===`weekCode`){let n=/^\s*(\d{4})(?:V|W)(0?[1-9]|[1-4][0-9]|5[0-3])\s*$/i.exec(e);if(!n)return null;let r=Number(n[2]),i=n[1];return t.display===`week-compact`?`${i} v. ${r}`:t.display===`week-long`?`vecka ${r} ${i}`:e}if(t.mode===`tertialCode`){let n=/^\s*(\d{4})T(0?[1-3])\s*$/i.exec(e);if(!n)return null;let r=Number(n[2]),i=n[1];return t.display===`tertial-compact`?`${i} T${r}`:t.display===`tertial-short`?`tertial ${r} ${i}`:t.display===`tertial-long`?`${[`första`,`andra`,`tredje`][r-1]} tertialet ${i}`:e}return null}_localizeAutomaticNumericText(e){let t=this._normalizeValueFormat(this.valueFormat),n=String(e??``).trim();if(!n||n===`..`||n===`...`)return null;let r=n.replace(/[ \s]/g,``);if(!/^-?\d+(?:[.,]\d+)?$/.test(r))return null;let i=t.decimalSeparator===`.`?`.`:`,`;return i===`.`&&r.indexOf(`,`)!==-1?r.replace(`,`,`.`):i===`,`&&r.indexOf(`.`)!==-1?r.replace(`.`,`,`):r}_inferAutomaticValueDecimals(e){if(!Number.isFinite(e))return 0;let t=String(e);/e/i.test(t)&&(t=e.toFixed(6).replace(/0+$/,``).replace(/\.$/,``));let n=t.replace(/^-/,``).split(`.`);return n.length>1?Math.min(n[1].length,6):0}_formatAutomaticValueForDisplay(e,t){if(!Number.isFinite(e))return null;let n=this._localizeAutomaticNumericText(t);if(n!==null)return n;let r=this._normalizeValueFormat(this.valueFormat),i=this._inferAutomaticValueDecimals(e);return this._formatLocalizedNumber(e,i,r.decimalSeparator)}_formatLocalizedNumber(e,t,n){let r=new Intl.NumberFormat(this.lang===`en`?`en-GB`:`sv-SE`,{minimumFractionDigits:t,maximumFractionDigits:t}),i=n===`.`||n===`,`?n:this.lang===`en`?`.`:`,`;return r.formatToParts(e).map(e=>e.type===`decimal`?i:e.value).join(``)}_formatValueForDisplay(e,t,n){if(!Number.isFinite(e))return null;let r={raw:1,thousands:1e3,millions:1e6,billions:1e9},i={raw:``,thousands:this.lang===`en`?`k`:`t`,millions:this.lang===`en`?`M`:`mn`,billions:this.lang===`en`?`B`:`md`},a=t.scale;if(a===`auto`){let t=Math.abs(e);a=t>=1e9?`billions`:t>=1e6?`millions`:t>=1e3?`thousands`:`raw`}let o=e/(r[a]||1),s=this._formatLocalizedNumber(o,t.decimals,t.decimalSeparator);t.type===`percent`?s=`${s} %`:t.type===`currency`&&(s=n?`${s} kr`:s);let c=i[a]||``;return c&&(s=`${s} ${c}`),s}_isCategoryAxis(e){return e?.categories?.length>0||e?.options?.type===`category`}_isTooltipNumericLikeText(e){if(typeof e!=`string`)return!1;let t=e.trim();return t?/^-?\d+(?:[.,]\d+)?$/.test(t):!1}_getTooltipPointRowIndex(e){let t=e?.point||e;return Number.isFinite(t?.x)?Number(t.x):Number.isFinite(e?.x)?Number(e.x):Number.isFinite(t?.index)?Number(t.index):Number.isFinite(e?.index)?Number(e.index):null}_getTooltipTableCategoryValue(e){let t=this._getResolvedTableData();if(!t?.rows?.length)return``;let n=this._getTooltipPointRowIndex(e);if(n===null||n<0||n>=t.rows.length)return``;let r=t.rows[n];return!Array.isArray(r)||r.length===0?``:this._normalizeRenderableCell(r[0]).text}_getTooltipSeriesDataCategoryValue(e){let t=e?.point||e,n=t?.series||e?.series,r=this._getTooltipPointRowIndex(e);if(!n||r===null)return``;let i=[n?.options?.data,n?.userOptions?.data];for(let e of i){if(!Array.isArray(e)||r<0||r>=e.length)continue;let t=e[r];if(!t||typeof t!=`object`)continue;let n=t.category!==void 0&&t.category!==null?String(t.category):typeof t.name==`string`?t.name:``;if(n&&!this._isTooltipNumericLikeText(n))return n}let a=t?.options?.category!==void 0&&t.options.category!==null?String(t.options.category):``;if(a&&!this._isTooltipNumericLikeText(a))return a;let o=typeof t?.name==`string`?t.name.trim():``;return o&&!this._isTooltipNumericLikeText(o)?o:``}_getTooltipXAxisLabel(e,t){let n=e?.point||e,r=n?.series?.xAxis||e?.series?.xAxis,i=this._getTooltipPointRowIndex(e),a=[];if(r&&Array.isArray(r.categories)&&i!==null){let e=r.categories[i];e!=null&&a.push(String(e))}typeof n?.category==`string`&&n.category.trim()&&a.push(n.category),typeof e?.key==`string`&&e.key.trim()&&a.push(e.key),typeof e?.x==`string`&&e.x.trim()&&a.push(e.x);let o=this._getTooltipSeriesDataCategoryValue(e);o&&a.push(o);let s=this._getTooltipTableCategoryValue(e);s&&a.push(s);for(let e of a){let n=String(e).trim();if(!(!n||this._isTooltipNumericLikeText(n)))return this._formatCategoryTimeLabel(n,t)??n}let c=a.find(e=>String(e).trim());if(!c)return``;let l=String(c).trim();return this._formatCategoryTimeLabel(l,t)??l}_getTooltipPointLabel(e){let t=e?.point||e,n=t?.series||e?.series,r=String(t?.series?.type||n?.type||t?.series?.options?.type||n?.options?.type||t?.series?.chart?.options?.chart?.type||``).trim().toLowerCase();return[`pie`,`variablepie`].includes(r)?t?.name||n?.name||``:n?.name||t?.name||``}_applyTimeFormatToLiveChart(e){let t=this._normalizeTimeFormat(this.timeFormat);if(t.mode===`raw`||t.display===`raw`)return;let n=this._formatCategoryTimeLabel.bind(this);[...e?.xAxis||[],...e?.yAxis||[]].forEach(e=>{if(!this._isCategoryAxis(e))return;let r=e.options?.labels&&typeof e.options.labels==`object`?{...e.options.labels}:{},i=typeof r.formatter==`function`?r.formatter:null;r.formatter=function(){let e=``;if(this?.axis&&Array.isArray(this.axis.categories)&&typeof this.pos==`number`){let t=this.axis.categories[this.pos];t!=null&&(e=String(t))}else this?.value!==void 0&&this.value!==null&&(e=String(this.value));let r=n(e,t);return r===null?i?i.call(this):e:r},delete r.format,e.update({labels:r},!1)})}_applyValueFormatToLiveChart(e){let t=this._normalizeValueFormat(this.valueFormat),n=this._normalizeTimeFormat(this.timeFormat),r=this._formatValueForDisplay.bind(this),i=this._formatAutomaticValueForDisplay.bind(this),a=this._getTooltipXAxisLabel.bind(this),o=this._getTooltipPointLabel.bind(this);if(this._shouldPreserveSourceValueFormatting(this.valueFormat)){let r=e?.options?.tooltip&&typeof e.options.tooltip==`object`?{...e.options.tooltip}:{},s=e?.options?.plotOptions&&typeof e.options.plotOptions==`object`?{...e.options.plotOptions}:{},c=s.series&&typeof s.series==`object`?{...s.series}:{},l=c.dataLabels&&typeof c.dataLabels==`object`?{...c.dataLabels}:{},u=e?.options?.lang&&typeof e.options.lang==`object`?{...e.options.lang}:{};delete l.format,delete l.formatter,u.decimalPoint=t.decimalSeparator===`.`?`.`:`,`,u.thousandsSep=` `,r.valueDecimals=void 0,r.formatter=function(){let e=Array.isArray(this.points)&&this.points.length?this.points:[this.point||this],t=a(this,n),r=[];return e.forEach(e=>{let t=e?.point||e,n=Number.isFinite(e?.y)?e.y:t?.y,a=o(e),s=i(n,t?.options&&t.options.y!==void 0&&t.options.y!==null?String(t.options.y):t&&t.y!==void 0&&t.y!==null?String(t.y):``);!Number.isFinite(n)||s==null||r.push(`${a?`${String(a)}: `:``}<b>${String(s)}</b><br/>`)}),`${t?`<span>${String(t)}</span><br/>`:``}${r.join(``)}`}.bind(this),e.update({lang:u,tooltip:r,plotOptions:{...s,series:{...c,dataLabels:l}}},!1,!1,!1),(e?.yAxis||[]).forEach(e=>{let t=e.options?.labels&&typeof e.options.labels==`object`?{...e.options.labels}:{};delete t.format,delete t.formatter,e.update({labels:t},!1)});return}e.update({tooltip:{...e.options?.tooltip||{},valueDecimals:t.decimals,formatter:function(){let e=Array.isArray(this.points)&&this.points.length?this.points:[this.point||this],i=a(this,n),s=[];return e.forEach(e=>{let n=e?.point||e,i=r(Number.isFinite(e?.y)?e.y:n?.y,t,!0);if(i===null)return;let a=o(e);s.push(`${a?`${String(a)}: `:``}<b>${i}</b><br/>`)}),`${i?`<span>${String(i)}</span><br/>`:``}${s.join(``)}`}},plotOptions:{...e.options?.plotOptions||{},series:{...e.options?.plotOptions?.series||{},dataLabels:{...e.options?.plotOptions?.series?.dataLabels||{},formatter:function(){return r(Number.isFinite(this?.y)?this.y:this?.point?.y,t,t.type===`percent`)??null}}}}},!1,!1,!1),(e?.yAxis||[]).forEach(e=>{let n=e.options?.labels&&typeof e.options.labels==`object`?{...e.options.labels}:{},i=typeof n.formatter==`function`?n.formatter:null,a=!(e.options?.title&&typeof e.options.title.text==`string`&&e.options.title.text.trim());n.formatter=function(){let e=r(this?.value,t,a);return e===null?i?i.call(this):this?.value:e},(t.type===`percent`||t.scale!==`auto`)&&delete n.format,e.update({labels:n},!1)})}_applyYAxisSettingsToLiveChart(e){let t=this._normalizeYAxisSettings(this.yAxisSettings),n=e?.yAxis||[];n.length&&n.forEach((e,n)=>{let r=e.options&&typeof e.options==`object`?e.options:{},i={},a=r.min!==void 0&&r.min!==null&&r.min!==``;n===0&&t.startAtZero&&!a&&(i.min=0);let o=Array.isArray(r.plotLines)?r.plotLines.filter(e=>e?.id!==`scb-viz-reference-line`):[];n===0&&t.referenceLineEnabled&&Number.isFinite(t.referenceLineValue)&&o.push({id:`scb-viz-reference-line`,className:`scb-axis-plotline scb-viz-reference-line`,value:t.referenceLineValue}),o.length?i.plotLines=o:Array.isArray(r.plotLines)&&(i.plotLines=[]),e.update(i,!1)})}#p(){let e=this._getCurrentHighchartsChart();if(!e)return;let t=!1;this.timeFormat!==void 0&&(this._applyTimeFormatToLiveChart(e),t=!0),this.valueFormat!==void 0&&(this._applyValueFormatToLiveChart(e),t=!0),this.yAxisSettings!==void 0&&(this._applyYAxisSettingsToLiveChart(e),t=!0),t&&e.redraw(!1)}_getCurrentHighchartsChart(){if(this._getCurrentPrintableView()!==`diagram`)return;let e=this.#a(this._getDiagramAssignedElements());if(e!==void 0)return window.Highcharts?.charts?.[e]}_getSeriesDifferentiationGroup(e,t){let n=String(e?.type||e?.options?.type||t?.options?.chart?.type||``).trim().toLowerCase();return[`line`,`spline`,`scatter`].includes(n)?`line`:[`area`,`areaspline`].includes(n)?`area`:[`column`,`bar`].includes(n)?this._isGroupedSeriesDifferentiationChart(e,t)?`grouped-fill`:`fill`:[`pie`,`variablepie`].includes(n)?`point-fill`:null}_getSeriesDifferentiationVariantByIndex(e){return Ed(e)}_isGroupedSeriesDifferentiationChart(e,t){return Dd(e,t)}_usesGroupedPointDifferentiation(e){return Od(e)}_getGroupedSeriesDifferentiationVariant(e,t,n){let r=Nd(e,t,n);return{...r,variantIndex:typeof r.variantIndex==`number`?r.variantIndex:n}}_applyGroupedLegendSeriesDifferentiation(e){(Array.isArray(e?.legend?.allItems)?e.legend.allItems:[]).forEach((t,n)=>{let r=t&&t.series?t.series:t;if(!this._isGroupedSeriesDifferentiationChart(r,e))return;let{variantIndex:i,patternKind:a}=this._getGroupedSeriesDifferentiationVariant(t,e,n),o=this._getHighchartsColorClassName(t?.legendSymbol??t?.legendItem?.symbol??t?.legendItem?.group,i);this._getLegendSeriesDifferentiationTargets(t).fillTargets.forEach(e=>{this._setSeriesDifferentiationMetadata(e,{role:`legend-fill`,patternKind:a}),this._setSeriesDifferentiationColorClass(e,o)}),this._ensureStyledModeSeriesPattern(e,o,a)})}_clearGroupedLegendSeriesDifferentiation(e){(Array.isArray(e?.legend?.allItems)?e.legend.allItems:[]).forEach(t=>{let n=t&&t.series?t.series:t;if(!this._isGroupedSeriesDifferentiationChart(n,e))return;let r=this._getLegendSeriesDifferentiationTargets(t);r.graphTargets.forEach(e=>{this._clearSeriesDifferentiationMetadata(e)}),r.fillTargets.forEach(e=>{this._clearSeriesDifferentiationMetadata(e),this._clearSeriesDifferentiationColorClass(e)})})}_shouldShowSeriesDifferentiationAction(){return Pd({chart:this._getCurrentHighchartsChart(),getCurrentPrintableView:()=>this._getCurrentPrintableView(),getSeriesDifferentiationGroup:(e,t)=>this._getSeriesDifferentiationGroup(e,t),isHighchartsStyledMode:e=>this._isHighchartsStyledMode(e)})}_getSeriesDifferentiationSnapshotStore(e){let t=this._seriesDifferentiationSnapshots.get(e);return t||(t=new Map,this._seriesDifferentiationSnapshots.set(e,t)),t}_cloneSeriesOptionValue(e){return Array.isArray(e)?e.map(e=>this._cloneSeriesOptionValue(e)):e&&typeof e==`object`?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,this._cloneSeriesOptionValue(t)])):e}_captureSeriesDifferentiationSnapshot(e){let t=this._cloneSeriesOptionValue(e?.options?.marker),n=this._cloneSeriesOptionValue(e?.resetA11yMarkerOptions),r=this._cloneSeriesOptionValue(e?.userOptions?.marker),i=t?.states,a=e?.a11yMarkersForced===!0&&n&&Object.keys(n).length>0||i?.normal?.opacity===0&&n&&Object.keys(n).length>0?n:r;return{marker:a&&Object.keys(a).length>0?a:t&&Object.keys(t).length>0?t:{enabled:!1}}}_isHighchartsStyledMode(e){return Id(e)}_getHighchartsSvgRoot(e){return Ld(e)}_getHighchartsColorClassName(e,t){return Rd(e,t)}_setSeriesDifferentiationMetadata(e,t){zd(e,t)}_clearSeriesDifferentiationMetadata(e){Bd(e)}_setSeriesDifferentiationColorClass(e,t){Vd(e,t)}_clearSeriesDifferentiationColorClass(e){Hd(e)}_getLegendSeriesDifferentiationTargets(e){return Ud(e)}_ensureStyledModeSeriesPattern(e,t,n){Wd(e,t,n)}_applyStyledModeSeriesDifferentiation(e){let t=this._getHighchartsSvgRoot(e);if(!t)return;t.classList.add(`scb-viz-series-differentiation-enabled`);let n=Sd(),r=this._getSeriesDifferentiationSnapshotStore(e);e.series?.forEach((t,i)=>{let a=this._getSeriesDifferentiationGroup(t,e);if(!a)return;let o=String(t?.index??i);r.has(o)||r.set(o,this._captureSeriesDifferentiationSnapshot(t));let s=a===`grouped-fill`&&this._usesGroupedPointDifferentiation(t),c=a===`grouped-fill`?this._getGroupedSeriesDifferentiationVariant(t,e,i):{variantIndex:i,...this._getSeriesDifferentiationVariantByIndex(i)},{dashStyle:l,markerSymbol:u,patternKind:d}=c,f=this._getHighchartsColorClassName(t?.graph??t?.area??t?.group,c.variantIndex),p=this._getLegendSeriesDifferentiationTargets(t);this._setSeriesDifferentiationMetadata(t?.graph,{role:`graph`,dashStyle:l}),a===`area`&&(this._setSeriesDifferentiationMetadata(t?.area,{role:`area`,patternKind:d}),this._setSeriesDifferentiationColorClass(t?.area,f),this._ensureStyledModeSeriesPattern(e,f,d)),a===`fill`&&(t.points?.forEach(e=>{this._setSeriesDifferentiationMetadata(e?.graphic,{role:`fill`,patternKind:d}),this._setSeriesDifferentiationColorClass(e?.graphic,f)}),this._ensureStyledModeSeriesPattern(e,f,d)),a===`grouped-fill`&&(s?t.points?.forEach((t,n)=>{let r=this._getGroupedSeriesDifferentiationVariant(t,e,n),i=this._getHighchartsColorClassName(t?.graphic??t?.legendSymbol??t?.legendItem?.symbol??t?.legendItem?.group,r.variantIndex);this._setSeriesDifferentiationMetadata(t?.graphic,{role:`fill`,patternKind:r.patternKind}),this._setSeriesDifferentiationColorClass(t?.graphic,i),this._ensureStyledModeSeriesPattern(e,i,r.patternKind)}):(t.points?.forEach(e=>{this._setSeriesDifferentiationMetadata(e?.graphic,{role:`fill`,patternKind:d}),this._setSeriesDifferentiationColorClass(e?.graphic,f)}),this._ensureStyledModeSeriesPattern(e,f,d))),a===`point-fill`&&t.points?.forEach((t,r)=>{let i=n[r%n.length],a=this._getHighchartsColorClassName(t?.graphic??t?.legendSymbol??t?.legendItem?.symbol??t?.legendItem?.group,r),o=this._getLegendSeriesDifferentiationTargets(t);this._setSeriesDifferentiationMetadata(t?.graphic,{role:`fill`,patternKind:i}),this._setSeriesDifferentiationColorClass(t?.graphic,a),this._ensureStyledModeSeriesPattern(e,a,i),o.fillTargets.forEach(e=>{this._setSeriesDifferentiationMetadata(e,{role:`legend-fill`,patternKind:i}),this._setSeriesDifferentiationColorClass(e,a)})}),(a===`line`||a===`area`)&&p.graphTargets.forEach(e=>{this._setSeriesDifferentiationMetadata(e,{role:`legend-symbol`,dashStyle:l})}),(a===`area`||a===`fill`||a===`grouped-fill`&&!s)&&p.fillTargets.forEach(e=>{this._setSeriesDifferentiationMetadata(e,{role:`legend-fill`,patternKind:d}),this._setSeriesDifferentiationColorClass(e,f)}),(a===`line`||a===`area`)&&t.update({marker:{enabled:!0,symbol:u}},!1)}),this._applyGroupedLegendSeriesDifferentiation(e),e.redraw(!1)}_restoreStyledModeSeriesDifferentiation(e){this._getHighchartsSvgRoot(e)?.classList.remove(`scb-viz-series-differentiation-enabled`);let t=this._getSeriesDifferentiationSnapshotStore(e);e.series?.forEach((n,r)=>{let i=this._getSeriesDifferentiationGroup(n,e);if(!i)return;let a=this._getLegendSeriesDifferentiationTargets(n);if(this._clearSeriesDifferentiationMetadata(n?.graph),this._clearSeriesDifferentiationMetadata(n?.area),this._clearSeriesDifferentiationColorClass(n?.area),n.points?.forEach(e=>{let t=this._getLegendSeriesDifferentiationTargets(e);this._clearSeriesDifferentiationMetadata(e?.graphic),this._clearSeriesDifferentiationColorClass(e?.graphic),t.graphTargets.forEach(e=>{this._clearSeriesDifferentiationMetadata(e)}),t.fillTargets.forEach(e=>{this._clearSeriesDifferentiationMetadata(e),this._clearSeriesDifferentiationColorClass(e)})}),a.graphTargets.forEach(e=>{this._clearSeriesDifferentiationMetadata(e)}),a.fillTargets.forEach(e=>{this._clearSeriesDifferentiationMetadata(e),this._clearSeriesDifferentiationColorClass(e)}),i===`line`||i===`area`){let e=t.get(String(n?.index??r));n.update({marker:this._cloneSeriesOptionValue(e?.marker)},!1)}}),this._clearGroupedLegendSeriesDifferentiation(e),e.redraw(!1),this._seriesDifferentiationSnapshots.delete(e)}#m(e){this._isHighchartsStyledMode(e)&&this._applyStyledModeSeriesDifferentiation(e)}#h(e){this._isHighchartsStyledMode(e)&&this._restoreStyledModeSeriesDifferentiation(e)}#g(){let e=this._getCurrentHighchartsChart();if(e){if(this._seriesDifferentiationEnabled){this.#m(e);return}this.#h(e)}}_canExportRaster(){return this._getExportableVisualElement()!==null}_canExportCsv(){return!!this._getResolvedTableData()?.rows?.length}_buildExportFileName(e){return Qu({lang:this.lang,title:this.title},e)}_getFullscreenTarget(){return this}_getCurrentFullscreenElement(){return ed()}_isFullscreenSupported(){return td(this._getFullscreenTarget())}_syncFullscreenState(){let e=this._getCurrentFullscreenElement()===this._getFullscreenTarget();this._isFullscreen=e,this.toggleAttribute(`data-scb-viz-fullscreen`,e),this.#c(),this.#r()}async _toggleFullscreen(){await nd(this._getFullscreenTarget())}_renderActionsMenu(){let e=this._getCurrentPrintableView(),t=this._canExportRaster(),n=this._canExportCsv(),r=t&&(e===`diagram`||e===`image`),i=n&&e===`table`,a=this._shouldShowSeriesDifferentiationAction();return b`
|
|
13472
|
+
`}connectedCallback(){super.connectedCallback(),document.addEventListener(`pointerdown`,this._onDocumentPointerDown,!0),document.addEventListener(`keydown`,this._onDocumentKeyDown),document.addEventListener(`fullscreenchange`,this._onDocumentFullscreenChange),document.addEventListener(`webkitfullscreenchange`,this._onDocumentFullscreenChange),window.addEventListener(`resize`,this._onWindowResize),window.visualViewport?.addEventListener(`resize`,this._onWindowResize)}firstUpdated(e){this._readTableDataFromSlot(),this.#C(),this.#T(),this.#u(),this._syncChipClass(),this.#e(),this.#r(),this._syncFullscreenState(),this.#c()}updated(e){super.updated(e),(e.has(`selectedChip`)||e.has(`variant`))&&(this._syncChipClass(),this._closeActionsMenu()),e.has(`selectedChip`)&&this._dispatchSelectedChipChanged(),(e.has(`spacing`)||e.has(`spacingTop`)||e.has(`spacingBottom`)||e.has(`spacingLeft`)||e.has(`spacingRight`))&&this.#C(),e.has(`containerMaxWidth`)&&this.#T(),e.has(`variant`)&&this.#e(),(e.has(`contentMaxWidth`)||e.has(`contentHeight`)||e.has(`toggleHeightMode`)||e.has(`variant`))&&this.#u(),(e.has(`selectedChip`)||e.has(`variant`)||e.has(`contentMaxWidth`)||e.has(`contentHeight`)||e.has(`toggleHeightMode`)||e.has(`_isFullscreen`))&&this.#r(),(e.has(`selectedChip`)||e.has(`variant`))&&this._seriesDifferentiationEnabled&&requestAnimationFrame(()=>{this.#g()}),(e.has(`valueFormat`)||e.has(`timeFormat`)||e.has(`yAxisSettings`)||e.has(`selectedChip`)||e.has(`variant`))&&this.#f(),(e.has(`title`)||e.has(`subtitle`)||e.has(`description`)||e.has(`comment`)||e.has(`source`)||e.has(`footnote`)||e.has(`officialStatistics`)||e.has(`selectedChip`)||e.has(`variant`)||e.has(`_isFullscreen`))&&this.#c()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener(`pointerdown`,this._onDocumentPointerDown,!0),document.removeEventListener(`keydown`,this._onDocumentKeyDown),document.removeEventListener(`fullscreenchange`,this._onDocumentFullscreenChange),document.removeEventListener(`webkitfullscreenchange`,this._onDocumentFullscreenChange),window.removeEventListener(`resize`,this._onWindowResize),window.visualViewport?.removeEventListener(`resize`,this._onWindowResize),this.#t(),this.#n(),this.#d(),this.#s()}_refreshTableDataFromSlot(e){this._readTableDataFromSlot(e||void 0),this.requestUpdate()}_onTableSlotChange(e){let t=e.target;t&&(this._refreshTableDataFromSlot(t),requestAnimationFrame(()=>{this._refreshTableDataFromSlot(t)}))}_onDiagramSlotChange(){this.#u(),this.#r(),this.#f(),this._seriesDifferentiationEnabled&&requestAnimationFrame(()=>{this.#g()}),this.requestUpdate()}#e(){if(this.#t(),typeof ResizeObserver>`u`)return;let e=this.shadowRoot?.querySelector(`.diagram-content`);e&&(this._diagramResizeObserver=new ResizeObserver(()=>{this.#r()}),this._diagramResizeObserver.observe(this),this._diagramResizeObserver.observe(e))}#t(){this._diagramResizeObserver?.disconnect(),this._diagramResizeObserver=void 0}#n(){this._diagramReflowFrame&&=(cancelAnimationFrame(this._diagramReflowFrame),0)}#r(){this.variant!==`Standard`||this.selectedChip!==`Diagram`||(this.#n(),this._diagramReflowFrame=requestAnimationFrame(()=>{this._diagramReflowFrame=requestAnimationFrame(()=>{this._diagramReflowFrame=0,this.#o()})}))}#i(e){let t=e?.getAttribute(`data-highcharts-chart`);if(!t)return;let n=Number.parseInt(t,10);return Number.isNaN(n)?void 0:n}#a(e){for(let t of e){let e=this.#i(t);if(e!==void 0)return e;let n=t.querySelector(`[data-highcharts-chart]`),r=this.#i(n);if(r!==void 0)return r}}#o(){if(this.variant!==`Standard`||this.selectedChip!==`Diagram`)return;let e=this.shadowRoot?.querySelector(`slot[name="diagram"]`);if(!e)return;let t=e.assignedElements({flatten:!0});if(t.length===0)return;let n=this.#a(t);if(n===void 0)return;let r=window.Highcharts?.charts?.[n];r&&(r.setSize?.(null,null,!1),r.reflow?.(),this._seriesDifferentiationEnabled&&this.#g())}_normalizeRenderableCell(e){return qd(e)}_readTableDataFromSlot(e){let t=e||this.shadowRoot?.querySelector(`slot[name="table"]`);this._slottedTableData=Jd(t)}_inferTableAlignments(e){return Yd(e,e=>this._parseTableNumericValue(e))}_parseTableNumericValue(e){if(e==null)return null;if(typeof e==`number`)return Number.isFinite(e)?e:null;let t=String(e).replace(/[ \s]+/g,``).trim();if(!t)return null;t.endsWith(`%`)&&(t=t.slice(0,-1));let n=t.lastIndexOf(`,`),r=t.lastIndexOf(`.`);if(n>-1&&r>-1?t=n>r?t.replace(/\./g,``).replace(`,`,`.`):t.replace(/,/g,``):n>-1&&(t=t.replace(`,`,`.`)),!/^-?\d+(?:\.\d+)?$/.test(t))return null;let i=Number(t);return Number.isFinite(i)?i:null}_formatTableCell(e,t,n){let r=this._normalizeRenderableCell(e);if(r.html)return r;let i=r.text;if(!i)return r;if(t===0){let e=this._normalizeTimeFormat(this.timeFormat),t=this._formatCategoryTimeLabel(i,e);return t===null?r:{html:``,text:t}}if(n[t]!==`right`)return r;if(this._shouldPreserveSourceValueFormatting(this.valueFormat)){let e=this._localizeAutomaticNumericText(i);return e===null?r:{html:``,text:e}}let a=this._parseTableNumericValue(i);if(a===null)return r;let o=this._normalizeValueFormat(this.valueFormat),s=this._formatValueForDisplay(a,o,!0);return s===null?r:{html:``,text:s}}#s(){this._fullscreenDiagramSizingFrame&&=(cancelAnimationFrame(this._fullscreenDiagramSizingFrame),0)}#c(){this.#s(),this._fullscreenDiagramSizingFrame=requestAnimationFrame(()=>{this._fullscreenDiagramSizingFrame=requestAnimationFrame(()=>{this._fullscreenDiagramSizingFrame=0,this.#l()})})}_getViewportHeight(){return Math.round(window.visualViewport?.height||window.innerHeight||document.documentElement.clientHeight||0)}_readCssLength(e){let t=Number.parseFloat(e||`0`);return Number.isFinite(t)?t:0}_getElementOuterHeight(e){let t=this.shadowRoot?.querySelector(e);if(!t)return 0;let n=getComputedStyle(t);return t.getBoundingClientRect().height+this._readCssLength(n.marginTop)+this._readCssLength(n.marginBottom)}_getFullscreenDiagramHeight(){if(!this._isFullscreen||this.variant!==`Standard`||this.selectedChip!==`Diagram`)return``;let e=this._getViewportHeight();if(!e)return``;let t=getComputedStyle(this),n=this._readCssLength(t.paddingTop)+this._readCssLength(t.paddingBottom)+this._getElementOuterHeight(`.header`)+this._getElementOuterHeight(`.actions-row`)+this._getElementOuterHeight(`.footer`)+16,r=Math.floor(e-n);return!Number.isFinite(r)||r<=0?``:`${Math.max(320,r)}px`}#l(){let e=this._getFullscreenDiagramHeight();this._fullscreenDiagramHeight!==e&&(this._fullscreenDiagramHeight=e,this.#u(),this.#r())}_getResolvedContentMaxWidth(){return this.contentMaxWidth?.trim()||``}_getResolvedDiagramHeight(){return this._fullscreenDiagramHeight||this.contentHeight?.trim()||``}_getResolvedDiagramScrollerWidth(){return this._getResolvedContentMaxWidth()}_getResolvedToggleHeightMode(){return this.toggleHeightMode===`auto`?`auto`:`stable`}_getResolvedStandardContentHeight(){return this._getResolvedDiagramHeight()||`600px`}#u(){let e=this.variant===`Standard`?this._getResolvedDiagramHeight():``,t=this.variant===`Standard`&&this._getResolvedToggleHeightMode()===`stable`?this._getResolvedStandardContentHeight():``;this.variant===`Standard`?this.style.setProperty(`--scb-viz-diagram-min-height`,e||`600px`):this.style.removeProperty(`--scb-viz-diagram-min-height`),e?(this.style.setProperty(`--scb-viz-diagram-height`,e),this.style.setProperty(`--scb-viz-diagram-overflow`,`hidden`)):(this.style.removeProperty(`--scb-viz-diagram-height`),this.style.removeProperty(`--scb-viz-diagram-overflow`)),t?this.style.setProperty(`--scb-viz-standard-content-height`,t):this.style.removeProperty(`--scb-viz-standard-content-height`)}_getResolvedTableData(){return this.tableData??this._slottedTableData}_getResolvedTableView(e){return Xd(e,{inferAlignments:e=>this._inferTableAlignments(e),normalizeCell:e=>this._normalizeRenderableCell(e),formatCell:(e,t,n)=>this._formatTableCell(e,t,n)})}_getDiagramAssignedElements(){let e=this.shadowRoot?.querySelector(`slot[name="diagram"]`);return e?e.assignedElements({flatten:!0}):[]}_findExportableVisualElement(e){for(let t of e){if(t instanceof SVGSVGElement||t instanceof HTMLCanvasElement||t instanceof HTMLImageElement)return t;let e=t.querySelector(`svg, canvas, img`);if(e instanceof SVGSVGElement||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement)return e}return null}_getExportableVisualElement(){if(this.variant===`Table`)return null;if(this.variant===`Image`){let e=this.shadowRoot?.querySelector(`.image-content img`);return e instanceof HTMLImageElement?e:null}return this._findExportableVisualElement(this._getDiagramAssignedElements())}#d(){this._chartConfigSyncFrame&&=(cancelAnimationFrame(this._chartConfigSyncFrame),0)}#f(){this.#d(),this._chartConfigSyncFrame=requestAnimationFrame(()=>{this._chartConfigSyncFrame=requestAnimationFrame(()=>{this._chartConfigSyncFrame=0,this.#p()})})}_getDefaultValueFormat(){return{type:`number`,scale:`auto`,decimals:0,decimalSeparator:this.lang===`en`?`.`:`,`}}_normalizeValueFormat(e){let t=this._getDefaultValueFormat(),n=e&&typeof e==`object`?e:{};return{type:[`number`,`currency`,`percent`].includes(String(n.type))?String(n.type):t.type,scale:[`auto`,`raw`,`thousands`,`millions`,`billions`].includes(String(n.scale))?String(n.scale):t.scale,decimals:Number.isFinite(Number(n.decimals))?Math.max(0,Math.min(20,Number(n.decimals))):t.decimals,decimalSeparator:String(n.decimalSeparator)===`.`?`.`:String(n.decimalSeparator)===`,`?`,`:t.decimalSeparator}}_shouldPreserveSourceValueFormatting(e){let t=this._normalizeValueFormat(e);return t.type===`number`&&t.scale===`auto`}_normalizeTimeFormat(e){let t={mode:`raw`,display:`raw`},n=e&&typeof e==`object`?e:{},r=[`raw`,`year`,`monthCode`,`quarterCode`,`weekCode`,`tertialCode`],i=typeof n.mode==`string`?n.mode:t.mode,a=typeof n.display==`string`?n.display:t.display;r.includes(i)||(i=t.mode);let o={raw:[`raw`],year:[`raw`,`year`],monthCode:[`raw`,`iso-month`,`short-month`,`long-month`],quarterCode:[`raw`,`quarter-compact`,`quarter-short`,`quarter-long`],weekCode:[`raw`,`week-compact`,`week-long`],tertialCode:[`raw`,`tertial-compact`,`tertial-short`,`tertial-long`]};return o[i].includes(a)||(a=o[i][0]),i===`raw`&&(a=`raw`),{mode:i,display:a}}_normalizeYAxisSettings(e){let t=e&&typeof e==`object`?e:{},n=Number.isFinite(Number(t.referenceLineValue))?Number(t.referenceLineValue):null;return{startAtZero:!!t.startAtZero,referenceLineEnabled:!!t.referenceLineEnabled&&Number.isFinite(n),referenceLineValue:n,referenceLineLabel:typeof t.referenceLineLabel==`string`?t.referenceLineLabel:``}}_getShortMonthNames(){return[`jan`,`feb`,`mar`,`apr`,`maj`,`jun`,`jul`,`aug`,`sep`,`okt`,`nov`,`dec`]}_getLongMonthNames(){return[`januari`,`februari`,`mars`,`april`,`maj`,`juni`,`juli`,`augusti`,`september`,`oktober`,`november`,`december`]}_formatCategoryTimeLabel(e,t){if(!e||t.mode===`raw`||t.display===`raw`)return null;if(t.mode===`year`){let t=/^\s*(\d{4})\s*$/.exec(e);return t?t[1]:null}if(t.mode===`monthCode`){let n=/^\s*(\d{4})M(0?[1-9]|1[0-2])\s*$/i.exec(e);if(!n)return null;let r=Number(n[2])-1,i=n[1],a=String(r+1).padStart(2,`0`);return t.display===`iso-month`?`${i}-${a}`:t.display===`short-month`?`${this._getShortMonthNames()[r]} ${i}`:t.display===`long-month`?`${this._getLongMonthNames()[r]} ${i}`:e}if(t.mode===`quarterCode`){let n=/^\s*(\d{4})(?:K(V)?|Q)(0?[1-4])\s*$/i.exec(e);if(!n)return null;let r=Number(n[3]),i=n[1];return t.display===`quarter-compact`?`${i} K${r}`:t.display===`quarter-short`?`kv ${r} ${i}`:t.display===`quarter-long`?`${[`första`,`andra`,`tredje`,`fjärde`][r-1]} kvartalet ${i}`:e}if(t.mode===`weekCode`){let n=/^\s*(\d{4})(?:V|W)(0?[1-9]|[1-4][0-9]|5[0-3])\s*$/i.exec(e);if(!n)return null;let r=Number(n[2]),i=n[1];return t.display===`week-compact`?`${i} v. ${r}`:t.display===`week-long`?`vecka ${r} ${i}`:e}if(t.mode===`tertialCode`){let n=/^\s*(\d{4})T(0?[1-3])\s*$/i.exec(e);if(!n)return null;let r=Number(n[2]),i=n[1];return t.display===`tertial-compact`?`${i} T${r}`:t.display===`tertial-short`?`tertial ${r} ${i}`:t.display===`tertial-long`?`${[`första`,`andra`,`tredje`][r-1]} tertialet ${i}`:e}return null}_localizeAutomaticNumericText(e){let t=this._normalizeValueFormat(this.valueFormat),n=String(e??``).trim();if(!n||n===`..`||n===`...`)return null;let r=n.replace(/[ \s]/g,``);if(!/^-?\d+(?:[.,]\d+)?$/.test(r))return null;let i=t.decimalSeparator===`.`?`.`:`,`;return i===`.`&&r.indexOf(`,`)!==-1?r.replace(`,`,`.`):i===`,`&&r.indexOf(`.`)!==-1?r.replace(`.`,`,`):r}_inferAutomaticValueDecimals(e){if(!Number.isFinite(e))return 0;let t=String(e);/e/i.test(t)&&(t=e.toFixed(6).replace(/0+$/,``).replace(/\.$/,``));let n=t.replace(/^-/,``).split(`.`);return n.length>1?Math.min(n[1].length,6):0}_formatAutomaticValueForDisplay(e,t){if(!Number.isFinite(e))return null;let n=this._localizeAutomaticNumericText(t);if(n!==null)return n;let r=this._normalizeValueFormat(this.valueFormat),i=this._inferAutomaticValueDecimals(e);return this._formatLocalizedNumber(e,i,r.decimalSeparator)}_formatLocalizedNumber(e,t,n){let r=new Intl.NumberFormat(this.lang===`en`?`en-GB`:`sv-SE`,{minimumFractionDigits:t,maximumFractionDigits:t}),i=n===`.`||n===`,`?n:this.lang===`en`?`.`:`,`;return r.formatToParts(e).map(e=>e.type===`decimal`?i:e.value).join(``)}_formatValueForDisplay(e,t,n){if(!Number.isFinite(e))return null;let r={raw:1,thousands:1e3,millions:1e6,billions:1e9},i={raw:``,thousands:this.lang===`en`?`k`:`t`,millions:this.lang===`en`?`M`:`mn`,billions:this.lang===`en`?`B`:`md`},a=t.scale;if(a===`auto`){let t=Math.abs(e);a=t>=1e9?`billions`:t>=1e6?`millions`:t>=1e3?`thousands`:`raw`}let o=e/(r[a]||1),s=this._formatLocalizedNumber(o,t.decimals,t.decimalSeparator);t.type===`percent`?s=`${s} %`:t.type===`currency`&&(s=n?`${s} kr`:s);let c=i[a]||``;return c&&(s=`${s} ${c}`),s}_isCategoryAxis(e){return e?.categories?.length>0||e?.options?.type===`category`}_isTooltipNumericLikeText(e){if(typeof e!=`string`)return!1;let t=e.trim();return t?/^-?\d+(?:[.,]\d+)?$/.test(t):!1}_getTooltipPointRowIndex(e){let t=e?.point||e;return Number.isFinite(t?.x)?Number(t.x):Number.isFinite(e?.x)?Number(e.x):Number.isFinite(t?.index)?Number(t.index):Number.isFinite(e?.index)?Number(e.index):null}_getTooltipTableCategoryValue(e){let t=this._getResolvedTableData();if(!t?.rows?.length)return``;let n=this._getTooltipPointRowIndex(e);if(n===null||n<0||n>=t.rows.length)return``;let r=t.rows[n];return!Array.isArray(r)||r.length===0?``:this._normalizeRenderableCell(r[0]).text}_getTooltipSeriesDataCategoryValue(e){let t=e?.point||e,n=t?.series||e?.series,r=this._getTooltipPointRowIndex(e);if(!n||r===null)return``;let i=[n?.options?.data,n?.userOptions?.data];for(let e of i){if(!Array.isArray(e)||r<0||r>=e.length)continue;let t=e[r];if(!t||typeof t!=`object`)continue;let n=t.category!==void 0&&t.category!==null?String(t.category):typeof t.name==`string`?t.name:``;if(n&&!this._isTooltipNumericLikeText(n))return n}let a=t?.options?.category!==void 0&&t.options.category!==null?String(t.options.category):``;if(a&&!this._isTooltipNumericLikeText(a))return a;let o=typeof t?.name==`string`?t.name.trim():``;return o&&!this._isTooltipNumericLikeText(o)?o:``}_getTooltipXAxisLabel(e,t){let n=e?.point||e,r=n?.series?.xAxis||e?.series?.xAxis,i=this._getTooltipPointRowIndex(e),a=[];if(r&&Array.isArray(r.categories)&&i!==null){let e=r.categories[i];e!=null&&a.push(String(e))}typeof n?.category==`string`&&n.category.trim()&&a.push(n.category),typeof e?.key==`string`&&e.key.trim()&&a.push(e.key),typeof e?.x==`string`&&e.x.trim()&&a.push(e.x);let o=this._getTooltipSeriesDataCategoryValue(e);o&&a.push(o);let s=this._getTooltipTableCategoryValue(e);s&&a.push(s);for(let e of a){let n=String(e).trim();if(!(!n||this._isTooltipNumericLikeText(n)))return this._formatCategoryTimeLabel(n,t)??n}let c=a.find(e=>String(e).trim());if(!c)return``;let l=String(c).trim();return this._formatCategoryTimeLabel(l,t)??l}_getTooltipPointLabel(e){let t=e?.point||e,n=t?.series||e?.series,r=String(t?.series?.type||n?.type||t?.series?.options?.type||n?.options?.type||t?.series?.chart?.options?.chart?.type||``).trim().toLowerCase();return[`pie`,`variablepie`].includes(r)?t?.name||n?.name||``:n?.name||t?.name||``}_applyTimeFormatToLiveChart(e){let t=this._normalizeTimeFormat(this.timeFormat);if(t.mode===`raw`||t.display===`raw`)return;let n=this._formatCategoryTimeLabel.bind(this);[...e?.xAxis||[],...e?.yAxis||[]].forEach(e=>{if(!this._isCategoryAxis(e))return;let r=e.options?.labels&&typeof e.options.labels==`object`?{...e.options.labels}:{},i=typeof r.formatter==`function`?r.formatter:null;r.formatter=function(){let e=``;if(this?.axis&&Array.isArray(this.axis.categories)&&typeof this.pos==`number`){let t=this.axis.categories[this.pos];t!=null&&(e=String(t))}else this?.value!==void 0&&this.value!==null&&(e=String(this.value));let r=n(e,t);return r===null?i?i.call(this):e:r},delete r.format,e.update({labels:r},!1)})}_applyValueFormatToLiveChart(e){let t=this._normalizeValueFormat(this.valueFormat),n=this._normalizeTimeFormat(this.timeFormat),r=this._formatValueForDisplay.bind(this),i=this._formatAutomaticValueForDisplay.bind(this),a=this._getTooltipXAxisLabel.bind(this),o=this._getTooltipPointLabel.bind(this);if(this._shouldPreserveSourceValueFormatting(this.valueFormat)){let r=e?.options?.tooltip&&typeof e.options.tooltip==`object`?{...e.options.tooltip}:{},s=e?.options?.plotOptions&&typeof e.options.plotOptions==`object`?{...e.options.plotOptions}:{},c=s.series&&typeof s.series==`object`?{...s.series}:{},l=c.dataLabels&&typeof c.dataLabels==`object`?{...c.dataLabels}:{},u=e?.options?.lang&&typeof e.options.lang==`object`?{...e.options.lang}:{};delete l.format,delete l.formatter,u.decimalPoint=t.decimalSeparator===`.`?`.`:`,`,u.thousandsSep=` `,r.valueDecimals=void 0,r.formatter=function(){let e=Array.isArray(this.points)&&this.points.length?this.points:[this.point||this],t=a(this,n),r=[];return e.forEach(e=>{let t=e?.point||e,n=Number.isFinite(e?.y)?e.y:t?.y,a=o(e),s=i(n,t?.options&&t.options.y!==void 0&&t.options.y!==null?String(t.options.y):t&&t.y!==void 0&&t.y!==null?String(t.y):``);!Number.isFinite(n)||s==null||r.push(`${a?`${String(a)}: `:``}<b>${String(s)}</b><br/>`)}),`${t?`<span>${String(t)}</span><br/>`:``}${r.join(``)}`}.bind(this),e.update({lang:u,tooltip:r,plotOptions:{...s,series:{...c,dataLabels:l}}},!1,!1,!1),(e?.yAxis||[]).forEach(e=>{let t=e.options?.labels&&typeof e.options.labels==`object`?{...e.options.labels}:{};delete t.format,delete t.formatter,e.update({labels:t},!1)});return}e.update({tooltip:{...e.options?.tooltip||{},valueDecimals:t.decimals,formatter:function(){let e=Array.isArray(this.points)&&this.points.length?this.points:[this.point||this],i=a(this,n),s=[];return e.forEach(e=>{let n=e?.point||e,i=r(Number.isFinite(e?.y)?e.y:n?.y,t,!0);if(i===null)return;let a=o(e);s.push(`${a?`${String(a)}: `:``}<b>${i}</b><br/>`)}),`${i?`<span>${String(i)}</span><br/>`:``}${s.join(``)}`}},plotOptions:{...e.options?.plotOptions||{},series:{...e.options?.plotOptions?.series||{},dataLabels:{...e.options?.plotOptions?.series?.dataLabels||{},formatter:function(){return r(Number.isFinite(this?.y)?this.y:this?.point?.y,t,t.type===`percent`)??null}}}}},!1,!1,!1),(e?.yAxis||[]).forEach(e=>{let n=e.options?.labels&&typeof e.options.labels==`object`?{...e.options.labels}:{},i=typeof n.formatter==`function`?n.formatter:null,a=!(e.options?.title&&typeof e.options.title.text==`string`&&e.options.title.text.trim());n.formatter=function(){let e=r(this?.value,t,a);return e===null?i?i.call(this):this?.value:e},(t.type===`percent`||t.scale!==`auto`)&&delete n.format,e.update({labels:n},!1)})}_applyYAxisSettingsToLiveChart(e){let t=this._normalizeYAxisSettings(this.yAxisSettings),n=e?.yAxis||[];n.length&&n.forEach((e,n)=>{let r=e.options&&typeof e.options==`object`?e.options:{},i={},a=r.min!==void 0&&r.min!==null&&r.min!==``;n===0&&t.startAtZero&&!a&&(i.min=0);let o=Array.isArray(r.plotLines)?r.plotLines.filter(e=>e?.id!==`scb-viz-reference-line`):[];n===0&&t.referenceLineEnabled&&Number.isFinite(t.referenceLineValue)&&o.push({id:`scb-viz-reference-line`,className:`scb-axis-plotline scb-viz-reference-line`,value:t.referenceLineValue}),o.length?i.plotLines=o:Array.isArray(r.plotLines)&&(i.plotLines=[]),e.update(i,!1)})}#p(){let e=this._getCurrentHighchartsChart();if(!e)return;let t=!1;this.timeFormat!==void 0&&(this._applyTimeFormatToLiveChart(e),t=!0),this.valueFormat!==void 0&&(this._applyValueFormatToLiveChart(e),t=!0),this.yAxisSettings!==void 0&&(this._applyYAxisSettingsToLiveChart(e),t=!0),t&&e.redraw(!1)}_getCurrentHighchartsChart(){if(this._getCurrentPrintableView()!==`diagram`)return;let e=this.#a(this._getDiagramAssignedElements());if(e!==void 0)return window.Highcharts?.charts?.[e]}_getSeriesDifferentiationGroup(e,t){let n=String(e?.type||e?.options?.type||t?.options?.chart?.type||``).trim().toLowerCase();return[`line`,`spline`,`scatter`].includes(n)?`line`:[`area`,`areaspline`].includes(n)?`area`:[`column`,`bar`].includes(n)?this._isGroupedSeriesDifferentiationChart(e,t)?`grouped-fill`:`fill`:[`pie`,`variablepie`].includes(n)?`point-fill`:null}_getSeriesDifferentiationVariantByIndex(e){return Od(e)}_isGroupedSeriesDifferentiationChart(e,t){return kd(e,t)}_usesGroupedPointDifferentiation(e){return Ad(e)}_getGroupedSeriesDifferentiationVariant(e,t,n){let r=Fd(e,t,n);return{...r,variantIndex:typeof r.variantIndex==`number`?r.variantIndex:n}}_applyGroupedLegendSeriesDifferentiation(e){(Array.isArray(e?.legend?.allItems)?e.legend.allItems:[]).forEach((t,n)=>{let r=t&&t.series?t.series:t;if(!this._isGroupedSeriesDifferentiationChart(r,e))return;let{variantIndex:i,patternKind:a}=this._getGroupedSeriesDifferentiationVariant(t,e,n),o=this._getHighchartsColorClassName(t?.legendSymbol??t?.legendItem?.symbol??t?.legendItem?.group,i);this._getLegendSeriesDifferentiationTargets(t).fillTargets.forEach(e=>{this._setSeriesDifferentiationMetadata(e,{role:`legend-fill`,patternKind:a}),this._setSeriesDifferentiationColorClass(e,o)}),this._ensureStyledModeSeriesPattern(e,o,a)})}_clearGroupedLegendSeriesDifferentiation(e){(Array.isArray(e?.legend?.allItems)?e.legend.allItems:[]).forEach(t=>{let n=t&&t.series?t.series:t;if(!this._isGroupedSeriesDifferentiationChart(n,e))return;let r=this._getLegendSeriesDifferentiationTargets(t);r.graphTargets.forEach(e=>{this._clearSeriesDifferentiationMetadata(e)}),r.fillTargets.forEach(e=>{this._clearSeriesDifferentiationMetadata(e),this._clearSeriesDifferentiationColorClass(e)})})}_shouldShowSeriesDifferentiationAction(){return Id({chart:this._getCurrentHighchartsChart(),getCurrentPrintableView:()=>this._getCurrentPrintableView(),getSeriesDifferentiationGroup:(e,t)=>this._getSeriesDifferentiationGroup(e,t),isHighchartsStyledMode:e=>this._isHighchartsStyledMode(e)})}_getSeriesDifferentiationSnapshotStore(e){let t=this._seriesDifferentiationSnapshots.get(e);return t||(t=new Map,this._seriesDifferentiationSnapshots.set(e,t)),t}_cloneSeriesOptionValue(e){return Array.isArray(e)?e.map(e=>this._cloneSeriesOptionValue(e)):e&&typeof e==`object`?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,this._cloneSeriesOptionValue(t)])):e}_captureSeriesDifferentiationSnapshot(e){let t=this._cloneSeriesOptionValue(e?.options?.marker),n=this._cloneSeriesOptionValue(e?.resetA11yMarkerOptions),r=this._cloneSeriesOptionValue(e?.userOptions?.marker),i=t?.states,a=e?.a11yMarkersForced===!0&&n&&Object.keys(n).length>0||i?.normal?.opacity===0&&n&&Object.keys(n).length>0?n:r;return{marker:a&&Object.keys(a).length>0?a:t&&Object.keys(t).length>0?t:{enabled:!1}}}_isHighchartsStyledMode(e){return Rd(e)}_getHighchartsSvgRoot(e){return zd(e)}_getHighchartsColorClassName(e,t){return Bd(e,t)}_setSeriesDifferentiationMetadata(e,t){Vd(e,t)}_clearSeriesDifferentiationMetadata(e){Hd(e)}_setSeriesDifferentiationColorClass(e,t){Ud(e,t)}_clearSeriesDifferentiationColorClass(e){Wd(e)}_getLegendSeriesDifferentiationTargets(e){return Gd(e)}_ensureStyledModeSeriesPattern(e,t,n){Kd(e,t,n)}_applyStyledModeSeriesDifferentiation(e){let t=this._getHighchartsSvgRoot(e);if(!t)return;t.classList.add(`scb-viz-series-differentiation-enabled`);let n=wd(),r=this._getSeriesDifferentiationSnapshotStore(e);e.series?.forEach((t,i)=>{let a=this._getSeriesDifferentiationGroup(t,e);if(!a)return;let o=String(t?.index??i);r.has(o)||r.set(o,this._captureSeriesDifferentiationSnapshot(t));let s=a===`grouped-fill`&&this._usesGroupedPointDifferentiation(t),c=a===`grouped-fill`?this._getGroupedSeriesDifferentiationVariant(t,e,i):{variantIndex:i,...this._getSeriesDifferentiationVariantByIndex(i)},{dashStyle:l,markerSymbol:u,patternKind:d}=c,f=this._getHighchartsColorClassName(t?.graph??t?.area??t?.group,c.variantIndex),p=this._getLegendSeriesDifferentiationTargets(t);this._setSeriesDifferentiationMetadata(t?.graph,{role:`graph`,dashStyle:l}),a===`area`&&(this._setSeriesDifferentiationMetadata(t?.area,{role:`area`,patternKind:d}),this._setSeriesDifferentiationColorClass(t?.area,f),this._ensureStyledModeSeriesPattern(e,f,d)),a===`fill`&&(t.points?.forEach(e=>{this._setSeriesDifferentiationMetadata(e?.graphic,{role:`fill`,patternKind:d}),this._setSeriesDifferentiationColorClass(e?.graphic,f)}),this._ensureStyledModeSeriesPattern(e,f,d)),a===`grouped-fill`&&(s?t.points?.forEach((t,n)=>{let r=this._getGroupedSeriesDifferentiationVariant(t,e,n),i=this._getHighchartsColorClassName(t?.graphic??t?.legendSymbol??t?.legendItem?.symbol??t?.legendItem?.group,r.variantIndex);this._setSeriesDifferentiationMetadata(t?.graphic,{role:`fill`,patternKind:r.patternKind}),this._setSeriesDifferentiationColorClass(t?.graphic,i),this._ensureStyledModeSeriesPattern(e,i,r.patternKind)}):(t.points?.forEach(e=>{this._setSeriesDifferentiationMetadata(e?.graphic,{role:`fill`,patternKind:d}),this._setSeriesDifferentiationColorClass(e?.graphic,f)}),this._ensureStyledModeSeriesPattern(e,f,d))),a===`point-fill`&&t.points?.forEach((t,r)=>{let i=n[r%n.length],a=this._getHighchartsColorClassName(t?.graphic??t?.legendSymbol??t?.legendItem?.symbol??t?.legendItem?.group,r),o=this._getLegendSeriesDifferentiationTargets(t);this._setSeriesDifferentiationMetadata(t?.graphic,{role:`fill`,patternKind:i}),this._setSeriesDifferentiationColorClass(t?.graphic,a),this._ensureStyledModeSeriesPattern(e,a,i),o.fillTargets.forEach(e=>{this._setSeriesDifferentiationMetadata(e,{role:`legend-fill`,patternKind:i}),this._setSeriesDifferentiationColorClass(e,a)})}),(a===`line`||a===`area`)&&p.graphTargets.forEach(e=>{this._setSeriesDifferentiationMetadata(e,{role:`legend-symbol`,dashStyle:l})}),(a===`area`||a===`fill`||a===`grouped-fill`&&!s)&&p.fillTargets.forEach(e=>{this._setSeriesDifferentiationMetadata(e,{role:`legend-fill`,patternKind:d}),this._setSeriesDifferentiationColorClass(e,f)}),(a===`line`||a===`area`)&&t.update({marker:{enabled:!0,symbol:u}},!1)}),this._applyGroupedLegendSeriesDifferentiation(e),e.redraw(!1)}_restoreStyledModeSeriesDifferentiation(e){this._getHighchartsSvgRoot(e)?.classList.remove(`scb-viz-series-differentiation-enabled`);let t=this._getSeriesDifferentiationSnapshotStore(e);e.series?.forEach((n,r)=>{let i=this._getSeriesDifferentiationGroup(n,e);if(!i)return;let a=this._getLegendSeriesDifferentiationTargets(n);if(this._clearSeriesDifferentiationMetadata(n?.graph),this._clearSeriesDifferentiationMetadata(n?.area),this._clearSeriesDifferentiationColorClass(n?.area),n.points?.forEach(e=>{let t=this._getLegendSeriesDifferentiationTargets(e);this._clearSeriesDifferentiationMetadata(e?.graphic),this._clearSeriesDifferentiationColorClass(e?.graphic),t.graphTargets.forEach(e=>{this._clearSeriesDifferentiationMetadata(e)}),t.fillTargets.forEach(e=>{this._clearSeriesDifferentiationMetadata(e),this._clearSeriesDifferentiationColorClass(e)})}),a.graphTargets.forEach(e=>{this._clearSeriesDifferentiationMetadata(e)}),a.fillTargets.forEach(e=>{this._clearSeriesDifferentiationMetadata(e),this._clearSeriesDifferentiationColorClass(e)}),i===`line`||i===`area`){let e=t.get(String(n?.index??r));n.update({marker:this._cloneSeriesOptionValue(e?.marker)},!1)}}),this._clearGroupedLegendSeriesDifferentiation(e),e.redraw(!1),this._seriesDifferentiationSnapshots.delete(e)}#m(e){this._isHighchartsStyledMode(e)&&this._applyStyledModeSeriesDifferentiation(e)}#h(e){this._isHighchartsStyledMode(e)&&this._restoreStyledModeSeriesDifferentiation(e)}#g(){let e=this._getCurrentHighchartsChart();if(e){if(this._seriesDifferentiationEnabled){this.#m(e);return}this.#h(e)}}_canExportRaster(){return this._getExportableVisualElement()!==null}_canExportCsv(){return!!this._getResolvedTableData()?.rows?.length}_buildExportFileName(e){return ed({lang:this.lang,title:this.title},e)}_getFullscreenTarget(){return this}_getCurrentFullscreenElement(){return nd()}_isFullscreenSupported(){return rd(this._getFullscreenTarget())}_syncFullscreenState(){let e=this._getCurrentFullscreenElement()===this._getFullscreenTarget();this._isFullscreen=e,this.toggleAttribute(`data-scb-viz-fullscreen`,e),this.#c(),this.#r()}async _toggleFullscreen(){await id(this._getFullscreenTarget())}_renderActionsMenu(){let e=this._getCurrentPrintableView(),t=this._canExportRaster(),n=this._canExportCsv(),r=t&&(e===`diagram`||e===`image`),i=n&&e===`table`,a=this._shouldShowSeriesDifferentiationAction();return b`
|
|
13473
13473
|
<div class="actions-menu">
|
|
13474
13474
|
<scb-icon-button
|
|
13475
13475
|
icon="more_vert"
|
|
@@ -13642,7 +13642,7 @@
|
|
|
13642
13642
|
aria-label="${this.officialStatisticsAlt}"
|
|
13643
13643
|
>
|
|
13644
13644
|
<span class="sos-logotype-small" aria-hidden="true">
|
|
13645
|
-
${
|
|
13645
|
+
${$d(ef)}
|
|
13646
13646
|
</span>
|
|
13647
13647
|
</a>
|
|
13648
13648
|
`:``}
|
|
@@ -13764,4 +13764,4 @@
|
|
|
13764
13764
|
></slot>
|
|
13765
13765
|
<slot></slot>
|
|
13766
13766
|
</div>
|
|
13767
|
-
`}}}_syncChipClass(){let e=this.variant===`Standard`;this.classList.toggle(`chip-diagram`,e&&this.selectedChip===`Diagram`),this.classList.toggle(`chip-table`,e&&this.selectedChip===`Table`)}_dispatchSelectedChipChanged(){let e={selectedChip:this.selectedChip};this.dispatchEvent(new CustomEvent(`selected-chip-changed`,{detail:e,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`selectedchipchanged`,{detail:e,bubbles:!0,composed:!0}))}_onSegmentedChange(e){let t=e.detail?.value;this.selectedChip===t?this.selectedChip=null:this.selectedChip=t}_toggleActionsMenu(e){e.stopPropagation(),this._actionsMenuOpen=!this._actionsMenuOpen,this._actionsMenuOpen&&requestAnimationFrame(()=>{this._focusFirstMenuItem()})}_closeActionsMenu(){this._actionsMenuOpen=!1}_focusMenuButton(){(this.shadowRoot?.querySelector(`.actions-menu scb-icon-button`))?.focus()}_focusFirstMenuItem(){(this.shadowRoot?.querySelector(`.actions-menu-item`))?.focus()}_getExportSurfaceTarget(){return this.shadowRoot?.querySelector(`.viz-container`)??this}async#_(e){let t=this._getExportableVisualElement();if(!t)return;let n=await
|
|
13767
|
+
`}}}_syncChipClass(){let e=this.variant===`Standard`;this.classList.toggle(`chip-diagram`,e&&this.selectedChip===`Diagram`),this.classList.toggle(`chip-table`,e&&this.selectedChip===`Table`)}_dispatchSelectedChipChanged(){let e={selectedChip:this.selectedChip};this.dispatchEvent(new CustomEvent(`selected-chip-changed`,{detail:e,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`selectedchipchanged`,{detail:e,bubbles:!0,composed:!0}))}_onSegmentedChange(e){let t=e.detail?.value;this.selectedChip===t?this.selectedChip=null:this.selectedChip=t}_toggleActionsMenu(e){e.stopPropagation(),this._actionsMenuOpen=!this._actionsMenuOpen,this._actionsMenuOpen&&requestAnimationFrame(()=>{this._focusFirstMenuItem()})}_closeActionsMenu(){this._actionsMenuOpen=!1}_focusMenuButton(){(this.shadowRoot?.querySelector(`.actions-menu scb-icon-button`))?.focus()}_focusFirstMenuItem(){(this.shadowRoot?.querySelector(`.actions-menu-item`))?.focus()}_getExportSurfaceTarget(){return this.shadowRoot?.querySelector(`.viz-container`)??this}async#_(e){let t=this._getExportableVisualElement();if(!t)return;let n=await cd(t,this._getExportSurfaceTarget(),e);n&&ud(n,this._buildExportFileName(e===`jpeg`?`jpg`:`png`))}_getCurrentPrintableView(){return this.variant===`Table`?`table`:this.variant===`Image`?`image`:this.selectedChip===`Table`?`table`:`diagram`}#v(e){return _d(this._getResolvedTableView(e),e=>this._escapeHtml(e))}#y(){return vd({comment:this.comment,commentLabel:this.commentLabel,description:this.description,descriptionLabel:this.descriptionLabel,escapeHtml:e=>this._escapeHtml(e),footnote:this.footnote,footnoteLabel:this.footnoteLabel,moreAboutStatsLabel:this.moreAboutStatsLabel,officialStatistics:this.officialStatistics,renderRichTextHtml:e=>this._renderRichTextHtml(e),sosLogotypeSvg:ef,source:this.source,sourceLabel:this.sourceLabel})}#b(e){return yd({contentHtml:e,escapeHtml:e=>this._escapeHtml(e),footerHtml:this.#y(),lang:this.lang,subtitle:this.subtitle,title:this.title})}async#x(){await od(this,async()=>{let e=this._getCurrentPrintableView(),t=``;if(e===`table`){let e=this._getResolvedTableData();if(!e?.rows?.length)return;t=this.#v(e)}else if(e===`image`){let e=this.shadowRoot?.querySelector(`.image-content img`),n=e?.currentSrc||e?.src||this.imageHref;if(!n)return;t=`<img class="viz-image" src="${this._escapeHtml(n)}" alt="${this._escapeHtml(this._getImageAltText())}">`}else{let e=this._getExportableVisualElement();if(!e)return;let n=await ld(e,this._getExportSurfaceTarget(),`png`);if(!n)return;t=`<img class="viz-chart-image" src="${n}" alt="${this._escapeHtml(this._getImageAltText())}">`}await ad(this.#b(t))})}#S(){let e=this._getResolvedTableData();e?.rows?.length&&ud(sd(Zd(e,e=>this._normalizeRenderableCell(e)),this.lang),this._buildExportFileName(`csv`))}#C(){let e=this.#w(this.spacing),t=this.#w(this.spacingTop)??e,n=this.#w(this.spacingBottom)??e,r=this.#w(this.spacingLeft),i=this.#w(this.spacingRight);t?this.style.setProperty(`--scb-viz-spacing-block-start`,t):this.style.removeProperty(`--scb-viz-spacing-block-start`),n?this.style.setProperty(`--scb-viz-spacing-block-end`,n):this.style.removeProperty(`--scb-viz-spacing-block-end`),r?this.style.setProperty(`--scb-viz-spacing-inline-start`,r):this.style.removeProperty(`--scb-viz-spacing-inline-start`),i?this.style.setProperty(`--scb-viz-spacing-inline-end`,i):this.style.removeProperty(`--scb-viz-spacing-inline-end`)}#w(e){if(!e)return;let t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}#T(){let e=this.containerMaxWidth?.trim();e?this.style.setProperty(`--scb-viz-container-max-width`,e):this.style.removeProperty(`--scb-viz-container-max-width`)}};P([g({type:String,reflect:!0})],$.prototype,`variant`,void 0),P([g({type:String,reflect:!0,attribute:`selected-chip`})],$.prototype,`selectedChip`,void 0),P([g({type:String,reflect:!0})],$.prototype,`title`,void 0),P([g({type:String,reflect:!0})],$.prototype,`subtitle`,void 0),P([g({type:String,reflect:!0})],$.prototype,`description`,void 0),P([g({type:String,reflect:!0})],$.prototype,`comment`,void 0),P([g({type:String,reflect:!0})],$.prototype,`source`,void 0),P([g({type:String,reflect:!0})],$.prototype,`footnote`,void 0),P([g({type:String,reflect:!0,attribute:`lang`})],$.prototype,`lang`,void 0),P([g({type:String,reflect:!0,attribute:`image-href`})],$.prototype,`imageHref`,void 0),P([g({type:Boolean,reflect:!0,attribute:`official-statistics`})],$.prototype,`officialStatistics`,void 0),P([g({type:Boolean,reflect:!0,attribute:`disable-toggle`})],$.prototype,`disableToggle`,void 0),P([g({type:String,attribute:`content-max-width`})],$.prototype,`contentMaxWidth`,void 0),P([g({type:String,attribute:`container-max-width`})],$.prototype,`containerMaxWidth`,void 0),P([g({type:String,attribute:`content-height`})],$.prototype,`contentHeight`,void 0),P([g({type:String,reflect:!0,attribute:`toggle-height-mode`})],$.prototype,`toggleHeightMode`,void 0),P([g({attribute:!1})],$.prototype,`tableData`,void 0),P([g({attribute:!1})],$.prototype,`valueFormat`,void 0),P([g({attribute:!1})],$.prototype,`timeFormat`,void 0),P([g({attribute:!1})],$.prototype,`yAxisSettings`,void 0),P([_()],$.prototype,`_slottedTableData`,void 0),P([_()],$.prototype,`_actionsMenuOpen`,void 0),P([_()],$.prototype,`_seriesDifferentiationEnabled`,void 0),P([_()],$.prototype,`_isFullscreen`,void 0),P([g({type:String,reflect:!0})],$.prototype,`spacing`,void 0),P([g({type:String,attribute:`spacing-top`,reflect:!0})],$.prototype,`spacingTop`,void 0),P([g({type:String,attribute:`spacing-bottom`,reflect:!0})],$.prototype,`spacingBottom`,void 0),P([g({type:String,attribute:`spacing-left`,reflect:!0})],$.prototype,`spacingLeft`,void 0),P([g({type:String,attribute:`spacing-right`,reflect:!0})],$.prototype,`spacingRight`,void 0),$=P([a(`scb-viz`)],$),Mc(),Vc(),rl(),uu(),fu(),mu(),Wc(),Mc(),Vc(),rl(),Fl(),uu(),fu(),gu(),mu(),Wc(),Mc(),Vc(),Ec(),rl(),Fl(),uu(),fu(),gu(),mu(),Wc(),Mc(),Vc(),Ec(),rl(),Fl(),uu(),fu(),gu(),mu(),Wc()})();
|