@luzmo/lucero 2.6.1 → 2.7.1

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 (34) hide show
  1. package/components/index.cjs +1 -1
  2. package/components/index.js +16 -16
  3. package/components/options/index.cjs +1 -1
  4. package/components/options/index.d.ts +1 -1
  5. package/components/options/index.js +1 -1
  6. package/components/options/options.d.ts +14 -28
  7. package/components/options/types.d.ts +42 -0
  8. package/components/options-BH_Y3UB6.cjs +110 -0
  9. package/components/{options-BrpagtL6.js → options-BiA2h1-i.js} +94 -74
  10. package/components/question-box/index.cjs +1 -1
  11. package/components/question-box/index.js +1 -1
  12. package/components/question-box/question-box.d.ts +4 -1
  13. package/components/{question-box-BAyRPZ8j.js → question-box-CxzEveid.js} +148 -144
  14. package/components/question-box-DmTWFlRn.cjs +401 -0
  15. package/components/select/index.cjs +1 -1
  16. package/components/select/index.d.ts +1 -0
  17. package/components/select/index.js +1 -1
  18. package/components/select/select.d.ts +9 -1
  19. package/components/{select-BWTeIJdP.js → select-8gtm46qA.js} +82 -76
  20. package/components/select-ChM3Zfxd.cjs +159 -0
  21. package/components/utils.cjs +1 -1
  22. package/components/utils.js +3 -3
  23. package/custom-elements.json +1 -1
  24. package/package.json +1 -1
  25. package/standalone/chunks/options-CPaX-OWy.js +94 -0
  26. package/standalone/manifest.json +1 -1
  27. package/standalone/options.js +1 -1
  28. package/standalone/question-box.js +52 -52
  29. package/standalone/select.js +10 -9
  30. package/standalone/utils.js +1 -1
  31. package/components/options-DE7SelUz.cjs +0 -105
  32. package/components/question-box-D7s2xNAD.cjs +0 -401
  33. package/components/select-Ch8KCcDr.cjs +0 -158
  34. package/standalone/chunks/options-CMRXQfIE.js +0 -89
