scb-wc 0.1.89 → 0.1.91
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +41 -22
- package/all.js +0 -5
- package/fonts/material-symbols-outlined/files/material-symbols-outlined-subset.woff2 +0 -0
- package/index.js +88 -93
- package/mvc/components/all.js +0 -5
- package/mvc/components/scb-accordion/scb-accordion-item.js +1 -1
- package/mvc/components/scb-button/scb-button.js +3 -3
- package/mvc/components/scb-calendar/scb-calendar.js +1 -1
- package/mvc/components/scb-calendar-card/scb-calendar-card.js +4 -4
- package/mvc/components/scb-card/scb-card.js +5 -5
- package/mvc/components/scb-dropdown/scb-dropdown.js +1 -1
- package/mvc/components/scb-header/scb-header.js +2 -2
- package/mvc/components/scb-horizontal-scroller/scb-horizontal-scroller.js +6 -6
- package/mvc/components/scb-icon-button/scb-icon-button.js +5 -5
- package/mvc/components/scb-keyfigure-card/scb-keyfigure-card.js +6 -6
- package/mvc/components/scb-list/scb-list-item.js +2 -2
- package/mvc/components/scb-menu/scb-menu-item.js +1 -1
- package/mvc/components/scb-nav/scb-nav.js +7 -7
- package/mvc/components/scb-options-menu/scb-options-menu-item.js +1 -1
- package/mvc/components/scb-progress-stepper/scb-progress-step.js +2 -2
- package/mvc/components/scb-search/scb-search.js +1 -1
- package/mvc/components/scb-segmented-button/scb-segmented-item.js +1 -1
- package/mvc/components/scb-select/scb-select-option.js +1 -1
- package/mvc/components/scb-select/scb-select.js +1 -1
- package/mvc/components/scb-stepper/scb-step.js +1 -1
- package/mvc/components/scb-textfield/scb-textfield.js +141 -24
- package/mvc/components/scb-toc/scb-toc-item.js +1 -1
- package/mvc/fonts/material-symbols-outlined/files/material-symbols-outlined-subset.woff2 +0 -0
- package/mvc/vendor/lazy-focus-ring.js +2 -0
- package/mvc/vendor/lazy-ripple.js +2 -0
- package/mvc/{components/scb-chevron → vendor}/scb-chevron.js +1 -1
- package/mvc/vendor/scb-icon-svg.js +11 -0
- package/package.json +2 -2
- package/scb-chevron/scb-chevron.js +0 -1
- package/scb-components/scb-nav/scb-nav.d.ts +2 -0
- package/scb-datepicker/scb-datepicker.js +0 -1
- package/scb-nav/scb-nav.js +7 -3
- package/scb-wc-public-entry/index.d.ts +97 -0
- package/scb-wc.bundle.js +264 -264
- package/scb-wc.d.ts +194 -204
- package/mvc/components/scb-datepicker/scb-datepicker.js +0 -118
- package/mvc/components/shared/lazy-focus-ring.js +0 -2
- package/mvc/components/shared/lazy-ripple.js +0 -2
- package/mvc/components/shared/scb-icon-svg.js +0 -11
- package/scb-components/index.d.ts +0 -102
- package/scb-components/scb-chevron/scb-chevron.d.ts +0 -11
- package/scb-components/scb-datepicker/scb-datepicker.d.ts +0 -41
- package/scb-components/shared/lazy-focus-ring.d.ts +0 -4
- package/scb-components/shared/lazy-ripple.d.ts +0 -9
- package/scb-components/shared/scb-icon-svg.d.ts +0 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["
|
|
2
|
-
import{h as T,m as C,p as a,v as c,y as P}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as H}from"../../vendor/preload-helper.js";import{t as i}from"../../vendor/decorate.js";(function(){try{var
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../../vendor/lazy-focus-ring.js","../../vendor/rolldown-runtime.js","../../vendor/preload-helper.js","../../vendor/lazy-ripple.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{h as T,m as C,p as a,v as c,y as P}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as H}from"../../vendor/preload-helper.js";import{t as i}from"../../vendor/decorate.js";(function(){try{var l=typeof globalThis<"u"?globalThis:window;if(!l.__scb_ce_guard_installed__){l.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(r,d,n){try{customElements.get(r)||e(r,d,n)}catch(o){var s=String(o||"");if(s.indexOf("already been used")===-1&&s.indexOf("NotSupportedError")===-1)throw o}}}}catch{}})();var h,L=new Intl.DateTimeFormat("sv-SE",{month:"short"}),p={fromAttribute:l=>l??"",toAttribute:l=>typeof l!="string"||l.trim()===""?null:l},g,m;function I(){return g??(g=H(()=>import("../../vendor/lazy-focus-ring.js").then(l=>l.i),__vite__mapDeps([0,1,2]),import.meta.url)),g}function S(){return m??(m=H(()=>import("../../vendor/lazy-ripple.js"),__vite__mapDeps([3,2]),import.meta.url)),m}var t=(h=class extends T{constructor(...e){super(...e),this.variant="default",this.size="medium",this.date=null,this.direction="horizontal",this.title="",this.calendarCardTitle="",this.subtitle="",this.supportingText="",this.cardHref="",this.cardHrefNav="",this.showMedia=null,this.mediaWidth="",this.mediaHeight="",this.mediaAspect="",this.width="",this.maxWidth="",this.minWidth="",this.height="",this.maxHeight="",this.minHeight="",this.sizing="",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.__focusRingRequested=!1,this.__focusRingLoaded=!1,this.__rippleRequested=!1,this.__rippleLoaded=!1,this.__pendingRippleClick=!1,this.__onPointerInteraction=r=>{this.__ensureRipple(r)},this.__ensureFocusRingOnFocusVisible=()=>{this.__focusRingLoaded||this.__focusRingRequested||(this.__focusRingRequested=!0,I().then(({ensureFocusRingReady:r})=>r()).then(()=>{this.__focusRingLoaded=!0,this.requestUpdate()}))}}__hasSlottedContent(e){return!!this.querySelector(`[slot="${e}"]`)}__getSlottedText(e){return this.querySelector(`[slot="${e}"]`)?.textContent?.trim()??""}get __resolvedTitle(){return this.__getSlottedText("heading")||this.calendarCardTitle||this.title}get __resolvedSubtitle(){return this.__getSlottedText("subtitle")||this.subtitle}get __resolvedLabel(){return this.__resolvedTitle||this.__resolvedSubtitle||"Kalenderkort"}firstUpdated(){this.__applyInnerSizing(),this.__applySpacing()}__ensureRipple(e){if(this.cardHref){if(e&&(this.__pendingRippleEvent=e),this.__rippleLoaded){this.__syncRipple();return}this.__rippleRequested||(this.__rippleRequested=!0,S().then(({ensureRippleReady:r})=>r()).then(()=>{this.__rippleLoaded=!0,this.requestUpdate(),this.updateComplete.then(()=>this.__syncRipple())}))}}async __syncRipple(){const e=this.renderRoot.querySelector("md-ripple"),r=this.renderRoot.querySelector(".calendar-card"),d=this.__pendingRippleEvent,n=this.__pendingRippleClick;this.__pendingRippleEvent=void 0,this.__pendingRippleClick=!1;const{syncRippleToControl:s}=await S();await s(e,r,d,n)}render(){const e=this.variant?`${this.variant.toLowerCase()}`:"",r=this.direction?`${this.direction.toLowerCase()}`:"",d=this.cardHref?"clickable":"",n=this.__hasSlottedContent("heading"),s=this.__hasSlottedContent("subtitle"),o=this.__hasSlottedContent("supporting-text"),b=this.calendarCardTitle||this.title,u=this.subtitle,v=this.supportingText,f=n||!!b,y=s||!!u,R=o||!!v,{day:x,month:_}=this.__getDateParts(),z=this.mediaWidth&&this.mediaWidth.trim()!==""?this.mediaWidth:"",w=this.mediaHeight&&this.mediaHeight.trim()!==""?this.mediaHeight:"",k=this.mediaAspect&&this.mediaAspect.trim()!==""?this.mediaAspect:"",$=`${z?`inline-size:${z};`:""}${w?`block-size:${w};`:""}${k?`aspect-ratio:${k};`:""}`;return c`
|
|
3
3
|
<div
|
|
4
|
-
class="calendar-card ${r} ${
|
|
4
|
+
class="calendar-card ${r} ${d} ${e}"
|
|
5
5
|
role="${this.cardHref?"link":"group"}"
|
|
6
6
|
aria-label="${this.__resolvedLabel}"
|
|
7
7
|
tabindex="${this.cardHref?"0":"-1"}"
|
|
@@ -38,4 +38,4 @@ import{h as T,m as C,p as a,v as c,y as P}from"../../vendor/vendor.js";import"..
|
|
|
38
38
|
</div>
|
|
39
39
|
</div>
|
|
40
40
|
${this.cardHref&&this.__focusRingLoaded?c`<md-focus-ring></md-focus-ring>`:""}
|
|
41
|
-
`}__getDateParts(){const e={day:1,month:"Jan"};if(!this.date)return e;const r=this.date instanceof Date?this.date:(()=>{const s=new Date(String(this.date));return Number.isNaN(s.getTime())?null:s})();if(!r)return e;const l=r.getDate(),n=L.format(r).replace(".","").trim();return{day:l,month:n.charAt(0).toUpperCase()+n.slice(1)}}__applyInnerSizing(){const e=this.renderRoot.querySelector(".calendar-card");e&&(this.width&&this.width.trim()!==""?(e.style.inlineSize="100%",e.style.maxInlineSize="100%"):(e.style.removeProperty("inline-size"),e.style.removeProperty("max-inline-size")),this.height&&this.height.trim()!==""||this.sizing==="stretch"?e.style.blockSize="100%":e.style.removeProperty("block-size"),this.maxHeight&&this.maxHeight.trim()!==""?e.style.maxBlockSize="100%":e.style.removeProperty("max-block-size"))}_onKeyDown(e){(e.key==="Enter"||e.key===" ")&&this.cardHref&&(window.open(this.cardHref,"_self"),e.preventDefault())}_handleHrefNavigation(){this.cardHref&&((!this.__rippleLoaded||this.__pendingRippleEvent)&&(this.__pendingRippleClick=!0,this.__ensureRipple()),this.cardHrefNav==="tab"?window.open(this.cardHref,"_blank"):this.cardHrefNav==="window"?window.open(this.cardHref,"_blank","noopener,noreferrer,width=800,height=600"):window.open(this.cardHref,"_self"))}mapSpacingToken(e){if(!e)return;const r=String(e).trim();if(r)return/^\d+$/.test(r)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(r,10)))})`:r}__applySpacing(){const e=this.mapSpacingToken(this.spacing),r=this.mapSpacingToken(this.spacingTop)??e,l=this.mapSpacingToken(this.spacingBottom)??e,n=this.mapSpacingToken(this.spacingLeft),s=this.mapSpacingToken(this.spacingRight);r?this.style.setProperty("--scb-calendar-card-spacing-block-start",r):this.style.removeProperty("--scb-calendar-card-spacing-block-start"),l?this.style.setProperty("--scb-calendar-card-spacing-block-end",l):this.style.removeProperty("--scb-calendar-card-spacing-block-end"),n?this.style.setProperty("--scb-calendar-card-spacing-inline-start",n):this.style.removeProperty("--scb-calendar-card-spacing-inline-start"),s?this.style.setProperty("--scb-calendar-card-spacing-inline-end",s):this.style.removeProperty("--scb-calendar-card-spacing-inline-end")}updated(e){e.has("width")&&(this.width?this.style.inlineSize=this.width:this.style.removeProperty("inline-size")),e.has("maxWidth")&&(this.maxWidth?this.style.maxInlineSize=this.maxWidth:this.style.removeProperty("max-inline-size")),e.has("minWidth")&&(this.minWidth?this.style.minInlineSize=this.minWidth:this.style.removeProperty("min-inline-size")),e.has("height")&&(this.height?this.style.blockSize=this.height:this.style.removeProperty("block-size")),e.has("maxHeight")&&(this.maxHeight?this.style.maxBlockSize=this.maxHeight:this.style.removeProperty("max-block-size")),e.has("minHeight")&&(this.minHeight?this.style.minBlockSize=this.minHeight:this.style.removeProperty("min-block-size")),(e.has("width")||e.has("height")||e.has("maxHeight")||e.has("sizing"))&&this.__applyInnerSizing(),(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom")||e.has("spacingLeft")||e.has("spacingRight"))&&this.__applySpacing()}},h.styles=P`:host{display:block;position:relative;box-sizing:border-box;inline-size:100%;min-inline-size:0;padding:var(--scb-calendar-card-focus-ring-gap, 4px);margin-block-start:var(--scb-calendar-card-spacing-block-start, 0);margin-block-end:var(--scb-calendar-card-spacing-block-end, 0);margin-inline-start:var(--scb-calendar-card-spacing-inline-start, 0);margin-inline-end:var(--scb-calendar-card-spacing-inline-end, 0);--scb-calendar-card-padding:var(--spacing-spacing-7, 24px);--scb-calendar-card-gap:var(--spacing-spacing-4, 12px);--scb-calendar-card-horizontal-gap:var(--spacing-spacing-6, 20px);--scb-calendar-card-horizontal-min-block-size:112px;--scb-calendar-card-media-size:var(--spacing-spacing-11, 64px);--scb-calendar-card-media-gap:var(--spacing-spacing-2, 4px);--scb-calendar-card-day-size:var(--scale-07, 28px);--scb-calendar-card-day-letter-spacing:-0.6px;--scb-calendar-card-month-size:var(--scale-02, 14px);--scb-calendar-card-content-gap:var(--spacing-spacing-4, 12px);--scb-calendar-card-header-gap:var(--spacing-spacing-2, 4px);--scb-calendar-card-title-min-block-size:32px;--scb-calendar-card-icon-size:20px;--scb-calendar-card-title-font-size:var(--md-sys-typescale-headline-small-size, 24px);--scb-calendar-card-title-line-height:var(--md-sys-typescale-headline-small-line-height2, 30px);--scb-calendar-card-title-letter-spacing:var(--md-sys-typescale-headline-small-tracking, -0.6px);--scb-calendar-card-subtitle-font-size:var(--md-sys-typescale-title-medium-size, 18px);--scb-calendar-card-subtitle-line-height:var(--md-sys-typescale-title-medium-line-height, 26px);--scb-calendar-card-subtitle-letter-spacing:var(--md-sys-typescale-title-medium-tracking, -0.3px);--scb-calendar-card-supporting-font-size:var(--md-sys-typescale-body-medium-size, 16px);--scb-calendar-card-supporting-line-height:var(--md-sys-typescale-body-medium-line-height, 24px);--scb-calendar-card-supporting-letter-spacing:var(--md-sys-typescale-body-medium-tracking, -0.15px)}:host([size='medium']),:host([size='small']){--scb-calendar-card-gap:var(--spacing-spacing-3, 8px);--scb-calendar-card-month-size:var(--scale-01, 12px);--scb-calendar-card-header-gap:var(--spacing-spacing-1, 2px)}:host([size='medium']){--scb-calendar-card-padding:var(--spacing-spacing-6, 20px);--scb-calendar-card-horizontal-gap:var(--spacing-spacing-5, 16px);--scb-calendar-card-horizontal-min-block-size:96px;--scb-calendar-card-media-size:var(--spacing-spacing-10, 56px);--scb-calendar-card-day-size:var(--scale-06, 24px);--scb-calendar-card-day-letter-spacing:-0.4px;--scb-calendar-card-content-gap:var(--spacing-spacing-3, 8px);--scb-calendar-card-title-min-block-size:28px;--scb-calendar-card-title-font-size:var(--md-sys-typescale-title-medium-size, 18px);--scb-calendar-card-title-line-height:var(--md-sys-typescale-title-medium-line-height, 26px);--scb-calendar-card-title-letter-spacing:var(--md-sys-typescale-title-medium-tracking, -0.3px);--scb-calendar-card-subtitle-font-size:var(--md-sys-typescale-title-small-size, 16px);--scb-calendar-card-subtitle-line-height:var(--md-sys-typescale-title-small-line-height, 24px);--scb-calendar-card-subtitle-letter-spacing:var(--md-sys-typescale-title-small-tracking, -0.2px);--scb-calendar-card-supporting-font-size:var(--md-sys-typescale-body-medium-size, 16px);--scb-calendar-card-supporting-line-height:var(--md-sys-typescale-body-medium-line-height, 24px);--scb-calendar-card-supporting-letter-spacing:var(--md-sys-typescale-body-medium-tracking, -0.15px)}:host([size='small']){--scb-calendar-card-padding:var(--spacing-spacing-5, 16px);--scb-calendar-card-horizontal-gap:var(--spacing-spacing-4, 12px);--scb-calendar-card-horizontal-min-block-size:84px;--scb-calendar-card-media-size:var(--spacing-spacing-9, 48px);--scb-calendar-card-day-size:var(--scale-05, 20px);--scb-calendar-card-day-letter-spacing:-0.3px;--scb-calendar-card-content-gap:var(--spacing-spacing-2, 4px);--scb-calendar-card-title-min-block-size:24px;--scb-calendar-card-icon-size:18px;--scb-calendar-card-title-font-size:var(--md-sys-typescale-title-small-size, 16px);--scb-calendar-card-title-line-height:var(--md-sys-typescale-title-small-line-height, 24px);--scb-calendar-card-title-letter-spacing:var(--md-sys-typescale-title-small-tracking, -0.2px);--scb-calendar-card-subtitle-font-size:var(--md-sys-typescale-body-medium-size, 16px);--scb-calendar-card-subtitle-line-height:var(--md-sys-typescale-body-medium-line-height, 24px);--scb-calendar-card-subtitle-letter-spacing:var(--md-sys-typescale-body-medium-tracking, -0.15px);--scb-calendar-card-supporting-font-size:var(--md-sys-typescale-body-small-size, 14px);--scb-calendar-card-supporting-line-height:var(--md-sys-typescale-body-small-line-height, 20px);--scb-calendar-card-supporting-letter-spacing:var(--md-sys-typescale-body-small-tracking, -0.1px)}:host([sizing='stretch']){inline-size:100%;block-size:100%;max-inline-size:none}:host([sizing='content-width']){display:inline-block;inline-size:auto;block-size:auto}:host([sizing='content-width']) .calendar-card{inline-size:max-content}:host([sizing='content-height']){inline-size:100%;block-size:auto;max-inline-size:none}md-focus-ring{position:absolute;inset:0;pointer-events:none;display:none;border-radius:var(--scb-calendar-card-focus-ring-radius, var(--radius-large, 16px))}.calendar-card:focus-visible+md-focus-ring{display:block}.calendar-card{box-sizing:border-box;overflow:hidden;position:relative;display:flex;color:var(--md-sys-color-on-surface, #0f0865);font-family:var(--brand-font, var(--brand, "Inter"), sans-serif);font-style:normal;flex-direction:column;align-items:flex-start;gap:var(--scb-calendar-card-gap);align-self:stretch;transition:box-shadow .18s ease,transform .18s ease,background-color .18s ease,border-color .18s ease;inline-size:100%;max-inline-size:100%}.calendar-card.clickable{cursor:pointer}.calendar-card,.calendar-card .subtitle,.calendar-card .supporting-text,.calendar-card .title{font-variant-numeric:proportional-nums;font-feature-settings:"tnum"0,"pnum"1}.calendar-card:focus,.calendar-card:focus-visible{outline:0}.calendar-card.horizontal{flex-direction:row;align-items:flex-start;max-width:none;width:100%;gap:var(--scb-calendar-card-horizontal-gap);min-block-size:var(--scb-calendar-card-horizontal-min-block-size)}.calendar-card.outlined{border-radius:var(--radius-large, 16px);border:1px solid var(--md-sys-color-outline-variant, #ccc);background:var(--md-sys-color-surface, #fff);padding:var(--scb-calendar-card-padding)}.calendar-card.filled,.media{background:var(--md-sys-color-surface-dim, #f9f8ef)}.calendar-card.filled{border-radius:var(--radius-large, 16px);padding:var(--scb-calendar-card-padding)}.calendar-card.filled .media{background:var(--md-sys-color-surface, #fff)}md-ripple{border-radius:var(--radius-l, 16px)}.media{width:var(--scb-calendar-card-media-size);min-width:var(--scb-calendar-card-media-size);max-width:var(--scb-calendar-card-media-size);height:var(--scb-calendar-card-media-size);padding:var(--spacing-spacing-0, 0)0;justify-content:center;align-items:center;gap:var(--scb-calendar-card-media-gap);border-radius:var(--md-sys-shape-corner-small)}.calendar-card.horizontal .media{align-self:flex-start}.media .day{font-size:var(--scb-calendar-card-day-size);font-weight:var(--weight-bold, 700);line-height:100%;letter-spacing:var(--scb-calendar-card-day-letter-spacing);font-variant-numeric:tabular-nums}.media .month{font-size:var(--scb-calendar-card-month-size);font-weight:var(--weight-regular, 400);line-height:100%}.container,.header-container,.media{display:flex;flex-direction:column}.container{flex:1 1 auto;min-width:0;gap:var(--scb-calendar-card-content-gap);width:100%;align-self:flex-start}.header-container{gap:var(--scb-calendar-card-header-gap)}.title-container{width:100%;flex:0 0 auto;display:flex;align-items:center;gap:var(--spacing-spacing-3, 8px);color:inherit;text-decoration:none;min-block-size:var(--scb-calendar-card-title-min-block-size)}.title{font-family:var(--brand-font, var(--brand, "Inter"), sans-serif);font-size:var(--scb-calendar-card-title-font-size);font-weight:var(--weight-bold, 700);line-height:var(--scb-calendar-card-title-line-height);letter-spacing:var(--scb-calendar-card-title-letter-spacing);flex:1 1 auto;min-inline-size:0;white-space:normal;word-break:normal;overflow-wrap:break-word;hyphens:auto;overflow:visible;text-overflow:clip}.title-container .calendar-card-icon{inline-size:var(--scb-calendar-card-icon-size);block-size:var(--scb-calendar-card-icon-size);flex:0 0 auto}.calendar-card-icon,.icon-container{align-items:center;justify-content:center}.icon-container{display:flex;width:var(--spacing-spacing-7, 24px);height:var(--spacing-spacing-7, 24px)}.calendar-card-icon{display:inline-flex;overflow:hidden;font-family:"Material Symbols Outlined";font-size:var(--icon-size-medium, 24px);line-height:1;white-space:nowrap;text-transform:none;word-wrap:normal;direction:ltr;font-variation-settings:normal;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.calendar-card-icon.scb-svg-icon{fill:currentColor;font:inherit}.subtitle,.supporting-text{font-family:var(--brand-font, var(--brand, "Inter"), sans-serif);white-space:normal;word-break:normal;overflow-wrap:break-word;hyphens:manual;overflow:visible;text-overflow:clip}.subtitle{font-size:var(--scb-calendar-card-subtitle-font-size);font-weight:var(--weight-semibold, 600);line-height:var(--scb-calendar-card-subtitle-line-height);letter-spacing:var(--scb-calendar-card-subtitle-letter-spacing)}.supporting-text{font-size:var(--scb-calendar-card-supporting-font-size);font-weight:var(--weight-regular, 400);line-height:var(--scb-calendar-card-supporting-line-height);letter-spacing:var(--scb-calendar-card-supporting-letter-spacing)}.subtitle ::slotted(*),.supporting-text ::slotted(*),.title ::slotted(*){margin:0;color:inherit;font:inherit;letter-spacing:inherit}.supporting-text ::slotted(scb-link){--scb-link-font-size:var(--scb-calendar-card-supporting-font-size);--scb-link-line-height:var(--scb-calendar-card-supporting-line-height);--scb-link-letter-spacing:var(--scb-calendar-card-supporting-letter-spacing)}`,h);i([a({type:String,reflect:!0})],t.prototype,"variant",void 0);i([a({type:String,reflect:!0})],t.prototype,"size",void 0);i([a({type:String,attribute:"date"})],t.prototype,"date",void 0);i([a({type:String,reflect:!0})],t.prototype,"direction",void 0);i([a({type:String,reflect:!0,converter:p})],t.prototype,"title",void 0);i([a({type:String,attribute:"calendar-card-title",reflect:!0,converter:p})],t.prototype,"calendarCardTitle",void 0);i([a({type:String,reflect:!0,converter:p})],t.prototype,"subtitle",void 0);i([a({type:String,attribute:"supporting-text",reflect:!0,converter:p})],t.prototype,"supportingText",void 0);i([a({type:String,attribute:"card-href"})],t.prototype,"cardHref",void 0);i([a({type:String,attribute:"card-href-nav"})],t.prototype,"cardHrefNav",void 0);i([a({type:Boolean,reflect:!0,attribute:"show-media"})],t.prototype,"showMedia",void 0);i([a({type:String,attribute:"media-width"})],t.prototype,"mediaWidth",void 0);i([a({type:String,attribute:"media-height"})],t.prototype,"mediaHeight",void 0);i([a({type:String,attribute:"media-aspect"})],t.prototype,"mediaAspect",void 0);i([a({type:String,reflect:!0})],t.prototype,"width",void 0);i([a({type:String,reflect:!0,attribute:"max-width"})],t.prototype,"maxWidth",void 0);i([a({type:String,attribute:"min-width"})],t.prototype,"minWidth",void 0);i([a({type:String,reflect:!0})],t.prototype,"height",void 0);i([a({type:String,reflect:!0,attribute:"max-height"})],t.prototype,"maxHeight",void 0);i([a({type:String,attribute:"min-height"})],t.prototype,"minHeight",void 0);i([a({type:String,reflect:!0,converter:p})],t.prototype,"sizing",void 0);i([a({type:String,reflect:!0})],t.prototype,"spacing",void 0);i([a({type:String,attribute:"spacing-top",reflect:!0})],t.prototype,"spacingTop",void 0);i([a({type:String,attribute:"spacing-bottom",reflect:!0})],t.prototype,"spacingBottom",void 0);i([a({type:String,attribute:"spacing-left",reflect:!0})],t.prototype,"spacingLeft",void 0);i([a({type:String,attribute:"spacing-right",reflect:!0})],t.prototype,"spacingRight",void 0);t=i([C("scb-calendar-card")],t);
|
|
41
|
+
`}__getDateParts(){const e={day:1,month:"Jan"};if(!this.date)return e;const r=this.date instanceof Date?this.date:(()=>{const s=new Date(String(this.date));return Number.isNaN(s.getTime())?null:s})();if(!r)return e;const d=r.getDate(),n=L.format(r).replace(".","").trim();return{day:d,month:n.charAt(0).toUpperCase()+n.slice(1)}}__applyInnerSizing(){const e=this.renderRoot.querySelector(".calendar-card");e&&(this.width&&this.width.trim()!==""?(e.style.inlineSize="100%",e.style.maxInlineSize="100%"):(e.style.removeProperty("inline-size"),e.style.removeProperty("max-inline-size")),this.height&&this.height.trim()!==""||this.sizing==="stretch"?e.style.blockSize="100%":e.style.removeProperty("block-size"),this.maxHeight&&this.maxHeight.trim()!==""?e.style.maxBlockSize="100%":e.style.removeProperty("max-block-size"))}_onKeyDown(e){(e.key==="Enter"||e.key===" ")&&this.cardHref&&(window.open(this.cardHref,"_self"),e.preventDefault())}_handleHrefNavigation(){this.cardHref&&((!this.__rippleLoaded||this.__pendingRippleEvent)&&(this.__pendingRippleClick=!0,this.__ensureRipple()),this.cardHrefNav==="tab"?window.open(this.cardHref,"_blank"):this.cardHrefNav==="window"?window.open(this.cardHref,"_blank","noopener,noreferrer,width=800,height=600"):window.open(this.cardHref,"_self"))}mapSpacingToken(e){if(!e)return;const r=String(e).trim();if(r)return/^\d+$/.test(r)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(r,10)))})`:r}__applySpacing(){const e=this.mapSpacingToken(this.spacing),r=this.mapSpacingToken(this.spacingTop)??e,d=this.mapSpacingToken(this.spacingBottom)??e,n=this.mapSpacingToken(this.spacingLeft),s=this.mapSpacingToken(this.spacingRight);r?this.style.setProperty("--scb-calendar-card-spacing-block-start",r):this.style.removeProperty("--scb-calendar-card-spacing-block-start"),d?this.style.setProperty("--scb-calendar-card-spacing-block-end",d):this.style.removeProperty("--scb-calendar-card-spacing-block-end"),n?this.style.setProperty("--scb-calendar-card-spacing-inline-start",n):this.style.removeProperty("--scb-calendar-card-spacing-inline-start"),s?this.style.setProperty("--scb-calendar-card-spacing-inline-end",s):this.style.removeProperty("--scb-calendar-card-spacing-inline-end")}updated(e){e.has("width")&&(this.width?this.style.inlineSize=this.width:this.style.removeProperty("inline-size")),e.has("maxWidth")&&(this.maxWidth?this.style.maxInlineSize=this.maxWidth:this.style.removeProperty("max-inline-size")),e.has("minWidth")&&(this.minWidth?this.style.minInlineSize=this.minWidth:this.style.removeProperty("min-inline-size")),e.has("height")&&(this.height?this.style.blockSize=this.height:this.style.removeProperty("block-size")),e.has("maxHeight")&&(this.maxHeight?this.style.maxBlockSize=this.maxHeight:this.style.removeProperty("max-block-size")),e.has("minHeight")&&(this.minHeight?this.style.minBlockSize=this.minHeight:this.style.removeProperty("min-block-size")),(e.has("width")||e.has("height")||e.has("maxHeight")||e.has("sizing"))&&this.__applyInnerSizing(),(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom")||e.has("spacingLeft")||e.has("spacingRight"))&&this.__applySpacing()}},h.styles=P`:host{display:block;position:relative;box-sizing:border-box;inline-size:100%;min-inline-size:0;padding:var(--scb-calendar-card-focus-ring-gap, 4px);margin-block-start:var(--scb-calendar-card-spacing-block-start, 0);margin-block-end:var(--scb-calendar-card-spacing-block-end, 0);margin-inline-start:var(--scb-calendar-card-spacing-inline-start, 0);margin-inline-end:var(--scb-calendar-card-spacing-inline-end, 0);--scb-calendar-card-padding:var(--spacing-spacing-7, 24px);--scb-calendar-card-gap:var(--spacing-spacing-4, 12px);--scb-calendar-card-horizontal-gap:var(--spacing-spacing-6, 20px);--scb-calendar-card-horizontal-min-block-size:112px;--scb-calendar-card-media-size:var(--spacing-spacing-11, 64px);--scb-calendar-card-media-gap:var(--spacing-spacing-2, 4px);--scb-calendar-card-day-size:var(--scale-07, 28px);--scb-calendar-card-day-letter-spacing:-0.6px;--scb-calendar-card-month-size:var(--scale-02, 14px);--scb-calendar-card-content-gap:var(--spacing-spacing-4, 12px);--scb-calendar-card-header-gap:var(--spacing-spacing-2, 4px);--scb-calendar-card-title-min-block-size:32px;--scb-calendar-card-icon-size:20px;--scb-calendar-card-title-font-size:var(--md-sys-typescale-headline-small-size, 24px);--scb-calendar-card-title-line-height:var(--md-sys-typescale-headline-small-line-height2, 30px);--scb-calendar-card-title-letter-spacing:var(--md-sys-typescale-headline-small-tracking, -0.6px);--scb-calendar-card-subtitle-font-size:var(--md-sys-typescale-title-medium-size, 18px);--scb-calendar-card-subtitle-line-height:var(--md-sys-typescale-title-medium-line-height, 26px);--scb-calendar-card-subtitle-letter-spacing:var(--md-sys-typescale-title-medium-tracking, -0.3px);--scb-calendar-card-supporting-font-size:var(--md-sys-typescale-body-medium-size, 16px);--scb-calendar-card-supporting-line-height:var(--md-sys-typescale-body-medium-line-height, 24px);--scb-calendar-card-supporting-letter-spacing:var(--md-sys-typescale-body-medium-tracking, -0.15px)}:host([size='medium']),:host([size='small']){--scb-calendar-card-gap:var(--spacing-spacing-3, 8px);--scb-calendar-card-month-size:var(--scale-01, 12px);--scb-calendar-card-header-gap:var(--spacing-spacing-1, 2px)}:host([size='medium']){--scb-calendar-card-padding:var(--spacing-spacing-6, 20px);--scb-calendar-card-horizontal-gap:var(--spacing-spacing-5, 16px);--scb-calendar-card-horizontal-min-block-size:96px;--scb-calendar-card-media-size:var(--spacing-spacing-10, 56px);--scb-calendar-card-day-size:var(--scale-06, 24px);--scb-calendar-card-day-letter-spacing:-0.4px;--scb-calendar-card-content-gap:var(--spacing-spacing-3, 8px);--scb-calendar-card-title-min-block-size:28px;--scb-calendar-card-title-font-size:var(--md-sys-typescale-title-medium-size, 18px);--scb-calendar-card-title-line-height:var(--md-sys-typescale-title-medium-line-height, 26px);--scb-calendar-card-title-letter-spacing:var(--md-sys-typescale-title-medium-tracking, -0.3px);--scb-calendar-card-subtitle-font-size:var(--md-sys-typescale-title-small-size, 16px);--scb-calendar-card-subtitle-line-height:var(--md-sys-typescale-title-small-line-height, 24px);--scb-calendar-card-subtitle-letter-spacing:var(--md-sys-typescale-title-small-tracking, -0.2px);--scb-calendar-card-supporting-font-size:var(--md-sys-typescale-body-medium-size, 16px);--scb-calendar-card-supporting-line-height:var(--md-sys-typescale-body-medium-line-height, 24px);--scb-calendar-card-supporting-letter-spacing:var(--md-sys-typescale-body-medium-tracking, -0.15px)}:host([size='small']){--scb-calendar-card-padding:var(--spacing-spacing-5, 16px);--scb-calendar-card-horizontal-gap:var(--spacing-spacing-4, 12px);--scb-calendar-card-horizontal-min-block-size:84px;--scb-calendar-card-media-size:var(--spacing-spacing-9, 48px);--scb-calendar-card-day-size:var(--scale-05, 20px);--scb-calendar-card-day-letter-spacing:-0.3px;--scb-calendar-card-content-gap:var(--spacing-spacing-2, 4px);--scb-calendar-card-title-min-block-size:24px;--scb-calendar-card-icon-size:18px;--scb-calendar-card-title-font-size:var(--md-sys-typescale-title-small-size, 16px);--scb-calendar-card-title-line-height:var(--md-sys-typescale-title-small-line-height, 24px);--scb-calendar-card-title-letter-spacing:var(--md-sys-typescale-title-small-tracking, -0.2px);--scb-calendar-card-subtitle-font-size:var(--md-sys-typescale-body-medium-size, 16px);--scb-calendar-card-subtitle-line-height:var(--md-sys-typescale-body-medium-line-height, 24px);--scb-calendar-card-subtitle-letter-spacing:var(--md-sys-typescale-body-medium-tracking, -0.15px);--scb-calendar-card-supporting-font-size:var(--md-sys-typescale-body-small-size, 14px);--scb-calendar-card-supporting-line-height:var(--md-sys-typescale-body-small-line-height, 20px);--scb-calendar-card-supporting-letter-spacing:var(--md-sys-typescale-body-small-tracking, -0.1px)}:host([sizing='stretch']){inline-size:100%;block-size:100%;max-inline-size:none}:host([sizing='content-width']){display:inline-block;inline-size:auto;block-size:auto}:host([sizing='content-width']) .calendar-card{inline-size:max-content}:host([sizing='content-height']){inline-size:100%;block-size:auto;max-inline-size:none}md-focus-ring{position:absolute;inset:0;pointer-events:none;display:none;border-radius:var(--scb-calendar-card-focus-ring-radius, var(--radius-large, 16px))}.calendar-card:focus-visible+md-focus-ring{display:block}.calendar-card{box-sizing:border-box;overflow:hidden;position:relative;display:flex;color:var(--md-sys-color-on-surface, #0f0865);font-family:var(--brand-font, var(--brand, "Inter"), sans-serif);font-style:normal;flex-direction:column;align-items:flex-start;gap:var(--scb-calendar-card-gap);align-self:stretch;transition:box-shadow .18s ease,transform .18s ease,background-color .18s ease,border-color .18s ease;inline-size:100%;max-inline-size:100%}.calendar-card.clickable{cursor:pointer}.calendar-card,.calendar-card .subtitle,.calendar-card .supporting-text,.calendar-card .title{font-variant-numeric:proportional-nums;font-feature-settings:"tnum"0,"pnum"1}.calendar-card:focus,.calendar-card:focus-visible{outline:0}.calendar-card.horizontal{flex-direction:row;align-items:flex-start;max-width:none;width:100%;gap:var(--scb-calendar-card-horizontal-gap);min-block-size:var(--scb-calendar-card-horizontal-min-block-size)}.calendar-card.outlined{border-radius:var(--radius-large, 16px);border:1px solid var(--md-sys-color-outline-variant, #ccc);background:var(--md-sys-color-surface, #fff);padding:var(--scb-calendar-card-padding)}.calendar-card.filled,.media{background:var(--md-sys-color-surface-dim, #f9f8ef)}.calendar-card.filled{border-radius:var(--radius-large, 16px);padding:var(--scb-calendar-card-padding)}.calendar-card.filled .media{background:var(--md-sys-color-surface, #fff)}md-ripple{border-radius:var(--radius-l, 16px)}.media{width:var(--scb-calendar-card-media-size);min-width:var(--scb-calendar-card-media-size);max-width:var(--scb-calendar-card-media-size);height:var(--scb-calendar-card-media-size);padding:var(--spacing-spacing-0, 0)0;justify-content:center;align-items:center;gap:var(--scb-calendar-card-media-gap);border-radius:var(--md-sys-shape-corner-small)}.calendar-card.horizontal .media{align-self:flex-start}.media .day{font-size:var(--scb-calendar-card-day-size);font-weight:var(--weight-bold, 700);line-height:100%;letter-spacing:var(--scb-calendar-card-day-letter-spacing);font-variant-numeric:tabular-nums}.media .month{font-size:var(--scb-calendar-card-month-size);font-weight:var(--weight-regular, 400);line-height:100%}.container,.header-container,.media{display:flex;flex-direction:column}.container{flex:1 1 auto;min-width:0;gap:var(--scb-calendar-card-content-gap);width:100%;align-self:flex-start}.header-container{gap:var(--scb-calendar-card-header-gap)}.title-container{width:100%;flex:0 0 auto;display:flex;align-items:center;gap:var(--spacing-spacing-3, 8px);color:inherit;text-decoration:none;min-block-size:var(--scb-calendar-card-title-min-block-size)}.title{font-family:var(--brand-font, var(--brand, "Inter"), sans-serif);font-size:var(--scb-calendar-card-title-font-size);font-weight:var(--weight-bold, 700);line-height:var(--scb-calendar-card-title-line-height);letter-spacing:var(--scb-calendar-card-title-letter-spacing);flex:1 1 auto;min-inline-size:0;white-space:normal;word-break:normal;overflow-wrap:break-word;hyphens:auto;overflow:visible;text-overflow:clip}.title-container .calendar-card-icon{inline-size:var(--scb-calendar-card-icon-size);block-size:var(--scb-calendar-card-icon-size);flex:0 0 auto}.calendar-card-icon,.icon-container{align-items:center;justify-content:center}.icon-container{display:flex;width:var(--spacing-spacing-7, 24px);height:var(--spacing-spacing-7, 24px)}.calendar-card-icon{display:inline-flex;overflow:hidden;font-family:"Material Symbols Outlined";font-size:var(--icon-size-medium, 24px);line-height:1;white-space:nowrap;text-transform:none;word-wrap:normal;direction:ltr;font-variation-settings:normal;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.calendar-card-icon.scb-svg-icon{fill:currentColor;font:inherit}.subtitle,.supporting-text{font-family:var(--brand-font, var(--brand, "Inter"), sans-serif);white-space:normal;word-break:normal;overflow-wrap:break-word;hyphens:manual;overflow:visible;text-overflow:clip}.subtitle{font-size:var(--scb-calendar-card-subtitle-font-size);font-weight:var(--weight-semibold, 600);line-height:var(--scb-calendar-card-subtitle-line-height);letter-spacing:var(--scb-calendar-card-subtitle-letter-spacing)}.supporting-text{font-size:var(--scb-calendar-card-supporting-font-size);font-weight:var(--weight-regular, 400);line-height:var(--scb-calendar-card-supporting-line-height);letter-spacing:var(--scb-calendar-card-supporting-letter-spacing)}.subtitle ::slotted(*),.supporting-text ::slotted(*),.title ::slotted(*){margin:0;color:inherit;font:inherit;letter-spacing:inherit}.supporting-text ::slotted(scb-link){--scb-link-font-size:var(--scb-calendar-card-supporting-font-size);--scb-link-line-height:var(--scb-calendar-card-supporting-line-height);--scb-link-letter-spacing:var(--scb-calendar-card-supporting-letter-spacing)}`,h);i([a({type:String,reflect:!0})],t.prototype,"variant",void 0);i([a({type:String,reflect:!0})],t.prototype,"size",void 0);i([a({type:String,attribute:"date"})],t.prototype,"date",void 0);i([a({type:String,reflect:!0})],t.prototype,"direction",void 0);i([a({type:String,reflect:!0,converter:p})],t.prototype,"title",void 0);i([a({type:String,attribute:"calendar-card-title",reflect:!0,converter:p})],t.prototype,"calendarCardTitle",void 0);i([a({type:String,reflect:!0,converter:p})],t.prototype,"subtitle",void 0);i([a({type:String,attribute:"supporting-text",reflect:!0,converter:p})],t.prototype,"supportingText",void 0);i([a({type:String,attribute:"card-href"})],t.prototype,"cardHref",void 0);i([a({type:String,attribute:"card-href-nav"})],t.prototype,"cardHrefNav",void 0);i([a({type:Boolean,reflect:!0,attribute:"show-media"})],t.prototype,"showMedia",void 0);i([a({type:String,attribute:"media-width"})],t.prototype,"mediaWidth",void 0);i([a({type:String,attribute:"media-height"})],t.prototype,"mediaHeight",void 0);i([a({type:String,attribute:"media-aspect"})],t.prototype,"mediaAspect",void 0);i([a({type:String,reflect:!0})],t.prototype,"width",void 0);i([a({type:String,reflect:!0,attribute:"max-width"})],t.prototype,"maxWidth",void 0);i([a({type:String,attribute:"min-width"})],t.prototype,"minWidth",void 0);i([a({type:String,reflect:!0})],t.prototype,"height",void 0);i([a({type:String,reflect:!0,attribute:"max-height"})],t.prototype,"maxHeight",void 0);i([a({type:String,attribute:"min-height"})],t.prototype,"minHeight",void 0);i([a({type:String,reflect:!0,converter:p})],t.prototype,"sizing",void 0);i([a({type:String,reflect:!0})],t.prototype,"spacing",void 0);i([a({type:String,attribute:"spacing-top",reflect:!0})],t.prototype,"spacingTop",void 0);i([a({type:String,attribute:"spacing-bottom",reflect:!0})],t.prototype,"spacingBottom",void 0);i([a({type:String,attribute:"spacing-left",reflect:!0})],t.prototype,"spacingLeft",void 0);i([a({type:String,attribute:"spacing-right",reflect:!0})],t.prototype,"spacingRight",void 0);t=i([C("scb-calendar-card")],t);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["
|
|
2
|
-
import{g as d,h as gt,m as v,p as r,v as l,y as bt}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as g}from"../../vendor/preload-helper.js";import{t as s}from"../../vendor/decorate.js";(function(){try{var
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../../vendor/lazy-focus-ring.js","../../vendor/rolldown-runtime.js","../../vendor/preload-helper.js","../../vendor/lazy-ripple.js","../scb-list/scb-list.js","../../vendor/decorate.js","../../vendor/vendor.js","../../vendor/vendor-lit.js","../scb-list/scb-list-item.js","../scb-icon-button/scb-icon-button.js","../../vendor/assertClassBrand.js","../scb-button/scb-button.js","../scb-link/scb-link.js","../../vendor/classPrivateFieldGet2.js","../scb-chip/scb-chip.js","../scb-avatar/scb-avatar.js","../scb-tooltip/scb-tooltip.js","../../vendor/icon.js","../../vendor/scb-card-variants.internal.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{g as d,h as gt,m as v,p as r,v as l,y as bt}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as g}from"../../vendor/preload-helper.js";import{t as s}from"../../vendor/decorate.js";(function(){try{var p=typeof globalThis<"u"?globalThis:window;if(!p.__scb_ce_guard_installed__){p.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(t,a,c){try{customElements.get(t)||e(t,a,c)}catch(h){var n=String(h||"");if(n.indexOf("already been used")===-1&&n.indexOf("NotSupportedError")===-1)throw h}}}}catch{}})();var C,ut=new Set(["social-comments-text","social-comments","social-comments-href","social-likes-text","social-likes","social-likes-hover-content","social-has-liked","social-likes-interactive","social-author","social-author-text","social-author-href"]),R,A,$,L,P,E,D,H,I,F;function vt(){return H??(H=g(()=>import("../../vendor/lazy-focus-ring.js").then(p=>p.i),__vite__mapDeps([0,1,2]),import.meta.url)),H}function W(){return I??(I=g(()=>import("../../vendor/lazy-ripple.js"),__vite__mapDeps([3,2]),import.meta.url)),I}function yt(){return R??(R=g(()=>import("../scb-list/scb-list.js"),__vite__mapDeps([4,5,6,7,8,2]),import.meta.url)),R}function ft(){return A??(A=g(()=>import("../scb-icon-button/scb-icon-button.js"),__vite__mapDeps([9,10,5,2,6,7]),import.meta.url)),A}function _t(){return $??($=g(()=>import("../scb-button/scb-button.js"),__vite__mapDeps([11,10,5,2,6,7]),import.meta.url)),$}function zt(){return L??(L=g(()=>import("../scb-link/scb-link.js"),__vite__mapDeps([12,10,13,5,2,6,7]),import.meta.url)),L}function xt(){return P??(P=g(()=>import("../scb-chip/scb-chip.js"),__vite__mapDeps([14,10,5,2,6,7]),import.meta.url)),P}function kt(){return E??(E=g(()=>import("../scb-avatar/scb-avatar.js"),__vite__mapDeps([15,10,5,2,6,7]),import.meta.url)),E}function St(){return D??(D=g(()=>import("../scb-tooltip/scb-tooltip.js"),__vite__mapDeps([16,5,2,6,17,1,7]),import.meta.url)),D}function Tt(){return F??(F=g(()=>import("../../vendor/scb-card-variants.internal.js"),__vite__mapDeps([18,6,7]),import.meta.url)),F}var o={fromAttribute:p=>p??"",toAttribute:p=>typeof p!="string"||p.trim()===""?null:p},i=(C=class extends gt{constructor(...e){super(...e),this.__dependencyKey="",this.__focusRingRequested=!1,this.__focusRingLoaded=!1,this.__rippleRequested=!1,this.__rippleLoaded=!1,this.__pendingRippleClick=!1,this.__isSyncingManagedSocialAttributes=!1,this.type="standard",this.variant="standard",this.direction="dynamic",this.size="large",this.mediaType="",this.mediaHref="",this.mediaAlt="",this.mediaSrcset="",this.mediaSizes="",this.mediaLoading="auto",this.mediaDecoding="async",this.mediaFetchPriority="auto",this.mediaFit="cover",this.mediaPosition="center",this.mediaWidth="",this.mediaHeight="",this.mediaAspect="",this.mediaPlaceholder=!1,this.cardHref="",this.href="",this.title="",this.cardTitle="",this.subtitle="",this.vignette="",this.vignetteVariant="filled",this.vignetteSpacing=void 0,this.vignetteSpacingTop=void 0,this.vignetteSpacingBottom=void 0,this.vignetteSpacingLeft=void 0,this.vignetteSpacingRight=void 0,this.supportingText="",this.commentsText="",this.commentsDisabled=!1,this.commentsHref="",this.likesText="",this.likesDisabled=!1,this.likesHoverContent="",this.hasLiked=!1,this.likesInteractive=!0,this.author=!1,this.authorText="",this.authorHref="",this.replyEnabled=!1,this.editEnabled=!1,this.deleteEnabled=!1,this.width="",this.maxWidth="",this.height="",this.maxHeight="",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.innerPadding=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.__onImgLoad=t=>{const a=t.currentTarget.closest(".media");a&&a.classList.add("is-loaded")},this.__ensureRippleOnInteraction=(t,a=!1)=>{if(this.__primaryHref()){if(t&&(this.__pendingRippleEvent=t),a&&(this.__pendingRippleClick=!0),this.__rippleLoaded){this.__syncRipple();return}this.__rippleRequested||(this.__rippleRequested=!0,W().then(({ensureRippleReady:c})=>c()).then(()=>{this.__rippleLoaded=!0,this.requestUpdate(),this.updateComplete.then(()=>this.__syncRipple())}))}},this.__syncRipple=async()=>{const t=this.renderRoot.querySelector("md-ripple"),a=this.renderRoot.querySelector(".scb-card"),c=this.__pendingRippleEvent,n=this.__pendingRippleClick;this.__pendingRippleEvent=void 0,this.__pendingRippleClick=!1;const{syncRippleToControl:h}=await W();await h(t,a,c,n)},this.__ensureFocusRingOnFocusVisible=()=>{this.__focusRingLoaded||this.__focusRingRequested||(this.__focusRingRequested=!0,vt().then(({ensureFocusRingReady:t})=>t()).then(()=>{this.__focusRingLoaded=!0,this.requestUpdate()}))},this.__onKeyDown=t=>{const a=this.__primaryHref();(t.key==="Enter"||t.key===" ")&&a&&(t.preventDefault(),this.__ensureRippleOnInteraction(void 0,!0),this.__navigate(a,t))},this.__handleHrefNavigation=t=>{const a=this.__primaryHref();a&&(t.target.closest("a")||this.__navigate(a,t))},this.__handleSlottedCardLinkClick=t=>{const a=t.composedPath().find(c=>c instanceof HTMLAnchorElement&&c.getAttribute("slot")==="card-link")?.getAttribute("href")||this.__primaryHref();a&&(this.__dispatchCardNavigate(a,t)||t.preventDefault())}}attributeChangedCallback(e,t,a){this.__isSyncingManagedSocialAttributes&&ut.has(e)||super.attributeChangedCallback(e,t,a)}get likeButton(){return this.cardType!=="social"?null:this.renderRoot.querySelector(".likes scb-icon-button")}__calcAspectWH(e){const t=(e||"").trim();if(!t)return{w:600,h:400};const a=t.includes("/")?t.split("/"):t.includes(":")?t.split(":"):t.includes("x")?t.split("x"):null;if(a&&a.length===2){const n=Number(a[0]),h=Number(a[1]);if(n>0&&h>0)return{w:n,h}}const c=Number(t);return isFinite(c)&&c>0?{w:1e3,h:Math.round(1e3/c)}:{w:600,h:400}}__mediaReserveAspect(e=""){const t=(this.mediaAspect||"").trim();if(t)return t;const a=Number(this.mediaWidth)||0,c=Number(this.mediaHeight)||0;return a>0&&c>0?`${a} / ${c}`:e}__mediaReserveStyle(e=""){const t=this.__mediaReserveAspect(e);return t?`--scb-card-media-aspect:${t};`:""}__slottedMediaAspect(){const e=this.querySelector('[slot="media"]');if(!e)return"";const t=Number(e.getAttribute("width"))||0,a=Number(e.getAttribute("height"))||0;return t>0&&a>0?`${t} / ${a}`:""}get __resolvedTitle(){return this.cardTitle||this.title}get cardType(){const e=(this.type||"standard").toLowerCase();switch(e){case"standard":case"list":case"social":case"link":case"action":case"container":return e;default:return"standard"}}__ensureVariantRenderer(){return this.cardType==="standard"||this.__variantRenderer?Promise.resolve():Tt().then(e=>{this.__variantRenderer!==e&&(this.__variantRenderer=e,e.ensureScbCardVariantStyles(this.renderRoot),this.requestUpdate())})}__dispatchCardNavigate(e,t){const a={href:e,originalEvent:t},c=new CustomEvent("card-navigate",{bubbles:!0,composed:!0,cancelable:!0,detail:a});if(this.dispatchEvent(c),c.defaultPrevented)return!1;const n=new CustomEvent("cardnavigate",{bubbles:!0,composed:!0,cancelable:!0,detail:a});return this.dispatchEvent(n),!n.defaultPrevented}__effectiveHref(){return this.cardHref||this.href}__slottedCardLink(){return this.querySelector(':scope > a[slot="card-link"]')}__primaryHref(){return this.__effectiveHref()||this.__slottedCardLink()?.getAttribute("href")||""}__navigate(e,t){e&&this.__dispatchCardNavigate(e,t)&&window.open(e,"_self")}__slotNames(){const e=new Set;for(const t of Array.from(this.children)){const a=t.getAttribute("slot");a&&e.add(a)}return e}__hasSlottedContent(e,t){return t?t.has(e):Array.from(this.children).some(a=>a.getAttribute("slot")===e)}__hasLightDomElement(e){return!!this.querySelector(e)}__ensureDependenciesReady(){const e=[],t=[],a=this.cardType,c=!!this.vignette?.trim(),n=(_,b)=>{t.push(_),e.push(b())};(a==="list"||this.__hasLightDomElement("scb-list, scb-list-item"))&&n("list",yt),a!=="standard"&&n("card-variants",()=>this.__ensureVariantRenderer()),(a==="social"&&(!this.likesDisabled&&this.likesInteractive||!this.commentsDisabled&&this.commentsHref||this.replyEnabled||this.editEnabled||this.deleteEnabled)||this.__hasLightDomElement("scb-icon-button"))&&n("icon-button",ft),this.__hasLightDomElement("scb-button")&&n("button",_t),this.__hasLightDomElement("scb-link")&&n("link",zt),(c||this.__hasLightDomElement("scb-chip"))&&n("chip",xt),((this.mediaType||"").toLowerCase()==="avatar"||this.__hasLightDomElement("scb-avatar"))&&n("avatar",kt),(a==="social"&&this.likesHoverContent||this.__hasLightDomElement("scb-tooltip"))&&n("tooltip",St);const h=t.sort().join("|");h!==this.__dependencyKey&&(this.__dependencyKey=h,e.length>0&&Promise.all(e).then(()=>this.requestUpdate()))}__mediaTemplate(e){if(this.__hasSlottedContent("media",e)){const t=this.__mediaReserveStyle(this.__slottedMediaAspect());return l`
|
|
3
3
|
<div class="media ${t?"has-reserved-space":""}" style=${t||d}>
|
|
4
4
|
<slot name="media"></slot>
|
|
5
5
|
</div>
|
|
@@ -9,7 +9,7 @@ import{g as d,h as gt,m as v,p as r,v as l,y as bt}from"../../vendor/vendor.js";
|
|
|
9
9
|
<scb-avatar variant="icon" label="${this.__resolvedTitle}" icon-name="person"></scb-avatar>
|
|
10
10
|
</slot>
|
|
11
11
|
</div>
|
|
12
|
-
`;if(this.mediaHref||this.mediaSrcset){let t=Number(this.mediaWidth)||0,a=Number(this.mediaHeight)||0;const c=(this.mediaAspect||"").trim();if(!t||!a){const
|
|
12
|
+
`;if(this.mediaHref||this.mediaSrcset){let t=Number(this.mediaWidth)||0,a=Number(this.mediaHeight)||0;const c=(this.mediaAspect||"").trim();if(!t||!a){const h=this.__calcAspectWH(c||"3/2");t||(t=h.w),a||(a=h.h)}const n=this.__mediaReserveStyle(`${t} / ${a}`);return l`
|
|
13
13
|
<div class="media has-reserved-space ${this.mediaPlaceholder?"has-ph":""}" style=${n}>
|
|
14
14
|
<slot name="media-sources"></slot>
|
|
15
15
|
<img
|
|
@@ -25,7 +25,7 @@ import{g as d,h as gt,m as v,p as r,v as l,y as bt}from"../../vendor/vendor.js";
|
|
|
25
25
|
@load=${this.__onImgLoad}
|
|
26
26
|
/>
|
|
27
27
|
</div>
|
|
28
|
-
`}return null}mapSpacingToken(e){if(!e)return;const t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}__applySpacing(){const e=this.mapSpacingToken(this.spacing),t=this.mapSpacingToken(this.spacingTop)??e,a=this.mapSpacingToken(this.spacingBottom)??e,c=this.mapSpacingToken(this.spacingLeft),n=this.mapSpacingToken(this.spacingRight);t?this.style.setProperty("--scb-card-spacing-block-start",t):this.style.removeProperty("--scb-card-spacing-block-start"),a?this.style.setProperty("--scb-card-spacing-block-end",a):this.style.removeProperty("--scb-card-spacing-block-end"),c?this.style.setProperty("--scb-card-spacing-inline-start",c):this.style.removeProperty("--scb-card-spacing-inline-start"),n?this.style.setProperty("--scb-card-spacing-inline-end",n):this.style.removeProperty("--scb-card-spacing-inline-end")}__applyPadding(){const e=this.mapSpacingToken(this.innerPadding),t=this.mapSpacingToken(this.paddingTop)??e,a=this.mapSpacingToken(this.paddingBottom)??e,c=this.mapSpacingToken(this.paddingLeft)??e,n=this.mapSpacingToken(this.paddingRight)??e;t?this.style.setProperty("--scb-card-content-padding-block-start",t):this.style.removeProperty("--scb-card-content-padding-block-start"),a?this.style.setProperty("--scb-card-content-padding-block-end",a):this.style.removeProperty("--scb-card-content-padding-block-end"),c?this.style.setProperty("--scb-card-content-padding-inline-start",c):this.style.removeProperty("--scb-card-content-padding-inline-start"),n?this.style.setProperty("--scb-card-content-padding-inline-end",n):this.style.removeProperty("--scb-card-content-padding-inline-end")}__syncStringAttribute(e,t){this.__isSyncingManagedSocialAttributes=!0;try{typeof t=="string"&&t.trim()!==""?this.setAttribute(e,t):this.removeAttribute(e)}finally{this.__isSyncingManagedSocialAttributes=!1}}__syncNumberAttribute(e,t){this.__isSyncingManagedSocialAttributes=!0;try{typeof t=="number"&&Number.isFinite(t)?this.setAttribute(e,String(t)):this.removeAttribute(e)}finally{this.__isSyncingManagedSocialAttributes=!1}}__syncBooleanAttribute(e,t){this.__isSyncingManagedSocialAttributes=!0;try{t?this.setAttribute(e,""):this.removeAttribute(e)}finally{this.__isSyncingManagedSocialAttributes=!1}}__syncSocialAttributes(){this.cardType==="social"&&(this.__syncStringAttribute("social-comments-text",this.commentsText),this.__syncNumberAttribute("social-comments",this.comments),this.__syncStringAttribute("social-comments-href",this.commentsHref),this.__syncStringAttribute("social-likes-text",this.likesText),this.__syncNumberAttribute("social-likes",this.likes),this.__syncStringAttribute("social-likes-hover-content",this.likesHoverContent),this.__syncBooleanAttribute("social-has-liked",this.hasLiked),this.__syncBooleanAttribute("social-likes-interactive",this.likesInteractive),this.__syncBooleanAttribute("social-author",this.author),this.__syncStringAttribute("social-author-text",this.authorText),this.__syncStringAttribute("social-author-href",this.authorHref))}render(){const e=this.__slotNames(),t=m=>this.__hasSlottedContent(m,e),a=this.cardType,c=this.variant?`${this.variant.toLowerCase()}`:"",n=(this.direction||"dynamic").toLowerCase(),
|
|
28
|
+
`}return null}mapSpacingToken(e){if(!e)return;const t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}__applySpacing(){const e=this.mapSpacingToken(this.spacing),t=this.mapSpacingToken(this.spacingTop)??e,a=this.mapSpacingToken(this.spacingBottom)??e,c=this.mapSpacingToken(this.spacingLeft),n=this.mapSpacingToken(this.spacingRight);t?this.style.setProperty("--scb-card-spacing-block-start",t):this.style.removeProperty("--scb-card-spacing-block-start"),a?this.style.setProperty("--scb-card-spacing-block-end",a):this.style.removeProperty("--scb-card-spacing-block-end"),c?this.style.setProperty("--scb-card-spacing-inline-start",c):this.style.removeProperty("--scb-card-spacing-inline-start"),n?this.style.setProperty("--scb-card-spacing-inline-end",n):this.style.removeProperty("--scb-card-spacing-inline-end")}__applyPadding(){const e=this.mapSpacingToken(this.innerPadding),t=this.mapSpacingToken(this.paddingTop)??e,a=this.mapSpacingToken(this.paddingBottom)??e,c=this.mapSpacingToken(this.paddingLeft)??e,n=this.mapSpacingToken(this.paddingRight)??e;t?this.style.setProperty("--scb-card-content-padding-block-start",t):this.style.removeProperty("--scb-card-content-padding-block-start"),a?this.style.setProperty("--scb-card-content-padding-block-end",a):this.style.removeProperty("--scb-card-content-padding-block-end"),c?this.style.setProperty("--scb-card-content-padding-inline-start",c):this.style.removeProperty("--scb-card-content-padding-inline-start"),n?this.style.setProperty("--scb-card-content-padding-inline-end",n):this.style.removeProperty("--scb-card-content-padding-inline-end")}__syncStringAttribute(e,t){this.__isSyncingManagedSocialAttributes=!0;try{typeof t=="string"&&t.trim()!==""?this.setAttribute(e,t):this.removeAttribute(e)}finally{this.__isSyncingManagedSocialAttributes=!1}}__syncNumberAttribute(e,t){this.__isSyncingManagedSocialAttributes=!0;try{typeof t=="number"&&Number.isFinite(t)?this.setAttribute(e,String(t)):this.removeAttribute(e)}finally{this.__isSyncingManagedSocialAttributes=!1}}__syncBooleanAttribute(e,t){this.__isSyncingManagedSocialAttributes=!0;try{t?this.setAttribute(e,""):this.removeAttribute(e)}finally{this.__isSyncingManagedSocialAttributes=!1}}__syncSocialAttributes(){this.cardType==="social"&&(this.__syncStringAttribute("social-comments-text",this.commentsText),this.__syncNumberAttribute("social-comments",this.comments),this.__syncStringAttribute("social-comments-href",this.commentsHref),this.__syncStringAttribute("social-likes-text",this.likesText),this.__syncNumberAttribute("social-likes",this.likes),this.__syncStringAttribute("social-likes-hover-content",this.likesHoverContent),this.__syncBooleanAttribute("social-has-liked",this.hasLiked),this.__syncBooleanAttribute("social-likes-interactive",this.likesInteractive),this.__syncBooleanAttribute("social-author",this.author),this.__syncStringAttribute("social-author-text",this.authorText),this.__syncStringAttribute("social-author-href",this.authorHref))}render(){const e=this.__slotNames(),t=m=>this.__hasSlottedContent(m,e),a=this.cardType,c=this.variant?`${this.variant.toLowerCase()}`:"",n=(this.direction||"dynamic").toLowerCase(),h=a!=="list"&&a!=="container"&&n!=="vertical"&&n!=="horizontal"?"dynamic-direction":"",_=a==="list"||a==="container"?"vertical":n==="horizontal"?"horizontal":"vertical",b=this.__effectiveHref(),f=t("card-link"),B=a==="standard"||a==="social",y=B&&!!b&&!f,u=B&&(!!b||f),J=y?"clickable":"",Q=f?"has-slotted-card-link":"",O=this.date instanceof Date?this.date.toISOString().slice(0,10):this.date||"",z=!!this.__resolvedTitle||t("heading"),x=!!this.subtitle||t("subtitle"),Y=!!this.supportingText||t("supporting-text"),V=!!O||t("date"),Z=t("footer"),N=(m=!1)=>z?l`
|
|
29
29
|
<div class="header">
|
|
30
30
|
<slot name="heading">
|
|
31
31
|
${m?l`<a class="title" href="${b}" tabindex="-1">${this.__resolvedTitle}</a>`:l`<span class="title">${this.__resolvedTitle}</span>`}
|
|
@@ -56,7 +56,7 @@ import{g as d,h as gt,m as v,p as r,v as l,y as bt}from"../../vendor/vendor.js";
|
|
|
56
56
|
</div>
|
|
57
57
|
`:d,lt=dt||z||x||Y||V,w=m=>l`
|
|
58
58
|
<div
|
|
59
|
-
class="scb-card ${c} ${_} ${
|
|
59
|
+
class="scb-card ${c} ${_} ${h} ${J} ${Q}"
|
|
60
60
|
@click=${y?this.__handleHrefNavigation:null}
|
|
61
61
|
@keydown=${y?this.__onKeyDown:null}
|
|
62
62
|
@focusin=${u?this.__ensureFocusRingOnFocusVisible:null}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{d as b,g as f,h as y,m as v,p as d,v as m,y as w}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/icon.js";import{
|
|
1
|
+
import{d as b,g as f,h as y,m as v,p as d,v as m,y as w}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/icon.js";import{n as _}from"../../vendor/lazy-focus-ring.js";import{t as a}from"../../vendor/decorate.js";import"../../vendor/scb-chevron.js";import"../scb-button/scb-button.js";import"../scb-options-menu/scb-options-menu.js";(function(){try{var h=typeof globalThis<"u"?globalThis:window;if(!h.__scb_ce_guard_installed__){h.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(e,i,s){try{customElements.get(e)||t(e,i,s)}catch(o){var n=String(o||"");if(n.indexOf("already been used")===-1&&n.indexOf("NotSupportedError")===-1)throw o}}}}catch{}})();var g,S=()=>{if(typeof window>"u"||typeof document>"u"||!("customElements"in window)||document.head.querySelector("style[data-scb-dropdown-pre-upgrade]"))return;const h=document.createElement("style");h.setAttribute("data-scb-dropdown-pre-upgrade",""),h.textContent=`
|
|
2
2
|
scb-dropdown:not(:defined) {
|
|
3
3
|
display: inline-block;
|
|
4
4
|
position: relative;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../../vendor/lazy-focus-ring.js","../../vendor/rolldown-runtime.js","../../vendor/preload-helper.js","../scb-drawer/scb-drawer.js","../../vendor/decorate.js","../../vendor/vendor.js","../../vendor/vendor-lit.js","../scb-divider/scb-divider.js","../../vendor/assertClassBrand.js","../scb-menu/scb-menu.js","../scb-menu/scb-menu-item.js","../../vendor/scb-chevron.js","../scb-menu/scb-menu-section.js","../scb-menu/scb-sub-menu.js","../scb-search/scb-search.js","../../vendor/icon.js","../../vendor/ripple.js","../../vendor/attachable-controller.js","../../vendor/scb-header-drawer.internal.js","../scb-button/scb-button.js","../scb-icon-button/scb-icon-button.js","../scb-skeleton/scb-skeleton.js","../scb-grid/scb-grid.js","../scb-grid/scb-grid-item.js","../scb-grid/scb-stack.js","../scb-dropdown/scb-dropdown.js","../scb-options-menu/scb-options-menu.js","../scb-options-menu/scb-options-menu-item.js","../scb-options-menu/scb-options-sub-menu.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
import{f as k,g as w,h as D,m as I,p as h,v as m,y as R}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as S}from"../../vendor/preload-helper.js";import{t as c}from"../../vendor/decorate.js";(function(){try{var b=typeof globalThis<"u"?globalThis:window;if(!b.__scb_ce_guard_installed__){b.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(t,r,s){try{customElements.get(t)||e(t,r,s)}catch(a){var i=String(a||"");if(i.indexOf("already been used")===-1&&i.indexOf("NotSupportedError")===-1)throw a}}}}catch{}})();var T,P,L=0,$=()=>{if(typeof window>"u"||typeof document>"u"||!("customElements"in window)||document.head.querySelector("style[data-scb-header-pre-upgrade]"))return;const b=document.createElement("style");b.setAttribute("data-scb-header-pre-upgrade",""),b.textContent=`
|
|
3
3
|
scb-header:not(:defined),
|
|
4
4
|
scb-header[data-upgrading] {
|
|
@@ -52,7 +52,7 @@ import{f as k,g as w,h as D,m as I,p as h,v as m,y as R}from"../../vendor/vendor
|
|
|
52
52
|
);
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
-
`,document.head.appendChild(b);const e=n=>{const u=String(n??"").trim();if(u)return/^\d+$/.test(u)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(u,10)))})`:u},t=n=>{const u=String(n??"").trim();if(!u)return!1;try{const p=JSON.parse(u);return Array.isArray(p)&&p.length>0}catch{return!1}},r=n=>n!=null&&!/^(false|0|off|no)$/i.test(n.trim()),s=n=>{for(const u of Array.from(n.children)){const p=u.tagName.toLowerCase();if(p==="scb-header-tab"||p==="scb-dropdown")return!0}return!1},i=n=>{s(n)||t(n.getAttribute("tabs"))||r(n.getAttribute("reserve-tabs"))||r(n.getAttribute("layout-pending"))?n.setAttribute("data-pre-has-tabs",""):n.removeAttribute("data-pre-has-tabs");const u=e(n.getAttribute("spacing")),p=e(n.getAttribute("spacing-top"))??u,f=e(n.getAttribute("spacing-bottom"))??u;p?n.style.setProperty("--scb-header-spacing-block-start",p):n.style.removeProperty("--scb-header-spacing-block-start"),f?n.style.setProperty("--scb-header-spacing-block-end",f):n.style.removeProperty("--scb-header-spacing-block-end");const y=(n.getAttribute("logo-width")??"").trim();y?n.style.setProperty("--scb-header-pre-logo-w",y):n.style.removeProperty("--scb-header-pre-logo-w");const _=(n.getAttribute("logo-height")??"").trim();_?n.style.setProperty("--scb-header-pre-logo-img-h",_):n.style.removeProperty("--scb-header-pre-logo-img-h");const l=(n.getAttribute("search-height")??"").trim();l?n.style.setProperty("--scb-header-pre-control-size",l):n.style.removeProperty("--scb-header-pre-control-size")};document.querySelectorAll("scb-header").forEach(i);const d=new MutationObserver(n=>{for(const u of n){if(u.type==="attributes"){const p=u.target;p instanceof HTMLElement&&p.tagName.toLowerCase()==="scb-header"&&i(p);continue}if(u.type==="childList"){const p=[...Array.from(u.addedNodes),...Array.from(u.removedNodes)];for(const f of p){if(!(f instanceof HTMLElement))continue;if(f.tagName.toLowerCase()==="scb-header"){i(f);continue}const y=f.closest?.("scb-header");y&&i(y)}}}});d.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabs","spacing","spacing-top","spacing-bottom","logo-width","logo-height","logo-aspect-ratio","logo-alt","logotype-text","search-height","reserve-tabs","layout-pending"]}),customElements.whenDefined("scb-header").then(()=>{d.disconnect()})};$();var M={fromAttribute:b=>b==null?!0:!/^(false|0|off|no)$/i.test(b),toAttribute:b=>String(!!b)},z={fromAttribute:b=>b==null?!1:!/^(false|0|off|no)$/i.test(b),toAttribute:b=>b?"":null},N={fromAttribute:b=>b==="small"||b==="large"?b:"medium",toAttribute:b=>{const e=String(b??"");return e==="small"||e==="large"?e:null}},o=(T=class extends D{constructor(){super(),this.maxWidth="1440px",this.size="medium",this.logoText="",this.logotypeText="",this.logoAlt="",this.logoHref="/",this.logoSrc="",this.logoWidth="",this.logoHeight="",this.logoAspectRatio="",this.logoInvertDm=!1,this.banner=!1,this.tabs=[],this.activeTab=null,this.reserveTabs=!1,this.layoutPending=!1,this.utilityItems=[],this.searchButtonLabel="Sök",this.menuButtonLabel="Meny",this.deferDrawer=!1,this.showDrawer=!0,this.alwaysShowMenuButton=!1,this.showSearch=!0,this.includeUtilityInMenu=!1,this.drawerOverlay=!0,this.searchText="",this._drawerId="main-drawer",this._menuExpanded=!1,this._searchId="header-search",this._drawerReady=!1,this._mobileSearchOpen=!1,this._initialUpgradeComplete=!1,this._slotNavItems=[],this._slotUtils=[],this._slotMenu=[],this._measureScheduled=!1,this._scheduleMeasure=()=>{this.layoutPending||this._measureScheduled||(this._measureScheduled=!0,requestAnimationFrame(()=>{this._measureScheduled=!1,this._measure()}))},this._onWindowResize=()=>{window.innerWidth>=this.BP_SM&&this._mobileSearchOpen&&this._setMobileSearchOpen(!1),this._scheduleMeasure()},this._onMenuSelect=t=>{const r=t.detail;this.dispatchEvent(new CustomEvent("scb-menu-select",{detail:r,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("scbmenuselect",{detail:r,bubbles:!0,composed:!0}));const s=r?.item,i=typeof r?.href=="string"?r.href:typeof r?.itemHref=="string"?r.itemHref:typeof r?.item_href=="string"?r.item_href:"",a=s?s.getAttribute("item-href")??s.getAttribute("href")??"":"";String(i||a||"").trim()&&this._closeDrawerNow()},this._collapsed=!1,this._unlockAtWidth=0,this._hideLogoText=!1,this._logoTextUnlockAt=0,this._slotWatchers=[],this._harvestPending=!1,this._harvest=(t={})=>{const r=Array.from(this.children),s=[],i=[],a=[];let d=-1,n=!1;const u=l=>({label:l.getAttribute("label")??"",href:l.getAttribute("href")??void 0,icon:l.getAttribute("icon")??void 0}),p=l=>{l.hasAttribute("role")&&l.removeAttribute("role"),l.hasAttribute("hidden")||l.setAttribute("hidden",""),l.getAttribute("aria-hidden")!=="true"&&l.setAttribute("aria-hidden","true")};for(const l of r){const A=l.tagName.toLowerCase();if(this._isDrawerCloseNode(l)){this._syncDrawerCloseNode(l);continue}if(A==="scb-header-tab"){p(l);const g=l.getAttribute("label")??"",v=l.getAttribute("href"),C=v&&v.trim()!==""?v:void 0;(l.hasAttribute("selected")||l.getAttribute("selected")==="true"||l.getAttribute("active")==="true"||l.getAttribute("aria-current")==="page")&&d===-1&&(d=s.length),s.push({kind:"tab",label:g,href:C});continue}if(A==="scb-badge"){const g=l.querySelector("scb-dropdown");if(g){n=!0;const v=g.getAttribute("label")??"";(g.hasAttribute("selected")||g.getAttribute("selected")==="true"||g.getAttribute("active")==="true"||g.getAttribute("aria-current")==="page")&&d===-1&&(d=s.length);const C=`scb-header-tab-${s.length}`;l.getAttribute("slot")!==C&&l.setAttribute("slot",C),g.hasAttribute("slot")&&g.removeAttribute("slot"),g.hasAttribute("as-tab")||g.setAttribute("as-tab",""),s.push({kind:"dropdown",slotName:C,label:v});continue}}if(A==="scb-dropdown"){n=!0;const g=l.getAttribute("label")??"";(l.hasAttribute("selected")||l.getAttribute("selected")==="true"||l.getAttribute("active")==="true"||l.getAttribute("aria-current")==="page")&&d===-1&&(d=s.length);const v=`scb-header-tab-${s.length}`;l.getAttribute("slot")!==v&&l.setAttribute("slot",v),l.hasAttribute("as-tab")||l.setAttribute("as-tab",""),s.push({kind:"dropdown",slotName:v,label:g});continue}if(A==="scb-header-utility"){p(l),i.push({label:l.getAttribute("label")??"",href:l.getAttribute("href")??"#",target:l.getAttribute("target")??void 0});continue}if(A==="scb-header-menu-group"){p(l);const g={label:l.getAttribute("label")??"",icon:l.getAttribute("icon")??void 0,children:[]};l.querySelectorAll("scb-header-menu-item").forEach(v=>g.children.push(u(v))),a.push(g);continue}if(A==="scb-header-menu-item"){p(l),a.push(u(l));continue}l.hasAttribute("slot")||p(l)}const f=!this._sameNavItems(this._slotNavItems,s),y=!this._sameUtilityItems(this._slotUtils,i),_=!this._sameMenuNodes(this._slotMenu,a);f&&(this._slotNavItems=s),y&&(this._slotUtils=i),_&&(this._slotMenu=a),n&&this._ensureDropdownReady(),!this.hasAttribute("active-tab")&&d>=0&&this.activeTab!==d&&(this.activeTab=d),(t.scheduleMeasure??!0)&&queueMicrotask(()=>{this.updateComplete.then(()=>{this._scheduleMeasure()})})},this._measure=()=>{if(this.layoutPending)return;const t=this._top,r=this._logoGroup;if(!t||!r)return;const s=window.innerWidth,i=t.clientWidth,a=this._overflows(this._util),d=this._tabsOverflows(),n=s<this.BP_MD||a||d;this._collapsed?!n&&i>=this._unlockAtWidth&&this._setCollapsed(!1):n&&(this._unlockAtWidth=i+this._HYST,this._setCollapsed(!0));let u=!1;if(this.showSearch&&s>=this.BP_SM&&s<this.BP_MD&&this._searchWrap){const f=getComputedStyle(this._searchWrap),y=Math.max(this._num(f.minWidth,this._tokenPx("--scb-header-search-min",250)),this._tokenPx("--scb-header-search-min",250)),_=this._num(getComputedStyle(t).gap,this._tokenPx("--spacing-7",24)),l=this.showDrawer&&(this.alwaysShowMenuButton||s<this.BP_MD||this._collapsed)?this._menuBtn?.getBoundingClientRect().width||this._tokenPx("--icon-size-extra-extra-large",48):0;u=r.getBoundingClientRect().width+_+y+_+l+8>i+.5}this._setHideSearch(u);let p=!1;if(this.showDrawer&&(this.alwaysShowMenuButton||s<this.BP_MD||this._collapsed)&&!this._visible(this._util)&&!this._visible(this._searchWrap)){const f=this._num(getComputedStyle(t).gap,this._tokenPx("--spacing-7",24)),y=this._menuBtn?.getBoundingClientRect().width||this._tokenPx("--icon-size-extra-extra-large",48),_=(this._logoGroup?.getBoundingClientRect().width||0)+f+y;this._hideLogoText?p=!(i>=this._logoTextUnlockAt):_>i+.5&&(p=!0,this._logoTextUnlockAt=i+this._HYST)}else p=!1,this._logoTextUnlockAt=0;this._setHideLogoText(p)},this._onGlobalFocusRingKeydown=t=>{t.key==="Tab"&&(this.toggleAttribute("data-keyboard-focus",!0),this._ensureFocusRingReady())},this._onGlobalFocusRingPointerDown=()=>{this.removeAttribute("data-keyboard-focus")},this._onLocalFocusIn=t=>{const r=t.composedPath()[0];r instanceof HTMLElement&&r.matches(":focus-visible")&&this._ensureFocusRingReady()},this._onDrawerOpened=()=>{this._menuExpanded=!0,this._syncMenuBtnAria(),this.dispatchEvent(new CustomEvent("drawer-open",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("draweropen",{bubbles:!0,composed:!0}))},this._onDrawerClosed=()=>{this._menuExpanded=!1,this._syncMenuBtnAria(),this.dispatchEvent(new CustomEvent("drawer-close",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("drawerclose",{bubbles:!0,composed:!0}))},this._onMenuClick=async t=>{this.showDrawer&&(this._setMobileSearchOpen(!1),this.dispatchEvent(new CustomEvent("menu-click",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("menuclick",{bubbles:!0,composed:!0})),!this._drawerReady&&(t.stopPropagation(),await this._ensureDrawerReady(),await this.updateComplete,this._openDrawerNow()))},this._onMobileSearchToggle=()=>{const t=!this._mobileSearchOpen;this._setMobileSearchOpen(t),t&&this.updateComplete.then(()=>{this.renderRoot.querySelector(".mobile-search-panel .header-search-input")?.focus?.()})},this._onTabClick=t=>{const r=t.currentTarget;if(!r)return;const s=r.tagName.toLowerCase()==="a";if(s&&(t.defaultPrevented||t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey))return;const i=r.getAttribute("data-index"),a=i!=null?Number(i):0,d=this._getNavItems()[a];if(d?.kind==="dropdown")return;this.activeTab=a;const n=d?.kind==="tab"?d.href??"":"",u=new CustomEvent("tab-change",{detail:{index:a,href:n},bubbles:!0,composed:!0,cancelable:!0}),p=new CustomEvent("tabchange",{detail:{index:a,href:n},bubbles:!0,composed:!0,cancelable:!0});!(this.dispatchEvent(u)&&this.dispatchEvent(p))&&s&&t.preventDefault()},this._onDropdownTabActivate=t=>{const r=t.detail?.dataIndex,s=typeof r=="number"?r:typeof r=="string"?Number(r):this._readTabIndexFromEvent(t);if(s==null||!Number.isFinite(s))return;const i=this._getNavItems();s<0||s>=i.length||i[s]?.kind==="dropdown"&&(this.activeTab=s,this.dispatchEvent(new CustomEvent("tab-change",{detail:{index:s,href:""},bubbles:!0,composed:!0,cancelable:!0})),this.dispatchEvent(new CustomEvent("tabchange",{detail:{index:s,href:""},bubbles:!0,composed:!0,cancelable:!0})))},this._onTabsKeydown=t=>{const r=t.key;if(r!=="ArrowLeft"&&r!=="ArrowRight"&&r!=="Home"&&r!=="End")return;const s=this._getNavItems();if(!s.length)return;const i=this._readTabIndexFromEvent(t);if(i==null)return;let a=Math.max(0,Math.min(s.length-1,i));r==="ArrowRight"?a=(a+1)%s.length:r==="ArrowLeft"?a=(a-1+s.length)%s.length:r==="Home"?a=0:r==="End"&&(a=s.length-1),t.preventDefault(),this._focusTabAtIndex(a)},this._onNativeSearchInput=t=>{const r=t.currentTarget;this._emitSearchInput(r?.value??"")},this._onNativeSearchSubmit=t=>{t.preventDefault();const r=t.currentTarget?.querySelector(".header-search-input");this._emitSearchChange(r?.value??"")},this._onSearchClear=()=>{this.searchText="",this.dispatchEvent(new CustomEvent("search-text-change",{detail:{value:""},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("searchtextchange",{detail:{value:""},bubbles:!0,composed:!0}))},this._onNativeSearchClear=t=>{t.preventDefault(),this._onSearchClear(),this.updateComplete.then(()=>{const r=t.currentTarget?.closest("form")?.querySelector(".header-search-input");r&&(r.value=""),r?.focus()})};const e=++L;this._drawerId=`scb-header-drawer-${e}`,this._searchId=`scb-header-search-${e}`}requestLayout(){this.layoutPending||(this.setAttribute("data-layout-settling",""),this.updateComplete.then(()=>{this.isConnected&&(this._measure(),this.removeAttribute("data-layout-settling"))}))}get _HYST(){return this._tokenPx("--spacing-11",64)}get BP_SM(){return this._tokenPx("--bp-sm",P.BP_SM_DEFAULT)}get BP_MD(){return this._tokenPx("--bp-md",P.BP_MD_DEFAULT)}_scheduleHarvest(){this._harvestPending||(this._harvestPending=!0,queueMicrotask(()=>{this._harvestPending=!1,this._harvest()}))}get _top(){return this.renderRoot.querySelector(".top-row")}get _util(){return this.renderRoot.querySelector(".utility")}get _logoGroup(){return this.renderRoot.querySelector(".logo-wrap")||this.renderRoot.querySelector(".logo-group")}get _searchWrap(){return this.renderRoot.querySelector(".search")}get _menuBtn(){return this.renderRoot.querySelector(".menu-trigger")}get _tabsNav(){return this.renderRoot.querySelector(".tabs-nav")}_attachSlotObservers(){this._slotMo?.disconnect(),this._slotWatchers.forEach(i=>i.disconnect()),this._slotWatchers=[];const e=["label","href","icon","target","selected","aria-current","active","role"],t=i=>{const a=new MutationObserver(d=>{this._scheduleHarvest()});this._slotWatchers.push(a),a.observe(i,{attributes:!0,attributeFilter:e})},r=()=>{this._slotWatchers.forEach(a=>a.disconnect()),this._slotWatchers=[];const i=Array.from(this.children);for(const a of i){const d=a.tagName.toLowerCase();if((d==="scb-header-tab"||d==="scb-dropdown"||d==="scb-header-utility"||d==="scb-header-menu-item"||d==="scb-header-menu-group"||d==="scb-badge")&&t(a),d==="scb-badge"){const n=a,u=new MutationObserver(f=>{r(),this._scheduleHarvest()});this._slotWatchers.push(u),u.observe(n,{childList:!0});const p=n.querySelector("scb-dropdown");p&&t(p);continue}if(d==="scb-header-menu-group"){const n=a,u=new MutationObserver(p=>{r(),this._scheduleHarvest()});this._slotWatchers.push(u),u.observe(n,{childList:!0,subtree:!0}),n.querySelectorAll("scb-header-menu-item").forEach(p=>t(p))}}},s=new MutationObserver(i=>{let a=!1;for(const d of i)if(d.type==="childList"){a=!0;break}a&&r(),this._scheduleHarvest()});this._slotMo=s,s.observe(this,{childList:!0}),r()}_sameNavItems(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r+=1){const s=e[r],i=t[r];if(!s||!i||s.kind!==i.kind||s.label!==i.label)return!1;if(s.kind==="tab"&&i.kind==="tab"){if((s.href??"")!==(i.href??""))return!1}else if(s.kind==="dropdown"&&i.kind==="dropdown"&&s.slotName!==i.slotName)return!1}return!0}_sameUtilityItems(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r+=1){const s=e[r],i=t[r];if(!s||!i||s.label!==i.label||s.href!==i.href||(s.target??"")!==(i.target??""))return!1}return!0}_sameMenuNodes(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r+=1){const s=e[r],i=t[r];if(!s||!i||s.label!==i.label||(s.href??"")!==(i.href??"")||(s.icon??"")!==(i.icon??"")||!this._sameMenuNodes(s.children??[],i.children??[]))return!1}return!0}_isDrawerCloseNode(e){const t=e.tagName.toLowerCase(),r=e.getAttribute("slot");if(r==="drawer-close")return!0;if(r||t!=="scb-icon-button")return!1;const s=(e.getAttribute("icon")??"").trim().toLowerCase(),i=(e.getAttribute("aria-label")??"").trim().toLowerCase();return s==="close"||i.includes("stäng")||i.includes("close")}_syncDrawerCloseNode(e){e.getAttribute("slot")!=="drawer-close"&&e.setAttribute("slot","drawer-close"),e.setAttribute("data-drawer-close",this._drawerId),e.setAttribute("aria-controls",this._drawerId),this._drawerReady?(e.removeAttribute("hidden"),e.removeAttribute("aria-hidden")):(e.hasAttribute("hidden")||e.setAttribute("hidden",""),e.getAttribute("aria-hidden")!=="true"&&e.setAttribute("aria-hidden","true"))}_syncDrawerCloseNodes(){for(const e of Array.from(this.children))this._isDrawerCloseNode(e)&&this._syncDrawerCloseNode(e)}_setCollapsed(e){this._collapsed!==e&&(this._collapsed=e,e?this.setAttribute("data-collapsed",""):this.removeAttribute("data-collapsed"))}_setHideSearch(e){e?this.setAttribute("data-hide-search",""):this.removeAttribute("data-hide-search")}_setHideLogoText(e){this._hideLogoText!==e&&(this._hideLogoText=e,e?this.setAttribute("data-hide-logo-text",""):this.removeAttribute("data-hide-logo-text"))}_setMobileSearchOpen(e){this._mobileSearchOpen!==e&&(this._mobileSearchOpen=e,this.toggleAttribute("data-mobile-search-open",e))}_num(e,t){const r=Number.parseFloat(String(e??"").trim());return Number.isFinite(r)?r:t}_tokenPx(e,t){const r=getComputedStyle(this);return this._num(r.getPropertyValue(e),t)}_visible(e){return e?getComputedStyle(e).display!=="none":!1}_overflows(e){return!e||!this._visible(e)?!1:e.scrollWidth>e.clientWidth+1}_tabsOverflows(){const e=this._tabsNav;if(!e||!this._visible(e))return!1;const t=Array.from(e.querySelectorAll(".tab-wrap"));if(t.length===0)return!1;const r=e.getBoundingClientRect();let s=r.left;for(const i of t){const a=i.getBoundingClientRect();a.width<=0||a.right>s&&(s=a.right)}return s-r.left>r.width+1}connectedCallback(){super.connectedCallback(),window.addEventListener("keydown",this._onGlobalFocusRingKeydown,!0),window.addEventListener("pointerdown",this._onGlobalFocusRingPointerDown,!0),this._initialUpgradeComplete||this.setAttribute("data-upgrading",""),this._harvest({scheduleMeasure:!1}),this._attachSlotObservers()}_finishInitialUpgrade(){this._initialUpgradeComplete||(this._initialUpgradeComplete=!0,requestAnimationFrame(()=>{this.isConnected&&(this._measure(),this.removeAttribute("data-upgrading"))}))}firstUpdated(){this._syncLandmarkAttributes(),this.renderRoot.addEventListener("focusin",this._onLocalFocusIn),this.showDrawer&&!this.deferDrawer&&this._ensureDrawerReady(),this.updateComplete.then(()=>{this._harvest({scheduleMeasure:!1}),this._attachSlotObservers(),this._syncDropdownTabs(),this._finishInitialUpgrade()});const e=this._top;e&&(this._ro=new ResizeObserver(()=>this._scheduleMeasure()),this._ro.observe(e)),window.addEventListener("resize",this._onWindowResize,{passive:!0})}updated(e){e.has("searchMax")&&this.style.setProperty("--scb-header-search-max",this.searchMax??"380px"),e.has("searchMin")&&this.style.setProperty("--scb-header-search-min",this.searchMin??"250px"),e.has("searchHeight")&&(this.searchHeight&&this.searchHeight.trim()?this.style.setProperty("--scb-search-height",this.searchHeight.trim()):this.style.removeProperty("--scb-search-height")),(e.has("logoWidth")||e.has("logoHeight")||e.has("logoAspectRatio"))&&this._applyLogoSizing(),(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom"))&&this._applySpacing(),(e.has("banner")||e.has("bannerLabel"))&&this._syncLandmarkAttributes(),(e.has("utilityItems")||e.has("tabs")||e.has("logoText")||e.has("logotypeText")||e.has("logoSrc")||e.has("logoWidth")||e.has("logoHeight")||e.has("logoAspectRatio")||e.has("activeTab")||e.has("_slotNavItems")||e.has("_slotUtils")||e.has("_slotMenu")||e.has("showDrawer")||e.has("alwaysShowMenuButton")||e.has("showSearch")||e.has("layoutPending")||e.has("searchMax")||e.has("searchMin")||e.has("size"))&&this.updateComplete.then(()=>{this._scheduleMeasure()}),(e.has("showDrawer")||e.has("deferDrawer"))&&this.showDrawer&&!this.deferDrawer&&this._ensureDrawerReady(),e.has("showSearch")&&!this.showSearch&&this._setMobileSearchOpen(!1),e.has("layoutPending")&&!this.layoutPending&&this.requestLayout(),(e.has("activeTab")||e.has("_slotNavItems")||e.has("tabs")||e.has("size"))&&this.updateComplete.then(()=>{this._syncDropdownTabs()})}disconnectedCallback(){this._ro?.disconnect(),this._slotMo?.disconnect(),this._slotWatchers.forEach(e=>e.disconnect()),this._slotWatchers=[],this.renderRoot.removeEventListener("focusin",this._onLocalFocusIn),window.removeEventListener("keydown",this._onGlobalFocusRingKeydown,!0),window.removeEventListener("pointerdown",this._onGlobalFocusRingPointerDown,!0),window.removeEventListener("resize",this._onWindowResize),super.disconnectedCallback()}_mapSpacingToken(e){if(!e)return;const t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}_applySpacing(){const e=this._mapSpacingToken(this.spacing),t=this._mapSpacingToken(this.spacingTop)??e,r=this._mapSpacingToken(this.spacingBottom)??e;t?this.style.setProperty("--scb-header-spacing-block-start",t):this.style.removeProperty("--scb-header-spacing-block-start"),r?this.style.setProperty("--scb-header-spacing-block-end",r):this.style.removeProperty("--scb-header-spacing-block-end")}_syncLandmarkAttributes(){const e=this.renderRoot.querySelector(".header-landmark");if(!e)return;if(!this.banner){e.removeAttribute("role"),e.removeAttribute("aria-label");return}e.setAttribute("role","banner");const t=(this.bannerLabel??"").trim();t?e.setAttribute("aria-label",t):e.removeAttribute("aria-label")}_applyLogoSizing(){const e=(this.logoWidth??"").trim(),t=(this.logoHeight??"").trim(),r=(this.logoAspectRatio??"").trim();e?this.style.setProperty("--scb-header-logo-img-w",e):this.style.removeProperty("--scb-header-logo-img-w"),t?this.style.setProperty("--scb-header-logo-img-h",t):e?this.style.setProperty("--scb-header-logo-img-h","auto"):this.style.removeProperty("--scb-header-logo-img-h"),r?this.style.setProperty("--scb-header-logo-img-aspect-ratio",r):this.style.removeProperty("--scb-header-logo-img-aspect-ratio")}_closeDrawerNow(){const e=this.renderRoot.querySelector(`#${this._drawerId}`);e&&(e.open=!1)}_openDrawerNow(){const e=this.renderRoot.querySelector(`#${this._drawerId}`);e&&(e.open=!0)}_ensureFocusRingReady(){customElements.get("md-focus-ring")||(this._focusRingImportPromise??(this._focusRingImportPromise=S(()=>import("../shared/lazy-focus-ring.js"),__vite__mapDeps([0,1]),import.meta.url)),this._focusRingImportPromise.then(({ensureFocusRingReady:e})=>{e()}))}async _ensureDrawerReady(){this._drawerReady||(this._drawerImportPromise??(this._drawerImportPromise=Promise.all([S(()=>import("../scb-drawer/scb-drawer.js"),__vite__mapDeps([2,3,4,5,6,7]),import.meta.url),S(()=>import("../scb-menu/scb-menu.js"),__vite__mapDeps([8,7,3,4,5,6,9,1,10,11,12]),import.meta.url),S(()=>import("../scb-search/scb-search.js"),__vite__mapDeps([13,3,1,4,14,15,5,16,17,0]),import.meta.url),S(()=>import("../../vendor/scb-header-drawer.internal.js").then(e=>{this._drawerRenderer=e}),__vite__mapDeps([18,4,5]),import.meta.url),this._ensureDrawerSlotComponentsReady()]).then(()=>{})),await this._drawerImportPromise,this._drawerReady=!0,this._syncDrawerCloseNodes())}_drawerSlotContains(e){return[...this.querySelectorAll('[slot="drawer-menu"], [slot="drawer-close"]')].some(t=>t.matches(e)||!!t.querySelector(e))}async _ensureDrawerSlotComponentsReady(){this.querySelector('[slot="drawer-menu"], [slot="drawer-close"]')&&await Promise.all([this._drawerSlotContains("scb-button")?S(()=>import("../scb-button/scb-button.js"),__vite__mapDeps([19,7,3,1,4,5]),import.meta.url):Promise.resolve(),this._drawerSlotContains("scb-icon-button")?S(()=>import("../scb-icon-button/scb-icon-button.js"),__vite__mapDeps([20,7,3,1,4,5]),import.meta.url):Promise.resolve(),this._drawerSlotContains("scb-skeleton")?S(()=>import("../scb-skeleton/scb-skeleton.js"),__vite__mapDeps([21,3,4,5]),import.meta.url):Promise.resolve(),this._drawerSlotContains("scb-grid")?S(()=>import("../scb-grid/scb-grid.js"),__vite__mapDeps([22,7,3,4,5,23,24]),import.meta.url):Promise.resolve(),this._drawerSlotContains("scb-grid-item")?S(()=>import("../scb-grid/scb-grid-item.js"),__vite__mapDeps([23,7,3,4,5]),import.meta.url):Promise.resolve()])}async _ensureDropdownReady(){customElements.get("scb-dropdown")||(this._dropdownImportPromise??(this._dropdownImportPromise=S(()=>import("../scb-dropdown/scb-dropdown.js").then(()=>{}),__vite__mapDeps([25,3,4,14,15,5,19,7,1,10,26,27,16,17,6,0,28]),import.meta.url)),await this._dropdownImportPromise)}_syncMenuBtnAria(){this.renderRoot.querySelectorAll(".menu-trigger").forEach(e=>{e.setAttribute("aria-expanded",String(this._menuExpanded))})}_getNavItems(){return this._slotNavItems.length?this._slotNavItems:(this.tabs??[]).map(e=>({kind:"tab",...e}))}_getDropdownForSlot(e){const t=this.querySelector(`[slot="${e}"]`);return t?t.tagName.toLowerCase()==="scb-dropdown"?t:t.querySelector("scb-dropdown"):null}_syncDropdownTabs(){this._getNavItems().forEach((e,t)=>{if(e.kind!=="dropdown")return;const r=this._getDropdownForSlot(e.slotName);if(!r)return;const s=String(t);r.getAttribute("data-index")!==s&&r.setAttribute("data-index",s),r.hasAttribute("as-tab")||r.setAttribute("as-tab","");const i=this.size,a=r;a?.size!==i&&(a.size=i),t===this.activeTab?r.getAttribute("aria-current")!=="page"&&r.setAttribute("aria-current","page"):r.hasAttribute("aria-current")&&r.removeAttribute("aria-current")})}_readTabIndexFromEvent(e){const t=e.composedPath?e.composedPath():[];for(const r of t){if(!(r instanceof HTMLElement))continue;const s=r.getAttribute("data-index");if(s==null)continue;const i=Number(s);if(Number.isFinite(i))return i}return null}_focusTabAtIndex(e){const t=this._getNavItems()[e];if(t){if(t.kind==="dropdown"){this._getDropdownForSlot(t.slotName)?.focus?.();return}this.renderRoot.querySelector(`.tab-link[data-index="${e}"]`)?.focus?.()}}_syncFlags(e,t){this.toggleAttribute("data-no-utility",e),this.toggleAttribute("data-no-search",t)}_emitSearchInput(e){this.searchText=e,this.dispatchEvent(new CustomEvent("search-input",{detail:{value:this.searchText},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("searchinput",{detail:{value:this.searchText},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("search-text-change",{detail:{value:this.searchText},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("searchtextchange",{detail:{value:this.searchText},bubbles:!0,composed:!0}))}_emitSearchChange(e,t){this.searchText=e,this.dispatchEvent(new CustomEvent("search-change",{detail:{value:this.searchText,active:t},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("searchchange",{detail:{value:this.searchText,active:t},bubbles:!0,composed:!0}))}_renderMenuButton(e="",t=!1){const r=e?`menu-trigger ${e}`:"menu-trigger",s=(this.menuButtonLabel??"").trim()||"Meny",i=this._menuExpanded?"true":"false";return t?m`
|
|
55
|
+
`,document.head.appendChild(b);const e=n=>{const u=String(n??"").trim();if(u)return/^\d+$/.test(u)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(u,10)))})`:u},t=n=>{const u=String(n??"").trim();if(!u)return!1;try{const p=JSON.parse(u);return Array.isArray(p)&&p.length>0}catch{return!1}},r=n=>n!=null&&!/^(false|0|off|no)$/i.test(n.trim()),s=n=>{for(const u of Array.from(n.children)){const p=u.tagName.toLowerCase();if(p==="scb-header-tab"||p==="scb-dropdown")return!0}return!1},i=n=>{s(n)||t(n.getAttribute("tabs"))||r(n.getAttribute("reserve-tabs"))||r(n.getAttribute("layout-pending"))?n.setAttribute("data-pre-has-tabs",""):n.removeAttribute("data-pre-has-tabs");const u=e(n.getAttribute("spacing")),p=e(n.getAttribute("spacing-top"))??u,f=e(n.getAttribute("spacing-bottom"))??u;p?n.style.setProperty("--scb-header-spacing-block-start",p):n.style.removeProperty("--scb-header-spacing-block-start"),f?n.style.setProperty("--scb-header-spacing-block-end",f):n.style.removeProperty("--scb-header-spacing-block-end");const y=(n.getAttribute("logo-width")??"").trim();y?n.style.setProperty("--scb-header-pre-logo-w",y):n.style.removeProperty("--scb-header-pre-logo-w");const _=(n.getAttribute("logo-height")??"").trim();_?n.style.setProperty("--scb-header-pre-logo-img-h",_):n.style.removeProperty("--scb-header-pre-logo-img-h");const l=(n.getAttribute("search-height")??"").trim();l?n.style.setProperty("--scb-header-pre-control-size",l):n.style.removeProperty("--scb-header-pre-control-size")};document.querySelectorAll("scb-header").forEach(i);const d=new MutationObserver(n=>{for(const u of n){if(u.type==="attributes"){const p=u.target;p instanceof HTMLElement&&p.tagName.toLowerCase()==="scb-header"&&i(p);continue}if(u.type==="childList"){const p=[...Array.from(u.addedNodes),...Array.from(u.removedNodes)];for(const f of p){if(!(f instanceof HTMLElement))continue;if(f.tagName.toLowerCase()==="scb-header"){i(f);continue}const y=f.closest?.("scb-header");y&&i(y)}}}});d.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabs","spacing","spacing-top","spacing-bottom","logo-width","logo-height","logo-aspect-ratio","logo-alt","logotype-text","search-height","reserve-tabs","layout-pending"]}),customElements.whenDefined("scb-header").then(()=>{d.disconnect()})};$();var M={fromAttribute:b=>b==null?!0:!/^(false|0|off|no)$/i.test(b),toAttribute:b=>String(!!b)},z={fromAttribute:b=>b==null?!1:!/^(false|0|off|no)$/i.test(b),toAttribute:b=>b?"":null},N={fromAttribute:b=>b==="small"||b==="large"?b:"medium",toAttribute:b=>{const e=String(b??"");return e==="small"||e==="large"?e:null}},o=(T=class extends D{constructor(){super(),this.maxWidth="1440px",this.size="medium",this.logoText="",this.logotypeText="",this.logoAlt="",this.logoHref="/",this.logoSrc="",this.logoWidth="",this.logoHeight="",this.logoAspectRatio="",this.logoInvertDm=!1,this.banner=!1,this.tabs=[],this.activeTab=null,this.reserveTabs=!1,this.layoutPending=!1,this.utilityItems=[],this.searchButtonLabel="Sök",this.menuButtonLabel="Meny",this.deferDrawer=!1,this.showDrawer=!0,this.alwaysShowMenuButton=!1,this.showSearch=!0,this.includeUtilityInMenu=!1,this.drawerOverlay=!0,this.searchText="",this._drawerId="main-drawer",this._menuExpanded=!1,this._searchId="header-search",this._drawerReady=!1,this._mobileSearchOpen=!1,this._initialUpgradeComplete=!1,this._slotNavItems=[],this._slotUtils=[],this._slotMenu=[],this._measureScheduled=!1,this._scheduleMeasure=()=>{this.layoutPending||this._measureScheduled||(this._measureScheduled=!0,requestAnimationFrame(()=>{this._measureScheduled=!1,this._measure()}))},this._onWindowResize=()=>{window.innerWidth>=this.BP_SM&&this._mobileSearchOpen&&this._setMobileSearchOpen(!1),this._scheduleMeasure()},this._onMenuSelect=t=>{const r=t.detail;this.dispatchEvent(new CustomEvent("scb-menu-select",{detail:r,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("scbmenuselect",{detail:r,bubbles:!0,composed:!0}));const s=r?.item,i=typeof r?.href=="string"?r.href:typeof r?.itemHref=="string"?r.itemHref:typeof r?.item_href=="string"?r.item_href:"",a=s?s.getAttribute("item-href")??s.getAttribute("href")??"":"";String(i||a||"").trim()&&this._closeDrawerNow()},this._collapsed=!1,this._unlockAtWidth=0,this._hideLogoText=!1,this._logoTextUnlockAt=0,this._slotWatchers=[],this._harvestPending=!1,this._harvest=(t={})=>{const r=Array.from(this.children),s=[],i=[],a=[];let d=-1,n=!1;const u=l=>({label:l.getAttribute("label")??"",href:l.getAttribute("href")??void 0,icon:l.getAttribute("icon")??void 0}),p=l=>{l.hasAttribute("role")&&l.removeAttribute("role"),l.hasAttribute("hidden")||l.setAttribute("hidden",""),l.getAttribute("aria-hidden")!=="true"&&l.setAttribute("aria-hidden","true")};for(const l of r){const A=l.tagName.toLowerCase();if(this._isDrawerCloseNode(l)){this._syncDrawerCloseNode(l);continue}if(A==="scb-header-tab"){p(l);const g=l.getAttribute("label")??"",v=l.getAttribute("href"),C=v&&v.trim()!==""?v:void 0;(l.hasAttribute("selected")||l.getAttribute("selected")==="true"||l.getAttribute("active")==="true"||l.getAttribute("aria-current")==="page")&&d===-1&&(d=s.length),s.push({kind:"tab",label:g,href:C});continue}if(A==="scb-badge"){const g=l.querySelector("scb-dropdown");if(g){n=!0;const v=g.getAttribute("label")??"";(g.hasAttribute("selected")||g.getAttribute("selected")==="true"||g.getAttribute("active")==="true"||g.getAttribute("aria-current")==="page")&&d===-1&&(d=s.length);const C=`scb-header-tab-${s.length}`;l.getAttribute("slot")!==C&&l.setAttribute("slot",C),g.hasAttribute("slot")&&g.removeAttribute("slot"),g.hasAttribute("as-tab")||g.setAttribute("as-tab",""),s.push({kind:"dropdown",slotName:C,label:v});continue}}if(A==="scb-dropdown"){n=!0;const g=l.getAttribute("label")??"";(l.hasAttribute("selected")||l.getAttribute("selected")==="true"||l.getAttribute("active")==="true"||l.getAttribute("aria-current")==="page")&&d===-1&&(d=s.length);const v=`scb-header-tab-${s.length}`;l.getAttribute("slot")!==v&&l.setAttribute("slot",v),l.hasAttribute("as-tab")||l.setAttribute("as-tab",""),s.push({kind:"dropdown",slotName:v,label:g});continue}if(A==="scb-header-utility"){p(l),i.push({label:l.getAttribute("label")??"",href:l.getAttribute("href")??"#",target:l.getAttribute("target")??void 0});continue}if(A==="scb-header-menu-group"){p(l);const g={label:l.getAttribute("label")??"",icon:l.getAttribute("icon")??void 0,children:[]};l.querySelectorAll("scb-header-menu-item").forEach(v=>g.children.push(u(v))),a.push(g);continue}if(A==="scb-header-menu-item"){p(l),a.push(u(l));continue}l.hasAttribute("slot")||p(l)}const f=!this._sameNavItems(this._slotNavItems,s),y=!this._sameUtilityItems(this._slotUtils,i),_=!this._sameMenuNodes(this._slotMenu,a);f&&(this._slotNavItems=s),y&&(this._slotUtils=i),_&&(this._slotMenu=a),n&&this._ensureDropdownReady(),!this.hasAttribute("active-tab")&&d>=0&&this.activeTab!==d&&(this.activeTab=d),(t.scheduleMeasure??!0)&&queueMicrotask(()=>{this.updateComplete.then(()=>{this._scheduleMeasure()})})},this._measure=()=>{if(this.layoutPending)return;const t=this._top,r=this._logoGroup;if(!t||!r)return;const s=window.innerWidth,i=t.clientWidth,a=this._overflows(this._util),d=this._tabsOverflows(),n=s<this.BP_MD||a||d;this._collapsed?!n&&i>=this._unlockAtWidth&&this._setCollapsed(!1):n&&(this._unlockAtWidth=i+this._HYST,this._setCollapsed(!0));let u=!1;if(this.showSearch&&s>=this.BP_SM&&s<this.BP_MD&&this._searchWrap){const f=getComputedStyle(this._searchWrap),y=Math.max(this._num(f.minWidth,this._tokenPx("--scb-header-search-min",250)),this._tokenPx("--scb-header-search-min",250)),_=this._num(getComputedStyle(t).gap,this._tokenPx("--spacing-7",24)),l=this.showDrawer&&(this.alwaysShowMenuButton||s<this.BP_MD||this._collapsed)?this._menuBtn?.getBoundingClientRect().width||this._tokenPx("--icon-size-extra-extra-large",48):0;u=r.getBoundingClientRect().width+_+y+_+l+8>i+.5}this._setHideSearch(u);let p=!1;if(this.showDrawer&&(this.alwaysShowMenuButton||s<this.BP_MD||this._collapsed)&&!this._visible(this._util)&&!this._visible(this._searchWrap)){const f=this._num(getComputedStyle(t).gap,this._tokenPx("--spacing-7",24)),y=this._menuBtn?.getBoundingClientRect().width||this._tokenPx("--icon-size-extra-extra-large",48),_=(this._logoGroup?.getBoundingClientRect().width||0)+f+y;this._hideLogoText?p=!(i>=this._logoTextUnlockAt):_>i+.5&&(p=!0,this._logoTextUnlockAt=i+this._HYST)}else p=!1,this._logoTextUnlockAt=0;this._setHideLogoText(p)},this._onGlobalFocusRingKeydown=t=>{t.key==="Tab"&&(this.toggleAttribute("data-keyboard-focus",!0),this._ensureFocusRingReady())},this._onGlobalFocusRingPointerDown=()=>{this.removeAttribute("data-keyboard-focus")},this._onLocalFocusIn=t=>{const r=t.composedPath()[0];r instanceof HTMLElement&&r.matches(":focus-visible")&&this._ensureFocusRingReady()},this._onDrawerOpened=()=>{this._menuExpanded=!0,this._syncMenuBtnAria(),this.dispatchEvent(new CustomEvent("drawer-open",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("draweropen",{bubbles:!0,composed:!0}))},this._onDrawerClosed=()=>{this._menuExpanded=!1,this._syncMenuBtnAria(),this.dispatchEvent(new CustomEvent("drawer-close",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("drawerclose",{bubbles:!0,composed:!0}))},this._onMenuClick=async t=>{this.showDrawer&&(this._setMobileSearchOpen(!1),this.dispatchEvent(new CustomEvent("menu-click",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("menuclick",{bubbles:!0,composed:!0})),!this._drawerReady&&(t.stopPropagation(),await this._ensureDrawerReady(),await this.updateComplete,this._openDrawerNow()))},this._onMobileSearchToggle=()=>{const t=!this._mobileSearchOpen;this._setMobileSearchOpen(t),t&&this.updateComplete.then(()=>{this.renderRoot.querySelector(".mobile-search-panel .header-search-input")?.focus?.()})},this._onTabClick=t=>{const r=t.currentTarget;if(!r)return;const s=r.tagName.toLowerCase()==="a";if(s&&(t.defaultPrevented||t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey))return;const i=r.getAttribute("data-index"),a=i!=null?Number(i):0,d=this._getNavItems()[a];if(d?.kind==="dropdown")return;this.activeTab=a;const n=d?.kind==="tab"?d.href??"":"",u=new CustomEvent("tab-change",{detail:{index:a,href:n},bubbles:!0,composed:!0,cancelable:!0}),p=new CustomEvent("tabchange",{detail:{index:a,href:n},bubbles:!0,composed:!0,cancelable:!0});!(this.dispatchEvent(u)&&this.dispatchEvent(p))&&s&&t.preventDefault()},this._onDropdownTabActivate=t=>{const r=t.detail?.dataIndex,s=typeof r=="number"?r:typeof r=="string"?Number(r):this._readTabIndexFromEvent(t);if(s==null||!Number.isFinite(s))return;const i=this._getNavItems();s<0||s>=i.length||i[s]?.kind==="dropdown"&&(this.activeTab=s,this.dispatchEvent(new CustomEvent("tab-change",{detail:{index:s,href:""},bubbles:!0,composed:!0,cancelable:!0})),this.dispatchEvent(new CustomEvent("tabchange",{detail:{index:s,href:""},bubbles:!0,composed:!0,cancelable:!0})))},this._onTabsKeydown=t=>{const r=t.key;if(r!=="ArrowLeft"&&r!=="ArrowRight"&&r!=="Home"&&r!=="End")return;const s=this._getNavItems();if(!s.length)return;const i=this._readTabIndexFromEvent(t);if(i==null)return;let a=Math.max(0,Math.min(s.length-1,i));r==="ArrowRight"?a=(a+1)%s.length:r==="ArrowLeft"?a=(a-1+s.length)%s.length:r==="Home"?a=0:r==="End"&&(a=s.length-1),t.preventDefault(),this._focusTabAtIndex(a)},this._onNativeSearchInput=t=>{const r=t.currentTarget;this._emitSearchInput(r?.value??"")},this._onNativeSearchSubmit=t=>{t.preventDefault();const r=t.currentTarget?.querySelector(".header-search-input");this._emitSearchChange(r?.value??"")},this._onSearchClear=()=>{this.searchText="",this.dispatchEvent(new CustomEvent("search-text-change",{detail:{value:""},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("searchtextchange",{detail:{value:""},bubbles:!0,composed:!0}))},this._onNativeSearchClear=t=>{t.preventDefault(),this._onSearchClear(),this.updateComplete.then(()=>{const r=t.currentTarget?.closest("form")?.querySelector(".header-search-input");r&&(r.value=""),r?.focus()})};const e=++L;this._drawerId=`scb-header-drawer-${e}`,this._searchId=`scb-header-search-${e}`}requestLayout(){this.layoutPending||(this.setAttribute("data-layout-settling",""),this.updateComplete.then(()=>{this.isConnected&&(this._measure(),this.removeAttribute("data-layout-settling"))}))}get _HYST(){return this._tokenPx("--spacing-11",64)}get BP_SM(){return this._tokenPx("--bp-sm",P.BP_SM_DEFAULT)}get BP_MD(){return this._tokenPx("--bp-md",P.BP_MD_DEFAULT)}_scheduleHarvest(){this._harvestPending||(this._harvestPending=!0,queueMicrotask(()=>{this._harvestPending=!1,this._harvest()}))}get _top(){return this.renderRoot.querySelector(".top-row")}get _util(){return this.renderRoot.querySelector(".utility")}get _logoGroup(){return this.renderRoot.querySelector(".logo-wrap")||this.renderRoot.querySelector(".logo-group")}get _searchWrap(){return this.renderRoot.querySelector(".search")}get _menuBtn(){return this.renderRoot.querySelector(".menu-trigger")}get _tabsNav(){return this.renderRoot.querySelector(".tabs-nav")}_attachSlotObservers(){this._slotMo?.disconnect(),this._slotWatchers.forEach(i=>i.disconnect()),this._slotWatchers=[];const e=["label","href","icon","target","selected","aria-current","active","role"],t=i=>{const a=new MutationObserver(d=>{this._scheduleHarvest()});this._slotWatchers.push(a),a.observe(i,{attributes:!0,attributeFilter:e})},r=()=>{this._slotWatchers.forEach(a=>a.disconnect()),this._slotWatchers=[];const i=Array.from(this.children);for(const a of i){const d=a.tagName.toLowerCase();if((d==="scb-header-tab"||d==="scb-dropdown"||d==="scb-header-utility"||d==="scb-header-menu-item"||d==="scb-header-menu-group"||d==="scb-badge")&&t(a),d==="scb-badge"){const n=a,u=new MutationObserver(f=>{r(),this._scheduleHarvest()});this._slotWatchers.push(u),u.observe(n,{childList:!0});const p=n.querySelector("scb-dropdown");p&&t(p);continue}if(d==="scb-header-menu-group"){const n=a,u=new MutationObserver(p=>{r(),this._scheduleHarvest()});this._slotWatchers.push(u),u.observe(n,{childList:!0,subtree:!0}),n.querySelectorAll("scb-header-menu-item").forEach(p=>t(p))}}},s=new MutationObserver(i=>{let a=!1;for(const d of i)if(d.type==="childList"){a=!0;break}a&&r(),this._scheduleHarvest()});this._slotMo=s,s.observe(this,{childList:!0}),r()}_sameNavItems(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r+=1){const s=e[r],i=t[r];if(!s||!i||s.kind!==i.kind||s.label!==i.label)return!1;if(s.kind==="tab"&&i.kind==="tab"){if((s.href??"")!==(i.href??""))return!1}else if(s.kind==="dropdown"&&i.kind==="dropdown"&&s.slotName!==i.slotName)return!1}return!0}_sameUtilityItems(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r+=1){const s=e[r],i=t[r];if(!s||!i||s.label!==i.label||s.href!==i.href||(s.target??"")!==(i.target??""))return!1}return!0}_sameMenuNodes(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r+=1){const s=e[r],i=t[r];if(!s||!i||s.label!==i.label||(s.href??"")!==(i.href??"")||(s.icon??"")!==(i.icon??"")||!this._sameMenuNodes(s.children??[],i.children??[]))return!1}return!0}_isDrawerCloseNode(e){const t=e.tagName.toLowerCase(),r=e.getAttribute("slot");if(r==="drawer-close")return!0;if(r||t!=="scb-icon-button")return!1;const s=(e.getAttribute("icon")??"").trim().toLowerCase(),i=(e.getAttribute("aria-label")??"").trim().toLowerCase();return s==="close"||i.includes("stäng")||i.includes("close")}_syncDrawerCloseNode(e){e.getAttribute("slot")!=="drawer-close"&&e.setAttribute("slot","drawer-close"),e.setAttribute("data-drawer-close",this._drawerId),e.setAttribute("aria-controls",this._drawerId),this._drawerReady?(e.removeAttribute("hidden"),e.removeAttribute("aria-hidden")):(e.hasAttribute("hidden")||e.setAttribute("hidden",""),e.getAttribute("aria-hidden")!=="true"&&e.setAttribute("aria-hidden","true"))}_syncDrawerCloseNodes(){for(const e of Array.from(this.children))this._isDrawerCloseNode(e)&&this._syncDrawerCloseNode(e)}_setCollapsed(e){this._collapsed!==e&&(this._collapsed=e,e?this.setAttribute("data-collapsed",""):this.removeAttribute("data-collapsed"))}_setHideSearch(e){e?this.setAttribute("data-hide-search",""):this.removeAttribute("data-hide-search")}_setHideLogoText(e){this._hideLogoText!==e&&(this._hideLogoText=e,e?this.setAttribute("data-hide-logo-text",""):this.removeAttribute("data-hide-logo-text"))}_setMobileSearchOpen(e){this._mobileSearchOpen!==e&&(this._mobileSearchOpen=e,this.toggleAttribute("data-mobile-search-open",e))}_num(e,t){const r=Number.parseFloat(String(e??"").trim());return Number.isFinite(r)?r:t}_tokenPx(e,t){const r=getComputedStyle(this);return this._num(r.getPropertyValue(e),t)}_visible(e){return e?getComputedStyle(e).display!=="none":!1}_overflows(e){return!e||!this._visible(e)?!1:e.scrollWidth>e.clientWidth+1}_tabsOverflows(){const e=this._tabsNav;if(!e||!this._visible(e))return!1;const t=Array.from(e.querySelectorAll(".tab-wrap"));if(t.length===0)return!1;const r=e.getBoundingClientRect();let s=r.left;for(const i of t){const a=i.getBoundingClientRect();a.width<=0||a.right>s&&(s=a.right)}return s-r.left>r.width+1}connectedCallback(){super.connectedCallback(),window.addEventListener("keydown",this._onGlobalFocusRingKeydown,!0),window.addEventListener("pointerdown",this._onGlobalFocusRingPointerDown,!0),this._initialUpgradeComplete||this.setAttribute("data-upgrading",""),this._harvest({scheduleMeasure:!1}),this._attachSlotObservers()}_finishInitialUpgrade(){this._initialUpgradeComplete||(this._initialUpgradeComplete=!0,requestAnimationFrame(()=>{this.isConnected&&(this._measure(),this.removeAttribute("data-upgrading"))}))}firstUpdated(){this._syncLandmarkAttributes(),this.renderRoot.addEventListener("focusin",this._onLocalFocusIn),this.showDrawer&&!this.deferDrawer&&this._ensureDrawerReady(),this.updateComplete.then(()=>{this._harvest({scheduleMeasure:!1}),this._attachSlotObservers(),this._syncDropdownTabs(),this._finishInitialUpgrade()});const e=this._top;e&&(this._ro=new ResizeObserver(()=>this._scheduleMeasure()),this._ro.observe(e)),window.addEventListener("resize",this._onWindowResize,{passive:!0})}updated(e){e.has("searchMax")&&this.style.setProperty("--scb-header-search-max",this.searchMax??"380px"),e.has("searchMin")&&this.style.setProperty("--scb-header-search-min",this.searchMin??"250px"),e.has("searchHeight")&&(this.searchHeight&&this.searchHeight.trim()?this.style.setProperty("--scb-search-height",this.searchHeight.trim()):this.style.removeProperty("--scb-search-height")),(e.has("logoWidth")||e.has("logoHeight")||e.has("logoAspectRatio"))&&this._applyLogoSizing(),(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom"))&&this._applySpacing(),(e.has("banner")||e.has("bannerLabel"))&&this._syncLandmarkAttributes(),(e.has("utilityItems")||e.has("tabs")||e.has("logoText")||e.has("logotypeText")||e.has("logoSrc")||e.has("logoWidth")||e.has("logoHeight")||e.has("logoAspectRatio")||e.has("activeTab")||e.has("_slotNavItems")||e.has("_slotUtils")||e.has("_slotMenu")||e.has("showDrawer")||e.has("alwaysShowMenuButton")||e.has("showSearch")||e.has("layoutPending")||e.has("searchMax")||e.has("searchMin")||e.has("size"))&&this.updateComplete.then(()=>{this._scheduleMeasure()}),(e.has("showDrawer")||e.has("deferDrawer"))&&this.showDrawer&&!this.deferDrawer&&this._ensureDrawerReady(),e.has("showSearch")&&!this.showSearch&&this._setMobileSearchOpen(!1),e.has("layoutPending")&&!this.layoutPending&&this.requestLayout(),(e.has("activeTab")||e.has("_slotNavItems")||e.has("tabs")||e.has("size"))&&this.updateComplete.then(()=>{this._syncDropdownTabs()})}disconnectedCallback(){this._ro?.disconnect(),this._slotMo?.disconnect(),this._slotWatchers.forEach(e=>e.disconnect()),this._slotWatchers=[],this.renderRoot.removeEventListener("focusin",this._onLocalFocusIn),window.removeEventListener("keydown",this._onGlobalFocusRingKeydown,!0),window.removeEventListener("pointerdown",this._onGlobalFocusRingPointerDown,!0),window.removeEventListener("resize",this._onWindowResize),super.disconnectedCallback()}_mapSpacingToken(e){if(!e)return;const t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}_applySpacing(){const e=this._mapSpacingToken(this.spacing),t=this._mapSpacingToken(this.spacingTop)??e,r=this._mapSpacingToken(this.spacingBottom)??e;t?this.style.setProperty("--scb-header-spacing-block-start",t):this.style.removeProperty("--scb-header-spacing-block-start"),r?this.style.setProperty("--scb-header-spacing-block-end",r):this.style.removeProperty("--scb-header-spacing-block-end")}_syncLandmarkAttributes(){const e=this.renderRoot.querySelector(".header-landmark");if(!e)return;if(!this.banner){e.removeAttribute("role"),e.removeAttribute("aria-label");return}e.setAttribute("role","banner");const t=(this.bannerLabel??"").trim();t?e.setAttribute("aria-label",t):e.removeAttribute("aria-label")}_applyLogoSizing(){const e=(this.logoWidth??"").trim(),t=(this.logoHeight??"").trim(),r=(this.logoAspectRatio??"").trim();e?this.style.setProperty("--scb-header-logo-img-w",e):this.style.removeProperty("--scb-header-logo-img-w"),t?this.style.setProperty("--scb-header-logo-img-h",t):e?this.style.setProperty("--scb-header-logo-img-h","auto"):this.style.removeProperty("--scb-header-logo-img-h"),r?this.style.setProperty("--scb-header-logo-img-aspect-ratio",r):this.style.removeProperty("--scb-header-logo-img-aspect-ratio")}_closeDrawerNow(){const e=this.renderRoot.querySelector(`#${this._drawerId}`);e&&(e.open=!1)}_openDrawerNow(){const e=this.renderRoot.querySelector(`#${this._drawerId}`);e&&(e.open=!0)}_ensureFocusRingReady(){customElements.get("md-focus-ring")||(this._focusRingImportPromise??(this._focusRingImportPromise=S(()=>import("../../vendor/lazy-focus-ring.js").then(e=>e.i),__vite__mapDeps([0,1,2]),import.meta.url)),this._focusRingImportPromise.then(({ensureFocusRingReady:e})=>{e()}))}async _ensureDrawerReady(){this._drawerReady||(this._drawerImportPromise??(this._drawerImportPromise=Promise.all([S(()=>import("../scb-drawer/scb-drawer.js"),__vite__mapDeps([3,4,5,6,7,8]),import.meta.url),S(()=>import("../scb-menu/scb-menu.js"),__vite__mapDeps([9,8,4,5,6,7,10,2,11,12,13]),import.meta.url),S(()=>import("../scb-search/scb-search.js"),__vite__mapDeps([14,4,2,5,15,1,6,16,17,0]),import.meta.url),S(()=>import("../../vendor/scb-header-drawer.internal.js").then(e=>{this._drawerRenderer=e}),__vite__mapDeps([18,5,6]),import.meta.url),this._ensureDrawerSlotComponentsReady()]).then(()=>{})),await this._drawerImportPromise,this._drawerReady=!0,this._syncDrawerCloseNodes())}_drawerSlotContains(e){return[...this.querySelectorAll('[slot="drawer-menu"], [slot="drawer-close"]')].some(t=>t.matches(e)||!!t.querySelector(e))}async _ensureDrawerSlotComponentsReady(){this.querySelector('[slot="drawer-menu"], [slot="drawer-close"]')&&await Promise.all([this._drawerSlotContains("scb-button")?S(()=>import("../scb-button/scb-button.js"),__vite__mapDeps([19,8,4,2,5,6]),import.meta.url):Promise.resolve(),this._drawerSlotContains("scb-icon-button")?S(()=>import("../scb-icon-button/scb-icon-button.js"),__vite__mapDeps([20,8,4,2,5,6]),import.meta.url):Promise.resolve(),this._drawerSlotContains("scb-skeleton")?S(()=>import("../scb-skeleton/scb-skeleton.js"),__vite__mapDeps([21,4,5,6]),import.meta.url):Promise.resolve(),this._drawerSlotContains("scb-grid")?S(()=>import("../scb-grid/scb-grid.js"),__vite__mapDeps([22,8,4,5,6,23,24]),import.meta.url):Promise.resolve(),this._drawerSlotContains("scb-grid-item")?S(()=>import("../scb-grid/scb-grid-item.js"),__vite__mapDeps([23,8,4,5,6]),import.meta.url):Promise.resolve()])}async _ensureDropdownReady(){customElements.get("scb-dropdown")||(this._dropdownImportPromise??(this._dropdownImportPromise=S(()=>import("../scb-dropdown/scb-dropdown.js").then(()=>{}),__vite__mapDeps([25,4,5,15,1,6,19,8,2,11,26,27,16,17,7,0,28]),import.meta.url)),await this._dropdownImportPromise)}_syncMenuBtnAria(){this.renderRoot.querySelectorAll(".menu-trigger").forEach(e=>{e.setAttribute("aria-expanded",String(this._menuExpanded))})}_getNavItems(){return this._slotNavItems.length?this._slotNavItems:(this.tabs??[]).map(e=>({kind:"tab",...e}))}_getDropdownForSlot(e){const t=this.querySelector(`[slot="${e}"]`);return t?t.tagName.toLowerCase()==="scb-dropdown"?t:t.querySelector("scb-dropdown"):null}_syncDropdownTabs(){this._getNavItems().forEach((e,t)=>{if(e.kind!=="dropdown")return;const r=this._getDropdownForSlot(e.slotName);if(!r)return;const s=String(t);r.getAttribute("data-index")!==s&&r.setAttribute("data-index",s),r.hasAttribute("as-tab")||r.setAttribute("as-tab","");const i=this.size,a=r;a?.size!==i&&(a.size=i),t===this.activeTab?r.getAttribute("aria-current")!=="page"&&r.setAttribute("aria-current","page"):r.hasAttribute("aria-current")&&r.removeAttribute("aria-current")})}_readTabIndexFromEvent(e){const t=e.composedPath?e.composedPath():[];for(const r of t){if(!(r instanceof HTMLElement))continue;const s=r.getAttribute("data-index");if(s==null)continue;const i=Number(s);if(Number.isFinite(i))return i}return null}_focusTabAtIndex(e){const t=this._getNavItems()[e];if(t){if(t.kind==="dropdown"){this._getDropdownForSlot(t.slotName)?.focus?.();return}this.renderRoot.querySelector(`.tab-link[data-index="${e}"]`)?.focus?.()}}_syncFlags(e,t){this.toggleAttribute("data-no-utility",e),this.toggleAttribute("data-no-search",t)}_emitSearchInput(e){this.searchText=e,this.dispatchEvent(new CustomEvent("search-input",{detail:{value:this.searchText},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("searchinput",{detail:{value:this.searchText},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("search-text-change",{detail:{value:this.searchText},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("searchtextchange",{detail:{value:this.searchText},bubbles:!0,composed:!0}))}_emitSearchChange(e,t){this.searchText=e,this.dispatchEvent(new CustomEvent("search-change",{detail:{value:this.searchText,active:t},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("searchchange",{detail:{value:this.searchText,active:t},bubbles:!0,composed:!0}))}_renderMenuButton(e="",t=!1){const r=e?`menu-trigger ${e}`:"menu-trigger",s=(this.menuButtonLabel??"").trim()||"Meny",i=this._menuExpanded?"true":"false";return t?m`
|
|
56
56
|
<button
|
|
57
57
|
type="button"
|
|
58
58
|
class=${`${r} header-icon-button`}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["
|
|
2
|
-
import{f,h as v,m,p as s,v as c,y}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as z}from"../../vendor/preload-helper.js";import{t as e}from"../../vendor/decorate.js";import{
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../../vendor/lazy-focus-ring.js","../../vendor/rolldown-runtime.js","../../vendor/preload-helper.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{f,h as v,m,p as s,v as c,y}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as z}from"../../vendor/preload-helper.js";import{t as e}from"../../vendor/decorate.js";import{t as d}from"../../vendor/scb-icon-svg.js";(function(){try{var h=typeof globalThis<"u"?globalThis:window;if(!h.__scb_ce_guard_installed__){h.__scb_ce_guard_installed__=!0;var o=customElements.define.bind(customElements);customElements.define=function(t,r,i){try{customElements.get(t)||o(t,r,i)}catch(a){var n=String(a||"");if(n.indexOf("already been used")===-1&&n.indexOf("NotSupportedError")===-1)throw a}}}}catch{}})();var p,b;function g(){return b??(b=z(()=>import("../../vendor/lazy-focus-ring.js").then(h=>h.i),__vite__mapDeps([0,1,2]),import.meta.url)),b}var l=(p=class extends v{constructor(...o){super(...o),this.variant="standard",this.width="100%",this.showScrollbar=!1,this.rightScrollButtonLabel="Scrolla höger",this.leftScrollButtonLabel="Scrolla vänster",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.contentFlex=!1,this.internalGap="",this._canScrollLeft=!1,this._canScrollRight=!1,this.__scrollLeft=()=>{this.doScrollBy(-this.getScrollStep())},this.__scrollRight=()=>{this.doScrollBy(this.getScrollStep())},this.updateScrollButtons=()=>{const t=this.scrollerEl||this.shadowRoot?.querySelector(".scb-horizontal-scroller");if(!t){this._canScrollLeft=!1,this._canScrollRight=!1,this.toggleAttribute("data-scroll-left",!1),this.toggleAttribute("data-scroll-right",!1);return}const r=t.scrollLeft>0,i=t.scrollLeft+t.clientWidth<t.scrollWidth-1;this._canScrollLeft=r,this._canScrollRight=i,this.toggleAttribute("data-scroll-left",r),this.toggleAttribute("data-scroll-right",i)},this.lastScrollLeft=0,this.isScrolling=!1,this.scrollEndTimeout=null,this.scrollerEl=null,this.slotEl=null,this.sizeObserver=null,this.resizeRaf=null,this.__onFocusIn=()=>{g().then(({ensureFocusRingReady:t})=>t())},this.__onLazyFocusRingKeydown=t=>{!(t instanceof KeyboardEvent)||t.key!=="Tab"||g().then(({ensureFocusRingOnTab:r})=>r(t))},this.handleScroll=()=>{const t=this.scrollerEl;t&&(this.updateScrollButtons(),this.dispatchCustomEventWithAlias("scb-scroll",{scrollLeft:t.scrollLeft}),this.isScrolling||(this.isScrolling=!0,this.dispatchCustomEventWithAlias("scb-scroll-start",{scrollLeft:t.scrollLeft})),clearTimeout(this.scrollEndTimeout),this.scrollEndTimeout=setTimeout(()=>{this.isScrolling=!1,this.dispatchCustomEventWithAlias("scb-scroll-end",{scrollLeft:t.scrollLeft})},120),t.scrollLeft>this.lastScrollLeft?this.dispatchCustomEventWithAlias("scb-scroll-right",{scrollLeft:t.scrollLeft}):t.scrollLeft<this.lastScrollLeft&&this.dispatchCustomEventWithAlias("scb-scroll-left",{scrollLeft:t.scrollLeft}),this.lastScrollLeft=t.scrollLeft)},this.handleWheel=t=>{const r=this.scrollerEl||this.shadowRoot?.querySelector(".scb-horizontal-scroller");if(!r||t.deltaY===0)return;const i=r.scrollLeft,n=i>0,a=i+r.clientWidth<r.scrollWidth-1;!n&&!a||(r.scrollLeft+=t.deltaY,r.scrollLeft!==i&&t.preventDefault())}}getScrollStep(){const o=this.scrollerEl||this.shadowRoot?.querySelector(".scb-horizontal-scroller");return o?Math.max(Math.round(o.clientWidth*.8),120):200}doScrollBy(o){this.scrollerEl?.scrollBy({left:o,behavior:"smooth"})}connectedCallback(){super.connectedCallback(),this.addEventListener("focusin",this.__onFocusIn),this.addEventListener("keydown",this.__onLazyFocusRingKeydown),this.style.setProperty("--scb-horizontal-scroller-width",this.width)}disconnectedCallback(){this.removeEventListener("focusin",this.__onFocusIn),this.removeEventListener("keydown",this.__onLazyFocusRingKeydown),this.renderRoot.removeEventListener("focusin",this.__onFocusIn),this.renderRoot.removeEventListener("keydown",this.__onLazyFocusRingKeydown),super.disconnectedCallback(),this.scrollerEl&&(this.scrollerEl.removeEventListener("scroll",this.handleScroll),this.scrollerEl.removeEventListener("wheel",this.handleWheel)),this.sizeObserver&&(this.sizeObserver.disconnect(),this.sizeObserver=null),this.resizeRaf!==null&&(cancelAnimationFrame(this.resizeRaf),this.resizeRaf=null),this.scrollEndTimeout&&(clearTimeout(this.scrollEndTimeout),this.scrollEndTimeout=null),this.scrollerEl=null,this.slotEl=null}dispatchCustomEvent(o,t={}){this.dispatchEvent(new CustomEvent(o,{detail:t,bubbles:!0,composed:!0}))}dispatchCustomEventWithAlias(o,t={}){if(this.dispatchCustomEvent(o,t),o.includes("-")){const r=o.replace(/-/g,"");this.dispatchCustomEvent(r,t)}}firstUpdated(){this.renderRoot.addEventListener("focusin",this.__onFocusIn),this.renderRoot.addEventListener("keydown",this.__onLazyFocusRingKeydown),this.scrollerEl=this.shadowRoot?.querySelector(".scb-horizontal-scroller"),this.slotEl=this.shadowRoot?.querySelector("slot"),this.scrollerEl&&(this.scrollerEl.addEventListener("scroll",this.handleScroll),this.scrollerEl.addEventListener("wheel",this.handleWheel,{passive:!1}));const o=()=>{this.resizeRaf===null&&(this.resizeRaf=requestAnimationFrame(()=>{this.resizeRaf=null,this.updateScrollButtons()}))};requestAnimationFrame(()=>{this.updateScrollButtons()}),this.slotEl&&this.slotEl.addEventListener("slotchange",()=>{o()}),this.sizeObserver=new ResizeObserver(()=>{o()}),this.scrollerEl&&this.sizeObserver.observe(this.scrollerEl),this.slotEl&&this.sizeObserver.observe(this.slotEl),this.__applySpacing(),this.__applyInternalGap()}updated(o){o.has("width")&&this.style.setProperty("--scb-horizontal-scroller-width",this.width),(o.has("spacing")||o.has("spacingTop")||o.has("spacingBottom")||o.has("spacingLeft")||o.has("spacingRight"))&&this.__applySpacing(),(o.has("internalGap")||o.has("contentFlex"))&&this.__applyInternalGap()}mapSpacingToken(o){if(!o)return;const t=String(o).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}__applySpacing(){const o=this.mapSpacingToken(this.spacing),t=this.mapSpacingToken(this.spacingTop),r=this.mapSpacingToken(this.spacingBottom),i=this.mapSpacingToken(this.spacingLeft),n=this.mapSpacingToken(this.spacingRight),a=t??o,u=r??o;a?this.style.setProperty("--scb-horizontal-scroller-spacing-block-start",a):this.style.removeProperty("--scb-horizontal-scroller-spacing-block-start"),u?this.style.setProperty("--scb-horizontal-scroller-spacing-block-end",u):this.style.removeProperty("--scb-horizontal-scroller-spacing-block-end"),i?this.style.setProperty("--scb-horizontal-scroller-spacing-inline-start",i):this.style.removeProperty("--scb-horizontal-scroller-spacing-inline-start"),n?this.style.setProperty("--scb-horizontal-scroller-spacing-inline-end",n):this.style.removeProperty("--scb-horizontal-scroller-spacing-inline-end")}__applyInternalGap(){const o=this.mapSpacingToken(this.internalGap);this.contentFlex&&o?this.style.setProperty("--scb-horizontal-scroller-internal-gap",o):this.style.removeProperty("--scb-horizontal-scroller-internal-gap")}render(){const o=this.variant,t=this._canScrollLeft||this._canScrollRight;return o==="inline"?c`
|
|
3
3
|
<div class="scb-horizontal-scroller ${t?"canScroll":""}" tabindex="0">
|
|
4
4
|
<slot></slot>
|
|
5
5
|
<md-focus-ring inward></md-focus-ring>
|
|
@@ -13,7 +13,7 @@ import{f,h as v,m,p as s,v as c,y}from"../../vendor/vendor.js";import"../../vend
|
|
|
13
13
|
aria-label="Scrolla vänster"
|
|
14
14
|
@click=${this.__scrollLeft}
|
|
15
15
|
>
|
|
16
|
-
${
|
|
16
|
+
${d("chevron_left","scroll-control-icon")}
|
|
17
17
|
<span>${this.leftScrollButtonLabel}</span>
|
|
18
18
|
</button>
|
|
19
19
|
`:""}
|
|
@@ -26,7 +26,7 @@ import{f,h as v,m,p as s,v as c,y}from"../../vendor/vendor.js";import"../../vend
|
|
|
26
26
|
@click=${this.__scrollRight}
|
|
27
27
|
>
|
|
28
28
|
<span>${this.rightScrollButtonLabel}</span>
|
|
29
|
-
${
|
|
29
|
+
${d("chevron_right","scroll-control-icon")}
|
|
30
30
|
</button>
|
|
31
31
|
`:""}
|
|
32
32
|
</div>
|
|
@@ -39,7 +39,7 @@ import{f,h as v,m,p as s,v as c,y}from"../../vendor/vendor.js";import"../../vend
|
|
|
39
39
|
aria-label="Scrolla vänster"
|
|
40
40
|
@click=${this.__scrollLeft}
|
|
41
41
|
>
|
|
42
|
-
${
|
|
42
|
+
${d("chevron_left","scroll-control-icon")}
|
|
43
43
|
</button>
|
|
44
44
|
`:""}
|
|
45
45
|
<div class="scroll-shadow-left"></div>
|
|
@@ -55,7 +55,7 @@ import{f,h as v,m,p as s,v as c,y}from"../../vendor/vendor.js";import"../../vend
|
|
|
55
55
|
aria-label="Scrolla höger"
|
|
56
56
|
@click=${this.__scrollRight}
|
|
57
57
|
>
|
|
58
|
-
${
|
|
58
|
+
${d("chevron_right","scroll-control-icon")}
|
|
59
59
|
</button>
|
|
60
60
|
`:""}
|
|
61
61
|
`}},p.styles=y`:host{display:flex;position:relative;align-items:center;gap:var(--spacing-3);padding:0;overflow:hidden;margin-block-start:var(--scb-horizontal-scroller-spacing-block-start, 0);margin-block-end:var(--scb-horizontal-scroller-spacing-block-end, 0);margin-inline-start:var(--scb-horizontal-scroller-spacing-inline-start, 0);margin-inline-end:var(--scb-horizontal-scroller-spacing-inline-end, 0)}.scb-horizontal-scroller{overflow-x:auto;-ms-overflow-style:none;scrollbar-width:none;width:100%}:host([data-scroll-left]:not([variant='inline'])) .scb-horizontal-scroller{-webkit-mask-image:linear-gradient(to right,transparent 0,black var(--scb-horizontal-scroller-edge-fade-size, 56px),black 100%);mask-image:linear-gradient(to right,transparent 0,black var(--scb-horizontal-scroller-edge-fade-size, 56px),black 100%)}:host([data-scroll-right]:not([variant='inline'])) .scb-horizontal-scroller{-webkit-mask-image:linear-gradient(to right,black 0,black calc(100% - var(--scb-horizontal-scroller-edge-fade-size, 56px)),transparent 100%);mask-image:linear-gradient(to right,black 0,black calc(100% - var(--scb-horizontal-scroller-edge-fade-size, 56px)),transparent 100%)}:host([data-scroll-left][data-scroll-right]:not([variant='inline'])) .scb-horizontal-scroller{-webkit-mask-image:linear-gradient(to right,transparent 0,black var(--scb-horizontal-scroller-edge-fade-size, 56px),black calc(100% - var(--scb-horizontal-scroller-edge-fade-size, 56px)),transparent 100%);mask-image:linear-gradient(to right,transparent 0,black var(--scb-horizontal-scroller-edge-fade-size, 56px),black calc(100% - var(--scb-horizontal-scroller-edge-fade-size, 56px)),transparent 100%)}:host([show-scrollbar]) .scb-horizontal-scroller{scrollbar-width:auto}:host([content-flex]) .scb-horizontal-scroller{display:flex;flex-direction:row;flex:1 1 auto}.scb-horizontal-scroller::-webkit-scrollbar{border-radius:var(--md-sys-shape-corner-large);height:4px;width:10px}.scb-horizontal-scroller::-webkit-scrollbar-thumb{background:var(--md-sys-color-on-surface);border-radius:var(--md-sys-shape-corner-large);cursor:pointer}.scb-horizontal-scroller::-webkit-scrollbar-track{background:var(--md-sys-color-secondary-container);border-radius:var(--md-sys-shape-corner-large)}.scb-horizontal-scroller:focus,.scroll-control:focus,.scroll-text-button:focus{outline:0}md-focus-ring{border-radius:var(--scb-card-focus-ring-radius, var(--md-sys-shape-corner-large))}:host([show-scrollbar]) .scb-horizontal-scroller.canScroll{padding-bottom:var(--spacing-5)}slot{display:block;box-sizing:border-box;padding-block:var(--spacing-3);padding-inline:2px;min-width:var(--scb-horizontal-scroller-width, auto)}:host([content-flex]) .scb-horizontal-scroller slot{display:flex;gap:var(--scb-horizontal-scroller-internal-gap)}.scroll-button-left{left:0;position:absolute;z-index:3}.scroll-button-right{right:2px;position:absolute;z-index:3}.scroll-control,.scroll-text-button{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;border:0;font-family:var(--brand-font, var(--brand, "Inter"), sans-serif);font-weight:var(--weight-semibold, 600);cursor:pointer;appearance:none;-webkit-appearance:none;-webkit-tap-highlight-color:transparent;touch-action:manipulation;border-radius:var(--radius-full, 1000px)}.scroll-control{inline-size:var(--scb-icon-button-container-size, 40px);block-size:var(--scb-icon-button-container-size, 40px);padding:0;overflow:hidden;background:var(--md-filled-tonal-icon-button-container-color, var(--md-sys-color-secondary-container, var(--p-90, #d6f1ff)));color:var(--md-filled-tonal-icon-button-icon-color, var(--md-sys-color-on-secondary-container, var(--p-30, #1e00be)))}.scroll-text-button{position:relative;min-block-size:calc(var(--md-sys-typescale-label-small-line-height, 20px) + calc(var(--spacing-4, 12px) - var(--spacing-1, 2px)) + calc(var(--spacing-4, 12px) - var(--spacing-1, 2px)));gap:var(--spacing-3, 8px);padding-block:calc(var(--spacing-4, 12px) - var(--spacing-1, 2px));padding-inline:var(--spacing-5, 16px);background:0 0;color:var(--md-text-button-label-text-color, var(--md-sys-color-primary, var(--p-40, #1f44ff)));font-size:var(--md-sys-typescale-label-small-size, 16px);line-height:var(--md-sys-typescale-label-small-line-height, 20px);letter-spacing:var(--md-sys-typescale-label-small-tracking, 0)}.scroll-control::before,.scroll-text-button::before{content:"";position:absolute;inset:0;border-radius:inherit;background:currentColor;opacity:0;pointer-events:none;transition:opacity var(--motion-duration-short, 150ms) var(--motion-easing-standard, ease)}.scroll-control:hover::before,.scroll-text-button:hover::before{opacity:var(--md-sys-state-hover-state-layer-opacity, 0.08)}.scroll-control:active::before,.scroll-text-button:active::before{opacity:var(--md-sys-state-pressed-state-layer-opacity, 0.12)}.scroll-control:focus-visible,.scroll-text-button:focus-visible{outline:var(--stroke-border-m, 2px) solid var(--md-focus-ring-color, var(--md-sys-color-primary, var(--p-40, #1f44ff)));outline-offset:var(--spacing-1, 2px)}.scroll-control-icon{position:relative;display:inline-block;inline-size:var(--icon-size-medium, 24px);block-size:var(--icon-size-medium, 24px);overflow:hidden;font-family:"Material Symbols Outlined";font-size:var(--icon-size-medium, 24px);line-height:1;text-align:center;white-space:nowrap;text-transform:none;word-wrap:normal;direction:ltr;font-feature-settings:"liga"1;font-variation-settings:"FILL"0,"wght"400,"GRAD"0,"opsz"24;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.scroll-control-icon.scb-svg-icon{fill:currentColor;font:inherit}.scroll-shadow-left,.scroll-shadow-right{position:absolute;top:0;width:5px;bottom:0;pointer-events:none;background:0 0;box-shadow:none;transition:box-shadow .2s;z-index:2}.scroll-shadow-left{left:0}.scroll-shadow-right{right:0}:host([data-scroll-left]) .scroll-shadow-left{background:0 0;box-shadow:12px 0 30px color-mix(in srgb,currentColor 18%,transparent),4px 0 12px color-mix(in srgb,currentColor 12%,transparent)}:host([data-scroll-left]) .scroll-shadow-left::after,:host([data-scroll-right]) .scroll-shadow-right::after{content:"";position:absolute;inset-block:0}:host([data-scroll-right]) .scroll-shadow-right{background:0 0;box-shadow:-12px 0 30px color-mix(in srgb,currentColor 18%,transparent),-4px 0 12px color-mix(in srgb,currentColor 12%,transparent)}:host([variant='inline']){flex-direction:column;align-items:unset;padding:0}:host([variant='inline'][show-scrollbar]){gap:var(--spacing-5)}`,p);e([s({type:String,reflect:!0})],l.prototype,"variant",void 0);e([s({type:String,reflect:!0})],l.prototype,"width",void 0);e([s({type:Boolean,reflect:!0,attribute:"show-scrollbar"})],l.prototype,"showScrollbar",void 0);e([s({type:String,reflect:!0,attribute:"right-scroll-button-label"})],l.prototype,"rightScrollButtonLabel",void 0);e([s({type:String,reflect:!0,attribute:"left-scroll-button-label"})],l.prototype,"leftScrollButtonLabel",void 0);e([s({type:String,reflect:!0})],l.prototype,"spacing",void 0);e([s({type:String,reflect:!0,attribute:"spacing-top"})],l.prototype,"spacingTop",void 0);e([s({type:String,reflect:!0,attribute:"spacing-bottom"})],l.prototype,"spacingBottom",void 0);e([s({type:String,reflect:!0,attribute:"spacing-left"})],l.prototype,"spacingLeft",void 0);e([s({type:String,reflect:!0,attribute:"spacing-right"})],l.prototype,"spacingRight",void 0);e([s({type:Boolean,reflect:!0,attribute:"content-flex"})],l.prototype,"contentFlex",void 0);e([s({type:String,reflect:!0,attribute:"internal-gap"})],l.prototype,"internalGap",void 0);e([f()],l.prototype,"_canScrollLeft",void 0);e([f()],l.prototype,"_canScrollRight",void 0);l=e([m("scb-horizontal-scroller")],l);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["
|
|
2
|
-
import{g as s,h as y,m as R,p as r,v as d,y as x}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as m}from"../../vendor/preload-helper.js";import{t as n}from"../../vendor/decorate.js";import{n as z,t as v}from"../../vendor/assertClassBrand.js";(function(){try{var
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../../vendor/lazy-focus-ring.js","../../vendor/rolldown-runtime.js","../../vendor/preload-helper.js","../../vendor/lazy-ripple.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{g as s,h as y,m as R,p as r,v as d,y as x}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as m}from"../../vendor/preload-helper.js";import{t as n}from"../../vendor/decorate.js";import{n as z,t as v}from"../../vendor/assertClassBrand.js";(function(){try{var c=typeof globalThis<"u"?globalThis:window;if(!c.__scb_ce_guard_installed__){c.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(t,i,a){try{customElements.get(t)||e(t,i,a)}catch(p){var l=String(p||"");if(l.indexOf("already been used")===-1&&l.indexOf("NotSupportedError")===-1)throw p}}}}catch{}})();var u,b,h,f;function S(){return h??(h=m(()=>import("../../vendor/lazy-focus-ring.js").then(c=>c.i),__vite__mapDeps([0,1,2]),import.meta.url)),h}function g(){return f??(f=m(()=>import("../../vendor/lazy-ripple.js"),__vite__mapDeps([3,2]),import.meta.url)),f}var o=(u=new WeakSet,b=class extends y{constructor(...e){super(...e),z(this,u),this.icon="home",this.ariaLabel="",this.variant="standard",this.size="medium",this.shape="round",this.toggle=!1,this.selected=!1,this.toggleofficon="add",this.toggleonicon="remove",this.disabled=!1,this.href="",this.target="",this.rel="",this.__filledValue=!1,this.__focusRingReady=!1,this.__focusRingImportRequested=!1,this.__rippleReady=!1,this.__pendingRippleClick=!1,this.__ensureFocusRing=()=>{this.__focusRingReady||this.__focusRingImportRequested||(this.__focusRingImportRequested=!0,S().then(({ensureFocusRingReady:t})=>(t(),customElements.whenDefined("md-focus-ring"))).then(()=>{this.__focusRingReady=!0,this.toggleAttribute("data-native-focus-ring-ready",!0),this.requestUpdate(),this.updateComplete.then(()=>this.__syncInteractiveState())}))},this.__onFocusIn=t=>{const i=t.composedPath()[0];i instanceof HTMLElement&&i.matches(":focus-visible")&&this.__ensureFocusRing()},this.__ensureRipple=(t,i=!1)=>{this.__rippleReady||this.disabled||(t&&(this.__pendingRippleEvent=t),i&&(this.__pendingRippleClick=!0),g().then(({ensureRippleReady:a})=>a()).then(()=>{this.disabled||(this.__rippleReady=!0,this.toggleAttribute("data-native-ripple-ready",!0),this.requestUpdate(),this.updateComplete.then(()=>this.__replayRippleState()))}))},this.__onPointerInteraction=t=>{this.__ensureRipple(t)},this.__onClick=t=>{if(this.disabled){t.preventDefault(),t.stopPropagation();return}this.toggle&&(this.selected=!this.selected,this.dispatchEvent(new CustomEvent("change",{detail:{selected:this.selected},bubbles:!0,composed:!0}))),this.__ensureRipple(void 0,!0)}}get filled(){return this.__filledValue}set filled(e){const t=!!e,i=this.__filledValue;i!==t&&(this.__filledValue=t,this.requestUpdate("filled",i),this.requestUpdate("iconFilled",i))}get iconFilled(){return this.__filledValue}set iconFilled(e){const t=!!e,i=this.__filledValue;i!==t&&(this.__filledValue=t,this.requestUpdate("iconFilled",i),this.requestUpdate("filled",i))}firstUpdated(){v(u,this,_).call(this),this.__syncInteractiveState()}updated(e){super.updated(e),(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom")||e.has("spacingLeft")||e.has("spacingRight"))&&v(u,this,_).call(this),(this.__focusRingReady||this.__rippleReady)&&this.updateComplete.then(()=>this.__syncInteractiveState())}focus(e){const t=this.__getNativeControl();if(t){t.focus(e);return}super.focus(e)}__getNativeControl(){return this.renderRoot.querySelector(".native-icon-button")}__syncInteractiveState(){const e=this.__getNativeControl(),t=this.renderRoot.querySelector("md-focus-ring");t&&e&&(t.control=e,t.visible=e.matches(":focus-visible"));const i=this.renderRoot.querySelector("md-ripple");i&&e&&(i.control=e)}async __replayRippleState(){const e=this.renderRoot.querySelector("md-ripple"),t=this.__getNativeControl(),i=this.__pendingRippleEvent,a=this.__pendingRippleClick;this.__pendingRippleEvent=void 0,this.__pendingRippleClick=!1;const{syncRippleToControl:l}=await g();await l(e,t,i,a),this.__syncInteractiveState()}__effectiveLabel(){return(this.ariaLabel||this.getAttribute("aria-label")||"").trim()||this.__currentIcon()||s}__currentIcon(){return this.toggle?this.selected?this.toggleonicon:this.toggleofficon:this.icon}mapSpacingToken(e){if(!e)return;const t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}__renderControl(e){const t=this.__effectiveLabel(),i=this.getAttribute("aria-controls")??s,a=this.getAttribute("aria-expanded")??s,l=this.toggle?String(this.selected):s,p=this.getAttribute("title")??s;return this.href?d`
|
|
3
3
|
<a
|
|
4
4
|
class="native-icon-button"
|
|
5
5
|
part="button"
|
|
@@ -10,7 +10,7 @@ import{g as s,h as y,m as R,p as r,v as d,y as x}from"../../vendor/vendor.js";im
|
|
|
10
10
|
aria-label=${t}
|
|
11
11
|
aria-controls=${i}
|
|
12
12
|
aria-expanded=${a}
|
|
13
|
-
aria-pressed=${
|
|
13
|
+
aria-pressed=${l}
|
|
14
14
|
aria-disabled=${this.disabled?"true":s}
|
|
15
15
|
tabindex=${this.disabled?"-1":s}
|
|
16
16
|
@click=${this.__onClick}
|
|
@@ -30,7 +30,7 @@ import{g as s,h as y,m as R,p as r,v as d,y as x}from"../../vendor/vendor.js";im
|
|
|
30
30
|
aria-label=${t}
|
|
31
31
|
aria-controls=${i}
|
|
32
32
|
aria-expanded=${a}
|
|
33
|
-
aria-pressed=${
|
|
33
|
+
aria-pressed=${l}
|
|
34
34
|
@click=${this.__onClick}
|
|
35
35
|
@focusin=${this.__onFocusIn}
|
|
36
36
|
@pointerenter=${this.__onPointerInteraction}
|
|
@@ -56,4 +56,4 @@ import{g as s,h as y,m as R,p as r,v as d,y as x}from"../../vendor/vendor.js";im
|
|
|
56
56
|
var(--md-sys-color-secondary-container, var(--p-90, #d6f1ff))
|
|
57
57
|
);color:var(--md-filled-tonal-icon-button-selected-icon-color,
|
|
58
58
|
var(--md-sys-color-on-secondary-container, var(--p-30, #1e00be))
|
|
59
|
-
)}:host([variant='outlined'][toggle][selected]) .native-icon-button{color:var(--md-outlined-icon-button-selected-icon-color, var(--md-sys-color-primary, var(--p-40, #1f44ff)));box-shadow:inset 0 0 0 var(--stroke-border, 1px) var(--md-outlined-icon-button-selected-outline-color, var(--md-sys-color-outline, var(--p-20, #0f0865)))}.native-icon-button:disabled,.native-icon-button[aria-disabled=true]{color:var(--md-icon-button-disabled-icon-color, rgb(15 8 101 / 38%));cursor:default;pointer-events:none}:host([variant='filled']) .native-icon-button:disabled,:host([variant='filled']) .native-icon-button[aria-disabled=true],:host([variant='filled-tonal']) .native-icon-button:disabled,:host([variant='filled-tonal']) .native-icon-button[aria-disabled=true]{background:var(--md-filled-icon-button-disabled-container-color, rgb(15 8 101 / 12%));color:var(--md-filled-icon-button-disabled-icon-color, rgb(15 8 101 / 38%))}:host([variant='outlined']) .native-icon-button:disabled,:host([variant='outlined']) .native-icon-button[aria-disabled=true]{color:var(--md-outlined-icon-button-disabled-icon-color, rgb(15 8 101 / 38%));box-shadow:inset 0 0 0 var(--stroke-border, 1px) var(--md-outlined-icon-button-disabled-outline-color, rgb(15 8 101 / 12%))}.native-icon-button-wrap md-ripple{position:absolute;inset:0;--md-ripple-hover-color:var(--scb-icon-button-state-layer-color, currentColor);--md-ripple-pressed-color:var(--scb-icon-button-state-layer-color, currentColor)}.native-icon-button-wrap md-focus-ring,.native-icon-button-wrap md-ripple{pointer-events:none;border-radius:inherit}`,b);function _(){const
|
|
59
|
+
)}:host([variant='outlined'][toggle][selected]) .native-icon-button{color:var(--md-outlined-icon-button-selected-icon-color, var(--md-sys-color-primary, var(--p-40, #1f44ff)));box-shadow:inset 0 0 0 var(--stroke-border, 1px) var(--md-outlined-icon-button-selected-outline-color, var(--md-sys-color-outline, var(--p-20, #0f0865)))}.native-icon-button:disabled,.native-icon-button[aria-disabled=true]{color:var(--md-icon-button-disabled-icon-color, rgb(15 8 101 / 38%));cursor:default;pointer-events:none}:host([variant='filled']) .native-icon-button:disabled,:host([variant='filled']) .native-icon-button[aria-disabled=true],:host([variant='filled-tonal']) .native-icon-button:disabled,:host([variant='filled-tonal']) .native-icon-button[aria-disabled=true]{background:var(--md-filled-icon-button-disabled-container-color, rgb(15 8 101 / 12%));color:var(--md-filled-icon-button-disabled-icon-color, rgb(15 8 101 / 38%))}:host([variant='outlined']) .native-icon-button:disabled,:host([variant='outlined']) .native-icon-button[aria-disabled=true]{color:var(--md-outlined-icon-button-disabled-icon-color, rgb(15 8 101 / 38%));box-shadow:inset 0 0 0 var(--stroke-border, 1px) var(--md-outlined-icon-button-disabled-outline-color, rgb(15 8 101 / 12%))}.native-icon-button-wrap md-ripple{position:absolute;inset:0;--md-ripple-hover-color:var(--scb-icon-button-state-layer-color, currentColor);--md-ripple-pressed-color:var(--scb-icon-button-state-layer-color, currentColor)}.native-icon-button-wrap md-focus-ring,.native-icon-button-wrap md-ripple{pointer-events:none;border-radius:inherit}`,b);function _(){const c=this.mapSpacingToken(this.spacing),e=this.mapSpacingToken(this.spacingTop)??c,t=this.mapSpacingToken(this.spacingBottom)??c,i=this.mapSpacingToken(this.spacingLeft),a=this.mapSpacingToken(this.spacingRight);e?this.style.setProperty("--scb-icon-button-spacing-block-start",e):this.style.removeProperty("--scb-icon-button-spacing-block-start"),t?this.style.setProperty("--scb-icon-button-spacing-block-end",t):this.style.removeProperty("--scb-icon-button-spacing-block-end"),i?this.style.setProperty("--scb-icon-button-spacing-inline-start",i):this.style.removeProperty("--scb-icon-button-spacing-inline-start"),a?this.style.setProperty("--scb-icon-button-spacing-inline-end",a):this.style.removeProperty("--scb-icon-button-spacing-inline-end")}n([r({type:String})],o.prototype,"icon",void 0);n([r({type:Boolean,reflect:!0})],o.prototype,"filled",null);n([r({type:Boolean,attribute:"icon-filled",reflect:!0})],o.prototype,"iconFilled",null);n([r({type:String,attribute:"aria-label"})],o.prototype,"ariaLabel",void 0);n([r({type:String,reflect:!0})],o.prototype,"variant",void 0);n([r({type:String,reflect:!0})],o.prototype,"size",void 0);n([r({type:String,reflect:!0})],o.prototype,"shape",void 0);n([r({type:Boolean,reflect:!0})],o.prototype,"toggle",void 0);n([r({type:Boolean,reflect:!0})],o.prototype,"selected",void 0);n([r({type:String})],o.prototype,"toggleofficon",void 0);n([r({type:String})],o.prototype,"toggleonicon",void 0);n([r({type:Boolean,reflect:!0})],o.prototype,"disabled",void 0);n([r({type:String,reflect:!0})],o.prototype,"spacing",void 0);n([r({type:String,attribute:"spacing-top",reflect:!0})],o.prototype,"spacingTop",void 0);n([r({type:String,attribute:"spacing-bottom",reflect:!0})],o.prototype,"spacingBottom",void 0);n([r({type:String,attribute:"spacing-left",reflect:!0})],o.prototype,"spacingLeft",void 0);n([r({type:String,attribute:"spacing-right",reflect:!0})],o.prototype,"spacingRight",void 0);n([r({type:String})],o.prototype,"href",void 0);n([r({type:String})],o.prototype,"target",void 0);n([r({type:String})],o.prototype,"rel",void 0);o=n([R("scb-icon-button")],o);export{o as ScbIconButton};
|