scb-wc-test 0.1.211 → 0.1.212

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/mvc/components/scb-calendar/scb-calendar-event.js +3 -3
  2. package/mvc/components/scb-calendar/scb-calendar.js +22 -22
  3. package/mvc/components/scb-card/scb-card.js +64 -64
  4. package/mvc/components/scb-cookies-consent/scb-cookies-consent.js +3 -3
  5. package/mvc/components/scb-drawer/scb-drawer.js +2 -2
  6. package/mvc/components/scb-dropdown/scb-dropdown.js +1 -1
  7. package/mvc/components/scb-fact-card/scb-fact-card.js +1 -1
  8. package/mvc/components/scb-header/scb-header.js +18 -18
  9. package/mvc/components/scb-horizontal-scroller/scb-horizontal-scroller.js +5 -5
  10. package/mvc/components/scb-icon-button/scb-icon-button.js +21 -21
  11. package/mvc/components/scb-keyfigure-card/scb-keyfigure-card.js +18 -18
  12. package/mvc/components/scb-menu/scb-menu-item.js +1 -1
  13. package/mvc/components/scb-nav/scb-nav.js +2 -2
  14. package/mvc/components/scb-notification-card/scb-notification-card.js +5 -5
  15. package/mvc/components/scb-search/scb-search.js +5 -4
  16. package/package.json +2 -2
  17. package/scb-calendar/scb-calendar-event.d.ts +4 -0
  18. package/scb-calendar/scb-calendar-event.js +32 -18
  19. package/scb-calendar/scb-calendar.d.ts +27 -0
  20. package/scb-calendar/scb-calendar.js +292 -198
  21. package/scb-card/scb-card.d.ts +5 -0
  22. package/scb-card/scb-card.js +259 -229
  23. package/scb-cookies-consent/scb-cookies-consent.d.ts +3 -0
  24. package/scb-cookies-consent/scb-cookies-consent.js +44 -31
  25. package/scb-drawer/scb-drawer.d.ts +1 -0
  26. package/scb-drawer/scb-drawer.js +15 -5
  27. package/scb-dropdown/scb-dropdown.js +7 -1
  28. package/scb-fact-card/scb-fact-card.js +8 -2
  29. package/scb-header/scb-header.js +208 -154
  30. package/scb-horizontal-scroller/scb-horizontal-scroller.d.ts +1 -0
  31. package/scb-horizontal-scroller/scb-horizontal-scroller.js +47 -41
  32. package/scb-icon-button/scb-icon-button.d.ts +5 -2
  33. package/scb-icon-button/scb-icon-button.js +113 -99
  34. package/scb-keyfigure-card/scb-keyfigure-card.d.ts +4 -0
  35. package/scb-keyfigure-card/scb-keyfigure-card.js +101 -76
  36. package/scb-menu/scb-menu-item.js +12 -0
  37. package/scb-nav/scb-nav.js +9 -3
  38. package/scb-notification-card/scb-notification-card.d.ts +1 -0
  39. package/scb-notification-card/scb-notification-card.js +47 -38
  40. package/scb-search/scb-search.d.ts +8 -0
  41. package/scb-search/scb-search.js +69 -43
  42. package/scb-wc-test.bundle.js +453 -452
@@ -1,6 +1,6 @@
1
- import{a as p,n as l,i as u,x as c,t as _}from"../../vendor/vendor.js";(function(){try{var t=typeof globalThis<"u"?globalThis:window;if(!t.__scb_ce_guard_installed__){t.__scb_ce_guard_installed__=!0;var i=customElements.define.bind(customElements);customElements.define=function(r,n,e){try{customElements.get(r)||i(r,n,e)}catch(o){var a=String(o||"");if(a.indexOf("already been used")===-1&&a.indexOf("NotSupportedError")===-1)throw o}}}}catch{}})();var f=Object.defineProperty,b=Object.getOwnPropertyDescriptor,d=(t,i,r,n)=>{for(var e=n>1?void 0:n?b(i,r):i,a=t.length-1,o;a>=0;a--)(o=t[a])&&(e=(n?o(i,r,e):o(e))||e);return n&&e&&f(i,r,e),e};let s=class extends u{constructor(){super(...arguments),this.title="",this.description="",this.startDate="",this.endDate=""}updated(t){super.updated?.(t),(t.has("title")||t.has("description")||t.has("startDate")||t.has("endDate"))&&this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}render(){return c`
2
- `}};s.styles=p`
1
+ import{a as l,n as u,i as c,x as p,t as b}from"../../vendor/vendor.js";(function(){try{var t=typeof globalThis<"u"?globalThis:window;if(!t.__scb_ce_guard_installed__){t.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(r,i,s){try{customElements.get(r)||e(r,i,s)}catch(d){var n=String(d||"");if(n.indexOf("already been used")===-1&&n.indexOf("NotSupportedError")===-1)throw d}}}}catch{}})();var _=Object.defineProperty,f=Object.getOwnPropertyDescriptor,o=(t,e,r,i)=>{for(var s=i>1?void 0:i?f(e,r):e,n=t.length-1,d;n>=0;n--)(d=t[n])&&(s=(i?d(e,r,s):d(s))||s);return i&&s&&_(e,r,s),s};let a=class extends c{constructor(){super(...arguments),this.title="",this.description="",this.startDate="",this.endDate=""}get date(){return this.startDate}set date(t){const e=(t??"")+"";e!==this.startDate&&(this.startDate=e)}static get observedAttributes(){return[...super.observedAttributes??[],"date"]}attributeChangedCallback(t,e,r){super.attributeChangedCallback(t,e,r),t==="date"&&(this.date=r??"")}updated(t){super.updated?.(t),(t.has("title")||t.has("description")||t.has("startDate")||t.has("endDate"))&&this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}render(){return p`
2
+ `}};a.styles=l`
3
3
  :host {
4
4
  display: block;
5
5
  }
