@govtechsg/sgds-web-component 3.26.1-rc.2 → 3.27.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. package/base/dropdown-list-element.js +9 -2
  2. package/base/dropdown-list-element.js.map +1 -1
  3. package/base/nav-element.d.ts +64 -0
  4. package/base/nav-element.js +263 -0
  5. package/base/nav-element.js.map +1 -0
  6. package/base/nav-profile-element.d.ts +47 -0
  7. package/base/nav-profile-element.js +191 -0
  8. package/base/nav-profile-element.js.map +1 -0
  9. package/base/nav-profile.js +6 -0
  10. package/base/nav-profile.js.map +1 -0
  11. package/components/Appnav/appnav-context.d.ts +6 -0
  12. package/components/Appnav/appnav-context.js +7 -0
  13. package/components/Appnav/appnav-context.js.map +1 -0
  14. package/components/Appnav/appnav.js +6 -0
  15. package/components/Appnav/appnav.js.map +1 -0
  16. package/components/Appnav/index.d.ts +9 -0
  17. package/components/Appnav/index.js +8 -0
  18. package/components/Appnav/index.js.map +1 -0
  19. package/components/Appnav/index.umd.min.js +2542 -0
  20. package/components/Appnav/index.umd.min.js.map +1 -0
  21. package/components/Appnav/sgds-appnav-profile.d.ts +17 -0
  22. package/components/Appnav/sgds-appnav-profile.js +31 -0
  23. package/components/Appnav/sgds-appnav-profile.js.map +1 -0
  24. package/components/Appnav/sgds-appnav.d.ts +44 -0
  25. package/components/Appnav/sgds-appnav.js +183 -0
  26. package/components/Appnav/sgds-appnav.js.map +1 -0
  27. package/components/Breadcrumb/index.umd.min.js +1 -1
  28. package/components/Breadcrumb/index.umd.min.js.map +1 -1
  29. package/components/ComboBox/index.umd.min.js +248 -248
  30. package/components/ComboBox/index.umd.min.js.map +1 -1
  31. package/components/Dropdown/index.umd.min.js +1 -1
  32. package/components/Dropdown/index.umd.min.js.map +1 -1
  33. package/components/Mainnav/index.umd.min.js +293 -281
  34. package/components/Mainnav/index.umd.min.js.map +1 -1
  35. package/components/Mainnav/mainnav.js +1 -1
  36. package/components/Mainnav/sgds-mainnav-profile.d.ts +5 -31
  37. package/components/Mainnav/sgds-mainnav-profile.js +5 -112
  38. package/components/Mainnav/sgds-mainnav-profile.js.map +1 -1
  39. package/components/Mainnav/sgds-mainnav.d.ts +5 -46
  40. package/components/Mainnav/sgds-mainnav.js +24 -260
  41. package/components/Mainnav/sgds-mainnav.js.map +1 -1
  42. package/components/OverflowMenu/index.umd.min.js +21 -21
  43. package/components/OverflowMenu/index.umd.min.js.map +1 -1
  44. package/components/QuantityToggle/index.umd.min.js +39 -39
  45. package/components/QuantityToggle/index.umd.min.js.map +1 -1
  46. package/components/QuantityToggle/sgds-quantity-toggle.d.ts +1 -2
  47. package/components/QuantityToggle/sgds-quantity-toggle.js +9 -18
  48. package/components/QuantityToggle/sgds-quantity-toggle.js.map +1 -1
  49. package/components/Select/index.umd.min.js +1 -1
  50. package/components/Select/index.umd.min.js.map +1 -1
  51. package/components/index.d.ts +2 -0
  52. package/components/index.js +2 -0
  53. package/components/index.js.map +1 -1
  54. package/components/index.umd.min.js +592 -543
  55. package/components/index.umd.min.js.map +1 -1
  56. package/css/fouc.css +6 -4
  57. package/custom-elements.json +17733 -15914
  58. package/index.d.ts +1 -0
  59. package/index.js +1 -0
  60. package/index.js.map +1 -1
  61. package/index.umd.min.js +537 -483
  62. package/index.umd.min.js.map +1 -1
  63. package/package.json +1 -1
  64. package/react/appnav/index.cjs.js +45 -0
  65. package/react/appnav/index.cjs.js.map +1 -0
  66. package/react/appnav/index.d.ts +4 -0
  67. package/react/appnav/index.js +21 -0
  68. package/react/appnav/index.js.map +1 -0
  69. package/react/appnav-profile/index.cjs.js +40 -0
  70. package/react/appnav-profile/index.cjs.js.map +1 -0
  71. package/react/appnav-profile/index.d.ts +4 -0
  72. package/react/appnav-profile/index.js +16 -0
  73. package/react/appnav-profile/index.js.map +1 -0
  74. package/react/base/dropdown-list-element.cjs.js +9 -2
  75. package/react/base/dropdown-list-element.cjs.js.map +1 -1
  76. package/react/base/dropdown-list-element.js +9 -2
  77. package/react/base/dropdown-list-element.js.map +1 -1
  78. package/react/base/nav-element.cjs.js +268 -0
  79. package/react/base/nav-element.cjs.js.map +1 -0
  80. package/react/base/nav-element.js +264 -0
  81. package/react/base/nav-element.js.map +1 -0
  82. package/react/base/nav-profile-element.cjs.js +196 -0
  83. package/react/base/nav-profile-element.cjs.js.map +1 -0
  84. package/react/base/nav-profile-element.js +192 -0
  85. package/react/base/nav-profile-element.js.map +1 -0
  86. package/react/base/nav-profile.cjs.js +11 -0
  87. package/react/base/nav-profile.cjs.js.map +1 -0
  88. package/react/base/nav-profile.js +7 -0
  89. package/react/base/nav-profile.js.map +1 -0
  90. package/react/components/Appnav/appnav-context.cjs.js +13 -0
  91. package/react/components/Appnav/appnav-context.cjs.js.map +1 -0
  92. package/react/components/Appnav/appnav-context.js +8 -0
  93. package/react/components/Appnav/appnav-context.js.map +1 -0
  94. package/react/components/Appnav/appnav.cjs.js +11 -0
  95. package/react/components/Appnav/appnav.cjs.js.map +1 -0
  96. package/react/components/Appnav/appnav.js +7 -0
  97. package/react/components/Appnav/appnav.js.map +1 -0
  98. package/react/components/Appnav/sgds-appnav-profile.cjs.js +37 -0
  99. package/react/components/Appnav/sgds-appnav-profile.cjs.js.map +1 -0
  100. package/react/components/Appnav/sgds-appnav-profile.js +32 -0
  101. package/react/components/Appnav/sgds-appnav-profile.js.map +1 -0
  102. package/react/components/Appnav/sgds-appnav.cjs.js +189 -0
  103. package/react/components/Appnav/sgds-appnav.cjs.js.map +1 -0
  104. package/react/components/Appnav/sgds-appnav.js +184 -0
  105. package/react/components/Appnav/sgds-appnav.js.map +1 -0
  106. package/react/components/Mainnav/mainnav.cjs.js +1 -1
  107. package/react/components/Mainnav/mainnav.js +1 -1
  108. package/react/components/Mainnav/sgds-mainnav-profile.cjs.js +4 -111
  109. package/react/components/Mainnav/sgds-mainnav-profile.cjs.js.map +1 -1
  110. package/react/components/Mainnav/sgds-mainnav-profile.js +5 -112
  111. package/react/components/Mainnav/sgds-mainnav-profile.js.map +1 -1
  112. package/react/components/Mainnav/sgds-mainnav.cjs.js +22 -258
  113. package/react/components/Mainnav/sgds-mainnav.cjs.js.map +1 -1
  114. package/react/components/Mainnav/sgds-mainnav.js +24 -260
  115. package/react/components/Mainnav/sgds-mainnav.js.map +1 -1
  116. package/react/components/QuantityToggle/sgds-quantity-toggle.cjs.js +9 -18
  117. package/react/components/QuantityToggle/sgds-quantity-toggle.cjs.js.map +1 -1
  118. package/react/components/QuantityToggle/sgds-quantity-toggle.js +9 -18
  119. package/react/components/QuantityToggle/sgds-quantity-toggle.js.map +1 -1
  120. package/react/index.cjs.js +130 -126
  121. package/react/index.cjs.js.map +1 -1
  122. package/react/index.d.ts +6 -4
  123. package/react/index.js +6 -4
  124. package/react/index.js.map +1 -1
  125. package/types/react.d.ts +197 -158
  126. package/components/Mainnav/mainnav-profile.js +0 -6
  127. package/components/Mainnav/mainnav-profile.js.map +0 -1
  128. package/react/components/Mainnav/mainnav-profile.cjs.js +0 -11
  129. package/react/components/Mainnav/mainnav-profile.cjs.js.map +0 -1
  130. package/react/components/Mainnav/mainnav-profile.js +0 -7
  131. package/react/components/Mainnav/mainnav-profile.js.map +0 -1
