scb-wc-test 0.1.296 → 0.1.298

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,4 +1,4 @@
1
- import{a as ct,n as y,r as P,i as ht,x as p,k as N,l as dt,t as gt}from"../../vendor/vendor.js";import"../scb-chip/scb-chip.js";import"../scb-segmented-button/scb-segmented-button.js";import"../scb-segmented-button/scb-segmented-item.js";import"../scb-accordion/scb-accordion.js";import"../scb-divider/scb-divider.js";import"../scb-horizontal-scroller/scb-horizontal-scroller.js";import"../scb-icon-button/scb-icon-button.js";import"../../vendor/preload-helper.js";import"../../vendor/vendor-material.js";import"../scb-accordion/scb-accordion-item.js";import"../scb-button/scb-button.js";(function(){try{var t=typeof globalThis<"u"?globalThis:window;if(!t.__scb_ce_guard_installed__){t.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(i,a,n){try{customElements.get(i)||e(i,a,n)}catch(r){var h=String(r||"");if(h.indexOf("already been used")===-1&&h.indexOf("NotSupportedError")===-1)throw r}}}}catch{}})();var pt=Object.defineProperty,ft=Object.getOwnPropertyDescriptor,W=t=>{throw TypeError(t)},b=(t,e,i,a)=>{for(var n=a>1?void 0:a?ft(e,i):e,h=t.length-1,r;h>=0;h--)(r=t[h])&&(n=(a?r(e,i,n):r(n))||n);return a&&n&&pt(e,i,n),n},mt=(t,e,i)=>e.has(t)||W("Cannot "+i),ut=(t,e,i)=>e.has(t)?W("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),l=(t,e,i)=>(mt(t,e,"access private method"),i),o,k,I,F,M,A,O,U,$,K,J,D,E,_,X,Q,Y,Z,tt,et,it,st,q,at,R,T,nt,rt,j,B,H,C,V;const ot=`<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"
1
+ import{a as pt,n as y,r as F,i as gt,x as g,k as U,l as ft,t as ut}from"../../vendor/vendor.js";import"../scb-chip/scb-chip.js";import"../scb-segmented-button/scb-segmented-button.js";import"../scb-segmented-button/scb-segmented-item.js";import"../scb-accordion/scb-accordion.js";import"../scb-divider/scb-divider.js";import"../scb-horizontal-scroller/scb-horizontal-scroller.js";import"../scb-icon-button/scb-icon-button.js";import"../../vendor/preload-helper.js";import"../../vendor/vendor-material.js";import"../scb-accordion/scb-accordion-item.js";import"../scb-button/scb-button.js";(function(){try{var t=typeof globalThis<"u"?globalThis:window;if(!t.__scb_ce_guard_installed__){t.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(i,s,a){try{customElements.get(i)||e(i,s,a)}catch(r){var o=String(r||"");if(o.indexOf("already been used")===-1&&o.indexOf("NotSupportedError")===-1)throw r}}}}catch{}})();var mt=Object.defineProperty,bt=Object.getOwnPropertyDescriptor,K=t=>{throw TypeError(t)},m=(t,e,i,s)=>{for(var a=s>1?void 0:s?bt(e,i):e,o=t.length-1,r;o>=0;o--)(r=t[o])&&(a=(s?r(e,i,a):r(a))||a);return s&&a&&mt(e,i,a),a},vt=(t,e,i)=>e.has(t)||K("Cannot "+i),yt=(t,e,i)=>e.has(t)?K("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),c=(t,e,i)=>(vt(t,e,"access private method"),i),l,A,N,j,M,k,I,J,D,q,E,Y,Z,Q,$,T,_,X,tt,et,it,st,at,nt,rt,O,ot,R,H,lt,ct,B,G,V,C,P;const ht=`<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"
2
2
  viewBox="0 0 727.3 87.3" style="enable-background:new 0 0 727.3 87.3;" xml:space="preserve" fill="currentColor">
3
3
  <style type="text/css">
4
4
  .st0{clip-path:url(#SVGID_00000118375311472882578510000008414848687067442345_);}
@@ -113,7 +113,7 @@ import{a as ct,n as y,r as P,i as ht,x as p,k as N,l as dt,t as gt}from"../../ve
113
113
  <path d="M688.2,24.4h5.8v6h-5.8V24.4z M688.2,36.6h5.8v30.1h-5.8V36.6z"/>
114
114
  <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"/>
115
115
  </svg>
116
- `;let m=class extends ht{constructor(){super(...arguments),ut(this,o),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._seriesDifferentiationSnapshots=new WeakMap,this._diagramReflowFrame=0,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this._onDocumentPointerDown=t=>{if(!this._actionsMenuOpen)return;const e=t.composedPath(),i=this.shadowRoot?.querySelector(".actions-menu");i&&e.includes(i)||this._closeActionsMenu()},this._onDocumentKeyDown=t=>{this._actionsMenuOpen&&t.key==="Escape"&&(t.preventDefault(),this._closeActionsMenu(),this._focusMenuButton())},this._onPrintClick=async()=>{this._closeActionsMenu(),await l(this,o,tt).call(this)},this._onDownloadPngClick=async()=>{this._canExportRaster()&&(this._closeActionsMenu(),await l(this,o,E).call(this,"png"))},this._onDownloadJpgClick=async()=>{this._canExportRaster()&&(this._closeActionsMenu(),await l(this,o,E).call(this,"jpeg"))},this._onDownloadCsvClick=()=>{this._canExportCsv()&&(this._closeActionsMenu(),l(this,o,et).call(this))},this._onToggleSeriesDifferentiationClick=()=>{this._seriesDifferentiationEnabled=!this._seriesDifferentiationEnabled,this._closeActionsMenu(),l(this,o,D).call(this)}}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"}_getImageAltText(){return[this.title,this.subtitle,this.description].map(e=>typeof e=="string"?e.trim():"").filter(Boolean).join(". ")||(this.lang==="en"?"Image figure":"Bildfigur")}connectedCallback(){super.connectedCallback(),document.addEventListener("pointerdown",this._onDocumentPointerDown,!0),document.addEventListener("keydown",this._onDocumentKeyDown)}firstUpdated(t){this._readTableDataFromSlot(),l(this,o,H).call(this),l(this,o,V).call(this),l(this,o,$).call(this),this._syncChipClass(),l(this,o,k).call(this),l(this,o,M).call(this)}updated(t){super.updated(t),(t.has("selectedChip")||t.has("variant"))&&(this._syncChipClass(),this._closeActionsMenu()),t.has("selectedChip")&&this._dispatchSelectedChipChanged(),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&l(this,o,H).call(this),t.has("containerMaxWidth")&&l(this,o,V).call(this),t.has("variant")&&l(this,o,k).call(this),(t.has("contentMaxWidth")||t.has("contentHeight")||t.has("toggleHeightMode")||t.has("variant"))&&l(this,o,$).call(this),(t.has("selectedChip")||t.has("variant")||t.has("contentMaxWidth")||t.has("contentHeight")||t.has("toggleHeightMode"))&&l(this,o,M).call(this),(t.has("selectedChip")||t.has("variant"))&&this._seriesDifferentiationEnabled&&requestAnimationFrame(()=>{l(this,o,D).call(this)})}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("pointerdown",this._onDocumentPointerDown,!0),document.removeEventListener("keydown",this._onDocumentKeyDown),l(this,o,I).call(this),l(this,o,F).call(this)}_onTableSlotChange(t){const e=t.target;e&&(this._readTableDataFromSlot(e),this.requestUpdate())}_onDiagramSlotChange(){l(this,o,$).call(this),l(this,o,M).call(this),this._seriesDifferentiationEnabled&&requestAnimationFrame(()=>{l(this,o,D).call(this)}),this.requestUpdate()}_normalizeRenderableCell(t){return t&&typeof t=="object"&&"html"in t&&"text"in t?{html:typeof t.html=="string"?t.html:"",text:typeof t.text=="string"?t.text:""}:{html:"",text:t==null?"":String(t)}}_readTableDataFromSlot(t){const e=t||this.shadowRoot?.querySelector('slot[name="table"]');if(!e)return;const i=e.assignedElements({flatten:!0}),a=[];i.forEach(g=>{if(g.tagName==="TABLE"){a.push(g);return}g.querySelectorAll("table").forEach(u=>a.push(u))});const n=a[0];if(!n){this._slottedTableData=void 0;return}const h=[],r=[],s=[],c=g=>g?(g.textContent??"").replace(/\s+/g," ").trim():"",d=g=>g?{html:(g.innerHTML??"").trim(),text:c(g)}:{html:"",text:""},v=n.querySelector("thead tr");v&&Array.from(v.querySelectorAll("th, td")).forEach(u=>h.push(d(u)));const z=Array.from(n.querySelectorAll("tbody tr")),w=z.length>0?z:Array.from(n.querySelectorAll("tr")).filter(g=>g.closest("thead")===null);if(w.forEach(g=>{const u=Array.from(g.querySelectorAll("th, td"));if(u.length===0)return;const f=u[0].tagName==="TH"&&g.closest("thead")===null&&g.closest("tfoot")===null;s.push(f);const S=[];u.forEach(x=>S.push(d(x))),r.push(S)}),!v&&r.length>0){const g=r[0],u=w[0],f=Array.from(u?.querySelectorAll("th, td")??[]);f.length>0&&f.every(x=>x.tagName==="TH")&&u?.closest("tbody")===null&&(h.splice(0,h.length,...g),r.shift(),s.shift())}this._slottedTableData={headers:h.length>0?h:void 0,rows:r,rowHeaderRows:s.length>0?s:void 0}}_inferTableAlignments(t){const e=Math.max(t.headers?.length??0,...t.rows.map(n=>n.length)),i=n=>{if(n==null)return!1;if(typeof n=="number")return!0;const h=String(n).replace(/[\u00A0\u202F\s]+/g,"").trim();return h?/^-?\d+(?:[.,]\d+)?$/.test(h):!1},a=[];for(let n=0;n<e;n+=1){if(n===0){a.push("left");continue}const h=t.rows.map(s=>this._normalizeRenderableCell(s[n]).text).filter(s=>s!==""&&s!==null&&s!==void 0),r=h.length>0&&h.every(i);a.push(r?"right":"left")}return a}_getResolvedContentMaxWidth(){return this.contentMaxWidth?.trim()||""}_getResolvedDiagramHeight(){return this.contentHeight?.trim()||""}_getResolvedToggleHeightMode(){return this.toggleHeightMode==="auto"?"auto":"stable"}_getResolvedStandardContentHeight(){return this._getResolvedDiagramHeight()||"420px"}_getResolvedTableData(){return this.tableData??this._slottedTableData}_getDiagramAssignedElements(){const t=this.shadowRoot?.querySelector('slot[name="diagram"]');return t?t.assignedElements({flatten:!0}):[]}_findExportableVisualElement(t){for(const e of t){if(e instanceof SVGSVGElement||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement)return e;const i=e.querySelector("svg, canvas, img");if(i instanceof SVGSVGElement||i instanceof HTMLCanvasElement||i instanceof HTMLImageElement)return i}return null}_getExportableVisualElement(){if(this.variant==="Table")return null;if(this.variant==="Image"){const t=this.shadowRoot?.querySelector(".image-content img");return t instanceof HTMLImageElement?t:null}return this._findExportableVisualElement(this._getDiagramAssignedElements())}_getCurrentHighchartsChart(){if(this._getCurrentPrintableView()!=="diagram")return;const t=l(this,o,O).call(this,this._getDiagramAssignedElements());return t===void 0?void 0:window.Highcharts?.charts?.[t]}_getSeriesDifferentiationGroup(t,e){const i=String(t?.type||t?.options?.type||e?.options?.chart?.type||"").trim().toLowerCase();return["line","spline","scatter"].includes(i)?"line":["area","areaspline"].includes(i)?"area":["column","bar"].includes(i)?"fill":["pie","variablepie"].includes(i)?"point-fill":null}_shouldShowSeriesDifferentiationAction(){if(this._getCurrentPrintableView()!=="diagram")return!1;const t=this._getCurrentHighchartsChart();return!t?.series?.length||!this._isHighchartsStyledMode(t)?!1:t.series.some(e=>this._getSeriesDifferentiationGroup(e,t)!==null)}_getSeriesDifferentiationSnapshotStore(t){let e=this._seriesDifferentiationSnapshots.get(t);return e||(e=new Map,this._seriesDifferentiationSnapshots.set(t,e)),e}_cloneSeriesOptionValue(t){return Array.isArray(t)?t.map(e=>this._cloneSeriesOptionValue(e)):t&&typeof t=="object"?Object.fromEntries(Object.entries(t).map(([e,i])=>[e,this._cloneSeriesOptionValue(i)])):t}_captureSeriesDifferentiationSnapshot(t){const e=this._cloneSeriesOptionValue(t?.options?.marker);return{marker:e&&Object.keys(e).length>0?e:{enabled:!1}}}_getHighchartsSvgElement(t){const e=t?.element??t;return e instanceof SVGElement?e:null}_isHighchartsStyledMode(t){return!!(t?.styledMode||t?.renderer?.styledMode||t?.options?.chart?.styledMode)}_getHighchartsSvgRoot(t){if(t?.container instanceof SVGSVGElement)return t.container;const e=t?.renderTo?.querySelector("svg")??t?.container?.querySelector?.("svg");return e instanceof SVGSVGElement?e:null}_getHighchartsColorClassName(t,e){const i=this._getHighchartsSvgElement(t);return Array.from(i?.classList??[]).find(n=>/^highcharts-color-\d+$/.test(n))??`highcharts-color-${e}`}_setSeriesDifferentiationMetadata(t,e){const i=this._getHighchartsSvgElement(t);i&&(i.setAttribute("data-scb-viz-role",e.role),e.dashStyle?i.setAttribute("data-scb-viz-dash-style",e.dashStyle):i.removeAttribute("data-scb-viz-dash-style"),e.patternKind?i.setAttribute("data-scb-viz-pattern-kind",e.patternKind):i.removeAttribute("data-scb-viz-pattern-kind"))}_clearSeriesDifferentiationMetadata(t){const e=this._getHighchartsSvgElement(t);e&&(e.removeAttribute("data-scb-viz-role"),e.removeAttribute("data-scb-viz-dash-style"),e.removeAttribute("data-scb-viz-pattern-kind"))}_getSeriesDifferentiationDashStyles(){return["Solid","ShortDash","ShortDot","ShortDashDot","ShortDashDotDot","Dot","LongDash","LongDashDot","Dash","DashDot"]}_getSeriesDifferentiationMarkerSymbols(){return["circle","diamond","square","triangle","triangle-down"]}_getSeriesDifferentiationPatternKinds(){return["diagonal","dots","cross","vertical","horizontal","grid","diagonal-reverse","dots-dense","checker","zigzag"]}_setSeriesDifferentiationColorClass(t,e){const i=this._getHighchartsSvgElement(t);if(!i||!e)return;const a=Array.from(i.classList).find(n=>/^highcharts-color-\d+$/.test(n));a!==e&&(a&&(i.classList.remove(a),i.setAttribute("data-scb-viz-prev-color-class",a)),i.classList.add(e),i.setAttribute("data-scb-viz-added-color-class",e))}_clearSeriesDifferentiationColorClass(t){const e=this._getHighchartsSvgElement(t);if(!e)return;const i=e.getAttribute("data-scb-viz-added-color-class"),a=e.getAttribute("data-scb-viz-prev-color-class");i&&(e.classList.remove(i),e.removeAttribute("data-scb-viz-added-color-class")),a&&(e.classList.add(a),e.removeAttribute("data-scb-viz-prev-color-class"))}_getLegendSeriesDifferentiationTargets(t){const e=[],i=[],a=this._getHighchartsSvgElement(t?.legendItem?.group),n=(r,s)=>{const c=this._getHighchartsSvgElement(s);!c||r.includes(c)||r.push(c)};if(n(e,t?.legendLine),n(e,t?.legendItem?.line),n(i,t?.legendSymbol),n(i,t?.legendItem?.symbol),n(i,t?.legendArea),n(i,t?.legendItem?.area),a){const r=a.querySelector(".highcharts-graph, .highcharts-legend-graph, line, path");r&&n(e,r),a.querySelectorAll("rect, circle, .highcharts-point, .highcharts-area, .highcharts-legend-symbol, path").forEach(s=>{n(i,s)})}const h=i.filter(r=>!e.includes(r));return{graphTargets:e,fillTargets:h}}_ensureStyledModeSeriesPattern(t,e,i){const a=this._getHighchartsSvgRoot(t);if(!a)return;const n="http://www.w3.org/2000/svg";let h=a.querySelector("defs");h instanceof SVGDefsElement||(h=document.createElementNS(n,"defs"),a.insertBefore(h,a.firstChild));const r=`scb-viz-pattern-${e}-${i}`;if(h.querySelector(`#${r}`))return;const s=document.createElementNS(n,"pattern");s.setAttribute("id",r),s.setAttribute("patternUnits","userSpaceOnUse"),s.setAttribute("width","10"),s.setAttribute("height","10"),s.classList.add(e);const c=document.createElementNS(n,"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);const d=(w,g="1.25")=>{const u=document.createElementNS(n,"path");return u.setAttribute("d",w),u.setAttribute("class","scb-viz-highcharts-pattern__mark"),u.setAttribute("stroke-width",g),u.setAttribute("stroke-linecap","square"),u},v=(w,g,u)=>{const f=document.createElementNS(n,"circle");return f.setAttribute("cx",w),f.setAttribute("cy",g),f.setAttribute("r",u),f.setAttribute("class","scb-viz-highcharts-pattern__mark--dot"),f},z=(w,g,u,f)=>{const S=document.createElementNS(n,"rect");return S.setAttribute("x",w),S.setAttribute("y",g),S.setAttribute("width",u),S.setAttribute("height",f),S.setAttribute("class","scb-viz-highcharts-pattern__mark--square"),S};switch(i){case"diagonal":s.appendChild(d("M-2,8 l10,-10 M0,10 l10,-10 M8,12 l4,-4"));break;case"dots":s.appendChild(v("2","2","1.2")),s.appendChild(v("7","7","1.2"));break;case"cross":s.appendChild(d("M0,0 L10,10 M10,0 L0,10"));break;case"vertical":s.appendChild(d("M2,0 L2,10 M7,0 L7,10"));break;case"horizontal":s.appendChild(d("M0,2 L10,2 M0,7 L10,7"));break;case"diagonal-reverse":s.appendChild(d("M0,0 L10,10 M-2,2 L8,12 M2,-2 L12,8"));break;case"dots-dense":s.appendChild(v("2","2","1")),s.appendChild(v("7","2","1")),s.appendChild(v("2","7","1")),s.appendChild(v("7","7","1"));break;case"checker":s.appendChild(z("0","0","4","4")),s.appendChild(z("5","5","4","4"));break;case"zigzag":s.appendChild(d("M-2,8 L2,4 L6,8 L10,4 L14,8 M-2,3 L2,-1 L6,3 L10,-1 L14,3"));break;default:s.appendChild(d("M0,0 L10,0 M0,5 L10,5 M0,10 L10,10","1"));break}h.appendChild(s)}_applyStyledModeSeriesDifferentiation(t){const e=this._getHighchartsSvgRoot(t);if(!e)return;e.classList.add("scb-viz-series-differentiation-enabled");const i=this._getSeriesDifferentiationDashStyles(),a=this._getSeriesDifferentiationMarkerSymbols(),n=this._getSeriesDifferentiationPatternKinds(),h=this._getSeriesDifferentiationSnapshotStore(t);t.series?.forEach((r,s)=>{const c=this._getSeriesDifferentiationGroup(r,t);if(!c)return;const d=String(r?.index??s);h.has(d)||h.set(d,this._captureSeriesDifferentiationSnapshot(r));const v=i[s%i.length],z=n[s%n.length],w=a[s%a.length],g=this._getHighchartsColorClassName(r?.graph??r?.area??r?.group,s),u=this._getLegendSeriesDifferentiationTargets(r);this._setSeriesDifferentiationMetadata(r?.graph,{role:"graph",dashStyle:v}),c==="area"&&(this._setSeriesDifferentiationMetadata(r?.area,{role:"area",patternKind:z}),this._setSeriesDifferentiationColorClass(r?.area,g),this._ensureStyledModeSeriesPattern(t,g,z)),c==="fill"&&(r.points?.forEach(f=>{this._setSeriesDifferentiationMetadata(f?.graphic,{role:"fill",patternKind:z}),this._setSeriesDifferentiationColorClass(f?.graphic,g)}),this._ensureStyledModeSeriesPattern(t,g,z)),c==="point-fill"&&r.points?.forEach((f,S)=>{const x=n[S%n.length],L=this._getHighchartsColorClassName(f?.graphic??f?.legendSymbol??f?.legendItem?.symbol??f?.legendItem?.group,S),lt=this._getLegendSeriesDifferentiationTargets(f);this._setSeriesDifferentiationMetadata(f?.graphic,{role:"fill",patternKind:x}),this._setSeriesDifferentiationColorClass(f?.graphic,L),this._ensureStyledModeSeriesPattern(t,L,x),lt.fillTargets.forEach(G=>{this._setSeriesDifferentiationMetadata(G,{role:"legend-fill",patternKind:x}),this._setSeriesDifferentiationColorClass(G,L)})}),(c==="line"||c==="area")&&u.graphTargets.forEach(f=>{this._setSeriesDifferentiationMetadata(f,{role:"legend-symbol",dashStyle:v})}),(c==="area"||c==="fill")&&u.fillTargets.forEach(f=>{this._setSeriesDifferentiationMetadata(f,{role:"legend-fill",patternKind:z}),this._setSeriesDifferentiationColorClass(f,g)}),(c==="line"||c==="area")&&r.update({marker:{enabled:!0,symbol:w}},!1)}),t.redraw(!1)}_restoreStyledModeSeriesDifferentiation(t){this._getHighchartsSvgRoot(t)?.classList.remove("scb-viz-series-differentiation-enabled");const i=this._getSeriesDifferentiationSnapshotStore(t);t.series?.forEach((a,n)=>{const h=this._getSeriesDifferentiationGroup(a,t);if(!h)return;const r=this._getLegendSeriesDifferentiationTargets(a);if(this._clearSeriesDifferentiationMetadata(a?.graph),this._clearSeriesDifferentiationMetadata(a?.area),this._clearSeriesDifferentiationColorClass(a?.area),a.points?.forEach(s=>{const c=this._getLegendSeriesDifferentiationTargets(s);this._clearSeriesDifferentiationMetadata(s?.graphic),this._clearSeriesDifferentiationColorClass(s?.graphic),c.graphTargets.forEach(d=>{this._clearSeriesDifferentiationMetadata(d)}),c.fillTargets.forEach(d=>{this._clearSeriesDifferentiationMetadata(d),this._clearSeriesDifferentiationColorClass(d)})}),r.graphTargets.forEach(s=>{this._clearSeriesDifferentiationMetadata(s)}),r.fillTargets.forEach(s=>{this._clearSeriesDifferentiationMetadata(s),this._clearSeriesDifferentiationColorClass(s)}),h==="line"||h==="area"){const s=i.get(String(a?.index??n));a.update({marker:this._cloneSeriesOptionValue(s?.marker)},!1)}}),t.redraw(!1)}_canExportRaster(){return this._getExportableVisualElement()!==null}_canExportCsv(){return!!this._getResolvedTableData()?.rows?.length}_getExportBaseFileName(){const t=this.lang==="en"?"visualization":"visualisering";return(this.title||t).normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||t}_buildExportFileName(t){const e=t==="csv"?this.lang==="en"?"-table":"-tabell":"";return`${this._getExportBaseFileName()}${e}.${t}`}_renderActionsMenu(){const t=this._getCurrentPrintableView(),e=this._canExportRaster(),i=this._canExportCsv(),a=e&&(t==="diagram"||t==="image"),n=i&&t==="table",h=this._shouldShowSeriesDifferentiationAction();return p`
116
+ `;let u=class extends gt{constructor(){super(...arguments),yt(this,l),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._seriesDifferentiationSnapshots=new WeakMap,this._diagramReflowFrame=0,this._chartConfigSyncFrame=0,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this._onDocumentPointerDown=t=>{if(!this._actionsMenuOpen)return;const e=t.composedPath(),i=this.shadowRoot?.querySelector(".actions-menu");i&&e.includes(i)||this._closeActionsMenu()},this._onDocumentKeyDown=t=>{this._actionsMenuOpen&&t.key==="Escape"&&(t.preventDefault(),this._closeActionsMenu(),this._focusMenuButton())},this._onPrintClick=async()=>{this._closeActionsMenu(),await c(this,l,st).call(this)},this._onDownloadPngClick=async()=>{this._canExportRaster()&&(this._closeActionsMenu(),await c(this,l,T).call(this,"png"))},this._onDownloadJpgClick=async()=>{this._canExportRaster()&&(this._closeActionsMenu(),await c(this,l,T).call(this,"jpeg"))},this._onDownloadCsvClick=()=>{this._canExportCsv()&&(this._closeActionsMenu(),c(this,l,at).call(this))},this._onToggleSeriesDifferentiationClick=()=>{this._seriesDifferentiationEnabled=!this._seriesDifferentiationEnabled,this._closeActionsMenu(),c(this,l,$).call(this)}}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"}_getImageAltText(){return[this.title,this.subtitle,this.description].map(e=>typeof e=="string"?e.trim():"").filter(Boolean).join(". ")||(this.lang==="en"?"Image figure":"Bildfigur")}connectedCallback(){super.connectedCallback(),document.addEventListener("pointerdown",this._onDocumentPointerDown,!0),document.addEventListener("keydown",this._onDocumentKeyDown)}firstUpdated(t){this._readTableDataFromSlot(),c(this,l,V).call(this),c(this,l,P).call(this),c(this,l,D).call(this),this._syncChipClass(),c(this,l,A).call(this),c(this,l,M).call(this)}updated(t){super.updated(t),(t.has("selectedChip")||t.has("variant"))&&(this._syncChipClass(),this._closeActionsMenu()),t.has("selectedChip")&&this._dispatchSelectedChipChanged(),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&c(this,l,V).call(this),t.has("containerMaxWidth")&&c(this,l,P).call(this),t.has("variant")&&c(this,l,A).call(this),(t.has("contentMaxWidth")||t.has("contentHeight")||t.has("toggleHeightMode")||t.has("variant"))&&c(this,l,D).call(this),(t.has("selectedChip")||t.has("variant")||t.has("contentMaxWidth")||t.has("contentHeight")||t.has("toggleHeightMode"))&&c(this,l,M).call(this),(t.has("selectedChip")||t.has("variant"))&&this._seriesDifferentiationEnabled&&requestAnimationFrame(()=>{c(this,l,$).call(this)}),(t.has("valueFormat")||t.has("timeFormat")||t.has("yAxisSettings")||t.has("selectedChip")||t.has("variant"))&&c(this,l,E).call(this)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("pointerdown",this._onDocumentPointerDown,!0),document.removeEventListener("keydown",this._onDocumentKeyDown),c(this,l,N).call(this),c(this,l,j).call(this),c(this,l,q).call(this)}_onTableSlotChange(t){const e=t.target;e&&(this._readTableDataFromSlot(e),this.requestUpdate())}_onDiagramSlotChange(){c(this,l,D).call(this),c(this,l,M).call(this),c(this,l,E).call(this),this._seriesDifferentiationEnabled&&requestAnimationFrame(()=>{c(this,l,$).call(this)}),this.requestUpdate()}_normalizeRenderableCell(t){return t&&typeof t=="object"&&"html"in t&&"text"in t?{html:typeof t.html=="string"?t.html:"",text:typeof t.text=="string"?t.text:""}:{html:"",text:t==null?"":String(t)}}_readTableDataFromSlot(t){const e=t||this.shadowRoot?.querySelector('slot[name="table"]');if(!e)return;const i=e.assignedElements({flatten:!0}),s=[];i.forEach(p=>{if(p.tagName==="TABLE"){s.push(p);return}p.querySelectorAll("table").forEach(b=>s.push(b))});const a=s[0];if(!a){this._slottedTableData=void 0;return}const o=[],r=[],n=[],h=p=>p?(p.textContent??"").replace(/\s+/g," ").trim():"",d=p=>p?{html:(p.innerHTML??"").trim(),text:h(p)}:{html:"",text:""},v=a.querySelector("thead tr");v&&Array.from(v.querySelectorAll("th, td")).forEach(b=>o.push(d(b)));const z=Array.from(a.querySelectorAll("tbody tr")),w=z.length>0?z:Array.from(a.querySelectorAll("tr")).filter(p=>p.closest("thead")===null);if(w.forEach(p=>{const b=Array.from(p.querySelectorAll("th, td"));if(b.length===0)return;const f=b[0].tagName==="TH"&&p.closest("thead")===null&&p.closest("tfoot")===null;n.push(f);const S=[];b.forEach(x=>S.push(d(x))),r.push(S)}),!v&&r.length>0){const p=r[0],b=w[0],f=Array.from(b?.querySelectorAll("th, td")??[]);f.length>0&&f.every(x=>x.tagName==="TH")&&b?.closest("tbody")===null&&(o.splice(0,o.length,...p),r.shift(),n.shift())}this._slottedTableData={headers:o.length>0?o:void 0,rows:r,rowHeaderRows:n.length>0?n:void 0}}_inferTableAlignments(t){const e=Math.max(t.headers?.length??0,...t.rows.map(a=>a.length)),i=a=>{if(a==null)return!1;if(typeof a=="number")return!0;const o=String(a).replace(/[\u00A0\u202F\s]+/g,"").trim();return o?/^-?\d+(?:[.,]\d+)?$/.test(o):!1},s=[];for(let a=0;a<e;a+=1){if(a===0){s.push("left");continue}const o=t.rows.map(n=>this._normalizeRenderableCell(n[a]).text).filter(n=>n!==""&&n!==null&&n!==void 0),r=o.length>0&&o.every(i);s.push(r?"right":"left")}return s}_getResolvedContentMaxWidth(){return this.contentMaxWidth?.trim()||""}_getResolvedDiagramHeight(){return this.contentHeight?.trim()||""}_getResolvedToggleHeightMode(){return this.toggleHeightMode==="auto"?"auto":"stable"}_getResolvedStandardContentHeight(){return this._getResolvedDiagramHeight()||"420px"}_getResolvedTableData(){return this.tableData??this._slottedTableData}_getDiagramAssignedElements(){const t=this.shadowRoot?.querySelector('slot[name="diagram"]');return t?t.assignedElements({flatten:!0}):[]}_findExportableVisualElement(t){for(const e of t){if(e instanceof SVGSVGElement||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement)return e;const i=e.querySelector("svg, canvas, img");if(i instanceof SVGSVGElement||i instanceof HTMLCanvasElement||i instanceof HTMLImageElement)return i}return null}_getExportableVisualElement(){if(this.variant==="Table")return null;if(this.variant==="Image"){const t=this.shadowRoot?.querySelector(".image-content img");return t instanceof HTMLImageElement?t:null}return this._findExportableVisualElement(this._getDiagramAssignedElements())}_getDefaultValueFormat(){return{type:"number",scale:"auto",decimals:0}}_normalizeValueFormat(t){const e=this._getDefaultValueFormat(),i=t&&typeof t=="object"?t:{},s=["number","currency","percent"].includes(String(i.type))?String(i.type):e.type,a=["auto","raw","thousands","millions","billions"].includes(String(i.scale))?String(i.scale):e.scale,o=Number.isFinite(Number(i.decimals))?Math.max(0,Math.min(20,Number(i.decimals))):e.decimals;return{type:s,scale:a,decimals:o}}_normalizeTimeFormat(t){const e={mode:"raw",display:"raw"},i=t&&typeof t=="object"?t:{},s=["raw","year","monthCode","quarterCode","weekCode","tertialCode"];let a=typeof i.mode=="string"?i.mode:e.mode,o=typeof i.display=="string"?i.display:e.display;s.includes(a)||(a=e.mode);const r={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 r[a].includes(o)||(o=r[a][0]),a==="raw"&&(o="raw"),{mode:a,display:o}}_normalizeYAxisSettings(t){const e=t&&typeof t=="object"?t:{},i=Number.isFinite(Number(e.referenceLineValue))?Number(e.referenceLineValue):null;return{startAtZero:!!e.startAtZero,referenceLineEnabled:!!e.referenceLineEnabled&&Number.isFinite(i),referenceLineValue:i,referenceLineLabel:typeof e.referenceLineLabel=="string"?e.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(t,e){if(!t||e.mode==="raw"||e.display==="raw")return null;if(e.mode==="year"){const i=/^\s*(\d{4})\s*$/.exec(t);return i?i[1]:null}if(e.mode==="monthCode"){const i=/^\s*(\d{4})M(0?[1-9]|1[0-2])\s*$/i.exec(t);if(!i)return null;const s=Number(i[2])-1,a=i[1],o=String(s+1).padStart(2,"0");return e.display==="iso-month"?`${a}-${o}`:e.display==="short-month"?`${this._getShortMonthNames()[s]} ${a}`:e.display==="long-month"?`${this._getLongMonthNames()[s]} ${a}`:t}if(e.mode==="quarterCode"){const i=/^\s*(\d{4})(?:K(V)?|Q)(0?[1-4])\s*$/i.exec(t);if(!i)return null;const s=Number(i[3]),a=i[1],o=["första","andra","tredje","fjärde"];return e.display==="quarter-compact"?`${a} K${s}`:e.display==="quarter-short"?`kv ${s} ${a}`:e.display==="quarter-long"?`${o[s-1]} kvartalet ${a}`:t}if(e.mode==="weekCode"){const i=/^\s*(\d{4})(?:V|W)(0?[1-9]|[1-4][0-9]|5[0-3])\s*$/i.exec(t);if(!i)return null;const s=Number(i[2]),a=i[1];return e.display==="week-compact"?`${a} v. ${s}`:e.display==="week-long"?`vecka ${s} ${a}`:t}if(e.mode==="tertialCode"){const i=/^\s*(\d{4})T(0?[1-3])\s*$/i.exec(t);if(!i)return null;const s=Number(i[2]),a=i[1],o=["första","andra","tredje"];return e.display==="tertial-compact"?`${a} T${s}`:e.display==="tertial-short"?`tertial ${s} ${a}`:e.display==="tertial-long"?`${o[s-1]} tertialet ${a}`:t}return null}_formatLocalizedNumber(t,e){return new Intl.NumberFormat(this.lang==="en"?"en-GB":"sv-SE",{minimumFractionDigits:e,maximumFractionDigits:e}).format(t)}_formatValueForDisplay(t,e,i){if(!Number.isFinite(t))return null;const s={raw:1,thousands:1e3,millions:1e6,billions:1e9},a={raw:"",thousands:this.lang==="en"?"k":"t",millions:this.lang==="en"?"M":"mn",billions:this.lang==="en"?"B":"md"};let o=e.scale;if(o==="auto"){const d=Math.abs(t);d>=1e9?o="billions":d>=1e6?o="millions":d>=1e3?o="thousands":o="raw"}const r=t/(s[o]||1);let n=this._formatLocalizedNumber(r,e.decimals);e.type==="percent"?n=`${n} %`:e.type==="currency"&&(n=i?`${n} kr`:n);const h=a[o]||"";return h&&(n=`${n} ${h}`),n}_isCategoryAxis(t){return t?.categories?.length>0||t?.options?.type==="category"}_applyTimeFormatToLiveChart(t){const e=this._normalizeTimeFormat(this.timeFormat);if(e.mode==="raw"||e.display==="raw")return;const i=this._formatCategoryTimeLabel.bind(this);[...t?.xAxis||[],...t?.yAxis||[]].forEach(s=>{if(!this._isCategoryAxis(s))return;const a=s.options?.labels&&typeof s.options.labels=="object"?{...s.options.labels}:{},o=typeof a.formatter=="function"?a.formatter:null;a.formatter=function(){let r="";if(this?.axis&&Array.isArray(this.axis.categories)&&typeof this.pos=="number"){const h=this.axis.categories[this.pos];typeof h<"u"&&h!==null&&(r=String(h))}else typeof this?.value<"u"&&this.value!==null&&(r=String(this.value));const n=i(r,e);return n!==null?n:o?o.call(this):r},delete a.format,s.update({labels:a},!1)})}_applyValueFormatToLiveChart(t){const e=this._normalizeValueFormat(this.valueFormat),i=this._formatValueForDisplay.bind(this);t.update({tooltip:{...t.options?.tooltip||{},valueDecimals:e.decimals,formatter:function(){const s=Array.isArray(this.points)&&this.points.length?this.points:[this.point||this];let a="";const o=[];return typeof this.x<"u"&&this.x!==null?a=`<span>${String(this.x)}</span><br/>`:typeof this.key<"u"&&this.key!==null&&(a=`<span>${String(this.key)}</span><br/>`),s.forEach(r=>{const n=r?.point||r,h=Number.isFinite(r?.y)?r.y:n?.y,d=i(h,e,!0);if(d===null)return;const v=n?.name||n?.series?.name||"";o.push(`${v?`${String(v)}: `:""}<b>${d}</b><br/>`)}),a+o.join("")}},plotOptions:{...t.options?.plotOptions||{},series:{...t.options?.plotOptions?.series||{},dataLabels:{...t.options?.plotOptions?.series?.dataLabels||{},formatter:function(){const s=Number.isFinite(this?.y)?this.y:this?.point?.y;return i(s,e,e.type==="percent")??null}}}}},!1,!1,!1),(t?.yAxis||[]).forEach(s=>{const a=s.options?.labels&&typeof s.options.labels=="object"?{...s.options.labels}:{},o=typeof a.formatter=="function"?a.formatter:null,r=!(s.options?.title&&typeof s.options.title.text=="string"&&s.options.title.text.trim());a.formatter=function(){const n=i(this?.value,e,r);return n!==null?n:o?o.call(this):this?.value},(e.type==="percent"||e.scale!=="auto")&&delete a.format,s.update({labels:a},!1)})}_applyYAxisSettingsToLiveChart(t){const e=this._normalizeYAxisSettings(this.yAxisSettings),i=t?.yAxis||[];i.length&&i.forEach((s,a)=>{const o=s.options&&typeof s.options=="object"?s.options:{},r={},n=typeof o.min<"u"&&o.min!==null&&o.min!=="";a===0&&e.startAtZero&&!n&&(r.min=0);const h=Array.isArray(o.plotLines)?o.plotLines.filter(d=>d?.id!=="scb-viz-reference-line"):[];a===0&&e.referenceLineEnabled&&Number.isFinite(e.referenceLineValue)&&h.push({id:"scb-viz-reference-line",className:"scb-axis-plotline scb-viz-reference-line",value:e.referenceLineValue,label:e.referenceLineLabel?{text:e.referenceLineLabel,className:"scb-viz-reference-line-label"}:void 0}),h.length?r.plotLines=h:Array.isArray(o.plotLines)&&(r.plotLines=[]),s.update(r,!1)})}_getCurrentHighchartsChart(){if(this._getCurrentPrintableView()!=="diagram")return;const t=c(this,l,I).call(this,this._getDiagramAssignedElements());return t===void 0?void 0:window.Highcharts?.charts?.[t]}_getSeriesDifferentiationGroup(t,e){const i=String(t?.type||t?.options?.type||e?.options?.chart?.type||"").trim().toLowerCase();return["line","spline","scatter"].includes(i)?"line":["area","areaspline"].includes(i)?"area":["column","bar"].includes(i)?"fill":["pie","variablepie"].includes(i)?"point-fill":null}_shouldShowSeriesDifferentiationAction(){if(this._getCurrentPrintableView()!=="diagram")return!1;const t=this._getCurrentHighchartsChart();return!t?.series?.length||!this._isHighchartsStyledMode(t)?!1:t.series.some(e=>this._getSeriesDifferentiationGroup(e,t)!==null)}_getSeriesDifferentiationSnapshotStore(t){let e=this._seriesDifferentiationSnapshots.get(t);return e||(e=new Map,this._seriesDifferentiationSnapshots.set(t,e)),e}_cloneSeriesOptionValue(t){return Array.isArray(t)?t.map(e=>this._cloneSeriesOptionValue(e)):t&&typeof t=="object"?Object.fromEntries(Object.entries(t).map(([e,i])=>[e,this._cloneSeriesOptionValue(i)])):t}_captureSeriesDifferentiationSnapshot(t){const e=this._cloneSeriesOptionValue(t?.options?.marker);return{marker:e&&Object.keys(e).length>0?e:{enabled:!1}}}_getHighchartsSvgElement(t){const e=t?.element??t;return e instanceof SVGElement?e:null}_isHighchartsStyledMode(t){return!!(t?.styledMode||t?.renderer?.styledMode||t?.options?.chart?.styledMode)}_getHighchartsSvgRoot(t){if(t?.container instanceof SVGSVGElement)return t.container;const e=t?.renderTo?.querySelector("svg")??t?.container?.querySelector?.("svg");return e instanceof SVGSVGElement?e:null}_getHighchartsColorClassName(t,e){const i=this._getHighchartsSvgElement(t);return Array.from(i?.classList??[]).find(a=>/^highcharts-color-\d+$/.test(a))??`highcharts-color-${e}`}_setSeriesDifferentiationMetadata(t,e){const i=this._getHighchartsSvgElement(t);i&&(i.setAttribute("data-scb-viz-role",e.role),e.dashStyle?i.setAttribute("data-scb-viz-dash-style",e.dashStyle):i.removeAttribute("data-scb-viz-dash-style"),e.patternKind?i.setAttribute("data-scb-viz-pattern-kind",e.patternKind):i.removeAttribute("data-scb-viz-pattern-kind"))}_clearSeriesDifferentiationMetadata(t){const e=this._getHighchartsSvgElement(t);e&&(e.removeAttribute("data-scb-viz-role"),e.removeAttribute("data-scb-viz-dash-style"),e.removeAttribute("data-scb-viz-pattern-kind"))}_getSeriesDifferentiationDashStyles(){return["Solid","ShortDash","ShortDot","ShortDashDot","ShortDashDotDot","Dot","LongDash","LongDashDot","Dash","DashDot"]}_getSeriesDifferentiationMarkerSymbols(){return["circle","diamond","square","triangle","triangle-down"]}_getSeriesDifferentiationPatternKinds(){return["diagonal","dots","cross","vertical","horizontal","grid","diagonal-reverse","dots-dense","checker","zigzag"]}_setSeriesDifferentiationColorClass(t,e){const i=this._getHighchartsSvgElement(t);if(!i||!e)return;const s=Array.from(i.classList).find(a=>/^highcharts-color-\d+$/.test(a));s!==e&&(s&&(i.classList.remove(s),i.setAttribute("data-scb-viz-prev-color-class",s)),i.classList.add(e),i.setAttribute("data-scb-viz-added-color-class",e))}_clearSeriesDifferentiationColorClass(t){const e=this._getHighchartsSvgElement(t);if(!e)return;const i=e.getAttribute("data-scb-viz-added-color-class"),s=e.getAttribute("data-scb-viz-prev-color-class");i&&(e.classList.remove(i),e.removeAttribute("data-scb-viz-added-color-class")),s&&(e.classList.add(s),e.removeAttribute("data-scb-viz-prev-color-class"))}_getLegendSeriesDifferentiationTargets(t){const e=[],i=[],s=this._getHighchartsSvgElement(t?.legendItem?.group),a=(r,n)=>{const h=this._getHighchartsSvgElement(n);!h||r.includes(h)||r.push(h)};if(a(e,t?.legendLine),a(e,t?.legendItem?.line),a(i,t?.legendSymbol),a(i,t?.legendItem?.symbol),a(i,t?.legendArea),a(i,t?.legendItem?.area),s){const r=s.querySelector(".highcharts-graph, .highcharts-legend-graph, line, path");r&&a(e,r),s.querySelectorAll("rect, circle, .highcharts-point, .highcharts-area, .highcharts-legend-symbol, path").forEach(n=>{a(i,n)})}const o=i.filter(r=>!e.includes(r));return{graphTargets:e,fillTargets:o}}_ensureStyledModeSeriesPattern(t,e,i){const s=this._getHighchartsSvgRoot(t);if(!s)return;const a="http://www.w3.org/2000/svg";let o=s.querySelector("defs");o instanceof SVGDefsElement||(o=document.createElementNS(a,"defs"),s.insertBefore(o,s.firstChild));const r=`scb-viz-pattern-${e}-${i}`;if(o.querySelector(`#${r}`))return;const n=document.createElementNS(a,"pattern");n.setAttribute("id",r),n.setAttribute("patternUnits","userSpaceOnUse"),n.setAttribute("width","10"),n.setAttribute("height","10"),n.classList.add(e);const h=document.createElementNS(a,"rect");h.setAttribute("x","0"),h.setAttribute("y","0"),h.setAttribute("width","10"),h.setAttribute("height","10"),h.setAttribute("class","scb-viz-highcharts-pattern__background"),n.appendChild(h);const d=(w,p="1.25")=>{const b=document.createElementNS(a,"path");return b.setAttribute("d",w),b.setAttribute("class","scb-viz-highcharts-pattern__mark"),b.setAttribute("stroke-width",p),b.setAttribute("stroke-linecap","square"),b},v=(w,p,b)=>{const f=document.createElementNS(a,"circle");return f.setAttribute("cx",w),f.setAttribute("cy",p),f.setAttribute("r",b),f.setAttribute("class","scb-viz-highcharts-pattern__mark--dot"),f},z=(w,p,b,f)=>{const S=document.createElementNS(a,"rect");return S.setAttribute("x",w),S.setAttribute("y",p),S.setAttribute("width",b),S.setAttribute("height",f),S.setAttribute("class","scb-viz-highcharts-pattern__mark--square"),S};switch(i){case"diagonal":n.appendChild(d("M-2,8 l10,-10 M0,10 l10,-10 M8,12 l4,-4"));break;case"dots":n.appendChild(v("2","2","1.2")),n.appendChild(v("7","7","1.2"));break;case"cross":n.appendChild(d("M0,0 L10,10 M10,0 L0,10"));break;case"vertical":n.appendChild(d("M2,0 L2,10 M7,0 L7,10"));break;case"horizontal":n.appendChild(d("M0,2 L10,2 M0,7 L10,7"));break;case"diagonal-reverse":n.appendChild(d("M0,0 L10,10 M-2,2 L8,12 M2,-2 L12,8"));break;case"dots-dense":n.appendChild(v("2","2","1")),n.appendChild(v("7","2","1")),n.appendChild(v("2","7","1")),n.appendChild(v("7","7","1"));break;case"checker":n.appendChild(z("0","0","4","4")),n.appendChild(z("5","5","4","4"));break;case"zigzag":n.appendChild(d("M-2,8 L2,4 L6,8 L10,4 L14,8 M-2,3 L2,-1 L6,3 L10,-1 L14,3"));break;default:n.appendChild(d("M0,0 L10,0 M0,5 L10,5 M0,10 L10,10","1"));break}o.appendChild(n)}_applyStyledModeSeriesDifferentiation(t){const e=this._getHighchartsSvgRoot(t);if(!e)return;e.classList.add("scb-viz-series-differentiation-enabled");const i=this._getSeriesDifferentiationDashStyles(),s=this._getSeriesDifferentiationMarkerSymbols(),a=this._getSeriesDifferentiationPatternKinds(),o=this._getSeriesDifferentiationSnapshotStore(t);t.series?.forEach((r,n)=>{const h=this._getSeriesDifferentiationGroup(r,t);if(!h)return;const d=String(r?.index??n);o.has(d)||o.set(d,this._captureSeriesDifferentiationSnapshot(r));const v=i[n%i.length],z=a[n%a.length],w=s[n%s.length],p=this._getHighchartsColorClassName(r?.graph??r?.area??r?.group,n),b=this._getLegendSeriesDifferentiationTargets(r);this._setSeriesDifferentiationMetadata(r?.graph,{role:"graph",dashStyle:v}),h==="area"&&(this._setSeriesDifferentiationMetadata(r?.area,{role:"area",patternKind:z}),this._setSeriesDifferentiationColorClass(r?.area,p),this._ensureStyledModeSeriesPattern(t,p,z)),h==="fill"&&(r.points?.forEach(f=>{this._setSeriesDifferentiationMetadata(f?.graphic,{role:"fill",patternKind:z}),this._setSeriesDifferentiationColorClass(f?.graphic,p)}),this._ensureStyledModeSeriesPattern(t,p,z)),h==="point-fill"&&r.points?.forEach((f,S)=>{const x=a[S%a.length],L=this._getHighchartsColorClassName(f?.graphic??f?.legendSymbol??f?.legendItem?.symbol??f?.legendItem?.group,S),dt=this._getLegendSeriesDifferentiationTargets(f);this._setSeriesDifferentiationMetadata(f?.graphic,{role:"fill",patternKind:x}),this._setSeriesDifferentiationColorClass(f?.graphic,L),this._ensureStyledModeSeriesPattern(t,L,x),dt.fillTargets.forEach(W=>{this._setSeriesDifferentiationMetadata(W,{role:"legend-fill",patternKind:x}),this._setSeriesDifferentiationColorClass(W,L)})}),(h==="line"||h==="area")&&b.graphTargets.forEach(f=>{this._setSeriesDifferentiationMetadata(f,{role:"legend-symbol",dashStyle:v})}),(h==="area"||h==="fill")&&b.fillTargets.forEach(f=>{this._setSeriesDifferentiationMetadata(f,{role:"legend-fill",patternKind:z}),this._setSeriesDifferentiationColorClass(f,p)}),(h==="line"||h==="area")&&r.update({marker:{enabled:!0,symbol:w}},!1)}),t.redraw(!1)}_restoreStyledModeSeriesDifferentiation(t){this._getHighchartsSvgRoot(t)?.classList.remove("scb-viz-series-differentiation-enabled");const i=this._getSeriesDifferentiationSnapshotStore(t);t.series?.forEach((s,a)=>{const o=this._getSeriesDifferentiationGroup(s,t);if(!o)return;const r=this._getLegendSeriesDifferentiationTargets(s);if(this._clearSeriesDifferentiationMetadata(s?.graph),this._clearSeriesDifferentiationMetadata(s?.area),this._clearSeriesDifferentiationColorClass(s?.area),s.points?.forEach(n=>{const h=this._getLegendSeriesDifferentiationTargets(n);this._clearSeriesDifferentiationMetadata(n?.graphic),this._clearSeriesDifferentiationColorClass(n?.graphic),h.graphTargets.forEach(d=>{this._clearSeriesDifferentiationMetadata(d)}),h.fillTargets.forEach(d=>{this._clearSeriesDifferentiationMetadata(d),this._clearSeriesDifferentiationColorClass(d)})}),r.graphTargets.forEach(n=>{this._clearSeriesDifferentiationMetadata(n)}),r.fillTargets.forEach(n=>{this._clearSeriesDifferentiationMetadata(n),this._clearSeriesDifferentiationColorClass(n)}),o==="line"||o==="area"){const n=i.get(String(s?.index??a));s.update({marker:this._cloneSeriesOptionValue(n?.marker)},!1)}}),t.redraw(!1)}_canExportRaster(){return this._getExportableVisualElement()!==null}_canExportCsv(){return!!this._getResolvedTableData()?.rows?.length}_getExportBaseFileName(){const t=this.lang==="en"?"visualization":"visualisering";return(this.title||t).normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||t}_buildExportFileName(t){const e=t==="csv"?this.lang==="en"?"-table":"-tabell":"";return`${this._getExportBaseFileName()}${e}.${t}`}_renderActionsMenu(){const t=this._getCurrentPrintableView(),e=this._canExportRaster(),i=this._canExportCsv(),s=e&&(t==="diagram"||t==="image"),a=i&&t==="table",o=this._shouldShowSeriesDifferentiationAction();return g`
117
117
  <div class="actions-menu">
118
118
  <scb-icon-button
119
119
  icon="more_vert"
@@ -144,7 +144,7 @@ import{a as ct,n as y,r as P,i as ht,x as p,k as N,l as dt,t as gt}from"../../ve
144
144
  <span class="actions-menu-item-label">${this.printLabel}</span>
145
145
  </button>
146
146
  </li>
147
- ${a?p`
147
+ ${s?g`
148
148
  <li>
149
149
  <button
150
150
  type="button"
@@ -168,7 +168,7 @@ import{a as ct,n as y,r as P,i as ht,x as p,k as N,l as dt,t as gt}from"../../ve
168
168
  </button>
169
169
  </li>
170
170
  `:""}
171
- ${n?p`
171
+ ${a?g`
172
172
  <li>
173
173
  <button
174
174
  type="button"
@@ -181,7 +181,7 @@ import{a as ct,n as y,r as P,i as ht,x as p,k as N,l as dt,t as gt}from"../../ve
181
181
  </button>
182
182
  </li>
183
183
  `:""}
184
- ${h?p`
184
+ ${o?g`
185
185
  <li>
186
186
  <button
187
187
  type="button"
@@ -200,9 +200,9 @@ import{a as ct,n as y,r as P,i as ht,x as p,k as N,l as dt,t as gt}from"../../ve
200
200
  </ul>
201
201
  </div>
202
202
  </div>
203
- `}_renderActions(){return p`
203
+ `}_renderActions(){return g`
204
204
  <div class="actions-row">
205
- ${this.variant==="Standard"&&!this.disableToggle?p`
205
+ ${this.variant==="Standard"&&!this.disableToggle?g`
206
206
  <div class="flipp-wrapper">
207
207
  <scb-segmented-button
208
208
  .value=${this.selectedChip||""}
@@ -220,58 +220,58 @@ import{a as ct,n as y,r as P,i as ht,x as p,k as N,l as dt,t as gt}from"../../ve
220
220
  ></scb-segmented-item>
221
221
  </scb-segmented-button>
222
222
  </div>
223
- `:p`<div></div>`}
223
+ `:g`<div></div>`}
224
224
  ${this._renderActionsMenu()}
225
225
  </div>
226
- `}_renderHeader(t=!1){const e=p`
226
+ `}_renderHeader(t=!1){const e=g`
227
227
  <div class="header">
228
- ${this.title?p` <div class="label" role="heading" aria-level="2">${this.title}</div> `:""}
229
- ${this.subtitle?p` <div class="sub-label">${this.subtitle}</div> `:""}
228
+ ${this.title?g` <div class="label" role="heading" aria-level="2">${this.title}</div> `:""}
229
+ ${this.subtitle?g` <div class="sub-label">${this.subtitle}</div> `:""}
230
230
  </div>
231
- `;return t?p`
231
+ `;return t?g`
232
232
  <div class="header-row">
233
233
  ${e}
234
234
  ${this._renderActionsMenu()}
235
235
  </div>
236
- `:e}_renderTable(){const t=this.tableData??this._slottedTableData;if(!t||!t.rows||t.rows.length===0)return null;const e=this._inferTableAlignments(t),i=Math.max(t.headers?.length??0,...t.rows.map(s=>s.length)),a=(t.headers??[]).map(s=>this._normalizeRenderableCell(s)),n=t.rows.map(s=>{const c=s.map(d=>this._normalizeRenderableCell(d));for(;c.length<i;)c.push({html:"",text:""});return c}),h=t.rowHeaderRows??[],r=[this.title,this.subtitle].map(s=>typeof s=="string"?s.trim():"").filter(Boolean).join(". ");return p`
236
+ `:e}_renderTable(){const t=this.tableData??this._slottedTableData;if(!t||!t.rows||t.rows.length===0)return null;const e=this._inferTableAlignments(t),i=Math.max(t.headers?.length??0,...t.rows.map(n=>n.length)),s=(t.headers??[]).map(n=>this._normalizeRenderableCell(n)),a=t.rows.map(n=>{const h=n.map(d=>this._normalizeRenderableCell(d));for(;h.length<i;)h.push({html:"",text:""});return h}),o=t.rowHeaderRows??[],r=[this.title,this.subtitle].map(n=>typeof n=="string"?n.trim():"").filter(Boolean).join(". ");return g`
237
237
  <table class="scb-viz-table" part="table">
238
- ${r?p`<caption class="visually-hidden">${r}</caption>`:""}
239
- ${a.length>0?p`
238
+ ${r?g`<caption class="visually-hidden">${r}</caption>`:""}
239
+ ${s.length>0?g`
240
240
  <thead>
241
241
  <tr>
242
- ${a.map((s,c)=>{const d=e[c]==="right"?"align-right":"align-left";return p`<th scope="col" class=${d}>${s.html?N(s.html):s.text}</th>`})}
242
+ ${s.map((n,h)=>{const d=e[h]==="right"?"align-right":"align-left";return g`<th scope="col" class=${d}>${n.html?U(n.html):n.text}</th>`})}
243
243
  </tr>
244
244
  </thead>
245
245
  `:""}
246
246
  <tbody>
247
- ${n.map((s,c)=>{const d=h[c]===!0;return p`
247
+ ${a.map((n,h)=>{const d=o[h]===!0;return g`
248
248
  <tr>
249
- ${s.map((v,z)=>{const w=e[z]==="right"?"align-right":"align-left",g=v.html?N(v.html):v.text;return z===0&&d?p`<th scope="row" class=${w}>${g}</th>`:p`<td class=${w}>${g}</td>`})}
249
+ ${n.map((v,z)=>{const w=e[z]==="right"?"align-right":"align-left",p=v.html?U(v.html):v.text;return z===0&&d?g`<th scope="row" class=${w}>${p}</th>`:g`<td class=${w}>${p}</td>`})}
250
250
  </tr>
251
251
  `})}
252
252
  </tbody>
253
253
  </table>
254
- `}_hasMoreAboutStats(){return!!(this.comment||this.source||this.footnote||this.officialStatistics)}_renderMoreAboutStatsContent(){return p`
254
+ `}_hasMoreAboutStats(){return!!(this.comment||this.source||this.footnote||this.officialStatistics)}_renderMoreAboutStatsContent(){return g`
255
255
  <div class="more-about-stats-content">
256
- ${this.comment?p`
256
+ ${this.comment?g`
257
257
  <div class="section">
258
258
  <div class="secondary-label" role="heading" aria-level="3">${this.commentLabel}</div>
259
259
  <div class="body-text">${this.comment}</div>
260
260
  </div>
261
261
  `:""}
262
- ${this.source?p`
262
+ ${this.source?g`
263
263
  <div class="section">
264
264
  <div class="secondary-label" role="heading" aria-level="3">${this.sourceLabel}</div>
265
265
  <div class="body-text">${this.source}</div>
266
266
  </div>
267
267
  `:""}
268
- ${this.footnote?p`
268
+ ${this.footnote?g`
269
269
  <div class="section">
270
270
  <div class="secondary-label" role="heading" aria-level="3">${this.footnoteLabel}</div>
271
271
  <div class="body-text">${this.footnote}</div>
272
272
  </div>
273
273
  `:""}
274
- ${this.officialStatistics?p`
274
+ ${this.officialStatistics?g`
275
275
  <a
276
276
  class="sos-logotype-link"
277
277
  href="https://www.scb.se/sos"
@@ -281,12 +281,12 @@ import{a as ct,n as y,r as P,i as ht,x as p,k as N,l as dt,t as gt}from"../../ve
281
281
  aria-label="${this.officialStatisticsAlt}"
282
282
  >
283
283
  <span class="sos-logotype-small" aria-hidden="true">
284
- ${dt(ot)}
284
+ ${ft(ht)}
285
285
  </span>
286
286
  </a>
287
287
  `:""}
288
288
  </div>
289
- `}_renderMoreAboutStatsScreen(){return this._hasMoreAboutStats()?p`
289
+ `}_renderMoreAboutStatsScreen(){return this._hasMoreAboutStats()?g`
290
290
  <div class="footer-statistics-screen">
291
291
  <scb-divider></scb-divider>
292
292
  <scb-accordion>
@@ -295,16 +295,16 @@ import{a as ct,n as y,r as P,i as ht,x as p,k as N,l as dt,t as gt}from"../../ve
295
295
  </scb-accordion-item>
296
296
  </scb-accordion>
297
297
  </div>
298
- `:""}_renderMoreAboutStatsPrint(){return this._hasMoreAboutStats()?p`
298
+ `:""}_renderMoreAboutStatsPrint(){return this._hasMoreAboutStats()?g`
299
299
  <div class="footer-statistics-print print-more-about-stats">
300
300
  <div class="secondary-label print-more-about-stats-heading" role="heading" aria-level="3">
301
301
  ${this.moreAboutStatsLabel}
302
302
  </div>
303
303
  ${this._renderMoreAboutStatsContent()}
304
304
  </div>
305
- `:""}_renderFooter(){return p`
305
+ `:""}_renderFooter(){return g`
306
306
  <div class="footer">
307
- ${this.description?p`
307
+ ${this.description?g`
308
308
  <div class="description section">
309
309
  <div class="secondary-label" role="heading" aria-level="3">${this.descriptionLabel}</div>
310
310
  <div class="body-text">${this.description}</div>
@@ -313,7 +313,7 @@ import{a as ct,n as y,r as P,i as ht,x as p,k as N,l as dt,t as gt}from"../../ve
313
313
  ${this._renderMoreAboutStatsScreen()}
314
314
  ${this._renderMoreAboutStatsPrint()}
315
315
  </div>
316
- `}render(){switch(this.variant){case"Table":return p`
316
+ `}render(){switch(this.variant){case"Table":return g`
317
317
  <div part="container" class="viz-container">
318
318
  ${this._renderHeader(!0)}
319
319
  <div class="content">
@@ -334,7 +334,7 @@ import{a as ct,n as y,r as P,i as ht,x as p,k as N,l as dt,t as gt}from"../../ve
334
334
  ></slot>
335
335
  <slot></slot>
336
336
  </div>
337
- `;case"Image":return p`
337
+ `;case"Image":return g`
338
338
  <div part="container" class="viz-container">
339
339
  ${this._renderHeader(!0)}
340
340
  <div
@@ -351,7 +351,7 @@ import{a as ct,n as y,r as P,i as ht,x as p,k as N,l as dt,t as gt}from"../../ve
351
351
  ></slot>
352
352
  <slot></slot>
353
353
  </div>
354
- `;default:return p`
354
+ `;default:return g`
355
355
  <div part="container" class="viz-container">
356
356
  ${this._renderHeader()}
357
357
  ${this._renderActions()}
@@ -362,7 +362,7 @@ import{a as ct,n as y,r as P,i as ht,x as p,k as N,l as dt,t as gt}from"../../ve
362
362
  <div
363
363
  class=${`standard-content-panel standard-content-panel--diagram ${this.selectedChip==="Diagram"?"standard-content-panel--active":""}`}
364
364
  >
365
- ${this._getResolvedContentMaxWidth()?p`
365
+ ${this._getResolvedContentMaxWidth()?g`
366
366
  <scb-horizontal-scroller
367
367
  width=${this._getResolvedContentMaxWidth()}
368
368
  class="standard-diagram-scroller"
@@ -375,7 +375,7 @@ import{a as ct,n as y,r as P,i as ht,x as p,k as N,l as dt,t as gt}from"../../ve
375
375
  <slot name="diagram" @slotchange=${this._onDiagramSlotChange}></slot>
376
376
  </div>
377
377
  </scb-horizontal-scroller>
378
- `:p`
378
+ `:g`
379
379
  <div class="standard-diagram-scroller">
380
380
  <div class="diagram-content">
381
381
  <slot name="diagram" @slotchange=${this._onDiagramSlotChange}></slot>
@@ -407,39 +407,39 @@ import{a as ct,n as y,r as P,i as ht,x as p,k as N,l as dt,t as gt}from"../../ve
407
407
  ></slot>
408
408
  <slot></slot>
409
409
  </div>
410
- `}}_syncChipClass(){const t=this.variant==="Standard";this.classList.toggle("chip-diagram",t&&this.selectedChip==="Diagram"),this.classList.toggle("chip-table",t&&this.selectedChip==="Table")}_dispatchSelectedChipChanged(){const t={selectedChip:this.selectedChip};this.dispatchEvent(new CustomEvent("selected-chip-changed",{detail:t,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("selectedchipchanged",{detail:t,bubbles:!0,composed:!0}))}_onSegmentedChange(t){const e=t.detail?.value;this.selectedChip===e?this.selectedChip=null:this.selectedChip=e}_toggleActionsMenu(t){t.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()}_getCurrentPrintableView(){return this.variant==="Table"?"table":this.variant==="Image"?"image":this.selectedChip==="Table"?"table":"diagram"}};o=new WeakSet;k=function(){if(l(this,o,I).call(this),typeof ResizeObserver>"u")return;const t=this.shadowRoot?.querySelector(".diagram-content");t&&(this._diagramResizeObserver=new ResizeObserver(()=>{l(this,o,M).call(this)}),this._diagramResizeObserver.observe(this),this._diagramResizeObserver.observe(t))};I=function(){this._diagramResizeObserver?.disconnect(),this._diagramResizeObserver=void 0};F=function(){this._diagramReflowFrame&&(cancelAnimationFrame(this._diagramReflowFrame),this._diagramReflowFrame=0)};M=function(){this.variant!=="Standard"||this.selectedChip!=="Diagram"||(l(this,o,F).call(this),this._diagramReflowFrame=requestAnimationFrame(()=>{this._diagramReflowFrame=requestAnimationFrame(()=>{this._diagramReflowFrame=0,l(this,o,U).call(this)})}))};A=function(t){const e=t?.getAttribute("data-highcharts-chart");if(!e)return;const i=Number.parseInt(e,10);return Number.isNaN(i)?void 0:i};O=function(t){for(const e of t){const i=l(this,o,A).call(this,e);if(i!==void 0)return i;const a=e.querySelector("[data-highcharts-chart]"),n=l(this,o,A).call(this,a);if(n!==void 0)return n}};U=function(){if(this.variant!=="Standard"||this.selectedChip!=="Diagram")return;const t=this.shadowRoot?.querySelector('slot[name="diagram"]');if(!t)return;const e=t.assignedElements({flatten:!0});if(e.length===0)return;const i=l(this,o,O).call(this,e);if(i===void 0)return;const n=window.Highcharts?.charts?.[i];n&&(n.setSize?.(null,null,!1),n.reflow?.(),this._seriesDifferentiationEnabled&&l(this,o,D).call(this))};$=function(){const t=this.variant==="Standard"?this._getResolvedDiagramHeight():"",e=this.variant==="Standard"&&this._getResolvedToggleHeightMode()==="stable"?this._getResolvedStandardContentHeight():"";this.variant==="Standard"?this.style.setProperty("--scb-viz-diagram-min-height",t||"420px"):this.style.removeProperty("--scb-viz-diagram-min-height"),t?(this.style.setProperty("--scb-viz-diagram-height",t),this.style.setProperty("--scb-viz-diagram-overflow","hidden")):(this.style.removeProperty("--scb-viz-diagram-height"),this.style.removeProperty("--scb-viz-diagram-overflow")),e?this.style.setProperty("--scb-viz-standard-content-height",e):this.style.removeProperty("--scb-viz-standard-content-height")};K=function(t){this._isHighchartsStyledMode(t)&&this._applyStyledModeSeriesDifferentiation(t)};J=function(t){this._isHighchartsStyledMode(t)&&this._restoreStyledModeSeriesDifferentiation(t)};D=function(){const t=this._getCurrentHighchartsChart();if(t){if(this._seriesDifferentiationEnabled){l(this,o,K).call(this,t);return}l(this,o,J).call(this,t)}};E=async function(t){const e=this._getExportableVisualElement();if(!e)return;const i=await l(this,o,it).call(this,e,t);i&&l(this,o,B).call(this,i,this._buildExportFileName(t==="jpeg"?"jpg":"png"))};_=function(t){return String(t??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")};X=function(t){const e=this._inferTableAlignments(t),i=Math.max(t.headers?.length??0,...t.rows.map(c=>c.length)),a=(t.headers??[]).map(c=>this._normalizeRenderableCell(c)),n=t.rows.map(c=>{const d=c.map(v=>this._normalizeRenderableCell(v));for(;d.length<i;)d.push({html:"",text:""});return d}),h=t.rowHeaderRows??[],r=a.length?`<thead><tr>${a.map((c,d)=>`<th scope="col" class="${e[d]==="right"?"align-right":"align-left"}">${c.html||l(this,o,_).call(this,c.text)}</th>`).join("")}</tr></thead>`:"",s=`<tbody>${n.map((c,d)=>{const v=h[d]===!0;return`<tr>${c.map((w,g)=>{const u=e[g]==="right"?"align-right":"align-left",f=w.html||l(this,o,_).call(this,w.text);return g===0&&v?`<th scope="row" class="${u}">${f}</th>`:`<td class="${u}">${f}</td>`}).join("")}</tr>`}).join("")}</tbody>`;return`<table class="scb-viz-print-table">${r}${s}</table>`};Q=function(){const t=[];if(this.description&&t.push(`
410
+ `}}_syncChipClass(){const t=this.variant==="Standard";this.classList.toggle("chip-diagram",t&&this.selectedChip==="Diagram"),this.classList.toggle("chip-table",t&&this.selectedChip==="Table")}_dispatchSelectedChipChanged(){const t={selectedChip:this.selectedChip};this.dispatchEvent(new CustomEvent("selected-chip-changed",{detail:t,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("selectedchipchanged",{detail:t,bubbles:!0,composed:!0}))}_onSegmentedChange(t){const e=t.detail?.value;this.selectedChip===e?this.selectedChip=null:this.selectedChip=e}_toggleActionsMenu(t){t.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()}_getCurrentPrintableView(){return this.variant==="Table"?"table":this.variant==="Image"?"image":this.selectedChip==="Table"?"table":"diagram"}};l=new WeakSet;A=function(){if(c(this,l,N).call(this),typeof ResizeObserver>"u")return;const t=this.shadowRoot?.querySelector(".diagram-content");t&&(this._diagramResizeObserver=new ResizeObserver(()=>{c(this,l,M).call(this)}),this._diagramResizeObserver.observe(this),this._diagramResizeObserver.observe(t))};N=function(){this._diagramResizeObserver?.disconnect(),this._diagramResizeObserver=void 0};j=function(){this._diagramReflowFrame&&(cancelAnimationFrame(this._diagramReflowFrame),this._diagramReflowFrame=0)};M=function(){this.variant!=="Standard"||this.selectedChip!=="Diagram"||(c(this,l,j).call(this),this._diagramReflowFrame=requestAnimationFrame(()=>{this._diagramReflowFrame=requestAnimationFrame(()=>{this._diagramReflowFrame=0,c(this,l,J).call(this)})}))};k=function(t){const e=t?.getAttribute("data-highcharts-chart");if(!e)return;const i=Number.parseInt(e,10);return Number.isNaN(i)?void 0:i};I=function(t){for(const e of t){const i=c(this,l,k).call(this,e);if(i!==void 0)return i;const s=e.querySelector("[data-highcharts-chart]"),a=c(this,l,k).call(this,s);if(a!==void 0)return a}};J=function(){if(this.variant!=="Standard"||this.selectedChip!=="Diagram")return;const t=this.shadowRoot?.querySelector('slot[name="diagram"]');if(!t)return;const e=t.assignedElements({flatten:!0});if(e.length===0)return;const i=c(this,l,I).call(this,e);if(i===void 0)return;const a=window.Highcharts?.charts?.[i];a&&(a.setSize?.(null,null,!1),a.reflow?.(),this._seriesDifferentiationEnabled&&c(this,l,$).call(this))};D=function(){const t=this.variant==="Standard"?this._getResolvedDiagramHeight():"",e=this.variant==="Standard"&&this._getResolvedToggleHeightMode()==="stable"?this._getResolvedStandardContentHeight():"";this.variant==="Standard"?this.style.setProperty("--scb-viz-diagram-min-height",t||"420px"):this.style.removeProperty("--scb-viz-diagram-min-height"),t?(this.style.setProperty("--scb-viz-diagram-height",t),this.style.setProperty("--scb-viz-diagram-overflow","hidden")):(this.style.removeProperty("--scb-viz-diagram-height"),this.style.removeProperty("--scb-viz-diagram-overflow")),e?this.style.setProperty("--scb-viz-standard-content-height",e):this.style.removeProperty("--scb-viz-standard-content-height")};q=function(){this._chartConfigSyncFrame&&(cancelAnimationFrame(this._chartConfigSyncFrame),this._chartConfigSyncFrame=0)};E=function(){c(this,l,q).call(this),this._chartConfigSyncFrame=requestAnimationFrame(()=>{this._chartConfigSyncFrame=requestAnimationFrame(()=>{this._chartConfigSyncFrame=0,c(this,l,Y).call(this)})})};Y=function(){const t=this._getCurrentHighchartsChart();if(!t)return;let e=!1;typeof this.timeFormat<"u"&&(this._applyTimeFormatToLiveChart(t),e=!0),typeof this.valueFormat<"u"&&(this._applyValueFormatToLiveChart(t),e=!0),typeof this.yAxisSettings<"u"&&(this._applyYAxisSettingsToLiveChart(t),e=!0),e&&t.redraw(!1)};Z=function(t){this._isHighchartsStyledMode(t)&&this._applyStyledModeSeriesDifferentiation(t)};Q=function(t){this._isHighchartsStyledMode(t)&&this._restoreStyledModeSeriesDifferentiation(t)};$=function(){const t=this._getCurrentHighchartsChart();if(t){if(this._seriesDifferentiationEnabled){c(this,l,Z).call(this,t);return}c(this,l,Q).call(this,t)}};T=async function(t){const e=this._getExportableVisualElement();if(!e)return;const i=await c(this,l,nt).call(this,e,t);i&&c(this,l,G).call(this,i,this._buildExportFileName(t==="jpeg"?"jpg":"png"))};_=function(t){return String(t??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")};X=function(t){const e=this._inferTableAlignments(t),i=Math.max(t.headers?.length??0,...t.rows.map(h=>h.length)),s=(t.headers??[]).map(h=>this._normalizeRenderableCell(h)),a=t.rows.map(h=>{const d=h.map(v=>this._normalizeRenderableCell(v));for(;d.length<i;)d.push({html:"",text:""});return d}),o=t.rowHeaderRows??[],r=s.length?`<thead><tr>${s.map((h,d)=>`<th scope="col" class="${e[d]==="right"?"align-right":"align-left"}">${h.html||c(this,l,_).call(this,h.text)}</th>`).join("")}</tr></thead>`:"",n=`<tbody>${a.map((h,d)=>{const v=o[d]===!0;return`<tr>${h.map((w,p)=>{const b=e[p]==="right"?"align-right":"align-left",f=w.html||c(this,l,_).call(this,w.text);return p===0&&v?`<th scope="row" class="${b}">${f}</th>`:`<td class="${b}">${f}</td>`}).join("")}</tr>`}).join("")}</tbody>`;return`<table class="scb-viz-print-table">${r}${n}</table>`};tt=function(){const t=[];if(this.description&&t.push(`
411
411
  <section class="print-section">
412
- <h2>${l(this,o,_).call(this,this.descriptionLabel)}</h2>
413
- <div>${l(this,o,_).call(this,this.description)}</div>
412
+ <h2>${c(this,l,_).call(this,this.descriptionLabel)}</h2>
413
+ <div>${c(this,l,_).call(this,this.description)}</div>
414
414
  </section>
415
415
  `),this._hasMoreAboutStats()){const e=[];this.comment&&e.push(`
416
416
  <section class="print-section print-meta-section">
417
- <h3>${l(this,o,_).call(this,this.commentLabel)}</h3>
418
- <div>${l(this,o,_).call(this,this.comment)}</div>
417
+ <h3>${c(this,l,_).call(this,this.commentLabel)}</h3>
418
+ <div>${c(this,l,_).call(this,this.comment)}</div>
419
419
  </section>
420
420
  `),this.source&&e.push(`
421
421
  <section class="print-section print-meta-section">
422
- <h3>${l(this,o,_).call(this,this.sourceLabel)}</h3>
423
- <div>${l(this,o,_).call(this,this.source)}</div>
422
+ <h3>${c(this,l,_).call(this,this.sourceLabel)}</h3>
423
+ <div>${c(this,l,_).call(this,this.source)}</div>
424
424
  </section>
425
425
  `),this.footnote&&e.push(`
426
426
  <section class="print-section print-meta-section">
427
- <h3>${l(this,o,_).call(this,this.footnoteLabel)}</h3>
428
- <div>${l(this,o,_).call(this,this.footnote)}</div>
427
+ <h3>${c(this,l,_).call(this,this.footnoteLabel)}</h3>
428
+ <div>${c(this,l,_).call(this,this.footnote)}</div>
429
429
  </section>
430
430
  `),this.officialStatistics&&e.push(`
431
- <div class="print-sos">${ot}</div>
431
+ <div class="print-sos">${ht}</div>
432
432
  `),t.push(`
433
433
  <section class="print-section print-more-about-stats">
434
- <h2>${l(this,o,_).call(this,this.moreAboutStatsLabel)}</h2>
434
+ <h2>${c(this,l,_).call(this,this.moreAboutStatsLabel)}</h2>
435
435
  ${e.join("")}
436
436
  </section>
437
- `)}return t.join("")};Y=function(t){return`<!doctype html>
438
- <html lang="${l(this,o,_).call(this,this.lang||"sv")}">
437
+ `)}return t.join("")};et=function(t){return`<!doctype html>
438
+ <html lang="${c(this,l,_).call(this,this.lang||"sv")}">
439
439
  <head>
440
440
  <meta charset="utf-8">
441
441
  <meta name="viewport" content="width=device-width, initial-scale=1">
442
- <title>${l(this,o,_).call(this,this.title||(this.lang==="en"?"Visualization":"Visualisering"))}</title>
442
+ <title>${c(this,l,_).call(this,this.title||(this.lang==="en"?"Visualization":"Visualisering"))}</title>
443
443
  <style>
444
444
  :root { color-scheme: light; }
445
445
  @page { margin: 16mm; }
@@ -477,15 +477,15 @@ import{a as ct,n as y,r as P,i as ht,x as p,k as N,l as dt,t as gt}from"../../ve
477
477
  <body>
478
478
  <article class="viz-print">
479
479
  <header class="viz-header">
480
- ${this.title?`<h1 class="viz-title">${l(this,o,_).call(this,this.title)}</h1>`:""}
481
- ${this.subtitle?`<div class="viz-subtitle">${l(this,o,_).call(this,this.subtitle)}</div>`:""}
480
+ ${this.title?`<h1 class="viz-title">${c(this,l,_).call(this,this.title)}</h1>`:""}
481
+ ${this.subtitle?`<div class="viz-subtitle">${c(this,l,_).call(this,this.subtitle)}</div>`:""}
482
482
  </header>
483
483
  <div class="viz-content">${t}</div>
484
- ${l(this,o,Q).call(this)}
484
+ ${c(this,l,tt).call(this)}
485
485
  </article>
486
486
  </body>
487
- </html>`};Z=async function(t){const e=document.createElement("iframe");e.setAttribute("aria-hidden","true"),e.style.position="fixed",e.style.right="0",e.style.bottom="0",e.style.width="0",e.style.height="0",e.style.border="0",e.style.visibility="hidden",document.body.appendChild(e);const i=()=>{e.remove()},a=e.contentDocument,n=e.contentWindow;if(!a||!n){i();return}a.open(),a.write(t),a.close();const h=Array.from(a.images||[]);await Promise.all(h.map(s=>s.complete?Promise.resolve():new Promise(c=>{s.addEventListener("load",()=>c(null),{once:!0}),s.addEventListener("error",()=>c(null),{once:!0})})));const r=()=>{n.removeEventListener("afterprint",r),i()};n.addEventListener("afterprint",r,{once:!0}),setTimeout(()=>{n.focus(),n.print(),setTimeout(i,1e3)},50)};tt=async function(){const t=this._getCurrentPrintableView();let e="";if(t==="table"){const i=this._getResolvedTableData();if(!i?.rows?.length)return;e=l(this,o,X).call(this,i)}else if(t==="image"){const i=this.shadowRoot?.querySelector(".image-content img"),a=i?.currentSrc||i?.src||this.imageHref;if(!a)return;e=`<img class="viz-image" src="${l(this,o,_).call(this,a)}" alt="${l(this,o,_).call(this,this._getImageAltText())}">`}else{const i=this._getExportableVisualElement();if(!i)return;const a=await l(this,o,st).call(this,i,"png");if(!a)return;e=`<img class="viz-chart-image" src="${a}" alt="${l(this,o,_).call(this,this._getImageAltText())}">`}await l(this,o,Z).call(this,l(this,o,Y).call(this,e))};et=function(){const t=this._getResolvedTableData();if(!t?.rows?.length)return;const e=this.lang==="en"?",":";",i=[];t.headers?.length&&i.push(t.headers.map(r=>this._normalizeRenderableCell(r).text)),t.rows.forEach(r=>{i.push(r.map(s=>this._normalizeRenderableCell(s).text))});const a=r=>`"${String(r??"").replace(/\r?\n/g," ").replace(/"/g,'""')}"`,n=`\uFEFF${i.map(r=>r.map(a).join(e)).join(`\r
488
- `)}`,h=new Blob([n],{type:"text/csv;charset=utf-8;"});l(this,o,B).call(this,h,this._buildExportFileName("csv"))};it=async function(t,e){const i=await l(this,o,q).call(this,t);return i?l(this,o,rt).call(this,i,e==="jpeg"?"image/jpeg":"image/png",e==="jpeg"?.92:void 0):null};st=async function(t,e){const i=await l(this,o,q).call(this,t);return i?i.toDataURL(e==="jpeg"?"image/jpeg":"image/png",e==="jpeg"?.92:void 0):null};q=async function(t){if(t instanceof HTMLCanvasElement){const r=t.width||Math.round(t.getBoundingClientRect().width),s=t.height||Math.round(t.getBoundingClientRect().height);if(!r||!s)return null;const c=document.createElement("canvas");c.width=r,c.height=s;const d=c.getContext("2d");return d?(d.fillStyle=l(this,o,j).call(this),d.fillRect(0,0,r,s),d.drawImage(t,0,0,r,s),c):null}if(t instanceof HTMLImageElement){const r=t.naturalWidth||t.width,s=t.naturalHeight||t.height;return!r||!s?null:l(this,o,T).call(this,t.currentSrc||t.src,r,s)}const{width:e,height:i,serialized:a}=l(this,o,at).call(this,t);if(!e||!i||!a)return null;const n=new Blob([a],{type:"image/svg+xml;charset=utf-8"}),h=URL.createObjectURL(n);try{return await l(this,o,T).call(this,h,e,i)}finally{URL.revokeObjectURL(h)}};at=function(t){const e=t.cloneNode(!0),i=t.getBoundingClientRect(),a=t.viewBox?.baseVal,n=Math.round(a?.width||i.width||Number(t.getAttribute("width"))||0),h=Math.round(a?.height||i.height||Number(t.getAttribute("height"))||0);return e.setAttribute("xmlns","http://www.w3.org/2000/svg"),e.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),!e.getAttribute("width")&&n&&e.setAttribute("width",String(n)),!e.getAttribute("height")&&h&&e.setAttribute("height",String(h)),!e.getAttribute("viewBox")&&n&&h&&e.setAttribute("viewBox",`0 0 ${n} ${h}`),l(this,o,R).call(this,t,e),e.querySelectorAll(".highcharts-tooltip, .highcharts-contextmenu, .highcharts-a11y-proxy-container, .highcharts-a11y-dummy-point").forEach(r=>r.remove()),{width:n,height:h,serialized:new XMLSerializer().serializeToString(e)}};R=function(t,e){const i=getComputedStyle(t);let a="";for(let r=0;r<i.length;r+=1){const s=i[r],c=i.getPropertyValue(s);c&&(a+=`${s}:${c};`)}a&&e.setAttribute("style",a);const n=Array.from(t.children),h=Array.from(e.children);for(let r=0;r<n.length;r+=1){const s=n[r],c=h[r];s&&c&&l(this,o,R).call(this,s,c)}};T=async function(t,e,i){const a=Math.max(1,Math.min(2,window.devicePixelRatio||1)),n=Math.max(1,Math.round(e)),h=Math.max(1,Math.round(i)),r=document.createElement("canvas");r.width=Math.max(1,Math.round(n*a)),r.height=Math.max(1,Math.round(h*a));const s=r.getContext("2d");if(!s)return null;const c=await l(this,o,nt).call(this,t);return c?(s.scale(a,a),s.fillStyle=l(this,o,j).call(this),s.fillRect(0,0,n,h),s.drawImage(c,0,0,n,h),r):null};nt=function(t){return new Promise(e=>{const i=new Image;i.crossOrigin="anonymous",i.onload=()=>e(i),i.onerror=()=>e(null),i.src=t})};rt=function(t,e,i){return new Promise(a=>{t.toBlob(n=>a(n),e,i)})};j=function(){const t=this.shadowRoot?.querySelector(".viz-container"),e=getComputedStyle(t??this).backgroundColor;return e&&e!=="rgba(0, 0, 0, 0)"?e:"#ffffff"};B=function(t,e){const i=URL.createObjectURL(t),a=document.createElement("a");a.href=i,a.download=e,document.body.appendChild(a),a.click(),a.remove(),setTimeout(()=>URL.revokeObjectURL(i),0)};H=function(){const t=l(this,o,C).call(this,this.spacing),e=l(this,o,C).call(this,this.spacingTop)??t,i=l(this,o,C).call(this,this.spacingBottom)??t,a=l(this,o,C).call(this,this.spacingLeft),n=l(this,o,C).call(this,this.spacingRight);e?this.style.setProperty("--scb-viz-spacing-block-start",e):this.style.removeProperty("--scb-viz-spacing-block-start"),i?this.style.setProperty("--scb-viz-spacing-block-end",i):this.style.removeProperty("--scb-viz-spacing-block-end"),a?this.style.setProperty("--scb-viz-spacing-inline-start",a):this.style.removeProperty("--scb-viz-spacing-inline-start"),n?this.style.setProperty("--scb-viz-spacing-inline-end",n):this.style.removeProperty("--scb-viz-spacing-inline-end")};C=function(t){if(!t)return;const e=String(t).trim();if(e)return/^\d+$/.test(e)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(e,10)))})`:e};V=function(){const t=this.containerMaxWidth?.trim();t?this.style.setProperty("--scb-viz-container-max-width",t):this.style.removeProperty("--scb-viz-container-max-width")};m.styles=ct`
487
+ </html>`};it=async function(t){const e=document.createElement("iframe");e.setAttribute("aria-hidden","true"),e.style.position="fixed",e.style.right="0",e.style.bottom="0",e.style.width="0",e.style.height="0",e.style.border="0",e.style.visibility="hidden",document.body.appendChild(e);const i=()=>{e.remove()},s=e.contentDocument,a=e.contentWindow;if(!s||!a){i();return}s.open(),s.write(t),s.close();const o=Array.from(s.images||[]);await Promise.all(o.map(n=>n.complete?Promise.resolve():new Promise(h=>{n.addEventListener("load",()=>h(null),{once:!0}),n.addEventListener("error",()=>h(null),{once:!0})})));const r=()=>{a.removeEventListener("afterprint",r),i()};a.addEventListener("afterprint",r,{once:!0}),setTimeout(()=>{a.focus(),a.print(),setTimeout(i,1e3)},50)};st=async function(){const t=this._getCurrentPrintableView();let e="";if(t==="table"){const i=this._getResolvedTableData();if(!i?.rows?.length)return;e=c(this,l,X).call(this,i)}else if(t==="image"){const i=this.shadowRoot?.querySelector(".image-content img"),s=i?.currentSrc||i?.src||this.imageHref;if(!s)return;e=`<img class="viz-image" src="${c(this,l,_).call(this,s)}" alt="${c(this,l,_).call(this,this._getImageAltText())}">`}else{const i=this._getExportableVisualElement();if(!i)return;const s=await c(this,l,rt).call(this,i,"png");if(!s)return;e=`<img class="viz-chart-image" src="${s}" alt="${c(this,l,_).call(this,this._getImageAltText())}">`}await c(this,l,it).call(this,c(this,l,et).call(this,e))};at=function(){const t=this._getResolvedTableData();if(!t?.rows?.length)return;const e=this.lang==="en"?",":";",i=[];t.headers?.length&&i.push(t.headers.map(r=>this._normalizeRenderableCell(r).text)),t.rows.forEach(r=>{i.push(r.map(n=>this._normalizeRenderableCell(n).text))});const s=r=>`"${String(r??"").replace(/\r?\n/g," ").replace(/"/g,'""')}"`,a=`\uFEFF${i.map(r=>r.map(s).join(e)).join(`\r
488
+ `)}`,o=new Blob([a],{type:"text/csv;charset=utf-8;"});c(this,l,G).call(this,o,this._buildExportFileName("csv"))};nt=async function(t,e){const i=await c(this,l,O).call(this,t);return i?c(this,l,ct).call(this,i,e==="jpeg"?"image/jpeg":"image/png",e==="jpeg"?.92:void 0):null};rt=async function(t,e){const i=await c(this,l,O).call(this,t);return i?i.toDataURL(e==="jpeg"?"image/jpeg":"image/png",e==="jpeg"?.92:void 0):null};O=async function(t){if(t instanceof HTMLCanvasElement){const r=t.width||Math.round(t.getBoundingClientRect().width),n=t.height||Math.round(t.getBoundingClientRect().height);if(!r||!n)return null;const h=document.createElement("canvas");h.width=r,h.height=n;const d=h.getContext("2d");return d?(d.fillStyle=c(this,l,B).call(this),d.fillRect(0,0,r,n),d.drawImage(t,0,0,r,n),h):null}if(t instanceof HTMLImageElement){const r=t.naturalWidth||t.width,n=t.naturalHeight||t.height;return!r||!n?null:c(this,l,H).call(this,t.currentSrc||t.src,r,n)}const{width:e,height:i,serialized:s}=c(this,l,ot).call(this,t);if(!e||!i||!s)return null;const a=new Blob([s],{type:"image/svg+xml;charset=utf-8"}),o=URL.createObjectURL(a);try{return await c(this,l,H).call(this,o,e,i)}finally{URL.revokeObjectURL(o)}};ot=function(t){const e=t.cloneNode(!0),i=t.getBoundingClientRect(),s=t.viewBox?.baseVal,a=Math.round(s?.width||i.width||Number(t.getAttribute("width"))||0),o=Math.round(s?.height||i.height||Number(t.getAttribute("height"))||0);return e.setAttribute("xmlns","http://www.w3.org/2000/svg"),e.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),!e.getAttribute("width")&&a&&e.setAttribute("width",String(a)),!e.getAttribute("height")&&o&&e.setAttribute("height",String(o)),!e.getAttribute("viewBox")&&a&&o&&e.setAttribute("viewBox",`0 0 ${a} ${o}`),c(this,l,R).call(this,t,e),e.querySelectorAll(".highcharts-tooltip, .highcharts-contextmenu, .highcharts-a11y-proxy-container, .highcharts-a11y-dummy-point").forEach(r=>r.remove()),{width:a,height:o,serialized:new XMLSerializer().serializeToString(e)}};R=function(t,e){const i=getComputedStyle(t);let s="";for(let r=0;r<i.length;r+=1){const n=i[r],h=i.getPropertyValue(n);h&&(s+=`${n}:${h};`)}s&&e.setAttribute("style",s);const a=Array.from(t.children),o=Array.from(e.children);for(let r=0;r<a.length;r+=1){const n=a[r],h=o[r];n&&h&&c(this,l,R).call(this,n,h)}};H=async function(t,e,i){const s=Math.max(1,Math.min(2,window.devicePixelRatio||1)),a=Math.max(1,Math.round(e)),o=Math.max(1,Math.round(i)),r=document.createElement("canvas");r.width=Math.max(1,Math.round(a*s)),r.height=Math.max(1,Math.round(o*s));const n=r.getContext("2d");if(!n)return null;const h=await c(this,l,lt).call(this,t);return h?(n.scale(s,s),n.fillStyle=c(this,l,B).call(this),n.fillRect(0,0,a,o),n.drawImage(h,0,0,a,o),r):null};lt=function(t){return new Promise(e=>{const i=new Image;i.crossOrigin="anonymous",i.onload=()=>e(i),i.onerror=()=>e(null),i.src=t})};ct=function(t,e,i){return new Promise(s=>{t.toBlob(a=>s(a),e,i)})};B=function(){const t=this.shadowRoot?.querySelector(".viz-container"),e=getComputedStyle(t??this).backgroundColor;return e&&e!=="rgba(0, 0, 0, 0)"?e:"#ffffff"};G=function(t,e){const i=URL.createObjectURL(t),s=document.createElement("a");s.href=i,s.download=e,document.body.appendChild(s),s.click(),s.remove(),setTimeout(()=>URL.revokeObjectURL(i),0)};V=function(){const t=c(this,l,C).call(this,this.spacing),e=c(this,l,C).call(this,this.spacingTop)??t,i=c(this,l,C).call(this,this.spacingBottom)??t,s=c(this,l,C).call(this,this.spacingLeft),a=c(this,l,C).call(this,this.spacingRight);e?this.style.setProperty("--scb-viz-spacing-block-start",e):this.style.removeProperty("--scb-viz-spacing-block-start"),i?this.style.setProperty("--scb-viz-spacing-block-end",i):this.style.removeProperty("--scb-viz-spacing-block-end"),s?this.style.setProperty("--scb-viz-spacing-inline-start",s):this.style.removeProperty("--scb-viz-spacing-inline-start"),a?this.style.setProperty("--scb-viz-spacing-inline-end",a):this.style.removeProperty("--scb-viz-spacing-inline-end")};C=function(t){if(!t)return;const e=String(t).trim();if(e)return/^\d+$/.test(e)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(e,10)))})`:e};P=function(){const t=this.containerMaxWidth?.trim();t?this.style.setProperty("--scb-viz-container-max-width",t):this.style.removeProperty("--scb-viz-container-max-width")};u.styles=pt`
489
489
  :host {
490
490
  display: block;
491
491
  box-sizing: border-box;
@@ -877,8 +877,7 @@ import{a as ct,n as y,r as P,i as ht,x as p,k as N,l as dt,t as gt}from"../../ve
877
877
  }