6
- `;d([l({type:String})],s.prototype,"title",2);d([l({type:String})],s.prototype,"description",2);d([l({type:String,attribute:"start-date"})],s.prototype,"startDate",2);d([l({type:String,attribute:"end-date"})],s.prototype,"endDate",2);s=d([_("scb-calendar-event")],s);
6
+ `;o([u({type:String})],a.prototype,"title",2);o([u({type:String})],a.prototype,"description",2);o([u({type:String,attribute:"start-date"})],a.prototype,"startDate",2);o([u({type:String,attribute:"end-date"})],a.prototype,"endDate",2);a=o([b("scb-calendar-event")],a);
@@ -1,45 +1,45 @@
1
- import{a as W,n as w,i as j,x as D,t as R}from"../../vendor/vendor.js";import"./scb-calendar-event.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-dialog/scb-dialog.js";import"../scb-list/scb-list.js";import"../../vendor/vendor-material.js";import"../../vendor/preload-helper.js";import"../scb-button/scb-button.js";import"../scb-textfield/scb-textfield.js";import"../scb-datepicker/scb-datepicker.js";import"../scb-divider/scb-divider.js";import"../scb-checkbox/scb-checkbox.js";import"../scb-checkbox/scb-checkbox-group.js";import"../scb-radio-button/scb-radio-button.js";import"../scb-radio-button/scb-radio-group.js";import"../scb-switch/scb-switch.js";import"../scb-chip/scb-chip.js";import"../scb-list/scb-list-item.js";(function(){try{var t=typeof globalThis<"u"?globalThis:window;if(!t.__scb_ce_guard_installed__){t.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(s,i,o){try{customElements.get(s)||e(s,i,o)}catch(d){var a=String(d||"");if(a.indexOf("already been used")===-1&&a.indexOf("NotSupportedError")===-1)throw d}}}}catch{}})();var J=Object.defineProperty,U=Object.getOwnPropertyDescriptor,q=t=>{throw TypeError(t)},_=(t,e,s,i)=>{for(var o=i>1?void 0:i?U(e,s):e,a=t.length-1,d;a>=0;a--)(d=t[a])&&(o=(i?d(e,s,o):d(o))||o);return i&&o&&J(e,s,o),o},B=(t,e,s)=>e.has(t)||q("Cannot "+s),I=(t,e,s)=>e.has(t)?q("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,s),L=(t,e,s)=>(B(t,e,"access private method"),s),N,O;let b=class extends j{constructor(){super(...arguments),I(this,N),this._lastActiveDay=null,this.lang="sv",this.disableWeekend=!1,this.publicHolidays=!0,this.displayYear=new Date().getFullYear(),this.displayMonth=new Date().getMonth()+1,this.selectedDate="",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this._mutationObserver=null,this._syncingDisplay=!1,this._onCalendarKeyDown=t=>{const s=Array.from(this.shadowRoot?.querySelectorAll(".calendar-day.has-event")??[]),i=this.shadowRoot?.activeElement,o=i&&s.includes(i)?i:document.activeElement,a=s.indexOf(o);if(a===-1)return;let d=a;const p=this.disableWeekend?5:7;switch(t.key){case"ArrowRight":d=a+1<s.length?a+1:a;break;case"ArrowLeft":d=a-1>=0?a-1:a;break;case"ArrowDown":d=a+p<s.length?a+p:a;break;case"ArrowUp":d=a-p>=0?a-p:a;break;default:return}d!==a&&(t.preventDefault(),s[d].focus())},this._onEventChanged=()=>{this.requestUpdate()},this._today=new Date,this._current=new Date,this._popupEvent=null,this._restoreDayFocus=()=>{this._lastActiveDay&&setTimeout(()=>{this._lastActiveDay?.focus(),this._lastActiveDay=null},0)},this._easterDateCalculated={}}connectedCallback(){super.connectedCallback(),L(this,N,O).call(this);const t=Number(this.displayYear),e=Number(this.displayMonth);!Number.isNaN(t)&&!Number.isNaN(e)&&e>=1&&e<=12&&(this._current=new Date(t,e-1,1)),this._syncDisplayFromCurrent(!1),this.addEventListener("change",this._onEventChanged),this._mutationObserver=new MutationObserver(()=>{this.requestUpdate()}),this._mutationObserver.observe(this,{childList:!0}),this.addEventListener("keydown",this._onCalendarKeyDown)}disconnectedCallback(){this.removeEventListener("change",this._onEventChanged),super.disconnectedCallback(),this._mutationObserver&&(this._mutationObserver.disconnect(),this._mutationObserver=null),this.removeEventListener("keydown",this._onCalendarKeyDown)}mapSpacingToken(t){if(!t)return;const e=String(t).trim();if(e)return/^\d+$/.test(e)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(e,10)))})`:e}updated(t){if(super.updated?.(t),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&L(this,N,O).call(this),!this._syncingDisplay&&(t.has("displayYear")||t.has("displayMonth"))){const e=Number(this.displayYear),s=Number(this.displayMonth);if(!Number.isNaN(e)&&!Number.isNaN(s)&&s>=1&&s<=12){const i=this._current.getFullYear(),o=this._current.getMonth()+1;(i!==e||o!==s)&&(this._current=new Date(e,s-1,1),this.dispatchEvent(new CustomEvent("scb-calendar-month-change",{bubbles:!0,composed:!0,detail:{displayYear:e,displayMonth:s}})),this.requestUpdate())}}}_syncDisplayFromCurrent(t=!0){const e=this._current.getFullYear(),s=this._current.getMonth()+1;this._syncingDisplay=!0;try{this.displayYear=e,this.displayMonth=s}finally{this._syncingDisplay=!1}t&&this.dispatchEvent(new CustomEvent("scb-calendar-month-change",{bubbles:!0,composed:!0,detail:{displayYear:e,displayMonth:s}}))}_daysInMonth(t,e){return new Date(t,e+1,0).getDate()}_firstDayOfWeek(t,e){const s=new Date(t,e,1).getDay();return s===0?6:s-1}_prevMonth(){this._current=new Date(this._current.getFullYear(),this._current.getMonth()-1,1),this.selectedDate="",this._popupEvent=null,this._syncDisplayFromCurrent(),this.requestUpdate()}_nextMonth(){this._current=new Date(this._current.getFullYear(),this._current.getMonth()+1,1),this.selectedDate="",this._popupEvent=null,this._syncDisplayFromCurrent(),this.requestUpdate()}_showEventPopup(t){this._popupEvent=t,this.selectedDate=t.date,this.dispatchEvent(new CustomEvent("scb-calendar-select",{bubbles:!0,composed:!0,detail:{selectedDate:t.date}})),this._lastActiveDay=this.shadowRoot?.activeElement||document.activeElement,this.requestUpdate(),this.updateComplete.then(()=>{const e=this.shadowRoot?.querySelector("scb-dialog");e&&(document.activeElement&&(e.__lastTriggerEl=document.activeElement),requestAnimationFrame(()=>{requestAnimationFrame(()=>{e.open=!0})}),e.addEventListener("close",this._restoreDayFocus,{once:!0}));const s=i=>{i.target?.closest(".event-popup")||this._closePopup()};window.addEventListener("mousedown",s,{once:!0})})}_closePopup(){const t=this.shadowRoot?.querySelector("scb-dialog");t&&t.removeAttribute("open"),this._popupEvent=null,this.requestUpdate()}_addDays(t,e){const s=new Date(t.valueOf());return s.setDate(s.getDate()+e),s}_easterDay(t){if(typeof this._easterDateCalculated["Ar"+t]<"u")return new Date(this._easterDateCalculated["Ar"+t]);let e=t;e<100&&(e=e+1900),e<1950&&(e=e+100);const s=e%19,i=e%4,o=e%7,a=(19*s+24)%30,d=(2*i+4*o+6*a+5)%7;let p=22+a+d,E=0;p==57&&(p-=7),p==56&&a==28&&d==6&&s>10&&(p-=7),p>31?(p-=31,E=4):E=3;const T=new Date(e,E-1,p);return this._easterDateCalculated["Ar"+t]=T,new Date(this._easterDateCalculated["Ar"+t])}_swedishHolidayName(t){const e=t.getMonth();if(e===1||e===6||e===7||e===8)return null;const s=t.getMonth()+1,i=t.getDate(),o=t.getFullYear(),a=this._easterDay(o),d=this.lang==="en",p=[["Nyårsdagen","New Year's Day",s===1&&i===1],["Trettondedag jul","Epiphany",s===1&&i===6],["Långfredag","Good Friday",+t==+this._addDays(a,-2)],["Påskdagen","Easter Sunday",+t==+a],["Annandag påsk","Easter Monday",+t==+this._addDays(a,1)],["Kristi himmelsfärdsdag","Ascension Day",+t==+this._addDays(a,39)],["Pingstdagen","Pentecost",+t==+this._addDays(a,50)&&o<2005],["Första maj","May Day",s===5&&i===1],["Nationaldagen","National Day",s===6&&i===6&&o>=2005],["Midsommarafton","Midsummer's Eve",s===6&&i>=19&&i<=25&&t.getDay()===5],["Midsommardagen","Midsummer's Day",s===6&&i>=20&&i<=26&&t.getDay()===6],["Julafton","Christmas Eve",s===12&&i===24],["Juldagen","Christmas Day",s===12&&i===25],["Annandag jul","Boxing Day",s===12&&i===26],["Alla helgons dag","All Saints' Day",s===10&&i>=31&&t.getDay()===6||s===11&&i<=6&&t.getDay()===6]];for(const E of p){const[T,A,$]=E;if($)return d?A:T}return null}render(){const t=this._current.getFullYear(),e=this._current.getMonth(),s=this._daysInMonth(t,e),i=this._firstDayOfWeek(t,e),o=this._today,a=this.lang==="en",d=a?["January","February","March","April","May","June","July","August","September","October","November","December"]:["Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December"];let p=a?["Mon","Tue","Wed","Thu","Fri","Sat","Sun"]:["Mån","Tis","Ons","Tor","Fre","Lör","Sön"];this.disableWeekend&&(p=p.slice(0,5));const E=Array.from(this.querySelectorAll("scb-calendar-event")),T=new Map;for(const n of E){const l=n.getAttribute("start-date")||"",y=n.getAttribute("end-date")||"";if(l&&y){const c=new Date(l),g=new Date(y);for(let h=new Date(c);h<=g;h.setDate(h.getDate()+1)){const f=h.toISOString().split("T")[0],x=T.get(f)||[];x.push({title:n.title,description:n.description,start:l,end:y}),T.set(f,x)}}else if(l&&n.title){const c=l.split("T")[0],g=T.get(c)||[];g.push({title:n.title,description:n.description,start:l}),T.set(c,g)}}const A=[];let $=1;for(let n=0;n<6;n++){const l=[],y=this.disableWeekend?[0,1,2,3,4]:[0,1,2,3,4,5,6];let c=$;for(let g=0;g<y.length;g++){const h=y[g];if(n===0&&h<i){if(!this.disableWeekend||h<5){const f=e===0?11:e-1,x=e===0?t-1:t,F=this._daysInMonth(x,f)-(i-h-1);l.push(D`
1
+ import{a as q,n as b,i as j,x as w,t as H}from"../../vendor/vendor.js";import"./scb-calendar-event.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-dialog/scb-dialog.js";import"../scb-list/scb-list.js";import"../../vendor/vendor-material.js";import"../../vendor/preload-helper.js";import"../scb-button/scb-button.js";import"../scb-textfield/scb-textfield.js";import"../scb-datepicker/scb-datepicker.js";import"../scb-divider/scb-divider.js";import"../scb-checkbox/scb-checkbox.js";import"../scb-checkbox/scb-checkbox-group.js";import"../scb-radio-button/scb-radio-button.js";import"../scb-radio-button/scb-radio-group.js";import"../scb-switch/scb-switch.js";import"../scb-chip/scb-chip.js";import"../scb-list/scb-list-item.js";(function(){try{var t=typeof globalThis<"u"?globalThis:window;if(!t.__scb_ce_guard_installed__){t.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(s,a,i){try{customElements.get(s)||e(s,a,i)}catch(l){var n=String(l||"");if(n.indexOf("already been used")===-1&&n.indexOf("NotSupportedError")===-1)throw l}}}}catch{}})();var W=Object.defineProperty,R=Object.getOwnPropertyDescriptor,P=t=>{throw TypeError(t)},m=(t,e,s,a)=>{for(var i=a>1?void 0:a?R(e,s):e,n=t.length-1,l;n>=0;n--)(l=t[n])&&(i=(a?l(e,s,i):l(i))||i);return a&&i&&W(e,s,i),i},z=(t,e,s)=>e.has(t)||P("Cannot "+s),K=(t,e,s)=>e.has(t)?P("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,s),I=(t,e,s)=>(z(t,e,"access private method"),s),F,J;let y=class extends j{constructor(){super(...arguments),K(this,F),this._lastActiveDay=null,this.lang="sv",this.disableWeekend=!1,this.publicHolidays=!0,this.displayYear=new Date().getFullYear(),this.displayMonth=new Date().getMonth()+1,this.selectedDate="",this.eventsJson=void 0,this._eventsFromJson=null,this._eventsJsonLast=void 0,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this._mutationObserver=null,this._syncingDisplay=!1,this._onCalendarKeyDown=t=>{const s=Array.from(this.shadowRoot?.querySelectorAll(".calendar-day.has-event")??[]),a=this.shadowRoot?.activeElement,i=a&&s.includes(a)?a:document.activeElement,n=s.indexOf(i);if(n===-1)return;let l=n;const c=this.disableWeekend?5:7;switch(t.key){case"ArrowRight":l=n+1<s.length?n+1:n;break;case"ArrowLeft":l=n-1>=0?n-1:n;break;case"ArrowDown":l=n+c<s.length?n+c:n;break;case"ArrowUp":l=n-c>=0?n-c:n;break;default:return}l!==n&&(t.preventDefault(),s[l].focus())},this._onEventChanged=()=>{this.requestUpdate()},this._today=new Date,this._current=new Date,this._popupEvent=null,this._restoreDayFocus=()=>{this._lastActiveDay&&setTimeout(()=>{this._lastActiveDay?.focus(),this._lastActiveDay=null},0)},this._easterDateCalculated={}}get value(){return this.selectedDate}set value(t){const e=(t??"")+"";e!==this.selectedDate&&(this.selectedDate=e)}static get observedAttributes(){return[...super.observedAttributes??[],"value"]}attributeChangedCallback(t,e,s){super.attributeChangedCallback(t,e,s),t==="value"&&(this.value=s??"")}connectedCallback(){super.connectedCallback(),I(this,F,J).call(this);const t=Number(this.displayYear),e=Number(this.displayMonth);!Number.isNaN(t)&&!Number.isNaN(e)&&e>=1&&e<=12&&(this._current=new Date(t,e-1,1)),this._syncDisplayFromCurrent(!1),this.addEventListener("change",this._onEventChanged),this._mutationObserver=new MutationObserver(()=>{this.requestUpdate()}),this._mutationObserver.observe(this,{childList:!0}),this.addEventListener("keydown",this._onCalendarKeyDown)}disconnectedCallback(){this.removeEventListener("change",this._onEventChanged),super.disconnectedCallback(),this._mutationObserver&&(this._mutationObserver.disconnect(),this._mutationObserver=null),this.removeEventListener("keydown",this._onCalendarKeyDown)}mapSpacingToken(t){if(!t)return;const e=String(t).trim();if(e)return/^\d+$/.test(e)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(e,10)))})`:e}updated(t){if(super.updated?.(t),t.has("eventsJson")&&(this._eventsJsonLast=void 0,this._eventsFromJson=null),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&I(this,F,J).call(this),!this._syncingDisplay&&(t.has("displayYear")||t.has("displayMonth"))){const e=Number(this.displayYear),s=Number(this.displayMonth);if(!Number.isNaN(e)&&!Number.isNaN(s)&&s>=1&&s<=12){const a=this._current.getFullYear(),i=this._current.getMonth()+1;(a!==e||i!==s)&&(this._current=new Date(e,s-1,1),this._dispatchMonthChange(e,s),this.requestUpdate())}}}_ensureEventsFromJson(){const t=(this.eventsJson??"").trim();if(!t){this._eventsFromJson=null,this._eventsJsonLast=t;return}if(!(this._eventsJsonLast===t&&this._eventsFromJson!==null)){this._eventsJsonLast=t;try{const e=JSON.parse(t);Array.isArray(e)?this._eventsFromJson=e:this._eventsFromJson=[]}catch{this._eventsFromJson=[]}}}_getEventInputs(){return Array.isArray(this.events)?this.events:(this._ensureEventsFromJson(),this._eventsFromJson!==null?this._eventsFromJson:null)}_normalizeEventInput(t){const e=t.title??"",s=t.description??"",a=t.startDate??t["start-date"]??t.start??t.date??"",i=t.endDate??t["end-date"]??t.end??"";return{title:e+"",description:s?s+"":void 0,start:a?a+"":void 0,end:i?i+"":void 0}}_buildEventMapFromInputs(t){const e=new Map;for(const s of t){const a=this._normalizeEventInput(s),i=a.start||"",n=a.end||"";if(!(!i||!a.title))if(i&&n){const l=new Date(i),c=new Date(n);for(let p=new Date(l);p<=c;p.setDate(p.getDate()+1)){const D=p.toISOString().split("T")[0],T=e.get(D)||[];T.push({title:a.title,description:a.description,start:i,end:n}),e.set(D,T)}}else{const l=i.split("T")[0],c=e.get(l)||[];c.push({title:a.title,description:a.description,start:i}),e.set(l,c)}}return e}_buildEventMapFromChildren(){const t=Array.from(this.querySelectorAll("scb-calendar-event")),e=new Map;for(const s of t){const a=s,i=(a.startDate??a.date??"")+""||s.getAttribute("start-date")||s.getAttribute("date")||"",n=(a.endDate??"")+""||s.getAttribute("end-date")||"";if(i&&n){const l=new Date(i),c=new Date(n);for(let p=new Date(l);p<=c;p.setDate(p.getDate()+1)){const D=p.toISOString().split("T")[0],T=e.get(D)||[];T.push({title:s.title??"",description:s.description,start:i,end:n}),e.set(D,T)}}else if(i&&s.title){const l=i.split("T")[0],c=e.get(l)||[];c.push({title:s.title,description:s.description,start:i}),e.set(l,c)}}return e}_syncDisplayFromCurrent(t=!0){const e=this._current.getFullYear(),s=this._current.getMonth()+1;this._syncingDisplay=!0;try{this.displayYear=e,this.displayMonth=s}finally{this._syncingDisplay=!1}t&&this._dispatchMonthChange(e,s)}_dispatchMonthChange(t,e){const s={displayYear:t,displayMonth:e};this.dispatchEvent(new CustomEvent("scb-calendar-month-change",{bubbles:!0,composed:!0,detail:s})),this.dispatchEvent(new CustomEvent("scbcalendarmonthchange",{bubbles:!0,composed:!0,detail:s}))}_dispatchSelect(t){const e={selectedDate:t};this.dispatchEvent(new CustomEvent("scb-calendar-select",{bubbles:!0,composed:!0,detail:e})),this.dispatchEvent(new CustomEvent("scbcalendarselect",{bubbles:!0,composed:!0,detail:e}))}_daysInMonth(t,e){return new Date(t,e+1,0).getDate()}_firstDayOfWeek(t,e){const s=new Date(t,e,1).getDay();return s===0?6:s-1}_prevMonth(){this._current=new Date(this._current.getFullYear(),this._current.getMonth()-1,1),this.selectedDate="",this._popupEvent=null,this._syncDisplayFromCurrent(),this.requestUpdate()}_nextMonth(){this._current=new Date(this._current.getFullYear(),this._current.getMonth()+1,1),this.selectedDate="",this._popupEvent=null,this._syncDisplayFromCurrent(),this.requestUpdate()}_showEventPopup(t){this._popupEvent=t,this.selectedDate=t.date,this._dispatchSelect(t.date),this._lastActiveDay=this.shadowRoot?.activeElement||document.activeElement,this.requestUpdate(),this.updateComplete.then(()=>{const e=this.shadowRoot?.querySelector("scb-dialog");e&&(document.activeElement&&(e.__lastTriggerEl=document.activeElement),requestAnimationFrame(()=>{requestAnimationFrame(()=>{e.open=!0})}),e.addEventListener("close",this._restoreDayFocus,{once:!0}));const s=a=>{a.target?.closest(".event-popup")||this._closePopup()};window.addEventListener("mousedown",s,{once:!0})})}_closePopup(){const t=this.shadowRoot?.querySelector("scb-dialog");t&&t.removeAttribute("open"),this._popupEvent=null,this.requestUpdate()}_addDays(t,e){const s=new Date(t.valueOf());return s.setDate(s.getDate()+e),s}_easterDay(t){if(typeof this._easterDateCalculated["Ar"+t]<"u")return new Date(this._easterDateCalculated["Ar"+t]);let e=t;e<100&&(e=e+1900),e<1950&&(e=e+100);const s=e%19,a=e%4,i=e%7,n=(19*s+24)%30,l=(2*a+4*i+6*n+5)%7;let c=22+n+l,p=0;c==57&&(c-=7),c==56&&n==28&&l==6&&s>10&&(c-=7),c>31?(c-=31,p=4):p=3;const D=new Date(e,p-1,c);return this._easterDateCalculated["Ar"+t]=D,new Date(this._easterDateCalculated["Ar"+t])}_swedishHolidayName(t){const e=t.getMonth();if(e===1||e===6||e===7||e===8)return null;const s=t.getMonth()+1,a=t.getDate(),i=t.getFullYear(),n=this._easterDay(i),l=this.lang==="en",c=[["Nyårsdagen","New Year's Day",s===1&&a===1],["Trettondedag jul","Epiphany",s===1&&a===6],["Långfredag","Good Friday",+t==+this._addDays(n,-2)],["Påskdagen","Easter Sunday",+t==+n],["Annandag påsk","Easter Monday",+t==+this._addDays(n,1)],["Kristi himmelsfärdsdag","Ascension Day",+t==+this._addDays(n,39)],["Pingstdagen","Pentecost",+t==+this._addDays(n,50)&&i<2005],["Första maj","May Day",s===5&&a===1],["Nationaldagen","National Day",s===6&&a===6&&i>=2005],["Midsommarafton","Midsummer's Eve",s===6&&a>=19&&a<=25&&t.getDay()===5],["Midsommardagen","Midsummer's Day",s===6&&a>=20&&a<=26&&t.getDay()===6],["Julafton","Christmas Eve",s===12&&a===24],["Juldagen","Christmas Day",s===12&&a===25],["Annandag jul","Boxing Day",s===12&&a===26],["Alla helgons dag","All Saints' Day",s===10&&a>=31&&t.getDay()===6||s===11&&a<=6&&t.getDay()===6]];for(const p of c){const[D,T,x]=p;if(x)return l?T:D}return null}render(){const t=this._current.getFullYear(),e=this._current.getMonth(),s=this._daysInMonth(t,e),a=this._firstDayOfWeek(t,e),i=this._today,n=this.lang==="en",l=n?["January","February","March","April","May","June","July","August","September","October","November","December"]:["Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December"];let c=n?["Mon","Tue","Wed","Thu","Fri","Sat","Sun"]:["Mån","Tis","Ons","Tor","Fre","Lör","Sön"];this.disableWeekend&&(c=c.slice(0,5));const p=this._getEventInputs(),D=p?this._buildEventMapFromInputs(p):this._buildEventMapFromChildren(),T=[];let x=1;for(let o=0;o<6;o++){const h=[],f=this.disableWeekend?[0,1,2,3,4]:[0,1,2,3,4,5,6];let d=x;for(let E=0;E<f.length;E++){const v=f[E];if(o===0&&v<a){if(!this.disableWeekend||v<5){const k=e===0?11:e-1,$=e===0?t-1:t,N=this._daysInMonth($,k)-(a-v-1);h.push(w`
2
2
  <div class="calendar-day calendar-day--other">
3
- <span class="calendar-day-number">${F}</span>
3
+ <span class="calendar-day-number">${N}</span>
4
4
  </div>
5
- `)}}else if(c>s)l.push(D`<div></div>`);else{let f=new Date(t,e,c);if(this.disableWeekend)for(;f.getDay()===0||f.getDay()===6;)c++,f=new Date(t,e,c);if(c>s){l.push(D`<div></div>`);continue}const x=o.getFullYear()===t&&o.getMonth()===e&&o.getDate()===c,v=`${t}-${String(e+1).padStart(2,"0")}-${String(c).padStart(2,"0")}`,F=new Date(t,e,c);let P=!1,k=null;this.publicHolidays&&(k=this._swedishHolidayName(F),P=!!k);let u=T.get(v)||[];u=[...u].sort((r,m)=>{const M=r.start&&v===r.start.split("T")[0]?r.start:r.end&&v===r.end.split("T")[0]?r.end:"",S=m.start&&v===m.start.split("T")[0]?m.start:m.end&&m.end.split("T")[0]?m.end:"",C=M&&M.includes("T"),Y=S&&S.includes("T");return C&&Y?M.localeCompare(S):C?-1:Y?1:r.title.localeCompare(m.title)});const H=[...u].map(r=>{let m="",M="";if(r.start&&r.end){const S=r.start.split("T")[0],C=r.end.split("T")[0];v===S&&v===C&&r.start.includes("T")&&r.end.includes("T")?m=r.start.split("T")[1].substring(0,5)+"–"+r.end.split("T")[1].substring(0,5):v===S&&r.start.includes("T")?m=r.start.split("T")[1].substring(0,5):v===C&&r.end.includes("T")?(m=r.end.split("T")[1].substring(0,5),M=a?"cont. ":"fort. "):v!==S&&(m="",M=a?"cont. ":"fort. ")}else r.start&&r.start.includes("T")&&(m=r.start.split("T")[1].substring(0,5));return{...r,time:m,prefix:M}});l.push(D`
5
+ `)}}else if(d>s)h.push(w`<div></div>`);else{let k=new Date(t,e,d);if(this.disableWeekend)for(;k.getDay()===0||k.getDay()===6;)d++,k=new Date(t,e,d);if(d>s){h.push(w`<div></div>`);continue}const $=i.getFullYear()===t&&i.getMonth()===e&&i.getDate()===d,_=`${t}-${String(e+1).padStart(2,"0")}-${String(d).padStart(2,"0")}`,N=new Date(t,e,d);let O=!1,M=null;this.publicHolidays&&(M=this._swedishHolidayName(N),O=!!M);let u=D.get(_)||[];u=[...u].sort((r,g)=>{const S=r.start&&_===r.start.split("T")[0]?r.start:r.end&&_===r.end.split("T")[0]?r.end:"",C=g.start&&_===g.start.split("T")[0]?g.start:g.end&&g.end.split("T")[0]?g.end:"",A=S&&S.includes("T"),L=C&&C.includes("T");return A&&L?S.localeCompare(C):A?-1:L?1:r.title.localeCompare(g.title)});const Y=[...u].map(r=>{let g="",S="";if(r.start&&r.end){const C=r.start.split("T")[0],A=r.end.split("T")[0];_===C&&_===A&&r.start.includes("T")&&r.end.includes("T")?g=r.start.split("T")[1].substring(0,5)+"–"+r.end.split("T")[1].substring(0,5):_===C&&r.start.includes("T")?g=r.start.split("T")[1].substring(0,5):_===A&&r.end.includes("T")?(g=r.end.split("T")[1].substring(0,5),S=n?"cont. ":"fort. "):_!==C&&(g="",S=n?"cont. ":"fort. ")}else r.start&&r.start.includes("T")&&(g=r.start.split("T")[1].substring(0,5));return{...r,time:g,prefix:S}});h.push(w`
6
6
  <div
7
- class="calendar-day${x?" today":""}${u.length?" has-event":""}${P?" calendar-day--holiday":""}"
7
+ class="calendar-day${$?" today":""}${u.length?" has-event":""}${O?" calendar-day--holiday":""}"
8
8
  tabindex=${u.length?"0":void 0}
9
- @click=${u.length?()=>this._showEventPopup({date:v,events:u}):null}
10
- @keydown=${u.length?r=>{(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),this._showEventPopup({date:v,events:u}))}:null}
11
- title=${k||(u.length===1?u[0].title:u.length>1?u.map(r=>r.title).join(", "):"")}
9
+ @click=${u.length?()=>this._showEventPopup({date:_,events:u}):null}
10
+ @keydown=${u.length?r=>{(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),this._showEventPopup({date:_,events:u}))}:null}
11
+ title=${M||(u.length===1?u[0].title:u.length>1?u.map(r=>r.title).join(", "):"")}
12
12
  role=${u.length?"button":void 0}