@@ -0,0 +1,17 @@
1
+ import NavProfileElement from "../../base/nav-profile-element";
2
+ /**
3
+ * @summary `SgdsAppnavProfile` is a profile component for the appnav that shows a full dropdown in desktop and handles its own mobile menu.
4
+ * In desktop: renders avatar + label + secondaryText with a dropdown.
5
+ * In mobile: renders the avatar as a toggler that opens a self-contained mobile panel with profile items.
6
+ * When no dropdown items are slotted, renders as a non-interactive read-only element (no caret, no pointer cursor, not focusable).
7
+ * When present, it disables the appnav's default hamburger toggler.
8
+ *
9
+ * @storyOrder 2
10
+ *
11
+ * @slot avatar - Avatar element displayed in both desktop (before label) and mobile (as toggler)
12
+ * @slot default - Profile menu items (sgds-dropdown-item elements). When empty, the component becomes read-only.
13
+ */
14
+ export declare class SgdsAppnavProfile extends NavProfileElement {
15
+ protected _breakpointReached: boolean;
16
+ }
17
+ export default SgdsAppnavProfile;
@@ -0,0 +1,31 @@
1
+ import { __decorate } from 'tslib';
2
+ import { consume } from '@lit/context';
3
+ import { state } from 'lit/decorators.js';
4
+ import NavProfileElement from '../../base/nav-profile-element.js';
5
+ import { AppnavBreakpointContext } from './appnav-context.js';
6
+
7
+ /**
8
+ * @summary `SgdsAppnavProfile` is a profile component for the appnav that shows a full dropdown in desktop and handles its own mobile menu.
9
+ * In desktop: renders avatar + label + secondaryText with a dropdown.
10
+ * In mobile: renders the avatar as a toggler that opens a self-contained mobile panel with profile items.
11
+ * When no dropdown items are slotted, renders as a non-interactive read-only element (no caret, no pointer cursor, not focusable).
12
+ * When present, it disables the appnav's default hamburger toggler.
13
+ *
14
+ * @storyOrder 2
15
+ *
16
+ * @slot avatar - Avatar element displayed in both desktop (before label) and mobile (as toggler)
17
+ * @slot default - Profile menu items (sgds-dropdown-item elements). When empty, the component becomes read-only.
18
+ */
19
+ class SgdsAppnavProfile extends NavProfileElement {
20
+ constructor() {
21
+ super(...arguments);
22
+ this._breakpointReached = true;
23
+ }
24
+ }
25
+ __decorate([
26
+ consume({ context: AppnavBreakpointContext, subscribe: true }),
27
+ state()
28
+ ], SgdsAppnavProfile.prototype, "_breakpointReached", void 0);
29
+
30
+ export { SgdsAppnavProfile, SgdsAppnavProfile as default };
31
+ //# sourceMappingURL=sgds-appnav-profile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sgds-appnav-profile.js","sources":["../../../src/components/Appnav/sgds-appnav-profile.ts"],"sourcesContent":["import { consume } from \"@lit/context\";\nimport { state } from \"lit/decorators.js\";\nimport NavProfileElement from \"../../base/nav-profile-element\";\nimport { AppnavBreakpointContext } from \"./appnav-context\";\n\n/**\n * @summary `SgdsAppnavProfile` is a profile component for the appnav that shows a full dropdown in desktop and handles its own mobile menu.\n * In desktop: renders avatar + label + secondaryText with a dropdown.\n * In mobile: renders the avatar as a toggler that opens a self-contained mobile panel with profile items.\n * When no dropdown items are slotted, renders as a non-interactive read-only element (no caret, no pointer cursor, not focusable).\n * When present, it disables the appnav's default hamburger toggler.\n *\n * @storyOrder 2\n *\n * @slot avatar - Avatar element displayed in both desktop (before label) and mobile (as toggler)\n * @slot default - Profile menu items (sgds-dropdown-item elements). When empty, the component becomes read-only.\n */\nexport class SgdsAppnavProfile extends NavProfileElement {\n @consume({ context: AppnavBreakpointContext, subscribe: true })\n @state()\n protected override _breakpointReached = true;\n}\n\nexport default SgdsAppnavProfile;\n"],"names":[],"mappings":";;;;;;AAKA;;;;;;;;;;;AAWG;AACG,MAAO,iBAAkB,SAAQ,iBAAiB,CAAA;AAAxD,IAAA,WAAA,GAAA;;QAGqB,IAAkB,CAAA,kBAAA,GAAG,IAAI,CAAC;KAC9C;AAAA,CAAA;AADoB,UAAA,CAAA;IAFlB,OAAO,CAAC,EAAE,OAAO,EAAE,uBAAuB,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;AAC9D,IAAA,KAAK,EAAE;AACqC,CAAA,EAAA,iBAAA,CAAA,SAAA,EAAA,oBAAA,EAAA,KAAA,CAAA,CAAA;;;;"}
@@ -0,0 +1,44 @@
1
+ import NavElement from "../../base/nav-element";
2
+ export type AppnavTone = "brand" | "gradient-1" | "gradient-2" | "gradient-3" | "gradient-4";
3
+ /**
4
+ * @summary `SgdsAppnav` is a application navigation bar for operational apps. Accepts icon-buttons and profile in a fluid layout with collapse/expand behavior.
5
+ *
6
+ * @storyOrder 1
7
+ *
8
+ * @event sgds-show - Emitted on show. Only for collapsed menu.
9
+ * @event sgds-after-show - Emitted on show after animation has completed. Only for collapsed menu.
10
+ * @event sgds-hide - Emitted on hide. Only for collapsed menu.
11
+ * @event sgds-after-hide - Emitted on hide after animation has completed. Only for collapsed menu.
12
+ *
13
+ * @slot default - Elements in this slot collapse into the mobile menu as text items. Accepts sgds-icon-button and other elements. Uses ariaLabel as menu item text.
14
+ * @slot start - Elements in this slot will be positioned to the left of the brand.
15
+ * @slot brand - Brand slot of SgdsAppnav. Pass in brand logo img here
16
+ * @slot profile - Profile slot. sgds-appnav-profile goes here. Positioned to the right of the toggler.
17
+ *
18
+ */
19
+ export declare class SgdsAppnav extends NavElement {
20
+ static styles: import("lit").CSSResult[];
21
+ private _breakpointReached;
22
+ private _expanded;
23
+ /** Sets the visual tone of the navigation bar */
24
+ tone: AppnavTone;
25
+ /** Used only for SSR to indicate the presence of the `start` slot. */
26
+ hasStartSlot: boolean;
27
+ private readonly hasSlotController;
28
+ /** @internal Whether the default slot has assigned elements */
29
+ private _hasDefaultSlotItems;
30
+ /** @internal Whether the profile slot has assigned elements */
31
+ private _hasProfileSlotItems;
32
+ /** @internal Stored default slot items for mobile menu rendering */
33
+ private _defaultSlotItems;
34
+ updated(): void;
35
+ protected _onBreakpointReached(reached: boolean): void;
36
+ protected _isBreakpointReached(): boolean;
37
+ private _handleTogglerKeydown;
38
+ private _handleDefaultSlotChange;
39
+ private _handleMobileItemClick;
40
+ private _renderAppnavToggler;
41
+ private _handleProfileSlotChange;
42
+ render(): import("lit").TemplateResult<1>;
43
+ }
44
+ export default SgdsAppnav;
@@ -0,0 +1,183 @@
1
+ import { __decorate } from 'tslib';
2
+ import { provide } from '@lit/context';
3
+ import { html, nothing } from 'lit';
4
+ import { state, property } from 'lit/decorators.js';
5
+ import { classMap } from 'lit/directives/class-map.js';
6
+ import NavElement from '../../base/nav-element.js';
7
+ import { HasSlotController } from '../../utils/slot.js';
8
+ import { AppnavBreakpointContext, AppnavExpandedContext } from './appnav-context.js';
9
+ import css_248z from './appnav.js';
10
+
11
+ /**
12
+ * @summary `SgdsAppnav` is a application navigation bar for operational apps. Accepts icon-buttons and profile in a fluid layout with collapse/expand behavior.
13
+ *
14
+ * @storyOrder 1
15
+ *
16
+ * @event sgds-show - Emitted on show. Only for collapsed menu.
17
+ * @event sgds-after-show - Emitted on show after animation has completed. Only for collapsed menu.
18
+ * @event sgds-hide - Emitted on hide. Only for collapsed menu.
19
+ * @event sgds-after-hide - Emitted on hide after animation has completed. Only for collapsed menu.
20
+ *
21
+ * @slot default - Elements in this slot collapse into the mobile menu as text items. Accepts sgds-icon-button and other elements. Uses ariaLabel as menu item text.
22
+ * @slot start - Elements in this slot will be positioned to the left of the brand.
23
+ * @slot brand - Brand slot of SgdsAppnav. Pass in brand logo img here
24
+ * @slot profile - Profile slot. sgds-appnav-profile goes here. Positioned to the right of the toggler.
25
+ *
26
+ */
27
+ class SgdsAppnav extends NavElement {
28
+ constructor() {
29
+ super(...arguments);
30
+ this._breakpointReached = false;
31
+ this._expanded = false;
32
+ /** Sets the visual tone of the navigation bar */
33
+ this.tone = "brand";
34
+ /** Used only for SSR to indicate the presence of the `start` slot. */
35
+ this.hasStartSlot = false;
36
+ this.hasSlotController = new HasSlotController(this, "start");
37
+ /** @internal Whether the default slot has assigned elements */
38
+ this._hasDefaultSlotItems = false;
39
+ /** @internal Whether the profile slot has assigned elements */
40
+ this._hasProfileSlotItems = false;
41
+ /** @internal Stored default slot items for mobile menu rendering */
42
+ this._defaultSlotItems = [];
43
+ }
44
+ updated() {
45
+ if (!this.hasStartSlot)
46
+ this.hasStartSlot = this.hasSlotController.test("start");
47
+ this._expanded = this.expanded;
48
+ }
49
+ _onBreakpointReached(reached) {
50
+ this._breakpointReached = reached;
51
+ }
52
+ _isBreakpointReached() {
53
+ return this._breakpointReached;
54
+ }
55
+ _handleTogglerKeydown(e) {
56
+ var _a;
57
+ if (e.key === "Tab" && !e.shiftKey && this.expanded) {
58
+ e.preventDefault();
59
+ const firstItem = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(".appnav-menu-item");
60
+ firstItem === null || firstItem === void 0 ? void 0 : firstItem.focus();
61
+ }
62
+ }
63
+ _handleDefaultSlotChange(e) {
64
+ const childElements = e.target.assignedElements({ flatten: true });
65
+ this._hasDefaultSlotItems = childElements.length > 0;
66
+ this._defaultSlotItems = childElements
67
+ .filter(el => typeof el.tagName !== "undefined")
68
+ .map(el => {
69
+ var _a;
70
+ return ({
71
+ label: el.getAttribute("ariaLabel") || el.getAttribute("aria-label") || ((_a = el.textContent) === null || _a === void 0 ? void 0 : _a.trim()) || "",
72
+ element: el
73
+ });
74
+ });
75
+ childElements.forEach(el => {
76
+ el.setAttribute("expand", this.expand);
77
+ });
78
+ }
79
+ _handleMobileItemClick(item) {
80
+ item.element.click();
81
+ this.hide();
82
+ }
83
+ _renderAppnavToggler() {
84
+ return html `<sgds-icon-button
85
+ name="three-dots-vertical"
86
+ variant="ghost"
87
+ size="sm"
88
+ tone="fixed-light"
89
+ class="navbar-toggler"
90
+ @click=${this._handleSummaryClick}
91
+ @keydown=${this._handleTogglerKeydown}
92
+ aria-controls="${this.collapseId}"
93
+ aria-expanded="${this.expanded}"
94
+ .ariaLabel=${"Toggle navigation"}
95
+ ></sgds-icon-button>`;
96
+ }
97
+ _handleProfileSlotChange(e) {
98
+ const childElements = e.target.assignedElements({ flatten: true });
99
+ this._hasProfileSlotItems = childElements.length > 0;
100
+ childElements.forEach(el => {
101
+ el.setAttribute("expand", this.expand);
102
+ el.setAttribute("tone", this.tone);
103
+ });
104
+ }
105
+ render() {
106
+ this.breakpointReached =
107
+ window.innerWidth <
108
+ (this.expand === "always"
109
+ ? -1
110
+ : this.expand === "never"
111
+ ? Infinity
112
+ : { sm: 512, md: 768, lg: 1024, xl: 1280, xxl: 1440 }[this.expand]);
113
+ return html `
114
+ <nav>
115
+ <div class="navbar ${this._expandClass()}">
116
+ <slot name="start" class=${classMap({ "slot-empty": !this.hasStartSlot })}></slot>
117
+ <a class="navbar-brand" href=${this.brandHref} aria-label="brand-link">
118
+ <slot name="brand"></slot>
119
+ </a>
120
+ <div class="navbar-body navbar-collapse" id=${this.collapseId}>
121
+ <div class="navbar-nav navbar-nav-scroll">
122
+ <slot
123
+ class=${classMap({ "slot-desktop-only": this.breakpointReached })}
124
+ @slotchange=${this._handleDefaultSlotChange}
125
+ ></slot>
126
+ ${this.breakpointReached
127
+ ? this._defaultSlotItems.map(item => html `<a
128
+ class="appnav-menu-item"
129
+ role="button"
130
+ tabindex="0"
131
+ @click=${() => this._handleMobileItemClick(item)}
132
+ @keydown=${(e) => {
133
+ if (e.key === "Enter" || e.key === " ") {
134
+ e.preventDefault();
135
+ this._handleMobileItemClick(item);
136
+ }
137
+ }}
138
+ >${item.label}</a
139
+ >`)
140
+ : nothing}
141
+ </div>
142
+ </div>
143
+ <div
144
+ class="navbar-end ${this._hasProfileSlotItems || (this._hasDefaultSlotItems && this.breakpointReached)
145
+ ? ""
146
+ : "slot-empty"}"
147
+ >
148
+ ${this._hasDefaultSlotItems && this.breakpointReached ? this._renderAppnavToggler() : nothing}
149
+ <slot name="profile" @slotchange=${this._handleProfileSlotChange}></slot>
150
+ </div>
151
+ </div>
152
+ </nav>
153
+ `;
154
+ }
155
+ }
156
+ SgdsAppnav.styles = [...NavElement.styles, css_248z];
157
+ __decorate([
158
+ provide({ context: AppnavBreakpointContext }),
159
+ state()
160
+ ], SgdsAppnav.prototype, "_breakpointReached", void 0);
161
+ __decorate([
162
+ provide({ context: AppnavExpandedContext }),
163
+ state()
164
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
165
+ ], SgdsAppnav.prototype, "_expanded", void 0);
166
+ __decorate([
167
+ property({ type: String, reflect: true })
168
+ ], SgdsAppnav.prototype, "tone", void 0);
169
+ __decorate([
170
+ property({ type: Boolean })
171
+ ], SgdsAppnav.prototype, "hasStartSlot", void 0);
172
+ __decorate([
173
+ state()
174
+ ], SgdsAppnav.prototype, "_hasDefaultSlotItems", void 0);
175
+ __decorate([
176
+ state()
177
+ ], SgdsAppnav.prototype, "_hasProfileSlotItems", void 0);
178
+ __decorate([
179
+ state()
180
+ ], SgdsAppnav.prototype, "_defaultSlotItems", void 0);
181
+
182
+ export { SgdsAppnav, SgdsAppnav as default };
183
+ //# sourceMappingURL=sgds-appnav.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sgds-appnav.js","sources":["../../../src/components/Appnav/sgds-appnav.ts"],"sourcesContent":["import { provide } from \"@lit/context\";\nimport { html, nothing } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport NavElement from \"../../base/nav-element\";\nimport { HasSlotController } from \"../../utils/slot\";\nimport { AppnavBreakpointContext, AppnavExpandedContext } from \"./appnav-context\";\nimport appnavStyle from \"./appnav.css\";\n\nexport type AppnavTone = \"brand\" | \"gradient-1\" | \"gradient-2\" | \"gradient-3\" | \"gradient-4\";\n\ninterface DefaultSlotItem {\n label: string;\n element: HTMLElement;\n}\n\n/**\n * @summary `SgdsAppnav` is a application navigation bar for operational apps. Accepts icon-buttons and profile in a fluid layout with collapse/expand behavior.\n *\n * @storyOrder 1\n *\n * @event sgds-show - Emitted on show. Only for collapsed menu.\n * @event sgds-after-show - Emitted on show after animation has completed. Only for collapsed menu.\n * @event sgds-hide - Emitted on hide. Only for collapsed menu.\n * @event sgds-after-hide - Emitted on hide after animation has completed. Only for collapsed menu.\n *\n * @slot default - Elements in this slot collapse into the mobile menu as text items. Accepts sgds-icon-button and other elements. Uses ariaLabel as menu item text.\n * @slot start - Elements in this slot will be positioned to the left of the brand.\n * @slot brand - Brand slot of SgdsAppnav. Pass in brand logo img here\n * @slot profile - Profile slot. sgds-appnav-profile goes here. Positioned to the right of the toggler.\n *\n */\nexport class SgdsAppnav extends NavElement {\n static styles = [...NavElement.styles, appnavStyle];\n\n @provide({ context: AppnavBreakpointContext })\n @state()\n private _breakpointReached = false;\n\n @provide({ context: AppnavExpandedContext })\n @state()\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n private _expanded = false;\n\n /** Sets the visual tone of the navigation bar */\n @property({ type: String, reflect: true })\n tone: AppnavTone = \"brand\";\n\n /** Used only for SSR to indicate the presence of the `start` slot. */\n @property({ type: Boolean }) hasStartSlot = false;\n\n private readonly hasSlotController = new HasSlotController(this, \"start\");\n\n /** @internal Whether the default slot has assigned elements */\n @state()\n private _hasDefaultSlotItems = false;\n\n /** @internal Whether the profile slot has assigned elements */\n @state()\n private _hasProfileSlotItems = false;\n\n /** @internal Stored default slot items for mobile menu rendering */\n @state()\n private _defaultSlotItems: DefaultSlotItem[] = [];\n\n updated() {\n if (!this.hasStartSlot) this.hasStartSlot = this.hasSlotController.test(\"start\");\n this._expanded = this.expanded;\n }\n\n protected _onBreakpointReached(reached: boolean): void {\n this._breakpointReached = reached;\n }\n\n protected _isBreakpointReached(): boolean {\n return this._breakpointReached;\n }\n\n private _handleTogglerKeydown(e: KeyboardEvent) {\n if (e.key === \"Tab\" && !e.shiftKey && this.expanded) {\n e.preventDefault();\n const firstItem = this.shadowRoot?.querySelector(\".appnav-menu-item\") as HTMLElement | null;\n firstItem?.focus();\n }\n }\n\n private _handleDefaultSlotChange(e: Event) {\n const childElements = (e.target as HTMLSlotElement).assignedElements({ flatten: true }) as HTMLElement[];\n this._hasDefaultSlotItems = childElements.length > 0;\n this._defaultSlotItems = childElements\n .filter(el => typeof el.tagName !== \"undefined\")\n .map(el => ({\n label: el.getAttribute(\"ariaLabel\") || el.getAttribute(\"aria-label\") || el.textContent?.trim() || \"\",\n element: el\n }));\n childElements.forEach(el => {\n el.setAttribute(\"expand\", this.expand);\n });\n }\n\n private _handleMobileItemClick(item: DefaultSlotItem) {\n item.element.click();\n this.hide();\n }\n\n private _renderAppnavToggler() {\n return html`<sgds-icon-button\n name=\"three-dots-vertical\"\n variant=\"ghost\"\n size=\"sm\"\n tone=\"fixed-light\"\n class=\"navbar-toggler\"\n @click=${this._handleSummaryClick}\n @keydown=${this._handleTogglerKeydown}\n aria-controls=\"${this.collapseId}\"\n aria-expanded=\"${this.expanded}\"\n .ariaLabel=${\"Toggle navigation\"}\n ></sgds-icon-button>`;\n }\n\n private _handleProfileSlotChange(e: Event) {\n const childElements = (e.target as HTMLSlotElement).assignedElements({ flatten: true });\n this._hasProfileSlotItems = childElements.length > 0;\n childElements.forEach(el => {\n el.setAttribute(\"expand\", this.expand);\n el.setAttribute(\"tone\", this.tone);\n });\n }\n\n render() {\n this.breakpointReached =\n window.innerWidth <\n (this.expand === \"always\"\n ? -1\n : this.expand === \"never\"\n ? Infinity\n : { sm: 512, md: 768, lg: 1024, xl: 1280, xxl: 1440 }[this.expand]);\n\n return html`\n <nav>\n <div class=\"navbar ${this._expandClass()}\">\n <slot name=\"start\" class=${classMap({ \"slot-empty\": !this.hasStartSlot })}></slot>\n <a class=\"navbar-brand\" href=${this.brandHref} aria-label=\"brand-link\">\n <slot name=\"brand\"></slot>\n </a>\n <div class=\"navbar-body navbar-collapse\" id=${this.collapseId}>\n <div class=\"navbar-nav navbar-nav-scroll\">\n <slot\n class=${classMap({ \"slot-desktop-only\": this.breakpointReached })}\n @slotchange=${this._handleDefaultSlotChange}\n ></slot>\n ${this.breakpointReached\n ? this._defaultSlotItems.map(\n item => html`<a\n class=\"appnav-menu-item\"\n role=\"button\"\n tabindex=\"0\"\n @click=${() => this._handleMobileItemClick(item)}\n @keydown=${(e: KeyboardEvent) => {\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n this._handleMobileItemClick(item);\n }\n }}\n >${item.label}</a\n >`\n )\n : nothing}\n </div>\n </div>\n <div\n class=\"navbar-end ${this._hasProfileSlotItems || (this._hasDefaultSlotItems && this.breakpointReached)\n ? \"\"\n : \"slot-empty\"}\"\n >\n ${this._hasDefaultSlotItems && this.breakpointReached ? this._renderAppnavToggler() : nothing}\n <slot name=\"profile\" @slotchange=${this._handleProfileSlotChange}></slot>\n </div>\n </div>\n </nav>\n `;\n }\n}\n\nexport default SgdsAppnav;\n"],"names":["appnavStyle"],"mappings":"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"}
@@ -72,7 +72,7 @@ const Ae=globalThis;let je;Ae.litIssuedWarnings??=new Set,je=(e,t)=>{t+=` See ht
72
72
  * @license
73
73
  * Copyright 2020 Google LLC
74
74
  * SPDX-License-Identifier: BSD-3-Clause
75
- */const Ge=()=>new Qe;class Qe{}const et=new WeakMap;const tt=Ne(class extends Xe{render(e){return he}update(e,[t]){const l=t!==this._ref;return l&&void 0!==this._ref&&this._updateRefValue(void 0),(l||this._lastElementForRef!==this._element)&&(this._ref=t,this._context=e.options?.host,this._updateRefValue(this._element=e.element)),he}_updateRefValue(e){if(this.isConnected||(e=void 0),"function"==typeof this._ref){const t=this._context??globalThis;let l=et.get(t);void 0===l&&(l=new WeakMap,et.set(t,l)),void 0!==l.get(this._ref)&&this._ref.call(this._context,void 0),l.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?et.get(this._context??globalThis)?.get(this._ref):this._ref?.value}disconnected(){this._lastElementForRef===this._element&&this._updateRefValue(void 0)}reconnected(){this._updateRefValue(this._element)}}),lt=Math.min,ot=Math.max,nt=Math.round,rt=Math.floor,it=e=>({x:e,y:e}),at={left:"right",right:"left",bottom:"top",top:"bottom"},st={start:"end",end:"start"};function ct(e,t,l){return ot(e,lt(t,l))}function dt(e,t){return"function"==typeof e?e(t):e}function ht(e){return e.split("-")[0]}function ut(e){return e.split("-")[1]}function vt(e){return"x"===e?"y":"x"}function ft(e){return"y"===e?"height":"width"}const pt=new Set(["top","bottom"]);function gt(e){return pt.has(ht(e))?"y":"x"}function wt(e){return vt(gt(e))}function mt(e,t,l){void 0===l&&(l=!1);const o=ut(e),n=wt(e),r=ft(n);let i="x"===n?o===(l?"end":"start")?"right":"left":"start"===o?"bottom":"top";return t.reference[r]>t.floating[r]&&(i=Mt(i)),[i,Mt(i)]}function _t(e){return e.replace(/start|end/g,e=>st[e])}const xt=["left","right"],bt=["right","left"],Zt=["top","bottom"],Ct=["bottom","top"];function yt(e,t,l,o){const n=ut(e);let r=function(e,t,l){switch(e){case"top":case"bottom":return l?t?bt:xt:t?xt:bt;case"left":case"right":return t?Zt:Ct;default:return[]}}(ht(e),"start"===l,o);return n&&(r=r.map(e=>e+"-"+n),t&&(r=r.concat(r.map(_t)))),r}function Mt(e){return e.replace(/left|right|bottom|top/g,e=>at[e])}function Vt(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 Ht(e){const{x:t,y:l,width:o,height:n}=e;return{width:o,height:n,top:l,left:t,right:t+o,bottom:l+n,x:t,y:l}}function Pt(e,t,l){let{reference:o,floating:n}=e;const r=gt(t),i=wt(t),a=ft(i),s=ht(t),c="y"===r,d=o.x+o.width/2-n.width/2,h=o.y+o.height/2-n.height/2,u=o[a]/2-n[a]/2;let v;switch(s){case"top":v={x:d,y:o.y-n.height};break;case"bottom":v={x:d,y:o.y+o.height};break;case"right":v={x:o.x+o.width,y:h};break;case"left":v={x:o.x-n.width,y:h};break;default:v={x:o.x,y:o.y}}switch(ut(t)){case"start":v[i]-=u*(l&&c?-1:1);break;case"end":v[i]+=u*(l&&c?-1:1)}return v}async function zt(e,t){var l;void 0===t&&(t={});const{x:o,y:n,platform:r,rects:i,elements:a,strategy:s}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:u=!1,padding:v=0}=dt(t,e),f=Vt(v),p=a[u?"floating"===h?"reference":"floating":h],g=Ht(await r.getClippingRect({element:null==(l=await(null==r.isElement?void 0:r.isElement(p)))||l?p:p.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:s})),w="floating"===h?{x:o,y:n,width:i.floating.width,height:i.floating.height}:i.reference,m=await(null==r.getOffsetParent?void 0:r.getOffsetParent(a.floating)),_=await(null==r.isElement?void 0:r.isElement(m))&&await(null==r.getScale?void 0:r.getScale(m))||{x:1,y:1},x=Ht(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:m,strategy:s}):w);return{top:(g.top-x.top+f.top)/_.y,bottom:(x.bottom-g.bottom+f.bottom)/_.y,left:(g.left-x.left+f.left)/_.x,right:(x.right-g.right+f.right)/_.x}}const Ot=new Set(["left","top"]);function kt(){return"undefined"!=typeof window}function Bt(e){return $t(e)?(e.nodeName||"").toLowerCase():"#document"}function At(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function jt(e){var t;return null==(t=($t(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function $t(e){return!!kt()&&(e instanceof Node||e instanceof At(e).Node)}function St(e){return!!kt()&&(e instanceof Element||e instanceof At(e).Element)}function Lt(e){return!!kt()&&(e instanceof HTMLElement||e instanceof At(e).HTMLElement)}function Et(e){return!(!kt()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof At(e).ShadowRoot)}const Tt=new Set(["inline","contents"]);function Rt(e){const{overflow:t,overflowX:l,overflowY:o,display:n}=Gt(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+l)&&!Tt.has(n)}const It=new Set(["table","td","th"]);function Dt(e){return It.has(Bt(e))}const Nt=[":popover-open",":modal"];function Ut(e){return Nt.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const Wt=["transform","translate","scale","rotate","perspective"],Ft=["transform","translate","scale","rotate","perspective","filter"],qt=["paint","layout","strict","content"];function Yt(e){const t=Kt(),l=St(e)?Gt(e):e;return Wt.some(e=>!!l[e]&&"none"!==l[e])||!!l.containerType&&"normal"!==l.containerType||!t&&!!l.backdropFilter&&"none"!==l.backdropFilter||!t&&!!l.filter&&"none"!==l.filter||Ft.some(e=>(l.willChange||"").includes(e))||qt.some(e=>(l.contain||"").includes(e))}function Kt(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const Jt=new Set(["html","body","#document"]);function Xt(e){return Jt.has(Bt(e))}function Gt(e){return At(e).getComputedStyle(e)}function Qt(e){return St(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function el(e){if("html"===Bt(e))return e;const t=e.assignedSlot||e.parentNode||Et(e)&&e.host||jt(e);return Et(t)?t.host:t}function tl(e){const t=el(e);return Xt(t)?e.ownerDocument?e.ownerDocument.body:e.body:Lt(t)&&Rt(t)?t:tl(t)}function ll(e,t,l){var o;void 0===t&&(t=[]),void 0===l&&(l=!0);const n=tl(e),r=n===(null==(o=e.ownerDocument)?void 0:o.body),i=At(n);if(r){const e=ol(i);return t.concat(i,i.visualViewport||[],Rt(n)?n:[],e&&l?ll(e):[])}return t.concat(n,ll(n,[],l))}function ol(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function nl(e){const t=Gt(e);let l=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const n=Lt(e),r=n?e.offsetWidth:l,i=n?e.offsetHeight:o,a=nt(l)!==r||nt(o)!==i;return a&&(l=r,o=i),{width:l,height:o,$:a}}function rl(e){return St(e)?e:e.contextElement}function il(e){const t=rl(e);if(!Lt(t))return it(1);const l=t.getBoundingClientRect(),{width:o,height:n,$:r}=nl(t);let i=(r?nt(l.width):l.width)/o,a=(r?nt(l.height):l.height)/n;return i&&Number.isFinite(i)||(i=1),a&&Number.isFinite(a)||(a=1),{x:i,y:a}}const al=it(0);function sl(e){const t=At(e);return Kt()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:al}function cl(e,t,l,o){void 0===t&&(t=!1),void 0===l&&(l=!1);const n=e.getBoundingClientRect(),r=rl(e);let i=it(1);t&&(o?St(o)&&(i=il(o)):i=il(e));const a=function(e,t,l){return void 0===t&&(t=!1),!(!l||t&&l!==At(e))&&t}(r,l,o)?sl(r):it(0);let s=(n.left+a.x)/i.x,c=(n.top+a.y)/i.y,d=n.width/i.x,h=n.height/i.y;if(r){const e=At(r),t=o&&St(o)?At(o):o;let l=e,n=ol(l);for(;n&&o&&t!==l;){const e=il(n),t=n.getBoundingClientRect(),o=Gt(n),r=t.left+(n.clientLeft+parseFloat(o.paddingLeft))*e.x,i=t.top+(n.clientTop+parseFloat(o.paddingTop))*e.y;s*=e.x,c*=e.y,d*=e.x,h*=e.y,s+=r,c+=i,l=At(n),n=ol(l)}}return Ht({width:d,height:h,x:s,y:c})}function dl(e,t){const l=Qt(e).scrollLeft;return t?t.left+l:cl(jt(e)).left+l}function hl(e,t){const l=e.getBoundingClientRect();return{x:l.left+t.scrollLeft-dl(e,l),y:l.top+t.scrollTop}}const ul=new Set(["absolute","fixed"]);function vl(e,t,l){let o;if("viewport"===t)o=function(e,t){const l=At(e),o=jt(e),n=l.visualViewport;let r=o.clientWidth,i=o.clientHeight,a=0,s=0;if(n){r=n.width,i=n.height;const e=Kt();(!e||e&&"fixed"===t)&&(a=n.offsetLeft,s=n.offsetTop)}const c=dl(o);if(c<=0){const e=o.ownerDocument,t=e.body,l=getComputedStyle(t),n="CSS1Compat"===e.compatMode&&parseFloat(l.marginLeft)+parseFloat(l.marginRight)||0,i=Math.abs(o.clientWidth-t.clientWidth-n);i<=25&&(r-=i)}else c<=25&&(r+=c);return{width:r,height:i,x:a,y:s}}(e,l);else if("document"===t)o=function(e){const t=jt(e),l=Qt(e),o=e.ownerDocument.body,n=ot(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),r=ot(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let i=-l.scrollLeft+dl(e);const a=-l.scrollTop;return"rtl"===Gt(o).direction&&(i+=ot(t.clientWidth,o.clientWidth)-n),{width:n,height:r,x:i,y:a}}(jt(e));else if(St(t))o=function(e,t){const l=cl(e,!0,"fixed"===t),o=l.top+e.clientTop,n=l.left+e.clientLeft,r=Lt(e)?il(e):it(1);return{width:e.clientWidth*r.x,height:e.clientHeight*r.y,x:n*r.x,y:o*r.y}}(t,l);else{const l=sl(e);o={x:t.x-l.x,y:t.y-l.y,width:t.width,height:t.height}}return Ht(o)}function fl(e,t){const l=el(e);return!(l===t||!St(l)||Xt(l))&&("fixed"===Gt(l).position||fl(l,t))}function pl(e,t,l){const o=Lt(t),n=jt(t),r="fixed"===l,i=cl(e,!0,r,t);let a={scrollLeft:0,scrollTop:0};const s=it(0);function c(){s.x=dl(n)}if(o||!o&&!r)if(("body"!==Bt(t)||Rt(n))&&(a=Qt(t)),o){const e=cl(t,!0,r,t);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else n&&c();r&&!o&&n&&c();const d=!n||o||r?it(0):hl(n,a);return{x:i.left+a.scrollLeft-s.x-d.x,y:i.top+a.scrollTop-s.y-d.y,width:i.width,height:i.height}}function gl(e){return"static"===Gt(e).position}function wl(e,t){if(!Lt(e)||"fixed"===Gt(e).position)return null;if(t)return t(e);let l=e.offsetParent;return jt(e)===l&&(l=l.ownerDocument.body),l}function ml(e,t){const l=At(e);if(Ut(e))return l;if(!Lt(e)){let t=el(e);for(;t&&!Xt(t);){if(St(t)&&!gl(t))return t;t=el(t)}return l}let o=wl(e,t);for(;o&&Dt(o)&&gl(o);)o=wl(o,t);return o&&Xt(o)&&gl(o)&&!Yt(o)?l:o||function(e){let t=el(e);for(;Lt(t)&&!Xt(t);){if(Yt(t))return t;if(Ut(t))return null;t=el(t)}return null}(e)||l}const _l={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:l,offsetParent:o,strategy:n}=e;const r="fixed"===n,i=jt(o),a=!!t&&Ut(t.floating);if(o===i||a&&r)return l;let s={scrollLeft:0,scrollTop:0},c=it(1);const d=it(0),h=Lt(o);if((h||!h&&!r)&&(("body"!==Bt(o)||Rt(i))&&(s=Qt(o)),Lt(o))){const e=cl(o);c=il(o),d.x=e.x+o.clientLeft,d.y=e.y+o.clientTop}const u=!i||h||r?it(0):hl(i,s);return{width:l.width*c.x,height:l.height*c.y,x:l.x*c.x-s.scrollLeft*c.x+d.x+u.x,y:l.y*c.y-s.scrollTop*c.y+d.y+u.y}},getDocumentElement:jt,getClippingRect:function(e){let{element:t,boundary:l,rootBoundary:o,strategy:n}=e;const r=[..."clippingAncestors"===l?Ut(t)?[]:function(e,t){const l=t.get(e);if(l)return l;let o=ll(e,[],!1).filter(e=>St(e)&&"body"!==Bt(e)),n=null;const r="fixed"===Gt(e).position;let i=r?el(e):e;for(;St(i)&&!Xt(i);){const t=Gt(i),l=Yt(i);l||"fixed"!==t.position||(n=null),(r?!l&&!n:!l&&"static"===t.position&&n&&ul.has(n.position)||Rt(i)&&!l&&fl(e,i))?o=o.filter(e=>e!==i):n=t,i=el(i)}return t.set(e,o),o}(t,this._c):[].concat(l),o],i=r[0],a=r.reduce((e,l)=>{const o=vl(t,l,n);return e.top=ot(o.top,e.top),e.right=lt(o.right,e.right),e.bottom=lt(o.bottom,e.bottom),e.left=ot(o.left,e.left),e},vl(t,i,n));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:ml,getElementRects:async function(e){const t=this.getOffsetParent||ml,l=this.getDimensions,o=await l(e.floating);return{reference:pl(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:l}=nl(e);return{width:t,height:l}},getScale:il,isElement:St,isRTL:function(e){return"rtl"===Gt(e).direction}};function xl(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function bl(e,t,l,o){void 0===o&&(o={});const{ancestorScroll:n=!0,ancestorResize:r=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:s=!1}=o,c=rl(e),d=n||r?[...c?ll(c):[],...ll(t)]:[];d.forEach(e=>{n&&e.addEventListener("scroll",l,{passive:!0}),r&&e.addEventListener("resize",l)});const h=c&&a?function(e,t){let l,o=null;const n=jt(e);function r(){var e;clearTimeout(l),null==(e=o)||e.disconnect(),o=null}return function i(a,s){void 0===a&&(a=!1),void 0===s&&(s=1),r();const c=e.getBoundingClientRect(),{left:d,top:h,width:u,height:v}=c;if(a||t(),!u||!v)return;const f={rootMargin:-rt(h)+"px "+-rt(n.clientWidth-(d+u))+"px "+-rt(n.clientHeight-(h+v))+"px "+-rt(d)+"px",threshold:ot(0,lt(1,s))||1};let p=!0;function g(t){const o=t[0].intersectionRatio;if(o!==s){if(!p)return i();o?i(!1,o):l=setTimeout(()=>{i(!1,1e-7)},1e3)}1!==o||xl(c,e.getBoundingClientRect())||i(),p=!1}try{o=new IntersectionObserver(g,{...f,root:n.ownerDocument})}catch(e){o=new IntersectionObserver(g,f)}o.observe(e)}(!0),r}(c,l):null;let u,v=-1,f=null;i&&(f=new ResizeObserver(e=>{let[o]=e;o&&o.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var e;null==(e=f)||e.observe(t)})),l()}),c&&!s&&f.observe(c),f.observe(t));let p=s?cl(e):null;return s&&function t(){const o=cl(e);p&&!xl(p,o)&&l();p=o,u=requestAnimationFrame(t)}(),l(),()=>{var e;d.forEach(e=>{n&&e.removeEventListener("scroll",l),r&&e.removeEventListener("resize",l)}),null==h||h(),null==(e=f)||e.disconnect(),f=null,s&&cancelAnimationFrame(u)}}const Zl=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var l,o;const{x:n,y:r,placement:i,middlewareData:a}=t,s=await async function(e,t){const{placement:l,platform:o,elements:n}=e,r=await(null==o.isRTL?void 0:o.isRTL(n.floating)),i=ht(l),a=ut(l),s="y"===gt(l),c=Ot.has(i)?-1:1,d=r&&s?-1:1,h=dt(t,e);let{mainAxis:u,crossAxis:v,alignmentAxis:f}="number"==typeof h?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&"number"==typeof f&&(v="end"===a?-1*f:f),s?{x:v*d,y:u*c}:{x:u*c,y:v*d}}(t,e);return i===(null==(l=a.offset)?void 0:l.placement)&&null!=(o=a.arrow)&&o.alignmentOffset?{}:{x:n+s.x,y:r+s.y,data:{...s,placement:i}}}}},Cl=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:l,y:o,placement:n}=t,{mainAxis:r=!0,crossAxis:i=!1,limiter:a={fn:e=>{let{x:t,y:l}=e;return{x:t,y:l}}},...s}=dt(e,t),c={x:l,y:o},d=await zt(t,s),h=gt(ht(n)),u=vt(h);let v=c[u],f=c[h];if(r){const e="y"===u?"bottom":"right";v=ct(v+d["y"===u?"top":"left"],v,v-d[e])}if(i){const e="y"===h?"bottom":"right";f=ct(f+d["y"===h?"top":"left"],f,f-d[e])}const p=a.fn({...t,[u]:v,[h]:f});return{...p,data:{x:p.x-l,y:p.y-o,enabled:{[u]:r,[h]:i}}}}}},yl=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var l,o;const{placement:n,middlewareData:r,rects:i,initialPlacement:a,platform:s,elements:c}=t,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:u,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:p=!0,...g}=dt(e,t);if(null!=(l=r.arrow)&&l.alignmentOffset)return{};const w=ht(n),m=gt(a),_=ht(a)===a,x=await(null==s.isRTL?void 0:s.isRTL(c.floating)),b=u||(_||!p?[Mt(a)]:function(e){const t=Mt(e);return[_t(e),t,_t(t)]}(a)),Z="none"!==f;!u&&Z&&b.push(...yt(a,p,f,x));const C=[a,...b],y=await zt(t,g),M=[];let V=(null==(o=r.flip)?void 0:o.overflows)||[];if(d&&M.push(y[w]),h){const e=mt(n,i,x);M.push(y[e[0]],y[e[1]])}if(V=[...V,{placement:n,overflows:M}],!M.every(e=>e<=0)){var H,P;const e=((null==(H=r.flip)?void 0:H.index)||0)+1,t=C[e];if(t){if(!("alignment"===h&&m!==gt(t))||V.every(e=>gt(e.placement)!==m||e.overflows[0]>0))return{data:{index:e,overflows:V},reset:{placement:t}}}let l=null==(P=V.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:P.placement;if(!l)switch(v){case"bestFit":{var z;const e=null==(z=V.filter(e=>{if(Z){const t=gt(e.placement);return t===m||"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:z[0];e&&(l=e);break}case"initialPlacement":l=a}if(n!==l)return{reset:{placement:l}}}return{}}}},Ml=(e,t,l)=>{const o=new Map,n={platform:_l,...l},r={...n.platform,_c:o};return(async(e,t,l)=>{const{placement:o="bottom",strategy:n="absolute",middleware:r=[],platform:i}=l,a=r.filter(Boolean),s=await(null==i.isRTL?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:n}),{x:d,y:h}=Pt(c,o,s),u=o,v={},f=0;for(let l=0;l<a.length;l++){const{name:r,fn:p}=a[l],{x:g,y:w,data:m,reset:_}=await p({x:d,y:h,initialPlacement:o,placement:u,strategy:n,middlewareData:v,rects:c,platform:i,elements:{reference:e,floating:t}});d=null!=g?g:d,h=null!=w?w:h,v={...v,[r]:{...v[r],...m}},_&&f<=50&&(f++,"object"==typeof _&&(_.placement&&(u=_.placement),_.rects&&(c=!0===_.rects?await i.getElementRects({reference:e,floating:t,strategy:n}):_.rects),({x:d,y:h}=Pt(c,u,s))),l=-1)}return{x:d,y:h,placement:u,strategy:n,middlewareData:v}})(e,t,{...n,platform:r})};function Vl(e,t,l){return new Promise(o=>{if((null==l?void 0:l.duration)===1/0)throw new Error("Promise-based animations must be finite.");const n=e.animate(t,Object.assign(Object.assign({},l),{duration:Hl()?0:null==l?void 0:l.duration}));n.addEventListener("cancel",o,{once:!0}),n.addEventListener("finish",o,{once:!0})})}function Hl(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches}const Pl=new Map,zl=new WeakMap;function Ol(e,t){const l=zl.get(e);if(null==l?void 0:l[t])return l[t];const o=Pl.get(t);return o||{keyframes:[],options:{duration:0}}}function kl(e,t){Pl.set(e,function(e){return null!=e?e:{keyframes:[],options:{duration:0}}}(t))}class Bl extends Te{constructor(){super(...arguments),this.myDropdown=Ge(),this.dropdownMenuId=function(e="",t=""){return`id-${Math.random().toString().substring(2,6)}-sgds-${e}-${t}`}("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=Ge(),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(){if(!this.disabled&&!this.menuIsOpen){if(this.menuIsOpen=!0,this.emit("sgds-show"),await this.updateFloatingPosition(),this._startAutoUpdate(),this.menuRef.value){const e=(this.menuRef.value.getAttribute("data-placement")||"").startsWith("top")?"4px":"-4px",{options:t}=Ol(this,"dropdown.show");await Vl(this.menuRef.value,[{opacity:0,transform:`translateY(${e})`},{opacity:1,transform:"translateY(0)"}],t)}this.emit("sgds-after-show")}}_startAutoUpdate(){this.myDropdown.value&&this.menuRef.value&&(this._cleanupAutoUpdate=bl(this.myDropdown.value,this.menuRef.value,()=>this.updateFloatingPosition()))}async hideMenu(e){if(this.menuIsOpen){if(this.emit("sgds-hide",{detail:{isOutside:e}}),this.menuRef.value){const e=(this.menuRef.value.getAttribute("data-placement")||"").startsWith("top")?"4px":"-4px",{options:t}=Ol(this,"dropdown.hide");await Vl(this.menuRef.value,[{opacity:1,transform:"translateY(0)"},{opacity:0,transform:`translateY(${e})`}],t)}this.menuIsOpen=!1,this.emit("sgds-after-hide"),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 l=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)},o=t.map(l),n=e.map(e=>{const n=l(e),r=o.indexOf(n);return-1!==r?t[r]:e}).concat(t.filter(t=>!e.some(e=>l(e)===l(t))));return n}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=[Zl(8),this.noFlip?void 0:yl(),Cl()].filter(Boolean);let l=t;Array.isArray(this.floatingOpts.middleware)&&this.floatingOpts.middleware.length>0&&(l=this.mergeMiddleware(t,this.floatingOpts.middleware.filter(Boolean)));const o=Object.assign(Object.assign({strategy:"fixed",placement:e},this.floatingOpts),{middleware:l}),{x:n,y:r,strategy:i,placement:a}=await Ml(this.myDropdown.value,this.menuRef.value,o);this.menuRef.value.setAttribute("data-placement",a),Object.assign(this.menuRef.value.style,{position:i,left:`${n}px`,top:`${r}px`})}}e([P({type:Boolean,state:!0})],Bl.prototype,"noFlip",void 0),e([P({type:Boolean,reflect:!0,state:!0})],Bl.prototype,"menuAlignRight",void 0),e([P({type:String,reflect:!0,state:!0})],Bl.prototype,"drop",void 0),e([P({type:Object})],Bl.prototype,"floatingOpts",void 0),e([P({type:Boolean,reflect:!0})],Bl.prototype,"menuIsOpen",void 0),e([P({type:Boolean,reflect:!0})],Bl.prototype,"disabled",void 0),e([P({type:Boolean,reflect:!0})],Bl.prototype,"readonly",void 0),kl("dropdown.show",{keyframes:[],options:{duration:200,easing:"cubic-bezier(0.1, 0, 0.5, 0)"}}),kl("dropdown.hide",{keyframes:[],options:{duration:200,easing:"cubic-bezier(0.15, 0.6, 0.6, 1)"}});class Al extends Bl{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(),l=t.find(t=>e.composedPath().includes(t));if(!l)return;const o=t.indexOf(l);this.nextDropdownItemNo=o+1,this.prevDropdownItemNo=o<=0?t.length-1:o-1,l.disabled||(this.emit("sgds-select",{detail:{item:l}}),"outside"!==this.close&&this.hideMenu())}_resetMenu(){this.nextDropdownItemNo=0,this.prevDropdownItemNo=-1;this._getMenuItems().forEach(e=>{var t;const l=null===(t=null==e?void 0:e.shadowRoot)||void 0===t?void 0:t.querySelector(".dropdown-item");l&&l.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 l=(e%t.length+t.length)%t.length,o=t[l];this.emit("i-sgds-option-focus",{detail:{option:o}}),this.nextDropdownItemNo=(l+1)%t.length,this.prevDropdownItemNo=(l-1+t.length)%t.length,t.forEach(e=>{const t=e.shadowRoot.querySelector(".dropdown-item");t.setAttribute("tabindex",e===o?"0":"-1"),e===o&&t.focus()})}}function jl(e,t){const l=Object.assign({waitUntilFirstUpdate:!1},t);return(t,o)=>{const{update:n}=t;if(e in t){const r=e;t.update=function(e){if(e.has(r)){const t=e.get(r),n=this[r];t!==n&&(l.waitUntilFirstUpdate&&!this.hasUpdated||this[o](t,n))}n.call(this,e)}}}}Al.styles=Bl.styles,e([B("ul.dropdown-menu")],Al.prototype,"menu",void 0),e([z()],Al.prototype,"nextDropdownItemNo",void 0),e([z()],Al.prototype,"prevDropdownItemNo",void 0),e([P({type:Boolean,reflect:!0})],Al.prototype,"hidden",void 0);var $l=i`: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%}`,Sl=i`.dropdown{display:flex;height:inherit;position:relative}.dropdown-menu{max-width:var(--sgds-dimension-320)}.toggler-container{flex:1;pointer-events:none}.toggler-container ::slotted(*){pointer-events:auto}`;class Ll extends Al{constructor(){super(),this.noFlip=!1,this.menuAlignRight=!1,this.drop="down",this.close="default",this.menuRef=tt()}async _handleClick(e){if(this.disabled)return;const t=this._toggler[0];if(!t)return void this.toggleMenu();if(e.composedPath().includes(t))return void this.toggleMenu();if(!this.menuIsOpen)return;const l=this.menuRef.value;l&&e.composedPath().includes(l)||this.hideMenu()}_handleCloseMenu(){const e=this._toggler[0];null==e||e.focus()}async connectedCallback(){super.connectedCallback(),this.addEventListener("sgds-hide",this._handleCloseMenu)}async disconnectedCallback(){this.removeEventListener("sgds-hide",this._handleCloseMenu)}async firstUpdated(e){super.firstUpdated(e),this.menuIsOpen&&await this.updateFloatingPosition(),this._handleDisabled()}_handleTogglerSlotChange(e){const t=e.target.assignedElements({flatten:!0})[0];t&&(t.setAttribute("aria-haspopup","menu"),t.setAttribute("aria-expanded",String(this.menuIsOpen)))}_handleMenuIsOpenChange(){const e=this._toggler[0];e&&e.setAttribute("aria-expanded",String(this.menuIsOpen))}_handleDisabled(){const e=this._toggler[0];e&&(this.disabled?e.setAttribute("disabled","true"):e.hasAttribute("disabled")&&e.removeAttribute("disabled"))}render(){return se`
75
+ */const Ge=()=>new Qe;class Qe{}const et=new WeakMap;const tt=Ne(class extends Xe{render(e){return he}update(e,[t]){const l=t!==this._ref;return l&&void 0!==this._ref&&this._updateRefValue(void 0),(l||this._lastElementForRef!==this._element)&&(this._ref=t,this._context=e.options?.host,this._updateRefValue(this._element=e.element)),he}_updateRefValue(e){if(this.isConnected||(e=void 0),"function"==typeof this._ref){const t=this._context??globalThis;let l=et.get(t);void 0===l&&(l=new WeakMap,et.set(t,l)),void 0!==l.get(this._ref)&&this._ref.call(this._context,void 0),l.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?et.get(this._context??globalThis)?.get(this._ref):this._ref?.value}disconnected(){this._lastElementForRef===this._element&&this._updateRefValue(void 0)}reconnected(){this._updateRefValue(this._element)}}),lt=Math.min,ot=Math.max,nt=Math.round,rt=Math.floor,it=e=>({x:e,y:e}),at={left:"right",right:"left",bottom:"top",top:"bottom"},st={start:"end",end:"start"};function ct(e,t,l){return ot(e,lt(t,l))}function dt(e,t){return"function"==typeof e?e(t):e}function ht(e){return e.split("-")[0]}function ut(e){return e.split("-")[1]}function vt(e){return"x"===e?"y":"x"}function ft(e){return"y"===e?"height":"width"}const pt=new Set(["top","bottom"]);function gt(e){return pt.has(ht(e))?"y":"x"}function wt(e){return vt(gt(e))}function mt(e,t,l){void 0===l&&(l=!1);const o=ut(e),n=wt(e),r=ft(n);let i="x"===n?o===(l?"end":"start")?"right":"left":"start"===o?"bottom":"top";return t.reference[r]>t.floating[r]&&(i=Mt(i)),[i,Mt(i)]}function _t(e){return e.replace(/start|end/g,e=>st[e])}const xt=["left","right"],bt=["right","left"],Zt=["top","bottom"],Ct=["bottom","top"];function yt(e,t,l,o){const n=ut(e);let r=function(e,t,l){switch(e){case"top":case"bottom":return l?t?bt:xt:t?xt:bt;case"left":case"right":return t?Zt:Ct;default:return[]}}(ht(e),"start"===l,o);return n&&(r=r.map(e=>e+"-"+n),t&&(r=r.concat(r.map(_t)))),r}function Mt(e){return e.replace(/left|right|bottom|top/g,e=>at[e])}function Vt(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 Ht(e){const{x:t,y:l,width:o,height:n}=e;return{width:o,height:n,top:l,left:t,right:t+o,bottom:l+n,x:t,y:l}}function Pt(e,t,l){let{reference:o,floating:n}=e;const r=gt(t),i=wt(t),a=ft(i),s=ht(t),c="y"===r,d=o.x+o.width/2-n.width/2,h=o.y+o.height/2-n.height/2,u=o[a]/2-n[a]/2;let v;switch(s){case"top":v={x:d,y:o.y-n.height};break;case"bottom":v={x:d,y:o.y+o.height};break;case"right":v={x:o.x+o.width,y:h};break;case"left":v={x:o.x-n.width,y:h};break;default:v={x:o.x,y:o.y}}switch(ut(t)){case"start":v[i]-=u*(l&&c?-1:1);break;case"end":v[i]+=u*(l&&c?-1:1)}return v}async function zt(e,t){var l;void 0===t&&(t={});const{x:o,y:n,platform:r,rects:i,elements:a,strategy:s}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:u=!1,padding:v=0}=dt(t,e),f=Vt(v),p=a[u?"floating"===h?"reference":"floating":h],g=Ht(await r.getClippingRect({element:null==(l=await(null==r.isElement?void 0:r.isElement(p)))||l?p:p.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:s})),w="floating"===h?{x:o,y:n,width:i.floating.width,height:i.floating.height}:i.reference,m=await(null==r.getOffsetParent?void 0:r.getOffsetParent(a.floating)),_=await(null==r.isElement?void 0:r.isElement(m))&&await(null==r.getScale?void 0:r.getScale(m))||{x:1,y:1},x=Ht(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:m,strategy:s}):w);return{top:(g.top-x.top+f.top)/_.y,bottom:(x.bottom-g.bottom+f.bottom)/_.y,left:(g.left-x.left+f.left)/_.x,right:(x.right-g.right+f.right)/_.x}}const Ot=new Set(["left","top"]);function kt(){return"undefined"!=typeof window}function Bt(e){return $t(e)?(e.nodeName||"").toLowerCase():"#document"}function At(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function jt(e){var t;return null==(t=($t(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function $t(e){return!!kt()&&(e instanceof Node||e instanceof At(e).Node)}function St(e){return!!kt()&&(e instanceof Element||e instanceof At(e).Element)}function Lt(e){return!!kt()&&(e instanceof HTMLElement||e instanceof At(e).HTMLElement)}function Et(e){return!(!kt()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof At(e).ShadowRoot)}const Tt=new Set(["inline","contents"]);function Rt(e){const{overflow:t,overflowX:l,overflowY:o,display:n}=Gt(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+l)&&!Tt.has(n)}const It=new Set(["table","td","th"]);function Dt(e){return It.has(Bt(e))}const Nt=[":popover-open",":modal"];function Ut(e){return Nt.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const Wt=["transform","translate","scale","rotate","perspective"],Ft=["transform","translate","scale","rotate","perspective","filter"],qt=["paint","layout","strict","content"];function Yt(e){const t=Kt(),l=St(e)?Gt(e):e;return Wt.some(e=>!!l[e]&&"none"!==l[e])||!!l.containerType&&"normal"!==l.containerType||!t&&!!l.backdropFilter&&"none"!==l.backdropFilter||!t&&!!l.filter&&"none"!==l.filter||Ft.some(e=>(l.willChange||"").includes(e))||qt.some(e=>(l.contain||"").includes(e))}function Kt(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const Jt=new Set(["html","body","#document"]);function Xt(e){return Jt.has(Bt(e))}function Gt(e){return At(e).getComputedStyle(e)}function Qt(e){return St(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function el(e){if("html"===Bt(e))return e;const t=e.assignedSlot||e.parentNode||Et(e)&&e.host||jt(e);return Et(t)?t.host:t}function tl(e){const t=el(e);return Xt(t)?e.ownerDocument?e.ownerDocument.body:e.body:Lt(t)&&Rt(t)?t:tl(t)}function ll(e,t,l){var o;void 0===t&&(t=[]),void 0===l&&(l=!0);const n=tl(e),r=n===(null==(o=e.ownerDocument)?void 0:o.body),i=At(n);if(r){const e=ol(i);return t.concat(i,i.visualViewport||[],Rt(n)?n:[],e&&l?ll(e):[])}return t.concat(n,ll(n,[],l))}function ol(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function nl(e){const t=Gt(e);let l=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const n=Lt(e),r=n?e.offsetWidth:l,i=n?e.offsetHeight:o,a=nt(l)!==r||nt(o)!==i;return a&&(l=r,o=i),{width:l,height:o,$:a}}function rl(e){return St(e)?e:e.contextElement}function il(e){const t=rl(e);if(!Lt(t))return it(1);const l=t.getBoundingClientRect(),{width:o,height:n,$:r}=nl(t);let i=(r?nt(l.width):l.width)/o,a=(r?nt(l.height):l.height)/n;return i&&Number.isFinite(i)||(i=1),a&&Number.isFinite(a)||(a=1),{x:i,y:a}}const al=it(0);function sl(e){const t=At(e);return Kt()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:al}function cl(e,t,l,o){void 0===t&&(t=!1),void 0===l&&(l=!1);const n=e.getBoundingClientRect(),r=rl(e);let i=it(1);t&&(o?St(o)&&(i=il(o)):i=il(e));const a=function(e,t,l){return void 0===t&&(t=!1),!(!l||t&&l!==At(e))&&t}(r,l,o)?sl(r):it(0);let s=(n.left+a.x)/i.x,c=(n.top+a.y)/i.y,d=n.width/i.x,h=n.height/i.y;if(r){const e=At(r),t=o&&St(o)?At(o):o;let l=e,n=ol(l);for(;n&&o&&t!==l;){const e=il(n),t=n.getBoundingClientRect(),o=Gt(n),r=t.left+(n.clientLeft+parseFloat(o.paddingLeft))*e.x,i=t.top+(n.clientTop+parseFloat(o.paddingTop))*e.y;s*=e.x,c*=e.y,d*=e.x,h*=e.y,s+=r,c+=i,l=At(n),n=ol(l)}}return Ht({width:d,height:h,x:s,y:c})}function dl(e,t){const l=Qt(e).scrollLeft;return t?t.left+l:cl(jt(e)).left+l}function hl(e,t){const l=e.getBoundingClientRect();return{x:l.left+t.scrollLeft-dl(e,l),y:l.top+t.scrollTop}}const ul=new Set(["absolute","fixed"]);function vl(e,t,l){let o;if("viewport"===t)o=function(e,t){const l=At(e),o=jt(e),n=l.visualViewport;let r=o.clientWidth,i=o.clientHeight,a=0,s=0;if(n){r=n.width,i=n.height;const e=Kt();(!e||e&&"fixed"===t)&&(a=n.offsetLeft,s=n.offsetTop)}const c=dl(o);if(c<=0){const e=o.ownerDocument,t=e.body,l=getComputedStyle(t),n="CSS1Compat"===e.compatMode&&parseFloat(l.marginLeft)+parseFloat(l.marginRight)||0,i=Math.abs(o.clientWidth-t.clientWidth-n);i<=25&&(r-=i)}else c<=25&&(r+=c);return{width:r,height:i,x:a,y:s}}(e,l);else if("document"===t)o=function(e){const t=jt(e),l=Qt(e),o=e.ownerDocument.body,n=ot(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),r=ot(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let i=-l.scrollLeft+dl(e);const a=-l.scrollTop;return"rtl"===Gt(o).direction&&(i+=ot(t.clientWidth,o.clientWidth)-n),{width:n,height:r,x:i,y:a}}(jt(e));else if(St(t))o=function(e,t){const l=cl(e,!0,"fixed"===t),o=l.top+e.clientTop,n=l.left+e.clientLeft,r=Lt(e)?il(e):it(1);return{width:e.clientWidth*r.x,height:e.clientHeight*r.y,x:n*r.x,y:o*r.y}}(t,l);else{const l=sl(e);o={x:t.x-l.x,y:t.y-l.y,width:t.width,height:t.height}}return Ht(o)}function fl(e,t){const l=el(e);return!(l===t||!St(l)||Xt(l))&&("fixed"===Gt(l).position||fl(l,t))}function pl(e,t,l){const o=Lt(t),n=jt(t),r="fixed"===l,i=cl(e,!0,r,t);let a={scrollLeft:0,scrollTop:0};const s=it(0);function c(){s.x=dl(n)}if(o||!o&&!r)if(("body"!==Bt(t)||Rt(n))&&(a=Qt(t)),o){const e=cl(t,!0,r,t);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else n&&c();r&&!o&&n&&c();const d=!n||o||r?it(0):hl(n,a);return{x:i.left+a.scrollLeft-s.x-d.x,y:i.top+a.scrollTop-s.y-d.y,width:i.width,height:i.height}}function gl(e){return"static"===Gt(e).position}function wl(e,t){if(!Lt(e)||"fixed"===Gt(e).position)return null;if(t)return t(e);let l=e.offsetParent;return jt(e)===l&&(l=l.ownerDocument.body),l}function ml(e,t){const l=At(e);if(Ut(e))return l;if(!Lt(e)){let t=el(e);for(;t&&!Xt(t);){if(St(t)&&!gl(t))return t;t=el(t)}return l}let o=wl(e,t);for(;o&&Dt(o)&&gl(o);)o=wl(o,t);return o&&Xt(o)&&gl(o)&&!Yt(o)?l:o||function(e){let t=el(e);for(;Lt(t)&&!Xt(t);){if(Yt(t))return t;if(Ut(t))return null;t=el(t)}return null}(e)||l}const _l={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:l,offsetParent:o,strategy:n}=e;const r="fixed"===n,i=jt(o),a=!!t&&Ut(t.floating);if(o===i||a&&r)return l;let s={scrollLeft:0,scrollTop:0},c=it(1);const d=it(0),h=Lt(o);if((h||!h&&!r)&&(("body"!==Bt(o)||Rt(i))&&(s=Qt(o)),Lt(o))){const e=cl(o);c=il(o),d.x=e.x+o.clientLeft,d.y=e.y+o.clientTop}const u=!i||h||r?it(0):hl(i,s);return{width:l.width*c.x,height:l.height*c.y,x:l.x*c.x-s.scrollLeft*c.x+d.x+u.x,y:l.y*c.y-s.scrollTop*c.y+d.y+u.y}},getDocumentElement:jt,getClippingRect:function(e){let{element:t,boundary:l,rootBoundary:o,strategy:n}=e;const r=[..."clippingAncestors"===l?Ut(t)?[]:function(e,t){const l=t.get(e);if(l)return l;let o=ll(e,[],!1).filter(e=>St(e)&&"body"!==Bt(e)),n=null;const r="fixed"===Gt(e).position;let i=r?el(e):e;for(;St(i)&&!Xt(i);){const t=Gt(i),l=Yt(i);l||"fixed"!==t.position||(n=null),(r?!l&&!n:!l&&"static"===t.position&&n&&ul.has(n.position)||Rt(i)&&!l&&fl(e,i))?o=o.filter(e=>e!==i):n=t,i=el(i)}return t.set(e,o),o}(t,this._c):[].concat(l),o],i=r[0],a=r.reduce((e,l)=>{const o=vl(t,l,n);return e.top=ot(o.top,e.top),e.right=lt(o.right,e.right),e.bottom=lt(o.bottom,e.bottom),e.left=ot(o.left,e.left),e},vl(t,i,n));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:ml,getElementRects:async function(e){const t=this.getOffsetParent||ml,l=this.getDimensions,o=await l(e.floating);return{reference:pl(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:l}=nl(e);return{width:t,height:l}},getScale:il,isElement:St,isRTL:function(e){return"rtl"===Gt(e).direction}};function xl(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function bl(e,t,l,o){void 0===o&&(o={});const{ancestorScroll:n=!0,ancestorResize:r=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:s=!1}=o,c=rl(e),d=n||r?[...c?ll(c):[],...ll(t)]:[];d.forEach(e=>{n&&e.addEventListener("scroll",l,{passive:!0}),r&&e.addEventListener("resize",l)});const h=c&&a?function(e,t){let l,o=null;const n=jt(e);function r(){var e;clearTimeout(l),null==(e=o)||e.disconnect(),o=null}return function i(a,s){void 0===a&&(a=!1),void 0===s&&(s=1),r();const c=e.getBoundingClientRect(),{left:d,top:h,width:u,height:v}=c;if(a||t(),!u||!v)return;const f={rootMargin:-rt(h)+"px "+-rt(n.clientWidth-(d+u))+"px "+-rt(n.clientHeight-(h+v))+"px "+-rt(d)+"px",threshold:ot(0,lt(1,s))||1};let p=!0;function g(t){const o=t[0].intersectionRatio;if(o!==s){if(!p)return i();o?i(!1,o):l=setTimeout(()=>{i(!1,1e-7)},1e3)}1!==o||xl(c,e.getBoundingClientRect())||i(),p=!1}try{o=new IntersectionObserver(g,{...f,root:n.ownerDocument})}catch(e){o=new IntersectionObserver(g,f)}o.observe(e)}(!0),r}(c,l):null;let u,v=-1,f=null;i&&(f=new ResizeObserver(e=>{let[o]=e;o&&o.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var e;null==(e=f)||e.observe(t)})),l()}),c&&!s&&f.observe(c),f.observe(t));let p=s?cl(e):null;return s&&function t(){const o=cl(e);p&&!xl(p,o)&&l();p=o,u=requestAnimationFrame(t)}(),l(),()=>{var e;d.forEach(e=>{n&&e.removeEventListener("scroll",l),r&&e.removeEventListener("resize",l)}),null==h||h(),null==(e=f)||e.disconnect(),f=null,s&&cancelAnimationFrame(u)}}const Zl=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var l,o;const{x:n,y:r,placement:i,middlewareData:a}=t,s=await async function(e,t){const{placement:l,platform:o,elements:n}=e,r=await(null==o.isRTL?void 0:o.isRTL(n.floating)),i=ht(l),a=ut(l),s="y"===gt(l),c=Ot.has(i)?-1:1,d=r&&s?-1:1,h=dt(t,e);let{mainAxis:u,crossAxis:v,alignmentAxis:f}="number"==typeof h?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&"number"==typeof f&&(v="end"===a?-1*f:f),s?{x:v*d,y:u*c}:{x:u*c,y:v*d}}(t,e);return i===(null==(l=a.offset)?void 0:l.placement)&&null!=(o=a.arrow)&&o.alignmentOffset?{}:{x:n+s.x,y:r+s.y,data:{...s,placement:i}}}}},Cl=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:l,y:o,placement:n}=t,{mainAxis:r=!0,crossAxis:i=!1,limiter:a={fn:e=>{let{x:t,y:l}=e;return{x:t,y:l}}},...s}=dt(e,t),c={x:l,y:o},d=await zt(t,s),h=gt(ht(n)),u=vt(h);let v=c[u],f=c[h];if(r){const e="y"===u?"bottom":"right";v=ct(v+d["y"===u?"top":"left"],v,v-d[e])}if(i){const e="y"===h?"bottom":"right";f=ct(f+d["y"===h?"top":"left"],f,f-d[e])}const p=a.fn({...t,[u]:v,[h]:f});return{...p,data:{x:p.x-l,y:p.y-o,enabled:{[u]:r,[h]:i}}}}}},yl=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var l,o;const{placement:n,middlewareData:r,rects:i,initialPlacement:a,platform:s,elements:c}=t,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:u,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:p=!0,...g}=dt(e,t);if(null!=(l=r.arrow)&&l.alignmentOffset)return{};const w=ht(n),m=gt(a),_=ht(a)===a,x=await(null==s.isRTL?void 0:s.isRTL(c.floating)),b=u||(_||!p?[Mt(a)]:function(e){const t=Mt(e);return[_t(e),t,_t(t)]}(a)),Z="none"!==f;!u&&Z&&b.push(...yt(a,p,f,x));const C=[a,...b],y=await zt(t,g),M=[];let V=(null==(o=r.flip)?void 0:o.overflows)||[];if(d&&M.push(y[w]),h){const e=mt(n,i,x);M.push(y[e[0]],y[e[1]])}if(V=[...V,{placement:n,overflows:M}],!M.every(e=>e<=0)){var H,P;const e=((null==(H=r.flip)?void 0:H.index)||0)+1,t=C[e];if(t){if(!("alignment"===h&&m!==gt(t))||V.every(e=>gt(e.placement)!==m||e.overflows[0]>0))return{data:{index:e,overflows:V},reset:{placement:t}}}let l=null==(P=V.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:P.placement;if(!l)switch(v){case"bestFit":{var z;const e=null==(z=V.filter(e=>{if(Z){const t=gt(e.placement);return t===m||"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:z[0];e&&(l=e);break}case"initialPlacement":l=a}if(n!==l)return{reset:{placement:l}}}return{}}}},Ml=(e,t,l)=>{const o=new Map,n={platform:_l,...l},r={...n.platform,_c:o};return(async(e,t,l)=>{const{placement:o="bottom",strategy:n="absolute",middleware:r=[],platform:i}=l,a=r.filter(Boolean),s=await(null==i.isRTL?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:n}),{x:d,y:h}=Pt(c,o,s),u=o,v={},f=0;for(let l=0;l<a.length;l++){const{name:r,fn:p}=a[l],{x:g,y:w,data:m,reset:_}=await p({x:d,y:h,initialPlacement:o,placement:u,strategy:n,middlewareData:v,rects:c,platform:i,elements:{reference:e,floating:t}});d=null!=g?g:d,h=null!=w?w:h,v={...v,[r]:{...v[r],...m}},_&&f<=50&&(f++,"object"==typeof _&&(_.placement&&(u=_.placement),_.rects&&(c=!0===_.rects?await i.getElementRects({reference:e,floating:t,strategy:n}):_.rects),({x:d,y:h}=Pt(c,u,s))),l=-1)}return{x:d,y:h,placement:u,strategy:n,middlewareData:v}})(e,t,{...n,platform:r})};function Vl(e,t,l){return new Promise(o=>{if((null==l?void 0:l.duration)===1/0)throw new Error("Promise-based animations must be finite.");const n=e.animate(t,Object.assign(Object.assign({},l),{duration:Hl()?0:null==l?void 0:l.duration}));n.addEventListener("cancel",o,{once:!0}),n.addEventListener("finish",o,{once:!0})})}function Hl(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches}const Pl=new Map,zl=new WeakMap;function Ol(e,t){const l=zl.get(e);if(null==l?void 0:l[t])return l[t];const o=Pl.get(t);return o||{keyframes:[],options:{duration:0}}}function kl(e,t){Pl.set(e,function(e){return null!=e?e:{keyframes:[],options:{duration:0}}}(t))}class Bl extends Te{constructor(){super(...arguments),this.myDropdown=Ge(),this.dropdownMenuId=function(e="",t=""){return`id-${Math.random().toString().substring(2,6)}-sgds-${e}-${t}`}("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=Ge(),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(){if(!this.disabled&&!this.menuIsOpen){if(this.menuIsOpen=!0,this.emit("sgds-show"),await this.updateFloatingPosition(),this._startAutoUpdate(),this.menuRef.value){const e=(this.menuRef.value.getAttribute("data-placement")||"").startsWith("top")?"4px":"-4px",{options:t}=Ol(this,"dropdown.show");await Vl(this.menuRef.value,[{opacity:0,transform:`translateY(${e})`},{opacity:1,transform:"translateY(0)"}],t)}this.emit("sgds-after-show")}}_startAutoUpdate(){this.myDropdown.value&&this.menuRef.value&&(this._cleanupAutoUpdate=bl(this.myDropdown.value,this.menuRef.value,()=>this.updateFloatingPosition()))}async hideMenu(e){if(this.menuIsOpen){if(this.emit("sgds-hide",{detail:{isOutside:e}}),this.menuRef.value){const e=(this.menuRef.value.getAttribute("data-placement")||"").startsWith("top")?"4px":"-4px",{options:t}=Ol(this,"dropdown.hide");await Vl(this.menuRef.value,[{opacity:1,transform:"translateY(0)"},{opacity:0,transform:`translateY(${e})`}],t)}this.menuIsOpen=!1,this.emit("sgds-after-hide"),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 l=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)},o=t.map(l),n=e.map(e=>{const n=l(e),r=o.indexOf(n);return-1!==r?t[r]:e}).concat(t.filter(t=>!e.some(e=>l(e)===l(t))));return n}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=[Zl(8),this.noFlip?void 0:yl(),Cl()].filter(Boolean);let l=t;Array.isArray(this.floatingOpts.middleware)&&this.floatingOpts.middleware.length>0&&(l=this.mergeMiddleware(t,this.floatingOpts.middleware.filter(Boolean)));const o=Object.assign(Object.assign({strategy:"fixed",placement:e},this.floatingOpts),{middleware:l}),{x:n,y:r,strategy:i,placement:a}=await Ml(this.myDropdown.value,this.menuRef.value,o);this.menuRef.value.setAttribute("data-placement",a),Object.assign(this.menuRef.value.style,{position:i,left:`${n}px`,top:`${r}px`})}}e([P({type:Boolean,state:!0})],Bl.prototype,"noFlip",void 0),e([P({type:Boolean,reflect:!0,state:!0})],Bl.prototype,"menuAlignRight",void 0),e([P({type:String,reflect:!0,state:!0})],Bl.prototype,"drop",void 0),e([P({type:Object})],Bl.prototype,"floatingOpts",void 0),e([P({type:Boolean,reflect:!0})],Bl.prototype,"menuIsOpen",void 0),e([P({type:Boolean,reflect:!0})],Bl.prototype,"disabled",void 0),e([P({type:Boolean,reflect:!0})],Bl.prototype,"readonly",void 0),kl("dropdown.show",{keyframes:[],options:{duration:200,easing:"cubic-bezier(0.1, 0, 0.5, 0)"}}),kl("dropdown.hide",{keyframes:[],options:{duration:200,easing:"cubic-bezier(0.15, 0.6, 0.6, 1)"}});class Al extends Bl{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(),l=t.find(t=>e.composedPath().includes(t));if(!l)return;const o=t.indexOf(l);this.nextDropdownItemNo=o+1,this.prevDropdownItemNo=o<=0?t.length-1:o-1,l.disabled||(this.emit("sgds-select",{detail:{item:l}}),"outside"!==this.close&&this.hideMenu())}_resetMenu(){this.nextDropdownItemNo=0,this.prevDropdownItemNo=-1;this._getMenuItems().forEach(e=>{var t;const l=null===(t=null==e?void 0:e.shadowRoot)||void 0===t?void 0:t.querySelector(".dropdown-item");l&&l.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"Escape":this.menuIsOpen&&(e.preventDefault(),this.hideMenu());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=>"menuitem"===e.getAttribute("role")&&!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&&!e.readonly)}_setMenuItem(e){const t=this._getActiveMenuItems();if(0===t.length)return;const l=(e%t.length+t.length)%t.length,o=t[l];this.emit("i-sgds-option-focus",{detail:{option:o}}),this.nextDropdownItemNo=(l+1)%t.length,this.prevDropdownItemNo=(l-1+t.length)%t.length,t.forEach(e=>{const t=e.shadowRoot.querySelector(".dropdown-item");t.setAttribute("tabindex",e===o?"0":"-1"),e===o&&t.focus()})}}function jl(e,t){const l=Object.assign({waitUntilFirstUpdate:!1},t);return(t,o)=>{const{update:n}=t;if(e in t){const r=e;t.update=function(e){if(e.has(r)){const t=e.get(r),n=this[r];t!==n&&(l.waitUntilFirstUpdate&&!this.hasUpdated||this[o](t,n))}n.call(this,e)}}}}Al.styles=Bl.styles,e([B("ul.dropdown-menu")],Al.prototype,"menu",void 0),e([z()],Al.prototype,"nextDropdownItemNo",void 0),e([z()],Al.prototype,"prevDropdownItemNo",void 0),e([P({type:Boolean,reflect:!0})],Al.prototype,"hidden",void 0);var $l=i`: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%}`,Sl=i`.dropdown{display:flex;height:inherit;position:relative}.dropdown-menu{max-width:var(--sgds-dimension-320)}.toggler-container{flex:1;pointer-events:none}.toggler-container ::slotted(*){pointer-events:auto}`;class Ll extends Al{constructor(){super(),this.noFlip=!1,this.menuAlignRight=!1,this.drop="down",this.close="default",this.menuRef=tt()}async _handleClick(e){if(this.disabled)return;const t=this._toggler[0];if(!t)return void this.toggleMenu();if(e.composedPath().includes(t))return void this.toggleMenu();if(!this.menuIsOpen)return;const l=this.menuRef.value;l&&e.composedPath().includes(l)||this.hideMenu()}_handleCloseMenu(){const e=this._toggler[0];null==e||e.focus()}async connectedCallback(){super.connectedCallback(),this.addEventListener("sgds-hide",this._handleCloseMenu)}async disconnectedCallback(){this.removeEventListener("sgds-hide",this._handleCloseMenu)}async firstUpdated(e){super.firstUpdated(e),this.menuIsOpen&&await this.updateFloatingPosition(),this._handleDisabled()}_handleTogglerSlotChange(e){const t=e.target.assignedElements({flatten:!0})[0];t&&(t.setAttribute("aria-haspopup","menu"),t.setAttribute("aria-expanded",String(this.menuIsOpen)))}_handleMenuIsOpenChange(){const e=this._toggler[0];e&&e.setAttribute("aria-expanded",String(this.menuIsOpen))}_handleDisabled(){const e=this._toggler[0];e&&(this.disabled?e.setAttribute("disabled","true"):e.hasAttribute("disabled")&&e.removeAttribute("disabled"))}render(){return se`
76
76
  <div class="dropdown" @click=${this._handleClick}>
77
77
  <div class="toggler-container" ${tt(this.myDropdown)}>
78
78
  <slot name="toggler" @slotchange=${this._handleTogglerSlotChange}></slot>