878
878
 
879
879
  .standard-content-shell--stable {
880
- height: var(--scb-viz-standard-content-height, var(--scb-viz-diagram-min-height, 420px));
881
- overflow: hidden;
880
+ min-height: var(--scb-viz-standard-content-height, var(--scb-viz-diagram-min-height, 420px));
882
881
  }
883
882
 
884
883
  .standard-content-panel {
@@ -904,29 +903,19 @@ import{a as ct,n as y,r as P,i as ht,x as p,k as N,l as dt,t as gt}from"../../ve
904
903
  min-width: 0;
905
904
  }
906
905
 
907
- .standard-content-shell--stable .standard-content-panel--active {
908
- height: 100%;
906
+ .standard-content-shell--stable .standard-content-panel--table.standard-content-panel--active {
907
+ height: var(--scb-viz-standard-content-height, var(--scb-viz-diagram-min-height, 420px));
909
908
  min-height: 0;
909
+ overflow: hidden;
910
910
  }
911
911
 
912
- .standard-content-shell--stable .standard-diagram-scroller,
913
- .standard-content-shell--stable .standard-table-scroller {
912
+ .standard-content-shell--stable .standard-content-panel--table.standard-content-panel--active .standard-table-scroller {
914
913
  flex: 1 1 auto;
915
914
  min-height: 0;
916
915
  height: 100%;
917
916
  }
918
917
 
919
- .standard-content-shell--stable .diagram-content {
920
- min-height: 0;
921
- height: 100%;
922
- }
923
-
924
- .standard-content-shell--stable ::slotted([slot='diagram']) {
925
- min-height: 0;
926
- height: 100%;
927
- }
928
-
929
- .standard-content-shell--stable .table-panel-scroll {
918
+ .standard-content-shell--stable .standard-content-panel--table.standard-content-panel--active .table-panel-scroll {
930
919
  flex: 1 1 auto;
931
920
  min-height: 0;
932
921
  overflow: auto;
@@ -1127,4 +1116,4 @@ import{a as ct,n as y,r as P,i as ht,x as p,k as N,l as dt,t as gt}from"../../ve
1127
1116
  width: calc(100% / var(--scb-viz-print-scale, 1));
1128
1117
  }
1129
1118
  }
1130
- `;b([y({type:String,reflect:!0})],m.prototype,"variant",2);b([y({type:String,reflect:!0,attribute:"selected-chip"})],m.prototype,"selectedChip",2);b([y({type:String,reflect:!0})],m.prototype,"title",2);b([y({type:String,reflect:!0})],m.prototype,"subtitle",2);b([y({type:String,reflect:!0})],m.prototype,"description",2);b([y({type:String,reflect:!0})],m.prototype,"comment",2);b([y({type:String,reflect:!0})],m.prototype,"source",2);b([y({type:String,reflect:!0})],m.prototype,"footnote",2);b([y({type:String,reflect:!0,attribute:"lang"})],m.prototype,"lang",2);b([y({type:String,reflect:!0,attribute:"image-href"})],m.prototype,"imageHref",2);b([y({type:Boolean,reflect:!0,attribute:"official-statistics"})],m.prototype,"officialStatistics",2);b([y({type:Boolean,reflect:!0,attribute:"disable-toggle"})],m.prototype,"disableToggle",2);b([y({type:String,attribute:"content-max-width"})],m.prototype,"contentMaxWidth",2);b([y({type:String,attribute:"container-max-width"})],m.prototype,"containerMaxWidth",2);b([y({type:String,attribute:"content-height"})],m.prototype,"contentHeight",2);b([y({type:String,reflect:!0,attribute:"toggle-height-mode"})],m.prototype,"toggleHeightMode",2);b([y({attribute:!1})],m.prototype,"tableData",2);b([P()],m.prototype,"_slottedTableData",2);b([P()],m.prototype,"_actionsMenuOpen",2);b([P()],m.prototype,"_seriesDifferentiationEnabled",2);b([y({type:String,reflect:!0})],m.prototype,"spacing",2);b([y({type:String,attribute:"spacing-top",reflect:!0})],m.prototype,"spacingTop",2);b([y({type:String,attribute:"spacing-bottom",reflect:!0})],m.prototype,"spacingBottom",2);b([y({type:String,attribute:"spacing-left",reflect:!0})],m.prototype,"spacingLeft",2);b([y({type:String,attribute:"spacing-right",reflect:!0})],m.prototype,"spacingRight",2);m=b([gt("scb-viz")],m);
1119
+ `;m([y({type:String,reflect:!0})],u.prototype,"variant",2);m([y({type:String,reflect:!0,attribute:"selected-chip"})],u.prototype,"selectedChip",2);m([y({type:String,reflect:!0})],u.prototype,"title",2);m([y({type:String,reflect:!0})],u.prototype,"subtitle",2);m([y({type:String,reflect:!0})],u.prototype,"description",2);m([y({type:String,reflect:!0})],u.prototype,"comment",2);m([y({type:String,reflect:!0})],u.prototype,"source",2);m([y({type:String,reflect:!0})],u.prototype,"footnote",2);m([y({type:String,reflect:!0,attribute:"lang"})],u.prototype,"lang",2);m([y({type:String,reflect:!0,attribute:"image-href"})],u.prototype,"imageHref",2);m([y({type:Boolean,reflect:!0,attribute:"official-statistics"})],u.prototype,"officialStatistics",2);m([y({type:Boolean,reflect:!0,attribute:"disable-toggle"})],u.prototype,"disableToggle",2);m([y({type:String,attribute:"content-max-width"})],u.prototype,"contentMaxWidth",2);m([y({type:String,attribute:"container-max-width"})],u.prototype,"containerMaxWidth",2);m([y({type:String,attribute:"content-height"})],u.prototype,"contentHeight",2);m([y({type:String,reflect:!0,attribute:"toggle-height-mode"})],u.prototype,"toggleHeightMode",2);m([y({attribute:!1})],u.prototype,"tableData",2);m([y({attribute:!1})],u.prototype,"valueFormat",2);m([y({attribute:!1})],u.prototype,"timeFormat",2);m([y({attribute:!1})],u.prototype,"yAxisSettings",2);m([F()],u.prototype,"_slottedTableData",2);m([F()],u.prototype,"_actionsMenuOpen",2);m([F()],u.prototype,"_seriesDifferentiationEnabled",2);m([y({type:String,reflect:!0})],u.prototype,"spacing",2);m([y({type:String,attribute:"spacing-top",reflect:!0})],u.prototype,"spacingTop",2);m([y({type:String,attribute:"spacing-bottom",reflect:!0})],u.prototype,"spacingBottom",2);m([y({type:String,attribute:"spacing-left",reflect:!0})],u.prototype,"spacingLeft",2);m([y({type:String,attribute:"spacing-right",reflect:!0})],u.prototype,"spacingRight",2);u=m([ut("scb-viz")],u);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scb-wc-test",
3
- "version": "0.1.296",
3
+ "version": "0.1.298",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
@@ -386,5 +386,5 @@
386
386
  },
387
387
  "./mvc/*": "./mvc/*"
388
388
  },