13
- aria-label=${k||(u.length?u.length===1?u[0].title:u.map(r=>r.title).join(", "):void 0)}
13
+ aria-label=${M||(u.length?u.length===1?u[0].title:u.map(r=>r.title).join(", "):void 0)}
14
14
  >
15
15
  <md-focus-ring inward></md-focus-ring>
16
- <span class="calendar-day-number">${c} ${k?D`<span class="calendar-day-holiday-name">${k}</span>`:""}</span>
16
+ <span class="calendar-day-number">${d} ${M?w`<span class="calendar-day-holiday-name">${M}</span>`:""}</span>
17
17
  <div class="calendar-titles-wrapper">
18
- ${H.map(r=>D`<span class="calendar-day-event-title">${r.prefix||""}${r.title}</span>`)}
18
+ ${Y.map(r=>w`<span class="calendar-day-event-title">${r.prefix||""}${r.title}</span>`)}
19
19
  </div>
20
20
  </div>
21
- `),c++}}if($=c,A.push(D`<div class="calendar-grid">${l}</div>`),$>s)break}return D`
21
+ `),d++}}if(x=d,T.push(w`<div class="calendar-grid">${h}</div>`),x>s)break}return w`
22
22
  <div class="calendar-header">
23
- <scb-icon-button @click=${this._prevMonth} icon="chevron_left" aria-label="${a?"Previous month":"Föregående månad"}"></scb-icon-button>
24
- <span>${d[e]} ${t}</span>
25
- <scb-icon-button @click=${this._nextMonth} icon="chevron_right" aria-label="${a?"Next month":"Nästa månad"}"></scb-icon-button>
23
+ <scb-icon-button @click=${this._prevMonth} icon="chevron_left" aria-label="${n?"Previous month":"Föregående månad"}"></scb-icon-button>
24
+ <span>${l[e]} ${t}</span>
25
+ <scb-icon-button @click=${this._nextMonth} icon="chevron_right" aria-label="${n?"Next month":"Nästa månad"}"></scb-icon-button>
26
26
  </div>
27
27
  <div class="calendar-grid calendar-grid-days">
28
- ${p.map(n=>D`<div>${n}</div>`)}
28
+ ${c.map(o=>w`<div>${o}</div>`)}
29
29
  </div>
30
30
  <div class="calendar-weeks">
