@govtechsg/sgds-web-component 3.21.2-rc.0 → 3.21.2-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/Button/index.umd.min.js +5 -3
- package/components/Button/index.umd.min.js.map +1 -1
- package/components/Button/sgds-button.d.ts +4 -0
- package/components/Button/sgds-button.js +8 -0
- package/components/Button/sgds-button.js.map +1 -1
- package/components/ComboBox/index.umd.min.js +17 -9
- package/components/ComboBox/index.umd.min.js.map +1 -1
- package/components/ComboBox/sgds-combo-box.js +10 -2
- package/components/ComboBox/sgds-combo-box.js.map +1 -1
- package/components/Datepicker/datepicker-calendar.js +41 -30
- package/components/Datepicker/datepicker-calendar.js.map +1 -1
- package/components/Datepicker/datepicker-calendar2.js +1 -1
- package/components/Datepicker/datepicker-header.js +4 -3
- package/components/Datepicker/datepicker-header.js.map +1 -1
- package/components/Datepicker/index.umd.min.js +59 -46
- package/components/Datepicker/index.umd.min.js.map +1 -1
- package/components/Datepicker/sgds-datepicker.js +2 -2
- package/components/Datepicker/sgds-datepicker.js.map +1 -1
- package/components/FileUpload/index.umd.min.js +4 -2
- package/components/FileUpload/index.umd.min.js.map +1 -1
- package/components/Pagination/index.umd.min.js +4 -2
- package/components/Pagination/index.umd.min.js.map +1 -1
- package/components/Select/index.umd.min.js +10 -2
- package/components/Select/index.umd.min.js.map +1 -1
- package/components/Select/sgds-select.js +10 -2
- package/components/Select/sgds-select.js.map +1 -1
- package/components/index.umd.min.js +70 -41
- package/components/index.umd.min.js.map +1 -1
- package/custom-elements.json +37 -1
- package/index.umd.min.js +70 -41
- package/index.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/react/components/Button/sgds-button.cjs.js +8 -0
- package/react/components/Button/sgds-button.cjs.js.map +1 -1
- package/react/components/Button/sgds-button.js +8 -0
- package/react/components/Button/sgds-button.js.map +1 -1
- package/react/components/ComboBox/sgds-combo-box.cjs.js +10 -2
- package/react/components/ComboBox/sgds-combo-box.cjs.js.map +1 -1
- package/react/components/ComboBox/sgds-combo-box.js +10 -2
- package/react/components/ComboBox/sgds-combo-box.js.map +1 -1
- package/react/components/Datepicker/datepicker-calendar.cjs.js +41 -30
- package/react/components/Datepicker/datepicker-calendar.cjs.js.map +1 -1
- package/react/components/Datepicker/datepicker-calendar.cjs2.js +1 -1
- package/react/components/Datepicker/datepicker-calendar.js +41 -30
- package/react/components/Datepicker/datepicker-calendar.js.map +1 -1
- package/react/components/Datepicker/datepicker-calendar2.js +1 -1
- package/react/components/Datepicker/datepicker-header.cjs.js +4 -3
- package/react/components/Datepicker/datepicker-header.cjs.js.map +1 -1
- package/react/components/Datepicker/datepicker-header.js +4 -3
- package/react/components/Datepicker/datepicker-header.js.map +1 -1
- package/react/components/Datepicker/sgds-datepicker.cjs.js +2 -2
- package/react/components/Datepicker/sgds-datepicker.cjs.js.map +1 -1
- package/react/components/Datepicker/sgds-datepicker.js +2 -2
- package/react/components/Datepicker/sgds-datepicker.js.map +1 -1
- package/react/components/Select/sgds-select.cjs.js +10 -2
- package/react/components/Select/sgds-select.cjs.js.map +1 -1
- package/react/components/Select/sgds-select.js +10 -2
- package/react/components/Select/sgds-select.js.map +1 -1
- package/react/utils/formSubmitController.cjs.js +5 -0
- package/react/utils/formSubmitController.cjs.js.map +1 -1
- package/react/utils/formSubmitController.js +5 -0
- package/react/utils/formSubmitController.js.map +1 -1
- package/types/react.d.ts +4 -0
- package/utils/formSubmitController.js +5 -0
- package/utils/formSubmitController.js.map +1 -1
|
@@ -16,6 +16,10 @@ export declare class SgdsButton extends ButtonElement {
|
|
|
16
16
|
static styles: import("lit").CSSResult[];
|
|
17
17
|
/** @internal */
|
|
18
18
|
private readonly formSubmitController;
|
|
19
|
+
/** The name of the button, submitted as a name/value pair with form data only when this button is the submitter. Only works with `type="submit"`. Has no effect when the button is rendered as a link (i.e. when `href` is set). */
|
|
20
|
+
name: string;
|
|
21
|
+
/** The value of the button, submitted as a name/value pair with form data only when this button is the submitter. Only works with `type="submit"`. Has no effect when the button is rendered as a link (i.e. when `href` is set). */
|
|
22
|
+
value: string;
|
|
19
23
|
/** The behavior of the button with default as `type='button', `reset` resets all the controls to their initial values and `submit` submits the form data to the server */
|
|
20
24
|
type: "button" | "submit" | "reset";
|
|
21
25
|
/**
|
|
@@ -87,6 +87,8 @@ class SgdsButton extends ButtonElement {
|
|
|
87
87
|
})}"
|
|
88
88
|
?disabled=${ifDefined(isLink ? undefined : this.disabled)}
|
|
89
89
|
type=${ifDefined(isLink ? undefined : this.type)}
|
|
90
|
+
name=${ifDefined(isLink ? undefined : this.name)}
|
|
91
|
+
value=${ifDefined(isLink ? undefined : this.value)}
|
|
90
92
|
href=${ifDefined(isLink ? this.href : undefined)}
|
|
91
93
|
target=${ifDefined(isLink ? this.target : undefined)}
|
|
92
94
|
download=${ifDefined(isLink ? this.download : undefined)}
|
|
@@ -114,6 +116,12 @@ class SgdsButton extends ButtonElement {
|
|
|
114
116
|
}
|
|
115
117
|
}
|
|
116
118
|
SgdsButton.styles = [...ButtonElement.styles, css_248z, css_248z$1];
|
|
119
|
+
__decorate([
|
|
120
|
+
property({ type: String, reflect: true })
|
|
121
|
+
], SgdsButton.prototype, "name", void 0);
|
|
122
|
+
__decorate([
|
|
123
|
+
property({ type: String, reflect: true })
|
|
124
|
+
], SgdsButton.prototype, "value", void 0);
|
|
117
125
|
__decorate([
|
|
118
126
|
property({ type: String, reflect: true })
|
|
119
127
|
], SgdsButton.prototype, "type", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sgds-button.js","sources":["../../../src/components/Button/sgds-button.ts"],"sourcesContent":["import { property } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport { html, literal } from \"lit/static-html.js\";\nimport ButtonElement from \"../../base/button-element\";\nimport { HasSlotController } from \"../../utils/slot\";\nimport { FormSubmitController } from \"../../utils/formSubmitController\";\nimport anchorStyles from \"../../styles/anchor.css\";\nimport buttonStyles from \"./button.css\";\n\nexport type ButtonVariant = \"primary\" | \"outline\" | \"ghost\" | \"danger\";\n\n/**\n * @summary Custom button styles for actions in forms, dialogs, and more with support for multiple sizes, states, and more.\n *\n * @slot default - The button's label.\n * @slot leftIcon - The slot for icon to the left of the button text\n * @slot rightIcon - The slot for icon to the right of the button text\n *\n * @event sgds-blur - Emitted when the button is blurred.\n * @event sgds-focus - Emitted when the button is focused.\n *\n *\n */\nexport class SgdsButton extends ButtonElement {\n static styles = [...ButtonElement.styles, anchorStyles, buttonStyles];\n\n /** @internal */\n private readonly formSubmitController = new FormSubmitController(this, {\n form: (input: HTMLInputElement) => {\n // Buttons support a form attribute that points to an arbitrary form, so if this attribute it set we need to query\n // the form from the same root using its id\n if (input.hasAttribute(\"form\")) {\n const doc = input.getRootNode() as Document | ShadowRoot;\n const formId = input.getAttribute(\"form\");\n return doc.getElementById(formId) as HTMLFormElement;\n }\n\n // Fall back to the closest containing form\n return input.closest(\"form\");\n }\n });\n /** The behavior of the button with default as `type='button', `reset` resets all the controls to their initial values and `submit` submits the form data to the server */\n @property({ type: String, reflect: true }) type: \"button\" | \"submit\" | \"reset\" = \"button\";\n /**\n * The \"form owner\" to associate the button with. If omitted, the closest containing form will be used instead. The\n * value of this attribute must be an id of a form in the same document or shadow root as the button.\n */\n @property({ type: String, reflect: true }) form: string;\n\n /** Used to override the form owner's `action` attribute. */\n @property({ type: String, reflect: true, attribute: \"formaction\" }) formAction: string;\n\n /** Used to override the form owner's `method` attribute. */\n @property({ type: String, reflect: true, attribute: \"formmethod\" }) formMethod: \"post\" | \"get\";\n\n /** Used to override the form owner's `novalidate` attribute. */\n @property({ attribute: \"formnovalidate\", type: Boolean, reflect: true })\n formNoValidate: boolean;\n\n /** Used to override the form owner's `target` attribute. */\n @property({ type: String, reflect: true, attribute: \"formtarget\" }) formTarget:\n | \"_self\"\n | \"_blank\"\n | \"_parent\"\n | \"_top\"\n | string;\n\n /** When set, the button will be in full width. */\n @property({ type: Boolean, reflect: true }) fullWidth = false;\n\n /** Used only for SSR to indicate the presence of the `leftIcon` slot. */\n @property({ type: Boolean }) hasLeftIconSlot = false;\n\n /** Used only for SSR to indicate the presence of the `rightIcon` slot. */\n @property({ type: Boolean }) hasRightIconSlot = false;\n\n private readonly hasSlotController = new HasSlotController(this, \"leftIcon\", \"rightIcon\");\n\n updated() {\n if (!this.hasLeftIconSlot) this.hasLeftIconSlot = this.hasSlotController.test(\"leftIcon\");\n if (!this.hasRightIconSlot) this.hasRightIconSlot = this.hasSlotController.test(\"rightIcon\");\n }\n\n protected override _handleClick(event: MouseEvent) {\n if (this.disabled || this.loading) {\n event.preventDefault();\n event.stopPropagation();\n return;\n }\n this.removeEventListener(\"click\", this._clickHandler);\n this.addEventListener(\"click\", this._clickHandler);\n }\n\n private _clickHandler = () => {\n if (this.type === \"submit\") {\n this.formSubmitController.submit(this);\n }\n if (this.type === \"reset\") {\n this.formSubmitController.reset(this);\n }\n };\n\n render() {\n const isLink = this.href;\n const tag = isLink ? literal`a` : literal`button`;\n const noIcon = !this.hasLeftIconSlot && !this.hasRightIconSlot;\n\n return html`\n <${tag}\n class=\"btn ${classMap({\n disabled: this.disabled,\n active: this.active,\n \"has-left-icon\": this.hasLeftIconSlot,\n \"has-right-icon\": this.hasRightIconSlot,\n \"no-icon\": noIcon,\n loading: this.loading\n })}\"\n ?disabled=${ifDefined(isLink ? undefined : this.disabled)}\n type=${ifDefined(isLink ? undefined : this.type)}\n href=${ifDefined(isLink ? this.href : undefined)}\n target=${ifDefined(isLink ? this.target : undefined)}\n download=${ifDefined(isLink ? this.download : undefined)}\n rel=${ifDefined(isLink && this.target === \"_blank\" ? \"noreferrer noopener\" : undefined)}\n role=${ifDefined(isLink ? \"button\" : undefined)}\n aria-disabled=${this.disabled || this.loading ? \"true\" : \"false\"}\n tabindex=${this.disabled ? \"-1\" : \"0\"}\n @click=${this._handleClick}\n @keydown=${this._handleKeydown}\n @focus=${this._handleFocus}\n @blur=${this._handleBlur}\n aria-label=${ifDefined(this.loading ? \"Loading\" : this.ariaLabel)}\n >\n ${\n this.loading\n ? html`<sgds-spinner\n size=${ifDefined(this._assignSpinnerSize(this.size))}\n tone=${ifDefined(this._assignSpinnerTone(this.tone, this.variant))}\n ></sgds-spinner>`\n : html`<slot name=\"leftIcon\"></slot>\n <span><slot></slot></span>\n <slot name=\"rightIcon\"></slot>`\n }\n \n </${tag}>\n `;\n }\n}\n\nexport default SgdsButton;\n"],"names":["anchorStyles","buttonStyles"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"sgds-button.js","sources":["../../../src/components/Button/sgds-button.ts"],"sourcesContent":["import { property } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport { html, literal } from \"lit/static-html.js\";\nimport ButtonElement from \"../../base/button-element\";\nimport { HasSlotController } from \"../../utils/slot\";\nimport { FormSubmitController } from \"../../utils/formSubmitController\";\nimport anchorStyles from \"../../styles/anchor.css\";\nimport buttonStyles from \"./button.css\";\n\nexport type ButtonVariant = \"primary\" | \"outline\" | \"ghost\" | \"danger\";\n\n/**\n * @summary Custom button styles for actions in forms, dialogs, and more with support for multiple sizes, states, and more.\n *\n * @slot default - The button's label.\n * @slot leftIcon - The slot for icon to the left of the button text\n * @slot rightIcon - The slot for icon to the right of the button text\n *\n * @event sgds-blur - Emitted when the button is blurred.\n * @event sgds-focus - Emitted when the button is focused.\n *\n *\n */\nexport class SgdsButton extends ButtonElement {\n static styles = [...ButtonElement.styles, anchorStyles, buttonStyles];\n\n /** @internal */\n private readonly formSubmitController = new FormSubmitController(this, {\n form: (input: HTMLInputElement) => {\n // Buttons support a form attribute that points to an arbitrary form, so if this attribute it set we need to query\n // the form from the same root using its id\n if (input.hasAttribute(\"form\")) {\n const doc = input.getRootNode() as Document | ShadowRoot;\n const formId = input.getAttribute(\"form\");\n return doc.getElementById(formId) as HTMLFormElement;\n }\n\n // Fall back to the closest containing form\n return input.closest(\"form\");\n }\n });\n /** The name of the button, submitted as a name/value pair with form data only when this button is the submitter. Only works with `type=\"submit\"`. Has no effect when the button is rendered as a link (i.e. when `href` is set). */\n @property({ type: String, reflect: true }) name: string;\n\n /** The value of the button, submitted as a name/value pair with form data only when this button is the submitter. Only works with `type=\"submit\"`. Has no effect when the button is rendered as a link (i.e. when `href` is set). */\n @property({ type: String, reflect: true }) value: string;\n\n /** The behavior of the button with default as `type='button', `reset` resets all the controls to their initial values and `submit` submits the form data to the server */\n @property({ type: String, reflect: true }) type: \"button\" | \"submit\" | \"reset\" = \"button\";\n /**\n * The \"form owner\" to associate the button with. If omitted, the closest containing form will be used instead. The\n * value of this attribute must be an id of a form in the same document or shadow root as the button.\n */\n @property({ type: String, reflect: true }) form: string;\n\n /** Used to override the form owner's `action` attribute. */\n @property({ type: String, reflect: true, attribute: \"formaction\" }) formAction: string;\n\n /** Used to override the form owner's `method` attribute. */\n @property({ type: String, reflect: true, attribute: \"formmethod\" }) formMethod: \"post\" | \"get\";\n\n /** Used to override the form owner's `novalidate` attribute. */\n @property({ attribute: \"formnovalidate\", type: Boolean, reflect: true })\n formNoValidate: boolean;\n\n /** Used to override the form owner's `target` attribute. */\n @property({ type: String, reflect: true, attribute: \"formtarget\" }) formTarget:\n | \"_self\"\n | \"_blank\"\n | \"_parent\"\n | \"_top\"\n | string;\n\n /** When set, the button will be in full width. */\n @property({ type: Boolean, reflect: true }) fullWidth = false;\n\n /** Used only for SSR to indicate the presence of the `leftIcon` slot. */\n @property({ type: Boolean }) hasLeftIconSlot = false;\n\n /** Used only for SSR to indicate the presence of the `rightIcon` slot. */\n @property({ type: Boolean }) hasRightIconSlot = false;\n\n private readonly hasSlotController = new HasSlotController(this, \"leftIcon\", \"rightIcon\");\n\n updated() {\n if (!this.hasLeftIconSlot) this.hasLeftIconSlot = this.hasSlotController.test(\"leftIcon\");\n if (!this.hasRightIconSlot) this.hasRightIconSlot = this.hasSlotController.test(\"rightIcon\");\n }\n\n protected override _handleClick(event: MouseEvent) {\n if (this.disabled || this.loading) {\n event.preventDefault();\n event.stopPropagation();\n return;\n }\n this.removeEventListener(\"click\", this._clickHandler);\n this.addEventListener(\"click\", this._clickHandler);\n }\n\n private _clickHandler = () => {\n if (this.type === \"submit\") {\n this.formSubmitController.submit(this);\n }\n if (this.type === \"reset\") {\n this.formSubmitController.reset(this);\n }\n };\n\n render() {\n const isLink = this.href;\n const tag = isLink ? literal`a` : literal`button`;\n const noIcon = !this.hasLeftIconSlot && !this.hasRightIconSlot;\n\n return html`\n <${tag}\n class=\"btn ${classMap({\n disabled: this.disabled,\n active: this.active,\n \"has-left-icon\": this.hasLeftIconSlot,\n \"has-right-icon\": this.hasRightIconSlot,\n \"no-icon\": noIcon,\n loading: this.loading\n })}\"\n ?disabled=${ifDefined(isLink ? undefined : this.disabled)}\n type=${ifDefined(isLink ? undefined : this.type)}\n name=${ifDefined(isLink ? undefined : this.name)}\n value=${ifDefined(isLink ? undefined : this.value)}\n href=${ifDefined(isLink ? this.href : undefined)}\n target=${ifDefined(isLink ? this.target : undefined)}\n download=${ifDefined(isLink ? this.download : undefined)}\n rel=${ifDefined(isLink && this.target === \"_blank\" ? \"noreferrer noopener\" : undefined)}\n role=${ifDefined(isLink ? \"button\" : undefined)}\n aria-disabled=${this.disabled || this.loading ? \"true\" : \"false\"}\n tabindex=${this.disabled ? \"-1\" : \"0\"}\n @click=${this._handleClick}\n @keydown=${this._handleKeydown}\n @focus=${this._handleFocus}\n @blur=${this._handleBlur}\n aria-label=${ifDefined(this.loading ? \"Loading\" : this.ariaLabel)}\n >\n ${\n this.loading\n ? html`<sgds-spinner\n size=${ifDefined(this._assignSpinnerSize(this.size))}\n tone=${ifDefined(this._assignSpinnerTone(this.tone, this.variant))}\n ></sgds-spinner>`\n : html`<slot name=\"leftIcon\"></slot>\n <span><slot></slot></span>\n <slot name=\"rightIcon\"></slot>`\n }\n \n </${tag}>\n `;\n }\n}\n\nexport default SgdsButton;\n"],"names":["anchorStyles","buttonStyles"],"mappings":"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"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Copyright 2017 Google LLC
|
|
5
5
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
6
6
|
*/
|
|
7
|
-
const t=globalThis,i=e=>{t.emitLitDebugLogEvents&&t.dispatchEvent(new CustomEvent("lit-debug",{detail:e}))};let l,a=0;t.litIssuedWarnings??=new Set,l=(e,i)=>{i+=e?` See https://lit.dev/msg/${e} for more information.`:"",t.litIssuedWarnings.has(i)||t.litIssuedWarnings.has(e)||(console.warn(i),t.litIssuedWarnings.add(i))},queueMicrotask(()=>{l("dev-mode","Lit is in dev mode. Not recommended for production!")});const o=t.ShadyDOM?.inUse&&!0===t.ShadyDOM?.noPatch?t.ShadyDOM.wrap:e=>e,s=t.trustedTypes,n=s?s.createPolicy("lit-html",{createHTML:e=>e}):void 0,r=e=>e,c=(e,t,i)=>r,d=e=>{if(T!==c)throw new Error("Attempted to overwrite existing lit-html security policy. setSanitizeDOMValueFactory should be called at most once.");T=e},h=()=>{T=c},v=(e,t,i)=>T(e,t,i),u="$lit$",p=`lit$${Math.random().toFixed(9).slice(2)}$`,g="?"+p,f=`<${g}>`,m=document,w=()=>m.createComment(""),b=e=>null===e||"object"!=typeof e&&"function"!=typeof e,x=Array.isArray,y=e=>x(e)||"function"==typeof e?.[Symbol.iterator],C="[ \t\n\f\r]",Z=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,_=/-->/g,M=/>/g,V=new RegExp(`>|${C}(?:([^\\s"'>=/]+)(${C}*=${C}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),k=/'/g,H=/"/g,$=/^(?:script|style|textarea|title)$/i,S=(B=1,(e,...t)=>(e.some(e=>void 0===e)&&console.warn("Some template strings are undefined.\nThis is probably caused by illegal octal escape sequences."),t.some(e=>e?._$litStatic$)&&l("","Static values 'literal' or 'unsafeStatic' cannot be used as values to non-static templates.\nPlease use the static 'html' tag function. See https://lit.dev/docs/templates/expressions/#static-expressions"),{_$litType$:B,strings:e,values:t}));var B;const A=Symbol.for("lit-noChange"),L=Symbol.for("lit-nothing"),E=new WeakMap,I=m.createTreeWalker(m,129);let T=c;function P(e,t){if(!x(e)||!e.hasOwnProperty("raw")){let e="invalid template strings array";throw e="\n Internal Error: expected template strings to be an array\n with a 'raw' field. Faking a template strings array by\n calling html or svg like an ordinary function is effectively\n the same as calling unsafeHtml and can lead to major security\n issues, e.g. opening your code up to XSS attacks.\n If you're using the html or svg tagged template functions normally\n and still seeing this error, please file a bug at\n https://github.com/lit/lit/issues/new?template=bug_report.md\n and include information about your build tooling, if any.\n ".trim().replace(/\n */g,"\n"),new Error(e)}return void 0!==n?n.createHTML(t):t}const R=(e,t)=>{const i=e.length-1,l=[];let a,o=2===t?"<svg>":3===t?"<math>":"",s=Z;for(let t=0;t<i;t++){const i=e[t];let n,r,c=-1,d=0;for(;d<i.length&&(s.lastIndex=d,r=s.exec(i),null!==r);)if(d=s.lastIndex,s===Z){if("!--"===r[1])s=_;else if(void 0!==r[1])s=M;else if(void 0!==r[2])$.test(r[2])&&(a=new RegExp(`</${r[2]}`,"g")),s=V;else if(void 0!==r[3])throw new Error("Bindings in tag names are not supported. Please use static templates instead. See https://lit.dev/docs/templates/expressions/#static-expressions")}else s===V?">"===r[0]?(s=a??Z,c=-1):void 0===r[1]?c=-2:(c=s.lastIndex-r[2].length,n=r[1],s=void 0===r[3]?V:'"'===r[3]?H:k):s===H||s===k?s=V:s===_||s===M?s=Z:(s=V,a=void 0);console.assert(-1===c||s===V||s===k||s===H,"unexpected parse state B");const h=s===V&&e[t+1].startsWith("/>")?" ":"";o+=s===Z?i+f:c>=0?(l.push(n),i.slice(0,c)+u+i.slice(c)+p+h):i+p+(-2===c?t:h)}return[P(e,o+(e[i]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),l]};class O{constructor({strings:e,_$litType$:t},a){let o;this.parts=[];let n=0,r=0;const c=e.length-1,d=this.parts,[h,v]=R(e,t);if(this.el=O.createElement(h,a),I.currentNode=this.el.content,2===t||3===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(o=I.nextNode())&&d.length<c;){if(1===o.nodeType){{const e=o.localName;if(/^(?:textarea|template)$/i.test(e)&&o.innerHTML.includes(p)){const t=`Expressions are not supported inside \`${e}\` elements. See https://lit.dev/msg/expression-in-${e} for more information.`;if("template"===e)throw new Error(t);l("",t)}}if(o.hasAttributes())for(const e of o.getAttributeNames())if(e.endsWith(u)){const t=v[r++],i=o.getAttribute(e).split(p),l=/([.?@])?(.*)/.exec(t);d.push({type:1,index:n,name:l[2],strings:i,ctor:"."===l[1]?N:"?"===l[1]?W:"@"===l[1]?q:F}),o.removeAttribute(e)}else e.startsWith(p)&&(d.push({type:6,index:n}),o.removeAttribute(e));if($.test(o.tagName)){const e=o.textContent.split(p),t=e.length-1;if(t>0){o.textContent=s?s.emptyScript:"";for(let i=0;i<t;i++)o.append(e[i],w()),I.nextNode(),d.push({type:2,index:++n});o.append(e[t],w())}}}else if(8===o.nodeType){if(o.data===g)d.push({type:2,index:n});else{let e=-1;for(;-1!==(e=o.data.indexOf(p,e+1));)d.push({type:7,index:n}),e+=p.length-1}}n++}if(v.length!==r)throw new Error('Detected duplicate attribute bindings. This occurs if your template has duplicate attributes on an element tag. For example "<input ?disabled=${true} ?disabled=${false}>" contains a duplicate "disabled" attribute. The error was detected in the following template: \n`'+e.join("${...}")+"`");i&&i({kind:"template prep",template:this,clonableTemplate:this.el,parts:this.parts,strings:e})}static createElement(e,t){const i=m.createElement("template");return i.innerHTML=e,i}}function z(e,t,i=e,l){if(t===A)return t;let a=void 0!==l?i.__directives?.[l]:i.__directive;const o=b(t)?void 0:t._$litDirective$;return a?.constructor!==o&&(a?._$notifyDirectiveConnectionChanged?.(!1),void 0===o?a=void 0:(a=new o(e),a._$initialize(e,i,l)),void 0!==l?(i.__directives??=[])[l]=a:i.__directive=a),void 0!==a&&(t=z(e,a._$resolve(e,t.values),a,l)),t}class D{constructor(e,t){this._$parts=[],this._$disconnectableChildren=void 0,this._$template=e,this._$parent=t}get parentNode(){return this._$parent.parentNode}get _$isConnected(){return this._$parent._$isConnected}_clone(e){const{el:{content:t},parts:i}=this._$template,l=(e?.creationScope??m).importNode(t,!0);I.currentNode=l;let a=I.nextNode(),o=0,s=0,n=i[0];for(;void 0!==n;){if(o===n.index){let t;2===n.type?t=new U(a,a.nextSibling,this,e):1===n.type?t=new n.ctor(a,n.name,n.strings,this,e):6===n.type&&(t=new j(a,this,e)),this._$parts.push(t),n=i[++s]}o!==n?.index&&(a=I.nextNode(),o++)}return I.currentNode=m,l}_update(e){let t=0;for(const l of this._$parts)void 0!==l&&(i&&i({kind:"set part",part:l,value:e[t],valueIndex:t,values:e,templateInstance:this}),void 0!==l.strings?(l._$setValue(e,l,t),t+=l.strings.length-2):l._$setValue(e[t])),t++}}class U{get _$isConnected(){return this._$parent?._$isConnected??this.__isConnected}constructor(e,t,i,l){this.type=2,this._$committedValue=L,this._$disconnectableChildren=void 0,this._$startNode=e,this._$endNode=t,this._$parent=i,this.options=l,this.__isConnected=l?.isConnected??!0,this._textSanitizer=void 0}get parentNode(){let e=o(this._$startNode).parentNode;const t=this._$parent;return void 0!==t&&11===e?.nodeType&&(e=t.parentNode),e}get startNode(){return this._$startNode}get endNode(){return this._$endNode}_$setValue(e,t=this){if(null===this.parentNode)throw new Error("This `ChildPart` has no `parentNode` and therefore cannot accept a value. This likely means the element containing the part was manipulated in an unsupported way outside of Lit's control such that the part's marker nodes were ejected from DOM. For example, setting the element's `innerHTML` or `textContent` can do this.");if(e=z(this,e,t),b(e))e===L||null==e||""===e?(this._$committedValue!==L&&(i&&i({kind:"commit nothing to child",start:this._$startNode,end:this._$endNode,parent:this._$parent,options:this.options}),this._$clear()),this._$committedValue=L):e!==this._$committedValue&&e!==A&&this._commitText(e);else if(void 0!==e._$litType$)this._commitTemplateResult(e);else if(void 0!==e.nodeType){if(this.options?.host===e)return this._commitText("[probable mistake: rendered a template's host in itself (commonly caused by writing ${this} in a template]"),void console.warn("Attempted to render the template host",e,"inside itself. This is almost always a mistake, and in dev mode ","we render some warning text. In production however, we'll ","render it, which will usually result in an error, and sometimes ","in the element disappearing from the DOM.");this._commitNode(e)}else y(e)?this._commitIterable(e):this._commitText(e)}_insert(e){return o(o(this._$startNode).parentNode).insertBefore(e,this._$endNode)}_commitNode(e){if(this._$committedValue!==e){if(this._$clear(),T!==c){const e=this._$startNode.parentNode?.nodeName;if("STYLE"===e||"SCRIPT"===e){let t="Forbidden";throw t="STYLE"===e?"Lit does not support binding inside style nodes. This is a security risk, as style injection attacks can exfiltrate data and spoof UIs. Consider instead using css`...` literals to compose styles, and do dynamic styling with css custom properties, ::parts, <slot>s, and by mutating the DOM rather than stylesheets.":"Lit does not support binding inside script nodes. This is a security risk, as it could allow arbitrary code execution.",new Error(t)}}i&&i({kind:"commit node",start:this._$startNode,parent:this._$parent,value:e,options:this.options}),this._$committedValue=this._insert(e)}}_commitText(e){if(this._$committedValue!==L&&b(this._$committedValue)){const t=o(this._$startNode).nextSibling;void 0===this._textSanitizer&&(this._textSanitizer=v(t,"data","property")),e=this._textSanitizer(e),i&&i({kind:"commit text",node:t,value:e,options:this.options}),t.data=e}else{const t=m.createTextNode("");this._commitNode(t),void 0===this._textSanitizer&&(this._textSanitizer=v(t,"data","property")),e=this._textSanitizer(e),i&&i({kind:"commit text",node:t,value:e,options:this.options}),t.data=e}this._$committedValue=e}_commitTemplateResult(e){const{values:t,_$litType$:l}=e,a="number"==typeof l?this._$getTemplate(e):(void 0===l.el&&(l.el=O.createElement(P(l.h,l.h[0]),this.options)),l);if(this._$committedValue?._$template===a)i&&i({kind:"template updating",template:a,instance:this._$committedValue,parts:this._$committedValue._$parts,options:this.options,values:t}),this._$committedValue._update(t);else{const e=new D(a,this),l=e._clone(this.options);i&&i({kind:"template instantiated",template:a,instance:e,parts:e._$parts,options:this.options,fragment:l,values:t}),e._update(t),i&&i({kind:"template instantiated and updated",template:a,instance:e,parts:e._$parts,options:this.options,fragment:l,values:t}),this._commitNode(l),this._$committedValue=e}}_$getTemplate(e){let t=E.get(e.strings);return void 0===t&&E.set(e.strings,t=new O(e)),t}_commitIterable(e){x(this._$committedValue)||(this._$committedValue=[],this._$clear());const t=this._$committedValue;let i,l=0;for(const a of e)l===t.length?t.push(i=new U(this._insert(w()),this._insert(w()),this,this.options)):i=t[l],i._$setValue(a),l++;l<t.length&&(this._$clear(i&&o(i._$endNode).nextSibling,l),t.length=l)}_$clear(e=o(this._$startNode).nextSibling,t){for(this._$notifyConnectionChanged?.(!1,!0,t);e!==this._$endNode;){const t=o(e).nextSibling;o(e).remove(),e=t}}setConnected(e){if(void 0!==this._$parent)throw new Error("part.setConnected() may only be called on a RootPart returned from render().");this.__isConnected=e,this._$notifyConnectionChanged?.(e)}}class F{get tagName(){return this.element.tagName}get _$isConnected(){return this._$parent._$isConnected}constructor(e,t,i,l,a){this.type=1,this._$committedValue=L,this._$disconnectableChildren=void 0,this.element=e,this.name=t,this._$parent=l,this.options=a,i.length>2||""!==i[0]||""!==i[1]?(this._$committedValue=new Array(i.length-1).fill(new String),this.strings=i):this._$committedValue=L,this._sanitizer=void 0}_$setValue(e,t=this,i,l){const a=this.strings;let o=!1;if(void 0===a)e=z(this,e,t,0),o=!b(e)||e!==this._$committedValue&&e!==A,o&&(this._$committedValue=e);else{const l=e;let s,n;for(e=a[0],s=0;s<a.length-1;s++)n=z(this,l[i+s],t,s),n===A&&(n=this._$committedValue[s]),o||=!b(n)||n!==this._$committedValue[s],n===L?e=L:e!==L&&(e+=(n??"")+a[s+1]),this._$committedValue[s]=n}o&&!l&&this._commitValue(e)}_commitValue(e){e===L?o(this.element).removeAttribute(this.name):(void 0===this._sanitizer&&(this._sanitizer=T(this.element,this.name,"attribute")),e=this._sanitizer(e??""),i&&i({kind:"commit attribute",element:this.element,name:this.name,value:e,options:this.options}),o(this.element).setAttribute(this.name,e??""))}}class N extends F{constructor(){super(...arguments),this.type=3}_commitValue(e){void 0===this._sanitizer&&(this._sanitizer=T(this.element,this.name,"property")),e=this._sanitizer(e),i&&i({kind:"commit property",element:this.element,name:this.name,value:e,options:this.options}),this.element[this.name]=e===L?void 0:e}}class W extends F{constructor(){super(...arguments),this.type=4}_commitValue(e){i&&i({kind:"commit boolean attribute",element:this.element,name:this.name,value:!(!e||e===L),options:this.options}),o(this.element).toggleAttribute(this.name,!!e&&e!==L)}}class q extends F{constructor(e,t,i,l,a){if(super(e,t,i,l,a),this.type=5,void 0!==this.strings)throw new Error(`A \`<${e.localName}>\` has a \`@${t}=...\` listener with invalid content. Event listeners in templates must have exactly one expression and no surrounding text.`)}_$setValue(e,t=this){if((e=z(this,e,t,0)??L)===A)return;const l=this._$committedValue,a=e===L&&l!==L||e.capture!==l.capture||e.once!==l.once||e.passive!==l.passive,o=e!==L&&(l===L||a);i&&i({kind:"commit event listener",element:this.element,name:this.name,value:e,options:this.options,removeListener:a,addListener:o,oldListener:l}),a&&this.element.removeEventListener(this.name,this,l),o&&this.element.addEventListener(this.name,this,e),this._$committedValue=e}handleEvent(e){"function"==typeof this._$committedValue?this._$committedValue.call(this.options?.host??this.element,e):this._$committedValue.handleEvent(e)}}class j{constructor(e,t,i){this.element=e,this.type=6,this._$disconnectableChildren=void 0,this._$parent=t,this.options=i}get _$isConnected(){return this._$parent._$isConnected}_$setValue(e){i&&i({kind:"commit to element binding",element:this.element,value:e,options:this.options}),z(this,e)}}const K={_boundAttributeSuffix:u,_marker:p,_markerMatch:g,_HTML_RESULT:1,_getTemplateHtml:R,_TemplateInstance:D,_isIterable:y,_resolveDirective:z,_ChildPart:U,_AttributePart:F,_BooleanAttributePart:W,_EventPart:q,_PropertyPart:N,_ElementPart:j},G=t.litHtmlPolyfillSupportDevMode;G?.(O,U),(t.litHtmlVersions??=[]).push("3.3.2"),t.litHtmlVersions.length>1&&queueMicrotask(()=>{l("multiple-versions","Multiple versions of Lit loaded. Loading multiple versions is not recommended.")});const J=(e,t,l)=>{if(null==t)throw new TypeError(`The container to render into may not be ${t}`);const o=a++,s=l?.renderBefore??t;let n=s._$litPart$;if(i&&i({kind:"begin render",id:o,value:e,container:t,options:l,part:n}),void 0===n){const e=l?.renderBefore??null;s._$litPart$=n=new U(t.insertBefore(w(),e),e,void 0,l??{})}return n._$setValue(e),i&&i({kind:"end render",id:o,value:e,container:t,options:l,part:n}),n};J.setSanitizer=d,J.createSanitizer=v,J._testOnlyClearSanitizerFactoryDoNotCallOrElse=h;
|
|
7
|
+
const t=globalThis,i=e=>{t.emitLitDebugLogEvents&&t.dispatchEvent(new CustomEvent("lit-debug",{detail:e}))};let l,a=0;t.litIssuedWarnings??=new Set,l=(e,i)=>{i+=e?` See https://lit.dev/msg/${e} for more information.`:"",t.litIssuedWarnings.has(i)||t.litIssuedWarnings.has(e)||(console.warn(i),t.litIssuedWarnings.add(i))},queueMicrotask(()=>{l("dev-mode","Lit is in dev mode. Not recommended for production!")});const o=t.ShadyDOM?.inUse&&!0===t.ShadyDOM?.noPatch?t.ShadyDOM.wrap:e=>e,s=t.trustedTypes,n=s?s.createPolicy("lit-html",{createHTML:e=>e}):void 0,r=e=>e,c=(e,t,i)=>r,d=e=>{if(T!==c)throw new Error("Attempted to overwrite existing lit-html security policy. setSanitizeDOMValueFactory should be called at most once.");T=e},h=()=>{T=c},v=(e,t,i)=>T(e,t,i),u="$lit$",p=`lit$${Math.random().toFixed(9).slice(2)}$`,g="?"+p,f=`<${g}>`,m=document,w=()=>m.createComment(""),b=e=>null===e||"object"!=typeof e&&"function"!=typeof e,x=Array.isArray,y=e=>x(e)||"function"==typeof e?.[Symbol.iterator],C="[ \t\n\f\r]",Z=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,_=/-->/g,M=/>/g,V=new RegExp(`>|${C}(?:([^\\s"'>=/]+)(${C}*=${C}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),k=/'/g,H=/"/g,$=/^(?:script|style|textarea|title)$/i,S=(B=1,(e,...t)=>(e.some(e=>void 0===e)&&console.warn("Some template strings are undefined.\nThis is probably caused by illegal octal escape sequences."),t.some(e=>e?._$litStatic$)&&l("","Static values 'literal' or 'unsafeStatic' cannot be used as values to non-static templates.\nPlease use the static 'html' tag function. See https://lit.dev/docs/templates/expressions/#static-expressions"),{_$litType$:B,strings:e,values:t}));var B;const A=Symbol.for("lit-noChange"),L=Symbol.for("lit-nothing"),E=new WeakMap,I=m.createTreeWalker(m,129);let T=c;function P(e,t){if(!x(e)||!e.hasOwnProperty("raw")){let e="invalid template strings array";throw e="\n Internal Error: expected template strings to be an array\n with a 'raw' field. Faking a template strings array by\n calling html or svg like an ordinary function is effectively\n the same as calling unsafeHtml and can lead to major security\n issues, e.g. opening your code up to XSS attacks.\n If you're using the html or svg tagged template functions normally\n and still seeing this error, please file a bug at\n https://github.com/lit/lit/issues/new?template=bug_report.md\n and include information about your build tooling, if any.\n ".trim().replace(/\n */g,"\n"),new Error(e)}return void 0!==n?n.createHTML(t):t}const O=(e,t)=>{const i=e.length-1,l=[];let a,o=2===t?"<svg>":3===t?"<math>":"",s=Z;for(let t=0;t<i;t++){const i=e[t];let n,r,c=-1,d=0;for(;d<i.length&&(s.lastIndex=d,r=s.exec(i),null!==r);)if(d=s.lastIndex,s===Z){if("!--"===r[1])s=_;else if(void 0!==r[1])s=M;else if(void 0!==r[2])$.test(r[2])&&(a=new RegExp(`</${r[2]}`,"g")),s=V;else if(void 0!==r[3])throw new Error("Bindings in tag names are not supported. Please use static templates instead. See https://lit.dev/docs/templates/expressions/#static-expressions")}else s===V?">"===r[0]?(s=a??Z,c=-1):void 0===r[1]?c=-2:(c=s.lastIndex-r[2].length,n=r[1],s=void 0===r[3]?V:'"'===r[3]?H:k):s===H||s===k?s=V:s===_||s===M?s=Z:(s=V,a=void 0);console.assert(-1===c||s===V||s===k||s===H,"unexpected parse state B");const h=s===V&&e[t+1].startsWith("/>")?" ":"";o+=s===Z?i+f:c>=0?(l.push(n),i.slice(0,c)+u+i.slice(c)+p+h):i+p+(-2===c?t:h)}return[P(e,o+(e[i]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),l]};class R{constructor({strings:e,_$litType$:t},a){let o;this.parts=[];let n=0,r=0;const c=e.length-1,d=this.parts,[h,v]=O(e,t);if(this.el=R.createElement(h,a),I.currentNode=this.el.content,2===t||3===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(o=I.nextNode())&&d.length<c;){if(1===o.nodeType){{const e=o.localName;if(/^(?:textarea|template)$/i.test(e)&&o.innerHTML.includes(p)){const t=`Expressions are not supported inside \`${e}\` elements. See https://lit.dev/msg/expression-in-${e} for more information.`;if("template"===e)throw new Error(t);l("",t)}}if(o.hasAttributes())for(const e of o.getAttributeNames())if(e.endsWith(u)){const t=v[r++],i=o.getAttribute(e).split(p),l=/([.?@])?(.*)/.exec(t);d.push({type:1,index:n,name:l[2],strings:i,ctor:"."===l[1]?N:"?"===l[1]?W:"@"===l[1]?q:F}),o.removeAttribute(e)}else e.startsWith(p)&&(d.push({type:6,index:n}),o.removeAttribute(e));if($.test(o.tagName)){const e=o.textContent.split(p),t=e.length-1;if(t>0){o.textContent=s?s.emptyScript:"";for(let i=0;i<t;i++)o.append(e[i],w()),I.nextNode(),d.push({type:2,index:++n});o.append(e[t],w())}}}else if(8===o.nodeType){if(o.data===g)d.push({type:2,index:n});else{let e=-1;for(;-1!==(e=o.data.indexOf(p,e+1));)d.push({type:7,index:n}),e+=p.length-1}}n++}if(v.length!==r)throw new Error('Detected duplicate attribute bindings. This occurs if your template has duplicate attributes on an element tag. For example "<input ?disabled=${true} ?disabled=${false}>" contains a duplicate "disabled" attribute. The error was detected in the following template: \n`'+e.join("${...}")+"`");i&&i({kind:"template prep",template:this,clonableTemplate:this.el,parts:this.parts,strings:e})}static createElement(e,t){const i=m.createElement("template");return i.innerHTML=e,i}}function z(e,t,i=e,l){if(t===A)return t;let a=void 0!==l?i.__directives?.[l]:i.__directive;const o=b(t)?void 0:t._$litDirective$;return a?.constructor!==o&&(a?._$notifyDirectiveConnectionChanged?.(!1),void 0===o?a=void 0:(a=new o(e),a._$initialize(e,i,l)),void 0!==l?(i.__directives??=[])[l]=a:i.__directive=a),void 0!==a&&(t=z(e,a._$resolve(e,t.values),a,l)),t}class D{constructor(e,t){this._$parts=[],this._$disconnectableChildren=void 0,this._$template=e,this._$parent=t}get parentNode(){return this._$parent.parentNode}get _$isConnected(){return this._$parent._$isConnected}_clone(e){const{el:{content:t},parts:i}=this._$template,l=(e?.creationScope??m).importNode(t,!0);I.currentNode=l;let a=I.nextNode(),o=0,s=0,n=i[0];for(;void 0!==n;){if(o===n.index){let t;2===n.type?t=new U(a,a.nextSibling,this,e):1===n.type?t=new n.ctor(a,n.name,n.strings,this,e):6===n.type&&(t=new j(a,this,e)),this._$parts.push(t),n=i[++s]}o!==n?.index&&(a=I.nextNode(),o++)}return I.currentNode=m,l}_update(e){let t=0;for(const l of this._$parts)void 0!==l&&(i&&i({kind:"set part",part:l,value:e[t],valueIndex:t,values:e,templateInstance:this}),void 0!==l.strings?(l._$setValue(e,l,t),t+=l.strings.length-2):l._$setValue(e[t])),t++}}class U{get _$isConnected(){return this._$parent?._$isConnected??this.__isConnected}constructor(e,t,i,l){this.type=2,this._$committedValue=L,this._$disconnectableChildren=void 0,this._$startNode=e,this._$endNode=t,this._$parent=i,this.options=l,this.__isConnected=l?.isConnected??!0,this._textSanitizer=void 0}get parentNode(){let e=o(this._$startNode).parentNode;const t=this._$parent;return void 0!==t&&11===e?.nodeType&&(e=t.parentNode),e}get startNode(){return this._$startNode}get endNode(){return this._$endNode}_$setValue(e,t=this){if(null===this.parentNode)throw new Error("This `ChildPart` has no `parentNode` and therefore cannot accept a value. This likely means the element containing the part was manipulated in an unsupported way outside of Lit's control such that the part's marker nodes were ejected from DOM. For example, setting the element's `innerHTML` or `textContent` can do this.");if(e=z(this,e,t),b(e))e===L||null==e||""===e?(this._$committedValue!==L&&(i&&i({kind:"commit nothing to child",start:this._$startNode,end:this._$endNode,parent:this._$parent,options:this.options}),this._$clear()),this._$committedValue=L):e!==this._$committedValue&&e!==A&&this._commitText(e);else if(void 0!==e._$litType$)this._commitTemplateResult(e);else if(void 0!==e.nodeType){if(this.options?.host===e)return this._commitText("[probable mistake: rendered a template's host in itself (commonly caused by writing ${this} in a template]"),void console.warn("Attempted to render the template host",e,"inside itself. This is almost always a mistake, and in dev mode ","we render some warning text. In production however, we'll ","render it, which will usually result in an error, and sometimes ","in the element disappearing from the DOM.");this._commitNode(e)}else y(e)?this._commitIterable(e):this._commitText(e)}_insert(e){return o(o(this._$startNode).parentNode).insertBefore(e,this._$endNode)}_commitNode(e){if(this._$committedValue!==e){if(this._$clear(),T!==c){const e=this._$startNode.parentNode?.nodeName;if("STYLE"===e||"SCRIPT"===e){let t="Forbidden";throw t="STYLE"===e?"Lit does not support binding inside style nodes. This is a security risk, as style injection attacks can exfiltrate data and spoof UIs. Consider instead using css`...` literals to compose styles, and do dynamic styling with css custom properties, ::parts, <slot>s, and by mutating the DOM rather than stylesheets.":"Lit does not support binding inside script nodes. This is a security risk, as it could allow arbitrary code execution.",new Error(t)}}i&&i({kind:"commit node",start:this._$startNode,parent:this._$parent,value:e,options:this.options}),this._$committedValue=this._insert(e)}}_commitText(e){if(this._$committedValue!==L&&b(this._$committedValue)){const t=o(this._$startNode).nextSibling;void 0===this._textSanitizer&&(this._textSanitizer=v(t,"data","property")),e=this._textSanitizer(e),i&&i({kind:"commit text",node:t,value:e,options:this.options}),t.data=e}else{const t=m.createTextNode("");this._commitNode(t),void 0===this._textSanitizer&&(this._textSanitizer=v(t,"data","property")),e=this._textSanitizer(e),i&&i({kind:"commit text",node:t,value:e,options:this.options}),t.data=e}this._$committedValue=e}_commitTemplateResult(e){const{values:t,_$litType$:l}=e,a="number"==typeof l?this._$getTemplate(e):(void 0===l.el&&(l.el=R.createElement(P(l.h,l.h[0]),this.options)),l);if(this._$committedValue?._$template===a)i&&i({kind:"template updating",template:a,instance:this._$committedValue,parts:this._$committedValue._$parts,options:this.options,values:t}),this._$committedValue._update(t);else{const e=new D(a,this),l=e._clone(this.options);i&&i({kind:"template instantiated",template:a,instance:e,parts:e._$parts,options:this.options,fragment:l,values:t}),e._update(t),i&&i({kind:"template instantiated and updated",template:a,instance:e,parts:e._$parts,options:this.options,fragment:l,values:t}),this._commitNode(l),this._$committedValue=e}}_$getTemplate(e){let t=E.get(e.strings);return void 0===t&&E.set(e.strings,t=new R(e)),t}_commitIterable(e){x(this._$committedValue)||(this._$committedValue=[],this._$clear());const t=this._$committedValue;let i,l=0;for(const a of e)l===t.length?t.push(i=new U(this._insert(w()),this._insert(w()),this,this.options)):i=t[l],i._$setValue(a),l++;l<t.length&&(this._$clear(i&&o(i._$endNode).nextSibling,l),t.length=l)}_$clear(e=o(this._$startNode).nextSibling,t){for(this._$notifyConnectionChanged?.(!1,!0,t);e!==this._$endNode;){const t=o(e).nextSibling;o(e).remove(),e=t}}setConnected(e){if(void 0!==this._$parent)throw new Error("part.setConnected() may only be called on a RootPart returned from render().");this.__isConnected=e,this._$notifyConnectionChanged?.(e)}}class F{get tagName(){return this.element.tagName}get _$isConnected(){return this._$parent._$isConnected}constructor(e,t,i,l,a){this.type=1,this._$committedValue=L,this._$disconnectableChildren=void 0,this.element=e,this.name=t,this._$parent=l,this.options=a,i.length>2||""!==i[0]||""!==i[1]?(this._$committedValue=new Array(i.length-1).fill(new String),this.strings=i):this._$committedValue=L,this._sanitizer=void 0}_$setValue(e,t=this,i,l){const a=this.strings;let o=!1;if(void 0===a)e=z(this,e,t,0),o=!b(e)||e!==this._$committedValue&&e!==A,o&&(this._$committedValue=e);else{const l=e;let s,n;for(e=a[0],s=0;s<a.length-1;s++)n=z(this,l[i+s],t,s),n===A&&(n=this._$committedValue[s]),o||=!b(n)||n!==this._$committedValue[s],n===L?e=L:e!==L&&(e+=(n??"")+a[s+1]),this._$committedValue[s]=n}o&&!l&&this._commitValue(e)}_commitValue(e){e===L?o(this.element).removeAttribute(this.name):(void 0===this._sanitizer&&(this._sanitizer=T(this.element,this.name,"attribute")),e=this._sanitizer(e??""),i&&i({kind:"commit attribute",element:this.element,name:this.name,value:e,options:this.options}),o(this.element).setAttribute(this.name,e??""))}}class N extends F{constructor(){super(...arguments),this.type=3}_commitValue(e){void 0===this._sanitizer&&(this._sanitizer=T(this.element,this.name,"property")),e=this._sanitizer(e),i&&i({kind:"commit property",element:this.element,name:this.name,value:e,options:this.options}),this.element[this.name]=e===L?void 0:e}}class W extends F{constructor(){super(...arguments),this.type=4}_commitValue(e){i&&i({kind:"commit boolean attribute",element:this.element,name:this.name,value:!(!e||e===L),options:this.options}),o(this.element).toggleAttribute(this.name,!!e&&e!==L)}}class q extends F{constructor(e,t,i,l,a){if(super(e,t,i,l,a),this.type=5,void 0!==this.strings)throw new Error(`A \`<${e.localName}>\` has a \`@${t}=...\` listener with invalid content. Event listeners in templates must have exactly one expression and no surrounding text.`)}_$setValue(e,t=this){if((e=z(this,e,t,0)??L)===A)return;const l=this._$committedValue,a=e===L&&l!==L||e.capture!==l.capture||e.once!==l.once||e.passive!==l.passive,o=e!==L&&(l===L||a);i&&i({kind:"commit event listener",element:this.element,name:this.name,value:e,options:this.options,removeListener:a,addListener:o,oldListener:l}),a&&this.element.removeEventListener(this.name,this,l),o&&this.element.addEventListener(this.name,this,e),this._$committedValue=e}handleEvent(e){"function"==typeof this._$committedValue?this._$committedValue.call(this.options?.host??this.element,e):this._$committedValue.handleEvent(e)}}class j{constructor(e,t,i){this.element=e,this.type=6,this._$disconnectableChildren=void 0,this._$parent=t,this.options=i}get _$isConnected(){return this._$parent._$isConnected}_$setValue(e){i&&i({kind:"commit to element binding",element:this.element,value:e,options:this.options}),z(this,e)}}const K={_boundAttributeSuffix:u,_marker:p,_markerMatch:g,_HTML_RESULT:1,_getTemplateHtml:O,_TemplateInstance:D,_isIterable:y,_resolveDirective:z,_ChildPart:U,_AttributePart:F,_BooleanAttributePart:W,_EventPart:q,_PropertyPart:N,_ElementPart:j},G=t.litHtmlPolyfillSupportDevMode;G?.(R,U),(t.litHtmlVersions??=[]).push("3.3.2"),t.litHtmlVersions.length>1&&queueMicrotask(()=>{l("multiple-versions","Multiple versions of Lit loaded. Loading multiple versions is not recommended.")});const J=(e,t,l)=>{if(null==t)throw new TypeError(`The container to render into may not be ${t}`);const o=a++,s=l?.renderBefore??t;let n=s._$litPart$;if(i&&i({kind:"begin render",id:o,value:e,container:t,options:l,part:n}),void 0===n){const e=l?.renderBefore??null;s._$litPart$=n=new U(t.insertBefore(w(),e),e,void 0,l??{})}return n._$setValue(e),i&&i({kind:"end render",id:o,value:e,container:t,options:l,part:n}),n};J.setSanitizer=d,J.createSanitizer=v,J._testOnlyClearSanitizerFactoryDoNotCallOrElse=h;
|
|
8
8
|
/**
|
|
9
9
|
* @license
|
|
10
10
|
* Copyright 2017 Google LLC
|
|
@@ -31,13 +31,13 @@ class extends ie{constructor(e){if(super(e),e.type!==Q&&e.type!==X&&e.type!==ee)
|
|
|
31
31
|
* @license
|
|
32
32
|
* Copyright 2017 Google LLC
|
|
33
33
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
34
|
-
*/;const Pe=globalThis;let
|
|
34
|
+
*/;const Pe=globalThis;let Oe;Pe.litIssuedWarnings??=new Set,Oe=(e,t)=>{t+=` See https://lit.dev/msg/${e} for more information.`,Pe.litIssuedWarnings.has(t)||Pe.litIssuedWarnings.has(e)||(console.warn(t),Pe.litIssuedWarnings.add(t))};class Re extends Te{constructor(){super(...arguments),this.renderOptions={host:this},this.__childPart=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this.__childPart=J(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.__childPart?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.__childPart?.setConnected(!1)}render(){return A}}var ze;Re._$litElement$=!0,Re[(ze="finalized",ze)]=!0,Pe.litElementHydrateSupport?.({LitElement:Re});const De=Pe.litElementPolyfillSupportDevMode;
|
|
35
35
|
/**
|
|
36
36
|
* @license
|
|
37
37
|
* Copyright 2017 Google LLC
|
|
38
38
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
39
39
|
*/
|
|
40
|
-
let Ue;De?.({LitElement:
|
|
40
|
+
let Ue;De?.({LitElement:Re}),(Pe.litElementVersions??=[]).push("4.2.2"),Pe.litElementVersions.length>1&&queueMicrotask(()=>{Oe("multiple-versions","Multiple versions of Lit loaded. Loading multiple versions is not recommended.")}),globalThis.litIssuedWarnings??=new Set,Ue=(e,t)=>{t+=` See https://lit.dev/msg/${e} for more information.`,globalThis.litIssuedWarnings.has(t)||globalThis.litIssuedWarnings.has(e)||(console.warn(t),globalThis.litIssuedWarnings.add(t))};const Fe={attribute:!0,type:String,converter:Le,reflect:!1,hasChanged:Ee},Ne=(e=Fe,t,i)=>{const{kind:l,metadata:a}=i;null==a&&Ue("missing-class-metadata",`The class ${t} is missing decorator metadata. This could mean that you're using a compiler that supports decorators but doesn't support decorator metadata, such as TypeScript 5.1. Please update your compiler.`);let o=globalThis.litPropertyMetadata.get(a);if(void 0===o&&globalThis.litPropertyMetadata.set(a,o=new Map),"setter"===l&&((e=Object.create(e)).wrapped=!0),o.set(i.name,e),"accessor"===l){const{name:l}=i;return{set(i){const a=t.get.call(this);t.set.call(this,i),this.requestUpdate(l,a,e,!0,i)},init(t){return void 0!==t&&this._$changeProperty(l,void 0,e,t),t}}}if("setter"===l){const{name:l}=i;return function(i){const a=this[l];t.call(this,i),this.requestUpdate(l,a,e,!0,i)}}throw new Error(`Unsupported decorator location: ${l}`)};function We(e){return(t,i)=>"object"==typeof i?Ne(e,t,i):((e,t,i)=>{const l=t.hasOwnProperty(i);return t.constructor.createProperty(i,e),l?Object.getOwnPropertyDescriptor(t,i):void 0})(e,t,i)}
|
|
41
41
|
/**
|
|
42
42
|
* @license
|
|
43
43
|
* Copyright 2017 Google LLC
|
|
@@ -78,7 +78,7 @@ function Ge(e){return(t,i)=>je(t,i,{async get(){return await this.updateComplete
|
|
|
78
78
|
* @license
|
|
79
79
|
* Copyright 2020 Google LLC
|
|
80
80
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
81
|
-
*/const st=()=>new nt;class nt{}const rt=new WeakMap;const ct=te(class extends ot{render(e){return L}update(e,[t]){const i=t!==this._ref;return i&&void 0!==this._ref&&this._updateRefValue(void 0),(i||this._lastElementForRef!==this._element)&&(this._ref=t,this._context=e.options?.host,this._updateRefValue(this._element=e.element)),L}_updateRefValue(e){if(this.isConnected||(e=void 0),"function"==typeof this._ref){const t=this._context??globalThis;let i=rt.get(t);void 0===i&&(i=new WeakMap,rt.set(t,i)),void 0!==i.get(this._ref)&&this._ref.call(this._context,void 0),i.set(this._ref,e),void 0!==e&&this._ref.call(this._context,e)}else this._ref.value=e}get _lastElementForRef(){return"function"==typeof this._ref?rt.get(this._context??globalThis)?.get(this._ref):this._ref?.value}disconnected(){this._lastElementForRef===this._element&&this._updateRefValue(void 0)}reconnected(){this._updateRefValue(this._element)}}),dt=["top","right","bottom","left"],ht=Math.min,vt=Math.max,ut=Math.round,pt=Math.floor,gt=e=>({x:e,y:e}),ft={left:"right",right:"left",bottom:"top",top:"bottom"},mt={start:"end",end:"start"};function wt(e,t,i){return vt(e,ht(t,i))}function bt(e,t){return"function"==typeof e?e(t):e}function xt(e){return e.split("-")[0]}function yt(e){return e.split("-")[1]}function Ct(e){return"x"===e?"y":"x"}function Zt(e){return"y"===e?"height":"width"}const _t=new Set(["top","bottom"]);function Mt(e){return _t.has(xt(e))?"y":"x"}function Vt(e){return Ct(Mt(e))}function kt(e,t,i){void 0===i&&(i=!1);const l=yt(e),a=Vt(e),o=Zt(a);let s="x"===a?l===(i?"end":"start")?"right":"left":"start"===l?"bottom":"top";return t.reference[o]>t.floating[o]&&(s=Et(s)),[s,Et(s)]}function Ht(e){return e.replace(/start|end/g,e=>mt[e])}const $t=["left","right"],St=["right","left"],Bt=["top","bottom"],At=["bottom","top"];function Lt(e,t,i,l){const a=yt(e);let o=function(e,t,i){switch(e){case"top":case"bottom":return i?t?St:$t:t?$t:St;case"left":case"right":return t?Bt:At;default:return[]}}(xt(e),"start"===i,l);return a&&(o=o.map(e=>e+"-"+a),t&&(o=o.concat(o.map(Ht)))),o}function Et(e){return e.replace(/left|right|bottom|top/g,e=>ft[e])}function It(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function Tt(e){const{x:t,y:i,width:l,height:a}=e;return{width:l,height:a,top:i,left:t,right:t+l,bottom:i+a,x:t,y:i}}function Pt(e,t,i){let{reference:l,floating:a}=e;const o=Mt(t),s=Vt(t),n=Zt(s),r=xt(t),c="y"===o,d=l.x+l.width/2-a.width/2,h=l.y+l.height/2-a.height/2,v=l[n]/2-a[n]/2;let u;switch(r){case"top":u={x:d,y:l.y-a.height};break;case"bottom":u={x:d,y:l.y+l.height};break;case"right":u={x:l.x+l.width,y:h};break;case"left":u={x:l.x-a.width,y:h};break;default:u={x:l.x,y:l.y}}switch(yt(t)){case"start":u[s]-=v*(i&&c?-1:1);break;case"end":u[s]+=v*(i&&c?-1:1)}return u}async function Rt(e,t){var i;void 0===t&&(t={});const{x:l,y:a,platform:o,rects:s,elements:n,strategy:r}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:v=!1,padding:u=0}=bt(t,e),p=It(u),g=n[v?"floating"===h?"reference":"floating":h],f=Tt(await o.getClippingRect({element:null==(i=await(null==o.isElement?void 0:o.isElement(g)))||i?g:g.contextElement||await(null==o.getDocumentElement?void 0:o.getDocumentElement(n.floating)),boundary:c,rootBoundary:d,strategy:r})),m="floating"===h?{x:l,y:a,width:s.floating.width,height:s.floating.height}:s.reference,w=await(null==o.getOffsetParent?void 0:o.getOffsetParent(n.floating)),b=await(null==o.isElement?void 0:o.isElement(w))&&await(null==o.getScale?void 0:o.getScale(w))||{x:1,y:1},x=Tt(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:n,rect:m,offsetParent:w,strategy:r}):m);return{top:(f.top-x.top+p.top)/b.y,bottom:(x.bottom-f.bottom+p.bottom)/b.y,left:(f.left-x.left+p.left)/b.x,right:(x.right-f.right+p.right)/b.x}}function Ot(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function zt(e){return dt.some(t=>e[t]>=0)}const Dt=new Set(["left","top"]);function Ut(){return"undefined"!=typeof window}function Ft(e){return qt(e)?(e.nodeName||"").toLowerCase():"#document"}function Nt(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Wt(e){var t;return null==(t=(qt(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function qt(e){return!!Ut()&&(e instanceof Node||e instanceof Nt(e).Node)}function jt(e){return!!Ut()&&(e instanceof Element||e instanceof Nt(e).Element)}function Kt(e){return!!Ut()&&(e instanceof HTMLElement||e instanceof Nt(e).HTMLElement)}function Gt(e){return!(!Ut()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Nt(e).ShadowRoot)}const Jt=new Set(["inline","contents"]);function Xt(e){const{overflow:t,overflowX:i,overflowY:l,display:a}=ci(e);return/auto|scroll|overlay|hidden|clip/.test(t+l+i)&&!Jt.has(a)}const Yt=new Set(["table","td","th"]);function Qt(e){return Yt.has(Ft(e))}const ei=[":popover-open",":modal"];function ti(e){return ei.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const ii=["transform","translate","scale","rotate","perspective"],li=["transform","translate","scale","rotate","perspective","filter"],ai=["paint","layout","strict","content"];function oi(e){const t=si(),i=jt(e)?ci(e):e;return ii.some(e=>!!i[e]&&"none"!==i[e])||!!i.containerType&&"normal"!==i.containerType||!t&&!!i.backdropFilter&&"none"!==i.backdropFilter||!t&&!!i.filter&&"none"!==i.filter||li.some(e=>(i.willChange||"").includes(e))||ai.some(e=>(i.contain||"").includes(e))}function si(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const ni=new Set(["html","body","#document"]);function ri(e){return ni.has(Ft(e))}function ci(e){return Nt(e).getComputedStyle(e)}function di(e){return jt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function hi(e){if("html"===Ft(e))return e;const t=e.assignedSlot||e.parentNode||Gt(e)&&e.host||Wt(e);return Gt(t)?t.host:t}function vi(e){const t=hi(e);return ri(t)?e.ownerDocument?e.ownerDocument.body:e.body:Kt(t)&&Xt(t)?t:vi(t)}function ui(e,t,i){var l;void 0===t&&(t=[]),void 0===i&&(i=!0);const a=vi(e),o=a===(null==(l=e.ownerDocument)?void 0:l.body),s=Nt(a);if(o){const e=pi(s);return t.concat(s,s.visualViewport||[],Xt(a)?a:[],e&&i?ui(e):[])}return t.concat(a,ui(a,[],i))}function pi(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function gi(e){const t=ci(e);let i=parseFloat(t.width)||0,l=parseFloat(t.height)||0;const a=Kt(e),o=a?e.offsetWidth:i,s=a?e.offsetHeight:l,n=ut(i)!==o||ut(l)!==s;return n&&(i=o,l=s),{width:i,height:l,$:n}}function fi(e){return jt(e)?e:e.contextElement}function mi(e){const t=fi(e);if(!Kt(t))return gt(1);const i=t.getBoundingClientRect(),{width:l,height:a,$:o}=gi(t);let s=(o?ut(i.width):i.width)/l,n=(o?ut(i.height):i.height)/a;return s&&Number.isFinite(s)||(s=1),n&&Number.isFinite(n)||(n=1),{x:s,y:n}}const wi=gt(0);function bi(e){const t=Nt(e);return si()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:wi}function xi(e,t,i,l){void 0===t&&(t=!1),void 0===i&&(i=!1);const a=e.getBoundingClientRect(),o=fi(e);let s=gt(1);t&&(l?jt(l)&&(s=mi(l)):s=mi(e));const n=function(e,t,i){return void 0===t&&(t=!1),!(!i||t&&i!==Nt(e))&&t}(o,i,l)?bi(o):gt(0);let r=(a.left+n.x)/s.x,c=(a.top+n.y)/s.y,d=a.width/s.x,h=a.height/s.y;if(o){const e=Nt(o),t=l&&jt(l)?Nt(l):l;let i=e,a=pi(i);for(;a&&l&&t!==i;){const e=mi(a),t=a.getBoundingClientRect(),l=ci(a),o=t.left+(a.clientLeft+parseFloat(l.paddingLeft))*e.x,s=t.top+(a.clientTop+parseFloat(l.paddingTop))*e.y;r*=e.x,c*=e.y,d*=e.x,h*=e.y,r+=o,c+=s,i=Nt(a),a=pi(i)}}return Tt({width:d,height:h,x:r,y:c})}function yi(e,t){const i=di(e).scrollLeft;return t?t.left+i:xi(Wt(e)).left+i}function Ci(e,t){const i=e.getBoundingClientRect();return{x:i.left+t.scrollLeft-yi(e,i),y:i.top+t.scrollTop}}const Zi=new Set(["absolute","fixed"]);function _i(e,t,i){let l;if("viewport"===t)l=function(e,t){const i=Nt(e),l=Wt(e),a=i.visualViewport;let o=l.clientWidth,s=l.clientHeight,n=0,r=0;if(a){o=a.width,s=a.height;const e=si();(!e||e&&"fixed"===t)&&(n=a.offsetLeft,r=a.offsetTop)}const c=yi(l);if(c<=0){const e=l.ownerDocument,t=e.body,i=getComputedStyle(t),a="CSS1Compat"===e.compatMode&&parseFloat(i.marginLeft)+parseFloat(i.marginRight)||0,s=Math.abs(l.clientWidth-t.clientWidth-a);s<=25&&(o-=s)}else c<=25&&(o+=c);return{width:o,height:s,x:n,y:r}}(e,i);else if("document"===t)l=function(e){const t=Wt(e),i=di(e),l=e.ownerDocument.body,a=vt(t.scrollWidth,t.clientWidth,l.scrollWidth,l.clientWidth),o=vt(t.scrollHeight,t.clientHeight,l.scrollHeight,l.clientHeight);let s=-i.scrollLeft+yi(e);const n=-i.scrollTop;return"rtl"===ci(l).direction&&(s+=vt(t.clientWidth,l.clientWidth)-a),{width:a,height:o,x:s,y:n}}(Wt(e));else if(jt(t))l=function(e,t){const i=xi(e,!0,"fixed"===t),l=i.top+e.clientTop,a=i.left+e.clientLeft,o=Kt(e)?mi(e):gt(1);return{width:e.clientWidth*o.x,height:e.clientHeight*o.y,x:a*o.x,y:l*o.y}}(t,i);else{const i=bi(e);l={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Tt(l)}function Mi(e,t){const i=hi(e);return!(i===t||!jt(i)||ri(i))&&("fixed"===ci(i).position||Mi(i,t))}function Vi(e,t,i){const l=Kt(t),a=Wt(t),o="fixed"===i,s=xi(e,!0,o,t);let n={scrollLeft:0,scrollTop:0};const r=gt(0);function c(){r.x=yi(a)}if(l||!l&&!o)if(("body"!==Ft(t)||Xt(a))&&(n=di(t)),l){const e=xi(t,!0,o,t);r.x=e.x+t.clientLeft,r.y=e.y+t.clientTop}else a&&c();o&&!l&&a&&c();const d=!a||l||o?gt(0):Ci(a,n);return{x:s.left+n.scrollLeft-r.x-d.x,y:s.top+n.scrollTop-r.y-d.y,width:s.width,height:s.height}}function ki(e){return"static"===ci(e).position}function Hi(e,t){if(!Kt(e)||"fixed"===ci(e).position)return null;if(t)return t(e);let i=e.offsetParent;return Wt(e)===i&&(i=i.ownerDocument.body),i}function $i(e,t){const i=Nt(e);if(ti(e))return i;if(!Kt(e)){let t=hi(e);for(;t&&!ri(t);){if(jt(t)&&!ki(t))return t;t=hi(t)}return i}let l=Hi(e,t);for(;l&&Qt(l)&&ki(l);)l=Hi(l,t);return l&&ri(l)&&ki(l)&&!oi(l)?i:l||function(e){let t=hi(e);for(;Kt(t)&&!ri(t);){if(oi(t))return t;if(ti(t))return null;t=hi(t)}return null}(e)||i}const Si={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:i,offsetParent:l,strategy:a}=e;const o="fixed"===a,s=Wt(l),n=!!t&&ti(t.floating);if(l===s||n&&o)return i;let r={scrollLeft:0,scrollTop:0},c=gt(1);const d=gt(0),h=Kt(l);if((h||!h&&!o)&&(("body"!==Ft(l)||Xt(s))&&(r=di(l)),Kt(l))){const e=xi(l);c=mi(l),d.x=e.x+l.clientLeft,d.y=e.y+l.clientTop}const v=!s||h||o?gt(0):Ci(s,r);return{width:i.width*c.x,height:i.height*c.y,x:i.x*c.x-r.scrollLeft*c.x+d.x+v.x,y:i.y*c.y-r.scrollTop*c.y+d.y+v.y}},getDocumentElement:Wt,getClippingRect:function(e){let{element:t,boundary:i,rootBoundary:l,strategy:a}=e;const o=[..."clippingAncestors"===i?ti(t)?[]:function(e,t){const i=t.get(e);if(i)return i;let l=ui(e,[],!1).filter(e=>jt(e)&&"body"!==Ft(e)),a=null;const o="fixed"===ci(e).position;let s=o?hi(e):e;for(;jt(s)&&!ri(s);){const t=ci(s),i=oi(s);i||"fixed"!==t.position||(a=null),(o?!i&&!a:!i&&"static"===t.position&&a&&Zi.has(a.position)||Xt(s)&&!i&&Mi(e,s))?l=l.filter(e=>e!==s):a=t,s=hi(s)}return t.set(e,l),l}(t,this._c):[].concat(i),l],s=o[0],n=o.reduce((e,i)=>{const l=_i(t,i,a);return e.top=vt(l.top,e.top),e.right=ht(l.right,e.right),e.bottom=ht(l.bottom,e.bottom),e.left=vt(l.left,e.left),e},_i(t,s,a));return{width:n.right-n.left,height:n.bottom-n.top,x:n.left,y:n.top}},getOffsetParent:$i,getElementRects:async function(e){const t=this.getOffsetParent||$i,i=this.getDimensions,l=await i(e.floating);return{reference:Vi(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:l.width,height:l.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:i}=gi(e);return{width:t,height:i}},getScale:mi,isElement:jt,isRTL:function(e){return"rtl"===ci(e).direction}};function Bi(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ai(e,t,i,l){void 0===l&&(l={});const{ancestorScroll:a=!0,ancestorResize:o=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:n="function"==typeof IntersectionObserver,animationFrame:r=!1}=l,c=fi(e),d=a||o?[...c?ui(c):[],...ui(t)]:[];d.forEach(e=>{a&&e.addEventListener("scroll",i,{passive:!0}),o&&e.addEventListener("resize",i)});const h=c&&n?function(e,t){let i,l=null;const a=Wt(e);function o(){var e;clearTimeout(i),null==(e=l)||e.disconnect(),l=null}return function s(n,r){void 0===n&&(n=!1),void 0===r&&(r=1),o();const c=e.getBoundingClientRect(),{left:d,top:h,width:v,height:u}=c;if(n||t(),!v||!u)return;const p={rootMargin:-pt(h)+"px "+-pt(a.clientWidth-(d+v))+"px "+-pt(a.clientHeight-(h+u))+"px "+-pt(d)+"px",threshold:vt(0,ht(1,r))||1};let g=!0;function f(t){const l=t[0].intersectionRatio;if(l!==r){if(!g)return s();l?s(!1,l):i=setTimeout(()=>{s(!1,1e-7)},1e3)}1!==l||Bi(c,e.getBoundingClientRect())||s(),g=!1}try{l=new IntersectionObserver(f,{...p,root:a.ownerDocument})}catch(e){l=new IntersectionObserver(f,p)}l.observe(e)}(!0),o}(c,i):null;let v,u=-1,p=null;s&&(p=new ResizeObserver(e=>{let[l]=e;l&&l.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(u),u=requestAnimationFrame(()=>{var e;null==(e=p)||e.observe(t)})),i()}),c&&!r&&p.observe(c),p.observe(t));let g=r?xi(e):null;return r&&function t(){const l=xi(e);g&&!Bi(g,l)&&i();g=l,v=requestAnimationFrame(t)}(),i(),()=>{var e;d.forEach(e=>{a&&e.removeEventListener("scroll",i),o&&e.removeEventListener("resize",i)}),null==h||h(),null==(e=p)||e.disconnect(),p=null,r&&cancelAnimationFrame(v)}}const Li=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var i,l;const{x:a,y:o,placement:s,middlewareData:n}=t,r=await async function(e,t){const{placement:i,platform:l,elements:a}=e,o=await(null==l.isRTL?void 0:l.isRTL(a.floating)),s=xt(i),n=yt(i),r="y"===Mt(i),c=Dt.has(s)?-1:1,d=o&&r?-1:1,h=bt(t,e);let{mainAxis:v,crossAxis:u,alignmentAxis:p}="number"==typeof h?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return n&&"number"==typeof p&&(u="end"===n?-1*p:p),r?{x:u*d,y:v*c}:{x:v*c,y:u*d}}(t,e);return s===(null==(i=n.offset)?void 0:i.placement)&&null!=(l=n.arrow)&&l.alignmentOffset?{}:{x:a+r.x,y:o+r.y,data:{...r,placement:s}}}}},Ei=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:i,y:l,placement:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:n={fn:e=>{let{x:t,y:i}=e;return{x:t,y:i}}},...r}=bt(e,t),c={x:i,y:l},d=await Rt(t,r),h=Mt(xt(a)),v=Ct(h);let u=c[v],p=c[h];if(o){const e="y"===v?"bottom":"right";u=wt(u+d["y"===v?"top":"left"],u,u-d[e])}if(s){const e="y"===h?"bottom":"right";p=wt(p+d["y"===h?"top":"left"],p,p-d[e])}const g=n.fn({...t,[v]:u,[h]:p});return{...g,data:{x:g.x-i,y:g.y-l,enabled:{[v]:o,[h]:s}}}}}},Ii=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var i,l;const{placement:a,middlewareData:o,rects:s,initialPlacement:n,platform:r,elements:c}=t,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:v,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:g=!0,...f}=bt(e,t);if(null!=(i=o.arrow)&&i.alignmentOffset)return{};const m=xt(a),w=Mt(n),b=xt(n)===n,x=await(null==r.isRTL?void 0:r.isRTL(c.floating)),y=v||(b||!g?[Et(n)]:function(e){const t=Et(e);return[Ht(e),t,Ht(t)]}(n)),C="none"!==p;!v&&C&&y.push(...Lt(n,g,p,x));const Z=[n,...y],_=await Rt(t,f),M=[];let V=(null==(l=o.flip)?void 0:l.overflows)||[];if(d&&M.push(_[m]),h){const e=kt(a,s,x);M.push(_[e[0]],_[e[1]])}if(V=[...V,{placement:a,overflows:M}],!M.every(e=>e<=0)){var k,H;const e=((null==(k=o.flip)?void 0:k.index)||0)+1,t=Z[e];if(t){if(!("alignment"===h&&w!==Mt(t))||V.every(e=>Mt(e.placement)!==w||e.overflows[0]>0))return{data:{index:e,overflows:V},reset:{placement:t}}}let i=null==(H=V.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:H.placement;if(!i)switch(u){case"bestFit":{var $;const e=null==($=V.filter(e=>{if(C){const t=Mt(e.placement);return t===w||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:$[0];e&&(i=e);break}case"initialPlacement":i=n}if(a!==i)return{reset:{placement:i}}}return{}}}},Ti=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var i,l;const{placement:a,rects:o,platform:s,elements:n}=t,{apply:r=()=>{},...c}=bt(e,t),d=await Rt(t,c),h=xt(a),v=yt(a),u="y"===Mt(a),{width:p,height:g}=o.floating;let f,m;"top"===h||"bottom"===h?(f=h,m=v===(await(null==s.isRTL?void 0:s.isRTL(n.floating))?"start":"end")?"left":"right"):(m=h,f="end"===v?"top":"bottom");const w=g-d.top-d.bottom,b=p-d.left-d.right,x=ht(g-d[f],w),y=ht(p-d[m],b),C=!t.middlewareData.shift;let Z=x,_=y;if(null!=(i=t.middlewareData.shift)&&i.enabled.x&&(_=b),null!=(l=t.middlewareData.shift)&&l.enabled.y&&(Z=w),C&&!v){const e=vt(d.left,0),t=vt(d.right,0),i=vt(d.top,0),l=vt(d.bottom,0);u?_=p-2*(0!==e||0!==t?e+t:vt(d.left,d.right)):Z=g-2*(0!==i||0!==l?i+l:vt(d.top,d.bottom))}await r({...t,availableWidth:_,availableHeight:Z});const M=await s.getDimensions(n.floating);return p!==M.width||g!==M.height?{reset:{rects:!0}}:{}}}},Pi=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:i}=t,{strategy:l="referenceHidden",...a}=bt(e,t);switch(l){case"referenceHidden":{const e=Ot(await Rt(t,{...a,elementContext:"reference"}),i.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:zt(e)}}}case"escaped":{const e=Ot(await Rt(t,{...a,altBoundary:!0}),i.floating);return{data:{escapedOffsets:e,escaped:zt(e)}}}default:return{}}}}},Ri=(e,t,i)=>{const l=new Map,a={platform:Si,...i},o={...a.platform,_c:l};return(async(e,t,i)=>{const{placement:l="bottom",strategy:a="absolute",middleware:o=[],platform:s}=i,n=o.filter(Boolean),r=await(null==s.isRTL?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:a}),{x:d,y:h}=Pt(c,l,r),v=l,u={},p=0;for(let i=0;i<n.length;i++){const{name:o,fn:g}=n[i],{x:f,y:m,data:w,reset:b}=await g({x:d,y:h,initialPlacement:l,placement:v,strategy:a,middlewareData:u,rects:c,platform:s,elements:{reference:e,floating:t}});d=null!=f?f:d,h=null!=m?m:h,u={...u,[o]:{...u[o],...w}},b&&p<=50&&(p++,"object"==typeof b&&(b.placement&&(v=b.placement),b.rects&&(c=!0===b.rects?await s.getElementRects({reference:e,floating:t,strategy:a}):b.rects),({x:d,y:h}=Pt(c,v,r))),i=-1)}return{x:d,y:h,placement:v,strategy:a,middlewareData:u}})(e,t,{...a,platform:o})};var Oi=we`:host([menuisopen]:not([disabled]):not([readonly])) .dropdown-menu{display:block}.dropdown-menu{background-clip:padding-box;background-color:var(--sgds-surface-default);border-radius:var(--sgds-border-radius-md);box-shadow:0 0 1px 0 hsla(0,0%,5%,.12),0 4px 8px 0 hsla(0,0%,5%,.12);color:var(--sgds-color-default);display:none;list-style:none;margin:0;max-height:var(--sgds-dimension-480);min-width:var(--sgds-dimension-192);overflow-y:auto;padding:var(--sgds-padding-xs) 0;position:absolute;text-align:left;z-index:var(--sgds-z-index-floating)}.nav-tabs .dropdown-menu{border-top-left-radius:0;border-top-right-radius:0;margin-top:calc(var(--sgds-nav-tabs-border-width)*-1)}@media (min-width:512px){.navbar-expand-sm .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:768px){.navbar-expand-md .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:1024px){.navbar-expand-lg .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:1280px){.navbar-expand-xl .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:1440px){.navbar-expand-xxl .navbar-nav .dropdown-menu{position:absolute}}.navbar-expand .navbar-nav .dropdown-menu{position:absolute}.sgds.navbar .dropdown-menu.megamenu{left:0;right:0;width:100%}.sgds.combobox>.dropdown-menu{min-width:100%}`,zi=we`.invalid-feedback-container{display:flex;gap:var(--sgds-form-gap-sm)}.invalid-feedback,.invalid-feedback-container{color:var(--sgds-form-danger-color-default);line-height:var(--sgds-line-height-20)}.invalid-feedback{font-size:var(--sgds-font-size-14);font-weight:var(--sgds-font-weight-regular)}.valid-icon{color:var(--sgds-form-success-color-default)}`,Di=we`.form-text{color:var(--sgds-form-color-subtle);font-size:var(--sgds-font-size-label-sm);line-height:var(--sgds-line-height-2-xs)}.form-text.disabled{opacity:var(--sgds-opacity-40)}`,Ui=we`.form-control-container{display:flex;flex-direction:column;gap:var(--sgds-form-gap-md)}.m-width-160{min-width:var(--sgds-dimension-160)}.m-width-256{min-width:var(--sgds-dimension-256)}.form-label{color:var(--sgds-form-color-default);font-size:var(--sgds-font-size-label-md)}.form-control-group{align-items:center;background-color:var(--sgds-form-surface-default);border:var(--sgds-form-border-width-default) solid var(--sgds-border-color-default);border-radius:var(--input-border-radius,var(--sgds-form-border-radius-md));display:flex;gap:var(--sgds-form-gap-md);height:var(--sgds-dimension-48);justify-content:center;overflow:hidden;padding:0 var(--sgds-form-padding-x);transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;width:-webkit-fill-available;width:-moz-available}.form-control{appearance:none;background-clip:padding-box;background:none;border:none;color:var(--sgds-form-color-default);display:block;flex-grow:1;font-family:var(--sgds-font-family-brand);font-size:var(--sgds-font-size-label-md);line-height:var(--sgds-line-height-xs);min-width:0;outline:none;padding:0;width:100%}.form-clearable{color:var(--sgds-color-subtle);cursor:pointer}@media (prefers-reduced-motion:reduce){.form-control-group{transition:none}}.form-control-group:not(.disabled):not(.is-invalid):not(.readonly):not(:focus-within):hover{outline:var(--sgds-form-border-width-thick) solid var(--sgds-border-color-emphasis);outline-offset:var(--sgds-form-outline-offset-focus)}.form-control-group:not(.disabled):not(.is-invalid):focus-within{outline:var(--sgds-form-outline-focus);outline-offset:var(--sgds-form-outline-offset-focus)}.form-control-container.disabled{opacity:var(--sgds-opacity-40)}.form-control-group.disabled{background-color:var(--sgds-form-surface-muted);cursor:not-allowed}.form-control-group.readonly{background-color:var(--sgds-form-surface-raised)}.form-control-group.is-invalid:not(.disabled){border:var(--sgds-form-border-width-default) solid var(--sgds-form-danger-border-color-default)}.form-control-group:not(.disabled).is-invalid:focus-within{outline:var(--sgds-border-width-2) solid var(--sgds-form-danger-color-default);outline-offset:var(--sgds-form-outline-offset-focus)}`;const Fi=(e="value")=>(t,i)=>{const l=t.constructor,a=l.prototype.attributeChangedCallback;l.prototype.attributeChangedCallback=function(t,o,s){var n;const r=l.getPropertyOptions(e);if(t===("string"==typeof r.attribute?r.attribute:e).toLowerCase()){const t=r.converter||Le,l=("function"==typeof t?t:null!==(n=null==t?void 0:t.fromAttribute)&&void 0!==n?n:Le.fromAttribute)(s,r.type);this[e]!==l&&(this[i]=l)}a.call(this,t,o,s)}};function Ni(e="",t=""){return`id-${Math.random().toString().substring(2,6)}-sgds-${e}-${t}`}class Wi{constructor(e,t){(this.host=e).addController(this),this._internals=e._internals||this.host.attachInternals(),this.options=Object.assign({setInvalid:(e,t)=>{e.invalid=t},value:e=>e.value,input:e=>e.input},t)}hostConnected(){this.host.addEventListener("invalid",e=>this.handleInvalid(e))}hostDisconnected(){this.host.removeEventListener("invalid",e=>this.handleInvalid(e))}handleInvalid(e){e.preventDefault(),this.options.setInvalid(this.host,!0)}handleInput(e){const t=e.target;this.options.setInvalid(this.host,!1),this.validateInput(t)}handleChange(e){const t=e.target;this.validateInput(t),this.options.setInvalid(this.host,!this.checkValidity())}get form(){return this._internals.form}get validity(){return this._internals.validity}get validationMessage(){return this._internals.validationMessage}get willValidate(){return this._internals.willValidate}updateInvalidState(){this.options.setInvalid(this.host,!this.checkValidity())}resetValidity(){return this._internals.setValidity({})}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}setValidity(e,t,i){return this._internals.setValidity(e,t,i)}setFormValue(){const e=this.options.value(this.host);this._internals.setFormValue(e)}validateInput(e){if(this.options.input(this.host).disabled)return this._internals.setValidity({});const t=e.validity;if(t.valid)this._internals.setValidity({});else for(const i in t)t[i]&&(this.validationError=i.toString(),this._internals.setValidity({[this.validationError]:!0},e.validationMessage,e))}}const qi=t=>{class i extends t{constructor(...e){super(...e),this._isTouched=!1,this._internals=this.attachInternals()}connectedCallback(){var e;super.connectedCallback(),this._mixinShouldSkipSgdsValidation()||null!==(e=this.inputValidationController)&&void 0!==e||(this.inputValidationController=new Wi(this))}async firstUpdated(e){super.firstUpdated(e),this.input=this.shadowRoot.querySelector("input")||await this.sgdsInput||this.shadowRoot.querySelector("textarea")||await this.sgdsDatepickerInput,this._mixinSetFormValue(),this._mixinShouldSkipSgdsValidation()||this._mixinValidate(this.input)}formResetCallback(){this._mixinResetFormControl?this._mixinResetFormControl():(this.value=this.defaultValue,this._mixinResetValidity(this.input)),this._mixinSetFormValue()}_mixinHandleChange(e){this._mixinSetFormValue(),this._mixinShouldSkipSgdsValidation()||this.inputValidationController.handleChange(e)}_mixinHandleInputChange(e){this._mixinSetFormValue(),this._mixinShouldSkipSgdsValidation()||this.inputValidationController.handleInput(e)}_mixinResetValidity(e){this._mixinShouldSkipSgdsValidation()||(this.inputValidationController.resetValidity(),this.inputValidationController.updateInvalidState(),this.inputValidationController.validateInput(e),this._isTouched&&(this._isTouched=!1))}_mixinValidate(e){this._mixinShouldSkipSgdsValidation()||this.inputValidationController.validateInput(e)}_mixinSetFormValue(){const e=this.value;this._internals.setFormValue(e)}_mixinCheckValidity(){return!!this._mixinShouldSkipSgdsValidation()||this.inputValidationController.checkValidity()}_mixinReportValidity(){return!!this._mixinShouldSkipSgdsValidation()||this.inputValidationController.reportValidity()}_mixinGetValidity(){return this._internals.validity}_mixinGetValidationMessage(){return this._internals.validationMessage}_mixinSetValidity(e,t,i){if(!this._mixinShouldSkipSgdsValidation())return this.inputValidationController.setValidity(e,t,i)}_mixinShouldSkipSgdsValidation(){const e=this.closest("form");return(null==e?void 0:e.noValidate)||this.noValidate}}return i.formAssociated=!0,e([Ge("sgds-input")],i.prototype,"sgdsInput",void 0),e([Ge("sgds-datepicker-input")],i.prototype,"sgdsDatepickerInput",void 0),i};var ji=we`:host{-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-font-smoothing:antialiased;color:var(--sgds-body-color-default,#1a1a1a);display:block;font-family:var(--sgds-font-family-brand,"Inter",system-ui,sans-serif);font-size:var(--sgds-font-size-body-md,1rem);font-weight:var(--sgds-font-weight-regular,400);line-height:var(--sgds-line-height-xs,24px);margin:0;*,:after,:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}:disabled{cursor:not-allowed}@media (prefers-reduced-motion:no-preference){:root{scroll-behavior:smooth}}::slotted(a[target=_blank]):after,a[target=_blank]:after{background-color:currentColor;content:"/";display:inline-block;height:1em;-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9.774 4.4H9.8a.6.6 0 1 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.861 6.91c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v4.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h4.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.468-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.774c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.525-.042-1.175-.042-1.993V9.774c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C8.305 4.4 8.956 4.4 9.774 4.4ZM12.4 5a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V6.449l-5.976 5.975a.6.6 0 0 1-.848-.848L17.55 5.6H13a.6.6 0 0 1-.6-.6Z' fill='%230E0E0E'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9.774 4.4H9.8a.6.6 0 1 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.861 6.91c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v4.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h4.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.468-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.774c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.525-.042-1.175-.042-1.993V9.774c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C8.305 4.4 8.956 4.4 9.774 4.4ZM12.4 5a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V6.449l-5.976 5.975a.6.6 0 0 1-.848-.848L17.55 5.6H13a.6.6 0 0 1-.6-.6Z' fill='%230E0E0E'/%3E%3C/svg%3E");-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;vertical-align:top;width:1em}::slotted(svg){vertical-align:middle}}`;class Ki extends Oe{emit(e,t){const i=new CustomEvent(e,Object.assign({bubbles:!0,cancelable:!1,composed:!0,detail:{}},t));return this.dispatchEvent(i),i}static define(e,t=this,i={}){if(customElements.get(e));else try{customElements.define(e,t,i)}catch(l){customElements.define(e,class extends t{},i)}}constructor(){super(),this.ssr=Boolean(this.shadowRoot),Object.entries(this.constructor.dependencies).forEach(([e,t])=>{this.constructor.define(e,t)})}firstUpdated(e){var t;super.firstUpdated(e),this.ssr&&(null===(t=this.shadowRoot)||void 0===t||t.querySelectorAll("slot").forEach(e=>{e.dispatchEvent(new Event("slotchange",{bubbles:!0,composed:!1,cancelable:!1}))}))}}Ki.styles=[ji],Ki.dependencies={},e([We({type:Boolean,reflect:!0})],Ki.prototype,"ssr",void 0);class Gi extends Ki{constructor(){super(...arguments),this.myDropdown=st(),this.dropdownMenuId=Ni("dropdown-menu","div"),this.noFlip=!1,this.menuAlignRight=!1,this.drop="down",this.floatingOpts={},this.menuIsOpen=!1,this.close="default",this.disabled=!1,this.readonly=!1,this.menuRef=st(),this._handleClickOutOfElement=e=>{this.menuIsOpen&&(e.composedPath().includes(this)||this.hideMenu(!0))}}connectedCallback(){super.connectedCallback(),"inside"!==this.close&&document.addEventListener("click",this._handleClickOutOfElement),this.addEventListener("keydown",this._handleKeyboardMenuEvent)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this._handleClickOutOfElement),this.removeEventListener("keydown",this._handleKeyboardMenuEvent),this._cleanupAutoUpdate&&(this._cleanupAutoUpdate(),this._cleanupAutoUpdate=void 0)}firstUpdated(e){super.firstUpdated(e),this.menuIsOpen&&requestAnimationFrame(async()=>{await this.updateFloatingPosition(),this._startAutoUpdate()})}async showMenu(){this.disabled||this.menuIsOpen||(this.menuIsOpen=!0,this.emit("sgds-show"),await this.updateFloatingPosition(),this.emit("sgds-after-show"),this._startAutoUpdate())}_startAutoUpdate(){this.myDropdown.value&&this.menuRef.value&&(this._cleanupAutoUpdate=Ai(this.myDropdown.value,this.menuRef.value,()=>this.updateFloatingPosition()))}hideMenu(e){this.menuIsOpen&&(this.emit("sgds-hide",{detail:{isOutside:e}}),this.menuIsOpen=!1,setTimeout(()=>this.emit("sgds-after-hide"),0),this._cleanupAutoUpdate&&(this._cleanupAutoUpdate(),this._cleanupAutoUpdate=void 0))}toggleMenu(){this.menuIsOpen?this.hideMenu():this.showMenu()}_handleKeyboardMenuEvent(e){if(!this.readonly)switch(e.key){case"ArrowDown":case"ArrowUp":e.preventDefault(),this.menuIsOpen||this.showMenu();break;case"Escape":this.hideMenu()}}mergeMiddleware(e,t){const i=e=>{var t;return(null==e?void 0:e.name)||(null===(t=null==e?void 0:e.constructor)||void 0===t?void 0:t.name)},l=t.map(i),a=e.map(e=>{const a=i(e),o=l.indexOf(a);return-1!==o?t[o]:e}).concat(t.filter(t=>!e.some(e=>i(e)===i(t))));return a}async updateFloatingPosition(){if(!this.myDropdown.value||!this.menuRef.value)return;let e="bottom-start";switch(this.drop){case"up":e=this.menuAlignRight?"top-end":"top-start";break;case"right":e="right-start";break;case"left":e="left-start";break;case"down":e=this.menuAlignRight?"bottom-end":"bottom-start";break;default:e="bottom-start"}const t=[Li(8),this.noFlip?void 0:Ii(),Ei()].filter(Boolean);let i=t;Array.isArray(this.floatingOpts.middleware)&&this.floatingOpts.middleware.length>0&&(i=this.mergeMiddleware(t,this.floatingOpts.middleware.filter(Boolean)));const l=Object.assign(Object.assign({strategy:"fixed",placement:e},this.floatingOpts),{middleware:i}),{x:a,y:o,strategy:s,placement:n}=await Ri(this.myDropdown.value,this.menuRef.value,l);this.menuRef.value.setAttribute("data-placement",n),Object.assign(this.menuRef.value.style,{position:s,left:`${a}px`,top:`${o}px`})}}e([We({type:Boolean,state:!0})],Gi.prototype,"noFlip",void 0),e([We({type:Boolean,reflect:!0,state:!0})],Gi.prototype,"menuAlignRight",void 0),e([We({type:String,reflect:!0,state:!0})],Gi.prototype,"drop",void 0),e([We({type:Object})],Gi.prototype,"floatingOpts",void 0),e([We({type:Boolean,reflect:!0})],Gi.prototype,"menuIsOpen",void 0),e([We({type:Boolean,reflect:!0})],Gi.prototype,"disabled",void 0),e([We({type:Boolean,reflect:!0})],Gi.prototype,"readonly",void 0);class Ji extends Gi{constructor(){super(...arguments),this.nextDropdownItemNo=0,this.prevDropdownItemNo=-1,this.hidden=!1}connectedCallback(){super.connectedCallback(),this.addEventListener("sgds-hide",this._resetMenu)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("sgds-hide",this._resetMenu)}firstUpdated(e){super.firstUpdated(e),this.addEventListener("keydown",this._handleKeyboardMenuItemsEvent)}handleSelectSlot(e){const t=this._getActiveMenuItems(),i=t.find(t=>e.composedPath().includes(t));if(!i)return;const l=t.indexOf(i);this.nextDropdownItemNo=l+1,this.prevDropdownItemNo=l<=0?t.length-1:l-1,i.disabled||(this.emit("sgds-select",{detail:{item:i}}),"outside"!==this.close&&this.hideMenu())}_resetMenu(){this.nextDropdownItemNo=0,this.prevDropdownItemNo=-1;this._getMenuItems().forEach(e=>{var t;const i=null===(t=null==e?void 0:e.shadowRoot)||void 0===t?void 0:t.querySelector(".dropdown-item");i&&i.removeAttribute("tabindex")})}_handleKeyboardMenuItemsEvent(e){if(this.readonly)return;const t=this._getActiveMenuItems();if(0!==t.length)switch(e.key){case"ArrowDown":e.preventDefault(),this._setMenuItem(this.nextDropdownItemNo);break;case"ArrowUp":e.preventDefault(),this._setMenuItem(this.prevDropdownItemNo);break;case"Tab":if(!this.menuIsOpen)return;e.preventDefault(),e.shiftKey?this._setMenuItem(this.prevDropdownItemNo):this._setMenuItem(this.nextDropdownItemNo);break;case"Enter":t.find(t=>e.composedPath().includes(t))&&this.handleSelectSlot(e);break}}_getMenuItems(){var e,t;if(this.shadowRoot.querySelector("slot#default")){return null===(e=this.shadowRoot.querySelector("slot#default"))||void 0===e?void 0:e.assignedElements({flatten:!0}).filter(e=>!e.classList.contains("empty-menu")&&!e.hasAttribute("hidden"))}if(null===(t=this.menu)||void 0===t?void 0:t.hasChildNodes()){return[...Array.from(this.menu.children)]}return[]}_getActiveMenuItems(){return this._getMenuItems().filter(e=>!e.disabled&&!e.hidden)}_setMenuItem(e){const t=this._getActiveMenuItems();if(0===t.length)return;const i=(e%t.length+t.length)%t.length,l=t[i];this.emit("i-sgds-option-focus",{detail:{option:l}}),this.nextDropdownItemNo=(i+1)%t.length,this.prevDropdownItemNo=(i-1+t.length)%t.length,t.forEach(e=>{const t=e.shadowRoot.querySelector(".dropdown-item");t.setAttribute("tabindex",e===l?"0":"-1"),e===l&&t.focus()})}}var Xi,Yi;Ji.styles=Gi.styles,e([(Xi="ul.dropdown-menu",(e,t,i)=>{const l=e=>{const i=e.renderRoot?.querySelector(Xi)??null;if(null===i&&Yi&&!e.hasUpdated){const e="object"==typeof t?t.name:t;Ke("",`@query'd field ${JSON.stringify(String(e))} with the 'cache' flag set for selector '${Xi}' has been accessed before the first update and returned null. This is expected if the renderRoot tree has not been provided beforehand (e.g. via Declarative Shadow DOM). Therefore the value hasn't been cached.`)}return i};if(Yi){const{get:a,set:o}="object"==typeof t?e:i??(()=>{const e=Symbol(`${String(t)} (@query() cache)`);return{get(){return this[e]},set(t){this[e]=t}}})();return je(e,t,{get(){let e=a.call(this);return void 0===e&&(e=l(this),(null!==e||this.hasUpdated)&&o.call(this,e)),e}})}return je(e,t,{get(){return l(this)}})})],Ji.prototype,"menu",void 0),e([qe()],Ji.prototype,"nextDropdownItemNo",void 0),e([qe()],Ji.prototype,"prevDropdownItemNo",void 0),e([We({type:Boolean,reflect:!0})],Ji.prototype,"hidden",void 0);var Qi=we`.empty-menu,.loading-menu{padding:var(--sgds-padding-sm) var(--sgds-padding-lg,20px);pointer-events:none}.loading-menu{align-items:center;display:flex;gap:var(--sgds-gap-xs)}`;class el extends(qi(Ji)){setInvalid(e){this.invalid=e,e?this.emit("sgds-invalid"):this.emit("sgds-valid")}constructor(){super(),this.label="",this.hintText="",this.autofocus=!1,this.disabled=!1,this.required=!1,this.loading=!1,this.value="",this.displayValue="",this.defaultValue="",this.hasFeedback=!1,this.invalidFeedback="",this.invalid=!1,this.menuList=[],this.selectedItems=[],this.filteredList=[],this._isTouched=!1,this._controlId=Ni("input"),this._labelId=Ni("label"),this.floatingOpts={middleware:[Ti({apply({rects:e,elements:t}){t.floating.style.width=`${e.reference.width}px`}})]}}connectedCallback(){super.connectedCallback(),this.addEventListener("blur",async e=>{var t;if(this._mixinShouldSkipSgdsValidation())return;const i=this.constructor.childName,l=(null===(t=e.relatedTarget)||void 0===t?void 0:t.tagName.toLowerCase())===i;this.invalid=!l&&!this._mixinReportValidity()})}reportValidity(){return this._mixinReportValidity()}checkValidity(){return this._mixinCheckValidity()}get validity(){return this._mixinGetValidity()}get validationMessage(){return this._mixinGetValidationMessage()}_renderFeedback(){return this.invalid&&this.hasFeedback?S` <div class="invalid-feedback-container">
|
|
81
|
+
*/const st=()=>new nt;class nt{}const rt=new WeakMap;const ct=te(class extends ot{render(e){return L}update(e,[t]){const i=t!==this._ref;return i&&void 0!==this._ref&&this._updateRefValue(void 0),(i||this._lastElementForRef!==this._element)&&(this._ref=t,this._context=e.options?.host,this._updateRefValue(this._element=e.element)),L}_updateRefValue(e){if(this.isConnected||(e=void 0),"function"==typeof this._ref){const t=this._context??globalThis;let i=rt.get(t);void 0===i&&(i=new WeakMap,rt.set(t,i)),void 0!==i.get(this._ref)&&this._ref.call(this._context,void 0),i.set(this._ref,e),void 0!==e&&this._ref.call(this._context,e)}else this._ref.value=e}get _lastElementForRef(){return"function"==typeof this._ref?rt.get(this._context??globalThis)?.get(this._ref):this._ref?.value}disconnected(){this._lastElementForRef===this._element&&this._updateRefValue(void 0)}reconnected(){this._updateRefValue(this._element)}}),dt=["top","right","bottom","left"],ht=Math.min,vt=Math.max,ut=Math.round,pt=Math.floor,gt=e=>({x:e,y:e}),ft={left:"right",right:"left",bottom:"top",top:"bottom"},mt={start:"end",end:"start"};function wt(e,t,i){return vt(e,ht(t,i))}function bt(e,t){return"function"==typeof e?e(t):e}function xt(e){return e.split("-")[0]}function yt(e){return e.split("-")[1]}function Ct(e){return"x"===e?"y":"x"}function Zt(e){return"y"===e?"height":"width"}const _t=new Set(["top","bottom"]);function Mt(e){return _t.has(xt(e))?"y":"x"}function Vt(e){return Ct(Mt(e))}function kt(e,t,i){void 0===i&&(i=!1);const l=yt(e),a=Vt(e),o=Zt(a);let s="x"===a?l===(i?"end":"start")?"right":"left":"start"===l?"bottom":"top";return t.reference[o]>t.floating[o]&&(s=Et(s)),[s,Et(s)]}function Ht(e){return e.replace(/start|end/g,e=>mt[e])}const $t=["left","right"],St=["right","left"],Bt=["top","bottom"],At=["bottom","top"];function Lt(e,t,i,l){const a=yt(e);let o=function(e,t,i){switch(e){case"top":case"bottom":return i?t?St:$t:t?$t:St;case"left":case"right":return t?Bt:At;default:return[]}}(xt(e),"start"===i,l);return a&&(o=o.map(e=>e+"-"+a),t&&(o=o.concat(o.map(Ht)))),o}function Et(e){return e.replace(/left|right|bottom|top/g,e=>ft[e])}function It(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function Tt(e){const{x:t,y:i,width:l,height:a}=e;return{width:l,height:a,top:i,left:t,right:t+l,bottom:i+a,x:t,y:i}}function Pt(e,t,i){let{reference:l,floating:a}=e;const o=Mt(t),s=Vt(t),n=Zt(s),r=xt(t),c="y"===o,d=l.x+l.width/2-a.width/2,h=l.y+l.height/2-a.height/2,v=l[n]/2-a[n]/2;let u;switch(r){case"top":u={x:d,y:l.y-a.height};break;case"bottom":u={x:d,y:l.y+l.height};break;case"right":u={x:l.x+l.width,y:h};break;case"left":u={x:l.x-a.width,y:h};break;default:u={x:l.x,y:l.y}}switch(yt(t)){case"start":u[s]-=v*(i&&c?-1:1);break;case"end":u[s]+=v*(i&&c?-1:1)}return u}async function Ot(e,t){var i;void 0===t&&(t={});const{x:l,y:a,platform:o,rects:s,elements:n,strategy:r}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:v=!1,padding:u=0}=bt(t,e),p=It(u),g=n[v?"floating"===h?"reference":"floating":h],f=Tt(await o.getClippingRect({element:null==(i=await(null==o.isElement?void 0:o.isElement(g)))||i?g:g.contextElement||await(null==o.getDocumentElement?void 0:o.getDocumentElement(n.floating)),boundary:c,rootBoundary:d,strategy:r})),m="floating"===h?{x:l,y:a,width:s.floating.width,height:s.floating.height}:s.reference,w=await(null==o.getOffsetParent?void 0:o.getOffsetParent(n.floating)),b=await(null==o.isElement?void 0:o.isElement(w))&&await(null==o.getScale?void 0:o.getScale(w))||{x:1,y:1},x=Tt(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:n,rect:m,offsetParent:w,strategy:r}):m);return{top:(f.top-x.top+p.top)/b.y,bottom:(x.bottom-f.bottom+p.bottom)/b.y,left:(f.left-x.left+p.left)/b.x,right:(x.right-f.right+p.right)/b.x}}function Rt(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function zt(e){return dt.some(t=>e[t]>=0)}const Dt=new Set(["left","top"]);function Ut(){return"undefined"!=typeof window}function Ft(e){return qt(e)?(e.nodeName||"").toLowerCase():"#document"}function Nt(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Wt(e){var t;return null==(t=(qt(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function qt(e){return!!Ut()&&(e instanceof Node||e instanceof Nt(e).Node)}function jt(e){return!!Ut()&&(e instanceof Element||e instanceof Nt(e).Element)}function Kt(e){return!!Ut()&&(e instanceof HTMLElement||e instanceof Nt(e).HTMLElement)}function Gt(e){return!(!Ut()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Nt(e).ShadowRoot)}const Jt=new Set(["inline","contents"]);function Xt(e){const{overflow:t,overflowX:i,overflowY:l,display:a}=ci(e);return/auto|scroll|overlay|hidden|clip/.test(t+l+i)&&!Jt.has(a)}const Yt=new Set(["table","td","th"]);function Qt(e){return Yt.has(Ft(e))}const ei=[":popover-open",":modal"];function ti(e){return ei.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const ii=["transform","translate","scale","rotate","perspective"],li=["transform","translate","scale","rotate","perspective","filter"],ai=["paint","layout","strict","content"];function oi(e){const t=si(),i=jt(e)?ci(e):e;return ii.some(e=>!!i[e]&&"none"!==i[e])||!!i.containerType&&"normal"!==i.containerType||!t&&!!i.backdropFilter&&"none"!==i.backdropFilter||!t&&!!i.filter&&"none"!==i.filter||li.some(e=>(i.willChange||"").includes(e))||ai.some(e=>(i.contain||"").includes(e))}function si(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const ni=new Set(["html","body","#document"]);function ri(e){return ni.has(Ft(e))}function ci(e){return Nt(e).getComputedStyle(e)}function di(e){return jt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function hi(e){if("html"===Ft(e))return e;const t=e.assignedSlot||e.parentNode||Gt(e)&&e.host||Wt(e);return Gt(t)?t.host:t}function vi(e){const t=hi(e);return ri(t)?e.ownerDocument?e.ownerDocument.body:e.body:Kt(t)&&Xt(t)?t:vi(t)}function ui(e,t,i){var l;void 0===t&&(t=[]),void 0===i&&(i=!0);const a=vi(e),o=a===(null==(l=e.ownerDocument)?void 0:l.body),s=Nt(a);if(o){const e=pi(s);return t.concat(s,s.visualViewport||[],Xt(a)?a:[],e&&i?ui(e):[])}return t.concat(a,ui(a,[],i))}function pi(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function gi(e){const t=ci(e);let i=parseFloat(t.width)||0,l=parseFloat(t.height)||0;const a=Kt(e),o=a?e.offsetWidth:i,s=a?e.offsetHeight:l,n=ut(i)!==o||ut(l)!==s;return n&&(i=o,l=s),{width:i,height:l,$:n}}function fi(e){return jt(e)?e:e.contextElement}function mi(e){const t=fi(e);if(!Kt(t))return gt(1);const i=t.getBoundingClientRect(),{width:l,height:a,$:o}=gi(t);let s=(o?ut(i.width):i.width)/l,n=(o?ut(i.height):i.height)/a;return s&&Number.isFinite(s)||(s=1),n&&Number.isFinite(n)||(n=1),{x:s,y:n}}const wi=gt(0);function bi(e){const t=Nt(e);return si()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:wi}function xi(e,t,i,l){void 0===t&&(t=!1),void 0===i&&(i=!1);const a=e.getBoundingClientRect(),o=fi(e);let s=gt(1);t&&(l?jt(l)&&(s=mi(l)):s=mi(e));const n=function(e,t,i){return void 0===t&&(t=!1),!(!i||t&&i!==Nt(e))&&t}(o,i,l)?bi(o):gt(0);let r=(a.left+n.x)/s.x,c=(a.top+n.y)/s.y,d=a.width/s.x,h=a.height/s.y;if(o){const e=Nt(o),t=l&&jt(l)?Nt(l):l;let i=e,a=pi(i);for(;a&&l&&t!==i;){const e=mi(a),t=a.getBoundingClientRect(),l=ci(a),o=t.left+(a.clientLeft+parseFloat(l.paddingLeft))*e.x,s=t.top+(a.clientTop+parseFloat(l.paddingTop))*e.y;r*=e.x,c*=e.y,d*=e.x,h*=e.y,r+=o,c+=s,i=Nt(a),a=pi(i)}}return Tt({width:d,height:h,x:r,y:c})}function yi(e,t){const i=di(e).scrollLeft;return t?t.left+i:xi(Wt(e)).left+i}function Ci(e,t){const i=e.getBoundingClientRect();return{x:i.left+t.scrollLeft-yi(e,i),y:i.top+t.scrollTop}}const Zi=new Set(["absolute","fixed"]);function _i(e,t,i){let l;if("viewport"===t)l=function(e,t){const i=Nt(e),l=Wt(e),a=i.visualViewport;let o=l.clientWidth,s=l.clientHeight,n=0,r=0;if(a){o=a.width,s=a.height;const e=si();(!e||e&&"fixed"===t)&&(n=a.offsetLeft,r=a.offsetTop)}const c=yi(l);if(c<=0){const e=l.ownerDocument,t=e.body,i=getComputedStyle(t),a="CSS1Compat"===e.compatMode&&parseFloat(i.marginLeft)+parseFloat(i.marginRight)||0,s=Math.abs(l.clientWidth-t.clientWidth-a);s<=25&&(o-=s)}else c<=25&&(o+=c);return{width:o,height:s,x:n,y:r}}(e,i);else if("document"===t)l=function(e){const t=Wt(e),i=di(e),l=e.ownerDocument.body,a=vt(t.scrollWidth,t.clientWidth,l.scrollWidth,l.clientWidth),o=vt(t.scrollHeight,t.clientHeight,l.scrollHeight,l.clientHeight);let s=-i.scrollLeft+yi(e);const n=-i.scrollTop;return"rtl"===ci(l).direction&&(s+=vt(t.clientWidth,l.clientWidth)-a),{width:a,height:o,x:s,y:n}}(Wt(e));else if(jt(t))l=function(e,t){const i=xi(e,!0,"fixed"===t),l=i.top+e.clientTop,a=i.left+e.clientLeft,o=Kt(e)?mi(e):gt(1);return{width:e.clientWidth*o.x,height:e.clientHeight*o.y,x:a*o.x,y:l*o.y}}(t,i);else{const i=bi(e);l={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Tt(l)}function Mi(e,t){const i=hi(e);return!(i===t||!jt(i)||ri(i))&&("fixed"===ci(i).position||Mi(i,t))}function Vi(e,t,i){const l=Kt(t),a=Wt(t),o="fixed"===i,s=xi(e,!0,o,t);let n={scrollLeft:0,scrollTop:0};const r=gt(0);function c(){r.x=yi(a)}if(l||!l&&!o)if(("body"!==Ft(t)||Xt(a))&&(n=di(t)),l){const e=xi(t,!0,o,t);r.x=e.x+t.clientLeft,r.y=e.y+t.clientTop}else a&&c();o&&!l&&a&&c();const d=!a||l||o?gt(0):Ci(a,n);return{x:s.left+n.scrollLeft-r.x-d.x,y:s.top+n.scrollTop-r.y-d.y,width:s.width,height:s.height}}function ki(e){return"static"===ci(e).position}function Hi(e,t){if(!Kt(e)||"fixed"===ci(e).position)return null;if(t)return t(e);let i=e.offsetParent;return Wt(e)===i&&(i=i.ownerDocument.body),i}function $i(e,t){const i=Nt(e);if(ti(e))return i;if(!Kt(e)){let t=hi(e);for(;t&&!ri(t);){if(jt(t)&&!ki(t))return t;t=hi(t)}return i}let l=Hi(e,t);for(;l&&Qt(l)&&ki(l);)l=Hi(l,t);return l&&ri(l)&&ki(l)&&!oi(l)?i:l||function(e){let t=hi(e);for(;Kt(t)&&!ri(t);){if(oi(t))return t;if(ti(t))return null;t=hi(t)}return null}(e)||i}const Si={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:i,offsetParent:l,strategy:a}=e;const o="fixed"===a,s=Wt(l),n=!!t&&ti(t.floating);if(l===s||n&&o)return i;let r={scrollLeft:0,scrollTop:0},c=gt(1);const d=gt(0),h=Kt(l);if((h||!h&&!o)&&(("body"!==Ft(l)||Xt(s))&&(r=di(l)),Kt(l))){const e=xi(l);c=mi(l),d.x=e.x+l.clientLeft,d.y=e.y+l.clientTop}const v=!s||h||o?gt(0):Ci(s,r);return{width:i.width*c.x,height:i.height*c.y,x:i.x*c.x-r.scrollLeft*c.x+d.x+v.x,y:i.y*c.y-r.scrollTop*c.y+d.y+v.y}},getDocumentElement:Wt,getClippingRect:function(e){let{element:t,boundary:i,rootBoundary:l,strategy:a}=e;const o=[..."clippingAncestors"===i?ti(t)?[]:function(e,t){const i=t.get(e);if(i)return i;let l=ui(e,[],!1).filter(e=>jt(e)&&"body"!==Ft(e)),a=null;const o="fixed"===ci(e).position;let s=o?hi(e):e;for(;jt(s)&&!ri(s);){const t=ci(s),i=oi(s);i||"fixed"!==t.position||(a=null),(o?!i&&!a:!i&&"static"===t.position&&a&&Zi.has(a.position)||Xt(s)&&!i&&Mi(e,s))?l=l.filter(e=>e!==s):a=t,s=hi(s)}return t.set(e,l),l}(t,this._c):[].concat(i),l],s=o[0],n=o.reduce((e,i)=>{const l=_i(t,i,a);return e.top=vt(l.top,e.top),e.right=ht(l.right,e.right),e.bottom=ht(l.bottom,e.bottom),e.left=vt(l.left,e.left),e},_i(t,s,a));return{width:n.right-n.left,height:n.bottom-n.top,x:n.left,y:n.top}},getOffsetParent:$i,getElementRects:async function(e){const t=this.getOffsetParent||$i,i=this.getDimensions,l=await i(e.floating);return{reference:Vi(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:l.width,height:l.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:i}=gi(e);return{width:t,height:i}},getScale:mi,isElement:jt,isRTL:function(e){return"rtl"===ci(e).direction}};function Bi(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ai(e,t,i,l){void 0===l&&(l={});const{ancestorScroll:a=!0,ancestorResize:o=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:n="function"==typeof IntersectionObserver,animationFrame:r=!1}=l,c=fi(e),d=a||o?[...c?ui(c):[],...ui(t)]:[];d.forEach(e=>{a&&e.addEventListener("scroll",i,{passive:!0}),o&&e.addEventListener("resize",i)});const h=c&&n?function(e,t){let i,l=null;const a=Wt(e);function o(){var e;clearTimeout(i),null==(e=l)||e.disconnect(),l=null}return function s(n,r){void 0===n&&(n=!1),void 0===r&&(r=1),o();const c=e.getBoundingClientRect(),{left:d,top:h,width:v,height:u}=c;if(n||t(),!v||!u)return;const p={rootMargin:-pt(h)+"px "+-pt(a.clientWidth-(d+v))+"px "+-pt(a.clientHeight-(h+u))+"px "+-pt(d)+"px",threshold:vt(0,ht(1,r))||1};let g=!0;function f(t){const l=t[0].intersectionRatio;if(l!==r){if(!g)return s();l?s(!1,l):i=setTimeout(()=>{s(!1,1e-7)},1e3)}1!==l||Bi(c,e.getBoundingClientRect())||s(),g=!1}try{l=new IntersectionObserver(f,{...p,root:a.ownerDocument})}catch(e){l=new IntersectionObserver(f,p)}l.observe(e)}(!0),o}(c,i):null;let v,u=-1,p=null;s&&(p=new ResizeObserver(e=>{let[l]=e;l&&l.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(u),u=requestAnimationFrame(()=>{var e;null==(e=p)||e.observe(t)})),i()}),c&&!r&&p.observe(c),p.observe(t));let g=r?xi(e):null;return r&&function t(){const l=xi(e);g&&!Bi(g,l)&&i();g=l,v=requestAnimationFrame(t)}(),i(),()=>{var e;d.forEach(e=>{a&&e.removeEventListener("scroll",i),o&&e.removeEventListener("resize",i)}),null==h||h(),null==(e=p)||e.disconnect(),p=null,r&&cancelAnimationFrame(v)}}const Li=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var i,l;const{x:a,y:o,placement:s,middlewareData:n}=t,r=await async function(e,t){const{placement:i,platform:l,elements:a}=e,o=await(null==l.isRTL?void 0:l.isRTL(a.floating)),s=xt(i),n=yt(i),r="y"===Mt(i),c=Dt.has(s)?-1:1,d=o&&r?-1:1,h=bt(t,e);let{mainAxis:v,crossAxis:u,alignmentAxis:p}="number"==typeof h?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return n&&"number"==typeof p&&(u="end"===n?-1*p:p),r?{x:u*d,y:v*c}:{x:v*c,y:u*d}}(t,e);return s===(null==(i=n.offset)?void 0:i.placement)&&null!=(l=n.arrow)&&l.alignmentOffset?{}:{x:a+r.x,y:o+r.y,data:{...r,placement:s}}}}},Ei=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:i,y:l,placement:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:n={fn:e=>{let{x:t,y:i}=e;return{x:t,y:i}}},...r}=bt(e,t),c={x:i,y:l},d=await Ot(t,r),h=Mt(xt(a)),v=Ct(h);let u=c[v],p=c[h];if(o){const e="y"===v?"bottom":"right";u=wt(u+d["y"===v?"top":"left"],u,u-d[e])}if(s){const e="y"===h?"bottom":"right";p=wt(p+d["y"===h?"top":"left"],p,p-d[e])}const g=n.fn({...t,[v]:u,[h]:p});return{...g,data:{x:g.x-i,y:g.y-l,enabled:{[v]:o,[h]:s}}}}}},Ii=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var i,l;const{placement:a,middlewareData:o,rects:s,initialPlacement:n,platform:r,elements:c}=t,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:v,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:g=!0,...f}=bt(e,t);if(null!=(i=o.arrow)&&i.alignmentOffset)return{};const m=xt(a),w=Mt(n),b=xt(n)===n,x=await(null==r.isRTL?void 0:r.isRTL(c.floating)),y=v||(b||!g?[Et(n)]:function(e){const t=Et(e);return[Ht(e),t,Ht(t)]}(n)),C="none"!==p;!v&&C&&y.push(...Lt(n,g,p,x));const Z=[n,...y],_=await Ot(t,f),M=[];let V=(null==(l=o.flip)?void 0:l.overflows)||[];if(d&&M.push(_[m]),h){const e=kt(a,s,x);M.push(_[e[0]],_[e[1]])}if(V=[...V,{placement:a,overflows:M}],!M.every(e=>e<=0)){var k,H;const e=((null==(k=o.flip)?void 0:k.index)||0)+1,t=Z[e];if(t){if(!("alignment"===h&&w!==Mt(t))||V.every(e=>Mt(e.placement)!==w||e.overflows[0]>0))return{data:{index:e,overflows:V},reset:{placement:t}}}let i=null==(H=V.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:H.placement;if(!i)switch(u){case"bestFit":{var $;const e=null==($=V.filter(e=>{if(C){const t=Mt(e.placement);return t===w||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:$[0];e&&(i=e);break}case"initialPlacement":i=n}if(a!==i)return{reset:{placement:i}}}return{}}}},Ti=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var i,l;const{placement:a,rects:o,platform:s,elements:n}=t,{apply:r=()=>{},...c}=bt(e,t),d=await Ot(t,c),h=xt(a),v=yt(a),u="y"===Mt(a),{width:p,height:g}=o.floating;let f,m;"top"===h||"bottom"===h?(f=h,m=v===(await(null==s.isRTL?void 0:s.isRTL(n.floating))?"start":"end")?"left":"right"):(m=h,f="end"===v?"top":"bottom");const w=g-d.top-d.bottom,b=p-d.left-d.right,x=ht(g-d[f],w),y=ht(p-d[m],b),C=!t.middlewareData.shift;let Z=x,_=y;if(null!=(i=t.middlewareData.shift)&&i.enabled.x&&(_=b),null!=(l=t.middlewareData.shift)&&l.enabled.y&&(Z=w),C&&!v){const e=vt(d.left,0),t=vt(d.right,0),i=vt(d.top,0),l=vt(d.bottom,0);u?_=p-2*(0!==e||0!==t?e+t:vt(d.left,d.right)):Z=g-2*(0!==i||0!==l?i+l:vt(d.top,d.bottom))}await r({...t,availableWidth:_,availableHeight:Z});const M=await s.getDimensions(n.floating);return p!==M.width||g!==M.height?{reset:{rects:!0}}:{}}}},Pi=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:i}=t,{strategy:l="referenceHidden",...a}=bt(e,t);switch(l){case"referenceHidden":{const e=Rt(await Ot(t,{...a,elementContext:"reference"}),i.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:zt(e)}}}case"escaped":{const e=Rt(await Ot(t,{...a,altBoundary:!0}),i.floating);return{data:{escapedOffsets:e,escaped:zt(e)}}}default:return{}}}}},Oi=(e,t,i)=>{const l=new Map,a={platform:Si,...i},o={...a.platform,_c:l};return(async(e,t,i)=>{const{placement:l="bottom",strategy:a="absolute",middleware:o=[],platform:s}=i,n=o.filter(Boolean),r=await(null==s.isRTL?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:a}),{x:d,y:h}=Pt(c,l,r),v=l,u={},p=0;for(let i=0;i<n.length;i++){const{name:o,fn:g}=n[i],{x:f,y:m,data:w,reset:b}=await g({x:d,y:h,initialPlacement:l,placement:v,strategy:a,middlewareData:u,rects:c,platform:s,elements:{reference:e,floating:t}});d=null!=f?f:d,h=null!=m?m:h,u={...u,[o]:{...u[o],...w}},b&&p<=50&&(p++,"object"==typeof b&&(b.placement&&(v=b.placement),b.rects&&(c=!0===b.rects?await s.getElementRects({reference:e,floating:t,strategy:a}):b.rects),({x:d,y:h}=Pt(c,v,r))),i=-1)}return{x:d,y:h,placement:v,strategy:a,middlewareData:u}})(e,t,{...a,platform:o})};var Ri=we`:host([menuisopen]:not([disabled]):not([readonly])) .dropdown-menu{display:block}.dropdown-menu{background-clip:padding-box;background-color:var(--sgds-surface-default);border-radius:var(--sgds-border-radius-md);box-shadow:0 0 1px 0 hsla(0,0%,5%,.12),0 4px 8px 0 hsla(0,0%,5%,.12);color:var(--sgds-color-default);display:none;list-style:none;margin:0;max-height:var(--sgds-dimension-480);min-width:var(--sgds-dimension-192);overflow-y:auto;padding:var(--sgds-padding-xs) 0;position:absolute;text-align:left;z-index:var(--sgds-z-index-floating)}.nav-tabs .dropdown-menu{border-top-left-radius:0;border-top-right-radius:0;margin-top:calc(var(--sgds-nav-tabs-border-width)*-1)}@media (min-width:512px){.navbar-expand-sm .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:768px){.navbar-expand-md .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:1024px){.navbar-expand-lg .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:1280px){.navbar-expand-xl .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:1440px){.navbar-expand-xxl .navbar-nav .dropdown-menu{position:absolute}}.navbar-expand .navbar-nav .dropdown-menu{position:absolute}.sgds.navbar .dropdown-menu.megamenu{left:0;right:0;width:100%}.sgds.combobox>.dropdown-menu{min-width:100%}`,zi=we`.invalid-feedback-container{display:flex;gap:var(--sgds-form-gap-sm)}.invalid-feedback,.invalid-feedback-container{color:var(--sgds-form-danger-color-default);line-height:var(--sgds-line-height-20)}.invalid-feedback{font-size:var(--sgds-font-size-14);font-weight:var(--sgds-font-weight-regular)}.valid-icon{color:var(--sgds-form-success-color-default)}`,Di=we`.form-text{color:var(--sgds-form-color-subtle);font-size:var(--sgds-font-size-label-sm);line-height:var(--sgds-line-height-2-xs)}.form-text.disabled{opacity:var(--sgds-opacity-40)}`,Ui=we`.form-control-container{display:flex;flex-direction:column;gap:var(--sgds-form-gap-md)}.m-width-160{min-width:var(--sgds-dimension-160)}.m-width-256{min-width:var(--sgds-dimension-256)}.form-label{color:var(--sgds-form-color-default);font-size:var(--sgds-font-size-label-md)}.form-control-group{align-items:center;background-color:var(--sgds-form-surface-default);border:var(--sgds-form-border-width-default) solid var(--sgds-border-color-default);border-radius:var(--input-border-radius,var(--sgds-form-border-radius-md));display:flex;gap:var(--sgds-form-gap-md);height:var(--sgds-dimension-48);justify-content:center;overflow:hidden;padding:0 var(--sgds-form-padding-x);transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;width:-webkit-fill-available;width:-moz-available}.form-control{appearance:none;background-clip:padding-box;background:none;border:none;color:var(--sgds-form-color-default);display:block;flex-grow:1;font-family:var(--sgds-font-family-brand);font-size:var(--sgds-font-size-label-md);line-height:var(--sgds-line-height-xs);min-width:0;outline:none;padding:0;width:100%}.form-clearable{color:var(--sgds-color-subtle);cursor:pointer}@media (prefers-reduced-motion:reduce){.form-control-group{transition:none}}.form-control-group:not(.disabled):not(.is-invalid):not(.readonly):not(:focus-within):hover{outline:var(--sgds-form-border-width-thick) solid var(--sgds-border-color-emphasis);outline-offset:var(--sgds-form-outline-offset-focus)}.form-control-group:not(.disabled):not(.is-invalid):focus-within{outline:var(--sgds-form-outline-focus);outline-offset:var(--sgds-form-outline-offset-focus)}.form-control-container.disabled{opacity:var(--sgds-opacity-40)}.form-control-group.disabled{background-color:var(--sgds-form-surface-muted);cursor:not-allowed}.form-control-group.readonly{background-color:var(--sgds-form-surface-raised)}.form-control-group.is-invalid:not(.disabled){border:var(--sgds-form-border-width-default) solid var(--sgds-form-danger-border-color-default)}.form-control-group:not(.disabled).is-invalid:focus-within{outline:var(--sgds-border-width-2) solid var(--sgds-form-danger-color-default);outline-offset:var(--sgds-form-outline-offset-focus)}`;const Fi=(e="value")=>(t,i)=>{const l=t.constructor,a=l.prototype.attributeChangedCallback;l.prototype.attributeChangedCallback=function(t,o,s){var n;const r=l.getPropertyOptions(e);if(t===("string"==typeof r.attribute?r.attribute:e).toLowerCase()){const t=r.converter||Le,l=("function"==typeof t?t:null!==(n=null==t?void 0:t.fromAttribute)&&void 0!==n?n:Le.fromAttribute)(s,r.type);this[e]!==l&&(this[i]=l)}a.call(this,t,o,s)}};function Ni(e="",t=""){return`id-${Math.random().toString().substring(2,6)}-sgds-${e}-${t}`}class Wi{constructor(e,t){(this.host=e).addController(this),this._internals=e._internals||this.host.attachInternals(),this.options=Object.assign({setInvalid:(e,t)=>{e.invalid=t},value:e=>e.value,input:e=>e.input},t)}hostConnected(){this.host.addEventListener("invalid",e=>this.handleInvalid(e))}hostDisconnected(){this.host.removeEventListener("invalid",e=>this.handleInvalid(e))}handleInvalid(e){e.preventDefault(),this.options.setInvalid(this.host,!0)}handleInput(e){const t=e.target;this.options.setInvalid(this.host,!1),this.validateInput(t)}handleChange(e){const t=e.target;this.validateInput(t),this.options.setInvalid(this.host,!this.checkValidity())}get form(){return this._internals.form}get validity(){return this._internals.validity}get validationMessage(){return this._internals.validationMessage}get willValidate(){return this._internals.willValidate}updateInvalidState(){this.options.setInvalid(this.host,!this.checkValidity())}resetValidity(){return this._internals.setValidity({})}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}setValidity(e,t,i){return this._internals.setValidity(e,t,i)}setFormValue(){const e=this.options.value(this.host);this._internals.setFormValue(e)}validateInput(e){if(this.options.input(this.host).disabled)return this._internals.setValidity({});const t=e.validity;if(t.valid)this._internals.setValidity({});else for(const i in t)t[i]&&(this.validationError=i.toString(),this._internals.setValidity({[this.validationError]:!0},e.validationMessage,e))}}const qi=t=>{class i extends t{constructor(...e){super(...e),this._isTouched=!1,this._internals=this.attachInternals()}connectedCallback(){var e;super.connectedCallback(),this._mixinShouldSkipSgdsValidation()||null!==(e=this.inputValidationController)&&void 0!==e||(this.inputValidationController=new Wi(this))}async firstUpdated(e){super.firstUpdated(e),this.input=this.shadowRoot.querySelector("input")||await this.sgdsInput||this.shadowRoot.querySelector("textarea")||await this.sgdsDatepickerInput,this._mixinSetFormValue(),this._mixinShouldSkipSgdsValidation()||this._mixinValidate(this.input)}formResetCallback(){this._mixinResetFormControl?this._mixinResetFormControl():(this.value=this.defaultValue,this._mixinResetValidity(this.input)),this._mixinSetFormValue()}_mixinHandleChange(e){this._mixinSetFormValue(),this._mixinShouldSkipSgdsValidation()||this.inputValidationController.handleChange(e)}_mixinHandleInputChange(e){this._mixinSetFormValue(),this._mixinShouldSkipSgdsValidation()||this.inputValidationController.handleInput(e)}_mixinResetValidity(e){this._mixinShouldSkipSgdsValidation()||(this.inputValidationController.resetValidity(),this.inputValidationController.updateInvalidState(),this.inputValidationController.validateInput(e),this._isTouched&&(this._isTouched=!1))}_mixinValidate(e){this._mixinShouldSkipSgdsValidation()||this.inputValidationController.validateInput(e)}_mixinSetFormValue(){const e=this.value;this._internals.setFormValue(e)}_mixinCheckValidity(){return!!this._mixinShouldSkipSgdsValidation()||this.inputValidationController.checkValidity()}_mixinReportValidity(){return!!this._mixinShouldSkipSgdsValidation()||this.inputValidationController.reportValidity()}_mixinGetValidity(){return this._internals.validity}_mixinGetValidationMessage(){return this._internals.validationMessage}_mixinSetValidity(e,t,i){if(!this._mixinShouldSkipSgdsValidation())return this.inputValidationController.setValidity(e,t,i)}_mixinShouldSkipSgdsValidation(){const e=this.closest("form");return(null==e?void 0:e.noValidate)||this.noValidate}}return i.formAssociated=!0,e([Ge("sgds-input")],i.prototype,"sgdsInput",void 0),e([Ge("sgds-datepicker-input")],i.prototype,"sgdsDatepickerInput",void 0),i};var ji=we`:host{-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-font-smoothing:antialiased;color:var(--sgds-body-color-default,#1a1a1a);display:block;font-family:var(--sgds-font-family-brand,"Inter",system-ui,sans-serif);font-size:var(--sgds-font-size-body-md,1rem);font-weight:var(--sgds-font-weight-regular,400);line-height:var(--sgds-line-height-xs,24px);margin:0;*,:after,:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}:disabled{cursor:not-allowed}@media (prefers-reduced-motion:no-preference){:root{scroll-behavior:smooth}}::slotted(a[target=_blank]):after,a[target=_blank]:after{background-color:currentColor;content:"/";display:inline-block;height:1em;-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9.774 4.4H9.8a.6.6 0 1 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.861 6.91c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v4.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h4.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.468-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.774c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.525-.042-1.175-.042-1.993V9.774c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C8.305 4.4 8.956 4.4 9.774 4.4ZM12.4 5a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V6.449l-5.976 5.975a.6.6 0 0 1-.848-.848L17.55 5.6H13a.6.6 0 0 1-.6-.6Z' fill='%230E0E0E'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9.774 4.4H9.8a.6.6 0 1 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.861 6.91c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v4.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h4.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.468-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.774c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.525-.042-1.175-.042-1.993V9.774c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C8.305 4.4 8.956 4.4 9.774 4.4ZM12.4 5a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V6.449l-5.976 5.975a.6.6 0 0 1-.848-.848L17.55 5.6H13a.6.6 0 0 1-.6-.6Z' fill='%230E0E0E'/%3E%3C/svg%3E");-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;vertical-align:top;width:1em}::slotted(svg){vertical-align:middle}}`;class Ki extends Re{emit(e,t){const i=new CustomEvent(e,Object.assign({bubbles:!0,cancelable:!1,composed:!0,detail:{}},t));return this.dispatchEvent(i),i}static define(e,t=this,i={}){if(customElements.get(e));else try{customElements.define(e,t,i)}catch(l){customElements.define(e,class extends t{},i)}}constructor(){super(),this.ssr=Boolean(this.shadowRoot),Object.entries(this.constructor.dependencies).forEach(([e,t])=>{this.constructor.define(e,t)})}firstUpdated(e){var t;super.firstUpdated(e),this.ssr&&(null===(t=this.shadowRoot)||void 0===t||t.querySelectorAll("slot").forEach(e=>{e.dispatchEvent(new Event("slotchange",{bubbles:!0,composed:!1,cancelable:!1}))}))}}Ki.styles=[ji],Ki.dependencies={},e([We({type:Boolean,reflect:!0})],Ki.prototype,"ssr",void 0);class Gi extends Ki{constructor(){super(...arguments),this.myDropdown=st(),this.dropdownMenuId=Ni("dropdown-menu","div"),this.noFlip=!1,this.menuAlignRight=!1,this.drop="down",this.floatingOpts={},this.menuIsOpen=!1,this.close="default",this.disabled=!1,this.readonly=!1,this.menuRef=st(),this._handleClickOutOfElement=e=>{this.menuIsOpen&&(e.composedPath().includes(this)||this.hideMenu(!0))}}connectedCallback(){super.connectedCallback(),"inside"!==this.close&&document.addEventListener("click",this._handleClickOutOfElement),this.addEventListener("keydown",this._handleKeyboardMenuEvent)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this._handleClickOutOfElement),this.removeEventListener("keydown",this._handleKeyboardMenuEvent),this._cleanupAutoUpdate&&(this._cleanupAutoUpdate(),this._cleanupAutoUpdate=void 0)}firstUpdated(e){super.firstUpdated(e),this.menuIsOpen&&requestAnimationFrame(async()=>{await this.updateFloatingPosition(),this._startAutoUpdate()})}async showMenu(){this.disabled||this.menuIsOpen||(this.menuIsOpen=!0,this.emit("sgds-show"),await this.updateFloatingPosition(),this.emit("sgds-after-show"),this._startAutoUpdate())}_startAutoUpdate(){this.myDropdown.value&&this.menuRef.value&&(this._cleanupAutoUpdate=Ai(this.myDropdown.value,this.menuRef.value,()=>this.updateFloatingPosition()))}hideMenu(e){this.menuIsOpen&&(this.emit("sgds-hide",{detail:{isOutside:e}}),this.menuIsOpen=!1,setTimeout(()=>this.emit("sgds-after-hide"),0),this._cleanupAutoUpdate&&(this._cleanupAutoUpdate(),this._cleanupAutoUpdate=void 0))}toggleMenu(){this.menuIsOpen?this.hideMenu():this.showMenu()}_handleKeyboardMenuEvent(e){if(!this.readonly)switch(e.key){case"ArrowDown":case"ArrowUp":e.preventDefault(),this.menuIsOpen||this.showMenu();break;case"Escape":this.hideMenu()}}mergeMiddleware(e,t){const i=e=>{var t;return(null==e?void 0:e.name)||(null===(t=null==e?void 0:e.constructor)||void 0===t?void 0:t.name)},l=t.map(i),a=e.map(e=>{const a=i(e),o=l.indexOf(a);return-1!==o?t[o]:e}).concat(t.filter(t=>!e.some(e=>i(e)===i(t))));return a}async updateFloatingPosition(){if(!this.myDropdown.value||!this.menuRef.value)return;let e="bottom-start";switch(this.drop){case"up":e=this.menuAlignRight?"top-end":"top-start";break;case"right":e="right-start";break;case"left":e="left-start";break;case"down":e=this.menuAlignRight?"bottom-end":"bottom-start";break;default:e="bottom-start"}const t=[Li(8),this.noFlip?void 0:Ii(),Ei()].filter(Boolean);let i=t;Array.isArray(this.floatingOpts.middleware)&&this.floatingOpts.middleware.length>0&&(i=this.mergeMiddleware(t,this.floatingOpts.middleware.filter(Boolean)));const l=Object.assign(Object.assign({strategy:"fixed",placement:e},this.floatingOpts),{middleware:i}),{x:a,y:o,strategy:s,placement:n}=await Oi(this.myDropdown.value,this.menuRef.value,l);this.menuRef.value.setAttribute("data-placement",n),Object.assign(this.menuRef.value.style,{position:s,left:`${a}px`,top:`${o}px`})}}e([We({type:Boolean,state:!0})],Gi.prototype,"noFlip",void 0),e([We({type:Boolean,reflect:!0,state:!0})],Gi.prototype,"menuAlignRight",void 0),e([We({type:String,reflect:!0,state:!0})],Gi.prototype,"drop",void 0),e([We({type:Object})],Gi.prototype,"floatingOpts",void 0),e([We({type:Boolean,reflect:!0})],Gi.prototype,"menuIsOpen",void 0),e([We({type:Boolean,reflect:!0})],Gi.prototype,"disabled",void 0),e([We({type:Boolean,reflect:!0})],Gi.prototype,"readonly",void 0);class Ji extends Gi{constructor(){super(...arguments),this.nextDropdownItemNo=0,this.prevDropdownItemNo=-1,this.hidden=!1}connectedCallback(){super.connectedCallback(),this.addEventListener("sgds-hide",this._resetMenu)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("sgds-hide",this._resetMenu)}firstUpdated(e){super.firstUpdated(e),this.addEventListener("keydown",this._handleKeyboardMenuItemsEvent)}handleSelectSlot(e){const t=this._getActiveMenuItems(),i=t.find(t=>e.composedPath().includes(t));if(!i)return;const l=t.indexOf(i);this.nextDropdownItemNo=l+1,this.prevDropdownItemNo=l<=0?t.length-1:l-1,i.disabled||(this.emit("sgds-select",{detail:{item:i}}),"outside"!==this.close&&this.hideMenu())}_resetMenu(){this.nextDropdownItemNo=0,this.prevDropdownItemNo=-1;this._getMenuItems().forEach(e=>{var t;const i=null===(t=null==e?void 0:e.shadowRoot)||void 0===t?void 0:t.querySelector(".dropdown-item");i&&i.removeAttribute("tabindex")})}_handleKeyboardMenuItemsEvent(e){if(this.readonly)return;const t=this._getActiveMenuItems();if(0!==t.length)switch(e.key){case"ArrowDown":e.preventDefault(),this._setMenuItem(this.nextDropdownItemNo);break;case"ArrowUp":e.preventDefault(),this._setMenuItem(this.prevDropdownItemNo);break;case"Tab":if(!this.menuIsOpen)return;e.preventDefault(),e.shiftKey?this._setMenuItem(this.prevDropdownItemNo):this._setMenuItem(this.nextDropdownItemNo);break;case"Enter":t.find(t=>e.composedPath().includes(t))&&this.handleSelectSlot(e);break}}_getMenuItems(){var e,t;if(this.shadowRoot.querySelector("slot#default")){return null===(e=this.shadowRoot.querySelector("slot#default"))||void 0===e?void 0:e.assignedElements({flatten:!0}).filter(e=>!e.classList.contains("empty-menu")&&!e.hasAttribute("hidden"))}if(null===(t=this.menu)||void 0===t?void 0:t.hasChildNodes()){return[...Array.from(this.menu.children)]}return[]}_getActiveMenuItems(){return this._getMenuItems().filter(e=>!e.disabled&&!e.hidden)}_setMenuItem(e){const t=this._getActiveMenuItems();if(0===t.length)return;const i=(e%t.length+t.length)%t.length,l=t[i];this.emit("i-sgds-option-focus",{detail:{option:l}}),this.nextDropdownItemNo=(i+1)%t.length,this.prevDropdownItemNo=(i-1+t.length)%t.length,t.forEach(e=>{const t=e.shadowRoot.querySelector(".dropdown-item");t.setAttribute("tabindex",e===l?"0":"-1"),e===l&&t.focus()})}}var Xi,Yi;Ji.styles=Gi.styles,e([(Xi="ul.dropdown-menu",(e,t,i)=>{const l=e=>{const i=e.renderRoot?.querySelector(Xi)??null;if(null===i&&Yi&&!e.hasUpdated){const e="object"==typeof t?t.name:t;Ke("",`@query'd field ${JSON.stringify(String(e))} with the 'cache' flag set for selector '${Xi}' has been accessed before the first update and returned null. This is expected if the renderRoot tree has not been provided beforehand (e.g. via Declarative Shadow DOM). Therefore the value hasn't been cached.`)}return i};if(Yi){const{get:a,set:o}="object"==typeof t?e:i??(()=>{const e=Symbol(`${String(t)} (@query() cache)`);return{get(){return this[e]},set(t){this[e]=t}}})();return je(e,t,{get(){let e=a.call(this);return void 0===e&&(e=l(this),(null!==e||this.hasUpdated)&&o.call(this,e)),e}})}return je(e,t,{get(){return l(this)}})})],Ji.prototype,"menu",void 0),e([qe()],Ji.prototype,"nextDropdownItemNo",void 0),e([qe()],Ji.prototype,"prevDropdownItemNo",void 0),e([We({type:Boolean,reflect:!0})],Ji.prototype,"hidden",void 0);var Qi=we`.empty-menu,.loading-menu{padding:var(--sgds-padding-sm) var(--sgds-padding-lg,20px);pointer-events:none}.loading-menu{align-items:center;display:flex;gap:var(--sgds-gap-xs)}`;class el extends(qi(Ji)){setInvalid(e){this.invalid=e,e?this.emit("sgds-invalid"):this.emit("sgds-valid")}constructor(){super(),this.label="",this.hintText="",this.autofocus=!1,this.disabled=!1,this.required=!1,this.loading=!1,this.value="",this.displayValue="",this.defaultValue="",this.hasFeedback=!1,this.invalidFeedback="",this.invalid=!1,this.menuList=[],this.selectedItems=[],this.filteredList=[],this._isTouched=!1,this._controlId=Ni("input"),this._labelId=Ni("label"),this.floatingOpts={middleware:[Ti({apply({rects:e,elements:t}){t.floating.style.width=`${e.reference.width}px`}})]}}connectedCallback(){super.connectedCallback(),this.addEventListener("blur",async e=>{var t;if(this._mixinShouldSkipSgdsValidation())return;const i=this.constructor.childName,l=(null===(t=e.relatedTarget)||void 0===t?void 0:t.tagName.toLowerCase())===i;this.invalid=!l&&!this._mixinReportValidity()})}reportValidity(){return this._mixinReportValidity()}checkValidity(){return this._mixinCheckValidity()}get validity(){return this._mixinGetValidity()}get validationMessage(){return this._mixinGetValidationMessage()}_renderFeedback(){return this.invalid&&this.hasFeedback?S` <div class="invalid-feedback-container">
|
|
82
82
|
<slot name="invalidIcon">
|
|
83
83
|
<sgds-icon name="exclamation-circle-fill" size="md"></sgds-icon>
|
|
84
84
|
</slot>
|
|
@@ -92,7 +92,7 @@ function Ge(e){return(t,i)=>je(t,i,{async get(){return await this.updateComplete
|
|
|
92
92
|
class=${Xe({"form-label":!0,required:this.required})}
|
|
93
93
|
>${this.label}</label
|
|
94
94
|
>
|
|
95
|
-
`;return this.label&&e}_handleClick(){if(this.readonly)return null;this.menuIsOpen?this.hideMenu():this.showMenu()}async _getMenuListFromOptions(e){const t=e.map(async e=>(await e.updateComplete,e)),i=await Promise.all(t);return null==i?void 0:i.map(e=>{var t;return{label:e.innerText,value:e.getAttribute("value"),disabled:null!==(t=e.disabled)&&void 0!==t?t:void 0}})}_renderEmptyMenu(){return S` <div class="empty-menu">No options</div> `}_renderLoadingMenu(){return S`<div class="loading-menu"><sgds-spinner size="xs" tone="brand"></sgds-spinner>Loading...</div>`}}function tl(e,t){const i=Object.assign({waitUntilFirstUpdate:!1},t);return(t,l)=>{const{update:a}=t;if(e in t){const o=e;t.update=function(e){if(e.has(o)){const t=e.get(o),a=this[o];t!==a&&(i.waitUntilFirstUpdate&&!this.hasUpdated||this[l](t,a))}a.call(this,e)}}}}el.styles=[...Ji.styles,
|
|
95
|
+
`;return this.label&&e}_handleClick(){if(this.readonly)return null;this.menuIsOpen?this.hideMenu():this.showMenu()}async _getMenuListFromOptions(e){const t=e.map(async e=>(await e.updateComplete,e)),i=await Promise.all(t);return null==i?void 0:i.map(e=>{var t;return{label:e.innerText,value:e.getAttribute("value"),disabled:null!==(t=e.disabled)&&void 0!==t?t:void 0}})}_renderEmptyMenu(){return S` <div class="empty-menu">No options</div> `}_renderLoadingMenu(){return S`<div class="loading-menu"><sgds-spinner size="xs" tone="brand"></sgds-spinner>Loading...</div>`}}function tl(e,t){const i=Object.assign({waitUntilFirstUpdate:!1},t);return(t,l)=>{const{update:a}=t;if(e in t){const o=e;t.update=function(e){if(e.has(o)){const t=e.get(o),a=this[o];t!==a&&(i.waitUntilFirstUpdate&&!this.hasUpdated||this[l](t,a))}a.call(this,e)}}}}el.styles=[...Ji.styles,Ri,Di,zi,Ui,Qi],e([We({reflect:!0})],el.prototype,"label",void 0),e([We({reflect:!0})],el.prototype,"hintText",void 0),e([We({reflect:!0})],el.prototype,"name",void 0),e([We({type:String,reflect:!0})],el.prototype,"placeholder",void 0),e([We({type:Boolean,reflect:!0})],el.prototype,"autofocus",void 0),e([We({type:Boolean,reflect:!0})],el.prototype,"disabled",void 0),e([We({type:Boolean,reflect:!0})],el.prototype,"required",void 0),e([We({type:Boolean,reflect:!0})],el.prototype,"loading",void 0),e([We({type:String,reflect:!0})],el.prototype,"value",void 0),e([qe()],el.prototype,"displayValue",void 0),e([Fi()],el.prototype,"defaultValue",void 0),e([We({type:Boolean,reflect:!0})],el.prototype,"hasFeedback",void 0),e([We({type:String,reflect:!0})],el.prototype,"invalidFeedback",void 0),e([We({type:Boolean,reflect:!0})],el.prototype,"invalid",void 0),e([We({type:Array})],el.prototype,"menuList",void 0),e([qe()],el.prototype,"selectedItems",void 0),e([qe()],el.prototype,"filteredList",void 0),e([Ge("input.form-control")],el.prototype,"_input",void 0);var il=we`:host{cursor:default;display:inline-flex;max-width:100%}:host([variant=accent]) .badge{background-color:var(--sgds-accent-surface-default)}:host([variant=success]) .badge{background-color:var(--sgds-success-surface-default)}:host([variant=danger]) .badge{background-color:var(--sgds-danger-surface-default)}:host([variant=warning]) .badge{background-color:var(--sgds-warning-surface-default);color:var(--sgds-color-fixed-dark)}:host([variant=cyan]) .badge{background-color:var(--sgds-cyan-surface-default)}:host([variant=purple]) .badge{background-color:var(--sgds-purple-surface-default)}:host([variant=neutral]) .badge{background-color:var(--sgds-neutral-surface-default)}:host([variant=white]) .badge{background-color:var(--sgds-surface-fixed-light);color:var(--sgds-color-fixed-dark)}:host([variant=accent][outlined]) .badge{background-color:var(--sgds-accent-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-accent-border-color-muted);color:var(--sgds-accent-color-fixed-dark)}:host([variant=success][outlined]) .badge{background-color:var(--sgds-success-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-success-border-color-muted);color:var(--sgds-success-color-fixed-dark)}:host([variant=danger][outlined]) .badge{background-color:var(--sgds-danger-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-danger-border-color-muted);color:var(--sgds-danger-color-fixed-dark)}:host([variant=warning][outlined]) .badge{background-color:var(--sgds-warning-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-warning-border-color-muted);color:var(--sgds-warning-color-fixed-dark)}:host([variant=cyan][outlined]) .badge{background-color:var(--sgds-cyan-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-cyan-border-color-muted);color:var(--sgds-cyan-color-fixed-dark)}:host([variant=purple][outlined]) .badge{background-color:var(--sgds-purple-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-purple-border-color-muted);color:var(--sgds-purple-color-fixed-dark)}:host([variant=neutral][outlined]) .badge{background-color:var(--sgds-neutral-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-neutral-border-color-muted);color:var(--sgds-color-fixed-dark)}:host([variant=white][outlined]) .badge{background-color:var(--sgds-surface-fixed-light);border:var(--sgds-border-width-1) solid var(--sgds-border-color-muted);color:var(--sgds-color-fixed-dark)}sgds-tooltip{display:block;max-width:100%}.badge{align-items:center;background-color:var(--sgds-primary-surface-default);border:var(--sgds-border-width-1) solid var(--sgds-border-color-transparent);border-radius:var(--sgds-border-radius-sm);color:var(--sgds-color-fixed-light);display:inline-flex;font-size:var(--sgds-font-size-label-xs);height:var(--sgds-dimension-24,24px);justify-content:center;line-height:var(--sgds-line-height-3-xs);max-width:var(--sgds-dimension-192,192px);min-width:var(--sgds-dimension-24);padding:var(--sgds-padding-none) var(--sgds-padding-xs)}.badge.outlined{background-color:var(--sgds-primary-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-primary-border-color-muted);color:var(--sgds-primary-color-fixed-dark)}.badge.full-width{max-width:100%}.badge-label{overflow:hidden;padding:var(--sgds-padding-none) var(--sgds-padding-3-xs);text-overflow:ellipsis;white-space:nowrap}.badge-dismissible{padding-right:0}.badge-dimissible sgds-close-button{--sgds-close-btn-border-radius:var(--sgds-border-radius-sm)}slot::slotted(*){color:inherit!important;font-size:inherit!important;font-weight:inherit!important;line-height:inherit!important;margin:inherit!important}`,ll=we`:host{display:contents}.tooltip-placeholder{display:inline-block;max-width:100%}.tooltip{word-wrap:break-word;background-color:var(--sgds-surface-fixed-dark);border-radius:var(--sgds-border-radius-md);box-shadow:0 0 2px 0 rgba(0,0,0,.12),0 8px 16px 0 rgba(0,0,0,.14);color:var(--sgds-color-fixed-light);display:block;font-size:var(--sgds-font-size-14);line-break:auto;max-width:var(--sgds-dimension-320);padding:var(--sgds-padding-xs) var(--sgds-padding-sm);text-align:left;text-decoration:none;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;z-index:var(--sgds-z-index-overlay)}div{max-width:fit-content}`;class al extends Ki{constructor(){super(...arguments),this._myTooltip=st(),this._tooltipBubble=st(),this.content="",this.placement="top",this.trigger="hover focus",this.open=!1,this._handleClickOutOfElement=e=>{this.open&&(e.composedPath().includes(this)||this.hide())}}connectedCallback(){super.connectedCallback(),this.trigger.includes("click")&&document.addEventListener("click",this._handleClickOutOfElement)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this._handleClickOutOfElement),this._cleanupAutoUpdate&&(this._cleanupAutoUpdate(),this._cleanupAutoUpdate=void 0)}firstUpdated(e){super.firstUpdated(e),this._tooltipTargetElements.forEach(e=>{e.setAttribute("data-sgds-tooltip",this.content),this.trigger.includes("hover")&&(e.addEventListener("mouseenter",()=>this.show()),e.addEventListener("mouseleave",()=>this.hide())),this.trigger.includes("focus")&&(e.addEventListener("focus",()=>this.show()),e.addEventListener("blur",()=>this.hide())),"click"===this.trigger&&e.addEventListener("click",()=>this.toggle())})}_handleSlotChange(){this._tooltipTargetElements.forEach(e=>e.setAttribute("data-sgds-tooltip",this.content))}async updateFloatingPosition(){if(!this._myTooltip.value||!this._tooltipBubble.value)return;const{x:e,y:t,placement:i,strategy:l,middlewareData:a}=await Oi(this._tooltipTargetElements[0],this._tooltipBubble.value,{strategy:"fixed",placement:this.placement,middleware:[Li(8),Ii(),Ei(),Pi()]});this._tooltipBubble.value.setAttribute("data-placement",i),Object.assign(this._tooltipBubble.value.style,{position:l,left:`${e}px`,top:`${t}px`});const{referenceHidden:o,escaped:s}=a.hide||{};this._tooltipBubble.value.style.visibility=o||s?"hidden":"visible"}async show(){this.open||(this.open=!0,this.emit("sgds-show"),await this.updateComplete,await this.updateFloatingPosition(),this._myTooltip.value&&this._tooltipBubble.value&&(this._cleanupAutoUpdate=Ai(this._tooltipTargetElements[0],this._tooltipBubble.value,()=>this.updateFloatingPosition())),this.emit("sgds-after-show"))}hide(){this.open&&(this.emit("sgds-hide"),this.open=!1,this._cleanupAutoUpdate&&(this._cleanupAutoUpdate(),this._cleanupAutoUpdate=void 0),setTimeout(()=>this.emit("sgds-after-hide"),0))}toggle(){this.open?this.hide():this.show()}render(){return S`
|
|
96
96
|
<div ${ct(this._myTooltip)} class="tooltip-placeholder">
|
|
97
97
|
<slot @slotchange=${()=>this._handleSlotChange()}></slot>
|
|
98
98
|
${this.open?S`<div ${ct(this._tooltipBubble)} class="tooltip" role="tooltip">${this.content}</div>`:null}
|
|
@@ -2388,7 +2388,7 @@ function Ge(e){return(t,i)=>je(t,i,{async get(){return await this.updateComplete
|
|
|
2388
2388
|
* Copyright 2017 Google LLC
|
|
2389
2389
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
2390
2390
|
*/
|
|
2391
|
-
const
|
|
2391
|
+
const Ol=(e,t,i)=>{const l=new Map;for(let a=t;a<=i;a++)l.set(e[a],a);return l};const Rl=te(class extends ie{constructor(e){if(super(e),e.type!==Y)throw new Error("repeat() can only be used in text expressions")}_getValuesAndKeys(e,t,i){let l;void 0===i?i=t:void 0!==t&&(l=t);const a=[],o=[];let s=0;for(const t of e)a[s]=l?l(t,s):s,o[s]=i(t,s),s++;return{values:o,keys:a}}render(e,t,i){return this._getValuesAndKeys(e,t,i).values}update(e,[t,i,l]){const a=e._$committedValue;const{values:o,keys:s}=this._getValuesAndKeys(t,i,l);if(!Array.isArray(a))return this._itemKeys=s,o;const n=this._itemKeys??=[],r=[];let c,d,h=0,v=a.length-1,u=0,p=o.length-1;for(;h<=v&&u<=p;)if(null===a[h])h++;else if(null===a[v])v--;else if(n[h]===s[u])r[u]=re(a[h],o[u]),h++,u++;else if(n[v]===s[p])r[p]=re(a[v],o[p]),v--,p--;else if(n[h]===s[p])r[p]=re(a[h],o[p]),ne(e,r[p+1],a[h]),h++,p--;else if(n[v]===s[u])r[u]=re(a[v],o[u]),ne(e,a[h],a[v]),v--,u++;else if(void 0===c&&(c=Ol(s,u,p),d=Ol(n,h,v)),c.has(n[h]))if(c.has(n[v])){const t=d.get(s[u]),i=void 0!==t?a[t]:null;if(null===i){const t=ne(e,a[h]);re(t,o[u]),r[u]=t}else r[u]=re(i,o[u]),ne(e,a[h],i),a[t]=null;u++}else he(a[v]),v--;else he(a[h]),h++;for(;u<=p;){const t=ne(e,r[p+1]);re(t,o[u]),r[u++]=t}for(;h<=v;){const e=a[h++];null!==e&&he(e)}return this._itemKeys=s,de(e,r),A}}),zl=Symbol.for(""),Dl=e=>{if(e?.r===zl)return e?._$litStatic$},Ul=new Map,Fl=(Nl=S,(e,...t)=>{const i=t.length;let l,a;const o=[],s=[];let n,r=0,c=!1;for(;r<i;){for(n=e[r];r<i&&void 0!==(a=t[r],l=Dl(a));)n+=l+e[++r],c=!0;r!==i&&s.push(a),o.push(n),r++}if(r===i&&o.push(e[i]),c){const i=o.join("$$lit$$");void 0===(e=Ul.get(i))&&(o.raw=o,Ul.set(i,e=o)),t=s}return Nl(e,...t)});
|
|
2392
2392
|
/**
|
|
2393
2393
|
* @license
|
|
2394
2394
|
* Copyright 2020 Google LLC
|
|
@@ -2419,7 +2419,7 @@ const Rl=(e,t,i)=>{const l=new Map;for(let a=t;a<=i;a++)l.set(e[a],a);return l};
|
|
|
2419
2419
|
${this.prefixIconTemplate}
|
|
2420
2420
|
<div class="combobox-input-container">
|
|
2421
2421
|
${this.multiSelect?S`
|
|
2422
|
-
${
|
|
2422
|
+
${Rl(this.selectedItems,e=>e.value,e=>S`<sgds-badge
|
|
2423
2423
|
outlined
|
|
2424
2424
|
variant="neutral"
|
|
2425
2425
|
show
|
|
@@ -2472,14 +2472,22 @@ const Rl=(e,t,i)=>{const l=new Map;for(let a=t;a<=i;a++)l.set(e[a],a);return l};
|
|
|
2472
2472
|
<!-- The input -->
|
|
2473
2473
|
${this._renderInput(e)} ${this._renderFeedback()}
|
|
2474
2474
|
|
|
2475
|
-
<
|
|
2475
|
+
<div
|
|
2476
|
+
id=${this.dropdownMenuId}
|
|
2477
|
+
class="dropdown-menu"
|
|
2478
|
+
part="menu"
|
|
2479
|
+
tabindex="-1"
|
|
2480
|
+
role="menu"
|
|
2481
|
+
aria-label=${this.label||"Options"}
|
|
2482
|
+
${ct(this.menuRef)}
|
|
2483
|
+
>
|
|
2476
2484
|
<slot
|
|
2477
2485
|
id="default"
|
|
2478
2486
|
class=${Xe({"d-none":this.loading||this.emptyMenuAsync||0===this.optionList.length})}
|
|
2479
2487
|
@slotchange=${this._handleDefaultSlotChange}
|
|
2480
2488
|
></slot>
|
|
2481
2489
|
${this._renderFeedbackMenu()}
|
|
2482
|
-
</
|
|
2490
|
+
</div>
|
|
2483
2491
|
</div>
|
|
2484
2492
|
|
|
2485
2493
|
<!-- Required an input element for constraint validation -->
|