scb-wc 0.1.147 → 0.1.149

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 (171) hide show
  1. package/README.md +22 -41
  2. package/all.js +5 -0
  3. package/fonts/material-symbols-outlined/files/material-symbols-outlined-subset.woff2 +0 -0
  4. package/icons.json +1 -3
  5. package/index.js +95 -90
  6. package/mvc/components/all.js +5 -0
  7. package/mvc/components/scb-accordion/scb-accordion-item.js +9 -9
  8. package/mvc/components/scb-app-bar/scb-app-bar.js +6 -6
  9. package/mvc/components/scb-avatar/scb-avatar.js +2 -2
  10. package/mvc/components/scb-badge/scb-badge.js +3 -3
  11. package/mvc/components/scb-breadcrumb/scb-breadcrumb-item.js +3 -3
  12. package/mvc/components/scb-breadcrumb/scb-breadcrumb.js +12 -12
  13. package/mvc/components/scb-button/scb-button.js +3 -5
  14. package/mvc/components/scb-calendar/scb-calendar.js +8 -8
  15. package/mvc/components/scb-calendar-card/scb-calendar-card.js +9 -9
  16. package/mvc/components/scb-card/scb-card.js +39 -39
  17. package/mvc/components/scb-checkbox/scb-checkbox-group.js +5 -5
  18. package/mvc/components/scb-checkbox/scb-checkbox.js +8 -8
  19. package/mvc/{vendor → components/scb-chevron}/scb-chevron.js +1 -1
  20. package/mvc/components/scb-chip/scb-chip.js +7 -7
  21. package/mvc/components/scb-collapse/scb-collapse.js +10 -10
  22. package/mvc/components/scb-datepicker/scb-datepicker.js +132 -0
  23. package/mvc/components/scb-dialog/scb-dialog.js +2 -2
  24. package/mvc/components/scb-drop-zone/scb-drop-zone.js +2 -2
  25. package/mvc/components/scb-dropdown/scb-dropdown.js +46 -31
  26. package/mvc/components/scb-fab/scb-fab.js +6 -6
  27. package/mvc/components/scb-fact-card/scb-fact-card-content.js +3 -3
  28. package/mvc/components/scb-fact-card/scb-fact-card.js +2 -2
  29. package/mvc/components/scb-footer/scb-footer.js +8 -8
  30. package/mvc/components/scb-form-error-summary/scb-form-error-summary.js +3 -3
  31. package/mvc/components/scb-header/scb-header.js +59 -99
  32. package/mvc/components/scb-horizontal-scroller/scb-horizontal-scroller.js +7 -7
  33. package/mvc/components/scb-icon/scb-icon.js +2 -2
  34. package/mvc/components/scb-icon-button/scb-icon-button.js +6 -6
  35. package/mvc/components/scb-keyfigure-card/scb-keyfigure-card.js +4 -4
  36. package/mvc/components/scb-link/scb-link.js +4 -4
  37. package/mvc/components/scb-list/scb-list-item.js +6 -6
  38. package/mvc/components/scb-list/scb-list.js +2 -2
  39. package/mvc/components/scb-menu/scb-menu-item.js +2 -2
  40. package/mvc/components/scb-menu/scb-menu-section.js +3 -5
  41. package/mvc/components/scb-menu/scb-menu.js +4 -8
  42. package/mvc/components/scb-nav/scb-nav.js +2 -2
  43. package/mvc/components/scb-notification-card/scb-notification-card.js +12 -12
  44. package/mvc/components/scb-options-menu/scb-options-menu-item.js +2 -2
  45. package/mvc/components/scb-options-menu/scb-options-menu.js +3 -2
  46. package/mvc/components/scb-pagination/scb-pagination.js +7 -7
  47. package/mvc/components/scb-progress-stepper/scb-progress-step.js +2 -2
  48. package/mvc/components/scb-radio-button/scb-radio-button.js +7 -7
  49. package/mvc/components/scb-radio-button/scb-radio-group.js +4 -4
  50. package/mvc/components/scb-search/scb-search.js +3 -3
  51. package/mvc/components/scb-segmented-button/scb-segmented-button.js +1 -1
  52. package/mvc/components/scb-segmented-button/scb-segmented-item.js +2 -2
  53. package/mvc/components/scb-select/scb-select-option.js +2 -2
  54. package/mvc/components/scb-select/scb-select.js +14 -14
  55. package/mvc/components/scb-slider/scb-slider.js +11 -11
  56. package/mvc/components/scb-snackbar/scb-snackbar.js +7 -7
  57. package/mvc/components/scb-status-pill/scb-status-pill.js +2 -2
  58. package/mvc/components/scb-stepper/scb-step.js +2 -8
  59. package/mvc/components/scb-stepper/scb-stepper.js +2 -24
  60. package/mvc/components/scb-switch/scb-switch.js +4 -4
  61. package/mvc/components/scb-table/scb-table.js +2 -2
  62. package/mvc/components/scb-table-advanced/scb-table-advanced.js +6 -6
  63. package/mvc/components/scb-textfield/scb-textfield.js +35 -166
  64. package/mvc/components/scb-toc/scb-toc-item.js +9 -9
  65. package/mvc/components/scb-tooltip/scb-tooltip.js +5 -5
  66. package/mvc/components/scb-viz/scb-viz.js +66 -100
  67. package/mvc/components/shared/lazy-focus-ring.js +2 -0
  68. package/mvc/components/shared/lazy-ripple.js +2 -0
  69. package/mvc/components/shared/scb-icon-svg.js +11 -0
  70. package/mvc/fonts/material-symbols-outlined/files/material-symbols-outlined-subset.woff2 +0 -0
  71. package/mvc/scb-logo.svg +20 -20
  72. package/mvc/scb-typography.css +1 -1
  73. package/mvc/scb-wc-core.css +1 -1
  74. package/mvc/scb-wc-selfhost.css +1 -1
  75. package/mvc/scb-wc.css +1 -1
  76. package/mvc/scb.svg +13 -13
  77. package/mvc/vendor/scb-card-variants.internal.js +36 -26
  78. package/package.json +2 -2
  79. package/scb-accordion/scb-accordion-item.js +26 -29
  80. package/scb-app-bar/scb-app-bar.js +11 -11
  81. package/scb-avatar/scb-avatar.js +4 -4
  82. package/scb-badge/scb-badge.js +1 -1
  83. package/scb-breadcrumb/scb-breadcrumb-item.js +20 -1
  84. package/scb-breadcrumb/scb-breadcrumb.js +24 -3
  85. package/scb-button/scb-button.js +13 -20
  86. package/scb-calendar/scb-calendar.js +5 -5
  87. package/scb-calendar-card/scb-calendar-card.js +44 -35
  88. package/scb-card/scb-card-variants.internal.js +1 -1
  89. package/scb-card/scb-card.js +219 -171
  90. package/scb-checkbox/scb-checkbox-group.js +24 -25
  91. package/scb-checkbox/scb-checkbox.js +23 -22
  92. package/scb-chevron/scb-chevron.js +1 -0
  93. package/scb-chip/scb-chip.js +56 -26
  94. package/scb-collapse/scb-collapse.js +10 -10
  95. package/scb-components/index.d.ts +104 -0
  96. package/scb-components/scb-card/scb-card.d.ts +1 -0
  97. package/scb-components/scb-chevron/scb-chevron.d.ts +11 -0
  98. package/scb-components/scb-datepicker/scb-datepicker.d.ts +45 -0
  99. package/scb-components/scb-dropdown/scb-dropdown.d.ts +1 -1
  100. package/scb-components/scb-icon-button/scb-icon-button.d.ts +1 -1
  101. package/scb-components/scb-list/scb-list-item.d.ts +1 -0
  102. package/scb-components/scb-list/scb-list.d.ts +1 -0
  103. package/scb-components/scb-segmented-button/scb-segmented-button.d.ts +4 -0
  104. package/scb-components/scb-select/scb-select.d.ts +1 -0
  105. package/scb-components/scb-textfield/scb-textfield.d.ts +1 -1
  106. package/scb-components/scb-viz/scb-viz.d.ts +3 -1
  107. package/scb-components/shared/lazy-focus-ring.d.ts +4 -0
  108. package/scb-components/shared/lazy-ripple.d.ts +9 -0
  109. package/scb-components/shared/scb-icon-svg.d.ts +3 -0
  110. package/scb-datepicker/scb-datepicker.js +1 -0
  111. package/scb-dialog/scb-dialog.js +4 -4
  112. package/scb-drop-zone/scb-drop-zone.js +23 -23
  113. package/scb-dropdown/scb-dropdown.js +44 -40
  114. package/scb-fab/scb-fab.js +12 -3
  115. package/scb-fact-card/scb-fact-card-content.js +36 -27
  116. package/scb-fact-card/scb-fact-card.js +9 -33
  117. package/scb-footer/scb-footer.js +9 -9
  118. package/scb-form-error-summary/scb-form-error-summary.js +7 -7
  119. package/scb-header/scb-header.js +90 -117
  120. package/scb-horizontal-scroller/scb-horizontal-scroller.js +4 -4
  121. package/scb-icon/scb-icon.js +1 -1
  122. package/scb-icon-button/scb-icon-button.js +8 -8
  123. package/scb-keyfigure-card/scb-keyfigure-card.js +21 -37
  124. package/scb-link/scb-link.js +1 -0
  125. package/scb-list/scb-list-item.js +30 -10
  126. package/scb-list/scb-list.js +5 -2
  127. package/scb-menu/scb-menu-item.js +2 -2
  128. package/scb-menu/scb-menu-section.js +4 -9
  129. package/scb-menu/scb-menu.js +8 -22
  130. package/scb-nav/scb-nav.js +3 -3
  131. package/scb-notification-card/scb-notification-card.js +9 -41
  132. package/scb-options-menu/scb-options-menu-item.js +4 -3
  133. package/scb-options-menu/scb-options-menu.js +32 -26
  134. package/scb-pagination/scb-pagination.js +2 -2
  135. package/scb-progress-stepper/scb-progress-step.js +3 -3
  136. package/scb-radio-button/scb-radio-button.js +33 -32
  137. package/scb-radio-button/scb-radio-group.js +24 -25
  138. package/scb-search/scb-search.js +35 -39
  139. package/scb-segmented-button/scb-segmented-button.js +14 -16
  140. package/scb-segmented-button/scb-segmented-item.js +53 -29
  141. package/scb-select/scb-select-option.js +6 -6
  142. package/scb-select/scb-select.js +93 -86
  143. package/scb-slider/scb-slider.js +18 -4
  144. package/scb-snackbar/scb-snackbar.js +9 -7
  145. package/scb-status-pill/scb-status-pill.js +4 -4
  146. package/scb-stepper/scb-step.js +19 -22
  147. package/scb-stepper/scb-stepper.js +14 -36
  148. package/scb-switch/scb-switch.js +17 -10
  149. package/scb-table/scb-table.js +14 -4
  150. package/scb-table-advanced/scb-table-advanced.js +14 -4
  151. package/scb-textfield/scb-textfield.js +58 -78
  152. package/scb-toc/scb-toc-item.js +9 -36
  153. package/scb-tooltip/scb-tooltip.js +6 -6
  154. package/scb-typography.css +1 -1
  155. package/scb-viz/scb-viz.js +87 -200
  156. package/scb-wc-core.css +1 -1
  157. package/scb-wc-selfhost.css +1 -1
  158. package/scb-wc.bundle.js +2052 -2160
  159. package/scb-wc.css +1 -1
  160. package/scb-wc.d.ts +208 -198
  161. package/shared/scb-icon-svg.js +5 -2
  162. package/starters/blazor/Components/Pages/Home.razor +1 -1
  163. package/starters/blazor-service/Components/Pages/Home.razor +1 -1
  164. package/starters/html/main.js +1 -1
  165. package/starters/html-service/main.js +1 -1
  166. package/starters/react/src/App.jsx +1 -1
  167. package/starters/react-service/src/App.jsx +1 -1
  168. package/mvc/vendor/lazy-focus-ring.js +0 -2
  169. package/mvc/vendor/lazy-ripple.js +0 -2
  170. package/mvc/vendor/scb-icon-svg.js +0 -11
  171. package/scb-wc-public-entry/index.d.ts +0 -99