389
- "buildHash": "A0EDE71FB433C114B5B53032DEDCDA6EA553DF442F1CC6A2D5B121B8D5636596"
389
+ "buildHash": "F6481C61D3EA233E29209E396E22084CDDAB8E3FA826B5DEF6C74AD32AD3AF16"
390
390
  }
@@ -10,6 +10,21 @@ export interface ScbVizTableData {
10
10
  rows: ScbVizRenderableTableCell[][];
11
11
  rowHeaderRows?: boolean[];
12
12
  }
13
+ export interface ScbVizValueFormat {
14
+ type?: string;
15
+ scale?: string;
16
+ decimals?: number;
17
+ }
18
+ export interface ScbVizTimeFormat {
19
+ mode?: string;
20
+ display?: string;
21
+ }
22
+ export interface ScbVizYAxisSettings {
23
+ startAtZero?: boolean;
24
+ referenceLineEnabled?: boolean;
25
+ referenceLineValue?: number | string | null;
26
+ referenceLineLabel?: string;
27
+ }
13
28
  export declare class ScbViz extends LitElement {
14
29
  #private;
15
30
  variant: 'Standard' | 'Table' | 'Image';
@@ -29,12 +44,16 @@ export declare class ScbViz extends LitElement {
29
44
  contentHeight: string;
30
45
  toggleHeightMode: 'auto' | 'stable';
31
46
  tableData: ScbVizTableData | undefined;
47
+ valueFormat: ScbVizValueFormat | undefined;
48
+ timeFormat: ScbVizTimeFormat | undefined;
49
+ yAxisSettings: ScbVizYAxisSettings | undefined;
32
50
  private _slottedTableData;
33
51
  private _actionsMenuOpen;
34
52
  private _seriesDifferentiationEnabled;
35
53
  private _diagramResizeObserver?;
36
54
  private _seriesDifferentiationSnapshots;
37
55
  private _diagramReflowFrame;
56
+ private _chartConfigSyncFrame;
38
57
  /** Vertikalt avstånd ovanför/under komponenten. 0–14 mappar till spacing-tokens, annars CSS-värde. */
39
58
  spacing: undefined;
40
59
  /** Överkantens avstånd. Om satt går före spacing. 0–14 mappar till spacing-tokens, annars CSS-värde. */
@@ -79,6 +98,19 @@ export declare class ScbViz extends LitElement {
79
98
  private _getDiagramAssignedElements;
80
99
  private _findExportableVisualElement;
81
100
  private _getExportableVisualElement;
101
+ private _getDefaultValueFormat;
102
+ private _normalizeValueFormat;
103
+ private _normalizeTimeFormat;
104
+ private _normalizeYAxisSettings;
105
+ private _getShortMonthNames;
106
+ private _getLongMonthNames;
107
+ private _formatCategoryTimeLabel;
108
+ private _formatLocalizedNumber;
109
+ private _formatValueForDisplay;
110
+ private _isCategoryAxis;
111
+ private _applyTimeFormatToLiveChart;
112
+ private _applyValueFormatToLiveChart;
113
+ private _applyYAxisSettingsToLiveChart;
82
114
  private _getCurrentHighchartsChart;
83
115
  private _getSeriesDifferentiationGroup;
84
116
  private _shouldShowSeriesDifferentiationAction;