@@ -1,158 +0,0 @@
1
- /*! * Lucero - The design system for Luzmo.
2
- *
3
- * Copyright © 2026 Luzmo
4
- * All rights reserved.
5
- * Lucero (“Luzmo Design System”) must be used according to the Luzmo Terms of Service.
6
- * This license allows users with a current active Luzmo account to use Lucero.
7
- * This license terminates automatically if a user no longer has an active Luzmo account.
8
- * Please view the Luzmo Terms of Service at: https://www.luzmo.com/information-pages/terms-of-use.
9
- *
10
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
11
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
12
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
13
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
14
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
15
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
16
- * SOFTWARE.
17
- * */
18
- require("./tokens.cjs");const e=require("./decorate-SO02l0A6.cjs"),t=require("./sized-mixin-CSajkMro.cjs"),n=require("./focusable-BIHTrJd6.cjs");require("./icon-BlbMP3mJ.cjs"),require("./popover-CFzz83f8.cjs");const r=require("./dependency-manger-BSaHw9ju.cjs"),i=require("./match-media-B_0cVVtk.cjs");require("./progress-circle-C_9UZs2Y.cjs");const a=require("./pending-state-A6NrvaQj.cjs");require("./overlay-DAOyrYJL.cjs"),require("./tooltip-BE01O3Sg.cjs");const o=require("./strategies-C6hzAW86.cjs"),s=require("./options-DE7SelUz.cjs");let c=require("lit"),l=require("lit/decorators.js"),u=require("@luzmo/icons"),d=require("lit/directives/if-defined.js"),f=require("lit/directives/class-map.js");var p=(e,t)=>{let n=getComputedStyle(e).getPropertyValue(t);for(;!n&&e.parentElement;)e=e.parentElement,n=getComputedStyle(e).getPropertyValue(t);return n.trim()},m=`:host{font-family:var(--luzmo-select-font-family,var(--select-font-family));font-size:var(--luzmo-select-font-size,var(--select-font-size))}#button{cursor:pointer;-webkit-user-select:none;user-select:none;font-family:var(--luzmo-button-font-family,var(--luzmo-font-family));-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;line-height:var(--luzmo-button-line-height,var(--luzmo-line-height,1.3));text-transform:none;vertical-align:top;-webkit-appearance:button;transition:background var(--luzmo-button-animation-duration,var(--luzmo-animation-duration)) ease-out, border-color var(--luzmo-button-animation-duration,var(--luzmo-animation-duration)) ease-out, color var(--luzmo-button-animation-duration,var(--luzmo-animation-duration)) ease-out, box-shadow var(--luzmo-button-animation-duration,var(--luzmo-animation-duration)) ease-out;justify-content:center;align-items:center;margin:0;-webkit-text-decoration:none;text-decoration:none;display:inline-flex;position:relative;overflow:visible}#button::-moz-focus-inner{border-style:none;padding:0}#button:focus{outline:none}#icon{font-size:var(--luzmo-select-font-size,var(--select-font-size));margin-inline-end:var(--luzmo-select-spacing-text-to-icon,var(--select-spacing-text-to-icon))}@media (forced-colors:active){:host{--highcontrast-select-focus-indicator-color:Highlight;--highcontrast-select-border-color-default:ButtonBorder;--highcontrast-select-border-color-hover:Highlight;--highcontrast-select-border-color-disabled:GrayText;--highcontrast-select-content-color-default:ButtonText;--highcontrast-select-content-color-disabled:GrayText;--highcontrast-select-background-color:ButtonFace}#button:focus-visible{--highcontrast-select-border-color-hover:ButtonText}#button .label,#button:after{forced-color-adjust:none}}#button{box-sizing:border-box;max-inline-size:100%;min-inline-size:calc(var(--select-minimum-width-multiplier) * var(--luzmo-select-button-block-size,var(--select-button-block-size)));block-size:var(--luzmo-select-button-block-size,var(--select-button-block-size));border-width:var(--luzmo-select-button-border-width,var(--select-button-border-width));border-radius:var(--luzmo-select-button-border-radius,var(--select-button-border-radius));box-shadow:var(--luzmo-select-button-box-shadow,var(--select-button-box-shadow));transition:background-color var(--luzmo-select-animation-duration,var(--select-animation-duration)), box-shadow var(--luzmo-select-animation-duration,var(--select-animation-duration)), border-color var(--luzmo-select-animation-duration,var(--select-animation-duration)) ease-in-out;color:var(--highcontrast-select-content-color-default,var(--luzmo-select-font-color-default,var(--select-font-color-default)));background-color:var(--highcontrast-select-background-color,var(--luzmo-select-background-color-default,var(--select-background-color-default)));border-style:solid;border-color:var(--highcontrast-select-border-color-default,var(--luzmo-select-border-color-default,var(--select-border-color-default)));margin-block-start:var(--luzmo-select-spacing-label-to-select,var(--select-spacing-label-to-select));padding-block:0;padding-inline-start:var(--luzmo-select-inline-edge-to-content,var(--select-inline-edge-to-content));padding-inline-end:var(--luzmo-select-spacing-edge-to-disclosure-icon,var(--select-spacing-edge-to-disclosure-icon));display:flex}#button:after{pointer-events:none;content:"";block-size:calc(100% + var(--luzmo-select-focus-indicator-gap,var(--select-focus-indicator-gap)) * 2 + var(--luzmo-select-button-border-width,var(--select-button-border-width)) * 2);inline-size:calc(100% + var(--luzmo-select-focus-indicator-gap,var(--select-focus-indicator-gap)) * 2 + var(--luzmo-select-button-border-width,var(--select-button-border-width)) * 2);border-style:solid;border-width:var(--luzmo-select-focus-indicator-width,var(--select-focus-indicator-width));border-radius:calc(var(--luzmo-select-button-border-radius,var(--select-button-border-radius)) + var(--luzmo-select-focus-indicator-gap,var(--select-focus-indicator-gap)) + var(--luzmo-select-button-border-width,var(--select-button-border-width)));border-color:#0000;margin-block-start:calc((var(--luzmo-select-focus-indicator-gap,var(--select-focus-indicator-gap)) + var(--luzmo-select-focus-indicator-width,var(--select-focus-indicator-width)) + var(--luzmo-select-button-border-width,var(--select-button-border-width))) * -1);margin-inline-start:calc((var(--luzmo-select-focus-indicator-gap,var(--select-focus-indicator-gap)) + var(--luzmo-select-focus-indicator-width,var(--select-focus-indicator-width)) + var(--luzmo-select-button-border-width,var(--select-button-border-width))) * -1);position:absolute;inset-block:0;inset-inline:0}#button:active{background-color:var(--highcontrast-select-background-color,var(--luzmo-select-background-color-active,var(--select-background-color-active)));border-color:var(--highcontrast-select-border-color-default,var(--luzmo-select-border-active,var(--select-border-color-active)))}#button:active:after{border-color:#0000}#button.placeholder:active .label{color:var(--highcontrast-select-content-color-default,var(--luzmo-select-font-color-active,var(--select-font-color-active)))}#button:focus-visible{background-color:var(--highcontrast-select-background-color,var(--luzmo-select-background-color-key-focus,var(--select-background-color-key-focus)));border-color:var(--highcontrast-select-border-color-default,var(--luzmo-select-border-color-key-focus,var(--select-border-color-key-focus)));color:var(--highcontrast-select-content-color-default,var(--luzmo-select-font-color-key-focus,var(--select-font-color-key-focus)));outline:none}#button:focus-visible:after{border-color:var(--highcontrast-select-focus-indicator-color,var(--luzmo-select-focus-indicator-color,var(--select-focus-indicator-color)))}#button.placeholder:focus-visible{color:var(--highcontrast-select-content-color-default,var(--luzmo-select-font-color-key-focus,var(--select-font-color-key-focus)))}#button:focus-visible .disclosure-icon,#button:focus-visible .clear-icon{color:var(--highcontrast-select-content-color-default,var(--luzmo-select-icon-color-key-focus,var(--select-icon-color-key-focus)))}:host([open]) #button:not(:disabled,.is-disabled){color:var(--highcontrast-select-content-color-default,var(--luzmo-select-font-color-default-open,var(--select-font-color-default-open)));background-color:var(--highcontrast-select-background-color,var(--luzmo-select-background-color-default-open,var(--select-background-color-default-open)));border-color:var(--highcontrast-select-border-color-default,var(--luzmo-select-border-default-open,var(--select-border-color-default-open)))}:host([open]) #button:not(:disabled,.is-disabled) .disclosure-icon,:host([open]) #button:not(:disabled,.is-disabled) .clear-icon{color:var(--highcontrast-select-content-color-default,var(--luzmo-select-icon-color-default-open,var(--select-icon-color-default-open)))}:host([invalid]) #button:not(:disabled,.is-disabled){border-color:var(--highcontrast-select-border-color-default,var(--luzmo-select-border-color-error-default,var(--select-border-color-error-default)))}:host([invalid]) #button:not(:disabled,.is-disabled) .validation-icon{color:var(--highcontrast-select-content-color-default,var(--luzmo-select-icon-color-error,var(--select-icon-color-error)))}:host([invalid]) #button:not(:disabled,.is-disabled):active{border-color:var(--highcontrast-select-border-color-default,var(--luzmo-select-border-color-error-active,var(--select-border-color-error-active)))}:host([invalid][open]) #button:not(:disabled,.is-disabled){border-color:var(--highcontrast-select-border-color-default,var(--luzmo-select-border-color-error-default-open,var(--select-border-color-error-default-open)))}:host([invalid]) #button:not(:disabled,.is-disabled):focus-visible{border-color:var(--highcontrast-select-border-color-default,var(--luzmo-select-border-color-error-key-focus,var(--select-border-color-error-key-focus)))}:host([pending]) #button .disclosure-icon,:host([pending]) #button .clear-icon{color:var(--highcontrast-select-content-color-disabled,var(--luzmo-select-icon-color-disabled,var(--select-icon-color-disabled)))}.icon{flex-shrink:0}.label{white-space:nowrap;font-size:var(--luzmo-select-font-size,var(--select-font-size));line-height:var(--luzmo-select-button-line-height,var(--select-button-line-height));font-weight:var(--luzmo-select-font-weight,var(--select-font-weight));text-overflow:ellipsis;text-align:start;flex:auto;overflow:hidden}.label.placeholder{font-weight:var(--luzmo-select-placeholder-font-weight,var(--select-font-weight));font-style:var(--luzmo-select-placeholder-font-style,var(--select-placeholder-font-style));transition:color var(--luzmo-select-animation-duration,var(--select-animation-duration)) ease-in-out;color:var(--highcontrast-select-content-color-default,var(--luzmo-select-font-color-default,var(--select-font-color-default)))}.label.placeholder:active{color:var(--highcontrast-select-content-color-default,var(--luzmo-select-font-color-active,var(--select-font-color-active)))}.clear-icon,.disclosure-icon{vertical-align:top;transition:color var(--luzmo-select-animation-duration,var(--select-animation-duration)) ease-out;color:var(--highcontrast-select-content-color-default,var(--luzmo-select-icon-color-default,var(--select-icon-color-default)));flex-shrink:0;display:inline-block;position:relative}.disclosure-icon{margin-inline-start:var(--luzmo-select-spacing-icon-to-disclosure-icon,var(--select-spacing-icon-to-disclosure-icon))}.clear-icon{margin-inline-start:var(--luzmo-select-spacing-icon-to-clear-icon,var(--select-spacing-icon-to-clear-icon))}.disclosure-icon:active{color:var(--highcontrast-select-content-color-default,var(--luzmo-select-icon-color-active,var(--select-icon-color-active)))}luzmo-progress-circle,.validation-icon{margin-inline-start:var(--luzmo-select-spacing-text-to-icon,var(--select-spacing-text-to-icon))}.icon-container{height:100%;font-size:var(--luzmo-select-disclosure-icon-size,var(--select-disclosure-icon-size));align-items:center;display:flex;position:relative}.icon-container.disclosure-icon{margin-inline-end:0}.label~.disclosure-icon,.label~.clear-icon{margin-inline-start:var(--luzmo-select-spacing-text-to-icon,var(--select-spacing-text-to-icon))}:host([quiet]) #button{inline-size:auto;min-inline-size:0;padding-inline:var(--luzmo-select-inline-edge-to-content-quiet,var(--select-inline-edge-to-content-quiet));color:var(--highcontrast-select-content-color-default,var(--luzmo-select-font-color-default,var(--select-font-color-default)));background-color:initial;background-color:var(--highcontrast-select-background-color,transparent);box-shadow:none;border:none;border-radius:0;margin-block-start:calc(var(--luzmo-select-spacing-label-to-select-quiet,var(--select-spacing-label-to-select-quiet)) + 1px)}:host([quiet]) #button.label-inline{margin-block-start:0}:host([quiet]) #button .disclosure-icon{margin-inline-end:var(--luzmo-select-spacing-edge-to-disclosure-icon-quiet,var(--select-spacing-edge-to-disclosure-icon-quiet))}:host([quiet]) #button:after{border:none;block-size:auto;inline-size:auto}@media (hover:hover){#button:hover{color:var(--highcontrast-select-content-color-default,var(--luzmo-select-font-color-hover,var(--select-font-color-hover)));background-color:var(--highcontrast-select-background-color,var(--luzmo-select-background-color-hover,var(--select-background-color-hover)));border-color:var(--highcontrast-select-border-color-hover,var(--luzmo-select-border-color-hover,var(--select-border-color-hover)))}#button:hover .disclosure-icon,#button:hover .clear-icon{color:var(--highcontrast-select-content-color-default,var(--luzmo-select-icon-color-hover,var(--select-icon-color-hover)))}#button:hover .clear-icon:hover{color:var(--highcontrast-select-content-color-default,var(--luzmo-select-clear-icon-color-hover,var(--select-icon-color-focus)))}:host([open]):not([quiet]) #button:not(:disabled,.is-disabled):hover{color:var(--highcontrast-select-content-color-default,var(--luzmo-select-font-color-hover-open,var(--select-font-color-hover-open)));background-color:var(--highcontrast-select-background-color,var(--luzmo-select-background-color-hover-open,var(--select-background-color-hover-open)));border-color:var(--highcontrast-select-border-color-hover,var(--luzmo-select-border-color-hover-open,var(--select-border-color-hover-open)))}:host([open]) #button:not(:disabled,.is-disabled):hover .disclosure-icon,:host([open]) #button:not(:disabled,.is-disabled):hover .clear-icon{color:var(--highcontrast-select-content-color-default,var(--luzmo-select-icon-color-hover-open,var(--select-icon-color-hover-open)))}:host([invalid]) #button:not(:disabled,.is-disabled):hover{border-color:var(--highcontrast-select-border-color-hover,var(--luzmo-select-border-color-error-hover,var(--select-border-color-error-hover)))}:host([invalid][open]) #button:not(:disabled,.is-disabled):hover{border-color:var(--highcontrast-select-border-color-hover,var(--luzmo-select-border-color-error-hover-open,var(--select-border-color-error-hover-open)))}.label.placeholder:hover{color:var(--highcontrast-select-content-color-default,var(--luzmo-select-font-color-hover,var(--select-font-color-hover)))}:host([quiet]) #button:hover{background-color:initial;background-color:var(--highcontrast-select-background-color,transparent)!important}}:host([quiet]) #button:focus-visible{background-color:initial;background-color:var(--highcontrast-select-background-color,transparent)}:host([quiet]) #button:focus-visible:after{box-shadow:0 var(--luzmo-select-focus-indicator-width,var(--select-focus-indicator-width)) 0 0 var(--highcontrast-select-focus-indicator-color,var(--luzmo-select-focus-indicator-color,var(--select-focus-indicator-color)));margin:calc((var(--luzmo-select-focus-indicator-gap,var(--select-focus-indicator-gap)) + var(--luzmo-select-button-border-width,var(--select-button-border-width))) * -1) 0;border:none;border-radius:0}:host([quiet][open]) #button,:host([quiet][disabled]) #button#button,:host([quiet]) #button#button:disabled,:host([quiet]) #button:active{background-color:initial;background-color:var(--highcontrast-select-background-color,transparent)}.label-inline{vertical-align:top;display:inline-flex}:host([disabled]) #button,#button:disabled{cursor:default;background-color:var(--highcontrast-select-background-color,var(--luzmo-select-background-color-disabled,var(--select-background-color-disabled)));border-color:#0000;border-color:var(--highcontrast-select-border-color-disabled,transparent);color:var(--highcontrast-select-content-color-disabled,var(--luzmo-select-font-color-disabled,var(--select-font-color-disabled)))}:host([disabled]) #button .icon,:host([disabled]) #button .disclosure-icon,:host([disabled]) #button .clear-icon,:host([disabled]) #button .validation-icon,#button:disabled .icon,#button:disabled .disclosure-icon,#button:disabled .clear-icon,#button:disabled .validation-icon{color:var(--highcontrast-select-content-color-disabled,var(--luzmo-select-icon-color-disabled,var(--select-icon-color-disabled)))}:host([disabled]) #button .label.placeholder,#button:disabled .label.placeholder{color:var(--highcontrast-select-content-color-disabled,var(--luzmo-select-font-color-disabled,var(--select-font-color-disabled)))}#popover{max-width:var(--luzmo-select-popover-max-width,var(--select-popover-max-width));min-width:var(--luzmo-select-popover-min-width,var(--select-popover-min-width));width:var(--luzmo-select-popover-width,var(--select-popover-width))}#popover.search-on{padding:0 0 var(--luzmo-popover-content-area-spacing-vertical,var(--popover-content-area-spacing-vertical)) 0!important}#search-container{border-bottom:var(--luzmo-select-search-container-border-bottom-width,var(--select-search-container-border-bottom-width)) solid var(--luzmo-select-search-container-border-bottom-color,var(--select-search-container-border-bottom-color));flex:none;display:flex;position:relative}#search-icon{left:var(--luzmo-select-inline-edge-to-content,var(--select-inline-edge-to-content));color:var(--luzmo-select-search-icon-color,var(--select-search-icon-color));font-size:var(--luzmo-select-search-icon-height,var(--select-search-icon-height));width:var(--luzmo-select-search-icon-width,var(--select-search-icon-width));text-align:center;pointer-events:none;justify-content:center;align-items:center;display:flex;position:absolute;top:0;bottom:0}#search:focus-within+#search-icon,#search:focus+#search-icon{color:var(--luzmo-select-search-icon-color-focus,var(--select-search-icon-color-focus))}#search{box-sizing:border-box;border-top-left-radius:var(--luzmo-popover-border-radius,var(--popover-border-radius));border-top-right-radius:var(--luzmo-popover-border-radius,var(--popover-border-radius));background-color:var(--luzmo-select-search-background-color,var(--select-search-background-color));width:100%;color:var(--luzmo-select-search-color,var(--select-search-color));height:var(--luzmo-select-button-block-size,var(--select-button-block-size));line-height:var(--luzmo-select-button-block-size,var(--select-button-block-size));padding-left:calc(var(--luzmo-select-inline-edge-to-content,var(--select-inline-edge-to-content)) + var(--luzmo-select-spacing-search-icon-to-text,var(--select-spacing-search-icon-to-text)) + var(--luzmo-select-search-icon-width,var(--select-search-icon-width)));padding-right:var(--luzmo-select-inline-edge-to-content,var(--select-inline-edge-to-content));font-size:var(--luzmo-select-font-size,var(--select-font-size));font-family:var(--luzmo-select-font-family,var(--select-font-family));line-height:var(--luzmo-select-button-line-height,var(--select-button-line-height));font-weight:var(--luzmo-select-font-weight,var(--select-font-weight));border:var(--luzmo-select-search-input-border-bottom-width,var(--select-search-input-border-bottom-width)) solid var(--luzmo-select-search-input-border-bottom-color,var(--select-search-input-border-bottom-color));outline:none}#no-results{color:var(--luzmo-select-no-results-color,var(--select-no-results-color));font-style:var(--luzmo-select-no-results-font-style,var(--select-no-results-font-style));height:var(--luzmo-select-no-results-height,var(--select-no-results-height));padding-inline:var(--luzmo-select-no-results-spacing-edge-to-text,var(--select-no-results-spacing-edge-to-text));align-items:center;display:flex}:host{--select-popover-max-width:300px;--select-popover-min-width:160px;--select-font-family:var(--luzmo-font-family);--select-font-size:var(--luzmo-font-size);--select-font-weight:var(--luzmo-font-weight);--select-spacing-search-icon-to-text:calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1));--select-search-icon-height:var(--luzmo-font-size);--select-search-icon-width:var(--luzmo-font-size);--select-search-icon-color:var(--luzmo-disabled-color);--select-search-icon-color-focus:var(--luzmo-font-color);--select-search-color:var(--luzmo-font-color);--select-search-background-color:var(--luzmo-background-color);--select-search-container-border-bottom-width:var(--luzmo-border-width);--select-search-container-border-bottom-color:var(--luzmo-border-color);--select-search-input-border-bottom-width:var(--luzmo-border-width);--select-search-input-border-bottom-color:transparent;--select-background-color-default:var(--luzmo-background-color);--select-background-color-default-open:var(--luzmo-background-color-hover);--select-background-color-active:var(--luzmo-background-color-down);--select-background-color-hover:var(--luzmo-background-color-hover);--select-background-color-hover-open:var(--luzmo-background-color-down);--select-background-color-key-focus:var(--luzmo-background-color-down);--select-border-color-default:var(--luzmo-border-color);--select-border-color-default-open:var(--luzmo-border-color-hover);--select-border-color-hover:var(--luzmo-border-color);--select-border-color-hover-open:var(--luzmo-border-color-hover);--select-border-color-active:var(--luzmo-border-color);--select-border-color-key-focus:var(--luzmo-border-color);--select-button-border-width:var(--luzmo-border-width);--select-placeholder-font-style:var(--luzmo-font-style);--select-button-line-height:var(--luzmo-line-height);--select-button-box-shadow:0px 1px 3px 0px var(--luzmo-shadow-color);--select-button-block-size:var(--luzmo-component-height);--select-button-border-radius:var(--luzmo-border-radius);--select-button-border-radius-reset:0;--select-inline-edge-to-content:calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1));--select-spacing-text-to-icon:calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1));--select-spacing-text-to-icon-inline-end:calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1));--select-spacing-icon-to-disclosure-icon:calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1));--select-spacing-icon-to-clear-icon:var(--select-spacing-icon-to-disclosure-icon);--select-inline-edge-to-content-quiet:0px;--select-spacing-label-to-select:0px;--select-spacing-label-to-select-quiet:calc(-1 * var(--luzmo-spacing-3) + var(--luzmo-spacing-1));--select-spacing-edge-to-disclosure-icon:calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1));--select-spacing-edge-to-disclosure-icon-quiet:0px;--select-animation-duration:var(--luzmo-animation-duration);--select-font-color-default:var(--luzmo-font-color);--select-font-color-default-open:var(--luzmo-font-color-hover);--select-font-color-hover:var(--luzmo-font-color-hover);--select-font-color-hover-open:var(--luzmo-font-color-down);--select-font-color-active:var(--luzmo-font-color-focus);--select-font-color-key-focus:var(--luzmo-font-color-focus);--select-icon-color-default:var(--luzmo-font-color);--select-icon-color-default-open:var(--luzmo-font-color-hover);--select-icon-color-hover:var(--luzmo-font-color-hover);--select-icon-color-hover-open:var(--luzmo-font-color-hover);--select-icon-color-active:var(--luzmo-font-color-focus);--select-icon-color-key-focus:var(--luzmo-font-color-focus);--select-border-color-error-default:var(--luzmo-negative-color);--select-border-color-error-default-open:var(--luzmo-negative-color-down);--select-border-color-error-hover:var(--luzmo-negative-color-hover);--select-border-color-error-hover-open:var(--luzmo-negative-color-down);--select-border-color-error-active:var(--luzmo-negative-color-down);--select-border-color-error-key-focus:var(--luzmo-negative-color-focus);--select-icon-color-error:var(--luzmo-negative-color);--select-background-color-disabled:var(--luzmo-background-color-disabled);--select-font-color-disabled:var(--luzmo-disabled-color);--select-icon-color-disabled:var(--luzmo-disabled-color);--select-focus-indicator-gap:var(--luzmo-indicator-gap);--select-focus-indicator-width:var(--luzmo-indicator-width);--select-focus-indicator-color:var(--luzmo-indicator-color);--select-disclosure-icon-size:var(--luzmo-font-size-s);--select-no-results-height:var(--select-button-block-size);--select-no-results-color:var(--select-font-color-disabled);--select-no-results-font-style:italic;--select-no-results-spacing-edge-to-text:var(--select-inline-edge-to-content)}:host([size=s]){--select-button-block-size:var(--luzmo-component-height-s);--select-font-size:var(--luzmo-font-size-s);--select-search-icon-height:var(--luzmo-font-size-s);--select-search-icon-width:var(--luzmo-font-size-s);--select-popover-max-width:280px;--select-popover-min-width:140px;--select-spacing-search-icon-to-text:var(--luzmo-spacing-3);--select-inline-edge-to-content:var(--luzmo-spacing-3);--select-spacing-text-to-icon:var(--luzmo-spacing-3);--select-spacing-text-to-icon-inline-end:var(--luzmo-spacing-3);--select-spacing-icon-to-disclosure-icon:var(--luzmo-spacing-3);--select-spacing-label-to-select-quiet:calc(-1 * var(--luzmo-spacing-3));--select-spacing-edge-to-disclosure-icon:var(--luzmo-spacing-3);--select-disclosure-icon-size:var(--luzmo-font-size-s)}:host([size=l]){--select-button-block-size:var(--luzmo-component-height-l);--select-font-size:var(--luzmo-font-size-l);--select-search-icon-height:var(--luzmo-font-size-l);--select-search-icon-width:var(--luzmo-font-size-l);--select-popover-max-width:360px;--select-popover-min-width:220px;--select-spacing-search-icon-to-text:var(--luzmo-spacing-4);--select-inline-edge-to-content:var(--luzmo-spacing-4);--select-spacing-text-to-icon:var(--luzmo-spacing-4);--select-spacing-text-to-icon-inline-end:var(--luzmo-spacing-4);--select-spacing-icon-to-disclosure-icon:var(--luzmo-spacing-4);--select-spacing-label-to-select-quiet:calc(-1 * var(--luzmo-spacing-4));--select-spacing-edge-to-disclosure-icon:var(--luzmo-spacing-4);--select-disclosure-icon-size:var(--luzmo-font-size)}:host([size=xl]){--select-button-block-size:var(--luzmo-component-height-xl);--select-font-size:var(--luzmo-font-size-xl);--select-search-icon-height:var(--luzmo-font-size-xl);--select-search-icon-width:var(--luzmo-font-size-xl);--select-popover-max-width:400px;--select-popover-min-width:260px;--select-spacing-search-icon-to-text:calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--select-inline-edge-to-content:calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--select-spacing-text-to-icon:calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--select-spacing-text-to-icon-inline-end:calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--select-spacing-icon-to-disclosure-icon:calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--select-spacing-label-to-select-quiet:calc(-1 * var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--select-spacing-edge-to-disclosure-icon:calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--select-disclosure-icon-size:var(--luzmo-font-size-l)}:host([variant=highlight]) ::slotted(luzmo-option[selected]){--option-highlight-label-content-color:var(--luzmo-primary-inverse-color);--option-label-icon-color-default:var(--luzmo-primary-inverse-color);--menu-checkmark-display:var(--menu-checkmark-display-hidden);background-color:var(--luzmo-option-highlight-label-background-color,var(--option-highlight-label-background-color,var(--luzmo-border-color)));padding-inline-start:var(--luzmo-option-label-inline-edge-to-content,var(--option-label-inline-edge-to-content))}:host{vertical-align:top;max-inline-size:100%;inline-size:var(--luzmo-select-inline-size,var(--select-inline-size));min-inline-size:calc(var(--select-minimum-width-multiplier) * var(--luzmo-select-block-size,var(--select-block-size)));display:inline-flex}:host([quiet]){width:auto;min-width:0}:host([disabled]){pointer-events:none}#button{width:100%;min-width:100%;max-width:100%}#icon:not([hidden]){display:inline-flex}:host([readonly]) #button{user-select:inherit}.validation-icon{flex-shrink:0}luzmo-overlay{pointer-events:none}luzmo-options{pointer-events:initial}:host>#no-results,:host>luzmo-options{display:none}:host([focused]:not([quiet])) #button #label.placeholder{color:var(--select-placeholder-text-color-key-focus,var(--alias-placeholder-text-color-hover))}.visually-hidden{clip:rect(0, 0, 0, 0);clip-path:inset(50%);white-space:nowrap;border:0;width:1px;height:1px;margin:0 -1px -1px 0;padding:0;position:absolute;overflow:hidden}luzmo-overlay:not(:defined){display:none}#button.remove-focus-ring-safari-hack:focus-visible{background-color:var(--highcontrast-select-background-color,var(--luzmo-select-background-color-default,var(--select-background-color-default)));border-color:var(--highcontrast-select-border-color-default,var(--luzmo-select-border-color-default,var(--select-border-color-default)));color:var(--highcontrast-select-content-color-default,var(--luzmo-select-font-color-default,var(--select-font-color-default)))}#button.remove-focus-ring-safari-hack:after{border:none}#button.remove-focus-ring-safari-hack:focus-visible:after{box-shadow:none}#button.remove-focus-ring-safari-hack:active{background-color:var(--highcontrast-select-background-color,var(--luzmo-select-background-color-default,var(--select-background-color-default)));border-color:var(--highcontrast-select-border-color-default,var(--luzmo-select-border-color-default,var(--select-border-color-default)));color:var(--highcontrast-select-content-color-default,var(--luzmo-select-font-color-default,var(--select-font-color-default)))}`,h=()=>c.html`
19
- <div class="disclosure-icon icon">
20
- ${(0,u.luzmoIcon)(u.luzmoAngleDown,{className:`indicator`})}
21
- </div>
22
- `,g=()=>c.html`
23
- <div class="icon-container validation-icon icon">
24
- ${(0,u.luzmoIcon)(u.luzmoAlert)}
25
- </div>
26
- `,_=()=>c.html`
27
- <div class="icon-container search-icon icon" id="search-icon">
28
- ${(0,u.luzmoIcon)(u.luzmoSearch)}
29
- </div>
30
- `,v=`select-option-menu`,y=class extends t.n(n.t,{noDefaultSize:!0}){static get styles(){return[(0,c.unsafeCSS)(m)]}get selfManageFocusElement(){return this._selfManageFocusElement}constructor(){super(),this.disabled=!1,this.focused=!1,this.variant=`checkmarks`,this.emphasized=!1,this.invalid=!1,this.search=`auto`,this.noWrap=!1,this.retrieving=!1,this.pending=!1,this.clearable=!1,this.hideDropdownIcon=!1,this.pendingLabel=`Pending`,this.searchLabel=`Search`,this.noResultsLabel=`No results`,this.noDataLabel=`No data`,this.multipleLabelTemplate=`Selected {count} items`,this.label=`Select`,this.open=!1,this.readonly=!1,this.placement=`bottom-end`,this.quiet=!1,this.value=[],this.options=[],this.selects=`multiple`,this.dependencyManager=new r.t(this),this.isMobile=new i.r(this,i.t),this.listRole=`listbox`,this.itemRole=`option`,this.hasRenderedOverlay=!1,this._selfManageFocusElement=!1,this.selectionPromise=Promise.resolve(),this.enterKeydownOn=null,this._selectedOptions=[],this.handleSlottableRequest=e=>{},this.renderAngleIcon=()=>h(),this.renderAlertIcon=()=>g(),this._popoverDependencyRegistered=!1,this.handleEnterKeydown=e=>{e.code===`Enter`&&(this.enterKeydownOn?e.preventDefault():(this.enterKeydownOn=e.target,this.addEventListener(`keyup`,e=>{e.code===`Enter`&&(this.enterKeydownOn=null)},{once:!0})))},this.clearValue=e=>{e.preventDefault(),e.stopPropagation(),this.value=[],this.strategy&&(this.strategy.preventNextToggle=`no`),this.open=!1,this.strategy&&(this.strategy.open=!1),this.dispatchEvent(new CustomEvent(`change`,{bubbles:!0,cancelable:!0,composed:!0,detail:{value:this.value??[]}}))},this.handleEscape=e=>{e.code===`Escape`&&this.open&&(e.stopPropagation(),e.preventDefault(),this.toggle(!1))},this.handleKeydown=e=>{let{code:t}=e;if(t===`Escape`)this.handleEscape(e);else if([`Delete`,`Backspace`].includes(t))this.clearValue(e);else if(this.focused=!0,!(!t.startsWith(`Arrow`)||this.readonly||this.pending)){if(t===`ArrowUp`||t===`ArrowDown`)this.toggle(!0),e.preventDefault();else if(e.preventDefault(),this.selects===`single`){let e=t===`ArrowRight`?1:-1,n=this.options.findIndex(e=>e?.value?.toString()===this.value?.[0]?.toString()),r=(this.options.length+n+e)%this.options.length,i=this.options.length;for(;(this.options?.[r]?.disabled||s.r(this.options?.[r]))&&i;)--i,r=(this.options.length+r+e)%this.options.length;let a=this.options[r];if(a?.disabled||s.r(a))return;this.value=[a.value??null],this.dispatchEvent(new CustomEvent(`change`,{bubbles:!0,cancelable:!0,composed:!0,detail:{value:this.value??[]}}))}}},this.pendingStateController=new a.t(this)}get focusElement(){return this.open?this.search===`on`||this.search===`auto`&&this.options?.length>20?this.searchInput:this.optionsMenu:this.button}forceFocusVisible(){this.disabled||(this.focused=!0)}click(){this.disabled||this.toggle()}handleButtonBlur(){this.focused=!1}focus(e){super.focus(e),!this.disabled&&this.focusElement&&(this.focused=this.hasVisibleFocusInTree())}handleHelperFocus(){this.focused=!0,this.button.focus()}handleChange(e){let t=e?.detail?.value??[];JSON.stringify(this.value)!==JSON.stringify(t)&&(this.value=t),this.strategy&&(this.strategy.preventNextToggle=`no`),e.stopPropagation(),e.cancelable&&this.selects!==`single`||(this.open=!1,this.strategy&&(this.strategy.open=!1)),e.preventDefault(),this.dispatchEvent(new CustomEvent(`change`,{bubbles:!0,cancelable:!0,composed:!0,detail:{value:this.value??[]}}))}handleButtonFocus(e){this.strategy?.handleButtonFocus(e)}toggle(e){this.readonly||this.pending||(this.open=e===void 0?!this.open:e,this.strategy&&(this.strategy.open=this.open),this._selfManageFocusElement=this.open)}close(){this.readonly||this.strategy&&(this.open=!1,this.strategy.open=!1)}bindEvents(){this.strategy?.abort(),this.strategy=new o.t.desktop(this.button,this),this.strategy?.overlay&&(this.strategy.overlay.type=`auto`,this.strategy.overlay.placement=this.placement)}connectedCallback(){super.connectedCallback(),this.ensurePopoverDependency()}disconnectedCallback(){this.close(),this.strategy?.releaseDescription(),super.disconnectedCallback()}handleTooltipSlotchange(e){this.tooltipEl=e.target.assignedElements()[0]}get labelTemplate(){let e=this._selectedOptions?.length===1&&this._selectedOptions[0]?.icon,t=c.html`<div
31
- id="icon"
32
- ?hidden=${typeof this.icons==`string`||this.value?.length>1||!e}
33
- >
34
- ${e?(0,u.luzmoIcon)(this._selectedOptions[0].icon):c.nothing}
35
- </div>`,n=e=>e.replaceAll(/{([^}]+)}/g,(e,t)=>t===`count`?String(this.value?.length):e),r={"visually-hidden":this.icons===`only`&&this.value?.length>0,placeholder:!this.value?.length,label:!0},i;i=this.value?.length?this.value.length===1?c.html`<span
36
- >${this._selectedOptions?.[0]?.shortLabel??this._selectedOptions?.[0]?.label??this.value?.[0]}</span
37
- >`:c.html`<span
38
- >${n(this.multipleLabelTemplate)}</span
39
- >`:c.html`
40
- <slot name="label" id="label">
41
- <span aria-hidden="true"> ${this.label} </span>
42
- </slot>
43
- `;let a=this.value?.length?c.html`
44
- <div aria-hidden="true" class="visually-hidden" id="applied-label">
45
- ${this.label}
46
- <slot name="label"></slot>
47
- </div>
48
- `:c.html` <span hidden id="applied-label">${this.label}</span> `;return[c.html`
49
- ${this.value?.length===1?t:c.nothing}
50
- <div
51
- id=${(0,d.ifDefined)(this.value?.length?`label`:void 0)}
52
- class=${(0,f.classMap)(r)}
53
- >
54
- ${i}
55
- </div>
56
- ${a}
57
- ${this.invalid&&!this.pending?c.html` ${this.renderAlertIcon()} `:c.nothing}
58
- ${this.pendingStateController.renderPendingState()}
59
- ${this.clearable&&!this.readonly&&this.value?.length>0?c.html`
60
- <div class="icon-container clear-icon icon" @click=${this.clearValue}>
61
- ${(0,u.luzmoIcon)(u.luzmoClose14)}
62
- </div>
63
- `:c.nothing}
64
- ${this.readonly||this.hideDropdownIcon?c.nothing:this.renderAngleIcon()}
65
- <slot
66
- aria-hidden="true"
67
- name="tooltip"
68
- id="tooltip"
69
- @slotchange=${this.handleTooltipSlotchange}
70
- ></slot>
71
- `]}update(e){e.has(`disabled`)&&this.disabled&&this.strategy&&(this.open=!1,this.strategy.open=!1),e.has(`pending`)&&this.pending&&this.strategy&&(this.open=!1,this.strategy.open=!1),super.update(e)}bindButtonKeydownListener(){this.button.addEventListener(`keydown`,this.handleKeydown)}willUpdate(e){let t=e.has(`open`),n=e.has(`value`),r=e.has(`options`),i=e.has(`selects`),a=e.get(`open`);i&&this.selects===`single`&&this.value?.length>1&&(console.warn(`luzmo-select is being set to a single value given the selects property changed to 'single'`),this.value=this.value.slice(0,1)),t&&a===!1&&this.open&&this.searchString&&(this.searchString=``),(n||r)&&this.setSelectedOptionsFromValue()}updated(e){super.updated(e);let t=e.has(`options`),n=e.has(`open`),r=e.has(`placement`);if(n&&(this.strategy.open=this.open,this.open===!1&&this.optionsMenu.scrollToTop()),t){let e=this.options?.length??0;for(let t of this.options??[])t.children?.length&&(e+=t.children.length);if(e>25){let e=(e,t=e.label)=>(t?.length??0)+(e.children?.length?0:e.shortcut?.length??0),t=this.options[0];for(let n of this.options)e(n)>e(t)&&(t=n);for(let n of this.options)if(n.children?.length)for(let r of n.children){let i=`${n.label} (${r.label})`;e(r,i)>e(t)&&(t={...r,label:i})}this._estimatePopoverWidth(t)}else this.style.removeProperty(`--select-popover-width`)}this.strategy?.overlay&&(this.strategy.overlay.type!==`auto`&&(this.strategy.overlay.type=`auto`),(r||this.strategy.overlay.type===`auto`)&&(this.strategy.overlay.placement=this.placement))}firstUpdated(e){super.firstUpdated(e),this.bindButtonKeydownListener(),this.bindEvents()}_getCssVarInPixels(e){let t=p(this,e),n;if(t.endsWith(`rem`)){let e=Number.parseFloat(getComputedStyle(document.documentElement).fontSize);n=Number.parseFloat(t)*e}else if(t.endsWith(`em`)){let e=Number.parseFloat(getComputedStyle(this).fontSize);n=Number.parseFloat(t)*e}else n=Number.parseFloat(t);return n>=0?n:void 0}_estimatePopoverWidth(e){let t=this._getCssVarInPixels(`--luzmo-select-font-size`)??this._getCssVarInPixels(`--select-font-size`),n=this._getCssVarInPixels(`--luzmo-select-popover-min-width`)??this._getCssVarInPixels(`--select-popover-min-width`),r=this._getCssVarInPixels(`--luzmo-spacing-5`),i=document.createElement(`luzmo-options`);i.style.setProperty(`--luzmo-select-font-size`,`${t}px`),i.options=[e],i.value=[e.value??null],i.variant=this.variant,i.size=this.size,i.style.position=`absolute`,i.style.left=`-9999px`,i.style.top=`-9999px`,i.style.opacity=`0`,i.style.width=`auto`,document.body.append(i),i.updateComplete.then(()=>{let e=i.offsetWidth+(r??0);return e>(n??0)?this.style.setProperty(`--select-popover-width`,`${e}px`):this.style.removeProperty(`--select-popover-width`),i.remove(),e}).catch(e=>{console.error(e),i.remove()})}get dismissHelper(){return c.html`
72
- <div class="visually-hidden">
73
- <button
74
- tabindex="-1"
75
- aria-label="Dismiss"
76
- @click=${this.close}
77
- ></button>
78
- </div>
79
- `}render(){return this.tooltipEl&&(this.tooltipEl.disabled=this.open),c.html`
80
- <span
81
- id="focus-helper"
82
- tabindex=${this.focused||this.open?`-1`:`0`}
83
- @focus=${this.handleHelperFocus}
84
- aria-describedby=${v}
85
- ></span>
86
- <button
87
- aria-controls=${(0,d.ifDefined)(this.open?`menu`:void 0)}
88
- aria-describedby="tooltip"
89
- aria-expanded=${this.open?`true`:`false`}
90
- aria-haspopup="true"
91
- aria-labelledby="loader icon label applied-label"
92
- id="button"
93
- class=${(0,d.ifDefined)(this.labelAlignment?`label-${this.labelAlignment}`:void 0)}
94
- @blur=${this.handleButtonBlur}
95
- @keydown=${{handleEvent:this.handleEnterKeydown,capture:!0}}
96
- ?disabled=${this.disabled}
97
- tabindex="-1"
98
- >
99
- ${this.labelTemplate}
100
- </button>
101
- ${this.renderMenu} ${this.renderDescriptionSlot}
102
- `}get renderDescriptionSlot(){return c.html`
103
- <div id=${v}>
104
- <slot name="description"></slot>
105
- </div>
106
- `}setSelectedOptionsFromValue(){let e=[];for(let t of this.options){let n=t?.value;!t.children?.length&&this.value?.includes(n??null)&&e.push(t);for(let n of t.children??[]){let r=n?.value;this.value?.includes(r??null)&&e.push({...n,label:`${t.label} (${n.label})`})}}this._selectedOptions=e}renderSearchInput(){return c.html`
107
- <div id="search-container">
108
- <input
109
- type="text"
110
- id="search"
111
- .placeholder=${this.searchLabel}
112
- @input=${this.handleSearchInput}
113
- @keydown=${this.handleSearchKeydown}
114
- .value=${this.searchString??``}
115
- .aria-label=${this.searchLabel}
116
- autocomplete="off"
117
- tabindex="0"
118
- role="searchbox"
119
- />
120
- ${_()}
121
- </div>
122
- `}filterOptions(){let e=this.searchString?.toLowerCase()??``,t=this.options.filter(t=>s.r(t)?!0:!!(typeof t==`string`?t:t?.label)?.toString()?.toLowerCase()?.includes(e));if(!e)return t;let n=t.filter((e,n)=>{if(!s.r(e))return!0;for(let e of t.slice(n+1)){if(e?.header)return!1;if(!s.r(e))return!0}return!1});return n.filter((e,t)=>!e?.divider||t>0&&!n[t-1]?.divider)}get renderMenu(){let e=this.filterOptions(),t=e.some(e=>!s.r(e)),n=c.html`
123
- <luzmo-options
124
- .variant=${this.variant}
125
- aria-labelledby="applied-label"
126
- id="menu"
127
- ?emphasized=${this.emphasized}
128
- .selects=${this.selects??`multiple`}
129
- .options=${e}
130
- .value=${this.value}
131
- .optionIconRenderer=${this.optionIconRenderer}
132
- ?pending=${this.retrieving}
133
- ?no-wrap=${this.noWrap}
134
- @change=${this.handleChange}
135
- @keydown=${{handleEvent:this.handleEnterKeydown,capture:!0}}
136
- @luzmo-scrolled=${this.handleScrolled}
137
- @luzmo-exceeded-top=${this.handleExceededTop}
138
- role=${this.listRole}
139
- size=${this.size}
140
- tabindex="0"
141
- >
142
- </luzmo-options>
143
- ${!t&&!this.retrieving&&!this.pending?c.html`<div id="no-results">
144
- ${this.searchString?this.noResultsLabel:this.noDataLabel}
145
- </div>`:c.nothing}
146
- `;return this.hasRenderedOverlay=this.hasRenderedOverlay||this.focused||this.open,this.hasRenderedOverlay?(this.dependencyManager.loaded&&this.dependencyManager.add(`luzmo-overlay`),this.renderOverlay(n)):n}renderOverlay(e){if(this.strategy?.overlay===void 0)return e;let t=this.renderContainer(e);return(0,c.render)(t,this.strategy?.overlay,{host:this}),this.strategy?.overlay}ensurePopoverDependency(){this._popoverDependencyRegistered||(this._popoverDependencyRegistered=!0,this.dependencyManager.add(`luzmo-popover`))}renderContainer(e){let t=this.search===`on`||this.searchString&&this.searchString?.length>0||this.search===`auto`&&this.options?.length>20,n=t?this.renderSearchInput():c.nothing,r=c.html`
147
- ${n} ${this.dismissHelper} ${e} ${this.dismissHelper}
148
- `;return c.html`
149
- <luzmo-popover
150
- class=${(0,d.ifDefined)(t?`search-on`:void 0)}
151
- id="popover"
152
- size=${this.size}
153
- role="presentation"
154
- placement=${this.placement}
155
- >
156
- ${r}
157
- </luzmo-popover>
158
- `}async getUpdateComplete(){let e=await super.getUpdateComplete();return await this.selectionPromise,this.overlayElement&&await this.overlayElement.updateComplete,e}handleScrolled(e){e.stopPropagation(),e.preventDefault(),this.dispatchEvent(new CustomEvent(`luzmo-scrolled`,{bubbles:!0,composed:!0,cancelable:!0,detail:{first:e?.detail?.first,last:e?.detail?.last}}))}handleExceededTop(e){e.preventDefault(),e.stopPropagation(),this.searchInput?this.searchInput.focus():this.toggle(!1)}handleSearchInput(e){let t=e.target.value;t!==this.searchString&&(this.searchString=t,this.dispatchEvent(new CustomEvent(`luzmo-search`,{bubbles:!0,composed:!0,cancelable:!0,detail:{string:this.searchString}})))}handleSearchKeydown(e){e.code===`Escape`?this.searchString?this.searchString=``:this.handleEscape(e):e.code===`ArrowDown`?(this.optionsMenu.focus(),e.preventDefault(),e.stopPropagation()):e.code===`ArrowUp`&&this.toggle(!1)}};e.t([(0,l.query)(`#button`)],y.prototype,`button`,void 0),e.t([(0,l.property)({type:Boolean,reflect:!0})],y.prototype,`disabled`,void 0),e.t([(0,l.property)({type:Boolean,reflect:!0})],y.prototype,`focused`,void 0),e.t([(0,l.property)({type:String,reflect:!0})],y.prototype,`icons`,void 0),e.t([(0,l.property)({type:String,reflect:!0})],y.prototype,`variant`,void 0),e.t([(0,l.property)({type:Boolean,reflect:!0})],y.prototype,`emphasized`,void 0),e.t([(0,l.property)({type:Boolean,reflect:!0})],y.prototype,`invalid`,void 0),e.t([(0,l.property)({type:String,reflect:!0})],y.prototype,`search`,void 0),e.t([(0,l.property)({type:Boolean,reflect:!0,attribute:`no-wrap`})],y.prototype,`noWrap`,void 0),e.t([(0,l.property)({type:Boolean,reflect:!0})],y.prototype,`retrieving`,void 0),e.t([(0,l.property)({type:Boolean,reflect:!0})],y.prototype,`pending`,void 0),e.t([(0,l.property)({type:Boolean,reflect:!0})],y.prototype,`clearable`,void 0),e.t([(0,l.property)({type:Boolean,reflect:!0,attribute:`hide-dropdown-icon`})],y.prototype,`hideDropdownIcon`,void 0),e.t([(0,l.property)({type:String,attribute:`pending-label`})],y.prototype,`pendingLabel`,void 0),e.t([(0,l.property)({type:String,attribute:`search-label`})],y.prototype,`searchLabel`,void 0),e.t([(0,l.property)({type:String,attribute:`no-results-label`})],y.prototype,`noResultsLabel`,void 0),e.t([(0,l.property)({type:String,attribute:`no-data-label`})],y.prototype,`noDataLabel`,void 0),e.t([(0,l.property)({type:String,attribute:`multiple-label-template`,reflect:!0})],y.prototype,`multipleLabelTemplate`,void 0),e.t([(0,l.property)({type:String,reflect:!0})],y.prototype,`label`,void 0),e.t([(0,l.property)({type:Boolean,reflect:!0})],y.prototype,`open`,void 0),e.t([(0,l.property)({type:Boolean,reflect:!0})],y.prototype,`readonly`,void 0),e.t([(0,l.state)()],y.prototype,`labelAlignment`,void 0),e.t([(0,l.state)()],y.prototype,`displayLabelContent`,void 0),e.t([(0,l.state)()],y.prototype,`searchString`,void 0),e.t([(0,l.query)(`luzmo-options`)],y.prototype,`optionsMenu`,void 0),e.t([(0,l.query)(`#search`)],y.prototype,`searchInput`,void 0),e.t([(0,l.query)(`luzmo-overlay`)],y.prototype,`overlayElement`,void 0),e.t([(0,l.property)({type:String,reflect:!0})],y.prototype,`placement`,void 0),e.t([(0,l.property)({type:Boolean,reflect:!0})],y.prototype,`quiet`,void 0),e.t([(0,l.property)({type:Array,hasChanged(e,t){return JSON.stringify(e??[])!==JSON.stringify(t??[])},converter:{fromAttribute:e=>{if(!e||e===``)return[];try{return JSON.parse(e)}catch{return[]}},toAttribute:e=>JSON.stringify(e)}})],y.prototype,`value`,void 0),e.t([(0,l.property)({type:Array,hasChanged(e,t){return JSON.stringify(e??[])!==JSON.stringify(t??[])}})],y.prototype,`options`,void 0),e.t([(0,l.property)({attribute:!1})],y.prototype,`optionIconRenderer`,void 0),e.t([(0,l.property)({type:String,reflect:!0})],y.prototype,`selects`,void 0),customElements.get(`luzmo-select`)||customElements.define(`luzmo-select`,y),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return y}});
@@ -1,89 +0,0 @@
1
-
2
- import"../tokens.js";import{c as e,i as t,n,o as r,y as i}from"./lit-DWANyjiY.js";import{a,c as o,g as s,h as c,l,n as u,r as d,t as f,u as p,v as m,y as h}from"./lucero-runtime-DMlHjBe_.js";import{t as g}from"./luzmoAngleRight-B-rZQuxv.js";import{t as _}from"./luzmoCheckHeavy-JAzxJeXk.js";import{t as v}from"./luzmo-icon-markup-DaKoHMY8.js";import"./icon-D69mOw1X.js";import{t as y}from"./random-id-0GBXy8EY.js";import{t as b}from"./observe-slot-presence-BxmG6A0m.js";import{r as x,t as S}from"./directive-Du_3lDov.js";import"./progress-circle-CFtVq9Ou.js";import{t as C}from"./divider.module-sYekRHno.js";import{t as w}from"./async-directive-ByLzVnWY.js";import"./async-directive-DNgXlN7F.js";import"./property-BsDbx7Z2.js";import{t as T}from"./repeat-CtNle5_O.js";var ee={icon:[32,32,`M7 0C3.14 0 0 3.14 0 7v18c0 3.86 3.14 7 7 7h18a7 7 0 0 0 7-7V7c0-3.86-3.14-7-7-7zm18 8a2 2 0 0 1 1.41.59 2 2 0 0 1 0 2.82l-12 12a2 2 0 0 1-2.83 0l-5.99-6a2 2 0 0 1 0-2.82 2 2 0 0 1 2.83 0L13 19.17 23.6 8.6A2 2 0 0 1 25 8Z`],name:`checkbox-checked`},E={icon:[32,32,`M7 0a7 7 0 0 0-7 7v18a7 7 0 0 0 7 7h18a7 7 0 0 0 7-7V7a7 7 0 0 0-7-7zm0 2h18c2.79 0 5 2.22 5 5v18c0 2.79-2.21 5-5 5H7c-2.78 0-5-2.21-5-5V7c0-2.78 2.22-5 5-5z`],name:`checkbox`},D=`#icon{height:var(--luzmo-option-icon-container-height,var(--option-icon-container-height));min-height:var(--luzmo-option-icon-size,var(--option-icon-height));color:var(--highcontrast-option-color-default,var(--luzmo-option-label-icon-color-default,var(--option-label-icon-color-default)));grid-area:iconArea;justify-content:center;align-self:start;align-items:center;display:flex}::slotted([slot=icon]){fill:var(--highcontrast-option-color-default,var(--luzmo-option-label-icon-color-default,var(--option-label-icon-color-default)));block-size:var(--luzmo-option-icon-size,var(--option-icon-height));inline-size:var(--luzmo-option-icon-width,var(--option-icon-width));font-size:var(--luzmo-option-icon-size,var(--option-icon-height));border-radius:var(--luzmo-option-icon-border-radius,0);border-width:var(--luzmo-option-icon-border-width,0);border-style:var(--luzmo-option-icon-border-style,solid);border-color:var(--luzmo-option-icon-border-color,transparent);text-align:center;--luzmo-icon-vertical-align:0;--luzmo-icon-img-object-fit:var(--luzmo-option-icon-object-fit,var(--option-icon-object-fit,fill));--luzmo-icon-img-object-position:var(--luzmo-option-icon-object-position,var(--option-icon-object-position,50% 50%));justify-content:center;align-items:center;margin-inline-end:max(var(--luzmo-option-label-text-to-visual,var(--option-label-text-to-visual)), var(--luzmo-option-icon-size,var(--option-icon-height)) * .35);display:flex;overflow:hidden}::slotted([slot=icon][data-option-thumbnail]){border-radius:var(--luzmo-option-thumbnail-border-radius,var(--luzmo-option-icon-border-radius,var(--luzmo-border-radius-s,4px)));border-width:var(--luzmo-option-thumbnail-border-width,1px);border-style:var(--luzmo-option-thumbnail-border-style,solid);border-color:var(--luzmo-option-thumbnail-border-color,var(--luzmo-option-icon-border-color,var(--luzmo-border-color-full,var(--luzmo-border-color,#0000001f))))}:host{cursor:pointer;box-sizing:border-box;background-color:var(--highcontrast-option-background-color-default,var(--luzmo-option-background-color-default,var(--option-background-color-default)));line-height:var(--luzmo-option-label-line-height,var(--option-label-line-height));min-block-size:max(var(--luzmo-option-min-height,var(--option-min-height)), var(--luzmo-option-icon-size,var(--option-icon-height)) + var(--luzmo-option-top-edge-to-text,var(--option-top-edge-to-text)) + var(--luzmo-option-bottom-edge-to-text,var(--option-bottom-edge-to-text)));padding-block-start:var(--luzmo-option-top-edge-to-text,var(--option-top-edge-to-text));padding-block-end:var(--luzmo-option-bottom-edge-to-text,var(--option-bottom-edge-to-text));padding-inline:var(--luzmo-option-label-inline-edge-to-content,var(--option-label-inline-edge-to-content));outline:none;flex-shrink:0;grid-template:". .headingIconArea sectionHeadingArea. .""selectedArea checkArea iconArea labelArea valueArea actionsArea"1fr". . .descriptionArea. ."". . . . . ."/auto auto auto 1fr auto auto;justify-content:start;align-items:center;margin:0;-webkit-text-decoration:none;text-decoration:none;display:grid;position:relative}:host:focus-visible{outline:none}#label{grid-area:submenuItemLabelArea}.checkmark,.checkbox{opacity:1;grid-area:checkArea;align-self:start;display:block}.checkmark{font-size:var(--luzmo-option-checkmark-size,var(--option-checkmark-size));fill:var(--highcontrast-options-checkmark-icon-color-default,var(--luzmo-options-checkmark-icon-color-default,var(--options-checkmark-icon-color-default)));color:var(--highcontrast-options-checkmark-icon-color-default,var(--luzmo-options-checkmark-icon-color-default,var(--options-checkmark-icon-color-default)));margin-block-start:calc(var(--luzmo-option-top-to-checkmark,var(--option-top-to-checkmark)) - var(--luzmo-option-top-edge-to-text,var(--option-top-edge-to-text)));margin-inline-end:var(--luzmo-option-text-to-control,var(--option-label-text-to-control))}.checkbox{font-size:var(--luzmo-option-checkbox-size,var(--option-checkbox-size));fill:var(--highcontrast-options-checkbox-icon-color-default,var(--luzmo-options-checkbox-icon-color-default,var(--options-checkbox-icon-color-default)));color:var(--highcontrast-options-checkbox-icon-color-default,var(--luzmo-options-checkbox-icon-color-default,var(--options-checkbox-icon-color-default)));margin-block-start:calc(var(--luzmo-option-top-to-checkbox,var(--option-top-to-checkbox)) - var(--luzmo-option-top-edge-to-text,var(--option-top-edge-to-text)));margin-inline-end:var(--luzmo-option-text-to-control,var(--option-label-text-to-control))}::slotted([slot=value]){grid-area:submenuItemValueArea}:host([focused]){background-color:var(--highcontrast-option-background-color-focus,var(--luzmo-option-background-color-key-focus,var(--option-background-color-key-focus)));outline:none}:host([focused])>#label,:host(:focus)>#label{color:var(--highcontrast-option-color-focus,var(--luzmo-option-label-content-color-focus,var(--option-label-content-color-focus)))}:host([focused])>[name=description]::slotted(*),:host(:focus)>[name=description]::slotted(*){color:var(--highcontrast-option-color-focus,var(--luzmo-option-description-color-focus,var(--option-description-color-focus)))}:host([focused])>::slotted([slot=value]),:host(:focus)>::slotted([slot=value]){color:var(--highcontrast-option-color-focus,var(--luzmo-option-value-color-focus,var(--option-value-color-focus)))}:host([focused])>.icon:not(.checkmark,.checkbox),:host(:focus)>.icon:not(.checkmark,.checkbox){fill:var(--highcontrast-option-color-focus,var(--luzmo-option-label-icon-color-focus,var(--option-label-icon-color-focus)));color:var(--highcontrast-option-color-focus,var(--luzmo-option-label-icon-color-focus,var(--option-label-icon-color-focus)))}:host([focused])>.checkmark,:host(:focus)>.checkmark{fill:var(--highcontrast-option-color-focus,var(--luzmo-options-checkmark-icon-color-focus,var(--options-checkmark-icon-color-focus)));color:var(--highcontrast-option-color-focus,var(--luzmo-options-checkmark-icon-color-focus,var(--options-checkmark-icon-color-focus)))}:host([focused])>.checkbox,:host(:focus)>.checkbox{fill:var(--highcontrast-option-color-focus,var(--luzmo-options-checkbox-icon-color-focus,var(--options-checkbox-icon-color-focus)));color:var(--highcontrast-option-color-focus,var(--luzmo-options-checkbox-icon-color-focus,var(--options-checkbox-icon-color-focus)))}:is(:host:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)),:host([dir=rtl])){--option-focus-indicator-direction-scalar:-1}:host(:is(:active,[active])){background-color:var(--highcontrast-option-background-color-focus,var(--luzmo-option-background-color-down,var(--option-background-color-down)))}:host(:is(:active,[active]))>#label{color:var(--highcontrast-option-color-focus,var(--luzmo-option-label-content-color-down,var(--option-label-content-color-down)))}:host(:is(:active,[active]))>[name=description]::slotted(*){color:var(--highcontrast-option-color-focus,var(--luzmo-option-description-color-down,var(--option-description-color-down)))}:host(:is(:active,[active]))>::slotted([slot=value]){color:var(--highcontrast-option-color-focus,var(--luzmo-option-value-color-down,var(--option-value-color-down)))}:host(:is(:active,[active]))>.icon:not(.checkmark,.checkbox){fill:var(--highcontrast-option-color-focus,var(--luzmo-option-label-icon-color-down,var(--option-label-icon-color-down)));color:var(--highcontrast-option-color-focus,var(--luzmo-option-label-icon-color-down,var(--option-label-icon-color-down)))}:host(:is(:active,[active]))>.checkmark{fill:var(--highcontrast-option-color-focus,var(--luzmo-options-checkmark-icon-color-down,var(--options-checkmark-icon-color-down)));color:var(--highcontrast-option-color-focus,var(--luzmo-options-checkmark-icon-color-down,var(--options-checkmark-icon-color-down)))}:host(:is(:active,[active]))>.checkbox{fill:var(--highcontrast-option-color-focus,var(--luzmo-options-checkbox-icon-color-down,var(--options-checkbox-icon-color-down)));color:var(--highcontrast-option-color-focus,var(--luzmo-options-checkbox-icon-color-down,var(--options-checkbox-icon-color-down)))}:host([disabled]),:host([aria-disabled=true]){background-color:initial}:host([disabled]) #label,:host([disabled]) ::slotted([slot=value]),:host([aria-disabled=true]) #label,:host([aria-disabled=true]) ::slotted([slot=value]){color:var(--highcontrast-option-color-disabled,var(--luzmo-option-label-content-color-disabled,var(--option-label-content-color-disabled)))}:host([disabled]) [name=description]::slotted(*),:host([aria-disabled=true]) [name=description]::slotted(*){color:var(--highcontrast-option-color-disabled,var(--luzmo-option-description-color-disabled,var(--option-description-color-disabled)))}:host([disabled]) ::slotted([slot=icon]),:host([aria-disabled=true]) ::slotted([slot=icon]){color:var(--highcontrast-option-color-disabled,var(--luzmo-option-label-icon-color-disabled,var(--option-label-icon-color-disabled)));fill:var(--highcontrast-option-color-disabled,var(--luzmo-option-label-icon-color-disabled,var(--option-label-icon-color-disabled)))}:host([focused]){box-shadow:inset calc(var(--luzmo-option-focus-indicator-width,var(--option-focus-indicator-width)) * 1) 0 0 0 var(--highcontrast-option-focus-indicator-color,var(--luzmo-option-focus-indicator-color,var(--option-focus-indicator-color)));box-shadow:inset calc(var(--luzmo-option-focus-indicator-width,var(--option-focus-indicator-width)) * var(--option-focus-indicator-direction-scalar,1)) 0 0 0 var(--highcontrast-option-focus-indicator-color,var(--luzmo-option-focus-indicator-color,var(--option-focus-indicator-color)))}#label{font-size:var(--luzmo-option-label-font-size,var(--option-label-font-size));color:var(--highcontrast-option-color-default,var(--luzmo-option-label-content-color-default,var(--option-label-content-color-default)));-webkit-hyphens:auto;hyphens:auto;overflow-wrap:break-word;grid-area:labelArea}:host([variant=highlight][selected]){--option-shortcut-opacity:1;background-color:var(--luzmo-option-highlight-selected-label-background-color,var(--option-highlight-selected-label-background-color))}:host([variant=highlight][selected]) #label{color:var(--luzmo-option-highlight-selected-label-content-color,var(--option-highlight-selected-label-content-color))}:host([variant=highlight][selected]) [name=description]::slotted(*){color:var(--luzmo-option-highlight-selected-description-color,var(--option-highlight-selected-label-content-color))}:host([variant=highlight][selected])>::slotted([slot=value]){color:var(--luzmo-option-highlight-selected-value-color,var(--option-highlight-selected-label-content-color))}:host([variant=highlight][selected]):hover #label{color:var(--luzmo-option-highlight-selected-label-content-color-hover,var(--option-highlight-selected-label-content-color-hover))}:host([variant=highlight][selected]):hover [name=description]::slotted(*){color:var(--luzmo-option-highlight-selected-description-color-hover,var(--option-highlight-selected-label-content-color-hover))}:host([variant=highlight][selected]):hover>::slotted([slot=value]){color:var(--luzmo-option-highlight-selected-value-color-hover,var(--option-highlight-selected-label-content-color-hover))}:host([variant=highlight][selected]):active #label{color:var(--luzmo-option-highlight-selected-label-content-color-down,var(--option-highlight-selected-label-content-color-down))}:host([variant=highlight][selected]):active [name=description]::slotted(*){color:var(--luzmo-option-highlight-selected-description-color-down,var(--option-highlight-selected-label-content-color-down))}:host([variant=highlight][selected]):active>::slotted([slot=value]){color:var(--luzmo-option-highlight-selected-value-color-down,var(--option-highlight-selected-label-content-color-down))}:host([variant=highlight][selected]):focus #label{color:var(--luzmo-option-highlight-selected-label-content-color-focus,var(--option-highlight-selected-label-content-color-focus))}:host([variant=highlight][selected]):focus [name=description]::slotted(*){color:var(--luzmo-option-highlight-selected-description-color-focus,var(--option-highlight-selected-label-content-color-focus))}:host([variant=highlight][selected]):focus>::slotted([slot=value]){color:var(--luzmo-option-highlight-selected-value-color-focus,var(--option-highlight-selected-label-content-color-focus))}:host([variant=highlight][selected]) ::slotted([slot=icon]){color:var(--highcontrast-option-color-disabled,var(--luzmo-option-highlight-selected-label-content-color,var(--option-highlight-selected-label-content-color)));fill:var(--highcontrast-option-color-disabled,var(--luzmo-option-highlight-selected-label-content-color,var(--option-highlight-selected-label-content-color)))}::slotted([slot=value]){color:var(--highcontrast-option-color-default,var(--luzmo-option-value-color-default,var(--option-value-color-default)));font-family:inherit;font-size:var(--luzmo-option-label-font-size,var(--option-label-font-size));grid-area:valueArea;justify-self:end}::slotted(kbd[slot=value]){font-size:var(--option-shortcut-font-size);opacity:var(--option-shortcut-opacity)}[name=description]::slotted(*){color:var(--highcontrast-option-color-default,var(--luzmo-option-description-color-default,var(--option-description-color-default)));font-size:var(--luzmo-option-description-font-size,var(--option-description-font-size));-webkit-hyphens:auto;hyphens:auto;overflow-wrap:break-word;line-height:var(--luzmo-option-description-line-height,var(--option-description-line-height));grid-area:descriptionArea;margin-block-start:var(--luzmo-option-label-to-description-spacing,var(--option-label-to-description-spacing))}:host([no-wrap]) #label{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}:host([expandable]){cursor:pointer}:host([expandable][has-selected-child][variant=highlight]:not([expanded])){background-color:color-mix(in srgb, var(--luzmo-option-highlight-selected-label-background-color,var(--option-highlight-selected-label-background-color)) 12%, transparent)}:host([expandable])>.checkmark{color:color-mix(in srgb, var(--highcontrast-options-checkmark-icon-color-default,var(--luzmo-options-checkmark-icon-color-default,var(--options-checkmark-icon-color-default))) 50%, transparent);fill:color-mix(in srgb, var(--highcontrast-options-checkmark-icon-color-default,var(--luzmo-options-checkmark-icon-color-default,var(--options-checkmark-icon-color-default))) 50%, transparent)}:host([expandable])>.checkbox{color:color-mix(in srgb, var(--highcontrast-options-checkbox-icon-color-default,var(--luzmo-options-checkbox-icon-color-default,var(--options-checkbox-icon-color-default))) 50%, transparent);fill:color-mix(in srgb, var(--highcontrast-options-checkbox-icon-color-default,var(--luzmo-options-checkbox-icon-color-default,var(--options-checkbox-icon-color-default))) 50%, transparent)}:host([expandable][has-selected-child])>.checkmark{color:color-mix(in srgb, var(--highcontrast-options-checkmark-icon-color-default,var(--luzmo-options-checkmark-icon-color-default,var(--options-checkmark-icon-color-default))) 50%, transparent);fill:color-mix(in srgb, var(--highcontrast-options-checkmark-icon-color-default,var(--luzmo-options-checkmark-icon-color-default,var(--options-checkmark-icon-color-default))) 50%, transparent)}:host([expandable][has-selected-child])>.checkbox{color:color-mix(in srgb, var(--highcontrast-options-checkbox-icon-color-default,var(--luzmo-options-checkbox-icon-color-default,var(--options-checkbox-icon-color-default))) 50%, transparent);fill:color-mix(in srgb, var(--highcontrast-options-checkbox-icon-color-default,var(--luzmo-options-checkbox-icon-color-default,var(--options-checkbox-icon-color-default))) 50%, transparent)}:host([child-option]){padding-inline-start:calc(var(--luzmo-option-label-inline-edge-to-content,var(--option-label-inline-edge-to-content)) + 24px)}@media (hover:hover){:host(:hover){background-color:var(--highcontrast-option-background-color-focus,var(--luzmo-option-background-color-hover,var(--option-background-color-hover)))}:host(:hover)>#label{color:var(--highcontrast-option-color-focus,var(--luzmo-option-label-content-color-hover,var(--option-label-content-color-hover)))}:host([variant=highlight][selected]:hover)>#label{color:var(--luzmo-option-highlight-selected-label-content-color-hover,var(--option-highlight-selected-label-content-color-hover))}:host([variant=highlight][selected]:hover)>[name=description]::slotted(*){color:var(--luzmo-option-highlight-selected-description-color-hover,var(--option-highlight-selected-label-content-color-hover))}:host(:hover)>[name=description]::slotted(*){color:var(--highcontrast-option-color-focus,var(--luzmo-option-description-color-hover,var(--option-description-color-hover)))}:host(:hover)>::slotted([slot=value]){color:var(--highcontrast-option-color-focus,var(--luzmo-option-value-color-hover,var(--option-value-color-hover)))}:host(:hover)>.icon:not(.checkmark,.checkbox){fill:var(--highcontrast-option-color-focus,var(--luzmo-option-label-icon-color-hover,var(--option-label-icon-color-hover)));color:var(--highcontrast-option-color-focus,var(--luzmo-option-label-icon-color-hover,var(--option-label-icon-color-hover)))}:host([variant=highlight][selected]:hover)>.icon:not(.checkmark,.checkbox){fill:var(--luzmo-option-highlight-selected-label-icon-color-hover,var(--option-highlight-selected-label-icon-color-hover))}:host(:hover)>.checkmark{fill:var(--highcontrast-option-color-focus,var(--luzmo-options-checkmark-icon-color-hover,var(--options-checkmark-icon-color-hover)));color:var(--highcontrast-option-color-focus,var(--luzmo-options-checkmark-icon-color-hover,var(--options-checkmark-icon-color-hover)))}:host(:hover)>.checkbox{fill:var(--highcontrast-option-color-focus,var(--luzmo-options-checkbox-icon-color-hover,var(--options-checkbox-icon-color-hover)));color:var(--highcontrast-option-color-focus,var(--luzmo-options-checkbox-icon-color-hover,var(--options-checkbox-icon-color-hover)))}:host([disabled]:hover),:host([aria-disabled=true]:hover){cursor:default;background-color:initial}:host([disabled]:hover) #label,:host([disabled]:hover) ::slotted([slot=value]),:host([aria-disabled=true]:hover) #label,:host([aria-disabled=true]:hover) ::slotted([slot=value]){color:var(--highcontrast-option-color-disabled,var(--luzmo-option-label-content-color-disabled,var(--option-label-content-color-disabled)))}:host([disabled]:hover) [name=description]::slotted(*),:host([aria-disabled=true]:hover) [name=description]::slotted(*){color:var(--highcontrast-option-color-disabled,var(--luzmo-option-description-color-disabled,var(--option-description-color-disabled)))}:host([disabled]:hover) ::slotted([slot=icon]),:host([aria-disabled=true]:hover) ::slotted([slot=icon]){color:var(--highcontrast-option-color-disabled,var(--luzmo-option-label-icon-color-disabled,var(--option-label-icon-color-disabled)));fill:var(--highcontrast-option-color-disabled,var(--luzmo-option-label-icon-color-disabled,var(--option-label-icon-color-disabled)))}}:host([emphasized]){--options-checkmark-icon-color-default:var(--luzmo-primary);--options-checkmark-icon-color-hover:var(--luzmo-primary-hover);--options-checkmark-icon-color-down:var(--luzmo-primary-down);--options-checkmark-icon-color-focus:var(--luzmo-primary-focus);--options-checkbox-icon-color-default:var(--luzmo-primary);--options-checkbox-icon-color-hover:var(--luzmo-primary-hover);--options-checkbox-icon-color-down:var(--luzmo-primary-down);--options-checkbox-icon-color-focus:var(--luzmo-primary-focus)}:host{text-align:initial;font-family:var(--luzmo-option-font-family,var(--luzmo-font-family))}:host([hidden]){display:none}:host([disabled]){pointer-events:none}:host([disabled]) [name=value]::slotted(*){color:var(--luzmo-option-label-icon-color-disabled,var(--luzmo-disabled-color))}#button{position:absolute;inset:0}.icon-container>svg{vertical-align:top}:host([dir=ltr]) [icon-only]::slotted(:last-of-type){margin-right:auto}:host([dir=rtl]) [icon-only]::slotted(:last-of-type){margin-left:auto}@media (forced-colors:active){:host{forced-color-adjust:none}}:host([no-wrap]) #label{display:block}`,O=t=>e`
3
- <span class="icon-container icon checkmark ${t.join(` `)}">
4
- ${v(_)}
5
- </span>
6
- `,k=t=>e`
7
- <span class="icon-container icon checkbox ${t.join(` `)}">
8
- ${v(E)}
9
- </span>
10
- `,A=t=>e`
11
- <span class="icon-container icon checkbox ${t.join(` `)}">
12
- ${v(ee)}
13
- </span>
14
- `,j=class extends u(f(b(a,`[slot="icon"]`))){static get styles(){return[i(D)]}get value(){return this._value||this.itemText}set value(e){e!==this._value&&(this._value=e||``,this._value?this.setAttribute(`value`,this._value):this.removeAttribute(`value`))}get itemText(){return this.itemChildren.content.reduce((e,t)=>e+(t.textContent||``).trim(),``)}get focusElement(){return this}get hasIcon(){return this.slotContentIsPresent}get itemChildren(){if(!this.iconSlot||!this.contentSlot)return{icon:[],content:[]};if(this._itemChildren)return this._itemChildren;let e=this.iconSlot.assignedElements().map(e=>{let t=e.cloneNode(!0);return t.removeAttribute(`slot`),t.classList.toggle(`icon`),t}),t=this.contentSlot.assignedNodes().map(e=>e.cloneNode(!0));return this._itemChildren={icon:e,content:t},this._itemChildren}constructor(){super(),this.active=!1,this.focused=!1,this.selected=!1,this.emphasized=!1,this.expandable=!1,this.expanded=!1,this.childOption=!1,this.hasSelectedChild=!1,this.variant=`checkmarks`,this._value=``,this.noWrap=!1,this.renderCheckIcon=(t,n)=>{let r=n?[`check-icon--with-adjacent-icon`]:[];return this.variant===`checkboxes`?t?A(r):k(r):t&&this.variant!==`highlight`?O(r):e``},this.proxyFocus=()=>{this.focus()},this.willDispatchUpdate=!1,this.addEventListener(`click`,this.handleClickCapture,{capture:!0}),new d(this,{config:{characterData:!0,childList:!0,subtree:!0},callback:()=>{this.breakItemChildrenCache()}})}click(){this.disabled||this.shouldProxyClick()||super.click()}handleClickCapture(e){if(this.disabled)return e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation(),!1}shouldProxyClick(){let e=!1;return this.anchorElement&&(this.anchorElement.click(),e=!0),e}breakItemChildrenCache(){this._itemChildren=void 0,this.triggerUpdate()}render(){return e`
15
- ${this.renderCheckIcon(this.selected||this.hasSelectedChild,this.hasIcon)}
16
- <div id="icon">
17
- <slot name="icon"></slot>
18
- </div>
19
- <div id="label">
20
- <slot id="slot"></slot>
21
- </div>
22
- <slot name="description"></slot>
23
- <slot name="value"></slot>
24
- ${this.href&&this.href.length>0?super.renderAnchor({id:`button`,ariaHidden:!0,className:`button anchor hidden`}):t}
25
- `}handlePointerdown(){}firstUpdated(e){super.firstUpdated(e),this.setAttribute(`tabindex`,`-1`),this.addEventListener(`pointerdown`,this.handlePointerdown),this.hasAttribute(`id`)||(this.id=`luzmo-option-${y()}`)}updateAriaSelected(){let e=this.getAttribute(`role`);e===`option`?this.setAttribute(`aria-selected`,this.selected?`true`:`false`):e===`optioncheckbox`&&this.setAttribute(`aria-checked`,this.selected?`true`:`false`)}setRole(e){this.setAttribute(`role`,e),this.updateAriaSelected()}updated(e){super.updated(e),e.has(`label`)&&(this.label||e.get(`label`)!==void 0)&&this.setAttribute(`aria-label`,this.label||``),this.anchorElement&&(this.anchorElement.addEventListener(`focus`,this.proxyFocus),this.anchorElement.tabIndex=-1),e.has(`selected`)&&this.updateAriaSelected()}connectedCallback(){super.connectedCallback(),this.triggerUpdate()}async triggerUpdate(){this.willDispatchUpdate||(this.willDispatchUpdate=!0,await new Promise(e=>requestAnimationFrame(e)),this.dispatchUpdate())}dispatchUpdate(){this.isConnected&&(this.willDispatchUpdate=!1)}};l([h({type:Boolean,reflect:!0})],j.prototype,`active`,void 0),l([h({type:Boolean,reflect:!0})],j.prototype,`focused`,void 0),l([h({type:Boolean,reflect:!0})],j.prototype,`selected`,void 0),l([h({type:Boolean,reflect:!0})],j.prototype,`emphasized`,void 0),l([h({type:Boolean,reflect:!0})],j.prototype,`expandable`,void 0),l([h({type:Boolean,reflect:!0})],j.prototype,`expanded`,void 0),l([h({type:Boolean,reflect:!0,attribute:`child-option`})],j.prototype,`childOption`,void 0),l([h({type:Boolean,reflect:!0,attribute:`has-selected-child`})],j.prototype,`hasSelectedChild`,void 0),l([h({type:String,reflect:!0})],j.prototype,`variant`,void 0),l([h({type:String})],j.prototype,`value`,null),l([s(`slot:not([name])`)],j.prototype,`contentSlot`,void 0),l([s(`slot[name="icon"]`)],j.prototype,`iconSlot`,void 0),l([h({type:Boolean,reflect:!0,attribute:`no-wrap`,hasChanged(){return!1}})],j.prototype,`noWrap`,void 0),l([s(`.anchor`)],j.prototype,`anchorElement`,void 0);function M(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}var N=class e extends Event{constructor(t){super(e.eventName,{bubbles:!1}),this.first=t.first,this.last=t.last}};N.eventName=`rangeChanged`;var P=class e extends Event{constructor(t){super(e.eventName,{bubbles:!1}),this.first=t.first,this.last=t.last}};P.eventName=`visibilityChanged`;var F=class e extends Event{constructor(){super(e.eventName,{bubbles:!1})}};F.eventName=`unpinned`;var te=class{constructor(e){this._element=null;let t=e??window;this._node=t,e&&(this._element=e)}get element(){return this._element||document.scrollingElement||document.documentElement}get scrollTop(){return this.element.scrollTop||window.scrollY}get scrollLeft(){return this.element.scrollLeft||window.scrollX}get scrollHeight(){return this.element.scrollHeight}get scrollWidth(){return this.element.scrollWidth}get viewportHeight(){return this._element?this._element.getBoundingClientRect().height:window.innerHeight}get viewportWidth(){return this._element?this._element.getBoundingClientRect().width:window.innerWidth}get maxScrollTop(){return this.scrollHeight-this.viewportHeight}get maxScrollLeft(){return this.scrollWidth-this.viewportWidth}},I=class extends te{constructor(e,t){super(t),this._clients=/* @__PURE__ */ new Set,this._retarget=null,this._end=null,this.__destination=null,this.correctingScrollError=!1,this._checkForArrival=this._checkForArrival.bind(this),this._updateManagedScrollTo=this._updateManagedScrollTo.bind(this),this.scrollTo=this.scrollTo.bind(this),this.scrollBy=this.scrollBy.bind(this);let n=this._node;this._originalScrollTo=n.scrollTo,this._originalScrollBy=n.scrollBy,this._originalScroll=n.scroll,this._attach(e)}get _destination(){return this.__destination}get scrolling(){return this._destination!==null}scrollTo(e,t){let n=typeof e==`number`&&typeof t==`number`?{left:e,top:t}:e;this._scrollTo(n)}scrollBy(e,t){let n=typeof e==`number`&&typeof t==`number`?{left:e,top:t}:e;n.top!==void 0&&(n.top+=this.scrollTop),n.left!==void 0&&(n.left+=this.scrollLeft),this._scrollTo(n)}_nativeScrollTo(e){this._originalScrollTo.bind(this._element||window)(e)}_scrollTo(e,t=null,n=null){this._end!==null&&this._end(),e.behavior===`smooth`?(this._setDestination(e),this._retarget=t,this._end=n):this._resetScrollState(),this._nativeScrollTo(e)}_setDestination(e){let{top:t,left:n}=e;return t=t===void 0?void 0:Math.max(0,Math.min(t,this.maxScrollTop)),n=n===void 0?void 0:Math.max(0,Math.min(n,this.maxScrollLeft)),this._destination!==null&&n===this._destination.left&&t===this._destination.top?!1:(this.__destination={top:t,left:n,behavior:`smooth`},!0)}_resetScrollState(){this.__destination=null,this._retarget=null,this._end=null}_updateManagedScrollTo(e){this._destination&&this._setDestination(e)&&this._nativeScrollTo(this._destination)}managedScrollTo(e,t,n){return this._scrollTo(e,t,n),this._updateManagedScrollTo}correctScrollError(e){this.correctingScrollError=!0,requestAnimationFrame(()=>requestAnimationFrame(()=>this.correctingScrollError=!1)),this._nativeScrollTo(e),this._retarget&&this._setDestination(this._retarget()),this._destination&&this._nativeScrollTo(this._destination)}_checkForArrival(){if(this._destination!==null){let{scrollTop:e,scrollLeft:t}=this,{top:n,left:r}=this._destination;n=Math.min(n||0,this.maxScrollTop),r=Math.min(r||0,this.maxScrollLeft);let i=Math.abs(n-e),a=Math.abs(r-t);i<1&&a<1&&(this._end&&this._end(),this._resetScrollState())}}detach(e){return this._clients.delete(e),this._clients.size===0&&(this._node.scrollTo=this._originalScrollTo,this._node.scrollBy=this._originalScrollBy,this._node.scroll=this._originalScroll,this._node.removeEventListener(`scroll`,this._checkForArrival)),null}_attach(e){this._clients.add(e),this._clients.size===1&&(this._node.scrollTo=this.scrollTo,this._node.scrollBy=this.scrollBy,this._node.scroll=this.scrollTo,this._node.addEventListener(`scroll`,this._checkForArrival))}},L=typeof window<`u`?window.ResizeObserver:void 0,R=Symbol(`virtualizerRef`),z=`virtualizer-sizer`,B,V=class{constructor(e){if(this._benchmarkStart=null,this._layout=null,this._clippingAncestors=[],this._scrollSize=null,this._scrollError=null,this._childrenPos=null,this._childMeasurements=null,this._toBeMeasured=/* @__PURE__ */ new Map,this._rangeChanged=!0,this._itemsChanged=!0,this._visibilityChanged=!0,this._scrollerController=null,this._isScroller=!1,this._sizer=null,this._hostElementRO=null,this._childrenRO=null,this._mutationObserver=null,this._scrollEventListeners=[],this._scrollEventListenerOptions={passive:!0},this._loadListener=this._childLoaded.bind(this),this._scrollIntoViewTarget=null,this._updateScrollIntoViewCoordinates=null,this._items=[],this._first=-1,this._last=-1,this._firstVisible=-1,this._lastVisible=-1,this._scheduled=/* @__PURE__ */ new WeakSet,this._measureCallback=null,this._measureChildOverride=null,this._layoutCompletePromise=null,this._layoutCompleteResolver=null,this._layoutCompleteRejecter=null,this._pendingLayoutComplete=null,this._layoutInitialized=null,this._connected=!1,!e)throw Error(`Virtualizer constructor requires a configuration object`);if(e.hostElement)this._init(e);else throw Error(`Virtualizer configuration requires the "hostElement" property`)}set items(e){Array.isArray(e)&&e!==this._items&&(this._itemsChanged=!0,this._items=e,this._schedule(this._updateLayout))}_init(e){this._isScroller=!!e.scroller,this._initHostElement(e);let t=e.layout||{};this._layoutInitialized=this._initLayout(t)}_initObservers(){this._mutationObserver=new MutationObserver(this._finishDOMUpdate.bind(this)),this._hostElementRO=new L(()=>this._hostElementSizeChanged()),this._childrenRO=new L(this._childrenSizeChanged.bind(this))}_initHostElement(e){let t=this._hostElement=e.hostElement;this._applyVirtualizerStyles(),t[R]=this}connected(){this._initObservers();let e=this._isScroller;this._clippingAncestors=K(this._hostElement,e),this._scrollerController=new I(this,this._clippingAncestors[0]),this._schedule(this._updateLayout),this._observeAndListen(),this._connected=!0}_observeAndListen(){this._mutationObserver.observe(this._hostElement,{childList:!0}),this._hostElementRO.observe(this._hostElement),this._scrollEventListeners.push(window),window.addEventListener(`scroll`,this,this._scrollEventListenerOptions),this._clippingAncestors.forEach(e=>{e.addEventListener(`scroll`,this,this._scrollEventListenerOptions),this._scrollEventListeners.push(e),this._hostElementRO.observe(e)}),this._hostElementRO.observe(this._scrollerController.element),this._children.forEach(e=>this._childrenRO.observe(e)),this._scrollEventListeners.forEach(e=>e.addEventListener(`scroll`,this,this._scrollEventListenerOptions))}disconnected(){this._scrollEventListeners.forEach(e=>e.removeEventListener(`scroll`,this,this._scrollEventListenerOptions)),this._scrollEventListeners=[],this._clippingAncestors=[],this._scrollerController?.detach(this),this._scrollerController=null,this._mutationObserver?.disconnect(),this._mutationObserver=null,this._hostElementRO?.disconnect(),this._hostElementRO=null,this._childrenRO?.disconnect(),this._childrenRO=null,this._rejectLayoutCompletePromise(`disconnected`),this._connected=!1}_applyVirtualizerStyles(){let e=this._hostElement.style;e.display=e.display||`block`,e.position=e.position||`relative`,e.contain=e.contain||`size layout`,this._isScroller&&(e.overflow=e.overflow||`auto`,e.minHeight=e.minHeight||`150px`)}_getSizer(){let e=this._hostElement;if(!this._sizer){let t=e.querySelector(`[${z}]`);t||(t=document.createElement(`div`),t.setAttribute(z,``),e.appendChild(t)),Object.assign(t.style,{position:`absolute`,margin:`-2px 0 0 0`,padding:0,visibility:`hidden`,fontSize:`2px`}),t.textContent=`&nbsp;`,t.setAttribute(z,``),this._sizer=t}return this._sizer}async updateLayoutConfig(e){await this._layoutInitialized;let t=e.type||B;if(typeof t==`function`&&this._layout instanceof t){let t={...e};return delete t.type,this._layout.config=t,!0}return!1}async _initLayout(e){let t,n;if(typeof e.type==`function`){n=e.type;let r={...e};delete r.type,t=r}else t=e;n===void 0&&(B=n=(await import(`./flow-CL5kBpdV.js`)).FlowLayout),this._layout=new n(e=>this._handleLayoutMessage(e),t),this._layout.measureChildren&&typeof this._layout.updateItemSizes==`function`&&(typeof this._layout.measureChildren==`function`&&(this._measureChildOverride=this._layout.measureChildren),this._measureCallback=this._layout.updateItemSizes.bind(this._layout)),this._layout.listenForChildLoadEvents&&this._hostElement.addEventListener(`load`,this._loadListener,!0),this._schedule(this._updateLayout)}startBenchmarking(){this._benchmarkStart===null&&(this._benchmarkStart=window.performance.now())}stopBenchmarking(){if(this._benchmarkStart!==null){let e=window.performance.now(),t=e-this._benchmarkStart,n=performance.getEntriesByName(`uv-virtualizing`,`measure`).filter(t=>t.startTime>=this._benchmarkStart&&t.startTime<e).reduce((e,t)=>e+t.duration,0);return this._benchmarkStart=null,{timeElapsed:t,virtualizationTime:n}}return null}_measureChildren(){let e={},t=this._children,n=this._measureChildOverride||this._measureChild;for(let r=0;r<t.length;r++){let i=t[r],a=this._first+r;(this._itemsChanged||this._toBeMeasured.has(i))&&(e[a]=n.call(this,i,this._items[a]))}this._childMeasurements=e,this._schedule(this._updateLayout),this._toBeMeasured.clear()}_measureChild(e){let{width:t,height:n}=e.getBoundingClientRect();return Object.assign({width:t,height:n},H(e))}async _schedule(e){this._scheduled.has(e)||(this._scheduled.add(e),await Promise.resolve(),this._scheduled.delete(e),e.call(this))}async _updateDOM(e){this._scrollSize=e.scrollSize,this._adjustRange(e.range),this._childrenPos=e.childPositions,this._scrollError=e.scrollError||null;let{_rangeChanged:t,_itemsChanged:n}=this;this._visibilityChanged&&=(this._notifyVisibility(),!1),(t||n)&&(this._notifyRange(),this._rangeChanged=!1),this._finishDOMUpdate()}_finishDOMUpdate(){this._connected&&(this._children.forEach(e=>this._childrenRO.observe(e)),this._checkScrollIntoViewTarget(this._childrenPos),this._positionChildren(this._childrenPos),this._sizeHostElement(this._scrollSize),this._correctScrollError(),this._benchmarkStart&&`mark`in window.performance&&window.performance.mark(`uv-end`))}_updateLayout(){this._layout&&this._connected&&(this._layout.items=this._items,this._updateView(),this._childMeasurements!==null&&(this._measureCallback&&this._measureCallback(this._childMeasurements),this._childMeasurements=null),this._layout.reflowIfNeeded(),this._benchmarkStart&&`mark`in window.performance&&window.performance.mark(`uv-end`))}_handleScrollEvent(){if(this._benchmarkStart&&`mark`in window.performance){try{window.performance.measure(`uv-virtualizing`,`uv-start`,`uv-end`)}catch(e){console.warn(`Error measuring performance data: `,e)}window.performance.mark(`uv-start`)}this._scrollerController.correctingScrollError===!1&&this._layout?.unpin(),this._schedule(this._updateLayout)}handleEvent(e){switch(e.type){case`scroll`:(e.currentTarget===window||this._clippingAncestors.includes(e.currentTarget))&&this._handleScrollEvent();break;default:console.warn(`event not handled`,e)}}_handleLayoutMessage(e){e.type===`stateChanged`?this._updateDOM(e):e.type===`visibilityChanged`?(this._firstVisible=e.firstVisible,this._lastVisible=e.lastVisible,this._notifyVisibility()):e.type===`unpinned`&&this._hostElement.dispatchEvent(new F)}get _children(){let e=[],t=this._hostElement.firstElementChild;for(;t;)t.hasAttribute(z)||e.push(t),t=t.nextElementSibling;return e}_updateView(){let e=this._hostElement,t=this._scrollerController?.element,n=this._layout;if(e&&t&&n){let r,i,a,o,s=e.getBoundingClientRect();r=0,i=0,a=window.innerHeight,o=window.innerWidth;let c=this._clippingAncestors.map(e=>e.getBoundingClientRect());c.unshift(s);for(let e of c)r=Math.max(r,e.top),i=Math.max(i,e.left),a=Math.min(a,e.bottom),o=Math.min(o,e.right);let l=t.getBoundingClientRect(),u={left:s.left-l.left,top:s.top-l.top},d={width:t.scrollWidth,height:t.scrollHeight},f=r-s.top+e.scrollTop,p=i-s.left+e.scrollLeft,m=Math.max(0,a-r);n.viewportSize={width:Math.max(0,o-i),height:m},n.viewportScroll={top:f,left:p},n.totalScrollSize=d,n.offsetWithinScroller=u}}_sizeHostElement(e){let t=82e5,n=e&&e.width!==null?Math.min(t,e.width):0,r=e&&e.height!==null?Math.min(t,e.height):0;if(this._isScroller)this._getSizer().style.transform=`translate(${n}px, ${r}px)`;else{let e=this._hostElement.style;e.minWidth=n?`${n}px`:`100%`,e.minHeight=r?`${r}px`:`100%`}}_positionChildren(e){e&&e.forEach(({top:e,left:t,width:n,height:r,xOffset:i,yOffset:a},o)=>{let s=this._children[o-this._first];s&&(s.style.position=`absolute`,s.style.boxSizing=`border-box`,s.style.transform=`translate(${t}px, ${e}px)`,n!==void 0&&(s.style.width=n+`px`),r!==void 0&&(s.style.height=r+`px`),s.style.left=i===void 0?null:i+`px`,s.style.top=a===void 0?null:a+`px`)})}async _adjustRange(e){let{_first:t,_last:n,_firstVisible:r,_lastVisible:i}=this;this._first=e.first,this._last=e.last,this._firstVisible=e.firstVisible,this._lastVisible=e.lastVisible,this._rangeChanged=this._rangeChanged||this._first!==t||this._last!==n,this._visibilityChanged=this._visibilityChanged||this._firstVisible!==r||this._lastVisible!==i}_correctScrollError(){if(this._scrollError){let{scrollTop:e,scrollLeft:t}=this._scrollerController,{top:n,left:r}=this._scrollError;this._scrollError=null,this._scrollerController.correctScrollError({top:e-n,left:t-r})}}element(e){return e===1/0&&(e=this._items.length-1),this._items?.[e]===void 0?void 0:{scrollIntoView:(t={})=>this._scrollElementIntoView({...t,index:e})}}_scrollElementIntoView(e){if(e.index>=this._first&&e.index<=this._last)this._children[e.index-this._first].scrollIntoView(e);else if(e.index=Math.min(e.index,this._items.length-1),e.behavior===`smooth`){let t=this._layout.getScrollIntoViewCoordinates(e),{behavior:n}=e;this._updateScrollIntoViewCoordinates=this._scrollerController.managedScrollTo(Object.assign(t,{behavior:n}),()=>this._layout.getScrollIntoViewCoordinates(e),()=>this._scrollIntoViewTarget=null),this._scrollIntoViewTarget=e}else this._layout.pin=e}_checkScrollIntoViewTarget(e){let{index:t}=this._scrollIntoViewTarget||{};t&&e?.has(t)&&this._updateScrollIntoViewCoordinates(this._layout.getScrollIntoViewCoordinates(this._scrollIntoViewTarget))}_notifyRange(){this._hostElement.dispatchEvent(new N({first:this._first,last:this._last}))}_notifyVisibility(){this._hostElement.dispatchEvent(new P({first:this._firstVisible,last:this._lastVisible}))}get layoutComplete(){return this._layoutCompletePromise||=new Promise((e,t)=>{this._layoutCompleteResolver=e,this._layoutCompleteRejecter=t}),this._layoutCompletePromise}_rejectLayoutCompletePromise(e){this._layoutCompleteRejecter!==null&&this._layoutCompleteRejecter(e),this._resetLayoutCompleteState()}_scheduleLayoutComplete(){this._layoutCompletePromise&&this._pendingLayoutComplete===null&&(this._pendingLayoutComplete=requestAnimationFrame(()=>requestAnimationFrame(()=>this._resolveLayoutCompletePromise())))}_resolveLayoutCompletePromise(){this._layoutCompleteResolver!==null&&this._layoutCompleteResolver(),this._resetLayoutCompleteState()}_resetLayoutCompleteState(){this._layoutCompletePromise=null,this._layoutCompleteResolver=null,this._layoutCompleteRejecter=null,this._pendingLayoutComplete=null}_hostElementSizeChanged(){this._schedule(this._updateLayout)}_childLoaded(){}_childrenSizeChanged(e){if(this._layout?.measureChildren){for(let t of e)this._toBeMeasured.set(t.target,t.contentRect);this._measureChildren()}this._scheduleLayoutComplete(),this._itemsChanged=!1,this._rangeChanged=!1}};function H(e){let t=window.getComputedStyle(e);return{marginTop:U(t.marginTop),marginRight:U(t.marginRight),marginBottom:U(t.marginBottom),marginLeft:U(t.marginLeft)}}function U(e){let t=e?parseFloat(e):NaN;return Number.isNaN(t)?0:t}function W(e){if(e.assignedSlot!==null)return e.assignedSlot;if(e.parentElement!==null)return e.parentElement;let t=e.parentNode;return t&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&t.host||null}function G(e,t=!1){let n=[],r=t?e:W(e);for(;r!==null;)n.push(r),r=W(r);return n}function K(e,t=!1){let n=!1;return G(e,t).filter(e=>{if(n)return!1;let t=getComputedStyle(e);return n=t.position===`fixed`,t.overflow!==`visible`})}var q=e=>e,J=(t,n)=>e`${n}: ${JSON.stringify(t,null,2)}`,Y=S(class extends w{constructor(e){if(super(e),this._virtualizer=null,this._first=0,this._last=-1,this._renderItem=(e,t)=>J(e,t+this._first),this._keyFunction=(e,t)=>q(e,t+this._first),this._items=[],e.type!==x.CHILD)throw Error(`The virtualize directive can only be used in child expressions`)}render(e){e&&this._setFunctions(e);let t=[];if(this._first>=0&&this._last>=this._first)for(let e=this._first;e<=this._last;e++)t.push(this._items[e]);return T(t,this._keyFunction,this._renderItem)}update(e,[t]){this._setFunctions(t);let n=this._items!==t.items;return this._items=t.items||[],this._virtualizer?this._updateVirtualizerConfig(e,t):this._initialize(e,t),n?r:this.render()}async _updateVirtualizerConfig(e,t){if(!await this._virtualizer.updateLayoutConfig(t.layout||{})){let n=e.parentNode;this._makeVirtualizer(n,t)}this._virtualizer.items=this._items}_setFunctions(e){let{renderItem:t,keyFunction:n}=e;t&&(this._renderItem=(e,n)=>t(e,n+this._first)),n&&(this._keyFunction=(e,t)=>n(e,t+this._first))}_makeVirtualizer(e,t){this._virtualizer&&this._virtualizer.disconnected();let{layout:n,scroller:r,items:i}=t;this._virtualizer=new V({hostElement:e,layout:n,scroller:r}),this._virtualizer.items=i,this._virtualizer.connected()}_initialize(e,t){let n=e.parentNode;n&&n.nodeType===1&&(n.addEventListener(`rangeChanged`,e=>{this._first=e.first,this._last=e.last,this.setValue(this.render())}),this._makeVirtualizer(n,t))}disconnected(){this._virtualizer?.disconnected()}reconnected(){this._virtualizer?.connected()}}),X=class extends n{constructor(){super(...arguments),this.items=[],this.renderItem=J,this.keyFunction=q,this.layout={},this.scroller=!1}createRenderRoot(){return this}render(){let{items:t,renderItem:n,keyFunction:r,layout:i,scroller:a}=this;return e`${Y({items:t,renderItem:n,keyFunction:r,layout:i,scroller:a})}`}element(e){return this[R]?.element(e)}get layoutComplete(){return this[R]?.layoutComplete}scrollToIndex(e,t=`start`){this.element(e)?.scrollIntoView({block:t})}};M([h({attribute:!1})],X.prototype,`items`,void 0),M([h()],X.prototype,`renderItem`,void 0),M([h()],X.prototype,`keyFunction`,void 0),M([h({attribute:!1})],X.prototype,`layout`,void 0),M([h({reflect:!0,type:Boolean})],X.prototype,`scroller`,void 0);var Z=`:host{--options-divider-thickness:var(--divider-thickness-medium,var(--luzmo-border-width));inline-size:auto;margin-block:var(--luzmo-options-section-divider-margin-block,max(0px, (var(--option-section-divider-height) - var(--options-divider-thickness)) / 2));margin-inline:var(--luzmo-option-label-inline-edge-to-content,var(--option-label-inline-edge-to-content));flex-shrink:0;display:block;overflow:visible}`,Q=class extends o(p,{validSizes:[`s`,`m`,`l`]}){static get styles(){return[i(C),i(Z)]}firstUpdated(e){super.firstUpdated(e),this.hasAttribute(`role`)||this.setAttribute(`role`,`separator`)}},ne=`:host{--option-top-to-action:var(--luzmo-spacing-1);--option-top-to-checkbox:calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1));--option-label-line-height:var(--luzmo-line-height);--option-label-line-height-cjk:1.5;--option-label-to-description-spacing:1px;--option-focus-indicator-width:var(--luzmo-indicator-width);--option-focus-indicator-color:var(--luzmo-indicator-color);--option-label-to-value-area-min-spacing:var(--luzmo-spacing-3);--option-label-content-color-default:var(--luzmo-font-color);--option-label-content-color-hover:var(--luzmo-font-color-hover);--option-label-content-color-down:var(--luzmo-font-color-down);--option-label-content-color-focus:var(--luzmo-font-color-focus);--option-label-icon-color-default:var(--luzmo-font-color);--option-label-icon-color-hover:var(--luzmo-font-color-hover);--option-label-icon-color-down:var(--luzmo-font-color-down);--option-label-icon-color-focus:var(--luzmo-font-color-focus);--option-highlight-selected-label-background-color:var(--luzmo-primary);--option-highlight-selected-label-content-color:var(--luzmo-primary-inverse-color);--option-highlight-selected-label-content-color-hover:var(--luzmo-primary-inverse-color);--option-highlight-selected-label-content-color-down:var(--luzmo-primary-inverse-color);--option-highlight-selected-label-content-color-focus:var(--luzmo-primary-inverse-color);--option-label-content-color-disabled:var(--luzmo-font-color-disabled);--option-label-icon-color-disabled:var(--luzmo-font-color-disabled);--option-description-line-height:var(--luzmo-line-height);--option-description-line-height-cjk:1.5;--option-description-color-default:var(--luzmo-font-color);--option-description-color-hover:var(--luzmo-font-color-hover);--option-description-color-down:var(--luzmo-font-color-down);--option-description-color-focus:var(--luzmo-font-color-focus);--option-description-color-disabled:var(--luzmo-disabled-color);--options-section-header-line-height:var(--luzmo-line-height);--options-section-header-line-height-cjk:1.5;--options-section-header-font-weight:var(--luzmo-font-weight-semibold);--options-section-header-color:var(--luzmo-font-color-down);--options-collapsible-icon-color:var(--luzmo-font-color-down);--options-checkmark-icon-color-default:var(--luzmo-font-color);--options-checkmark-icon-color-hover:var(--luzmo-font-color-hover);--options-checkmark-icon-color-down:var(--luzmo-font-color-down);--options-checkmark-icon-color-focus:var(--luzmo-font-color-focus);--options-checkbox-icon-color-default:var(--luzmo-font-color);--options-checkbox-icon-color-hover:var(--luzmo-font-color-hover);--options-checkbox-icon-color-down:var(--luzmo-font-color-down);--options-checkbox-icon-color-focus:var(--luzmo-font-color-focus);--options-drillin-icon-color-default:var(--luzmo-font-color);--options-drillin-icon-color-hover:var(--luzmo-font-color-hover);--options-drillin-icon-color-down:var(--luzmo-font-color-down);--options-drillin-icon-color-focus:var(--luzmo-font-color-focus);--option-value-color-default:var(--luzmo-font-color);--option-value-color-hover:var(--luzmo-font-color-hover);--option-value-color-down:var(--luzmo-font-color-down);--option-value-color-focus:var(--luzmo-font-color-focus);--option-shortcut-opacity:.7;--option-collapsible-no-icon-suboption-padding-x-start:28px;--option-background-color-selected:var(--luzmo-background-color);--option-background-color-default:var(--luzmo-background-color);--option-background-color-hover:var(--luzmo-background-color-hover);--option-background-color-down:var(--luzmo-background-color-down);--option-background-color-key-focus:var(--luzmo-background-color-focus);--options-scrollbar-width:var(--luzmo-scrollbar-size);--options-scrollbar-track-background:var(--luzmo-scrollbar-track-background);--options-scrollbar-track-border-radius:var(--luzmo-scrollbar-track-border-radius);--options-scrollbar-thumb-background:var(--luzmo-scrollbar-thumb-background);--options-scrollbar-thumb-border-radius:var(--luzmo-scrollbar-thumb-border-radius);--options-scrollbar-thumb-hover-background:var(--luzmo-scrollbar-thumb-hover-background);--luzmo-option-thumbnail-border-radius:var(--luzmo-border-radius-s,4px);--luzmo-option-thumbnail-border-width:1px;--luzmo-option-thumbnail-border-style:solid;--luzmo-option-thumbnail-border-color:var(--luzmo-border-color-full,var(--luzmo-border-color,#0000001f));--option-min-height:var(--luzmo-component-height);--options-max-height:calc(8 * var(--option-min-height));--option-icon-container-height:18px;--options-pending-height:var(--option-min-height);--progress-circle-size:calc(var(--options-pending-height) - var(--option-top-edge-to-text) - var(--option-bottom-edge-to-text));--option-icon-height:var(--luzmo-font-size);--option-icon-width:var(--luzmo-font-size);--option-label-font-size:var(--luzmo-font-size);--option-shortcut-font-size:var(--luzmo-font-size-s);--option-label-text-to-visual:calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1));--option-label-text-to-control:calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1));--option-label-inline-edge-to-content:calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1));--pending-inline-edge-to-content:var(--option-label-inline-edge-to-content);--option-top-edge-to-text:calc(var(--luzmo-spacing-2) + var(--luzmo-spacing-1));--option-bottom-edge-to-text:var(--luzmo-spacing-3);--option-description-font-size:var(--luzmo-font-size-xs);--options-section-header-font-size:var(--luzmo-font-size);--options-section-header-min-width:var(--luzmo-component-height);--option-selectable-edge-to-text-not-selected:calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1));--option-checkmark-size:var(--luzmo-font-size-xs);--option-checkbox-size:var(--luzmo-font-size-xs);--option-top-to-checkmark:calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1))}:host([size=s]){--option-min-height:var(--luzmo-component-height-s);--option-icon-container-height:17px;--option-icon-height:var(--luzmo-font-size-s);--option-icon-width:var(--luzmo-font-size-s);--option-label-font-size:var(--luzmo-font-size-s);--option-shortcut-font-size:var(--luzmo-font-size-xs);--option-label-text-to-visual:var(--luzmo-spacing-3);--option-label-text-to-control:var(--luzmo-spacing-3);--option-label-inline-edge-to-content:var(--luzmo-spacing-3);--option-top-edge-to-text:calc(var(--luzmo-spacing-1) + var(--luzmo-spacing-2));--option-bottom-edge-to-text:var(--luzmo-spacing-2);--option-description-font-size:var(--luzmo-font-size-xs);--options-section-header-font-size:var(--luzmo-font-size-s);--options-section-header-min-width:var(--luzmo-component-height-s);--option-selectable-edge-to-text-not-selected:var(--luzmo-spacing-3);--option-checkmark-size:var(--luzmo-font-size-xs);--option-checkbox-size:var(--luzmo-font-size-xs);--option-top-to-checkmark:var(--luzmo-spacing-3);--option-top-to-checkbox:var(--luzmo-spacing-3)}:host([size=l]){--option-min-height:var(--luzmo-component-height-l);--option-icon-container-height:calc(var(--luzmo-spacing-5) + var(--luzmo-spacing-1));--option-icon-height:var(--luzmo-font-size-l);--option-icon-width:var(--luzmo-font-size-l);--option-label-font-size:var(--luzmo-font-size-l);--option-shortcut-font-size:var(--luzmo-font-size);--option-label-text-to-visual:var(--luzmo-spacing-4);--option-label-text-to-control:var(--luzmo-spacing-4);--option-label-inline-edge-to-content:var(--luzmo-spacing-4);--option-top-edge-to-text:var(--luzmo-spacing-4);--option-bottom-edge-to-text:calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1));--option-description-font-size:var(--luzmo-font-size-s);--options-section-header-font-size:var(--luzmo-font-size-l);--options-section-header-min-width:var(--luzmo-component-height-l);--option-selectable-edge-to-text-not-selected:var(--luzmo-spacing-4);--option-checkmark-size:var(--luzmo-font-size-s);--option-checkbox-size:var(--luzmo-font-size-s);--option-top-to-checkmark:var(--luzmo-spacing-4);--option-top-to-checkbox:var(--luzmo-spacing-4)}:host([size=xl]){--option-min-height:var(--luzmo-component-height-xl);--option-icon-container-height:26px;--option-icon-height:var(--luzmo-font-size-xl);--option-icon-width:var(--luzmo-font-size-xl);--option-label-font-size:var(--luzmo-font-size-xl);--option-shortcut-font-size:var(--luzmo-font-size-l);--option-label-text-to-visual:calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--option-label-text-to-control:calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--option-label-inline-edge-to-content:calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--option-top-edge-to-text:var(--luzmo-spacing-4);--option-bottom-edge-to-text:calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1));--option-description-font-size:var(--luzmo-font-size);--options-section-header-font-size:var(--luzmo-font-size-xl);--options-section-header-min-width:var(--luzmo-component-height-xl);--option-selectable-edge-to-text-not-selected:calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--option-checkmark-size:var(--luzmo-font-size);--option-checkbox-size:var(--luzmo-font-size);--option-top-to-checkmark:calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--option-top-to-checkbox:calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1))}@media (forced-colors:active){:host{--highcontrast-option-background-color-default:ButtonFace;--highcontrast-option-color-default:ButtonText;--highcontrast-option-background-color-focus:Highlight;--highcontrast-option-color-focus:HighlightText;--highcontrast-options-checkmark-icon-color-default:Highlight;--highcontrast-options-checkbox-icon-color-default:Highlight;--highcontrast-option-color-disabled:GrayText;--highcontrast-option-focus-indicator-color:Highlight;--highcontrast-option-selected-background-color:Highlight;--highcontrast-option-selected-color:HighlightText}@supports (color:SelectedItem){:host{--highcontrast-option-selected-background-color:SelectedItem;--highcontrast-option-selected-color:SelectedItemText}}}:host{inline-size:auto;inline-size:var(--luzmo-options-inline-size,auto);box-sizing:border-box;max-height:var(--luzmo-options-max-height,var(--options-max-height));margin:0;padding:0;list-style-type:none;display:inline-block;overflow:auto}:host::-webkit-scrollbar{width:var(--luzmo-options-scrollbar-width,var(--options-scrollbar-width));height:var(--luzmo-options-scrollbar-width,var(--options-scrollbar-width))}:host::-webkit-scrollbar-track{background:var(--luzmo-options-scrollbar-track-background,var(--options-scrollbar-track-background));border-radius:var(--luzmo-options-scrollbar-track-border-radius,var(--options-scrollbar-track-border-radius))}:host::-webkit-scrollbar-thumb{background:var(--luzmo-options-scrollbar-thumb-background,var(--options-scrollbar-thumb-background));border-radius:var(--luzmo-options-scrollbar-thumb-border-radius,var(--options-scrollbar-thumb-border-radius))}:host::-webkit-scrollbar-thumb:hover{background:var(--luzmo-options-scrollbar-thumb-hover-background,var(--options-scrollbar-thumb-hover-background))}:host{scrollbar-width:var(--luzmo-scrollbar-width,thin);scrollbar-color:var(--luzmo-options-scrollbar-thumb-background,var(--options-scrollbar-thumb-background)) var(--luzmo-options-scrollbar-track-background,var(--options-scrollbar-track-background))}:host:lang(ja),:host:lang(ko),:host:lang(zh){--option-label-line-height:var(--luzmo-option-label-line-height-cjk,var(--option-label-line-height-cjk));--option-description-line-height:var(--luzmo-option-description-line-height-cjk,var(--option-description-line-height-cjk));--options-section-header-line-height:var(--luzmo-options-section-header-line-height-cjk,var(--options-section-header-line-height-cjk))}luzmo-option{width:100%}.section-header{align-items:center;gap:var(--option-label-text-to-visual);box-sizing:border-box;min-inline-size:var(--options-section-header-min-width);padding-block:var(--option-top-edge-to-text) var(--option-bottom-edge-to-text);padding-inline:var(--option-label-inline-edge-to-content);font-family:var(--luzmo-font-family);font-size:var(--luzmo-options-section-header-font-size,var(--options-section-header-font-size));font-weight:var(--luzmo-options-section-header-font-weight,var(--options-section-header-font-weight));line-height:var(--luzmo-options-section-header-line-height,var(--options-section-header-line-height));color:var(--luzmo-options-section-header-color,var(--options-section-header-color));flex-shrink:0;display:flex}.section-header-label{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}#pending{height:var(--options-pending-height);padding-inline:var(--pending-inline-edge-to-content);flex-shrink:0;align-items:center;display:flex}:host{flex-direction:column;width:100%;display:inline-flex}:host(:focus){outline:none}::slotted(*){flex-shrink:0}`;customElements.get(`lit-virtualizer`)||customElements.define(`lit-virtualizer`,X);var re=t=>e`
26
- <luzmo-icon
27
- block
28
- .icon=${g}
29
- style="transition: transform var(--luzmo-animation-duration, 130ms) ease; transform: rotate(${t?`90deg`:`0deg`})"
30
- ></luzmo-icon>
31
- `;function ie(e){return typeof e==`object`&&(!!e?.header||!!e?.divider)}var ae=25;function oe(e,t){return!!t&&(e===t||e.contains(t))}var $=class extends o(p,{noDefaultSize:!0}){static get styles(){return[i(ne)]}get _flattenedOptions(){let e=[];for(let t of this.options)if(e.push(t),t.children?.length&&t.value!==void 0&&this._expandedValues.has(t.value))for(let n of t.children)e.push({...n,_isChild:!0,_parentValue:t.value});return e}get _flatVirtualizeActive(){let e=this.options.length;for(let t of this.options)t.children?.length&&(e+=t.children.length);return e>25}toggleExpand(e){let t=e.value;if(t===void 0)return;let n=new Set(this._expandedValues);n.has(t)?n.delete(t):n.add(t),this._expandedValues=n}constructor(){super(),this.label=``,this.variant=`highlight`,this.selects=`single`,this.emphasized=!1,this.pending=!1,this.options=[],this.value=[],this.focusedOptionIndex=0,this._selectedOptions=[],this._firstVisibleIndex=0,this._expandedValues=/* @__PURE__ */ new Set,this.addEventListener(`focusin`,this.handleFocusin),this.addEventListener(`blur`,this.handleBlur)}firstUpdated(e){super.firstUpdated(e),this.hasAttribute(`tabindex`)||(this.tabIndex=0);let t=[new Promise(e=>requestAnimationFrame(()=>e(!0)))];[...this.children].forEach(e=>{e.localName===`luzmo-option`&&t.push(e.updateComplete)}),this.optionElementsUpdated=Promise.all(t)}willUpdate(e){e.has(`selects`)&&this.selects===`single`&&this.value?.length>1&&(this.value=this.value.slice(0,1))}updated(e){super.updated(e),e.has(`label`)&&(this.label||e.get(`label`)!==void 0)&&(this.label?this.setAttribute(`aria-label`,this.label):this.removeAttribute(`aria-label`)),e.has(`pending`)&&(this.pending?this.setAttribute(`aria-busy`,`true`):this.removeAttribute(`aria-busy`))}async getUpdateComplete(){let e=await super.getUpdateComplete();return await this.optionElementsUpdated,e}focus({preventScroll:e}={}){super.focus({preventScroll:e}),this.focusOptionByOffset(0)}_removeFocusedPropertyOnOptions(){requestAnimationFrame(()=>{this.visibleOptionElements.forEach(e=>{e.focused=!1})})}scrollToTop(){this.scrollTop=0}handleFocusin(){this.startListeningToKeyboard()}handleBlur(e){oe(this,e.relatedTarget)||(this.stopListeningToKeyboard(),this._removeFocusedPropertyOnOptions(),this.removeAttribute(`aria-activedescendant`))}startListeningToKeyboard(){this.addEventListener(`keydown`,this.handleKeydown)}stopListeningToKeyboard(){this.removeEventListener(`keydown`,this.handleKeydown)}handleKeydown(e){if(e.defaultPrevented)return;let t=this._flattenedOptions,n=this.focusedOptionIndex,r=[...this.visibleOptionElements].find(e=>e.value?.toString()===t?.[n]?.value?.toString()),{key:i}=e;if(i===`Tab`)this.prepareToCleanUp();else if(i===` `||i===`Enter`){e.preventDefault();let i=t?.[n];r&&i&&(i.children?.length?this.toggleExpand(i):this.toggleOption(e,i))}else(i===`ArrowDown`||i===`ArrowUp`)&&(e.preventDefault(),this.navigateWithinOptions(e,r))}navigateWithinOptions(e,t){let{key:n}=e,r=n===`ArrowDown`?1:-1;e.preventDefault(),e.stopPropagation();let i=this.focusOptionByOffset(r,t,!0);i!==t&&(this._flatVirtualizeActive||i?.scrollIntoView({block:`nearest`}))}focusOptionByOffset(e,t,n){let r=this._flattenedOptions,i=e||1;t&&(t.focused=!1);let a=this.focusedOptionIndex;this.focusedOptionIndex=r.length>0?(r.length+this.focusedOptionIndex+e)%r.length:0;let o=r[this.focusedOptionIndex],s=r.length;for(;(o?.disabled||o?.divider||o?.header)&&s;)--s,this.focusedOptionIndex=(r.length+this.focusedOptionIndex+i)%r.length,o=r[this.focusedOptionIndex];let c=a<this.focusedOptionIndex&&e===-1,l=a>this.focusedOptionIndex&&e===1;(c||l)&&(this.focusedOptionIndex=a,this.dispatchEvent(new Event(`luzmo-exceeded-${c?`top`:`bottom`}`,{bubbles:!0,composed:!0,cancelable:!0})));let u;return n&&this._flatVirtualizeActive&&(u=[...this.visibleOptionElements].find(e=>e.value?.toString()===r[this.focusedOptionIndex]?.value?.toString()),u||(this.focusedOptionIndex=this._firstVisibleIndex)),this._flatVirtualizeActive&&n&&this.virtualizer.element(this.focusedOptionIndex)?.scrollIntoView({behavior:`smooth`,block:`nearest`}),u??=[...this.visibleOptionElements].find(e=>(e.value===null?null:e.value?.toString())===(r[this.focusedOptionIndex]?.value===null?r[this.focusedOptionIndex]?.value:r[this.focusedOptionIndex]?.value?.toString())),o?.disabled||this.setFocusedAndActiveDescendant(u),u}updateSelectedItemIndex(){this.focusedOptionIndex=this._flatVirtualizeActive?this._firstVisibleIndex:0}setSelectedOptionsFromValue(){this._selectedOptions=this.options.filter(e=>Array.isArray(this.value)&&this.value?.includes(e?.value??null))}visibilityChanged(e){this._firstVisibleIndex=e?.first??0}rangeChange(e){e.stopPropagation(),e.preventDefault(),e?.first!==-1&&e?.last!==-1&&this.dispatchEvent(new CustomEvent(`luzmo-scrolled`,{bubbles:!0,composed:!0,cancelable:!0,detail:{first:e.first,last:e.last}}))}async toggleOption(e,t){let n=e instanceof KeyboardEvent,r=this._flattenedOptions.findIndex(e=>e?.value===t?.value);this.focusedOptionIndex=r,this.visibleOptionElements.forEach(e=>{if(n){let n=(e?.value===null?null:e.value?.toString())===(t?.value===null?null:t?.value?.toString());e.focused=n,n&&this.setFocusedAndActiveDescendant(e)}else e.focused=!1});let i=Array.isArray(this.value)&&this.value?.includes(t?.value??null);this.selects===`single`?(this.value=[t?.value],this._selectedOptions=[t]):(this.value=i?this.value.filter(e=>e!==t?.value):[...this.value??[],t?.value],this._selectedOptions=i?this._selectedOptions.filter(e=>e.value!==t.value):[...this._selectedOptions,t]),await this.updateComplete,this.dispatchEvent(new CustomEvent(`change`,{bubbles:!0,cancelable:!0,composed:!0,detail:{value:this.value??[]}})),this.prepareToCleanUp()}handleOptionClick(e,t){this.toggleOption(t,e)}handleExpandClick(e){this.toggleExpand(e)}render(){let n=t=>e`<luzmo-icon
32
- slot="icon"
33
- .icon=${t}
34
- .size=${this.size}
35
- ></luzmo-icon>`,r=t=>e`<span slot="description">${t}</span>`,i=t=>e`<luzmo-icon
36
- slot="icon"
37
- data-option-thumbnail
38
- .src=${t}
39
- .size=${this.size}
40
- ></luzmo-icon>`,a=a=>{let o=a?.value,s=a?.label,c=a?.description,l=a?.shortcut,u=a?.icon,d=a?.imgSrc,f=a?.divider,p=typeof a==`string`?void 0:a?.disabled,m=!!(a.children&&a.children.length>0),h=!!a._isChild,g=m&&o!==void 0&&this._expandedValues.has(o);if(f)return e`<luzmo-options-divider
41
- role="presentation"
42
- ></luzmo-options-divider>`;let _=this.optionIconRenderer?.(a,{size:this.size??`m`})??(u?n(u):d?i(d):t);if(a?.header)return e`<div class="section-header" role="presentation">
43
- ${_}
44
- <span class="section-header-label">${s}</span>
45
- </div>`;if(m){let n=Array.isArray(this.value)&&a.children.some(e=>this.value.includes(e.value));return e`<luzmo-option
46
- .value=${o}
47
- .size=${this.size}
48
- .variant=${this.variant}
49
- ?emphasized=${this.emphasized}
50
- ?no-wrap=${this.noWrap}
51
- ?disabled=${p}
52
- expandable
53
- ?expanded=${g}
54
- ?has-selected-child=${n}
55
- .selected=${!1}
56
- role="option"
57
- aria-expanded=${g?`true`:`false`}
58
- @click=${e=>{e.stopPropagation(),this.handleExpandClick(a)}}
59
- >
60
- ${_} ${s}
61
- ${c?r(c):t}
62
- <span slot="value">${re(g)}</span>
63
- </luzmo-option>`}return e`<luzmo-option
64
- .value=${o}
65
- .size=${this.size}
66
- .variant=${this.variant}
67
- ?emphasized=${this.emphasized}
68
- ?no-wrap=${this.noWrap}
69
- ?disabled=${p}
70
- ?child-option=${h}
71
- .selected=${Array.isArray(this.value)?this.value?.includes(o):!1}
72
- .role=${this.selects===`single`?`option`:`optioncheckbox`}
73
- @click=${this.handleOptionClick.bind(this,a)}
74
- >
75
- ${_} ${s}
76
- ${c?r(c):t}
77
- ${l?e`<kbd slot="value">${l}</kbd>`:t}
78
- </luzmo-option>`},o=this._flattenedOptions,s=this._flatVirtualizeActive?e`<lit-virtualizer
79
- role="presentation"
80
- .items=${o}
81
- .renderItem=${a}
82
- @rangeChanged=${this.rangeChange}
83
- @visibilityChanged=${this.visibilityChanged}
84
- ></lit-virtualizer>`:T(o,a),c=this.pending?e`<div id="pending" aria-hidden="true">
85
- <luzmo-progress-circle
86
- indeterminate
87
- label="Loading"
88
- ></luzmo-progress-circle>
89
- </div>`:t;return e`${s} ${c}`}connectedCallback(){super.connectedCallback(),this.setAttribute(`role`,`listbox`),this.updateComplete.then(()=>this.updateItemFocus())}disconnectedCallback(){super.disconnectedCallback()}prepareToCleanUp(){document.addEventListener(`focusout`,()=>{requestAnimationFrame(()=>{this.updateSelectedItemIndex()})},{once:!0})}updateItemFocus(){if(this.visibleOptionElements.length===0)return;let e=this._flattenedOptions,t=this.focusedOptionIndex,n=[...this.visibleOptionElements].find(n=>(n.value===null?null:n.value?.toString())===(e?.[t]?.value===null?null:e?.[t]?.value?.toString()));this.setFocusedAndActiveDescendant(n)}setFocusedAndActiveDescendant(e){if(!e)return;let t=this.hasVisibleFocusInTree()||!!(this.visibleOptionElements?.some&&this.visibleOptionElements?.some(e=>e.hasVisibleFocusInTree()));e.focused=t,t&&this.setAttribute(`aria-activedescendant`,e.id)}};l([h({type:String,reflect:!0})],$.prototype,`label`,void 0),l([h({type:String,reflect:!0})],$.prototype,`variant`,void 0),l([h({type:String,reflect:!0})],$.prototype,`selects`,void 0),l([h({type:Boolean,reflect:!0})],$.prototype,`emphasized`,void 0),l([h({type:Boolean,reflect:!0})],$.prototype,`pending`,void 0),l([h({type:Array,hasChanged(e,t){return JSON.stringify(e??[])!==JSON.stringify(t??[])}})],$.prototype,`options`,void 0),l([h({type:Boolean,reflect:!0,attribute:`no-wrap`})],$.prototype,`noWrap`,void 0),l([h({type:Array,hasChanged(e,t){return JSON.stringify(e??[])!==JSON.stringify(t??[])}})],$.prototype,`value`,void 0),l([h({attribute:!1})],$.prototype,`optionIconRenderer`,void 0),l([s(`lit-virtualizer`)],$.prototype,`virtualizer`,void 0),l([c(`luzmo-option`)],$.prototype,`visibleOptionElements`,void 0),l([m()],$.prototype,`_expandedValues`,void 0),customElements.get(`luzmo-options`)||customElements.define(`luzmo-options`,$),customElements.get(`luzmo-options-divider`)||customElements.define(`luzmo-options-divider`,Q),customElements.get(`luzmo-option`)||customElements.define(`luzmo-option`,j);export{j as a,Q as i,ae as n,ie as r,$ as t};