@@ -1,4 +1,4 @@
1
- import{d as F,f as z,g as l,h as L,m as M,o as q,p as a,s as b,v as u,y as T}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/icon.js";import"../../vendor/ripple.js";import{t as c}from"../../vendor/decorate.js";import{n as P,t as d}from"../../vendor/assertClassBrand.js";import{n as S,r as C,t as m}from"../../vendor/classPrivateFieldGet2.js";import"../../vendor/md-focus-ring.js";import{t as O}from"../../vendor/delegate.js";import{a as D,n as H,o as G,r as K,s as U,t as W}from"../../vendor/form-associated.js";import{t as N}from"../../vendor/redispatch-event.js";import{i as Y,n as j,r as J}from"../../vendor/validator.js";import{t as Q}from"../../vendor/checkbox-validator.js";import"./scb-checkbox-group.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,r,s){try{customElements.get(i)||e(i,r,s)}catch(w){var p=String(w||"");if(p.indexOf("already been used")===-1&&p.indexOf("NotSupportedError")===-1)throw w}}}}catch{}})();var X=Y(K(D(L))),h=class extends X{constructor(){super(),this.checked=!1,this.indeterminate=!1,this.required=!1,this.value="on",this.prevChecked=!1,this.prevDisabled=!1,this.prevIndeterminate=!1,this.addEventListener("click",t=>{!U(t)||!this.input||(this.focus(),G(this.input))})}update(t){(t.has("checked")||t.has("disabled")||t.has("indeterminate"))&&(this.prevChecked=t.get("checked")??this.checked,this.prevDisabled=t.get("disabled")??this.disabled,this.prevIndeterminate=t.get("indeterminate")??this.indeterminate),super.update(t)}render(){const t=!this.prevChecked&&!this.prevIndeterminate,e=this.prevChecked&&!this.prevIndeterminate,i=this.prevIndeterminate,r=this.checked&&!this.indeterminate,s=this.indeterminate,p=q({disabled:this.disabled,selected:r||s,unselected:!r&&!s,checked:r,indeterminate:s,"prev-unselected":t,"prev-checked":e,"prev-indeterminate":i,"prev-disabled":this.prevDisabled}),{ariaLabel:w,ariaInvalid:B}=this;return u`
1
+ import{d as F,f as E,g as l,h as L,m as M,o as q,p as o,s as b,v as m,y as T}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/icon.js";import"../../vendor/ripple.js";import{t as c}from"../../vendor/decorate.js";import{n as P,t as d}from"../../vendor/assertClassBrand.js";import{n as S,r as C,t as u}from"../../vendor/classPrivateFieldGet2.js";import"../../vendor/md-focus-ring.js";import{t as O}from"../../vendor/delegate.js";import{a as D,n as H,o as G,r as K,s as U,t as W}from"../../vendor/form-associated.js";import{t as N}from"../../vendor/redispatch-event.js";import{i as Y,n as j,r as J}from"../../vendor/validator.js";import{t as Q}from"../../vendor/checkbox-validator.js";import"./scb-checkbox-group.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,r,s){try{customElements.get(i)||e(i,r,s)}catch(w){var p=String(w||"");if(p.indexOf("already been used")===-1&&p.indexOf("NotSupportedError")===-1)throw w}}}}catch{}})();var X=Y(K(D(L))),h=class extends X{constructor(){super(),this.checked=!1,this.indeterminate=!1,this.required=!1,this.value="on",this.prevChecked=!1,this.prevDisabled=!1,this.prevIndeterminate=!1,this.addEventListener("click",t=>{!U(t)||!this.input||(this.focus(),G(this.input))})}update(t){(t.has("checked")||t.has("disabled")||t.has("indeterminate"))&&(this.prevChecked=t.get("checked")??this.checked,this.prevDisabled=t.get("disabled")??this.disabled,this.prevIndeterminate=t.get("indeterminate")??this.indeterminate),super.update(t)}render(){const t=!this.prevChecked&&!this.prevIndeterminate,e=this.prevChecked&&!this.prevIndeterminate,i=this.prevIndeterminate,r=this.checked&&!this.indeterminate,s=this.indeterminate,p=q({disabled:this.disabled,selected:r||s,unselected:!r&&!s,checked:r,indeterminate:s,"prev-unselected":t,"prev-checked":e,"prev-indeterminate":i,"prev-disabled":this.prevDisabled}),{ariaLabel:w,ariaInvalid:B}=this;return m`
2
2
  <div class="container ${p}">
3
3
  <input
4
4
  type="checkbox"
@@ -22,10 +22,10 @@ import{d as F,f as z,g as l,h as L,m as M,o as q,p as a,s as b,v as u,y as T}fro
22
22
  <rect class="mark long" />
23
23
  </svg>
24
24
  </div>
25
- `}handleInput(t){const e=t.target;this.checked=e.checked,this.indeterminate=e.indeterminate}handleChange(t){N(this,t)}[H](){return!this.checked||this.indeterminate?null:this.value}[W](){return String(this.checked)}formResetCallback(){this.checked=this.hasAttribute("checked")}formStateRestoreCallback(t){this.checked=t==="true"}[j](){return new Q(()=>this)}[J](){return this.input}};O(h);h.shadowRootOptions={...L.shadowRootOptions,delegatesFocus:!0};b([a({type:Boolean})],h.prototype,"checked",void 0);b([a({type:Boolean})],h.prototype,"indeterminate",void 0);b([a({type:Boolean})],h.prototype,"required",void 0);b([a()],h.prototype,"value",void 0);b([z()],h.prototype,"prevChecked",void 0);b([z()],h.prototype,"prevDisabled",void 0);b([z()],h.prototype,"prevIndeterminate",void 0);b([F("input")],h.prototype,"input",void 0);var Z=T`:host{border-start-start-radius:var(--md-checkbox-container-shape-start-start, var(--md-checkbox-container-shape, 2px));border-start-end-radius:var(--md-checkbox-container-shape-start-end, var(--md-checkbox-container-shape, 2px));border-end-end-radius:var(--md-checkbox-container-shape-end-end, var(--md-checkbox-container-shape, 2px));border-end-start-radius:var(--md-checkbox-container-shape-end-start, var(--md-checkbox-container-shape, 2px));display:inline-flex;height:var(--md-checkbox-container-size, 18px);position:relative;vertical-align:top;width:var(--md-checkbox-container-size, 18px);-webkit-tap-highlight-color:rgba(0,0,0,0);cursor:pointer}:host([disabled]){cursor:default}:host([touch-target=wrapper]){margin:max(0px,(48px - var(--md-checkbox-container-size, 18px))/2)}md-focus-ring{height:44px;inset:unset;width:44px}input{appearance:none;height:48px;margin:0;opacity:0;outline:none;position:absolute;width:48px;z-index:1;cursor:inherit}:host([touch-target=none]) input{height:100%;width:100%}.container{border-radius:inherit;display:flex;height:100%;place-content:center;place-items:center;position:relative;width:100%}.outline,.background,.icon{inset:0;position:absolute}.outline,.background{border-radius:inherit}.outline{border-color:var(--md-checkbox-outline-color, var(--md-sys-color-on-surface-variant, #49454f));border-style:solid;border-width:var(--md-checkbox-outline-width, 2px);box-sizing:border-box}.background{background-color:var(--md-checkbox-selected-container-color, var(--md-sys-color-primary, #6750a4))}.background,.icon{opacity:0;transition-duration:150ms,50ms;transition-property:transform,opacity;transition-timing-function:cubic-bezier(0.3, 0, 0.8, 0.15),linear;transform:scale(0.6)}:where(.selected) :is(.background,.icon){opacity:1;transition-duration:350ms,50ms;transition-timing-function:cubic-bezier(0.05, 0.7, 0.1, 1),linear;transform:scale(1)}md-ripple{border-radius:var(--md-checkbox-state-layer-shape, var(--md-sys-shape-corner-full, 9999px));height:var(--md-checkbox-state-layer-size, 40px);inset:unset;width:var(--md-checkbox-state-layer-size, 40px);--md-ripple-hover-color: var(--md-checkbox-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--md-ripple-hover-opacity: var(--md-checkbox-hover-state-layer-opacity, 0.08);--md-ripple-pressed-color: var(--md-checkbox-pressed-state-layer-color, var(--md-sys-color-primary, #6750a4));--md-ripple-pressed-opacity: var(--md-checkbox-pressed-state-layer-opacity, 0.12)}.selected md-ripple{--md-ripple-hover-color: var(--md-checkbox-selected-hover-state-layer-color, var(--md-sys-color-primary, #6750a4));--md-ripple-hover-opacity: var(--md-checkbox-selected-hover-state-layer-opacity, 0.08);--md-ripple-pressed-color: var(--md-checkbox-selected-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--md-ripple-pressed-opacity: var(--md-checkbox-selected-pressed-state-layer-opacity, 0.12)}.icon{fill:var(--md-checkbox-selected-icon-color, var(--md-sys-color-on-primary, #fff));height:var(--md-checkbox-icon-size, 18px);width:var(--md-checkbox-icon-size, 18px)}.mark.short{height:2px;transition-property:transform,height;width:2px}.mark.long{height:2px;transition-property:transform,width;width:10px}.mark{animation-duration:150ms;animation-timing-function:cubic-bezier(0.3, 0, 0.8, 0.15);transition-duration:150ms;transition-timing-function:cubic-bezier(0.3, 0, 0.8, 0.15)}.selected .mark{animation-duration:350ms;animation-timing-function:cubic-bezier(0.05, 0.7, 0.1, 1);transition-duration:350ms;transition-timing-function:cubic-bezier(0.05, 0.7, 0.1, 1)}.checked .mark,.prev-checked.unselected .mark{transform:scaleY(-1) translate(7px, -14px) rotate(45deg)}.checked .mark.short,.prev-checked.unselected .mark.short{height:5.6568542495px}.checked .mark.long,.prev-checked.unselected .mark.long{width:11.313708499px}.indeterminate .mark,.prev-indeterminate.unselected .mark{transform:scaleY(-1) translate(4px, -10px) rotate(0deg)}.prev-unselected .mark{transition-property:none}.prev-unselected.checked .mark.long{animation-name:prev-unselected-to-checked}@keyframes prev-unselected-to-checked{from{width:0}}:where(:hover) .outline{border-color:var(--md-checkbox-hover-outline-color, var(--md-sys-color-on-surface, #1d1b20));border-width:var(--md-checkbox-hover-outline-width, 2px)}:where(:hover) .background{background:var(--md-checkbox-selected-hover-container-color, var(--md-sys-color-primary, #6750a4))}:where(:hover) .icon{fill:var(--md-checkbox-selected-hover-icon-color, var(--md-sys-color-on-primary, #fff))}:where(:focus-within) .outline{border-color:var(--md-checkbox-focus-outline-color, var(--md-sys-color-on-surface, #1d1b20));border-width:var(--md-checkbox-focus-outline-width, 2px)}:where(:focus-within) .background{background:var(--md-checkbox-selected-focus-container-color, var(--md-sys-color-primary, #6750a4))}:where(:focus-within) .icon{fill:var(--md-checkbox-selected-focus-icon-color, var(--md-sys-color-on-primary, #fff))}:where(:active) .outline{border-color:var(--md-checkbox-pressed-outline-color, var(--md-sys-color-on-surface, #1d1b20));border-width:var(--md-checkbox-pressed-outline-width, 2px)}:where(:active) .background{background:var(--md-checkbox-selected-pressed-container-color, var(--md-sys-color-primary, #6750a4))}:where(:active) .icon{fill:var(--md-checkbox-selected-pressed-icon-color, var(--md-sys-color-on-primary, #fff))}:where(.disabled,.prev-disabled) :is(.background,.icon,.mark){animation-duration:0s;transition-duration:0s}:where(.disabled) .outline{border-color:var(--md-checkbox-disabled-outline-color, var(--md-sys-color-on-surface, #1d1b20));border-width:var(--md-checkbox-disabled-outline-width, 2px);opacity:var(--md-checkbox-disabled-container-opacity, 0.38)}:where(.selected.disabled) .outline{visibility:hidden}:where(.selected.disabled) .background{background:var(--md-checkbox-selected-disabled-container-color, var(--md-sys-color-on-surface, #1d1b20));opacity:var(--md-checkbox-selected-disabled-container-opacity, 0.38)}:where(.disabled) .icon{fill:var(--md-checkbox-selected-disabled-icon-color, var(--md-sys-color-surface, #fef7ff))}@media(forced-colors: active){.background{background-color:CanvasText}.selected.disabled .background{background-color:GrayText;opacity:1}.outline{border-color:CanvasText}.disabled .outline{border-color:GrayText;opacity:1}.icon{fill:Canvas}}
26
- `,E=class extends h{};E.styles=[Z];E=b([M("md-checkbox")],E);var n,f,x,y,V,$=!1,_=0,A=t=>{t.metaKey||t.altKey||t.ctrlKey||($=!0)},v=()=>{$=!1},ee=()=>{_===0&&(window.addEventListener("keydown",A,!0),window.addEventListener("pointerdown",v,!0),window.addEventListener("mousedown",v,!0),window.addEventListener("touchstart",v,!0)),_+=1},te=()=>{_=Math.max(0,_-1),_===0&&(window.removeEventListener("keydown",A,!0),window.removeEventListener("pointerdown",v,!0),window.removeEventListener("mousedown",v,!0),window.removeEventListener("touchstart",v,!0))},o=(n=new WeakSet,f=new WeakMap,x=new WeakMap,y=new WeakMap,V=class extends L{constructor(){super(),P(this,n),C(this,f,void 0),C(this,x,void 0),C(this,y,void 0),this._internals=null,this.disabled=!1,this.indeterminate=!1,this.checked=!1,this.required=!1,this.error=!1,this.size="medium",this.label="",this.supportingText="",this.errorText="",this.ariaLabel="",this.ariaControls=null,this.ariaExpanded=null,this.name="",this.value="on",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this._form=null,this._formResetHandler=null,this._formSubmitHandler=null,this._initialChecked=!1,this._customValidationMessage="",this._validationMessage="",this._hasValidationBeenReported=!1,this._checkboxId="",this._showOuterFocusRing=!1,S(f,this,()=>{this.disabled||this.label?.trim()&&$&&d(n,this,k).call(this,!0)}),S(x,this,()=>{d(n,this,k).call(this,!1)}),S(y,this,()=>{d(n,this,k).call(this,!1)}),"attachInternals"in this&&(this._internals=this.attachInternals())}connectedCallback(){super.connectedCallback(),ee(),this._checkboxId=this.id||`scb-checkbox-${Math.random().toString(36).slice(2,11)}`,this._initialChecked=this.checked,d(n,this,I).call(this),this.addEventListener("focusin",m(f,this)),this.addEventListener("focusout",m(x,this)),this.addEventListener("pointerdown",m(y,this),!0),this._form=this.closest("form"),this._form&&(this._formResetHandler=()=>{this.checked=this._initialChecked,this.indeterminate=!1,this.error=!1,this._hasValidationBeenReported=!1,this.__syncFormValue(),this.__syncValidity()},this._formSubmitHandler=e=>{this.reportValidity()||(e.preventDefault(),e.stopPropagation())},this._form.addEventListener("reset",this._formResetHandler,!0),this._form.addEventListener("submit",this._formSubmitHandler,!0)),this.__syncFormValue()}disconnectedCallback(){super.disconnectedCallback(),te(),this.removeEventListener("focusin",m(f,this)),this.removeEventListener("focusout",m(x,this)),this.removeEventListener("pointerdown",m(y,this),!0),this._form&&this._formResetHandler&&this._form.removeEventListener("reset",this._formResetHandler,!0),this._form&&this._formSubmitHandler&&this._form.removeEventListener("submit",this._formSubmitHandler,!0)}firstUpdated(){const e=this.shadowRoot?.querySelector("md-checkbox");e&&e.addEventListener("change",()=>{const i=e,r=!!i.checked,s=!!i.indeterminate;this.checked=r,this.indeterminate=s,this.dispatchEvent(new CustomEvent("change",{detail:{checked:r,indeterminate:s},bubbles:!0,composed:!0}))}),this.shadowRoot?.querySelector("label.wrap")?.addEventListener("click",i=>{if(!this.disabled&&!i.composedPath().some(r=>{const s=r;return s?.tagName?.toLowerCase?.()==="md-checkbox"||s?.classList?.contains("box-wrap")})){i.preventDefault();const r=this.shadowRoot.querySelector("md-checkbox");r&&(r.checked=!r.checked,r.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))}}),this.__syncInnerAria(),this.__syncValidity(),d(n,this,R).call(this)}updated(e){super.updated(e),e.has("disabled")&&(this.toggleAttribute("aria-disabled",this.disabled),this.disabled&&d(n,this,k).call(this,!1)),(e.has("label")||e.has("supportingText")||e.has("ariaLabel")||e.has("ariaControls")||e.has("ariaExpanded")||e.has("error")||e.has("errorText"))&&this.__syncInnerAria(),e.has("label")&&d(n,this,I).call(this),(e.has("checked")||e.has("disabled")||e.has("value"))&&this.__syncFormValue(),(e.has("checked")||e.has("disabled")||e.has("required")||e.has("errorText"))&&this.__syncValidity(),(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom")||e.has("spacingLeft")||e.has("spacingRight"))&&d(n,this,R).call(this)}formDisabledCallback(e){this.disabled=e,e&&(this._hasValidationBeenReported=!1)}__syncInnerAria(){const e=this.shadowRoot?.querySelector("md-checkbox")?.shadowRoot;if(!e)return;const i=e.querySelector('[role="checkbox"]')||e.querySelector('input[type="checkbox"]');if(!i)return;const r=!!this.label?.trim(),s=r?`${this._checkboxId}-label`:"",p=this.__getVisibleSupportingText()?`${this._checkboxId}-supporting-text`:"";r&&s?(i.setAttribute("aria-labelledby",s),i.removeAttribute("aria-label")):(i.removeAttribute("aria-labelledby"),this.ariaLabel?.trim()?i.setAttribute("aria-label",this.ariaLabel.trim()):i.removeAttribute("aria-label")),p?i.setAttribute("aria-describedby",p):i.removeAttribute("aria-describedby"),this.ariaControls?.trim()?i.setAttribute("aria-controls",this.ariaControls.trim()):i.removeAttribute("aria-controls"),this.ariaExpanded==="true"||this.ariaExpanded==="false"?i.setAttribute("aria-expanded",this.ariaExpanded):i.removeAttribute("aria-expanded")}__getValidationMessage(){return this._customValidationMessage?this._customValidationMessage:this.required&&!this.checked?this.errorText||"Markera det här fältet.":""}__syncValidity(){const e=this.shadowRoot?.querySelector("md-checkbox"),i=this.disabled?"":this.__getValidationMessage(),r=this.error,s=this._validationMessage;if(this._internals)if(i){const p=this._customValidationMessage?{customError:!0}:{valueMissing:!0};this._internals.setValidity(p,i,e??void 0)}else this._internals.setValidity({});this._validationMessage=i,this.error=this.disabled?!1:i?this._hasValidationBeenReported||r:r&&!this._hasValidationBeenReported&&!s,this.toggleAttribute("aria-invalid",this.error),(r!==this.error||s!==this._validationMessage)&&this.requestUpdate()}checkValidity(){return this.__syncValidity(),this._internals?this._internals.checkValidity():!this.error}reportValidity(){return this._hasValidationBeenReported=!0,this.__syncValidity(),this._internals?this._internals.reportValidity():this.checkValidity()}setCustomValidity(e){this._customValidationMessage=String(e??""),this.__syncValidity()}get form(){return this._internals?.form??this._form}get validity(){return this._internals?.validity}get validationMessage(){return this._internals?.validationMessage??this.__getValidationMessage()}get willValidate(){return this._internals?.willValidate??!0}get labels(){return this._internals?.labels}__syncFormValue(){if(!this._internals)return;const e=this.disabled||!this.checked?null:this.value;this._internals.setFormValue(e)}render(){const e=this.__getVisibleSupportingText(),i=e?`${this._checkboxId}-supporting-text`:void 0,r=!!this.label?.trim(),s=r?l:this.ariaLabel||l;return u`
25
+ `}handleInput(t){const e=t.target;this.checked=e.checked,this.indeterminate=e.indeterminate}handleChange(t){N(this,t)}[H](){return!this.checked||this.indeterminate?null:this.value}[W](){return String(this.checked)}formResetCallback(){this.checked=this.hasAttribute("checked")}formStateRestoreCallback(t){this.checked=t==="true"}[j](){return new Q(()=>this)}[J](){return this.input}};O(h);h.shadowRootOptions={...L.shadowRootOptions,delegatesFocus:!0};b([o({type:Boolean})],h.prototype,"checked",void 0);b([o({type:Boolean})],h.prototype,"indeterminate",void 0);b([o({type:Boolean})],h.prototype,"required",void 0);b([o()],h.prototype,"value",void 0);b([E()],h.prototype,"prevChecked",void 0);b([E()],h.prototype,"prevDisabled",void 0);b([E()],h.prototype,"prevIndeterminate",void 0);b([F("input")],h.prototype,"input",void 0);var Z=T`:host{border-start-start-radius:var(--md-checkbox-container-shape-start-start, var(--md-checkbox-container-shape, 2px));border-start-end-radius:var(--md-checkbox-container-shape-start-end, var(--md-checkbox-container-shape, 2px));border-end-end-radius:var(--md-checkbox-container-shape-end-end, var(--md-checkbox-container-shape, 2px));border-end-start-radius:var(--md-checkbox-container-shape-end-start, var(--md-checkbox-container-shape, 2px));display:inline-flex;height:var(--md-checkbox-container-size, 18px);position:relative;vertical-align:top;width:var(--md-checkbox-container-size, 18px);-webkit-tap-highlight-color:rgba(0,0,0,0);cursor:pointer}:host([disabled]){cursor:default}:host([touch-target=wrapper]){margin:max(0px,(48px - var(--md-checkbox-container-size, 18px))/2)}md-focus-ring{height:44px;inset:unset;width:44px}input{appearance:none;height:48px;margin:0;opacity:0;outline:none;position:absolute;width:48px;z-index:1;cursor:inherit}:host([touch-target=none]) input{height:100%;width:100%}.container{border-radius:inherit;display:flex;height:100%;place-content:center;place-items:center;position:relative;width:100%}.outline,.background,.icon{inset:0;position:absolute}.outline,.background{border-radius:inherit}.outline{border-color:var(--md-checkbox-outline-color, var(--md-sys-color-on-surface-variant, #49454f));border-style:solid;border-width:var(--md-checkbox-outline-width, 2px);box-sizing:border-box}.background{background-color:var(--md-checkbox-selected-container-color, var(--md-sys-color-primary, #6750a4))}.background,.icon{opacity:0;transition-duration:150ms,50ms;transition-property:transform,opacity;transition-timing-function:cubic-bezier(0.3, 0, 0.8, 0.15),linear;transform:scale(0.6)}:where(.selected) :is(.background,.icon){opacity:1;transition-duration:350ms,50ms;transition-timing-function:cubic-bezier(0.05, 0.7, 0.1, 1),linear;transform:scale(1)}md-ripple{border-radius:var(--md-checkbox-state-layer-shape, var(--md-sys-shape-corner-full, 9999px));height:var(--md-checkbox-state-layer-size, 40px);inset:unset;width:var(--md-checkbox-state-layer-size, 40px);--md-ripple-hover-color: var(--md-checkbox-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--md-ripple-hover-opacity: var(--md-checkbox-hover-state-layer-opacity, 0.08);--md-ripple-pressed-color: var(--md-checkbox-pressed-state-layer-color, var(--md-sys-color-primary, #6750a4));--md-ripple-pressed-opacity: var(--md-checkbox-pressed-state-layer-opacity, 0.12)}.selected md-ripple{--md-ripple-hover-color: var(--md-checkbox-selected-hover-state-layer-color, var(--md-sys-color-primary, #6750a4));--md-ripple-hover-opacity: var(--md-checkbox-selected-hover-state-layer-opacity, 0.08);--md-ripple-pressed-color: var(--md-checkbox-selected-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--md-ripple-pressed-opacity: var(--md-checkbox-selected-pressed-state-layer-opacity, 0.12)}.icon{fill:var(--md-checkbox-selected-icon-color, var(--md-sys-color-on-primary, #fff));height:var(--md-checkbox-icon-size, 18px);width:var(--md-checkbox-icon-size, 18px)}.mark.short{height:2px;transition-property:transform,height;width:2px}.mark.long{height:2px;transition-property:transform,width;width:10px}.mark{animation-duration:150ms;animation-timing-function:cubic-bezier(0.3, 0, 0.8, 0.15);transition-duration:150ms;transition-timing-function:cubic-bezier(0.3, 0, 0.8, 0.15)}.selected .mark{animation-duration:350ms;animation-timing-function:cubic-bezier(0.05, 0.7, 0.1, 1);transition-duration:350ms;transition-timing-function:cubic-bezier(0.05, 0.7, 0.1, 1)}.checked .mark,.prev-checked.unselected .mark{transform:scaleY(-1) translate(7px, -14px) rotate(45deg)}.checked .mark.short,.prev-checked.unselected .mark.short{height:5.6568542495px}.checked .mark.long,.prev-checked.unselected .mark.long{width:11.313708499px}.indeterminate .mark,.prev-indeterminate.unselected .mark{transform:scaleY(-1) translate(4px, -10px) rotate(0deg)}.prev-unselected .mark{transition-property:none}.prev-unselected.checked .mark.long{animation-name:prev-unselected-to-checked}@keyframes prev-unselected-to-checked{from{width:0}}:where(:hover) .outline{border-color:var(--md-checkbox-hover-outline-color, var(--md-sys-color-on-surface, #1d1b20));border-width:var(--md-checkbox-hover-outline-width, 2px)}:where(:hover) .background{background:var(--md-checkbox-selected-hover-container-color, var(--md-sys-color-primary, #6750a4))}:where(:hover) .icon{fill:var(--md-checkbox-selected-hover-icon-color, var(--md-sys-color-on-primary, #fff))}:where(:focus-within) .outline{border-color:var(--md-checkbox-focus-outline-color, var(--md-sys-color-on-surface, #1d1b20));border-width:var(--md-checkbox-focus-outline-width, 2px)}:where(:focus-within) .background{background:var(--md-checkbox-selected-focus-container-color, var(--md-sys-color-primary, #6750a4))}:where(:focus-within) .icon{fill:var(--md-checkbox-selected-focus-icon-color, var(--md-sys-color-on-primary, #fff))}:where(:active) .outline{border-color:var(--md-checkbox-pressed-outline-color, var(--md-sys-color-on-surface, #1d1b20));border-width:var(--md-checkbox-pressed-outline-width, 2px)}:where(:active) .background{background:var(--md-checkbox-selected-pressed-container-color, var(--md-sys-color-primary, #6750a4))}:where(:active) .icon{fill:var(--md-checkbox-selected-pressed-icon-color, var(--md-sys-color-on-primary, #fff))}:where(.disabled,.prev-disabled) :is(.background,.icon,.mark){animation-duration:0s;transition-duration:0s}:where(.disabled) .outline{border-color:var(--md-checkbox-disabled-outline-color, var(--md-sys-color-on-surface, #1d1b20));border-width:var(--md-checkbox-disabled-outline-width, 2px);opacity:var(--md-checkbox-disabled-container-opacity, 0.38)}:where(.selected.disabled) .outline{visibility:hidden}:where(.selected.disabled) .background{background:var(--md-checkbox-selected-disabled-container-color, var(--md-sys-color-on-surface, #1d1b20));opacity:var(--md-checkbox-selected-disabled-container-opacity, 0.38)}:where(.disabled) .icon{fill:var(--md-checkbox-selected-disabled-icon-color, var(--md-sys-color-surface, #fef7ff))}@media(forced-colors: active){.background{background-color:CanvasText}.selected.disabled .background{background-color:GrayText;opacity:1}.outline{border-color:CanvasText}.disabled .outline{border-color:GrayText;opacity:1}.icon{fill:Canvas}}
26
+ `,z=class extends h{};z.styles=[Z];z=b([M("md-checkbox")],z);var n,g,f,x,V,$=!1,_=0,A=t=>{t.metaKey||t.altKey||t.ctrlKey||($=!0)},v=()=>{$=!1},ee=()=>{_===0&&(window.addEventListener("keydown",A,!0),window.addEventListener("pointerdown",v,!0),window.addEventListener("mousedown",v,!0),window.addEventListener("touchstart",v,!0)),_+=1},te=()=>{_=Math.max(0,_-1),_===0&&(window.removeEventListener("keydown",A,!0),window.removeEventListener("pointerdown",v,!0),window.removeEventListener("mousedown",v,!0),window.removeEventListener("touchstart",v,!0))},a=(n=new WeakSet,g=new WeakMap,f=new WeakMap,x=new WeakMap,V=class extends L{constructor(){super(),P(this,n),C(this,g,void 0),C(this,f,void 0),C(this,x,void 0),this._internals=null,this.disabled=!1,this.indeterminate=!1,this.checked=!1,this.required=!1,this.error=!1,this.size="medium",this.label="",this.supportingText="",this.errorText="",this.ariaLabel="",this.ariaControls=null,this.ariaExpanded=null,this.name="",this.value="on",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this._form=null,this._formResetHandler=null,this._formSubmitHandler=null,this._initialChecked=!1,this._customValidationMessage="",this._validationMessage="",this._hasValidationBeenReported=!1,this._checkboxId="",this._showOuterFocusRing=!1,S(g,this,()=>{this.disabled||this.label?.trim()&&$&&d(n,this,y).call(this,!0)}),S(f,this,()=>{d(n,this,y).call(this,!1)}),S(x,this,()=>{d(n,this,y).call(this,!1)}),"attachInternals"in this&&(this._internals=this.attachInternals())}connectedCallback(){super.connectedCallback(),ee(),this._checkboxId=this.id||`scb-checkbox-${Math.random().toString(36).slice(2,11)}`,this._initialChecked=this.checked,d(n,this,I).call(this),this.addEventListener("focusin",u(g,this)),this.addEventListener("focusout",u(f,this)),this.addEventListener("pointerdown",u(x,this),!0),this._form=this.closest("form"),this._form&&(this._formResetHandler=()=>{this.checked=this._initialChecked,this.indeterminate=!1,this.error=!1,this._hasValidationBeenReported=!1,this.__syncFormValue(),this.__syncValidity()},this._formSubmitHandler=e=>{this.reportValidity()||(e.preventDefault(),e.stopPropagation())},this._form.addEventListener("reset",this._formResetHandler,!0),this._form.addEventListener("submit",this._formSubmitHandler,!0)),this.__syncFormValue()}disconnectedCallback(){super.disconnectedCallback(),te(),this.removeEventListener("focusin",u(g,this)),this.removeEventListener("focusout",u(f,this)),this.removeEventListener("pointerdown",u(x,this),!0),this._form&&this._formResetHandler&&this._form.removeEventListener("reset",this._formResetHandler,!0),this._form&&this._formSubmitHandler&&this._form.removeEventListener("submit",this._formSubmitHandler,!0)}firstUpdated(){const e=this.shadowRoot?.querySelector("md-checkbox");e&&e.addEventListener("change",()=>{const i=e,r=!!i.checked,s=!!i.indeterminate;this.checked=r,this.indeterminate=s,this.dispatchEvent(new CustomEvent("change",{detail:{checked:r,indeterminate:s},bubbles:!0,composed:!0}))}),this.shadowRoot?.querySelector("label.wrap")?.addEventListener("click",i=>{if(!this.disabled&&!i.composedPath().some(r=>{const s=r;return s?.tagName?.toLowerCase?.()==="md-checkbox"||s?.classList?.contains("box-wrap")})){i.preventDefault();const r=this.shadowRoot.querySelector("md-checkbox");r&&(r.checked=!r.checked,r.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))}}),this.__syncInnerAria(),this.__syncValidity(),d(n,this,R).call(this)}updated(e){super.updated(e),e.has("disabled")&&(this.toggleAttribute("aria-disabled",this.disabled),this.disabled&&d(n,this,y).call(this,!1)),(e.has("label")||e.has("supportingText")||e.has("ariaLabel")||e.has("ariaControls")||e.has("ariaExpanded")||e.has("error")||e.has("errorText"))&&this.__syncInnerAria(),e.has("label")&&d(n,this,I).call(this),(e.has("checked")||e.has("disabled")||e.has("value"))&&this.__syncFormValue(),(e.has("checked")||e.has("disabled")||e.has("required")||e.has("errorText"))&&this.__syncValidity(),(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom")||e.has("spacingLeft")||e.has("spacingRight"))&&d(n,this,R).call(this)}formDisabledCallback(e){this.disabled=e,e&&(this._hasValidationBeenReported=!1)}__syncInnerAria(){const e=this.shadowRoot?.querySelector("md-checkbox")?.shadowRoot;if(!e)return;const i=e.querySelector('[role="checkbox"]')||e.querySelector('input[type="checkbox"]');if(!i)return;const r=!!this.label?.trim(),s=r?`${this._checkboxId}-label`:"",p=this.__getVisibleSupportingText()?`${this._checkboxId}-supporting-text`:"";r&&s?(i.setAttribute("aria-labelledby",s),i.removeAttribute("aria-label")):(i.removeAttribute("aria-labelledby"),this.ariaLabel?.trim()?i.setAttribute("aria-label",this.ariaLabel.trim()):i.removeAttribute("aria-label")),p?i.setAttribute("aria-describedby",p):i.removeAttribute("aria-describedby"),this.ariaControls?.trim()?i.setAttribute("aria-controls",this.ariaControls.trim()):i.removeAttribute("aria-controls"),this.ariaExpanded==="true"||this.ariaExpanded==="false"?i.setAttribute("aria-expanded",this.ariaExpanded):i.removeAttribute("aria-expanded")}__getValidationMessage(){return this._customValidationMessage?this._customValidationMessage:this.required&&!this.checked?this.errorText||"Markera det här fältet.":""}__syncValidity(){const e=this.shadowRoot?.querySelector("md-checkbox"),i=this.disabled?"":this.__getValidationMessage(),r=this.error,s=this._validationMessage;if(this._internals)if(i){const p=this._customValidationMessage?{customError:!0}:{valueMissing:!0};this._internals.setValidity(p,i,e??void 0)}else this._internals.setValidity({});this._validationMessage=i,this.error=this.disabled?!1:i?this._hasValidationBeenReported||r:r&&!this._hasValidationBeenReported&&!s,this.toggleAttribute("aria-invalid",this.error),(r!==this.error||s!==this._validationMessage)&&this.requestUpdate()}checkValidity(){return this.__syncValidity(),this._internals?this._internals.checkValidity():!this.error}reportValidity(){return this._hasValidationBeenReported=!0,this.__syncValidity(),this._internals?this._internals.reportValidity():this.checkValidity()}setCustomValidity(e){this._customValidationMessage=String(e??""),this.__syncValidity()}get form(){return this._internals?.form??this._form}get validity(){return this._internals?.validity}get validationMessage(){return this._internals?.validationMessage??this.__getValidationMessage()}get willValidate(){return this._internals?.willValidate??!0}get labels(){return this._internals?.labels}__syncFormValue(){if(!this._internals)return;const e=this.disabled||!this.checked?null:this.value;this._internals.setFormValue(e)}render(){const e=this.__getVisibleSupportingText(),i=e?`${this._checkboxId}-supporting-text`:void 0,r=!!this.label?.trim(),s=r?l:this.ariaLabel||l;return m`
27
27
  <label class="wrap">
28
- ${r?u`<md-focus-ring class="outer-focus-ring" ?visible=${this._showOuterFocusRing}></md-focus-ring>`:l}
28
+ ${r?m`<md-focus-ring class="outer-focus-ring" ?visible=${this._showOuterFocusRing}></md-focus-ring>`:l}
29
29
  <div class="box-wrap">
30
30
  <md-checkbox
31
31
  id="${this._checkboxId}"
@@ -39,13 +39,13 @@ import{d as F,f as z,g as l,h as L,m as M,o as q,p as a,s as b,v as u,y as T}fro
39
39
  aria-expanded=${this.ariaExpanded||l}
40
40
  ></md-checkbox>
41
41
  </div>
42
- ${r?u`<span class="lbl" id="${this._checkboxId}-label">${this.label}</span>`:l}
43
- ${e?u`
42
+ ${r?m`<span class="lbl" id="${this._checkboxId}-label">${this.label}</span>`:l}
43
+ ${e?m`
44
44
  <div id="${i}" class="supporting-text">
45
45
  <span>${e}</span>
46
- ${this.error?u`<md-icon aria-hidden="true">error</md-icon>`:l}
46
+ ${this.error?m`<md-icon aria-hidden="true">error</md-icon>`:l}
47
47
  </div>
48
48
  `:l}
49
49
  </label>
50
50
  <slot></slot>
51
- `}__getVisibleSupportingText(){return this.error?this._validationMessage||this.errorText||"Ogiltigt val.":this.supportingText}},V.formAssociated=!0,V.styles=T`:host{display:inline-grid;grid-template-columns:auto;grid-template-rows:auto auto;row-gap:0;font-family:var(--brand-font, 'Inter', sans-serif);--scb-checkbox-text-font:var(--md-sys-typescale-body-medium-font);--scb-checkbox-text-size:var(--md-sys-typescale-body-medium-size);--scb-checkbox-text-line-height:var(--md-sys-typescale-body-medium-line-height);--scb-checkbox-text-tracking:var(--md-sys-typescale-body-medium-tracking);--scb-checkbox-text-weight:var(--md-sys-typescale-body-medium-weight, var(--weight-regular, 400));--scb-checkbox-error-icon-size:var(--icon-size-small, 20px);margin-block-start:var(--scb-checkbox-spacing-block-start, 0);margin-block-end:var(--scb-checkbox-spacing-block-end, 0);margin-inline-start:var(--scb-checkbox-spacing-inline-start, 0);margin-inline-end:var(--scb-checkbox-spacing-inline-end, 0)}:host([size='small']){--scb-checkbox-text-font:var(--md-sys-typescale-body-small-font);--scb-checkbox-text-size:var(--md-sys-typescale-body-small-size);--scb-checkbox-text-line-height:var(--md-sys-typescale-body-small-line-height);--scb-checkbox-text-tracking:var(--md-sys-typescale-body-small-tracking);--scb-checkbox-text-weight:var(--md-sys-typescale-body-small-weight, var(--weight-regular, 400));--scb-checkbox-error-icon-size:var(--icon-size-extra-small, 16px)}:host([size='large']){--scb-checkbox-text-font:var(--md-sys-typescale-body-large-font);--scb-checkbox-text-size:var(--md-sys-typescale-body-large-size);--scb-checkbox-text-line-height:var(--md-sys-typescale-body-large-line-height);--scb-checkbox-text-tracking:var(--md-sys-typescale-body-large-tracking);--scb-checkbox-text-weight:var(--md-sys-typescale-body-large-weight, var(--weight-regular, 400));--scb-checkbox-error-icon-size:var(--icon-size-medium, 24px)}:host([orientation='horizontal']){margin-inline-end:var(--scb-checkbox-spacing-inline-end, var(--scb-checkbox-gap, var(--spacing-7, 24px)))}.wrap{display:inline-grid;grid-template-columns:auto 1fr;align-items:center;column-gap:var(--spacing-5, 16px);row-gap:0;cursor:pointer;position:relative;overflow:visible}.outer-focus-ring{position:absolute;inset:calc(var(--spacing-2, 4px)*-1) calc(var(--spacing-4, 12px)*-1) calc(var(--spacing-2, 4px)*-1) calc(var(--spacing-4, 12px)*-1);pointer-events:none;--md-focus-ring-shape-start-start:var(--radius-s, 8px);--md-focus-ring-shape-start-end:var(--radius-s, 8px);--md-focus-ring-shape-end-start:var(--radius-s, 8px);--md-focus-ring-shape-end-end:var(--radius-s, 8px)}:host([data-has-label]) md-checkbox::part(focus-ring){display:none}:host([disabled]) .wrap{cursor:default}.box-wrap{height:var(--scb-checkbox-target, 40px);display:flex;align-items:center;justify-content:center;overflow:visible}md-checkbox{margin:0}:host([error]) md-checkbox{--md-checkbox-outline-color:var(--md-sys-color-error);--md-checkbox-hover-outline-color:var(--md-sys-color-error);--md-checkbox-focus-outline-color:var(--md-sys-color-error);--md-checkbox-pressed-outline-color:var(--md-sys-color-error)}.lbl{color:var(--md-sys-color-on-surface);font-family:var(--scb-checkbox-text-font, var(--brand-font));font-size:var(--scb-checkbox-text-size);line-height:var(--scb-checkbox-text-line-height);font-weight:var(--scb-checkbox-text-weight);letter-spacing:var(--scb-checkbox-text-tracking)}:host([disabled]) .lbl{color:var(--n-60)}.supporting-text{grid-column:2;grid-row:2;display:block;color:var(--md-sys-color-on-surface-variant);font-family:var(--scb-checkbox-text-font, var(--brand-font));font-size:var(--scb-checkbox-text-size);line-height:var(--scb-checkbox-text-line-height, 20px);font-weight:var(--scb-checkbox-text-weight);letter-spacing:var(--scb-checkbox-text-tracking);margin-bottom:var(--spacing-4, 8px)}.supporting-text md-icon{display:inline-flex;color:var(--md-sys-color-error);--md-icon-size:var(--scb-checkbox-error-icon-size);font-size:var(--scb-checkbox-error-icon-size);line-height:1;margin-inline-start:var(--spacing-2, 4px);vertical-align:-.18em}:host([disabled]) .supporting-text{color:var(--n-60)}@media (prefers-color-scheme:dark){.lbl{color:var(--md-sys-color-on-surface)}.supporting-text{color:var(--md-sys-color-on-surface-variant)}}:host([error]) .supporting-text{color:var(--md-sys-color-error)}`,V);function k(t){this._showOuterFocusRing!==t&&(this._showOuterFocusRing=t,this.requestUpdate())}function I(){const t=!!this.label?.trim();this.toggleAttribute("data-has-label",t),t||d(n,this,k).call(this,!1)}function R(){const t=d(n,this,g).call(this,this.spacing),e=d(n,this,g).call(this,this.spacingTop)??t,i=d(n,this,g).call(this,this.spacingBottom)??t,r=d(n,this,g).call(this,this.spacingLeft),s=d(n,this,g).call(this,this.spacingRight);e?this.style.setProperty("--scb-checkbox-spacing-block-start",e):this.style.removeProperty("--scb-checkbox-spacing-block-start"),i?this.style.setProperty("--scb-checkbox-spacing-block-end",i):this.style.removeProperty("--scb-checkbox-spacing-block-end"),r?this.style.setProperty("--scb-checkbox-spacing-inline-start",r):this.style.removeProperty("--scb-checkbox-spacing-inline-start"),s?this.style.setProperty("--scb-checkbox-spacing-inline-end",s):this.style.removeProperty("--scb-checkbox-spacing-inline-end")}function g(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}c([a({type:Boolean,reflect:!0})],o.prototype,"disabled",void 0);c([a({type:Boolean,reflect:!0})],o.prototype,"indeterminate",void 0);c([a({type:Boolean,reflect:!0})],o.prototype,"checked",void 0);c([a({type:Boolean,reflect:!0})],o.prototype,"required",void 0);c([a({type:Boolean,reflect:!0})],o.prototype,"error",void 0);c([a({type:String,reflect:!0})],o.prototype,"size",void 0);c([a({type:String})],o.prototype,"label",void 0);c([a({type:String,attribute:"supporting-text"})],o.prototype,"supportingText",void 0);c([a({type:String,attribute:"error-text"})],o.prototype,"errorText",void 0);c([a({type:String,reflect:!0,attribute:"aria-label"})],o.prototype,"ariaLabel",void 0);c([a({type:String,attribute:"aria-controls"})],o.prototype,"ariaControls",void 0);c([a({type:String,attribute:"aria-expanded"})],o.prototype,"ariaExpanded",void 0);c([a({type:String})],o.prototype,"name",void 0);c([a({type:String})],o.prototype,"value",void 0);c([a({type:String,reflect:!0})],o.prototype,"spacing",void 0);c([a({type:String,attribute:"spacing-top",reflect:!0})],o.prototype,"spacingTop",void 0);c([a({type:String,attribute:"spacing-bottom",reflect:!0})],o.prototype,"spacingBottom",void 0);c([a({type:String,attribute:"spacing-left",reflect:!0})],o.prototype,"spacingLeft",void 0);c([a({type:String,attribute:"spacing-right",reflect:!0})],o.prototype,"spacingRight",void 0);o=c([M("scb-checkbox")],o);export{o as ScbCheckbox};
51
+ `}__getVisibleSupportingText(){return this.error?this._validationMessage||this.errorText||"Ogiltigt val.":this.supportingText}},V.formAssociated=!0,V.styles=T`:host{display:inline-grid;grid-template-columns:auto;grid-template-rows:auto auto;row-gap:0;font-family:var(--brand-font, 'Inter', sans-serif);--scb-checkbox-text-font:var(--scb-form-choice-label-font, var(--scb-typography-body-medium-font, var(--md-sys-typescale-body-medium-font)));--scb-checkbox-text-size:var(--scb-form-choice-label-size, var(--scb-typography-body-medium-size, var(--md-sys-typescale-body-medium-size)));--scb-checkbox-text-line-height:var(--scb-form-choice-label-line-height, var(--scb-typography-body-medium-line-height, var(--md-sys-typescale-body-medium-line-height)));--scb-checkbox-text-tracking:var(--scb-form-choice-label-letter-spacing, var(--scb-typography-body-medium-tracking, var(--md-sys-typescale-body-medium-tracking)));--scb-checkbox-text-weight:var(--scb-form-choice-label-font-weight, var(--scb-typography-body-medium-weight, var(--md-sys-typescale-body-medium-weight, var(--weight-regular, 400))));--scb-checkbox-supporting-font:var(--scb-form-choice-supporting-font, var(--scb-checkbox-text-font));--scb-checkbox-supporting-size:var(--scb-form-choice-supporting-size, var(--scb-checkbox-text-size));--scb-checkbox-supporting-line-height:var(--scb-form-choice-supporting-line-height, var(--scb-checkbox-text-line-height));--scb-checkbox-supporting-tracking:var(--scb-form-choice-supporting-letter-spacing, var(--scb-checkbox-text-tracking));--scb-checkbox-supporting-weight:var(--scb-form-choice-supporting-font-weight, var(--scb-checkbox-text-weight));--scb-checkbox-target:var(--scb-control-size-medium, var(--scale-10, 40px));--scb-checkbox-label-gap:var(--spacing-5, 16px);--scb-checkbox-error-icon-size:var(--icon-size-small, 20px);margin-block-start:var(--scb-checkbox-spacing-block-start, 0);margin-block-end:var(--scb-checkbox-spacing-block-end, 0);margin-inline-start:var(--scb-checkbox-spacing-inline-start, 0);margin-inline-end:var(--scb-checkbox-spacing-inline-end, 0)}:host([size='small']){--scb-checkbox-target:var(--scb-control-size-small, var(--scale-08, 32px));--scb-checkbox-label-gap:var(--spacing-4, 12px);--scb-checkbox-error-icon-size:var(--icon-size-extra-small, 16px)}:host([size='large']){--scb-checkbox-target:var(--scb-control-size-large, var(--scale-12, 56px));--scb-checkbox-label-gap:var(--spacing-6, 20px);--scb-checkbox-error-icon-size:var(--icon-size-medium, 24px)}:host([orientation='horizontal']){margin-inline-end:var(--scb-checkbox-spacing-inline-end, var(--scb-checkbox-gap, var(--spacing-7, 24px)))}.wrap{display:inline-grid;grid-template-columns:auto 1fr;align-items:center;column-gap:var(--scb-checkbox-label-gap, var(--spacing-5, 16px));row-gap:0;cursor:pointer;position:relative;overflow:visible}.outer-focus-ring{position:absolute;inset:calc(var(--spacing-2, 4px)*-1) calc(var(--spacing-4, 12px)*-1) calc(var(--spacing-2, 4px)*-1) calc(var(--spacing-4, 12px)*-1);pointer-events:none;--md-focus-ring-shape-start-start:var(--radius-s, 8px);--md-focus-ring-shape-start-end:var(--radius-s, 8px);--md-focus-ring-shape-end-start:var(--radius-s, 8px);--md-focus-ring-shape-end-end:var(--radius-s, 8px)}:host([data-has-label]) md-checkbox::part(focus-ring){display:none}:host([disabled]) .wrap{cursor:default}.box-wrap{height:var(--scb-checkbox-target, var(--scb-control-size-medium, 40px));display:flex;align-items:center;justify-content:center;overflow:visible}md-checkbox{margin:0}:host([error]) md-checkbox{--md-checkbox-outline-color:var(--md-sys-color-error);--md-checkbox-hover-outline-color:var(--md-sys-color-error);--md-checkbox-focus-outline-color:var(--md-sys-color-error);--md-checkbox-pressed-outline-color:var(--md-sys-color-error)}.lbl{color:var(--md-sys-color-on-surface);font-family:var(--scb-checkbox-text-font, var(--brand-font));font-size:var(--scb-checkbox-text-size);line-height:var(--scb-checkbox-text-line-height);font-weight:var(--scb-checkbox-text-weight);letter-spacing:var(--scb-checkbox-text-tracking)}:host([disabled]) .lbl{color:var(--n-60)}.supporting-text{grid-column:2;grid-row:2;display:block;color:var(--md-sys-color-on-surface-variant);font-family:var(--scb-checkbox-supporting-font, var(--brand-font));font-size:var(--scb-checkbox-supporting-size);line-height:var(--scb-checkbox-supporting-line-height, 20px);font-weight:var(--scb-checkbox-supporting-weight);letter-spacing:var(--scb-checkbox-supporting-tracking);margin-bottom:var(--spacing-4, 8px)}.supporting-text md-icon{display:inline-flex;color:var(--md-sys-color-error);--md-icon-size:var(--scb-checkbox-error-icon-size);font-size:var(--scb-checkbox-error-icon-size);line-height:1;margin-inline-start:var(--spacing-2, 4px);vertical-align:-.18em}:host([disabled]) .supporting-text{color:var(--n-60)}@media (prefers-color-scheme:dark){.lbl{color:var(--md-sys-color-on-surface)}.supporting-text{color:var(--md-sys-color-on-surface-variant)}}:host([error]) .supporting-text{color:var(--md-sys-color-error)}`,V);function y(t){this._showOuterFocusRing!==t&&(this._showOuterFocusRing=t,this.requestUpdate())}function I(){const t=!!this.label?.trim();this.toggleAttribute("data-has-label",t),t||d(n,this,y).call(this,!1)}function R(){const t=d(n,this,k).call(this,this.spacing),e=d(n,this,k).call(this,this.spacingTop)??t,i=d(n,this,k).call(this,this.spacingBottom)??t,r=d(n,this,k).call(this,this.spacingLeft),s=d(n,this,k).call(this,this.spacingRight);e?this.style.setProperty("--scb-checkbox-spacing-block-start",e):this.style.removeProperty("--scb-checkbox-spacing-block-start"),i?this.style.setProperty("--scb-checkbox-spacing-block-end",i):this.style.removeProperty("--scb-checkbox-spacing-block-end"),r?this.style.setProperty("--scb-checkbox-spacing-inline-start",r):this.style.removeProperty("--scb-checkbox-spacing-inline-start"),s?this.style.setProperty("--scb-checkbox-spacing-inline-end",s):this.style.removeProperty("--scb-checkbox-spacing-inline-end")}function k(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}c([o({type:Boolean,reflect:!0})],a.prototype,"disabled",void 0);c([o({type:Boolean,reflect:!0})],a.prototype,"indeterminate",void 0);c([o({type:Boolean,reflect:!0})],a.prototype,"checked",void 0);c([o({type:Boolean,reflect:!0})],a.prototype,"required",void 0);c([o({type:Boolean,reflect:!0})],a.prototype,"error",void 0);c([o({type:String,reflect:!0})],a.prototype,"size",void 0);c([o({type:String})],a.prototype,"label",void 0);c([o({type:String,attribute:"supporting-text"})],a.prototype,"supportingText",void 0);c([o({type:String,attribute:"error-text"})],a.prototype,"errorText",void 0);c([o({type:String,reflect:!0,attribute:"aria-label"})],a.prototype,"ariaLabel",void 0);c([o({type:String,attribute:"aria-controls"})],a.prototype,"ariaControls",void 0);c([o({type:String,attribute:"aria-expanded"})],a.prototype,"ariaExpanded",void 0);c([o({type:String})],a.prototype,"name",void 0);c([o({type:String})],a.prototype,"value",void 0);c([o({type:String,reflect:!0})],a.prototype,"spacing",void 0);c([o({type:String,attribute:"spacing-top",reflect:!0})],a.prototype,"spacingTop",void 0);c([o({type:String,attribute:"spacing-bottom",reflect:!0})],a.prototype,"spacingBottom",void 0);c([o({type:String,attribute:"spacing-left",reflect:!0})],a.prototype,"spacingLeft",void 0);c([o({type:String,attribute:"spacing-right",reflect:!0})],a.prototype,"spacingRight",void 0);a=c([M("scb-checkbox")],a);export{a as ScbCheckbox};
@@ -1,4 +1,4 @@
1
- import{h,m as v,p as d,v as p,y as f}from"./vendor.js";import"./vendor-lit.js";import{t as c}from"./decorate.js";(function(){try{var e=typeof globalThis<"u"?globalThis:window;if(!e.__scb_ce_guard_installed__){e.__scb_ce_guard_installed__=!0;var r=customElements.define.bind(customElements);customElements.define=function(o,a,l){try{customElements.get(o)||r(o,a,l)}catch(i){var s=String(i||"");if(s.indexOf("already been used")===-1&&s.indexOf("NotSupportedError")===-1)throw i}}}}catch{}})();var n,t=(n=class extends h{constructor(...r){super(...r),this.open=!1}render(){return p`
1
+ import{h,m as v,p as d,v as p,y as f}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as c}from"../../vendor/decorate.js";(function(){try{var e=typeof globalThis<"u"?globalThis:window;if(!e.__scb_ce_guard_installed__){e.__scb_ce_guard_installed__=!0;var r=customElements.define.bind(customElements);customElements.define=function(o,a,l){try{customElements.get(o)||r(o,a,l)}catch(i){var s=String(i||"");if(s.indexOf("already been used")===-1&&s.indexOf("NotSupportedError")===-1)throw i}}}}catch{}})();var n,t=(n=class extends h{constructor(...r){super(...r),this.open=!1}render(){return p`
2
2
  <svg
3
3
  class="chevron-icon"
4
4
  viewBox="0 0 24 24"
@@ -1,10 +1,10 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../../vendor/assist-chip.js","../../vendor/vendor.js","../../vendor/chip.js","../../vendor/md-focus-ring.js","../../vendor/rolldown-runtime.js","../../vendor/attachable-controller.js","../../vendor/vendor-lit.js","../../vendor/delegate.js","../../vendor/ripple.js","../../vendor/shared-styles.js","../../vendor/elevation.js","../../vendor/filter-chip.js","../../vendor/redispatch-event.js","../../vendor/chip-set.js","../../vendor/icon.js"])))=>i.map(i=>d[i]);
2
- import{h as v,m as f,p as s,v as o,y as g}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as d}from"../../vendor/preload-helper.js";import{t as i}from"../../vendor/decorate.js";import{n as _,t as u}from"../../vendor/assertClassBrand.js";(function(){try{var r=typeof globalThis<"u"?globalThis:window;if(!r.__scb_ce_guard_installed__){r.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(a,c,p){try{customElements.get(a)||t(a,c,p)}catch(n){var l=String(n||"");if(l.indexOf("already been used")===-1&&l.indexOf("NotSupportedError")===-1)throw n}}}}catch{}})();var h,m,e=(h=new WeakSet,m=class extends v{constructor(){super(),_(this,h),this.variant="assist",this.staticVariant="filled",this.label="",this.icon="",this.disabled=!1,this.elevated=!1,this.removable=!1,this.selected=!1,this.disableToggle=!1,this.href="",this.target="",this.name="",this.value="",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.size="medium",this._internals=null,this.__loadedVariants=new Set,this.__chipSetLoaded=!1,this.__iconLoaded=!1,this._onFilterClick=t=>{if(this.disableToggle){const a=t.currentTarget;a&&(a.selected=this.selected),t.preventDefault();return}this._toggleSelected()},"attachInternals"in this&&(this._internals=this.attachInternals())}updated(t){super.updated(t),(t.has("variant")||t.has("icon"))&&this.__ensureDepsLoaded(),t.has("disabled")&&(this.toggleAttribute("aria-disabled",this.disabled),this.dispatchEvent(new CustomEvent("disabled-changed",{detail:{disabled:this.disabled},bubbles:!0,composed:!0}))),t.has("variant")&&this.dispatchEvent(new CustomEvent("variant-changed",{detail:{variant:this.variant},bubbles:!0,composed:!0})),t.has("staticVariant")&&this.dispatchEvent(new CustomEvent("static-variant-changed",{detail:{staticVariant:this.staticVariant},bubbles:!0,composed:!0})),t.has("label")&&this.dispatchEvent(new CustomEvent("label-changed",{detail:{label:this.label},bubbles:!0,composed:!0})),t.has("elevated")&&this.dispatchEvent(new CustomEvent("elevated-changed",{detail:{elevated:this.elevated},bubbles:!0,composed:!0})),t.has("selected")&&this.dispatchEvent(new CustomEvent("selected-changed",{detail:{selected:this.selected},bubbles:!0,composed:!0})),t.has("icon")&&this.dispatchEvent(new CustomEvent("icon-changed",{detail:{icon:this.icon},bubbles:!0,composed:!0})),t.has("size")&&this.dispatchEvent(new CustomEvent("size-changed",{detail:{size:this.size},bubbles:!0,composed:!0})),(t.has("selected")||t.has("disabled")||t.has("variant")||t.has("value")||t.has("name"))&&this._updateFormValue(),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&u(h,this,b).call(this)}firstUpdated(){this.__ensureDepsLoaded(),u(h,this,b).call(this),this._updateFormValue()}async __ensureDepsLoaded(){const t=this.variant==="assist"||this.variant==="filter"?this.variant:null;if(t&&!this.__loadedVariants.has(t)){switch(t){case"assist":await d(()=>import("../../vendor/assist-chip.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]),import.meta.url);break;case"filter":await d(()=>import("../../vendor/filter-chip.js"),__vite__mapDeps([11,1,2,3,4,5,6,7,8,9,10,12]),import.meta.url);break}this.__loadedVariants.add(t)}t&&!this._insideChipSet&&!this.__chipSetLoaded&&(await d(()=>import("../../vendor/chip-set.js"),__vite__mapDeps([13,1,2,3,4,5,6,7,8]),import.meta.url),this.__chipSetLoaded=!0),this.icon&&!this.__iconLoaded&&(await d(()=>import("../../vendor/icon.js").then(a=>a.t),__vite__mapDeps([14,4,1,6]),import.meta.url),this.__iconLoaded=!0)}get _insideChipSet(){return!!this.closest("md-chip-set")}render(){const t=this._renderChip();return this.variant==="static"||this._insideChipSet?t:o`<md-chip-set>${t}</md-chip-set>`}_renderChip(){const t=this.icon?o`<md-icon slot="icon">${this.icon}</md-icon>`:null;switch(this.variant){case"static":return o`
2
+ import{h as m,m as u,p as s,v as r,y as f}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as h}from"../../vendor/preload-helper.js";import{t as e}from"../../vendor/decorate.js";import{n as _,t as g}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 i=customElements.define.bind(customElements);customElements.define=function(a,p,o){try{customElements.get(a)||i(a,p,o)}catch(l){var n=String(l||"");if(n.indexOf("already been used")===-1&&n.indexOf("NotSupportedError")===-1)throw l}}}}catch{}})();var d,b,t=(d=new WeakSet,b=class extends m{constructor(){super(),_(this,d),this.variant="assist",this.staticVariant="filled",this.label="",this.icon="",this.disabled=!1,this.elevated=!1,this.removable=!1,this.selected=!1,this.disableToggle=!1,this.href="",this.target="",this.name="",this.value="",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.size="medium",this._internals=null,this.__loadedVariants=new Set,this.__chipSetLoaded=!1,this.__iconLoaded=!1,this._onFilterClick=i=>{if(this.disableToggle){const a=i.currentTarget;a&&(a.selected=this.selected),i.preventDefault();return}this._toggleSelected()},"attachInternals"in this&&(this._internals=this.attachInternals())}updated(i){super.updated(i),(i.has("variant")||i.has("icon"))&&this.__ensureDepsLoaded(),i.has("disabled")&&(this.toggleAttribute("aria-disabled",this.disabled),this.dispatchEvent(new CustomEvent("disabled-changed",{detail:{disabled:this.disabled},bubbles:!0,composed:!0}))),i.has("variant")&&this.dispatchEvent(new CustomEvent("variant-changed",{detail:{variant:this.variant},bubbles:!0,composed:!0})),i.has("staticVariant")&&this.dispatchEvent(new CustomEvent("static-variant-changed",{detail:{staticVariant:this.staticVariant},bubbles:!0,composed:!0})),i.has("label")&&this.dispatchEvent(new CustomEvent("label-changed",{detail:{label:this.label},bubbles:!0,composed:!0})),i.has("elevated")&&this.dispatchEvent(new CustomEvent("elevated-changed",{detail:{elevated:this.elevated},bubbles:!0,composed:!0})),i.has("selected")&&this.dispatchEvent(new CustomEvent("selected-changed",{detail:{selected:this.selected},bubbles:!0,composed:!0})),i.has("icon")&&this.dispatchEvent(new CustomEvent("icon-changed",{detail:{icon:this.icon},bubbles:!0,composed:!0})),i.has("size")&&this.dispatchEvent(new CustomEvent("size-changed",{detail:{size:this.size},bubbles:!0,composed:!0})),(i.has("selected")||i.has("disabled")||i.has("variant")||i.has("value")||i.has("name"))&&this._updateFormValue(),(i.has("spacing")||i.has("spacingTop")||i.has("spacingBottom")||i.has("spacingLeft")||i.has("spacingRight"))&&g(d,this,v).call(this)}firstUpdated(){this.__ensureDepsLoaded(),g(d,this,v).call(this),this._updateFormValue()}async __ensureDepsLoaded(){const i=this.variant==="assist"||this.variant==="filter"?this.variant:null;if(i&&!this.__loadedVariants.has(i)){switch(i){case"assist":await h(()=>import("../../vendor/assist-chip.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]),import.meta.url);break;case"filter":await h(()=>import("../../vendor/filter-chip.js"),__vite__mapDeps([11,1,2,3,4,5,6,7,8,9,10,12]),import.meta.url);break}this.__loadedVariants.add(i)}i&&!this._insideChipSet&&!this.__chipSetLoaded&&(await h(()=>import("../../vendor/chip-set.js"),__vite__mapDeps([13,1,2,3,4,5,6,7,8]),import.meta.url),this.__chipSetLoaded=!0),this.icon&&!this.__iconLoaded&&(await h(()=>import("../../vendor/icon.js").then(a=>a.t),__vite__mapDeps([14,4,1,6]),import.meta.url),this.__iconLoaded=!0)}get _insideChipSet(){return!!this.closest("md-chip-set")}render(){const i=this._renderChip();return this.variant==="static"||this._insideChipSet?i:r`<md-chip-set>${i}</md-chip-set>`}_renderChip(){const i=this.icon?r`<md-icon slot="icon">${this.icon}</md-icon>`:null;switch(this.variant){case"static":return r`
3
3
  <span class="static-chip" aria-disabled=${this.disabled?"true":"false"}>
4
- ${t}
4
+ ${i}
5
5
  <slot>${this.label}</slot>
6
6
  </span>
7
- `;case"assist":{const a=this.target==="_blank"?"noopener noreferrer":void 0;return o`
7
+ `;case"assist":{const a=this.target==="_blank"?"noopener noreferrer":void 0;return r`
8
8
  <md-assist-chip
9
9
  label=${this.label}
10
10
  ?disabled=${this.disabled}
@@ -14,9 +14,9 @@ import{h as v,m as f,p as s,v as o,y as g}from"../../vendor/vendor.js";import"..
14
14
  rel=${a}
15
15
  @update-focus=${this._forward}
16
16
  >
17
- ${t}
17
+ ${i}
18
18
  </md-assist-chip>
19
- `}case"filter":return o`
19
+ `}case"filter":return r`
20
20
  <md-filter-chip
21
21
  label=${this.label}
22
22
  ?disabled=${this.disabled}
@@ -26,6 +26,6 @@ import{h as v,m as f,p as s,v as o,y as g}from"../../vendor/vendor.js";import"..
26
26
  @update-focus=${this._forward}
27
27
  @click=${this._onFilterClick}
28
28
  >
29
- ${t}
29
+ ${i}
30
30
  </md-filter-chip>
31
- `;default:return o``}}_toggleSelected(){this.selected=!this.selected,this._updateFormValue()}_onRemove(t){t.preventDefault(),t.stopPropagation(),this.dispatchEvent(new CustomEvent("remove",{detail:{label:this.label},bubbles:!0,composed:!0}))}_forward(t){this.dispatchEvent(new CustomEvent(t.type,{detail:t.detail,bubbles:!0,composed:!0}))}_updateFormValue(){if(!this._internals)return;if(!(this.variant==="filter"&&this.selected&&!this.disabled&&this.name)){this._internals.setFormValue(null),this._internals.setValidity({});return}const t=this.value||this.label||"";this._internals.setFormValue(t,this.name),this._internals.setValidity({})}formDisabledCallback(t){this.disabled=t}mapSpacingToken(t){if(!t)return;const a=String(t).trim();if(a)return/^\d+$/.test(a)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(a,10)))})`:a}},m.formAssociated=!0,m.styles=g`:host{display:inline-block;margin-block-start:var(--scb-chip-spacing-block-start, 0);margin-block-end:var(--scb-chip-spacing-block-end, 0);margin-inline-start:var(--scb-chip-spacing-inline-start, 0);margin-inline-end:var(--scb-chip-spacing-inline-end, 0)}:host md-assist-chip{--_label-text-color:var(--md-sys-color-on-surface-variant);--_hover-label-text-color:var(--md-sys-color-on-surface-variant);--_focus-label-text-color:var(--md-sys-color-on-surface-variant);--_pressed-label-text-color:var(--md-sys-color-on-surface-variant)}.static-chip{--scb-static-chip-color:var(--md-sys-color-on-surface, #0F0865);display:inline-flex;align-items:center;gap:var(--spacing-2, 4px);box-sizing:border-box;width:fit-content;border-radius:8px;padding:3px 11px;color:var(--md-sys-color-on-surface);font-family:var(--brand-font, var(--brand, "Inter"), sans-serif);font-size:14px;font-style:normal;font-weight:550;line-height:22px;white-space:nowrap}:host([static-variant='outlined']) .static-chip{border:1px solid var(--md-sys-color-outline);background:0 0}:host(:not([static-variant='outlined'])) .static-chip,:host([static-variant='filled']) .static-chip{border:0;background:color-mix(in srgb,var(--scb-static-chip-color) 8%,transparent)}.static-chip md-icon{font-size:18px}::slotted(*){display:inline!important;margin:0!important;color:inherit!important;font:inherit!important;letter-spacing:inherit!important;line-height:inherit!important}:host([size='small']) md-assist-chip,:host([size='small']) md-filter-chip{--md-assist-chip-label-text-size:var(--md-sys-typescale-label-small-size);--md-filter-chip-label-text-size:var(--md-sys-typescale-label-small-size)}:host([size='medium']) md-assist-chip,:host([size='medium']) md-filter-chip{--md-assist-chip-label-text-size:var(--md-sys-typescale-label-medium-size);--md-filter-chip-label-text-size:var(--md-sys-typescale-label-medium-size)}:host([size='large']) md-assist-chip,:host([size='large']) md-filter-chip{--md-assist-chip-label-text-size:var(--md-sys-typescale-body-large-size);--md-filter-chip-label-text-size:var(--md-sys-typescale-body-large-size)}`,m);function b(){const r=this.mapSpacingToken(this.spacing),t=this.mapSpacingToken(this.spacingTop),a=this.mapSpacingToken(this.spacingBottom),c=this.mapSpacingToken(this.spacingLeft),p=this.mapSpacingToken(this.spacingRight),l=t??r,n=a??r;l?this.style.setProperty("--scb-chip-spacing-block-start",l):this.style.removeProperty("--scb-chip-spacing-block-start"),n?this.style.setProperty("--scb-chip-spacing-block-end",n):this.style.removeProperty("--scb-chip-spacing-block-end"),c?this.style.setProperty("--scb-chip-spacing-inline-start",c):this.style.removeProperty("--scb-chip-spacing-inline-start"),p?this.style.setProperty("--scb-chip-spacing-inline-end",p):this.style.removeProperty("--scb-chip-spacing-inline-end")}i([s({type:String,reflect:!0})],e.prototype,"variant",void 0);i([s({type:String,reflect:!0,attribute:"static-variant"})],e.prototype,"staticVariant",void 0);i([s({type:String})],e.prototype,"label",void 0);i([s({type:String})],e.prototype,"icon",void 0);i([s({type:Boolean,reflect:!0})],e.prototype,"disabled",void 0);i([s({type:Boolean,reflect:!0})],e.prototype,"elevated",void 0);i([s({type:Boolean,reflect:!0})],e.prototype,"removable",void 0);i([s({type:Boolean,reflect:!0})],e.prototype,"selected",void 0);i([s({type:Boolean,reflect:!0,attribute:"disable-toggle"})],e.prototype,"disableToggle",void 0);i([s({type:String})],e.prototype,"href",void 0);i([s({type:String})],e.prototype,"target",void 0);i([s({type:String})],e.prototype,"name",void 0);i([s({type:String})],e.prototype,"value",void 0);i([s({type:String,reflect:!0})],e.prototype,"spacing",void 0);i([s({type:String,reflect:!0,attribute:"spacing-top"})],e.prototype,"spacingTop",void 0);i([s({type:String,reflect:!0,attribute:"spacing-bottom"})],e.prototype,"spacingBottom",void 0);i([s({type:String,reflect:!0,attribute:"spacing-left"})],e.prototype,"spacingLeft",void 0);i([s({type:String,reflect:!0,attribute:"spacing-right"})],e.prototype,"spacingRight",void 0);i([s({type:String,reflect:!0})],e.prototype,"size",void 0);e=i([f("scb-chip")],e);export{e as ScbChip};
31
+ `;default:return r``}}_toggleSelected(){this.selected=!this.selected,this._updateFormValue()}_onRemove(i){i.preventDefault(),i.stopPropagation(),this.dispatchEvent(new CustomEvent("remove",{detail:{label:this.label},bubbles:!0,composed:!0}))}_forward(i){this.dispatchEvent(new CustomEvent(i.type,{detail:i.detail,bubbles:!0,composed:!0}))}_updateFormValue(){if(!this._internals)return;if(!(this.variant==="filter"&&this.selected&&!this.disabled&&this.name)){this._internals.setFormValue(null),this._internals.setValidity({});return}const i=this.value||this.label||"";this._internals.setFormValue(i,this.name),this._internals.setValidity({})}formDisabledCallback(i){this.disabled=i}mapSpacingToken(i){if(!i)return;const a=String(i).trim();if(a)return/^\d+$/.test(a)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(a,10)))})`:a}},b.formAssociated=!0,b.styles=f`:host{display:inline-block;--scb-chip-container-height:32px;--scb-chip-icon-size:18px;--scb-chip-label-font-size:var(--scb-typography-label-large-size, var(--md-sys-typescale-label-large-size, 14px));--scb-chip-label-line-height:var(--scb-typography-label-large-line-height, var(--md-sys-typescale-label-large-line-height, 20px));--scb-chip-label-letter-spacing:var(--scb-typography-label-large-tracking, var(--md-sys-typescale-label-large-tracking, 0.1px));--scb-chip-leading-space:var(--spacing-5, 16px);--scb-chip-trailing-space:var(--spacing-5, 16px);--scb-chip-with-leading-icon-leading-space:var(--spacing-3, 8px);--scb-chip-with-trailing-icon-trailing-space:var(--spacing-3, 8px);--scb-chip-icon-label-space:var(--spacing-3, 8px);--md-assist-chip-container-height:var(--scb-chip-container-height);--md-filter-chip-container-height:var(--scb-chip-container-height);--md-assist-chip-icon-size:var(--scb-chip-icon-size);--md-filter-chip-icon-size:var(--scb-chip-icon-size);--md-assist-chip-label-text-size:var(--scb-chip-label-font-size);--md-filter-chip-label-text-size:var(--scb-chip-label-font-size);--md-assist-chip-label-text-line-height:var(--scb-chip-label-line-height);--md-filter-chip-label-text-line-height:var(--scb-chip-label-line-height);--md-assist-chip-leading-space:var(--scb-chip-leading-space);--md-filter-chip-leading-space:var(--scb-chip-leading-space);--md-assist-chip-trailing-space:var(--scb-chip-trailing-space);--md-filter-chip-trailing-space:var(--scb-chip-trailing-space);--md-assist-chip-with-leading-icon-leading-space:var(--scb-chip-with-leading-icon-leading-space);--md-filter-chip-with-leading-icon-leading-space:var(--scb-chip-with-leading-icon-leading-space);--md-filter-chip-with-trailing-icon-trailing-space:var(--scb-chip-with-trailing-icon-trailing-space);--md-assist-chip-icon-label-space:var(--scb-chip-icon-label-space);--md-filter-chip-icon-label-space:var(--scb-chip-icon-label-space);margin-block-start:var(--scb-chip-spacing-block-start, 0);margin-block-end:var(--scb-chip-spacing-block-end, 0);margin-inline-start:var(--scb-chip-spacing-inline-start, 0);margin-inline-end:var(--scb-chip-spacing-inline-end, 0)}:host([size='small']){--scb-chip-container-height:28px;--scb-chip-icon-size:16px;--scb-chip-leading-space:var(--spacing-4, 12px);--scb-chip-trailing-space:var(--spacing-4, 12px);--scb-chip-with-leading-icon-leading-space:var(--spacing-2, 4px);--scb-chip-with-trailing-icon-trailing-space:var(--spacing-2, 4px);--scb-chip-icon-label-space:var(--spacing-2, 4px)}:host([size='large']){--scb-chip-container-height:40px;--scb-chip-icon-size:20px;--scb-chip-leading-space:var(--spacing-6, 20px);--scb-chip-trailing-space:var(--spacing-6, 20px);--scb-chip-with-leading-icon-leading-space:var(--spacing-4, 12px);--scb-chip-with-trailing-icon-trailing-space:var(--spacing-4, 12px);--scb-chip-icon-label-space:var(--spacing-3, 8px)}:host md-assist-chip{--_label-text-color:var(--md-sys-color-on-surface-variant);--_hover-label-text-color:var(--md-sys-color-on-surface-variant);--_focus-label-text-color:var(--md-sys-color-on-surface-variant);--_pressed-label-text-color:var(--md-sys-color-on-surface-variant)}.static-chip{--scb-static-chip-color:var(--md-sys-color-on-surface, #0F0865);display:inline-flex;align-items:center;gap:var(--scb-chip-icon-label-space);box-sizing:border-box;width:fit-content;border-radius:8px;min-height:var(--scb-chip-container-height);padding-block:0;padding-inline:calc(var(--scb-chip-leading-space) - 1px) calc(var(--scb-chip-trailing-space) - 1px);color:var(--md-sys-color-on-surface);font-family:var(--brand-font, var(--brand, "Inter"), sans-serif);font-size:var(--scb-chip-label-font-size);font-style:normal;font-weight:550;line-height:var(--scb-chip-label-line-height);letter-spacing:var(--scb-chip-label-letter-spacing);white-space:nowrap}:host([static-variant='outlined']) .static-chip{border:1px solid var(--md-sys-color-outline);background:0 0}:host(:not([static-variant='outlined'])) .static-chip,:host([static-variant='filled']) .static-chip{border:0;background:color-mix(in srgb,var(--scb-static-chip-color) 8%,transparent)}.static-chip md-icon{font-size:var(--scb-chip-icon-size)}::slotted(*){display:inline!important;margin:0!important;color:inherit!important;font:inherit!important;letter-spacing:inherit!important;line-height:inherit!important}`,b);function v(){const c=this.mapSpacingToken(this.spacing),i=this.mapSpacingToken(this.spacingTop),a=this.mapSpacingToken(this.spacingBottom),p=this.mapSpacingToken(this.spacingLeft),o=this.mapSpacingToken(this.spacingRight),n=i??c,l=a??c;n?this.style.setProperty("--scb-chip-spacing-block-start",n):this.style.removeProperty("--scb-chip-spacing-block-start"),l?this.style.setProperty("--scb-chip-spacing-block-end",l):this.style.removeProperty("--scb-chip-spacing-block-end"),p?this.style.setProperty("--scb-chip-spacing-inline-start",p):this.style.removeProperty("--scb-chip-spacing-inline-start"),o?this.style.setProperty("--scb-chip-spacing-inline-end",o):this.style.removeProperty("--scb-chip-spacing-inline-end")}e([s({type:String,reflect:!0})],t.prototype,"variant",void 0);e([s({type:String,reflect:!0,attribute:"static-variant"})],t.prototype,"staticVariant",void 0);e([s({type:String})],t.prototype,"label",void 0);e([s({type:String})],t.prototype,"icon",void 0);e([s({type:Boolean,reflect:!0})],t.prototype,"disabled",void 0);e([s({type:Boolean,reflect:!0})],t.prototype,"elevated",void 0);e([s({type:Boolean,reflect:!0})],t.prototype,"removable",void 0);e([s({type:Boolean,reflect:!0})],t.prototype,"selected",void 0);e([s({type:Boolean,reflect:!0,attribute:"disable-toggle"})],t.prototype,"disableToggle",void 0);e([s({type:String})],t.prototype,"href",void 0);e([s({type:String})],t.prototype,"target",void 0);e([s({type:String})],t.prototype,"name",void 0);e([s({type:String})],t.prototype,"value",void 0);e([s({type:String,reflect:!0})],t.prototype,"spacing",void 0);e([s({type:String,reflect:!0,attribute:"spacing-top"})],t.prototype,"spacingTop",void 0);e([s({type:String,reflect:!0,attribute:"spacing-bottom"})],t.prototype,"spacingBottom",void 0);e([s({type:String,reflect:!0,attribute:"spacing-left"})],t.prototype,"spacingLeft",void 0);e([s({type:String,reflect:!0,attribute:"spacing-right"})],t.prototype,"spacingRight",void 0);e([s({type:String,reflect:!0})],t.prototype,"size",void 0);t=e([u("scb-chip")],t);export{t as ScbChip};
@@ -1,8 +1,8 @@
1
- import{h as q,m as I,p as h,v as E,y as D}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as c}from"../../vendor/decorate.js";import{n as W,t as a}from"../../vendor/assertClassBrand.js";import"../scb-button/scb-button.js";import{n as l,r as f,t as g}from"../../vendor/classPrivateFieldGet2.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(i,o,n){try{customElements.get(i)||t(i,o,n)}catch(d){var p=String(d||"");if(p.indexOf("already been used")===-1&&p.indexOf("NotSupportedError")===-1)throw d}}}}catch{}})();var s,b,m,v,y,u,_,x,L,r=(s=new WeakSet,b=new WeakMap,m=new WeakMap,v=new WeakMap,y=new WeakMap,u=new WeakMap,_=new WeakMap,x=new WeakMap,L=class extends q{constructor(...t){super(...t),W(this,s),f(this,b,void 0),f(this,m,void 0),f(this,v,void 0),f(this,y,void 0),f(this,u,void 0),f(this,_,void 0),f(this,x,void 0),this._contentId=`scb-collapse-content-${Math.random().toString(36).substr(2,9)}`,this.variant="elements",this.collapsedHeight=40,this.visibleElements=1,this.expanded=!1,this.hideToggle=!1,this.toggleButtonVariant="text",this.toggleButtonSize="medium",this.togglePosition="after",this.toggleLayout="block",this._elementCount=0,this.expandButtonLabel="Mer",this.collapseButtonLabel="Mindre",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.itemsGap=void 0,this._contentHeight=0,l(m,this,0),l(v,this,0),l(u,this,0),l(_,this,0)}get _regionLabel(){return`${this.expanded?this.collapseButtonLabel:this.expandButtonLabel} – ${this._contentId}`}toggle(){this.expanded=!this.expanded}getDefaultSlot(){return this.shadowRoot?.querySelector("slot:not([name])")}getToggleMeasureStyles(){const t=this.toggleButtonSize==="small",i=this.toggleButtonSize==="medium"||!this.toggleButtonSize,o=this.toggleButtonSize==="large",n=o?"var(--md-sys-typescale-label-medium-font)":"var(--md-sys-typescale-label-small-font)",p=o?"var(--md-sys-typescale-label-medium-size)":"var(--md-sys-typescale-label-small-size)",d=o?"var(--md-sys-typescale-label-medium-weight)":"var(--md-sys-typescale-label-small-weight)",S=o?"var(--md-sys-typescale-label-medium-line-height)":"var(--md-sys-typescale-label-small-line-height)",k=o?"var(--icon-size-medium, 24px)":"var(--icon-size-small, 20px)",F=t?"var(--spacing-2)":"var(--spacing-3)",A=t?"var(--spacing-4)":i?"var(--spacing-5)":"var(--spacing-7)",H=t?"calc(var(--spacing-3) - var(--spacing-1))":i?"calc(var(--spacing-4) - var(--spacing-1))":"var(--spacing-5)";return[`--scb-collapse-toggle-measure-font-family:${n}`,`--scb-collapse-toggle-measure-font-size:${p}`,`--scb-collapse-toggle-measure-font-weight:${d}`,`--scb-collapse-toggle-measure-line-height:${S}`,`--scb-collapse-toggle-measure-icon-size:${k}`,`--scb-collapse-toggle-measure-icon-gap:${F}`,`--scb-collapse-toggle-measure-padding-inline:${A}`,`--scb-collapse-toggle-measure-padding-block:${H}`,`--scb-collapse-toggle-measure-block-size:calc(${S} + ${H} + ${H})`].join(";")}mapSpacingToken(t){if(!t)return;const i=String(t).trim();if(i)return/^\d+$/.test(i)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(i,10)))})`:i}willUpdate(t){t.has("expanded")&&this.variant==="height"&&a(s,this,G).call(this,!!t.get("expanded"),this.expanded),t.has("variant")&&(this._measureContent(!1),this._countElements(!1))}_isFullyCollapsed(){if(this.expanded)return!1;if(this.variant==="height"){const t=typeof this.collapsedHeight=="string"?Number.parseFloat(this.collapsedHeight):this.collapsedHeight;return Number.isFinite(t)&&t<=0}return a(s,this,z).call(this)<=0}firstUpdated(){requestAnimationFrame(()=>{this._measureContent(),this._countElements(),a(s,this,$).call(this),a(s,this,w).call(this)});const t=this.getDefaultSlot();t&&t.addEventListener("slotchange",()=>{requestAnimationFrame(()=>{this._measureContent(),this._countElements(),a(s,this,$).call(this),a(s,this,w).call(this)})}),a(s,this,M).call(this),a(s,this,$).call(this)}updated(t){(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&a(s,this,M).call(this),t.has("itemsGap")&&(a(s,this,$).call(this),this._measureContent()),this.variant==="elements"&&!t.has("expanded")&&(t.has("variant")||t.has("visibleElements")||t.has("itemsGap"))&&(this._countElements(),a(s,this,w).call(this)),t.has("expanded")&&(a(s,this,$).call(this),this.variant==="height"?a(s,this,O).call(this):this.variant==="elements"&&a(s,this,U).call(this,!!t.get("expanded"),this.expanded),this.dispatchEvent(new CustomEvent("expandedchange",{detail:{expanded:this.expanded},bubbles:!0,composed:!0})))}_measureContent(t=!0){if(this.variant==="height"){const i=this.shadowRoot?.querySelector(".collapse-content"),o=this.getDefaultSlot();if(i){const n=i.scrollHeight;n!==this._contentHeight&&(this._contentHeight=n,t&&this.requestUpdate())}else if(o){const n=o.assignedNodes({flatten:!0});let p=0;n.forEach(S=>{if(S.nodeType===Node.ELEMENT_NODE){const k=S;p+=k.offsetHeight||k.scrollHeight||0}});const d=p;d!==this._contentHeight&&(this._contentHeight=d,t&&this.requestUpdate())}}}_countElements(t=!0){if(this.variant==="elements"){const i=this.getDefaultSlot();if(i){const o=i.assignedNodes({flatten:!0}).filter(n=>n.nodeType===Node.ELEMENT_NODE).length;o!==this._elementCount&&(this._elementCount=o,t&&this.requestUpdate())}}}render(){const t=this._isFullyCollapsed();if(this.variant==="height"){const i=this.expanded?"none":`${this.collapsedHeight}px`,o=this._contentHeight>this.collapsedHeight,n=o&&!this.hideToggle?a(s,this,N).call(this):"";return E`
1
+ import{h as I,m as D,p as h,v as E,y as W}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as c}from"../../vendor/decorate.js";import{n as G,t as o}from"../../vendor/assertClassBrand.js";import"../scb-button/scb-button.js";import{n as l,r as f,t as g}from"../../vendor/classPrivateFieldGet2.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(i,n,a){try{customElements.get(i)||t(i,n,a)}catch(d){var p=String(d||"");if(p.indexOf("already been used")===-1&&p.indexOf("NotSupportedError")===-1)throw d}}}}catch{}})();var s,b,u,v,y,m,_,x,L,r=(s=new WeakSet,b=new WeakMap,u=new WeakMap,v=new WeakMap,y=new WeakMap,m=new WeakMap,_=new WeakMap,x=new WeakMap,L=class extends I{constructor(...t){super(...t),G(this,s),f(this,b,void 0),f(this,u,void 0),f(this,v,void 0),f(this,y,void 0),f(this,m,void 0),f(this,_,void 0),f(this,x,void 0),this._contentId=`scb-collapse-content-${Math.random().toString(36).substr(2,9)}`,this.variant="elements",this.collapsedHeight=40,this.visibleElements=1,this.expanded=!1,this.hideToggle=!1,this.toggleButtonVariant="text",this.toggleButtonSize="medium",this.togglePosition="after",this.toggleLayout="block",this._elementCount=0,this.expandButtonLabel="Mer",this.collapseButtonLabel="Mindre",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.itemsGap=void 0,this._contentHeight=0,l(u,this,0),l(v,this,0),l(m,this,0),l(_,this,0)}get _regionLabel(){return`${this.expanded?this.collapseButtonLabel:this.expandButtonLabel} – ${this._contentId}`}toggle(){this.expanded=!this.expanded}getDefaultSlot(){return this.shadowRoot?.querySelector("slot:not([name])")}getToggleMeasureStyles(){const t=this.toggleButtonSize==="extra-small",i=this.toggleButtonSize==="small",n=this.toggleButtonSize==="medium"||!this.toggleButtonSize,a=this.toggleButtonSize==="large",p="var(--md-sys-typescale-label-medium-font)",d="var(--md-sys-typescale-label-medium-size)",k="var(--md-sys-typescale-label-medium-weight)",w="var(--md-sys-typescale-label-medium-line-height)",F=a?"var(--icon-size-medium, 24px)":"var(--icon-size-small, 20px)",A=t||i?"var(--spacing-2)":"var(--spacing-3)",q=t||i?"var(--spacing-4)":n?"var(--spacing-5)":"var(--spacing-7)",H=t||i?"var(--spacing-2)":n?"var(--spacing-3)":"var(--spacing-5)";return[`--scb-collapse-toggle-measure-font-family:${p}`,`--scb-collapse-toggle-measure-font-size:${d}`,`--scb-collapse-toggle-measure-font-weight:${k}`,`--scb-collapse-toggle-measure-line-height:${w}`,`--scb-collapse-toggle-measure-icon-size:${F}`,`--scb-collapse-toggle-measure-icon-gap:${A}`,`--scb-collapse-toggle-measure-padding-inline:${q}`,`--scb-collapse-toggle-measure-padding-block:${H}`,`--scb-collapse-toggle-measure-block-size:calc(${w} + ${H} + ${H})`].join(";")}mapSpacingToken(t){if(!t)return;const i=String(t).trim();if(i)return/^\d+$/.test(i)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(i,10)))})`:i}willUpdate(t){t.has("expanded")&&this.variant==="height"&&o(s,this,O).call(this,!!t.get("expanded"),this.expanded),t.has("variant")&&(this._measureContent(!1),this._countElements(!1))}_isFullyCollapsed(){if(this.expanded)return!1;if(this.variant==="height"){const t=typeof this.collapsedHeight=="string"?Number.parseFloat(this.collapsedHeight):this.collapsedHeight;return Number.isFinite(t)&&t<=0}return o(s,this,z).call(this)<=0}firstUpdated(){requestAnimationFrame(()=>{this._measureContent(),this._countElements(),o(s,this,$).call(this),o(s,this,S).call(this)});const t=this.getDefaultSlot();t&&t.addEventListener("slotchange",()=>{requestAnimationFrame(()=>{this._measureContent(),this._countElements(),o(s,this,$).call(this),o(s,this,S).call(this)})}),o(s,this,M).call(this),o(s,this,$).call(this)}updated(t){(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&o(s,this,M).call(this),t.has("itemsGap")&&(o(s,this,$).call(this),this._measureContent()),this.variant==="elements"&&!t.has("expanded")&&(t.has("variant")||t.has("visibleElements")||t.has("itemsGap"))&&(this._countElements(),o(s,this,S).call(this)),t.has("expanded")&&(o(s,this,$).call(this),this.variant==="height"?o(s,this,V).call(this):this.variant==="elements"&&o(s,this,j).call(this,!!t.get("expanded"),this.expanded),this.dispatchEvent(new CustomEvent("expandedchange",{detail:{expanded:this.expanded},bubbles:!0,composed:!0})))}_measureContent(t=!0){if(this.variant==="height"){const i=this.shadowRoot?.querySelector(".collapse-content"),n=this.getDefaultSlot();if(i){const a=i.scrollHeight;a!==this._contentHeight&&(this._contentHeight=a,t&&this.requestUpdate())}else if(n){const a=n.assignedNodes({flatten:!0});let p=0;a.forEach(k=>{if(k.nodeType===Node.ELEMENT_NODE){const w=k;p+=w.offsetHeight||w.scrollHeight||0}});const d=p;d!==this._contentHeight&&(this._contentHeight=d,t&&this.requestUpdate())}}}_countElements(t=!0){if(this.variant==="elements"){const i=this.getDefaultSlot();if(i){const n=i.assignedNodes({flatten:!0}).filter(a=>a.nodeType===Node.ELEMENT_NODE).length;n!==this._elementCount&&(this._elementCount=n,t&&this.requestUpdate())}}}render(){const t=this._isFullyCollapsed();if(this.variant==="height"){const i=this.expanded?"none":`${this.collapsedHeight}px`,n=this._contentHeight>this.collapsedHeight,a=n&&!this.hideToggle?o(s,this,N).call(this):"";return E`
2
2
  <div class="collapse-layout">
3
- ${this.togglePosition==="before"?n:""}
3
+ ${this.togglePosition==="before"?a:""}
4
4
  <div
5
- class="collapse-content collapse-content--height ${this.expanded?"expanded":""} ${o&&!this.expanded?"has-fade":""}"
5
+ class="collapse-content collapse-content--height ${this.expanded?"expanded":""} ${n&&!this.expanded?"has-fade":""}"
6
6
  id="${this._contentId}"
7
7
  style="max-height: ${i};"
8
8
  role="region"
@@ -12,11 +12,11 @@ import{h as q,m as I,p as h,v as E,y as D}from"../../vendor/vendor.js";import"..
12
12
  >
13
13
  <slot></slot>
14
14
  </div>
15
- ${this.togglePosition==="after"?n:""}
15
+ ${this.togglePosition==="after"?a:""}
16
16
  </div>
17
- `}else{const i=a(s,this,z).call(this),o=this._elementCount>i&&!this.hideToggle?a(s,this,N).call(this):"";return E`
17
+ `}else{const i=o(s,this,z).call(this),n=this._elementCount>i&&!this.hideToggle?o(s,this,N).call(this):"";return E`
18
18
  <div class="collapse-layout">
19
- ${this.togglePosition==="before"?o:""}
19
+ ${this.togglePosition==="before"?n:""}
20
20
  <div
21
21
  class="collapse-content collapse-content--elements ${this.expanded?"expanded":""}"
22
22
  id="${this._contentId}"
@@ -27,9 +27,9 @@ import{h as q,m as I,p as h,v as E,y as D}from"../../vendor/vendor.js";import"..
27
27
  >
28
28
  <slot></slot>
29
29
  </div>
30
- ${this.togglePosition==="after"?o:""}
30
+ ${this.togglePosition==="after"?n:""}
31
31
  </div>
32
- `}}},L.styles=D`:host{display:block;box-sizing:border-box;margin-block-start:var(--scb-collapse-spacing-block-start, 0);margin-block-end:var(--scb-collapse-spacing-block-end, 0);margin-inline-start:var(--scb-collapse-spacing-inline-start, 0);margin-inline-end:var(--scb-collapse-spacing-inline-end, 0)}.collapse-content{overflow:hidden;display:flow-root;position:relative;transition:max-height var(--motion-duration-medium) var(--motion-easing-standard)}.collapse-content--elements,.collapse-content--height{transition:height var(--motion-duration-medium) var(--motion-easing-standard)}.collapse-content.expanded{max-height:none;overflow:visible}.collapse-content.animating{overflow:hidden}.collapse-content--height.has-fade{-webkit-mask-image:linear-gradient(180deg,#000 0,#000 calc(100% - var(--scb-collapse-fade-height, 48px)),transparent 100%);mask-image:linear-gradient(180deg,#000 0,#000 calc(100% - var(--scb-collapse-fade-height, 48px)),transparent 100%)}.collapse-layout{display:block}.collapse-control-row{display:block;margin-block-start:8px}.collapse-control-row--before{margin-block-start:0;margin-block-end:var(--spacing-3, 12px)}.collapse-toggle{display:inline-grid;inline-size:max-content}.collapse-toggle scb-button,.collapse-toggle__measure{grid-area:1/1}.collapse-toggle scb-button{inline-size:100%}.collapse-toggle__measure{box-sizing:border-box;display:inline-flex;align-items:center;gap:var(--scb-collapse-toggle-measure-icon-gap);min-inline-size:64px;min-block-size:var(--scb-collapse-toggle-measure-block-size);padding-inline:var(--scb-collapse-toggle-measure-padding-inline);padding-block:var(--scb-collapse-toggle-measure-padding-block);border-radius:999px;color:transparent;font-family:var(--scb-collapse-toggle-measure-font-family);font-size:var(--scb-collapse-toggle-measure-font-size);font-weight:var(--scb-collapse-toggle-measure-font-weight);line-height:var(--scb-collapse-toggle-measure-line-height);pointer-events:none;user-select:none;white-space:nowrap;visibility:hidden}.collapse-toggle__measure-icon{display:inline-block;inline-size:var(--scb-collapse-toggle-measure-icon-size);block-size:var(--scb-collapse-toggle-measure-icon-size)}:host([toggle-layout='inline']) .collapse-control-row{display:flex;flex-wrap:wrap;align-items:center;gap:var(--spacing-3, 12px)}:host([toggle-layout='inline']) .collapse-toggle{flex:0 0 auto}slot[name=toggle-content]{display:contents}::slotted(.scb-collapsed-hidden){display:none!important}`,L);function M(){const e=this.mapSpacingToken(this.spacing),t=this.mapSpacingToken(this.spacingTop)??e,i=this.mapSpacingToken(this.spacingBottom)??e,o=this.mapSpacingToken(this.spacingLeft),n=this.mapSpacingToken(this.spacingRight);t?this.style.setProperty("--scb-collapse-spacing-block-start",t):this.style.removeProperty("--scb-collapse-spacing-block-start"),i?this.style.setProperty("--scb-collapse-spacing-block-end",i):this.style.removeProperty("--scb-collapse-spacing-block-end"),o?this.style.setProperty("--scb-collapse-spacing-inline-start",o):this.style.removeProperty("--scb-collapse-spacing-inline-start"),n?this.style.setProperty("--scb-collapse-spacing-inline-end",n):this.style.removeProperty("--scb-collapse-spacing-inline-end")}function $(){const e=this.mapSpacingToken(this.itemsGap);e?this.style.setProperty("--scb-collapse-items-gap",e):this.style.removeProperty("--scb-collapse-items-gap");const t=this.getDefaultSlot();t&&t.assignedNodes({flatten:!0}).filter(i=>i.nodeType===Node.ELEMENT_NODE).forEach((i,o)=>{const n=i;o===0||!e?n.style.removeProperty("margin-block-start"):n.style.setProperty("margin-block-start","var(--scb-collapse-items-gap)")})}function G(e,t){if(e===t){l(b,this,void 0);return}const i=this.shadowRoot?.querySelector(".collapse-content");if(!i){l(b,this,void 0);return}const o=i.getBoundingClientRect().height,n=Math.max(i.scrollHeight,this._contentHeight,o),p=t?n:Math.min(this.collapsedHeight,n);l(b,this,{startHeight:o,endHeight:p,expanded:t})}function C(e){g(m,this)&&(cancelAnimationFrame(g(m,this)),l(m,this,0)),g(v,this)&&(window.clearTimeout(g(v,this)),l(v,this,0));const t=e??this.shadowRoot?.querySelector(".collapse-content");t&&g(y,this)&&t.removeEventListener("transitionend",g(y,this)),l(y,this,void 0)}function B(e,t){a(s,this,C).call(this,e),e.classList.remove("animating"),e.style.removeProperty("height"),e.style.removeProperty("transition"),e.style.setProperty("max-height",t?"none":`${this.collapsedHeight}px`)}function O(){const e=this.shadowRoot?.querySelector(".collapse-content"),t=g(b,this);if(l(b,this,void 0),!e||!t)return;const i=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches??!1;if(a(s,this,C).call(this,e),i||Math.abs(t.startHeight-t.endHeight)<1){a(s,this,B).call(this,e,t.expanded);return}e.classList.add("animating"),e.style.transition="none",e.style.setProperty("max-height","none"),e.style.height=`${t.startHeight}px`,e.getBoundingClientRect(),l(y,this,o=>{o.target===e&&o.propertyName==="height"&&a(s,this,B).call(this,e,t.expanded)}),e.addEventListener("transitionend",g(y,this)),l(m,this,requestAnimationFrame(()=>{l(m,this,0),e.style.removeProperty("transition"),e.style.height=`${t.endHeight}px`})),l(v,this,window.setTimeout(()=>{a(s,this,B).call(this,e,t.expanded)},700))}function z(){const e=typeof this.visibleElements=="string"?parseInt(this.visibleElements,10):this.visibleElements;return Number.isFinite(e)?Math.max(0,Math.floor(e)):0}function R(){const e=this.getDefaultSlot();return e?e.assignedNodes({flatten:!0}).filter(t=>t.nodeType===Node.ELEMENT_NODE):[]}function w(e=this.expanded){if(this.variant!=="elements")return;const t=a(s,this,z).call(this);a(s,this,R).call(this).forEach((i,o)=>{i.classList.toggle("scb-collapsed-hidden",!e&&o>=t)})}function V(e){const t=this.shadowRoot?.querySelector(".collapse-content");if(!t)return 0;const i=a(s,this,R).call(this),o=i.map(p=>p.classList.contains("scb-collapsed-hidden"));a(s,this,w).call(this,e);const n=t.scrollHeight;return i.forEach((p,d)=>{p.classList.toggle("scb-collapsed-hidden",o[d])}),n}function P(e){g(u,this)&&(cancelAnimationFrame(g(u,this)),l(u,this,0)),g(_,this)&&(window.clearTimeout(g(_,this)),l(_,this,0));const t=e??this.shadowRoot?.querySelector(".collapse-content");t&&g(x,this)&&t.removeEventListener("transitionend",g(x,this)),l(x,this,void 0)}function T(e,t){a(s,this,P).call(this,e),a(s,this,w).call(this,t),e.classList.remove("animating"),e.style.removeProperty("height"),e.style.removeProperty("transition")}function U(e,t){const i=this.shadowRoot?.querySelector(".collapse-content");if(!i||e===t){a(s,this,w).call(this,t);return}const o=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches??!1,n=i.getBoundingClientRect().height,p=a(s,this,V).call(this,t);if(a(s,this,P).call(this,i),o||Math.abs(n-p)<1){a(s,this,T).call(this,i,t);return}i.classList.add("animating"),i.style.transition="none",i.style.height=`${n}px`,t&&a(s,this,w).call(this,!0),i.getBoundingClientRect(),l(x,this,d=>{d.target===i&&d.propertyName==="height"&&a(s,this,T).call(this,i,t)}),i.addEventListener("transitionend",g(x,this)),l(u,this,requestAnimationFrame(()=>{l(u,this,0),i.style.removeProperty("transition"),i.style.height=`${p}px`})),l(_,this,window.setTimeout(()=>{a(s,this,T).call(this,i,t)},700))}function j(){const e=this.expandButtonLabel.length>=this.collapseButtonLabel.length?this.expandButtonLabel:this.collapseButtonLabel;return E`
32
+ `}}},L.styles=W`:host{display:block;box-sizing:border-box;margin-block-start:var(--scb-collapse-spacing-block-start, 0);margin-block-end:var(--scb-collapse-spacing-block-end, 0);margin-inline-start:var(--scb-collapse-spacing-inline-start, 0);margin-inline-end:var(--scb-collapse-spacing-inline-end, 0)}.collapse-content{overflow:hidden;display:flow-root;position:relative;transition:max-height var(--motion-duration-medium) var(--motion-easing-standard)}.collapse-content--elements,.collapse-content--height{transition:height var(--motion-duration-medium) var(--motion-easing-standard)}.collapse-content.expanded{max-height:none;overflow:visible}.collapse-content.animating{overflow:hidden}.collapse-content--height.has-fade{-webkit-mask-image:linear-gradient(180deg,#000 0,#000 calc(100% - var(--scb-collapse-fade-height, 48px)),transparent 100%);mask-image:linear-gradient(180deg,#000 0,#000 calc(100% - var(--scb-collapse-fade-height, 48px)),transparent 100%)}.collapse-layout{display:block}.collapse-control-row{display:block;margin-block-start:8px}.collapse-control-row--before{margin-block-start:0;margin-block-end:var(--spacing-3, 12px)}.collapse-toggle{display:inline-grid;inline-size:max-content}.collapse-toggle scb-button,.collapse-toggle__measure{grid-area:1/1}.collapse-toggle scb-button{inline-size:100%}.collapse-toggle__measure{box-sizing:border-box;display:inline-flex;align-items:center;gap:var(--scb-collapse-toggle-measure-icon-gap);min-inline-size:64px;min-block-size:var(--scb-collapse-toggle-measure-block-size);padding-inline:var(--scb-collapse-toggle-measure-padding-inline);padding-block:var(--scb-collapse-toggle-measure-padding-block);border-radius:999px;color:transparent;font-family:var(--scb-collapse-toggle-measure-font-family);font-size:var(--scb-collapse-toggle-measure-font-size);font-weight:var(--scb-collapse-toggle-measure-font-weight);line-height:var(--scb-collapse-toggle-measure-line-height);pointer-events:none;user-select:none;white-space:nowrap;visibility:hidden}.collapse-toggle__measure-icon{display:inline-block;inline-size:var(--scb-collapse-toggle-measure-icon-size);block-size:var(--scb-collapse-toggle-measure-icon-size)}:host([toggle-layout='inline']) .collapse-control-row{display:flex;flex-wrap:wrap;align-items:center;gap:var(--spacing-3, 12px)}:host([toggle-layout='inline']) .collapse-toggle{flex:0 0 auto}slot[name=toggle-content]{display:contents}::slotted(.scb-collapsed-hidden){display:none!important}`,L);function M(){const e=this.mapSpacingToken(this.spacing),t=this.mapSpacingToken(this.spacingTop)??e,i=this.mapSpacingToken(this.spacingBottom)??e,n=this.mapSpacingToken(this.spacingLeft),a=this.mapSpacingToken(this.spacingRight);t?this.style.setProperty("--scb-collapse-spacing-block-start",t):this.style.removeProperty("--scb-collapse-spacing-block-start"),i?this.style.setProperty("--scb-collapse-spacing-block-end",i):this.style.removeProperty("--scb-collapse-spacing-block-end"),n?this.style.setProperty("--scb-collapse-spacing-inline-start",n):this.style.removeProperty("--scb-collapse-spacing-inline-start"),a?this.style.setProperty("--scb-collapse-spacing-inline-end",a):this.style.removeProperty("--scb-collapse-spacing-inline-end")}function $(){const e=this.mapSpacingToken(this.itemsGap);e?this.style.setProperty("--scb-collapse-items-gap",e):this.style.removeProperty("--scb-collapse-items-gap");const t=this.getDefaultSlot();t&&t.assignedNodes({flatten:!0}).filter(i=>i.nodeType===Node.ELEMENT_NODE).forEach((i,n)=>{const a=i;n===0||!e?a.style.removeProperty("margin-block-start"):a.style.setProperty("margin-block-start","var(--scb-collapse-items-gap)")})}function O(e,t){if(e===t){l(b,this,void 0);return}const i=this.shadowRoot?.querySelector(".collapse-content");if(!i){l(b,this,void 0);return}const n=i.getBoundingClientRect().height,a=Math.max(i.scrollHeight,this._contentHeight,n),p=t?a:Math.min(this.collapsedHeight,a);l(b,this,{startHeight:n,endHeight:p,expanded:t})}function C(e){g(u,this)&&(cancelAnimationFrame(g(u,this)),l(u,this,0)),g(v,this)&&(window.clearTimeout(g(v,this)),l(v,this,0));const t=e??this.shadowRoot?.querySelector(".collapse-content");t&&g(y,this)&&t.removeEventListener("transitionend",g(y,this)),l(y,this,void 0)}function B(e,t){o(s,this,C).call(this,e),e.classList.remove("animating"),e.style.removeProperty("height"),e.style.removeProperty("transition"),e.style.setProperty("max-height",t?"none":`${this.collapsedHeight}px`)}function V(){const e=this.shadowRoot?.querySelector(".collapse-content"),t=g(b,this);if(l(b,this,void 0),!e||!t)return;const i=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches??!1;if(o(s,this,C).call(this,e),i||Math.abs(t.startHeight-t.endHeight)<1){o(s,this,B).call(this,e,t.expanded);return}e.classList.add("animating"),e.style.transition="none",e.style.setProperty("max-height","none"),e.style.height=`${t.startHeight}px`,e.getBoundingClientRect(),l(y,this,n=>{n.target===e&&n.propertyName==="height"&&o(s,this,B).call(this,e,t.expanded)}),e.addEventListener("transitionend",g(y,this)),l(u,this,requestAnimationFrame(()=>{l(u,this,0),e.style.removeProperty("transition"),e.style.height=`${t.endHeight}px`})),l(v,this,window.setTimeout(()=>{o(s,this,B).call(this,e,t.expanded)},700))}function z(){const e=typeof this.visibleElements=="string"?parseInt(this.visibleElements,10):this.visibleElements;return Number.isFinite(e)?Math.max(0,Math.floor(e)):0}function R(){const e=this.getDefaultSlot();return e?e.assignedNodes({flatten:!0}).filter(t=>t.nodeType===Node.ELEMENT_NODE):[]}function S(e=this.expanded){if(this.variant!=="elements")return;const t=o(s,this,z).call(this);o(s,this,R).call(this).forEach((i,n)=>{i.classList.toggle("scb-collapsed-hidden",!e&&n>=t)})}function U(e){const t=this.shadowRoot?.querySelector(".collapse-content");if(!t)return 0;const i=o(s,this,R).call(this),n=i.map(p=>p.classList.contains("scb-collapsed-hidden"));o(s,this,S).call(this,e);const a=t.scrollHeight;return i.forEach((p,d)=>{p.classList.toggle("scb-collapsed-hidden",n[d])}),a}function P(e){g(m,this)&&(cancelAnimationFrame(g(m,this)),l(m,this,0)),g(_,this)&&(window.clearTimeout(g(_,this)),l(_,this,0));const t=e??this.shadowRoot?.querySelector(".collapse-content");t&&g(x,this)&&t.removeEventListener("transitionend",g(x,this)),l(x,this,void 0)}function T(e,t){o(s,this,P).call(this,e),o(s,this,S).call(this,t),e.classList.remove("animating"),e.style.removeProperty("height"),e.style.removeProperty("transition")}function j(e,t){const i=this.shadowRoot?.querySelector(".collapse-content");if(!i||e===t){o(s,this,S).call(this,t);return}const n=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches??!1,a=i.getBoundingClientRect().height,p=o(s,this,U).call(this,t);if(o(s,this,P).call(this,i),n||Math.abs(a-p)<1){o(s,this,T).call(this,i,t);return}i.classList.add("animating"),i.style.transition="none",i.style.height=`${a}px`,t&&o(s,this,S).call(this,!0),i.getBoundingClientRect(),l(x,this,d=>{d.target===i&&d.propertyName==="height"&&o(s,this,T).call(this,i,t)}),i.addEventListener("transitionend",g(x,this)),l(m,this,requestAnimationFrame(()=>{l(m,this,0),i.style.removeProperty("transition"),i.style.height=`${p}px`})),l(_,this,window.setTimeout(()=>{o(s,this,T).call(this,i,t)},700))}function J(){const e=this.expandButtonLabel.length>=this.collapseButtonLabel.length?this.expandButtonLabel:this.collapseButtonLabel;return E`
33
33
  <div class="collapse-toggle">
34
34
  <span class="collapse-toggle__measure" aria-hidden="true" style="${this.getToggleMeasureStyles()}">
35
35
  <span class="collapse-toggle__measure-icon"></span>
@@ -50,7 +50,7 @@ import{h as q,m as I,p as h,v as E,y as D}from"../../vendor/vendor.js";import"..
50
50
  </div>
51
51
  `}function N(){return E`
52
52
  <div class="collapse-control-row collapse-control-row--${this.togglePosition==="before"?"before":"after"}">
53
- ${a(s,this,j).call(this)}
53
+ ${o(s,this,J).call(this)}
54
54
  <slot name="toggle-content"></slot>
55
55
  </div>
56
- `}c([h({type:String})],r.prototype,"variant",void 0);c([h({type:Number,attribute:"collapsed-height",reflect:!0})],r.prototype,"collapsedHeight",void 0);c([h({type:Number,attribute:"visible-elements",reflect:!0})],r.prototype,"visibleElements",void 0);c([h({type:Boolean,reflect:!0})],r.prototype,"expanded",void 0);c([h({type:Boolean,attribute:"hide-toggle",reflect:!0})],r.prototype,"hideToggle",void 0);c([h({type:String,attribute:"toggle-button-variant",reflect:!0})],r.prototype,"toggleButtonVariant",void 0);c([h({type:String,attribute:"toggle-button-size",reflect:!0})],r.prototype,"toggleButtonSize",void 0);c([h({type:String,attribute:"toggle-position",reflect:!0})],r.prototype,"togglePosition",void 0);c([h({type:String,attribute:"toggle-layout",reflect:!0})],r.prototype,"toggleLayout",void 0);c([h({type:String,attribute:"expand-button-label",reflect:!0})],r.prototype,"expandButtonLabel",void 0);c([h({type:String,attribute:"collapse-button-label",reflect:!0})],r.prototype,"collapseButtonLabel",void 0);c([h({type:String,reflect:!0})],r.prototype,"spacing",void 0);c([h({type:String,attribute:"spacing-top",reflect:!0})],r.prototype,"spacingTop",void 0);c([h({type:String,attribute:"spacing-bottom",reflect:!0})],r.prototype,"spacingBottom",void 0);c([h({type:String,attribute:"spacing-left",reflect:!0})],r.prototype,"spacingLeft",void 0);c([h({type:String,attribute:"spacing-right",reflect:!0})],r.prototype,"spacingRight",void 0);c([h({type:String,attribute:"items-gap",reflect:!0})],r.prototype,"itemsGap",void 0);r=c([I("scb-collapse")],r);
56
+ `}c([h({type:String})],r.prototype,"variant",void 0);c([h({type:Number,attribute:"collapsed-height",reflect:!0})],r.prototype,"collapsedHeight",void 0);c([h({type:Number,attribute:"visible-elements",reflect:!0})],r.prototype,"visibleElements",void 0);c([h({type:Boolean,reflect:!0})],r.prototype,"expanded",void 0);c([h({type:Boolean,attribute:"hide-toggle",reflect:!0})],r.prototype,"hideToggle",void 0);c([h({type:String,attribute:"toggle-button-variant",reflect:!0})],r.prototype,"toggleButtonVariant",void 0);c([h({type:String,attribute:"toggle-button-size",reflect:!0})],r.prototype,"toggleButtonSize",void 0);c([h({type:String,attribute:"toggle-position",reflect:!0})],r.prototype,"togglePosition",void 0);c([h({type:String,attribute:"toggle-layout",reflect:!0})],r.prototype,"toggleLayout",void 0);c([h({type:String,attribute:"expand-button-label",reflect:!0})],r.prototype,"expandButtonLabel",void 0);c([h({type:String,attribute:"collapse-button-label",reflect:!0})],r.prototype,"collapseButtonLabel",void 0);c([h({type:String,reflect:!0})],r.prototype,"spacing",void 0);c([h({type:String,attribute:"spacing-top",reflect:!0})],r.prototype,"spacingTop",void 0);c([h({type:String,attribute:"spacing-bottom",reflect:!0})],r.prototype,"spacingBottom",void 0);c([h({type:String,attribute:"spacing-left",reflect:!0})],r.prototype,"spacingLeft",void 0);c([h({type:String,attribute:"spacing-right",reflect:!0})],r.prototype,"spacingRight",void 0);c([h({type:String,attribute:"items-gap",reflect:!0})],r.prototype,"itemsGap",void 0);r=c([D("scb-collapse")],r);
@@ -0,0 +1,132 @@
1
+ import{f as l,h as $,m as M,p as m,v as d,y as Y}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/icon.js";import"../../vendor/ripple.js";import{addLazyFocusRingListeners as C}from"../shared/lazy-focus-ring.js";import{t as h}from"../../vendor/decorate.js";import"../scb-button/scb-button.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-divider/scb-divider.js";(function(){try{var w=typeof globalThis<"u"?globalThis:window;if(!w.__scb_ce_guard_installed__){w.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(e,o,p){try{customElements.get(e)||t(e,o,p)}catch(r){var a=String(r||"");if(a.indexOf("already been used")===-1&&a.indexOf("NotSupportedError")===-1)throw r}}}}catch{}})();var v,c=(v=class extends ${constructor(...t){super(...t),this._currentDate=new Date,this._selectedDate=null,this._showMonthDropdown=!1,this._showYearDropdown=!1,this.variant="date",this.lang="sv",this.selectedValue="",this.open=!0,this._selectedHour=0,this._selectedMinute=0,this._viewportMargin=8,this._popupOffset=4,this._onWindowReposition=()=>{this._positionPopupWithinViewport()},this._monthNames=[this.lang=="sv"?"Januari":"January",this.lang=="sv"?"Februari":"February",this.lang=="sv"?"Mars":"March",(this.lang=="sv","April"),this.lang=="sv"?"Maj":"May",this.lang=="sv"?"Juni":"June",this.lang=="sv"?"Juli":"July",this.lang=="sv"?"Augusti":"August",(this.lang=="sv","September"),this.lang=="sv"?"Oktober":"October",(this.lang=="sv","November"),(this.lang=="sv","December")],this._onPopupKeydown=e=>{e.key==="Escape"&&(e.preventDefault(),e.stopPropagation(),!this._closeOpenDropdowns()&&this._close())},this._outsideClickHandler=e=>{this.open&&(e.composedPath().includes(this)||this._close())},this._prevMonth=()=>{const e=this._currentDate.getFullYear(),o=this._currentDate.getMonth();o===0?this._currentDate=new Date(e-1,11,1):this._currentDate=new Date(e,o-1,1)},this._prevYear=()=>{const e=this._currentDate.getFullYear(),o=this._currentDate.getMonth();this._currentDate=new Date(e-1,o,1)},this._nextMonth=()=>{const e=this._currentDate.getFullYear(),o=this._currentDate.getMonth();o===11?this._currentDate=new Date(e+1,0,1):this._currentDate=new Date(e,o+1,1)},this._nextYear=()=>{const e=this._currentDate.getFullYear(),o=this._currentDate.getMonth();this._currentDate=new Date(e+1,o,1)},this._onTimeChange=e=>{const[o,p]=e.target.value.split(":"),a=parseInt(o,10),r=parseInt(p,10);this._selectedHour=isNaN(a)?0:Math.max(0,Math.min(23,a)),this._selectedMinute=isNaN(r)?0:Math.max(0,Math.min(59,r)),this._fireDateTimeChange()},this._close=()=>{this.open=!1,this.dispatchEvent(new CustomEvent("datepicker-closed",{bubbles:!0,composed:!0}))}}_isRenderedInsideDialog(){const t=this.getRootNode(),e=t instanceof ShadowRoot?t.host:null;return e instanceof HTMLElement&&e.closest("scb-dialog")?!0:!!this.closest("scb-dialog")}connectedCallback(){super.connectedCallback(),this._removeLazyFocusRingListeners=C(this,this.renderRoot)}_positionPopupWithinViewport(){if(!this.open)return;const t=this.renderRoot.querySelector(".datepicker-popup");if(!t)return;const e=this.parentElement?.getBoundingClientRect();if(!e)return;const o=window.innerWidth,p=window.innerHeight,a=Math.max(220,o-this._viewportMargin*2);if(this._isRenderedInsideDialog()){const _=Math.min(t.offsetWidth||380,a),b=t.offsetHeight||420,D=Math.min(Math.max(e.left,this._viewportMargin),o-this._viewportMargin-_),g=p-e.bottom-this._viewportMargin,f=e.top-this._viewportMargin,k=g<b+this._popupOffset&&f>g;if(this.style.setProperty("--scb-datepicker-position","absolute"),this.style.setProperty("--scb-datepicker-computed-width",`${_}px`),this.style.setProperty("--scb-datepicker-left",`${D-e.left}px`),this.style.setProperty("--scb-datepicker-transform","none"),this.style.setProperty("--scb-datepicker-bottom","auto"),k){const x=Math.max(this._viewportMargin,e.top-b-this._popupOffset)-e.top;this.style.setProperty("--scb-datepicker-top",`${x}px`),this.style.setProperty("--scb-datepicker-max-height",`${Math.max(0,f-this._popupOffset)}px`)}else this.style.setProperty("--scb-datepicker-top",`${e.height+this._popupOffset}px`),this.style.setProperty("--scb-datepicker-max-height",`${Math.max(0,g-this._popupOffset)}px`);return}const r=Math.min(t.offsetWidth||380,a),s=t.offsetHeight||420,i=Math.min(Math.max(e.left,this._viewportMargin),o-this._viewportMargin-r),n=p-e.bottom-this._viewportMargin,u=e.top-this._viewportMargin,y=n<s+this._popupOffset&&u>n;this.style.setProperty("--scb-datepicker-position","fixed"),this.style.setProperty("--scb-datepicker-computed-width",`${r}px`),this.style.setProperty("--scb-datepicker-left",`${i}px`),this.style.setProperty("--scb-datepicker-transform","none"),y?(this.style.setProperty("--scb-datepicker-top",`${Math.max(this._viewportMargin,e.top-s-this._popupOffset)}px`),this.style.setProperty("--scb-datepicker-bottom","auto"),this.style.setProperty("--scb-datepicker-max-height",`${Math.max(0,u-this._popupOffset)}px`)):(this.style.setProperty("--scb-datepicker-top",`${e.bottom+this._popupOffset}px`),this.style.setProperty("--scb-datepicker-bottom","auto"),this.style.setProperty("--scb-datepicker-max-height",`${Math.max(0,n-this._popupOffset)}px`))}updated(t){if(super.updated(t),this.open?(window.addEventListener("mousedown",this._outsideClickHandler),window.addEventListener("resize",this._onWindowReposition,{passive:!0}),window.addEventListener("scroll",this._onWindowReposition,{passive:!0,capture:!0}),requestAnimationFrame(()=>this._positionPopupWithinViewport())):(window.removeEventListener("mousedown",this._outsideClickHandler),window.removeEventListener("resize",this._onWindowReposition),window.removeEventListener("scroll",this._onWindowReposition,!0)),t.has("selectedValue")&&this.selectedValue){const e=new Date(this.selectedValue);isNaN(e.getTime())||(this._selectedDate=e,this._currentDate=new Date(e.getFullYear(),e.getMonth(),1),this.variant==="datetime-local"&&(this._selectedHour=e.getHours(),this._selectedMinute=e.getMinutes()))}this.open&&requestAnimationFrame(()=>this._positionPopupWithinViewport())}disconnectedCallback(){this._removeLazyFocusRingListeners?.(),this._removeLazyFocusRingListeners=void 0,window.removeEventListener("mousedown",this._outsideClickHandler),window.removeEventListener("resize",this._onWindowReposition),window.removeEventListener("scroll",this._onWindowReposition,!0),super.disconnectedCallback()}_locale(){return this.lang==="sv"?"sv-SE":"en-GB"}_formatDateLabel(t){return new Intl.DateTimeFormat(this._locale(),{day:"numeric",month:"long",year:"numeric"}).format(t)}_closeOpenDropdowns(){return!this._showMonthDropdown&&!this._showYearDropdown?!1:(this._showMonthDropdown=!1,this._showYearDropdown=!1,!0)}render(){if(!this.open)return d``;const t=this._currentDate.getFullYear(),e=this._currentDate.getMonth(),o=new Date,p=this._getMonthDays(t,e),a=Array.from({length:101},(s,i)=>o.getFullYear()-50+i),r=this.variant==="datetime-local"&&!this._showMonthDropdown&&!this._showYearDropdown;return d`
2
+ <div class="datepicker-popup popup" @keydown=${this._onPopupKeydown}>
3
+ <div class="header">
4
+ <div class="month-selector ${this._showMonthDropdown?"open":""} ${this._showYearDropdown?"disable":""}">
5
+ <scb-icon-button icon="chevron_left" @click=${this._prevMonth} aria-label=${this.lang=="sv"?"Föregående månad":"Previous month"}></scb-icon-button>
6
+ <div class="custom-dropdown month-dropdown">
7
+ <div
8
+ tabindex=${this._showYearDropdown?-1:0}
9
+ class="dropdown-selected"
10
+ role="button"
11
+ aria-haspopup="listbox"
12
+ aria-expanded=${String(this._showMonthDropdown)}
13
+ aria-label=${this.lang=="sv"?"Välj månad":"Choose month"}
14
+ @click=${()=>this._toggleMonthDropdown()}
15
+ @keydown=${s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),this._toggleMonthDropdown())}}
16
+ >
17
+ ${this._monthNames[e].slice(0,3)}
18
+ <md-icon aria-hidden="true">arrow_drop_down</md-icon>
19
+ <md-focus-ring></md-focus-ring>
20
+ <md-ripple></md-ripple>
21
+ </div>
22
+ </div>
23
+ <scb-icon-button icon="chevron_right" @click=${this._nextMonth} aria-label=${this.lang=="sv"?"Nästa månad":"Next month"}></scb-icon-button>
24
+ </div>
25
+ <div class="year-selector ${this._showMonthDropdown?"disable":""} ${this._showYearDropdown?"open":""}">
26
+ <scb-icon-button icon="chevron_left" @click=${this._prevYear} aria-label=${this.lang=="sv"?"Föregående år":"Previous year"}></scb-icon-button>
27
+ <div class="custom-dropdown year-dropdown">
28
+ <div
29
+ tabindex=${this._showMonthDropdown?-1:0}
30
+ class="dropdown-selected"
31
+ role="button"
32
+ aria-haspopup="listbox"
33
+ aria-expanded=${String(this._showYearDropdown)}
34
+ aria-label=${this.lang=="sv"?"Välj år":"Choose year"}
35
+ @click=${()=>this._toggleYearDropdown()}
36
+ @keydown=${s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),this._toggleYearDropdown())}}
37
+ >
38
+ ${t}
39
+ <md-icon aria-hidden="true">arrow_drop_down</md-icon>
40
+ <md-focus-ring></md-focus-ring>
41
+ <md-ripple></md-ripple>
42
+ </div>
43
+ </div>
44
+ <scb-icon-button icon="chevron_right" @click=${this._nextYear} aria-label=${this.lang=="sv"?"Nästa år":"Next year"}></scb-icon-button>
45
+ </div>
46
+ </div>
47
+ ${this._showMonthDropdown||this._showYearDropdown?d`<scb-divider></scb-divider>`:""}
48
+ <div class="datepicker-content" style="position:relative;">
49
+ ${this._showMonthDropdown?d`
50
+ <div class="dropdown-list" role="listbox" aria-label=${this.lang=="sv"?"Månader":"Months"}>
51
+ ${this._monthNames.map((s,i)=>d`
52
+ <div
53
+ @keydown=${n=>{(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),this._onMonthChangeCustom(i))}}
54
+ tabindex="0"
55
+ role="option"
56
+ aria-selected=${i===e?"true":"false"}
57
+ class="dropdown-item${i===e?" selected":""}"
58
+ @click=${()=>this._onMonthChangeCustom(i)}
59
+ id=${i===e?"selected-month":""}
60
+ >
61
+ ${i===e?d`<md-icon aria-hidden="true">check</md-icon>`:""}
62
+ ${s}
63
+ <md-ripple></md-ripple><md-focus-ring inward></md-focus-ring>
64
+ </div>
65
+ `)}
66
+ </div>
67
+ `:""}
68
+ ${this._showYearDropdown?d`
69
+ <div class="dropdown-list" role="listbox" aria-label=${this.lang=="sv"?"År":"Years"}>
70
+ ${a.map(s=>d`
71
+ <div
72
+ @keydown=${i=>{(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),this._onYearChangeCustom(s))}}
73
+ tabindex="0"
74
+ role="option"
75
+ aria-selected=${s===t?"true":"false"}
76
+ class="dropdown-item${s===t?" selected":""}"
77
+ @click=${()=>this._onYearChangeCustom(s)}
78
+ id=${s===t?"selected-year":""}
79
+ >
80
+ ${s===t?d`<md-icon aria-hidden="true">check</md-icon>`:""}
81
+ ${s}
82
+ <md-ripple></md-ripple><md-focus-ring inward></md-focus-ring>
83
+ </div>
84
+ `)}
85
+ </div>
86
+ `:""}
87
+ ${!this._showMonthDropdown&&!this._showYearDropdown?d`
88
+ <div class="datepicker-calendar">
89
+ <table>
90
+ <thead>
91
+ <tr>
92
+ <th>${this.lang=="sv"?"Må":"Mo"}</th><th>${this.lang=="sv"?"Ti":"Tu"}</th><th>${this.lang=="sv"?"On":"We"}</th><th>${this.lang=="sv"?"To":"Th"}</th><th>${this.lang=="sv","Fr"}</th><th>${this.lang=="sv"?"Lö":"Sa"}</th><th>${this.lang=="sv"?"Sö":"Su"}</th>
93
+ </tr>
94
+ </thead>
95
+ <tbody>
96
+ ${p.map(s=>d`
97
+ <tr>
98
+ ${s.map(i=>i?d`
99
+ <td>
100
+ <div
101
+ @keydown=${n=>{(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),this._selectDate(i))}}
102
+ role="button"
103
+ aria-label=${this._formatDateLabel(i)}
104
+ aria-pressed=${this._isSelected(i)?"true":"false"}
105
+ tabindex="0"
106
+ class="day${this._isToday(i,o)?" today":""}${this._isSelected(i)?" selected":""}"
107
+ @click=${()=>this._selectDate(i)}
108
+ >${i.getDate()}<md-ripple></md-ripple><md-focus-ring></md-focus-ring></div>
109
+ </td>
110
+ `:d`<td></td>`)}
111
+ </tr>
112
+ `)}
113
+ </tbody>
114
+ </table>
115
+ </div>
116
+ `:""}
117
+ </div>
118
+ ${r?d`
119
+ <div style="padding: 0 24px;">
120
+ <label style="display:flex;align-items:center;gap:8px;">
121
+ <span>${this.lang=="sv"?"Tid:":"Time:"}</span>
122
+ <scb-textfield type="time" .value=${`${String(this._selectedHour).padStart(2,"0")}:${String(this._selectedMinute).padStart(2,"0")}`} @blur=${this._onTimeChange} aria-label="${this.lang=="sv"?"Tid":"Time"}"></scb-textfield>
123
+ </label>
124
+ </div>
125
+ `:""}
126
+ <div class="datepicker-footer">
127
+ ${!this._showMonthDropdown&&!this._showYearDropdown?d`
128
+ <scb-button variant="text" label=${this.lang=="sv"?"Stäng":"Close"} @click=${this._close}></scb-button>
129
+ `:""}
130
+ </div>
131
+ </div>
132
+ `}_getMonthDays(t,e){const o=new Date(Date.UTC(t,e,1)),p=new Date(Date.UTC(t,e+1,0)),a=[];let r=[],s=o.getUTCDay(),i=s===0?6:s-1;for(let n=0;n<i;n++)r.push(null);for(let n=1;n<=p.getUTCDate();n++){const u=new Date(Date.UTC(t,e,n));r.push(u),r.length===7&&(a.push(r),r=[])}if(r.length){for(;r.length<7;)r.push(null);a.push(r)}return a}_toggleMonthDropdown(){this._showMonthDropdown=!this._showMonthDropdown,this._showMonthDropdown&&(this._showYearDropdown=!1,setTimeout(()=>{const t=this.renderRoot.querySelector("#selected-month");t&&t.scrollIntoView({block:"center"})},0))}_toggleYearDropdown(){this._showYearDropdown=!this._showYearDropdown,this._showYearDropdown&&(this._showMonthDropdown=!1,setTimeout(()=>{const t=this.renderRoot.querySelector("#selected-year");t&&t.scrollIntoView({block:"center"})},0))}_onMonthChangeCustom(t){const e=this._currentDate.getFullYear();this._currentDate=new Date(e,t,1),this._showMonthDropdown=!1}_onYearChangeCustom(t){const e=this._currentDate.getMonth();this._currentDate=new Date(t,e,1),this._showYearDropdown=!1}_isToday(t,e){return t.getDate()===e.getDate()&&t.getMonth()===e.getMonth()&&t.getFullYear()===e.getFullYear()}_isSelected(t){return this._selectedDate&&t.getDate()===this._selectedDate.getDate()&&t.getMonth()===this._selectedDate.getMonth()&&t.getFullYear()===this._selectedDate.getFullYear()}_selectDate(t){if(this._selectedDate=t,this.variant==="datetime-local"){const e=new Date(t);e.setHours(this._selectedHour??0,this._selectedMinute??0,0,0),this._selectedHour=e.getHours(),this._selectedMinute=e.getMinutes();const o=a=>a.toString().padStart(2,"0"),p=`${e.getFullYear()}-${o(e.getMonth()+1)}-${o(e.getDate())} ${o(e.getHours())}:${o(e.getMinutes())}`;this.dispatchEvent(new CustomEvent("date-selected",{detail:{value:p},bubbles:!0,composed:!0}))}else{const e=t.toISOString().slice(0,10);this.dispatchEvent(new CustomEvent("date-selected",{detail:{value:e},bubbles:!0,composed:!0}))}}_fireDateTimeChange(){if(this.variant==="datetime-local"&&this._selectedDate){const t=new Date(this._selectedDate);t.setHours(this._selectedHour??0,this._selectedMinute??0,0,0);const e=p=>p.toString().padStart(2,"0"),o=`${t.getFullYear()}-${e(t.getMonth()+1)}-${e(t.getDate())} ${e(t.getHours())}:${e(t.getMinutes())}`;this.dispatchEvent(new CustomEvent("date-selected",{detail:{value:o},bubbles:!0,composed:!0}))}}},v.styles=[Y`:host{--scb-datepicker-width:380px;--scb-datepicker-z-index:1100;--scb-datepicker-viewport-margin:8px;--scb-datepicker-offset:var(--spacing-2, 4px);max-width:var(--scb-datepicker-computed-width, min(var(--scb-datepicker-width), calc(100vw - (var(--scb-datepicker-viewport-margin) * 2))));font-family:var(--brand-font);color:var(--md-sys-color-on-surface);display:block;position:var(--scb-datepicker-position, fixed);top:var(--scb-datepicker-top, calc(100% + var(--scb-datepicker-offset)));bottom:var(--scb-datepicker-bottom, auto);left:var(--scb-datepicker-left, 0);width:var(--scb-datepicker-computed-width, min(var(--scb-datepicker-width), calc(100vw - (var(--scb-datepicker-viewport-margin) * 2))));transform:var(--scb-datepicker-transform, translateX(0px));z-index:var(--scb-datepicker-z-index)}.dropdown-selected,.month-selector,.year-selector{display:flex;align-items:center}.dropdown-selected{position:relative;border-radius:8px;font-size:16px;cursor:pointer;text-align:left;gap:8px;padding:4px 8px}.dropdown-selected:focus{outline:0}.dropdown-selected md-focus-ring{border-radius:8px}.dropdown-list{position:relative;background:var(--md-sys-color-surface);padding:4px 0}.dropdown-item{display:flex;position:relative;cursor:pointer;padding:var(--spacing-3) 56px;min-height:40px;align-items:center}.dropdown-item:focus-within{outline:0}.datepicker-popup,.dropdown-item md-focus-ring{border-radius:var(--md-sys-shape-corner-small)}.dropdown-item.selected{background:var(--md-sys-color-secondary-container, #e3f2fd);font-weight:500;padding-left:16px;gap:16px}.datepicker-popup{background:var(--md-sys-color-surface);box-shadow:0 1px 2px 0 rgba(0,0,0,.3),0 2px 6px 2px rgba(0,0,0,.15);max-width:100%;width:100%;max-height:var(--scb-datepicker-max-height, 80vh);overflow:auto;font-family:var(--brand-font)}.datepicker-content{overflow-y:auto;max-height:290px}.datepicker-content::-webkit-scrollbar{width:12px;background:var(--md-sys-color-surface);border-radius:var(--md-sys-shape-corner-small)}.datepicker-content::-webkit-scrollbar-thumb{background:var(--md-sys-color-outline);border-radius:var(--md-sys-shape-corner-small);border:4px solid var(--md-sys-color-surface)}.datepicker-content::-webkit-scrollbar-track{background:var(--md-sys-color-surface);border-radius:var(--md-sys-shape-corner-small)}.popup{position:absolute;top:0;left:0;z-index:1}.header{display:flex;align-items:center;justify-content:space-between;margin-bottom:30px;padding:20px 16px 0;flex-wrap:wrap}.datepicker-footer{padding:8px 16px 24px}.month-label{font-size:18px;font-weight:500}.datepicker-calendar{padding:0 16px}table{width:100%;border-collapse:collapse;margin-bottom:8px}th{color:var(--md-sys-color-on-surface-variant, #757575);font-size:16px;font-weight:600;padding-bottom:20px}td{text-align:center}.day:focus-within{outline:0}.close-datepicker,.day{background:0 0;font-size:16px;cursor:pointer}.day{position:relative;width:40px;height:40px;border-radius:50%;border:0;font-family:var(--brand-font, Inter, Arial, sans-serif);align-content:center}.day.selected{background:var(--md-sys-color-secondary-container)}.close-datepicker{margin-top:8px;border-color:none;color:var(--md-sys-color-primary, #0057b8);padding:4px 12px;border-radius:8px}.close-datepicker:hover{background:var(--md-sys-color-primary-container, #e3f2fd)}`],v);h([l()],c.prototype,"_currentDate",void 0);h([l()],c.prototype,"_selectedDate",void 0);h([l()],c.prototype,"_showMonthDropdown",void 0);h([l()],c.prototype,"_showYearDropdown",void 0);h([m({type:String})],c.prototype,"variant",void 0);h([m({type:String})],c.prototype,"lang",void 0);h([m({type:String})],c.prototype,"selectedValue",void 0);h([m({type:Boolean})],c.prototype,"open",void 0);h([l()],c.prototype,"_selectedHour",void 0);h([l()],c.prototype,"_selectedMinute",void 0);c=h([M("scb-datepicker")],c);