31
- ${A}
31
+ ${T}
32
32
  </div>
33
- ${this._popupEvent&&Array.isArray(this._popupEvent.events)?D`
34
- <scb-dialog variant="floating" open label="${a?"Events":"Händelser"} ${this._popupEvent.date}">
33
+ ${this._popupEvent&&Array.isArray(this._popupEvent.events)?w`
34
+ <scb-dialog variant="floating" open label="${n?"Events":"Händelser"} ${this._popupEvent.date}">
35
35
  <scb-list>
36
- ${[...this._popupEvent.events].sort((n,l)=>{const y=n.start&&n.start.includes("T")?n.start:n.end&&n.end.includes("T")?n.end:"",c=l.start&&l.start.includes("T")?l.start:l.end&&l.end.includes("T")?l.end:"",g=y&&y.includes("T"),h=c&&c.includes("T");return g&&h?y.localeCompare(c):g?-1:h?1:n.title.localeCompare(l.title)}).map(n=>{const l=this._popupEvent?.date??"";let y="",c="",g="";if(n.start&&n.end){const h=n.start.split("T")[0],f=n.end.split("T")[0];h===f&&n.start.includes("T")&&n.end.includes("T")?y=n.start.split("T")[1].substring(0,5)+" – "+n.end.split("T")[1].substring(0,5):l===h&&n.start.includes("T")&&(y="Start: "+n.start.split("T")[1].substring(0,5)+(a?" (Extended event) ":" (Flerdagsevenemang) ")),l===f&&n.end.includes("T")&&h!==f&&(g=(a?"End: ":"Slut: ")+n.end.split("T")[1].substring(0,5)),l!==h&&(c=a?"cont. ":"fort. ")}else n.start&&n.start.includes("T")&&(y=n.start.split("T")[1].substring(0,5));return D`
37
- <scb-list-item label="${c}${n.title}" supporting-text="${n.description?n.description:""}" overline="${y||""}${g||""}">
36
+ ${[...this._popupEvent.events].sort((o,h)=>{const f=o.start&&o.start.includes("T")?o.start:o.end&&o.end.includes("T")?o.end:"",d=h.start&&h.start.includes("T")?h.start:h.end&&h.end.includes("T")?h.end:"",E=f&&f.includes("T"),v=d&&d.includes("T");return E&&v?f.localeCompare(d):E?-1:v?1:o.title.localeCompare(h.title)}).map(o=>{const h=this._popupEvent?.date??"";let f="",d="",E="";if(o.start&&o.end){const v=o.start.split("T")[0],k=o.end.split("T")[0];v===k&&o.start.includes("T")&&o.end.includes("T")?f=o.start.split("T")[1].substring(0,5)+" – "+o.end.split("T")[1].substring(0,5):h===v&&o.start.includes("T")&&(f="Start: "+o.start.split("T")[1].substring(0,5)+(n?" (Extended event) ":" (Flerdagsevenemang) ")),h===k&&o.end.includes("T")&&v!==k&&(E=(n?"End: ":"Slut: ")+o.end.split("T")[1].substring(0,5)),h!==v&&(d=n?"cont. ":"fort. ")}else o.start&&o.start.includes("T")&&(f=o.start.split("T")[1].substring(0,5));return w`
37
+ <scb-list-item label="${d}${o.title}" supporting-text="${o.description?o.description:""}" overline="${f||""}${E||""}">
38
38
  </scb-list-item>`})}
39
39
  </scb-list>
40
40
  </scb-dialog>
41
41
  `:""}
42
- `}};N=new WeakSet;O=function(){const t=this.mapSpacingToken(this.spacing),e=this.mapSpacingToken(this.spacingTop)??t,s=this.mapSpacingToken(this.spacingBottom)??t,i=this.mapSpacingToken(this.spacingLeft),o=this.mapSpacingToken(this.spacingRight);e?this.style.setProperty("--scb-calendar-spacing-block-start",e):this.style.removeProperty("--scb-calendar-spacing-block-start"),s?this.style.setProperty("--scb-calendar-spacing-block-end",s):this.style.removeProperty("--scb-calendar-spacing-block-end"),i?this.style.setProperty("--scb-calendar-spacing-inline-start",i):this.style.removeProperty("--scb-calendar-spacing-inline-start"),o?this.style.setProperty("--scb-calendar-spacing-inline-end",o):this.style.removeProperty("--scb-calendar-spacing-inline-end")};b.styles=W`
42
+ `}};F=new WeakSet;J=function(){const t=this.mapSpacingToken(this.spacing),e=this.mapSpacingToken(this.spacingTop)??t,s=this.mapSpacingToken(this.spacingBottom)??t,a=this.mapSpacingToken(this.spacingLeft),i=this.mapSpacingToken(this.spacingRight);e?this.style.setProperty("--scb-calendar-spacing-block-start",e):this.style.removeProperty("--scb-calendar-spacing-block-start"),s?this.style.setProperty("--scb-calendar-spacing-block-end",s):this.style.removeProperty("--scb-calendar-spacing-block-end"),a?this.style.setProperty("--scb-calendar-spacing-inline-start",a):this.style.removeProperty("--scb-calendar-spacing-inline-start"),i?this.style.setProperty("--scb-calendar-spacing-inline-end",i):this.style.removeProperty("--scb-calendar-spacing-inline-end")};y.styles=q`
43
43
  :host {
44
44
  display: block;
45
45
  margin-block-start: var(--scb-calendar-spacing-block-start, 0);
@@ -153,4 +153,4 @@ import{a as W,n as w,i as j,x as D,t as R}from"../../vendor/vendor.js";import"./
153
153
  gap: var(--spacing-4);
154
154
  }
155
155
 
156
- `;_([w({type:String})],b.prototype,"lang",2);_([w({type:Boolean,attribute:"disable-weekend"})],b.prototype,"disableWeekend",2);_([w({type:Boolean,attribute:"public-holidays"})],b.prototype,"publicHolidays",2);_([w({type:Number,attribute:"display-year",reflect:!0})],b.prototype,"displayYear",2);_([w({type:Number,attribute:"display-month",reflect:!0})],b.prototype,"displayMonth",2);_([w({type:String,attribute:"selected-date",reflect:!0})],b.prototype,"selectedDate",2);_([w({type:String,reflect:!0})],b.prototype,"spacing",2);_([w({type:String,attribute:"spacing-top",reflect:!0})],b.prototype,"spacingTop",2);_([w({type:String,attribute:"spacing-bottom",reflect:!0})],b.prototype,"spacingBottom",2);_([w({type:String,attribute:"spacing-left",reflect:!0})],b.prototype,"spacingLeft",2);_([w({type:String,attribute:"spacing-right",reflect:!0})],b.prototype,"spacingRight",2);b=_([R("scb-calendar")],b);
156
+ `;m([b({type:String})],y.prototype,"lang",2);m([b({type:Boolean,attribute:"disable-weekend"})],y.prototype,"disableWeekend",2);m([b({type:Boolean,attribute:"public-holidays"})],y.prototype,"publicHolidays",2);m([b({type:Number,attribute:"display-year",reflect:!0})],y.prototype,"displayYear",2);m([b({type:Number,attribute:"display-month",reflect:!0})],y.prototype,"displayMonth",2);m([b({type:String,attribute:"selected-date",reflect:!0})],y.prototype,"selectedDate",2);m([b({attribute:!1})],y.prototype,"events",2);m([b({type:String,attribute:"events-json"})],y.prototype,"eventsJson",2);m([b({type:String,reflect:!0})],y.prototype,"spacing",2);m([b({type:String,attribute:"spacing-top",reflect:!0})],y.prototype,"spacingTop",2);m([b({type:String,attribute:"spacing-bottom",reflect:!0})],y.prototype,"spacingBottom",2);m([b({type:String,attribute:"spacing-left",reflect:!0})],y.prototype,"spacingLeft",2);m([b({type:String,attribute:"spacing-right",reflect:!0})],y.prototype,"spacingRight",2);y=m([H("scb-calendar")],y);
@@ -1,12 +1,12 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../../vendor/vendor-material.js","../../vendor/vendor.js"])))=>i.map(i=>d[i]);
2
- import{_ as f}from"../../vendor/preload-helper.js";import{a as $,n as a,i as k,x as r,t as _}from"../../vendor/vendor.js";import"../../vendor/vendor-material.js";import"../scb-list/scb-list.js";import"../scb-button/scb-button.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-link/scb-link.js";import"../scb-avatar/scb-avatar.js";import"../scb-tooltip/scb-tooltip.js";import"../scb-list/scb-list-item.js";(function(){try{var e=typeof globalThis<"u"?globalThis:window;if(!e.__scb_ce_guard_installed__){e.__scb_ce_guard_installed__=!0;var i=customElements.define.bind(customElements);customElements.define=function(o,n,c){try{customElements.get(o)||i(o,n,c)}catch(l){var d=String(l||"");if(d.indexOf("already been used")===-1&&d.indexOf("NotSupportedError")===-1)throw l}}}}catch{}})();var z=Object.defineProperty,w=Object.getOwnPropertyDescriptor,x=e=>{throw TypeError(e)},s=(e,i,o,n)=>{for(var c=n>1?void 0:n?w(i,o):i,d=e.length-1,l;d>=0;d--)(l=e[d])&&(c=(n?l(i,o,c):l(c))||c);return n&&c&&z(i,o,c),c},S=(e,i,o)=>i.has(e)||x("Cannot "+o),T=(e,i,o)=>i.has(e)?x("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(e):i.set(e,o),y=(e,i,o)=>(S(e,i,"access private method"),o),b,g;let t=class extends k{constructor(){super(...arguments),T(this,b),this.type="",this.variant="",this.direction="",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.title="",this.subtitle="",this.supportingText="",this.commentsText="",this.comments=0,this.commentsHref="",this.likesText="",this.likes=0,this.likesHoverContent="",this.hasLiked=!1,this.likesInteractive=!1,this.author=!1,this.authorText="",this.authorHref="",this.sizing="stretch",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.__onImgLoad=e=>{const i=e.currentTarget.closest(".media");i&&i.classList.add("is-loaded")},this.__onKeyDown=e=>{(e.key==="Enter"||e.key===" ")&&this.cardHref&&(e.preventDefault(),window.open(this.cardHref,"_self"))},this.__handleHrefNavigation=e=>{this.cardHref&&(e.target.closest("a")||window.open(this.cardHref,"_self"))}}get likeButton(){return this.type!=="social"?null:this.renderRoot.querySelector(".likes scb-icon-button")}__calcAspectWH(e){const i=(e||"").trim();if(!i)return{w:640,h:360};const o=i.includes("/")?i.split("/"):i.includes(":")?i.split(":"):i.includes("x")?i.split("x"):null;if(o&&o.length===2){const c=Number(o[0]),d=Number(o[1]);if(c>0&&d>0)return{w:c,h:d}}const n=Number(i);return isFinite(n)&&n>0?{w:1e3,h:Math.round(1e3/n)}:{w:640,h:360}}__noWrapText(e){return(e??"").replace(/ /g," ").replace(/-/g,"‑")}__mediaTemplate(){if((this.mediaType||"").toLowerCase()==="avatar")return r`
2
+ import{_ as y}from"../../vendor/preload-helper.js";import{a as _,n as a,i as $,x as o,t as z}from"../../vendor/vendor.js";import"../../vendor/vendor-material.js";import"../scb-list/scb-list.js";import"../scb-button/scb-button.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-link/scb-link.js";import"../scb-avatar/scb-avatar.js";import"../scb-tooltip/scb-tooltip.js";import"../scb-list/scb-list-item.js";(function(){try{var e=typeof globalThis<"u"?globalThis:window;if(!e.__scb_ce_guard_installed__){e.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(r,c,n){try{customElements.get(r)||t(r,c,n)}catch(p){var l=String(p||"");if(l.indexOf("already been used")===-1&&l.indexOf("NotSupportedError")===-1)throw p}}}}catch{}})();var w=Object.defineProperty,S=Object.getOwnPropertyDescriptor,k=e=>{throw TypeError(e)},s=(e,t,r,c)=>{for(var n=c>1?void 0:c?S(t,r):t,l=e.length-1,p;l>=0;l--)(p=e[l])&&(n=(c?p(t,r,n):p(n))||n);return c&&n&&w(t,r,n),n},T=(e,t,r)=>t.has(e)||k("Cannot "+r),L=(e,t,r)=>t.has(e)?k("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),x=(e,t,r)=>(T(e,t,"access private method"),r),v,g;let i=class extends ${constructor(){super(...arguments),L(this,v),this.type="",this.variant="",this.direction="",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.subtitle="",this.supportingText="",this.commentsText="",this.comments=0,this.commentsHref="",this.likesText="",this.likes=0,this.likesHoverContent="",this.hasLiked=!1,this.likesInteractive=!1,this.author=!1,this.authorText="",this.authorHref="",this.sizing="stretch",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.__onImgLoad=e=>{const t=e.currentTarget.closest(".media");t&&t.classList.add("is-loaded")},this.__onKeyDown=e=>{const t=this.__effectiveHref();(e.key==="Enter"||e.key===" ")&&t&&(e.preventDefault(),this.__navigate(t,e))},this.__handleHrefNavigation=e=>{const t=this.__effectiveHref();t&&(e.target.closest("a")||this.__navigate(t,e))}}get likeButton(){return this.type!=="social"?null:this.renderRoot.querySelector(".likes scb-icon-button")}__calcAspectWH(e){const t=(e||"").trim();if(!t)return{w:640,h:360};const r=t.includes("/")?t.split("/"):t.includes(":")?t.split(":"):t.includes("x")?t.split("x"):null;if(r&&r.length===2){const n=Number(r[0]),l=Number(r[1]);if(n>0&&l>0)return{w:n,h:l}}const c=Number(t);return isFinite(c)&&c>0?{w:1e3,h:Math.round(1e3/c)}:{w:640,h:360}}__noWrapText(e){return(e??"").replace(/ /g," ").replace(/-/g,"‑")}__dispatchLikeEvent(e,t){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,detail:t})),this.dispatchEvent(new CustomEvent(e.replace("-",""),{bubbles:!0,composed:!0,detail:t}))}__dispatchCardNavigate(e,t){const r={href:e,originalEvent:t},c=new CustomEvent("card-navigate",{bubbles:!0,composed:!0,cancelable:!0,detail:r});if(this.dispatchEvent(c),c.defaultPrevented)return!1;const n=new CustomEvent("cardnavigate",{bubbles:!0,composed:!0,cancelable:!0,detail:r});return this.dispatchEvent(n),!n.defaultPrevented}__effectiveHref(){return this.cardHref||this.href}__navigate(e,t){e&&this.__dispatchCardNavigate(e,t)&&window.open(e,"_self")}__mediaTemplate(){if((this.mediaType||"").toLowerCase()==="avatar")return o`
3
3
  <div class="media">
4
4
  <slot name="media">
5
5
  <scb-avatar variant="icon" label="${this.title}" icon-name="person"></scb-avatar>
6
6
  </slot>
7
7
  </div>
8
- `;if(this.mediaHref||this.mediaSrcset){let i=Number(this.mediaWidth)||0,o=Number(this.mediaHeight)||0;const n=(this.mediaAspect||"").trim();if(!i||!o){const u=this.__calcAspectWH(n||"16/9");i||(i=u.w),o||(o=u.h)}const c=`aspect-ratio:${n||`${i}/${o}`};`,d=this.mediaPlaceholder?"has-ph":"",l=this.mediaFit||"cover",h=this.mediaPosition||"center";return r`
9
- <div class="media ${d}" style="${c}">
8
+ `;if(this.mediaHref||this.mediaSrcset){let t=Number(this.mediaWidth)||0,r=Number(this.mediaHeight)||0;const c=(this.mediaAspect||"").trim();if(!t||!r){const h=this.__calcAspectWH(c||"16/9");t||(t=h.w),r||(r=h.h)}const n=`aspect-ratio:${c||`${t}/${r}`};`,l=this.mediaPlaceholder?"has-ph":"",p=this.mediaFit||"cover",m=this.mediaPosition||"center";return o`
9
+ <div class="media ${l}" style="${n}">
10
10
  <slot name="media-sources"></slot>
11
11
  <img
12
12
  src="${this.mediaHref||""}"
@@ -16,84 +16,84 @@ import{_ as f}from"../../vendor/preload-helper.js";import{a as $,n as a,i as k,x
16
16
  loading="${this.mediaLoading}"
17
17
  decoding="${this.mediaDecoding}"
18
18
  fetchpriority="${this.mediaFetchPriority}"
19
- style="object-fit:${l};object-position:${h};"
20
- width="${i}"
21
- height="${o}"
19
+ style="object-fit:${p};object-position:${m};"
20
+ width="${t}"
21
+ height="${r}"
22
22
  @load=${this.__onImgLoad}
23
23
  />
24
24
  </div>
25
- `}return null}mapSpacingToken(e){if(!e)return;const i=String(e).trim();if(i)return/^\d+$/.test(i)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(i,10)))})`:i}render(){const e=this.variant?`${this.variant.toLowerCase()}`:"",i=this.type==="list"?"vertical":this.direction?this.direction.toLowerCase():"",o=this.cardHref?"clickable":"",n=this.date instanceof Date?this.date.toISOString().slice(0,10):this.date||"",c=(h=!1)=>h?r`<a class="title" href="${this.cardHref}" tabindex="0"
25
+ `}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}render(){const e=this.variant?`${this.variant.toLowerCase()}`:"",t=this.type==="list"?"vertical":this.direction?this.direction.toLowerCase():"",r=this.__effectiveHref(),c=r?"clickable":"",n=this.date instanceof Date?this.date.toISOString().slice(0,10):this.date||"",l=(h=!1)=>h?o`<a class="title" href="${r}" tabindex="-1"
26
26
  >${this.title}</a
27
- ><md-icon>arrow_forward</md-icon>`:r`<span class="title">${this.title}</span>`,d=()=>this.__mediaTemplate(),l=h=>r`
27
+ ><md-icon>arrow_forward</md-icon>`:o`<span class="title">${this.title}</span>`,p=()=>this.__mediaTemplate(),m=h=>o`
28
28
  <div
29
- class="scb-card ${e} ${i} ${o}"
30
- @click=${this.cardHref?this.__handleHrefNavigation:null}
31
- @keydown=${this.cardHref?this.__onKeyDown:null}
32
- style="cursor:${this.cardHref?"pointer":"default"};"
33
- role=${this.cardHref?"link":"group"}
34
- tabindex=${this.cardHref?"0":"-1"}
29
+ class="scb-card ${e} ${t} ${c}"
30
+ @click=${r?this.__handleHrefNavigation:null}
31
+ @keydown=${r?this.__onKeyDown:null}
32
+ style="cursor:${r?"pointer":"default"};"
33
+ role=${r?"link":"group"}
34
+ tabindex=${r?"0":"-1"}
35
35
  aria-label=${this.title||"Kort"}
36
36
  >
37
- ${this.cardHref?r`<md-ripple></md-ripple>`:""}
38
- ${d()}
37
+ ${r?o`<md-ripple></md-ripple>`:""}
38
+ ${p()}
39
39
  ${h}
40
40
  </div>
41
41
  <md-focus-ring></md-focus-ring>
42
- `;switch(this.type){case"standard":return l(r`
42
+ `;switch(this.type){case"standard":return m(o`
43
43
  <div class="full-content">
44
44
  <div class="top-content">
45
- ${this.title?r`<div class="header">${c(!!this.cardHref)}</div>`:""}
46
- ${this.subtitle?r`<div class="sub-label">${this.subtitle}</div>`:""}
47
- ${this.supportingText?r`<div class="supporting-text">${this.supportingText}</div>`:""}
48
- ${n?r`<div class="date">${n}</div>`:""}
45
+ ${this.title?o`<div class="header">${l(!!r)}</div>`:""}
46
+ ${this.subtitle?o`<div class="sub-label">${this.subtitle}</div>`:""}
47
+ ${this.supportingText?o`<div class="supporting-text">${this.supportingText}</div>`:""}
48
+ ${n?o`<div class="date">${n}</div>`:""}
49
49
  </div>
50
50
  </div>
51
- `);case"list":return l(r`
51
+ `);case"list":return m(o`
52
52
  <div class="full-content">
53
53
  <div class="top-content">
54
- ${this.title?r`<div class="header"><span class="title">${this.title}</span></div>`:""}
55
- ${this.subtitle?r`<div class="sub-label">${this.subtitle}</div>`:""}
56
- ${this.supportingText?r`<div class="supporting-text">${this.supportingText}</div>`:""}
57
- ${n?r`<div class="date">${n}</div>`:""}
54
+ ${this.title?o`<div class="header"><span class="title">${this.title}</span></div>`:""}
55
+ ${this.subtitle?o`<div class="sub-label">${this.subtitle}</div>`:""}
56
+ ${this.supportingText?o`<div class="supporting-text">${this.supportingText}</div>`:""}
57
+ ${n?o`<div class="date">${n}</div>`:""}
58
58
  </div>
59
59
  <div class="content list">
60
60
  <slot></slot>
61
61
  </div>
62
62
  </div>
63
- `);case"social":const h=this.commentsHref,u=p=>{p.stopPropagation()},m=p=>{const v=this.renderRoot?.querySelector(".scb-card");v&&(p?v.classList.add("no-hover"):v.classList.remove("no-hover"))};return l(r`
63
+ `);case"social":const h=this.commentsHref,f=d=>{d.stopPropagation()},u=d=>{const b=this.renderRoot?.querySelector(".scb-card");b&&(d?b.classList.add("no-hover"):b.classList.remove("no-hover"))};return m(o`
64
64
  <div class="full-content">
65
65
  <div class="top-content">
66
- ${this.title?r`<div class="header">${c(!!this.cardHref)}</div>`:""}
67
- ${this.subtitle?r`<div class="sub-label">${this.subtitle}</div>`:""}
68
- ${this.supportingText?r`<div class="supporting-text">${this.supportingText}</div>`:""}
69
- ${n?r`<div class="date">${n}</div>`:""}
66
+ ${this.title?o`<div class="header">${l(!!r)}</div>`:""}
67
+ ${this.subtitle?o`<div class="sub-label">${this.subtitle}</div>`:""}
68
+ ${this.supportingText?o`<div class="supporting-text">${this.supportingText}</div>`:""}
69
+ ${n?o`<div class="date">${n}</div>`:""}
70
70
  </div>
71
71
  <div class="content">
72
72
  <div class="social-metrics">
73
- ${this.author?r`
73
+ ${this.author?o`
74
74
  <a
75
75
  class="author social-text"
76
76
  href="${this.authorHref||"#"}"
77
77
  tabindex="0"
78
- @click=${u}
79
- @mouseenter=${()=>m(!0)}
80
- @mouseleave=${()=>m(!1)}
78
+ @click=${f}
79
+ @mouseenter=${()=>u(!0)}
80
+ @mouseleave=${()=>u(!1)}
81
81
  >${this.authorText}</a>
82
82
  `:""}
83
83
  <span class="comments"
84
- @mouseenter=${()=>m(!0)}
85
- @mouseleave=${()=>m(!1)}
84
+ @mouseenter=${()=>u(!0)}
85
+ @mouseleave=${()=>u(!1)}
86
86
  >
87
- ${h!==""?r`
88
- <scb-icon-button href="${h}" tabindex="0" @click=${u} variant="standard" icon="comment" aria-label="Gå till kommentarer"></scb-icon-button>
89
- `:r`
87
+ ${h!==""?o`
88
+ <scb-icon-button href="${h}" tabindex="0" @click=${f} variant="standard" icon="comment" aria-label="Gå till kommentarer"></scb-icon-button>
89
+ `:o`
90
90
  <md-icon>comment</md-icon>
91
91
  `}
92
92
  <span class="social-text">${this.commentsText}: ${this.comments}</span>
93
93
  </span>
94
94
  <span class="likes"
95
- @mouseenter=${()=>m(!0)}
96
- @mouseleave=${()=>m(!1)}
95
+ @mouseenter=${()=>u(!0)}
96
+ @mouseleave=${()=>u(!1)}
97
97
  >
98
98
  <scb-icon-button
99
99
  id="like-button"
@@ -101,53 +101,53 @@ import{_ as f}from"../../vendor/preload-helper.js";import{a as $,n as a,i as k,x
101
101
  icon="thumb_up"
102
102
  ?icon-filled=${this.hasLiked} // boolean attribute binding
103
103
  aria-label="${this.likesText||"Gilla"}"
104
- @click=${p=>{p.stopPropagation(),this.hasLiked=!this.hasLiked,this.dispatchEvent(new CustomEvent("like-click",{bubbles:!0,composed:!0}))}}
105
- @keydown=${p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),p.stopPropagation(),this.hasLiked=!this.hasLiked,this.dispatchEvent(new CustomEvent("like-click",{bubbles:!0,composed:!0})))}}
106
- @hover=${p=>{p.preventDefault(),p.stopPropagation(),this.dispatchEvent(new CustomEvent("like-hover",{bubbles:!0,composed:!0}))}}
104
+ @click=${d=>{d.stopPropagation(),this.hasLiked=!this.hasLiked,this.__dispatchLikeEvent("like-click",{hasLiked:this.hasLiked,likes:this.likes})}}
105
+ @keydown=${d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),d.stopPropagation(),this.hasLiked=!this.hasLiked,this.__dispatchLikeEvent("like-click",{hasLiked:this.hasLiked,likes:this.likes}))}}
106
+ @hover=${d=>{d.preventDefault(),d.stopPropagation(),this.__dispatchLikeEvent("like-hover",{hasLiked:this.hasLiked,likes:this.likes})}}
107
107
  ></scb-icon-button>
108
- ${this.likesHoverContent?r`
108
+ ${this.likesHoverContent?o`
109
109
  <scb-tooltip variant="rich" for="like-button" supporting-text=${this.__noWrapText(this.likesHoverContent)} trigger="hover" position="right">
110
110
  <span class="social-text">${this.likesText}: ${this.likes}</span>
111
111
  </scb-tooltip>
112
- `:r`<span class="social-text">${this.likesText}: ${this.likes}</span>`}
112
+ `:o`<span class="social-text">${this.likesText}: ${this.likes}</span>`}
113
113
  </span>
114
114
  </div>
115
115
  </div>
116
116
  </div>
117
- `);case"link":return l(r`
117
+ `);case"link":return m(o`
118
118
  <div class="full-content">
119
119
  <div class="top-content">
120
- ${this.title?r`<div class="header"><span class="title">${this.title}</span></div>`:""}
121
- ${this.subtitle?r`<div class="sub-label">${this.subtitle}</div>`:""}
122
- ${this.supportingText?r`<div class="supporting-text">${this.supportingText}</div>`:""}
123
- ${n?r`<div class="date">${n}</div>`:""}
120
+ ${this.title?o`<div class="header"><span class="title">${this.title}</span></div>`:""}
121
+ ${this.subtitle?o`<div class="sub-label">${this.subtitle}</div>`:""}
122
+ ${this.supportingText?o`<div class="supporting-text">${this.supportingText}</div>`:""}
123
+ ${n?o`<div class="date">${n}</div>`:""}
124
124
  </div>
125
125
  <div class="content links">
126
126
  <slot></slot>
127
127
  </div>
128
128
  </div>
129
- `);case"action":return l(r`
129
+ `);case"action":return m(o`
130
130
  <div class="full-content">
131
131
  <div class="top-content">
132
- ${this.title?r`<div class="header"><span class="title">${this.title}</span></div>`:""}
133
- ${this.subtitle?r`<div class="sub-label">${this.subtitle}</div>`:""}
134
- ${this.supportingText?r`<div class="supporting-text">${this.supportingText}</div>`:""}
135
- ${n?r`<div class="date">${n}</div>`:""}
132
+ ${this.title?o`<div class="header"><span class="title">${this.title}</span></div>`:""}
133
+ ${this.subtitle?o`<div class="sub-label">${this.subtitle}</div>`:""}
134
+ ${this.supportingText?o`<div class="supporting-text">${this.supportingText}</div>`:""}
135
+ ${n?o`<div class="date">${n}</div>`:""}
136
136
  </div>
137
137
  <div class="content actions">
138
138
  <slot></slot>
139
139
  </div>
140
140
  </div>
141
- `);default:return l(r`
141
+ `);default:return m(o`
142
142
  <div class="full-content">
143
143
  <div class="top-content">
144
- ${this.title?r`<div class="header">${c(!!this.cardHref)}</div>`:""}
145
- ${this.subtitle?r`<div class="sub-label">${this.subtitle}</div>`:""}
146
- ${this.supportingText?r`<div class="supporting-text">${this.supportingText}</div>`:""}
147
- ${n?r`<div class="date">${n}</div>`:""}
144
+ ${this.title?o`<div class="header">${l(!!r)}</div>`:""}
145
+ ${this.subtitle?o`<div class="sub-label">${this.subtitle}</div>`:""}
146
+ ${this.supportingText?o`<div class="supporting-text">${this.supportingText}</div>`:""}
147
+ ${n?o`<div class="date">${n}</div>`:""}
148
148
  </div>
149
149
  </div>
150
- `)}}updated(e){super.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("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("type")&&(this.type==="list"?this.setAttribute("data-density","-2"):this.removeAttribute("data-density")),this.style.setProperty("--scb-card-media-fit",this.mediaFit||"cover"),this.style.setProperty("--scb-card-media-position",this.mediaPosition||"center"),(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom")||e.has("spacingLeft")||e.has("spacingRight"))&&y(this,b,g).call(this)}async firstUpdated(e){t.__iconLoaded||(await f(()=>import("../../vendor/vendor-material.js").then(i=>i.i),__vite__mapDeps([0,1]),import.meta.url),t.__iconLoaded=!0),t.__rippleLoaded||(await f(()=>import("../../vendor/vendor-material.js").then(i=>i.r),__vite__mapDeps([0,1]),import.meta.url),t.__rippleLoaded=!0),y(this,b,g).call(this)}};b=new WeakSet;g=function(){const e=this.mapSpacingToken(this.spacing),i=this.mapSpacingToken(this.spacingTop)??e,o=this.mapSpacingToken(this.spacingBottom)??e,n=this.mapSpacingToken(this.spacingLeft),c=this.mapSpacingToken(this.spacingRight);i?this.style.setProperty("--scb-card-spacing-block-start",i):this.style.removeProperty("--scb-card-spacing-block-start"),o?this.style.setProperty("--scb-card-spacing-block-end",o):this.style.removeProperty("--scb-card-spacing-block-end"),n?this.style.setProperty("--scb-card-spacing-inline-start",n):this.style.removeProperty("--scb-card-spacing-inline-start"),c?this.style.setProperty("--scb-card-spacing-inline-end",c):this.style.removeProperty("--scb-card-spacing-inline-end")};t.__iconLoaded=!1;t.__rippleLoaded=!1;t.styles=$`
150
+ `)}}updated(e){super.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("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("type")&&(this.type==="list"?this.setAttribute("data-density","-2"):this.removeAttribute("data-density")),this.style.setProperty("--scb-card-media-fit",this.mediaFit||"cover"),this.style.setProperty("--scb-card-media-position",this.mediaPosition||"center"),(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom")||e.has("spacingLeft")||e.has("spacingRight"))&&x(this,v,g).call(this)}async firstUpdated(e){i.__iconLoaded||(await y(()=>import("../../vendor/vendor-material.js").then(t=>t.i),__vite__mapDeps([0,1]),import.meta.url),i.__iconLoaded=!0),i.__rippleLoaded||(await y(()=>import("../../vendor/vendor-material.js").then(t=>t.r),__vite__mapDeps([0,1]),import.meta.url),i.__rippleLoaded=!0),x(this,v,g).call(this)}};v=new WeakSet;g=function(){const e=this.mapSpacingToken(this.spacing),t=this.mapSpacingToken(this.spacingTop)??e,r=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"),r?this.style.setProperty("--scb-card-spacing-block-end",r):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")};i.__iconLoaded=!1;i.__rippleLoaded=!1;i.styles=_`
151
151
  :host {
152
152
  display: block;
153
153
  box-sizing: border-box;
@@ -493,4 +493,4 @@ import{_ as f}from"../../vendor/preload-helper.js";import{a as $,n as a,i as k,x
493
493
  .scb-card.filled .content.list ::slotted(scb-list) {
494
494
  --scb-list-bg: var(--md-sys-color-surface-dim, #F9F8EF);
495
495
  }
496
- `;s([a({type:String,reflect:!0})],t.prototype,"type",2);s([a({type:String,reflect:!0})],t.prototype,"variant",2);s([a({type:String,reflect:!0})],t.prototype,"direction",2);s([a({type:String,attribute:"media-type"})],t.prototype,"mediaType",2);s([a({type:String,attribute:"media-href"})],t.prototype,"mediaHref",2);s([a({type:String,attribute:"media-alt"})],t.prototype,"mediaAlt",2);s([a({type:String,attribute:"media-srcset"})],t.prototype,"mediaSrcset",2);s([a({type:String,attribute:"media-sizes"})],t.prototype,"mediaSizes",2);s([a({type:String,attribute:"media-loading"})],t.prototype,"mediaLoading",2);s([a({type:String,attribute:"media-decoding"})],t.prototype,"mediaDecoding",2);s([a({type:String,attribute:"media-fetchpriority"})],t.prototype,"mediaFetchPriority",2);s([a({type:String,attribute:"media-fit"})],t.prototype,"mediaFit",2);s([a({type:String,attribute:"media-position"})],t.prototype,"mediaPosition",2);s([a({type:String,attribute:"media-width"})],t.prototype,"mediaWidth",2);s([a({type:String,attribute:"media-height"})],t.prototype,"mediaHeight",2);s([a({type:String,attribute:"media-aspect"})],t.prototype,"mediaAspect",2);s([a({type:Boolean,attribute:"media-placeholder"})],t.prototype,"mediaPlaceholder",2);s([a({type:String,attribute:"card-href",reflect:!0})],t.prototype,"cardHref",2);s([a({type:String,reflect:!0})],t.prototype,"title",2);s([a({type:String,reflect:!0})],t.prototype,"subtitle",2);s([a({type:String,attribute:"supporting-text",reflect:!0})],t.prototype,"supportingText",2);s([a({type:Date,reflect:!0})],t.prototype,"date",2);s([a({type:String,attribute:"social-comments-text",reflect:!0})],t.prototype,"commentsText",2);s([a({type:Number,attribute:"social-comments",reflect:!0})],t.prototype,"comments",2);s([a({type:String,attribute:"social-comments-href",reflect:!0})],t.prototype,"commentsHref",2);s([a({type:String,attribute:"social-likes-text",reflect:!0})],t.prototype,"likesText",2);s([a({type:Number,attribute:"social-likes",reflect:!0})],t.prototype,"likes",2);s([a({type:String,attribute:"social-likes-hover-content",reflect:!0})],t.prototype,"likesHoverContent",2);s([a({type:Boolean,attribute:"social-has-liked",reflect:!0})],t.prototype,"hasLiked",2);s([a({type:Boolean,attribute:"social-likes-interactive",reflect:!0})],t.prototype,"likesInteractive",2);s([a({type:Boolean,attribute:"social-author",reflect:!0})],t.prototype,"author",2);s([a({type:String,attribute:"social-author-text",reflect:!0})],t.prototype,"authorText",2);s([a({type:String,attribute:"social-author-href",reflect:!0})],t.prototype,"authorHref",2);s([a({type:String,reflect:!0})],t.prototype,"sizing",2);s([a({type:String,reflect:!0})],t.prototype,"width",2);s([a({type:String,reflect:!0,attribute:"max-width"})],t.prototype,"maxWidth",2);s([a({type:String,reflect:!0})],t.prototype,"height",2);s([a({type:String,reflect:!0,attribute:"max-height"})],t.prototype,"maxHeight",2);s([a({type:String,reflect:!0})],t.prototype,"spacing",2);s([a({type:String,attribute:"spacing-top",reflect:!0})],t.prototype,"spacingTop",2);s([a({type:String,attribute:"spacing-bottom",reflect:!0})],t.prototype,"spacingBottom",2);s([a({type:String,attribute:"spacing-left",reflect:!0})],t.prototype,"spacingLeft",2);s([a({type:String,attribute:"spacing-right",reflect:!0})],t.prototype,"spacingRight",2);t=s([_("scb-card")],t);
496
+ `;s([a({type:String,reflect:!0})],i.prototype,"type",2);s([a({type:String,reflect:!0})],i.prototype,"variant",2);s([a({type:String,reflect:!0})],i.prototype,"direction",2);s([a({type:String,attribute:"media-type"})],i.prototype,"mediaType",2);s([a({type:String,attribute:"media-href"})],i.prototype,"mediaHref",2);s([a({type:String,attribute:"media-alt"})],i.prototype,"mediaAlt",2);s([a({type:String,attribute:"media-srcset"})],i.prototype,"mediaSrcset",2);s([a({type:String,attribute:"media-sizes"})],i.prototype,"mediaSizes",2);s([a({type:String,attribute:"media-loading"})],i.prototype,"mediaLoading",2);s([a({type:String,attribute:"media-decoding"})],i.prototype,"mediaDecoding",2);s([a({type:String,attribute:"media-fetchpriority"})],i.prototype,"mediaFetchPriority",2);s([a({type:String,attribute:"media-fit"})],i.prototype,"mediaFit",2);s([a({type:String,attribute:"media-position"})],i.prototype,"mediaPosition",2);s([a({type:String,attribute:"media-width"})],i.prototype,"mediaWidth",2);s([a({type:String,attribute:"media-height"})],i.prototype,"mediaHeight",2);s([a({type:String,attribute:"media-aspect"})],i.prototype,"mediaAspect",2);s([a({type:Boolean,attribute:"media-placeholder"})],i.prototype,"mediaPlaceholder",2);s([a({type:String,attribute:"card-href",reflect:!0})],i.prototype,"cardHref",2);s([a({type:String,reflect:!0})],i.prototype,"href",2);s([a({type:String,reflect:!0})],i.prototype,"title",2);s([a({type:String,reflect:!0})],i.prototype,"subtitle",2);s([a({type:String,attribute:"supporting-text",reflect:!0})],i.prototype,"supportingText",2);s([a({type:Date,reflect:!0})],i.prototype,"date",2);s([a({type:String,attribute:"social-comments-text",reflect:!0})],i.prototype,"commentsText",2);s([a({type:Number,attribute:"social-comments",reflect:!0})],i.prototype,"comments",2);s([a({type:String,attribute:"social-comments-href",reflect:!0})],i.prototype,"commentsHref",2);s([a({type:String,attribute:"social-likes-text",reflect:!0})],i.prototype,"likesText",2);s([a({type:Number,attribute:"social-likes",reflect:!0})],i.prototype,"likes",2);s([a({type:String,attribute:"social-likes-hover-content",reflect:!0})],i.prototype,"likesHoverContent",2);s([a({type:Boolean,attribute:"social-has-liked",reflect:!0})],i.prototype,"hasLiked",2);s([a({type:Boolean,attribute:"social-likes-interactive",reflect:!0})],i.prototype,"likesInteractive",2);s([a({type:Boolean,attribute:"social-author",reflect:!0})],i.prototype,"author",2);s([a({type:String,attribute:"social-author-text",reflect:!0})],i.prototype,"authorText",2);s([a({type:String,attribute:"social-author-href",reflect:!0})],i.prototype,"authorHref",2);s([a({type:String,reflect:!0})],i.prototype,"sizing",2);s([a({type:String,reflect:!0})],i.prototype,"width",2);s([a({type:String,reflect:!0,attribute:"max-width"})],i.prototype,"maxWidth",2);s([a({type:String,reflect:!0})],i.prototype,"height",2);s([a({type:String,reflect:!0,attribute:"max-height"})],i.prototype,"maxHeight",2);s([a({type:String,reflect:!0})],i.prototype,"spacing",2);s([a({type:String,attribute:"spacing-top",reflect:!0})],i.prototype,"spacingTop",2);s([a({type:String,attribute:"spacing-bottom",reflect:!0})],i.prototype,"spacingBottom",2);s([a({type:String,attribute:"spacing-left",reflect:!0})],i.prototype,"spacingLeft",2);s([a({type:String,attribute:"spacing-right",reflect:!0})],i.prototype,"spacingRight",2);i=s([z("scb-card")],i);
@@ -1,4 +1,4 @@
1
- import{a as l,n as c,i as d,x as g,t as h}from"../../vendor/vendor.js";import"../scb-button/scb-button.js";import"../../vendor/vendor-material.js";(function(){try{var t=typeof globalThis<"u"?globalThis:window;if(!t.__scb_ce_guard_installed__){t.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(s,i,n){try{customElements.get(s)||e(s,i,n)}catch(p){var a=String(p||"");if(a.indexOf("already been used")===-1&&a.indexOf("NotSupportedError")===-1)throw p}}}}catch{}})();var f=Object.defineProperty,u=Object.getOwnPropertyDescriptor,r=(t,e,s,i)=>{for(var n=i>1?void 0:i?u(e,s):e,a=t.length-1,p;a>=0;a--)(p=t[a])&&(n=(i?p(e,s,n):p(n))||n);return i&&n&&f(e,s,n),n};let o=class extends d{constructor(){super(...arguments),this.open=!0,this.title="",this.supportingText="",this.ariaLabel="Cookie-inställningar",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0}mapSpacingToken(t){if(!t)return;const e=String(t).trim();if(e)return/^\d+$/.test(e)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(e,10)))})`:e}applySpacing(){const t=this.mapSpacingToken(this.spacing),e=this.mapSpacingToken(this.spacingTop)??t,s=this.mapSpacingToken(this.spacingBottom)??t,i=this.mapSpacingToken(this.spacingLeft),n=this.mapSpacingToken(this.spacingRight);e?this.style.setProperty("--scb-cookies-consent-spacing-block-start",e):this.style.removeProperty("--scb-cookies-consent-spacing-block-start"),s?this.style.setProperty("--scb-cookies-consent-spacing-block-end",s):this.style.removeProperty("--scb-cookies-consent-spacing-block-end"),i?this.style.setProperty("--scb-cookies-consent-spacing-inline-start",i):this.style.removeProperty("--scb-cookies-consent-spacing-inline-start"),n?this.style.setProperty("--scb-cookies-consent-spacing-inline-end",n):this.style.removeProperty("--scb-cookies-consent-spacing-inline-end")}firstUpdated(t){const e=()=>{const s=window.innerWidth<=480,i=this.shadowRoot.querySelector('slot[name="buttons"]');i&&i.assignedElements().forEach(a=>{s?a.setAttribute("full-width",""):a.removeAttribute("full-width")})};e(),window.addEventListener("resize",e),this.addEventListener("click",s=>{const i=s.target;i.slot==="buttons"&&(i.id==="accept-btn"?this.closeAndRemove("cookies-accept"):i.id==="decline-btn"?this.closeAndRemove("cookies-decline"):i.id==="handle-btn"&&this.closeAndRemove("cookies-handle"))}),this.applySpacing()}updated(t){super.updated(t),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&this.applySpacing()}connectedCallback(){super.connectedCallback(),this.id||(this.id="cookie-consent")}closeAndRemove(t){this.dispatchEvent(new CustomEvent(t)),this.remove()}render(){return this.open?g`
1
+ import{a as l,n as r,i as d,x as h,t as u}from"../../vendor/vendor.js";import"../scb-button/scb-button.js";import"../../vendor/vendor-material.js";(function(){try{var t=typeof globalThis<"u"?globalThis:window;if(!t.__scb_ce_guard_installed__){t.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(i,o,n){try{customElements.get(i)||e(i,o,n)}catch(p){var c=String(p||"");if(c.indexOf("already been used")===-1&&c.indexOf("NotSupportedError")===-1)throw p}}}}catch{}})();var g=Object.defineProperty,f=Object.getOwnPropertyDescriptor,a=(t,e,i,o)=>{for(var n=o>1?void 0:o?f(e,i):e,c=t.length-1,p;c>=0;c--)(p=t[c])&&(n=(o?p(e,i,n):p(n))||n);return o&&n&&g(e,i,n),n};let s=class extends d{constructor(){super(...arguments),this.open=!0,this.autoRemove=!0,this.title="",this.supportingText="",this.ariaLabel="Cookie-inställningar",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this._updateButtonWidth=()=>{const t=window.innerWidth<=480,e=this.shadowRoot.querySelector('slot[name="buttons"]');e&&e.assignedElements().forEach(o=>{t?o.setAttribute("full-width",""):o.removeAttribute("full-width")})}}mapSpacingToken(t){if(!t)return;const e=String(t).trim();if(e)return/^\d+$/.test(e)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(e,10)))})`:e}applySpacing(){const t=this.mapSpacingToken(this.spacing),e=this.mapSpacingToken(this.spacingTop)??t,i=this.mapSpacingToken(this.spacingBottom)??t,o=this.mapSpacingToken(this.spacingLeft),n=this.mapSpacingToken(this.spacingRight);e?this.style.setProperty("--scb-cookies-consent-spacing-block-start",e):this.style.removeProperty("--scb-cookies-consent-spacing-block-start"),i?this.style.setProperty("--scb-cookies-consent-spacing-block-end",i):this.style.removeProperty("--scb-cookies-consent-spacing-block-end"),o?this.style.setProperty("--scb-cookies-consent-spacing-inline-start",o):this.style.removeProperty("--scb-cookies-consent-spacing-inline-start"),n?this.style.setProperty("--scb-cookies-consent-spacing-inline-end",n):this.style.removeProperty("--scb-cookies-consent-spacing-inline-end")}firstUpdated(t){this._updateButtonWidth(),window.addEventListener("resize",this._updateButtonWidth),this.addEventListener("click",e=>{const i=e.target;i.slot==="buttons"&&(i.id==="accept-btn"?this.closeAndRemove("cookies-accept"):i.id==="decline-btn"?this.closeAndRemove("cookies-decline"):i.id==="handle-btn"&&this.closeAndRemove("cookies-handle"))}),this.applySpacing()}updated(t){super.updated(t),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&this.applySpacing(),t.has("open")&&this.open&&this._updateButtonWidth()}connectedCallback(){super.connectedCallback(),this.id||(this.id="cookie-consent")}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("resize",this._updateButtonWidth)}closeAndRemove(t){this.dispatchEvent(new CustomEvent(t));const e=t.includes("-")?t.replace(/-/g,""):"";e&&e!==t&&this.dispatchEvent(new CustomEvent(e)),this.autoRemove?this.remove():this.open=!1}render(){return this.open?h`
2
2
  <div role="dialog" class="cookies-consent" aria-modal="true" aria-label=${this.ariaLabel}>
3
3
  <h2>${this.title}</h2>
4
4
  <div>
@@ -8,7 +8,7 @@ import{a as l,n as c,i as d,x as g,t as h}from"../../vendor/vendor.js";import"..
8
8
  <slot name="buttons"></slot>
9
9
  </div>
10
10
  </div>
11
- `:null}};o.styles=l`
11
+ `:null}};s.styles=l`
12
12
  :host {
13
13
  position: fixed;
14
14
  width: 100%;
@@ -75,4 +75,4 @@ import{a as l,n as c,i as d,x as g,t as h}from"../../vendor/vendor.js";import"..
75
75
  justify-content: flex-start;
76
76
  }
77
77
  }
78
- `;r([c({type:Boolean})],o.prototype,"open",2);r([c({type:String,reflect:!0})],o.prototype,"title",2);r([c({type:String,attribute:"supporting-text",reflect:!0})],o.prototype,"supportingText",2);r([c({type:String,attribute:"aria-label",reflect:!0})],o.prototype,"ariaLabel",2);r([c({type:String,reflect:!0})],o.prototype,"spacing",2);r([c({type:String,attribute:"spacing-top",reflect:!0})],o.prototype,"spacingTop",2);r([c({type:String,attribute:"spacing-bottom",reflect:!0})],o.prototype,"spacingBottom",2);r([c({type:String,attribute:"spacing-left",reflect:!0})],o.prototype,"spacingLeft",2);r([c({type:String,attribute:"spacing-right",reflect:!0})],o.prototype,"spacingRight",2);o=r([h("scb-cookies-consent")],o);
78
+ `;a([r({type:Boolean})],s.prototype,"open",2);a([r({type:Boolean,attribute:"auto-remove",converter:{fromAttribute:t=>t!=="false"}})],s.prototype,"autoRemove",2);a([r({type:String,reflect:!0})],s.prototype,"title",2);a([r({type:String,attribute:"supporting-text",reflect:!0})],s.prototype,"supportingText",2);a([r({type:String,attribute:"aria-label",reflect:!0})],s.prototype,"ariaLabel",2);a([r({type:String,reflect:!0})],s.prototype,"spacing",2);a([r({type:String,attribute:"spacing-top",reflect:!0})],s.prototype,"spacingTop",2);a([r({type:String,attribute:"spacing-bottom",reflect:!0})],s.prototype,"spacingBottom",2);a([r({type:String,attribute:"spacing-left",reflect:!0})],s.prototype,"spacingLeft",2);a([r({type:String,attribute:"spacing-right",reflect:!0})],s.prototype,"spacingRight",2);s=a([u("scb-cookies-consent")],s);
@@ -1,4 +1,4 @@
1
- import{a as _,n as a,i as u,E as d,x as f,t as h}from"../../vendor/vendor.js";import"../scb-divider/scb-divider.js";(function(){try{var e=typeof globalThis<"u"?globalThis:window;if(!e.__scb_ce_guard_installed__){e.__scb_ce_guard_installed__=!0;var o=customElements.define.bind(customElements);customElements.define=function(r,s,i){try{customElements.get(r)||o(r,s,i)}catch(c){var l=String(c||"");if(l.indexOf("already been used")===-1&&l.indexOf("NotSupportedError")===-1)throw c}}}}catch{}})();var p=Object.defineProperty,y=Object.getOwnPropertyDescriptor,n=(e,o,r,s)=>{for(var i=s>1?void 0:s?y(o,r):o,l=e.length-1,c;l>=0;l--)(c=e[l])&&(i=(s?c(o,r,i):c(i))||i);return s&&i&&p(o,r,i),i};let t=class extends u{constructor(){super(...arguments),this.floating=!0,this.left=!0,this.right=!1,this.open=!1,this.overlay=!1,this.lockScroll=!1,this.closeOnOverlay=!0,this.modal=!1,this.__effectiveSide="left",this.__lastTriggerEl=null,this.__lastTriggerWasAriaControls=!1,this.__onDocumentClick=e=>{const o=this.__getActionFromEvent(e);if(o){o==="open"&&this.__setOpen(!0),o==="close"&&this.__setOpen(!1),o==="toggle"&&this.__setOpen(!this.open),e.stopPropagation();return}this.floating&&this.open&&!this.overlay&&(e.composedPath().includes(this)||this.__setOpen(!1))},this.__onDocumentKeydown=e=>{if(this.open){if(e.key==="Escape"){this.__setOpen(!1);return}if(this.overlay&&e.key==="Tab"){const o=this.__getFocusable();if(o.length===0)return;const r=o[0],s=o[o.length-1],i=document.activeElement;e.shiftKey?(i===r||!i||!this.contains(i))&&(e.preventDefault(),s.focus()):(i===s||!i||!this.contains(i))&&(e.preventDefault(),r.focus())}}}}static __ensureOverlayStyles(){if(typeof document>"u"||document.getElementById("scb-drawer-overlay-styles"))return;const e=document.createElement("style");e.id="scb-drawer-overlay-styles",e.textContent=`
1
+ import{a as u,n as a,i as _,E as d,x as f,t as h}from"../../vendor/vendor.js";import"../scb-divider/scb-divider.js";(function(){try{var e=typeof globalThis<"u"?globalThis:window;if(!e.__scb_ce_guard_installed__){e.__scb_ce_guard_installed__=!0;var o=customElements.define.bind(customElements);customElements.define=function(r,s,i){try{customElements.get(r)||o(r,s,i)}catch(c){var l=String(c||"");if(l.indexOf("already been used")===-1&&l.indexOf("NotSupportedError")===-1)throw c}}}}catch{}})();var p=Object.defineProperty,v=Object.getOwnPropertyDescriptor,n=(e,o,r,s)=>{for(var i=s>1?void 0:s?v(o,r):o,l=e.length-1,c;l>=0;l--)(c=e[l])&&(i=(s?c(o,r,i):c(i))||i);return s&&i&&p(o,r,i),i};let t=class extends _{constructor(){super(...arguments),this.floating=!0,this.left=!0,this.right=!1,this.open=!1,this.overlay=!1,this.lockScroll=!1,this.closeOnOverlay=!0,this.modal=!1,this.__effectiveSide="left",this.__lastTriggerEl=null,this.__lastTriggerWasAriaControls=!1,this.__onDocumentClick=e=>{const o=this.__getActionFromEvent(e);if(o){o==="open"&&this.__setOpen(!0),o==="close"&&this.__setOpen(!1),o==="toggle"&&this.__setOpen(!this.open),e.stopPropagation();return}this.floating&&this.open&&!this.overlay&&(e.composedPath().includes(this)||this.__setOpen(!1))},this.__onDocumentKeydown=e=>{if(this.open){if(e.key==="Escape"){this.__setOpen(!1);return}if(this.overlay&&e.key==="Tab"){const o=this.__getFocusable();if(o.length===0)return;const r=o[0],s=o[o.length-1],i=document.activeElement;e.shiftKey?(i===r||!i||!this.contains(i))&&(e.preventDefault(),s.focus()):(i===s||!i||!this.contains(i))&&(e.preventDefault(),r.focus())}}}}static __ensureOverlayStyles(){if(typeof document>"u"||document.getElementById("scb-drawer-overlay-styles"))return;const e=document.createElement("style");e.id="scb-drawer-overlay-styles",e.textContent=`
2
2
  .scb-drawer-global-overlay {
3
3
  position: fixed;
4
4
  inset: 0;
@@ -23,7 +23,7 @@ import{a as _,n as a,i as u,E as d,x as f,t as h}from"../../vendor/vendor.js";im
23
23
  >
24
24
  <div class="panel"><slot></slot></div>
25
25
  </div>
26
- `}connectedCallback(){super.connectedCallback(),this.__syncEffectiveSide(new Map),document.addEventListener("click",this.__onDocumentClick,!1)}disconnectedCallback(){document.removeEventListener("click",this.__onDocumentClick,!1),document.removeEventListener("keydown",this.__onDocumentKeydown,!0),this.overlay&&(t.__hideOverlay(this),this.lockScroll&&t.__lockScrollDisable()),super.disconnectedCallback()}__getActionFromEvent(e){if(!this.id)return null;const o=e.composedPath();for(const r of o)if(r instanceof Element){if(r.getAttribute("data-drawer-open")===this.id)return this.__lastTriggerEl=r,this.__lastTriggerWasAriaControls=!1,"open";if(r.getAttribute("data-drawer-close")===this.id)return this.__lastTriggerEl=r,this.__lastTriggerWasAriaControls=!1,"close";if(r.getAttribute("data-drawer-toggle")===this.id)return this.__lastTriggerEl=r,this.__lastTriggerWasAriaControls=!1,"toggle";if(r.getAttribute("aria-controls")===this.id)return this.__lastTriggerEl=r,this.__lastTriggerWasAriaControls=!0,"toggle"}return null}__getFocusable(){const e='button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])',o=new Set,r=s=>{s.querySelectorAll(e).forEach(i=>o.add(i))};return r(this),r(this.renderRoot),Array.from(o).filter(s=>!s.hasAttribute("disabled")&&s.tabIndex>=0)}__setOpen(e){this.open=e}__syncLastTriggerExpanded(e){this.__lastTriggerEl&&this.__lastTriggerWasAriaControls&&this.__lastTriggerEl.getAttribute("aria-controls")===this.id&&this.__lastTriggerEl.setAttribute("aria-expanded",String(e))}__syncEffectiveSide(e){const o=this.left&&this.right;let r;o?e.has("left")&&this.left&&!e.has("right")?r="left":r="right":this.right?r="right":r="left",this.__effectiveSide!==r&&(this.__effectiveSide=r),this.getAttribute("data-side")!==r&&this.setAttribute("data-side",r)}willUpdate(e){this.__syncEffectiveSide(e)}updated(e){if(e.has("open")){const o=!!e.get("open");this.__applyOpenSideEffects(o,this.open)}}__applyOpenSideEffects(e,o){o&&!e?(this.__syncLastTriggerExpanded(!0),this.floating&&this.overlay&&(t.__showOverlay(this),this.lockScroll&&t.__lockScrollEnable()),document.addEventListener("keydown",this.__onDocumentKeydown,!0),this.updateComplete.then(()=>{this.__getFocusable()[0]?.focus?.()}),this.dispatchEvent(new CustomEvent("scb-drawer-opened",{bubbles:!0,composed:!0}))):!o&&e&&(this.__syncLastTriggerExpanded(!1),this.floating&&this.overlay&&(t.__hideOverlay(this),this.lockScroll&&t.__lockScrollDisable()),document.removeEventListener("keydown",this.__onDocumentKeydown,!0),this.__lastTriggerEl?.focus?.(),this.dispatchEvent(new CustomEvent("scb-drawer-closed",{bubbles:!0,composed:!0})))}};t.__overlayEl=null;t.__overlayStack=[];t.__lockedCount=0;t.__prevDocOverflow=null;t.__prevBodyOverflow=null;t.__prevDocPaddingRight=null;t.__prevBodyPaddingRight=null;t.styles=_`
26
+ `}connectedCallback(){super.connectedCallback(),this.__syncEffectiveSide(new Map),document.addEventListener("click",this.__onDocumentClick,!1)}disconnectedCallback(){document.removeEventListener("click",this.__onDocumentClick,!1),document.removeEventListener("keydown",this.__onDocumentKeydown,!0),this.overlay&&(t.__hideOverlay(this),this.lockScroll&&t.__lockScrollDisable()),super.disconnectedCallback()}__getActionFromEvent(e){if(!this.id)return null;const o=e.composedPath();for(const r of o)if(r instanceof Element){if(r.getAttribute("data-drawer-open")===this.id)return this.__lastTriggerEl=r,this.__lastTriggerWasAriaControls=!1,"open";if(r.getAttribute("data-drawer-close")===this.id)return this.__lastTriggerEl=r,this.__lastTriggerWasAriaControls=!1,"close";if(r.getAttribute("data-drawer-toggle")===this.id)return this.__lastTriggerEl=r,this.__lastTriggerWasAriaControls=!1,"toggle";if(r.getAttribute("aria-controls")===this.id)return this.__lastTriggerEl=r,this.__lastTriggerWasAriaControls=!0,"toggle"}return null}__getFocusable(){const e='button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])',o=new Set,r=s=>{s.querySelectorAll(e).forEach(i=>o.add(i))};return r(this),r(this.renderRoot),Array.from(o).filter(s=>!s.hasAttribute("disabled")&&s.tabIndex>=0)}__setOpen(e){this.open=e}__syncLastTriggerExpanded(e){this.__lastTriggerEl&&this.__lastTriggerWasAriaControls&&this.__lastTriggerEl.getAttribute("aria-controls")===this.id&&this.__lastTriggerEl.setAttribute("aria-expanded",String(e))}__syncEffectiveSide(e){const o=this.left&&this.right;let r;o?e.has("left")&&this.left&&!e.has("right")?r="left":r="right":this.right?r="right":r="left",this.__effectiveSide!==r&&(this.__effectiveSide=r),this.getAttribute("data-side")!==r&&this.setAttribute("data-side",r)}willUpdate(e){this.__syncEffectiveSide(e)}updated(e){if(e.has("open")){const o=!!e.get("open");this.__applyOpenSideEffects(o,this.open)}}__applyOpenSideEffects(e,o){o&&!e?(this.__syncLastTriggerExpanded(!0),this.floating&&this.overlay&&(t.__showOverlay(this),this.lockScroll&&t.__lockScrollEnable()),document.addEventListener("keydown",this.__onDocumentKeydown,!0),this.updateComplete.then(()=>{this.__getFocusable()[0]?.focus?.()}),this.dispatchEvent(new CustomEvent("scb-drawer-opened",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("scbdraweropened",{bubbles:!0,composed:!0}))):!o&&e&&(this.__syncLastTriggerExpanded(!1),this.floating&&this.overlay&&(t.__hideOverlay(this),this.lockScroll&&t.__lockScrollDisable()),document.removeEventListener("keydown",this.__onDocumentKeydown,!0),this.__lastTriggerEl?.focus?.(),this.dispatchEvent(new CustomEvent("scb-drawer-closed",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("scbdrawerclosed",{bubbles:!0,composed:!0})))}};t.__overlayEl=null;t.__overlayStack=[];t.__lockedCount=0;t.__prevDocOverflow=null;t.__prevBodyOverflow=null;t.__prevDocPaddingRight=null;t.__prevBodyPaddingRight=null;t.styles=u`
27
27
  :host {
28
28
  display: block;
29
29
  color: var(--md-sys-color-on-surface);