@nordhealth/components 4.19.0 → 4.20.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.
- package/custom-elements.json +3182 -2894
- package/lib/Calendar-B5X2WKNb.js +2 -0
- package/lib/Calendar-B5X2WKNb.js.map +1 -0
- package/lib/Calendar.js +1 -1
- package/lib/DatePicker.js +1 -1
- package/lib/Dropdown.js +1 -1
- package/lib/DropdownGroup.js +1 -1
- package/lib/DropdownGroup.js.map +1 -1
- package/lib/DropdownItem-Cp-z3XA9.js +2 -0
- package/lib/DropdownItem-Cp-z3XA9.js.map +1 -0
- package/lib/DropdownItem.js +1 -1
- package/lib/Header.js +1 -1
- package/lib/Header.js.map +1 -1
- package/lib/Input.js.map +1 -1
- package/lib/Layout.js +1 -1
- package/lib/Layout.js.map +1 -1
- package/lib/Message.js +1 -1
- package/lib/Message.js.map +1 -1
- package/lib/NavItem.js +1 -1
- package/lib/NavItem.js.map +1 -1
- package/lib/Navigation.js +1 -1
- package/lib/Navigation.js.map +1 -1
- package/lib/Select.js +1 -1
- package/lib/Select.js.map +1 -1
- package/lib/bundle.js +7 -7
- package/lib/bundle.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/src/calendar/Calendar.d.ts +15 -0
- package/lib/src/header/Header.d.ts +2 -0
- package/lib/src/input/Input.d.ts +1 -1
- package/lib/src/layout/Layout.d.ts +14 -0
- package/lib/src/nav-item/NavItem.d.ts +15 -0
- package/lib/src/navigation/Navigation.d.ts +7 -0
- package/package.json +3 -3
- package/lib/Calendar-20BBxuFj.js +0 -2
- package/lib/Calendar-20BBxuFj.js.map +0 -1
- package/lib/DropdownItem-tmJQrv7d.js +0 -2
- package/lib/DropdownItem-tmJQrv7d.js.map +0 -1
package/lib/bundle.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundle.js","sources":["../../../node_modules/.pnpm/@rollup+plugin-typescript@11.1.6_rollup@4.21.3_tslib@2.8.1_typescript@5.5.4/node_modules/tslib/tslib.es6.js","../../../node_modules/.pnpm/@lit+reactive-element@2.1.0/node_modules/@lit/reactive-element/css-tag.js","../../../node_modules/.pnpm/@lit+reactive-element@2.1.0/node_modules/@lit/reactive-element/reactive-element.js","../../../node_modules/.pnpm/lit-html@3.3.0/node_modules/lit-html/lit-html.js","../../../node_modules/.pnpm/lit-element@4.2.0/node_modules/lit-element/lit-element.js","../../../node_modules/.pnpm/@lit+reactive-element@2.1.0/node_modules/@lit/reactive-element/decorators/custom-element.js","../../../node_modules/.pnpm/@lit+reactive-element@2.1.0/node_modules/@lit/reactive-element/decorators/property.js","../../../node_modules/.pnpm/@lit+reactive-element@2.1.0/node_modules/@lit/reactive-element/decorators/state.js","../../../node_modules/.pnpm/@lit+reactive-element@2.1.0/node_modules/@lit/reactive-element/decorators/base.js","../../../node_modules/.pnpm/@lit+reactive-element@2.1.0/node_modules/@lit/reactive-element/decorators/query.js","../src/common/decorators/observe.ts","../src/common/fsm.ts","../src/visually-hidden/VisuallyHidden.ts","../../../node_modules/.pnpm/lit-html@3.3.0/node_modules/lit-html/directives/if-defined.js","../../../node_modules/.pnpm/lit-html@3.3.0/node_modules/lit-html/directive.js","../../../node_modules/.pnpm/lit-html@3.3.0/node_modules/lit-html/directives/unsafe-html.js","../src/common/directives/cond.ts","../src/icon/IconManager.ts","../src/icon/Icon.ts","../src/avatar/Avatar.ts","../src/badge/Badge.ts","../../icons/lib/assets/interface-checked-circle.js","../../icons/lib/assets/interface-help.js","../../icons/lib/assets/interface-info.js","../../icons/lib/assets/interface-warning.js","../src/banner/Banner.ts","../../../node_modules/.pnpm/lit-html@3.3.0/node_modules/lit-html/directives/class-map.js","../src/common/controllers/DirectionController.ts","../src/common/controllers/EventController.ts","../src/common/controllers/SlotController.ts","../src/button-group/ButtonGroup.ts","../../../node_modules/.pnpm/lit-html@3.3.0/node_modules/lit-html/directive-helpers.js","../../../node_modules/.pnpm/lit-html@3.3.0/node_modules/lit-html/async-directive.js","../../../node_modules/.pnpm/lit-html@3.3.0/node_modules/lit-html/directives/ref.js","../src/common/controllers/LightDomController.ts","../src/common/mixins/FocusableMixin.ts","../src/common/mixins/InputMixin.ts","../src/spinner/Spinner.ts","../src/button/Button.ts","../../icons/lib/assets/arrow-down-small.js","../../icons/lib/assets/arrow-left-small.js","../../icons/lib/assets/arrow-right-small.js","../../../node_modules/.pnpm/lit-html@3.3.0/node_modules/lit-html/directives/repeat.js","../../../node_modules/.pnpm/tinykeys@1.4.0/node_modules/tinykeys/dist/tinykeys.module.js","../src/common/collection.ts","../src/common/controllers/SwipeController.ts","../src/common/dates.ts","../src/common/number.ts","../src/calendar/localization.ts","../src/localization/en-us.ts","../src/command-menu/localization.ts","../src/date-picker/localization.ts","../src/modal/localization.ts","../src/nav-toggle/localization.ts","../src/textarea/localization.ts","../src/notification/localization.ts","../src/message/localization.ts","../src/tag/localization.ts","../src/localization/translation.ts","../src/localization/LocalizeController.ts","../src/common/events.ts","../src/calendar/DateSelectEvent.ts","../src/calendar/Calendar.ts","../src/card/Card.ts","../../icons/lib/assets/interface-checked-small.js","../../icons/lib/assets/interface-remove-small.js","../src/common/controllers/FormDataController.ts","../src/common/mixins/FormAssociatedMixin.ts","../src/common/mixins/SizeMixin.ts","../src/checkbox/Checkbox.ts","../../icons/lib/assets/keyboard-arrow-up-down.js","../../icons/lib/assets/keyboard-backspace.js","../../icons/lib/assets/keyboard-return.js","../src/common/controllers/ShortcutController.ts","../src/common/controllers/LightDismissController.ts","../src/common/focus.ts","../src/command-menu/KeyboardController.ts","../src/command-menu/SelectEvent.ts","../../icons/lib/assets/arrow-left.js","../../icons/lib/assets/arrow-right.js","../../icons/lib/assets/keyboard-option.js","../src/command-menu/CommandMenuAction.ts","../src/command-menu/CommandMenu.ts","../../icons/lib/assets/interface-calendar.js","../../icons/lib/assets/interface-close-small.js","../src/common/mixins/ReadonlyMixin.ts","../src/date-picker/date-adapter.ts","../../icons/lib/assets/navigation-search.js","../../../node_modules/.pnpm/lit-html@3.3.0/node_modules/lit-html/directives/style-map.js","../src/common/controllers/ResizeController.ts","../src/common/mixins/AutocompleteMixin.ts","../src/common/mixins/TextSelectableMixin.ts","../src/input/Input.ts","../src/common/input.ts","../src/common/form.ts","../../../node_modules/.pnpm/@floating-ui+utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs","../../../node_modules/.pnpm/@floating-ui+core@1.7.4/node_modules/@floating-ui/core/dist/floating-ui.core.mjs","../../../node_modules/.pnpm/@floating-ui+utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs","../../../node_modules/.pnpm/@floating-ui+dom@1.7.5/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs","../src/common/controllers/ScrollbarController.ts","../src/common/mixins/FloatingComponentMixin.ts","../src/common/positioning.ts","../src/popout/Popout.ts","../src/stack/Stack.ts","../src/date-picker/DatePicker.ts","../src/divider/Divider.ts","../src/footer/Footer.ts","../src/drawer/Drawer.ts","../src/dropdown-group/DropdownGroup.ts","../src/dropdown-item/DropdownItem.ts","../src/dropdown-submenu/DropdownSubmenu.ts","../src/dropdown/Dropdown.ts","../src/empty-state/EmptyState.ts","../src/fieldset/Fieldset.ts","../src/header/Header.ts","../../icons/lib/assets/navigation-toggle-lock.js","../src/common/controllers/BroadcastChannelController.ts","../src/common/storage.ts","../../icons/lib/assets/navigation-toggle.js","../src/nav-toggle/NavToggle.ts","../src/layout/Layout.ts","../src/message/Message.ts","../src/common/inert.ts","../src/common/controllers/FocusTrapController.ts","../src/modal/ModalController.ts","../src/modal/Modal.ts","../src/nav-group/NavGroup.ts","../src/nav-item/NavItem.ts","../src/navigation/Navigation.ts","../src/notification-group/NotificationGroup.ts","../src/common/mixins/NotificationMixin.ts","../src/notification/Notification.ts","../src/progress-bar/ProgressBar.ts","../src/progress/Progress.ts","../../../node_modules/.pnpm/qr@0.4.2/node_modules/qr/esm/index.js","../src/qrcode/Qrcode.ts","../src/common/controllers/LightSlotController.ts","../src/radio/Radio.ts","../src/common/directives/wrapIf.ts","../src/range/Range.ts","../src/segmented-control-item/SegmentedControlItem.ts","../src/segmented-control/SegmentedControl.ts","../../icons/lib/assets/interface-dropdown-small.js","../src/select/Select.ts","../src/skeleton/Skeleton.ts","../src/tab/Tab.ts","../src/tab-group/TabGroup.ts","../src/tab-panel/TabPanel.ts","../src/table/Table.ts","../src/tag-group/TagGroup.ts","../src/tag/Tag.ts","../src/textarea/Textarea.ts","../src/toast-group/ToastGroup.ts","../../icons/lib/assets/interface-close.js","../src/toast/Toast.ts","../src/toggle/Toggle.ts","../src/common/attribute.ts","../src/tooltip/Tooltip.ts","../src/top-bar/TopBar.ts"],"sourcesContent":["/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.unshift(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.unshift(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\r\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\r\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nvar ownKeys = function(o) {\r\n ownKeys = Object.getOwnPropertyNames || function (o) {\r\n var ar = [];\r\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\r\n return ar;\r\n };\r\n return ownKeys(o);\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n\r\nexport function __addDisposableResource(env, value, async) {\r\n if (value !== null && value !== void 0) {\r\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\r\n var dispose, inner;\r\n if (async) {\r\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\r\n dispose = value[Symbol.asyncDispose];\r\n }\r\n if (dispose === void 0) {\r\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\r\n dispose = value[Symbol.dispose];\r\n if (async) inner = dispose;\r\n }\r\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\r\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\r\n env.stack.push({ value: value, dispose: dispose, async: async });\r\n }\r\n else if (async) {\r\n env.stack.push({ async: true });\r\n }\r\n return value;\r\n\r\n}\r\n\r\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\r\n\r\nexport function __disposeResources(env) {\r\n function fail(e) {\r\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\r\n env.hasError = true;\r\n }\r\n var r, s = 0;\r\n function next() {\r\n while (r = env.stack.pop()) {\r\n try {\r\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\r\n if (r.dispose) {\r\n var result = r.dispose.call(r.value);\r\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n }\r\n else s |= 1;\r\n }\r\n catch (e) {\r\n fail(e);\r\n }\r\n }\r\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\r\n if (env.hasError) throw env.error;\r\n }\r\n return next();\r\n}\r\n\r\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\r\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\r\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\r\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\r\n });\r\n }\r\n return path;\r\n}\r\n\r\nexport default {\r\n __extends: __extends,\r\n __assign: __assign,\r\n __rest: __rest,\r\n __decorate: __decorate,\r\n __param: __param,\r\n __esDecorate: __esDecorate,\r\n __runInitializers: __runInitializers,\r\n __propKey: __propKey,\r\n __setFunctionName: __setFunctionName,\r\n __metadata: __metadata,\r\n __awaiter: __awaiter,\r\n __generator: __generator,\r\n __createBinding: __createBinding,\r\n __exportStar: __exportStar,\r\n __values: __values,\r\n __read: __read,\r\n __spread: __spread,\r\n __spreadArrays: __spreadArrays,\r\n __spreadArray: __spreadArray,\r\n __await: __await,\r\n __asyncGenerator: __asyncGenerator,\r\n __asyncDelegator: __asyncDelegator,\r\n __asyncValues: __asyncValues,\r\n __makeTemplateObject: __makeTemplateObject,\r\n __importStar: __importStar,\r\n __importDefault: __importDefault,\r\n __classPrivateFieldGet: __classPrivateFieldGet,\r\n __classPrivateFieldSet: __classPrivateFieldSet,\r\n __classPrivateFieldIn: __classPrivateFieldIn,\r\n __addDisposableResource: __addDisposableResource,\r\n __disposeResources: __disposeResources,\r\n __rewriteRelativeImportExtension: __rewriteRelativeImportExtension,\r\n};\r\n","/**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&\"adoptedStyleSheets\"in Document.prototype&&\"replace\"in CSSStyleSheet.prototype,s=Symbol(),o=new WeakMap;class n{constructor(t,e,o){if(this._$cssResult$=!0,o!==s)throw Error(\"CSSResult is not constructable. Use `unsafeCSS` or `css` instead.\");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const s=this.t;if(e&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=o.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&o.set(s,t))}return t}toString(){return this.cssText}}const r=t=>new n(\"string\"==typeof t?t:t+\"\",void 0,s),i=(t,...e)=>{const o=1===t.length?t[0]:e.reduce(((e,s,o)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if(\"number\"==typeof t)return t;throw Error(\"Value passed to 'css' function must be a 'css' function result: \"+t+\". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.\")})(s)+t[o+1]),t[0]);return new n(o,t,s)},S=(s,o)=>{if(e)s.adoptedStyleSheets=o.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const e of o){const o=document.createElement(\"style\"),n=t.litNonce;void 0!==n&&o.setAttribute(\"nonce\",n),o.textContent=e.cssText,s.appendChild(o)}},c=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e=\"\";for(const s of t.cssRules)e+=s.cssText;return r(e)})(t):t;export{n as CSSResult,S as adoptStyles,i as css,c as getCompatibleStyle,e as supportsAdoptingStyleSheets,r as unsafeCSS};\n//# sourceMappingURL=css-tag.js.map\n","import{getCompatibleStyle as t,adoptStyles as s}from\"./css-tag.js\";export{CSSResult,css,supportsAdoptingStyleSheets,unsafeCSS}from\"./css-tag.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const{is:i,defineProperty:e,getOwnPropertyDescriptor:h,getOwnPropertyNames:r,getOwnPropertySymbols:o,getPrototypeOf:n}=Object,a=globalThis,c=a.trustedTypes,l=c?c.emptyScript:\"\",p=a.reactiveElementPolyfillSupport,d=(t,s)=>t,u={toAttribute(t,s){switch(s){case Boolean:t=t?l:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,s){let i=t;switch(s){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},f=(t,s)=>!i(t,s),b={attribute:!0,type:String,converter:u,reflect:!1,useDefault:!1,hasChanged:f};Symbol.metadata??=Symbol(\"metadata\"),a.litPropertyMetadata??=new WeakMap;class y extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,s=b){if(s.state&&(s.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((s=Object.create(s)).wrapped=!0),this.elementProperties.set(t,s),!s.noAccessor){const i=Symbol(),h=this.getPropertyDescriptor(t,i,s);void 0!==h&&e(this.prototype,t,h)}}static getPropertyDescriptor(t,s,i){const{get:e,set:r}=h(this.prototype,t)??{get(){return this[s]},set(t){this[s]=t}};return{get:e,set(s){const h=e?.call(this);r?.call(this,s),this.requestUpdate(t,h,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??b}static _$Ei(){if(this.hasOwnProperty(d(\"elementProperties\")))return;const t=n(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(d(\"finalized\")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(d(\"properties\"))){const t=this.properties,s=[...r(t),...o(t)];for(const i of s)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const s=litPropertyMetadata.get(t);if(void 0!==s)for(const[t,i]of s)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[t,s]of this.elementProperties){const i=this._$Eu(t,s);void 0!==i&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(s){const i=[];if(Array.isArray(s)){const e=new Set(s.flat(1/0).reverse());for(const s of e)i.unshift(t(s))}else void 0!==s&&i.push(t(s));return i}static _$Eu(t,s){const i=s.attribute;return!1===i?void 0:\"string\"==typeof i?i:\"string\"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,s=this.constructor.elementProperties;for(const i of s.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return s(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,s,i){this._$AK(t,i)}_$ET(t,s){const i=this.constructor.elementProperties.get(t),e=this.constructor._$Eu(t,i);if(void 0!==e&&!0===i.reflect){const h=(void 0!==i.converter?.toAttribute?i.converter:u).toAttribute(s,i.type);this._$Em=t,null==h?this.removeAttribute(e):this.setAttribute(e,h),this._$Em=null}}_$AK(t,s){const i=this.constructor,e=i._$Eh.get(t);if(void 0!==e&&this._$Em!==e){const t=i.getPropertyOptions(e),h=\"function\"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:u;this._$Em=e,this[e]=h.fromAttribute(s,t.type)??this._$Ej?.get(e)??null,this._$Em=null}}requestUpdate(t,s,i){if(void 0!==t){const e=this.constructor,h=this[t];if(i??=e.getPropertyOptions(t),!((i.hasChanged??f)(h,s)||i.useDefault&&i.reflect&&h===this._$Ej?.get(t)&&!this.hasAttribute(e._$Eu(t,i))))return;this.C(t,s,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,s,{useDefault:i,reflect:e,wrapped:h},r){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,r??s??this[t]),!0!==h||void 0!==r)||(this._$AL.has(t)||(this.hasUpdated||i||(s=void 0),this._$AL.set(t,s)),!0===e&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,s]of this._$Ep)this[t]=s;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[s,i]of t){const{wrapped:t}=i,e=this[s];!0!==t||this._$AL.has(s)||void 0===e||this.C(s,void 0,i,e)}}let t=!1;const s=this._$AL;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(s)):this._$EM()}catch(s){throw t=!1,this._$EM(),s}t&&this._$AE(s)}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach((t=>this._$ET(t,this[t]))),this._$EM()}updated(t){}firstUpdated(t){}}y.elementStyles=[],y.shadowRootOptions={mode:\"open\"},y[d(\"elementProperties\")]=new Map,y[d(\"finalized\")]=new Map,p?.({ReactiveElement:y}),(a.reactiveElementVersions??=[]).push(\"2.1.0\");export{y as ReactiveElement,s as adoptStyles,u as defaultConverter,t as getCompatibleStyle,f as notEqual};\n//# sourceMappingURL=reactive-element.js.map\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst t=globalThis,i=t.trustedTypes,s=i?i.createPolicy(\"lit-html\",{createHTML:t=>t}):void 0,e=\"$lit$\",h=`lit$${Math.random().toFixed(9).slice(2)}$`,o=\"?\"+h,n=`<${o}>`,r=document,l=()=>r.createComment(\"\"),c=t=>null===t||\"object\"!=typeof t&&\"function\"!=typeof t,a=Array.isArray,u=t=>a(t)||\"function\"==typeof t?.[Symbol.iterator],d=\"[ \\t\\n\\f\\r]\",f=/<(?:(!--|\\/[^a-zA-Z])|(\\/?[a-zA-Z][^>\\s]*)|(\\/?$))/g,v=/-->/g,_=/>/g,m=RegExp(`>|${d}(?:([^\\\\s\"'>=/]+)(${d}*=${d}*(?:[^ \\t\\n\\f\\r\"'\\`<>=]|(\"|')|))|$)`,\"g\"),p=/'/g,g=/\"/g,$=/^(?:script|style|textarea|title)$/i,y=t=>(i,...s)=>({_$litType$:t,strings:i,values:s}),x=y(1),b=y(2),w=y(3),T=Symbol.for(\"lit-noChange\"),E=Symbol.for(\"lit-nothing\"),A=new WeakMap,C=r.createTreeWalker(r,129);function P(t,i){if(!a(t)||!t.hasOwnProperty(\"raw\"))throw Error(\"invalid template strings array\");return void 0!==s?s.createHTML(i):i}const V=(t,i)=>{const s=t.length-1,o=[];let r,l=2===i?\"<svg>\":3===i?\"<math>\":\"\",c=f;for(let i=0;i<s;i++){const s=t[i];let a,u,d=-1,y=0;for(;y<s.length&&(c.lastIndex=y,u=c.exec(s),null!==u);)y=c.lastIndex,c===f?\"!--\"===u[1]?c=v:void 0!==u[1]?c=_:void 0!==u[2]?($.test(u[2])&&(r=RegExp(\"</\"+u[2],\"g\")),c=m):void 0!==u[3]&&(c=m):c===m?\">\"===u[0]?(c=r??f,d=-1):void 0===u[1]?d=-2:(d=c.lastIndex-u[2].length,a=u[1],c=void 0===u[3]?m:'\"'===u[3]?g:p):c===g||c===p?c=m:c===v||c===_?c=f:(c=m,r=void 0);const x=c===m&&t[i+1].startsWith(\"/>\")?\" \":\"\";l+=c===f?s+n:d>=0?(o.push(a),s.slice(0,d)+e+s.slice(d)+h+x):s+h+(-2===d?i:x)}return[P(t,l+(t[s]||\"<?>\")+(2===i?\"</svg>\":3===i?\"</math>\":\"\")),o]};class N{constructor({strings:t,_$litType$:s},n){let r;this.parts=[];let c=0,a=0;const u=t.length-1,d=this.parts,[f,v]=V(t,s);if(this.el=N.createElement(f,n),C.currentNode=this.el.content,2===s||3===s){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(r=C.nextNode())&&d.length<u;){if(1===r.nodeType){if(r.hasAttributes())for(const t of r.getAttributeNames())if(t.endsWith(e)){const i=v[a++],s=r.getAttribute(t).split(h),e=/([.?@])?(.*)/.exec(i);d.push({type:1,index:c,name:e[2],strings:s,ctor:\".\"===e[1]?H:\"?\"===e[1]?I:\"@\"===e[1]?L:k}),r.removeAttribute(t)}else t.startsWith(h)&&(d.push({type:6,index:c}),r.removeAttribute(t));if($.test(r.tagName)){const t=r.textContent.split(h),s=t.length-1;if(s>0){r.textContent=i?i.emptyScript:\"\";for(let i=0;i<s;i++)r.append(t[i],l()),C.nextNode(),d.push({type:2,index:++c});r.append(t[s],l())}}}else if(8===r.nodeType)if(r.data===o)d.push({type:2,index:c});else{let t=-1;for(;-1!==(t=r.data.indexOf(h,t+1));)d.push({type:7,index:c}),t+=h.length-1}c++}}static createElement(t,i){const s=r.createElement(\"template\");return s.innerHTML=t,s}}function S(t,i,s=t,e){if(i===T)return i;let h=void 0!==e?s._$Co?.[e]:s._$Cl;const o=c(i)?void 0:i._$litDirective$;return h?.constructor!==o&&(h?._$AO?.(!1),void 0===o?h=void 0:(h=new o(t),h._$AT(t,s,e)),void 0!==e?(s._$Co??=[])[e]=h:s._$Cl=h),void 0!==h&&(i=S(t,h._$AS(t,i.values),h,e)),i}class M{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:i},parts:s}=this._$AD,e=(t?.creationScope??r).importNode(i,!0);C.currentNode=e;let h=C.nextNode(),o=0,n=0,l=s[0];for(;void 0!==l;){if(o===l.index){let i;2===l.type?i=new R(h,h.nextSibling,this,t):1===l.type?i=new l.ctor(h,l.name,l.strings,this,t):6===l.type&&(i=new z(h,this,t)),this._$AV.push(i),l=s[++n]}o!==l?.index&&(h=C.nextNode(),o++)}return C.currentNode=r,e}p(t){let i=0;for(const s of this._$AV)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,i),i+=s.strings.length-2):s._$AI(t[i])),i++}}class R{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,i,s,e){this.type=2,this._$AH=E,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=e,this._$Cv=e?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===t?.nodeType&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=S(this,t,i),c(t)?t===E||null==t||\"\"===t?(this._$AH!==E&&this._$AR(),this._$AH=E):t!==this._$AH&&t!==T&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):u(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==E&&c(this._$AH)?this._$AA.nextSibling.data=t:this.T(r.createTextNode(t)),this._$AH=t}$(t){const{values:i,_$litType$:s}=t,e=\"number\"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=N.createElement(P(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===e)this._$AH.p(i);else{const t=new M(e,this),s=t.u(this.options);t.p(i),this.T(s),this._$AH=t}}_$AC(t){let i=A.get(t.strings);return void 0===i&&A.set(t.strings,i=new N(t)),i}k(t){a(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let s,e=0;for(const h of t)e===i.length?i.push(s=new R(this.O(l()),this.O(l()),this,this.options)):s=i[e],s._$AI(h),e++;e<i.length&&(this._$AR(s&&s._$AB.nextSibling,e),i.length=e)}_$AR(t=this._$AA.nextSibling,i){for(this._$AP?.(!1,!0,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class k{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,i,s,e,h){this.type=1,this._$AH=E,this._$AN=void 0,this.element=t,this.name=i,this._$AM=e,this.options=h,s.length>2||\"\"!==s[0]||\"\"!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=E}_$AI(t,i=this,s,e){const h=this.strings;let o=!1;if(void 0===h)t=S(this,t,i,0),o=!c(t)||t!==this._$AH&&t!==T,o&&(this._$AH=t);else{const e=t;let n,r;for(t=h[0],n=0;n<h.length-1;n++)r=S(this,e[s+n],i,n),r===T&&(r=this._$AH[n]),o||=!c(r)||r!==this._$AH[n],r===E?t=E:t!==E&&(t+=(r??\"\")+h[n+1]),this._$AH[n]=r}o&&!e&&this.j(t)}j(t){t===E?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??\"\")}}class H extends k{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===E?void 0:t}}class I extends k{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==E)}}class L extends k{constructor(t,i,s,e,h){super(t,i,s,e,h),this.type=5}_$AI(t,i=this){if((t=S(this,t,i,0)??E)===T)return;const s=this._$AH,e=t===E&&s!==E||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,h=t!==E&&(s===E||e);e&&this.element.removeEventListener(this.name,this,s),h&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){\"function\"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class z{constructor(t,i,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){S(this,t)}}const Z={M:e,P:h,A:o,C:1,L:V,R:M,D:u,V:S,I:R,H:k,N:I,U:L,B:H,F:z},j=t.litHtmlPolyfillSupport;j?.(N,R),(t.litHtmlVersions??=[]).push(\"3.3.0\");const B=(t,i,s)=>{const e=s?.renderBefore??i;let h=e._$litPart$;if(void 0===h){const t=s?.renderBefore??null;e._$litPart$=h=new R(i.insertBefore(l(),t),t,void 0,s??{})}return h._$AI(t),h};export{Z as _$LH,x as html,w as mathml,T as noChange,E as nothing,B as render,b as svg};\n//# sourceMappingURL=lit-html.js.map\n","import{ReactiveElement as t}from\"@lit/reactive-element\";export*from\"@lit/reactive-element\";import{render as e,noChange as r}from\"lit-html\";export*from\"lit-html\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const s=globalThis;class i extends t{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=e(r,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return r}}i._$litElement$=!0,i[\"finalized\"]=!0,s.litElementHydrateSupport?.({LitElement:i});const o=s.litElementPolyfillSupport;o?.({LitElement:i});const n={_$AK:(t,e,r)=>{t._$AK(e,r)},_$AL:t=>t._$AL};(s.litElementVersions??=[]).push(\"4.2.0\");export{i as LitElement,n as _$LE};\n//# sourceMappingURL=lit-element.js.map\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst t=t=>(e,o)=>{void 0!==o?o.addInitializer((()=>{customElements.define(t,e)})):customElements.define(t,e)};export{t as customElement};\n//# sourceMappingURL=custom-element.js.map\n","import{defaultConverter as t,notEqual as e}from\"../reactive-element.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const o={attribute:!0,type:String,converter:t,reflect:!1,hasChanged:e},r=(t=o,e,r)=>{const{kind:n,metadata:i}=r;let s=globalThis.litPropertyMetadata.get(i);if(void 0===s&&globalThis.litPropertyMetadata.set(i,s=new Map),\"setter\"===n&&((t=Object.create(t)).wrapped=!0),s.set(r.name,t),\"accessor\"===n){const{name:o}=r;return{set(r){const n=e.get.call(this);e.set.call(this,r),this.requestUpdate(o,n,t)},init(e){return void 0!==e&&this.C(o,void 0,t,e),e}}}if(\"setter\"===n){const{name:o}=r;return function(r){const n=this[o];e.call(this,r),this.requestUpdate(o,n,t)}}throw Error(\"Unsupported decorator location: \"+n)};function n(t){return(e,o)=>\"object\"==typeof o?r(t,e,o):((t,e,o)=>{const r=e.hasOwnProperty(o);return e.constructor.createProperty(o,t),r?Object.getOwnPropertyDescriptor(e,o):void 0})(t,e,o)}export{n as property,r as standardProperty};\n//# sourceMappingURL=property.js.map\n","import{property as t}from\"./property.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */function r(r){return t({...r,state:!0,attribute:!1})}export{r as state};\n//# sourceMappingURL=state.js.map\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst e=(e,t,c)=>(c.configurable=!0,c.enumerable=!0,Reflect.decorate&&\"object\"!=typeof t&&Object.defineProperty(e,t,c),c);export{e as desc};\n//# sourceMappingURL=base.js.map\n","import{desc as t}from\"./base.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */function e(e,r){return(n,s,i)=>{const o=t=>t.renderRoot?.querySelector(e)??null;if(r){const{get:e,set:r}=\"object\"==typeof s?n:i??(()=>{const t=Symbol();return{get(){return this[t]},set(e){this[t]=e}}})();return t(n,s,{get(){let t=e.call(this);return void 0===t&&(t=o(this),(null!==t||this.hasUpdated)&&r.call(this,t)),t}})}return t(n,s,{get(){return o(this)}})}}export{e as query};\n//# sourceMappingURL=query.js.map\n","import type { ReactiveController, ReactiveElement } from 'lit'\n\ntype ObserveFunction = (oldValue: any, newValue: any, name: PropertyKey) => void\ntype ObserveLifecycle = 'update' | 'updated'\n\nclass PropertyObserverController<T extends ReactiveElement, TKey extends keyof T> implements ReactiveController {\n private _value?: T[TKey]\n\n constructor(\n private host: T,\n private key: TKey,\n private cb: ObserveFunction,\n private lifecycle: ObserveLifecycle,\n ) {\n host.addController(this)\n }\n\n hostUpdate() {\n if (this.lifecycle === 'update') {\n this.handle()\n }\n }\n\n hostUpdated() {\n if (this.lifecycle === 'updated') {\n this.handle()\n }\n }\n\n private handle() {\n const { key, _value, host } = this\n const newValue = host[key]\n\n if (_value !== newValue) {\n this._value = newValue\n this.cb.call(host, _value, newValue, key)\n }\n }\n}\n\nexport function observe(propertyName: string, lifecycle: ObserveLifecycle = 'update') {\n return function decorator(target: any, methodName: string) {\n const proto = target.constructor as typeof ReactiveElement\n\n proto.addInitializer((el) => {\n type Key = keyof typeof el\n const cb = el[methodName as Key] as ObserveFunction\n\n // since we can't get strong typing here, we can add a runtime check\n // this will get stripped out in prod, and should only ever happen in dev anyway\n if (process.env.NODE_ENV === 'development') {\n if (!(propertyName in el)) {\n throw new TypeError(\n `@observe: property '${propertyName}' does not exist.\\nPossible properties: ${Object.keys(target)\n .map(p => `'${p}'`)\n .join(', ')}`,\n )\n }\n }\n\n el.addController(new PropertyObserverController(el, propertyName as Key, cb, lifecycle))\n })\n }\n}\n","type EventsFromTransitions<T> = { [Prop in keyof T]: keyof T[Prop] }[keyof T]\n\nexport function fsm<\n TTransitions extends Record<TStates, Partial<Record<TEvents, TStates>>>,\n TStates extends keyof TTransitions,\n TEvents extends EventsFromTransitions<TTransitions>,\n>(config: TTransitions) {\n return {\n transition(currentState: TStates, event: TEvents) {\n const nextState = config[currentState][event] as TStates\n return nextState || currentState\n },\n }\n}\n\nexport type Machine = ReturnType<typeof fsm>\n\nexport type States<T extends Machine | Machine['transition']> = T extends Machine\n ? Parameters<T['transition']>[0]\n : T extends Machine['transition']\n ? Parameters<T>[0]\n : never\n\nexport type Events<T extends Machine | Machine['transition']> = T extends Machine\n ? Parameters<T['transition']>[1]\n : T extends Machine['transition']\n ? Parameters<T>[1]\n : never\n","import { html, LitElement } from 'lit'\nimport { customElement } from 'lit/decorators.js'\nimport style from './VisuallyHidden.css'\n\n/**\n * Visually hidden is used when an element needs to be available\n * to assistive technologies like screen readers, but be otherwise\n * hidden.\n *\n * @status ready\n * @category text\n * @slot - The visually hidden content.\n */\n@customElement('nord-visually-hidden')\nexport default class VisuallyHidden extends LitElement {\n static styles = style\n\n render() {\n return html`<slot></slot>`\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-visually-hidden': VisuallyHidden\n }\n}\n","import{nothing as t}from\"../lit-html.js\";\n/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const o=o=>o??t;export{o as ifDefined};\n//# sourceMappingURL=if-defined.js.map\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst t={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},e=t=>(...e)=>({_$litDirective$:t,values:e});class i{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}export{i as Directive,t as PartType,e as directive};\n//# sourceMappingURL=directive.js.map\n","import{nothing as t,noChange as i}from\"../lit-html.js\";import{Directive as r,PartType as s,directive as n}from\"../directive.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */class e extends r{constructor(i){if(super(i),this.it=t,i.type!==s.CHILD)throw Error(this.constructor.directiveName+\"() can only be used in child bindings\")}render(r){if(r===t||null==r)return this._t=void 0,this.it=r;if(r===i)return r;if(\"string\"!=typeof r)throw Error(this.constructor.directiveName+\"() called with a non-string value\");if(r===this.it)return this._t;this.it=r;const s=[r];return s.raw=s,this._t={_$litType$:this.constructor.resultType,strings:s,values:[]}}}e.directiveName=\"unsafeHTML\",e.resultType=1;const o=n(e);export{e as UnsafeHTMLDirective,o as unsafeHTML};\n//# sourceMappingURL=unsafe-html.js.map\n","import { nothing } from 'lit'\n\n// NOTE: the below generic versions cannot be used until this bug is fixed: https://github.com/runem/lit-analyzer/issues/207\n// since lit-analyzer does not understand the use of nothing\n\n// /**\n// * if value is truthy, return it, otherwise return nothing\n// */\n// export function cond<T>(value: T): NonNullable<T> | typeof nothing\n\n// /**\n// * if condition is truthy, return trueCase, otherwise return nothing\n// */\n// export function cond<T>(condition: unknown, trueCase: T): T | typeof nothing\n\n// /**\n// * condition is true, so always return trueCase\n// */\n// export function cond<T>(condition: true, trueCase: T): T\n\n// /**\n// * condition is false, to will always return nothing\n// */\n// export function cond<T>(condition: false, trueCase: T): typeof nothing\n\n// /**\n// * if condition is truthy, return trueCase, otherwise return falseCase\n// */\n// export function cond<T, F>(condition: unknown, trueCase: T, falseCase: F): T | F\n\n// /**\n// * condition is true, so always return trueCase\n// */\n// export function cond<T, F>(condition: true, trueCase: T, falseCase: F): T\n\n// /**\n// * condition is false, so always return falseCase\n// */\n// export function cond<T, F>(condition: false, trueCase: T, falseCase: F): F\n\n/**\n * if value is truthy, return it, otherwise return nothing\n */\nexport function cond(value: any): typeof value | typeof nothing\n\n/**\n * if condition is truthy, return trueCase, otherwise return nothing\n */\nexport function cond(condition: unknown, trueCase: any): typeof trueCase | typeof nothing\n\n/**\n * condition is true, so always return trueCase\n */\nexport function cond(condition: true, trueCase: any): typeof trueCase\n\n/**\n * condition is false, to will always return nothing\n */\nexport function cond(condition: false, trueCase: any): typeof nothing\n\n/**\n * if condition is truthy, return trueCase, otherwise return falseCase\n */\nexport function cond(condition: unknown, trueCase: any, falseCase: any): typeof trueCase | typeof falseCase\n\n/**\n * condition is true, so always return trueCase\n */\nexport function cond(condition: true, trueCase: any, falseCase: any): typeof trueCase\n\n/**\n * condition is false, so always return falseCase\n */\nexport function cond(condition: false, trueCase: any, falseCase: any): typeof falseCase\n\nexport function cond(condition: unknown, trueCase: any = condition, falseCase: any = nothing) {\n return condition ? trueCase : falseCase\n}\n","export type IconResolver = (iconName: string) => Promise<string>\n\n// in dev we should just load from node_modules\nconst loadIcon: IconResolver = (name: string) =>\n import(/* @vite-ignore */ `@nordhealth/icons/lib/assets/${name}.js`).then(({ default: svg }) => svg)\n\n// in prod we should load from the CDN, as a sensible default\nconst loadIconCdn: IconResolver = (name: string) =>\n fetch(`https://nordcdn.net/ds/icons/${process.env.ICON_VERSION}/assets/${name}.svg`).then((response) => {\n if (!response.ok) {\n throw new TypeError(`NORD: unknown icon: '${name}'`)\n }\n\n return response.text()\n })\n\nexport class IconManager {\n private cache = new Map<string, string | Promise<string>>()\n resolver: IconResolver = process.env.NODE_ENV === 'development' ? loadIcon : loadIconCdn\n\n resolve(name: string, onResolved: (svg: string) => void) {\n let cached = this.cache.get(name)\n\n // if it's a string, we can resolve immediately\n if (typeof cached === 'string') {\n onResolved(cached)\n return\n }\n\n // if it's null, then we should initiate a fetch\n if (!cached) {\n cached = this.resolver(name)\n .catch(() => '')\n .then((svg) => {\n // replace the promise with the resolved value, for faster resolution next time\n this.cache.set(name, svg)\n return svg\n })\n\n // store the promise so that duplicate icons do not make separate requests\n this.cache.set(name, cached)\n }\n\n cached.then(onResolved)\n }\n\n registerIcon(iconOrName: string | { title: string, default: string }, icon?: string) {\n let name: string | undefined\n let svg: string | undefined\n\n if (typeof iconOrName === 'string') {\n name = iconOrName\n svg = icon\n }\n else {\n name = iconOrName.title\n svg = iconOrName.default\n }\n\n // handle errors\n if (!name) {\n throw new Error('name is required when registering an icon')\n }\n if (!svg) {\n throw new Error('icon must not be empty')\n }\n\n this.cache.set(name, svg)\n }\n\n clear() {\n this.cache.clear()\n }\n}\n","import type { IconResolver } from './IconManager.js'\nimport { html, LitElement } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js'\nimport { observe } from '../common/decorators/observe.js'\n\nimport { cond } from '../common/directives/cond.js'\nimport componentStyle from '../common/styles/Component.css'\nimport style from './Icon.css'\nimport { IconManager } from './IconManager.js'\n\n/**\n * Icons are used to provide additional meaning or in places where text label doesn’t fit.\n * Icon component allows you to display an icon from the Nordicons library.\n *\n * @status ready\n * @category image\n * @slot - The default slot used for placing a custom SVG icon.\n */\n@customElement('nord-icon')\nexport default class Icon extends LitElement {\n static styles = [componentStyle, style]\n\n private static manager = new IconManager()\n\n /**\n * Register a custom icon resolver, which accepts the icon name as an parameter, and returns an SVG string.\n * Can return a string synchronously, or a promise of a string.\n * By default, will load icons from the Nord CDN.\n * @param resolver The resolver function to register.\n */\n static registerResolver(resolver: IconResolver) {\n this.manager.resolver = resolver\n }\n\n /**\n * Register an individual icon so it can be rendered synchronously, to avoid loading over the network.\n * @param icon An object representing the icon to be registered, where \"title\" is the icon's name, and \"default\" is the SVG string.\n * This is intended to be used in cases where you import an icon's entire ES module and register it directly.\n */\n static registerIcon(icon: { title: string, default: string }): void\n\n /**\n * Register an individual icon so it can be rendered synchronously, to avoid loading over the network.\n * @param name The name of the icon to be registered.\n * @param icon The SVG string for the icon.\n */\n static registerIcon(name: string, icon: string): void\n\n /**\n * Register an individual icon so it can be rendered synchronously, to avoid loading over the network.\n * @param iconOrName The name of the icon to be registered or an object representing the icon to be registered, where \"title\" is the icon's name, and \"default\" is the SVG string.\n * @param icon The SVG string for the icon.\n */\n static registerIcon(iconOrName: string | { title: string, default: string }, icon?: string) {\n return this.manager.registerIcon(iconOrName, icon)\n }\n\n /**\n * The name of the icon to display, as defined by [nordicons](/nordicons/).\n */\n @property({ reflect: true }) name: string = ''\n\n /**\n * The size of the icon.\n * @default \"m\"\n */\n @property({ reflect: true }) size?: 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl'\n\n /**\n * The color of the icon.\n * Can accept any valid CSS color value, including custom properties.\n */\n @property({ reflect: true }) color?: string\n\n /**\n * An accessible label for the icon.\n * If no label is supplied, the icon is hidden from assistive technology.\n */\n @property({ reflect: true }) label?: string\n\n @state() private svg: string = ''\n\n render() {\n // if a label is supplied, we give the div a role of img.\n // without this we could not use aria-label, since it is only valid on elements of certain roles.\n // we always hide the inner svg, since the svg does not have any text/title/label itself.\n return html`\n <div\n role=${cond(this.label, 'img')}\n style=${cond(this.color, `color:${this.color}`)}\n aria-label=${ifDefined(this.label)}\n >\n <slot aria-hidden=\"true\"></slot>\n <div aria-hidden=\"true\">${unsafeHTML(this.svg)}</div>\n </div>\n `\n }\n\n @observe('name')\n protected handleNameChange() {\n if (!this.name) {\n this.svg = ''\n return\n }\n\n Icon.manager.resolve(this.name, (svg) => {\n this.svg = svg\n })\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-icon': Icon\n }\n}\n","import type { States } from '../common/fsm.js'\nimport { html, LitElement, nothing } from 'lit'\n\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { observe } from '../common/decorators/observe.js'\nimport { fsm } from '../common/fsm.js'\nimport componentStyle from '../common/styles/Component.css'\nimport style from './Avatar.css'\nimport '../visually-hidden/VisuallyHidden.js'\nimport '../icon/Icon.js'\n\nconst { transition } = fsm({\n initial: {\n 'src-set': 'loading',\n },\n loading: {\n 'load': 'loaded',\n 'error': 'initial',\n 'src-clear': 'initial',\n },\n loaded: {\n 'src-set': 'loading',\n 'src-clear': 'initial',\n },\n})\n\n/**\n * Avatar is used for showing a thumbnail representation of a single user or entity.\n * Default avatar illustration is displayed when no src is specified.\n *\n * @status ready\n * @category image\n *\n * @cssprop [--n-avatar-color=var(--n-color-status-highlight)] - Controls the color of the avatar fallback, using [color tokens](/tokens/#color).\n * @cssprop [--n-avatar-size=var(--n-size-icon-l)] - Controls the size of the avatar, using [icon sizing tokens](/tokens/#size).\n * @cssprop [--n-avatar-box-shadow=none] - Controls the box shadow for the avatar.\n * @cssprop [--n-avatar-text-color=var(--n-color-text-on-accent)] - Controls the color of the avatar’s text and icon, using [color tokens](/tokens/#color).\n */\n\n@customElement('nord-avatar')\nexport default class Avatar extends LitElement {\n static styles = [componentStyle, style]\n\n @state() private state: States<typeof transition> = 'initial'\n\n /**\n * The size of the avatar.\n */\n @property({ reflect: true }) size: 's' | 'm' | 'l' | 'xl' | 'xxl' | 'xxxl' = 'm'\n\n /**\n * The URL of the avatar image uploaded by the user.\n */\n @property({ reflect: true }) src?: string\n\n /**\n * The name of the person or entity.\n */\n @property({ reflect: true }) name: string = ''\n\n /**\n * The fallback icon.\n */\n @property({ reflect: true }) icon?: string\n\n /**\n * The style variant of the avatar.\n */\n @property({ reflect: true }) variant: 'default' | 'square' = 'default'\n\n render() {\n return html`\n <div class=\"n-avatar\">\n ${this.state !== 'initial' ? this.renderImage() : nothing}\n ${this.state !== 'loaded' ? this.renderFallback() : nothing}\n </div>\n `\n }\n\n @observe('src')\n protected handleSrcChange() {\n const event = this.src ? 'src-set' : 'src-clear'\n this.state = transition(this.state, event)\n }\n\n protected renderImage() {\n return this.src\n ? html`\n <slot hidden></slot>\n <img\n class=\"n-${this.state}\"\n src=${this.src}\n @load=${this.handleLoad}\n @error=${this.handleError}\n alt=${this.name || ''}\n />\n `\n : nothing\n }\n\n protected renderFallback() {\n return html`\n <nord-visually-hidden>${this.name}</nord-visually-hidden>\n <div class=\"n-avatar-inner\" aria-hidden=\"true\">\n <slot></slot>\n </div>\n ${this.icon\n ? html`<nord-icon name=\"${this.icon}\"></nord-icon>`\n : html`\n <svg aria-hidden=\"true\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 27 27\">\n <rect fill=\"var(--_n-avatar-color)\" height=\"27\" rx=\"12\" width=\"27\" x=\"0\" y=\"0\"></rect>\n <g fill=\"#fff\" opacity=\".7\">\n <circle cx=\"13.5\" cy=\"30\" r=\"13\"></circle>\n <circle cx=\"13.5\" cy=\"11\" r=\"5\"></circle>\n </g>\n </svg>\n `}\n `\n }\n\n private handleLoad() {\n this.state = transition(this.state, 'load')\n }\n\n private handleError() {\n this.state = transition(this.state, 'error')\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-avatar': Avatar\n }\n}\n","import { html, LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport componentStyle from '../common/styles/Component.css'\nimport style from './Badge.css'\n\n/**\n * Badges are used to inform users of the status of an object\n * or of an action that’s been taken. Commonly used in tabular\n * data to indicate status.\n *\n * @status ready\n * @category text\n * @slot - The badge content.\n * @slot icon - Used to place an icon at the start of badge.\n */\n@customElement('nord-badge')\nexport default class Badge extends LitElement {\n static styles = [componentStyle, style]\n\n /**\n * The type of badge.\n * Determines the background color of the badge.\n * @deprecated Use `variant` instead. If you previously used `\"progress\"`, use `\"info\"` instead.\n * @default \"neutral\"\n */\n @property({ reflect: true }) type?: 'warning' | 'success' | 'danger' | 'highlight' | 'info' | 'neutral' | 'progress'\n\n /**\n * The style variant of the badge.\n * Determines the background color of the badge.\n * @default \"neutral\"\n */\n @property({ reflect: true }) variant?: 'warning' | 'success' | 'danger' | 'highlight' | 'neutral' | 'info'\n\n /**\n * Strong badges are a secondary style for badges.\n * They provide more visual prominence and emphasize them.\n */\n @property({ reflect: true, type: Boolean }) strong = false\n\n render() {\n return html`\n <span class=\"n-badge\">\n <slot name=\"icon\"></slot>\n <slot></slot>\n </span>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-badge': Badge\n }\n}\n","export default '<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m13.3 6.38 1.49 1.33-5.32 5.95c-.18.21-.44.33-.72.33 0 0-.02 0-.03 0-.26 0-.52-.1-.71-.29l-2.86-2.86 1.41-1.41 2.12 2.12 4.61-5.17zm6.7 3.62c0 5.51-4.49 10-10 10s-10-4.49-10-10 4.49-10 10-10 10 4.49 10 10zm-2 0c0-4.41-3.59-8-8-8s-8 3.59-8 8 3.59 8 8 8 8-3.59 8-8z\" fill=\"currentColor\"/></svg>';\nexport const title = \"interface-checked-circle\";\nexport const tags =\n \"nordicon interface circle round checked checkmark ready done success\";\n","export default '<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m11.15 15c0 .64-.51 1.15-1.15 1.15s-1.15-.51-1.15-1.15.51-1.15 1.15-1.15 1.15.51 1.15 1.15zm8.85-5c0 5.51-4.49 10-10 10s-10-4.49-10-10 4.49-10 10-10 10 4.49 10 10zm-2 0c0-4.41-3.59-8-8-8s-8 3.59-8 8 3.59 8 8 8 8-3.59 8-8zm-8-5.5c-1.93 0-3.5 1.57-3.5 3.5h2c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5-.67 1.5-1.5 1.5c-.55 0-1 .45-1 1v1.5h2v-.65c1.44-.43 2.5-1.77 2.5-3.35 0-1.93-1.57-3.5-3.5-3.5z\" fill=\"currentColor\"/></svg>';\nexport const title = \"interface-help\";\nexport const tags =\n \"nordicon interface help speech bubble support circle round question mark\";\n","export default '<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m8.7 6c0-.72.58-1.3 1.3-1.3s1.3.58 1.3 1.3-.58 1.3-1.3 1.3-1.3-.58-1.3-1.3zm-8.7 4c0-5.51 4.49-10 10-10s10 4.49 10 10-4.49 10-10 10-10-4.49-10-10zm2 0c0 4.41 3.59 8 8 8s8-3.59 8-8-3.59-8-8-8-8 3.59-8 8zm7 5h2v-6h-2z\" fill=\"currentColor\"/></svg>';\nexport const title = \"interface-info\";\nexport const tags =\n \"nordicon interface info circle round alert notice information\";\n","export default '<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m11.1502 13c0 .64-.51 1.15-1.15 1.15-.63998 0-1.14998-.51-1.14998-1.15s.51-1.15 1.14998-1.15c.64 0 1.15.51 1.15 1.15zm-2.14998-2h1.99998v-5h-1.99998zm10.51998 6.01c-.36.62-1.01.99-1.73.99h-15.58998c-.72 0-1.360004-.37-1.730004-.99-.36-.62-.37-1.36-.02-1.99l7.800004-13.95c.36-.629997 1.03-1.0199969 1.74998-1.0199969.72 0 1.39.3899999 1.75 1.0199969l7.8 13.95c.35.63.34 1.37-.02 1.99zm-1.72-1.01-7.8-13.95-7.79998 13.95z\" fill=\"currentColor\"/></svg>';\nexport const title = \"interface-warning\";\nexport const tags =\n \"nordicon interface warning exclamation mark triangle shape alert error\";\n","import * as successIcon from '@nordhealth/icons/lib/assets/interface-checked-circle.js'\nimport * as warningIcon from '@nordhealth/icons/lib/assets/interface-help.js'\nimport * as infoIcon from '@nordhealth/icons/lib/assets/interface-info.js'\nimport * as dangerIcon from '@nordhealth/icons/lib/assets/interface-warning.js'\nimport { html, LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport componentStyle from '../common/styles/Component.css'\n\nimport Icon from '../icon/Icon.js'\nimport style from './Banner.css'\n\nIcon.registerIcon(warningIcon)\nIcon.registerIcon(dangerIcon)\nIcon.registerIcon(infoIcon)\nIcon.registerIcon(successIcon)\n\nconst iconMap: Record<Banner['variant'], string> = {\n warning: warningIcon.title,\n danger: dangerIcon.title,\n info: infoIcon.title,\n success: successIcon.title,\n}\n\n/**\n * Banner informs users about important changes or conditions in the\n * interface. Use this component if you need to communicate to users\n * in a prominent way.\n *\n * @status ready\n * @category feedback\n * @slot - default slot\n *\n * @cssprop [--n-banner-border-radius=var(--n-border-radius)] - Controls how rounded the corners are, using [border radius tokens](/tokens/#border-radius).\n * @cssprop [--n-banner-box-shadow=var(--n-box-shadow-card)] - Controls the surrounding shadow, using [box shadow tokens](/tokens/#box-shadow).\n */\n@customElement('nord-banner')\nexport default class Banner extends LitElement {\n static styles = [componentStyle, style]\n\n /**\n * The style variant of the banner.\n */\n @property({ reflect: true }) variant: 'info' | 'danger' | 'success' | 'warning' = 'info'\n\n render() {\n const icon = iconMap[this.variant] || iconMap.info\n\n return html`\n <div class=\"n-banner\" role=\"alert\">\n <nord-stack align-items=\"start\" direction=\"horizontal\">\n <nord-icon name=${icon} size=\"m\"></nord-icon>\n <div class=\"n-banner-content\">\n <slot></slot>\n </div>\n </nord-stack>\n </div>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-banner': Banner\n }\n}\n","import{noChange as t}from\"../lit-html.js\";import{directive as s,Directive as i,PartType as r}from\"../directive.js\";\n/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const e=s(class extends i{constructor(t){if(super(t),t.type!==r.ATTRIBUTE||\"class\"!==t.name||t.strings?.length>2)throw Error(\"`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.\")}render(t){return\" \"+Object.keys(t).filter((s=>t[s])).join(\" \")+\" \"}update(s,[i]){if(void 0===this.st){this.st=new Set,void 0!==s.strings&&(this.nt=new Set(s.strings.join(\" \").split(/\\s/).filter((t=>\"\"!==t))));for(const t in i)i[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(i)}const r=s.element.classList;for(const t of this.st)t in i||(r.remove(t),this.st.delete(t));for(const t in i){const s=!!i[t];s===this.st.has(t)||this.nt?.has(t)||(s?(r.add(t),this.st.add(t)):(r.remove(t),this.st.delete(t)))}return t}});export{e as classMap};\n//# sourceMappingURL=class-map.js.map\n","import type { ReactiveController, ReactiveControllerHost } from 'lit'\nimport { isServer } from 'lit'\n\nexport type WritingDirection = 'ltr' | 'rtl'\n\nexport class DirectionController implements ReactiveController {\n // these are all static as we only want a single observer on <html>\n private static hosts = new Set<ReactiveControllerHost>()\n private static observer?: MutationObserver\n\n get dir(): WritingDirection {\n if (!isServer && document.documentElement.dir) {\n return document.documentElement.dir as WritingDirection\n }\n\n return 'ltr'\n }\n\n get isLTR() {\n return this.dir === 'ltr'\n }\n\n get isRTL() {\n return this.dir === 'rtl'\n }\n\n constructor(private host: ReactiveControllerHost) {\n this.host.addController(this)\n }\n\n hostConnected() {\n if (!DirectionController.observer) {\n DirectionController.observer = new MutationObserver(DirectionController.observe)\n DirectionController.observer.observe(document.documentElement, { attributes: true, attributeFilter: ['dir'] })\n }\n\n if (!DirectionController.hosts.has(this.host)) {\n DirectionController.hosts.add(this.host)\n }\n }\n\n hostDisconnected() {\n DirectionController.hosts.delete(this.host)\n }\n\n private static observe() {\n DirectionController.hosts.forEach(host => host.requestUpdate())\n }\n}\n","import type { ReactiveController, ReactiveControllerHost } from 'lit'\n\ninterface ShadowRootEventMap {\n slotchange: Event\n}\n\nexport class EventController implements ReactiveController {\n private listeners: Array<() => void> = []\n\n constructor(host: ReactiveControllerHost) {\n host.addController(this)\n }\n\n hostDisconnected() {\n this.listeners.forEach(stop => stop())\n this.listeners = []\n }\n\n listen<K extends keyof WindowEventMap>(\n window: Window,\n type: K,\n listener: (this: Window, ev: WindowEventMap[K]) => void,\n options?: boolean | AddEventListenerOptions\n ): void\n\n listen<K extends keyof DocumentEventMap>(\n document: Document,\n type: K,\n listener: (this: Document, ev: DocumentEventMap[K]) => void,\n options?: boolean | AddEventListenerOptions\n ): void\n\n listen<K extends keyof HTMLElementEventMap>(\n element: HTMLElement,\n type: K,\n listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => void,\n options?: boolean | AddEventListenerOptions\n ): void\n\n listen<K extends keyof ShadowRootEventMap>(\n element: ShadowRoot,\n type: K,\n listener: (this: ShadowRoot, ev: ShadowRootEventMap[K]) => void,\n options?: boolean | AddEventListenerOptions\n ): void\n\n listen<K extends keyof MediaQueryListEventMap>(\n element: MediaQueryList,\n type: K,\n listener: (this: ShadowRoot, ev: MediaQueryListEventMap[K]) => void,\n options?: boolean | AddEventListenerOptions\n ): void\n\n listen(\n element: EventTarget,\n type: string,\n listener: (this: EventTarget, ev: Event) => void,\n options?: boolean | AddEventListenerOptions\n ): void\n\n listen(\n element: EventTarget,\n type: string,\n listener: (this: EventTarget, ev: Event) => void,\n options?: boolean | AddEventListenerOptions,\n ) {\n element?.addEventListener(type, listener, options)\n\n const stop = () => element?.removeEventListener(type, listener, options)\n this.listeners.push(stop)\n }\n}\n","import type { ReactiveController, ReactiveControllerHost } from 'lit'\nimport { isServer } from 'lit'\nimport { EventController } from './EventController.js'\n\nexport class SlotController implements ReactiveController {\n private events: EventController\n private selector: string\n\n constructor(\n protected host: ReactiveControllerHost & HTMLElement,\n public slotName: string = '',\n ) {\n host.addController(this)\n this.events = new EventController(host)\n this.selector = slotName ? `:scope > [slot=\"${slotName}\"]` : `:scope > :not([slot])`\n }\n\n hostConnected() {\n if (this.host.shadowRoot) {\n this.events.listen(this.host.shadowRoot, 'slotchange', this.handleSlotChange)\n }\n }\n\n get hasContent() {\n return this.content != null\n }\n\n get isEmpty() {\n return !this.hasContent\n }\n\n get content() {\n if (isServer) {\n return null\n }\n\n return this.host.querySelector(this.selector)\n }\n\n get assigned() {\n if (isServer) {\n return []\n }\n\n return Array.from(this.host.querySelectorAll(this.selector))\n }\n\n private handleSlotChange = (e: Event) => {\n const slot = e.target as HTMLSlotElement\n\n if (slot.name === this.slotName) {\n this.onChange(e)\n }\n }\n\n protected onChange(_e: Event) {\n this.host.requestUpdate()\n }\n}\n","import { html, LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { classMap } from 'lit/directives/class-map.js'\nimport { DirectionController } from '../common/controllers/DirectionController.js'\nimport { SlotController } from '../common/controllers/SlotController.js'\nimport componentStyle from '../common/styles/Component.css'\nimport style from './ButtonGroup.css'\n\n/**\n * Button groups are designed to bring together button controls that are of a similar nature. For example text formatting controls.\n *\n * @status ready\n * @category structure\n * @slot - The button group content\n *\n * @cssprop [--n-button-group-border-radius=var(--n-border-radius-s)] - Controls the rounded corners of the button group, using [border radius tokens](/tokens/#border-radius). Only relevant for the default variant.\n * @cssprop [--n-button-group-box-shadow=var(--n-box-shadow)] - Controls the surrounding shadow, using [box shadow tokens](/tokens/#box-shadow). Only relevant for the default variant.\n */\n@customElement('nord-button-group')\nexport default class ButtonGroup extends LitElement {\n static styles = [componentStyle, style]\n\n private defaultSlot = new SlotController(this)\n private dirController = new DirectionController(this)\n\n /**\n * The style variant of the button group.\n */\n @property({ reflect: true }) variant: 'default' | 'spaced' = 'default'\n\n /**\n * The direction of the button group.\n */\n @property({ reflect: true }) direction: 'vertical' | 'horizontal' = 'horizontal'\n\n /**\n * Defines whether the buttons are forced in a single line\n * or can be flowed into multiple lines (only applied when variant is set to `spaced`).\n */\n @property({ reflect: true, type: Boolean }) wrap = false\n\n /**\n * The appropriate role for the containing element.\n */\n\n @property({ reflect: true }) role: string = 'group'\n\n render() {\n const hasSmallButtons = this.defaultSlot.assigned.every((node) => {\n if (node.localName === 'nord-button' || node.localName === 'nord-select') {\n return node.getAttribute('size') === 's'\n }\n\n return true\n })\n\n const hasMultipleButtons = this.defaultSlot.assigned.length > 1\n\n return html`\n <div\n class=${classMap({\n 'n-button-group': true,\n 'n-rtl': this.dirController.isRTL,\n 'n-small-gap': hasSmallButtons && this.variant === 'spaced',\n 'n-multiple-buttons': hasMultipleButtons,\n })}\n >\n <slot></slot>\n </div>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-button-group': ButtonGroup\n }\n}\n","import{_$LH as o}from\"./lit-html.js\";\n/**\n * @license\n * Copyright 2020 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const{I:t}=o,i=o=>null===o||\"object\"!=typeof o&&\"function\"!=typeof o,n={HTML:1,SVG:2,MATHML:3},e=(o,t)=>void 0===t?void 0!==o?._$litType$:o?._$litType$===t,l=o=>null!=o?._$litType$?.h,c=o=>void 0!==o?._$litDirective$,d=o=>o?._$litDirective$,f=o=>void 0===o.strings,s=()=>document.createComment(\"\"),r=(o,i,n)=>{const e=o._$AA.parentNode,l=void 0===i?o._$AB:i._$AA;if(void 0===n){const i=e.insertBefore(s(),l),c=e.insertBefore(s(),l);n=new t(i,c,o,o.options)}else{const t=n._$AB.nextSibling,i=n._$AM,c=i!==o;if(c){let t;n._$AQ?.(o),n._$AM=o,void 0!==n._$AP&&(t=o._$AU)!==i._$AU&&n._$AP(t)}if(t!==l||c){let o=n._$AA;for(;o!==t;){const t=o.nextSibling;e.insertBefore(o,l),o=t}}}return n},v=(o,t,i=o)=>(o._$AI(t,i),o),u={},m=(o,t=u)=>o._$AH=t,p=o=>o._$AH,M=o=>{o._$AP?.(!1,!0);let t=o._$AA;const i=o._$AB.nextSibling;for(;t!==i;){const o=t.nextSibling;t.remove(),t=o}},h=o=>{o._$AR()};export{n as TemplateResultType,h as clearPart,p as getCommittedValue,d as getDirectiveClass,r as insertPart,l as isCompiledTemplateResult,c as isDirectiveResult,i as isPrimitive,f as isSingleExpression,e as isTemplateResult,M as removePart,v as setChildPartValue,m as setCommittedValue};\n//# sourceMappingURL=directive-helpers.js.map\n","import{isSingleExpression as i}from\"./directive-helpers.js\";import{Directive as t,PartType as e}from\"./directive.js\";export{directive}from\"./directive.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const s=(i,t)=>{const e=i._$AN;if(void 0===e)return!1;for(const i of e)i._$AO?.(t,!1),s(i,t);return!0},o=i=>{let t,e;do{if(void 0===(t=i._$AM))break;e=t._$AN,e.delete(i),i=t}while(0===e?.size)},r=i=>{for(let t;t=i._$AM;i=t){let e=t._$AN;if(void 0===e)t._$AN=e=new Set;else if(e.has(i))break;e.add(i),c(t)}};function h(i){void 0!==this._$AN?(o(this),this._$AM=i,r(this)):this._$AM=i}function n(i,t=!1,e=0){const r=this._$AH,h=this._$AN;if(void 0!==h&&0!==h.size)if(t)if(Array.isArray(r))for(let i=e;i<r.length;i++)s(r[i],!1),o(r[i]);else null!=r&&(s(r,!1),o(r));else s(this,i)}const c=i=>{i.type==e.CHILD&&(i._$AP??=n,i._$AQ??=h)};class f extends t{constructor(){super(...arguments),this._$AN=void 0}_$AT(i,t,e){super._$AT(i,t,e),r(this),this.isConnected=i._$AU}_$AO(i,t=!0){i!==this.isConnected&&(this.isConnected=i,i?this.reconnected?.():this.disconnected?.()),t&&(s(this,i),o(this))}setValue(t){if(i(this._$Ct))this._$Ct._$AI(t,this);else{const i=[...this._$Ct._$AH];i[this._$Ci]=t,this._$Ct._$AI(i,this,0)}}disconnected(){}reconnected(){}}export{f as AsyncDirective,t as Directive,e as PartType};\n//# sourceMappingURL=async-directive.js.map\n","import{nothing as t}from\"../lit-html.js\";import{AsyncDirective as i}from\"../async-directive.js\";import{directive as s}from\"../directive.js\";\n/**\n * @license\n * Copyright 2020 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const e=()=>new h;class h{}const o=new WeakMap,n=s(class extends i{render(i){return t}update(i,[s]){const e=s!==this.G;return e&&void 0!==this.G&&this.rt(void 0),(e||this.lt!==this.ct)&&(this.G=s,this.ht=i.options?.host,this.rt(this.ct=i.element)),t}rt(t){if(this.isConnected||(t=void 0),\"function\"==typeof this.G){const i=this.ht??globalThis;let s=o.get(i);void 0===s&&(s=new WeakMap,o.set(i,s)),void 0!==s.get(this.G)&&this.G.call(this.ht,void 0),s.set(this.G,t),void 0!==t&&this.G.call(this.ht,t)}else this.G.value=t}get lt(){return\"function\"==typeof this.G?o.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});export{e as createRef,n as ref};\n//# sourceMappingURL=ref.js.map\n","import type { ReactiveController, ReactiveControllerHost, RenderOptions } from 'lit'\nimport { render } from 'lit'\n\ninterface LightDomOptions {\n render: () => unknown\n renderOptions?: RenderOptions\n container?: HTMLElement\n}\n\nexport class LightDomController implements ReactiveController {\n constructor(\n private host: ReactiveControllerHost & HTMLElement,\n private options: LightDomOptions,\n ) {\n host.addController(this)\n }\n\n private get container(): HTMLElement {\n return this.options.container || this.host\n }\n\n hostUpdated() {\n this.render()\n }\n\n private render() {\n render(this.options.render(), this.container, this.options.renderOptions)\n }\n}\n","import type { LitElement } from 'lit'\nimport type { Ref } from 'lit/directives/ref.js'\nimport { createRef } from 'lit/directives/ref.js'\n\ntype Constructable<T = Record<string, unknown>> = new (...args: any[]) => T\n\nexport declare class FocusableMixinInterface {\n protected focusableRef: Ref<HTMLElement>\n focus(options?: FocusOptions): void\n blur(): void\n click(): void\n}\n\nexport function FocusableMixin<T extends Constructable<LitElement>>(superClass: T) {\n class FocusableElement extends superClass {\n protected focusableRef = createRef<HTMLElement>()\n\n /**\n * Programmatically move focus to the component.\n * @param {FocusOptions} options An object which controls aspects of the focusing process.\n */\n focus(options?: FocusOptions) {\n this.focusableRef.value?.focus(options)\n }\n\n /**\n * Programmatically remove focus from the component.\n */\n blur() {\n this.focusableRef.value?.blur()\n }\n\n /**\n * Programmatically simulates a click on the component.\n */\n click() {\n this.focusableRef.value?.click()\n }\n }\n\n return FocusableElement as unknown as Constructable<FocusableMixinInterface> & T\n}\n","import type { LitElement } from 'lit'\nimport { property } from 'lit/decorators.js'\n\ntype Constructor<T = Record<string, unknown>> = new (...args: any[]) => T\n\nexport declare class InputMixinInterface {\n name?: string\n value: string\n disabled: boolean\n protected _formId?: string\n set form(id: string)\n get form(): HTMLFormElement | null\n}\n\nexport function InputMixin<T extends Constructor<LitElement>>(superClass: T): Constructor<InputMixinInterface> & T {\n class InputElement extends superClass {\n /**\n * Makes the component disabled. This prevents users from\n * being able to interact with the component, and conveys\n * its inactive state to assistive technologies.\n */\n @property({ type: Boolean, reflect: true }) disabled = false\n\n /**\n * The name of the form component.\n */\n @property({ reflect: true }) name?: string\n\n /**\n * The value of the form component.\n */\n @property() value: string = ''\n\n private formAncestor: HTMLFormElement | null = null\n protected _formId?: string\n set form(id: string) {\n const oldVal = this._formId\n this._formId = id\n this.requestUpdate('form', oldVal)\n }\n\n /**\n * Gets the form, if any, associated with the form element.\n * The setter accepts a string, which is the id of the form.\n */\n @property()\n get form(): HTMLFormElement | null {\n if (this._formId) {\n const root = this.getRootNode() as ShadowRoot | Document\n return root.querySelector<HTMLFormElement>(`form#${this._formId}`)\n }\n return this.formAncestor\n }\n\n connectedCallback() {\n super.connectedCallback()\n // we can cache this, since it will only change if the element is (re)connected\n this.formAncestor = this.closest('form')\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n this.formAncestor = null\n }\n }\n\n return InputElement as unknown as Constructor<InputMixinInterface> & T\n}\n","import { html, LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { cond } from '../common/directives/cond.js'\nimport componentStyle from '../common/styles/Component.css'\nimport style from './Spinner.css'\n\n/**\n * Spinner component is used to indicate users that their action is being\n * processed. You can customize the size and color of the spinner with the\n * provided properties.\n *\n * @status ready\n * @category feedback\n * @cssprop [--n-spinner-color=var(--n-color-accent)] - Controls the color the spinner.\n */\n@customElement('nord-spinner')\nexport default class Spinner extends LitElement {\n static styles = [componentStyle, style]\n\n /**\n * The size of the spinner.\n */\n @property({ reflect: true }) size: 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl' = 'm'\n\n /**\n * The color of the spinner.\n * Can accept any valid CSS color value, including custom properties.\n * Takes precedence over the `--n-spinner-color` CSS custom property.\n */\n @property({ reflect: true }) color?: string\n\n /**\n * An accessible label for the spinner.\n * If no label is supplied, the spinner is hidden from assistive technology.\n */\n @property({ reflect: true }) label?: string\n\n render() {\n // if a label is supplied, we give the div a role of img.\n // without this we could not use aria-label, since it is only valid on elements of certain roles.\n return html`\n <div\n class=\"n-spinner\"\n role=${cond(this.label, 'img')}\n aria-label=${ifDefined(this.label)}\n style=${cond(this.color, `--_n-spinner-color:${this.color}`)}\n ></div>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-spinner': Spinner\n }\n}\n","/* eslint-disable lit-a11y/accessible-name */\nimport type { TemplateResult } from 'lit'\nimport { html, LitElement, nothing } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { createRef, ref } from 'lit/directives/ref.js'\nimport { EventController } from '../common/controllers/EventController.js'\nimport { LightDomController } from '../common/controllers/LightDomController.js'\nimport { SlotController } from '../common/controllers/SlotController.js'\n\nimport { cond } from '../common/directives/cond.js'\n\nimport { FocusableMixin } from '../common/mixins/FocusableMixin.js'\nimport { InputMixin } from '../common/mixins/InputMixin.js'\nimport componentStyle from '../common/styles/Component.css'\nimport style from './Button.css'\nimport '../spinner/Spinner.js'\n\n/**\n * Buttons are used for interface actions. Primary style should be\n * used only once per section for main call-to-action, while other\n * styles can appear more frequently.\n *\n * @status ready\n * @category action\n * @slot - The button content\n * @slot start - Used to place content at the start of button text. Typically used for icons.\n * @slot end - Used to place content at the end of button text. Typically used for icons.\n *\n * @cssprop [--n-button-border-radius=var(--n-border-radius-s)] - Controls the rounded corners of the button, using [border radius tokens](/tokens/#border-radius).\n * @cssprop [--n-button-gap=var(--n-space-s)] - Controls the spacing between items within the button, using our [spacing tokens](/tokens/#space).\n * @cssprop [--n-button-gradient=linear-gradient(to bottom, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.013) 100%))] - Controls the overlayed gradient background on the button.\n * @cssprop [--n-button-background-color=var(--n-color-button)] - Controls the background color of the button, using our [color tokens](/tokens/#color).\n * @cssprop [--n-button-border-color=var(--n-color-border-strong)] - Controls the border color of the button, using our [color tokens](/tokens/#color).\n * @cssprop [--n-button-text-align=center] - Controls the text alignment for the text in the button.\n * @cssprop [--n-button-box-shadow=var(--n-box-shadow)] - Controls the surrounding shadow, using our [box shadow tokens](/tokens/#box-shadow).\n * @cssprop [--n-button-color=var(--n-color-text)] - Controls the color of the text within the button, using our [color tokens](/tokens/#color).\n * @cssprop [--n-button-padding-inline=calc(var(--n-space-m) / 1.2)] - Controls the inline, or left and right, padding of the button.\n * @cssprop [--n-button-font-size=var(--n-font-size-m)] - Controls the size of the text within the button, using our [font tokens](/tokens/#font).\n * @cssprop [--n-button-font-weight=var(--n-font-weight)] - Controls the weight of the text within the button, using our [font tokens](/tokens/#font).\n * @cssprop [--n-button-min-block-size=var(--n-space-xl)] - Controls the minimum block size, or height, of the button using our [spacing tokens](/tokens/#space).\n * @cssprop [--n-button-toggle-icon-color=var(--n-color-icon)] - Controls the color of toggle icon that gets rendered when the button is used as a [Dropdown](/components/dropdown/) toggle.\n * @cssprop [--n-button-user-select=none] - Controls the text selection behavior of the button text.\n */\n@customElement('nord-button')\nexport default class Button extends InputMixin(FocusableMixin(LitElement)) {\n static styles = [componentStyle, style]\n\n private defaultSlot = new SlotController(this)\n private buttonRef = createRef<HTMLButtonElement>()\n private events = new EventController(this)\n private lightDom = new LightDomController(this, {\n render: () => this.renderLightDom(),\n })\n\n /**\n * The style variant of the button.\n */\n @property({ reflect: true }) variant: 'default' | 'primary' | 'dashed' | 'plain' | 'danger' = 'default'\n\n /**\n * The type of the button.\n */\n @property({ reflect: true }) type: 'button' | 'submit' | 'reset' = 'submit'\n\n /**\n * The size of the button.\n * This affects font-size and padding.\n */\n @property({ reflect: true }) size: 's' | 'm' | 'l' = 'm'\n\n /**\n * This does not need to be documented,\n * since it is only for forwarding the aria-expanded attribute\n * to the internal button element.\n * @private\n */\n @property({ attribute: 'aria-expanded' }) accessibleExpanded?: 'true' | 'false'\n\n /**\n * This does not need to be documented,\n * since it is only for forwarding the aria-haspopup attribute\n * to the internal button element.\n * @private\n */\n @property({ attribute: 'aria-haspopup' }) accessibleHasPopup?:\n | 'false'\n | 'true'\n | 'menu'\n | 'listbox'\n | 'tree'\n | 'grid'\n | 'dialog'\n\n /**\n * When provided, renders the button as a link,\n * with its href attribute set to the given value.\n */\n @property({ reflect: true }) href?: string\n\n /**\n * When provided together with a href property, the button will\n * trigger a file download instead of a page visit.\n */\n @property({ reflect: true, type: Boolean }) download = false\n\n /**\n * When provided together with a href property, determines where\n * to open the linked URL. The keywords have special meanings for\n * where to load the URL: “_self” means the current browsing context,\n * “_blank” usually a new tab but users can configure browsers this to\n * open a new window instead, “_parent” means the parent browsing\n * context of the current one, but if no parent exists, behaves as\n * _self, and finally “top” means the topmost browsing context.\n */\n @property() target: '_self' | '_blank' | '_parent' | '_top' = '_self'\n\n /**\n * Controls whether the button expands to fill the width of its container.\n */\n @property({ reflect: true, type: Boolean }) expand = false\n\n /**\n * When provided, the button is rendered as a square button. Use this for icon only buttons.\n */\n @property({ reflect: true, type: Boolean }) square = false\n\n /**\n * Controls whether the button is in loading state. Please note that the spinner\n * is hidden from assistive technologies, so you need to make sure to announce\n * the loading state to e.g. screen reader users. We also recommend disabling\n * all user interactions on the button itself while in loading state.\n */\n @property({ reflect: true, type: Boolean }) loading = false\n\n /**\n * Controls whether the `interface-dropdown-small` icon from Nordicons is hidden\n * in the `end` slot when used as a dropdown toggle.\n */\n @property({ reflect: true, type: Boolean, attribute: 'hide-dropdown-icon' }) hideDropdownIcon = false\n\n connectedCallback() {\n super.connectedCallback()\n this.events.listen(this, 'click', this.handleOuterClick, true)\n }\n\n render() {\n const isDropdownToggle = this.assignedSlot?.name === 'toggle'\n const isIconButton = this.defaultSlot.assigned.some(node => node.localName === 'nord-icon')\n const shouldShowDropdownIcon = isDropdownToggle && !this.hideDropdownIcon && !isIconButton && !this.href\n\n const innards = html`\n <slot name=\"start\"></slot>\n <div class=\"n-content\">\n <slot></slot>\n </div>\n <nord-spinner\n class=\"n-button-spinner\"\n color=\"currentColor\"\n ?hidden=${!this.loading || Boolean(this.href)}\n ></nord-spinner>\n <slot name=\"end\">\n ${shouldShowDropdownIcon\n ? html`<nord-icon name=\"interface-dropdown-small\" class=\"n-toggle-icon\"></nord-icon>`\n : nothing}\n </slot>\n `\n\n return this.href ? this.renderLink(innards) : this.renderButton(innards)\n }\n\n /**\n * We jump through some hoops here to ensure the link is treated correctly when \"disabled\".\n * Links cannot be disabled natively, so we need to rely on some aria magic to get the correct semantics.\n * Along with the advice in the article below, we also set tabindex to \"-1\", so it is taken out of tab order.\n *\n * @see https://www.scottohara.me/blog/2021/05/28/disabled-links.html\n */\n private renderLink(innards: TemplateResult) {\n return html`\n <a\n ${ref(this.focusableRef)}\n class=\"n-button\"\n target=${this.target}\n ?download=${this.download}\n href=${cond(this.disabled, nothing, this.href)}\n tabindex=${cond(this.disabled, '-1')}\n aria-disabled=${cond(this.disabled, 'true')}\n role=${cond(this.disabled, 'link')}\n >${innards}\n </a>\n `\n }\n\n private renderButton(innards: TemplateResult) {\n return html`\n <slot name=\"proxy\" @slotchange=${this.handleProxyChange}></slot>\n <button\n ${ref(this.focusableRef)}\n class=\"n-button\"\n ?disabled=${this.disabled}\n name=${cond(this.name)}\n value=${cond(this.value)}\n @click=${this.handleClick}\n aria-disabled=${cond(this.loading, 'true')}\n aria-expanded=${cond(this.accessibleExpanded)}\n aria-haspopup=${cond(this.accessibleHasPopup)}\n >\n ${innards}\n </button>\n `\n }\n\n private renderLightDom() {\n if (this.href || !this.form) {\n return nothing\n }\n\n return html`\n <button\n ${ref(this.buttonRef)}\n slot=\"proxy\"\n name=${cond(this.name)}\n value=${cond(this.value)}\n ?disabled=${this.disabled}\n form=${cond(this._formId)}\n type=${this.type}\n ></button>\n `\n }\n\n private handleOuterClick = (e: MouseEvent) => {\n // we want to avoid emitting click events when a click\n // happens in blank space in the host, but not on the button\n // so we stop propagation of any events if click didn't happen on the internal or proxy button\n const isInternalButton = e\n .composedPath()\n .some(node => node === this.focusableRef.value || node === this.buttonRef.value)\n\n if (!isInternalButton) {\n e.stopPropagation()\n }\n }\n\n private handleClick(e: Event) {\n if (this.buttonRef.value) {\n // prevents two events: one from internal button, one from proxy button\n e.stopPropagation()\n this.buttonRef.value.click()\n }\n }\n\n /**\n * React/Vue etc may remove our proxy button when updating button text, since they are unaware of its existence.\n * So we listen for a slotchange event, and if the element is no longer connected to the DOM we add it back in.\n */\n private handleProxyChange(e: Event) {\n const slot = e.target as HTMLSlotElement\n const proxyButton = this.buttonRef.value\n\n if (proxyButton && proxyButton.assignedSlot !== slot) {\n this.appendChild(proxyButton)\n }\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-button': Button\n }\n}\n","export default '<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m.100342 6.92903 2.121318-2.12132 7.77818 7.77819 7.77826-7.77828 2.1213 2.12132-8.4853 8.48536c-.7811.7811-2.04743.7811-2.82848 0z\" fill=\"currentColor\"/></svg>';\nexport const title = \"arrow-down-small\";\nexport const tags = \"nordicon arrow down small caret pointing triangle chevron\";\n","export default '<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m13.0712.105225 2.1213 2.121315-7.77816 7.77816 7.77826 7.7783-2.1213 2.1213-8.48539-8.4854c-.78105-.781-.78105-2.04735 0-2.82839z\" fill=\"currentColor\"/></svg>';\nexport const title = \"arrow-left-small\";\nexport const tags = \"nordicon arrow left small caret pointing triangle chevron\";\n","export default '<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m6.92903.100342-2.12132 2.121318 7.77819 7.77818-7.77828 7.77826 2.12132 2.1213 8.48536-8.4853c.7811-.7811.7811-2.04743 0-2.82848z\" fill=\"currentColor\"/></svg>';\nexport const title = \"arrow-right-small\";\nexport const tags =\n \"nordicon arrow right small caret pointing triangle chevron\";\n","import{noChange as e}from\"../lit-html.js\";import{directive as s,Directive as t,PartType as r}from\"../directive.js\";import{getCommittedValue as l,setChildPartValue as o,insertPart as i,removePart as n,setCommittedValue as f}from\"../directive-helpers.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst u=(e,s,t)=>{const r=new Map;for(let l=s;l<=t;l++)r.set(e[l],l);return r},c=s(class extends t{constructor(e){if(super(e),e.type!==r.CHILD)throw Error(\"repeat() can only be used in text expressions\")}dt(e,s,t){let r;void 0===t?t=s:void 0!==s&&(r=s);const l=[],o=[];let i=0;for(const s of e)l[i]=r?r(s,i):i,o[i]=t(s,i),i++;return{values:o,keys:l}}render(e,s,t){return this.dt(e,s,t).values}update(s,[t,r,c]){const d=l(s),{values:p,keys:a}=this.dt(t,r,c);if(!Array.isArray(d))return this.ut=a,p;const h=this.ut??=[],v=[];let m,y,x=0,j=d.length-1,k=0,w=p.length-1;for(;x<=j&&k<=w;)if(null===d[x])x++;else if(null===d[j])j--;else if(h[x]===a[k])v[k]=o(d[x],p[k]),x++,k++;else if(h[j]===a[w])v[w]=o(d[j],p[w]),j--,w--;else if(h[x]===a[w])v[w]=o(d[x],p[w]),i(s,v[w+1],d[x]),x++,w--;else if(h[j]===a[k])v[k]=o(d[j],p[k]),i(s,d[x],d[j]),j--,k++;else if(void 0===m&&(m=u(a,k,w),y=u(h,x,j)),m.has(h[x]))if(m.has(h[j])){const e=y.get(a[k]),t=void 0!==e?d[e]:null;if(null===t){const e=i(s,d[x]);o(e,p[k]),v[k]=e}else v[k]=o(t,p[k]),i(s,d[x],t),d[e]=null;k++}else n(d[j]),j--;else n(d[x]),x++;for(;k<=w;){const e=i(s,v[w+1]);o(e,p[k]),v[k++]=e}for(;x<=j;){const e=d[x++];null!==e&&n(e)}return this.ut=a,f(s,v),e}});export{c as repeat};\n//# sourceMappingURL=repeat.js.map\n","var t=[\"Shift\",\"Meta\",\"Alt\",\"Control\"],e=\"object\"==typeof navigator&&/Mac|iPod|iPhone|iPad/.test(navigator.platform)?\"Meta\":\"Control\";function n(t,e){return\"function\"==typeof t.getModifierState&&t.getModifierState(e)}function r(t){return t.trim().split(\" \").map(function(t){var n=t.split(/\\b\\+/),r=n.pop();return[n=n.map(function(t){return\"$mod\"===t?e:t}),r]})}function o(e,o){var i;void 0===o&&(o={});var u=null!=(i=o.timeout)?i:1e3,a=Object.keys(e).map(function(t){return[r(t),e[t]]}),f=new Map,c=null;return function(e){e instanceof KeyboardEvent&&(a.forEach(function(r){var o=r[0],i=r[1],u=f.get(o)||o;!function(e,r){return!(r[1].toUpperCase()!==e.key.toUpperCase()&&r[1]!==e.code||r[0].find(function(t){return!n(e,t)})||t.find(function(t){return!r[0].includes(t)&&r[1]!==t&&n(e,t)}))}(e,u[0])?n(e,e.key)||f.delete(o):u.length>1?f.set(o,u.slice(1)):(f.delete(o),i(e))}),c&&clearTimeout(c),c=setTimeout(f.clear.bind(f),u))}}function i(t,e,n){var r;void 0===n&&(n={});var i=null!=(r=n.event)?r:\"keydown\",u=o(e,n);return t.addEventListener(i,u),function(){t.removeEventListener(i,u)}}export default i;export{o as createKeybindingsHandler,r as parseKeybinding};\n//# sourceMappingURL=tinykeys.module.js.map\n","/**\n * Groups an array objects by property value\n * @param array the collection of objects to group\n * @param key the property to group by\n * @returns a Map keyed by property value, where values are are an array of objects with that property value.\n */\nexport function groupBy<TObject extends Record<any, any>, TKey extends keyof TObject>(\n array: Array<TObject>,\n key: TKey,\n) {\n const grouped = new Map<TObject[TKey], TObject[]>()\n\n for (const item of array) {\n const value = item[key]\n const collection = grouped.get(value) ?? []\n\n if (!grouped.has(value)) {\n grouped.set(value, [])\n }\n collection.push(item)\n grouped.set(value, collection)\n }\n\n return grouped\n}\n\n/**\n * Split an array into chunks of the given size\n * @param array - The array to split\n * @param chunkSize - The size of each chunk\n * @returns The array split into chunks\n */\nexport function chunk<T>(array: T[], chunkSize: number): T[][] {\n const result = []\n\n for (let i = 0; i < array.length; i += chunkSize) {\n result.push(array.slice(i, i + chunkSize))\n }\n\n return result\n}\n\n/**\n * maps over an array, starting at the given offset and wrapping around.\n * @param array - The array to map over\n * @param startingOffset - The starting offset\n * @param mapFn - The mapping function\n * @returns The mapped array\n */\nexport function mapWithOffset<T, U>(array: T[], startingOffset: number, mapFn: (item: T, i: number) => U): U[] {\n return array.map((_, i) => {\n const adjustedIndex = (i + startingOffset) % array.length\n return mapFn(array[adjustedIndex], adjustedIndex)\n })\n}\n","import type { ReactiveController, ReactiveElement } from 'lit'\nimport { EventController } from './EventController.js'\n\nexport interface SwipeDetails {\n initialX: number\n initialY: number\n pageX: number\n pageY: number\n distX: number\n distY: number\n}\n\nconst preventDefault = (e: Event) => e.preventDefault()\n\ntype SetRequired<T, K extends keyof T> = T & { [Property in K]-?: T[K] }\ninterface SwipeControllerOptions {\n target?: () => HTMLElement\n matchesGesture: (details: SwipeDetails) => boolean\n onSwipeEnd: (details: SwipeDetails) => void\n}\n\nexport class SwipeController implements ReactiveController {\n private events: EventController\n private hadFirstUpdate = false\n\n private initialTouchX: number = 0\n private initialTouchY: number = 0\n private options: SetRequired<SwipeControllerOptions, 'target'>\n\n constructor(host: ReactiveElement, options: SwipeControllerOptions) {\n host.addController(this)\n this.events = new EventController(host)\n\n this.options = {\n target: () => host,\n ...options,\n }\n }\n\n hostUpdated() {\n if (!this.hadFirstUpdate) {\n this.hadFirstUpdate = true\n\n const target = this.options.target()\n this.events.listen(target, 'touchstart', this.handleTouchStart)\n this.events.listen(target, 'touchmove', preventDefault)\n this.events.listen(target, 'touchend', this.handleTouchEnd)\n }\n }\n\n hostDisconnected() {\n this.hadFirstUpdate = false\n }\n\n private handleTouchStart = (event: TouchEvent) => {\n const [{ pageX, pageY }] = event.changedTouches\n this.initialTouchX = pageX\n this.initialTouchY = pageY\n }\n\n private handleTouchEnd = (event: TouchEvent) => {\n const [{ pageX, pageY }] = event.changedTouches\n const { matchesGesture, onSwipeEnd } = this.options\n\n const distX = pageX - this.initialTouchX\n const distY = pageY - this.initialTouchY\n const details = { initialX: this.initialTouchX, initialY: this.initialTouchY, pageX, pageY, distX, distY }\n\n if (matchesGesture(details)) {\n event.preventDefault()\n onSwipeEnd(details)\n }\n }\n}\n\nconst THRESHOLD = 70\n\nexport function isHorizontalSwipe({ distX, distY }: SwipeDetails) {\n return Math.abs(distX) >= THRESHOLD && Math.abs(distY) <= THRESHOLD\n}\n\nexport function isDownwardsSwipe({ distX, distY }: SwipeDetails) {\n return Math.abs(distY) >= THRESHOLD && Math.abs(distX) <= THRESHOLD && distY > 0\n}\n","const ISO_DATE_FORMAT = /^(\\d{4})-(\\d{2})-(\\d{2})$/\n\nexport enum DaysOfWeek {\n Sunday = 0,\n Monday = 1,\n Tuesday = 2,\n Wednesday = 3,\n Thursday = 4,\n Friday = 5,\n Saturday = 6,\n}\n\nexport function createDate(year: string, month: string, day: string): Date | undefined {\n const dayInt = Number.parseInt(day, 10)\n const monthInt = Number.parseInt(month, 10)\n const yearInt = Number.parseInt(year, 10)\n\n const isValid\n = Number.isInteger(yearInt) // all parts should be integers\n && Number.isInteger(monthInt)\n && Number.isInteger(dayInt)\n && monthInt > 0 // month must be 1-12\n && monthInt <= 12\n && dayInt > 0 // day must be 1-31\n && dayInt <= 31\n && yearInt > 0\n\n if (isValid) {\n const date = new Date(yearInt, monthInt - 1, dayInt)\n // this handles values where year is 0-99, which JS \"helpfully\" interprets as 1900-1999\n date.setFullYear(yearInt)\n\n return date\n }\n\n return undefined\n}\n\n/**\n * @param value date string in ISO format YYYY-MM-DD\n */\nexport function parseISODate(value: string): Date | undefined {\n if (!value) {\n return undefined\n }\n\n const matches = value.match(ISO_DATE_FORMAT)\n\n if (matches) {\n return createDate(matches[1], matches[2], matches[3])\n }\n\n return undefined\n}\n\n/**\n * print date in format YYYY-MM-DD\n * @param date\n */\nexport function printISODate(date: Date): string {\n if (!date) {\n return ''\n }\n\n const d = date.getDate().toString(10)\n const m = (date.getMonth() + 1).toString(10)\n const y = date.getFullYear().toString(10)\n\n return `${y.padStart(4, '0')}-${m.padStart(2, '0')}-${d.padStart(2, '0')}`\n}\n\nfunction today() {\n const date = new Date()\n return new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0, 0))\n}\n\nexport function getDayNames(locale: string, weekday: Exclude<Intl.DateTimeFormatOptions['weekday'], undefined>) {\n const days = []\n const options = { weekday }\n const day = today()\n\n for (let i = 0; i < 7; i++) {\n days[day.getDay()] = day.toLocaleDateString(locale, options)\n day.setDate(day.getDate() + 1)\n }\n\n return days\n}\n\nexport function getMonthNames(locale: string, month: Exclude<Intl.DateTimeFormatOptions['month'], undefined>) {\n const months = []\n const options = { month }\n\n // set to first of the month, so that all dates are valid\n const day = today()\n day.setDate(1)\n\n for (let i = 0; i < 12; i++) {\n months[day.getMonth()] = day.toLocaleDateString(locale, options)\n day.setMonth(day.getMonth() + 1)\n }\n\n return months\n}\n\n/**\n * Compare if two dates are in the same month of the same year.\n */\nexport function isEqualMonth(a?: Date, b?: Date): boolean {\n if (a == null || b == null) {\n return false\n }\n\n return a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth()\n}\n\n/**\n * Compare if two dates are equal in terms of day, month, and year\n */\nexport function isEqual(a?: Date, b?: Date): boolean {\n if (a == null || b == null) {\n return false\n }\n\n return isEqualMonth(a, b) && a.getDate() === b.getDate()\n}\n\nexport function addDays(date: Date, days: number): Date {\n const d = new Date(date)\n d.setDate(d.getDate() + days)\n return d\n}\n\nexport function addMonths(date: Date, months: number): Date {\n const d = new Date(date)\n d.setMonth(date.getMonth() + months)\n return d\n}\n\nexport function addYears(date: Date, years: number): Date {\n const d = new Date(date)\n d.setFullYear(date.getFullYear() + years)\n return d\n}\n\nexport function startOfWeek(date: Date, firstDayOfWeek: DaysOfWeek = DaysOfWeek.Monday): Date {\n const d = new Date(date)\n const day = d.getDay()\n const diff = (day < firstDayOfWeek ? 7 : 0) + day - firstDayOfWeek\n\n d.setDate(d.getDate() - diff)\n return d\n}\n\nexport function endOfWeek(date: Date, firstDayOfWeek: DaysOfWeek = DaysOfWeek.Monday): Date {\n const d = new Date(date)\n const day = d.getDay()\n const diff = (day < firstDayOfWeek ? -7 : 0) + 6 - (day - firstDayOfWeek)\n\n d.setDate(d.getDate() + diff)\n return d\n}\n\nexport function startOfMonth(date: Date): Date {\n const d = new Date(date.getFullYear(), date.getMonth(), 1)\n d.setFullYear(date.getFullYear())\n return d\n}\n\nexport function endOfMonth(date: Date): Date {\n const d = new Date(date.getFullYear(), date.getMonth() + 1, 0)\n d.setFullYear(date.getFullYear())\n return d\n}\n\nexport function setMonth(date: Date, month: number): Date {\n const d = new Date(date)\n d.setMonth(month)\n return d\n}\n\nexport function setYear(date: Date, year: number): Date {\n const d = new Date(date)\n d.setFullYear(year)\n return d\n}\n\n/**\n * Ensures date is within range, returns min or max if out of bounds\n */\nexport function clamp(date: Date, min?: Date, max?: Date): Date {\n const time = date.getTime()\n\n if (min && min instanceof Date && time < min.getTime()) {\n return min\n }\n\n if (max && max instanceof Date && time > max.getTime()) {\n return max\n }\n\n return date\n}\n\n/**\n * Check if date is within a min and max\n */\nexport function inRange(date: Date, min?: Date, max?: Date): boolean {\n return clamp(date, min, max) === date\n}\n\n/**\n * given start and end date, return an (inclusive) array of all dates in between\n * @param start\n * @param end\n */\nfunction getDaysInRange(start: Date, end: Date): Date[] {\n const days: Date[] = []\n let current = start\n\n while (!isEqual(current, end)) {\n days.push(current)\n current = addDays(current, 1)\n }\n\n days.push(current)\n\n return days\n}\n\n/**\n * given a date, return an array of dates from a calendar perspective\n * @param date\n * @param firstDayOfWeek\n */\nexport function getViewOfMonth(date: Date, firstDayOfWeek: DaysOfWeek = DaysOfWeek.Monday): Date[] {\n const start = startOfWeek(startOfMonth(date), firstDayOfWeek)\n const end = endOfWeek(endOfMonth(date), firstDayOfWeek)\n\n return getDaysInRange(start, end)\n}\n","/**\n * Wraps a value so that it always falls within min/max,\n * where a value greater than max gets set to min, and vice versa\n */\nexport function wrap(val: number, min: number, max: number) {\n if (val > max)\n return min\n if (val < min)\n return max\n return val\n}\n\nexport function range(from: number, to: number) {\n const result: number[] = []\n\n for (let i = from; i <= to; i++) {\n result.push(i)\n }\n\n return result\n}\n\nexport function clamp(value: number, min: number, max: number) {\n return Math.max(min, Math.min(value, max))\n}\n","const calendarLocalization = {\n prevMonthLabel: 'Previous month',\n nextMonthLabel: 'Next month',\n monthSelectLabel: 'Month',\n yearSelectLabel: 'Year',\n}\n\nexport default calendarLocalization\n","import calendarLocalization from '../calendar/localization.js'\nimport commandMenuLocalization from '../command-menu/localization.js'\nimport datePickerLocalization from '../date-picker/localization.js'\nimport messageLocalization from '../message/localization.js'\nimport modalLocalization from '../modal/localization.js'\nimport navToggleLocalization from '../nav-toggle/localization.js'\nimport notificationLocalization from '../notification/localization.js'\nimport tagLocalization from '../tag/localization.js'\nimport textareaLocalization from '../textarea/localization.js'\n\nconst en = {\n '$lang': 'en-US',\n '$name': 'English',\n '$dir': 'ltr' as 'ltr' | 'rtl',\n 'nord-command-menu': commandMenuLocalization,\n 'nord-calendar': calendarLocalization,\n 'nord-date-picker': datePickerLocalization,\n 'nord-modal': modalLocalization,\n 'nord-nav-toggle': navToggleLocalization,\n 'nord-textarea': textareaLocalization,\n 'nord-notification': notificationLocalization,\n 'nord-message': messageLocalization,\n 'nord-tag': tagLocalization,\n}\n\nexport default en\n","const commandMenuLocalization = {\n instructions: 'Press \\'Enter\\' to confirm your input or \\'Escape\\' to cancel',\n inputLabel: 'Type the name of a command to run.',\n footerArrowKeys: 'Navigate',\n footerEnterKey: 'Select',\n footerEscapeKey: 'Esc to dismiss',\n footerBackspaceKey: 'Move to parent',\n noResults: (searchTerm: string) => `No results for “${searchTerm}”`,\n tip: 'Search tips: some search terms require an exact match. Try typing the entire command name, or use a different word or phrase.',\n placeholder: 'Type a command or search…',\n}\n\nexport default commandMenuLocalization\n","const datePickerLocalization = {\n modalHeading: 'Choose a date',\n closeLabel: 'Close window',\n buttonLabel: 'Choose date',\n selectedDateMessage: 'Selected date is',\n dateOutOfMinBound: (minDate: string) => `Date must be on or after ${minDate}`,\n dateOutOfMaxBound: (maxDate: string) => `Date must be on or before ${maxDate}`,\n}\n\nexport default datePickerLocalization\n","const localization = {\n closeLabel: 'Close dialog',\n}\n\nexport default localization\n","const localization = {\n label: 'Toggle navigation',\n}\n\nexport default localization\n","const localization = {\n remainingCharacters: (remainder: number) => `Characters remaining: ${remainder}`,\n}\n\nexport default localization\n","const localization = {\n dismissLabel: 'Dismiss notification',\n}\n\nexport default localization\n","const localization = {\n unreadLabel: 'Unread',\n}\n\nexport default localization\n","const localization = {\n removeLabel: 'Remove',\n}\n\nexport default localization\n","import { isServer } from 'lit'\nimport en from './en-us.js'\n\n// gets list of properties beginning prefix\ntype PickStartsWith<T, Prefix extends string> = T extends `${Prefix}${string}` ? T : never\n\n// Recursively make all properties optional\ntype DeepPartial<T> = T extends object\n ? {\n [P in keyof T]?: DeepPartial<T[P]>\n }\n : T\n\nexport type Translation = typeof en\nexport type PartialTranslation = {\n $lang: string\n $name?: string\n $dir?: 'ltr' | 'rtl'\n} & DeepPartial<Omit<Translation, '$lang' | '$name' | '$dir'>>\nexport type WellKnownKeys = PickStartsWith<keyof Translation, '$'>\n\nconst documentLangSubscribers = new Set<() => void>()\nconst translationRegistrationSubscribers = new Set<() => void>()\nconst translations = new Map<string, Translation>()\n\nfunction notifyDocumentLangChange() {\n for (const subscriber of documentLangSubscribers) {\n subscriber()\n }\n}\n\nfunction notifyTranslationRegistration() {\n for (const subscriber of translationRegistrationSubscribers) {\n subscriber()\n }\n}\n\nfunction deepMerge(target: unknown, source: unknown): unknown {\n if (!isObject(source))\n return source\n\n if (!isObject(target))\n return source\n\n const result = { ...target }\n\n for (const key in source) {\n const sourceValue = (source as Record<string, unknown>)[key]\n const targetValue = result[key]\n\n if (isObject(sourceValue) && isObject(targetValue)) {\n result[key] = deepMerge(targetValue, sourceValue)\n }\n else {\n result[key] = sourceValue\n }\n }\n\n return result\n}\n\nfunction isObject(value: unknown): value is Record<string, unknown> {\n return value !== null && typeof value === 'object' && !Array.isArray(value)\n}\n\n// observe changes to the document's lang\nif (!isServer) {\n const observer = new MutationObserver(notifyDocumentLangChange)\n\n observer.observe(document.documentElement, {\n attributes: true,\n attributeFilter: ['lang'],\n })\n}\n\n/**\n * Removes all registered translations\n */\nexport function clearTranslations() {\n translations.clear()\n}\n\n/**\n * Registers one or more translations. If a translation for the same language\n * already exists, the new translation will be deep-merged with the existing one.\n * Translations can be partial — only the fields you provide will override existing values.\n */\nexport function registerTranslation(...translation: (Translation | PartialTranslation)[]) {\n translation.forEach((t) => {\n const lang = t.$lang.toLowerCase()\n const existing = translations.get(lang)\n\n // Deep merge: keep existing keys, override with new ones\n const merged = existing ? (deepMerge(existing, t) as Translation) : (t as Translation)\n translations.set(lang, merged)\n })\n\n notifyTranslationRegistration()\n}\n\n/**\n * subscribe to document language changes\n * @param onChange callback for when document `lang` attr changes\n * @returns cleanup function\n */\nexport function subscribeToDocumentLang(onChange: () => void): () => void {\n documentLangSubscribers.add(onChange)\n return () => documentLangSubscribers.delete(onChange)\n}\n\n/**\n * subscribe to translation registration changes\n * @param onChange callback for when new translations are registered\n * @returns cleanup function\n */\nexport function subscribeToTranslationRegistration(onChange: () => void): () => void {\n translationRegistrationSubscribers.add(onChange)\n return () => translationRegistrationSubscribers.delete(onChange)\n}\n\n/**\n * Check whether there is a translation registered for the given lang\n * @param lang the lang code e.g. \"en\" or \"en-GB\"\n */\nexport function isTranslationRegistered(lang: string) {\n return translations.has(lang)\n}\n\n/**\n * Picks the most appropriate translation for the given language, from most specific to least specific.\n * First tries lang + region, then lang only, then fallback.\n */\nexport function resolveTranslation(langCode: string) {\n const lang = langCode.toLowerCase()\n const [langOnly] = lang.split('-')\n\n return translations.get(lang) || translations.get(langOnly) || en\n}\n\nexport { en as fallback }\n","import type { ReactiveController, ReactiveControllerHost } from 'lit'\nimport type {\n Translation,\n WellKnownKeys,\n} from './translation.js'\nimport { isServer } from 'lit'\nimport {\n fallback,\n resolveTranslation,\n subscribeToDocumentLang,\n subscribeToTranslationRegistration,\n} from './translation.js'\n\n// Use fallback (en) as source of truth for valid translation keys\ntype FallbackType = typeof fallback\n\n// helper types...\n\n// used to match any function\ntype Func = (...args: any[]) => any\n\n// if object property is function, use return type, else value type\ntype Result<Type, Key extends keyof Type> = Type[Key] extends Func ? ReturnType<Type[Key]> : Type[Key]\n\n// if object property is function,\ntype FuncParams<Type, K extends keyof Type> = Type[K] extends Func ? Parameters<Type[K]> : []\n\nfunction noop() {\n // this function is intentionally left blank\n}\n\nexport class LocalizeController<TComponentName extends Exclude<keyof Translation, WellKnownKeys>>\nimplements ReactiveController {\n private unsubscribeDocumentLang?: ReturnType<typeof subscribeToDocumentLang>\n private unsubscribeTranslationRegistration?: ReturnType<typeof subscribeToTranslationRegistration>\n private observer?: MutationObserver\n private resolvedTranslation: Translation\n\n constructor(\n private host: ReactiveControllerHost & HTMLElement,\n private options = { onLangChange: noop },\n ) {\n host.addController(this)\n this.resolvedTranslation = resolveTranslation(this.lang)\n }\n\n /**\n * The lang of the document or element, with element taking precedence\n */\n get lang() {\n if (isServer) {\n return this.host.lang || 'en-US'\n }\n\n return this.host.lang || document.documentElement.lang\n }\n\n /**\n * The lang of the translation being applied.\n * This may not match the document/element lang, in case of fallback translation\n */\n get resolvedLang() {\n return this.resolvedTranslation.$lang\n }\n\n hostConnected() {\n // Always subscribe to translation registration changes (for when new translations are registered)\n this.unsubscribeTranslationRegistration = subscribeToTranslationRegistration(this.handleLangChange)\n\n // Re-resolve translation now that the host is connected and attributes are set\n // This handles cases where the lang attribute is set after the constructor runs (e.g., in Vue)\n const resolved = resolveTranslation(this.lang)\n if (this.resolvedTranslation !== resolved) {\n this.resolvedTranslation = resolved\n }\n\n // If the host has its own `lang` attribute, create a local observer to watch for changes to that attribute\n if (this.host.getAttribute('lang')) {\n this.observer = new MutationObserver(this.handleLangChange)\n this.observer.observe(this.host, {\n attributes: true,\n attributeFilter: ['lang'],\n })\n }\n else {\n // Otherwise, also subscribe to document language changes\n this.unsubscribeDocumentLang = subscribeToDocumentLang(this.handleLangChange)\n }\n\n this.options.onLangChange()\n }\n\n hostDisconnected() {\n this.unsubscribeDocumentLang?.()\n this.unsubscribeTranslationRegistration?.()\n this.observer?.disconnect()\n }\n\n term<Key extends keyof FallbackType[TComponentName]>(\n key: Key,\n ...args: FuncParams<FallbackType[TComponentName], Key>\n ): Result<FallbackType[TComponentName], Key> {\n const { resolvedTranslation, resolvedLang } = this\n const component = this.host.localName as TComponentName\n\n // Cast to specific component type to satisfy TS that key is valid for this component\n const componentTranslation = resolvedTranslation[component] as FallbackType[TComponentName] | undefined\n\n if (componentTranslation == null) {\n console.warn(`NORD: Missing translations for component \\`${component}\\` in lang: \\`${resolvedLang}\\``)\n }\n else if (componentTranslation[key] == null) {\n console.warn(\n `NORD: Missing translation key \\`${String(key)}\\` for component \\`${component}\\` in lang \\`${resolvedLang}\\``,\n )\n }\n\n const fallbackComponentTranslation = fallback[component] as FallbackType[TComponentName]\n const translationValue = (componentTranslation?.[key] ?? fallbackComponentTranslation[key]) as Result<FallbackType[TComponentName], Key>\n return typeof translationValue === 'function' ? translationValue(...args) : translationValue\n }\n\n private handleLangChange = () => {\n const resolved = resolveTranslation(this.lang)\n\n if (this.resolvedTranslation !== resolved) {\n this.resolvedTranslation = resolved\n\n this.options.onLangChange()\n this.host.requestUpdate()\n }\n }\n}\n","/**\n * A base class for events which defaults to bubbling and composed\n */\nexport class NordEvent extends Event {\n constructor(type: string, eventInitDict?: EventInit) {\n super(type, {\n bubbles: true,\n composed: true,\n ...eventInitDict,\n })\n }\n}\n\nexport function oneEvent<K extends keyof GlobalEventHandlersEventMap>(element: HTMLElement, type: K) {\n return new Promise<GlobalEventHandlersEventMap[K]>((resolve) => {\n element.addEventListener(type, e => resolve(e), { once: true })\n })\n}\n\nexport function transition(element: HTMLElement) {\n return Promise.race([oneEvent(element, 'transitionend'), oneEvent(element, 'transitioncancel')])\n}\n\nexport function animation(element: HTMLElement) {\n return Promise.race([oneEvent(element, 'animationend'), oneEvent(element, 'animationcancel')])\n}\n","import { NordEvent } from '../common/events.js'\n\nexport class DateSelectEvent extends NordEvent {\n constructor(\n name: string,\n public date: Date,\n ) {\n super(name)\n }\n}\n","import * as arrowDownIcon from '@nordhealth/icons/lib/assets/arrow-down-small.js'\nimport * as arrowLeftIcon from '@nordhealth/icons/lib/assets/arrow-left-small.js'\nimport * as arrowRightIcon from '@nordhealth/icons/lib/assets/arrow-right-small.js'\nimport { html, isServer, LitElement } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { classMap } from 'lit/directives/class-map.js'\nimport { repeat } from 'lit/directives/repeat.js'\nimport { createKeybindingsHandler } from 'tinykeys'\n\nimport { chunk, mapWithOffset } from '../common/collection.js'\nimport { DirectionController } from '../common/controllers/DirectionController.js'\nimport { isHorizontalSwipe, SwipeController } from '../common/controllers/SwipeController.js'\n\nimport {\n addDays,\n clamp,\n DaysOfWeek,\n endOfMonth,\n endOfWeek,\n getDayNames,\n getMonthNames,\n getViewOfMonth,\n inRange,\n isEqual,\n isEqualMonth,\n parseISODate,\n printISODate,\n setMonth,\n setYear,\n startOfMonth,\n startOfWeek,\n} from '../common/dates.js'\nimport { observe } from '../common/decorators/observe.js'\nimport { cond } from '../common/directives/cond.js'\nimport { range } from '../common/number.js'\nimport componentStyle from '../common/styles/Component.css'\nimport Icon from '../icon/Icon.js'\nimport { LocalizeController } from '../localization/LocalizeController.js'\nimport style from './Calendar.css'\n\nimport { DateSelectEvent } from './DateSelectEvent.js'\nimport '../button/Button.js'\nimport '../visually-hidden/VisuallyHidden.js'\n\nexport type DatePredicate = (date: Date) => boolean\n\nIcon.registerIcon(arrowRightIcon)\nIcon.registerIcon(arrowLeftIcon)\nIcon.registerIcon(arrowDownIcon)\n\nfunction preventDefault(fn: EventListener) {\n return (e: Event) => {\n e.preventDefault()\n fn(e)\n }\n}\n\nconst isDateDisabled: DatePredicate = () => false\nconst isDateHighlighted = () => false\n\nconst dialogLabelId = 'dialog-header'\n\n/**\n * Calendar allows user to pick a date. It comes with built-in\n * functionality that allows you to set a minimum and a maximum allowed date.\n * Please note that the date must be passed in ISO-8601 format.\n *\n * @status ready\n * @category list\n * @fires {DateSelectEvent} change - Dispatched when a date is selected and the value changes.\n * @fires {DateSelectEvent} nord-focus-date - Dispatched when the calendar's focused date changes.\n *\n * @cssprop [--n-calendar-border-radius=var(--n-border-radius)] - Controls how rounded the corners are, using [border radius tokens](/tokens/#border-radius).\n * @cssprop [--n-calendar-box-shadow=var(--n-box-shadow-popout)] - Controls the surrounding shadow, using [box shadow tokens](/tokens/#box-shadow).\n *\n * @localization prevMonthLabel - Accessible label for the previous month button.\n * @localization nextMonthLabel - Accessible label for the next month button.\n * @localization monthSelectLabel - Accessible label for the month select.\n * @localization yearSelectLabel - Accessible label for the year select.\n */\n@customElement('nord-calendar')\nexport default class Calendar extends LitElement {\n static styles = [componentStyle, style]\n\n @query('.n-calendar-select-month', true) private monthSelectNode!: HTMLElement\n @query(`button[tabindex=\"0\"]`) private focusedDayNode!: HTMLButtonElement\n\n private direction = new DirectionController(this)\n private swipe = new SwipeController(this, {\n matchesGesture: isHorizontalSwipe,\n onSwipeEnd: ({ distX }) => this.addMonths(distX < 0 ? 1 : -1),\n })\n\n private shortcuts = createKeybindingsHandler({\n 'ArrowRight': preventDefault(() => this.addDays(this.direction.isLTR ? 1 : -1)),\n 'ArrowLeft': preventDefault(() => this.addDays(this.direction.isLTR ? -1 : 1)),\n 'ArrowDown': preventDefault(() => this.addDays(7)),\n 'ArrowUp': preventDefault(() => this.addDays(-7)),\n 'Home': preventDefault(() => this.startOfWeek()),\n 'End': preventDefault(() => this.endOfWeek()),\n 'PageUp': preventDefault(() => this.addMonths(-1)),\n 'PageDown': preventDefault(() => this.addMonths(1)),\n 'Shift+PageUp': preventDefault(() => this.addYears(-1)),\n 'Shift+PageDown': preventDefault(() => this.addYears(1)),\n })\n\n private localize = new LocalizeController<'nord-calendar'>(this, {\n onLangChange: () => this.handleLangChange(),\n })\n\n /**\n * Whilst dateAdapter is used for handling the formatting/parsing dates in the input,\n * these are used to format dates exclusively for the benefit of screen readers.\n *\n * We prefer DateTimeFormat over date.toLocaleDateString, as the former has\n * better performance when formatting large number of dates. See:\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString#Performance\n */\n private dateFormatShort!: Intl.DateTimeFormat\n private monthNames!: string[]\n private monthNamesShort!: string[]\n private dayNames!: string[]\n private dayNamesShort!: string[]\n\n /**\n * The selected date on the calendar. Must be in IS0-8601 format: YYYY-MM-DD.\n */\n @property() value: string = ''\n\n /**\n * Which day is considered first day of the week? `0` for Sunday, `1` for Monday, etc.\n * Default is Monday.\n */\n @property({ reflect: true, type: Number, attribute: 'first-day-of-week' }) firstDayOfWeek: DaysOfWeek\n = DaysOfWeek.Monday\n\n /**\n * Minimum date allowed to be picked. Must be in IS0-8601 format: YYYY-MM-DD.\n * This setting can be used alone or together with the max property.\n */\n @property({ reflect: true }) min?: string\n\n /**\n * Maximum date allowed to be picked. Must be in IS0-8601 format: YYYY-MM-DD.\n * This setting can be used alone or together with the min property.\n */\n @property({ reflect: true }) max?: string\n\n /**\n * The date that is considered today. Must be in IS0-8601 format: YYYY-MM-DD.\n * If not set, the current local date of the user is used.\n */\n @property({ reflect: true }) today?: string\n\n /**\n * Controls whether the calendar expands to fill the width of its container.\n */\n @property({ reflect: true, type: Boolean }) expand = false\n\n /**\n * Controls which days are disabled and therefore disallowed.\n * For example, this can be used to disallow selection of weekends.\n */\n @property({ attribute: false }) isDateDisabled: DatePredicate = isDateDisabled\n\n /**\n * Controls which days are highlighted with a small indicator.\n * Returning a \"falsy\" value will not show an indicator.\n * Returning \"truthy\" value will show the indicator, but without an accessible label.\n * Returning a string will show the indicator, and use the string as accessible label.\n * It is recommended to return a string rather than a truthy value whenever possible.\n */\n @property({ attribute: false }) isDateHighlighted: (date: Date) => string | boolean = isDateHighlighted\n\n @state() private activeFocus = false\n @state() private focusedDay = new Date()\n\n /**\n * Programmatically move focus to the calendar.\n * @param options An object which controls aspects of the focusing process.\n */\n focus(options?: FocusOptions & { target: 'day' | 'month' }) {\n const target = options?.target ?? 'day'\n\n if (target === 'day') {\n this.focusedDayNode.focus()\n }\n else if (target === 'month') {\n this.monthSelectNode.focus()\n }\n }\n\n render() {\n const today = this.getToday()\n const valueAsDate = parseISODate(this.value)\n const focusedMonth = this.focusedDay.getMonth()\n const focusedYear = this.focusedDay.getFullYear()\n\n const minDate = parseISODate(this.min || '')\n const maxDate = parseISODate(this.max || '')\n const minDateStartOfMonth = minDate ? startOfMonth(minDate) : undefined\n const maxDateEndOfMonth = maxDate ? endOfMonth(maxDate) : undefined\n\n const currentYear = today.getFullYear()\n const minYear = minDate ? minDate.getFullYear() : currentYear - 100\n const maxYear = maxDate ? maxDate.getFullYear() : currentYear + 10\n\n if (isServer) {\n // Needed when run on a server, because the `onLangChange` callback does not get triggered, so we need to manually\n // call `handleLangChange` to set the localized values for month and day names, which the `render` method relies on.\n this.handleLangChange()\n }\n\n return html`\n <div class=\"n-calendar\">\n <div class=\"n-calendar-header\">\n <div>\n <nord-visually-hidden>\n <h2 id=${dialogLabelId} aria-live=\"polite\" aria-atomic=\"true\">\n ${this.monthNames[focusedMonth]}, ${this.focusedDay.getFullYear()}\n </h2>\n </nord-visually-hidden>\n\n <div class=\"n-calendar-select\">\n <select\n aria-label=${this.localize.term('monthSelectLabel')}\n class=\"n-calendar-select-month\"\n @input=${this.handleMonthSelect}\n >\n ${this.monthNames.map(\n (month, i) => html`\n <option\n value=${i}\n ?selected=${i === focusedMonth}\n ?disabled=${!inRange(new Date(focusedYear, i, 1), minDateStartOfMonth, maxDateEndOfMonth)}\n >\n ${month}\n </option>\n `,\n )}\n </select>\n <div class=\"n-calendar-select-label\" aria-hidden=\"true\">\n <span>${this.monthNamesShort[focusedMonth]}</span>\n <nord-icon color=\"var(--n-color-icon)\" name=\"arrow-down-small\" size=\"xxs\"></nord-icon>\n </div>\n </div>\n\n <div class=\"n-calendar-select\">\n <select\n aria-label=${this.localize.term('yearSelectLabel')}\n class=\"n-calendar-select-year\"\n @input=${this.handleYearSelect}\n >\n ${repeat(\n range(minYear, maxYear),\n year => year,\n year => html`<option ?selected=${year === focusedYear}>${year}</option>`,\n )}\n </select>\n <div class=\"n-calendar-select-label\" aria-hidden=\"true\">\n <span>${this.focusedDay.getFullYear()}</span>\n <nord-icon color=\"var(--n-color-icon)\" name=\"arrow-down-small\" size=\"xxs\"></nord-icon>\n </div>\n </div>\n </div>\n\n <div class=\"n-calendar-nav\">\n <nord-button\n class=\"n-calendar-prev\"\n @click=${this.handlePreviousMonthClick}\n ?disabled=${isEqualMonth(minDate, this.focusedDay)}\n type=\"button\"\n >\n <nord-visually-hidden>${this.localize.term('prevMonthLabel')}</nord-visually-hidden>\n <nord-icon name=${this.direction.isLTR ? 'arrow-left-small' : 'arrow-right-small'} size=\"s\"></nord-icon>\n </nord-button>\n\n <nord-button\n class=\"n-calendar-next\"\n @click=${this.handleNextMonthClick}\n ?disabled=${isEqualMonth(maxDate, this.focusedDay)}\n type=\"button\"\n >\n <nord-visually-hidden>${this.localize.term('nextMonthLabel')}</nord-visually-hidden>\n <nord-icon name=${this.direction.isLTR ? 'arrow-right-small' : 'arrow-left-small'} size=\"s\"></nord-icon>\n </nord-button>\n </div>\n </div>\n\n <table\n class=\"n-calendar-table\"\n aria-labelledby=${dialogLabelId}\n @focusin=${this.enableActiveFocus}\n @focusout=${this.disableActiveFocus}\n >\n <thead>\n <tr>\n ${mapWithOffset(\n this.dayNames,\n this.firstDayOfWeek,\n (dayName, i) => html`\n <th class=\"n-calendar-table-header\" scope=\"col\">\n <span aria-hidden=\"true\">${this.dayNamesShort[i]}</span>\n <nord-visually-hidden>${dayName}</nord-visually-hidden>\n </th>\n `,\n )}\n </tr>\n </thead>\n <tbody>\n ${chunk(getViewOfMonth(this.focusedDay, this.firstDayOfWeek), 7).map(\n week => html`\n <tr class=\"n-calendar-row\">\n ${week.map((day) => {\n const outsideRange = !inRange(day, minDate, maxDate)\n const isToday = isEqual(day, today)\n const isDisabled = this.isDateDisabled(day)\n const isSelected = isEqual(day, valueAsDate)\n const isInMonth = isEqualMonth(day, this.focusedDay)\n const isHighlighted = this.isDateHighlighted(day)\n const formattedDate = this.dateFormatShort.format(day)\n\n const accessibleLabel\n = isHighlighted && typeof isHighlighted === 'string'\n ? `${formattedDate}, ${isHighlighted}`\n : formattedDate\n\n return html`\n <td class=\"n-calendar-cell\">\n <button\n type=\"button\"\n tabindex=${isEqual(day, this.focusedDay) ? 0 : -1}\n class=${classMap({\n 'n-calendar-day': true,\n 'is-outside': outsideRange,\n 'is-month': isInMonth,\n 'is-highlighted': isHighlighted,\n })}\n @click=${() => this.handleDaySelect(day)}\n @keydown=${this.shortcuts}\n ?disabled=${outsideRange}\n aria-disabled=${cond(isDisabled, 'true')}\n aria-pressed=${isSelected ? 'true' : 'false'}\n aria-current=${cond(isToday, 'date')}\n aria-label=${accessibleLabel}\n >\n <span aria-hidden=\"true\">${day.getDate()}</span>\n </button>\n </td>\n `\n })}\n </tr>\n `,\n )}\n </tbody>\n </table>\n </div>\n `\n }\n\n @observe('value')\n protected handleValueChange() {\n this.setFocusedDay(parseISODate(this.value) || this.getToday())\n }\n\n @observe('focusedDay', 'updated')\n protected handleFocusedDayChange() {\n if (this.activeFocus) {\n this.focusedDayNode.focus()\n }\n }\n\n private handleLangChange() {\n const lang = this.localize.resolvedLang\n this.dateFormatShort = new Intl.DateTimeFormat(lang, { day: 'numeric', month: 'long' })\n this.monthNames = getMonthNames(lang, 'long')\n this.monthNamesShort = getMonthNames(lang, 'short')\n this.dayNames = getDayNames(lang, 'long')\n this.dayNamesShort = getDayNames(lang, 'narrow')\n }\n\n private handleDaySelect = (day: Date) => {\n const isInRange = inRange(day, parseISODate(this.min || ''), parseISODate(this.max || ''))\n const isAllowed = !this.isDateDisabled(day)\n\n if (isInRange && isAllowed) {\n this.value = printISODate(day)\n this.dispatchEvent(new DateSelectEvent('change', day))\n }\n }\n\n private getToday() {\n return parseISODate(this.today || '') || new Date()\n }\n\n private addDays(days: number) {\n this.setFocusedDay(addDays(this.focusedDay, days))\n }\n\n private addMonths(months: number) {\n this.setMonth(this.focusedDay.getMonth() + months)\n }\n\n private addYears(years: number) {\n this.setYear(this.focusedDay.getFullYear() + years)\n }\n\n private startOfWeek() {\n this.setFocusedDay(startOfWeek(this.focusedDay, this.firstDayOfWeek))\n }\n\n private endOfWeek() {\n this.setFocusedDay(endOfWeek(this.focusedDay, this.firstDayOfWeek))\n }\n\n private setMonth(month: number) {\n const min = setMonth(startOfMonth(this.focusedDay), month)\n const max = endOfMonth(min)\n const date = setMonth(this.focusedDay, month)\n\n this.setFocusedDay(clamp(date, min, max))\n }\n\n private setYear(year: number) {\n const min = setYear(startOfMonth(this.focusedDay), year)\n const max = endOfMonth(min)\n const date = setYear(this.focusedDay, year)\n\n this.setFocusedDay(clamp(date, min, max))\n }\n\n private setFocusedDay(day: Date) {\n this.focusedDay = clamp(day, parseISODate(this.min || ''), parseISODate(this.max || ''))\n this.dispatchEvent(new DateSelectEvent('nord-focus-date', this.focusedDay))\n }\n\n private handleMonthSelect = (e: Event) => {\n this.setMonth(Number.parseInt((e.target as HTMLSelectElement).value, 10))\n }\n\n private handleYearSelect = (e: Event) => {\n this.setYear(Number.parseInt((e.target as HTMLSelectElement).value, 10))\n }\n\n private handleNextMonthClick = (event: MouseEvent) => {\n event.preventDefault()\n this.addMonths(1)\n }\n\n private handlePreviousMonthClick = (event: MouseEvent) => {\n event.preventDefault()\n this.addMonths(-1)\n }\n\n private enableActiveFocus = () => {\n this.activeFocus = true\n }\n\n private disableActiveFocus = (e: FocusEvent) => {\n const table = e.currentTarget as Node\n const relatedTarget = e.relatedTarget as Node\n\n if (relatedTarget && !table.contains(relatedTarget)) {\n this.activeFocus = false\n }\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-calendar': Calendar\n }\n}\n","import { html, LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { SlotController } from '../common/controllers/SlotController.js'\nimport componentStyle from '../common/styles/Component.css'\nimport style from './Card.css'\n\n/**\n * Cards are shadowed surfaces that display content and actions on a\n * single topic. They should be easy to scan for relevant and\n * actionable information.\n *\n * @status ready\n * @category structure\n * @slot - The card content.\n * @slot header - Optional slot that holds a header for the card.\n * @slot header-end - Optional slot that positions content at the end of the header. Useful for actions or additional info.\n * @slot footer - Optional slot that holds footer content for the card.\n *\n * @cssprop [--n-card-border-radius=var(--n-border-radius)] - Controls how rounded the corners are, using [border radius tokens](/tokens/#border-radius).\n * @cssprop [--n-card-box-shadow=var(--n-box-shadow-popout)] - Controls the surrounding shadow, using [box shadow tokens](/tokens/#box-shadow).\n * @cssprop [--n-card-padding=var(--n-space-m)] - Controls the padding on all sides of the card.\n * @cssprop [--n-card-slot-padding=var(--n-space-m)] - Controls the padding of items slotted within the card. This does not affect the block padding of items slotted into the header.\n * @cssprop [--n-card-header-background=transparent] - Controls the background color of the card header.\n * @cssprop [--n-card-border-color=var(--n-color-border)] - Controls the border color of the card header and footer divider.\n * @cssprop [--n-card-header-padding-block=var(--n-space-m)] - Controls the block (top and bottom) padding of the card header.\n * @cssprop [--n-card-header-padding-inline=var(--n-card-slot-padding)] - Controls the inline (left and right) padding of the card header.\n * @cssprop [--n-card-header-slot-flex-grow=0] - Controls the flex-grow value of the header slot.\n */\n@customElement('nord-card')\nexport default class Card extends LitElement {\n static styles = [componentStyle, style]\n\n private headerSlot = new SlotController(this, 'header')\n private headerEndSlot = new SlotController(this, 'header-end')\n private footerSlot = new SlotController(this, 'footer')\n\n /**\n * Controls the padding of the card component. When set to “none”,\n * the header and footer slots will still have padding.\n */\n @property({ reflect: true }) padding: 'm' | 'l' | 'none' = 'm'\n\n /**\n * When set, adds a divider border above the footer slot.\n */\n @property({ type: Boolean, reflect: true, attribute: 'footer-divider' }) footerDivider = false\n\n render() {\n return html`\n <div class=\"n-card\">\n <div class=\"header\" ?hidden=${this.headerSlot.isEmpty && this.headerEndSlot.isEmpty}>\n <slot name=${this.headerSlot.slotName}></slot>\n <slot name=${this.headerEndSlot.slotName}></slot>\n </div>\n <slot></slot>\n <slot name=${this.footerSlot.slotName} ?hidden=${this.footerSlot.isEmpty}></slot>\n </div>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-card': Card\n }\n}\n","export default '<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m18.9985 5.35769-9.8419 10.83221c-.27855.3095-.68088.4952-1.11417.5107h-.03095c-.41782 0-.80469-.1548-1.0987-.4488l-5.91132-5.9113 2.18193-2.1819 4.76619 4.7662 8.75862-9.62524 2.2903 2.08908z\" fill=\"currentColor\"/></svg>';\nexport const title = \"interface-checked-small\";\nexport const tags =\n \"nordicon interface checked small symbol checkmark done ready\";\n","export default '<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m20 8.49976v3.00004h-20v-3.00004z\" fill=\"currentColor\"/></svg>';\nexport const title = \"interface-remove-small\";\nexport const tags =\n \"nordicon interface remove small delete erase minimize line\";\n","import type { ReactiveController, ReactiveControllerHost } from 'lit'\nimport type { InputMixinInterface } from '../mixins/InputMixin.js'\n\ninterface FormDataOptions {\n value: () => string | undefined\n}\n\nexport class FormDataController implements ReactiveController {\n private _form: HTMLFormElement | null = null\n\n constructor(\n private host: ReactiveControllerHost & InputMixinInterface,\n private options: FormDataOptions,\n ) {\n host.addController(this)\n }\n\n hostConnected() {\n this.listen(this.host.form)\n }\n\n hostUpdated() {\n this.listen(this.host.form)\n }\n\n hostDisconnected() {\n this.cleanup()\n }\n\n private listen(form: HTMLFormElement | null) {\n if (this._form !== form) {\n this.cleanup()\n this._form = form\n this._form?.addEventListener('formdata', this.handleFormData)\n }\n }\n\n private cleanup() {\n this._form?.removeEventListener('formdata', this.handleFormData)\n this._form = null\n }\n\n private handleFormData = (e: FormDataEvent) => {\n const { disabled, name } = this.host\n\n if (disabled) {\n return\n }\n if (!name) {\n return\n }\n\n const value = this.options.value()\n if (value != null) {\n e.formData.append(name, value)\n }\n }\n}\n","import type { LitElement, TemplateResult } from 'lit'\nimport type { InputMixinInterface } from './InputMixin.js'\nimport { html, nothing } from 'lit'\nimport { property } from 'lit/decorators.js'\nimport { FormDataController } from '../controllers/FormDataController.js'\nimport { SlotController } from '../controllers/SlotController.js'\nimport { NordEvent } from '../events.js'\nimport '../../visually-hidden/VisuallyHidden.js'\n\ntype Constructor<T = Record<string, unknown>> = new (...args: any[]) => T\ntype NativeInputElement = HTMLSelectElement | HTMLInputElement | HTMLTextAreaElement\n\nexport declare class FormAssociatedMixinInterface {\n label: string\n required: boolean\n hideRequired: boolean\n hint?: string\n hintBelow: boolean\n hideLabel: boolean\n placeholder?: string\n error?: string\n\n protected inputId: string\n protected errorId: string\n protected hintId: string\n protected labelSlot: SlotController\n protected hintSlot: SlotController\n protected errorSlot: SlotController\n protected formData: FormDataController\n\n protected get formValue(): string | undefined\n protected get hasError(): boolean\n protected get hasHint(): boolean\n protected get isHintBelow(): boolean\n\n protected handleChange(e: Event): void\n protected handleInput(e: Event): void\n protected renderLabel(additionalContent?: TemplateResult): TemplateResult\n protected renderHint(): TemplateResult\n protected renderError(): TemplateResult\n protected getDescribedBy(): string | undefined\n protected getInvalid(): 'true' | undefined\n}\n\nexport function FormAssociatedMixin<T extends Constructor<InputMixinInterface & LitElement>>(superClass: T) {\n // TODO: would be nice if custom elements analyzer could pick up the slot docs from the mixin\n\n /**\n * @slot label - Use when a label requires more than plain text.\n * @slot hint - Use when a hint requires more than plain text.\n * @slot error - Optional slot that holds error text for the input.\n */\n class FormAssociatedElement extends superClass {\n protected labelSlot = new SlotController(this, 'label')\n protected errorSlot = new SlotController(this, 'error')\n protected hintSlot = new SlotController(this, 'hint')\n protected formData = new FormDataController(this, { value: () => this.formValue })\n\n protected get formValue() {\n return this.value\n }\n\n protected inputId = 'input'\n protected errorId = 'error'\n protected hintId = 'hint'\n\n /**\n * Label for the input.\n */\n @property({ reflect: true }) label: string = ''\n\n /**\n * Optional hint text to be displayed with the input. Alternatively use the hint slot.\n */\n @property({ reflect: true }) hint?: string\n\n /**\n * Renders the hint below the input and any error instead of below the label.\n */\n @property({ reflect: true, type: Boolean, attribute: 'hint-below' }) hintBelow = false\n\n /**\n * Visually hide the label, but still show it to assistive technologies like screen readers.\n */\n @property({ reflect: true, type: Boolean, attribute: 'hide-label' }) hideLabel = false\n\n /**\n * Placeholder text to display within the input.\n */\n @property({ reflect: true }) placeholder?: string\n\n /**\n * Optional error to be shown with the input. Alternatively use the error slot.\n */\n @property({ reflect: true }) error?: string\n\n /**\n * Determines whether the input is required or not.\n * An input marked as required will be announced as such to users of assistive technology.\n * When using this property you need to also set “novalidate” attribute on a form element to prevent browser from displaying its own validation errors.\n */\n @property({ reflect: true, type: Boolean }) required = false\n\n /**\n * Visually hide the required indicator, but still show\n * required attribute to assistive technologies like screen readers.\n */\n @property({ reflect: true, type: Boolean, attribute: 'hide-required' }) hideRequired = false\n\n protected handleInput(e: Event) {\n e.stopPropagation()\n const target = e.target as NativeInputElement\n this.value = target.value\n\n /**\n * Fired as the user types into the input.\n */\n this.dispatchEvent(new NordEvent('input'))\n }\n\n protected handleChange(e: Event) {\n e.stopPropagation()\n\n /**\n * Fired whenever the input's value is changed via user interaction.\n */\n this.dispatchEvent(new NordEvent('change'))\n }\n\n protected renderLabel(additionalContent?: TemplateResult) {\n const label = html`\n <label for=${this.inputId}>\n <slot name=\"label\">${this.label}</slot\n ><span ?hidden=${!this.required || this.hideRequired} aria-hidden=\"true\" class=\"n-required\">*</span>\n ${additionalContent}\n </label>\n `\n\n if (this.hideLabel) {\n return html`\n <nord-visually-hidden>\n ${label}\n ${this.isHintBelow ? nothing : this.renderHint()}\n </nord-visually-hidden>\n `\n }\n\n return html`\n <div class=\"n-label-container\">\n ${label}\n ${this.isHintBelow ? nothing : this.renderHint()}\n </div>\n `\n }\n\n protected renderHint() {\n return html`\n <div class=\"n-caption n-hint\" id=${this.hintId} ?hidden=${!this.hasHint}>\n <slot name=\"hint\">${this.hint}</slot>\n </div>\n `\n }\n\n protected renderError() {\n return html`\n <div class=\"n-caption n-error\" id=${this.errorId} role=\"alert\" ?hidden=${!this.hasError}>\n <slot name=\"error\">${this.error}</slot>\n </div>\n `\n }\n\n protected getDescribedBy() {\n const { hasHint, hasError } = this\n\n if (hasHint && hasError) {\n if (this.isHintBelow) {\n return `${this.errorId} ${this.hintId}`\n }\n return `${this.hintId} ${this.errorId}`\n }\n if (hasHint) {\n return this.hintId\n }\n if (hasError) {\n return this.errorId\n }\n\n return undefined\n }\n\n protected getInvalid() {\n return this.hasError ? 'true' : undefined\n }\n\n protected get hasHint() {\n return Boolean(this.hint) || this.hintSlot.hasContent\n }\n\n protected get hasError() {\n return Boolean(this.error) || this.errorSlot.hasContent\n }\n\n protected get isHintBelow() {\n return this.hintBelow\n }\n }\n\n return FormAssociatedElement as unknown as Constructor<FormAssociatedMixinInterface> & T\n}\n","import type { LitElement } from 'lit'\nimport { property } from 'lit/decorators.js'\n\ntype Constructor<T = Record<string, unknown>> = new (...args: any[]) => T\n\nexport declare class SizeMixinInterface {\n size: 's' | 'm' | 'l'\n}\n\nexport function SizeMixin<T extends Constructor<LitElement>>(superClass: T): Constructor<SizeMixinInterface> & T {\n class SizeElement extends superClass {\n /**\n * The size of the component.\n */\n @property({ reflect: true }) size: 's' | 'm' | 'l' = 'm'\n }\n\n return SizeElement\n}\n","import * as checkedIcon from '@nordhealth/icons/lib/assets/interface-checked-small.js'\nimport * as indeterminateIcon from '@nordhealth/icons/lib/assets/interface-remove-small.js'\nimport { html, LitElement, nothing } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { ref } from 'lit/directives/ref.js'\n\nimport { FocusableMixin } from '../common/mixins/FocusableMixin.js'\nimport { FormAssociatedMixin } from '../common/mixins/FormAssociatedMixin.js'\nimport { InputMixin } from '../common/mixins/InputMixin.js'\nimport { SizeMixin } from '../common/mixins/SizeMixin.js'\nimport componentStyle from '../common/styles/Component.css'\n\nimport formFieldStyle from '../common/styles/FormField.css'\nimport Icon from '../icon/Icon.js'\nimport style from './Checkbox.css'\n\nIcon.registerIcon(checkedIcon)\nIcon.registerIcon(indeterminateIcon)\n\n/**\n * Checkboxes allow user to choose one or more options from a limited set of options.\n * If you have more than 10 options, please use Select component instead.\n *\n * @status ready\n * @category form\n * @slot label - Use when a label requires more than plain text.\n * @slot hint - Optional slot that holds hint text for the input.\n * @slot error - Optional slot that holds error text for the input.\n *\n * @cssprop [--n-label-color=var(--n-color-text)] - Controls the text color of the label, using our [color tokens](/tokens/#color).\n */\n@customElement('nord-checkbox')\nexport default class Checkbox extends SizeMixin(FormAssociatedMixin(InputMixin(FocusableMixin(LitElement)))) {\n static styles = [componentStyle, formFieldStyle, style]\n\n protected override get formValue() {\n return this.checked ? this.value || 'on' : undefined\n }\n\n /**\n * Controls whether the checkbox is in an indeterminate state.\n */\n @property({ reflect: true, type: Boolean }) indeterminate = false\n\n /**\n * Controls whether the checkbox is checked or not.\n */\n @property({ reflect: true, type: Boolean }) checked: boolean = false\n\n render() {\n return html`\n <div class=\"n-flex\">\n <div class=\"n-input-container\">\n <input\n ${ref(this.focusableRef)}\n class=\"n-input\"\n id=${this.inputId}\n type=\"checkbox\"\n name=${ifDefined(this.name)}\n .value=${this.value}\n .checked=${this.checked}\n .indeterminate=${this.indeterminate}\n ?disabled=${this.disabled}\n ?required=${this.required}\n aria-describedby=${ifDefined(this.getDescribedBy())}\n aria-invalid=${ifDefined(this.getInvalid())}\n @change=${this.handleChange}\n />\n <nord-icon class=\"icon-checked\" name=\"interface-checked-small\"></nord-icon>\n <nord-icon class=\"icon-indeterminate\" name=\"interface-remove-small\"></nord-icon>\n </div>\n <div class=\"n-expand\">${this.renderLabel()} ${this.isHintBelow ? nothing : this.renderError()}</div>\n </div>\n ${this.isHintBelow ? this.renderError() : nothing}\n ${this.isHintBelow ? this.renderHint() : nothing}\n `\n }\n\n protected handleChange(e: Event): void {\n const target = e.target as HTMLInputElement\n this.checked = target.checked\n super.handleChange(e)\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-checkbox': Checkbox\n }\n}\n","export default '<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m8.29008 12.3413 1.41 1.42-3.96 3.95c-.2.19-.45.29-.71.29s-.51-.1-.71-.29l-3.990002-4 1.410002-1.42 2.26 2.25v-12.54002h2v12.63002zm11.38002-6.05002-4.01-4c-.39-.39-1.02-.39-1.41 0l-3.96 3.95 1.41 1.42 2.29-2.29v12.63002h2v-12.54002l2.26 2.25 1.41-1.42z\" fill=\"currentColor\"/></svg>';\nexport const title = \"keyboard-arrow-up-down\";\nexport const tags = \"nordicon keyboard keys arrow up down shortcut\";\n","export default '<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m18 2h-10.54c-.58 0-1.14.25-1.52.7l-5.14 6c-.65.75-.65 1.85 0 2.6l5.14 6c.38.44.93.7 1.52.7h10.54c1.1 0 2-.9 2-2v-12c0-1.1-.9-2-2-2zm0 14h-10.54l-5.14-6 5.14-6h10.54zm-9.54-3.88 2.12-2.12-2.12-2.12 1.41-1.41 2.12 2.12 2.12-2.12 1.41 1.41-2.12 2.12 2.12 2.12-1.41 1.41-2.12-2.12-2.12 2.12z\" fill=\"currentColor\"/></svg>';\nexport const title = \"keyboard-backspace\";\nexport const tags = \"nordicon keyboard backspace back delete key shortcut\";\n","export default '<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m18.0025 4v8c0 1.1-.9 2-2 2h-12.59l3 3-1.41 1.41-4.71-4.7c-.39-.39-.39-1.02 0-1.41l4.71-4.71 1.41 1.41-3 3h12.59v-8h-4v-2h4c1.1 0 2 .9 2 2z\" fill=\"currentColor\"/></svg>';\nexport const title = \"keyboard-return\";\nexport const tags = \"nordicon keyboard return key shortcut\";\n","import type { ReactiveController, ReactiveControllerHost } from 'lit'\nimport type { KeyBindingMap } from 'tinykeys'\nimport tinykeys from 'tinykeys'\n\ntype ShortcutTarget = Parameters<typeof tinykeys>[0]\n\nconst ARROW_RE = /Arrow(Up|Down|Left|Right)/g\nconst ESC_RE = /Escape/g\n\nfunction normalise(shortcuts: KeyBindingMap) {\n const normalised: KeyBindingMap = {}\n\n Object.keys(shortcuts).forEach((keybinding) => {\n normalised[keybinding] = shortcuts[keybinding]\n\n // Arrow and Escape keys in IE/Edge have different names\n if (ARROW_RE.test(keybinding)) {\n const mapped = keybinding.replace(ARROW_RE, (_match, capture) => capture)\n normalised[mapped] = normalised[keybinding]\n }\n if (ESC_RE.test(keybinding)) {\n const mapped = keybinding.replace(ESC_RE, () => 'Esc')\n normalised[mapped] = normalised[keybinding]\n }\n })\n\n return normalised\n}\n\nexport class ShortcutController implements ReactiveController {\n private unregister?: ReturnType<typeof tinykeys>\n\n constructor(\n host: ReactiveControllerHost,\n private shortcuts?: KeyBindingMap,\n private target?: ShortcutTarget,\n ) {\n host.addController(this)\n }\n\n hostConnected() {\n if (this.shortcuts) {\n this.bind(this.shortcuts)\n }\n }\n\n hostDisconnected() {\n this.unbind()\n }\n\n unbind() {\n this.unregister?.()\n }\n\n bind(shortcuts: KeyBindingMap) {\n this.unbind()\n this.shortcuts = shortcuts\n this.unregister = tinykeys(this.target ?? window, normalise(this.shortcuts))\n }\n}\n\nexport type { KeyBindingMap as ShortcutMap }\n","import type { ReactiveController, ReactiveControllerHost } from 'lit'\nimport { EventController } from './EventController.js'\nimport { ShortcutController } from './ShortcutController.js'\n\nexport interface LightDismissOptions {\n isOpen: () => boolean\n onDismiss: EventListener\n isDismissible?: (node: EventTarget) => boolean\n}\n\nexport class LightDismissController implements ReactiveController {\n private shortcut: ShortcutController\n private events: EventController\n\n private isMouseDownOutside = false\n\n constructor(\n private host: ReactiveControllerHost & Element,\n private options: LightDismissOptions,\n ) {\n host.addController(this)\n this.shortcut = new ShortcutController(host, { Escape: this.handleEsc })\n this.events = new EventController(host)\n }\n\n hostConnected() {\n this.events.listen(document, 'mousedown', this.handleMouseDown, true)\n this.events.listen(document, 'click', this.handleClick, true)\n }\n\n private handleEsc = (e: KeyboardEvent) => {\n if (!this.options.isOpen()) {\n return\n }\n\n this.options.onDismiss(e)\n }\n\n private handleMouseDown = (e: MouseEvent) => {\n if (!this.options.isOpen()) {\n return\n }\n\n const predicate: LightDismissOptions['isDismissible'] = this.options.isDismissible ?? (node => node !== this.host)\n this.isMouseDownOutside = e.composedPath().every(predicate)\n }\n\n private handleClick = (e: MouseEvent) => {\n if (!this.options.isOpen()) {\n return\n }\n\n const predicate: LightDismissOptions['isDismissible'] = this.options.isDismissible ?? (node => node !== this.host)\n const isClickOutside = e.composedPath().every(predicate)\n\n const shouldDismiss = isClickOutside && this.isMouseDownOutside\n\n if (shouldDismiss) {\n this.options.onDismiss(e)\n }\n }\n}\n","/**\n * Gets the currently focused element, taking shadow roots into account.\n */\nexport function getFocusedElement(root: Document | ShadowRoot): Element | undefined {\n if (root.activeElement?.shadowRoot) {\n return getFocusedElement(root.activeElement.shadowRoot)\n }\n\n return root.activeElement || undefined\n}\n","import type { ReactiveController } from 'lit'\nimport type { ShortcutMap } from '../common/controllers/ShortcutController.js'\nimport type CommandMenu from './CommandMenu.js'\nimport { ShortcutController } from '../common/controllers/ShortcutController.js'\n\ninterface KeyboardActions {\n trigger: () => void\n goBack: () => void\n start: () => void\n end: () => void\n next: () => void\n previous: () => void\n toggleOpen: () => void\n}\n\nfunction preventDefault(fn: (e: Event) => void) {\n return (e: Event) => {\n e.preventDefault()\n fn(e)\n }\n}\n\nexport class KeyboardController {\n private globalShortcuts: ShortcutController\n private navigationShortcuts: ShortcutController\n private commandShortcuts: ShortcutController\n\n constructor(\n private host: CommandMenu,\n actions: KeyboardActions,\n ) {\n host.addController(this as ReactiveController)\n\n this.commandShortcuts = new ShortcutController(host)\n this.globalShortcuts = new ShortcutController(host, { '$mod+k': preventDefault(actions.toggleOpen) })\n this.navigationShortcuts = new ShortcutController(\n host,\n {\n Enter: preventDefault(actions.trigger),\n Backspace: actions.goBack, // we don't want to prevent default, since that would stop backspace deleting chars\n End: preventDefault(actions.end),\n Home: preventDefault(actions.start),\n ArrowDown: preventDefault(actions.next),\n ArrowUp: preventDefault(actions.previous),\n },\n host,\n )\n }\n\n registerCommandShortcuts() {\n const shortcuts: ShortcutMap = {}\n\n for (const command of this.host.commands) {\n if (command.shortcut) {\n shortcuts[command.shortcut] = () => command.handler?.(this.host)\n }\n }\n\n this.commandShortcuts.bind(shortcuts)\n }\n}\n","import type { ICommandMenuAction } from './ICommandMenuAction.js'\nimport { NordEvent } from '../common/events.js'\n\nexport class SelectEvent extends NordEvent {\n static eventName = 'nord-select'\n\n constructor(public command: ICommandMenuAction) {\n super(SelectEvent.eventName)\n }\n}\n","export default '<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><g fill=\"currentColor\"><path d=\"m14.4101 18.0001-1.42 1.41-8.70004-8.74c-.39-.39-.39-1.02001 0-1.41001l8.64004-8.670002 1.42 1.410002-7.94004 7.97 8.00004 8.04001z\"/><path d=\"m14.4101 18.0001-1.42 1.41-8.70004-8.74c-.39-.39-.39-1.02001 0-1.41001l8.64004-8.670002 1.42 1.410002-7.94004 7.97 8.00004 8.04001z\"/></g></svg>';\nexport const title = \"arrow-left\";\nexport const tags = \"nordicon arrow left caret pointing triangle chevron\";\n","export default '<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m14.7098 10.7401-8.63996 8.67-1.42-1.41 7.93996-7.97-7.99996-8.03001 1.42-1.410002 8.69996 8.740002c.39.39.39 1.02001 0 1.41001z\" fill=\"currentColor\"/></svg>';\nexport const title = \"arrow-right\";\nexport const tags = \"nordicon arrow right caret pointing triangle chevron\";\n","export default '<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m13.5 14h6.5v2h-6.5c-.63 0-1.22-.3-1.6-.8l-5.4-7.2h-6.5v-2h6.5c.63 0 1.22.3 1.6.8zm-1.5-8v2h8v-2z\" fill=\"currentColor\"/></svg>';\nexport const title = \"keyboard-option\";\nexport const tags = \"nordicon keyboard option key shortcut\";\n","import type { ICommandMenuAction } from './ICommandMenuAction.js'\nimport * as chevronIconLeft from '@nordhealth/icons/lib/assets/arrow-left.js'\nimport * as chevronIconRight from '@nordhealth/icons/lib/assets/arrow-right.js'\nimport * as altKeyIcon from '@nordhealth/icons/lib/assets/keyboard-option.js'\nimport { html, LitElement, nothing } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { classMap } from 'lit/directives/class-map.js'\nimport { DirectionController } from '../common/controllers/DirectionController.js'\nimport { observe } from '../common/decorators/observe.js'\nimport Icon from '../icon/Icon.js'\nimport style from './CommandMenuAction.css'\n\nimport '../visually-hidden/VisuallyHidden.js'\n\nconst KEY_REGEX = /(?:Key|Digit)([A-Z0-9])/g\nconst isMacintosh = () => navigator.platform.includes('Mac')\n\nIcon.registerIcon(chevronIconLeft)\nIcon.registerIcon(chevronIconRight)\nIcon.registerIcon(altKeyIcon)\n\n/**\n * Command Menu Action displays a single action that can be executed by the user. For usage examples, please see Command Menu component.\n *\n * @status internal\n */\n@customElement('nord-command-menu-action')\nexport default class CommandMenuAction extends LitElement {\n static styles = style\n\n private direction = new DirectionController(this)\n\n @property({ type: Object }) command!: ICommandMenuAction\n\n @property({ type: Boolean }) selected = false\n\n override render() {\n return html`\n <div\n class=${classMap({\n 'n-selected': this.selected,\n 'n-command': true,\n })}\n >\n <div aria-hidden=\"true\" class=\"n-command-icon\">\n <nord-icon size=\"s\" name=${this.getIconName()}></nord-icon>\n </div>\n <div class=\"n-title\">${this.command.title}</div>\n ${this.renderShortcut()}\n </div>\n `\n }\n\n /**\n * Scroll to show element\n */\n @observe('selected')\n protected ensureInView() {\n if (this.selected) {\n requestAnimationFrame(() => this.scrollIntoView({ block: 'nearest' }))\n }\n }\n\n private getIconName() {\n if (this.command.icon) {\n return this.command.icon\n }\n\n return this.direction.isLTR ? chevronIconRight.title : chevronIconLeft.title\n }\n\n private renderShortcut() {\n if (!this.command.shortcut) {\n return nothing\n }\n\n const keys = this.command.shortcut.replace(KEY_REGEX, '$1')\n\n return html`\n <nord-visually-hidden>, ${keys}</nord-visually-hidden>\n\n <div aria-hidden=\"true\" class=\"n-shortcuts\">\n ${keys\n .split('+')\n .map(\n key =>\n html`<div class=\"n-shortcut\">\n ${key.toLowerCase() === 'alt' && isMacintosh()\n ? html`<nord-icon name=${altKeyIcon.title} size=\"s\"></nord-icon>`\n : key}\n </div>`,\n )}\n </div>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-command-menu-action': CommandMenuAction\n }\n}\n","import type { ICommandMenuAction } from './ICommandMenuAction.js'\nimport * as navigateIcon from '@nordhealth/icons/lib/assets/keyboard-arrow-up-down.js'\nimport * as backspaceIcon from '@nordhealth/icons/lib/assets/keyboard-backspace.js'\nimport * as enterIcon from '@nordhealth/icons/lib/assets/keyboard-return.js'\nimport { html, LitElement, nothing } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\n\nimport { classMap } from 'lit/directives/class-map.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { createRef, ref } from 'lit/directives/ref.js'\n\nimport { repeat } from 'lit/directives/repeat.js'\nimport { groupBy } from '../common/collection.js'\nimport { LightDismissController } from '../common/controllers/LightDismissController.js'\nimport { observe } from '../common/decorators/observe.js'\nimport { cond } from '../common/directives/cond.js'\nimport { NordEvent } from '../common/events.js'\n\nimport { getFocusedElement } from '../common/focus.js'\nimport { wrap } from '../common/number.js'\nimport componentStyle from '../common/styles/Component.css'\nimport Icon from '../icon/Icon.js'\nimport { LocalizeController } from '../localization/LocalizeController.js'\nimport style from './CommandMenu.css'\nimport { KeyboardController } from './KeyboardController.js'\nimport { SelectEvent } from './SelectEvent.js'\nimport '../visually-hidden/VisuallyHidden.js'\nimport './CommandMenuAction.js'\n\nIcon.registerIcon(navigateIcon)\nIcon.registerIcon(enterIcon)\nIcon.registerIcon(backspaceIcon)\n\n/**\n * Command Menu allows users to navigate and use an app without\n * touching the mouse and helps them transform into “power users”\n * who can harness more advanced features far faster.\n *\n * @status ready\n * @category action\n * @slot footer - Used to replace the default footer contents.\n * @fires open - The command menu was opened.\n * @fires close - The command menu was closed.\n * @fires {SelectEvent} nord-select - User selected a command from the menu.\n *\n * @cssprop [--n-command-menu-inline-size=640px] - Controls the max inline size, or width, of the command menu.\n * @cssprop [--n-command-menu-block-size=290px] - Controls the max block size, or height, of the command menu.\n * @cssprop [--n-command-menu-block-start=16%] - Controls the command menu offset from the block start, or top, of the screen.\n *\n * @localization instructions - Instructions that offer guidance on how to use the command menu.\n * @localization inputLabel - Accessible label given to the command menu's input.\n * @localization footerArrowKeys - Describes what the arrow keys do.\n * @localization footerEnterKey - Describes what the enter key does.\n * @localization footerEscapeKey - Describes what the escape key does.\n * @localization footerBackspaceKey - Describes what the backspace key does.\n * @localization noResults - A message shown when there are no matching results.\n * @localization tip - A hint tip that describes some approaches to find a command when there are no matching results.\n * @localization placeholder - Hint text to display in the Command Menu search field.\n */\n@customElement('nord-command-menu')\nexport default class CommandMenu extends LitElement {\n static styles = [componentStyle, style]\n\n private inputRef = createRef<HTMLInputElement>()\n private listRef = createRef<HTMLElement>()\n private previousFocus?: HTMLElement\n\n private localize = new LocalizeController<'nord-command-menu'>(this)\n private dismissController = new LightDismissController(this, {\n isOpen: () => this.open,\n onDismiss: () => this.close(),\n })\n\n private keyboardController = new KeyboardController(this, {\n trigger: () => this.select(),\n goBack: () => this.goBack(),\n end: () => this.end(),\n start: () => this.start(),\n next: () => this.next(),\n previous: () => this.previous(),\n toggleOpen: () => this.toggleOpen(),\n })\n\n /**\n * Show or hide the command menu.\n */\n @property({ reflect: true, type: Boolean }) open = false\n\n /**\n * Use external filtering mode. When set to true, the component will not perform\n * internal text-based filtering and expects external filtering logic to be implemented.\n */\n @property({ reflect: true, type: Boolean, attribute: 'external-filtering' }) externalFiltering = false\n\n /**\n * When enabled, typing in the search input will automatically exit nested views\n * to allow global search across all commands.\n */\n @property({ reflect: true, type: Boolean, attribute: 'exit-nested-on-search' }) exitNestedOnSearch = false\n\n /**\n * Array of commands to be included in the menu.\n * Please see “Commands data” section for more documentation.\n */\n @property({ type: Array, attribute: false }) commands: Array<ICommandMenuAction> = []\n\n /**\n * Current search query in the command menu input.\n */\n @property({ type: String, attribute: false }) searchQuery: string = ''\n\n @state() private parent: ICommandMenuAction['parent']\n @state() private bump = true\n @state() private selectedIndex = 0\n @state() private filteredCommands: Array<ICommandMenuAction> = []\n\n private get selected(): ICommandMenuAction {\n return this.filteredCommands[this.selectedIndex]\n }\n\n /**\n * Show the command menu programmatically.\n * @param options - Options for showing the menu.\n * @param options.parent - Opens the menu filtered to a specific parent command.\n */\n show(options: { parent?: string } = {}) {\n const notCancelled = this.dispatchEvent(new NordEvent('open', { cancelable: true }))\n\n if (notCancelled) {\n this.open = true\n this.setParent(options.parent)\n }\n }\n\n /**\n * Close the command menu programmatically.\n */\n close() {\n this.open = false\n this.previousFocus?.focus()\n this.previousFocus = undefined\n\n this.dispatchEvent(new NordEvent('close'))\n }\n\n /**\n * Toggle the open state programmatically.\n */\n toggleOpen() {\n if (this.open) {\n this.close()\n }\n else {\n this.show()\n }\n }\n\n /**\n * Focus the command menu's input.\n */\n focus() {\n this.inputRef.value?.focus()\n }\n\n override render() {\n const sections = groupBy(this.filteredCommands, 'section')\n const activeDescendant = this.filteredCommands.length === 0 ? 'no-results' : this.selected?.id\n\n return html`\n <div\n class=${classMap({\n 'n-visible': this.open,\n 'n-modal': true,\n })}\n >\n <div\n @animationend=${this.handleAnimationEnd}\n class=${classMap({\n 'n-bump': this.bump,\n 'n-modal-content': true,\n })}\n >\n <div class=\"n-search-wrapper\">\n <nord-visually-hidden id=\"instructions\">${this.localize.term('instructions')}</nord-visually-hidden>\n <input\n type=\"text\"\n id=\"search\"\n @input=${this.handleInput}\n @blur=${this.handleBlur}\n ${ref(this.inputRef)}\n placeholder=${this.localize.term('placeholder')}\n .value=${this.searchQuery}\n spellcheck=\"false\"\n autocomplete=\"off\"\n autocapitalize=\"off\"\n aria-label=${this.localize.term('inputLabel')}\n aria-autocomplete=\"list\"\n aria-haspopup=\"listbox\"\n role=\"combobox\"\n aria-controls=\"list\"\n aria-expanded=\"true\"\n aria-activedescendant=${ifDefined(activeDescendant)}\n aria-describedby=\"instructions\"\n />\n </div>\n\n <div class=\"n-modal-body\">\n <div id=\"list\" ${ref(this.listRef)} role=\"listbox\" aria-label=${this.localize.term('inputLabel')}>\n ${this.filteredCommands.length === 0\n ? this.renderNoResults()\n : Array.from(sections, ([section, commands]) => this.renderSection(section, commands))}\n </div>\n </div>\n <slot name=\"footer\">\n <div class=\"n-modal-footer\">\n <span class=\"n-help\">\n <nord-icon label=\"Arrow keys\" name=${navigateIcon.title}></nord-icon>\n ${this.localize.term('footerArrowKeys')}\n </span>\n <span class=\"n-help\">\n <nord-icon label=\"Enter key\" name=${enterIcon.title}></nord-icon>\n ${this.localize.term('footerEnterKey')}\n </span>\n <span class=\"n-help\">${this.localize.term('footerEscapeKey')}</span>\n <span class=\"n-help n-backspace\">\n <nord-icon label=\"Backspace key\" name=${backspaceIcon.title}></nord-icon>\n ${this.localize.term('footerBackspaceKey')}\n </span>\n </div>\n </slot>\n </div>\n </div>\n `\n }\n\n private renderNoResults() {\n return html`\n <div id=\"no-results\" class=\"n-command-empty\" role=\"option\" aria-selected=\"true\">\n <div class=\"n-title\">${this.localize.term('noResults', this.searchQuery)}</div>\n <div class=\"n-tip\">${this.localize.term('tip')}</div>\n </div>\n `\n }\n\n private renderSection(section: string | undefined, commands: ICommandMenuAction[]) {\n const sectionId = `section-${section}`\n\n // TODO: test on latest safari, since it seems to have issues with grouped options\n return html`\n <div role=\"group\" aria-labelledby=${cond(section, sectionId)}>\n ${section ? html`<div class=\"n-group-header\" role=\"presentation\" id=${sectionId}>${section}</div>` : nothing}\n ${repeat(\n commands,\n command => command.id,\n command => html`\n <nord-command-menu-action\n id=${command.id}\n .command=${command}\n ?selected=${this.open && command.id === this.selected?.id}\n @click=${() => this.select(command)}\n role=\"option\"\n aria-selected=${cond(command.id === this.selected?.id, 'true')}\n ></nord-command-menu-action>\n `,\n )}\n </div>\n `\n }\n\n @observe('commands')\n protected handleCommandsChange() {\n this.keyboardController.registerCommandShortcuts()\n }\n\n @observe('open')\n protected handleBump() {\n if (this.open) {\n this.bump = true\n }\n }\n\n @observe('open', 'updated')\n protected focusOnOpen() {\n if (this.open) {\n this.previousFocus = getFocusedElement(document) as HTMLElement\n this.focus()\n\n if (this.listRef.value) {\n this.listRef.value.scrollTop = 0\n }\n }\n }\n\n private handleAnimationEnd() {\n this.bump = false\n }\n\n private handleBlur() {\n if (this.open) {\n this.focus()\n }\n }\n\n private handleInput(event: KeyboardEvent) {\n event.stopPropagation()\n\n const input = event.target as HTMLInputElement\n this.setSearch(input.value)\n\n // When exitNestedOnSearch is enabled, clear the parent to exit nested view and allow global search\n if (this.exitNestedOnSearch && input.value && this.parent) {\n this.parent = undefined\n }\n\n /**\n * Fired as the user types into the search input.\n */\n this.dispatchEvent(new NordEvent('input'))\n }\n\n private select(command: ICommandMenuAction = this.selected) {\n const isParent = this.commands.some(item => item.parent === command.id)\n\n if (isParent) {\n this.setParent(command.id)\n this.bump = true\n this.focus()\n }\n else {\n this.close()\n }\n\n this.setSearch('')\n command.handler?.(this)\n\n // this is separated into two parts because of a bug in Custom Elements Analyzer, where it gets the event name wrong.\n // TODO: cleanup when bug is fixed.\n const event = new SelectEvent(command)\n this.dispatchEvent(event)\n }\n\n private start() {\n this.selectedIndex = 0\n }\n\n private end() {\n this.selectedIndex = this.filteredCommands.length - 1\n }\n\n private next() {\n this.selectedIndex = wrap(this.selectedIndex + 1, 0, this.filteredCommands.length - 1)\n }\n\n private previous() {\n this.selectedIndex = wrap(this.selectedIndex - 1, 0, this.filteredCommands.length - 1)\n }\n\n private goBack() {\n if (this.searchQuery) {\n return\n }\n\n if (this.parent) {\n const parentCommand = this.commands.find(command => command.id === this.parent)\n this.setParent(parentCommand?.parent)\n }\n }\n\n private setParent(parent?: ICommandMenuAction['parent']) {\n this.parent = parent\n this.setSearch('')\n }\n\n private setSearch(str: string) {\n this.searchQuery = str\n this.selectedIndex = 0\n }\n\n @observe('searchQuery')\n @observe('parent')\n @observe('commands')\n @observe('externalFiltering')\n private filterCommands() {\n // sort commands in the same way as they are visually displayed\n // this is a quick fix for cases where the visual order of commands is different from order in the commands array\n // without ordering, the up/down arrow keys can end up navigating out of visual order.\n // but it feels wasteful to groupBy here, then discard the result, only to re-calculate in render.\n // TODO: is there a way to do this without grouping twice?\n const groupedBySection = groupBy(this.commands, 'section')\n const ordered = [...groupedBySection.values()].flat()\n\n if (this.externalFiltering) {\n // When external filtering is enabled, still filter by parent but skip search-based filtering\n this.filteredCommands = ordered.filter(\n ({ parent }) =>\n // use looser equality check so that it handles `null` as command's `parent` value\n // eslint-disable-next-line eqeqeq\n parent == this.parent,\n )\n return\n }\n\n const searchTerms = this.searchQuery.toLocaleLowerCase().split(/\\s+/)\n\n this.filteredCommands = ordered.filter(({ title, keywords = '', parent }) => {\n const searchSpace = `${title} ${keywords}`.toLocaleLowerCase()\n const matcher = searchTerms.every(term => searchSpace.includes(term))\n\n if (!this.parent && this.searchQuery) {\n // global search for items on root only (exclude nested items)\n return matcher && !parent\n }\n\n // use looser equality check so that it handles `null` as command's `parent` value\n // eslint-disable-next-line eqeqeq\n return parent == this.parent && matcher\n })\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-command-menu': CommandMenu\n }\n}\n","export default '<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m18 2h-2v-2h-2v2h-8v-2h-2v2h-2c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2v-14c0-1.1-.9-2-2-2zm-14 2v2h2v-2h8v2h2v-2h2v4h-16v-4zm-2 14v-8h16v8z\" fill=\"currentColor\"/></svg>';\nexport const title = \"interface-calendar\";\nexport const tags = \"nordicon interface calendar date time day week month year\";\n","export default '<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m12.1087 10.005 7.8867 7.8866-2.1087 2.1085-7.8866-7.8867-7.89154 7.8916-2.10356422-2.1036 7.89153422-7.8915-7.89653-7.89664 2.1137-2.11326 7.8915 7.90132 7.8864-7.89650372 2.1085 2.10861372z\" fill=\"currentColor\"/></svg>';\nexport const title = \"interface-close-small\";\nexport const tags =\n \"nordicon interface close remove small cross delete erase symbol\";\n","import type { LitElement } from 'lit'\nimport { property } from 'lit/decorators.js'\n\ntype Constructor<T = Record<string, unknown>> = new (...args: any[]) => T\n\nexport declare class ReadonlyMixinInterface {\n readonly: boolean\n}\n\nexport function ReadonlyMixin<T extends Constructor<LitElement>>(\n superClass: T,\n): Constructor<ReadonlyMixinInterface> & T {\n class ReadonlyElement extends superClass {\n /**\n * Makes the component readonly, so that it is not editable.\n * Readonly differs from disabled in that readonly fields are still focusable and will be submitted with a form.\n */\n @property({ type: Boolean, reflect: true }) readonly = false\n }\n\n return ReadonlyElement\n}\n","import type { createDate } from '../common/dates.js'\nimport { parseISODate, printISODate } from '../common/dates.js'\n\ntype CreateDate = typeof createDate\nexport type DateParser = (input: string, createDate: CreateDate) => Date | undefined\nexport type DateFormatter = (date: Date) => string\n\nexport interface DateAdapter {\n parse: DateParser\n format: DateFormatter\n}\n\nexport const isoAdapter: DateAdapter = { parse: parseISODate, format: printISODate }\n","export default '<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m16.03 14.61c1.23-1.54 1.97-3.49 1.97-5.61 0-4.97-4.03-9-9-9s-9 4.03-9 9 4.03 9 9 9c2.12 0 4.07-.74 5.61-1.97l3.97 3.97 1.41-1.41-3.97-3.97zm-7.03 1.39c-3.86 0-7-3.14-7-7s3.14-7 7-7 7 3.14 7 7-3.14 7-7 7z\" fill=\"currentColor\"/></svg>';\nexport const title = \"navigation-search\";\nexport const tags = \"nordicon navigation menu find search magnifying glass\";\n","import{noChange as t}from\"../lit-html.js\";import{directive as e,Directive as r,PartType as s}from\"../directive.js\";\n/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const n=\"important\",i=\" !\"+n,o=e(class extends r{constructor(t){if(super(t),t.type!==s.ATTRIBUTE||\"style\"!==t.name||t.strings?.length>2)throw Error(\"The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.\")}render(t){return Object.keys(t).reduce(((e,r)=>{const s=t[r];return null==s?e:e+`${r=r.includes(\"-\")?r:r.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,\"-$&\").toLowerCase()}:${s};`}),\"\")}update(e,[r]){const{style:s}=e.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(r)),this.render(r);for(const t of this.ft)null==r[t]&&(this.ft.delete(t),t.includes(\"-\")?s.removeProperty(t):s[t]=null);for(const t in r){const e=r[t];if(null!=e){this.ft.add(t);const r=\"string\"==typeof e&&e.endsWith(i);t.includes(\"-\")||r?s.setProperty(t,r?e.slice(0,-11):e,r?n:\"\"):s[t]=e}}return t}});export{o as styleMap};\n//# sourceMappingURL=style-map.js.map\n","import type { ReactiveController, ReactiveControllerHost } from 'lit'\nimport { isServer } from 'lit'\n\nexport class ResizeController implements ReactiveController {\n private observer?: ResizeObserver\n private hadFirstUpdate = false\n private borderBoxSize?: ResizeObserverSize\n\n constructor(\n host: ReactiveControllerHost,\n private target: () => HTMLElement,\n ) {\n host.addController(this)\n\n if (!isServer) {\n this.observer = new ResizeObserver(([entry]) => {\n const [borderBoxSize] = entry.borderBoxSize\n this.borderBoxSize = borderBoxSize\n host.requestUpdate()\n })\n }\n }\n\n get inlineSize() {\n return this.borderBoxSize?.inlineSize\n }\n\n get blockSize() {\n return this.borderBoxSize?.blockSize\n }\n\n hostUpdated() {\n if (!this.hadFirstUpdate && this.observer) {\n this.observer.observe(this.target())\n this.hadFirstUpdate = true\n }\n }\n\n hostConnected() {\n // in case the host has rendered, disconnected, and is now reconnected\n if (this.hadFirstUpdate && this.observer) {\n this.observer.observe(this.target())\n }\n }\n\n hostDisconnected() {\n if (this.observer) {\n this.observer.disconnect()\n }\n }\n}\n","import type { LitElement } from 'lit'\nimport { property } from 'lit/decorators.js'\n\ntype Constructor<T = Record<string, unknown>> = new (...args: any[]) => T\ntype AutocompleteAttribute\n = | 'off'\n | 'on'\n | 'name'\n | 'honorific-prefix'\n | 'given-name'\n | 'additional-name'\n | 'family-name'\n | 'honorific-suffix'\n | 'nickname'\n | 'email'\n | 'username'\n | 'new-password'\n | 'current-password'\n | 'one-time-code'\n | 'organization-title'\n | 'organization'\n | 'street-address'\n | 'address-line1'\n | 'address-line2'\n | 'address-line3'\n | 'address-level4'\n | 'address-level3'\n | 'address-level2'\n | 'address-level1'\n | 'country'\n | 'country-name'\n | 'postal-code'\n | 'cc-name'\n | 'cc-given-name'\n | 'cc-additional-name'\n | 'cc-family-name'\n | 'cc-number'\n | 'cc-exp'\n | 'cc-exp-month'\n | 'cc-exp-year'\n | 'cc-csc'\n | 'cc-type'\n | 'transaction-currency'\n | 'transaction-amount'\n | 'language'\n | 'bday'\n | 'bday-day'\n | 'bday-month'\n | 'bday-year'\n | 'sex'\n | 'tel'\n | 'tel-country-code'\n | 'tel-national'\n | 'tel-area-code'\n | 'tel-local'\n | 'tel-extension'\n | 'impp'\n | 'url'\n | 'photo'\n\nexport declare class AutocompleteMixinInterface {\n autocomplete: AutocompleteAttribute\n}\n\nexport function AutocompleteMixin<T extends Constructor<LitElement>>(\n superClass: T,\n): Constructor<AutocompleteMixinInterface> & T {\n class AutocompleteElement extends superClass {\n /**\n * Specifies the data type of the field, so that the browser may attempt to fill out the field automatically on behalf of the user.\n */\n @property() autocomplete: AutocompleteAttribute = 'off'\n }\n\n return AutocompleteElement\n}\n","import type { LitElement } from 'lit'\nimport type { Ref } from 'lit/directives/ref.js'\nimport type { InputMixinInterface } from './InputMixin.js'\nimport { createRef } from 'lit/directives/ref.js'\n\ntype Constructable<T = Record<string, unknown>> = new (...args: any[]) => T\n\nexport declare class TextSelectableMixinInterface {\n protected textSelectableRef: Ref<HTMLInputElement | HTMLTextAreaElement>\n set selectionStart(value: number | null)\n get selectionStart(): number | null\n set selectionEnd(value: number | null)\n get selectionEnd(): number | null\n select(): void\n setSelectionRange(start: number | null, end: number | null, direction?: 'forward' | 'backward' | 'none'): void\n setRangeText(\n replacement: string,\n start?: number,\n end?: number,\n selectMode?: 'select' | 'start' | 'end' | 'preserve'\n ): void\n}\n\nexport function TextSelectableMixin<T extends Constructable<InputMixinInterface & LitElement>>(superClass: T) {\n class TextSelectableElement extends superClass {\n protected textSelectableRef = createRef<HTMLInputElement | HTMLTextAreaElement>()\n\n /**\n * Gets or sets the starting position or offset of a text selection.\n *\n * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/selectionStart)\n */\n set selectionStart(value: number | null) {\n if (this.textSelectableRef.value) {\n this.textSelectableRef.value.selectionStart = value\n }\n }\n\n get selectionStart() {\n return this.textSelectableRef.value?.selectionStart ?? null\n }\n\n /**\n * Gets or sets the end position or offset of a text selection.\n *\n * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/selectionEnd)\n */\n set selectionEnd(value: number | null) {\n if (this.textSelectableRef.value) {\n this.textSelectableRef.value.selectionEnd = value\n }\n }\n\n get selectionEnd() {\n return this.textSelectableRef.value?.selectionEnd ?? null\n }\n\n /**\n * Gets or sets the direction in which selection occurred.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLInputElement/selectionDirection)\n */\n set selectionDirection(value: 'forward' | 'backward' | 'none' | null) {\n if (this.textSelectableRef.value) {\n this.textSelectableRef.value.selectionDirection = value\n }\n }\n\n get selectionDirection() {\n return this.textSelectableRef.value?.selectionDirection ?? null\n }\n\n /**\n * Selects all the text in the text field.\n *\n * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/select)\n */\n select() {\n if (this.textSelectableRef.value) {\n this.textSelectableRef.value.select()\n }\n }\n\n /**\n * Sets the start and end positions of a selection in the text field.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLInputElement/setSelectionRange)\n *\n * @param start The offset into the text field for the start of the selection.\n * @param end The offset into the text field for the end of the selection.\n * @param direction The direction in which the selection is performed.\n */\n setSelectionRange(start: number | null, end: number | null, direction?: 'forward' | 'backward' | 'none') {\n if (this.textSelectableRef.value) {\n this.textSelectableRef.value.setSelectionRange(start, end, direction)\n }\n }\n\n /**\n * Replaces a range of text with a new string.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLInputElement/setRangeText)\n *\n * @param replacement The string to insert.\n * @param start The 0-based index of the first character to replace. Defaults to the current `selectionStart` value (the start of the user's current selection).\n * @param end The 0-based index of the character after the last character to replace. Defaults to the current `selectionEnd` value (the end of the user's current selection).\n * @param selectMode A string defining how the selection should be set after the text has been replaced.\n */\n setRangeText(\n replacement: string,\n start?: number,\n end?: number,\n selectMode: 'select' | 'start' | 'end' | 'preserve' = 'preserve',\n ) {\n if (this.textSelectableRef.value) {\n const selectionStart = start ?? this.textSelectableRef.value.selectionStart!\n\n const selectionEnd = end ?? this.textSelectableRef.value.selectionEnd!\n\n this.textSelectableRef.value.setRangeText(replacement, selectionStart, selectionEnd, selectMode)\n\n if (this.value !== this.textSelectableRef.value.value) {\n this.value = this.textSelectableRef.value.value\n }\n }\n }\n\n /**\n * Returns the native `<input>` or `<textarea>` element used under the hood.\n */\n async getNativeElement() {\n // wait for the element to be rendered\n await this.updateComplete\n\n return this.textSelectableRef.value\n }\n }\n\n return TextSelectableElement as unknown as Constructable<TextSelectableMixinInterface> & T\n}\n","import * as searchIcon from '@nordhealth/icons/lib/assets/navigation-search.js'\nimport { html, LitElement, nothing } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { classMap } from 'lit/directives/class-map.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { ref } from 'lit/directives/ref.js'\n\nimport { styleMap } from 'lit/directives/style-map.js'\nimport { DirectionController } from '../common/controllers/DirectionController.js'\nimport { ResizeController } from '../common/controllers/ResizeController.js'\nimport { cond } from '../common/directives/cond.js'\nimport { NordEvent } from '../common/events.js'\nimport { getSubmitButton } from '../common/form.js'\nimport { cleanValue } from '../common/input.js'\nimport { AutocompleteMixin } from '../common/mixins/AutocompleteMixin.js'\n\nimport { FocusableMixin } from '../common/mixins/FocusableMixin.js'\nimport { FormAssociatedMixin } from '../common/mixins/FormAssociatedMixin.js'\nimport { InputMixin } from '../common/mixins/InputMixin.js'\nimport { ReadonlyMixin } from '../common/mixins/ReadonlyMixin.js'\nimport { SizeMixin } from '../common/mixins/SizeMixin.js'\nimport { TextSelectableMixin } from '../common/mixins/TextSelectableMixin.js'\nimport componentStyle from '../common/styles/Component.css'\nimport formFieldStyle from '../common/styles/FormField.css'\nimport textFieldStyle from '../common/styles/TextField.css'\nimport Icon from '../icon/Icon.js'\nimport style from './Input.css'\n\nIcon.registerIcon(searchIcon)\n\nconst px = (value?: number) => (value ? `${value}px` : undefined)\n\ntype InputMode = 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search'\nconst defaultInputmodeMap: Record<string, InputMode> = {\n number: 'numeric',\n email: 'email',\n tel: 'tel',\n url: 'url',\n search: 'search',\n}\n\n/**\n * Inputs are used to allow users to provide text input when the expected input is short.\n * As well as plain text, Input supports various types of text, including passwords and numbers.\n *\n * @status ready\n * @category form\n * @slot label - Use when a label requires more than plain text.\n * @slot hint - Optional slot that holds hint text for the input.\n * @slot error - Optional slot that holds error text for the input.\n * @slot start - Optional slot used to place an icon or prefix at the start of the input.\n * @slot end - Optional slot used to place an icon or suffix at the end of the input.\n *\n * @cssprop [--n-input-inline-size=240px] - Controls the inline size, or width, of the input.\n * @cssprop [--n-input-background=var(--n-color-active)] - Controls the background of the input, using our [color tokens](/tokens/#color).\n * @cssprop [--n-input-color=var(--n-color-text)] - Controls the text color of the input, using our [color tokens](/tokens/#color).\n * @cssprop [--n-input-border-color=var(--n-color-border-strong)] - Controls the border color of the input, using our [color tokens](/tokens/#color).\n * @cssprop [--n-input-border-radius=var(--n-border-radius-s)] - Controls how rounded the corners are, using [border radius tokens](/tokens/#border-radius).\n * @cssprop [--n-input-text-align=start] - Controls the alignment of text within the input itself.\n * @cssprop [--n-label-color=var(--n-color-text)] - Controls the text color of the label, using our [color tokens](/tokens/#color).\n */\n@customElement('nord-input')\nexport default class Input extends SizeMixin(\n FormAssociatedMixin(AutocompleteMixin(ReadonlyMixin(TextSelectableMixin(InputMixin(FocusableMixin(LitElement)))))),\n) {\n static styles = [componentStyle, formFieldStyle, textFieldStyle, style]\n\n @query('slot[name=\\'start\\']') private startSlot!: HTMLSlotElement\n @query('slot[name=\\'end\\']') private endSlot!: HTMLSlotElement\n private startObserver = new ResizeController(this, () => this.startSlot)\n private endObserver = new ResizeController(this, () => this.endSlot)\n private direction = new DirectionController(this)\n\n /**\n * The type of the input.\n */\n @property({ reflect: true }) type:\n | 'text'\n | 'email'\n | 'password'\n | 'tel'\n | 'url'\n | 'search'\n | 'number'\n | 'unit'\n | 'button' = 'text'\n\n /**\n * Controls whether the input expands to fill the width of its container.\n */\n @property({ reflect: true, type: Boolean }) expand = false\n\n /**\n * Optionally disallow certain characters from being used inside the input, using a regex pattern.\n */\n @property({ reflect: true, attribute: 'disallow-pattern' }) disallowPattern?: string = undefined\n\n /**\n * The inputmode attribute provides a hint to the browser about what type of keyboard to open on mobile devices.\n * Valid values: none, text, decimal, numeric, tel, search, email, url\n * When not explicitly set, defaults based on input type:\n * - type=\"number\" → inputmode=\"numeric\"\n * - type=\"email\" → inputmode=\"email\"\n * - type=\"tel\" → inputmode=\"tel\"\n * - type=\"url\" → inputmode=\"url\"\n * - type=\"search\" → inputmode=\"search\"\n * Can be explicitly overridden for any type.\n */\n @property({ reflect: true }) inputmode?: 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url' = undefined\n\n render() {\n const isNumber = this.type === 'number'\n\n const inputmodeValue = this.inputmode || defaultInputmodeMap[this.type]\n\n return html`\n ${this.renderLabel()}\n\n <div\n class=${classMap({\n 'n-input-container': true,\n 'is-rtl': this.direction.dir === 'rtl',\n })}\n style=${styleMap({\n '--_n-input-start-inline-size': px(this.startObserver.inlineSize),\n '--_n-input-end-inline-size': px(this.endObserver.inlineSize),\n })}\n >\n <slot name=\"start\">\n ${this.type === 'search' ? html`<nord-icon name=\"navigation-search\"></nord-icon>` : nothing}\n </slot>\n <input\n ${ref(this.textSelectableRef)}\n ${ref(this.focusableRef)}\n id=${this.inputId}\n class=\"n-input\"\n type=${isNumber || this.type === 'unit' ? 'text' : this.type}\n inputmode=${ifDefined(inputmodeValue)}\n pattern=${cond(isNumber, '[0-9]*')}\n ?disabled=${this.disabled}\n ?required=${this.required}\n ?readonly=${this.readonly}\n name=${ifDefined(this.name)}\n .value=${this.value ?? ''}\n placeholder=${ifDefined(this.placeholder)}\n @input=${this.handleInputChange}\n @change=${this.handleChange}\n @keydown=${this.handleKeydown}\n @select=${this.handleSelect}\n aria-describedby=${ifDefined(this.getDescribedBy())}\n aria-invalid=${ifDefined(this.getInvalid())}\n spellcheck=\"false\"\n autocomplete=${this.autocomplete as any}\n />\n <slot name=\"end\"></slot>\n </div>\n\n ${this.renderError()}\n ${this.isHintBelow ? this.renderHint() : nothing}\n `\n }\n\n private handleKeydown(e: KeyboardEvent) {\n if (e.key !== 'Enter') {\n return\n }\n\n const { form } = this\n\n if (form) {\n const button = getSubmitButton(form)\n setTimeout(() => button?.click(), 0)\n }\n }\n\n private handleInputChange = (e: Event) => {\n const target = e.target as HTMLInputElement\n\n // clean up any invalid characters\n if (this.disallowPattern) {\n cleanValue(target, new RegExp(this.disallowPattern, 'g'))\n }\n this.handleInput(e)\n }\n\n protected handleSelect(e: Event) {\n e.stopPropagation()\n\n /**\n * Fired when some text has been selected.\n */\n this.dispatchEvent(new NordEvent('select'))\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-input': Input\n }\n}\n","export function cleanValue(inputEl: HTMLInputElement, regex: RegExp): string {\n const { value } = inputEl\n const cursor = inputEl.selectionStart as number\n\n const beforeCursor = value.slice(0, cursor)\n const afterCursor = value.slice(cursor, value.length)\n\n const filteredBeforeCursor = beforeCursor.replace(regex, '')\n const filterAfterCursor = afterCursor.replace(regex, '')\n\n const newValue = filteredBeforeCursor + filterAfterCursor\n const newCursor = filteredBeforeCursor.length\n\n inputEl.value = newValue\n inputEl.selectionStart = newCursor\n inputEl.selectionEnd = newCursor\n\n return newValue\n}\n","/**\n * Finds a form's submit button. First looking for a button inside form,\n * and then looking for a button whose form attribute is equal to the ID of the form.\n */\nexport function getSubmitButton(form: HTMLFormElement): HTMLButtonElement | null {\n // we can get away with just looking for native <button> elements,\n // rather than our component, since our button component renders one to light dom.\n let button = form.querySelector<HTMLButtonElement>(`button[type=\"submit\"]`)\n\n if (!button && form.id) {\n const root = form.getRootNode() as ShadowRoot | Document\n button = root.querySelector<HTMLButtonElement>(`button[form=${form.id}]`)\n }\n\n return button\n}\n","/**\n * Custom positioning reference element.\n * @see https://floating-ui.com/docs/virtual-elements\n */\n\nconst sides = ['top', 'right', 'bottom', 'left'];\nconst alignments = ['start', 'end'];\nconst placements = /*#__PURE__*/sides.reduce((acc, side) => acc.concat(side, side + \"-\" + alignments[0], side + \"-\" + alignments[1]), []);\nconst min = Math.min;\nconst max = Math.max;\nconst round = Math.round;\nconst floor = Math.floor;\nconst createCoords = v => ({\n x: v,\n y: v\n});\nconst oppositeSideMap = {\n left: 'right',\n right: 'left',\n bottom: 'top',\n top: 'bottom'\n};\nconst oppositeAlignmentMap = {\n start: 'end',\n end: 'start'\n};\nfunction clamp(start, value, end) {\n return max(start, min(value, end));\n}\nfunction evaluate(value, param) {\n return typeof value === 'function' ? value(param) : value;\n}\nfunction getSide(placement) {\n return placement.split('-')[0];\n}\nfunction getAlignment(placement) {\n return placement.split('-')[1];\n}\nfunction getOppositeAxis(axis) {\n return axis === 'x' ? 'y' : 'x';\n}\nfunction getAxisLength(axis) {\n return axis === 'y' ? 'height' : 'width';\n}\nconst yAxisSides = /*#__PURE__*/new Set(['top', 'bottom']);\nfunction getSideAxis(placement) {\n return yAxisSides.has(getSide(placement)) ? 'y' : 'x';\n}\nfunction getAlignmentAxis(placement) {\n return getOppositeAxis(getSideAxis(placement));\n}\nfunction getAlignmentSides(placement, rects, rtl) {\n if (rtl === void 0) {\n rtl = false;\n }\n const alignment = getAlignment(placement);\n const alignmentAxis = getAlignmentAxis(placement);\n const length = getAxisLength(alignmentAxis);\n let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';\n if (rects.reference[length] > rects.floating[length]) {\n mainAlignmentSide = getOppositePlacement(mainAlignmentSide);\n }\n return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];\n}\nfunction getExpandedPlacements(placement) {\n const oppositePlacement = getOppositePlacement(placement);\n return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];\n}\nfunction getOppositeAlignmentPlacement(placement) {\n return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);\n}\nconst lrPlacement = ['left', 'right'];\nconst rlPlacement = ['right', 'left'];\nconst tbPlacement = ['top', 'bottom'];\nconst btPlacement = ['bottom', 'top'];\nfunction getSideList(side, isStart, rtl) {\n switch (side) {\n case 'top':\n case 'bottom':\n if (rtl) return isStart ? rlPlacement : lrPlacement;\n return isStart ? lrPlacement : rlPlacement;\n case 'left':\n case 'right':\n return isStart ? tbPlacement : btPlacement;\n default:\n return [];\n }\n}\nfunction getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {\n const alignment = getAlignment(placement);\n let list = getSideList(getSide(placement), direction === 'start', rtl);\n if (alignment) {\n list = list.map(side => side + \"-\" + alignment);\n if (flipAlignment) {\n list = list.concat(list.map(getOppositeAlignmentPlacement));\n }\n }\n return list;\n}\nfunction getOppositePlacement(placement) {\n return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]);\n}\nfunction expandPaddingObject(padding) {\n return {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n ...padding\n };\n}\nfunction getPaddingObject(padding) {\n return typeof padding !== 'number' ? expandPaddingObject(padding) : {\n top: padding,\n right: padding,\n bottom: padding,\n left: padding\n };\n}\nfunction rectToClientRect(rect) {\n const {\n x,\n y,\n width,\n height\n } = rect;\n return {\n width,\n height,\n top: y,\n left: x,\n right: x + width,\n bottom: y + height,\n x,\n y\n };\n}\n\nexport { alignments, clamp, createCoords, evaluate, expandPaddingObject, floor, getAlignment, getAlignmentAxis, getAlignmentSides, getAxisLength, getExpandedPlacements, getOppositeAlignmentPlacement, getOppositeAxis, getOppositeAxisPlacements, getOppositePlacement, getPaddingObject, getSide, getSideAxis, max, min, placements, rectToClientRect, round, sides };\n","import { getSideAxis, getAlignmentAxis, getAxisLength, getSide, getAlignment, evaluate, getPaddingObject, rectToClientRect, min, clamp, placements, getAlignmentSides, getOppositeAlignmentPlacement, getOppositePlacement, getExpandedPlacements, getOppositeAxisPlacements, sides, max, getOppositeAxis } from '@floating-ui/utils';\nexport { rectToClientRect } from '@floating-ui/utils';\n\nfunction computeCoordsFromPlacement(_ref, placement, rtl) {\n let {\n reference,\n floating\n } = _ref;\n const sideAxis = getSideAxis(placement);\n const alignmentAxis = getAlignmentAxis(placement);\n const alignLength = getAxisLength(alignmentAxis);\n const side = getSide(placement);\n const isVertical = sideAxis === 'y';\n const commonX = reference.x + reference.width / 2 - floating.width / 2;\n const commonY = reference.y + reference.height / 2 - floating.height / 2;\n const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;\n let coords;\n switch (side) {\n case 'top':\n coords = {\n x: commonX,\n y: reference.y - floating.height\n };\n break;\n case 'bottom':\n coords = {\n x: commonX,\n y: reference.y + reference.height\n };\n break;\n case 'right':\n coords = {\n x: reference.x + reference.width,\n y: commonY\n };\n break;\n case 'left':\n coords = {\n x: reference.x - floating.width,\n y: commonY\n };\n break;\n default:\n coords = {\n x: reference.x,\n y: reference.y\n };\n }\n switch (getAlignment(placement)) {\n case 'start':\n coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);\n break;\n case 'end':\n coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);\n break;\n }\n return coords;\n}\n\n/**\n * Resolves with an object of overflow side offsets that determine how much the\n * element is overflowing a given clipping boundary on each side.\n * - positive = overflowing the boundary by that number of pixels\n * - negative = how many pixels left before it will overflow\n * - 0 = lies flush with the boundary\n * @see https://floating-ui.com/docs/detectOverflow\n */\nasync function detectOverflow(state, options) {\n var _await$platform$isEle;\n if (options === void 0) {\n options = {};\n }\n const {\n x,\n y,\n platform,\n rects,\n elements,\n strategy\n } = state;\n const {\n boundary = 'clippingAncestors',\n rootBoundary = 'viewport',\n elementContext = 'floating',\n altBoundary = false,\n padding = 0\n } = evaluate(options, state);\n const paddingObject = getPaddingObject(padding);\n const altContext = elementContext === 'floating' ? 'reference' : 'floating';\n const element = elements[altBoundary ? altContext : elementContext];\n const clippingClientRect = rectToClientRect(await platform.getClippingRect({\n element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),\n boundary,\n rootBoundary,\n strategy\n }));\n const rect = elementContext === 'floating' ? {\n x,\n y,\n width: rects.floating.width,\n height: rects.floating.height\n } : rects.reference;\n const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));\n const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {\n x: 1,\n y: 1\n } : {\n x: 1,\n y: 1\n };\n const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({\n elements,\n rect,\n offsetParent,\n strategy\n }) : rect);\n return {\n top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,\n bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,\n left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,\n right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x\n };\n}\n\n/**\n * Computes the `x` and `y` coordinates that will place the floating element\n * next to a given reference element.\n *\n * This export does not have any `platform` interface logic. You will need to\n * write one for the platform you are using Floating UI with.\n */\nconst computePosition = async (reference, floating, config) => {\n const {\n placement = 'bottom',\n strategy = 'absolute',\n middleware = [],\n platform\n } = config;\n const validMiddleware = middleware.filter(Boolean);\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));\n let rects = await platform.getElementRects({\n reference,\n floating,\n strategy\n });\n let {\n x,\n y\n } = computeCoordsFromPlacement(rects, placement, rtl);\n let statefulPlacement = placement;\n let middlewareData = {};\n let resetCount = 0;\n for (let i = 0; i < validMiddleware.length; i++) {\n var _platform$detectOverf;\n const {\n name,\n fn\n } = validMiddleware[i];\n const {\n x: nextX,\n y: nextY,\n data,\n reset\n } = await fn({\n x,\n y,\n initialPlacement: placement,\n placement: statefulPlacement,\n strategy,\n middlewareData,\n rects,\n platform: {\n ...platform,\n detectOverflow: (_platform$detectOverf = platform.detectOverflow) != null ? _platform$detectOverf : detectOverflow\n },\n elements: {\n reference,\n floating\n }\n });\n x = nextX != null ? nextX : x;\n y = nextY != null ? nextY : y;\n middlewareData = {\n ...middlewareData,\n [name]: {\n ...middlewareData[name],\n ...data\n }\n };\n if (reset && resetCount <= 50) {\n resetCount++;\n if (typeof reset === 'object') {\n if (reset.placement) {\n statefulPlacement = reset.placement;\n }\n if (reset.rects) {\n rects = reset.rects === true ? await platform.getElementRects({\n reference,\n floating,\n strategy\n }) : reset.rects;\n }\n ({\n x,\n y\n } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));\n }\n i = -1;\n }\n }\n return {\n x,\n y,\n placement: statefulPlacement,\n strategy,\n middlewareData\n };\n};\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = options => ({\n name: 'arrow',\n options,\n async fn(state) {\n const {\n x,\n y,\n placement,\n rects,\n platform,\n elements,\n middlewareData\n } = state;\n // Since `element` is required, we don't Partial<> the type.\n const {\n element,\n padding = 0\n } = evaluate(options, state) || {};\n if (element == null) {\n return {};\n }\n const paddingObject = getPaddingObject(padding);\n const coords = {\n x,\n y\n };\n const axis = getAlignmentAxis(placement);\n const length = getAxisLength(axis);\n const arrowDimensions = await platform.getDimensions(element);\n const isYAxis = axis === 'y';\n const minProp = isYAxis ? 'top' : 'left';\n const maxProp = isYAxis ? 'bottom' : 'right';\n const clientProp = isYAxis ? 'clientHeight' : 'clientWidth';\n const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];\n const startDiff = coords[axis] - rects.reference[axis];\n const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));\n let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;\n\n // DOM platform can return `window` as the `offsetParent`.\n if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) {\n clientSize = elements.floating[clientProp] || rects.floating[length];\n }\n const centerToReference = endDiff / 2 - startDiff / 2;\n\n // If the padding is large enough that it causes the arrow to no longer be\n // centered, modify the padding so that it is centered.\n const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;\n const minPadding = min(paddingObject[minProp], largestPossiblePadding);\n const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);\n\n // Make sure the arrow doesn't overflow the floating element if the center\n // point is outside the floating element's bounds.\n const min$1 = minPadding;\n const max = clientSize - arrowDimensions[length] - maxPadding;\n const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;\n const offset = clamp(min$1, center, max);\n\n // If the reference is small enough that the arrow's padding causes it to\n // to point to nothing for an aligned placement, adjust the offset of the\n // floating element itself. To ensure `shift()` continues to take action,\n // a single reset is performed when this is true.\n const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;\n const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0;\n return {\n [axis]: coords[axis] + alignmentOffset,\n data: {\n [axis]: offset,\n centerOffset: center - offset - alignmentOffset,\n ...(shouldAddOffset && {\n alignmentOffset\n })\n },\n reset: shouldAddOffset\n };\n }\n});\n\nfunction getPlacementList(alignment, autoAlignment, allowedPlacements) {\n const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => getSide(placement) === placement);\n return allowedPlacementsSortedByAlignment.filter(placement => {\n if (alignment) {\n return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false);\n }\n return true;\n });\n}\n/**\n * Optimizes the visibility of the floating element by choosing the placement\n * that has the most space available automatically, without needing to specify a\n * preferred placement. Alternative to `flip`.\n * @see https://floating-ui.com/docs/autoPlacement\n */\nconst autoPlacement = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'autoPlacement',\n options,\n async fn(state) {\n var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE;\n const {\n rects,\n middlewareData,\n placement,\n platform,\n elements\n } = state;\n const {\n crossAxis = false,\n alignment,\n allowedPlacements = placements,\n autoAlignment = true,\n ...detectOverflowOptions\n } = evaluate(options, state);\n const placements$1 = alignment !== undefined || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements;\n const overflow = await platform.detectOverflow(state, detectOverflowOptions);\n const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0;\n const currentPlacement = placements$1[currentIndex];\n if (currentPlacement == null) {\n return {};\n }\n const alignmentSides = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));\n\n // Make `computeCoords` start from the right place.\n if (placement !== currentPlacement) {\n return {\n reset: {\n placement: placements$1[0]\n }\n };\n }\n const currentOverflows = [overflow[getSide(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]];\n const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), {\n placement: currentPlacement,\n overflows: currentOverflows\n }];\n const nextPlacement = placements$1[currentIndex + 1];\n\n // There are more placements to check.\n if (nextPlacement) {\n return {\n data: {\n index: currentIndex + 1,\n overflows: allOverflows\n },\n reset: {\n placement: nextPlacement\n }\n };\n }\n const placementsSortedByMostSpace = allOverflows.map(d => {\n const alignment = getAlignment(d.placement);\n return [d.placement, alignment && crossAxis ?\n // Check along the mainAxis and main crossAxis side.\n d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0) :\n // Check only the mainAxis.\n d.overflows[0], d.overflows];\n }).sort((a, b) => a[1] - b[1]);\n const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter(d => d[2].slice(0,\n // Aligned placements should not check their opposite crossAxis\n // side.\n getAlignment(d[0]) ? 2 : 3).every(v => v <= 0));\n const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0];\n if (resetPlacement !== placement) {\n return {\n data: {\n index: currentIndex + 1,\n overflows: allOverflows\n },\n reset: {\n placement: resetPlacement\n }\n };\n }\n return {};\n }\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by flipping the `placement`\n * in order to keep it in view when the preferred placement(s) will overflow the\n * clipping boundary. Alternative to `autoPlacement`.\n * @see https://floating-ui.com/docs/flip\n */\nconst flip = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'flip',\n options,\n async fn(state) {\n var _middlewareData$arrow, _middlewareData$flip;\n const {\n placement,\n middlewareData,\n rects,\n initialPlacement,\n platform,\n elements\n } = state;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = true,\n fallbackPlacements: specifiedFallbackPlacements,\n fallbackStrategy = 'bestFit',\n fallbackAxisSideDirection = 'none',\n flipAlignment = true,\n ...detectOverflowOptions\n } = evaluate(options, state);\n\n // If a reset by the arrow was caused due to an alignment offset being\n // added, we should skip any logic now since `flip()` has already done its\n // work.\n // https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643\n if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {\n return {};\n }\n const side = getSide(placement);\n const initialSideAxis = getSideAxis(initialPlacement);\n const isBasePlacement = getSide(initialPlacement) === initialPlacement;\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));\n const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));\n const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none';\n if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {\n fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));\n }\n const placements = [initialPlacement, ...fallbackPlacements];\n const overflow = await platform.detectOverflow(state, detectOverflowOptions);\n const overflows = [];\n let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];\n if (checkMainAxis) {\n overflows.push(overflow[side]);\n }\n if (checkCrossAxis) {\n const sides = getAlignmentSides(placement, rects, rtl);\n overflows.push(overflow[sides[0]], overflow[sides[1]]);\n }\n overflowsData = [...overflowsData, {\n placement,\n overflows\n }];\n\n // One or more sides is overflowing.\n if (!overflows.every(side => side <= 0)) {\n var _middlewareData$flip2, _overflowsData$filter;\n const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;\n const nextPlacement = placements[nextIndex];\n if (nextPlacement) {\n const ignoreCrossAxisOverflow = checkCrossAxis === 'alignment' ? initialSideAxis !== getSideAxis(nextPlacement) : false;\n if (!ignoreCrossAxisOverflow ||\n // We leave the current main axis only if every placement on that axis\n // overflows the main axis.\n overflowsData.every(d => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) {\n // Try next placement and re-run the lifecycle.\n return {\n data: {\n index: nextIndex,\n overflows: overflowsData\n },\n reset: {\n placement: nextPlacement\n }\n };\n }\n }\n\n // First, find the candidates that fit on the mainAxis side of overflow,\n // then find the placement that fits the best on the main crossAxis side.\n let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;\n\n // Otherwise fallback.\n if (!resetPlacement) {\n switch (fallbackStrategy) {\n case 'bestFit':\n {\n var _overflowsData$filter2;\n const placement = (_overflowsData$filter2 = overflowsData.filter(d => {\n if (hasFallbackAxisSideDirection) {\n const currentSideAxis = getSideAxis(d.placement);\n return currentSideAxis === initialSideAxis ||\n // Create a bias to the `y` side axis due to horizontal\n // reading directions favoring greater width.\n currentSideAxis === 'y';\n }\n return true;\n }).map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];\n if (placement) {\n resetPlacement = placement;\n }\n break;\n }\n case 'initialPlacement':\n resetPlacement = initialPlacement;\n break;\n }\n }\n if (placement !== resetPlacement) {\n return {\n reset: {\n placement: resetPlacement\n }\n };\n }\n }\n return {};\n }\n };\n};\n\nfunction getSideOffsets(overflow, rect) {\n return {\n top: overflow.top - rect.height,\n right: overflow.right - rect.width,\n bottom: overflow.bottom - rect.height,\n left: overflow.left - rect.width\n };\n}\nfunction isAnySideFullyClipped(overflow) {\n return sides.some(side => overflow[side] >= 0);\n}\n/**\n * Provides data to hide the floating element in applicable situations, such as\n * when it is not in the same clipping context as the reference element.\n * @see https://floating-ui.com/docs/hide\n */\nconst hide = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'hide',\n options,\n async fn(state) {\n const {\n rects,\n platform\n } = state;\n const {\n strategy = 'referenceHidden',\n ...detectOverflowOptions\n } = evaluate(options, state);\n switch (strategy) {\n case 'referenceHidden':\n {\n const overflow = await platform.detectOverflow(state, {\n ...detectOverflowOptions,\n elementContext: 'reference'\n });\n const offsets = getSideOffsets(overflow, rects.reference);\n return {\n data: {\n referenceHiddenOffsets: offsets,\n referenceHidden: isAnySideFullyClipped(offsets)\n }\n };\n }\n case 'escaped':\n {\n const overflow = await platform.detectOverflow(state, {\n ...detectOverflowOptions,\n altBoundary: true\n });\n const offsets = getSideOffsets(overflow, rects.floating);\n return {\n data: {\n escapedOffsets: offsets,\n escaped: isAnySideFullyClipped(offsets)\n }\n };\n }\n default:\n {\n return {};\n }\n }\n }\n };\n};\n\nfunction getBoundingRect(rects) {\n const minX = min(...rects.map(rect => rect.left));\n const minY = min(...rects.map(rect => rect.top));\n const maxX = max(...rects.map(rect => rect.right));\n const maxY = max(...rects.map(rect => rect.bottom));\n return {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY\n };\n}\nfunction getRectsByLine(rects) {\n const sortedRects = rects.slice().sort((a, b) => a.y - b.y);\n const groups = [];\n let prevRect = null;\n for (let i = 0; i < sortedRects.length; i++) {\n const rect = sortedRects[i];\n if (!prevRect || rect.y - prevRect.y > prevRect.height / 2) {\n groups.push([rect]);\n } else {\n groups[groups.length - 1].push(rect);\n }\n prevRect = rect;\n }\n return groups.map(rect => rectToClientRect(getBoundingRect(rect)));\n}\n/**\n * Provides improved positioning for inline reference elements that can span\n * over multiple lines, such as hyperlinks or range selections.\n * @see https://floating-ui.com/docs/inline\n */\nconst inline = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'inline',\n options,\n async fn(state) {\n const {\n placement,\n elements,\n rects,\n platform,\n strategy\n } = state;\n // A MouseEvent's client{X,Y} coords can be up to 2 pixels off a\n // ClientRect's bounds, despite the event listener being triggered. A\n // padding of 2 seems to handle this issue.\n const {\n padding = 2,\n x,\n y\n } = evaluate(options, state);\n const nativeClientRects = Array.from((await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || []);\n const clientRects = getRectsByLine(nativeClientRects);\n const fallback = rectToClientRect(getBoundingRect(nativeClientRects));\n const paddingObject = getPaddingObject(padding);\n function getBoundingClientRect() {\n // There are two rects and they are disjoined.\n if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) {\n // Find the first rect in which the point is fully inside.\n return clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback;\n }\n\n // There are 2 or more connected rects.\n if (clientRects.length >= 2) {\n if (getSideAxis(placement) === 'y') {\n const firstRect = clientRects[0];\n const lastRect = clientRects[clientRects.length - 1];\n const isTop = getSide(placement) === 'top';\n const top = firstRect.top;\n const bottom = lastRect.bottom;\n const left = isTop ? firstRect.left : lastRect.left;\n const right = isTop ? firstRect.right : lastRect.right;\n const width = right - left;\n const height = bottom - top;\n return {\n top,\n bottom,\n left,\n right,\n width,\n height,\n x: left,\n y: top\n };\n }\n const isLeftSide = getSide(placement) === 'left';\n const maxRight = max(...clientRects.map(rect => rect.right));\n const minLeft = min(...clientRects.map(rect => rect.left));\n const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight);\n const top = measureRects[0].top;\n const bottom = measureRects[measureRects.length - 1].bottom;\n const left = minLeft;\n const right = maxRight;\n const width = right - left;\n const height = bottom - top;\n return {\n top,\n bottom,\n left,\n right,\n width,\n height,\n x: left,\n y: top\n };\n }\n return fallback;\n }\n const resetRects = await platform.getElementRects({\n reference: {\n getBoundingClientRect\n },\n floating: elements.floating,\n strategy\n });\n if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) {\n return {\n reset: {\n rects: resetRects\n }\n };\n }\n return {};\n }\n };\n};\n\nconst originSides = /*#__PURE__*/new Set(['left', 'top']);\n\n// For type backwards-compatibility, the `OffsetOptions` type was also\n// Derivable.\n\nasync function convertValueToCoords(state, options) {\n const {\n placement,\n platform,\n elements\n } = state;\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));\n const side = getSide(placement);\n const alignment = getAlignment(placement);\n const isVertical = getSideAxis(placement) === 'y';\n const mainAxisMulti = originSides.has(side) ? -1 : 1;\n const crossAxisMulti = rtl && isVertical ? -1 : 1;\n const rawValue = evaluate(options, state);\n\n // eslint-disable-next-line prefer-const\n let {\n mainAxis,\n crossAxis,\n alignmentAxis\n } = typeof rawValue === 'number' ? {\n mainAxis: rawValue,\n crossAxis: 0,\n alignmentAxis: null\n } : {\n mainAxis: rawValue.mainAxis || 0,\n crossAxis: rawValue.crossAxis || 0,\n alignmentAxis: rawValue.alignmentAxis\n };\n if (alignment && typeof alignmentAxis === 'number') {\n crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;\n }\n return isVertical ? {\n x: crossAxis * crossAxisMulti,\n y: mainAxis * mainAxisMulti\n } : {\n x: mainAxis * mainAxisMulti,\n y: crossAxis * crossAxisMulti\n };\n}\n\n/**\n * Modifies the placement by translating the floating element along the\n * specified axes.\n * A number (shorthand for `mainAxis` or distance), or an axes configuration\n * object may be passed.\n * @see https://floating-ui.com/docs/offset\n */\nconst offset = function (options) {\n if (options === void 0) {\n options = 0;\n }\n return {\n name: 'offset',\n options,\n async fn(state) {\n var _middlewareData$offse, _middlewareData$arrow;\n const {\n x,\n y,\n placement,\n middlewareData\n } = state;\n const diffCoords = await convertValueToCoords(state, options);\n\n // If the placement is the same and the arrow caused an alignment offset\n // then we don't need to change the positioning coordinates.\n if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {\n return {};\n }\n return {\n x: x + diffCoords.x,\n y: y + diffCoords.y,\n data: {\n ...diffCoords,\n placement\n }\n };\n }\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by shifting it in order to\n * keep it in view when it will overflow the clipping boundary.\n * @see https://floating-ui.com/docs/shift\n */\nconst shift = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'shift',\n options,\n async fn(state) {\n const {\n x,\n y,\n placement,\n platform\n } = state;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = false,\n limiter = {\n fn: _ref => {\n let {\n x,\n y\n } = _ref;\n return {\n x,\n y\n };\n }\n },\n ...detectOverflowOptions\n } = evaluate(options, state);\n const coords = {\n x,\n y\n };\n const overflow = await platform.detectOverflow(state, detectOverflowOptions);\n const crossAxis = getSideAxis(getSide(placement));\n const mainAxis = getOppositeAxis(crossAxis);\n let mainAxisCoord = coords[mainAxis];\n let crossAxisCoord = coords[crossAxis];\n if (checkMainAxis) {\n const minSide = mainAxis === 'y' ? 'top' : 'left';\n const maxSide = mainAxis === 'y' ? 'bottom' : 'right';\n const min = mainAxisCoord + overflow[minSide];\n const max = mainAxisCoord - overflow[maxSide];\n mainAxisCoord = clamp(min, mainAxisCoord, max);\n }\n if (checkCrossAxis) {\n const minSide = crossAxis === 'y' ? 'top' : 'left';\n const maxSide = crossAxis === 'y' ? 'bottom' : 'right';\n const min = crossAxisCoord + overflow[minSide];\n const max = crossAxisCoord - overflow[maxSide];\n crossAxisCoord = clamp(min, crossAxisCoord, max);\n }\n const limitedCoords = limiter.fn({\n ...state,\n [mainAxis]: mainAxisCoord,\n [crossAxis]: crossAxisCoord\n });\n return {\n ...limitedCoords,\n data: {\n x: limitedCoords.x - x,\n y: limitedCoords.y - y,\n enabled: {\n [mainAxis]: checkMainAxis,\n [crossAxis]: checkCrossAxis\n }\n }\n };\n }\n };\n};\n/**\n * Built-in `limiter` that will stop `shift()` at a certain point.\n */\nconst limitShift = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n options,\n fn(state) {\n const {\n x,\n y,\n placement,\n rects,\n middlewareData\n } = state;\n const {\n offset = 0,\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = true\n } = evaluate(options, state);\n const coords = {\n x,\n y\n };\n const crossAxis = getSideAxis(placement);\n const mainAxis = getOppositeAxis(crossAxis);\n let mainAxisCoord = coords[mainAxis];\n let crossAxisCoord = coords[crossAxis];\n const rawOffset = evaluate(offset, state);\n const computedOffset = typeof rawOffset === 'number' ? {\n mainAxis: rawOffset,\n crossAxis: 0\n } : {\n mainAxis: 0,\n crossAxis: 0,\n ...rawOffset\n };\n if (checkMainAxis) {\n const len = mainAxis === 'y' ? 'height' : 'width';\n const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;\n const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;\n if (mainAxisCoord < limitMin) {\n mainAxisCoord = limitMin;\n } else if (mainAxisCoord > limitMax) {\n mainAxisCoord = limitMax;\n }\n }\n if (checkCrossAxis) {\n var _middlewareData$offse, _middlewareData$offse2;\n const len = mainAxis === 'y' ? 'width' : 'height';\n const isOriginSide = originSides.has(getSide(placement));\n const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);\n const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);\n if (crossAxisCoord < limitMin) {\n crossAxisCoord = limitMin;\n } else if (crossAxisCoord > limitMax) {\n crossAxisCoord = limitMax;\n }\n }\n return {\n [mainAxis]: mainAxisCoord,\n [crossAxis]: crossAxisCoord\n };\n }\n };\n};\n\n/**\n * Provides data that allows you to change the size of the floating element —\n * for instance, prevent it from overflowing the clipping boundary or match the\n * width of the reference element.\n * @see https://floating-ui.com/docs/size\n */\nconst size = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'size',\n options,\n async fn(state) {\n var _state$middlewareData, _state$middlewareData2;\n const {\n placement,\n rects,\n platform,\n elements\n } = state;\n const {\n apply = () => {},\n ...detectOverflowOptions\n } = evaluate(options, state);\n const overflow = await platform.detectOverflow(state, detectOverflowOptions);\n const side = getSide(placement);\n const alignment = getAlignment(placement);\n const isYAxis = getSideAxis(placement) === 'y';\n const {\n width,\n height\n } = rects.floating;\n let heightSide;\n let widthSide;\n if (side === 'top' || side === 'bottom') {\n heightSide = side;\n widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right';\n } else {\n widthSide = side;\n heightSide = alignment === 'end' ? 'top' : 'bottom';\n }\n const maximumClippingHeight = height - overflow.top - overflow.bottom;\n const maximumClippingWidth = width - overflow.left - overflow.right;\n const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight);\n const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth);\n const noShift = !state.middlewareData.shift;\n let availableHeight = overflowAvailableHeight;\n let availableWidth = overflowAvailableWidth;\n if ((_state$middlewareData = state.middlewareData.shift) != null && _state$middlewareData.enabled.x) {\n availableWidth = maximumClippingWidth;\n }\n if ((_state$middlewareData2 = state.middlewareData.shift) != null && _state$middlewareData2.enabled.y) {\n availableHeight = maximumClippingHeight;\n }\n if (noShift && !alignment) {\n const xMin = max(overflow.left, 0);\n const xMax = max(overflow.right, 0);\n const yMin = max(overflow.top, 0);\n const yMax = max(overflow.bottom, 0);\n if (isYAxis) {\n availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right));\n } else {\n availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom));\n }\n }\n await apply({\n ...state,\n availableWidth,\n availableHeight\n });\n const nextDimensions = await platform.getDimensions(elements.floating);\n if (width !== nextDimensions.width || height !== nextDimensions.height) {\n return {\n reset: {\n rects: true\n }\n };\n }\n return {};\n }\n };\n};\n\nexport { arrow, autoPlacement, computePosition, detectOverflow, flip, hide, inline, limitShift, offset, shift, size };\n","function hasWindow() {\n return typeof window !== 'undefined';\n}\nfunction getNodeName(node) {\n if (isNode(node)) {\n return (node.nodeName || '').toLowerCase();\n }\n // Mocked nodes in testing environments may not be instances of Node. By\n // returning `#document` an infinite loop won't occur.\n // https://github.com/floating-ui/floating-ui/issues/2317\n return '#document';\n}\nfunction getWindow(node) {\n var _node$ownerDocument;\n return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;\n}\nfunction getDocumentElement(node) {\n var _ref;\n return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;\n}\nfunction isNode(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof Node || value instanceof getWindow(value).Node;\n}\nfunction isElement(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof Element || value instanceof getWindow(value).Element;\n}\nfunction isHTMLElement(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;\n}\nfunction isShadowRoot(value) {\n if (!hasWindow() || typeof ShadowRoot === 'undefined') {\n return false;\n }\n return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;\n}\nconst invalidOverflowDisplayValues = /*#__PURE__*/new Set(['inline', 'contents']);\nfunction isOverflowElement(element) {\n const {\n overflow,\n overflowX,\n overflowY,\n display\n } = getComputedStyle(element);\n return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !invalidOverflowDisplayValues.has(display);\n}\nconst tableElements = /*#__PURE__*/new Set(['table', 'td', 'th']);\nfunction isTableElement(element) {\n return tableElements.has(getNodeName(element));\n}\nconst topLayerSelectors = [':popover-open', ':modal'];\nfunction isTopLayer(element) {\n return topLayerSelectors.some(selector => {\n try {\n return element.matches(selector);\n } catch (_e) {\n return false;\n }\n });\n}\nconst transformProperties = ['transform', 'translate', 'scale', 'rotate', 'perspective'];\nconst willChangeValues = ['transform', 'translate', 'scale', 'rotate', 'perspective', 'filter'];\nconst containValues = ['paint', 'layout', 'strict', 'content'];\nfunction isContainingBlock(elementOrCss) {\n const webkit = isWebKit();\n const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n // https://drafts.csswg.org/css-transforms-2/#individual-transforms\n return transformProperties.some(value => css[value] ? css[value] !== 'none' : false) || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || willChangeValues.some(value => (css.willChange || '').includes(value)) || containValues.some(value => (css.contain || '').includes(value));\n}\nfunction getContainingBlock(element) {\n let currentNode = getParentNode(element);\n while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {\n if (isContainingBlock(currentNode)) {\n return currentNode;\n } else if (isTopLayer(currentNode)) {\n return null;\n }\n currentNode = getParentNode(currentNode);\n }\n return null;\n}\nfunction isWebKit() {\n if (typeof CSS === 'undefined' || !CSS.supports) return false;\n return CSS.supports('-webkit-backdrop-filter', 'none');\n}\nconst lastTraversableNodeNames = /*#__PURE__*/new Set(['html', 'body', '#document']);\nfunction isLastTraversableNode(node) {\n return lastTraversableNodeNames.has(getNodeName(node));\n}\nfunction getComputedStyle(element) {\n return getWindow(element).getComputedStyle(element);\n}\nfunction getNodeScroll(element) {\n if (isElement(element)) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n }\n return {\n scrollLeft: element.scrollX,\n scrollTop: element.scrollY\n };\n}\nfunction getParentNode(node) {\n if (getNodeName(node) === 'html') {\n return node;\n }\n const result =\n // Step into the shadow DOM of the parent of a slotted node.\n node.assignedSlot ||\n // DOM Element detected.\n node.parentNode ||\n // ShadowRoot detected.\n isShadowRoot(node) && node.host ||\n // Fallback.\n getDocumentElement(node);\n return isShadowRoot(result) ? result.host : result;\n}\nfunction getNearestOverflowAncestor(node) {\n const parentNode = getParentNode(node);\n if (isLastTraversableNode(parentNode)) {\n return node.ownerDocument ? node.ownerDocument.body : node.body;\n }\n if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {\n return parentNode;\n }\n return getNearestOverflowAncestor(parentNode);\n}\nfunction getOverflowAncestors(node, list, traverseIframes) {\n var _node$ownerDocument2;\n if (list === void 0) {\n list = [];\n }\n if (traverseIframes === void 0) {\n traverseIframes = true;\n }\n const scrollableAncestor = getNearestOverflowAncestor(node);\n const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);\n const win = getWindow(scrollableAncestor);\n if (isBody) {\n const frameElement = getFrameElement(win);\n return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);\n }\n return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));\n}\nfunction getFrameElement(win) {\n return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;\n}\n\nexport { getComputedStyle, getContainingBlock, getDocumentElement, getFrameElement, getNearestOverflowAncestor, getNodeName, getNodeScroll, getOverflowAncestors, getParentNode, getWindow, isContainingBlock, isElement, isHTMLElement, isLastTraversableNode, isNode, isOverflowElement, isShadowRoot, isTableElement, isTopLayer, isWebKit };\n","import { rectToClientRect, arrow as arrow$1, autoPlacement as autoPlacement$1, detectOverflow as detectOverflow$1, flip as flip$1, hide as hide$1, inline as inline$1, limitShift as limitShift$1, offset as offset$1, shift as shift$1, size as size$1, computePosition as computePosition$1 } from '@floating-ui/core';\nimport { round, createCoords, max, min, floor } from '@floating-ui/utils';\nimport { getComputedStyle as getComputedStyle$1, isHTMLElement, isElement, getWindow, isWebKit, getFrameElement, getNodeScroll, getDocumentElement, isTopLayer, getNodeName, isOverflowElement, getOverflowAncestors, getParentNode, isLastTraversableNode, isContainingBlock, isTableElement, getContainingBlock } from '@floating-ui/utils/dom';\nexport { getOverflowAncestors } from '@floating-ui/utils/dom';\n\nfunction getCssDimensions(element) {\n const css = getComputedStyle$1(element);\n // In testing environments, the `width` and `height` properties are empty\n // strings for SVG elements, returning NaN. Fallback to `0` in this case.\n let width = parseFloat(css.width) || 0;\n let height = parseFloat(css.height) || 0;\n const hasOffset = isHTMLElement(element);\n const offsetWidth = hasOffset ? element.offsetWidth : width;\n const offsetHeight = hasOffset ? element.offsetHeight : height;\n const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;\n if (shouldFallback) {\n width = offsetWidth;\n height = offsetHeight;\n }\n return {\n width,\n height,\n $: shouldFallback\n };\n}\n\nfunction unwrapElement(element) {\n return !isElement(element) ? element.contextElement : element;\n}\n\nfunction getScale(element) {\n const domElement = unwrapElement(element);\n if (!isHTMLElement(domElement)) {\n return createCoords(1);\n }\n const rect = domElement.getBoundingClientRect();\n const {\n width,\n height,\n $\n } = getCssDimensions(domElement);\n let x = ($ ? round(rect.width) : rect.width) / width;\n let y = ($ ? round(rect.height) : rect.height) / height;\n\n // 0, NaN, or Infinity should always fallback to 1.\n\n if (!x || !Number.isFinite(x)) {\n x = 1;\n }\n if (!y || !Number.isFinite(y)) {\n y = 1;\n }\n return {\n x,\n y\n };\n}\n\nconst noOffsets = /*#__PURE__*/createCoords(0);\nfunction getVisualOffsets(element) {\n const win = getWindow(element);\n if (!isWebKit() || !win.visualViewport) {\n return noOffsets;\n }\n return {\n x: win.visualViewport.offsetLeft,\n y: win.visualViewport.offsetTop\n };\n}\nfunction shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {\n return false;\n }\n return isFixed;\n}\n\nfunction getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {\n if (includeScale === void 0) {\n includeScale = false;\n }\n if (isFixedStrategy === void 0) {\n isFixedStrategy = false;\n }\n const clientRect = element.getBoundingClientRect();\n const domElement = unwrapElement(element);\n let scale = createCoords(1);\n if (includeScale) {\n if (offsetParent) {\n if (isElement(offsetParent)) {\n scale = getScale(offsetParent);\n }\n } else {\n scale = getScale(element);\n }\n }\n const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);\n let x = (clientRect.left + visualOffsets.x) / scale.x;\n let y = (clientRect.top + visualOffsets.y) / scale.y;\n let width = clientRect.width / scale.x;\n let height = clientRect.height / scale.y;\n if (domElement) {\n const win = getWindow(domElement);\n const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;\n let currentWin = win;\n let currentIFrame = getFrameElement(currentWin);\n while (currentIFrame && offsetParent && offsetWin !== currentWin) {\n const iframeScale = getScale(currentIFrame);\n const iframeRect = currentIFrame.getBoundingClientRect();\n const css = getComputedStyle$1(currentIFrame);\n const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;\n const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;\n x *= iframeScale.x;\n y *= iframeScale.y;\n width *= iframeScale.x;\n height *= iframeScale.y;\n x += left;\n y += top;\n currentWin = getWindow(currentIFrame);\n currentIFrame = getFrameElement(currentWin);\n }\n }\n return rectToClientRect({\n width,\n height,\n x,\n y\n });\n}\n\n// If <html> has a CSS width greater than the viewport, then this will be\n// incorrect for RTL.\nfunction getWindowScrollBarX(element, rect) {\n const leftScroll = getNodeScroll(element).scrollLeft;\n if (!rect) {\n return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;\n }\n return rect.left + leftScroll;\n}\n\nfunction getHTMLOffset(documentElement, scroll) {\n const htmlRect = documentElement.getBoundingClientRect();\n const x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect);\n const y = htmlRect.top + scroll.scrollTop;\n return {\n x,\n y\n };\n}\n\nfunction convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {\n let {\n elements,\n rect,\n offsetParent,\n strategy\n } = _ref;\n const isFixed = strategy === 'fixed';\n const documentElement = getDocumentElement(offsetParent);\n const topLayer = elements ? isTopLayer(elements.floating) : false;\n if (offsetParent === documentElement || topLayer && isFixed) {\n return rect;\n }\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n let scale = createCoords(1);\n const offsets = createCoords(0);\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isHTMLElement(offsetParent)) {\n const offsetRect = getBoundingClientRect(offsetParent);\n scale = getScale(offsetParent);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n }\n }\n const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);\n return {\n width: rect.width * scale.x,\n height: rect.height * scale.y,\n x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,\n y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y\n };\n}\n\nfunction getClientRects(element) {\n return Array.from(element.getClientRects());\n}\n\n// Gets the entire size of the scrollable document area, even extending outside\n// of the `<html>` and `<body>` rect bounds if horizontally scrollable.\nfunction getDocumentRect(element) {\n const html = getDocumentElement(element);\n const scroll = getNodeScroll(element);\n const body = element.ownerDocument.body;\n const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);\n const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);\n let x = -scroll.scrollLeft + getWindowScrollBarX(element);\n const y = -scroll.scrollTop;\n if (getComputedStyle$1(body).direction === 'rtl') {\n x += max(html.clientWidth, body.clientWidth) - width;\n }\n return {\n width,\n height,\n x,\n y\n };\n}\n\n// Safety check: ensure the scrollbar space is reasonable in case this\n// calculation is affected by unusual styles.\n// Most scrollbars leave 15-18px of space.\nconst SCROLLBAR_MAX = 25;\nfunction getViewportRect(element, strategy) {\n const win = getWindow(element);\n const html = getDocumentElement(element);\n const visualViewport = win.visualViewport;\n let width = html.clientWidth;\n let height = html.clientHeight;\n let x = 0;\n let y = 0;\n if (visualViewport) {\n width = visualViewport.width;\n height = visualViewport.height;\n const visualViewportBased = isWebKit();\n if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {\n x = visualViewport.offsetLeft;\n y = visualViewport.offsetTop;\n }\n }\n const windowScrollbarX = getWindowScrollBarX(html);\n // <html> `overflow: hidden` + `scrollbar-gutter: stable` reduces the\n // visual width of the <html> but this is not considered in the size\n // of `html.clientWidth`.\n if (windowScrollbarX <= 0) {\n const doc = html.ownerDocument;\n const body = doc.body;\n const bodyStyles = getComputedStyle(body);\n const bodyMarginInline = doc.compatMode === 'CSS1Compat' ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;\n const clippingStableScrollbarWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);\n if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) {\n width -= clippingStableScrollbarWidth;\n }\n } else if (windowScrollbarX <= SCROLLBAR_MAX) {\n // If the <body> scrollbar is on the left, the width needs to be extended\n // by the scrollbar amount so there isn't extra space on the right.\n width += windowScrollbarX;\n }\n return {\n width,\n height,\n x,\n y\n };\n}\n\nconst absoluteOrFixed = /*#__PURE__*/new Set(['absolute', 'fixed']);\n// Returns the inner client rect, subtracting scrollbars if present.\nfunction getInnerBoundingClientRect(element, strategy) {\n const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');\n const top = clientRect.top + element.clientTop;\n const left = clientRect.left + element.clientLeft;\n const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);\n const width = element.clientWidth * scale.x;\n const height = element.clientHeight * scale.y;\n const x = left * scale.x;\n const y = top * scale.y;\n return {\n width,\n height,\n x,\n y\n };\n}\nfunction getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {\n let rect;\n if (clippingAncestor === 'viewport') {\n rect = getViewportRect(element, strategy);\n } else if (clippingAncestor === 'document') {\n rect = getDocumentRect(getDocumentElement(element));\n } else if (isElement(clippingAncestor)) {\n rect = getInnerBoundingClientRect(clippingAncestor, strategy);\n } else {\n const visualOffsets = getVisualOffsets(element);\n rect = {\n x: clippingAncestor.x - visualOffsets.x,\n y: clippingAncestor.y - visualOffsets.y,\n width: clippingAncestor.width,\n height: clippingAncestor.height\n };\n }\n return rectToClientRect(rect);\n}\nfunction hasFixedPositionAncestor(element, stopNode) {\n const parentNode = getParentNode(element);\n if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {\n return false;\n }\n return getComputedStyle$1(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);\n}\n\n// A \"clipping ancestor\" is an `overflow` element with the characteristic of\n// clipping (or hiding) child elements. This returns all clipping ancestors\n// of the given element up the tree.\nfunction getClippingElementAncestors(element, cache) {\n const cachedResult = cache.get(element);\n if (cachedResult) {\n return cachedResult;\n }\n let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');\n let currentContainingBlockComputedStyle = null;\n const elementIsFixed = getComputedStyle$1(element).position === 'fixed';\n let currentNode = elementIsFixed ? getParentNode(element) : element;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {\n const computedStyle = getComputedStyle$1(currentNode);\n const currentNodeIsContaining = isContainingBlock(currentNode);\n if (!currentNodeIsContaining && computedStyle.position === 'fixed') {\n currentContainingBlockComputedStyle = null;\n }\n const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && absoluteOrFixed.has(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);\n if (shouldDropCurrentNode) {\n // Drop non-containing blocks.\n result = result.filter(ancestor => ancestor !== currentNode);\n } else {\n // Record last containing block for next iteration.\n currentContainingBlockComputedStyle = computedStyle;\n }\n currentNode = getParentNode(currentNode);\n }\n cache.set(element, result);\n return result;\n}\n\n// Gets the maximum area that the element is visible in due to any number of\n// clipping ancestors.\nfunction getClippingRect(_ref) {\n let {\n element,\n boundary,\n rootBoundary,\n strategy\n } = _ref;\n const elementClippingAncestors = boundary === 'clippingAncestors' ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);\n const clippingAncestors = [...elementClippingAncestors, rootBoundary];\n const firstClippingAncestor = clippingAncestors[0];\n const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {\n const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);\n accRect.top = max(rect.top, accRect.top);\n accRect.right = min(rect.right, accRect.right);\n accRect.bottom = min(rect.bottom, accRect.bottom);\n accRect.left = max(rect.left, accRect.left);\n return accRect;\n }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));\n return {\n width: clippingRect.right - clippingRect.left,\n height: clippingRect.bottom - clippingRect.top,\n x: clippingRect.left,\n y: clippingRect.top\n };\n}\n\nfunction getDimensions(element) {\n const {\n width,\n height\n } = getCssDimensions(element);\n return {\n width,\n height\n };\n}\n\nfunction getRectRelativeToOffsetParent(element, offsetParent, strategy) {\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n const documentElement = getDocumentElement(offsetParent);\n const isFixed = strategy === 'fixed';\n const rect = getBoundingClientRect(element, true, isFixed, offsetParent);\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n const offsets = createCoords(0);\n\n // If the <body> scrollbar appears on the left (e.g. RTL systems). Use\n // Firefox with layout.scrollbar.side = 3 in about:config to test this.\n function setLeftRTLScrollbarOffset() {\n offsets.x = getWindowScrollBarX(documentElement);\n }\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isOffsetParentAnElement) {\n const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n } else if (documentElement) {\n setLeftRTLScrollbarOffset();\n }\n }\n if (isFixed && !isOffsetParentAnElement && documentElement) {\n setLeftRTLScrollbarOffset();\n }\n const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);\n const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;\n const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;\n return {\n x,\n y,\n width: rect.width,\n height: rect.height\n };\n}\n\nfunction isStaticPositioned(element) {\n return getComputedStyle$1(element).position === 'static';\n}\n\nfunction getTrueOffsetParent(element, polyfill) {\n if (!isHTMLElement(element) || getComputedStyle$1(element).position === 'fixed') {\n return null;\n }\n if (polyfill) {\n return polyfill(element);\n }\n let rawOffsetParent = element.offsetParent;\n\n // Firefox returns the <html> element as the offsetParent if it's non-static,\n // while Chrome and Safari return the <body> element. The <body> element must\n // be used to perform the correct calculations even if the <html> element is\n // non-static.\n if (getDocumentElement(element) === rawOffsetParent) {\n rawOffsetParent = rawOffsetParent.ownerDocument.body;\n }\n return rawOffsetParent;\n}\n\n// Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\nfunction getOffsetParent(element, polyfill) {\n const win = getWindow(element);\n if (isTopLayer(element)) {\n return win;\n }\n if (!isHTMLElement(element)) {\n let svgOffsetParent = getParentNode(element);\n while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {\n if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {\n return svgOffsetParent;\n }\n svgOffsetParent = getParentNode(svgOffsetParent);\n }\n return win;\n }\n let offsetParent = getTrueOffsetParent(element, polyfill);\n while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {\n offsetParent = getTrueOffsetParent(offsetParent, polyfill);\n }\n if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {\n return win;\n }\n return offsetParent || getContainingBlock(element) || win;\n}\n\nconst getElementRects = async function (data) {\n const getOffsetParentFn = this.getOffsetParent || getOffsetParent;\n const getDimensionsFn = this.getDimensions;\n const floatingDimensions = await getDimensionsFn(data.floating);\n return {\n reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),\n floating: {\n x: 0,\n y: 0,\n width: floatingDimensions.width,\n height: floatingDimensions.height\n }\n };\n};\n\nfunction isRTL(element) {\n return getComputedStyle$1(element).direction === 'rtl';\n}\n\nconst platform = {\n convertOffsetParentRelativeRectToViewportRelativeRect,\n getDocumentElement,\n getClippingRect,\n getOffsetParent,\n getElementRects,\n getClientRects,\n getDimensions,\n getScale,\n isElement,\n isRTL\n};\n\nfunction rectsAreEqual(a, b) {\n return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;\n}\n\n// https://samthor.au/2021/observing-dom/\nfunction observeMove(element, onMove) {\n let io = null;\n let timeoutId;\n const root = getDocumentElement(element);\n function cleanup() {\n var _io;\n clearTimeout(timeoutId);\n (_io = io) == null || _io.disconnect();\n io = null;\n }\n function refresh(skip, threshold) {\n if (skip === void 0) {\n skip = false;\n }\n if (threshold === void 0) {\n threshold = 1;\n }\n cleanup();\n const elementRectForRootMargin = element.getBoundingClientRect();\n const {\n left,\n top,\n width,\n height\n } = elementRectForRootMargin;\n if (!skip) {\n onMove();\n }\n if (!width || !height) {\n return;\n }\n const insetTop = floor(top);\n const insetRight = floor(root.clientWidth - (left + width));\n const insetBottom = floor(root.clientHeight - (top + height));\n const insetLeft = floor(left);\n const rootMargin = -insetTop + \"px \" + -insetRight + \"px \" + -insetBottom + \"px \" + -insetLeft + \"px\";\n const options = {\n rootMargin,\n threshold: max(0, min(1, threshold)) || 1\n };\n let isFirstUpdate = true;\n function handleObserve(entries) {\n const ratio = entries[0].intersectionRatio;\n if (ratio !== threshold) {\n if (!isFirstUpdate) {\n return refresh();\n }\n if (!ratio) {\n // If the reference is clipped, the ratio is 0. Throttle the refresh\n // to prevent an infinite loop of updates.\n timeoutId = setTimeout(() => {\n refresh(false, 1e-7);\n }, 1000);\n } else {\n refresh(false, ratio);\n }\n }\n if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {\n // It's possible that even though the ratio is reported as 1, the\n // element is not actually fully within the IntersectionObserver's root\n // area anymore. This can happen under performance constraints. This may\n // be a bug in the browser's IntersectionObserver implementation. To\n // work around this, we compare the element's bounding rect now with\n // what it was at the time we created the IntersectionObserver. If they\n // are not equal then the element moved, so we refresh.\n refresh();\n }\n isFirstUpdate = false;\n }\n\n // Older browsers don't support a `document` as the root and will throw an\n // error.\n try {\n io = new IntersectionObserver(handleObserve, {\n ...options,\n // Handle <iframe>s\n root: root.ownerDocument\n });\n } catch (_e) {\n io = new IntersectionObserver(handleObserve, options);\n }\n io.observe(element);\n }\n refresh(true);\n return cleanup;\n}\n\n/**\n * Automatically updates the position of the floating element when necessary.\n * Should only be called when the floating element is mounted on the DOM or\n * visible on the screen.\n * @returns cleanup function that should be invoked when the floating element is\n * removed from the DOM or hidden from the screen.\n * @see https://floating-ui.com/docs/autoUpdate\n */\nfunction autoUpdate(reference, floating, update, options) {\n if (options === void 0) {\n options = {};\n }\n const {\n ancestorScroll = true,\n ancestorResize = true,\n elementResize = typeof ResizeObserver === 'function',\n layoutShift = typeof IntersectionObserver === 'function',\n animationFrame = false\n } = options;\n const referenceEl = unwrapElement(reference);\n const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...getOverflowAncestors(floating)] : [];\n ancestors.forEach(ancestor => {\n ancestorScroll && ancestor.addEventListener('scroll', update, {\n passive: true\n });\n ancestorResize && ancestor.addEventListener('resize', update);\n });\n const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;\n let reobserveFrame = -1;\n let resizeObserver = null;\n if (elementResize) {\n resizeObserver = new ResizeObserver(_ref => {\n let [firstEntry] = _ref;\n if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {\n // Prevent update loops when using the `size` middleware.\n // https://github.com/floating-ui/floating-ui/issues/1740\n resizeObserver.unobserve(floating);\n cancelAnimationFrame(reobserveFrame);\n reobserveFrame = requestAnimationFrame(() => {\n var _resizeObserver;\n (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);\n });\n }\n update();\n });\n if (referenceEl && !animationFrame) {\n resizeObserver.observe(referenceEl);\n }\n resizeObserver.observe(floating);\n }\n let frameId;\n let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;\n if (animationFrame) {\n frameLoop();\n }\n function frameLoop() {\n const nextRefRect = getBoundingClientRect(reference);\n if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {\n update();\n }\n prevRefRect = nextRefRect;\n frameId = requestAnimationFrame(frameLoop);\n }\n update();\n return () => {\n var _resizeObserver2;\n ancestors.forEach(ancestor => {\n ancestorScroll && ancestor.removeEventListener('scroll', update);\n ancestorResize && ancestor.removeEventListener('resize', update);\n });\n cleanupIo == null || cleanupIo();\n (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();\n resizeObserver = null;\n if (animationFrame) {\n cancelAnimationFrame(frameId);\n }\n };\n}\n\n/**\n * Resolves with an object of overflow side offsets that determine how much the\n * element is overflowing a given clipping boundary on each side.\n * - positive = overflowing the boundary by that number of pixels\n * - negative = how many pixels left before it will overflow\n * - 0 = lies flush with the boundary\n * @see https://floating-ui.com/docs/detectOverflow\n */\nconst detectOverflow = detectOverflow$1;\n\n/**\n * Modifies the placement by translating the floating element along the\n * specified axes.\n * A number (shorthand for `mainAxis` or distance), or an axes configuration\n * object may be passed.\n * @see https://floating-ui.com/docs/offset\n */\nconst offset = offset$1;\n\n/**\n * Optimizes the visibility of the floating element by choosing the placement\n * that has the most space available automatically, without needing to specify a\n * preferred placement. Alternative to `flip`.\n * @see https://floating-ui.com/docs/autoPlacement\n */\nconst autoPlacement = autoPlacement$1;\n\n/**\n * Optimizes the visibility of the floating element by shifting it in order to\n * keep it in view when it will overflow the clipping boundary.\n * @see https://floating-ui.com/docs/shift\n */\nconst shift = shift$1;\n\n/**\n * Optimizes the visibility of the floating element by flipping the `placement`\n * in order to keep it in view when the preferred placement(s) will overflow the\n * clipping boundary. Alternative to `autoPlacement`.\n * @see https://floating-ui.com/docs/flip\n */\nconst flip = flip$1;\n\n/**\n * Provides data that allows you to change the size of the floating element —\n * for instance, prevent it from overflowing the clipping boundary or match the\n * width of the reference element.\n * @see https://floating-ui.com/docs/size\n */\nconst size = size$1;\n\n/**\n * Provides data to hide the floating element in applicable situations, such as\n * when it is not in the same clipping context as the reference element.\n * @see https://floating-ui.com/docs/hide\n */\nconst hide = hide$1;\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = arrow$1;\n\n/**\n * Provides improved positioning for inline reference elements that can span\n * over multiple lines, such as hyperlinks or range selections.\n * @see https://floating-ui.com/docs/inline\n */\nconst inline = inline$1;\n\n/**\n * Built-in `limiter` that will stop `shift()` at a certain point.\n */\nconst limitShift = limitShift$1;\n\n/**\n * Computes the `x` and `y` coordinates that will place the floating element\n * next to a given reference element.\n */\nconst computePosition = (reference, floating, options) => {\n // This caches the expensive `getClippingElementAncestors` function so that\n // multiple lifecycle resets re-use the same result. It only lives for a\n // single call. If other functions become expensive, we can add them as well.\n const cache = new Map();\n const mergedOptions = {\n platform,\n ...options\n };\n const platformWithCache = {\n ...mergedOptions.platform,\n _c: cache\n };\n return computePosition$1(reference, floating, {\n ...mergedOptions,\n platform: platformWithCache\n });\n};\n\nexport { arrow, autoPlacement, autoUpdate, computePosition, detectOverflow, flip, hide, inline, limitShift, offset, platform, shift, size };\n","import type { ReactiveController, ReactiveControllerHost } from 'lit'\n\n/**\n * We can have any number of components open at a time, all of which lock scroll.\n * Consider multiple modals being open, plus some popouts, etc.\n *\n * So we need some bookkeeping to know when to unlock scroll...\n *\n * But we can't simply keep a count of how many components are open,\n * since a misbehaving component may call lockScroll() multiple times.\n *\n * Nor can we rely on the first component to call lockScroll() to be the last to unlockScroll(),\n * since we cannot guarantee order of operations.\n *\n * Therefore, we track instances of ScrollbarController in a Set,\n * and only unlock scroll when the set is empty.\n *\n * We also need to be careful to restore any styles that were there\n * before we locked scroll.\n */\nexport class ScrollbarController implements ReactiveController {\n private static locks = new Set<ScrollbarController>()\n private static resets: Array<() => void> = []\n\n constructor(host: ReactiveControllerHost) {\n host.addController(this)\n }\n\n hostDisconnected() {\n this.unlockScroll()\n }\n\n lockScroll() {\n if (ScrollbarController.locks.size === 0) {\n const documentWidth = document.documentElement.clientWidth\n const width = Math.abs(window.innerWidth - documentWidth)\n\n const computedStyle = getComputedStyle(document.body)\n const paddingRight = Number.parseInt(computedStyle.paddingRight, 10) || 0\n\n // hiding the scrollbar slightly increases the width of the inner viewport.\n // this is fine for the modal, since it is accounted for there. but it causes layout shift for any other fixed position components/elements.\n // so we define a custom property here for the gutter value, since it can be inherited/used by any other component that has a fixed position e.g. toast-group.\n ScrollbarController.setStyle('--n-scrollbar-gutter', `${width + paddingRight}px`)\n ScrollbarController.setStyle('overflow', 'hidden')\n // use physical padding property rather than the logical equivalent, since the scrollbar is on always right side of the viewport, even in RTL.\n ScrollbarController.setStyle('padding-right', `var(--n-scrollbar-gutter)`)\n }\n\n ScrollbarController.locks.add(this)\n }\n\n unlockScroll() {\n ScrollbarController.locks.delete(this)\n\n if (ScrollbarController.locks.size === 0) {\n ScrollbarController.resets.forEach(reset => reset())\n ScrollbarController.resets = []\n }\n }\n\n private static setStyle(property: string, value: string) {\n const { style } = document.body\n\n const previous = style.getPropertyValue(property)\n style.setProperty(property, value)\n\n ScrollbarController.resets.push(() => style.setProperty(property, previous))\n }\n}\n","import type { Alignment } from '@floating-ui/dom'\nimport type { LitElement } from 'lit'\nimport type { LogicalSide } from '../positioning.js'\nimport { property } from 'lit/decorators.js'\n\ntype Constructor<T = Record<string, unknown>> = new (...args: any[]) => T\n\nexport declare class FloatingMixinInterface {\n open: boolean\n align: Alignment\n position: LogicalSide | 'auto'\n}\n\nexport function FloatingMixin<T extends Constructor<LitElement>>(\n superClass: T,\n): Constructor<FloatingMixinInterface> & T {\n class FloatingElement extends superClass {\n /**\n * Controls whether the component is open or not.\n */\n @property({ type: Boolean, reflect: true }) open = false\n\n /**\n * Set the alignment in relation to the toggle (or anchor) depending on the position.\n * `start` will align it to the left of the toggle (or anchor).\n * `end` will align it to the right of the toggle (or anchor).\n * Setting the `position` to `inline-start` or `inline-end` will switch\n * `start` and `end` to the top and bottom respectively.\n */\n @property({ reflect: true }) align: 'start' | 'end' = 'start'\n\n /**\n * Set the position in relation to the toggle (or anchor).\n * Options follow logical properties.\n * `block-start` and `block-end` referring to top and bottom respectively,\n * `inline-start` and `inline-end` referring to left and right respectively.\n * You can also set it to `auto` for automatic positioning depending on\n * which side has the most space available.\n */\n @property({ reflect: true }) position: 'block-end' | 'block-start' | 'inline-start' | 'inline-end' | 'auto'\n = 'block-end'\n }\n\n return FloatingElement\n}\n","import type { Alignment, Placement, Side } from '@floating-ui/dom'\n\ntype FullPlacement = Exclude<Placement, Side>\nexport type LogicalSide = 'block-end' | 'block-start' | 'inline-start' | 'inline-end'\nexport type LogicalSideAlign = `${LogicalSide}-${Alignment}`\ntype Direction = 'ltr' | 'rtl'\n\nconst logicalMapLTR: Record<LogicalSideAlign, FullPlacement> = {\n 'inline-start-start': 'left-start',\n 'inline-start-end': 'left-end',\n 'inline-end-start': 'right-start',\n 'inline-end-end': 'right-end',\n 'block-start-start': 'top-start',\n 'block-start-end': 'top-end',\n 'block-end-start': 'bottom-start',\n 'block-end-end': 'bottom-end',\n}\n\nconst logicalMapRTL: Record<LogicalSideAlign, FullPlacement> = {\n 'inline-start-start': 'right-start',\n 'inline-start-end': 'right-end',\n 'inline-end-start': 'left-start',\n 'inline-end-end': 'left-end',\n 'block-start-start': 'top-start',\n 'block-start-end': 'top-end',\n 'block-end-start': 'bottom-start',\n 'block-end-end': 'bottom-end',\n}\n\nconst logicalMap: Record<LogicalSide, Side> = {\n 'block-end': 'bottom',\n 'block-start': 'top',\n 'inline-start': 'left',\n 'inline-end': 'right',\n}\n\n/**\n * Converts a single logical position to a physical position\n */\nexport function logicalToPhysical(logicalSide: LogicalSide): Side\n\n/**\n * Converts a logical side and alignment to floating-ui compatible placement\n */\nexport function logicalToPhysical(logicalSide: LogicalSide, alignment: Alignment, dir: Direction): Placement\n\nexport function logicalToPhysical(logicalSide: LogicalSide, alignment?: Alignment, dir?: Direction) {\n if (alignment != null && dir != null) {\n const logicalSideAlign: LogicalSideAlign = `${logicalSide}-${alignment}`\n return dir === 'ltr' ? logicalMapLTR[logicalSideAlign] : logicalMapRTL[logicalSideAlign]\n }\n\n return logicalMap[logicalSide]\n}\n","import type {\n ComputePositionConfig,\n Placement,\n} from '@floating-ui/dom'\nimport {\n autoPlacement,\n autoUpdate,\n computePosition,\n flip,\n hide,\n offset,\n shift,\n} from '@floating-ui/dom'\nimport { html, LitElement } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { DirectionController } from '../common/controllers/DirectionController.js'\nimport { EventController } from '../common/controllers/EventController.js'\nimport { LightDismissController } from '../common/controllers/LightDismissController.js'\nimport { ScrollbarController } from '../common/controllers/ScrollbarController.js'\n\nimport { observe } from '../common/decorators/observe.js'\nimport { NordEvent, transition } from '../common/events.js'\nimport { FloatingMixin } from '../common/mixins/FloatingComponentMixin.js'\nimport { logicalToPhysical } from '../common/positioning.js'\nimport componentStyle from '../common/styles/Component.css'\nimport style from './Popout.css'\n\n/*\n * The breakpoint width to switch between \"sheet\" design and floating design\n */\nconst mediaQuery\n = typeof matchMedia === 'undefined'\n ? ({\n matches: false,\n addEventListener() {\n /* noop */\n },\n } as unknown as MediaQueryList)\n : matchMedia('(max-width: 35.9375em)')\n\n/**\n * Popouts are small overlays that open on demand. They let users access additional content and actions without cluttering the page.\n *\n * @status ready\n * @category overlay\n * @slot - The popout content.\n */\n@customElement('nord-popout')\nexport default class Popout extends FloatingMixin(LitElement) {\n static styles = [componentStyle, style]\n\n private targetElement?: HTMLElement\n private anchorElement?: HTMLElement\n private cleanupAutoUpdate?: ReturnType<typeof autoUpdate>\n\n @query('.n-popout', true) private popout!: HTMLDivElement\n\n private scrollBar = new ScrollbarController(this)\n\n /**\n * Handle dismissal of the popout, clicking outside the target button and popout.\n */\n private dismiss = new LightDismissController(this, {\n isOpen: () => this.open,\n onDismiss: e => this.hide(e.type !== 'click'),\n isDismissible: node => node !== this.popout && node !== this.targetElement,\n })\n\n private events = new EventController(this)\n private direction = new DirectionController(this)\n\n @state() private computedPosition?: Placement\n\n @state() private smallViewport = mediaQuery.matches\n\n /**\n * The id for the active element to reference via aria-controls.\n */\n\n @property({ reflect: true }) id: string = ''\n\n /**\n * Set an optional anchor element to align against, replacing the triggering element.\n */\n @property({ reflect: true }) anchor?: string\n\n /**\n * Set to true to always display the popout as a floating overlay, even on smaller viewports.\n */\n @property({ reflect: true, type: Boolean, attribute: 'always-floating' }) alwaysFloating: boolean = false\n\n /**\n * Show the popout.\n * A promise that resolves to a `TransitionEvent` when the popout's show animation ends or is cancelled.\n * If the popout is already open, the promise resolves immediately with `undefined`.\n */\n async show(): Promise<TransitionEvent | void> {\n if (this.open) {\n return Promise.resolve()\n }\n\n this.enterTopLayer()\n this.open = true\n\n // we should only focus once the popout is visible after render is complete\n await this.updateComplete\n\n /**\n * Dispatched when the popout is opened.\n */\n this.dispatchEvent(new NordEvent('open'))\n\n return transition(this.popout)\n }\n\n /**\n * Hide the popout.\n * Returns a promise that resolves to a `TransitionEvent` when the popout's hide animation ends or is cancelled.\n * If the popout is already closed, the promise resolves immediately with `undefined`.\n * @param {boolean} moveFocusToButton prevent focus returning to the target button. Default is true.\n */\n async hide(moveFocusToButton: boolean = true): Promise<TransitionEvent | void> {\n if (!this.open) {\n return Promise.resolve()\n }\n\n this.open = false\n\n this.cleanupAutoUpdate?.()\n\n /**\n * Dispatched when the popout is closed.\n */\n this.dispatchEvent(new NordEvent('close'))\n\n if (moveFocusToButton) {\n this.targetElement?.focus({ preventScroll: true })\n }\n\n const result = await transition(this.popout)\n this.leaveTopLayer()\n return result\n }\n\n /**\n * Position the popout on load.\n */\n firstUpdated() {\n if (!this.smallViewport || this.alwaysFloating) {\n this.updatePosition()\n }\n }\n\n connectedCallback() {\n super.connectedCallback()\n\n this.events.listen(mediaQuery, 'change', this.handleMediaQueryChange)\n\n this.initializeElements()\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n\n this.cleanupAutoUpdate?.()\n this.targetElement?.removeAttribute('aria-expanded')\n }\n\n render() {\n return html`\n <div\n class=\"n-popout ${this.computedPosition} is-${this.direction.dir}\"\n aria-hidden=${this.open ? 'false' : 'true'}\n @transitionend=${this.enableScroll}\n >\n <slot></slot>\n </div>\n `\n }\n\n @observe('id')\n protected handleIdChange() {\n // clean up any old listeners\n this.targetElement?.removeEventListener('click', this.toggleOpen)\n\n if (!this.id) {\n console.warn('NORD: popout requires an id attribute and value')\n }\n else {\n this.initializeElements()\n }\n }\n\n private initializeElements() {\n this.targetElement = this.getToggle()\n this.anchorElement = this.getAnchor()\n\n this.events.listen(this.targetElement, 'click', this.toggleOpen)\n }\n\n @observe('open')\n protected handleOpenChange() {\n this.targetElement?.setAttribute('aria-expanded', `${this.open}`)\n\n if (this.open) {\n this.enterTopLayer()\n\n if (this.smallViewport && !this.alwaysFloating) {\n // hide scrollbar and prevent scroll on body\n this.scrollBar.lockScroll()\n }\n else if (this.anchorElement) {\n this.cleanupAutoUpdate = autoUpdate(this.anchorElement, this, this.updatePosition)\n }\n }\n else {\n this.cleanupAutoUpdate?.()\n }\n }\n\n @observe('anchor')\n protected handleAnchorChange() {\n this.cleanupAutoUpdate?.()\n this.anchorElement = this.getAnchor()\n\n // if the popout is already open when the anchor changes, we should update its position\n if (this.open && (!this.smallViewport || this.alwaysFloating) && this.anchorElement) {\n this.cleanupAutoUpdate = autoUpdate(this.anchorElement, this, this.updatePosition)\n }\n }\n\n private enableScroll = () => {\n // scrollbar should only be restored when the backdrop has transitioned\n // that way we avoid awkward double scrollbars.\n if (!this.open) {\n this.scrollBar.unlockScroll()\n this.leaveTopLayer()\n }\n }\n\n /**\n * Place the element in the top layer via the Popover API so that\n * position: fixed works relative to the viewport regardless of\n * container queries or other containing block ancestors.\n */\n private enterTopLayer() {\n if (typeof this.showPopover !== 'function')\n return\n\n try {\n this.setAttribute('popover', 'manual')\n this.showPopover()\n }\n catch {\n this.removeAttribute('popover')\n }\n }\n\n private leaveTopLayer() {\n this.removeAttribute('popover')\n }\n\n /**\n * Get the position of the element toggling the popout\n * and position the popout underneath it, taking into account the optional placement.\n */\n private updatePosition = async () => {\n if (!this.anchorElement) {\n return\n }\n\n const computePositionConfig: ComputePositionConfig = {\n strategy: 'fixed',\n }\n\n if (this.position === 'auto') {\n computePositionConfig.middleware = [\n offset(8),\n autoPlacement({ alignment: this.align, padding: 8 }),\n shift({\n padding: 8,\n }),\n hide(),\n ]\n }\n else {\n computePositionConfig.placement = logicalToPhysical(this.position, this.align, this.direction.dir)\n computePositionConfig.middleware = [\n offset(8),\n flip(),\n shift({\n padding: 8,\n }),\n hide(),\n ]\n }\n\n const { x, y, placement, middlewareData } = await computePosition(this.anchorElement, this, computePositionConfig)\n\n this.computedPosition = placement\n\n // use physical properties here since floating-ui\n // works exclusively in physical dimensions\n // we do all the mapping in logicalToPhysical\n this.style.setProperty('--_n-popout-position-x', `${x}px`)\n this.style.setProperty('--_n-popout-position-y', `${y}px`)\n\n if (middlewareData.hide?.referenceHidden) {\n this.hide()\n }\n }\n\n /**\n * Toggle the popout open or closed using state.\n * Updating the position to underneath the target button before the popout is opened.\n */\n private toggleOpen = (e: Event) => {\n e.preventDefault()\n if (this.open) {\n this.hide(false)\n }\n else if (!this.smallViewport || this.alwaysFloating) {\n this.enterTopLayer()\n this.updatePosition().then(() => this.show())\n }\n else {\n this.show()\n }\n }\n\n private getToggle() {\n const rootNode = this.getRootNode() as Document | ShadowRoot\n const allToggles = rootNode.querySelectorAll<HTMLElement>(`[aria-controls='${this.id}']`)\n\n let toggle = allToggles[0]\n\n // When multiple toggles share the same aria-controls (duplicate IDs on page),\n // pair each toggle with its corresponding popout by document order.\n if (allToggles.length > 1) {\n const index = [...rootNode.querySelectorAll<HTMLElement>(`[id='${this.id}']`)].indexOf(this)\n if (index >= 0 && index < allToggles.length) {\n toggle = allToggles[index]\n }\n }\n\n if (toggle instanceof HTMLSlotElement) {\n return toggle.assignedElements()[0] as HTMLElement\n }\n\n return toggle\n }\n\n private getAnchor() {\n if (!this.anchor) {\n return this.targetElement\n }\n\n const rootNode = this.getRootNode() as Document | ShadowRoot\n const anchor = <HTMLElement>rootNode.querySelector(`#${this.anchor}`)\n\n if (anchor instanceof HTMLSlotElement) {\n return anchor.assignedElements()[0] as HTMLElement\n }\n\n return anchor\n }\n\n /**\n * Update the smallViewport flag to switch between \"sheet\" and \"floating\".\n * autoUpdate is needed when a viewport gets larger and the popout is open.\n */\n private handleMediaQueryChange = () => {\n this.smallViewport = mediaQuery.matches\n\n this.cleanupAutoUpdate?.()\n\n if ((!this.smallViewport || this.alwaysFloating) && this.open && this.anchorElement) {\n this.cleanupAutoUpdate = autoUpdate(this.anchorElement, this, this.updatePosition)\n this.scrollBar.unlockScroll()\n }\n else if (this.open) {\n this.scrollBar.lockScroll()\n }\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-popout': Popout\n }\n}\n","import { html, LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport componentStyle from '../common/styles/Component.css'\nimport style from './Stack.css'\n\n/**\n * Stack component manages layout of immediate children along the\n * vertical or horizontal axis with optional spacing between each child.\n *\n * @status ready\n * @category structure\n * @slot - The stack content.\n *\n * @cssprop [--n-stack-gap=var(--n-space-m)] - Controls the spacing between items, using our [spacing tokens](/tokens/#space).\n */\n@customElement('nord-stack')\nexport default class Stack extends LitElement {\n static styles = [componentStyle, style]\n\n /**\n * The space injected between components.\n */\n @property({ reflect: true }) gap: 'none' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl' = 'm'\n\n /**\n * The direction of the stack.\n */\n @property({ reflect: true }) direction: 'vertical' | 'horizontal' = 'vertical'\n\n /**\n * How to align the child items inside the stack.\n */\n @property({ reflect: true, attribute: 'align-items' }) alignItems?:\n | 'center'\n | 'start'\n | 'end'\n | 'baseline'\n | 'stretch' = 'stretch'\n\n /**\n * Defines whether the Stack items are forced in a single line\n * or can be flowed into multiple lines.\n */\n @property({ reflect: true, type: Boolean }) wrap = false\n\n /**\n * How to justify the child items inside the stack.\n */\n @property({ reflect: true, attribute: 'justify-content' }) justifyContent?:\n | 'center'\n | 'start'\n | 'end'\n | 'space-between'\n | 'space-around'\n | 'space-evenly'\n\n render() {\n return html`<slot></slot>`\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-stack': Stack\n }\n}\n","import type Button from '../button/Button.js'\nimport type Calendar from '../calendar/Calendar.js'\nimport type { DatePredicate } from '../calendar/Calendar.js'\nimport type { DateSelectEvent } from '../calendar/DateSelectEvent.js'\nimport type Popout from '../popout/Popout.js'\nimport type { DateAdapter } from './date-adapter.js'\n\nimport * as calendarIcon from '@nordhealth/icons/lib/assets/interface-calendar.js'\nimport * as closeIcon from '@nordhealth/icons/lib/assets/interface-close-small.js'\nimport { html, LitElement, nothing } from 'lit'\n\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { ref } from 'lit/directives/ref.js'\nimport { isDownwardsSwipe, SwipeController } from '../common/controllers/SwipeController.js'\n\nimport { createDate, DaysOfWeek, parseISODate, printISODate } from '../common/dates.js'\nimport { cond } from '../common/directives/cond.js'\nimport { NordEvent } from '../common/events.js'\nimport { FocusableMixin } from '../common/mixins/FocusableMixin.js'\nimport { FormAssociatedMixin } from '../common/mixins/FormAssociatedMixin.js'\nimport { InputMixin } from '../common/mixins/InputMixin.js'\nimport { ReadonlyMixin } from '../common/mixins/ReadonlyMixin.js'\nimport { SizeMixin } from '../common/mixins/SizeMixin.js'\nimport componentStyle from '../common/styles/Component.css'\n\nimport formFieldStyle from '../common/styles/FormField.css'\nimport textFieldStyle from '../common/styles/TextField.css'\nimport Icon from '../icon/Icon.js'\n\nimport { LocalizeController } from '../localization/LocalizeController.js'\nimport { isoAdapter } from './date-adapter.js'\nimport style from './DatePicker.css'\nimport '../input/Input.js'\nimport '../button/Button.js'\n\nimport '../visually-hidden/VisuallyHidden.js'\nimport '../popout/Popout.js'\nimport '../stack/Stack.js'\nimport '../calendar/Calendar.js'\n\nIcon.registerIcon(calendarIcon)\nIcon.registerIcon(closeIcon)\n\nconst isDateDisabled = () => false\nconst isDateHighlighted = () => false\n\n/**\n *\n * Date Picker allows user to enter a date either through text input,\n * or by choosing a date from the calendar. Please note that the date\n * must be passed in ISO-8601 format: YYYY-MM-DD.\n *\n * @status ready\n * @category form\n *\n * @fires {NordEvent} open - Dispatched when the popout is opened.\n * @fires {NordEvent} close - Dispatched when the popout is closed.\n * @fires {DateSelectEvent} nord-focus-date - Dispatched when the calendar's focused date changes.\n *\n * @localization modalHeading - Heading for the date picker's modal.\n * @localization closeLabel - Accessible label for the close button.\n * @localization buttonLabel - Accessible label for the toggle button that opens the date picker modal.\n * @localization selectedDateMessage - Describes the selected date. This message is appended to the toggle button label when a date is selected.\n * @localization dateOutOfMinBound - Error message shown when the entered date is below the minimum allowed date.\n * @localization dateOutOfMaxBound - Error message shown when the entered date is above the maximum allowed date.\n *\n * @cssprop [--n-label-color=var(--n-color-text)] - Controls the text color of the label, using our [color tokens](/tokens/#color).\n */\n@customElement('nord-date-picker')\nexport default class DatePicker extends SizeMixin(\n FormAssociatedMixin(ReadonlyMixin(InputMixin(FocusableMixin(LitElement)))),\n) {\n static styles = [componentStyle, formFieldStyle, textFieldStyle, style]\n\n @query(`.n-date-picker-toggle`, true) private toggleButton!: Button\n @query(`.n-date-picker-close-button`, true) private closeButton!: HTMLButtonElement\n @query(`nord-calendar`, true) private calendar!: Calendar\n @query(`[role=\"dialog\"]`, true) private popout!: Popout\n\n private swipe = new SwipeController(this, {\n target: () => this.popout,\n matchesGesture: isDownwardsSwipe,\n onSwipeEnd: () => this.hide(),\n })\n\n private localize = new LocalizeController<'nord-date-picker'>(this, {\n onLangChange: () => this.createDateFormatters(),\n })\n\n /**\n * Whilst dateAdapter is used for handling the formatting/parsing dates in the input,\n * these are used to format dates exclusively for the benefit of screen readers.\n *\n * We prefer DateTimeFormat over date.toLocaleDateString, as the former has\n * better performance when formatting large number of dates. See:\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString#Performance\n */\n private dateFormatLong!: Intl.DateTimeFormat\n\n /**\n * Date value. Must be in IS0-8601 format: YYYY-MM-DD.\n */\n @property() value: string = ''\n\n /**\n * Internal validation error message. Set automatically when min/max validation fails.\n * This is a read-only property that's managed by the component.\n */\n @property({ attribute: false }) internalError?: string\n\n get valueAsDate(): Date | undefined {\n return parseISODate(this.value)\n }\n\n /**\n * Get/set the value of the picker as a Date object.\n */\n set valueAsDate(date: Date | undefined) {\n this.value = date ? printISODate(date) : ''\n }\n\n get valueAsNumber(): number {\n return this.valueAsDate?.getTime() ?? Number.NaN\n }\n\n /**\n * Get/set the value of the picker as the number of milliseconds elapsed since the UNIX epoch.\n */\n set valueAsNumber(date: number) {\n this.value = date ? printISODate(new Date(date)) : ''\n }\n\n /**\n * Get the raw value of the input field without date formatting. This is a read-only property.\n */\n @property({ attribute: false }) rawValue?: string\n\n /**\n * Controls whether date picker dialog is open or not.\n */\n @property({ type: Boolean, reflect: true }) open = false\n\n /**\n * Minimum date allowed to be picked. Must be in IS0-8601 format: YYYY-MM-DD.\n * This setting can be used alone or together with the max property.\n */\n @property({ reflect: true }) min?: string\n\n /**\n * Maximum date allowed to be picked. Must be in IS0-8601 format: YYYY-MM-DD.\n * This setting can be used alone or together with the min property.\n */\n @property({ reflect: true }) max?: string\n\n /**\n * The date that is considered today. Must be in IS0-8601 format: YYYY-MM-DD.\n * If not set, the current local date of the user is used.\n */\n @property({ reflect: true }) today?: string\n\n /**\n * Which day is considered first day of the week? `0` for Sunday, `1` for Monday, etc.\n * Default is Monday.\n */\n @property({ reflect: true, attribute: 'first-day-of-week', type: Number }) firstDayOfWeek: DaysOfWeek\n = DaysOfWeek.Monday\n\n /**\n * Date adapter, for custom parsing/formatting.\n * Must be object with a `parse` function which accepts a `string` and returns a `Date`,\n * and a `format` function which accepts a `Date` and returns a `string`.\n * Default is IS0-8601 parsing and formatting.\n */\n @property({ attribute: false }) dateAdapter: DateAdapter = isoAdapter\n\n /**\n * Controls which days are disabled and therefore disallowed.\n * For example, this can be used to disallow selection of weekends.\n */\n @property({ attribute: false }) isDateDisabled: DatePredicate = isDateDisabled\n\n /**\n * Controls which days are highlighted with a small indicator.\n * Returning `false` will not show an indicator.\n * Returning `true` will show the indicator, but without an accessible label. Therefore\n * Returning a string will show the indicator, and use the string as accessible label.\n * It is recommended to return a string rather than `true` whenever possible.\n */\n @property({ attribute: false }) isDateHighlighted: (date: Date) => string | boolean = isDateHighlighted\n\n /**\n * Controls whether the date picker expands to fill the width of its container.\n */\n @property({ reflect: true, type: Boolean }) expand = false\n\n firstUpdated() {\n // Make sure the date picker has a raw value when the value is initially set\n this.rawValue = (<HTMLInputElement | null> this.focusableRef.value)?.value\n }\n\n render() {\n const { valueAsDate } = this\n const formattedDate = valueAsDate ? this.dateAdapter.format(valueAsDate) : ''\n\n return html`\n <nord-input\n class=\"n-date-picker-input\"\n value=${formattedDate}\n label=${ifDefined(this.label)}\n hint=${ifDefined(this.hint)}\n error=${cond(this.error || this.internalError, this.error || this.internalError)}\n placeholder=${ifDefined(this.placeholder)}\n id=${this.inputId}\n size=${this.size}\n ?expand=${this.expand}\n ?disabled=${this.disabled}\n ?required=${this.required}\n ?readonly=${this.readonly}\n ?hint-below=${this.hintBelow}\n ?hide-label=${this.hideLabel}\n ?hide-required=${this.hideRequired}\n disallow-pattern=\"[^0-9./-]\"\n @focus=${this.handleFocus}\n @blur=${this.handleBlur}\n @input=${this.handleInputChange}\n ${ref(this.focusableRef)}\n aria-invalid=${cond(this.error || this.internalError, 'true')}\n aria-describedby=${ifDefined(this.getDescribedBy())}\n >\n ${!this.hintSlot.isEmpty ? html`<slot name=\"hint\" slot=\"hint\"></slot>` : nothing}\n ${!this.labelSlot.isEmpty ? html`<slot name=\"label\" slot=\"label\"></slot>` : nothing}\n <nord-button\n size=${this.size}\n ?disabled=${this.disabled || this.readonly}\n slot=\"end\"\n class=\"n-date-picker-toggle\"\n aria-controls=\"popout\"\n type=\"button\"\n >\n <nord-icon name=\"interface-calendar\"></nord-icon>\n <nord-visually-hidden>\n ${this.localize.term('buttonLabel')}\n ${valueAsDate\n ? html`\n <span>\n , ${this.localize.term('selectedDateMessage')} ${this.dateFormatLong.format(valueAsDate)}\n </span>\n `\n : nothing}\n </nord-visually-hidden>\n </nord-button>\n </nord-input>\n <nord-popout\n id=\"popout\"\n anchor=${this.inputId}\n align=\"end\"\n position=\"block-end\"\n role=\"dialog\"\n aria-modal=\"true\"\n ?open=${this.open}\n @open=${this.handleOpen}\n @close=${this.handleClose}\n aria-labelledby=\"header\"\n >\n <div aria-hidden=\"true\" tabindex=\"0\" @focus=${this.focusLast}></div>\n\n <nord-stack class=\"n-date-picker-header\" direction=\"horizontal\" justify-content=\"space-between\">\n <div class=\"n-date-picker-heading\" id=\"header\">${this.localize.term('modalHeading')}</div>\n <nord-button\n class=\"n-date-picker-close-button\"\n type=\"button\"\n size=\"s\"\n variant=\"plain\"\n @click=${this.handleClose}\n >\n <nord-visually-hidden>${this.localize.term('closeLabel')}</nord-visually-hidden>\n <nord-icon name=\"interface-close-small\"></nord-icon>\n </nord-button>\n </nord-stack>\n\n <nord-calendar\n class=\"n-date-picker-calendar\"\n expand\n value=${this.value}\n min=${ifDefined(this.min)}\n max=${ifDefined(this.max)}\n today=${ifDefined(this.today)}\n .firstDayOfWeek=${this.firstDayOfWeek}\n .isDateDisabled=${this.isDateDisabled}\n .isDateHighlighted=${this.isDateHighlighted}\n @change=${this.handleDaySelect}\n ></nord-calendar>\n\n <div aria-hidden=\"true\" tabindex=\"0\" @focus=${this.focusFirst}></div>\n </nord-popout>\n `\n }\n\n private createDateFormatters() {\n this.dateFormatLong = new Intl.DateTimeFormat(this.localize.resolvedLang, {\n day: 'numeric',\n month: 'long',\n year: 'numeric',\n })\n }\n\n private focusFirst() {\n this.closeButton.focus()\n }\n\n private focusLast() {\n this.calendar.focus({ target: 'day' })\n }\n\n private handleDaySelect = (e: DateSelectEvent) => {\n e.stopPropagation()\n this.setValue(e.date)\n this.hide()\n }\n\n private handleOpen() {\n this.open = true\n this.calendar.focus({ target: 'month' })\n }\n\n private handleClose() {\n this.open = false\n }\n\n private handleBlur = (event: Event) => {\n event.stopPropagation()\n\n // Validate on blur and set internal error\n this.internalError = this.validateDateBounds(this.valueAsDate)\n\n this.dispatchEvent(new NordEvent('blur'))\n }\n\n private handleFocus = (event: Event) => {\n event.stopPropagation()\n this.dispatchEvent(new NordEvent('focus'))\n }\n\n private handleInputChange = (e: Event) => {\n const target = e.target as HTMLInputElement\n\n const parsed = this.dateAdapter.parse(target.value, createDate)\n this.rawValue = (<HTMLInputElement | null> this.focusableRef.value)?.value\n\n if (parsed || target.value === '') {\n this.setValue(parsed)\n }\n }\n\n private setValue(date?: Date) {\n this.value = date ? printISODate(date) : ''\n\n const { valueAsDate } = this\n const formattedDate = valueAsDate ? this.dateAdapter.format(valueAsDate) : ''\n this.rawValue = formattedDate\n\n this.dispatchEvent(new NordEvent('change'))\n }\n\n private validateDateBounds(date: Date | undefined): string | undefined {\n if (!date)\n return undefined\n\n const minDate = parseISODate(this.min || '')\n const maxDate = parseISODate(this.max || '')\n\n if (minDate && date < minDate) {\n return this.localize.term('dateOutOfMinBound', this.min!)\n }\n if (maxDate && date > maxDate) {\n return this.localize.term('dateOutOfMaxBound', this.max!)\n }\n }\n\n /**\n * Hide the date picker programmatically.\n * @param moveFocusToButton A boolean option to move the focus to the original button that opens the popout.\n */\n hide(moveFocusToButton?: boolean) {\n this.popout.hide(moveFocusToButton)\n }\n\n /**\n * Show the date picker programmatically.\n */\n show() {\n this.popout.show()\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-date-picker': DatePicker\n }\n}\n","import { LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { observe } from '../common/decorators/observe.js'\n\nimport componentStyle from '../common/styles/Component.css'\nimport style from './Divider.css'\n\n/**\n * Divider components are used to separate and distinguish sections of\n * content or groups of menu items. Visually, they look like\n * horizontal or vertical lines.\n *\n * @status ready\n * @category structure\n *\n * @cssprop [--n-divider-color=var(--n-color-border)] - Controls the color of the divider, using our [color tokens](/tokens/#color).\n * @cssprop [--n-divider-size=1px] - Controls the size, or thickness, of the divider.\n */\n@customElement('nord-divider')\nexport default class Divider extends LitElement {\n static styles = [componentStyle, style]\n\n /**\n * The direction of the divider.\n */\n @property({ reflect: true }) direction: 'vertical' | 'horizontal' = 'horizontal'\n\n firstUpdated() {\n this.setAttribute('role', 'separator')\n }\n\n @observe('direction')\n private handleDirectionChange() {\n this.setAttribute('aria-orientation', this.direction === 'vertical' ? 'vertical' : 'horizontal')\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-divider': Divider\n }\n}\n","import { html, LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport componentStyle from '../common/styles/Component.css'\nimport style from './Footer.css'\n\n/**\n * The footer is a block of designated space for providing additional information or actions that are positioned below the main content.\n *\n * @status new\n * @category structure\n * @slot - The footer content.\n *\n * @cssprop [--n-footer-padding-inline=var(--n-space-l)] - Controls the inline padding around the footer’s main slot, using [spacing tokens](/tokens/#space).\n * @cssprop [--n-footer-box-shadow=var(--n-box-shadow-header)] - Controls the box shadow of the footer, using [box shadow tokens](/tokens/#box-shadow).\n * @cssprop [--n-footer-background-color=var(--n-color-surface)] - Controls the background color of the footer, using [color tokens](/tokens/#color).\n */\n@customElement('nord-footer')\nexport default class Footer extends LitElement {\n static styles = [componentStyle, style]\n\n /**\n * Controls the size of the footer component.\n */\n @property({ reflect: true }) size: 'm' | 's' = 'm'\n\n render() {\n return html`\n <footer class=\"n-footer\">\n <slot></slot>\n </footer>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-footer': Footer\n }\n}\n","import { html, LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { SlotController } from '../common/controllers/SlotController.js'\n\nimport componentStyle from '../common/styles/Component.css'\n\nimport style from './Drawer.css'\nimport '../footer/Footer.js'\n\n/**\n * Drawer is used to display context-sensitive actions and information.\n * Drawer doesn’t block users from completing their task, like a modal would.\n *\n * @status new\n * @category structure\n * @slot header - Optional slot that holds a header for the drawer.\n * @slot - Default slot.\n * @slot footer - Optional slot that holds footer content for the drawer.\n *\n * @cssprop [--n-drawer-padding=var(--n-space-l)] - Controls the padding around the main area (the default slot), using our [spacing tokens](/tokens/#space).\n */\n@customElement('nord-drawer')\nexport default class Drawer extends LitElement {\n static styles = [componentStyle, style]\n\n private footerSlot = new SlotController(this, 'footer')\n\n /**\n * Controls the padding of the drawer component.\n */\n @property({ reflect: true }) padding: 'm' | 'none' = 'm'\n\n render() {\n return html`\n <div class=\"n-drawer\">\n <slot name=\"header\"></slot>\n\n <div class=\"n-drawer-main\">\n <slot></slot>\n </div>\n\n <nord-footer ?hidden=${this.footerSlot.isEmpty}>\n <slot name=${this.footerSlot.slotName}></slot>\n </nord-footer>\n </div>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-drawer': Drawer\n }\n}\n","import { html, LitElement, nothing } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport componentStyle from '../common/styles/Component.css'\nimport style from './DropdownGroup.css'\n\n/**\n * Dropdown group includes all the actions or items in a single dropdown\n * group and is used for grouping items into related categories.\n *\n * @status ready\n * @category action\n * @slot - The dropdown group content.\n */\n@customElement('nord-dropdown-group')\nexport default class DropdownGroup extends LitElement {\n static styles = [componentStyle, style]\n\n /**\n * Heading and accessible label for the dropdown group.\n */\n @property({ reflect: true }) heading?: string\n\n render() {\n return html`\n <div class=\"n-dropdown-group\">\n ${this.heading\n ? html`<p id=\"heading\" aria-hidden=\"true\" class=\"n-dropdown-group-heading\">${this.heading}</p>`\n : nothing}\n <div class=\"n-dropdown-group-content\" role=\"group\" aria-labelledby=${this.heading ? 'heading' : nothing}>\n <slot></slot>\n </div>\n </div>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-dropdown-group': DropdownGroup\n }\n}\n","import type { TemplateResult } from 'lit'\nimport { html, LitElement, nothing } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { ref } from 'lit/directives/ref.js'\nimport { SlotController } from '../common/controllers/SlotController.js'\nimport { cond } from '../common/directives/cond.js'\nimport { FocusableMixin } from '../common/mixins/FocusableMixin.js'\n\nimport componentStyle from '../common/styles/Component.css'\nimport style from './DropdownItem.css'\n\n/**\n * Dropdown item populates dropdown with actions. Items can be\n * placed either inside a dropdown group or directly inside a\n * dropdown component.\n *\n * @status ready\n * @category action\n * @slot - The dropdown item content.\n * @slot start - Used to place content before dropdown item text. Typically used for icons.\n * @slot end - Used to place content after dropdown item text. Typically used for icons.\n *\n * @cssprop [--n-dropdown-item-background-color=transparent] - Controls the background color of the item, using our [color tokens](/tokens/#color).\n * @cssprop [--n-dropdown-item-color=var(--n-color-text)] - Controls the color of the text within the item, using our [color tokens](/tokens/#color).\n */\n@customElement('nord-dropdown-item')\nexport default class DropdownItem extends FocusableMixin(LitElement) {\n static styles = [componentStyle, style]\n\n private endSlot = new SlotController(this, 'end')\n\n /**\n * The url the dropdown item should link to.\n */\n @property({ reflect: true }) href?: string\n\n /**\n * When provided together with a href property, determines where\n * to open the linked URL. The keywords have special meanings for\n * where to load the URL: “_self” means the current browsing context,\n * “_blank” usually a new tab but users can configure browsers this to\n * open a new window instead, “_parent” means the parent browsing\n * context of the current one, but if no parent exists, behaves as\n * _self, and finally “top” means the topmost browsing context.\n */\n @property() target: '_self' | '_blank' | '_parent' | '_top' = '_self'\n\n /**\n * Makes the component disabled. This prevents users from\n * being able to interact with the component, and conveys\n * its inactive state to assistive technologies.\n */\n @property({ type: Boolean, reflect: true }) disabled = false\n\n render() {\n const innards = html`\n <slot name=\"start\"></slot>\n <div class=\"n-content\"><slot></slot></div>\n <slot name=\"end\" ?hidden=${this.endSlot.isEmpty}></slot>\n `\n\n return this.href ? this.renderLink(innards) : this.renderButton(innards)\n }\n\n /**\n * We jump through some hoops here to ensure the link is treated correctly when \"disabled\".\n * Links cannot be disabled natively, so we need to rely on some aria magic to get the correct semantics.\n * Along with the advice in the article below, we also set tabindex to \"-1\", so it is taken out of tab order.\n *\n * @see https://www.scottohara.me/blog/2021/05/28/disabled-links.html\n */\n private renderLink(innards: TemplateResult) {\n return html`\n <a\n ${ref(this.focusableRef)}\n class=\"n-dropdown-item\"\n target=${this.target}\n href=${cond(this.disabled, nothing, this.href)}\n tabindex=${cond(this.disabled, '-1')}\n aria-disabled=${cond(this.disabled, 'true')}\n role=${cond(this.disabled, 'link')}\n >${innards}\n </a>\n `\n }\n\n private renderButton(innards: TemplateResult) {\n return html`\n <button ${ref(this.focusableRef)} class=\"n-dropdown-item\" ?disabled=${this.disabled}>${innards}</button>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-dropdown-item': DropdownItem\n }\n}\n","import type Dropdown from '../dropdown/Dropdown.js'\nimport type Popout from '../popout/Popout.js'\nimport { html, LitElement } from 'lit'\nimport { customElement, query, state } from 'lit/decorators.js'\nimport { classMap } from 'lit/directives/class-map.js'\nimport { EventController } from '../common/controllers/EventController.js'\nimport componentStyle from '../common/styles/Component.css'\nimport style from './DropdownSubmenu.css'\nimport '../popout/Popout.js'\n\nlet popoutCounter = 0\n\n/**\n * Dropdown submenu nests a secondary menu within a parent dropdown.\n * The trigger slot contains the item that opens the submenu, and the default slot contains the submenu items.\n *\n * Supports both hover (non-touch) and click (touch-devices/accessibility) interactions.\n *\n * On small screens, uses mobile stack navigation: tapping a submenu trigger replaces the\n * dropdown's visible content with the submenu's items and shows a back button.\n *\n * @status ready\n * @category action\n *\n * @slot trigger - The element that opens the submenu (typically nord-dropdown-item).\n * @slot - The submenu content items.\n *\n * @fires {NordEvent} open - Forwarded from the internal nord-popout.\n * @fires {NordEvent} close - Forwarded from the internal nord-popout.\n * @fires {CustomEvent} nord-submenu-navigate - Fired when mobile stack navigation activates this submenu.\n */\n@customElement('nord-dropdown-submenu')\nexport default class DropdownSubmenu extends LitElement {\n static styles = [componentStyle, style]\n\n @query('nord-popout')\n private popout?: Popout\n\n /** @internal */\n @state() private mobileActive = false\n\n private readonly popoutId = `nord-dropdown-submenu-popout-${++popoutCounter}`\n private events = new EventController(this)\n private currentTriggerElement: HTMLElement | null = null\n private popoutOpen = false\n private readonly mobileMediaQuery = window.matchMedia('(max-width: 35.9375em)')\n @state() private isSmallScreen = this.mobileMediaQuery.matches\n @state() private parentDropdownAlwaysFloating = false\n private parentObserver?: MutationObserver\n\n private get shouldUseMobileStack(): boolean {\n return this.isSmallScreen && !this.parentDropdownAlwaysFloating\n }\n\n private get parentDropdown(): Dropdown | null {\n return this.closest<Dropdown>('nord-dropdown')\n }\n\n private get isInSubmenuStack(): boolean {\n const parent = this.parentDropdown\n if (!parent)\n return false\n return parent.submenuStackRef.includes(this)\n }\n\n private get isDeepestInStack(): boolean {\n const parent = this.parentDropdown\n if (!parent)\n return false\n return parent.deepestSubmenu === this\n }\n\n connectedCallback() {\n super.connectedCallback()\n\n // Set aria-haspopup on trigger before first render\n const triggerElement = this.querySelector<HTMLElement>('[slot=\"trigger\"]')\n triggerElement?.setAttribute('aria-haspopup', 'menu')\n\n // Read alwaysFloating from parent dropdown\n const parentDropdown = this.closest<Dropdown>('nord-dropdown')\n if (parentDropdown) {\n this.parentDropdownAlwaysFloating = parentDropdown.alwaysFloating\n // Close this submenu when a sibling regular item is hovered\n this.events.listen(parentDropdown, 'mouseover', this.handleParentDropdownMouseOver)\n\n // Observe always-floating attribute on parent dropdown for reactivity\n this.parentObserver = new MutationObserver((mutations) => {\n for (const mutation of mutations) {\n if (mutation.attributeName === 'always-floating') {\n this.parentDropdownAlwaysFloating = parentDropdown.alwaysFloating\n }\n }\n })\n this.parentObserver.observe(parentDropdown, {\n attributes: true,\n attributeFilter: ['always-floating'],\n })\n }\n\n // Listen for screen size changes (use correct breakpoint)\n this.events.listen(this.mobileMediaQuery, 'change', (event: MediaQueryListEvent) => {\n this.isSmallScreen = event.matches\n this.requestUpdate()\n })\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n this.parentObserver?.disconnect()\n }\n\n render() {\n // Mobile stack navigation: show content inline when active\n if (this.shouldUseMobileStack && this.mobileActive) {\n // Add active class for any submenu in the stack, and is-deepest-active for the deepest one\n return html`\n <slot name=\"trigger\"></slot>\n <div class=${classMap({\n 'n-dropdown-submenu-content': true,\n 'active': this.isInSubmenuStack,\n 'is-deepest-active': this.isDeepestInStack,\n })} @keydown=${this.handleContentKeydown}>\n <slot></slot>\n </div>\n `\n }\n\n // Desktop/always-floating mode: show popout\n return html`\n <slot\n name=\"trigger\"\n aria-controls=${this.popoutId}\n @slotchange=${this.handleTriggerSlotChange}\n ></slot>\n <nord-popout\n id=${this.popoutId}\n position=\"inline-end\"\n always-floating\n @open=${this.handlePopoutOpen}\n @close=${this.handlePopoutClose}\n >\n <div\n class=\"n-dropdown-submenu-content\"\n @keydown=${this.handleContentKeydown}\n >\n <slot></slot>\n </div>\n </nord-popout>\n `\n }\n\n private handleTriggerSlotChange() {\n const slot = this.shadowRoot?.querySelector<HTMLSlotElement>('slot[name=\"trigger\"]')\n const triggerElement = slot?.assignedElements()[0] as HTMLElement | undefined\n\n // Remove listeners from previous trigger element\n if (this.currentTriggerElement && this.currentTriggerElement !== triggerElement) {\n this.currentTriggerElement.removeEventListener('mouseenter', this.handleTriggerMouseEnter)\n this.currentTriggerElement.removeEventListener('click', this.handleTriggerClick)\n this.currentTriggerElement.removeEventListener('keydown', this.handleTriggerKeydown)\n }\n\n this.currentTriggerElement = triggerElement ?? null\n\n if (!triggerElement)\n return\n\n triggerElement.setAttribute('aria-haspopup', 'menu')\n\n const isTouchDevice = !window.matchMedia('(hover: hover)').matches\n\n // Non-touch devices: hover to open\n this.events.listen(triggerElement, 'mouseenter', this.handleTriggerMouseEnter)\n // Non-touch devices or small screens: click to navigate/open\n if (!isTouchDevice || this.isSmallScreen) {\n this.events.listen(triggerElement, 'click', this.handleTriggerClick)\n }\n // Keyboard: arrow keys for navigation\n this.events.listen(triggerElement, 'keydown', this.handleTriggerKeydown)\n }\n\n private handleTriggerMouseEnter = () => {\n // On mobile, don't open popout on hover — only on click\n if (this.shouldUseMobileStack)\n return\n\n this.closeOtherSubmenus()\n this.popout?.show()\n }\n\n private handleTriggerClick = (event: MouseEvent) => {\n event.preventDefault()\n event.stopImmediatePropagation()\n\n if (this.shouldUseMobileStack) {\n this.navigateIntoSubmenu()\n return\n }\n\n this.closeOtherSubmenus()\n this.popout?.show()\n }\n\n private handleTriggerKeydown = (event: KeyboardEvent) => {\n if (event.key === 'ArrowRight' || event.key === 'Enter') {\n event.preventDefault()\n\n if (this.shouldUseMobileStack) {\n this.navigateIntoSubmenu()\n return\n }\n\n this.closeOtherSubmenus()\n this.popout?.show()\n this.updateComplete.then(() => {\n this.querySelector<HTMLElement>('nord-dropdown-item')?.focus()\n })\n }\n }\n\n private handleContentKeydown = (event: KeyboardEvent) => {\n if (event.key === 'ArrowLeft') {\n event.preventDefault()\n event.stopPropagation()\n\n if (this.shouldUseMobileStack && this.mobileActive) {\n this.closest<Dropdown>('nord-dropdown')?.navigateBack()\n return\n }\n\n this.popout?.hide(true)\n }\n }\n\n private handlePopoutOpen = () => {\n this.popoutOpen = true\n this.closeOtherSubmenus()\n }\n\n private handlePopoutClose = (event: Event) => {\n event.stopPropagation()\n this.popoutOpen = false\n }\n\n private handleParentDropdownMouseOver = (event: MouseEvent) => {\n // Don't close on mouseover during mobile stack navigation\n if (this.shouldUseMobileStack)\n return\n\n const target = event.target as HTMLElement\n const isRegularDropdownItem = target.tagName === 'NORD-DROPDOWN-ITEM' && !this.contains(target)\n if (isRegularDropdownItem && this.popoutOpen) {\n event.stopImmediatePropagation()\n this.popout?.hide()\n }\n }\n\n private closeOtherSubmenus() {\n // Don't close siblings during mobile stack navigation\n if (this.shouldUseMobileStack)\n return\n\n // Find the immediate parent container (dropdown or submenu)\n const immediateParent = this.parentElement?.closest('nord-dropdown, nord-dropdown-submenu')\n if (!immediateParent)\n return\n\n // Close only siblings at the same level\n Array.from(\n immediateParent.querySelectorAll<DropdownSubmenu>(':scope > nord-dropdown-submenu'),\n ).forEach((sibling) => {\n if (sibling !== this)\n sibling.close()\n })\n }\n\n /**\n * Deactivate mobile stack navigation (remove from stack).\n * @internal\n */\n deactivateMobile() {\n this.mobileActive = false\n\n // NATIVELY REMOVE THE ATTRIBUTE FROM THE HOST\n this.removeAttribute('mobile-active')\n\n // Clear aria-expanded that may have been set by Popout during hover\n const triggerSlot = this.shadowRoot?.querySelector<HTMLSlotElement>('slot[name=\"trigger\"]')\n const triggerElement = triggerSlot?.assignedElements()[0] as HTMLElement | undefined\n triggerElement?.removeAttribute('aria-expanded')\n }\n\n /**\n * Read trigger text for back button title in Dropdown.\n * @internal\n */\n get label(): string {\n const triggerSlot = this.shadowRoot?.querySelector<HTMLSlotElement>('slot[name=\"trigger\"]')\n return triggerSlot?.assignedElements()[0]?.textContent?.trim() ?? ''\n }\n\n /**\n * Close the submenu programmatically.\n * Returns a promise that resolves when the close animation completes.\n */\n close(): Promise<TransitionEvent | void> {\n if (this.mobileActive) {\n this.deactivateMobile()\n return Promise.resolve()\n }\n\n if (!this.popout) {\n return Promise.reject(new Error('DropdownSubmenu: popout component not found or not ready'))\n }\n return this.popout.hide()\n }\n\n /**\n * Navigate into this submenu using mobile stack navigation.\n * @internal\n */\n private navigateIntoSubmenu() {\n this.mobileActive = true\n this.setAttribute('mobile-active', '')\n this.dispatchEvent(\n new CustomEvent('nord-submenu-navigate', { bubbles: true, detail: { submenu: this } }),\n )\n this.updateComplete.then(() => {\n // Focus on first submenu item (not back button in header)\n const contentDiv = this.querySelector('.n-dropdown-submenu-content')\n const firstItem = contentDiv?.querySelector<HTMLElement>('nord-dropdown-item')\n firstItem?.focus()\n })\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-dropdown-submenu': DropdownSubmenu\n }\n}\n","import type DropdownSubmenu from '../dropdown-submenu/DropdownSubmenu.js'\nimport type Popout from '../popout/Popout.js'\nimport { html, LitElement } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { SlotController } from '../common/controllers/SlotController.js'\nimport { observe } from '../common/decorators/observe.js'\n\nimport { FloatingMixin } from '../common/mixins/FloatingComponentMixin.js'\nimport componentStyle from '../common/styles/Component.css'\n\nimport style from './Dropdown.css'\nimport '../popout/Popout.js'\nimport '../icon/Icon.js'\nimport '../dropdown-item/DropdownItem.js'\n\n/**\n * Dropdown menu displays a list of actions or selectable options for\n * a user. Dropdown uses popout component internally to create\n * the overlay functionality.\n *\n * @status ready\n * @category action\n *\n * @slot - The dropdown content.\n * @slot toggle - Used to place the toggle for dropdown.\n * @slot header - Optional slot that holds a header for the dropdown.\n * @slot header-end - Optional slot that positions content at the end of the header. Useful for actions or additional info.\n *\n * @fires {NordEvent} open - Dispatched when the popout is opened.\n * @fires {NordEvent} close - Dispatched when the popout is closed.\n *\n * @cssprop [--n-dropdown-size=250px] - Controls the inline size, or width, of the dropdown. Will resize up to 1.5 times to account for larger content.\n * @cssprop [--n-dropdown-max-block-size=460px] - Controls the maximum block size, or height, of the dropdown. Larger content will get a scrollbar.\n */\n@customElement('nord-dropdown')\nexport default class Dropdown extends FloatingMixin(LitElement) {\n static styles = [componentStyle, style]\n\n /**\n * we delegate focus, to ensure focus does not move to body if you click\n * some whitespace or a dropdown-group heading, as this would close the dropdown\n * @internal\n */\n static shadowRootOptions = { ...LitElement.shadowRootOptions, delegatesFocus: true }\n\n private headerSlot = new SlotController(this, 'header')\n private headerEndSlot = new SlotController(this, 'header-end')\n\n @query('.n-dropdown-content') private list!: HTMLElement\n @query('nord-popout', true) private popout!: Popout\n\n @state() private submenuStack: DropdownSubmenu[] = []\n private isNavigating = false\n\n private get isShowingSubmenu(): boolean {\n return this.submenuStack.length > 0\n }\n\n /**\n * @internal\n */\n get submenuStackRef(): readonly DropdownSubmenu[] {\n return this.submenuStack\n }\n\n /**\n * @internal\n */\n get deepestSubmenu(): DropdownSubmenu | undefined {\n return this.submenuStack[this.submenuStack.length - 1]\n }\n\n /**\n * Controls whether the toggle slot expands to fill the width of its container.\n */\n @property({ reflect: true, type: Boolean }) expand = false\n\n /**\n * The size of the dropdown. This affects the minimum and maximum inline-size\n * of the dropdown.\n */\n @property({ reflect: true }) size: 's' | 'm' | 'l' = 'm'\n\n /**\n * Set to true to always display the dropdown as a floating overlay, even on smaller viewports.\n */\n @property({ reflect: true, type: Boolean, attribute: 'always-floating' })\n alwaysFloating: boolean = false\n\n @observe('alwaysFloating')\n protected handleAlwaysFloatingChange() {\n if (this.open) {\n this.open = false\n this.updateComplete.then(() => {\n this.open = true\n })\n }\n }\n\n connectedCallback() {\n super.connectedCallback()\n\n const toggle = this.querySelector(`[slot=\"toggle\"]`)\n toggle?.setAttribute('aria-haspopup', 'true')\n }\n\n render() {\n const activeSubmenu = this.submenuStack[this.submenuStack.length - 1]\n\n return html`\n <div class=\"n-dropdown\" @nord-submenu-navigate=${this.handleSubmenuNavigate} @focusout=${this.handleBlur}>\n <slot name=\"toggle\" aria-controls=\"popout\"></slot>\n <nord-popout\n id=\"popout\"\n align=${ifDefined(this.align)}\n position=${ifDefined(this.position)}\n ?open=${this.open}\n ?always-floating=${this.alwaysFloating}\n @open=${this.handleOpen}\n @close=${this.handleClose}\n >\n ${\n this.isShowingSubmenu\n ? html`\n <div class=\"n-dropdown-header is-navigation-header\">\n <nord-dropdown-item @click=${this.handleBackClick} class=\"n-dropdown-back-item\">\n <nord-icon slot=\"start\" name=\"arrow-left\" size=\"s\"></nord-icon>\n ${activeSubmenu?.label ?? ''}\n </nord-dropdown-item>\n </div>\n `\n : html`\n <div class=\"n-dropdown-header\" ?hidden=${this.headerSlot.isEmpty && this.headerEndSlot.isEmpty}>\n <slot name=${this.headerSlot.slotName}></slot>\n <slot name=${this.headerEndSlot.slotName}></slot>\n </div>\n `\n }\n <div class=\"n-dropdown-content ${this.isShowingSubmenu ? 'is-submenu-active' : ''}\">\n <slot></slot>\n </div>\n </nord-popout>\n </div>\n `\n }\n\n private handleBlur(e: FocusEvent) {\n const relatedTarget = e.relatedTarget as HTMLElement\n\n // Don't close during navigation or if we're still showing a submenu\n // (the blur event fires after back button is removed from DOM, but we're still in submenu mode)\n if (this.isNavigating || this.isShowingSubmenu)\n return\n\n // Safari will set relatedTarget to null when clicking on the trigger button\n // because it doesn't focus buttons on click.\n // this caused weird behavior where the dropdown closed _and_ opened with a single click.\n // so we only run this logic if relatedTarget is set, which sidesteps this issue\n if (!relatedTarget) {\n return\n }\n\n // Close dropdown if focus moved outside\n if (!this.contains(relatedTarget)) {\n this.popout.hide(false)\n }\n }\n\n private handleOpen() {\n this.open = true\n }\n\n private handleBackClick(event: MouseEvent) {\n event.preventDefault()\n event.stopPropagation()\n\n this.isNavigating = true\n this.navigateBack()\n\n // Reset navigation flag after updates complete\n this.updateComplete.then(() => {\n this.isNavigating = false\n // Focus the trigger of the submenu we're returning to, or the first item\n const newTop = this.submenuStack[this.submenuStack.length - 1]\n const focusTarget = newTop\n ? newTop.querySelector<HTMLElement>('[slot=\"trigger\"]')\n : this.querySelector<HTMLElement>('nord-dropdown-item')\n focusTarget?.focus()\n })\n }\n\n private handleClose(e: Event) {\n // Don't close during navigation\n if (this.isNavigating)\n return\n\n // Clear submenu stack on close\n this.clearSubmenuStack()\n\n // Ignore close events from child popouts (submenus)\n // The event target will be a nord-popout element that is a child of this dropdown\n const eventTarget = e.target as HTMLElement\n const isChildPopout = eventTarget?.tagName === 'NORD-POPOUT' && this.contains(eventTarget)\n\n if (isChildPopout) {\n return\n }\n\n this.open = false\n }\n\n @observe('open', 'updated')\n protected handleOpenChange() {\n if (this.open) {\n const focusTarget\n = this.querySelector<HTMLElement>('[autofocus]')\n ?? this.querySelector<HTMLElement>('nord-dropdown-item, nord-message')\n\n focusTarget?.focus()\n this.list.scrollTop = 0\n }\n else if (!this.isNavigating) {\n // Clear submenu stack when dropdown closes (but not during navigation)\n this.clearSubmenuStack()\n }\n }\n\n /**\n * Navigate back one level in the submenu stack.\n * @internal\n */\n navigateBack() {\n if (this.submenuStack.length === 0)\n return\n\n const topSubmenu = this.submenuStack[this.submenuStack.length - 1]\n topSubmenu.deactivateMobile()\n // Trigger re-render so it loses active and is-deepest-active classes\n topSubmenu.requestUpdate()\n\n const newTop = this.submenuStack[this.submenuStack.length - 2]\n if (newTop) {\n newTop.removeAttribute('has-active-child')\n // Trigger re-render so it gains is-deepest-active class back\n newTop.requestUpdate()\n }\n\n this.submenuStack = this.submenuStack.slice(0, -1)\n }\n\n /**\n * Clear the entire submenu stack.\n * @internal\n */\n private clearSubmenuStack() {\n for (const submenu of this.submenuStack) {\n submenu.deactivateMobile()\n submenu.removeAttribute('has-active-child')\n }\n this.submenuStack = []\n }\n\n /**\n * Handle submenu navigation event.\n * @internal\n */\n private handleSubmenuNavigate(event: Event) {\n const customEvent = event as CustomEvent<{ submenu: DropdownSubmenu }>\n customEvent.stopPropagation()\n\n const previousDeepest = this.submenuStack[this.submenuStack.length - 1]\n if (previousDeepest) {\n previousDeepest.setAttribute('has-active-child', '')\n // Trigger re-render so it loses is-deepest-active class\n previousDeepest.requestUpdate()\n }\n\n const newSubmenu = customEvent.detail.submenu\n this.submenuStack = [...this.submenuStack, newSubmenu]\n\n // Trigger re-render of new deepest so it gains is-deepest-active class\n this.updateComplete.then(() => {\n newSubmenu.requestUpdate()\n })\n }\n\n /**\n * Hide the dropdown programmatically.\n * This method delegates to the Dropdown's internal Popout component.\n * See [Popout's hide() method](/components/popout#methods-hide) for more details.\n * @param moveFocusToButton A boolean option to move the focus to the original button that opens the dropdown.\n */\n hide(moveFocusToButton?: boolean): Promise<TransitionEvent | void> {\n return this.popout.hide(moveFocusToButton)\n }\n\n /**\n * Show the dropdown programmatically.\n * This method delegates to the Dropdown's internal Popout component.\n * See [Popout's show() method](/components/popout#methods-hide) for more details.\n */\n show(): Promise<TransitionEvent | void> {\n return this.popout.show()\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-dropdown': Dropdown\n }\n}\n","import { html, LitElement } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\nimport componentStyle from '../common/styles/Component.css'\nimport style from './EmptyState.css'\n\n/**\n * Empty state can be used when there is no data to display to\n * describe what the user can do next. Empty state provides\n * explanation and guidance to help user progress.\n *\n * @status ready\n * @category feedback\n * @slot - default slot\n */\n@customElement('nord-empty-state')\nexport default class EmptyState extends LitElement {\n static styles = [componentStyle, style]\n\n render() {\n return html`<div class=\"n-empty-state\">\n <slot></slot>\n </div>`\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-empty-state': EmptyState\n }\n}\n","import { html, LitElement, nothing } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { SlotController } from '../common/controllers/SlotController.js'\nimport { cond } from '../common/directives/cond.js'\n\nimport componentStyle from '../common/styles/Component.css'\nimport formFieldStyle from '../common/styles/FormField.css'\nimport style from './Fieldset.css'\n\n/**\n * Fieldset is used for grouping sets of input components.\n * It is necessary to use a fieldset with radio and checkbox components.\n * It can also be useful for logically grouping other types of inputs.\n *\n * @status ready\n * @category form\n * @slot label - Use when a label requires more than plain text.\n * @slot hint - Optional slot that holds hint text for the fieldset.\n * @slot error - Optional slot that holds error text for the fieldset.\n *\n * @cssprop [--n-label-color=var(--n-color-text)] - Controls the text color of the label, using our [color tokens](/tokens/#color).\n */\n@customElement('nord-fieldset')\nexport default class Fieldset extends LitElement {\n static styles = [componentStyle, formFieldStyle, style]\n\n private errorSlot = new SlotController(this, 'error')\n private hintSlot = new SlotController(this, 'hint')\n private errorId = 'error'\n private hintId = 'hint'\n\n /**\n * Label for the fieldset. Rendered as a `<legend>` element.\n */\n @property({ reflect: true }) label: string = ''\n\n /**\n * Optional hint text to be displayed with the input. Alternatively use the hint slot.\n */\n @property({ reflect: true }) hint?: string\n\n /**\n * Renders the hint below the grouped controls and any error instead of below the legend.\n */\n @property({ reflect: true, type: Boolean, attribute: 'hint-below' }) hintBelow = false\n\n /**\n * Optional error to be shown with the fieldset. Alternatively use the error slot.\n */\n @property({ reflect: true }) error?: string\n\n /**\n * Determines whether the fieldset is required or not.\n * A fieldset marked as required will be announced as such to users of assistive technology.\n * When using this property you need to also set “novalidate” attribute on a form element to prevent browser from displaying its own validation errors.\n */\n @property({ reflect: true, type: Boolean }) required = false\n\n /**\n * Visually hide the required indicator, but still show\n * required attribute to assistive technologies like screen readers.\n */\n @property({ reflect: true, type: Boolean, attribute: 'hide-required' }) hideRequired = false\n\n /**\n * Visually hide the label, but still show it to assistive technologies like screen readers.\n */\n @property({ reflect: true, type: Boolean, attribute: 'hide-label' }) hideLabel = false\n\n /**\n * The size of the label.\n */\n @property({ reflect: true }) size: 's' | 'm' = 'm'\n\n render() {\n const { hasError } = this\n\n return html`\n <fieldset\n aria-invalid=${cond(hasError, 'true')}\n aria-describedby=${cond(this.getDescribedBy())}\n aria-required=${cond(this.required, 'true')}\n >\n <legend class=\"n-label-container ${this.hideLabel ? 'n-hidden' : ''}\">\n <div class=\"n-label\">\n <slot name=\"label\">${this.label}</slot\n ><span aria-hidden=\"true\" class=\"n-required\" ?hidden=${!this.required || this.hideRequired}>*</span>\n </div>\n\n ${this.isHintBelow ? nothing : this.renderHint()}\n </legend>\n\n <slot></slot>\n\n <div class=\"n-caption n-error\" id=${this.errorId} role=\"alert\" ?hidden=${!this.hasError}>\n <slot name=\"error\">${this.error}</slot>\n </div>\n ${this.isHintBelow ? this.renderHint() : nothing}\n </fieldset>\n `\n }\n\n private renderHint() {\n return html`\n <div class=\"n-caption n-hint\" id=${this.hintId} ?hidden=${!this.hasHint}>\n <slot name=\"hint\">${this.hint}</slot>\n </div>\n `\n }\n\n private getDescribedBy() {\n if (!this.isHintBelow) {\n return this.hasError ? this.errorId : undefined\n }\n\n if (this.hasHint && this.hasError) {\n return `${this.errorId} ${this.hintId}`\n }\n\n if (this.hasError) {\n return this.errorId\n }\n\n if (this.hasHint) {\n return this.hintId\n }\n\n return undefined\n }\n\n protected get hasHint() {\n return Boolean(this.hint) || this.hintSlot.hasContent\n }\n\n protected get hasError() {\n return Boolean(this.error) || this.errorSlot.hasContent\n }\n\n private get isHintBelow() {\n return this.hintBelow\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-fieldset': Fieldset\n }\n}\n","import { html, LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { SlotController } from '../common/controllers/SlotController.js'\nimport componentStyle from '../common/styles/Component.css'\nimport style from './Header.css'\n\n/**\n * The header is a block of designated space for labelling the currently\n * viewed context as well as providing primary actions.\n *\n * @status ready\n * @category structure\n * @slot - The header content.\n * @slot end - Optional slot for buttons, toggles, etc.\n */\n@customElement('nord-header')\nexport default class Header extends LitElement {\n static styles = [componentStyle, style]\n\n private endSlot = new SlotController(this, 'end')\n\n /**\n * Controls the size of the header component.\n */\n @property({ reflect: true }) size: 'm' | 's' = 'm'\n\n render() {\n return html`\n <header class=\"n-header\">\n <slot></slot>\n <div class=\"n-header-end\" ?hidden=${this.endSlot.isEmpty}>\n <slot name=\"end\"></slot>\n </div>\n </header>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-header': Header\n }\n}\n","export default '<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m19.7188 10.71-8 8-1.41-1.41 7.29-7.29-7.3-7.29996 1.41-1.41 8 8c.39.39.39 1.01996 0 1.40996zm-8-1.40996-7.99997-8.01-1.41 1.41 7.29 7.29-7.3 7.29996 1.41 1.41 8.00997-7.99c.39-.39.39-1.01996 0-1.40996z\" fill=\"currentColor\"/></svg>';\nexport const title = \"navigation-toggle-lock\";\nexport const tags =\n \"nordicon navigation hamburger menu toggle navigation arrow right double lock triangle chevron\";\n","import type { ReactiveController, ReactiveControllerHost } from 'lit'\n\ninterface Options<T> {\n channelName: string\n onMessage: (message: T) => void\n enabled?: () => boolean\n}\n\nconst defaultEnabled = () => true\n\nexport class BroadcastChannelController<T> implements ReactiveController {\n private channel?: BroadcastChannel\n private options: Required<Options<T>>\n\n constructor(host: ReactiveControllerHost, options: Options<T>) {\n host.addController(this)\n this.options = { enabled: defaultEnabled, ...options }\n }\n\n hostConnected(): void {\n if (typeof BroadcastChannel !== 'undefined') {\n this.channel = new BroadcastChannel(this.options.channelName)\n this.channel.addEventListener('message', this)\n }\n }\n\n hostDisconnected(): void {\n this.channel?.removeEventListener('message', this)\n this.channel?.close()\n }\n\n handleEvent(event: MessageEvent<T>) {\n if (this.options.enabled()) {\n this.options.onMessage(event.data)\n }\n }\n\n post(message: T) {\n if (this.options.enabled()) {\n this.channel?.postMessage(message)\n }\n }\n}\n","/**\n * Thin wrapper around local storage which simplifies (de)serialization and default values.\n * By default, (de)serializes as JSON.\n */\nexport function storage<T>(\n key: string,\n defaultValue: T,\n serialize: (value: T) => string = JSON.stringify,\n deserialize: (value: string) => T = JSON.parse,\n) {\n return {\n get value(): T {\n try {\n const value = localStorage.getItem(key)\n return value ? deserialize(value) : defaultValue\n }\n catch {\n return defaultValue\n }\n },\n\n set value(value: T) {\n try {\n localStorage.setItem(key, serialize(value))\n }\n catch {\n // nothing we can do here\n }\n },\n }\n}\n","export default '<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m18.9988 3v2h-16.00002v-2zm-16.00002 8h16.00002v-2h-16.00002zm0 6h16.00002v-2h-16.00002z\" fill=\"currentColor\"/></svg>';\nexport const title = \"navigation-toggle\";\nexport const tags =\n \"nordicon navigation hamburger menu toggle navigation three lines\";\n","import * as lockIcon from '@nordhealth/icons/lib/assets/navigation-toggle-lock.js'\nimport * as unlockIcon from '@nordhealth/icons/lib/assets/navigation-toggle.js'\nimport { html, LitElement } from 'lit'\nimport { customElement } from 'lit/decorators.js'\nimport { classMap } from 'lit/directives/class-map.js'\nimport { ref } from 'lit/directives/ref.js'\n\nimport { DirectionController } from '../common/controllers/DirectionController.js'\nimport { FocusableMixin } from '../common/mixins/FocusableMixin.js'\nimport componentStyle from '../common/styles/Component.css'\n\nimport Icon from '../icon/Icon.js'\nimport { LocalizeController } from '../localization/LocalizeController.js'\nimport style from './NavToggle.css'\n\nimport '../button/Button.js'\nimport '../visually-hidden/VisuallyHidden.js'\n\nIcon.registerIcon(unlockIcon)\nIcon.registerIcon(lockIcon)\n\n/**\n * Nav toggle is meant for hiding and showing the primary navigation.\n * This component is used internally in the Layout component, but can also be\n * used separate to further customize the behavior.\n *\n * @status ready\n * @category action\n *\n * @localization label - Accessible label for the nav toggle button.\n */\n@customElement('nord-nav-toggle')\nexport default class NavToggle extends FocusableMixin(LitElement) {\n static styles = [componentStyle, style]\n\n private direction = new DirectionController(this)\n private localization = new LocalizeController<'nord-nav-toggle'>(this)\n\n render() {\n return html`\n <nord-button variant=\"plain\" ${ref(this.focusableRef)} class=${classMap({ 'is-rtl': this.direction.isRTL })}>\n <nord-visually-hidden>${this.localization.term('label')}</nord-visually-hidden>\n <nord-icon size=\"m\" name=${unlockIcon.title}></nord-icon>\n <nord-icon size=\"m\" name=${lockIcon.title}></nord-icon>\n </nord-button>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-nav-toggle': NavToggle\n }\n}\n","import type { Events, States } from '../common/fsm.js'\nimport type NavItem from '../nav-item/NavItem.js'\nimport * as lockIcon from '@nordhealth/icons/lib/assets/navigation-toggle-lock.js'\nimport { html, LitElement, nothing } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { classMap } from 'lit/directives/class-map.js'\nimport { styleMap } from 'lit/directives/style-map.js'\nimport { BroadcastChannelController } from '../common/controllers/BroadcastChannelController.js'\nimport { DirectionController } from '../common/controllers/DirectionController.js'\nimport { EventController } from '../common/controllers/EventController.js'\nimport { LightDismissController } from '../common/controllers/LightDismissController.js'\nimport { SlotController } from '../common/controllers/SlotController.js'\nimport { observe } from '../common/decorators/observe.js'\nimport { cond } from '../common/directives/cond.js'\nimport { fsm } from '../common/fsm.js'\nimport { clamp } from '../common/number.js'\nimport { storage } from '../common/storage.js'\n\nimport componentStyle from '../common/styles/Component.css'\nimport stickyStyle from '../common/styles/Sticky.css'\n\nimport Icon from '../icon/Icon.js'\nimport style from './Layout.css'\nimport '../nav-toggle/NavToggle.js'\n\nIcon.registerIcon(lockIcon)\n\nconst NAV_DEFAULT_WIDTH = 250\nconst NAV_MIN_WIDTH = 220\nconst NAV_MAX_WIDTH = 400\nconst NAV_COLLAPSE_WIDTH = 100\nconst NAV_RESIZE_STEP = 30\nconst NAV_PEEK_DELAY = 300\n\nconst mediaQuery\n = typeof matchMedia !== 'undefined'\n ? matchMedia('(min-width: 768px)')\n : ({\n matches: false,\n addEventListener() {\n /* noop */\n },\n } as unknown as MediaQueryList)\n\nconst navWidthStore = storage('nord-layout.navWidth', NAV_DEFAULT_WIDTH)\nconst navOpenStore = storage('nord-layout.navOpen', true)\n\nconst navMachine = fsm({\n opened: {\n toggle: 'closed',\n close: 'closed',\n },\n closed: {\n toggle: 'opened',\n open: 'opened',\n focusin: 'peek',\n pointerenter: 'peek',\n },\n peek: {\n toggle: 'opened',\n focusout: 'unpeek',\n pointerleave: 'wait',\n dropdownOpen: 'blocked',\n click: 'unpeek',\n open: 'opened',\n },\n blocked: {\n dropdownClose: 'peek',\n open: 'opened',\n },\n wait: {\n toggle: 'opened',\n focusin: 'peek',\n pointerenter: 'peek',\n timeout: 'unpeek',\n },\n unpeek: {\n toggle: 'opened',\n focusin: 'peek',\n pointerenter: 'peek',\n transitionend: 'closed',\n },\n})\n\ntype NavState = States<typeof navMachine>\ntype NavEvent = Events<typeof navMachine>\n\nconst isNavItem = (el: HTMLElement): el is NavItem => el.localName === 'nord-nav-item'\nconst isNavItemLeaf = (el: HTMLElement) => isNavItem(el) && !el.hasSubNav\n\n/**\n * Layout component is used to create the main layout of an app. Layout\n * currently comes with one main configuration: two-column.\n *\n * @status ready\n * @category structure\n * @slot - The default main section content.\n * @slot nav - Used to place content inside the navigation sidebar.\n * @slot top-bar - Used to place the [Top Bar](../top-bar/) component.\n * @slot header - Used to place content inside the header section. This slot can be made sticky by utilizing the `sticky` property on the layout component.\n * @slot footer - Used to place content inside the footer section. This slot can be made sticky by utilizing the `stickyFooter` property on the layout component.\n * @slot drawer - Used to place additional content/details relating to a selected item.\n * @slot nav-toggle - Used to place a own nav-toggle component, for cases where you might need to add a tooltip.\n *\n * @cssprop [--n-layout-padding=var(--n-space-l)] - Controls the padding around the main layout area (the main slot), using our [spacing tokens](/tokens/#space).\n * @cssprop [--n-layout-drawer-inline-size=320px] - Controls the width of the drawer area, when used.\n * @cssprop [--n-layout-background-color=var(--n-color-background)] - Controls the background color of the layout, using [color tokens](/tokens/#color).\n */\n@customElement('nord-layout')\nexport default class Layout extends LitElement {\n static styles = [componentStyle, stickyStyle, style]\n\n private peekTimeoutId?: ReturnType<typeof setTimeout>\n\n private navSlot = new SlotController(this, 'nav')\n private drawerSlot = new SlotController(this, 'drawer')\n private topBarSlot = new SlotController(this, 'top-bar')\n private headerSlot = new SlotController(this, 'header')\n private footerSlot = new SlotController(this, 'footer')\n private direction = new DirectionController(this)\n private events = new EventController(this)\n private lightDismiss = new LightDismissController(this, {\n isOpen: () => this.navState === 'opened' && !this.wideScreen,\n onDismiss: () => this.navTransition('close'),\n isDismissible: node => node !== this.navEl,\n })\n\n private broadcast = new BroadcastChannelController<{ navOpen: boolean } | { navWidth: number }>(this, {\n channelName: 'nord-layout-nav-state',\n enabled: () => this.syncNavState && this.wideScreen,\n onMessage: (data) => {\n if ('navOpen' in data) {\n this.navOpen = data.navOpen\n }\n if ('navWidth' in data) {\n this.navWidth = data.navWidth\n }\n },\n })\n\n @query('.n-layout-nav', true) private navEl!: HTMLDivElement\n\n @state() private navWidth = navWidthStore.value\n @state() private isDragging = false\n @state() private navState!: NavState\n @state() private wideScreen = mediaQuery.matches\n\n /**\n * Controls whether the navigation is hidden off-screen or not.\n * Defaults to `true` for wide viewports, and `false` otherwise.\n */\n @property({ reflect: true, type: Boolean, attribute: 'nav-open' }) navOpen!: boolean\n\n /**\n * Controls whether the navigation's open/closed state is persisted across page loads.\n * This is useful for multi-page apps, where clicks on links trigger a full page load.\n */\n @property({ reflect: true, type: Boolean, attribute: 'persist-nav-state' }) persistNavState = false\n\n /**\n * Controls whether the navigation's open/closed state and width is synced across tabs/windows on the same origin.\n * This is useful for long-lived app sessions where you may have multiple tabs/windows open at once.\n */\n @property({ type: Boolean, reflect: true, attribute: 'sync-nav-state' }) syncNavState = false\n\n /**\n * Controls the padding of the default main section slot. When set to “none”,\n * the nav and header slots will still have padding.\n */\n @property({ reflect: true }) padding: 'm' | 'none' = 'm'\n\n /**\n * Controls whether the layout's header has sticky positioning.\n */\n @property({ type: Boolean, reflect: true }) sticky: boolean = false\n\n /**\n * Controls whether the layout's footer has sticky positioning.\n */\n @property({ type: Boolean, reflect: true, attribute: 'sticky-footer' }) stickyFooter: boolean = false\n\n /**\n * A getter whose values reflects whether the layout component considers the viewport to be narrow or not.\n * A narrow viewport is considered to be less than 768px wide.\n */\n get isNarrow(): boolean {\n return !this.wideScreen\n }\n\n connectedCallback(): void {\n super.connectedCallback()\n this.events.listen(mediaQuery, 'change', this.handleMediaQueryChange)\n }\n\n willUpdate() {\n // we only want this logic to run once, before first render\n if (this.hasUpdated) {\n return\n }\n\n // on mobile it should always start closed\n if (this.isNarrow) {\n this.navState = 'closed'\n }\n // if nav state is persisted, and it was previously closed, start closed\n else if (this.persistNavState && navOpenStore.value === false) {\n this.navState = 'closed'\n }\n // otherwise start open\n else {\n this.navState = 'opened'\n }\n }\n\n render() {\n const { navWidth, navState, navSlot, headerSlot, footerSlot, topBarSlot, drawerSlot, isDragging, direction } = this\n const adjustedNavWidth = navState === 'opened' && this.wideScreen ? navWidth : NAV_DEFAULT_WIDTH\n\n return html`\n <div\n class=${classMap({\n 'n-layout': true,\n 'n-rtl': direction.isRTL,\n 'n-dragging': isDragging,\n 'n-has-header': headerSlot.hasContent,\n 'n-has-footer': footerSlot.hasContent,\n 'n-has-top-bar': topBarSlot.hasContent,\n 'n-has-drawer': drawerSlot.hasContent,\n 'n-has-nav': navSlot.hasContent,\n })}\n style=${styleMap({\n '--_n-layout-nav-width': `${adjustedNavWidth}px`,\n })}\n data-nav=${navSlot.hasContent ? navState : 'closed'}\n data-screen=${this.wideScreen ? 'wide' : 'narrow'}\n >\n <div\n class=\"n-layout-nav\"\n ?hidden=${navSlot.isEmpty}\n @focusin=${this.handleNavFocus}\n @mouseenter=${this.handleMouseEnter}\n @mouseleave=${this.handleMouseLeave}\n @open=${this.handleDropdownOpen}\n @close=${this.handleDropdownClose}\n >\n <slot name=\"nav\" @click=${this.handleNavClick}></slot>\n <div\n class=\"n-resize\"\n role=\"separator\"\n aria-orientation=\"vertical\"\n tabindex=\"0\"\n @pointerdown=${cond(navState === 'opened', this.startDragging)}\n @pointermove=${cond(isDragging, this.handleDrag)}\n @pointerleave=${this.stopDragging}\n @pointerup=${this.stopDragging}\n @keydown=${this.handleKeyboardResize}\n ?hidden=${this.isNarrow}\n ></div>\n ${this.renderNavCollapse()}\n </div>\n\n <div class=\"n-layout-main\" @focusin=${this.handleMainFocus} @click=${this.handleMainClick}>\n ${navSlot.hasContent ? this.renderNavToggle() : nothing}\n\n <div class=\"n-top-bar-container\">\n <slot name=\"top-bar\"></slot>\n </div>\n\n <div class=\"n-layout-content\">\n <div class=\"n-sticky\">\n <slot name=\"header\"></slot>\n </div>\n <main>\n <slot></slot>\n </main>\n <slot name=\"footer\"></slot>\n </div>\n\n <aside ?hidden=${this.drawerSlot.isEmpty}>\n <slot name=\"drawer\"></slot>\n </aside>\n </div>\n </div>\n `\n }\n\n private renderNavToggle() {\n return html`\n <div class=\"n-nav-toggle-container\">\n <slot\n name=\"nav-toggle\"\n @click=${this.handleToggleClick}\n @mouseover=${this.handleMouseEnter}\n @mouseout=${this.handleMouseLeave}\n >\n <nord-nav-toggle></nord-nav-toggle>\n </slot>\n </div>\n `\n }\n\n private renderNavCollapse() {\n return html`\n <button class=\"n-collapse-btn\" @click=${this.handleToggleClick}>\n <nord-icon name=\"navigation-toggle-lock\" size=\"s\"></nord-icon>\n </button>\n `\n }\n\n @observe('navWidth', 'updated')\n protected handleNavWidthChange() {\n navWidthStore.value = this.navWidth\n }\n\n @observe('navState')\n protected handleNavStateChange(prev: NavState) {\n if (prev === 'wait' && this.peekTimeoutId) {\n clearTimeout(this.peekTimeoutId)\n }\n if (prev === 'unpeek') {\n this.navEl.removeEventListener('transitionend', this.handleTransitionEnd)\n }\n\n switch (this.navState) {\n case 'closed':\n this.navOpen = false\n break\n case 'opened':\n this.navOpen = true\n break\n case 'wait':\n this.peekTimeoutId = setTimeout(() => this.navTransition('timeout'), NAV_PEEK_DELAY)\n break\n case 'unpeek':\n this.navEl.addEventListener('transitionend', this.handleTransitionEnd, { once: true })\n break\n default:\n break\n }\n }\n\n @observe('navOpen', 'updated')\n protected handleOpenChange(prev: boolean) {\n if (!this.isDragging) {\n // when opening nav, it should restore to default width (or larger).\n // unless it is being dragged, in which case the drag width wins\n this.setNavWidth(Math.max(this.navWidth, NAV_DEFAULT_WIDTH))\n }\n\n this.navTransition(this.navOpen ? 'open' : 'close')\n\n if (this.persistNavState) {\n navOpenStore.value = this.navOpen\n }\n\n // skip first update, we only want subsequent changes\n if (prev != null) {\n this.broadcast.post({ navOpen: this.navOpen })\n }\n }\n\n /* ---------------------------------------------\n / NAVIGATION OPEN/CLOSE LOGIC\n / --------------------------------------------- */\n\n private navTransition(event: NavEvent) {\n this.navState = navMachine.transition(this.navState, event)\n }\n\n private handleNavClick(e: Event) {\n if (!e.defaultPrevented && !this.wideScreen) {\n const target = e.target as HTMLElement\n\n if (isNavItemLeaf(target)) {\n this.navTransition('close')\n }\n }\n }\n\n private handleMainClick() {\n this.navTransition('click')\n }\n\n private handleDropdownOpen(e: Event) {\n const target = e.target as Element\n\n if (target.localName === 'nord-dropdown') {\n this.navTransition('dropdownOpen')\n }\n }\n\n private handleDropdownClose(e: Event) {\n const target = e.target as Element\n\n if (target.localName === 'nord-dropdown') {\n this.navTransition('dropdownClose')\n }\n }\n\n private handleMediaQueryChange = () => {\n this.wideScreen = mediaQuery.matches\n this.navTransition(this.wideScreen ? 'open' : 'close')\n }\n\n private handleToggleClick = () => {\n this.navTransition('toggle')\n }\n\n private handleNavFocus = () => {\n this.navTransition('focusin')\n }\n\n private handleMainFocus = () => {\n this.navTransition('focusout')\n }\n\n private handleMouseEnter = () => {\n if (this.wideScreen) {\n this.navTransition('pointerenter')\n }\n }\n\n private handleMouseLeave = () => {\n this.navTransition('pointerleave')\n }\n\n private handleTransitionEnd = () => {\n this.navTransition('transitionend')\n }\n\n /* ---------------------------------------------\n / RESIZE LOGIC\n / --------------------------------------------- */\n\n private handleKeyboardResize(e: KeyboardEvent) {\n const {\n navWidth,\n direction: { isLTR },\n } = this\n\n switch (e.key) {\n case 'ArrowLeft':\n this.setNavWidth(navWidth + (isLTR ? -NAV_RESIZE_STEP : NAV_RESIZE_STEP))\n break\n case 'ArrowRight':\n this.setNavWidth(navWidth + (isLTR ? NAV_RESIZE_STEP : -NAV_RESIZE_STEP))\n break\n case 'Enter':\n this.navTransition('toggle')\n break\n case 'Home':\n this.setNavWidth(NAV_MIN_WIDTH)\n break\n case 'End':\n this.setNavWidth(NAV_MAX_WIDTH)\n break\n default:\n return\n }\n\n this.broadcast.post({ navWidth: this.navWidth })\n e.preventDefault()\n }\n\n private setNavWidth(width: number) {\n this.navWidth = clamp(Math.round(width), NAV_MIN_WIDTH, NAV_MAX_WIDTH)\n }\n\n private startDragging(e: PointerEvent) {\n if (e.button === 0) {\n const target = e.target as Element\n target.setPointerCapture(e.pointerId)\n this.isDragging = true\n }\n }\n\n private stopDragging() {\n this.isDragging = false\n this.broadcast.post({ navWidth: this.navWidth })\n }\n\n private handleDrag(e: PointerEvent) {\n const width = this.direction.isRTL ? this.clientWidth - e.clientX : e.clientX\n\n this.setNavWidth(width)\n this.navTransition(width >= NAV_COLLAPSE_WIDTH ? 'open' : 'close')\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-layout': Layout\n }\n}\n","import type { TemplateResult } from 'lit'\nimport { html, LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { ref } from 'lit/directives/ref.js'\nimport { FocusableMixin } from '../common/mixins/FocusableMixin.js'\n\nimport componentStyle from '../common/styles/Component.css'\nimport itemStyle from '../dropdown-item/DropdownItem.css'\nimport { LocalizeController } from '../localization/LocalizeController.js'\nimport style from './Message.css'\n\n/**\n * Message represents a specific item within a collection,\n * such as notifications, tasks or conversations. Message\n * can be placed directly inside a dropdown component.\n *\n * @status ready\n * @category action\n * @slot - The message content.\n * @slot footer - Used to place content after the message. Typically used for a timestamp.\n *\n * @cssprop [--n-message-border-color=var(--n-color-border)] - Controls the border color of the message, using our [color tokens](/tokens/#color).\n *\n * @localization unreadLabel - Label for the unread messages.\n */\n@customElement('nord-message')\nexport default class Message extends FocusableMixin(LitElement) {\n static styles = [componentStyle, itemStyle, style]\n\n private localize = new LocalizeController<'nord-message'>(this)\n\n /**\n * The url the message should link to.\n */\n @property({ reflect: true }) href?: string\n\n /**\n * Highlight the message visually. This is meant for highlighting\n * a new message that just appeared. Highlight style should be removed\n * after the user has seen the message and there’s been a timeout of\n * e.g. 30 seconds.\n */\n @property({ reflect: true, type: Boolean }) highlight?: boolean\n\n /**\n * Mark the message as unread. By default messages are read.\n */\n @property({ reflect: true, type: Boolean }) unread?: boolean\n\n // TODO: dropdown-item and message component have the same logic\n // for determining if it renders a link vs button. Perhaps we\n // can later see if both can use a mixin or similar instead?\n render() {\n const link = (content: TemplateResult) =>\n html`<a href=${ifDefined(this.href)} ${ref(this.focusableRef)} class=\"n-dropdown-item n-message\">${content}</a>`\n const button = (content: TemplateResult) =>\n html`<button ${ref(this.focusableRef)} class=\"n-dropdown-item n-message\">${content}</button>`\n\n const container = this.href ? link : button\n\n return container(html`\n <div role=\"img\" class=\"n-unread\" aria-label=${this.localize.term('unreadLabel')} ?hidden=${!this.unread}></div>\n <slot></slot>\n <slot name=\"footer\"></slot>\n `)\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-message': Message\n }\n}\n","/**\n * Set or remove the `inert` attribute on an element.\n *\n * @param element The element to set or remove the `inert` attribute on.\n * @param enabled Whether to set or remove the `inert` attribute.\n */\nfunction setInertAttribute(element: Element, enabled: boolean) {\n if (enabled) {\n const current = element.getAttribute('inert')\n\n // store previous value\n if (current !== null) {\n element.setAttribute('data-n-inert', current)\n }\n\n element.setAttribute('inert', '')\n }\n else {\n const current = element.getAttribute('data-n-inert')\n\n // restore previous value if necessary\n if (current !== null) {\n element.setAttribute('inert', current)\n element.removeAttribute('data-n-inert')\n }\n else {\n element.removeAttribute('inert')\n }\n }\n}\n\n/**\n * Set or remove the `inert` attribute on all given elements.\n *\n * @param elements The elements to set or remove the `inert` attribute on.\n * @param enabled Whether to set or remove the `inert` attribute.\n */\nexport function setInertAttributes(elements: Element[], enabled: boolean) {\n elements.forEach(element => setInertAttribute(element, enabled))\n}\n\n/**\n * Get all siblings of an element, including the siblings of its parents.\n * Use this to find all elements that should be inert when a modal is open.\n * And then use `setInertAttributes` to set or remove the `inert` attribute\n * on all of them.\n */\nexport function getElementsAround(element: Element): Element[] {\n const elements = []\n let next = element.nextElementSibling\n\n while (next) {\n elements.push(next)\n next = next.nextElementSibling\n }\n\n next = element.previousElementSibling\n\n while (next) {\n elements.push(next)\n next = next.previousElementSibling\n }\n\n if (element.parentElement && element.parentElement !== document.body) {\n elements.push(...getElementsAround(element.parentElement))\n }\n\n return elements\n}\n","import type { ReactiveController, ReactiveControllerHost } from 'lit'\nimport { getElementsAround, setInertAttributes } from '../../common/inert.js'\n\nexport class FocusTrapController implements ReactiveController {\n private inertElements: Element[] = []\n\n constructor(private host: ReactiveControllerHost & HTMLElement) {\n host.addController(this)\n }\n\n hostDisconnected() {\n this.release()\n }\n\n trap() {\n const elements = getElementsAround(this.host)\n\n setInertAttributes(elements, true)\n this.inertElements = elements\n }\n\n release() {\n setInertAttributes(this.inertElements, false)\n this.inertElements = []\n }\n}\n","import type { ReactiveController, ReactiveControllerHost } from 'lit'\nimport type { LightDismissOptions } from '../common/controllers/LightDismissController.js'\nimport { EventController } from '../common/controllers/EventController.js'\nimport { FocusTrapController } from '../common/controllers/FocusTrapController.js'\nimport { LightDismissController } from '../common/controllers/LightDismissController.js'\nimport { ScrollbarController } from '../common/controllers/ScrollbarController.js'\n\nclass Stack<T> {\n private items: T[] = []\n\n get length() {\n return this.items.length\n }\n\n get top(): T | undefined {\n return this.items[this.length - 1]\n }\n\n push(item: T) {\n this.items.push(item)\n }\n\n pop() {\n return this.items.pop()\n }\n\n remove(item: T) {\n const index = this.items.indexOf(item)\n\n if (index !== -1) {\n this.items.splice(index, 1)\n }\n }\n}\n\nconst isButton = (element: Element): element is HTMLButtonElement => element.localName === 'button'\n\ninterface ModalControllerOptions {\n isOpen: LightDismissOptions['isOpen']\n onDismiss: (trigger: Event) => void\n close: (returnValue?: string, trigger?: Event) => void\n isLightDismissEnabled: () => boolean\n backdrop: () => HTMLElement\n dialog: () => HTMLElement\n}\n\nexport class ModalController implements ReactiveController {\n private static openModals = new Stack<ModalController>()\n\n private scrollBar: ScrollbarController\n private focusTrap: FocusTrapController\n private lightDismiss: LightDismissController\n private events: EventController\n private options: ModalControllerOptions\n\n private trigger?: HTMLElement\n private lastButton?: HTMLButtonElement\n\n constructor(\n private host: ReactiveControllerHost & HTMLElement,\n options: ModalControllerOptions,\n ) {\n host.addController(this)\n this.options = options\n\n this.scrollBar = new ScrollbarController(host)\n this.focusTrap = new FocusTrapController(host)\n this.events = new EventController(host)\n this.lightDismiss = new LightDismissController(host, {\n isOpen: options.isOpen,\n isDismissible: node => node !== options.dialog(),\n onDismiss: this.handleLightDismiss,\n })\n }\n\n hostConnected() {\n // if submit event is not supported, let's do a basic polyfill\n if (!window.SubmitEvent) {\n this.events.listen(this.host, 'click', this.trackLastButton, true)\n this.events.listen(this.host, 'submit', this.polyfillSubmitter, true)\n }\n\n this.events.listen(this.host, 'transitionend', this.handleTransitionEnd)\n this.events.listen(this.host, 'submit', this.handleSubmit)\n }\n\n hostDisconnected(): void {\n ModalController.openModals.remove(this)\n }\n\n block() {\n // if there is already a modal open, release its focus trap\n ModalController.openModals.top?.focusTrap.release()\n\n // add this modal to the stack of open modals\n ModalController.openModals.push(this)\n\n // hide scrollbar and prevent scroll on body\n this.scrollBar.lockScroll()\n\n // store the element that was focused prior to modal opening\n this.trigger = document.activeElement as HTMLElement\n\n // handle initial (auto)focus\n const focusTarget = this.host.querySelector<HTMLElement>('[autofocus]') || this.host\n focusTarget.focus()\n\n // finally, we should enable the focus trap\n this.focusTrap.trap()\n }\n\n unblock() {\n // it does not make sense to unblock a modal if it is not the top-most modal\n if (ModalController.openModals.top !== this) {\n return\n }\n\n ModalController.openModals.pop()\n\n // ensure modal is scrolled to top ready for re-open\n this.options.backdrop().scrollTop = 0\n\n // we need to release the focus trap...\n this.focusTrap.release()\n\n // ...before we can return focus to the trigger\n this.trigger?.focus()\n this.trigger = undefined\n\n // if there are still modals open, enable the next modal's focus trap\n ModalController.openModals.top?.focusTrap.trap()\n }\n\n /**\n * capture the last button clicked, so that we can polyfill `submitter` property in submit event\n */\n private trackLastButton = (e: Event) => {\n const target = e.target as HTMLElement\n\n if (isButton(target)) {\n this.lastButton = target\n }\n }\n\n private polyfillSubmitter = (e: Event) => {\n // @ts-expect-error submitter is readonly, but this is only called if SubmitEvent is not supported\n e.submitter = this.lastButton\n }\n\n private handleTransitionEnd = (e: TransitionEvent) => {\n // scrollbar should only be restored when the modal has transitioned,\n // that way we avoid awkward double scrollbars.\n if (!this.options.isOpen() && e.target === this.host) {\n this.scrollBar.unlockScroll()\n }\n }\n\n private handleLightDismiss = (trigger: Event) => {\n if (this.host.contains(trigger.target as Node) && this.options.isLightDismissEnabled()) {\n this.options.onDismiss(trigger)\n }\n }\n\n private handleSubmit = (e: SubmitEvent) => {\n this.lastButton = undefined\n\n const target = e.target as HTMLFormElement\n const submitter = e.submitter as HTMLButtonElement\n\n const isDialogProperty = target.method === 'dialog'\n const isDialogAttr = target.getAttribute('method') === 'dialog'\n\n // if they mismatch, it means \"dialog\" method is not supported,\n // so we should polyfill the fact it does not do a full submit\n if (isDialogAttr && !isDialogProperty) {\n e.preventDefault()\n }\n\n if (isDialogAttr || isDialogProperty) {\n this.options.close(submitter?.value, e)\n }\n }\n}\n","import * as closeIcon from '@nordhealth/icons/lib/assets/interface-close-small.js'\nimport { html, LitElement } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { classMap } from 'lit/directives/class-map.js'\n\nimport { SlotController } from '../common/controllers/SlotController.js'\nimport { observe } from '../common/decorators/observe.js'\nimport { NordEvent } from '../common/events.js'\nimport componentStyle from '../common/styles/Component.css'\n\nimport Icon from '../icon/Icon.js'\nimport { LocalizeController } from '../localization/LocalizeController.js'\nimport style from './Modal.css'\nimport { ModalController } from './ModalController.js'\n\nimport '../footer/Footer.js'\n\nIcon.registerIcon(closeIcon)\n\n/**\n * Event dispatched when a modal is about to be dismissed.\n * The `trigger` property contains the original event that caused the dismiss.\n */\nexport class ModalCancelEvent extends NordEvent {\n declare trigger: Event\n\n constructor(trigger: Event) {\n super('cancel', { cancelable: true })\n Object.defineProperty(this, 'trigger', {\n value: trigger,\n enumerable: true,\n writable: false,\n })\n }\n}\n\n/**\n * Event dispatched when a modal is closed.\n * The `trigger` property contains the original event that caused the close, if available.\n */\nexport class ModalCloseEvent extends NordEvent {\n declare trigger: Event | undefined\n\n constructor(trigger?: Event) {\n super('close')\n Object.defineProperty(this, 'trigger', {\n value: trigger,\n enumerable: true,\n writable: false,\n })\n }\n}\n\n/**\n * Modal component is used to display content that temporarily blocks interactions\n * with the main view of an application. Modal should be used sparingly and\n * only when necessary.\n *\n * @status ready\n * @category overlay\n * @slot - Default slot\n * @slot header - Slot which holds the header of the modal, positioned next to the close button.\n * @slot feature - Slot for full bleed content like an image.\n * @slot footer - Slot which is typically used to hold call to action buttons, but can also be used to build custom footers.\n * @fires {ModalCancelEvent} cancel - Dispatched before the modal has closed when a user attempts to dismiss a modal. The event includes a trigger property containing the original event that caused the dismiss. Call preventDefault() on the event to prevent the modal closing.\n * @fires {ModalCloseEvent} close - Dispatched when a modal is closed for any reason. The event includes an optional trigger property containing the original event that caused the close, if the modal was closed by a user action.\n *\n * @cssprop [--n-modal-padding-inline=var(--n-space-m)] - Controls the padding on the sides of the modal, using our [spacing tokens](/tokens/#space).\n * @cssprop [--n-modal-padding-block=var(--n-space-m)] - Controls the padding above and below the header of the modal, using our [spacing tokens](/tokens/#space).\n * @cssprop [--n-modal-max-inline-size=620px] - Controls the width of the modal.\n *\n * @localization closeLabel - Accessible label for the close button.\n */\n@customElement('nord-modal')\nexport default class Modal extends LitElement {\n static styles = [componentStyle, style]\n\n @query('.n-modal', true) private modal!: HTMLDivElement\n @query('.n-modal-backdrop', true) private backdrop!: HTMLDivElement\n\n private lastTrigger?: Event\n\n private defaultSlot = new SlotController(this)\n private headerSlot = new SlotController(this, 'header')\n private featureSlot = new SlotController(this, 'feature')\n private footerSlot = new SlotController(this, 'footer')\n\n private localize = new LocalizeController<'nord-modal'>(this)\n private modalController = new ModalController(this, {\n isOpen: () => this.open,\n onDismiss: (e: Event) => this.handleDismiss(e),\n isLightDismissEnabled: () => !this.persistent,\n dialog: () => this.modal,\n backdrop: () => this.backdrop,\n close: (returnValue, trigger) => this.close(returnValue, trigger),\n })\n\n /**\n * Controls whether the modal is open or not.\n */\n @property({ type: Boolean, reflect: true }) open = false\n\n /**\n * Controls the max-width of the modal when open.\n */\n @property({ reflect: true }) size: 's' | 'm' | 'l' | 'xl' = 'm'\n\n /**\n * The reason why the modal was closed. This typically indicates\n * which button the user pressed to close the modal, though any value\n * can be supplied if the modal is programmatically closed.\n */\n @property({ attribute: false }) returnValue: string = ''\n\n /**\n * By default if a modal is too big for the browser window,\n * the entire modal will scroll. This setting changes that behavior\n * so that the body of the modal scrolls instead, with the modal\n * itself remaining fixed.\n */\n @property({ type: Boolean, reflect: true }) scrollable = false\n\n /**\n * When true, the modal will not close when clicking the backdrop or pressing Escape,\n * and the close button will be hidden. Only programmatic close or custom action buttons\n * can dismiss the modal.\n */\n @property({ type: Boolean, reflect: true }) persistent = false\n\n connectedCallback(): void {\n super.connectedCallback()\n\n this.setAttribute('role', 'dialog')\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback()\n\n // Clear trigger reference when modal is removed from DOM to prevent memory leaks\n this.lastTrigger = undefined\n }\n\n /**\n * Show the modal, automatically moving focus to the modal or a child\n * element with an `autofocus` attribute.\n */\n showModal() {\n this.open = true\n }\n\n /**\n * Programmatically close the modal.\n * @param returnValue An optional value to indicate why the modal was closed.\n * @param trigger An optional event that triggered the close.\n */\n close(returnValue?: string, trigger?: Event) {\n this.open = false\n\n if (returnValue != null) {\n this.returnValue = returnValue\n }\n\n const closeTrigger = trigger ?? this.lastTrigger\n this.dispatchEvent(new ModalCloseEvent(closeTrigger))\n this.lastTrigger = undefined\n }\n\n /**\n * Programmatically focus the modal.\n * @param options An object which controls aspects of the focusing process.\n */\n focus(options?: FocusOptions) {\n this.modal.focus({ preventScroll: true, ...options })\n }\n\n render() {\n return html`\n <div class=\"n-modal-backdrop\">\n <div\n class=${classMap({\n 'n-modal': true,\n 'n-overflow-hidden': this.featureSlot.hasContent && this.defaultSlot.isEmpty && this.footerSlot.isEmpty,\n })}\n tabindex=\"0\"\n >\n <!-- eslint-disable-next-line @nordhealth/no-unknown-legacy-classes -->\n <div class=\"n-modal-header n-rounded-top\" ?hidden=${this.headerSlot.isEmpty}>\n <slot class=\"n-padded\" name=${this.headerSlot.slotName}></slot>\n <button class=\"n-close\" @click=${(e: Event) => this.handleDismiss(e)} ?hidden=${this.persistent}>\n <nord-icon name=\"interface-close-small\" size=\"s\" label=${this.localize.term('closeLabel')}></nord-icon>\n </button>\n </div>\n\n <div class=\"n-modal-body\">\n <slot\n name=${this.featureSlot.slotName}\n class=${this.headerSlot.isEmpty ? 'n-rounded-top' : ''}\n ?hidden=${this.featureSlot.isEmpty}\n ></slot>\n <slot class=${this.defaultSlot.isEmpty ? '' : 'n-body-padded'}></slot>\n </div>\n\n <nord-footer ?hidden=${this.footerSlot.isEmpty}>\n <slot name=${this.footerSlot.slotName}></slot>\n </nord-footer>\n </div>\n </div>\n `\n }\n\n @observe('open', 'updated')\n protected handleOpenUpdated(prev: boolean) {\n if (this.open) {\n this.modalController.block()\n }\n else if (prev === true) {\n this.modalController.unblock()\n }\n }\n\n private handleDismiss(trigger: Event) {\n // allow cancelling of close\n const allowed = this.dispatchEvent(new ModalCancelEvent(trigger))\n\n if (allowed) {\n this.lastTrigger = trigger\n this.close()\n }\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-modal': Modal\n }\n}\n","import { html, LitElement, nothing } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport componentStyle from '../common/styles/Component.css'\n\nimport style from './NavGroup.css'\nimport '../icon/Icon.js'\n\n/**\n * Navigation group includes all the actions or items in a single\n * group and is used for grouping items into related categories.\n *\n * @category navigation\n * @status ready\n * @slot - The default slot used for the nav items.\n *\n * @fires {NordEvent} toggle - Dispatched whenever a nav item's state changes between open and closed.\n * @fires {NordEvent} activate - Dispatched whenever a nav item has been marked as active\n */\n@customElement('nord-nav-group')\nexport default class NavGroup extends LitElement {\n static styles = [componentStyle, style]\n\n /**\n * Heading and accessible label for the nav group\n */\n @property({ reflect: true }) heading?: string\n\n render() {\n return html`\n ${this.heading ? html`<p id=\"heading\" aria-hidden=\"true\" class=\"n-heading\">${this.heading}</p>` : nothing}\n <div role=\"list\" aria-labelledby=${this.heading ? 'heading' : nothing}>\n <slot></slot>\n </div>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-nav-group': NavGroup\n }\n}\n","import type { TemplateResult } from 'lit'\nimport { html, LitElement, nothing } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { classMap } from 'lit/directives/class-map.js'\nimport { ref } from 'lit/directives/ref.js'\nimport { DirectionController } from '../common/controllers/DirectionController.js'\nimport { SlotController } from '../common/controllers/SlotController.js'\nimport { observe } from '../common/decorators/observe.js'\nimport { cond } from '../common/directives/cond.js'\nimport { NordEvent } from '../common/events.js'\n\nimport { FocusableMixin } from '../common/mixins/FocusableMixin.js'\nimport componentStyle from '../common/styles/Component.css'\nimport style from './NavItem.css'\n\n/**\n * Navigation item populates sidebar navigation with links.\n * Every item should be placed inside a navigation group.\n *\n * @status ready\n * @category navigation\n * @slot - The default slot used for the nav item's text.\n * @slot subnav - Used for nesting navigation. When used the nav-item becomes a button to collapse the subnav, rather than a link.\n *\n * @fires toggle - Dispatched whenever a nav item's state changes between open and closed.\n * @fires activate - Dispatched whenever a nav item has been marked as active\n */\n@customElement('nord-nav-item')\nexport default class NavItem extends FocusableMixin(LitElement) {\n static styles = [componentStyle, style]\n\n private subnavSlot = new SlotController(this, 'subnav')\n private direction = new DirectionController(this)\n\n /**\n * Used for indicating the current page. This gives a prominent background to the nav item,\n * and marks the item as the current page for assistive technology.\n */\n @property({ type: Boolean, reflect: true }) active = false\n\n /**\n * The name of an icon from Nordicons to display for the nav item.\n */\n @property({ reflect: true }) icon?: string\n\n /**\n * The url the nav item should link to.\n * Note: this is not used if you have nested navigation using the \"subnav\" slot.\n */\n @property({ reflect: true }) href?: string\n\n /**\n * Allows you to add a notification badge with a number next to the nav item.\n */\n @property({ reflect: true }) badge?: string\n\n /**\n * When the nav items contains a subnav, controls whether the section is expanded or not.\n * Note: this is only used if you have nested navigation using the \"subnav\" slot.\n */\n @property({ reflect: true, type: Boolean }) open = false\n\n /**\n * @internal\n */\n get hasSubNav() {\n return this.subnavSlot.hasContent\n }\n\n render() {\n const innards = html`\n ${this.icon ? html`<nord-icon class=\"n-nav-icon\" name=${this.icon} size=\"m\"></nord-icon>` : nothing}\n <div class=\"n-nav-content\">\n <span class=\"n-nav-label\"><slot></slot></span>\n ${this.badge ? html`<span class=\"n-nav-badge\">${this.badge}</span>` : nothing}\n </div>\n `\n let element: TemplateResult\n\n if (this.subnavSlot.hasContent) {\n element = this.renderToggle(innards)\n }\n else if (this.href) {\n element = this.renderLink(innards)\n }\n else {\n element = this.renderButton(innards)\n }\n\n return html`\n <div role=\"listitem\">\n ${element}\n <slot name=${this.subnavSlot.slotName} ?hidden=${!this.open}></slot>\n </div>\n `\n }\n\n private renderLink(innards: TemplateResult) {\n return html`\n <a class=\"n-nav-item\" ${ref(this.focusableRef)} aria-current=${cond(this.active, 'page')} href=${this.href || ''}>\n ${innards}\n </a>\n `\n }\n\n private renderToggle(innards: TemplateResult) {\n return html`\n <button\n class=\"n-nav-item\"\n @click=${this.toggleOpen}\n aria-expanded=${this.open ? 'true' : 'false'}\n ${ref(this.focusableRef)}\n >\n ${innards}\n\n <nord-icon\n size=\"xxs\"\n class=${classMap({ 'n-toggle-icon': true, 'n-rtl': this.direction.isRTL })}\n name=\"arrow-expand-right-small\"\n ></nord-icon>\n </button>\n `\n }\n\n private renderButton(innards: TemplateResult) {\n return html`<button class=\"n-nav-item\" ${ref(this.focusableRef)}>${innards}</button>`\n }\n\n private toggleOpen() {\n this.open = !this.open\n this.dispatchEvent(new NordEvent('toggle'))\n }\n\n @observe('active', 'updated')\n protected handleActiveChange() {\n if (this.active && !this.hasSubNav) {\n this.dispatchEvent(new NordEvent('activate'))\n }\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-nav-item': NavItem\n }\n}\n","import type NavItem from '../nav-item/NavItem.js'\nimport { html, LitElement, nothing } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { EventController } from '../common/controllers/EventController.js'\nimport { SlotController } from '../common/controllers/SlotController.js'\nimport componentStyle from '../common/styles/Component.css'\nimport style from './Navigation.css'\n\n/**\n * Navigation is used to display the primary navigation in the sidebar\n * of an application. Navigation includes a list of links that users\n * use to move between sections of the application.\n *\n * @status ready\n * @category navigation\n * @slot - The main section of the sidebar, for holding nav components.\n * @slot header - The top section of the sidebar.\n * @slot footer - The bottom section of the sidebar.\n *\n * @fires {NordEvent} toggle - Dispatched whenever a nav item's state changes between open and closed.\n * @fires {NordEvent} activate - Dispatched whenever a nav item has been marked as active\n *\n * @cssprop [--n-navigation-background-color=var(--n-color-nav-surface)] - Controls the background color of the navigation element.\n */\n@customElement('nord-navigation')\nexport default class Navigation extends LitElement {\n static styles = [componentStyle, style]\n\n private headerSlot = new SlotController(this, 'header')\n private events = new EventController(this)\n private footerObserver: MutationObserver | null = null\n private allowItemsToRemainOpen = false\n\n /**\n * Controls whether the navigations's footer has sticky positioning.\n */\n @property({ type: Boolean, reflect: true, attribute: 'sticky-footer' }) stickyFooter: boolean = false\n\n connectedCallback() {\n super.connectedCallback()\n // if we add this event listener during render\n // we seem to miss the first activate event.\n // so let's add it as early as possible.\n this.events.listen(this, 'activate', this.handleActivate)\n\n // in cases where there is an initially active nav-item,\n // we should allow any nav-items with the `open` attribute to remain open.\n const activeItem = this.querySelector('nord-nav-item[active]')\n this.allowItemsToRemainOpen = activeItem != null\n\n if (typeof window !== 'undefined') {\n this.observeFooter()\n }\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n this.footerObserver?.disconnect()\n this.footerObserver = null\n }\n\n /**\n * Observe the footer slot element for visibility changes.\n * Watches style and class attributes on the footer element itself, and\n * childList on the host to detect footer being added/removed (e.g. v-if).\n */\n private observeFooter() {\n this.footerObserver = new MutationObserver(() => this.requestUpdate())\n\n // Watch for footer element being added/removed from the host\n this.footerObserver.observe(this, { childList: true })\n\n // Watch hidden attribute on the footer element directly\n const footerEl = this.querySelector(':scope > [slot=\"footer\"]')\n if (footerEl) {\n this.footerObserver.observe(footerEl, {\n attributes: true,\n attributeFilter: ['style', 'class'],\n })\n }\n }\n\n private get isFooterVisible() {\n // In SSR, the element is backed by a minimal DOM shim that does not implement\n // querySelector or window.getComputedStyle. Return true so the footer slot\n // renders as visible during server-side rendering.\n if (typeof window === 'undefined') {\n return true\n }\n\n const footerEl = this.querySelector<HTMLElement>(':scope > [slot=\"footer\"]')\n if (!footerEl) {\n return false\n }\n\n const style = window.getComputedStyle(footerEl)\n return (\n style.display !== 'none'\n && style.visibility !== 'hidden'\n && style.visibility !== 'collapse'\n && style.opacity !== '0'\n && style.contentVisibility !== 'hidden'\n )\n }\n\n render() {\n return html`\n <slot name=\"header\" ?hidden=${this.headerSlot.isEmpty}></slot>\n <div class=\"n-navigation-main\">\n <nav>\n <slot></slot>\n </nav>\n ${!this.stickyFooter ? html`<slot name=\"footer\" ?hidden=${!this.isFooterVisible}></slot>` : nothing}\n </div>\n ${this.stickyFooter ? html`<slot name=\"footer\" ?hidden=${!this.isFooterVisible}></slot>` : nothing}\n `\n }\n\n private handleActivate = (e: Event) => {\n const target = e.target as NavItem\n const ancestors = new Set<NavItem>()\n\n // walk up the DOM, gathering all ancestors from the target to its top-most nav-item.\n // it's more efficient to first gather ancestors here,\n // than to repeatedly call item.contains(target) in the for-loop below.\n let parent = target.parentElement?.closest('nord-nav-item')\n while (parent) {\n ancestors.add(parent)\n parent = parent.parentElement?.closest('nord-nav-item')\n }\n\n // open and activate any items on the path, otherwise close and deactivate.\n // however, if the item is set to open initially, we should not close it.\n for (const item of this.querySelectorAll('nord-nav-item')) {\n if (item !== target) {\n const isAncestor = ancestors.has(item)\n item.open = isAncestor || (this.allowItemsToRemainOpen && item.open)\n item.active = isAncestor\n }\n }\n\n // this is a one-time thing, purely for initial open state\n this.allowItemsToRemainOpen = false\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-navigation': Navigation\n }\n}\n","import { html, LitElement } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\nimport componentStyle from '../common/styles/Component.css'\nimport style from './NotificationGroup.css'\n\n/**\n * Notification group is used to position and style a group of notifications.\n *\n * @status ready\n * @category feedback\n * @slot - Default slot in which to place notifications.\n *\n * @fires {NordEvent} dismiss - Fired when a notification is dismissed, and its exit animation has completed. This event should be used to remove the dismissed notification from the DOM.\n */\n@customElement('nord-notification-group')\nexport default class NotificationGroup extends LitElement {\n static styles = [componentStyle, style]\n\n render() {\n return html`\n <div class=\"n-notification-group\">\n <slot></slot>\n </div>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-notification-group': NotificationGroup\n }\n}\n","import type { LitElement } from 'lit'\nimport type { Ref } from 'lit/directives/ref.js'\nimport { state } from 'lit/decorators.js'\nimport { createRef } from 'lit/directives/ref.js'\nimport { animation, NordEvent } from '../events.js'\n\ntype Constructor<T = Record<string, unknown>> = new (...args: any[]) => T\n\nexport declare class NotificationMixinInterface {\n protected dismissed: boolean\n protected notificationRef: Ref<HTMLElement>\n dismiss(): Promise<void>\n}\n\nexport function NotificationMixin<T extends Constructor<LitElement>>(\n superClass: T,\n): Constructor<NotificationMixinInterface> & T {\n class NotificationElement extends superClass {\n protected notificationRef = createRef<HTMLElement>()\n\n @state() protected dismissed = false\n\n /**\n * Programmatically dismiss the notification.\n * The returned promise resolves when notification's exit animation is complete.\n */\n async dismiss() {\n if (this.notificationRef.value) {\n this.dismissed = true\n await animation(this.notificationRef.value)\n this.dispatchEvent(new NordEvent('dismiss'))\n }\n }\n }\n\n return NotificationElement as unknown as Constructor<NotificationMixinInterface> & T\n}\n","import { html, LitElement } from 'lit'\nimport { customElement } from 'lit/decorators.js'\nimport { classMap } from 'lit/directives/class-map.js'\nimport { ref } from 'lit/directives/ref.js'\n\nimport { NotificationMixin } from '../common/mixins/NotificationMixin.js'\nimport componentStyle from '../common/styles/Component.css'\nimport { LocalizeController } from '../localization/LocalizeController.js'\nimport style from './Notification.css'\nimport '../stack/Stack.js'\nimport '../icon/Icon.js'\n\n/**\n * Notifications provide important information that requires action or acknowledgement.\n * A notification is displayed until the user dismisses it.\n *\n * @status ready\n * @category feedback\n * @slot - Default slot used for the notification text/message.\n * @slot icon - Slot used for the notification icon.\n * @fires dismiss - Fired when the notification is dismissed, and its exit animation has completed. This event should be used to remove the dismissed notification from the DOM.\n * @localization dismissLabel - Accessible label for the dismiss button.\n */\n@customElement('nord-notification')\nexport default class Notification extends NotificationMixin(LitElement) {\n static styles = [componentStyle, style]\n\n private localize = new LocalizeController<'nord-notification'>(this)\n\n render() {\n return html`\n <div ${ref(this.notificationRef)} class=${classMap({ 'n-notification': true, 'n-dismissed': this.dismissed })}>\n <button class=\"n-dismiss\" @click=${this.dismiss}>\n <nord-icon name=\"interface-close-small\" size=\"xs\" label=${this.localize.term('dismissLabel')}></nord-icon>\n </button>\n\n <nord-stack align-items=\"stretch\" direction=\"horizontal\">\n <slot name=\"icon\">\n <nord-icon name=\"navigation-notifications\"></nord-icon>\n </slot>\n <div class=\"n-notification-body\">\n <slot></slot>\n </div>\n </nord-stack>\n </div>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-notification': Notification\n }\n}\n","import { html, LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { ref } from 'lit/directives/ref.js'\nimport { FocusableMixin } from '../common/mixins/FocusableMixin.js'\n\nimport componentStyle from '../common/styles/Component.css'\nimport style from './ProgressBar.css'\n\n/**\n * Progress Bar is used to visually represent the completion\n * of a task or process. It shows how much of the task has\n * been completed and how much is still left.\n *\n * @status ready\n * @category feedback\n *\n * @cssprop [--n-progress-size=var(--n-space-s)] - Controls the thickness of the progress bar, using our [spacing tokens](/tokens/#space).\n * @cssprop [--n-progress-border-radius=var(--n-border-radius-s)] - Controls how rounded the corners are, using [border radius tokens](/tokens/#border-radius).\n * @cssprop [--n-progress-color=var(--n-color-accent)] - Controls the color of the progress bar, using [color tokens](/tokens/#color).\n */\n@customElement('nord-progress-bar')\nexport default class ProgressBar extends FocusableMixin(LitElement) {\n static styles = [componentStyle, style]\n\n /**\n * Specifies how much of the task has been completed. Must be a valid floating\n * point number between 0 and max, or between 0 and 100 if max is omitted. If\n * there is no value, the progress bar is indeterminate; this indicates that\n * an activity is ongoing with no indication of how long it’s expected to take.\n */\n @property({ reflect: true, type: Number }) value?: number\n\n /**\n * Describes how much work the task indicated by the progress element requires.\n * The max attribute, if present, must have a value greater than 0 and be a\n * valid floating point number.\n */\n @property({ reflect: true, type: Number }) max: number = 100\n\n /**\n * Accessible label for the progress indicator. Visually hidden, but shown\n * for assistive technology.\n */\n @property({ reflect: true }) label: string = 'Current progress'\n\n render() {\n /**\n * The Aria properties are required for now due to a Chrome bug.\n * In the future we can probably get rid of them. For context:\n * https://bugs.chromium.org/p/chromium/issues/detail?id=1310779\n */\n return html`<label>\n <nord-visually-hidden>${this.label}</nord-visually-hidden>\n <progress\n ${ref(this.focusableRef)}\n aria-valuenow=${ifDefined(this.value)}\n aria-valuemin=\"0\"\n aria-valuemax=${this.max}\n tabindex=\"-1\"\n max=${this.max}\n value=${ifDefined(this.value)}\n ></progress>\n </label>`\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-progress-bar': ProgressBar\n }\n}\n","import { html, LitElement, svg } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { cond } from '../common/directives/cond.js'\nimport componentStyle from '../common/styles/Component.css'\nimport style from './Progress.css'\n\nconst CX = 11.25\nconst CY = 11.25\nconst OUTER_RADIUS = 9\nconst INNER_RADIUS = 6\n\nlet instanceCounter = 0\n\n/**\n * Generates an SVG path for a pie sector starting from 12 o'clock, sweeping clockwise.\n * @param percent - The progress percentage (0-100)\n * @returns The SVG path data string\n */\nfunction sectorPath(percent: number): string {\n const p = Math.max(0, Math.min(100, percent))\n if (p === 0)\n return ''\n if (p === 100) {\n return `M${CX},${CY - INNER_RADIUS}\n A${INNER_RADIUS},${INNER_RADIUS} 0 1 1 ${CX},${CY + INNER_RADIUS}\n A${INNER_RADIUS},${INNER_RADIUS} 0 1 1 ${CX},${CY - INNER_RADIUS} Z`\n }\n const sweep = (p / 100) * 360\n const theta = (-90 + sweep) * (Math.PI / 180)\n const ex = CX + INNER_RADIUS * Math.cos(theta)\n const ey = CY + INNER_RADIUS * Math.sin(theta)\n const large = sweep > 180 ? 1 : 0\n return `M${CX},${CY}\n L${CX},${CY - INNER_RADIUS}\n A${INNER_RADIUS},${INNER_RADIUS} 0 ${large},1 ${ex},${ey}\n Z`\n}\n\n/**\n * Progress component is used to display a circular pie-chart style progress indicator.\n * You can customize the size and color of the progress indicator with the\n * provided properties.\n *\n * @status ready\n * @category feedback\n * @cssprop [--n-progress-color=var(--n-color-accent)] - Controls the color of the progress indicator.\n */\n@customElement('nord-progress')\nexport default class Progress extends LitElement {\n static styles = [componentStyle, style]\n\n /**\n * The size of the progress indicator.\n */\n @property({ reflect: true }) size: 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl' = 'm'\n\n /**\n * The color of the progress indicator.\n * Can accept any valid CSS color value, including custom properties.\n * Takes precedence over the `--n-progress-color` CSS custom property.\n */\n @property({ reflect: true }) color?: string\n\n /**\n * An accessible label for the progress indicator.\n * If no label is supplied, the component is hidden from assistive technology.\n */\n @property({ reflect: true }) label?: string\n\n /**\n * The progress percentage value.\n */\n @property({ reflect: true, type: Number }) progress: number = 0\n\n /**\n * Internal state for the animated progress value.\n */\n @state() private _animatedProgress: number = 0\n\n /**\n * Animation frame ID for cleanup.\n */\n private _animationId: number | null = null\n\n /**\n * Target progress for animation.\n */\n private _targetProgress: number = 0\n\n /**\n * Unique ID for this component instance, used for SVG clipPath.\n */\n private _instanceId: number = 0\n\n constructor() {\n super()\n this._instanceId = instanceCounter++\n }\n\n connectedCallback() {\n super.connectedCallback()\n this._animatedProgress = this.progress\n this._targetProgress = this.progress\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n if (this._animationId !== null) {\n cancelAnimationFrame(this._animationId)\n this._animationId = null\n }\n }\n\n updated(changedProperties: Map<string, unknown>) {\n if (changedProperties.has('progress')) {\n this._targetProgress = Math.max(0, Math.min(100, this.progress))\n this._animate()\n }\n }\n\n private _animate() {\n if (this._animationId !== null) {\n cancelAnimationFrame(this._animationId)\n }\n\n const animate = () => {\n const diff = this._targetProgress - this._animatedProgress\n if (Math.abs(diff) < 0.5) {\n this._animatedProgress = this._targetProgress\n this._animationId = null\n return\n }\n // Ease towards target with smooth interpolation\n this._animatedProgress += diff * 0.15\n this._animationId = requestAnimationFrame(animate)\n }\n\n this._animationId = requestAnimationFrame(animate)\n }\n\n private get _clampedProgress(): number {\n return Math.max(0, Math.min(100, this._animatedProgress))\n }\n\n /**\n * Check if the color is a semantic value handled by CSS.\n */\n private get _isSemanticColor(): boolean {\n return ['success', 'warning', 'danger', 'highlight', 'info'].includes(this.color ?? '')\n }\n\n /**\n * Get the custom color style if not a semantic value.\n */\n private get _customColorStyle(): string | undefined {\n if (this.color && !this._isSemanticColor) {\n return `--_n-progress-color:${this.color}`\n }\n return undefined\n }\n\n render() {\n const hasLabel = Boolean(this.label)\n const pathData = sectorPath(this._clampedProgress)\n const clipId = `n-progress-clip-${this._instanceId}`\n\n return html`\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 22.5 22.5\"\n fill=\"none\"\n role=${cond(hasLabel, 'progressbar')}\n aria-label=${ifDefined(this.label)}\n aria-valuenow=${cond(hasLabel, Math.round(this._clampedProgress))}\n aria-valuemin=${cond(hasLabel, '0')}\n aria-valuemax=${cond(hasLabel, '100')}\n aria-hidden=${cond(!hasLabel, 'true')}\n style=${ifDefined(this._customColorStyle)}\n >\n <g clip-path=\"url(#${clipId})\">\n <rect x=\"1.25\" y=\"1.25\" width=\"20\" height=\"20\" rx=\"10\" fill=\"var(--_n-progress-background)\" />\n <circle\n cx=\"${CX}\"\n cy=\"${CY}\"\n r=\"${OUTER_RADIUS}\"\n fill=\"var(--_n-progress-background)\"\n stroke=\"var(--_n-progress-color)\"\n stroke-width=\"2\"\n />\n ${svg`<path fill=\"var(--_n-progress-color)\" d=\"${pathData}\" />`}\n </g>\n <rect\n x=\"0.625\"\n y=\"0.625\"\n width=\"21.25\"\n height=\"21.25\"\n rx=\"10.625\"\n stroke=\"var(--_n-progress-background)\"\n stroke-width=\"1.25\"\n />\n <defs>\n <clipPath id=\"${clipId}\">\n <rect x=\"1.25\" y=\"1.25\" width=\"20\" height=\"20\" rx=\"10\" fill=\"white\" />\n </clipPath>\n </defs>\n </svg>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-progress': Progress\n }\n}\n","/*!\nCopyright (c) 2023 Paul Miller (paulmillr.com)\nThe library paulmillr-qr is dual-licensed under the Apache 2.0 OR MIT license.\nYou can select a license of your choice.\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n/**\n * Methods for encoding (generating) QR code patterns.\n * Check out decode.ts for decoding (reading).\n * @module\n * @example\n```js\nimport encodeQR from '@paulmillr/qr';\nconst txt = 'Hello world';\nconst ascii = encodeQR(txt, 'ascii'); // Not all fonts are supported\nconst terminalFriendly = encodeQR(txt, 'term'); // 2x larger, all fonts are OK\nconst gifBytes = encodeQR(txt, 'gif'); // Uncompressed GIF\nconst svgElement = encodeQR(txt, 'svg'); // SVG vector image element\nconst array = encodeQR(txt, 'raw'); // 2d array for canvas or other libs\n// import decodeQR from '@paulmillr/qr/decode';\n```\n */\n// We do not use newline escape code directly in strings because it's not parser-friendly\nconst chCodes = { newline: 10, reset: 27 };\nfunction assertNumber(n) {\n if (!Number.isSafeInteger(n))\n throw new Error(`integer expected: ${n}`);\n}\nfunction validateVersion(ver) {\n if (!Number.isSafeInteger(ver) || ver < 1 || ver > 40)\n throw new Error(`Invalid version=${ver}. Expected number [1..40]`);\n}\nfunction bin(dec, pad) {\n return dec.toString(2).padStart(pad, '0');\n}\nfunction mod(a, b) {\n const result = a % b;\n return result >= 0 ? result : b + result;\n}\nfunction fillArr(length, val) {\n return new Array(length).fill(val);\n}\n/**\n * Interleaves byte blocks.\n * @param blocks [[1, 2, 3], [4, 5, 6]]\n * @returns [1, 4, 2, 5, 3, 6]\n */\nfunction interleaveBytes(...blocks) {\n let len = 0;\n for (const b of blocks)\n len = Math.max(len, b.length);\n const res = [];\n for (let i = 0; i < len; i++) {\n for (const b of blocks) {\n if (i >= b.length)\n continue; // outside of block, skip\n res.push(b[i]);\n }\n }\n return new Uint8Array(res);\n}\nfunction includesAt(lst, pattern, index) {\n if (index < 0 || index + pattern.length > lst.length)\n return false;\n for (let i = 0; i < pattern.length; i++)\n if (pattern[i] !== lst[index + i])\n return false;\n return true;\n}\n// Optimize for minimal score/penalty\nfunction best() {\n let best;\n let bestScore = Infinity;\n return {\n add(score, value) {\n if (score >= bestScore)\n return;\n best = value;\n bestScore = score;\n },\n get: () => best,\n score: () => bestScore,\n };\n}\n// Based on https://github.com/paulmillr/scure-base/blob/main/index.ts\nfunction alphabet(alphabet) {\n return {\n has: (char) => alphabet.includes(char),\n decode: (input) => {\n if (!Array.isArray(input) || (input.length && typeof input[0] !== 'string'))\n throw new Error('alphabet.decode input should be array of strings');\n return input.map((letter) => {\n if (typeof letter !== 'string')\n throw new Error(`alphabet.decode: not string element=${letter}`);\n const index = alphabet.indexOf(letter);\n if (index === -1)\n throw new Error(`Unknown letter: \"${letter}\". Allowed: ${alphabet}`);\n return index;\n });\n },\n encode: (digits) => {\n if (!Array.isArray(digits) || (digits.length && typeof digits[0] !== 'number'))\n throw new Error('alphabet.encode input should be an array of numbers');\n return digits.map((i) => {\n assertNumber(i);\n if (i < 0 || i >= alphabet.length)\n throw new Error(`Digit index outside alphabet: ${i} (alphabet: ${alphabet.length})`);\n return alphabet[i];\n });\n },\n };\n}\nexport class Bitmap {\n static size(size, limit) {\n if (typeof size === 'number')\n size = { height: size, width: size };\n if (!Number.isSafeInteger(size.height) && size.height !== Infinity)\n throw new Error(`Bitmap: invalid height=${size.height} (${typeof size.height})`);\n if (!Number.isSafeInteger(size.width) && size.width !== Infinity)\n throw new Error(`Bitmap: invalid width=${size.width} (${typeof size.width})`);\n if (limit !== undefined) {\n // Clamp length, so it won't overflow, also allows to use Infinity, so we draw until end\n size = {\n width: Math.min(size.width, limit.width),\n height: Math.min(size.height, limit.height),\n };\n }\n return size;\n }\n static fromString(s) {\n // Remove linebreaks on start and end, so we draw in `` section\n s = s.replace(/^\\n+/g, '').replace(/\\n+$/g, '');\n const lines = s.split(String.fromCharCode(chCodes.newline));\n const height = lines.length;\n const data = new Array(height);\n let width;\n for (const line of lines) {\n const row = line.split('').map((i) => {\n if (i === 'X')\n return true;\n if (i === ' ')\n return false;\n if (i === '?')\n return undefined;\n throw new Error(`Bitmap.fromString: unknown symbol=${i}`);\n });\n if (width && row.length !== width)\n throw new Error(`Bitmap.fromString different row sizes: width=${width} cur=${row.length}`);\n width = row.length;\n data.push(row);\n }\n if (!width)\n width = 0;\n return new Bitmap({ height, width }, data);\n }\n constructor(size, data) {\n const { height, width } = Bitmap.size(size);\n this.data = data || Array.from({ length: height }, () => fillArr(width, undefined));\n this.height = height;\n this.width = width;\n }\n point(p) {\n return this.data[p.y][p.x];\n }\n isInside(p) {\n return 0 <= p.x && p.x < this.width && 0 <= p.y && p.y < this.height;\n }\n size(offset) {\n if (!offset)\n return { height: this.height, width: this.width };\n const { x, y } = this.xy(offset);\n return { height: this.height - y, width: this.width - x };\n }\n xy(c) {\n if (typeof c === 'number')\n c = { x: c, y: c };\n if (!Number.isSafeInteger(c.x))\n throw new Error(`Bitmap: invalid x=${c.x}`);\n if (!Number.isSafeInteger(c.y))\n throw new Error(`Bitmap: invalid y=${c.y}`);\n // Do modulo, so we can use negative positions\n c.x = mod(c.x, this.width);\n c.y = mod(c.y, this.height);\n return c;\n }\n // Basically every operation can be represented as rect\n rect(c, size, value) {\n const { x, y } = this.xy(c);\n const { height, width } = Bitmap.size(size, this.size({ x, y }));\n for (let yPos = 0; yPos < height; yPos++) {\n for (let xPos = 0; xPos < width; xPos++) {\n // NOTE: we use give function relative coordinates inside box\n this.data[y + yPos][x + xPos] =\n typeof value === 'function'\n ? value({ x: xPos, y: yPos }, this.data[y + yPos][x + xPos])\n : value;\n }\n }\n return this;\n }\n // returns rectangular part of bitmap\n rectRead(c, size, fn) {\n return this.rect(c, size, (c, cur) => {\n fn(c, cur);\n return cur;\n });\n }\n // Horizontal & vertical lines\n hLine(c, len, value) {\n return this.rect(c, { width: len, height: 1 }, value);\n }\n vLine(c, len, value) {\n return this.rect(c, { width: 1, height: len }, value);\n }\n // add border\n border(border = 2, value) {\n const height = this.height + 2 * border;\n const width = this.width + 2 * border;\n const v = fillArr(border, value);\n const h = Array.from({ length: border }, () => fillArr(width, value));\n return new Bitmap({ height, width }, [...h, ...this.data.map((i) => [...v, ...i, ...v]), ...h]);\n }\n // Embed another bitmap on coordinates\n embed(c, bm) {\n return this.rect(c, bm.size(), ({ x, y }) => bm.data[y][x]);\n }\n // returns rectangular part of bitmap\n rectSlice(c, size = this.size()) {\n const rect = new Bitmap(Bitmap.size(size, this.size(this.xy(c))));\n this.rect(c, size, ({ x, y }, cur) => (rect.data[y][x] = cur));\n return rect;\n }\n // Change shape, replace rows with columns (data[y][x] -> data[x][y])\n inverse() {\n const { height, width } = this;\n const res = new Bitmap({ height: width, width: height });\n return res.rect({ x: 0, y: 0 }, Infinity, ({ x, y }) => this.data[x][y]);\n }\n // Each pixel size is multiplied by factor\n scale(factor) {\n if (!Number.isSafeInteger(factor) || factor > 1024)\n throw new Error(`invalid scale factor: ${factor}`);\n const { height, width } = this;\n const res = new Bitmap({ height: factor * height, width: factor * width });\n return res.rect({ x: 0, y: 0 }, Infinity, ({ x, y }) => this.data[Math.floor(y / factor)][Math.floor(x / factor)]);\n }\n clone() {\n const res = new Bitmap(this.size());\n return res.rect({ x: 0, y: 0 }, this.size(), ({ x, y }) => this.data[y][x]);\n }\n // Ensure that there is no undefined values left\n assertDrawn() {\n this.rectRead(0, Infinity, (_, cur) => {\n if (typeof cur !== 'boolean')\n throw new Error(`Invalid color type=${typeof cur}`);\n });\n }\n // Simple string representation for debugging\n toString() {\n return this.data\n .map((i) => i.map((j) => (j === undefined ? '?' : j ? 'X' : ' ')).join(''))\n .join(String.fromCharCode(chCodes.newline));\n }\n toASCII() {\n const { height, width, data } = this;\n let out = '';\n // Terminal character height is x2 of character width, so we process two rows of bitmap\n // to produce one row of ASCII\n for (let y = 0; y < height; y += 2) {\n for (let x = 0; x < width; x++) {\n const first = data[y][x];\n const second = y + 1 >= height ? true : data[y + 1][x]; // if last row outside bitmap, make it black\n if (!first && !second)\n out += '█'; // both rows white (empty)\n else if (!first && second)\n out += '▀'; // top row white\n else if (first && !second)\n out += '▄'; // down row white\n else if (first && second)\n out += ' '; // both rows black\n }\n out += String.fromCharCode(chCodes.newline);\n }\n return out;\n }\n toTerm() {\n const cc = String.fromCharCode(chCodes.reset);\n const reset = cc + '[0m';\n const whiteBG = cc + '[1;47m ' + reset;\n const darkBG = cc + `[40m ` + reset;\n return this.data\n .map((i) => i.map((j) => (j ? darkBG : whiteBG)).join(''))\n .join(String.fromCharCode(chCodes.newline));\n }\n toSVG(optimize = true) {\n let out = `<svg viewBox=\"0 0 ${this.width} ${this.height}\" xmlns=\"http://www.w3.org/2000/svg\">`;\n // Construct optimized SVG path data.\n let pathData = '';\n let prevPoint;\n this.rectRead(0, Infinity, (point, val) => {\n if (!val)\n return;\n const { x, y } = point;\n if (!optimize) {\n out += `<rect x=\"${x}\" y=\"${y}\" width=\"1\" height=\"1\" />`;\n return;\n }\n // https://developer.mozilla.org/en-US/docs/Web/SVG/Reference/Attribute/d#path_commands\n // Determine the shortest way to represent the initial cursor movement.\n // M - Move cursor (without drawing) to absolute coordinate pair.\n let m = `M${x} ${y}`;\n // Only allow using the relative cursor move command if previous points\n // were drawn.\n if (prevPoint) {\n // m - Move cursor (without drawing) to relative coordinate pair.\n const relM = `m${x - prevPoint.x} ${y - prevPoint.y}`;\n if (relM.length <= m.length)\n m = relM;\n }\n // Determine the shortest way to represent the cell's bottom line draw.\n // H - Draw line from cursor position to absolute x coordinate.\n // h - Draw line from cursor position to relative x coordinate.\n const bH = x < 10 ? `H${x}` : 'h-1';\n // v - Draw line from cursor position to relative y coordinate.\n // Z - Close path (draws line from cursor position to M coordinate).\n pathData += `${m}h1v1${bH}Z`;\n prevPoint = point;\n });\n if (optimize)\n out += `<path d=\"${pathData}\"/>`;\n out += `</svg>`;\n return out;\n }\n toGIF() {\n // NOTE: Small, but inefficient implementation.\n // Uses 1 byte per pixel.\n const u16le = (i) => [i & 0xff, (i >>> 8) & 0xff];\n const dims = [...u16le(this.width), ...u16le(this.height)];\n const data = [];\n this.rectRead(0, Infinity, (_, cur) => data.push(+(cur === true)));\n const N = 126; // Block size\n // prettier-ignore\n const bytes = [\n 0x47, 0x49, 0x46, 0x38, 0x37, 0x61, ...dims, 0xf6, 0x00, 0x00, 0xff, 0xff, 0xff,\n ...fillArr(3 * 127, 0x00), 0x2c, 0x00, 0x00, 0x00, 0x00, ...dims, 0x00, 0x07\n ];\n const fullChunks = Math.floor(data.length / N);\n // Full blocks\n for (let i = 0; i < fullChunks; i++)\n bytes.push(N + 1, 0x80, ...data.slice(N * i, N * (i + 1)).map((i) => +i));\n // Remaining bytes\n bytes.push((data.length % N) + 1, 0x80, ...data.slice(fullChunks * N).map((i) => +i));\n bytes.push(0x01, 0x81, 0x00, 0x3b);\n return new Uint8Array(bytes);\n }\n toImage(isRGB = false) {\n const { height, width } = this.size();\n const data = new Uint8Array(height * width * (isRGB ? 3 : 4));\n let i = 0;\n for (let y = 0; y < height; y++) {\n for (let x = 0; x < width; x++) {\n const value = !!this.data[y][x] ? 0 : 255;\n data[i++] = value;\n data[i++] = value;\n data[i++] = value;\n if (!isRGB)\n data[i++] = 255; // alpha channel\n }\n }\n return { height, width, data };\n }\n}\n// End of utils\n// Runtime type-checking\n/** Error correction mode. low: 7%, medium: 15%, quartile: 25%, high: 30% */\nexport const ECMode = ['low', 'medium', 'quartile', 'high'];\n/** QR Code encoding */\nexport const Encoding = ['numeric', 'alphanumeric', 'byte', 'kanji', 'eci'];\n// Various constants & tables\n// prettier-ignore\nconst BYTES = [\n // 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n 26, 44, 70, 100, 134, 172, 196, 242, 292, 346, 404, 466, 532, 581, 655, 733, 815, 901, 991, 1085,\n // 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40\n 1156, 1258, 1364, 1474, 1588, 1706, 1828, 1921, 2051, 2185, 2323, 2465, 2611, 2761, 2876, 3034, 3196, 3362, 3532, 3706,\n];\n// prettier-ignore\nconst WORDS_PER_BLOCK = {\n // Version 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40\n low: [7, 10, 15, 20, 26, 18, 20, 24, 30, 18, 20, 24, 26, 30, 22, 24, 28, 30, 28, 28, 28, 28, 30, 30, 26, 28, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30],\n medium: [10, 16, 26, 18, 24, 16, 18, 22, 22, 26, 30, 22, 22, 24, 24, 28, 28, 26, 26, 26, 26, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28],\n quartile: [13, 22, 18, 26, 18, 24, 18, 22, 20, 24, 28, 26, 24, 20, 30, 24, 28, 28, 26, 30, 28, 30, 30, 30, 30, 28, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30],\n high: [17, 28, 22, 16, 22, 28, 26, 26, 24, 28, 24, 28, 22, 24, 24, 30, 28, 28, 26, 28, 30, 24, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30],\n};\n// prettier-ignore\nconst ECC_BLOCKS = {\n // Version 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40\n low: [1, 1, 1, 1, 1, 2, 2, 2, 2, 4, 4, 4, 4, 4, 6, 6, 6, 6, 7, 8, 8, 9, 9, 10, 12, 12, 12, 13, 14, 15, 16, 17, 18, 19, 19, 20, 21, 22, 24, 25],\n medium: [1, 1, 1, 2, 2, 4, 4, 4, 5, 5, 5, 8, 9, 9, 10, 10, 11, 13, 14, 16, 17, 17, 18, 20, 21, 23, 25, 26, 28, 29, 31, 33, 35, 37, 38, 40, 43, 45, 47, 49],\n quartile: [1, 1, 2, 2, 4, 4, 6, 6, 8, 8, 8, 10, 12, 16, 12, 17, 16, 18, 21, 20, 23, 23, 25, 27, 29, 34, 34, 35, 38, 40, 43, 45, 48, 51, 53, 56, 59, 62, 65, 68],\n high: [1, 1, 2, 4, 4, 4, 5, 6, 8, 8, 11, 11, 16, 16, 18, 16, 19, 21, 25, 25, 25, 34, 30, 32, 35, 37, 40, 42, 45, 48, 51, 54, 57, 60, 63, 66, 70, 74, 77, 81],\n};\nconst info = {\n size: {\n encode: (ver) => 21 + 4 * (ver - 1), // ver1 = 21, ver40=177 blocks\n decode: (size) => (size - 17) / 4,\n },\n sizeType: (ver) => Math.floor((ver + 7) / 17),\n // Based on https://codereview.stackexchange.com/questions/74925/algorithm-to-generate-this-alignment-pattern-locations-table-for-qr-codes\n alignmentPatterns(ver) {\n if (ver === 1)\n return [];\n const first = 6;\n const last = info.size.encode(ver) - first - 1;\n const distance = last - first;\n const count = Math.ceil(distance / 28);\n let interval = Math.floor(distance / count);\n if (interval % 2)\n interval += 1;\n else if ((distance % count) * 2 >= count)\n interval += 2;\n const res = [first];\n for (let m = 1; m < count; m++)\n res.push(last - (count - m) * interval);\n res.push(last);\n return res;\n },\n ECCode: {\n low: 0b01,\n medium: 0b00,\n quartile: 0b11,\n high: 0b10,\n },\n formatMask: 0b101010000010010,\n formatBits(ecc, maskIdx) {\n const data = (info.ECCode[ecc] << 3) | maskIdx;\n let d = data;\n for (let i = 0; i < 10; i++)\n d = (d << 1) ^ ((d >> 9) * 0b10100110111);\n return ((data << 10) | d) ^ info.formatMask;\n },\n versionBits(ver) {\n let d = ver;\n for (let i = 0; i < 12; i++)\n d = (d << 1) ^ ((d >> 11) * 0b1111100100101);\n return (ver << 12) | d;\n },\n alphabet: {\n numeric: alphabet('0123456789'),\n alphanumerc: alphabet('0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:'),\n }, // as Record<EncodingType, ReturnType<typeof alphabet>>,\n lengthBits(ver, type) {\n const table = {\n numeric: [10, 12, 14],\n alphanumeric: [9, 11, 13],\n byte: [8, 16, 16],\n kanji: [8, 10, 12],\n eci: [0, 0, 0],\n };\n return table[type][info.sizeType(ver)];\n },\n modeBits: {\n numeric: '0001',\n alphanumeric: '0010',\n byte: '0100',\n kanji: '1000',\n eci: '0111',\n },\n capacity(ver, ecc) {\n const bytes = BYTES[ver - 1];\n const words = WORDS_PER_BLOCK[ecc][ver - 1];\n const numBlocks = ECC_BLOCKS[ecc][ver - 1];\n const blockLen = Math.floor(bytes / numBlocks) - words;\n const shortBlocks = numBlocks - (bytes % numBlocks);\n return {\n words,\n numBlocks,\n shortBlocks,\n blockLen,\n capacity: (bytes - words * numBlocks) * 8,\n total: (words + blockLen) * numBlocks + numBlocks - shortBlocks,\n };\n },\n};\nconst PATTERNS = [\n (x, y) => (x + y) % 2 == 0,\n (_x, y) => y % 2 == 0,\n (x, _y) => x % 3 == 0,\n (x, y) => (x + y) % 3 == 0,\n (x, y) => (Math.floor(y / 2) + Math.floor(x / 3)) % 2 == 0,\n (x, y) => ((x * y) % 2) + ((x * y) % 3) == 0,\n (x, y) => (((x * y) % 2) + ((x * y) % 3)) % 2 == 0,\n (x, y) => (((x + y) % 2) + ((x * y) % 3)) % 2 == 0,\n];\n// Galois field && reed-solomon encoding\nconst GF = {\n tables: ((p_poly) => {\n const exp = fillArr(256, 0);\n const log = fillArr(256, 0);\n for (let i = 0, x = 1; i < 256; i++) {\n exp[i] = x;\n log[x] = i;\n x <<= 1;\n if (x & 0x100)\n x ^= p_poly;\n }\n return { exp, log };\n })(0x11d),\n exp: (x) => GF.tables.exp[x],\n log(x) {\n if (x === 0)\n throw new Error(`GF.log: invalid arg=${x}`);\n return GF.tables.log[x] % 255;\n },\n mul(x, y) {\n if (x === 0 || y === 0)\n return 0;\n return GF.tables.exp[(GF.tables.log[x] + GF.tables.log[y]) % 255];\n },\n add: (x, y) => x ^ y,\n pow: (x, e) => GF.tables.exp[(GF.tables.log[x] * e) % 255],\n inv(x) {\n if (x === 0)\n throw new Error(`GF.inverse: invalid arg=${x}`);\n return GF.tables.exp[255 - GF.tables.log[x]];\n },\n polynomial(poly) {\n if (poly.length == 0)\n throw new Error('GF.polymomial: invalid length');\n if (poly[0] !== 0)\n return poly;\n // Strip leading zeros\n let i = 0;\n for (; i < poly.length - 1 && poly[i] == 0; i++)\n ;\n return poly.slice(i);\n },\n monomial(degree, coefficient) {\n if (degree < 0)\n throw new Error(`GF.monomial: invalid degree=${degree}`);\n if (coefficient == 0)\n return [0];\n let coefficients = fillArr(degree + 1, 0);\n coefficients[0] = coefficient;\n return GF.polynomial(coefficients);\n },\n degree: (a) => a.length - 1,\n coefficient: (a, degree) => a[GF.degree(a) - degree],\n mulPoly(a, b) {\n if (a[0] === 0 || b[0] === 0)\n return [0];\n const res = fillArr(a.length + b.length - 1, 0);\n for (let i = 0; i < a.length; i++) {\n for (let j = 0; j < b.length; j++) {\n res[i + j] = GF.add(res[i + j], GF.mul(a[i], b[j]));\n }\n }\n return GF.polynomial(res);\n },\n mulPolyScalar(a, scalar) {\n if (scalar == 0)\n return [0];\n if (scalar == 1)\n return a;\n const res = fillArr(a.length, 0);\n for (let i = 0; i < a.length; i++)\n res[i] = GF.mul(a[i], scalar);\n return GF.polynomial(res);\n },\n mulPolyMonomial(a, degree, coefficient) {\n if (degree < 0)\n throw new Error('GF.mulPolyMonomial: invalid degree');\n if (coefficient == 0)\n return [0];\n const res = fillArr(a.length + degree, 0);\n for (let i = 0; i < a.length; i++)\n res[i] = GF.mul(a[i], coefficient);\n return GF.polynomial(res);\n },\n addPoly(a, b) {\n if (a[0] === 0)\n return b;\n if (b[0] === 0)\n return a;\n let smaller = a;\n let larger = b;\n if (smaller.length > larger.length)\n [smaller, larger] = [larger, smaller];\n let sumDiff = fillArr(larger.length, 0);\n let lengthDiff = larger.length - smaller.length;\n let s = larger.slice(0, lengthDiff);\n for (let i = 0; i < s.length; i++)\n sumDiff[i] = s[i];\n for (let i = lengthDiff; i < larger.length; i++)\n sumDiff[i] = GF.add(smaller[i - lengthDiff], larger[i]);\n return GF.polynomial(sumDiff);\n },\n remainderPoly(data, divisor) {\n const out = Array.from(data);\n for (let i = 0; i < data.length - divisor.length + 1; i++) {\n const elm = out[i];\n if (elm === 0)\n continue;\n for (let j = 1; j < divisor.length; j++) {\n if (divisor[j] !== 0)\n out[i + j] = GF.add(out[i + j], GF.mul(divisor[j], elm));\n }\n }\n return out.slice(data.length - divisor.length + 1, out.length);\n },\n divisorPoly(degree) {\n let g = [1];\n for (let i = 0; i < degree; i++)\n g = GF.mulPoly(g, [1, GF.pow(2, i)]);\n return g;\n },\n evalPoly(poly, a) {\n if (a == 0)\n return GF.coefficient(poly, 0); // Just return the x^0 coefficient\n let res = poly[0];\n for (let i = 1; i < poly.length; i++)\n res = GF.add(GF.mul(a, res), poly[i]);\n return res;\n },\n // TODO: cleanup\n euclidian(a, b, R) {\n // Force degree(a) >= degree(b)\n if (GF.degree(a) < GF.degree(b))\n [a, b] = [b, a];\n let rLast = a;\n let r = b;\n let tLast = [0];\n let t = [1];\n // while degree of Ri ≥ t/2\n while (2 * GF.degree(r) >= R) {\n let rLastLast = rLast;\n let tLastLast = tLast;\n rLast = r;\n tLast = t;\n if (rLast[0] === 0)\n throw new Error('rLast[0] === 0');\n r = rLastLast;\n let q = [0];\n const dltInverse = GF.inv(rLast[0]);\n while (GF.degree(r) >= GF.degree(rLast) && r[0] !== 0) {\n const degreeDiff = GF.degree(r) - GF.degree(rLast);\n const scale = GF.mul(r[0], dltInverse);\n q = GF.addPoly(q, GF.monomial(degreeDiff, scale));\n r = GF.addPoly(r, GF.mulPolyMonomial(rLast, degreeDiff, scale));\n }\n q = GF.mulPoly(q, tLast);\n t = GF.addPoly(q, tLastLast);\n if (GF.degree(r) >= GF.degree(rLast))\n throw new Error(`Division failed r: ${r}, rLast: ${rLast}`);\n }\n const sigmaTildeAtZero = GF.coefficient(t, 0);\n if (sigmaTildeAtZero == 0)\n throw new Error('sigmaTilde(0) was zero');\n const inverse = GF.inv(sigmaTildeAtZero);\n return [GF.mulPolyScalar(t, inverse), GF.mulPolyScalar(r, inverse)];\n },\n};\nfunction RS(eccWords) {\n return {\n encode(from) {\n const d = GF.divisorPoly(eccWords);\n const pol = Array.from(from);\n pol.push(...d.slice(0, -1).fill(0));\n return Uint8Array.from(GF.remainderPoly(pol, d));\n },\n decode(to) {\n const res = to.slice();\n const poly = GF.polynomial(Array.from(to));\n // Find errors\n let syndrome = fillArr(eccWords, 0);\n let hasError = false;\n for (let i = 0; i < eccWords; i++) {\n const evl = GF.evalPoly(poly, GF.exp(i));\n syndrome[syndrome.length - 1 - i] = evl;\n if (evl !== 0)\n hasError = true;\n }\n if (!hasError)\n return res;\n syndrome = GF.polynomial(syndrome);\n const monomial = GF.monomial(eccWords, 1);\n const [errorLocator, errorEvaluator] = GF.euclidian(monomial, syndrome, eccWords);\n // Error locations\n const locations = fillArr(GF.degree(errorLocator), 0);\n let e = 0;\n for (let i = 1; i < 256 && e < locations.length; i++) {\n if (GF.evalPoly(errorLocator, i) === 0)\n locations[e++] = GF.inv(i);\n }\n if (e !== locations.length)\n throw new Error('RS.decode: invalid errors number');\n for (let i = 0; i < locations.length; i++) {\n const pos = res.length - 1 - GF.log(locations[i]);\n if (pos < 0)\n throw new Error('RS.decode: invalid error location');\n const xiInverse = GF.inv(locations[i]);\n let denominator = 1;\n for (let j = 0; j < locations.length; j++) {\n if (i === j)\n continue;\n denominator = GF.mul(denominator, GF.add(1, GF.mul(locations[j], xiInverse)));\n }\n res[pos] = GF.add(res[pos], GF.mul(GF.evalPoly(errorEvaluator, xiInverse), GF.inv(denominator)));\n }\n return res;\n },\n };\n}\n// Interleaves blocks\nfunction interleave(ver, ecc) {\n const { words, shortBlocks, numBlocks, blockLen, total } = info.capacity(ver, ecc);\n const rs = RS(words);\n return {\n encode(bytes) {\n // Add error correction to bytes\n const blocks = [];\n const eccBlocks = [];\n for (let i = 0; i < numBlocks; i++) {\n const isShort = i < shortBlocks;\n const len = blockLen + (isShort ? 0 : 1);\n blocks.push(bytes.subarray(0, len));\n eccBlocks.push(rs.encode(bytes.subarray(0, len)));\n bytes = bytes.subarray(len);\n }\n const resBlocks = interleaveBytes(...blocks);\n const resECC = interleaveBytes(...eccBlocks);\n const res = new Uint8Array(resBlocks.length + resECC.length);\n res.set(resBlocks);\n res.set(resECC, resBlocks.length);\n return res;\n },\n decode(data) {\n if (data.length !== total)\n throw new Error(`interleave.decode: len(data)=${data.length}, total=${total}`);\n const blocks = [];\n for (let i = 0; i < numBlocks; i++) {\n const isShort = i < shortBlocks;\n blocks.push(new Uint8Array(words + blockLen + (isShort ? 0 : 1)));\n }\n // Short blocks\n let pos = 0;\n for (let i = 0; i < blockLen; i++) {\n for (let j = 0; j < numBlocks; j++)\n blocks[j][i] = data[pos++];\n }\n // Long blocks\n for (let j = shortBlocks; j < numBlocks; j++)\n blocks[j][blockLen] = data[pos++];\n // ECC\n for (let i = blockLen; i < blockLen + words; i++) {\n for (let j = 0; j < numBlocks; j++) {\n const isShort = j < shortBlocks;\n blocks[j][i + (isShort ? 0 : 1)] = data[pos++];\n }\n }\n // Decode\n // Error-correct and copy data blocks together into a stream of bytes\n const res = [];\n for (const block of blocks)\n res.push(...Array.from(rs.decode(block)).slice(0, -words));\n return Uint8Array.from(res);\n },\n };\n}\n// Draw\n// Generic template per version+ecc+mask. Can be cached, to speedup calculations.\nfunction drawTemplate(ver, ecc, maskIdx, test = false) {\n const size = info.size.encode(ver);\n let b = new Bitmap(size + 2);\n // Finder patterns\n // We draw full pattern and later slice, since before addition of borders finder is truncated by one pixel on sides\n const finder = new Bitmap(3).rect(0, 3, true).border(1, false).border(1, true).border(1, false);\n b = b\n .embed(0, finder) // top left\n .embed({ x: -finder.width, y: 0 }, finder) // top right\n .embed({ x: 0, y: -finder.height }, finder); // bottom left\n b = b.rectSlice(1, size);\n // Alignment patterns\n const align = new Bitmap(1).rect(0, 1, true).border(1, false).border(1, true);\n const alignPos = info.alignmentPatterns(ver);\n for (const y of alignPos) {\n for (const x of alignPos) {\n if (b.data[y][x] !== undefined)\n continue;\n b.embed({ x: x - 2, y: y - 2 }, align); // center of pattern should be at position\n }\n }\n // Timing patterns\n b = b\n .hLine({ x: 0, y: 6 }, Infinity, ({ x }, cur) => (cur === undefined ? x % 2 == 0 : cur))\n .vLine({ x: 6, y: 0 }, Infinity, ({ y }, cur) => (cur === undefined ? y % 2 == 0 : cur));\n // Format information\n {\n const bits = info.formatBits(ecc, maskIdx);\n const getBit = (i) => !test && ((bits >> i) & 1) == 1;\n // vertical\n for (let i = 0; i < 6; i++)\n b.data[i][8] = getBit(i); // right of top-left finder\n // TODO: re-write as lines, like:\n // b.vLine({ x: 8, y: 0 }, 6, ({ x, y }) => getBit(y));\n for (let i = 6; i < 8; i++)\n b.data[i + 1][8] = getBit(i); // after timing pattern\n for (let i = 8; i < 15; i++)\n b.data[size - 15 + i][8] = getBit(i); // right of bottom-left finder\n // horizontal\n for (let i = 0; i < 8; i++)\n b.data[8][size - i - 1] = getBit(i); // under top-right finder\n for (let i = 8; i < 9; i++)\n b.data[8][15 - i - 1 + 1] = getBit(i); // VVV, after timing\n for (let i = 9; i < 15; i++)\n b.data[8][15 - i - 1] = getBit(i); // under top-left finder\n b.data[size - 8][8] = !test; // bottom-left finder, right\n }\n // Version information\n if (ver >= 7) {\n const bits = info.versionBits(ver);\n for (let i = 0; i < 18; i += 1) {\n const bit = !test && ((bits >> i) & 1) == 1;\n const x = Math.floor(i / 3);\n const y = (i % 3) + size - 8 - 3;\n // two copies\n b.data[x][y] = bit;\n b.data[y][x] = bit;\n }\n }\n return b;\n}\n// zigzag: bottom->top && top->bottom\nfunction zigzag(tpl, maskIdx, fn) {\n const size = tpl.height;\n const pattern = PATTERNS[maskIdx];\n // zig-zag pattern\n let dir = -1;\n let y = size - 1;\n // two columns at time\n for (let xOffset = size - 1; xOffset > 0; xOffset -= 2) {\n if (xOffset == 6)\n xOffset = 5; // skip vertical timing pattern\n for (;; y += dir) {\n for (let j = 0; j < 2; j += 1) {\n const x = xOffset - j;\n if (tpl.data[y][x] !== undefined)\n continue; // skip already written elements\n fn(x, y, pattern(x, y));\n }\n if (y + dir < 0 || y + dir >= size)\n break;\n }\n dir = -dir; // change direction\n }\n}\n// NOTE: byte encoding is just representation, QR works with strings only. Most decoders will fail on raw byte array,\n// since they expect unicode or other text encoding inside bytes\nfunction detectType(str) {\n let type = 'numeric';\n for (let x of str) {\n if (info.alphabet.numeric.has(x))\n continue;\n type = 'alphanumeric';\n if (!info.alphabet.alphanumerc.has(x))\n return 'byte';\n }\n return type;\n}\n/**\n * @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99])\n */\nexport function utf8ToBytes(str) {\n if (typeof str !== 'string')\n throw new Error(`utf8ToBytes expected string, got ${typeof str}`);\n return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809\n}\nfunction encode(ver, ecc, data, type) {\n let encoded = '';\n let dataLen = data.length;\n if (type === 'numeric') {\n const t = info.alphabet.numeric.decode(data.split(''));\n const n = t.length;\n for (let i = 0; i < n - 2; i += 3)\n encoded += bin(t[i] * 100 + t[i + 1] * 10 + t[i + 2], 10);\n if (n % 3 === 1) {\n encoded += bin(t[n - 1], 4);\n }\n else if (n % 3 === 2) {\n encoded += bin(t[n - 2] * 10 + t[n - 1], 7);\n }\n }\n else if (type === 'alphanumeric') {\n const t = info.alphabet.alphanumerc.decode(data.split(''));\n const n = t.length;\n for (let i = 0; i < n - 1; i += 2)\n encoded += bin(t[i] * 45 + t[i + 1], 11);\n if (n % 2 == 1)\n encoded += bin(t[n - 1], 6); // pad if odd number of chars\n }\n else if (type === 'byte') {\n const utf8 = utf8ToBytes(data);\n dataLen = utf8.length;\n encoded = Array.from(utf8)\n .map((i) => bin(i, 8))\n .join('');\n }\n else {\n throw new Error('encode: unsupported type');\n }\n const { capacity } = info.capacity(ver, ecc);\n const len = bin(dataLen, info.lengthBits(ver, type));\n let bits = info.modeBits[type] + len + encoded;\n if (bits.length > capacity)\n throw new Error('Capacity overflow');\n // Terminator\n bits += '0'.repeat(Math.min(4, Math.max(0, capacity - bits.length)));\n // Pad bits string untill full byte\n if (bits.length % 8)\n bits += '0'.repeat(8 - (bits.length % 8));\n // Add padding until capacity is full\n const padding = '1110110000010001';\n for (let idx = 0; bits.length !== capacity; idx++)\n bits += padding[idx % padding.length];\n // Convert a bitstring to array of bytes\n const bytes = Uint8Array.from(bits.match(/(.{8})/g).map((i) => Number(`0b${i}`)));\n return interleave(ver, ecc).encode(bytes);\n}\n// DRAW\nfunction drawQR(ver, ecc, data, maskIdx, test = false) {\n const b = drawTemplate(ver, ecc, maskIdx, test);\n let i = 0;\n const need = 8 * data.length;\n zigzag(b, maskIdx, (x, y, mask) => {\n let value = false;\n if (i < need) {\n value = ((data[i >>> 3] >> ((7 - i) & 7)) & 1) !== 0;\n i++;\n }\n b.data[y][x] = value !== mask; // !== as xor\n });\n if (i !== need)\n throw new Error('QR: bytes left after draw');\n return b;\n}\nfunction penalty(bm) {\n const inverse = bm.inverse();\n // Adjacent modules in row/column in same | No. of modules = (5 + i) color\n const sameColor = (row) => {\n let res = 0;\n for (let i = 0, same = 1, last = undefined; i < row.length; i++) {\n if (last === row[i]) {\n same++;\n if (i !== row.length - 1)\n continue; // handle last element\n }\n if (same >= 5)\n res += 3 + (same - 5);\n last = row[i];\n same = 1;\n }\n return res;\n };\n let adjacent = 0;\n bm.data.forEach((row) => (adjacent += sameColor(row)));\n inverse.data.forEach((column) => (adjacent += sameColor(column)));\n // Block of modules in same color (Block size = 2x2)\n let box = 0;\n let b = bm.data;\n const lastW = bm.width - 1;\n const lastH = bm.height - 1;\n for (let x = 0; x < lastW; x++) {\n for (let y = 0; y < lastH; y++) {\n const x1 = x + 1;\n const y1 = y + 1;\n if (b[x][y] === b[x1][y] && b[x1][y] === b[x][y1] && b[x1][y] === b[x1][y1]) {\n box += 3;\n }\n }\n }\n // 1:1:3:1:1 ratio (dark:light:dark:light:dark) pattern in row/column, preceded or followed by light area 4 modules wide\n const finderPattern = (row) => {\n const finderPattern = [true, false, true, true, true, false, true]; // dark:light:dark:light:dark\n const lightPattern = [false, false, false, false]; // light area 4 modules wide\n const p1 = [...finderPattern, ...lightPattern];\n const p2 = [...lightPattern, ...finderPattern];\n let res = 0;\n for (let i = 0; i < row.length; i++) {\n if (includesAt(row, p1, i))\n res += 40;\n if (includesAt(row, p2, i))\n res += 40;\n }\n return res;\n };\n let finder = 0;\n for (const row of bm.data)\n finder += finderPattern(row);\n for (const column of inverse.data)\n finder += finderPattern(column);\n // Proportion of dark modules in entire symbol\n // Add 10 points to a deviation of 5% increment or decrement in the proportion\n // ratio of dark module from the referential 50%\n let darkPixels = 0;\n bm.rectRead(0, Infinity, (_c, val) => (darkPixels += val ? 1 : 0));\n const darkPercent = (darkPixels / (bm.height * bm.width)) * 100;\n const dark = 10 * Math.floor(Math.abs(darkPercent - 50) / 5);\n return adjacent + box + finder + dark;\n}\n// Selects best mask according to penalty, if no mask is provided\nfunction drawQRBest(ver, ecc, data, maskIdx) {\n if (maskIdx === undefined) {\n const bestMask = best();\n for (let mask = 0; mask < PATTERNS.length; mask++)\n bestMask.add(penalty(drawQR(ver, ecc, data, mask, true)), mask);\n maskIdx = bestMask.get();\n }\n if (maskIdx === undefined)\n throw new Error('Cannot find mask'); // Should never happen\n return drawQR(ver, ecc, data, maskIdx);\n}\nfunction validateECC(ec) {\n if (!ECMode.includes(ec))\n throw new Error(`Invalid error correction mode=${ec}. Expected: ${ECMode}`);\n}\nfunction validateEncoding(enc) {\n if (!Encoding.includes(enc))\n throw new Error(`Encoding: invalid mode=${enc}. Expected: ${Encoding}`);\n if (enc === 'kanji' || enc === 'eci')\n throw new Error(`Encoding: ${enc} is not supported (yet?).`);\n}\nfunction validateMask(mask) {\n if (![0, 1, 2, 3, 4, 5, 6, 7].includes(mask) || !PATTERNS[mask])\n throw new Error(`Invalid mask=${mask}. Expected number [0..7]`);\n}\nexport function encodeQR(text, output = 'raw', opts = {}) {\n const ecc = opts.ecc !== undefined ? opts.ecc : 'medium';\n validateECC(ecc);\n const encoding = opts.encoding !== undefined ? opts.encoding : detectType(text);\n validateEncoding(encoding);\n if (opts.mask !== undefined)\n validateMask(opts.mask);\n let ver = opts.version;\n let data, err = new Error('Unknown error');\n if (ver !== undefined) {\n validateVersion(ver);\n data = encode(ver, ecc, text, encoding);\n }\n else {\n // If no version is provided, try to find smallest one which fits\n // Currently just scans all version, can be significantly speedup if needed\n for (let i = 1; i <= 40; i++) {\n try {\n data = encode(i, ecc, text, encoding);\n ver = i;\n break;\n }\n catch (e) {\n err = e;\n }\n }\n }\n if (!ver || !data)\n throw err;\n let res = drawQRBest(ver, ecc, data, opts.mask);\n res.assertDrawn();\n const border = opts.border === undefined ? 2 : opts.border;\n if (!Number.isSafeInteger(border))\n throw new Error(`invalid border type=${typeof border}`);\n res = res.border(border, false); // Add border\n if (opts.scale !== undefined)\n res = res.scale(opts.scale); // Scale image\n if (output === 'raw')\n return res.data;\n else if (output === 'ascii')\n return res.toASCII();\n else if (output === 'svg')\n return res.toSVG(opts.optimize);\n else if (output === 'gif')\n return res.toGIF();\n else if (output === 'term')\n return res.toTerm();\n else\n throw new Error(`Unknown output: ${output}`);\n}\nexport default encodeQR;\nexport const utils = {\n best,\n bin,\n drawTemplate,\n fillArr,\n info,\n interleave,\n validateVersion,\n zigzag,\n};\n// Unsafe API utils, exported only for tests\nexport const _tests = {\n Bitmap,\n info,\n detectType,\n encode,\n drawQR,\n penalty,\n PATTERNS,\n};\n// Type tests\n// const o1 = qr('test', 'ascii');\n// const o2 = qr('test', 'raw');\n// const o3 = qr('test', 'gif');\n// const o4 = qr('test', 'svg');\n// const o5 = qr('test', 'term');\n//# sourceMappingURL=index.js.map","import { html, LitElement } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { styleMap } from 'lit/directives/style-map.js'\nimport encodeQR from 'qr'\nimport { observe } from '../common/decorators/observe.js'\nimport componentStyle from '../common/styles/Component.css'\nimport style from './Qrcode.css'\n\nconst correctionMap: Record<'L' | 'M' | 'Q' | 'H', 'low' | 'medium' | 'quartile' | 'high'> = {\n L: 'low',\n M: 'medium',\n Q: 'quartile',\n H: 'high',\n}\n\n/**\n * QR Code component is used for providing information or links\n * to users which they can quickly scan with their smartphone.\n *\n * @status ready\n * @category image\n * @displayName QR Code\n */\n@customElement('nord-qrcode')\nexport default class Qrcode extends LitElement {\n static styles = [componentStyle, style]\n\n @query('canvas', true) private canvas!: HTMLCanvasElement\n @query('.computed', true) private computed!: HTMLElement\n\n /**\n * The value of the QR Code, most commonly an URL.\n */\n @property({ reflect: true }) value = ''\n\n /**\n * Label used by assistive technology. If unspecified, the value will\n * be used instead.\n */\n @property({ reflect: true }) label = ''\n\n /**\n * The size of the rendered QR Code in pixels.\n */\n @property({ reflect: true, type: Number }) size = 128\n\n /**\n * The fill color of the QR Code.\n * Can accept any valid CSS color value, including custom properties.\n */\n @property({ reflect: true }) color = 'var(--n-color-text)'\n\n /**\n * The background color of the QR Code.\n * Can accept any valid CSS color value, including custom properties.\n */\n @property({ reflect: true }) background = 'var(--n-color-surface)'\n\n /**\n * Error correction level makes the QR Code bigger and helps users to\n * scan it without issues. L, M, Q and H values will use 7%, 15%, 25%\n * and 30% of the QR code for error correction respectively.\n */\n @property({ reflect: true }) correction: 'L' | 'M' | 'Q' | 'H' = 'H'\n\n firstUpdated() {\n this.generate()\n }\n\n @observe('correction')\n @observe('color')\n @observe('background')\n @observe('size')\n @observe('value')\n private generate() {\n /**\n * Lit’s built-in hasUpdated property returns true if the component\n * has updated at least once.\n */\n if (!this.hasUpdated) {\n return\n }\n\n const { backgroundColor, color } = getComputedStyle(this.computed)\n\n const qrArray = encodeQR(this.value, 'raw', {\n ecc: correctionMap[this.correction],\n border: 0,\n })\n\n // Draw the canvas 2x larger to avoid blurring on high DPI displays\n const size = this.size * 2\n const ctx = this.canvas.getContext('2d')\n const scale = size / qrArray.length\n\n this.canvas.width = size\n this.canvas.height = size\n\n if (ctx) {\n ctx.fillStyle = backgroundColor\n ctx.fillRect(0, 0, size, size)\n qrArray.forEach((row, y) => {\n row.forEach((cell, x) => {\n if (cell) {\n ctx.fillStyle = color\n ctx.fillRect(x * scale, y * scale, scale, scale)\n }\n })\n })\n }\n }\n\n render() {\n return html`\n <div\n class=\"n-qrcode\"\n style=${styleMap({\n 'inline-size': `${this.size}px`,\n 'block-size': `${this.size}px`,\n })}\n >\n <canvas role=\"img\" aria-label=${this.label.length > 0 ? this.label : this.value}></canvas>\n </div>\n <div\n class=\"computed\"\n hidden\n style=${styleMap({\n 'background-color': `${this.background}`,\n 'color': `${this.color}`,\n })}\n ></div>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-qrcode': Qrcode\n }\n}\n","import type { ReactiveControllerHost } from 'lit'\nimport { isServer, nothing } from 'lit'\nimport { LightDomController } from './LightDomController.js'\nimport { SlotController } from './SlotController.js'\n\ninterface LightSlotOptions {\n slotName: string\n render: () => unknown\n syncLightDom: (element: Element) => void\n}\n\n/**\n * Handles cases where a component needs to render to light DOM,\n * and potentially sync component properties to user-supplied content.\n */\nexport class LightSlotController extends SlotController {\n private renderHook?: Comment\n private lightDom?: LightDomController\n\n constructor(\n host: ReactiveControllerHost & HTMLElement,\n private options: LightSlotOptions,\n ) {\n super(host, options.slotName)\n\n if (isServer) {\n return\n }\n\n // we need a node to hook onto for rendering\n // without this, multiple controllers rendering to the light DOM\n // will overwrite each others' content\n this.renderHook = document.createComment(this.slotName)\n\n this.lightDom = new LightDomController(host, {\n render: () => (this.hasContent ? nothing : this.options.render()),\n renderOptions: { renderBefore: this.renderHook },\n })\n }\n\n hostConnected() {\n super.hostConnected()\n\n if (this.renderHook) {\n this.host.appendChild(this.renderHook)\n this.syncLightDom()\n }\n }\n\n protected override onChange = () => {\n this.syncLightDom()\n }\n\n private syncLightDom() {\n const node = this.content\n\n if (node) {\n this.options.syncLightDom(node)\n }\n }\n}\n","import { html, LitElement, nothing } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { ref } from 'lit/directives/ref.js'\nimport { LightDomController } from '../common/controllers/LightDomController.js'\nimport { LightSlotController } from '../common/controllers/LightSlotController.js'\nimport { observe } from '../common/decorators/observe.js'\nimport { cond } from '../common/directives/cond.js'\nimport { wrapIf } from '../common/directives/wrapIf.js'\n\nimport { FocusableMixin } from '../common/mixins/FocusableMixin.js'\nimport { FormAssociatedMixin } from '../common/mixins/FormAssociatedMixin.js'\nimport { InputMixin } from '../common/mixins/InputMixin.js'\nimport { SizeMixin } from '../common/mixins/SizeMixin.js'\n\nimport componentStyle from '../common/styles/Component.css'\nimport formFieldStyle from '../common/styles/FormField.css'\nimport style from './Radio.css'\n\nlet id = 0\nconst createId = (suffix: string) => `nord-radio-${suffix}-${id++}`\n\nfunction isLabel(element: Element): element is HTMLLabelElement {\n return element.localName === 'label'\n}\n\n/**\n * Force reflow (and with it a repaint) of a radio button because of a macOS Safari rendering bug\n *\n * @see https://bugs.webkit.org/show_bug.cgi?id=249706\n */\nfunction forceReflow(radio: Radio) {\n radio.style.display = 'none'\n // eslint-disable-next-line ts/no-unused-expressions\n radio.offsetHeight // no need to store this anywhere, the reference is enough\n radio.style.display = 'inline-block'\n}\n\n/**\n * Radio buttons are graphical user interface elements that allow user to choose only one option from\n * a predefined set of mutually exclusive options.\n *\n * @status ready\n * @category form\n * @slot label - Use when a label requires more than plain text.\n * @slot hint - Optional slot that holds hint text for the input.\n * @slot error - Optional slot that holds error text for the input.\n *\n * @cssprop [--n-label-color=var(--n-color-text)] - Controls the text color of the label, using our [color tokens](/tokens/#color).\n */\n@customElement('nord-radio')\nexport default class Radio extends SizeMixin(FormAssociatedMixin(InputMixin(FocusableMixin(LitElement)))) {\n static styles = [componentStyle, formFieldStyle, style]\n\n protected override inputId = createId('input')\n protected override hintId = createId('hint')\n protected override errorId = createId('error')\n\n /**\n * For accessibility reasons, we render some parts of the component to the light DOM.\n */\n protected override hintSlot = new LightSlotController(this, {\n slotName: 'hint',\n render: () => (this.hint ? html`<div slot=\"hint-internal\" id=${this.hintId}>${this.hint}</div>` : nothing),\n syncLightDom: (element) => {\n element.id = this.hintId\n },\n })\n\n protected override labelSlot = new LightSlotController(this, {\n slotName: 'label',\n render: () => (this.label ? html`<label slot=\"label-internal\" for=${this.inputId}>${this.label}</label>` : nothing),\n syncLightDom: (element) => {\n if (!isLabel(element)) {\n console.warn(`NORD: Only <label> elements should be placed in radio's \"label\" slot`)\n }\n else {\n element.htmlFor = this.inputId\n }\n },\n })\n\n protected override errorSlot = new LightSlotController(this, {\n slotName: 'error',\n render: () => (this.error ? html`<div slot=\"error-internal\" id=${this.errorId}>${this.error}</div>` : nothing),\n syncLightDom: (element) => {\n element.id = this.hintId\n },\n })\n\n protected inputSlot = new LightDomController(this, {\n render: () => html`\n <input\n slot=\"input\"\n @blur=${this.handleBlur}\n @focus=${this.handleFocus}\n ${ref(this.focusableRef)}\n class=\"n-input\"\n id=${this.inputId}\n type=\"radio\"\n name=${cond(this.name)}\n .value=${cond(this.value)}\n .checked=${this.checked}\n ?disabled=${this.disabled}\n ?required=${this.required}\n aria-describedby=${cond(this.getDescribedBy())}\n aria-invalid=${cond(this.getInvalid())}\n form=${cond(this._formId)}\n />\n `,\n })\n\n protected override get formValue() {\n // opt out of formdata event, since radio button is in light dom\n return undefined\n }\n\n /**\n * Controls whether the checkbox is checked or not.\n */\n @property({ type: Boolean, reflect: true }) checked: boolean = false\n\n render() {\n const hint = html`\n <div class=\"n-caption n-hint\" ?hidden=${!this.hasHint}>\n <slot name=\"hint\"></slot>\n <slot name=\"hint-internal\"></slot>\n </div>\n `\n const error = html`\n <div class=\"n-caption n-error\" role=\"alert\" ?hidden=${!this.hasError}>\n <slot name=\"error\"></slot>\n <slot name=\"error-internal\"></slot>\n </div>\n `\n\n return html`\n <div class=\"n-flex\">\n <div class=\"n-input-container\" @change=${this.handleChange}>\n <slot name=\"input\"></slot>\n ${this.checked ? html`<div class=\"n-dot\"></div>` : nothing}\n </div>\n <div class=\"n-expand\">\n <div class=\"n-label-container\">\n ${wrapIf(\n this.hideLabel,\n () => html`\n <slot name=\"label\"></slot>\n <slot name=\"label-internal\"></slot>\n `,\n content => html`<nord-visually-hidden>${content}</nord-visually-hidden>`,\n )}\n ${this.isHintBelow ? nothing : hint}\n </div>\n ${this.isHintBelow ? nothing : error}\n </div>\n </div>\n ${this.isHintBelow ? error : nothing}\n ${this.isHintBelow ? hint : nothing}\n `\n }\n\n @observe('checked')\n protected handleCheckedChange(previousChecked: boolean) {\n // if this component was previous unchecked but is now checked,\n // then we need to uncheck any radios in the same group\n if (!previousChecked && this.checked) {\n this.uncheckSiblings()\n }\n }\n\n private uncheckSiblings() {\n const root = this.getRootNode() as Document | ShadowRoot\n\n root.querySelectorAll<Radio>(`nord-radio[name=\"${this.name}\"]`).forEach((radio) => {\n if (radio !== this && radio.checked) {\n radio.checked = false\n forceReflow(radio)\n }\n })\n }\n\n protected handleChange(e: Event): void {\n e.stopPropagation()\n const target = e.target as HTMLInputElement\n\n this.checked = target.checked\n super.handleChange(e)\n }\n\n private handleBlur = (e: Event) => {\n e.stopPropagation()\n this.dispatchEvent(new Event('blur', { bubbles: false, cancelable: true }))\n }\n\n private handleFocus = (e: Event) => {\n e.stopPropagation()\n this.dispatchEvent(new Event('focus', { bubbles: false, cancelable: true }))\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-radio': Radio\n }\n}\n","// some clever typing so that TS knows what happens if you pass true/false values\nexport function wrapIf<TInner, TWrapper>(\n condition: false,\n inner: () => TInner,\n wrapper: (inner: TInner) => TWrapper,\n): TInner\nexport function wrapIf<TInner, TWrapper>(\n condition: true,\n inner: () => TInner,\n wrapper: (inner: TInner) => TWrapper,\n): TWrapper\nexport function wrapIf<TInner, TWrapper>(\n condition: unknown,\n inner: () => TInner,\n wrapper: (inner: TInner) => TWrapper,\n): TInner | TWrapper\n\n/**\n * @returns if condition is truthy, return result of wrapper, passing result of inner as arg. if falsy, return result of inner\n */\nexport function wrapIf<TInner, TWrapper>(condition: any, inner: () => TInner, wrapper: (innards: TInner) => TWrapper) {\n return condition ? wrapper(inner()) : inner()\n}\n","import { html, LitElement, nothing } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { classMap } from 'lit/directives/class-map.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { ref } from 'lit/directives/ref.js'\nimport { DirectionController } from '../common/controllers/DirectionController.js'\n\nimport { NordEvent } from '../common/events.js'\nimport { AutocompleteMixin } from '../common/mixins/AutocompleteMixin.js'\nimport { FocusableMixin } from '../common/mixins/FocusableMixin.js'\nimport { FormAssociatedMixin } from '../common/mixins/FormAssociatedMixin.js'\nimport { InputMixin } from '../common/mixins/InputMixin.js'\nimport { ReadonlyMixin } from '../common/mixins/ReadonlyMixin.js'\n\nimport componentStyle from '../common/styles/Component.css'\nimport formFieldStyle from '../common/styles/FormField.css'\nimport textFieldStyle from '../common/styles/TextField.css'\nimport style from './Range.css'\n\n/**\n * Range input lets user specify a numeric value using a slider which\n * must be no less than a given value, and no more than another given value.\n *\n * @status ready\n * @category form\n * @slot label - Use when a label requires more than plain text.\n * @slot hint - Optional slot that holds hint text for the input.\n * @slot error - Optional slot that holds error text for the input.\n *\n * @cssprop [--n-range-thumb-size=20px] - Controls the size of the thumb.\n * @cssprop [--n-range-track-color-active=var(--n-color-accent)] - Controls the color of the portion of the track that represents the current value.\n * @cssprop [--n-range-track-color-inactive=var(--n-color-border-strong)] - Controls the color of the portion of the track that represents the remaining value.\n * @cssprop [--n-range-track-size=3px] - Controls the height of the track.\n */\n@customElement('nord-range')\nexport default class Range extends FormAssociatedMixin(\n AutocompleteMixin(ReadonlyMixin(InputMixin(FocusableMixin(LitElement)))),\n) {\n static styles = [componentStyle, formFieldStyle, textFieldStyle, style]\n\n private direction = new DirectionController(this)\n\n /**\n * Minimum value for the range slider.\n */\n @property({ reflect: true, type: Number }) min: number = 0\n\n /**\n * Maximum value for the range slider.\n */\n @property({ reflect: true, type: Number }) max: number = 10\n\n /**\n * Step amount for the range slider.\n */\n @property({ reflect: true, type: Number }) step: number = 1\n\n /**\n * Controls whether the input expands to fill the width of its container.\n */\n @property({ reflect: true, type: Boolean }) expand = false\n\n render() {\n const value = Number(this.value) || 0\n const percent = Math.max(0, (value - this.min) / (this.max - this.min))\n\n return html`\n <div class=\"n-input-container\">\n ${this.renderLabel(html`<span class=\"n-range-output\" aria-hidden=\"true\">${value}</span>`)}\n\n <input\n ${ref(this.focusableRef)}\n id=${this.inputId}\n type=\"range\"\n class=${classMap({\n 'n-range': true,\n 'is-rtl': this.direction.isRTL,\n })}\n name=${ifDefined(this.name)}\n min=${this.min}\n step=${this.step}\n max=${this.max}\n style=${`--_n-range-progress: ${percent * 100}%`}\n ?disabled=${this.disabled}\n ?required=${this.required}\n ?readonly=${this.readonly}\n .value=${this.value ? this.value : '0'}\n @input=${this.handleInput}\n @change=${this.handleChange}\n aria-describedby=${ifDefined(this.getDescribedBy())}\n aria-invalid=${ifDefined(this.getInvalid())}\n />\n </div>\n\n ${this.renderError()}\n ${this.isHintBelow ? this.renderHint() : nothing}\n `\n }\n\n protected handleInput(e: Event) {\n e.stopPropagation()\n const target = e.target as HTMLInputElement\n\n if (this.readonly) {\n e.preventDefault()\n target.value = this.value\n return\n }\n\n this.value = target.value\n\n /**\n * Fired as the user types into the input.\n */\n this.dispatchEvent(new NordEvent('input'))\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-range': Range\n }\n}\n","import { html, LitElement, nothing } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { ref } from 'lit/directives/ref.js'\nimport { LightDomController } from '../common/controllers/LightDomController.js'\nimport { LightSlotController } from '../common/controllers/LightSlotController.js'\nimport { observe } from '../common/decorators/observe.js'\nimport { cond } from '../common/directives/cond.js'\nimport { NordEvent } from '../common/events.js'\n\nimport { FocusableMixin } from '../common/mixins/FocusableMixin.js'\nimport { InputMixin } from '../common/mixins/InputMixin.js'\n\nimport componentStyle from '../common/styles/Component.css'\nimport style from './SegmentedControlItem.css'\n\nlet id = 0\nconst createId = (suffix: string) => `nord-segmented-control-item-${suffix}-${id++}`\n\nfunction isLabel(element: Element): element is HTMLLabelElement {\n return element.localName === 'label'\n}\n\ntype NativeInputElement = HTMLSelectElement | HTMLInputElement | HTMLTextAreaElement\n\n/**\n * Segmented control items populate a segmented control with options.\n * Every item should be placed inside a segmented control.\n *\n * @status new\n * @category action\n * @slot label - Use when a label requires more than plain text.\n *\n * @cssprop [--n-segmented-control-item-border-radius=var(--n-border-radius-s)] - Controls the rounded corners of the item, using [border radius tokens](/tokens/#border-radius).\n * @cssprop [--n-segmented-control-item-gap=var(--n-space-xs)] - Controls the spacing between elements within the item, using our [spacing tokens](/tokens/#space).\n * @cssprop [--n-segmented-control-item-gradient=linear-gradient(to bottom, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.013) 100%))] - Controls the overlayed gradient background on the item.\n * @cssprop [--n-segmented-control-item-background-color=var(--n-color-nav-hover)] - Controls the background color of the item, using our [color tokens](/tokens/#color).\n * @cssprop [--n-segmented-control-item-color=var(--n-color-text-weaker)] - Controls the color of the text within the item, using our [color tokens](/tokens/#color).\n * @cssprop [--n-segmented-control-item-padding-inline=calc(var(--n-space-m) / 1.2)] - Controls the inline, or left and right, padding of the item.\n * @cssprop [--n-segmented-control-item-box-shadow=none] - Controls the surrounding shadow, using our [box shadow tokens](/tokens/#box-shadow).\n * @cssprop [--n-segmented-control-item-font-size=var(--n-font-size-m)] - Controls the size of the text within the item, using our [font tokens](/tokens/#font).\n * @cssprop [--n-segmented-control-item-font-weight=var(--n-font-weight)] - Controls the weight of the text within the item, using our [font tokens](/tokens/#font).\n * @cssprop [--n-segmented-control-item-min-block-size=calc(var(--n-space-xl) - 2px)] - Controls the minimum block size, or height, of the item using our [spacing tokens](/tokens/#space).\n * @cssprop [--n-segmented-control-item-inline-size=auto] - Controls the inline size of the item.\n */\n@customElement('nord-segmented-control-item')\nexport default class SegmentedControlItem extends InputMixin(FocusableMixin(LitElement)) {\n static styles = [componentStyle, style]\n\n protected inputId = createId('input')\n\n /**\n * For accessibility reasons, we render the form parts of the component to the light DOM.\n */\n protected inputSlot = new LightDomController(this, {\n render: () => html`\n <input\n slot=\"input\"\n @blur=${this.handleBlur}\n @focus=${this.handleFocus}\n ${ref(this.focusableRef)}\n id=${this.inputId}\n type=\"radio\"\n class=\"n-input\"\n name=${cond(this.name)}\n .value=${cond(this.value)}\n .checked=${this.checked}\n ?disabled=${this.disabled}\n form=${cond(this._formId)}\n />\n `,\n })\n\n protected labelSlot = new LightSlotController(this, {\n slotName: 'label',\n render: () =>\n this.label\n ? html`<label slot=\"label-internal\" for=${this.inputId} class=\"n-segmented-control-item\">${this.label}</label>`\n : nothing,\n syncLightDom: (element) => {\n if (!isLabel(element)) {\n console.warn(`NORD: Only <label> elements should be placed in Segmented Control's \"label\" slot`)\n }\n else {\n element.htmlFor = this.inputId\n }\n },\n })\n\n /**\n * Controls whether the segmented control item is checked or not.\n */\n @property({ type: Boolean, reflect: true }) checked: boolean = false\n\n /**\n * The size of the segmented control item.\n * This affects font-size and padding.\n */\n @property({ reflect: true }) size: 's' | 'm' | 'l' = 'm'\n\n /**\n * Label for the segmented control item.\n */\n @property({ reflect: true }) label: string = ''\n\n render() {\n return html`<div class=\"n-segmented-control-item\" @change=${this.handleChange}>\n <slot name=\"input\"></slot>\n <slot name=\"label\"></slot>\n <slot name=\"label-internal\"></slot>\n </div>`\n }\n\n @observe('checked')\n protected handleCheckedChange(previousChecked: boolean) {\n // if this component was previous unchecked but is now checked,\n // then we need to uncheck any items in the same group\n if (!previousChecked && this.checked) {\n this.uncheckSiblings()\n }\n }\n\n private uncheckSiblings() {\n const root = this.getRootNode() as Document | ShadowRoot\n\n root\n .querySelectorAll<SegmentedControlItem>(`nord-segmented-control-item[name=\"${this.name}\"]`)\n .forEach((segmentedControlItem) => {\n if (segmentedControlItem !== this) {\n segmentedControlItem.checked = false\n }\n })\n }\n\n protected handleChange(e: Event): void {\n const target = e.target as HTMLInputElement\n this.checked = target.checked\n\n e.stopPropagation()\n\n /**\n * Fired whenever the segmented control item has been checked.\n */\n this.dispatchEvent(new NordEvent('change'))\n }\n\n private handleBlur = (e: Event) => {\n e.stopPropagation()\n this.dispatchEvent(new Event('blur', { bubbles: false, cancelable: true }))\n }\n\n private handleFocus = (e: Event) => {\n e.stopPropagation()\n this.dispatchEvent(new Event('focus', { bubbles: false, cancelable: true }))\n }\n\n protected handleInput(e: Event) {\n e.stopPropagation()\n const target = e.target as NativeInputElement\n this.value = target.value\n\n /**\n * Fired as the user types into the input.\n */\n this.dispatchEvent(new NordEvent('input'))\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-segmented-control-item': SegmentedControlItem\n }\n}\n","import { html, LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { classMap } from 'lit/directives/class-map.js'\nimport { SlotController } from '../common/controllers/SlotController.js'\n\nimport componentStyle from '../common/styles/Component.css'\nimport style from './SegmentedControl.css'\n\n/**\n * Segmented control is used to pick one choice from a set of\n * closely related choices, and immediately apply that selection.\n *\n * @status new\n * @category action\n * @slot - Default slot.\n *\n * @fires {NordEvent} change - Fired whenever a segmented control item has been checked.\n */\n@customElement('nord-segmented-control')\nexport default class SegmentedControl extends LitElement {\n static styles = [componentStyle, style]\n\n private defaultSlot = new SlotController(this)\n\n /**\n * Controls whether the segmented control expands to fill the width of its container.\n */\n @property({ reflect: true, type: Boolean }) expand = false\n\n render() {\n const isDisabled = this.defaultSlot.assigned.every((node) => {\n if (node.hasAttribute('disabled')) {\n return true\n }\n return false\n })\n\n return html`<div\n class=${classMap({\n 'n-segmented-control': true,\n 'n-disabled': isDisabled,\n })}\n >\n <slot></slot>\n </div>`\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-segmented-control': SegmentedControl\n }\n}\n","export default '<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m14.0864 12.0402 1.8138 1.8137-4.7724 4.7724c-.2573.2573-.5789.373-.9133.373-.33447 0-.65606-.1286-.91333-.373l-4.77238-4.7724 1.81377-1.8137 3.85904 3.859 3.8591-3.859zm-3.859-7.93687 3.859 3.85907 1.8138-1.81376-4.7724-4.77238c-.5017-.50168-1.31208-.50168-1.81376 0l-4.77238 4.77238 1.81376 1.81376 3.85908-3.85907z\" fill=\"currentColor\"/></svg>';\nexport const title = \"interface-dropdown-small\";\nexport const tags =\n \"nordicon small interface dropdown select arrow up down caret triangle chevron\";\n","import * as dropdownIcon from '@nordhealth/icons/lib/assets/interface-dropdown-small.js'\nimport { html, isServer, LitElement, nothing } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { ref } from 'lit/directives/ref.js'\n\nimport { SlotController } from '../common/controllers/SlotController.js'\nimport { AutocompleteMixin } from '../common/mixins/AutocompleteMixin.js'\n\nimport { FocusableMixin } from '../common/mixins/FocusableMixin.js'\nimport { FormAssociatedMixin } from '../common/mixins/FormAssociatedMixin.js'\nimport { InputMixin } from '../common/mixins/InputMixin.js'\nimport { SizeMixin } from '../common/mixins/SizeMixin.js'\nimport componentStyle from '../common/styles/Component.css'\n\nimport formFieldStyle from '../common/styles/FormField.css'\nimport Icon from '../icon/Icon.js'\nimport style from './Select.css'\nimport '../button/Button.js'\n\nIcon.registerIcon(dropdownIcon)\n\n/**\n * Select lets users choose one option from an options menu.\n * Consider using select when you have 5 or more options to choose from.\n *\n * @status ready\n * @category form\n * @slot - Default slot for holding <option> elements.\n * @slot label - Use when a label requires more than plain text.\n * @slot hint - Use when a hint requires more than plain text.\n * @slot error - Optional slot that holds error text for the input.\n * @slot icon - Used to place an icon at the start of select.\n *\n * @cssprop [--n-select-block-size=var(--n-space-xl)] - Controls the block size, or height, of the select using our [spacing tokens](/tokens/#space).\n * @cssprop [--n-select-inline-size=fit-content] - Controls the inline size, or width, of the select.\n * @cssprop [--n-label-color=var(--n-color-text)] - Controls the text color of the label, using our [color tokens](/tokens/#color).\n */\n@customElement('nord-select')\nexport default class Select extends SizeMixin(\n FormAssociatedMixin(AutocompleteMixin(InputMixin(FocusableMixin(LitElement)))),\n) {\n static styles = [componentStyle, formFieldStyle, style]\n\n protected override get formValue() {\n return this.value || undefined\n }\n\n private defaultSlot = new SlotController(this)\n private optionObserver?: MutationObserver\n\n protected inputId = 'select'\n\n firstUpdated() {\n this.setupOptionObserver()\n }\n\n connectedCallback() {\n super.connectedCallback()\n // Re-setup observer after reconnection (firstUpdated only runs once per instance)\n if (this.hasUpdated && !this.optionObserver) {\n this.setupOptionObserver()\n }\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n // Clean up observer to prevent memory leaks\n this.optionObserver?.disconnect()\n this.optionObserver = undefined\n }\n\n private setupOptionObserver() {\n // Avoid creating multiple observers\n if (this.optionObserver) {\n return\n }\n\n // Set up observer to watch for changes to slotted option content\n this.optionObserver = new MutationObserver(() => this.requestUpdate())\n this.optionObserver.observe(this, {\n subtree: true,\n childList: true,\n characterData: true,\n })\n }\n\n /**\n * Controls whether the select expands to fill the width of its container.\n */\n @property({ reflect: true, type: Boolean }) expand = false\n\n render() {\n const slottedOptions = this.options\n const buttonText = this.getButtonText(slottedOptions)\n\n return html`\n <slot></slot>\n ${this.renderLabel()}\n\n <div class=\"n-select-container\">\n <select\n ${ref(this.focusableRef)}\n id=${this.inputId}\n ?disabled=${this.disabled}\n ?required=${this.required}\n name=${ifDefined(this.name)}\n @change=${this.handleChange}\n @input=${this.handleInput}\n aria-describedby=${ifDefined(this.getDescribedBy())}\n aria-invalid=${ifDefined(this.getInvalid())}\n autocomplete=${this.autocomplete as any}\n >\n ${this.placeholder && html`<option value=\"\" disabled ?selected=${!this.value}>${this.placeholder}</option>`}\n ${slottedOptions.map(option => this.renderOption(option))}\n </select>\n\n <nord-button size=${this.size} ?disabled=${this.disabled} ?expand=${this.expand} type=\"button\" inert>\n <slot slot=\"start\" name=\"icon\"></slot>\n ${buttonText}\n <nord-icon slot=\"end\" name=\"interface-dropdown-small\"></nord-icon>\n </nord-button>\n </div>\n\n ${this.renderError()}\n ${this.isHintBelow ? this.renderHint() : nothing}\n `\n }\n\n private get options() {\n if (isServer) {\n return []\n }\n\n return Array.from(this.querySelectorAll('option'))\n }\n\n private getButtonText(options: HTMLOptionElement[]): string {\n const selected = options.find(option => option.value === this.value.toString())\n\n if (selected) {\n return selected.text\n }\n\n if (this.placeholder) {\n return this.placeholder\n }\n\n if (options[0]) {\n return options[0].text\n }\n\n return ''\n }\n\n private renderOption(option: HTMLOptionElement) {\n return html`\n <option\n value=${ifDefined(option.value)}\n ?disabled=${option.disabled}\n .selected=${option.value === this.value.toString()}\n >\n ${option.text}\n </option>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-select': Select\n }\n}\n","import { html, LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport componentStyle from '../common/styles/Component.css'\nimport style from './Skeleton.css'\n\n/**\n * Skeletons are used to provide a low fidelity representation of content\n * before it appears in a view. This improves the perceived loading time\n * for our users.\n *\n * @status ready\n * @category feedback\n *\n * @cssprop [--n-skeleton-border-radius=var(--n-border-radius)] - Controls how rounded the corners are, using [border radius tokens](/tokens/#border-radius).\n * @cssprop [--n-skeleton-color=var(--n-color-border)] - Controls the main color of the skeleton, using our [color tokens](/tokens/#color).\n * @cssprop [--n-skeleton-sheen-color=var(--n-color-border-strong)] - Controls the sheen color of the skeleton, using our [color tokens](/tokens/#color).\n */\n@customElement('nord-skeleton')\nexport default class Skeleton extends LitElement {\n static styles = [componentStyle, style]\n\n /**\n * Determines which animation effect the skeleton will use.\n * The default is no animation.\n */\n @property({ reflect: true }) effect?: 'pulse' | 'sheen'\n\n render() {\n return html`\n <div class=\"n-skeleton\" aria-hidden=\"true\">\n <div class=\"n-skeleton-indicator\"></div>\n </div>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-skeleton': Skeleton\n }\n}\n","import { html, LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { SlotController } from '../common/controllers/SlotController.js'\nimport { observe } from '../common/decorators/observe.js'\n\nimport componentStyle from '../common/styles/Component.css'\nimport style from './Tab.css'\n\n/**\n * The interactive tab button for use within the tab group component.\n *\n * @status ready\n * @category navigation\n * @slot - The tab button content.\n *\n * @cssprop [--n-tab-color=var(--n-color-text-weak)] - Controls the text color of the tab, using our [color tokens](/tokens/#color).\n * @cssprop [--n-tab-font-weight=var(--n-font-weight)] - Controls the font weight of the tab, using our [font tokens](/tokens/#font).\n */\n@customElement('nord-tab')\nexport default class Tab extends LitElement {\n static styles = [componentStyle, style]\n\n private defaultSlot = new SlotController(this)\n\n /**\n * Whether the tab item is selected\n */\n @property({ reflect: true, type: Boolean }) selected: boolean = false\n\n render() {\n return html`<div class=\"n-tab\" data-text=\"${this.defaultSlot.isEmpty ? this.textContent : ''}\">\n <slot></slot>\n </div>`\n }\n\n /**\n * Apply accessible attributes and values to the tab button.\n * Observe the selected property if it changes\n */\n @observe('selected')\n protected handleSelectionChange() {\n this.setAttribute('aria-selected', `${this.selected}`)\n this.setAttribute('tabindex', this.selected ? '0' : '-1')\n }\n\n connectedCallback() {\n super.connectedCallback()\n this.setAttribute('role', 'tab')\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-tab': Tab\n }\n}\n","import { html, isServer, LitElement } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\n\nimport { DirectionController } from '../common/controllers/DirectionController.js'\nimport componentStyle from '../common/styles/Component.css'\nimport stickyStyle from '../common/styles/Sticky.css'\nimport Tab from '../tab/Tab.js'\n\nimport style from './TabGroup.css'\n\nlet tabGroupCount = 1\n\n/**\n * Tab Group allows multiple panels to be contained within a single window,\n * using tabs as a navigational element.\n *\n * @status ready\n * @category navigation\n * @slot - The element which contains the content to be revealed.\n * @slot tab - The element which contains all tabs to reveal tabbed content.\n *\n * @cssprop [--n-tab-group-padding=0] - Controls the padding around the tab group (including the tab list), using our [spacing tokens](/tokens/#space).\n */\n@customElement('nord-tab-group')\nexport default class TabGroup extends LitElement {\n static styles = [componentStyle, stickyStyle, style]\n\n private direction = new DirectionController(this)\n\n private observer?: MutationObserver\n\n private static observerOptions = {\n attributes: true,\n subtree: true,\n attributeFilter: ['selected'],\n attributeOldValue: true,\n }\n\n /**\n * Unique ID for each tab group component present.\n */\n private tabGroupId = `nord-tab-group-${tabGroupCount++}`\n\n /**\n * Adds an accessible label to the tab list container.\n */\n @property({ reflect: true }) label: string = ''\n\n /**\n * Controls the padding of the tab group component.\n */\n @property({ reflect: true }) padding?: 'm' | 'l' | 'none' = 'm'\n\n /**\n * Whether the tab list sticks to the top of the tab group as you scroll.\n */\n @property({ reflect: true, type: Boolean }) sticky: boolean = false\n\n /**\n * The current tab node selected in the tab group.\n */\n @state() private selectedTab = this.initialSelectedTab\n\n render() {\n return html`\n <div class=\"n-tab-group is-${this.direction.dir}\">\n <div\n class=\"n-tab-group-list n-sticky\"\n role=\"tablist\"\n aria-label=\"${this.label}\"\n @click=${this.handleTabChange}\n @keydown=${this.handleKeydown}\n >\n <slot name=\"tab\"></slot>\n </div>\n <slot></slot>\n </div>\n `\n }\n\n connectedCallback() {\n super.connectedCallback()\n this.updateSlots()\n // Re-setup observer after reconnection (firstUpdated only runs once per instance)\n if (this.hasUpdated && !this.observer) {\n this.setupObserver()\n }\n }\n\n firstUpdated() {\n this.setupObserver()\n }\n\n private updateSlots() {\n this.setupTabs()\n this.setupPanels()\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n // Clean up observer to prevent memory leaks\n this.observer?.disconnect()\n this.observer = undefined\n }\n\n private setupObserver() {\n // Avoid creating multiple observers\n if (this.observer) {\n return\n }\n\n this.observer = new MutationObserver(this.handleMutation)\n this.observer.observe(this, TabGroup.observerOptions)\n }\n\n /**\n * If the selected tab is selected programmatically update all the tabs.\n */\n private handleMutation = (mutations: MutationRecord[]) => {\n mutations.forEach((mutation) => {\n if (mutation.attributeName === 'selected' && mutation.oldValue === null) {\n const selectedTab = <Tab>mutation.target\n this.observer?.disconnect()\n this.updateSelectedTab(selectedTab)\n this.observer?.observe(this, TabGroup.observerOptions)\n }\n })\n }\n\n /**\n * Get the selected tab button, or the first tab button.\n */\n private get initialSelectedTab() {\n if (isServer) {\n return null\n }\n\n return this.querySelector('nord-tab[selected]') || this.querySelector('nord-tab')\n }\n\n /**\n * Apply accessible attributes and values to the tab buttons.\n */\n private setupTabs() {\n const tabs = this.querySelectorAll('nord-tab')\n\n tabs.forEach((tab, index) => {\n tab.setAttribute('id', `${this.tabGroupId}-tab-${index + 1}`)\n tab.setAttribute('aria-controls', `${this.tabGroupId}-panel-${index + 1}`)\n tab.toggleAttribute('selected', tab === this.selectedTab)\n })\n }\n\n /**\n * Apply accessible attributes and values to the tab panels.\n */\n private setupPanels() {\n const panels = this.querySelectorAll('nord-tab-panel')\n const selectedPanelId = this.selectedTab?.getAttribute('aria-controls')\n\n panels.forEach((panel, index) => {\n panel.setAttribute('id', `${this.tabGroupId}-panel-${index + 1}`)\n panel.setAttribute('aria-labelledby', `${this.tabGroupId}-tab-${index + 1}`)\n panel.setAttribute('aria-hidden', `${panel.getAttribute('id') !== selectedPanelId}`)\n })\n }\n\n private handleTabChange(event: Event) {\n // Always reset the scroll when a tab is selected.\n this.scrollTo({ top: 0 })\n\n /**\n * Return handler if it's not a tab or if it's already selected\n */\n if (!(event.target instanceof Tab) || event.target === this.selectedTab)\n return\n\n this.updateSelectedTab(event.target)\n }\n\n /**\n * Get the previous tab button in the tab group\n */\n private previousTab(tab: Tab) {\n const tabs = [...this.querySelectorAll('nord-tab')]\n const selectedTabIndex = tabs.indexOf(tab)\n return tabs[selectedTabIndex - 1]\n }\n\n /**\n * Handle keyboard accessible controls.\n */\n private handleKeydown(event: KeyboardEvent) {\n const tab = <Tab>event.target\n\n const firstTab = <Tab> this.querySelector('nord-tab:first-of-type')\n const lastTab = <Tab> this.querySelector('nord-tab:last-of-type')\n const nextTab = <Tab> this.querySelector(`#${tab.getAttribute('id')} ~ nord-tab`) || firstTab\n const previousTab = <Tab> this.previousTab(tab) || lastTab\n\n const updateTab = (selectedTab: Tab, keyEvent: Event) => {\n keyEvent.preventDefault()\n\n // Always reset the scroll when a tab is selected.\n this.scrollTo({ top: 0 })\n this.updateSelectedTab(selectedTab)\n }\n\n switch (event.key) {\n case 'ArrowLeft':\n case 'ArrowUp':\n updateTab(this.direction.isLTR ? previousTab : nextTab, event)\n break\n\n case 'ArrowRight':\n case 'ArrowDown':\n updateTab(this.direction.isLTR ? nextTab : previousTab, event)\n break\n\n case 'Home':\n updateTab(firstTab, event)\n break\n\n case 'End':\n updateTab(lastTab, event)\n break\n\n default:\n break\n }\n }\n\n /**\n * Update the selected tab button with attributes and values.\n * Update the tab group state.\n */\n private updateSelectedTab(selectedTab: Tab) {\n const selectedPanel = this.querySelector(`#${selectedTab.getAttribute('aria-controls')}`)\n\n if (selectedTab === this.selectedTab)\n return\n\n /**\n * Reset all the selected state of the tabs, and select the clicked tab\n */\n this.querySelectorAll('nord-tab').forEach((tab) => {\n tab.removeAttribute('selected')\n if (tab === selectedTab) {\n tab.setAttribute('selected', '')\n tab.focus()\n tab.scrollIntoView({ block: 'nearest', inline: 'nearest' })\n this.selectedTab = tab\n }\n })\n\n /**\n * Reset all the visibility of the panels,\n * and show the panel related to the selected tab\n */\n this.querySelectorAll('nord-tab-panel').forEach((panel) => {\n panel.setAttribute('aria-hidden', `${panel !== selectedPanel}`)\n })\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-tab-group': TabGroup\n }\n}\n","import { html, LitElement } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\nimport componentStyle from '../common/styles/Component.css'\nimport style from './TabPanel.css'\n\n/**\n * The panel which contains content that can be revealed using a tab\n * in the tab group component.\n *\n * @status ready\n * @category navigation\n * @slot - The tab panel content.\n */\n@customElement('nord-tab-panel')\nexport default class TabPanel extends LitElement {\n static styles = [componentStyle, style]\n\n render() {\n return html`<div class=\"n-tab-panel\"><slot></slot></div>`\n }\n\n connectedCallback() {\n super.connectedCallback()\n\n /**\n * Apply accessible attributes and values to the tab panel.\n */\n this.setAttribute('role', 'tabpanel')\n this.setAttribute('tabindex', '0')\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-tab-panel': TabPanel\n }\n}\n","import { html, LitElement, render } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport style from './Table.css'\n\nfunction isDocument(node: Node): node is Document {\n return node.nodeType === Node.DOCUMENT_NODE\n}\n\n/**\n * Table is used to organize and display information from a data set.\n * Provides table styles in addition to features like sticky\n * headers and support for narrow viewports.\n *\n * @status ready\n * @category list\n * @slot - Default slot which holds the HTML `<table>` element.\n *\n * @cssprop [--n-table-td-padding=calc(var(--n-space-m) * 0.95)] - Controls the padding around the table cells.\n * @cssprop [--n-table-border-radius=var(--n-border-radius-s)] - Controls how rounded the corners are, using [border radius tokens](/tokens/#border-radius).\n *\n * @usage https://stackblitz.com/github/nordhealth/advanced-table-examples/tree/main/nord-react-tanstack-table?embed=1&file=src/DataTable/DataTable.tsx&hideNavigation=1&view=preview - with react and tanstack table\n * @usage https://stackblitz.com/github/nordhealth/advanced-table-examples/tree/main/nord-react-ag-grid?embed=1&file=src/DataTable/DataTable.tsx&hideNavigation=1&view=preview - with react and ag grid\n * @usage https://stackblitz.com/github/nordhealth/advanced-table-examples/tree/main/nord-vue-tanstack-table?embed=1&file=src/components/DataTable/DataTable.vue&hideNavigation=1&view=preview - with vue and tanstack table\n * @usage https://stackblitz.com/github/nordhealth/advanced-table-examples/tree/main/nord-vue-ag-grid?embed=1&file=src/components/DataTable/DataTable.vue&hideNavigation=1&view=preview - with vue and ag grid\n */\n@customElement('nord-table')\nexport default class Table extends LitElement {\n /**\n * Controls the density of the table's rows and headers.\n * Relaxed increases space, condensed reduces space.\n */\n @property({ reflect: true }) density: 'condensed' | 'default' | 'relaxed' = 'default'\n\n /**\n * Enables scroll-snapping, meaning the scroll position is always column-aligned.\n */\n @property({ reflect: true, type: Boolean, attribute: 'scroll-snap' }) scrollSnap = false\n\n /**\n * Controls whether to use zebra striping on tables, which can improve readability.\n */\n @property({ type: Boolean, reflect: true }) striped = false\n\n connectedCallback() {\n super.connectedCallback()\n this.renderStyles()\n }\n\n /**\n * renders table styles into nearest root.\n * this is necessary since we do not use shadow dom.\n */\n private renderStyles() {\n const rootNode = this.getRootNode() as Document | ShadowRoot\n const renderTarget = isDocument(rootNode) ? rootNode.head : rootNode\n const tagName = this.localName\n\n const componentStyles = rootNode.querySelector(`style[data-component=${tagName}]`)\n if (componentStyles) {\n return\n }\n\n const fragment = document.createDocumentFragment()\n render(\n html`\n <style data-component=${tagName}>\n ${style}\n </style>\n `,\n fragment,\n )\n renderTarget.appendChild(fragment)\n }\n\n /**\n * opt out of shadow dom\n */\n protected createRenderRoot() {\n return this\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-table': Table\n }\n}\n","import { html, LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { classMap } from 'lit/directives/class-map.js'\nimport { DirectionController } from '../common/controllers/DirectionController.js'\nimport { SlotController } from '../common/controllers/SlotController.js'\n\nimport componentStyle from '../common/styles/Component.css'\nimport style from './TagGroup.css'\n\n/**\n * Tag groups are designed to bring together selectable tags that are of a similar nature. For example categories you can filter by.\n *\n * @status new\n * @category structure\n * @slot - The tag group content\n *\n * @fires {NordEvent} change - Fired whenever a tag has been checked or unchecked via user interaction.\n * @fires {NordEvent} remove - Fired when the remove button is activated on a tag. This event should be used to remove the tag from the DOM.\n *\n * @cssprop [--n-tag-group-border-radius=var(--n-border-radius-s)] - Controls the rounded corners of the tag group, using [border radius tokens](/tokens/#border-radius). Only relevant for the default variant.\n * @cssprop [--n-tag-group-box-shadow=var(--n-box-shadow)] - Controls the surrounding shadow, using [box shadow tokens](/tokens/#box-shadow). Only relevant for the default variant.\n */\n@customElement('nord-tag-group')\nexport default class TagGroup extends LitElement {\n static styles = [componentStyle, style]\n\n private defaultSlot = new SlotController(this)\n private dirController = new DirectionController(this)\n\n /**\n * The style variant of the tag group.\n */\n @property({ reflect: true }) variant: 'default' | 'spaced' = 'default'\n\n /**\n * The direction of the tag group.\n */\n @property({ reflect: true }) direction: 'vertical' | 'horizontal' = 'horizontal'\n\n /**\n * Defines whether the tags are forced in a single line\n * or can be flowed into multiple lines (only applied when variant is set to `spaced`).\n */\n @property({ reflect: true, type: Boolean }) wrap = false\n\n /**\n * The appropriate role for the containing element.\n */\n\n @property({ reflect: true }) role: string = 'group'\n\n render() {\n const hasMultipleTags = this.defaultSlot.assigned.length > 1\n\n return html`<div\n class=${classMap({\n 'n-tag-group': true,\n 'n-rtl': this.dirController.isRTL,\n 'n-multiple-tags': hasMultipleTags,\n })}\n >\n <slot></slot>\n </div>`\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-tag-group': TagGroup\n }\n}\n","import * as checkedIcon from '@nordhealth/icons/lib/assets/interface-checked-small.js'\nimport * as closeIcon from '@nordhealth/icons/lib/assets/interface-close-small.js'\nimport { html, LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { ref } from 'lit/directives/ref.js'\nimport { FormDataController } from '../common/controllers/FormDataController.js'\nimport { NordEvent } from '../common/events.js'\nimport { FocusableMixin } from '../common/mixins/FocusableMixin.js'\nimport { InputMixin } from '../common/mixins/InputMixin.js'\nimport componentStyle from '../common/styles/Component.css'\nimport Icon from '../icon/Icon.js'\n\nimport { LocalizeController } from '../localization/LocalizeController.js'\nimport style from './Tag.css'\n\nIcon.registerIcon(checkedIcon)\nIcon.registerIcon(closeIcon)\n\n/**\n * Tags represent a set of keywords that help label, categorize,\n * and organize objects. Commonly used to signify the attributes of an object.\n *\n * @status new\n * @category text\n * @slot - The tag content.\n *\n * @localization removeLabel - Accessible label for the remove button.\n */\n@customElement('nord-tag')\nexport default class Tag extends InputMixin(FocusableMixin(LitElement)) {\n static styles = [componentStyle, style]\n\n private localize = new LocalizeController<'nord-tag'>(this)\n\n protected formData = new FormDataController(this, { value: () => this.formValue })\n\n protected get formValue() {\n return this.variant === 'selectable' && this.checked ? this.value || 'on' : undefined\n }\n\n protected inputId = 'input'\n\n /**\n * The behavioral variant of the tag.\n */\n @property({ reflect: true }) variant: 'default' | 'removable' | 'selectable' = 'default'\n\n /**\n * Controls whether the tag is checked or not (only relevant when variant is set to `selectable`).\n */\n @property({ reflect: true, type: Boolean }) checked: boolean = false\n\n /**\n * The size of the tag. This affects the font-size.\n */\n @property({ reflect: true }) size: 's' | 'm' = 'm'\n\n /**\n * Controls whether the tag expands to fill the width of its container.\n */\n @property({ reflect: true, type: Boolean }) expand = false\n\n protected handleChange(e: Event) {\n const target = e.target as HTMLInputElement\n this.checked = target.checked\n\n e.stopPropagation()\n\n /**\n * Fired whenever the tag has been checked or unchecked via user interaction.\n */\n this.dispatchEvent(new NordEvent('change'))\n }\n\n protected handleRemove() {\n /**\n * Fired when the remove button is activated. This event should be used to remove the tag from the DOM.\n */\n this.dispatchEvent(new NordEvent('remove'))\n }\n\n render() {\n switch (this.variant) {\n case 'selectable':\n return this.renderSelectableTag()\n case 'removable':\n return this.renderRemovableTag()\n case 'default':\n default:\n return this.renderStaticTag()\n }\n }\n\n private renderStaticTag() {\n return html`\n <div class=\"n-tag\">\n <div class=\"n-content\">\n <slot></slot>\n </div>\n </div>\n `\n }\n\n private renderRemovableTag() {\n return html`\n <div class=\"n-tag\">\n <div class=\"n-content\">\n <slot></slot>\n </div>\n <button class=\"n-remove-button\" @click=${this.handleRemove} ?disabled=${this.disabled}>\n <nord-icon name=\"interface-close-small\" label=${this.localize.term('removeLabel')}></nord-icon>\n </button>\n </div>\n `\n }\n\n private renderSelectableTag() {\n return html`\n <label for=${this.inputId} class=\"n-tag\">\n <div class=\"n-input-container\">\n <input\n ${ref(this.focusableRef)}\n class=\"n-input\"\n id=${this.inputId}\n type=\"checkbox\"\n name=${ifDefined(this.name)}\n .value=${this.value}\n .checked=${this.checked}\n ?disabled=${this.disabled}\n @change=${this.handleChange}\n />\n <nord-icon class=\"icon-checked\" name=\"interface-checked-small\"></nord-icon>\n </div>\n <div class=\"n-content\">\n <slot></slot>\n </div>\n </label>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-tag': Tag\n }\n}\n","import { html, LitElement, nothing } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { ref } from 'lit/directives/ref.js'\nimport { observe } from '../common/decorators/observe.js'\n\nimport { NordEvent } from '../common/events.js'\nimport { AutocompleteMixin } from '../common/mixins/AutocompleteMixin.js'\nimport { FocusableMixin } from '../common/mixins/FocusableMixin.js'\nimport { FormAssociatedMixin } from '../common/mixins/FormAssociatedMixin.js'\nimport { InputMixin } from '../common/mixins/InputMixin.js'\nimport { ReadonlyMixin } from '../common/mixins/ReadonlyMixin.js'\nimport { SizeMixin } from '../common/mixins/SizeMixin.js'\n\nimport { TextSelectableMixin } from '../common/mixins/TextSelectableMixin.js'\nimport componentStyle from '../common/styles/Component.css'\nimport formFieldStyle from '../common/styles/FormField.css'\nimport textFieldStyle from '../common/styles/TextField.css'\nimport { LocalizeController } from '../localization/LocalizeController.js'\nimport style from './Textarea.css'\n\nfunction createLengthMeasurer(locale: string) {\n if (Intl.Segmenter) {\n const segmenter = new Intl.Segmenter(locale)\n return (value: string) => [...segmenter.segment(value)].length\n }\n\n return (value: string) => value.length\n}\n\n/**\n * Textarea is a component that allows user to write text over\n * multiple rows. Used when the expected user input is long.\n * For shorter input, use the Input component.\n *\n * @status ready\n * @category form\n * @slot label - Use when a label requires more than plain text.\n * @slot hint - Optional slot that holds hint text for the textarea.\n * @slot error - Optional slot that holds error text for the textarea.\n *\n * @cssprop [--n-textarea-inline-size=240px] - Controls the inline size, or width, of the textarea.\n * @cssprop [--n-textarea-block-size=76px] - Controls the block size, or height, of the textarea.\n * @cssprop [--n-textarea-background=var(--n-color-active)] - Controls the background of the textarea, using our [color tokens](/tokens/#color).\n * @cssprop [--n-textarea-color=var(--n-color-text)] - Controls the text color of the textarea, using our [color tokens](/tokens/#color).\n * @cssprop [--n-textarea-border-color=var(--n-color-border-strong)] - Controls the border color of the textarea, using our [color tokens](/tokens/#color).\n * @cssprop [--n-textarea-border-radius=var(--n-border-radius-s)] - Controls how rounded the corners are, using [border radius tokens](/tokens/#border-radius).\n * @cssprop [--n-label-color=var(--n-color-text)] - Controls the text color of the label, using our [color tokens](/tokens/#color).\n *\n * @localization remainingCharacters - A function which receives the number of remaining characters and returns a string to be used as the aria-live message.\n */\n@customElement('nord-textarea')\nexport default class Textarea extends SizeMixin(\n FormAssociatedMixin(AutocompleteMixin(ReadonlyMixin(TextSelectableMixin(InputMixin(FocusableMixin(LitElement)))))),\n) {\n static styles = [componentStyle, formFieldStyle, textFieldStyle, style]\n\n protected inputId = 'textarea'\n\n private lengthMeasurer!: (value: string) => number\n private localize = new LocalizeController<'nord-textarea'>(this, {\n onLangChange: () => this.handleLangChange(),\n })\n\n /**\n * Controls whether the textarea is resizable.\n * By default is manually resizable vertically.\n * Set to \"auto\" to enable auto-resizing as content grows.\n */\n @property({ reflect: true }) resize: 'vertical' | 'auto' = 'vertical'\n\n /**\n * Controls whether the textarea expands to fill the width of its container.\n */\n @property({ reflect: true, type: Boolean }) expand = false\n\n /**\n * Controls the max allowed length for the textarea.\n */\n @property({ reflect: true, attribute: 'maxlength', type: Number }) maxLength?: number\n\n /**\n * Controls whether to show a count of the number of characters in the textarea.\n * When combined with `maxlength`, both the count and the max length are shown.\n */\n @property({ reflect: true, type: Boolean, attribute: 'character-counter' }) characterCounter = false\n\n render() {\n return html`\n ${this.renderLabel()}\n\n <div class=\"n-input-container\">\n <textarea\n ${ref(this.textSelectableRef)}\n ${ref(this.focusableRef)}\n id=${this.inputId}\n class=\"n-input\"\n ?disabled=${this.disabled}\n ?readonly=${this.readonly}\n ?required=${this.required}\n name=${ifDefined(this.name)}\n maxlength=${ifDefined(this.maxLength)}\n .value=${this.value ?? ''}\n placeholder=${ifDefined(this.placeholder)}\n @change=${this.handleChange}\n @input=${this.handleInput}\n @select=${this.handleSelect}\n aria-describedby=${ifDefined(this.getDescribedBy())}\n aria-invalid=${ifDefined(this.getInvalid())}\n autocomplete=${this.autocomplete as any}\n ></textarea>\n\n ${this.characterCounter ? this.renderCharacterCounter() : nothing}\n </div>\n\n ${this.renderError()}\n ${this.isHintBelow ? this.renderHint() : nothing}\n `\n }\n\n protected handleSelect(e: Event) {\n e.stopPropagation()\n\n /**\n * Fired when some text has been selected.\n */\n this.dispatchEvent(new NordEvent('select'))\n }\n\n private renderCharacterCounter() {\n const { value, maxLength } = this\n const length = typeof value === 'string' ? this.lengthMeasurer(value) : 0\n\n const remainder = maxLength ? maxLength - length : null\n const counter = maxLength ? `${length}/${maxLength}` : length\n\n return html`\n <nord-visually-hidden aria-live=\"polite\" aria-atomic=\"true\">\n ${remainder != null && remainder <= 10 ? this.localize.term('remainingCharacters', remainder) : ''}\n </nord-visually-hidden>\n <div class=\"n-character-counter\">${counter}</div>\n `\n }\n\n private handleLangChange() {\n const lang = this.localize.resolvedLang\n this.lengthMeasurer = createLengthMeasurer(lang)\n }\n\n @observe('resize', 'updated')\n @observe('value', 'updated')\n protected resizeToFitContent() {\n const textarea = this.focusableRef.value\n\n if (!textarea) {\n return\n }\n\n if (this.resize === 'auto') {\n textarea.style.height = 'auto'\n textarea.style.height = `${textarea.scrollHeight}px`\n }\n else {\n textarea.style.height = ''\n }\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-textarea': Textarea\n }\n}\n","import type Toast from '../toast/Toast.js'\nimport { html, LitElement } from 'lit'\n\nimport { customElement } from 'lit/decorators.js'\nimport componentStyle from '../common/styles/Component.css'\nimport style from './ToastGroup.css'\n\ntype ToastOptions = Partial<Pick<Toast, 'variant' | 'autoDismiss'>>\n\n/**\n * Toast group is used to position and style a group of toasts, whilst ensuring they are announced by screen readers.\n *\n * @status ready\n * @category feedback\n * @slot - Default slot in which to place toasts.\n *\n * @fires {NordEvent} dismiss - Fired when a toast is dismissed (via user action or auto-dismiss), and its exit animation has completed. This event should be used to remove the dismissed toast from the DOM.\n */\n@customElement('nord-toast-group')\nexport default class ToastGroup extends LitElement {\n static styles = [componentStyle, style]\n\n render() {\n return html`\n <div class=\"n-toast-group\" role=\"log\" aria-relevant=\"additions\">\n <slot></slot>\n </div>\n `\n }\n\n /**\n * Convenience method for creating and adding a toast to the group.\n * @param {string} text - The text/message of the toast.\n * @param options - An optional object for configuring the toast's `variant` and `autoDismiss`.\n * @returns {Toast} The toast instance.\n */\n addToast(text: string, options: ToastOptions = {}) {\n const { variant, autoDismiss } = options\n const toast = document.createElement('nord-toast')\n\n if (variant) {\n toast.variant = variant\n }\n\n if (autoDismiss != null) {\n toast.autoDismiss = autoDismiss\n }\n\n toast.textContent = text\n this.appendChild(toast)\n\n return toast\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-toast-group': ToastGroup\n }\n}\n","export default '<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m11.41 10 8.29 8.29-1.41 1.41-8.29-8.29-8.28996 8.3-1.410001-1.41 8.290001-8.3-8.300001-8.28996 1.420001-1.420001 8.28996 8.300001 8.29-8.300001 1.41 1.410001z\" fill=\"currentColor\"/></svg>';\nexport const title = \"interface-close\";\nexport const tags = \"nordicon interface close cross remove delete erase symbol\";\n","import * as closeIcon from '@nordhealth/icons/lib/assets/interface-close.js'\nimport { html, LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { classMap } from 'lit/directives/class-map.js'\nimport { ref } from 'lit/directives/ref.js'\n\nimport { observe } from '../common/decorators/observe.js'\nimport { NotificationMixin } from '../common/mixins/NotificationMixin.js'\nimport componentStyle from '../common/styles/Component.css'\nimport Icon from '../icon/Icon.js'\nimport style from './Toast.css'\n\nIcon.registerIcon(closeIcon)\n\n/**\n * Toasts are non-disruptive messages that appear in the interface\n * to provide quick, at-a-glance feedback on the outcome of an action.\n *\n * @status ready\n * @category feedback\n * @slot - Default slot used for the toast text/message.\n * @fires dismiss - Fired when the toast is dismissed (via user action or auto-dismiss), and its exit animation has completed. This event should be used to remove the dismissed toast from the DOM.\n */\n@customElement('nord-toast')\nexport default class Toast extends NotificationMixin(LitElement) {\n static styles = [componentStyle, style]\n\n private timeoutId?: ReturnType<typeof setTimeout>\n\n /**\n * The style variant of the toast.\n */\n @property({ reflect: true }) variant: 'default' | 'danger' = 'default'\n\n /**\n * Timeout in milliseconds before the toast is automatically dismissed.\n */\n @property({ reflect: true, type: Number, attribute: 'auto-dismiss' }) autoDismiss? = 10000\n\n disconnectedCallback() {\n super.disconnectedCallback()\n clearTimeout(this.timeoutId)\n }\n\n /**\n * Programmatically dismiss the toast.\n * The returned promise resolves when toast's exit animation is complete.\n */\n async dismiss() {\n clearTimeout(this.timeoutId)\n return super.dismiss()\n }\n\n render() {\n return html`\n <div ${ref(this.notificationRef)} class=${classMap({ 'n-toast': true, 'n-dismissed': this.dismissed })}>\n <div class=\"n-toast-inner\">\n <slot></slot>\n </div>\n\n <button class=\"n-dismiss\" @click=${this.dismiss} aria-hidden=\"true\">\n <nord-icon name=\"interface-close\" size=\"s\"></nord-icon>\n </button>\n </div>\n `\n }\n\n @observe('autoDismiss')\n protected handleAutoDismissChange() {\n clearTimeout(this.timeoutId)\n\n if (this.autoDismiss != null && this.autoDismiss >= 0) {\n setTimeout(() => this.dismiss(), this.autoDismiss)\n }\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-toast': Toast\n }\n}\n","/* eslint-disable lit-a11y/role-has-required-aria-attrs */\nimport { html, LitElement, nothing } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { ref } from 'lit/directives/ref.js'\n\nimport { FocusableMixin } from '../common/mixins/FocusableMixin.js'\nimport { FormAssociatedMixin } from '../common/mixins/FormAssociatedMixin.js'\nimport { InputMixin } from '../common/mixins/InputMixin.js'\n\nimport componentStyle from '../common/styles/Component.css'\nimport formFieldStyle from '../common/styles/FormField.css'\nimport style from './Toggle.css'\n\n/**\n * Toggle switch gives control over a feature or option that can be\n * turned on or off. If a physical switch would work for the action, a\n * toggle is probably the best component to use.\n *\n * @status ready\n * @category form\n * @slot label - Use when a label requires more than plain text.\n * @slot hint - Optional slot that holds hint text for the input.\n * @slot error - Optional slot that holds error text for the input.\n *\n * @cssprop [--n-label-color=var(--n-color-text)] - Controls the text color of the label, using our [color tokens](/tokens/#color).\n */\n@customElement('nord-toggle')\nexport default class Toggle extends FormAssociatedMixin(InputMixin(FocusableMixin(LitElement))) {\n static styles = [componentStyle, formFieldStyle, style]\n\n protected override get formValue() {\n return this.checked ? this.value || 'on' : undefined\n }\n\n /**\n * Controls whether the toggle is checked or not.\n */\n @property({ reflect: true, type: Boolean }) checked: boolean = false\n\n /**\n * Controls whether the contents are displayed in reverse order,\n * putting the label before the toggle.\n */\n @property({ reflect: true, type: Boolean }) reverse: boolean = false\n\n /**\n * The size of the toggle switch.\n */\n @property({ reflect: true }) size: 's' | 'm' | 'l' = 'm'\n\n render() {\n const label = html`\n <div class=\"n-expand\">\n ${this.renderLabel()}\n ${this.isHintBelow ? nothing : this.renderError()}\n </div>\n `\n const input = html`<div class=\"n-input-container\">\n <input\n ${ref(this.focusableRef)}\n class=\"n-toggle\"\n id=${this.inputId}\n type=\"checkbox\"\n role=\"switch\"\n name=${ifDefined(this.name)}\n .value=${this.value}\n .checked=${this.checked}\n ?disabled=${this.disabled}\n ?required=${this.required}\n aria-describedby=${ifDefined(this.getDescribedBy())}\n aria-invalid=${ifDefined(this.getInvalid())}\n @change=${this.handleChange}\n />\n </div>`\n\n return html`\n <div class=\"n-flex\">${this.reverse ? [label, input] : [input, label]}</div>\n ${this.isHintBelow ? this.renderError() : nothing}\n ${this.isHintBelow ? this.renderHint() : nothing}\n `\n }\n\n protected handleChange(e: Event): void {\n const target = e.target as HTMLInputElement\n this.checked = target.checked\n super.handleChange(e)\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-toggle': Toggle\n }\n}\n","function getTokens(element: Element, attr: string) {\n const value = element.getAttribute(attr)\n return value ? value.split(/\\s+/) : []\n}\n\nfunction setTokens(element: Element, attr: string, tokens: string[]) {\n element.setAttribute(attr, tokens.join(' '))\n}\n\n/**\n * Carefully adds a token to a space-separated attribute\n * Similar to classList, but for any attribute.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMTokenList/add\n */\nexport function add(element: Element, attr: string, token: string) {\n const tokens = getTokens(element, attr)\n\n if (!tokens.includes(token)) {\n setTokens(element, attr, tokens.concat(token))\n }\n}\n\n/**\n * Carefully removes a token from a space-separated attribute.\n * Similar to classList, but for any attribute.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMTokenList/remove\n */\nexport function remove(element: Element, attr: string, token: string) {\n const tokens = getTokens(element, attr)\n\n if (tokens.includes(token)) {\n setTokens(\n element,\n attr,\n tokens.filter(t => t !== token),\n )\n }\n}\n","import type { States } from '../common/fsm.js'\nimport type { FocusableMixinInterface } from '../common/mixins/FocusableMixin.js'\nimport { computePosition, flip, offset, shift } from '@floating-ui/dom'\n\nimport { html, LitElement } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport * as attr from '../common/attribute.js'\nimport { EventController } from '../common/controllers/EventController.js'\nimport { SlotController } from '../common/controllers/SlotController.js'\nimport { observe } from '../common/decorators/observe.js'\nimport { fsm } from '../common/fsm.js'\nimport { logicalToPhysical } from '../common/positioning.js'\nimport componentStyle from '../common/styles/Component.css'\nimport style from './Tooltip.css'\n\n// @ts-expect-error we're being naughty and accessing a protected field!\n// however this means we always get the correct types,\n// and it will ensure this file is not forgotten about if focusable mixin ever changes\ntype FocusableElement = HTMLElement & Pick<FocusableMixinInterface, 'focusableRef'>\n\nfunction isElement(el: Node): el is Element {\n return el.nodeType === Node.ELEMENT_NODE\n}\n\nfunction referencesTooltip(node: Node, tooltip: Tooltip) {\n return Boolean(tooltip.id) && isElement(node) && node.getAttribute('aria-describedby') === tooltip.id\n}\n\nfunction getFocusable(el?: FocusableElement): HTMLElement | undefined {\n const focusable = el?.focusableRef?.value as HTMLElement | FocusableElement | undefined\n\n if (focusable && 'focusableRef' in focusable) {\n return getFocusable(focusable)\n }\n\n return focusable\n}\n\nconst { transition } = fsm({\n hidden: {\n show: 'waiting',\n },\n visible: {\n hide: 'hidden',\n reposition: 'positioning',\n show: 'positioning',\n },\n waiting: {\n timeout: 'positioning',\n hide: 'hidden',\n },\n positioning: {\n positioned: 'visible',\n hide: 'hidden',\n },\n})\n\ntype TooltipStates = States<typeof transition>\n\n/**\n * Tooltips are floating containers for displaying additional information\n * for the currently focused element. A tooltip can be useful when you want\n * to e.g. give a hint about an existing Command Menu shortcut.\n *\n * @status ready\n * @category overlay\n * @slot - The tooltip content\n * @slot shortcut - Optional slot that holds shortcut keys to access the subject\n * @cssprop [--n-tooltip-max-size=50ch] - Controls the maximum inline size, or width, of the tooltip.\n */\n@customElement('nord-tooltip')\nexport default class Tooltip extends LitElement {\n static styles = [componentStyle, style]\n\n // tracks the last tooltip opened, so we can enforce only one is ever open at a time\n private static lastOpened?: Tooltip\n\n private shortcutSlot = new SlotController(this, 'shortcut')\n private events = new EventController(this)\n\n // The current element which revealed the tooltip shown\n private currentElement?: FocusableElement\n private timeoutId?: ReturnType<typeof setTimeout>\n\n /**\n * the proxy element is for cases where the targetElement is a web component,\n * and the WC has a focusable child in its shadow root e.g. a button component.\n * in this case, when the tooltip is shown, we inject the proxy into targetElement's shadow root\n * and wire up aria-describedby from the focusable element to the proxy.\n * when the tooltip is hidden, we remove the proxy and remove the aria-describedby relationship.\n */\n private proxy?: HTMLSpanElement\n\n /**\n * The current state of the tooltip, dependent on the state machine\n */\n @state() private state: TooltipStates = 'hidden'\n\n // The current coordinates for the tooltip\n private coords: [number, number] = [0, 0]\n\n /**\n * Control the position of the tooltip component.\n * When set to \"none\", the tooltip will be shown above\n * but accommodate for browser boundaries.\n */\n @property({ reflect: true }) position: 'block-end' | 'block-start' | 'inline-start' | 'inline-end' = 'block-start'\n\n /**\n * The tooltip role, set on the component by default.\n */\n\n @property({ reflect: true }) role = 'tooltip'\n\n /**\n * The id for the active element to reference via aria-describedby.\n */\n\n @property({ reflect: true }) id: string = ''\n\n /**\n * The delay in milliseconds before the tooltip is opened.\n */\n @property({ reflect: true, type: Number }) delay: number = 500\n\n /**\n * Apply all event listeners\n */\n connectedCallback() {\n super.connectedCallback()\n\n this.proxy = document.createElement('span')\n\n const rootNode = this.getRootNode() as Document\n\n this.events.listen(rootNode, 'keydown', this.hideOnEscape)\n\n // we treat mouseover and focusin the same, since they both show tooltip\n this.events.listen(rootNode, 'mouseover', this.handleShow)\n this.events.listen(rootNode, 'focusin', this.handleShow)\n\n // we treat focusout, mouseout, click the same, since they all hide tooltip\n this.events.listen(rootNode, 'mouseout', this.handleHide)\n this.events.listen(rootNode, 'focusout', this.handleHide)\n // we use event capture here to handle cases where e.g. a close button causes its ancestor to be removed from the DOM.\n // in this case the click event will never bubble up to the rootNode, so we never receive it, and the tooltip can remain open\n // by capturing, we get this event first, and can close the tooltip eagerly\n this.events.listen(rootNode, 'click', this.handleHide, { capture: true })\n\n this.events.listen(window, 'resize', this.reposition, { passive: true })\n this.events.listen(window, 'scroll', this.reposition, { passive: true })\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n\n this.proxy?.remove()\n this.proxy = undefined\n }\n\n render() {\n return html`\n <div class=\"n-tooltip\">\n <slot></slot>\n <div class=\"n-tooltip-shortcut\" ?hidden=${this.shortcutSlot.isEmpty}>\n <slot class=\"n-tooltip-key\" name=\"shortcut\"></slot>\n </div>\n </div>\n `\n }\n\n @observe('id')\n protected handleIdChange() {\n if (!this.id) {\n console.warn('NORD: The tooltip requires an id attribute and value')\n }\n }\n\n @observe('state')\n private handleStateChange(prevState: TooltipStates) {\n switch (this.state) {\n case 'hidden': {\n if (prevState === 'waiting' && this.timeoutId) {\n clearTimeout(this.timeoutId)\n }\n\n this.removeDescribedBy()\n this.currentElement = undefined\n this.style.visibility = 'hidden'\n this.style.opacity = '0'\n break\n }\n\n case 'visible': {\n this.timeoutId = undefined\n Tooltip.lastOpened = this\n this.addDescribedBy()\n\n const [x, y] = this.coords\n\n // use physical properties here since floating-ui\n // works exclusively in physical dimensions\n // we do all the mapping in logicalToPhysical\n this.style.left = `${x}px`\n this.style.top = `${y}px`\n this.style.visibility = 'visible'\n this.style.opacity = '1'\n break\n }\n\n case 'waiting': {\n this.timeoutId = setTimeout(() => {\n this.state = transition(this.state, 'timeout')\n }, this.delay)\n break\n }\n\n case 'positioning': {\n if (Tooltip.lastOpened !== this) {\n Tooltip.lastOpened?.hideTooltip()\n }\n\n if (this.currentElement) {\n this.updatePosition(this.currentElement)\n }\n break\n }\n }\n }\n\n /**\n * Setting and updating the position of the tooltip\n */\n private updatePosition = (currentElement: HTMLElement) =>\n computePosition(currentElement, this, {\n strategy: 'fixed',\n placement: logicalToPhysical(this.position),\n middleware: [\n offset(8),\n flip(),\n shift({\n padding: 8,\n }),\n ],\n }).then(({ x, y }) => {\n this.coords = [x, y]\n this.state = transition(this.state, 'positioned')\n })\n\n private hideTooltip = () => {\n this.state = transition(this.state, 'hide')\n }\n\n private reposition = () => {\n this.state = transition(this.state, 'reposition')\n }\n\n private handleShow = (e: Event) => {\n const target = e.target as FocusableElement\n\n if (referencesTooltip(target, this)) {\n this.currentElement = target\n this.state = transition(this.state, 'show')\n }\n }\n\n private handleHide = (e: Event) => {\n if (e.target === this.currentElement) {\n this.hideTooltip()\n }\n }\n\n private hideOnEscape = (e: KeyboardEvent) => {\n if (e.key === 'Escape') {\n this.hideTooltip()\n }\n }\n\n private addDescribedBy = () => {\n const focusable = getFocusable(this.currentElement)\n\n if (focusable && this.proxy) {\n this.proxy.hidden = true\n this.proxy.id = this.id\n this.proxy.textContent = this.textContent\n\n focusable.insertAdjacentElement('afterend', this.proxy)\n attr.add(focusable, 'aria-describedby', this.id)\n }\n }\n\n private removeDescribedBy = () => {\n const focusable = getFocusable(this.currentElement)\n\n if (focusable && this.proxy) {\n this.proxy.remove()\n attr.remove(focusable, 'aria-describedby', this.id)\n }\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-tooltip': Tooltip\n }\n}\n","import { html, LitElement } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\nimport componentStyle from '../common/styles/Component.css'\nimport style from './TopBar.css'\n\n/**\n * Top bar is a header component that is always visible at the top of the interface. Top bar allows functionality such as search and contextual menus to be placed at the top of the interface.\n *\n * @status ready\n * @category structure\n * @slot - Used for the main content of the top bar. We recommend placing your application’s global search functionality into this slot.\n * @slot end - Optional slot for menus, buttons, toggles, etc.\n */\n@customElement('nord-top-bar')\nexport default class TopBar extends LitElement {\n static styles = [componentStyle, style]\n\n render() {\n return html`\n <slot></slot>\n <slot name=\"end\"></slot>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-top-bar': TopBar\n }\n}\n"],"names":["__decorate","decorators","target","key","desc","d","c","arguments","length","r","Object","getOwnPropertyDescriptor","Reflect","decorate","i","defineProperty","SuppressedError","t","globalThis","e","ShadowRoot","ShadyCSS","nativeShadow","Document","prototype","CSSStyleSheet","s","Symbol","o","WeakMap","n$7","constructor","this","_$cssResult$","Error","cssText","styleSheet","get","replaceSync","set","toString","reduce","n","cssRules","is","h","getOwnPropertyNames","getOwnPropertySymbols","getPrototypeOf","a","trustedTypes","l","emptyScript","p","reactiveElementPolyfillSupport","u","toAttribute","Boolean","Array","JSON","stringify","fromAttribute","Number","parse","f","b","attribute","type","String","converter","reflect","useDefault","hasChanged","metadata","litPropertyMetadata","y$1","HTMLElement","addInitializer","_$Ei","push","observedAttributes","finalize","_$Eh","keys","createProperty","state","hasOwnProperty","create","wrapped","elementProperties","noAccessor","getPropertyDescriptor","call","requestUpdate","configurable","enumerable","getPropertyOptions","Map","finalized","properties","_$Eu","elementStyles","finalizeStyles","styles","isArray","Set","flat","reverse","unshift","toLowerCase","super","_$Ep","isUpdatePending","hasUpdated","_$Em","_$Ev","_$ES","Promise","enableUpdating","_$AL","_$E_","forEach","addController","_$EO","add","renderRoot","isConnected","hostConnected","removeController","delete","size","createRenderRoot","shadowRoot","attachShadow","shadowRootOptions","adoptedStyleSheets","map","document","createElement","litNonce","setAttribute","textContent","appendChild","connectedCallback","disconnectedCallback","hostDisconnected","attributeChangedCallback","_$AK","_$ET","removeAttribute","_$Ej","hasAttribute","C","_$EP","has","_$Eq","reject","scheduleUpdate","performUpdate","shouldUpdate","willUpdate","hostUpdate","update","_$EM","_$AE","hostUpdated","firstUpdated","updated","updateComplete","getUpdateComplete","y","mode","ReactiveElement","reactiveElementVersions","createPolicy","createHTML","Math","random","toFixed","slice","createComment","iterator","v","_","m","RegExp","g","$","_$litType$","strings","values","x","T","for","E","A","createTreeWalker","P","V","lastIndex","exec","test","startsWith","N","parts","el","currentNode","content","firstChild","replaceWith","childNodes","nextNode","nodeType","hasAttributes","getAttributeNames","endsWith","getAttribute","split","index","name","ctor","H","I","L","k","tagName","append","data","indexOf","innerHTML","S","_$Co","_$Cl","_$litDirective$","_$AO","_$AT","_$AS","_$AV","_$AN","_$AD","_$AM","parentNode","_$AU","creationScope","importNode","R","nextSibling","z","_$AI","_$Cv","_$AH","_$AA","_$AB","options","startNode","endNode","_$AR","O","insertBefore","createTextNode","_$AC","M","_$AP","remove","setConnected","element","fill","j","toggleAttribute","capture","once","passive","removeEventListener","addEventListener","handleEvent","host","Z","D","U","B","F","litHtmlPolyfillSupport","litHtmlVersions","renderBefore","_$litPart$","renderOptions","_$Do","render","_$litElement$","litElementHydrateSupport","LitElement","litElementPolyfillSupport","litElementVersions","customElements","define","kind","init","querySelector","PropertyObserverController","cb","lifecycle","handle","_value","newValue","observe","propertyName","methodName","fsm","config","transition","currentState","event","VisuallyHidden","html","style","customElement","i$2","_$Ct","_$Ci","e$3","it","directiveName","_t","raw","resultType","cond","condition","trueCase","falseCase","nothing","loadIconCdn","fetch","then","response","ok","TypeError","text","Icon","Icon_1","svg","registerResolver","resolver","manager","registerIcon","iconOrName","icon","label","color","ifDefined","unsafeHTML","handleNameChange","resolve","componentStyle","cache","onResolved","cached","catch","title","default","clear","property","initial","loading","load","error","loaded","Avatar","variant","renderImage","renderFallback","handleSrcChange","src","handleLoad","handleError","Badge","strong","warningIcon","dangerIcon","infoIcon","successIcon","iconMap","warning","warningIcon.title","danger","dangerIcon.title","info","infoIcon.title","success","successIcon.title","Banner","filter","join","st","nt","classList","DirectionController","dir","documentElement","isLTR","isRTL","observer","MutationObserver","attributes","attributeFilter","hosts","EventController","listeners","stop","listen","listener","SlotController","slotName","handleSlotChange","onChange","events","selector","hasContent","isEmpty","assigned","from","querySelectorAll","_e","ButtonGroup","defaultSlot","dirController","direction","wrap","role","hasSmallButtons","every","node","localName","hasMultipleButtons","classMap","_$AQ","reconnected","disconnected","setValue","G","rt","lt","ct","ht","value","LightDomController","container","FocusableMixin","superClass","focusableRef","createRef","focus","_a","blur","click","InputMixin","InputElement","disabled","formAncestor","form","id","oldVal","_formId","getRootNode","closest","Spinner","Button","buttonRef","lightDom","renderLightDom","download","expand","square","hideDropdownIcon","handleOuterClick","composedPath","some","stopPropagation","isDropdownToggle","assignedSlot","isIconButton","shouldShowDropdownIcon","href","innards","renderLink","renderButton","ref","handleProxyChange","handleClick","accessibleExpanded","accessibleHasPopup","slot","proxyButton","dt","ut","w","navigator","platform","getModifierState","trim","pop","timeout","KeyboardEvent","toUpperCase","code","find","includes","clearTimeout","setTimeout","bind","groupBy","array","grouped","item","collection","preventDefault","SwipeController","hadFirstUpdate","initialTouchX","initialTouchY","handleTouchStart","pageX","pageY","changedTouches","handleTouchEnd","matchesGesture","onSwipeEnd","distX","distY","details","initialX","initialY","isHorizontalSwipe","abs","isDownwardsSwipe","ISO_DATE_FORMAT","DaysOfWeek","createDate","year","month","day","dayInt","parseInt","monthInt","yearInt","isInteger","date","Date","setFullYear","parseISODate","matches","match","printISODate","getDate","getMonth","getFullYear","padStart","today","UTC","getDayNames","locale","weekday","days","getDay","toLocaleDateString","setDate","getMonthNames","months","setMonth","isEqualMonth","isEqual","addDays","startOfWeek","firstDayOfWeek","Monday","diff","endOfWeek","startOfMonth","endOfMonth","setYear","clamp","min","max","time","getTime","inRange","getViewOfMonth","start","end","current","getDaysInRange","val","en","$lang","$name","$dir","instructions","inputLabel","footerArrowKeys","footerEnterKey","footerEscapeKey","footerBackspaceKey","noResults","searchTerm","tip","placeholder","prevMonthLabel","nextMonthLabel","monthSelectLabel","yearSelectLabel","modalHeading","closeLabel","buttonLabel","selectedDateMessage","dateOutOfMinBound","minDate","dateOutOfMaxBound","maxDate","remainingCharacters","remainder","dismissLabel","unreadLabel","removeLabel","documentLangSubscribers","translationRegistrationSubscribers","translations","deepMerge","source","isObject","result","sourceValue","targetValue","subscriber","registerTranslation","translation","lang","existing","merged","notifyTranslationRegistration","isTranslationRegistered","resolveTranslation","langCode","langOnly","noop","LocalizeController","onLangChange","handleLangChange","resolved","resolvedTranslation","resolvedLang","unsubscribeTranslationRegistration","unsubscribeDocumentLang","subscribeToDocumentLang","_b","_c","disconnect","term","args","component","componentTranslation","console","warn","fallbackComponentTranslation","fallback","translationValue","NordEvent","Event","eventInitDict","bubbles","composed","oneEvent","race","DateSelectEvent","fn","arrowRightIcon","arrowLeftIcon","arrowDownIcon","isDateDisabled","isDateHighlighted","dialogLabelId","Calendar","swipe","addMonths","shortcuts","createKeybindingsHandler","ArrowRight","ArrowLeft","ArrowDown","ArrowUp","Home","End","PageUp","PageDown","addYears","localize","activeFocus","focusedDay","handleDaySelect","isInRange","isAllowed","dispatchEvent","handleMonthSelect","handleYearSelect","handleNextMonthClick","handlePreviousMonthClick","enableActiveFocus","disableActiveFocus","table","currentTarget","relatedTarget","contains","focusedDayNode","monthSelectNode","getToday","valueAsDate","focusedMonth","focusedYear","minDateStartOfMonth","undefined","maxDateEndOfMonth","currentYear","minYear","maxYear","monthNames","monthNamesShort","repeat","to","range","dayNames","startingOffset","mapFn","dayName","dayNamesShort","adjustedIndex","chunkSize","chunk","week","outsideRange","isToday","isDisabled","isSelected","isInMonth","isHighlighted","formattedDate","dateFormatShort","format","accessibleLabel","handleValueChange","setFocusedDay","handleFocusedDayChange","Intl","DateTimeFormat","years","query","Card","headerSlot","headerEndSlot","footerSlot","padding","footerDivider","FormDataController","_form","handleFormData","formData","cleanup","FormAssociatedMixin","FormAssociatedElement","labelSlot","errorSlot","hintSlot","formValue","inputId","errorId","hintId","hintBelow","hideLabel","required","hideRequired","handleInput","handleChange","renderLabel","additionalContent","isHintBelow","renderHint","hasHint","hint","renderError","hasError","getDescribedBy","getInvalid","SizeMixin","SizeElement","checkedIcon","indeterminateIcon","Checkbox","indeterminate","checked","formFieldStyle","ARROW_RE","ESC_RE","ShortcutController","unbind","unregister","tinykeys","window","normalised","keybinding","mapped","replace","_match","normalise","LightDismissController","isMouseDownOutside","handleEsc","isOpen","onDismiss","handleMouseDown","predicate","isDismissible","shortcut","Escape","getFocusedElement","root","activeElement","KeyboardController","actions","commandShortcuts","globalShortcuts","toggleOpen","navigationShortcuts","Enter","trigger","Backspace","goBack","next","previous","registerCommandShortcuts","command","commands","handler","SelectEvent","eventName","KEY_REGEX","chevronIconLeft","chevronIconRight","altKeyIcon","CommandMenuAction","selected","getIconName","renderShortcut","ensureInView","requestAnimationFrame","scrollIntoView","block","chevronIconRight.title","chevronIconLeft.title","altKeyIcon.title","navigateIcon","enterIcon","backspaceIcon","CommandMenu","inputRef","listRef","dismissController","open","close","keyboardController","select","externalFiltering","exitNestedOnSearch","searchQuery","bump","selectedIndex","filteredCommands","show","cancelable","setParent","parent","previousFocus","sections","activeDescendant","handleAnimationEnd","handleBlur","renderNoResults","section","renderSection","navigateIcon.title","enterIcon.title","backspaceIcon.title","sectionId","handleCommandsChange","handleBump","focusOnOpen","scrollTop","input","setSearch","parentCommand","str","filterCommands","ordered","searchTerms","toLocaleLowerCase","keywords","searchSpace","matcher","ReadonlyMixin","ReadonlyElement","readonly","isoAdapter","ft","removeProperty","setProperty","ResizeController","ResizeObserver","entry","borderBoxSize","inlineSize","blockSize","AutocompleteMixin","AutocompleteElement","autocomplete","TextSelectableMixin","textSelectableRef","selectionStart","selectionEnd","selectionDirection","setSelectionRange","setRangeText","replacement","selectMode","getNativeElement","searchIcon","px","defaultInputmodeMap","number","email","tel","url","search","Input","startObserver","startSlot","endObserver","endSlot","disallowPattern","inputmode","handleInputChange","inputEl","regex","cursor","beforeCursor","afterCursor","filteredBeforeCursor","newCursor","cleanValue","isNumber","inputmodeValue","styleMap","handleKeydown","handleSelect","button","getSubmitButton","textFieldStyle","sides","alignments","placements","acc","side","concat","round","floor","createCoords","oppositeSideMap","left","right","bottom","top","oppositeAlignmentMap","evaluate","param","getSide","placement","getAlignment","getOppositeAxis","axis","getAxisLength","yAxisSides","getSideAxis","getAlignmentAxis","getAlignmentSides","rects","rtl","alignment","alignmentAxis","mainAlignmentSide","reference","floating","getOppositePlacement","getOppositeAlignmentPlacement","lrPlacement","rlPlacement","tbPlacement","btPlacement","getOppositeAxisPlacements","flipAlignment","list","isStart","getSideList","rectToClientRect","rect","width","height","computeCoordsFromPlacement","_ref","sideAxis","alignLength","isVertical","commonX","commonY","commonAlign","coords","async","detectOverflow","_await$platform$isEle","elements","strategy","boundary","rootBoundary","elementContext","altBoundary","paddingObject","expandPaddingObject","getPaddingObject","clippingClientRect","getClippingRect","isElement","contextElement","getDocumentElement","offsetParent","getOffsetParent","offsetScale","getScale","elementClientRect","convertOffsetParentRelativeRectToViewportRelativeRect","getSideOffsets","overflow","isAnySideFullyClipped","originSides","hasWindow","getNodeName","isNode","nodeName","getWindow","_node$ownerDocument","ownerDocument","defaultView","Node","Element","isHTMLElement","isShadowRoot","invalidOverflowDisplayValues","isOverflowElement","overflowX","overflowY","display","getComputedStyle","tableElements","isTableElement","topLayerSelectors","isTopLayer","transformProperties","willChangeValues","containValues","isContainingBlock","elementOrCss","webkit","isWebKit","css","containerType","backdropFilter","willChange","contain","CSS","supports","lastTraversableNodeNames","isLastTraversableNode","getNodeScroll","scrollLeft","scrollX","scrollY","getParentNode","getNearestOverflowAncestor","body","getOverflowAncestors","traverseIframes","_node$ownerDocument2","scrollableAncestor","isBody","win","frameElement","getFrameElement","visualViewport","getCssDimensions","getComputedStyle$1","parseFloat","hasOffset","offsetWidth","offsetHeight","shouldFallback","unwrapElement","domElement","getBoundingClientRect","isFinite","noOffsets","getVisualOffsets","offsetLeft","offsetTop","includeScale","isFixedStrategy","clientRect","scale","visualOffsets","isFixed","floatingOffsetParent","shouldAddVisualOffsets","offsetWin","currentWin","currentIFrame","iframeScale","iframeRect","clientLeft","paddingLeft","clientTop","paddingTop","getWindowScrollBarX","leftScroll","getHTMLOffset","scroll","htmlRect","SCROLLBAR_MAX","absoluteOrFixed","getClientRectFromClippingAncestor","clippingAncestor","clientWidth","clientHeight","visualViewportBased","windowScrollbarX","doc","bodyStyles","bodyMarginInline","compatMode","marginLeft","marginRight","clippingStableScrollbarWidth","getViewportRect","scrollWidth","scrollHeight","getDocumentRect","getInnerBoundingClientRect","hasFixedPositionAncestor","stopNode","position","getRectRelativeToOffsetParent","isOffsetParentAnElement","offsets","setLeftRTLScrollbarOffset","offsetRect","htmlOffset","isStaticPositioned","getTrueOffsetParent","polyfill","rawOffsetParent","svgOffsetParent","getContainingBlock","topLayer","clippingAncestors","cachedResult","currentContainingBlockComputedStyle","elementIsFixed","computedStyle","currentNodeIsContaining","ancestor","getClippingElementAncestors","firstClippingAncestor","clippingRect","accRect","getElementRects","getOffsetParentFn","getDimensionsFn","getDimensions","floatingDimensions","getClientRects","rectsAreEqual","autoUpdate","ancestorScroll","ancestorResize","elementResize","layoutShift","IntersectionObserver","animationFrame","referenceEl","ancestors","cleanupIo","onMove","timeoutId","io","_io","refresh","skip","threshold","elementRectForRootMargin","rootMargin","isFirstUpdate","handleObserve","entries","ratio","intersectionRatio","observeMove","frameId","reobserveFrame","resizeObserver","firstEntry","unobserve","cancelAnimationFrame","_resizeObserver","prevRefRect","frameLoop","nextRefRect","_resizeObserver2","offset","_middlewareData$offse","_middlewareData$arrow","middlewareData","diffCoords","mainAxisMulti","crossAxisMulti","rawValue","mainAxis","crossAxis","convertValueToCoords","arrow","alignmentOffset","autoPlacement","_middlewareData$autoP","_middlewareData$autoP2","_placementsThatFitOnE","allowedPlacements","autoAlignment","detectOverflowOptions","placements$1","getPlacementList","currentIndex","currentPlacement","alignmentSides","reset","currentOverflows","allOverflows","overflows","nextPlacement","placementsSortedByMostSpace","sort","placementsThatFitOnEachSide","resetPlacement","shift","checkMainAxis","checkCrossAxis","limiter","mainAxisCoord","crossAxisCoord","maxSide","limitedCoords","enabled","flip","_middlewareData$flip","initialPlacement","fallbackPlacements","specifiedFallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","initialSideAxis","isBasePlacement","oppositePlacement","getExpandedPlacements","hasFallbackAxisSideDirection","overflowsData","_middlewareData$flip2","_overflowsData$filter","nextIndex","_overflowsData$filter2","currentSideAxis","hide","referenceHiddenOffsets","referenceHidden","escapedOffsets","escaped","computePosition","mergedOptions","platformWithCache","middleware","validMiddleware","statefulPlacement","resetCount","_platform$detectOverf","nextX","nextY","computePosition$1","ScrollbarController","unlockScroll","lockScroll","locks","documentWidth","innerWidth","paddingRight","setStyle","resets","getPropertyValue","FloatingMixin","FloatingElement","align","logicalMapLTR","logicalMapRTL","logicalMap","logicalToPhysical","logicalSide","logicalSideAlign","mediaQuery","matchMedia","Popout","scrollBar","dismiss","popout","targetElement","smallViewport","alwaysFloating","enableScroll","leaveTopLayer","updatePosition","anchorElement","computePositionConfig","computedPosition","enterTopLayer","handleMediaQueryChange","cleanupAutoUpdate","moveFocusToButton","preventScroll","initializeElements","handleIdChange","getToggle","getAnchor","handleOpenChange","handleAnchorChange","showPopover","rootNode","allToggles","toggle","HTMLSlotElement","assignedElements","anchor","Stack","gap","alignItems","calendarIcon","closeIcon","DatePicker","createDateFormatters","dateAdapter","internalError","validateDateBounds","handleFocus","parsed","valueAsNumber","NaN","dateFormatLong","handleOpen","handleClose","focusLast","focusFirst","closeButton","calendar","Divider","handleDirectionChange","Footer","Drawer","DropdownGroup","heading","DropdownItem","popoutCounter","DropdownSubmenu","mobileActive","popoutId","currentTriggerElement","popoutOpen","mobileMediaQuery","isSmallScreen","parentDropdownAlwaysFloating","handleTriggerMouseEnter","shouldUseMobileStack","closeOtherSubmenus","handleTriggerClick","stopImmediatePropagation","navigateIntoSubmenu","handleTriggerKeydown","handleContentKeydown","navigateBack","handlePopoutOpen","handlePopoutClose","handleParentDropdownMouseOver","parentDropdown","isInSubmenuStack","submenuStackRef","isDeepestInStack","deepestSubmenu","triggerElement","parentObserver","mutations","mutation","attributeName","active","handleTriggerSlotChange","isTouchDevice","immediateParent","parentElement","sibling","deactivateMobile","triggerSlot","_d","CustomEvent","detail","submenu","contentDiv","firstItem","Dropdown","submenuStack","isNavigating","isShowingSubmenu","handleAlwaysFloatingChange","activeSubmenu","handleSubmenuNavigate","handleBackClick","newTop","focusTarget","clearSubmenuStack","eventTarget","topSubmenu","customEvent","previousDeepest","newSubmenu","delegatesFocus","EmptyState","Fieldset","Header","defaultEnabled","BroadcastChannelController","BroadcastChannel","channel","channelName","onMessage","post","message","postMessage","storage","defaultValue","serialize","deserialize","localStorage","getItem","setItem","unlockIcon","lockIcon","NavToggle","localization","unlockIcon.title","lockIcon.title","navWidthStore","navOpenStore","navMachine","opened","closed","focusin","pointerenter","peek","focusout","pointerleave","dropdownOpen","blocked","dropdownClose","wait","unpeek","transitionend","Layout","navSlot","drawerSlot","topBarSlot","lightDismiss","navState","wideScreen","navTransition","navEl","broadcast","syncNavState","navOpen","navWidth","isDragging","persistNavState","sticky","stickyFooter","handleToggleClick","handleNavFocus","handleMainFocus","handleMouseEnter","handleMouseLeave","handleTransitionEnd","isNarrow","adjustedNavWidth","handleDropdownOpen","handleDropdownClose","handleNavClick","startDragging","handleDrag","stopDragging","handleKeyboardResize","renderNavCollapse","handleMainClick","renderNavToggle","handleNavWidthChange","handleNavStateChange","prev","peekTimeoutId","setNavWidth","defaultPrevented","isNavItem","hasSubNav","setPointerCapture","pointerId","clientX","stickyStyle","Message","unread","itemStyle","setInertAttributes","setInertAttribute","getElementsAround","nextElementSibling","previousElementSibling","FocusTrapController","inertElements","release","trap","ModalController","trackLastButton","lastButton","polyfillSubmitter","submitter","handleLightDismiss","isLightDismissEnabled","handleSubmit","isDialogProperty","method","isDialogAttr","focusTrap","dialog","SubmitEvent","openModals","unblock","backdrop","items","splice","ModalCancelEvent","writable","ModalCloseEvent","Modal","featureSlot","modalController","handleDismiss","persistent","modal","returnValue","scrollable","lastTrigger","showModal","closeTrigger","handleOpenUpdated","NavGroup","NavItem","subnavSlot","badge","renderToggle","handleActiveChange","Navigation","footerObserver","allowItemsToRemainOpen","handleActivate","isAncestor","activeItem","observeFooter","childList","footerEl","isFooterVisible","visibility","opacity","contentVisibility","NotificationGroup","NotificationMixin","NotificationElement","notificationRef","dismissed","Notification","ProgressBar","CX","CY","instanceCounter","Progress","progress","_animatedProgress","_animationId","_targetProgress","_instanceId","changedProperties","_animate","animate","_clampedProgress","_isSemanticColor","_customColorStyle","hasLabel","pathData","percent","sweep","theta","PI","cos","sin","sectorPath","clipId","chCodes","bin","dec","pad","mod","fillArr","interleaveBytes","blocks","len","res","Uint8Array","includesAt","lst","pattern","alphabet","char","decode","letter","encode","digits","isSafeInteger","assertNumber","Bitmap","limit","Infinity","fromString","lines","fromCharCode","line","row","point","isInside","xy","yPos","xPos","rectRead","cur","hLine","vLine","border","embed","bm","rectSlice","inverse","factor","clone","assertDrawn","toASCII","out","first","second","toTerm","cc","whiteBG","darkBG","toSVG","optimize","prevPoint","relM","toGIF","u16le","dims","bytes","fullChunks","toImage","isRGB","ECMode","Encoding","BYTES","WORDS_PER_BLOCK","low","medium","quartile","high","ECC_BLOCKS","ver","sizeType","alignmentPatterns","last","distance","count","ceil","interval","ECCode","formatMask","formatBits","ecc","maskIdx","versionBits","numeric","alphanumerc","lengthBits","alphanumeric","byte","kanji","eci","modeBits","capacity","words","numBlocks","blockLen","shortBlocks","total","PATTERNS","_x","_y","GF","tables","exp","log","mul","pow","inv","polynomial","poly","monomial","degree","coefficient","coefficients","mulPoly","mulPolyScalar","scalar","mulPolyMonomial","addPoly","smaller","larger","sumDiff","lengthDiff","remainderPoly","divisor","elm","divisorPoly","evalPoly","euclidian","rLast","tLast","rLastLast","tLastLast","q","dltInverse","degreeDiff","sigmaTildeAtZero","interleave","rs","eccWords","pol","syndrome","evl","errorLocator","errorEvaluator","locations","pos","xiInverse","denominator","eccBlocks","subarray","resBlocks","resECC","isShort","encoded","dataLen","utf8","TextEncoder","utf8ToBytes","bits","idx","drawQR","finder","alignPos","getBit","bit","drawTemplate","need","tpl","xOffset","zigzag","mask","penalty","sameColor","same","adjacent","column","box","lastW","lastH","x1","y1","finderPattern","lightPattern","p1","p2","darkPixels","darkPercent","dark","encodeQR","output","opts","ec","validateECC","encoding","detectType","enc","validateEncoding","validateMask","version","err","validateVersion","bestMask","best","bestScore","score","drawQRBest","correctionMap","Q","Qrcode","background","correction","generate","backgroundColor","computed","qrArray","ctx","canvas","getContext","fillStyle","fillRect","cell","LightSlotController","syncLightDom","renderHook","createId","suffix","Radio","isLabel","htmlFor","inputSlot","inner","wrapper","handleCheckedChange","previousChecked","uncheckSiblings","radio","forceReflow","Range","step","SegmentedControlItem","segmentedControlItem","SegmentedControl","dropdownIcon","Select","setupOptionObserver","optionObserver","subtree","characterData","slottedOptions","buttonText","getButtonText","option","renderOption","Skeleton","Tab","handleSelectionChange","tabGroupCount","TabGroup","TabGroup_1","tabGroupId","selectedTab","initialSelectedTab","handleMutation","oldValue","updateSelectedTab","observerOptions","handleTabChange","updateSlots","setupObserver","setupTabs","setupPanels","tab","panels","selectedPanelId","panel","scrollTo","previousTab","tabs","selectedTabIndex","firstTab","lastTab","nextTab","updateTab","keyEvent","selectedPanel","inline","attributeOldValue","TabPanel","Table","density","scrollSnap","striped","renderStyles","renderTarget","DOCUMENT_NODE","head","fragment","createDocumentFragment","TagGroup","hasMultipleTags","Tag","handleRemove","renderSelectableTag","renderRemovableTag","renderStaticTag","Textarea","resize","characterCounter","maxLength","renderCharacterCounter","lengthMeasurer","counter","Segmenter","segmenter","segment","createLengthMeasurer","resizeToFitContent","textarea","ToastGroup","addToast","autoDismiss","toast","Toast","handleAutoDismissChange","Toggle","getTokens","attr","setTokens","tokens","referencesTooltip","tooltip","ELEMENT_NODE","getFocusable","focusable","hidden","visible","reposition","waiting","positioning","positioned","Tooltip","Tooltip_1","shortcutSlot","delay","currentElement","hideTooltip","handleShow","handleHide","hideOnEscape","addDescribedBy","proxy","insertAdjacentElement","token","attr.add","removeDescribedBy","attr.remove","handleStateChange","prevState","lastOpened","TopBar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KAAKmpC,UAAYxrB,YAAW,KAC1B3d,KAAKqD,MAAQgO,GAAWrR,KAAKqD,MAAO,UAAU,GAC7CrD,KAAK65D,OACR,MAGF,IAAK,cACCF,GAAQiB,aAAe56D,OACL,QAApBma,EAAAw/C,GAAQiB,kBAAY,IAAAzgD,GAAAA,EAAA4/C,eAGlB/5D,KAAK85D,gBACP95D,KAAKuxC,eAAevxC,KAAK85D,gBAKhC,GA5JMJ,GAAAn1D,OAAS,CAACyP,GAAgBtC,IAwBhB1T,EAAA,CAAhBqF,MAA+Cq2D,GAAAl6D,UAAA,aAAA,GAUnBxB,EAAA,CAA5BwW,GAAS,CAAElS,SAAS,KAA6Fo3D,GAAAl6D,UAAA,gBAAA,GAMrFxB,EAAA,CAA5BwW,GAAS,CAAElS,SAAS,KAAwBo3D,GAAAl6D,UAAA,YAAA,GAMhBxB,EAAA,CAA5BwW,GAAS,CAAElS,SAAS,KAAuBo3D,GAAAl6D,UAAA,UAAA,GAKDxB,EAAA,CAA1CwW,GAAS,CAAElS,SAAS,EAAMH,KAAML,UAA6B43D,GAAAl6D,UAAA,aAAA,GAiDpDxB,EAAA,CADTgT,GAAQ,OAKR0oD,GAAAl6D,UAAA,iBAAA,MAGOxB,EAAA,CADPgT,GAAQ,UAkDR0oD,GAAAl6D,UAAA,oBAAA,MA7JkBk6D,GAAOC,GAAA37D,EAAA,CAD3B2T,GAAc,iBACM+nD,WAAAA,8gECxDN,IAAMmB,GAAN,cAAqB3qD,GAGlC,MAAAH,GACE,OAAO0B,CAAI,uCAIZ,GAPMopD,GAAAt2D,OAAS,CAACyP,GAAgBtC,IADdmpD,GAAM78D,EAAA,CAD1B2T,GAAc,iBACMkpD,WAAAA","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,13,14,15,26,31,32,33,42,43,88,95,96,97,98,134]}
|
|
1
|
+
{"version":3,"file":"bundle.js","sources":["../../../node_modules/.pnpm/@rollup+plugin-typescript@11.1.6_rollup@4.21.3_tslib@2.8.1_typescript@5.5.4/node_modules/tslib/tslib.es6.js","../../../node_modules/.pnpm/@lit+reactive-element@2.1.0/node_modules/@lit/reactive-element/css-tag.js","../../../node_modules/.pnpm/@lit+reactive-element@2.1.0/node_modules/@lit/reactive-element/reactive-element.js","../../../node_modules/.pnpm/lit-html@3.3.0/node_modules/lit-html/lit-html.js","../../../node_modules/.pnpm/lit-element@4.2.0/node_modules/lit-element/lit-element.js","../../../node_modules/.pnpm/@lit+reactive-element@2.1.0/node_modules/@lit/reactive-element/decorators/custom-element.js","../../../node_modules/.pnpm/@lit+reactive-element@2.1.0/node_modules/@lit/reactive-element/decorators/property.js","../../../node_modules/.pnpm/@lit+reactive-element@2.1.0/node_modules/@lit/reactive-element/decorators/state.js","../../../node_modules/.pnpm/@lit+reactive-element@2.1.0/node_modules/@lit/reactive-element/decorators/base.js","../../../node_modules/.pnpm/@lit+reactive-element@2.1.0/node_modules/@lit/reactive-element/decorators/query.js","../src/common/decorators/observe.ts","../src/common/fsm.ts","../src/visually-hidden/VisuallyHidden.ts","../../../node_modules/.pnpm/lit-html@3.3.0/node_modules/lit-html/directives/if-defined.js","../../../node_modules/.pnpm/lit-html@3.3.0/node_modules/lit-html/directive.js","../../../node_modules/.pnpm/lit-html@3.3.0/node_modules/lit-html/directives/unsafe-html.js","../src/common/directives/cond.ts","../src/icon/IconManager.ts","../src/icon/Icon.ts","../src/avatar/Avatar.ts","../src/badge/Badge.ts","../../icons/lib/assets/interface-checked-circle.js","../../icons/lib/assets/interface-help.js","../../icons/lib/assets/interface-info.js","../../icons/lib/assets/interface-warning.js","../src/banner/Banner.ts","../../../node_modules/.pnpm/lit-html@3.3.0/node_modules/lit-html/directives/class-map.js","../src/common/controllers/DirectionController.ts","../src/common/controllers/EventController.ts","../src/common/controllers/SlotController.ts","../src/button-group/ButtonGroup.ts","../../../node_modules/.pnpm/lit-html@3.3.0/node_modules/lit-html/directive-helpers.js","../../../node_modules/.pnpm/lit-html@3.3.0/node_modules/lit-html/async-directive.js","../../../node_modules/.pnpm/lit-html@3.3.0/node_modules/lit-html/directives/ref.js","../src/common/controllers/LightDomController.ts","../src/common/mixins/FocusableMixin.ts","../src/common/mixins/InputMixin.ts","../src/spinner/Spinner.ts","../src/button/Button.ts","../../icons/lib/assets/arrow-down-small.js","../../icons/lib/assets/arrow-left-small.js","../../icons/lib/assets/arrow-right-small.js","../../../node_modules/.pnpm/lit-html@3.3.0/node_modules/lit-html/directives/repeat.js","../../../node_modules/.pnpm/tinykeys@1.4.0/node_modules/tinykeys/dist/tinykeys.module.js","../src/common/collection.ts","../src/common/controllers/SwipeController.ts","../src/common/dates.ts","../src/common/number.ts","../src/calendar/localization.ts","../src/localization/en-us.ts","../src/command-menu/localization.ts","../src/date-picker/localization.ts","../src/modal/localization.ts","../src/nav-toggle/localization.ts","../src/textarea/localization.ts","../src/notification/localization.ts","../src/message/localization.ts","../src/tag/localization.ts","../src/localization/translation.ts","../src/localization/LocalizeController.ts","../src/common/events.ts","../src/calendar/DateSelectEvent.ts","../src/calendar/Calendar.ts","../src/card/Card.ts","../../icons/lib/assets/interface-checked-small.js","../../icons/lib/assets/interface-remove-small.js","../src/common/controllers/FormDataController.ts","../src/common/mixins/FormAssociatedMixin.ts","../src/common/mixins/SizeMixin.ts","../src/checkbox/Checkbox.ts","../../icons/lib/assets/keyboard-arrow-up-down.js","../../icons/lib/assets/keyboard-backspace.js","../../icons/lib/assets/keyboard-return.js","../src/common/controllers/ShortcutController.ts","../src/common/controllers/LightDismissController.ts","../src/common/focus.ts","../src/command-menu/KeyboardController.ts","../src/command-menu/SelectEvent.ts","../../icons/lib/assets/arrow-left.js","../../icons/lib/assets/arrow-right.js","../../icons/lib/assets/keyboard-option.js","../src/command-menu/CommandMenuAction.ts","../src/command-menu/CommandMenu.ts","../../icons/lib/assets/interface-calendar.js","../../icons/lib/assets/interface-close-small.js","../src/common/mixins/ReadonlyMixin.ts","../src/date-picker/date-adapter.ts","../../icons/lib/assets/navigation-search.js","../../../node_modules/.pnpm/lit-html@3.3.0/node_modules/lit-html/directives/style-map.js","../src/common/controllers/ResizeController.ts","../src/common/mixins/AutocompleteMixin.ts","../src/common/mixins/TextSelectableMixin.ts","../src/input/Input.ts","../src/common/input.ts","../src/common/form.ts","../../../node_modules/.pnpm/@floating-ui+utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs","../../../node_modules/.pnpm/@floating-ui+core@1.7.4/node_modules/@floating-ui/core/dist/floating-ui.core.mjs","../../../node_modules/.pnpm/@floating-ui+utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs","../../../node_modules/.pnpm/@floating-ui+dom@1.7.5/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs","../src/common/controllers/ScrollbarController.ts","../src/common/mixins/FloatingComponentMixin.ts","../src/common/positioning.ts","../src/popout/Popout.ts","../src/stack/Stack.ts","../src/date-picker/DatePicker.ts","../src/divider/Divider.ts","../src/footer/Footer.ts","../src/drawer/Drawer.ts","../src/dropdown-group/DropdownGroup.ts","../src/dropdown-item/DropdownItem.ts","../src/dropdown-submenu/DropdownSubmenu.ts","../src/dropdown/Dropdown.ts","../src/empty-state/EmptyState.ts","../src/fieldset/Fieldset.ts","../src/header/Header.ts","../../icons/lib/assets/navigation-toggle-lock.js","../src/common/controllers/BroadcastChannelController.ts","../src/common/storage.ts","../../icons/lib/assets/navigation-toggle.js","../src/nav-toggle/NavToggle.ts","../src/layout/Layout.ts","../src/message/Message.ts","../src/common/inert.ts","../src/common/controllers/FocusTrapController.ts","../src/modal/ModalController.ts","../src/modal/Modal.ts","../src/nav-group/NavGroup.ts","../src/nav-item/NavItem.ts","../src/navigation/Navigation.ts","../src/notification-group/NotificationGroup.ts","../src/common/mixins/NotificationMixin.ts","../src/notification/Notification.ts","../src/progress-bar/ProgressBar.ts","../src/progress/Progress.ts","../../../node_modules/.pnpm/qr@0.4.2/node_modules/qr/esm/index.js","../src/qrcode/Qrcode.ts","../src/common/controllers/LightSlotController.ts","../src/radio/Radio.ts","../src/common/directives/wrapIf.ts","../src/range/Range.ts","../src/segmented-control-item/SegmentedControlItem.ts","../src/segmented-control/SegmentedControl.ts","../../icons/lib/assets/interface-dropdown-small.js","../src/select/Select.ts","../src/skeleton/Skeleton.ts","../src/tab/Tab.ts","../src/tab-group/TabGroup.ts","../src/tab-panel/TabPanel.ts","../src/table/Table.ts","../src/tag-group/TagGroup.ts","../src/tag/Tag.ts","../src/textarea/Textarea.ts","../src/toast-group/ToastGroup.ts","../../icons/lib/assets/interface-close.js","../src/toast/Toast.ts","../src/toggle/Toggle.ts","../src/common/attribute.ts","../src/tooltip/Tooltip.ts","../src/top-bar/TopBar.ts"],"sourcesContent":["/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.unshift(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.unshift(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\r\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\r\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nvar ownKeys = function(o) {\r\n ownKeys = Object.getOwnPropertyNames || function (o) {\r\n var ar = [];\r\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\r\n return ar;\r\n };\r\n return ownKeys(o);\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n\r\nexport function __addDisposableResource(env, value, async) {\r\n if (value !== null && value !== void 0) {\r\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\r\n var dispose, inner;\r\n if (async) {\r\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\r\n dispose = value[Symbol.asyncDispose];\r\n }\r\n if (dispose === void 0) {\r\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\r\n dispose = value[Symbol.dispose];\r\n if (async) inner = dispose;\r\n }\r\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\r\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\r\n env.stack.push({ value: value, dispose: dispose, async: async });\r\n }\r\n else if (async) {\r\n env.stack.push({ async: true });\r\n }\r\n return value;\r\n\r\n}\r\n\r\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\r\n\r\nexport function __disposeResources(env) {\r\n function fail(e) {\r\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\r\n env.hasError = true;\r\n }\r\n var r, s = 0;\r\n function next() {\r\n while (r = env.stack.pop()) {\r\n try {\r\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\r\n if (r.dispose) {\r\n var result = r.dispose.call(r.value);\r\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n }\r\n else s |= 1;\r\n }\r\n catch (e) {\r\n fail(e);\r\n }\r\n }\r\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\r\n if (env.hasError) throw env.error;\r\n }\r\n return next();\r\n}\r\n\r\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\r\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\r\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\r\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\r\n });\r\n }\r\n return path;\r\n}\r\n\r\nexport default {\r\n __extends: __extends,\r\n __assign: __assign,\r\n __rest: __rest,\r\n __decorate: __decorate,\r\n __param: __param,\r\n __esDecorate: __esDecorate,\r\n __runInitializers: __runInitializers,\r\n __propKey: __propKey,\r\n __setFunctionName: __setFunctionName,\r\n __metadata: __metadata,\r\n __awaiter: __awaiter,\r\n __generator: __generator,\r\n __createBinding: __createBinding,\r\n __exportStar: __exportStar,\r\n __values: __values,\r\n __read: __read,\r\n __spread: __spread,\r\n __spreadArrays: __spreadArrays,\r\n __spreadArray: __spreadArray,\r\n __await: __await,\r\n __asyncGenerator: __asyncGenerator,\r\n __asyncDelegator: __asyncDelegator,\r\n __asyncValues: __asyncValues,\r\n __makeTemplateObject: __makeTemplateObject,\r\n __importStar: __importStar,\r\n __importDefault: __importDefault,\r\n __classPrivateFieldGet: __classPrivateFieldGet,\r\n __classPrivateFieldSet: __classPrivateFieldSet,\r\n __classPrivateFieldIn: __classPrivateFieldIn,\r\n __addDisposableResource: __addDisposableResource,\r\n __disposeResources: __disposeResources,\r\n __rewriteRelativeImportExtension: __rewriteRelativeImportExtension,\r\n};\r\n","/**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&\"adoptedStyleSheets\"in Document.prototype&&\"replace\"in CSSStyleSheet.prototype,s=Symbol(),o=new WeakMap;class n{constructor(t,e,o){if(this._$cssResult$=!0,o!==s)throw Error(\"CSSResult is not constructable. Use `unsafeCSS` or `css` instead.\");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const s=this.t;if(e&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=o.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&o.set(s,t))}return t}toString(){return this.cssText}}const r=t=>new n(\"string\"==typeof t?t:t+\"\",void 0,s),i=(t,...e)=>{const o=1===t.length?t[0]:e.reduce(((e,s,o)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if(\"number\"==typeof t)return t;throw Error(\"Value passed to 'css' function must be a 'css' function result: \"+t+\". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.\")})(s)+t[o+1]),t[0]);return new n(o,t,s)},S=(s,o)=>{if(e)s.adoptedStyleSheets=o.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const e of o){const o=document.createElement(\"style\"),n=t.litNonce;void 0!==n&&o.setAttribute(\"nonce\",n),o.textContent=e.cssText,s.appendChild(o)}},c=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e=\"\";for(const s of t.cssRules)e+=s.cssText;return r(e)})(t):t;export{n as CSSResult,S as adoptStyles,i as css,c as getCompatibleStyle,e as supportsAdoptingStyleSheets,r as unsafeCSS};\n//# sourceMappingURL=css-tag.js.map\n","import{getCompatibleStyle as t,adoptStyles as s}from\"./css-tag.js\";export{CSSResult,css,supportsAdoptingStyleSheets,unsafeCSS}from\"./css-tag.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const{is:i,defineProperty:e,getOwnPropertyDescriptor:h,getOwnPropertyNames:r,getOwnPropertySymbols:o,getPrototypeOf:n}=Object,a=globalThis,c=a.trustedTypes,l=c?c.emptyScript:\"\",p=a.reactiveElementPolyfillSupport,d=(t,s)=>t,u={toAttribute(t,s){switch(s){case Boolean:t=t?l:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,s){let i=t;switch(s){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},f=(t,s)=>!i(t,s),b={attribute:!0,type:String,converter:u,reflect:!1,useDefault:!1,hasChanged:f};Symbol.metadata??=Symbol(\"metadata\"),a.litPropertyMetadata??=new WeakMap;class y extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,s=b){if(s.state&&(s.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((s=Object.create(s)).wrapped=!0),this.elementProperties.set(t,s),!s.noAccessor){const i=Symbol(),h=this.getPropertyDescriptor(t,i,s);void 0!==h&&e(this.prototype,t,h)}}static getPropertyDescriptor(t,s,i){const{get:e,set:r}=h(this.prototype,t)??{get(){return this[s]},set(t){this[s]=t}};return{get:e,set(s){const h=e?.call(this);r?.call(this,s),this.requestUpdate(t,h,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??b}static _$Ei(){if(this.hasOwnProperty(d(\"elementProperties\")))return;const t=n(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(d(\"finalized\")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(d(\"properties\"))){const t=this.properties,s=[...r(t),...o(t)];for(const i of s)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const s=litPropertyMetadata.get(t);if(void 0!==s)for(const[t,i]of s)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[t,s]of this.elementProperties){const i=this._$Eu(t,s);void 0!==i&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(s){const i=[];if(Array.isArray(s)){const e=new Set(s.flat(1/0).reverse());for(const s of e)i.unshift(t(s))}else void 0!==s&&i.push(t(s));return i}static _$Eu(t,s){const i=s.attribute;return!1===i?void 0:\"string\"==typeof i?i:\"string\"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,s=this.constructor.elementProperties;for(const i of s.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return s(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,s,i){this._$AK(t,i)}_$ET(t,s){const i=this.constructor.elementProperties.get(t),e=this.constructor._$Eu(t,i);if(void 0!==e&&!0===i.reflect){const h=(void 0!==i.converter?.toAttribute?i.converter:u).toAttribute(s,i.type);this._$Em=t,null==h?this.removeAttribute(e):this.setAttribute(e,h),this._$Em=null}}_$AK(t,s){const i=this.constructor,e=i._$Eh.get(t);if(void 0!==e&&this._$Em!==e){const t=i.getPropertyOptions(e),h=\"function\"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:u;this._$Em=e,this[e]=h.fromAttribute(s,t.type)??this._$Ej?.get(e)??null,this._$Em=null}}requestUpdate(t,s,i){if(void 0!==t){const e=this.constructor,h=this[t];if(i??=e.getPropertyOptions(t),!((i.hasChanged??f)(h,s)||i.useDefault&&i.reflect&&h===this._$Ej?.get(t)&&!this.hasAttribute(e._$Eu(t,i))))return;this.C(t,s,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,s,{useDefault:i,reflect:e,wrapped:h},r){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,r??s??this[t]),!0!==h||void 0!==r)||(this._$AL.has(t)||(this.hasUpdated||i||(s=void 0),this._$AL.set(t,s)),!0===e&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,s]of this._$Ep)this[t]=s;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[s,i]of t){const{wrapped:t}=i,e=this[s];!0!==t||this._$AL.has(s)||void 0===e||this.C(s,void 0,i,e)}}let t=!1;const s=this._$AL;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(s)):this._$EM()}catch(s){throw t=!1,this._$EM(),s}t&&this._$AE(s)}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach((t=>this._$ET(t,this[t]))),this._$EM()}updated(t){}firstUpdated(t){}}y.elementStyles=[],y.shadowRootOptions={mode:\"open\"},y[d(\"elementProperties\")]=new Map,y[d(\"finalized\")]=new Map,p?.({ReactiveElement:y}),(a.reactiveElementVersions??=[]).push(\"2.1.0\");export{y as ReactiveElement,s as adoptStyles,u as defaultConverter,t as getCompatibleStyle,f as notEqual};\n//# sourceMappingURL=reactive-element.js.map\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst t=globalThis,i=t.trustedTypes,s=i?i.createPolicy(\"lit-html\",{createHTML:t=>t}):void 0,e=\"$lit$\",h=`lit$${Math.random().toFixed(9).slice(2)}$`,o=\"?\"+h,n=`<${o}>`,r=document,l=()=>r.createComment(\"\"),c=t=>null===t||\"object\"!=typeof t&&\"function\"!=typeof t,a=Array.isArray,u=t=>a(t)||\"function\"==typeof t?.[Symbol.iterator],d=\"[ \\t\\n\\f\\r]\",f=/<(?:(!--|\\/[^a-zA-Z])|(\\/?[a-zA-Z][^>\\s]*)|(\\/?$))/g,v=/-->/g,_=/>/g,m=RegExp(`>|${d}(?:([^\\\\s\"'>=/]+)(${d}*=${d}*(?:[^ \\t\\n\\f\\r\"'\\`<>=]|(\"|')|))|$)`,\"g\"),p=/'/g,g=/\"/g,$=/^(?:script|style|textarea|title)$/i,y=t=>(i,...s)=>({_$litType$:t,strings:i,values:s}),x=y(1),b=y(2),w=y(3),T=Symbol.for(\"lit-noChange\"),E=Symbol.for(\"lit-nothing\"),A=new WeakMap,C=r.createTreeWalker(r,129);function P(t,i){if(!a(t)||!t.hasOwnProperty(\"raw\"))throw Error(\"invalid template strings array\");return void 0!==s?s.createHTML(i):i}const V=(t,i)=>{const s=t.length-1,o=[];let r,l=2===i?\"<svg>\":3===i?\"<math>\":\"\",c=f;for(let i=0;i<s;i++){const s=t[i];let a,u,d=-1,y=0;for(;y<s.length&&(c.lastIndex=y,u=c.exec(s),null!==u);)y=c.lastIndex,c===f?\"!--\"===u[1]?c=v:void 0!==u[1]?c=_:void 0!==u[2]?($.test(u[2])&&(r=RegExp(\"</\"+u[2],\"g\")),c=m):void 0!==u[3]&&(c=m):c===m?\">\"===u[0]?(c=r??f,d=-1):void 0===u[1]?d=-2:(d=c.lastIndex-u[2].length,a=u[1],c=void 0===u[3]?m:'\"'===u[3]?g:p):c===g||c===p?c=m:c===v||c===_?c=f:(c=m,r=void 0);const x=c===m&&t[i+1].startsWith(\"/>\")?\" \":\"\";l+=c===f?s+n:d>=0?(o.push(a),s.slice(0,d)+e+s.slice(d)+h+x):s+h+(-2===d?i:x)}return[P(t,l+(t[s]||\"<?>\")+(2===i?\"</svg>\":3===i?\"</math>\":\"\")),o]};class N{constructor({strings:t,_$litType$:s},n){let r;this.parts=[];let c=0,a=0;const u=t.length-1,d=this.parts,[f,v]=V(t,s);if(this.el=N.createElement(f,n),C.currentNode=this.el.content,2===s||3===s){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(r=C.nextNode())&&d.length<u;){if(1===r.nodeType){if(r.hasAttributes())for(const t of r.getAttributeNames())if(t.endsWith(e)){const i=v[a++],s=r.getAttribute(t).split(h),e=/([.?@])?(.*)/.exec(i);d.push({type:1,index:c,name:e[2],strings:s,ctor:\".\"===e[1]?H:\"?\"===e[1]?I:\"@\"===e[1]?L:k}),r.removeAttribute(t)}else t.startsWith(h)&&(d.push({type:6,index:c}),r.removeAttribute(t));if($.test(r.tagName)){const t=r.textContent.split(h),s=t.length-1;if(s>0){r.textContent=i?i.emptyScript:\"\";for(let i=0;i<s;i++)r.append(t[i],l()),C.nextNode(),d.push({type:2,index:++c});r.append(t[s],l())}}}else if(8===r.nodeType)if(r.data===o)d.push({type:2,index:c});else{let t=-1;for(;-1!==(t=r.data.indexOf(h,t+1));)d.push({type:7,index:c}),t+=h.length-1}c++}}static createElement(t,i){const s=r.createElement(\"template\");return s.innerHTML=t,s}}function S(t,i,s=t,e){if(i===T)return i;let h=void 0!==e?s._$Co?.[e]:s._$Cl;const o=c(i)?void 0:i._$litDirective$;return h?.constructor!==o&&(h?._$AO?.(!1),void 0===o?h=void 0:(h=new o(t),h._$AT(t,s,e)),void 0!==e?(s._$Co??=[])[e]=h:s._$Cl=h),void 0!==h&&(i=S(t,h._$AS(t,i.values),h,e)),i}class M{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:i},parts:s}=this._$AD,e=(t?.creationScope??r).importNode(i,!0);C.currentNode=e;let h=C.nextNode(),o=0,n=0,l=s[0];for(;void 0!==l;){if(o===l.index){let i;2===l.type?i=new R(h,h.nextSibling,this,t):1===l.type?i=new l.ctor(h,l.name,l.strings,this,t):6===l.type&&(i=new z(h,this,t)),this._$AV.push(i),l=s[++n]}o!==l?.index&&(h=C.nextNode(),o++)}return C.currentNode=r,e}p(t){let i=0;for(const s of this._$AV)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,i),i+=s.strings.length-2):s._$AI(t[i])),i++}}class R{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,i,s,e){this.type=2,this._$AH=E,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=e,this._$Cv=e?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===t?.nodeType&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=S(this,t,i),c(t)?t===E||null==t||\"\"===t?(this._$AH!==E&&this._$AR(),this._$AH=E):t!==this._$AH&&t!==T&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):u(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==E&&c(this._$AH)?this._$AA.nextSibling.data=t:this.T(r.createTextNode(t)),this._$AH=t}$(t){const{values:i,_$litType$:s}=t,e=\"number\"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=N.createElement(P(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===e)this._$AH.p(i);else{const t=new M(e,this),s=t.u(this.options);t.p(i),this.T(s),this._$AH=t}}_$AC(t){let i=A.get(t.strings);return void 0===i&&A.set(t.strings,i=new N(t)),i}k(t){a(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let s,e=0;for(const h of t)e===i.length?i.push(s=new R(this.O(l()),this.O(l()),this,this.options)):s=i[e],s._$AI(h),e++;e<i.length&&(this._$AR(s&&s._$AB.nextSibling,e),i.length=e)}_$AR(t=this._$AA.nextSibling,i){for(this._$AP?.(!1,!0,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class k{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,i,s,e,h){this.type=1,this._$AH=E,this._$AN=void 0,this.element=t,this.name=i,this._$AM=e,this.options=h,s.length>2||\"\"!==s[0]||\"\"!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=E}_$AI(t,i=this,s,e){const h=this.strings;let o=!1;if(void 0===h)t=S(this,t,i,0),o=!c(t)||t!==this._$AH&&t!==T,o&&(this._$AH=t);else{const e=t;let n,r;for(t=h[0],n=0;n<h.length-1;n++)r=S(this,e[s+n],i,n),r===T&&(r=this._$AH[n]),o||=!c(r)||r!==this._$AH[n],r===E?t=E:t!==E&&(t+=(r??\"\")+h[n+1]),this._$AH[n]=r}o&&!e&&this.j(t)}j(t){t===E?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??\"\")}}class H extends k{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===E?void 0:t}}class I extends k{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==E)}}class L extends k{constructor(t,i,s,e,h){super(t,i,s,e,h),this.type=5}_$AI(t,i=this){if((t=S(this,t,i,0)??E)===T)return;const s=this._$AH,e=t===E&&s!==E||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,h=t!==E&&(s===E||e);e&&this.element.removeEventListener(this.name,this,s),h&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){\"function\"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class z{constructor(t,i,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){S(this,t)}}const Z={M:e,P:h,A:o,C:1,L:V,R:M,D:u,V:S,I:R,H:k,N:I,U:L,B:H,F:z},j=t.litHtmlPolyfillSupport;j?.(N,R),(t.litHtmlVersions??=[]).push(\"3.3.0\");const B=(t,i,s)=>{const e=s?.renderBefore??i;let h=e._$litPart$;if(void 0===h){const t=s?.renderBefore??null;e._$litPart$=h=new R(i.insertBefore(l(),t),t,void 0,s??{})}return h._$AI(t),h};export{Z as _$LH,x as html,w as mathml,T as noChange,E as nothing,B as render,b as svg};\n//# sourceMappingURL=lit-html.js.map\n","import{ReactiveElement as t}from\"@lit/reactive-element\";export*from\"@lit/reactive-element\";import{render as e,noChange as r}from\"lit-html\";export*from\"lit-html\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const s=globalThis;class i extends t{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=e(r,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return r}}i._$litElement$=!0,i[\"finalized\"]=!0,s.litElementHydrateSupport?.({LitElement:i});const o=s.litElementPolyfillSupport;o?.({LitElement:i});const n={_$AK:(t,e,r)=>{t._$AK(e,r)},_$AL:t=>t._$AL};(s.litElementVersions??=[]).push(\"4.2.0\");export{i as LitElement,n as _$LE};\n//# sourceMappingURL=lit-element.js.map\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst t=t=>(e,o)=>{void 0!==o?o.addInitializer((()=>{customElements.define(t,e)})):customElements.define(t,e)};export{t as customElement};\n//# sourceMappingURL=custom-element.js.map\n","import{defaultConverter as t,notEqual as e}from\"../reactive-element.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const o={attribute:!0,type:String,converter:t,reflect:!1,hasChanged:e},r=(t=o,e,r)=>{const{kind:n,metadata:i}=r;let s=globalThis.litPropertyMetadata.get(i);if(void 0===s&&globalThis.litPropertyMetadata.set(i,s=new Map),\"setter\"===n&&((t=Object.create(t)).wrapped=!0),s.set(r.name,t),\"accessor\"===n){const{name:o}=r;return{set(r){const n=e.get.call(this);e.set.call(this,r),this.requestUpdate(o,n,t)},init(e){return void 0!==e&&this.C(o,void 0,t,e),e}}}if(\"setter\"===n){const{name:o}=r;return function(r){const n=this[o];e.call(this,r),this.requestUpdate(o,n,t)}}throw Error(\"Unsupported decorator location: \"+n)};function n(t){return(e,o)=>\"object\"==typeof o?r(t,e,o):((t,e,o)=>{const r=e.hasOwnProperty(o);return e.constructor.createProperty(o,t),r?Object.getOwnPropertyDescriptor(e,o):void 0})(t,e,o)}export{n as property,r as standardProperty};\n//# sourceMappingURL=property.js.map\n","import{property as t}from\"./property.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */function r(r){return t({...r,state:!0,attribute:!1})}export{r as state};\n//# sourceMappingURL=state.js.map\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst e=(e,t,c)=>(c.configurable=!0,c.enumerable=!0,Reflect.decorate&&\"object\"!=typeof t&&Object.defineProperty(e,t,c),c);export{e as desc};\n//# sourceMappingURL=base.js.map\n","import{desc as t}from\"./base.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */function e(e,r){return(n,s,i)=>{const o=t=>t.renderRoot?.querySelector(e)??null;if(r){const{get:e,set:r}=\"object\"==typeof s?n:i??(()=>{const t=Symbol();return{get(){return this[t]},set(e){this[t]=e}}})();return t(n,s,{get(){let t=e.call(this);return void 0===t&&(t=o(this),(null!==t||this.hasUpdated)&&r.call(this,t)),t}})}return t(n,s,{get(){return o(this)}})}}export{e as query};\n//# sourceMappingURL=query.js.map\n","import type { ReactiveController, ReactiveElement } from 'lit'\n\ntype ObserveFunction = (oldValue: any, newValue: any, name: PropertyKey) => void\ntype ObserveLifecycle = 'update' | 'updated'\n\nclass PropertyObserverController<T extends ReactiveElement, TKey extends keyof T> implements ReactiveController {\n private _value?: T[TKey]\n\n constructor(\n private host: T,\n private key: TKey,\n private cb: ObserveFunction,\n private lifecycle: ObserveLifecycle,\n ) {\n host.addController(this)\n }\n\n hostUpdate() {\n if (this.lifecycle === 'update') {\n this.handle()\n }\n }\n\n hostUpdated() {\n if (this.lifecycle === 'updated') {\n this.handle()\n }\n }\n\n private handle() {\n const { key, _value, host } = this\n const newValue = host[key]\n\n if (_value !== newValue) {\n this._value = newValue\n this.cb.call(host, _value, newValue, key)\n }\n }\n}\n\nexport function observe(propertyName: string, lifecycle: ObserveLifecycle = 'update') {\n return function decorator(target: any, methodName: string) {\n const proto = target.constructor as typeof ReactiveElement\n\n proto.addInitializer((el) => {\n type Key = keyof typeof el\n const cb = el[methodName as Key] as ObserveFunction\n\n // since we can't get strong typing here, we can add a runtime check\n // this will get stripped out in prod, and should only ever happen in dev anyway\n if (process.env.NODE_ENV === 'development') {\n if (!(propertyName in el)) {\n throw new TypeError(\n `@observe: property '${propertyName}' does not exist.\\nPossible properties: ${Object.keys(target)\n .map(p => `'${p}'`)\n .join(', ')}`,\n )\n }\n }\n\n el.addController(new PropertyObserverController(el, propertyName as Key, cb, lifecycle))\n })\n }\n}\n","type EventsFromTransitions<T> = { [Prop in keyof T]: keyof T[Prop] }[keyof T]\n\nexport function fsm<\n TTransitions extends Record<TStates, Partial<Record<TEvents, TStates>>>,\n TStates extends keyof TTransitions,\n TEvents extends EventsFromTransitions<TTransitions>,\n>(config: TTransitions) {\n return {\n transition(currentState: TStates, event: TEvents) {\n const nextState = config[currentState][event] as TStates\n return nextState || currentState\n },\n }\n}\n\nexport type Machine = ReturnType<typeof fsm>\n\nexport type States<T extends Machine | Machine['transition']> = T extends Machine\n ? Parameters<T['transition']>[0]\n : T extends Machine['transition']\n ? Parameters<T>[0]\n : never\n\nexport type Events<T extends Machine | Machine['transition']> = T extends Machine\n ? Parameters<T['transition']>[1]\n : T extends Machine['transition']\n ? Parameters<T>[1]\n : never\n","import { html, LitElement } from 'lit'\nimport { customElement } from 'lit/decorators.js'\nimport style from './VisuallyHidden.css'\n\n/**\n * Visually hidden is used when an element needs to be available\n * to assistive technologies like screen readers, but be otherwise\n * hidden.\n *\n * @status ready\n * @category text\n * @slot - The visually hidden content.\n */\n@customElement('nord-visually-hidden')\nexport default class VisuallyHidden extends LitElement {\n static styles = style\n\n render() {\n return html`<slot></slot>`\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-visually-hidden': VisuallyHidden\n }\n}\n","import{nothing as t}from\"../lit-html.js\";\n/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const o=o=>o??t;export{o as ifDefined};\n//# sourceMappingURL=if-defined.js.map\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst t={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},e=t=>(...e)=>({_$litDirective$:t,values:e});class i{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}export{i as Directive,t as PartType,e as directive};\n//# sourceMappingURL=directive.js.map\n","import{nothing as t,noChange as i}from\"../lit-html.js\";import{Directive as r,PartType as s,directive as n}from\"../directive.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */class e extends r{constructor(i){if(super(i),this.it=t,i.type!==s.CHILD)throw Error(this.constructor.directiveName+\"() can only be used in child bindings\")}render(r){if(r===t||null==r)return this._t=void 0,this.it=r;if(r===i)return r;if(\"string\"!=typeof r)throw Error(this.constructor.directiveName+\"() called with a non-string value\");if(r===this.it)return this._t;this.it=r;const s=[r];return s.raw=s,this._t={_$litType$:this.constructor.resultType,strings:s,values:[]}}}e.directiveName=\"unsafeHTML\",e.resultType=1;const o=n(e);export{e as UnsafeHTMLDirective,o as unsafeHTML};\n//# sourceMappingURL=unsafe-html.js.map\n","import { nothing } from 'lit'\n\n// NOTE: the below generic versions cannot be used until this bug is fixed: https://github.com/runem/lit-analyzer/issues/207\n// since lit-analyzer does not understand the use of nothing\n\n// /**\n// * if value is truthy, return it, otherwise return nothing\n// */\n// export function cond<T>(value: T): NonNullable<T> | typeof nothing\n\n// /**\n// * if condition is truthy, return trueCase, otherwise return nothing\n// */\n// export function cond<T>(condition: unknown, trueCase: T): T | typeof nothing\n\n// /**\n// * condition is true, so always return trueCase\n// */\n// export function cond<T>(condition: true, trueCase: T): T\n\n// /**\n// * condition is false, to will always return nothing\n// */\n// export function cond<T>(condition: false, trueCase: T): typeof nothing\n\n// /**\n// * if condition is truthy, return trueCase, otherwise return falseCase\n// */\n// export function cond<T, F>(condition: unknown, trueCase: T, falseCase: F): T | F\n\n// /**\n// * condition is true, so always return trueCase\n// */\n// export function cond<T, F>(condition: true, trueCase: T, falseCase: F): T\n\n// /**\n// * condition is false, so always return falseCase\n// */\n// export function cond<T, F>(condition: false, trueCase: T, falseCase: F): F\n\n/**\n * if value is truthy, return it, otherwise return nothing\n */\nexport function cond(value: any): typeof value | typeof nothing\n\n/**\n * if condition is truthy, return trueCase, otherwise return nothing\n */\nexport function cond(condition: unknown, trueCase: any): typeof trueCase | typeof nothing\n\n/**\n * condition is true, so always return trueCase\n */\nexport function cond(condition: true, trueCase: any): typeof trueCase\n\n/**\n * condition is false, to will always return nothing\n */\nexport function cond(condition: false, trueCase: any): typeof nothing\n\n/**\n * if condition is truthy, return trueCase, otherwise return falseCase\n */\nexport function cond(condition: unknown, trueCase: any, falseCase: any): typeof trueCase | typeof falseCase\n\n/**\n * condition is true, so always return trueCase\n */\nexport function cond(condition: true, trueCase: any, falseCase: any): typeof trueCase\n\n/**\n * condition is false, so always return falseCase\n */\nexport function cond(condition: false, trueCase: any, falseCase: any): typeof falseCase\n\nexport function cond(condition: unknown, trueCase: any = condition, falseCase: any = nothing) {\n return condition ? trueCase : falseCase\n}\n","export type IconResolver = (iconName: string) => Promise<string>\n\n// in dev we should just load from node_modules\nconst loadIcon: IconResolver = (name: string) =>\n import(/* @vite-ignore */ `@nordhealth/icons/lib/assets/${name}.js`).then(({ default: svg }) => svg)\n\n// in prod we should load from the CDN, as a sensible default\nconst loadIconCdn: IconResolver = (name: string) =>\n fetch(`https://nordcdn.net/ds/icons/${process.env.ICON_VERSION}/assets/${name}.svg`).then((response) => {\n if (!response.ok) {\n throw new TypeError(`NORD: unknown icon: '${name}'`)\n }\n\n return response.text()\n })\n\nexport class IconManager {\n private cache = new Map<string, string | Promise<string>>()\n resolver: IconResolver = process.env.NODE_ENV === 'development' ? loadIcon : loadIconCdn\n\n resolve(name: string, onResolved: (svg: string) => void) {\n let cached = this.cache.get(name)\n\n // if it's a string, we can resolve immediately\n if (typeof cached === 'string') {\n onResolved(cached)\n return\n }\n\n // if it's null, then we should initiate a fetch\n if (!cached) {\n cached = this.resolver(name)\n .catch(() => '')\n .then((svg) => {\n // replace the promise with the resolved value, for faster resolution next time\n this.cache.set(name, svg)\n return svg\n })\n\n // store the promise so that duplicate icons do not make separate requests\n this.cache.set(name, cached)\n }\n\n cached.then(onResolved)\n }\n\n registerIcon(iconOrName: string | { title: string, default: string }, icon?: string) {\n let name: string | undefined\n let svg: string | undefined\n\n if (typeof iconOrName === 'string') {\n name = iconOrName\n svg = icon\n }\n else {\n name = iconOrName.title\n svg = iconOrName.default\n }\n\n // handle errors\n if (!name) {\n throw new Error('name is required when registering an icon')\n }\n if (!svg) {\n throw new Error('icon must not be empty')\n }\n\n this.cache.set(name, svg)\n }\n\n clear() {\n this.cache.clear()\n }\n}\n","import type { IconResolver } from './IconManager.js'\nimport { html, LitElement } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js'\nimport { observe } from '../common/decorators/observe.js'\n\nimport { cond } from '../common/directives/cond.js'\nimport componentStyle from '../common/styles/Component.css'\nimport style from './Icon.css'\nimport { IconManager } from './IconManager.js'\n\n/**\n * Icons are used to provide additional meaning or in places where text label doesn’t fit.\n * Icon component allows you to display an icon from the Nordicons library.\n *\n * @status ready\n * @category image\n * @slot - The default slot used for placing a custom SVG icon.\n */\n@customElement('nord-icon')\nexport default class Icon extends LitElement {\n static styles = [componentStyle, style]\n\n private static manager = new IconManager()\n\n /**\n * Register a custom icon resolver, which accepts the icon name as an parameter, and returns an SVG string.\n * Can return a string synchronously, or a promise of a string.\n * By default, will load icons from the Nord CDN.\n * @param resolver The resolver function to register.\n */\n static registerResolver(resolver: IconResolver) {\n this.manager.resolver = resolver\n }\n\n /**\n * Register an individual icon so it can be rendered synchronously, to avoid loading over the network.\n * @param icon An object representing the icon to be registered, where \"title\" is the icon's name, and \"default\" is the SVG string.\n * This is intended to be used in cases where you import an icon's entire ES module and register it directly.\n */\n static registerIcon(icon: { title: string, default: string }): void\n\n /**\n * Register an individual icon so it can be rendered synchronously, to avoid loading over the network.\n * @param name The name of the icon to be registered.\n * @param icon The SVG string for the icon.\n */\n static registerIcon(name: string, icon: string): void\n\n /**\n * Register an individual icon so it can be rendered synchronously, to avoid loading over the network.\n * @param iconOrName The name of the icon to be registered or an object representing the icon to be registered, where \"title\" is the icon's name, and \"default\" is the SVG string.\n * @param icon The SVG string for the icon.\n */\n static registerIcon(iconOrName: string | { title: string, default: string }, icon?: string) {\n return this.manager.registerIcon(iconOrName, icon)\n }\n\n /**\n * The name of the icon to display, as defined by [nordicons](/nordicons/).\n */\n @property({ reflect: true }) name: string = ''\n\n /**\n * The size of the icon.\n * @default \"m\"\n */\n @property({ reflect: true }) size?: 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl'\n\n /**\n * The color of the icon.\n * Can accept any valid CSS color value, including custom properties.\n */\n @property({ reflect: true }) color?: string\n\n /**\n * An accessible label for the icon.\n * If no label is supplied, the icon is hidden from assistive technology.\n */\n @property({ reflect: true }) label?: string\n\n @state() private svg: string = ''\n\n render() {\n // if a label is supplied, we give the div a role of img.\n // without this we could not use aria-label, since it is only valid on elements of certain roles.\n // we always hide the inner svg, since the svg does not have any text/title/label itself.\n return html`\n <div\n role=${cond(this.label, 'img')}\n style=${cond(this.color, `color:${this.color}`)}\n aria-label=${ifDefined(this.label)}\n >\n <slot aria-hidden=\"true\"></slot>\n <div aria-hidden=\"true\">${unsafeHTML(this.svg)}</div>\n </div>\n `\n }\n\n @observe('name')\n protected handleNameChange() {\n if (!this.name) {\n this.svg = ''\n return\n }\n\n Icon.manager.resolve(this.name, (svg) => {\n this.svg = svg\n })\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-icon': Icon\n }\n}\n","import type { States } from '../common/fsm.js'\nimport { html, LitElement, nothing } from 'lit'\n\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { observe } from '../common/decorators/observe.js'\nimport { fsm } from '../common/fsm.js'\nimport componentStyle from '../common/styles/Component.css'\nimport style from './Avatar.css'\nimport '../visually-hidden/VisuallyHidden.js'\nimport '../icon/Icon.js'\n\nconst { transition } = fsm({\n initial: {\n 'src-set': 'loading',\n },\n loading: {\n 'load': 'loaded',\n 'error': 'initial',\n 'src-clear': 'initial',\n },\n loaded: {\n 'src-set': 'loading',\n 'src-clear': 'initial',\n },\n})\n\n/**\n * Avatar is used for showing a thumbnail representation of a single user or entity.\n * Default avatar illustration is displayed when no src is specified.\n *\n * @status ready\n * @category image\n *\n * @cssprop [--n-avatar-color=var(--n-color-status-highlight)] - Controls the color of the avatar fallback, using [color tokens](/tokens/#color).\n * @cssprop [--n-avatar-size=var(--n-size-icon-l)] - Controls the size of the avatar, using [icon sizing tokens](/tokens/#size).\n * @cssprop [--n-avatar-box-shadow=none] - Controls the box shadow for the avatar.\n * @cssprop [--n-avatar-text-color=var(--n-color-text-on-accent)] - Controls the color of the avatar’s text and icon, using [color tokens](/tokens/#color).\n */\n\n@customElement('nord-avatar')\nexport default class Avatar extends LitElement {\n static styles = [componentStyle, style]\n\n @state() private state: States<typeof transition> = 'initial'\n\n /**\n * The size of the avatar.\n */\n @property({ reflect: true }) size: 's' | 'm' | 'l' | 'xl' | 'xxl' | 'xxxl' = 'm'\n\n /**\n * The URL of the avatar image uploaded by the user.\n */\n @property({ reflect: true }) src?: string\n\n /**\n * The name of the person or entity.\n */\n @property({ reflect: true }) name: string = ''\n\n /**\n * The fallback icon.\n */\n @property({ reflect: true }) icon?: string\n\n /**\n * The style variant of the avatar.\n */\n @property({ reflect: true }) variant: 'default' | 'square' = 'default'\n\n render() {\n return html`\n <div class=\"n-avatar\">\n ${this.state !== 'initial' ? this.renderImage() : nothing}\n ${this.state !== 'loaded' ? this.renderFallback() : nothing}\n </div>\n `\n }\n\n @observe('src')\n protected handleSrcChange() {\n const event = this.src ? 'src-set' : 'src-clear'\n this.state = transition(this.state, event)\n }\n\n protected renderImage() {\n return this.src\n ? html`\n <slot hidden></slot>\n <img\n class=\"n-${this.state}\"\n src=${this.src}\n @load=${this.handleLoad}\n @error=${this.handleError}\n alt=${this.name || ''}\n />\n `\n : nothing\n }\n\n protected renderFallback() {\n return html`\n <nord-visually-hidden>${this.name}</nord-visually-hidden>\n <div class=\"n-avatar-inner\" aria-hidden=\"true\">\n <slot></slot>\n </div>\n ${this.icon\n ? html`<nord-icon name=\"${this.icon}\"></nord-icon>`\n : html`\n <svg aria-hidden=\"true\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 27 27\">\n <rect fill=\"var(--_n-avatar-color)\" height=\"27\" rx=\"12\" width=\"27\" x=\"0\" y=\"0\"></rect>\n <g fill=\"#fff\" opacity=\".7\">\n <circle cx=\"13.5\" cy=\"30\" r=\"13\"></circle>\n <circle cx=\"13.5\" cy=\"11\" r=\"5\"></circle>\n </g>\n </svg>\n `}\n `\n }\n\n private handleLoad() {\n this.state = transition(this.state, 'load')\n }\n\n private handleError() {\n this.state = transition(this.state, 'error')\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-avatar': Avatar\n }\n}\n","import { html, LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport componentStyle from '../common/styles/Component.css'\nimport style from './Badge.css'\n\n/**\n * Badges are used to inform users of the status of an object\n * or of an action that’s been taken. Commonly used in tabular\n * data to indicate status.\n *\n * @status ready\n * @category text\n * @slot - The badge content.\n * @slot icon - Used to place an icon at the start of badge.\n */\n@customElement('nord-badge')\nexport default class Badge extends LitElement {\n static styles = [componentStyle, style]\n\n /**\n * The type of badge.\n * Determines the background color of the badge.\n * @deprecated Use `variant` instead. If you previously used `\"progress\"`, use `\"info\"` instead.\n * @default \"neutral\"\n */\n @property({ reflect: true }) type?: 'warning' | 'success' | 'danger' | 'highlight' | 'info' | 'neutral' | 'progress'\n\n /**\n * The style variant of the badge.\n * Determines the background color of the badge.\n * @default \"neutral\"\n */\n @property({ reflect: true }) variant?: 'warning' | 'success' | 'danger' | 'highlight' | 'neutral' | 'info'\n\n /**\n * Strong badges are a secondary style for badges.\n * They provide more visual prominence and emphasize them.\n */\n @property({ reflect: true, type: Boolean }) strong = false\n\n render() {\n return html`\n <span class=\"n-badge\">\n <slot name=\"icon\"></slot>\n <slot></slot>\n </span>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-badge': Badge\n }\n}\n","export default '<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m13.3 6.38 1.49 1.33-5.32 5.95c-.18.21-.44.33-.72.33 0 0-.02 0-.03 0-.26 0-.52-.1-.71-.29l-2.86-2.86 1.41-1.41 2.12 2.12 4.61-5.17zm6.7 3.62c0 5.51-4.49 10-10 10s-10-4.49-10-10 4.49-10 10-10 10 4.49 10 10zm-2 0c0-4.41-3.59-8-8-8s-8 3.59-8 8 3.59 8 8 8 8-3.59 8-8z\" fill=\"currentColor\"/></svg>';\nexport const title = \"interface-checked-circle\";\nexport const tags =\n \"nordicon interface circle round checked checkmark ready done success\";\n","export default '<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m11.15 15c0 .64-.51 1.15-1.15 1.15s-1.15-.51-1.15-1.15.51-1.15 1.15-1.15 1.15.51 1.15 1.15zm8.85-5c0 5.51-4.49 10-10 10s-10-4.49-10-10 4.49-10 10-10 10 4.49 10 10zm-2 0c0-4.41-3.59-8-8-8s-8 3.59-8 8 3.59 8 8 8 8-3.59 8-8zm-8-5.5c-1.93 0-3.5 1.57-3.5 3.5h2c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5-.67 1.5-1.5 1.5c-.55 0-1 .45-1 1v1.5h2v-.65c1.44-.43 2.5-1.77 2.5-3.35 0-1.93-1.57-3.5-3.5-3.5z\" fill=\"currentColor\"/></svg>';\nexport const title = \"interface-help\";\nexport const tags =\n \"nordicon interface help speech bubble support circle round question mark\";\n","export default '<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m8.7 6c0-.72.58-1.3 1.3-1.3s1.3.58 1.3 1.3-.58 1.3-1.3 1.3-1.3-.58-1.3-1.3zm-8.7 4c0-5.51 4.49-10 10-10s10 4.49 10 10-4.49 10-10 10-10-4.49-10-10zm2 0c0 4.41 3.59 8 8 8s8-3.59 8-8-3.59-8-8-8-8 3.59-8 8zm7 5h2v-6h-2z\" fill=\"currentColor\"/></svg>';\nexport const title = \"interface-info\";\nexport const tags =\n \"nordicon interface info circle round alert notice information\";\n","export default '<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m11.1502 13c0 .64-.51 1.15-1.15 1.15-.63998 0-1.14998-.51-1.14998-1.15s.51-1.15 1.14998-1.15c.64 0 1.15.51 1.15 1.15zm-2.14998-2h1.99998v-5h-1.99998zm10.51998 6.01c-.36.62-1.01.99-1.73.99h-15.58998c-.72 0-1.360004-.37-1.730004-.99-.36-.62-.37-1.36-.02-1.99l7.800004-13.95c.36-.629997 1.03-1.0199969 1.74998-1.0199969.72 0 1.39.3899999 1.75 1.0199969l7.8 13.95c.35.63.34 1.37-.02 1.99zm-1.72-1.01-7.8-13.95-7.79998 13.95z\" fill=\"currentColor\"/></svg>';\nexport const title = \"interface-warning\";\nexport const tags =\n \"nordicon interface warning exclamation mark triangle shape alert error\";\n","import * as successIcon from '@nordhealth/icons/lib/assets/interface-checked-circle.js'\nimport * as warningIcon from '@nordhealth/icons/lib/assets/interface-help.js'\nimport * as infoIcon from '@nordhealth/icons/lib/assets/interface-info.js'\nimport * as dangerIcon from '@nordhealth/icons/lib/assets/interface-warning.js'\nimport { html, LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport componentStyle from '../common/styles/Component.css'\n\nimport Icon from '../icon/Icon.js'\nimport style from './Banner.css'\n\nIcon.registerIcon(warningIcon)\nIcon.registerIcon(dangerIcon)\nIcon.registerIcon(infoIcon)\nIcon.registerIcon(successIcon)\n\nconst iconMap: Record<Banner['variant'], string> = {\n warning: warningIcon.title,\n danger: dangerIcon.title,\n info: infoIcon.title,\n success: successIcon.title,\n}\n\n/**\n * Banner informs users about important changes or conditions in the\n * interface. Use this component if you need to communicate to users\n * in a prominent way.\n *\n * @status ready\n * @category feedback\n * @slot - default slot\n *\n * @cssprop [--n-banner-border-radius=var(--n-border-radius)] - Controls how rounded the corners are, using [border radius tokens](/tokens/#border-radius).\n * @cssprop [--n-banner-box-shadow=var(--n-box-shadow-card)] - Controls the surrounding shadow, using [box shadow tokens](/tokens/#box-shadow).\n */\n@customElement('nord-banner')\nexport default class Banner extends LitElement {\n static styles = [componentStyle, style]\n\n /**\n * The style variant of the banner.\n */\n @property({ reflect: true }) variant: 'info' | 'danger' | 'success' | 'warning' = 'info'\n\n render() {\n const icon = iconMap[this.variant] || iconMap.info\n\n return html`\n <div class=\"n-banner\" role=\"alert\">\n <nord-stack align-items=\"start\" direction=\"horizontal\">\n <nord-icon name=${icon} size=\"m\"></nord-icon>\n <div class=\"n-banner-content\">\n <slot></slot>\n </div>\n </nord-stack>\n </div>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-banner': Banner\n }\n}\n","import{noChange as t}from\"../lit-html.js\";import{directive as s,Directive as i,PartType as r}from\"../directive.js\";\n/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const e=s(class extends i{constructor(t){if(super(t),t.type!==r.ATTRIBUTE||\"class\"!==t.name||t.strings?.length>2)throw Error(\"`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.\")}render(t){return\" \"+Object.keys(t).filter((s=>t[s])).join(\" \")+\" \"}update(s,[i]){if(void 0===this.st){this.st=new Set,void 0!==s.strings&&(this.nt=new Set(s.strings.join(\" \").split(/\\s/).filter((t=>\"\"!==t))));for(const t in i)i[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(i)}const r=s.element.classList;for(const t of this.st)t in i||(r.remove(t),this.st.delete(t));for(const t in i){const s=!!i[t];s===this.st.has(t)||this.nt?.has(t)||(s?(r.add(t),this.st.add(t)):(r.remove(t),this.st.delete(t)))}return t}});export{e as classMap};\n//# sourceMappingURL=class-map.js.map\n","import type { ReactiveController, ReactiveControllerHost } from 'lit'\nimport { isServer } from 'lit'\n\nexport type WritingDirection = 'ltr' | 'rtl'\n\nexport class DirectionController implements ReactiveController {\n // these are all static as we only want a single observer on <html>\n private static hosts = new Set<ReactiveControllerHost>()\n private static observer?: MutationObserver\n\n get dir(): WritingDirection {\n if (!isServer && document.documentElement.dir) {\n return document.documentElement.dir as WritingDirection\n }\n\n return 'ltr'\n }\n\n get isLTR() {\n return this.dir === 'ltr'\n }\n\n get isRTL() {\n return this.dir === 'rtl'\n }\n\n constructor(private host: ReactiveControllerHost) {\n this.host.addController(this)\n }\n\n hostConnected() {\n if (!DirectionController.observer) {\n DirectionController.observer = new MutationObserver(DirectionController.observe)\n DirectionController.observer.observe(document.documentElement, { attributes: true, attributeFilter: ['dir'] })\n }\n\n if (!DirectionController.hosts.has(this.host)) {\n DirectionController.hosts.add(this.host)\n }\n }\n\n hostDisconnected() {\n DirectionController.hosts.delete(this.host)\n }\n\n private static observe() {\n DirectionController.hosts.forEach(host => host.requestUpdate())\n }\n}\n","import type { ReactiveController, ReactiveControllerHost } from 'lit'\n\ninterface ShadowRootEventMap {\n slotchange: Event\n}\n\nexport class EventController implements ReactiveController {\n private listeners: Array<() => void> = []\n\n constructor(host: ReactiveControllerHost) {\n host.addController(this)\n }\n\n hostDisconnected() {\n this.listeners.forEach(stop => stop())\n this.listeners = []\n }\n\n listen<K extends keyof WindowEventMap>(\n window: Window,\n type: K,\n listener: (this: Window, ev: WindowEventMap[K]) => void,\n options?: boolean | AddEventListenerOptions\n ): void\n\n listen<K extends keyof DocumentEventMap>(\n document: Document,\n type: K,\n listener: (this: Document, ev: DocumentEventMap[K]) => void,\n options?: boolean | AddEventListenerOptions\n ): void\n\n listen<K extends keyof HTMLElementEventMap>(\n element: HTMLElement,\n type: K,\n listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => void,\n options?: boolean | AddEventListenerOptions\n ): void\n\n listen<K extends keyof ShadowRootEventMap>(\n element: ShadowRoot,\n type: K,\n listener: (this: ShadowRoot, ev: ShadowRootEventMap[K]) => void,\n options?: boolean | AddEventListenerOptions\n ): void\n\n listen<K extends keyof MediaQueryListEventMap>(\n element: MediaQueryList,\n type: K,\n listener: (this: ShadowRoot, ev: MediaQueryListEventMap[K]) => void,\n options?: boolean | AddEventListenerOptions\n ): void\n\n listen(\n element: EventTarget,\n type: string,\n listener: (this: EventTarget, ev: Event) => void,\n options?: boolean | AddEventListenerOptions\n ): void\n\n listen(\n element: EventTarget,\n type: string,\n listener: (this: EventTarget, ev: Event) => void,\n options?: boolean | AddEventListenerOptions,\n ) {\n element?.addEventListener(type, listener, options)\n\n const stop = () => element?.removeEventListener(type, listener, options)\n this.listeners.push(stop)\n }\n}\n","import type { ReactiveController, ReactiveControllerHost } from 'lit'\nimport { isServer } from 'lit'\nimport { EventController } from './EventController.js'\n\nexport class SlotController implements ReactiveController {\n private events: EventController\n private selector: string\n\n constructor(\n protected host: ReactiveControllerHost & HTMLElement,\n public slotName: string = '',\n ) {\n host.addController(this)\n this.events = new EventController(host)\n this.selector = slotName ? `:scope > [slot=\"${slotName}\"]` : `:scope > :not([slot])`\n }\n\n hostConnected() {\n if (this.host.shadowRoot) {\n this.events.listen(this.host.shadowRoot, 'slotchange', this.handleSlotChange)\n }\n }\n\n get hasContent() {\n return this.content != null\n }\n\n get isEmpty() {\n return !this.hasContent\n }\n\n get content() {\n if (isServer) {\n return null\n }\n\n return this.host.querySelector(this.selector)\n }\n\n get assigned() {\n if (isServer) {\n return []\n }\n\n return Array.from(this.host.querySelectorAll(this.selector))\n }\n\n private handleSlotChange = (e: Event) => {\n const slot = e.target as HTMLSlotElement\n\n if (slot.name === this.slotName) {\n this.onChange(e)\n }\n }\n\n protected onChange(_e: Event) {\n this.host.requestUpdate()\n }\n}\n","import { html, LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { classMap } from 'lit/directives/class-map.js'\nimport { DirectionController } from '../common/controllers/DirectionController.js'\nimport { SlotController } from '../common/controllers/SlotController.js'\nimport componentStyle from '../common/styles/Component.css'\nimport style from './ButtonGroup.css'\n\n/**\n * Button groups are designed to bring together button controls that are of a similar nature. For example text formatting controls.\n *\n * @status ready\n * @category structure\n * @slot - The button group content\n *\n * @cssprop [--n-button-group-border-radius=var(--n-border-radius-s)] - Controls the rounded corners of the button group, using [border radius tokens](/tokens/#border-radius). Only relevant for the default variant.\n * @cssprop [--n-button-group-box-shadow=var(--n-box-shadow)] - Controls the surrounding shadow, using [box shadow tokens](/tokens/#box-shadow). Only relevant for the default variant.\n */\n@customElement('nord-button-group')\nexport default class ButtonGroup extends LitElement {\n static styles = [componentStyle, style]\n\n private defaultSlot = new SlotController(this)\n private dirController = new DirectionController(this)\n\n /**\n * The style variant of the button group.\n */\n @property({ reflect: true }) variant: 'default' | 'spaced' = 'default'\n\n /**\n * The direction of the button group.\n */\n @property({ reflect: true }) direction: 'vertical' | 'horizontal' = 'horizontal'\n\n /**\n * Defines whether the buttons are forced in a single line\n * or can be flowed into multiple lines (only applied when variant is set to `spaced`).\n */\n @property({ reflect: true, type: Boolean }) wrap = false\n\n /**\n * The appropriate role for the containing element.\n */\n\n @property({ reflect: true }) role: string = 'group'\n\n render() {\n const hasSmallButtons = this.defaultSlot.assigned.every((node) => {\n if (node.localName === 'nord-button' || node.localName === 'nord-select') {\n return node.getAttribute('size') === 's'\n }\n\n return true\n })\n\n const hasMultipleButtons = this.defaultSlot.assigned.length > 1\n\n return html`\n <div\n class=${classMap({\n 'n-button-group': true,\n 'n-rtl': this.dirController.isRTL,\n 'n-small-gap': hasSmallButtons && this.variant === 'spaced',\n 'n-multiple-buttons': hasMultipleButtons,\n })}\n >\n <slot></slot>\n </div>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-button-group': ButtonGroup\n }\n}\n","import{_$LH as o}from\"./lit-html.js\";\n/**\n * @license\n * Copyright 2020 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const{I:t}=o,i=o=>null===o||\"object\"!=typeof o&&\"function\"!=typeof o,n={HTML:1,SVG:2,MATHML:3},e=(o,t)=>void 0===t?void 0!==o?._$litType$:o?._$litType$===t,l=o=>null!=o?._$litType$?.h,c=o=>void 0!==o?._$litDirective$,d=o=>o?._$litDirective$,f=o=>void 0===o.strings,s=()=>document.createComment(\"\"),r=(o,i,n)=>{const e=o._$AA.parentNode,l=void 0===i?o._$AB:i._$AA;if(void 0===n){const i=e.insertBefore(s(),l),c=e.insertBefore(s(),l);n=new t(i,c,o,o.options)}else{const t=n._$AB.nextSibling,i=n._$AM,c=i!==o;if(c){let t;n._$AQ?.(o),n._$AM=o,void 0!==n._$AP&&(t=o._$AU)!==i._$AU&&n._$AP(t)}if(t!==l||c){let o=n._$AA;for(;o!==t;){const t=o.nextSibling;e.insertBefore(o,l),o=t}}}return n},v=(o,t,i=o)=>(o._$AI(t,i),o),u={},m=(o,t=u)=>o._$AH=t,p=o=>o._$AH,M=o=>{o._$AP?.(!1,!0);let t=o._$AA;const i=o._$AB.nextSibling;for(;t!==i;){const o=t.nextSibling;t.remove(),t=o}},h=o=>{o._$AR()};export{n as TemplateResultType,h as clearPart,p as getCommittedValue,d as getDirectiveClass,r as insertPart,l as isCompiledTemplateResult,c as isDirectiveResult,i as isPrimitive,f as isSingleExpression,e as isTemplateResult,M as removePart,v as setChildPartValue,m as setCommittedValue};\n//# sourceMappingURL=directive-helpers.js.map\n","import{isSingleExpression as i}from\"./directive-helpers.js\";import{Directive as t,PartType as e}from\"./directive.js\";export{directive}from\"./directive.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const s=(i,t)=>{const e=i._$AN;if(void 0===e)return!1;for(const i of e)i._$AO?.(t,!1),s(i,t);return!0},o=i=>{let t,e;do{if(void 0===(t=i._$AM))break;e=t._$AN,e.delete(i),i=t}while(0===e?.size)},r=i=>{for(let t;t=i._$AM;i=t){let e=t._$AN;if(void 0===e)t._$AN=e=new Set;else if(e.has(i))break;e.add(i),c(t)}};function h(i){void 0!==this._$AN?(o(this),this._$AM=i,r(this)):this._$AM=i}function n(i,t=!1,e=0){const r=this._$AH,h=this._$AN;if(void 0!==h&&0!==h.size)if(t)if(Array.isArray(r))for(let i=e;i<r.length;i++)s(r[i],!1),o(r[i]);else null!=r&&(s(r,!1),o(r));else s(this,i)}const c=i=>{i.type==e.CHILD&&(i._$AP??=n,i._$AQ??=h)};class f extends t{constructor(){super(...arguments),this._$AN=void 0}_$AT(i,t,e){super._$AT(i,t,e),r(this),this.isConnected=i._$AU}_$AO(i,t=!0){i!==this.isConnected&&(this.isConnected=i,i?this.reconnected?.():this.disconnected?.()),t&&(s(this,i),o(this))}setValue(t){if(i(this._$Ct))this._$Ct._$AI(t,this);else{const i=[...this._$Ct._$AH];i[this._$Ci]=t,this._$Ct._$AI(i,this,0)}}disconnected(){}reconnected(){}}export{f as AsyncDirective,t as Directive,e as PartType};\n//# sourceMappingURL=async-directive.js.map\n","import{nothing as t}from\"../lit-html.js\";import{AsyncDirective as i}from\"../async-directive.js\";import{directive as s}from\"../directive.js\";\n/**\n * @license\n * Copyright 2020 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const e=()=>new h;class h{}const o=new WeakMap,n=s(class extends i{render(i){return t}update(i,[s]){const e=s!==this.G;return e&&void 0!==this.G&&this.rt(void 0),(e||this.lt!==this.ct)&&(this.G=s,this.ht=i.options?.host,this.rt(this.ct=i.element)),t}rt(t){if(this.isConnected||(t=void 0),\"function\"==typeof this.G){const i=this.ht??globalThis;let s=o.get(i);void 0===s&&(s=new WeakMap,o.set(i,s)),void 0!==s.get(this.G)&&this.G.call(this.ht,void 0),s.set(this.G,t),void 0!==t&&this.G.call(this.ht,t)}else this.G.value=t}get lt(){return\"function\"==typeof this.G?o.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});export{e as createRef,n as ref};\n//# sourceMappingURL=ref.js.map\n","import type { ReactiveController, ReactiveControllerHost, RenderOptions } from 'lit'\nimport { render } from 'lit'\n\ninterface LightDomOptions {\n render: () => unknown\n renderOptions?: RenderOptions\n container?: HTMLElement\n}\n\nexport class LightDomController implements ReactiveController {\n constructor(\n private host: ReactiveControllerHost & HTMLElement,\n private options: LightDomOptions,\n ) {\n host.addController(this)\n }\n\n private get container(): HTMLElement {\n return this.options.container || this.host\n }\n\n hostUpdated() {\n this.render()\n }\n\n private render() {\n render(this.options.render(), this.container, this.options.renderOptions)\n }\n}\n","import type { LitElement } from 'lit'\nimport type { Ref } from 'lit/directives/ref.js'\nimport { createRef } from 'lit/directives/ref.js'\n\ntype Constructable<T = Record<string, unknown>> = new (...args: any[]) => T\n\nexport declare class FocusableMixinInterface {\n protected focusableRef: Ref<HTMLElement>\n focus(options?: FocusOptions): void\n blur(): void\n click(): void\n}\n\nexport function FocusableMixin<T extends Constructable<LitElement>>(superClass: T) {\n class FocusableElement extends superClass {\n protected focusableRef = createRef<HTMLElement>()\n\n /**\n * Programmatically move focus to the component.\n * @param {FocusOptions} options An object which controls aspects of the focusing process.\n */\n focus(options?: FocusOptions) {\n this.focusableRef.value?.focus(options)\n }\n\n /**\n * Programmatically remove focus from the component.\n */\n blur() {\n this.focusableRef.value?.blur()\n }\n\n /**\n * Programmatically simulates a click on the component.\n */\n click() {\n this.focusableRef.value?.click()\n }\n }\n\n return FocusableElement as unknown as Constructable<FocusableMixinInterface> & T\n}\n","import type { LitElement } from 'lit'\nimport { property } from 'lit/decorators.js'\n\ntype Constructor<T = Record<string, unknown>> = new (...args: any[]) => T\n\nexport declare class InputMixinInterface {\n name?: string\n value: string\n disabled: boolean\n protected _formId?: string\n set form(id: string)\n get form(): HTMLFormElement | null\n}\n\nexport function InputMixin<T extends Constructor<LitElement>>(superClass: T): Constructor<InputMixinInterface> & T {\n class InputElement extends superClass {\n /**\n * Makes the component disabled. This prevents users from\n * being able to interact with the component, and conveys\n * its inactive state to assistive technologies.\n */\n @property({ type: Boolean, reflect: true }) disabled = false\n\n /**\n * The name of the form component.\n */\n @property({ reflect: true }) name?: string\n\n /**\n * The value of the form component.\n */\n @property() value: string = ''\n\n private formAncestor: HTMLFormElement | null = null\n protected _formId?: string\n set form(id: string) {\n const oldVal = this._formId\n this._formId = id\n this.requestUpdate('form', oldVal)\n }\n\n /**\n * Gets the form, if any, associated with the form element.\n * The setter accepts a string, which is the id of the form.\n */\n @property()\n get form(): HTMLFormElement | null {\n if (this._formId) {\n const root = this.getRootNode() as ShadowRoot | Document\n return root.querySelector<HTMLFormElement>(`form#${this._formId}`)\n }\n return this.formAncestor\n }\n\n connectedCallback() {\n super.connectedCallback()\n // we can cache this, since it will only change if the element is (re)connected\n this.formAncestor = this.closest('form')\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n this.formAncestor = null\n }\n }\n\n return InputElement as unknown as Constructor<InputMixinInterface> & T\n}\n","import { html, LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { cond } from '../common/directives/cond.js'\nimport componentStyle from '../common/styles/Component.css'\nimport style from './Spinner.css'\n\n/**\n * Spinner component is used to indicate users that their action is being\n * processed. You can customize the size and color of the spinner with the\n * provided properties.\n *\n * @status ready\n * @category feedback\n * @cssprop [--n-spinner-color=var(--n-color-accent)] - Controls the color the spinner.\n */\n@customElement('nord-spinner')\nexport default class Spinner extends LitElement {\n static styles = [componentStyle, style]\n\n /**\n * The size of the spinner.\n */\n @property({ reflect: true }) size: 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl' = 'm'\n\n /**\n * The color of the spinner.\n * Can accept any valid CSS color value, including custom properties.\n * Takes precedence over the `--n-spinner-color` CSS custom property.\n */\n @property({ reflect: true }) color?: string\n\n /**\n * An accessible label for the spinner.\n * If no label is supplied, the spinner is hidden from assistive technology.\n */\n @property({ reflect: true }) label?: string\n\n render() {\n // if a label is supplied, we give the div a role of img.\n // without this we could not use aria-label, since it is only valid on elements of certain roles.\n return html`\n <div\n class=\"n-spinner\"\n role=${cond(this.label, 'img')}\n aria-label=${ifDefined(this.label)}\n style=${cond(this.color, `--_n-spinner-color:${this.color}`)}\n ></div>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-spinner': Spinner\n }\n}\n","/* eslint-disable lit-a11y/accessible-name */\nimport type { TemplateResult } from 'lit'\nimport { html, LitElement, nothing } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { createRef, ref } from 'lit/directives/ref.js'\nimport { EventController } from '../common/controllers/EventController.js'\nimport { LightDomController } from '../common/controllers/LightDomController.js'\nimport { SlotController } from '../common/controllers/SlotController.js'\n\nimport { cond } from '../common/directives/cond.js'\n\nimport { FocusableMixin } from '../common/mixins/FocusableMixin.js'\nimport { InputMixin } from '../common/mixins/InputMixin.js'\nimport componentStyle from '../common/styles/Component.css'\nimport style from './Button.css'\nimport '../spinner/Spinner.js'\n\n/**\n * Buttons are used for interface actions. Primary style should be\n * used only once per section for main call-to-action, while other\n * styles can appear more frequently.\n *\n * @status ready\n * @category action\n * @slot - The button content\n * @slot start - Used to place content at the start of button text. Typically used for icons.\n * @slot end - Used to place content at the end of button text. Typically used for icons.\n *\n * @cssprop [--n-button-border-radius=var(--n-border-radius-s)] - Controls the rounded corners of the button, using [border radius tokens](/tokens/#border-radius).\n * @cssprop [--n-button-gap=var(--n-space-s)] - Controls the spacing between items within the button, using our [spacing tokens](/tokens/#space).\n * @cssprop [--n-button-gradient=linear-gradient(to bottom, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.013) 100%))] - Controls the overlayed gradient background on the button.\n * @cssprop [--n-button-background-color=var(--n-color-button)] - Controls the background color of the button, using our [color tokens](/tokens/#color).\n * @cssprop [--n-button-border-color=var(--n-color-border-strong)] - Controls the border color of the button, using our [color tokens](/tokens/#color).\n * @cssprop [--n-button-text-align=center] - Controls the text alignment for the text in the button.\n * @cssprop [--n-button-box-shadow=var(--n-box-shadow)] - Controls the surrounding shadow, using our [box shadow tokens](/tokens/#box-shadow).\n * @cssprop [--n-button-color=var(--n-color-text)] - Controls the color of the text within the button, using our [color tokens](/tokens/#color).\n * @cssprop [--n-button-padding-inline=calc(var(--n-space-m) / 1.2)] - Controls the inline, or left and right, padding of the button.\n * @cssprop [--n-button-font-size=var(--n-font-size-m)] - Controls the size of the text within the button, using our [font tokens](/tokens/#font).\n * @cssprop [--n-button-font-weight=var(--n-font-weight)] - Controls the weight of the text within the button, using our [font tokens](/tokens/#font).\n * @cssprop [--n-button-min-block-size=var(--n-space-xl)] - Controls the minimum block size, or height, of the button using our [spacing tokens](/tokens/#space).\n * @cssprop [--n-button-toggle-icon-color=var(--n-color-icon)] - Controls the color of toggle icon that gets rendered when the button is used as a [Dropdown](/components/dropdown/) toggle.\n * @cssprop [--n-button-user-select=none] - Controls the text selection behavior of the button text.\n */\n@customElement('nord-button')\nexport default class Button extends InputMixin(FocusableMixin(LitElement)) {\n static styles = [componentStyle, style]\n\n private defaultSlot = new SlotController(this)\n private buttonRef = createRef<HTMLButtonElement>()\n private events = new EventController(this)\n private lightDom = new LightDomController(this, {\n render: () => this.renderLightDom(),\n })\n\n /**\n * The style variant of the button.\n */\n @property({ reflect: true }) variant: 'default' | 'primary' | 'dashed' | 'plain' | 'danger' = 'default'\n\n /**\n * The type of the button.\n */\n @property({ reflect: true }) type: 'button' | 'submit' | 'reset' = 'submit'\n\n /**\n * The size of the button.\n * This affects font-size and padding.\n */\n @property({ reflect: true }) size: 's' | 'm' | 'l' = 'm'\n\n /**\n * This does not need to be documented,\n * since it is only for forwarding the aria-expanded attribute\n * to the internal button element.\n * @private\n */\n @property({ attribute: 'aria-expanded' }) accessibleExpanded?: 'true' | 'false'\n\n /**\n * This does not need to be documented,\n * since it is only for forwarding the aria-haspopup attribute\n * to the internal button element.\n * @private\n */\n @property({ attribute: 'aria-haspopup' }) accessibleHasPopup?:\n | 'false'\n | 'true'\n | 'menu'\n | 'listbox'\n | 'tree'\n | 'grid'\n | 'dialog'\n\n /**\n * When provided, renders the button as a link,\n * with its href attribute set to the given value.\n */\n @property({ reflect: true }) href?: string\n\n /**\n * When provided together with a href property, the button will\n * trigger a file download instead of a page visit.\n */\n @property({ reflect: true, type: Boolean }) download = false\n\n /**\n * When provided together with a href property, determines where\n * to open the linked URL. The keywords have special meanings for\n * where to load the URL: “_self” means the current browsing context,\n * “_blank” usually a new tab but users can configure browsers this to\n * open a new window instead, “_parent” means the parent browsing\n * context of the current one, but if no parent exists, behaves as\n * _self, and finally “top” means the topmost browsing context.\n */\n @property() target: '_self' | '_blank' | '_parent' | '_top' = '_self'\n\n /**\n * Controls whether the button expands to fill the width of its container.\n */\n @property({ reflect: true, type: Boolean }) expand = false\n\n /**\n * When provided, the button is rendered as a square button. Use this for icon only buttons.\n */\n @property({ reflect: true, type: Boolean }) square = false\n\n /**\n * Controls whether the button is in loading state. Please note that the spinner\n * is hidden from assistive technologies, so you need to make sure to announce\n * the loading state to e.g. screen reader users. We also recommend disabling\n * all user interactions on the button itself while in loading state.\n */\n @property({ reflect: true, type: Boolean }) loading = false\n\n /**\n * Controls whether the `interface-dropdown-small` icon from Nordicons is hidden\n * in the `end` slot when used as a dropdown toggle.\n */\n @property({ reflect: true, type: Boolean, attribute: 'hide-dropdown-icon' }) hideDropdownIcon = false\n\n connectedCallback() {\n super.connectedCallback()\n this.events.listen(this, 'click', this.handleOuterClick, true)\n }\n\n render() {\n const isDropdownToggle = this.assignedSlot?.name === 'toggle'\n const isIconButton = this.defaultSlot.assigned.some(node => node.localName === 'nord-icon')\n const shouldShowDropdownIcon = isDropdownToggle && !this.hideDropdownIcon && !isIconButton && !this.href\n\n const innards = html`\n <slot name=\"start\"></slot>\n <div class=\"n-content\">\n <slot></slot>\n </div>\n <nord-spinner\n class=\"n-button-spinner\"\n color=\"currentColor\"\n ?hidden=${!this.loading || Boolean(this.href)}\n ></nord-spinner>\n <slot name=\"end\">\n ${shouldShowDropdownIcon\n ? html`<nord-icon name=\"interface-dropdown-small\" class=\"n-toggle-icon\"></nord-icon>`\n : nothing}\n </slot>\n `\n\n return this.href ? this.renderLink(innards) : this.renderButton(innards)\n }\n\n /**\n * We jump through some hoops here to ensure the link is treated correctly when \"disabled\".\n * Links cannot be disabled natively, so we need to rely on some aria magic to get the correct semantics.\n * Along with the advice in the article below, we also set tabindex to \"-1\", so it is taken out of tab order.\n *\n * @see https://www.scottohara.me/blog/2021/05/28/disabled-links.html\n */\n private renderLink(innards: TemplateResult) {\n return html`\n <a\n ${ref(this.focusableRef)}\n class=\"n-button\"\n target=${this.target}\n ?download=${this.download}\n href=${cond(this.disabled, nothing, this.href)}\n tabindex=${cond(this.disabled, '-1')}\n aria-disabled=${cond(this.disabled, 'true')}\n role=${cond(this.disabled, 'link')}\n >${innards}\n </a>\n `\n }\n\n private renderButton(innards: TemplateResult) {\n return html`\n <slot name=\"proxy\" @slotchange=${this.handleProxyChange}></slot>\n <button\n ${ref(this.focusableRef)}\n class=\"n-button\"\n ?disabled=${this.disabled}\n name=${cond(this.name)}\n value=${cond(this.value)}\n @click=${this.handleClick}\n aria-disabled=${cond(this.loading, 'true')}\n aria-expanded=${cond(this.accessibleExpanded)}\n aria-haspopup=${cond(this.accessibleHasPopup)}\n >\n ${innards}\n </button>\n `\n }\n\n private renderLightDom() {\n if (this.href || !this.form) {\n return nothing\n }\n\n return html`\n <button\n ${ref(this.buttonRef)}\n slot=\"proxy\"\n name=${cond(this.name)}\n value=${cond(this.value)}\n ?disabled=${this.disabled}\n form=${cond(this._formId)}\n type=${this.type}\n ></button>\n `\n }\n\n private handleOuterClick = (e: MouseEvent) => {\n // we want to avoid emitting click events when a click\n // happens in blank space in the host, but not on the button\n // so we stop propagation of any events if click didn't happen on the internal or proxy button\n const isInternalButton = e\n .composedPath()\n .some(node => node === this.focusableRef.value || node === this.buttonRef.value)\n\n if (!isInternalButton) {\n e.stopPropagation()\n }\n }\n\n private handleClick(e: Event) {\n if (this.buttonRef.value) {\n // prevents two events: one from internal button, one from proxy button\n e.stopPropagation()\n this.buttonRef.value.click()\n }\n }\n\n /**\n * React/Vue etc may remove our proxy button when updating button text, since they are unaware of its existence.\n * So we listen for a slotchange event, and if the element is no longer connected to the DOM we add it back in.\n */\n private handleProxyChange(e: Event) {\n const slot = e.target as HTMLSlotElement\n const proxyButton = this.buttonRef.value\n\n if (proxyButton && proxyButton.assignedSlot !== slot) {\n this.appendChild(proxyButton)\n }\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-button': Button\n }\n}\n","export default '<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m.100342 6.92903 2.121318-2.12132 7.77818 7.77819 7.77826-7.77828 2.1213 2.12132-8.4853 8.48536c-.7811.7811-2.04743.7811-2.82848 0z\" fill=\"currentColor\"/></svg>';\nexport const title = \"arrow-down-small\";\nexport const tags = \"nordicon arrow down small caret pointing triangle chevron\";\n","export default '<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m13.0712.105225 2.1213 2.121315-7.77816 7.77816 7.77826 7.7783-2.1213 2.1213-8.48539-8.4854c-.78105-.781-.78105-2.04735 0-2.82839z\" fill=\"currentColor\"/></svg>';\nexport const title = \"arrow-left-small\";\nexport const tags = \"nordicon arrow left small caret pointing triangle chevron\";\n","export default '<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m6.92903.100342-2.12132 2.121318 7.77819 7.77818-7.77828 7.77826 2.12132 2.1213 8.48536-8.4853c.7811-.7811.7811-2.04743 0-2.82848z\" fill=\"currentColor\"/></svg>';\nexport const title = \"arrow-right-small\";\nexport const tags =\n \"nordicon arrow right small caret pointing triangle chevron\";\n","import{noChange as e}from\"../lit-html.js\";import{directive as s,Directive as t,PartType as r}from\"../directive.js\";import{getCommittedValue as l,setChildPartValue as o,insertPart as i,removePart as n,setCommittedValue as f}from\"../directive-helpers.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst u=(e,s,t)=>{const r=new Map;for(let l=s;l<=t;l++)r.set(e[l],l);return r},c=s(class extends t{constructor(e){if(super(e),e.type!==r.CHILD)throw Error(\"repeat() can only be used in text expressions\")}dt(e,s,t){let r;void 0===t?t=s:void 0!==s&&(r=s);const l=[],o=[];let i=0;for(const s of e)l[i]=r?r(s,i):i,o[i]=t(s,i),i++;return{values:o,keys:l}}render(e,s,t){return this.dt(e,s,t).values}update(s,[t,r,c]){const d=l(s),{values:p,keys:a}=this.dt(t,r,c);if(!Array.isArray(d))return this.ut=a,p;const h=this.ut??=[],v=[];let m,y,x=0,j=d.length-1,k=0,w=p.length-1;for(;x<=j&&k<=w;)if(null===d[x])x++;else if(null===d[j])j--;else if(h[x]===a[k])v[k]=o(d[x],p[k]),x++,k++;else if(h[j]===a[w])v[w]=o(d[j],p[w]),j--,w--;else if(h[x]===a[w])v[w]=o(d[x],p[w]),i(s,v[w+1],d[x]),x++,w--;else if(h[j]===a[k])v[k]=o(d[j],p[k]),i(s,d[x],d[j]),j--,k++;else if(void 0===m&&(m=u(a,k,w),y=u(h,x,j)),m.has(h[x]))if(m.has(h[j])){const e=y.get(a[k]),t=void 0!==e?d[e]:null;if(null===t){const e=i(s,d[x]);o(e,p[k]),v[k]=e}else v[k]=o(t,p[k]),i(s,d[x],t),d[e]=null;k++}else n(d[j]),j--;else n(d[x]),x++;for(;k<=w;){const e=i(s,v[w+1]);o(e,p[k]),v[k++]=e}for(;x<=j;){const e=d[x++];null!==e&&n(e)}return this.ut=a,f(s,v),e}});export{c as repeat};\n//# sourceMappingURL=repeat.js.map\n","var t=[\"Shift\",\"Meta\",\"Alt\",\"Control\"],e=\"object\"==typeof navigator&&/Mac|iPod|iPhone|iPad/.test(navigator.platform)?\"Meta\":\"Control\";function n(t,e){return\"function\"==typeof t.getModifierState&&t.getModifierState(e)}function r(t){return t.trim().split(\" \").map(function(t){var n=t.split(/\\b\\+/),r=n.pop();return[n=n.map(function(t){return\"$mod\"===t?e:t}),r]})}function o(e,o){var i;void 0===o&&(o={});var u=null!=(i=o.timeout)?i:1e3,a=Object.keys(e).map(function(t){return[r(t),e[t]]}),f=new Map,c=null;return function(e){e instanceof KeyboardEvent&&(a.forEach(function(r){var o=r[0],i=r[1],u=f.get(o)||o;!function(e,r){return!(r[1].toUpperCase()!==e.key.toUpperCase()&&r[1]!==e.code||r[0].find(function(t){return!n(e,t)})||t.find(function(t){return!r[0].includes(t)&&r[1]!==t&&n(e,t)}))}(e,u[0])?n(e,e.key)||f.delete(o):u.length>1?f.set(o,u.slice(1)):(f.delete(o),i(e))}),c&&clearTimeout(c),c=setTimeout(f.clear.bind(f),u))}}function i(t,e,n){var r;void 0===n&&(n={});var i=null!=(r=n.event)?r:\"keydown\",u=o(e,n);return t.addEventListener(i,u),function(){t.removeEventListener(i,u)}}export default i;export{o as createKeybindingsHandler,r as parseKeybinding};\n//# sourceMappingURL=tinykeys.module.js.map\n","/**\n * Groups an array objects by property value\n * @param array the collection of objects to group\n * @param key the property to group by\n * @returns a Map keyed by property value, where values are are an array of objects with that property value.\n */\nexport function groupBy<TObject extends Record<any, any>, TKey extends keyof TObject>(\n array: Array<TObject>,\n key: TKey,\n) {\n const grouped = new Map<TObject[TKey], TObject[]>()\n\n for (const item of array) {\n const value = item[key]\n const collection = grouped.get(value) ?? []\n\n if (!grouped.has(value)) {\n grouped.set(value, [])\n }\n collection.push(item)\n grouped.set(value, collection)\n }\n\n return grouped\n}\n\n/**\n * Split an array into chunks of the given size\n * @param array - The array to split\n * @param chunkSize - The size of each chunk\n * @returns The array split into chunks\n */\nexport function chunk<T>(array: T[], chunkSize: number): T[][] {\n const result = []\n\n for (let i = 0; i < array.length; i += chunkSize) {\n result.push(array.slice(i, i + chunkSize))\n }\n\n return result\n}\n\n/**\n * maps over an array, starting at the given offset and wrapping around.\n * @param array - The array to map over\n * @param startingOffset - The starting offset\n * @param mapFn - The mapping function\n * @returns The mapped array\n */\nexport function mapWithOffset<T, U>(array: T[], startingOffset: number, mapFn: (item: T, i: number) => U): U[] {\n return array.map((_, i) => {\n const adjustedIndex = (i + startingOffset) % array.length\n return mapFn(array[adjustedIndex], adjustedIndex)\n })\n}\n","import type { ReactiveController, ReactiveElement } from 'lit'\nimport { EventController } from './EventController.js'\n\nexport interface SwipeDetails {\n initialX: number\n initialY: number\n pageX: number\n pageY: number\n distX: number\n distY: number\n}\n\nconst preventDefault = (e: Event) => e.preventDefault()\n\ntype SetRequired<T, K extends keyof T> = T & { [Property in K]-?: T[K] }\ninterface SwipeControllerOptions {\n target?: () => HTMLElement\n matchesGesture: (details: SwipeDetails) => boolean\n onSwipeEnd: (details: SwipeDetails) => void\n}\n\nexport class SwipeController implements ReactiveController {\n private events: EventController\n private hadFirstUpdate = false\n\n private initialTouchX: number = 0\n private initialTouchY: number = 0\n private options: SetRequired<SwipeControllerOptions, 'target'>\n\n constructor(host: ReactiveElement, options: SwipeControllerOptions) {\n host.addController(this)\n this.events = new EventController(host)\n\n this.options = {\n target: () => host,\n ...options,\n }\n }\n\n hostUpdated() {\n if (!this.hadFirstUpdate) {\n this.hadFirstUpdate = true\n\n const target = this.options.target()\n this.events.listen(target, 'touchstart', this.handleTouchStart)\n this.events.listen(target, 'touchmove', preventDefault)\n this.events.listen(target, 'touchend', this.handleTouchEnd)\n }\n }\n\n hostDisconnected() {\n this.hadFirstUpdate = false\n }\n\n private handleTouchStart = (event: TouchEvent) => {\n const [{ pageX, pageY }] = event.changedTouches\n this.initialTouchX = pageX\n this.initialTouchY = pageY\n }\n\n private handleTouchEnd = (event: TouchEvent) => {\n const [{ pageX, pageY }] = event.changedTouches\n const { matchesGesture, onSwipeEnd } = this.options\n\n const distX = pageX - this.initialTouchX\n const distY = pageY - this.initialTouchY\n const details = { initialX: this.initialTouchX, initialY: this.initialTouchY, pageX, pageY, distX, distY }\n\n if (matchesGesture(details)) {\n event.preventDefault()\n onSwipeEnd(details)\n }\n }\n}\n\nconst THRESHOLD = 70\n\nexport function isHorizontalSwipe({ distX, distY }: SwipeDetails) {\n return Math.abs(distX) >= THRESHOLD && Math.abs(distY) <= THRESHOLD\n}\n\nexport function isDownwardsSwipe({ distX, distY }: SwipeDetails) {\n return Math.abs(distY) >= THRESHOLD && Math.abs(distX) <= THRESHOLD && distY > 0\n}\n","const ISO_DATE_FORMAT = /^(\\d{4})-(\\d{2})-(\\d{2})$/\n\nexport enum DaysOfWeek {\n Sunday = 0,\n Monday = 1,\n Tuesday = 2,\n Wednesday = 3,\n Thursday = 4,\n Friday = 5,\n Saturday = 6,\n}\n\nexport function createDate(year: string, month: string, day: string): Date | undefined {\n const dayInt = Number.parseInt(day, 10)\n const monthInt = Number.parseInt(month, 10)\n const yearInt = Number.parseInt(year, 10)\n\n const isValid\n = Number.isInteger(yearInt) // all parts should be integers\n && Number.isInteger(monthInt)\n && Number.isInteger(dayInt)\n && monthInt > 0 // month must be 1-12\n && monthInt <= 12\n && dayInt > 0 // day must be 1-31\n && dayInt <= 31\n && yearInt > 0\n\n if (isValid) {\n const date = new Date(yearInt, monthInt - 1, dayInt)\n // this handles values where year is 0-99, which JS \"helpfully\" interprets as 1900-1999\n date.setFullYear(yearInt)\n\n return date\n }\n\n return undefined\n}\n\n/**\n * @param value date string in ISO format YYYY-MM-DD\n */\nexport function parseISODate(value: string): Date | undefined {\n if (!value) {\n return undefined\n }\n\n const matches = value.match(ISO_DATE_FORMAT)\n\n if (matches) {\n return createDate(matches[1], matches[2], matches[3])\n }\n\n return undefined\n}\n\n/**\n * print date in format YYYY-MM-DD\n * @param date\n */\nexport function printISODate(date: Date): string {\n if (!date) {\n return ''\n }\n\n const d = date.getDate().toString(10)\n const m = (date.getMonth() + 1).toString(10)\n const y = date.getFullYear().toString(10)\n\n return `${y.padStart(4, '0')}-${m.padStart(2, '0')}-${d.padStart(2, '0')}`\n}\n\nfunction today() {\n const date = new Date()\n return new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0, 0))\n}\n\nexport function getDayNames(locale: string, weekday: Exclude<Intl.DateTimeFormatOptions['weekday'], undefined>) {\n const days = []\n const options = { weekday }\n const day = today()\n\n for (let i = 0; i < 7; i++) {\n days[day.getDay()] = day.toLocaleDateString(locale, options)\n day.setDate(day.getDate() + 1)\n }\n\n return days\n}\n\nexport function getMonthNames(locale: string, month: Exclude<Intl.DateTimeFormatOptions['month'], undefined>) {\n const months = []\n const options = { month }\n\n // set to first of the month, so that all dates are valid\n const day = today()\n day.setDate(1)\n\n for (let i = 0; i < 12; i++) {\n months[day.getMonth()] = day.toLocaleDateString(locale, options)\n day.setMonth(day.getMonth() + 1)\n }\n\n return months\n}\n\n/**\n * Compare if two dates are in the same month of the same year.\n */\nexport function isEqualMonth(a?: Date, b?: Date): boolean {\n if (a == null || b == null) {\n return false\n }\n\n return a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth()\n}\n\n/**\n * Compare if two dates are equal in terms of day, month, and year\n */\nexport function isEqual(a?: Date, b?: Date): boolean {\n if (a == null || b == null) {\n return false\n }\n\n return isEqualMonth(a, b) && a.getDate() === b.getDate()\n}\n\nexport function addDays(date: Date, days: number): Date {\n const d = new Date(date)\n d.setDate(d.getDate() + days)\n return d\n}\n\nexport function addMonths(date: Date, months: number): Date {\n const d = new Date(date)\n d.setMonth(date.getMonth() + months)\n return d\n}\n\nexport function addYears(date: Date, years: number): Date {\n const d = new Date(date)\n d.setFullYear(date.getFullYear() + years)\n return d\n}\n\nexport function startOfWeek(date: Date, firstDayOfWeek: DaysOfWeek = DaysOfWeek.Monday): Date {\n const d = new Date(date)\n const day = d.getDay()\n const diff = (day < firstDayOfWeek ? 7 : 0) + day - firstDayOfWeek\n\n d.setDate(d.getDate() - diff)\n return d\n}\n\nexport function endOfWeek(date: Date, firstDayOfWeek: DaysOfWeek = DaysOfWeek.Monday): Date {\n const d = new Date(date)\n const day = d.getDay()\n const diff = (day < firstDayOfWeek ? -7 : 0) + 6 - (day - firstDayOfWeek)\n\n d.setDate(d.getDate() + diff)\n return d\n}\n\nexport function startOfMonth(date: Date): Date {\n const d = new Date(date.getFullYear(), date.getMonth(), 1)\n d.setFullYear(date.getFullYear())\n return d\n}\n\nexport function endOfMonth(date: Date): Date {\n const d = new Date(date.getFullYear(), date.getMonth() + 1, 0)\n d.setFullYear(date.getFullYear())\n return d\n}\n\nexport function setMonth(date: Date, month: number): Date {\n const d = new Date(date)\n d.setMonth(month)\n return d\n}\n\nexport function setYear(date: Date, year: number): Date {\n const d = new Date(date)\n d.setFullYear(year)\n return d\n}\n\n/**\n * Ensures date is within range, returns min or max if out of bounds\n */\nexport function clamp(date: Date, min?: Date, max?: Date): Date {\n const time = date.getTime()\n\n if (min && min instanceof Date && time < min.getTime()) {\n return min\n }\n\n if (max && max instanceof Date && time > max.getTime()) {\n return max\n }\n\n return date\n}\n\n/**\n * Check if date is within a min and max\n */\nexport function inRange(date: Date, min?: Date, max?: Date): boolean {\n return clamp(date, min, max) === date\n}\n\n/**\n * given start and end date, return an (inclusive) array of all dates in between\n * @param start\n * @param end\n */\nfunction getDaysInRange(start: Date, end: Date): Date[] {\n const days: Date[] = []\n let current = start\n\n while (!isEqual(current, end)) {\n days.push(current)\n current = addDays(current, 1)\n }\n\n days.push(current)\n\n return days\n}\n\n/**\n * given a date, return an array of dates from a calendar perspective\n * @param date\n * @param firstDayOfWeek\n */\nexport function getViewOfMonth(date: Date, firstDayOfWeek: DaysOfWeek = DaysOfWeek.Monday): Date[] {\n const start = startOfWeek(startOfMonth(date), firstDayOfWeek)\n const end = endOfWeek(endOfMonth(date), firstDayOfWeek)\n\n return getDaysInRange(start, end)\n}\n","/**\n * Wraps a value so that it always falls within min/max,\n * where a value greater than max gets set to min, and vice versa\n */\nexport function wrap(val: number, min: number, max: number) {\n if (val > max)\n return min\n if (val < min)\n return max\n return val\n}\n\nexport function range(from: number, to: number) {\n const result: number[] = []\n\n for (let i = from; i <= to; i++) {\n result.push(i)\n }\n\n return result\n}\n\nexport function clamp(value: number, min: number, max: number) {\n return Math.max(min, Math.min(value, max))\n}\n","const calendarLocalization = {\n prevMonthLabel: 'Previous month',\n nextMonthLabel: 'Next month',\n monthSelectLabel: 'Month',\n yearSelectLabel: 'Year',\n}\n\nexport default calendarLocalization\n","import calendarLocalization from '../calendar/localization.js'\nimport commandMenuLocalization from '../command-menu/localization.js'\nimport datePickerLocalization from '../date-picker/localization.js'\nimport messageLocalization from '../message/localization.js'\nimport modalLocalization from '../modal/localization.js'\nimport navToggleLocalization from '../nav-toggle/localization.js'\nimport notificationLocalization from '../notification/localization.js'\nimport tagLocalization from '../tag/localization.js'\nimport textareaLocalization from '../textarea/localization.js'\n\nconst en = {\n '$lang': 'en-US',\n '$name': 'English',\n '$dir': 'ltr' as 'ltr' | 'rtl',\n 'nord-command-menu': commandMenuLocalization,\n 'nord-calendar': calendarLocalization,\n 'nord-date-picker': datePickerLocalization,\n 'nord-modal': modalLocalization,\n 'nord-nav-toggle': navToggleLocalization,\n 'nord-textarea': textareaLocalization,\n 'nord-notification': notificationLocalization,\n 'nord-message': messageLocalization,\n 'nord-tag': tagLocalization,\n}\n\nexport default en\n","const commandMenuLocalization = {\n instructions: 'Press \\'Enter\\' to confirm your input or \\'Escape\\' to cancel',\n inputLabel: 'Type the name of a command to run.',\n footerArrowKeys: 'Navigate',\n footerEnterKey: 'Select',\n footerEscapeKey: 'Esc to dismiss',\n footerBackspaceKey: 'Move to parent',\n noResults: (searchTerm: string) => `No results for “${searchTerm}”`,\n tip: 'Search tips: some search terms require an exact match. Try typing the entire command name, or use a different word or phrase.',\n placeholder: 'Type a command or search…',\n}\n\nexport default commandMenuLocalization\n","const datePickerLocalization = {\n modalHeading: 'Choose a date',\n closeLabel: 'Close window',\n buttonLabel: 'Choose date',\n selectedDateMessage: 'Selected date is',\n dateOutOfMinBound: (minDate: string) => `Date must be on or after ${minDate}`,\n dateOutOfMaxBound: (maxDate: string) => `Date must be on or before ${maxDate}`,\n}\n\nexport default datePickerLocalization\n","const localization = {\n closeLabel: 'Close dialog',\n}\n\nexport default localization\n","const localization = {\n label: 'Toggle navigation',\n}\n\nexport default localization\n","const localization = {\n remainingCharacters: (remainder: number) => `Characters remaining: ${remainder}`,\n}\n\nexport default localization\n","const localization = {\n dismissLabel: 'Dismiss notification',\n}\n\nexport default localization\n","const localization = {\n unreadLabel: 'Unread',\n}\n\nexport default localization\n","const localization = {\n removeLabel: 'Remove',\n}\n\nexport default localization\n","import { isServer } from 'lit'\nimport en from './en-us.js'\n\n// gets list of properties beginning prefix\ntype PickStartsWith<T, Prefix extends string> = T extends `${Prefix}${string}` ? T : never\n\n// Recursively make all properties optional\ntype DeepPartial<T> = T extends object\n ? {\n [P in keyof T]?: DeepPartial<T[P]>\n }\n : T\n\nexport type Translation = typeof en\nexport type PartialTranslation = {\n $lang: string\n $name?: string\n $dir?: 'ltr' | 'rtl'\n} & DeepPartial<Omit<Translation, '$lang' | '$name' | '$dir'>>\nexport type WellKnownKeys = PickStartsWith<keyof Translation, '$'>\n\nconst documentLangSubscribers = new Set<() => void>()\nconst translationRegistrationSubscribers = new Set<() => void>()\nconst translations = new Map<string, Translation>()\n\nfunction notifyDocumentLangChange() {\n for (const subscriber of documentLangSubscribers) {\n subscriber()\n }\n}\n\nfunction notifyTranslationRegistration() {\n for (const subscriber of translationRegistrationSubscribers) {\n subscriber()\n }\n}\n\nfunction deepMerge(target: unknown, source: unknown): unknown {\n if (!isObject(source))\n return source\n\n if (!isObject(target))\n return source\n\n const result = { ...target }\n\n for (const key in source) {\n const sourceValue = (source as Record<string, unknown>)[key]\n const targetValue = result[key]\n\n if (isObject(sourceValue) && isObject(targetValue)) {\n result[key] = deepMerge(targetValue, sourceValue)\n }\n else {\n result[key] = sourceValue\n }\n }\n\n return result\n}\n\nfunction isObject(value: unknown): value is Record<string, unknown> {\n return value !== null && typeof value === 'object' && !Array.isArray(value)\n}\n\n// observe changes to the document's lang\nif (!isServer) {\n const observer = new MutationObserver(notifyDocumentLangChange)\n\n observer.observe(document.documentElement, {\n attributes: true,\n attributeFilter: ['lang'],\n })\n}\n\n/**\n * Removes all registered translations\n */\nexport function clearTranslations() {\n translations.clear()\n}\n\n/**\n * Registers one or more translations. If a translation for the same language\n * already exists, the new translation will be deep-merged with the existing one.\n * Translations can be partial — only the fields you provide will override existing values.\n */\nexport function registerTranslation(...translation: (Translation | PartialTranslation)[]) {\n translation.forEach((t) => {\n const lang = t.$lang.toLowerCase()\n const existing = translations.get(lang)\n\n // Deep merge: keep existing keys, override with new ones\n const merged = existing ? (deepMerge(existing, t) as Translation) : (t as Translation)\n translations.set(lang, merged)\n })\n\n notifyTranslationRegistration()\n}\n\n/**\n * subscribe to document language changes\n * @param onChange callback for when document `lang` attr changes\n * @returns cleanup function\n */\nexport function subscribeToDocumentLang(onChange: () => void): () => void {\n documentLangSubscribers.add(onChange)\n return () => documentLangSubscribers.delete(onChange)\n}\n\n/**\n * subscribe to translation registration changes\n * @param onChange callback for when new translations are registered\n * @returns cleanup function\n */\nexport function subscribeToTranslationRegistration(onChange: () => void): () => void {\n translationRegistrationSubscribers.add(onChange)\n return () => translationRegistrationSubscribers.delete(onChange)\n}\n\n/**\n * Check whether there is a translation registered for the given lang\n * @param lang the lang code e.g. \"en\" or \"en-GB\"\n */\nexport function isTranslationRegistered(lang: string) {\n return translations.has(lang)\n}\n\n/**\n * Picks the most appropriate translation for the given language, from most specific to least specific.\n * First tries lang + region, then lang only, then fallback.\n */\nexport function resolveTranslation(langCode: string) {\n const lang = langCode.toLowerCase()\n const [langOnly] = lang.split('-')\n\n return translations.get(lang) || translations.get(langOnly) || en\n}\n\nexport { en as fallback }\n","import type { ReactiveController, ReactiveControllerHost } from 'lit'\nimport type {\n Translation,\n WellKnownKeys,\n} from './translation.js'\nimport { isServer } from 'lit'\nimport {\n fallback,\n resolveTranslation,\n subscribeToDocumentLang,\n subscribeToTranslationRegistration,\n} from './translation.js'\n\n// Use fallback (en) as source of truth for valid translation keys\ntype FallbackType = typeof fallback\n\n// helper types...\n\n// used to match any function\ntype Func = (...args: any[]) => any\n\n// if object property is function, use return type, else value type\ntype Result<Type, Key extends keyof Type> = Type[Key] extends Func ? ReturnType<Type[Key]> : Type[Key]\n\n// if object property is function,\ntype FuncParams<Type, K extends keyof Type> = Type[K] extends Func ? Parameters<Type[K]> : []\n\nfunction noop() {\n // this function is intentionally left blank\n}\n\nexport class LocalizeController<TComponentName extends Exclude<keyof Translation, WellKnownKeys>>\nimplements ReactiveController {\n private unsubscribeDocumentLang?: ReturnType<typeof subscribeToDocumentLang>\n private unsubscribeTranslationRegistration?: ReturnType<typeof subscribeToTranslationRegistration>\n private observer?: MutationObserver\n private resolvedTranslation: Translation\n\n constructor(\n private host: ReactiveControllerHost & HTMLElement,\n private options = { onLangChange: noop },\n ) {\n host.addController(this)\n this.resolvedTranslation = resolveTranslation(this.lang)\n }\n\n /**\n * The lang of the document or element, with element taking precedence\n */\n get lang() {\n if (isServer) {\n return this.host.lang || 'en-US'\n }\n\n return this.host.lang || document.documentElement.lang\n }\n\n /**\n * The lang of the translation being applied.\n * This may not match the document/element lang, in case of fallback translation\n */\n get resolvedLang() {\n return this.resolvedTranslation.$lang\n }\n\n hostConnected() {\n // Always subscribe to translation registration changes (for when new translations are registered)\n this.unsubscribeTranslationRegistration = subscribeToTranslationRegistration(this.handleLangChange)\n\n // Re-resolve translation now that the host is connected and attributes are set\n // This handles cases where the lang attribute is set after the constructor runs (e.g., in Vue)\n const resolved = resolveTranslation(this.lang)\n if (this.resolvedTranslation !== resolved) {\n this.resolvedTranslation = resolved\n }\n\n // If the host has its own `lang` attribute, create a local observer to watch for changes to that attribute\n if (this.host.getAttribute('lang')) {\n this.observer = new MutationObserver(this.handleLangChange)\n this.observer.observe(this.host, {\n attributes: true,\n attributeFilter: ['lang'],\n })\n }\n else {\n // Otherwise, also subscribe to document language changes\n this.unsubscribeDocumentLang = subscribeToDocumentLang(this.handleLangChange)\n }\n\n this.options.onLangChange()\n }\n\n hostDisconnected() {\n this.unsubscribeDocumentLang?.()\n this.unsubscribeTranslationRegistration?.()\n this.observer?.disconnect()\n }\n\n term<Key extends keyof FallbackType[TComponentName]>(\n key: Key,\n ...args: FuncParams<FallbackType[TComponentName], Key>\n ): Result<FallbackType[TComponentName], Key> {\n const { resolvedTranslation, resolvedLang } = this\n const component = this.host.localName as TComponentName\n\n // Cast to specific component type to satisfy TS that key is valid for this component\n const componentTranslation = resolvedTranslation[component] as FallbackType[TComponentName] | undefined\n\n if (componentTranslation == null) {\n console.warn(`NORD: Missing translations for component \\`${component}\\` in lang: \\`${resolvedLang}\\``)\n }\n else if (componentTranslation[key] == null) {\n console.warn(\n `NORD: Missing translation key \\`${String(key)}\\` for component \\`${component}\\` in lang \\`${resolvedLang}\\``,\n )\n }\n\n const fallbackComponentTranslation = fallback[component] as FallbackType[TComponentName]\n const translationValue = (componentTranslation?.[key] ?? fallbackComponentTranslation[key]) as Result<FallbackType[TComponentName], Key>\n return typeof translationValue === 'function' ? translationValue(...args) : translationValue\n }\n\n private handleLangChange = () => {\n const resolved = resolveTranslation(this.lang)\n\n if (this.resolvedTranslation !== resolved) {\n this.resolvedTranslation = resolved\n\n this.options.onLangChange()\n this.host.requestUpdate()\n }\n }\n}\n","/**\n * A base class for events which defaults to bubbling and composed\n */\nexport class NordEvent extends Event {\n constructor(type: string, eventInitDict?: EventInit) {\n super(type, {\n bubbles: true,\n composed: true,\n ...eventInitDict,\n })\n }\n}\n\nexport function oneEvent<K extends keyof GlobalEventHandlersEventMap>(element: HTMLElement, type: K) {\n return new Promise<GlobalEventHandlersEventMap[K]>((resolve) => {\n element.addEventListener(type, e => resolve(e), { once: true })\n })\n}\n\nexport function transition(element: HTMLElement) {\n return Promise.race([oneEvent(element, 'transitionend'), oneEvent(element, 'transitioncancel')])\n}\n\nexport function animation(element: HTMLElement) {\n return Promise.race([oneEvent(element, 'animationend'), oneEvent(element, 'animationcancel')])\n}\n","import { NordEvent } from '../common/events.js'\n\nexport class DateSelectEvent extends NordEvent {\n constructor(\n name: string,\n public date: Date,\n ) {\n super(name)\n }\n}\n","import * as arrowDownIcon from '@nordhealth/icons/lib/assets/arrow-down-small.js'\nimport * as arrowLeftIcon from '@nordhealth/icons/lib/assets/arrow-left-small.js'\nimport * as arrowRightIcon from '@nordhealth/icons/lib/assets/arrow-right-small.js'\nimport { html, isServer, LitElement } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { classMap } from 'lit/directives/class-map.js'\nimport { repeat } from 'lit/directives/repeat.js'\nimport { createKeybindingsHandler } from 'tinykeys'\n\nimport { chunk, mapWithOffset } from '../common/collection.js'\nimport { DirectionController } from '../common/controllers/DirectionController.js'\nimport { isHorizontalSwipe, SwipeController } from '../common/controllers/SwipeController.js'\n\nimport {\n addDays,\n clamp,\n DaysOfWeek,\n endOfMonth,\n endOfWeek,\n getDayNames,\n getMonthNames,\n getViewOfMonth,\n inRange,\n isEqual,\n isEqualMonth,\n parseISODate,\n printISODate,\n setMonth,\n setYear,\n startOfMonth,\n startOfWeek,\n} from '../common/dates.js'\nimport { observe } from '../common/decorators/observe.js'\nimport { cond } from '../common/directives/cond.js'\nimport { range } from '../common/number.js'\nimport componentStyle from '../common/styles/Component.css'\nimport Icon from '../icon/Icon.js'\nimport { LocalizeController } from '../localization/LocalizeController.js'\nimport style from './Calendar.css'\n\nimport { DateSelectEvent } from './DateSelectEvent.js'\nimport '../button/Button.js'\nimport '../visually-hidden/VisuallyHidden.js'\n\nexport type DatePredicate = (date: Date) => boolean\n\nIcon.registerIcon(arrowRightIcon)\nIcon.registerIcon(arrowLeftIcon)\nIcon.registerIcon(arrowDownIcon)\n\nfunction preventDefault(fn: EventListener) {\n return (e: Event) => {\n e.preventDefault()\n fn(e)\n }\n}\n\nconst isDateDisabled: DatePredicate = () => false\nconst isDateHighlighted = () => false\n\nconst dialogLabelId = 'dialog-header'\n\n/**\n * Calendar allows user to pick a date. It comes with built-in\n * functionality that allows you to set a minimum and a maximum allowed date.\n * Please note that the date must be passed in ISO-8601 format.\n *\n * @status ready\n * @category list\n * @fires {DateSelectEvent} change - Dispatched when a date is selected and the value changes.\n * @fires {DateSelectEvent} nord-focus-date - Dispatched when the calendar's focused date changes.\n *\n * @cssprop [--n-calendar-border-radius=var(--n-border-radius)] - Controls how rounded the corners are, using [border radius tokens](/tokens/#border-radius).\n * @cssprop [--n-calendar-box-shadow=var(--n-box-shadow-popout)] - Controls the surrounding shadow, using [box shadow tokens](/tokens/#box-shadow).\n * @cssprop [--n-calendar-padding-block=var(--n-space-m)] - Controls the block padding of the calendar, using [space tokens](/tokens/#space).\n * @cssprop [--n-calendar-padding-inline=var(--n-space-m)] - Controls the inline padding of the calendar, using [space tokens](/tokens/#space).\n * @cssprop [--n-calendar-day-size=var(--n-space-xl)] - Controls the block and inline size of each day cell, using [space tokens](/tokens/#space).\n * @cssprop [--n-calendar-day-font-size=var(--n-font-size-m)] - Controls the font size of each day cell, using [font size tokens](/tokens/#font-size).\n * @cssprop [--n-calendar-select-label-font-size=var(--n-font-size-xl)] - Controls the font size of the month and year select labels, using [font size tokens](/tokens/#font-size).\n * @cssprop [--n-calendar-nav-padding-inline=11px] - Controls the inline padding of the previous and next month buttons.\n * @cssprop [--n-calendar-nav-gap=var(--n-space-xs)] - Controls the gap between the previous and next month buttons, using [space tokens](/tokens/#space).\n * @cssprop [--n-calendar-header-margin-block-end=var(--n-space-m)] - Controls the block-end margin of the calendar header, using [space tokens](/tokens/#space).\n * @cssprop [--n-calendar-header-padding-block-end=0] - Controls the block-end padding of the calendar header, using [space tokens](/tokens/#space).\n * @cssprop [--n-calendar-header-gap=var(--n-space-s)] - Controls the gap between the month/year selects and the navigation buttons, using [space tokens](/tokens/#space).\n * @cssprop [--n-calendar-inline-size=max-content] - Controls the inline size of the calendar. Defaults to `100%` when the `expand` attribute is set.\n *\n * @localization prevMonthLabel - Accessible label for the previous month button.\n * @localization nextMonthLabel - Accessible label for the next month button.\n * @localization monthSelectLabel - Accessible label for the month select.\n * @localization yearSelectLabel - Accessible label for the year select.\n */\n@customElement('nord-calendar')\nexport default class Calendar extends LitElement {\n static styles = [componentStyle, style]\n\n @query('.n-calendar-select-month', true) private monthSelectNode!: HTMLElement\n @query(`button[tabindex=\"0\"]`) private focusedDayNode!: HTMLButtonElement\n\n private direction = new DirectionController(this)\n private swipe = new SwipeController(this, {\n matchesGesture: isHorizontalSwipe,\n onSwipeEnd: ({ distX }) => this.addMonths(distX < 0 ? 1 : -1),\n })\n\n private shortcuts = createKeybindingsHandler({\n 'ArrowRight': preventDefault(() => this.addDays(this.direction.isLTR ? 1 : -1)),\n 'ArrowLeft': preventDefault(() => this.addDays(this.direction.isLTR ? -1 : 1)),\n 'ArrowDown': preventDefault(() => this.addDays(7)),\n 'ArrowUp': preventDefault(() => this.addDays(-7)),\n 'Home': preventDefault(() => this.startOfWeek()),\n 'End': preventDefault(() => this.endOfWeek()),\n 'PageUp': preventDefault(() => this.addMonths(-1)),\n 'PageDown': preventDefault(() => this.addMonths(1)),\n 'Shift+PageUp': preventDefault(() => this.addYears(-1)),\n 'Shift+PageDown': preventDefault(() => this.addYears(1)),\n })\n\n private localize = new LocalizeController<'nord-calendar'>(this, {\n onLangChange: () => this.handleLangChange(),\n })\n\n /**\n * Whilst dateAdapter is used for handling the formatting/parsing dates in the input,\n * these are used to format dates exclusively for the benefit of screen readers.\n *\n * We prefer DateTimeFormat over date.toLocaleDateString, as the former has\n * better performance when formatting large number of dates. See:\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString#Performance\n */\n private dateFormatShort!: Intl.DateTimeFormat\n private monthNames!: string[]\n private monthNamesShort!: string[]\n private dayNames!: string[]\n private dayNamesShort!: string[]\n\n /**\n * The selected date on the calendar. Must be in IS0-8601 format: YYYY-MM-DD.\n */\n @property() value: string = ''\n\n /**\n * Which day is considered first day of the week? `0` for Sunday, `1` for Monday, etc.\n * Default is Monday.\n */\n @property({ reflect: true, type: Number, attribute: 'first-day-of-week' }) firstDayOfWeek: DaysOfWeek\n = DaysOfWeek.Monday\n\n /**\n * Minimum date allowed to be picked. Must be in IS0-8601 format: YYYY-MM-DD.\n * This setting can be used alone or together with the max property.\n */\n @property({ reflect: true }) min?: string\n\n /**\n * Maximum date allowed to be picked. Must be in IS0-8601 format: YYYY-MM-DD.\n * This setting can be used alone or together with the min property.\n */\n @property({ reflect: true }) max?: string\n\n /**\n * The date that is considered today. Must be in IS0-8601 format: YYYY-MM-DD.\n * If not set, the current local date of the user is used.\n */\n @property({ reflect: true }) today?: string\n\n /**\n * Controls whether the calendar expands to fill the width of its container.\n */\n @property({ reflect: true, type: Boolean }) expand = false\n\n /**\n * Controls the size of the calendar.\n */\n @property({ reflect: true }) size: 's' | 'm' = 'm'\n\n /**\n * Controls which days are disabled and therefore disallowed.\n * For example, this can be used to disallow selection of weekends.\n */\n @property({ attribute: false }) isDateDisabled: DatePredicate = isDateDisabled\n\n /**\n * Controls which days are highlighted with a small indicator.\n * Returning a \"falsy\" value will not show an indicator.\n * Returning \"truthy\" value will show the indicator, but without an accessible label.\n * Returning a string will show the indicator, and use the string as accessible label.\n * It is recommended to return a string rather than a truthy value whenever possible.\n */\n @property({ attribute: false }) isDateHighlighted: (date: Date) => string | boolean = isDateHighlighted\n\n @state() private activeFocus = false\n @state() private focusedDay = new Date()\n\n /**\n * Programmatically move focus to the calendar.\n * @param options An object which controls aspects of the focusing process.\n */\n focus(options?: FocusOptions & { target: 'day' | 'month' }) {\n const target = options?.target ?? 'day'\n\n if (target === 'day') {\n this.focusedDayNode.focus()\n }\n else if (target === 'month') {\n this.monthSelectNode.focus()\n }\n }\n\n render() {\n const today = this.getToday()\n const valueAsDate = parseISODate(this.value)\n const focusedMonth = this.focusedDay.getMonth()\n const focusedYear = this.focusedDay.getFullYear()\n\n const minDate = parseISODate(this.min || '')\n const maxDate = parseISODate(this.max || '')\n const minDateStartOfMonth = minDate ? startOfMonth(minDate) : undefined\n const maxDateEndOfMonth = maxDate ? endOfMonth(maxDate) : undefined\n\n const currentYear = today.getFullYear()\n const minYear = minDate ? minDate.getFullYear() : currentYear - 100\n const maxYear = maxDate ? maxDate.getFullYear() : currentYear + 10\n\n if (isServer) {\n // Needed when run on a server, because the `onLangChange` callback does not get triggered, so we need to manually\n // call `handleLangChange` to set the localized values for month and day names, which the `render` method relies on.\n this.handleLangChange()\n }\n\n return html`\n <div class=\"n-calendar\">\n <div class=\"n-calendar-header\">\n <div>\n <nord-visually-hidden>\n <h2 id=${dialogLabelId} aria-live=\"polite\" aria-atomic=\"true\">\n ${this.monthNames[focusedMonth]}, ${this.focusedDay.getFullYear()}\n </h2>\n </nord-visually-hidden>\n\n <div class=\"n-calendar-select\">\n <select\n aria-label=${this.localize.term('monthSelectLabel')}\n class=\"n-calendar-select-month\"\n @input=${this.handleMonthSelect}\n >\n ${this.monthNames.map(\n (month, i) => html`\n <option\n value=${i}\n ?selected=${i === focusedMonth}\n ?disabled=${!inRange(new Date(focusedYear, i, 1), minDateStartOfMonth, maxDateEndOfMonth)}\n >\n ${month}\n </option>\n `,\n )}\n </select>\n <div class=\"n-calendar-select-label\" aria-hidden=\"true\">\n <span>${this.monthNamesShort[focusedMonth]}</span>\n <nord-icon color=\"var(--n-color-icon)\" name=\"arrow-down-small\" size=\"xxs\"></nord-icon>\n </div>\n </div>\n\n <div class=\"n-calendar-select\">\n <select\n aria-label=${this.localize.term('yearSelectLabel')}\n class=\"n-calendar-select-year\"\n @input=${this.handleYearSelect}\n >\n ${repeat(\n range(minYear, maxYear),\n year => year,\n year => html`<option ?selected=${year === focusedYear}>${year}</option>`,\n )}\n </select>\n <div class=\"n-calendar-select-label\" aria-hidden=\"true\">\n <span>${this.focusedDay.getFullYear()}</span>\n <nord-icon color=\"var(--n-color-icon)\" name=\"arrow-down-small\" size=\"xxs\"></nord-icon>\n </div>\n </div>\n </div>\n\n <div class=\"n-calendar-nav\">\n <nord-button\n class=\"n-calendar-prev\"\n size=${this.size}\n square\n @click=${this.handlePreviousMonthClick}\n ?disabled=${isEqualMonth(minDate, this.focusedDay)}\n type=\"button\"\n >\n <nord-visually-hidden>${this.localize.term('prevMonthLabel')}</nord-visually-hidden>\n <nord-icon name=${this.direction.isLTR ? 'arrow-left-small' : 'arrow-right-small'} size=${this.size === 's' ? 'xs' : 's'}></nord-icon>\n </nord-button>\n\n <nord-button\n class=\"n-calendar-next\"\n size=${this.size}\n square\n @click=${this.handleNextMonthClick}\n ?disabled=${isEqualMonth(maxDate, this.focusedDay)}\n type=\"button\"\n >\n <nord-visually-hidden>${this.localize.term('nextMonthLabel')}</nord-visually-hidden>\n <nord-icon name=${this.direction.isLTR ? 'arrow-right-small' : 'arrow-left-small'} size=${this.size === 's' ? 'xs' : 's'}></nord-icon>\n </nord-button>\n </div>\n </div>\n\n <table\n class=\"n-calendar-table\"\n aria-labelledby=${dialogLabelId}\n @focusin=${this.enableActiveFocus}\n @focusout=${this.disableActiveFocus}\n >\n <thead>\n <tr>\n ${mapWithOffset(\n this.dayNames,\n this.firstDayOfWeek,\n (dayName, i) => html`\n <th class=\"n-calendar-table-header\" scope=\"col\">\n <span aria-hidden=\"true\">${this.dayNamesShort[i]}</span>\n <nord-visually-hidden>${dayName}</nord-visually-hidden>\n </th>\n `,\n )}\n </tr>\n </thead>\n <tbody>\n ${chunk(getViewOfMonth(this.focusedDay, this.firstDayOfWeek), 7).map(\n week => html`\n <tr class=\"n-calendar-row\">\n ${week.map((day) => {\n const outsideRange = !inRange(day, minDate, maxDate)\n const isToday = isEqual(day, today)\n const isDisabled = this.isDateDisabled(day)\n const isSelected = isEqual(day, valueAsDate)\n const isInMonth = isEqualMonth(day, this.focusedDay)\n const isHighlighted = this.isDateHighlighted(day)\n const formattedDate = this.dateFormatShort.format(day)\n\n const accessibleLabel\n = isHighlighted && typeof isHighlighted === 'string'\n ? `${formattedDate}, ${isHighlighted}`\n : formattedDate\n\n return html`\n <td class=\"n-calendar-cell\">\n <button\n type=\"button\"\n tabindex=${isEqual(day, this.focusedDay) ? 0 : -1}\n class=${classMap({\n 'n-calendar-day': true,\n 'is-outside': outsideRange,\n 'is-month': isInMonth,\n 'is-highlighted': isHighlighted,\n })}\n @click=${() => this.handleDaySelect(day)}\n @keydown=${this.shortcuts}\n ?disabled=${outsideRange}\n aria-disabled=${cond(isDisabled, 'true')}\n aria-pressed=${isSelected ? 'true' : 'false'}\n aria-current=${cond(isToday, 'date')}\n aria-label=${accessibleLabel}\n >\n <span aria-hidden=\"true\">${day.getDate()}</span>\n </button>\n </td>\n `\n })}\n </tr>\n `,\n )}\n </tbody>\n </table>\n </div>\n `\n }\n\n @observe('value')\n protected handleValueChange() {\n this.setFocusedDay(parseISODate(this.value) || this.getToday())\n }\n\n @observe('focusedDay', 'updated')\n protected handleFocusedDayChange() {\n if (this.activeFocus) {\n this.focusedDayNode.focus()\n }\n }\n\n private handleLangChange() {\n const lang = this.localize.resolvedLang\n this.dateFormatShort = new Intl.DateTimeFormat(lang, { day: 'numeric', month: 'long' })\n this.monthNames = getMonthNames(lang, 'long')\n this.monthNamesShort = getMonthNames(lang, 'short')\n this.dayNames = getDayNames(lang, 'long')\n this.dayNamesShort = getDayNames(lang, 'narrow')\n }\n\n private handleDaySelect = (day: Date) => {\n const isInRange = inRange(day, parseISODate(this.min || ''), parseISODate(this.max || ''))\n const isAllowed = !this.isDateDisabled(day)\n\n if (isInRange && isAllowed) {\n this.value = printISODate(day)\n this.dispatchEvent(new DateSelectEvent('change', day))\n }\n }\n\n private getToday() {\n return parseISODate(this.today || '') || new Date()\n }\n\n private addDays(days: number) {\n this.setFocusedDay(addDays(this.focusedDay, days))\n }\n\n private addMonths(months: number) {\n this.setMonth(this.focusedDay.getMonth() + months)\n }\n\n private addYears(years: number) {\n this.setYear(this.focusedDay.getFullYear() + years)\n }\n\n private startOfWeek() {\n this.setFocusedDay(startOfWeek(this.focusedDay, this.firstDayOfWeek))\n }\n\n private endOfWeek() {\n this.setFocusedDay(endOfWeek(this.focusedDay, this.firstDayOfWeek))\n }\n\n private setMonth(month: number) {\n const min = setMonth(startOfMonth(this.focusedDay), month)\n const max = endOfMonth(min)\n const date = setMonth(this.focusedDay, month)\n\n this.setFocusedDay(clamp(date, min, max))\n }\n\n private setYear(year: number) {\n const min = setYear(startOfMonth(this.focusedDay), year)\n const max = endOfMonth(min)\n const date = setYear(this.focusedDay, year)\n\n this.setFocusedDay(clamp(date, min, max))\n }\n\n private setFocusedDay(day: Date) {\n this.focusedDay = clamp(day, parseISODate(this.min || ''), parseISODate(this.max || ''))\n this.dispatchEvent(new DateSelectEvent('nord-focus-date', this.focusedDay))\n }\n\n private handleMonthSelect = (e: Event) => {\n this.setMonth(Number.parseInt((e.target as HTMLSelectElement).value, 10))\n }\n\n private handleYearSelect = (e: Event) => {\n this.setYear(Number.parseInt((e.target as HTMLSelectElement).value, 10))\n }\n\n private handleNextMonthClick = (event: MouseEvent) => {\n event.preventDefault()\n this.addMonths(1)\n }\n\n private handlePreviousMonthClick = (event: MouseEvent) => {\n event.preventDefault()\n this.addMonths(-1)\n }\n\n private enableActiveFocus = () => {\n this.activeFocus = true\n }\n\n private disableActiveFocus = (e: FocusEvent) => {\n const table = e.currentTarget as Node\n const relatedTarget = e.relatedTarget as Node\n\n if (relatedTarget && !table.contains(relatedTarget)) {\n this.activeFocus = false\n }\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-calendar': Calendar\n }\n}\n","import { html, LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { SlotController } from '../common/controllers/SlotController.js'\nimport componentStyle from '../common/styles/Component.css'\nimport style from './Card.css'\n\n/**\n * Cards are shadowed surfaces that display content and actions on a\n * single topic. They should be easy to scan for relevant and\n * actionable information.\n *\n * @status ready\n * @category structure\n * @slot - The card content.\n * @slot header - Optional slot that holds a header for the card.\n * @slot header-end - Optional slot that positions content at the end of the header. Useful for actions or additional info.\n * @slot footer - Optional slot that holds footer content for the card.\n *\n * @cssprop [--n-card-border-radius=var(--n-border-radius)] - Controls how rounded the corners are, using [border radius tokens](/tokens/#border-radius).\n * @cssprop [--n-card-box-shadow=var(--n-box-shadow-popout)] - Controls the surrounding shadow, using [box shadow tokens](/tokens/#box-shadow).\n * @cssprop [--n-card-padding=var(--n-space-m)] - Controls the padding on all sides of the card.\n * @cssprop [--n-card-slot-padding=var(--n-space-m)] - Controls the padding of items slotted within the card. This does not affect the block padding of items slotted into the header.\n * @cssprop [--n-card-header-background=transparent] - Controls the background color of the card header.\n * @cssprop [--n-card-border-color=var(--n-color-border)] - Controls the border color of the card header and footer divider.\n * @cssprop [--n-card-header-padding-block=var(--n-space-m)] - Controls the block (top and bottom) padding of the card header.\n * @cssprop [--n-card-header-padding-inline=var(--n-card-slot-padding)] - Controls the inline (left and right) padding of the card header.\n * @cssprop [--n-card-header-slot-flex-grow=0] - Controls the flex-grow value of the header slot.\n */\n@customElement('nord-card')\nexport default class Card extends LitElement {\n static styles = [componentStyle, style]\n\n private headerSlot = new SlotController(this, 'header')\n private headerEndSlot = new SlotController(this, 'header-end')\n private footerSlot = new SlotController(this, 'footer')\n\n /**\n * Controls the padding of the card component. When set to “none”,\n * the header and footer slots will still have padding.\n */\n @property({ reflect: true }) padding: 'm' | 'l' | 'none' = 'm'\n\n /**\n * When set, adds a divider border above the footer slot.\n */\n @property({ type: Boolean, reflect: true, attribute: 'footer-divider' }) footerDivider = false\n\n render() {\n return html`\n <div class=\"n-card\">\n <div class=\"header\" ?hidden=${this.headerSlot.isEmpty && this.headerEndSlot.isEmpty}>\n <slot name=${this.headerSlot.slotName}></slot>\n <slot name=${this.headerEndSlot.slotName}></slot>\n </div>\n <slot></slot>\n <slot name=${this.footerSlot.slotName} ?hidden=${this.footerSlot.isEmpty}></slot>\n </div>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-card': Card\n }\n}\n","export default '<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m18.9985 5.35769-9.8419 10.83221c-.27855.3095-.68088.4952-1.11417.5107h-.03095c-.41782 0-.80469-.1548-1.0987-.4488l-5.91132-5.9113 2.18193-2.1819 4.76619 4.7662 8.75862-9.62524 2.2903 2.08908z\" fill=\"currentColor\"/></svg>';\nexport const title = \"interface-checked-small\";\nexport const tags =\n \"nordicon interface checked small symbol checkmark done ready\";\n","export default '<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m20 8.49976v3.00004h-20v-3.00004z\" fill=\"currentColor\"/></svg>';\nexport const title = \"interface-remove-small\";\nexport const tags =\n \"nordicon interface remove small delete erase minimize line\";\n","import type { ReactiveController, ReactiveControllerHost } from 'lit'\nimport type { InputMixinInterface } from '../mixins/InputMixin.js'\n\ninterface FormDataOptions {\n value: () => string | undefined\n}\n\nexport class FormDataController implements ReactiveController {\n private _form: HTMLFormElement | null = null\n\n constructor(\n private host: ReactiveControllerHost & InputMixinInterface,\n private options: FormDataOptions,\n ) {\n host.addController(this)\n }\n\n hostConnected() {\n this.listen(this.host.form)\n }\n\n hostUpdated() {\n this.listen(this.host.form)\n }\n\n hostDisconnected() {\n this.cleanup()\n }\n\n private listen(form: HTMLFormElement | null) {\n if (this._form !== form) {\n this.cleanup()\n this._form = form\n this._form?.addEventListener('formdata', this.handleFormData)\n }\n }\n\n private cleanup() {\n this._form?.removeEventListener('formdata', this.handleFormData)\n this._form = null\n }\n\n private handleFormData = (e: FormDataEvent) => {\n const { disabled, name } = this.host\n\n if (disabled) {\n return\n }\n if (!name) {\n return\n }\n\n const value = this.options.value()\n if (value != null) {\n e.formData.append(name, value)\n }\n }\n}\n","import type { LitElement, TemplateResult } from 'lit'\nimport type { InputMixinInterface } from './InputMixin.js'\nimport { html, nothing } from 'lit'\nimport { property } from 'lit/decorators.js'\nimport { FormDataController } from '../controllers/FormDataController.js'\nimport { SlotController } from '../controllers/SlotController.js'\nimport { NordEvent } from '../events.js'\nimport '../../visually-hidden/VisuallyHidden.js'\n\ntype Constructor<T = Record<string, unknown>> = new (...args: any[]) => T\ntype NativeInputElement = HTMLSelectElement | HTMLInputElement | HTMLTextAreaElement\n\nexport declare class FormAssociatedMixinInterface {\n label: string\n required: boolean\n hideRequired: boolean\n hint?: string\n hintBelow: boolean\n hideLabel: boolean\n placeholder?: string\n error?: string\n\n protected inputId: string\n protected errorId: string\n protected hintId: string\n protected labelSlot: SlotController\n protected hintSlot: SlotController\n protected errorSlot: SlotController\n protected formData: FormDataController\n\n protected get formValue(): string | undefined\n protected get hasError(): boolean\n protected get hasHint(): boolean\n protected get isHintBelow(): boolean\n\n protected handleChange(e: Event): void\n protected handleInput(e: Event): void\n protected renderLabel(additionalContent?: TemplateResult): TemplateResult\n protected renderHint(): TemplateResult\n protected renderError(): TemplateResult\n protected getDescribedBy(): string | undefined\n protected getInvalid(): 'true' | undefined\n}\n\nexport function FormAssociatedMixin<T extends Constructor<InputMixinInterface & LitElement>>(superClass: T) {\n // TODO: would be nice if custom elements analyzer could pick up the slot docs from the mixin\n\n /**\n * @slot label - Use when a label requires more than plain text.\n * @slot hint - Use when a hint requires more than plain text.\n * @slot error - Optional slot that holds error text for the input.\n */\n class FormAssociatedElement extends superClass {\n protected labelSlot = new SlotController(this, 'label')\n protected errorSlot = new SlotController(this, 'error')\n protected hintSlot = new SlotController(this, 'hint')\n protected formData = new FormDataController(this, { value: () => this.formValue })\n\n protected get formValue() {\n return this.value\n }\n\n protected inputId = 'input'\n protected errorId = 'error'\n protected hintId = 'hint'\n\n /**\n * Label for the input.\n */\n @property({ reflect: true }) label: string = ''\n\n /**\n * Optional hint text to be displayed with the input. Alternatively use the hint slot.\n */\n @property({ reflect: true }) hint?: string\n\n /**\n * Renders the hint below the input and any error instead of below the label.\n */\n @property({ reflect: true, type: Boolean, attribute: 'hint-below' }) hintBelow = false\n\n /**\n * Visually hide the label, but still show it to assistive technologies like screen readers.\n */\n @property({ reflect: true, type: Boolean, attribute: 'hide-label' }) hideLabel = false\n\n /**\n * Placeholder text to display within the input.\n */\n @property({ reflect: true }) placeholder?: string\n\n /**\n * Optional error to be shown with the input. Alternatively use the error slot.\n */\n @property({ reflect: true }) error?: string\n\n /**\n * Determines whether the input is required or not.\n * An input marked as required will be announced as such to users of assistive technology.\n * When using this property you need to also set “novalidate” attribute on a form element to prevent browser from displaying its own validation errors.\n */\n @property({ reflect: true, type: Boolean }) required = false\n\n /**\n * Visually hide the required indicator, but still show\n * required attribute to assistive technologies like screen readers.\n */\n @property({ reflect: true, type: Boolean, attribute: 'hide-required' }) hideRequired = false\n\n protected handleInput(e: Event) {\n e.stopPropagation()\n const target = e.target as NativeInputElement\n this.value = target.value\n\n /**\n * Fired as the user types into the input.\n */\n this.dispatchEvent(new NordEvent('input'))\n }\n\n protected handleChange(e: Event) {\n e.stopPropagation()\n\n /**\n * Fired whenever the input's value is changed via user interaction.\n */\n this.dispatchEvent(new NordEvent('change'))\n }\n\n protected renderLabel(additionalContent?: TemplateResult) {\n const label = html`\n <label for=${this.inputId}>\n <slot name=\"label\">${this.label}</slot\n ><span ?hidden=${!this.required || this.hideRequired} aria-hidden=\"true\" class=\"n-required\">*</span>\n ${additionalContent}\n </label>\n `\n\n if (this.hideLabel) {\n return html`\n <nord-visually-hidden>\n ${label}\n ${this.isHintBelow ? nothing : this.renderHint()}\n </nord-visually-hidden>\n `\n }\n\n return html`\n <div class=\"n-label-container\">\n ${label}\n ${this.isHintBelow ? nothing : this.renderHint()}\n </div>\n `\n }\n\n protected renderHint() {\n return html`\n <div class=\"n-caption n-hint\" id=${this.hintId} ?hidden=${!this.hasHint}>\n <slot name=\"hint\">${this.hint}</slot>\n </div>\n `\n }\n\n protected renderError() {\n return html`\n <div class=\"n-caption n-error\" id=${this.errorId} role=\"alert\" ?hidden=${!this.hasError}>\n <slot name=\"error\">${this.error}</slot>\n </div>\n `\n }\n\n protected getDescribedBy() {\n const { hasHint, hasError } = this\n\n if (hasHint && hasError) {\n if (this.isHintBelow) {\n return `${this.errorId} ${this.hintId}`\n }\n return `${this.hintId} ${this.errorId}`\n }\n if (hasHint) {\n return this.hintId\n }\n if (hasError) {\n return this.errorId\n }\n\n return undefined\n }\n\n protected getInvalid() {\n return this.hasError ? 'true' : undefined\n }\n\n protected get hasHint() {\n return Boolean(this.hint) || this.hintSlot.hasContent\n }\n\n protected get hasError() {\n return Boolean(this.error) || this.errorSlot.hasContent\n }\n\n protected get isHintBelow() {\n return this.hintBelow\n }\n }\n\n return FormAssociatedElement as unknown as Constructor<FormAssociatedMixinInterface> & T\n}\n","import type { LitElement } from 'lit'\nimport { property } from 'lit/decorators.js'\n\ntype Constructor<T = Record<string, unknown>> = new (...args: any[]) => T\n\nexport declare class SizeMixinInterface {\n size: 's' | 'm' | 'l'\n}\n\nexport function SizeMixin<T extends Constructor<LitElement>>(superClass: T): Constructor<SizeMixinInterface> & T {\n class SizeElement extends superClass {\n /**\n * The size of the component.\n */\n @property({ reflect: true }) size: 's' | 'm' | 'l' = 'm'\n }\n\n return SizeElement\n}\n","import * as checkedIcon from '@nordhealth/icons/lib/assets/interface-checked-small.js'\nimport * as indeterminateIcon from '@nordhealth/icons/lib/assets/interface-remove-small.js'\nimport { html, LitElement, nothing } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { ref } from 'lit/directives/ref.js'\n\nimport { FocusableMixin } from '../common/mixins/FocusableMixin.js'\nimport { FormAssociatedMixin } from '../common/mixins/FormAssociatedMixin.js'\nimport { InputMixin } from '../common/mixins/InputMixin.js'\nimport { SizeMixin } from '../common/mixins/SizeMixin.js'\nimport componentStyle from '../common/styles/Component.css'\n\nimport formFieldStyle from '../common/styles/FormField.css'\nimport Icon from '../icon/Icon.js'\nimport style from './Checkbox.css'\n\nIcon.registerIcon(checkedIcon)\nIcon.registerIcon(indeterminateIcon)\n\n/**\n * Checkboxes allow user to choose one or more options from a limited set of options.\n * If you have more than 10 options, please use Select component instead.\n *\n * @status ready\n * @category form\n * @slot label - Use when a label requires more than plain text.\n * @slot hint - Optional slot that holds hint text for the input.\n * @slot error - Optional slot that holds error text for the input.\n *\n * @cssprop [--n-label-color=var(--n-color-text)] - Controls the text color of the label, using our [color tokens](/tokens/#color).\n */\n@customElement('nord-checkbox')\nexport default class Checkbox extends SizeMixin(FormAssociatedMixin(InputMixin(FocusableMixin(LitElement)))) {\n static styles = [componentStyle, formFieldStyle, style]\n\n protected override get formValue() {\n return this.checked ? this.value || 'on' : undefined\n }\n\n /**\n * Controls whether the checkbox is in an indeterminate state.\n */\n @property({ reflect: true, type: Boolean }) indeterminate = false\n\n /**\n * Controls whether the checkbox is checked or not.\n */\n @property({ reflect: true, type: Boolean }) checked: boolean = false\n\n render() {\n return html`\n <div class=\"n-flex\">\n <div class=\"n-input-container\">\n <input\n ${ref(this.focusableRef)}\n class=\"n-input\"\n id=${this.inputId}\n type=\"checkbox\"\n name=${ifDefined(this.name)}\n .value=${this.value}\n .checked=${this.checked}\n .indeterminate=${this.indeterminate}\n ?disabled=${this.disabled}\n ?required=${this.required}\n aria-describedby=${ifDefined(this.getDescribedBy())}\n aria-invalid=${ifDefined(this.getInvalid())}\n @change=${this.handleChange}\n />\n <nord-icon class=\"icon-checked\" name=\"interface-checked-small\"></nord-icon>\n <nord-icon class=\"icon-indeterminate\" name=\"interface-remove-small\"></nord-icon>\n </div>\n <div class=\"n-expand\">${this.renderLabel()} ${this.isHintBelow ? nothing : this.renderError()}</div>\n </div>\n ${this.isHintBelow ? this.renderError() : nothing}\n ${this.isHintBelow ? this.renderHint() : nothing}\n `\n }\n\n protected handleChange(e: Event): void {\n const target = e.target as HTMLInputElement\n this.checked = target.checked\n super.handleChange(e)\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-checkbox': Checkbox\n }\n}\n","export default '<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m8.29008 12.3413 1.41 1.42-3.96 3.95c-.2.19-.45.29-.71.29s-.51-.1-.71-.29l-3.990002-4 1.410002-1.42 2.26 2.25v-12.54002h2v12.63002zm11.38002-6.05002-4.01-4c-.39-.39-1.02-.39-1.41 0l-3.96 3.95 1.41 1.42 2.29-2.29v12.63002h2v-12.54002l2.26 2.25 1.41-1.42z\" fill=\"currentColor\"/></svg>';\nexport const title = \"keyboard-arrow-up-down\";\nexport const tags = \"nordicon keyboard keys arrow up down shortcut\";\n","export default '<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m18 2h-10.54c-.58 0-1.14.25-1.52.7l-5.14 6c-.65.75-.65 1.85 0 2.6l5.14 6c.38.44.93.7 1.52.7h10.54c1.1 0 2-.9 2-2v-12c0-1.1-.9-2-2-2zm0 14h-10.54l-5.14-6 5.14-6h10.54zm-9.54-3.88 2.12-2.12-2.12-2.12 1.41-1.41 2.12 2.12 2.12-2.12 1.41 1.41-2.12 2.12 2.12 2.12-1.41 1.41-2.12-2.12-2.12 2.12z\" fill=\"currentColor\"/></svg>';\nexport const title = \"keyboard-backspace\";\nexport const tags = \"nordicon keyboard backspace back delete key shortcut\";\n","export default '<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m18.0025 4v8c0 1.1-.9 2-2 2h-12.59l3 3-1.41 1.41-4.71-4.7c-.39-.39-.39-1.02 0-1.41l4.71-4.71 1.41 1.41-3 3h12.59v-8h-4v-2h4c1.1 0 2 .9 2 2z\" fill=\"currentColor\"/></svg>';\nexport const title = \"keyboard-return\";\nexport const tags = \"nordicon keyboard return key shortcut\";\n","import type { ReactiveController, ReactiveControllerHost } from 'lit'\nimport type { KeyBindingMap } from 'tinykeys'\nimport tinykeys from 'tinykeys'\n\ntype ShortcutTarget = Parameters<typeof tinykeys>[0]\n\nconst ARROW_RE = /Arrow(Up|Down|Left|Right)/g\nconst ESC_RE = /Escape/g\n\nfunction normalise(shortcuts: KeyBindingMap) {\n const normalised: KeyBindingMap = {}\n\n Object.keys(shortcuts).forEach((keybinding) => {\n normalised[keybinding] = shortcuts[keybinding]\n\n // Arrow and Escape keys in IE/Edge have different names\n if (ARROW_RE.test(keybinding)) {\n const mapped = keybinding.replace(ARROW_RE, (_match, capture) => capture)\n normalised[mapped] = normalised[keybinding]\n }\n if (ESC_RE.test(keybinding)) {\n const mapped = keybinding.replace(ESC_RE, () => 'Esc')\n normalised[mapped] = normalised[keybinding]\n }\n })\n\n return normalised\n}\n\nexport class ShortcutController implements ReactiveController {\n private unregister?: ReturnType<typeof tinykeys>\n\n constructor(\n host: ReactiveControllerHost,\n private shortcuts?: KeyBindingMap,\n private target?: ShortcutTarget,\n ) {\n host.addController(this)\n }\n\n hostConnected() {\n if (this.shortcuts) {\n this.bind(this.shortcuts)\n }\n }\n\n hostDisconnected() {\n this.unbind()\n }\n\n unbind() {\n this.unregister?.()\n }\n\n bind(shortcuts: KeyBindingMap) {\n this.unbind()\n this.shortcuts = shortcuts\n this.unregister = tinykeys(this.target ?? window, normalise(this.shortcuts))\n }\n}\n\nexport type { KeyBindingMap as ShortcutMap }\n","import type { ReactiveController, ReactiveControllerHost } from 'lit'\nimport { EventController } from './EventController.js'\nimport { ShortcutController } from './ShortcutController.js'\n\nexport interface LightDismissOptions {\n isOpen: () => boolean\n onDismiss: EventListener\n isDismissible?: (node: EventTarget) => boolean\n}\n\nexport class LightDismissController implements ReactiveController {\n private shortcut: ShortcutController\n private events: EventController\n\n private isMouseDownOutside = false\n\n constructor(\n private host: ReactiveControllerHost & Element,\n private options: LightDismissOptions,\n ) {\n host.addController(this)\n this.shortcut = new ShortcutController(host, { Escape: this.handleEsc })\n this.events = new EventController(host)\n }\n\n hostConnected() {\n this.events.listen(document, 'mousedown', this.handleMouseDown, true)\n this.events.listen(document, 'click', this.handleClick, true)\n }\n\n private handleEsc = (e: KeyboardEvent) => {\n if (!this.options.isOpen()) {\n return\n }\n\n this.options.onDismiss(e)\n }\n\n private handleMouseDown = (e: MouseEvent) => {\n if (!this.options.isOpen()) {\n return\n }\n\n const predicate: LightDismissOptions['isDismissible'] = this.options.isDismissible ?? (node => node !== this.host)\n this.isMouseDownOutside = e.composedPath().every(predicate)\n }\n\n private handleClick = (e: MouseEvent) => {\n if (!this.options.isOpen()) {\n return\n }\n\n const predicate: LightDismissOptions['isDismissible'] = this.options.isDismissible ?? (node => node !== this.host)\n const isClickOutside = e.composedPath().every(predicate)\n\n const shouldDismiss = isClickOutside && this.isMouseDownOutside\n\n if (shouldDismiss) {\n this.options.onDismiss(e)\n }\n }\n}\n","/**\n * Gets the currently focused element, taking shadow roots into account.\n */\nexport function getFocusedElement(root: Document | ShadowRoot): Element | undefined {\n if (root.activeElement?.shadowRoot) {\n return getFocusedElement(root.activeElement.shadowRoot)\n }\n\n return root.activeElement || undefined\n}\n","import type { ReactiveController } from 'lit'\nimport type { ShortcutMap } from '../common/controllers/ShortcutController.js'\nimport type CommandMenu from './CommandMenu.js'\nimport { ShortcutController } from '../common/controllers/ShortcutController.js'\n\ninterface KeyboardActions {\n trigger: () => void\n goBack: () => void\n start: () => void\n end: () => void\n next: () => void\n previous: () => void\n toggleOpen: () => void\n}\n\nfunction preventDefault(fn: (e: Event) => void) {\n return (e: Event) => {\n e.preventDefault()\n fn(e)\n }\n}\n\nexport class KeyboardController {\n private globalShortcuts: ShortcutController\n private navigationShortcuts: ShortcutController\n private commandShortcuts: ShortcutController\n\n constructor(\n private host: CommandMenu,\n actions: KeyboardActions,\n ) {\n host.addController(this as ReactiveController)\n\n this.commandShortcuts = new ShortcutController(host)\n this.globalShortcuts = new ShortcutController(host, { '$mod+k': preventDefault(actions.toggleOpen) })\n this.navigationShortcuts = new ShortcutController(\n host,\n {\n Enter: preventDefault(actions.trigger),\n Backspace: actions.goBack, // we don't want to prevent default, since that would stop backspace deleting chars\n End: preventDefault(actions.end),\n Home: preventDefault(actions.start),\n ArrowDown: preventDefault(actions.next),\n ArrowUp: preventDefault(actions.previous),\n },\n host,\n )\n }\n\n registerCommandShortcuts() {\n const shortcuts: ShortcutMap = {}\n\n for (const command of this.host.commands) {\n if (command.shortcut) {\n shortcuts[command.shortcut] = () => command.handler?.(this.host)\n }\n }\n\n this.commandShortcuts.bind(shortcuts)\n }\n}\n","import type { ICommandMenuAction } from './ICommandMenuAction.js'\nimport { NordEvent } from '../common/events.js'\n\nexport class SelectEvent extends NordEvent {\n static eventName = 'nord-select'\n\n constructor(public command: ICommandMenuAction) {\n super(SelectEvent.eventName)\n }\n}\n","export default '<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><g fill=\"currentColor\"><path d=\"m14.4101 18.0001-1.42 1.41-8.70004-8.74c-.39-.39-.39-1.02001 0-1.41001l8.64004-8.670002 1.42 1.410002-7.94004 7.97 8.00004 8.04001z\"/><path d=\"m14.4101 18.0001-1.42 1.41-8.70004-8.74c-.39-.39-.39-1.02001 0-1.41001l8.64004-8.670002 1.42 1.410002-7.94004 7.97 8.00004 8.04001z\"/></g></svg>';\nexport const title = \"arrow-left\";\nexport const tags = \"nordicon arrow left caret pointing triangle chevron\";\n","export default '<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m14.7098 10.7401-8.63996 8.67-1.42-1.41 7.93996-7.97-7.99996-8.03001 1.42-1.410002 8.69996 8.740002c.39.39.39 1.02001 0 1.41001z\" fill=\"currentColor\"/></svg>';\nexport const title = \"arrow-right\";\nexport const tags = \"nordicon arrow right caret pointing triangle chevron\";\n","export default '<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m13.5 14h6.5v2h-6.5c-.63 0-1.22-.3-1.6-.8l-5.4-7.2h-6.5v-2h6.5c.63 0 1.22.3 1.6.8zm-1.5-8v2h8v-2z\" fill=\"currentColor\"/></svg>';\nexport const title = \"keyboard-option\";\nexport const tags = \"nordicon keyboard option key shortcut\";\n","import type { ICommandMenuAction } from './ICommandMenuAction.js'\nimport * as chevronIconLeft from '@nordhealth/icons/lib/assets/arrow-left.js'\nimport * as chevronIconRight from '@nordhealth/icons/lib/assets/arrow-right.js'\nimport * as altKeyIcon from '@nordhealth/icons/lib/assets/keyboard-option.js'\nimport { html, LitElement, nothing } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { classMap } from 'lit/directives/class-map.js'\nimport { DirectionController } from '../common/controllers/DirectionController.js'\nimport { observe } from '../common/decorators/observe.js'\nimport Icon from '../icon/Icon.js'\nimport style from './CommandMenuAction.css'\n\nimport '../visually-hidden/VisuallyHidden.js'\n\nconst KEY_REGEX = /(?:Key|Digit)([A-Z0-9])/g\nconst isMacintosh = () => navigator.platform.includes('Mac')\n\nIcon.registerIcon(chevronIconLeft)\nIcon.registerIcon(chevronIconRight)\nIcon.registerIcon(altKeyIcon)\n\n/**\n * Command Menu Action displays a single action that can be executed by the user. For usage examples, please see Command Menu component.\n *\n * @status internal\n */\n@customElement('nord-command-menu-action')\nexport default class CommandMenuAction extends LitElement {\n static styles = style\n\n private direction = new DirectionController(this)\n\n @property({ type: Object }) command!: ICommandMenuAction\n\n @property({ type: Boolean }) selected = false\n\n override render() {\n return html`\n <div\n class=${classMap({\n 'n-selected': this.selected,\n 'n-command': true,\n })}\n >\n <div aria-hidden=\"true\" class=\"n-command-icon\">\n <nord-icon size=\"s\" name=${this.getIconName()}></nord-icon>\n </div>\n <div class=\"n-title\">${this.command.title}</div>\n ${this.renderShortcut()}\n </div>\n `\n }\n\n /**\n * Scroll to show element\n */\n @observe('selected')\n protected ensureInView() {\n if (this.selected) {\n requestAnimationFrame(() => this.scrollIntoView({ block: 'nearest' }))\n }\n }\n\n private getIconName() {\n if (this.command.icon) {\n return this.command.icon\n }\n\n return this.direction.isLTR ? chevronIconRight.title : chevronIconLeft.title\n }\n\n private renderShortcut() {\n if (!this.command.shortcut) {\n return nothing\n }\n\n const keys = this.command.shortcut.replace(KEY_REGEX, '$1')\n\n return html`\n <nord-visually-hidden>, ${keys}</nord-visually-hidden>\n\n <div aria-hidden=\"true\" class=\"n-shortcuts\">\n ${keys\n .split('+')\n .map(\n key =>\n html`<div class=\"n-shortcut\">\n ${key.toLowerCase() === 'alt' && isMacintosh()\n ? html`<nord-icon name=${altKeyIcon.title} size=\"s\"></nord-icon>`\n : key}\n </div>`,\n )}\n </div>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-command-menu-action': CommandMenuAction\n }\n}\n","import type { ICommandMenuAction } from './ICommandMenuAction.js'\nimport * as navigateIcon from '@nordhealth/icons/lib/assets/keyboard-arrow-up-down.js'\nimport * as backspaceIcon from '@nordhealth/icons/lib/assets/keyboard-backspace.js'\nimport * as enterIcon from '@nordhealth/icons/lib/assets/keyboard-return.js'\nimport { html, LitElement, nothing } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\n\nimport { classMap } from 'lit/directives/class-map.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { createRef, ref } from 'lit/directives/ref.js'\n\nimport { repeat } from 'lit/directives/repeat.js'\nimport { groupBy } from '../common/collection.js'\nimport { LightDismissController } from '../common/controllers/LightDismissController.js'\nimport { observe } from '../common/decorators/observe.js'\nimport { cond } from '../common/directives/cond.js'\nimport { NordEvent } from '../common/events.js'\n\nimport { getFocusedElement } from '../common/focus.js'\nimport { wrap } from '../common/number.js'\nimport componentStyle from '../common/styles/Component.css'\nimport Icon from '../icon/Icon.js'\nimport { LocalizeController } from '../localization/LocalizeController.js'\nimport style from './CommandMenu.css'\nimport { KeyboardController } from './KeyboardController.js'\nimport { SelectEvent } from './SelectEvent.js'\nimport '../visually-hidden/VisuallyHidden.js'\nimport './CommandMenuAction.js'\n\nIcon.registerIcon(navigateIcon)\nIcon.registerIcon(enterIcon)\nIcon.registerIcon(backspaceIcon)\n\n/**\n * Command Menu allows users to navigate and use an app without\n * touching the mouse and helps them transform into “power users”\n * who can harness more advanced features far faster.\n *\n * @status ready\n * @category action\n * @slot footer - Used to replace the default footer contents.\n * @fires open - The command menu was opened.\n * @fires close - The command menu was closed.\n * @fires {SelectEvent} nord-select - User selected a command from the menu.\n *\n * @cssprop [--n-command-menu-inline-size=640px] - Controls the max inline size, or width, of the command menu.\n * @cssprop [--n-command-menu-block-size=290px] - Controls the max block size, or height, of the command menu.\n * @cssprop [--n-command-menu-block-start=16%] - Controls the command menu offset from the block start, or top, of the screen.\n *\n * @localization instructions - Instructions that offer guidance on how to use the command menu.\n * @localization inputLabel - Accessible label given to the command menu's input.\n * @localization footerArrowKeys - Describes what the arrow keys do.\n * @localization footerEnterKey - Describes what the enter key does.\n * @localization footerEscapeKey - Describes what the escape key does.\n * @localization footerBackspaceKey - Describes what the backspace key does.\n * @localization noResults - A message shown when there are no matching results.\n * @localization tip - A hint tip that describes some approaches to find a command when there are no matching results.\n * @localization placeholder - Hint text to display in the Command Menu search field.\n */\n@customElement('nord-command-menu')\nexport default class CommandMenu extends LitElement {\n static styles = [componentStyle, style]\n\n private inputRef = createRef<HTMLInputElement>()\n private listRef = createRef<HTMLElement>()\n private previousFocus?: HTMLElement\n\n private localize = new LocalizeController<'nord-command-menu'>(this)\n private dismissController = new LightDismissController(this, {\n isOpen: () => this.open,\n onDismiss: () => this.close(),\n })\n\n private keyboardController = new KeyboardController(this, {\n trigger: () => this.select(),\n goBack: () => this.goBack(),\n end: () => this.end(),\n start: () => this.start(),\n next: () => this.next(),\n previous: () => this.previous(),\n toggleOpen: () => this.toggleOpen(),\n })\n\n /**\n * Show or hide the command menu.\n */\n @property({ reflect: true, type: Boolean }) open = false\n\n /**\n * Use external filtering mode. When set to true, the component will not perform\n * internal text-based filtering and expects external filtering logic to be implemented.\n */\n @property({ reflect: true, type: Boolean, attribute: 'external-filtering' }) externalFiltering = false\n\n /**\n * When enabled, typing in the search input will automatically exit nested views\n * to allow global search across all commands.\n */\n @property({ reflect: true, type: Boolean, attribute: 'exit-nested-on-search' }) exitNestedOnSearch = false\n\n /**\n * Array of commands to be included in the menu.\n * Please see “Commands data” section for more documentation.\n */\n @property({ type: Array, attribute: false }) commands: Array<ICommandMenuAction> = []\n\n /**\n * Current search query in the command menu input.\n */\n @property({ type: String, attribute: false }) searchQuery: string = ''\n\n @state() private parent: ICommandMenuAction['parent']\n @state() private bump = true\n @state() private selectedIndex = 0\n @state() private filteredCommands: Array<ICommandMenuAction> = []\n\n private get selected(): ICommandMenuAction {\n return this.filteredCommands[this.selectedIndex]\n }\n\n /**\n * Show the command menu programmatically.\n * @param options - Options for showing the menu.\n * @param options.parent - Opens the menu filtered to a specific parent command.\n */\n show(options: { parent?: string } = {}) {\n const notCancelled = this.dispatchEvent(new NordEvent('open', { cancelable: true }))\n\n if (notCancelled) {\n this.open = true\n this.setParent(options.parent)\n }\n }\n\n /**\n * Close the command menu programmatically.\n */\n close() {\n this.open = false\n this.previousFocus?.focus()\n this.previousFocus = undefined\n\n this.dispatchEvent(new NordEvent('close'))\n }\n\n /**\n * Toggle the open state programmatically.\n */\n toggleOpen() {\n if (this.open) {\n this.close()\n }\n else {\n this.show()\n }\n }\n\n /**\n * Focus the command menu's input.\n */\n focus() {\n this.inputRef.value?.focus()\n }\n\n override render() {\n const sections = groupBy(this.filteredCommands, 'section')\n const activeDescendant = this.filteredCommands.length === 0 ? 'no-results' : this.selected?.id\n\n return html`\n <div\n class=${classMap({\n 'n-visible': this.open,\n 'n-modal': true,\n })}\n >\n <div\n @animationend=${this.handleAnimationEnd}\n class=${classMap({\n 'n-bump': this.bump,\n 'n-modal-content': true,\n })}\n >\n <div class=\"n-search-wrapper\">\n <nord-visually-hidden id=\"instructions\">${this.localize.term('instructions')}</nord-visually-hidden>\n <input\n type=\"text\"\n id=\"search\"\n @input=${this.handleInput}\n @blur=${this.handleBlur}\n ${ref(this.inputRef)}\n placeholder=${this.localize.term('placeholder')}\n .value=${this.searchQuery}\n spellcheck=\"false\"\n autocomplete=\"off\"\n autocapitalize=\"off\"\n aria-label=${this.localize.term('inputLabel')}\n aria-autocomplete=\"list\"\n aria-haspopup=\"listbox\"\n role=\"combobox\"\n aria-controls=\"list\"\n aria-expanded=\"true\"\n aria-activedescendant=${ifDefined(activeDescendant)}\n aria-describedby=\"instructions\"\n />\n </div>\n\n <div class=\"n-modal-body\">\n <div id=\"list\" ${ref(this.listRef)} role=\"listbox\" aria-label=${this.localize.term('inputLabel')}>\n ${this.filteredCommands.length === 0\n ? this.renderNoResults()\n : Array.from(sections, ([section, commands]) => this.renderSection(section, commands))}\n </div>\n </div>\n <slot name=\"footer\">\n <div class=\"n-modal-footer\">\n <span class=\"n-help\">\n <nord-icon label=\"Arrow keys\" name=${navigateIcon.title}></nord-icon>\n ${this.localize.term('footerArrowKeys')}\n </span>\n <span class=\"n-help\">\n <nord-icon label=\"Enter key\" name=${enterIcon.title}></nord-icon>\n ${this.localize.term('footerEnterKey')}\n </span>\n <span class=\"n-help\">${this.localize.term('footerEscapeKey')}</span>\n <span class=\"n-help n-backspace\">\n <nord-icon label=\"Backspace key\" name=${backspaceIcon.title}></nord-icon>\n ${this.localize.term('footerBackspaceKey')}\n </span>\n </div>\n </slot>\n </div>\n </div>\n `\n }\n\n private renderNoResults() {\n return html`\n <div id=\"no-results\" class=\"n-command-empty\" role=\"option\" aria-selected=\"true\">\n <div class=\"n-title\">${this.localize.term('noResults', this.searchQuery)}</div>\n <div class=\"n-tip\">${this.localize.term('tip')}</div>\n </div>\n `\n }\n\n private renderSection(section: string | undefined, commands: ICommandMenuAction[]) {\n const sectionId = `section-${section}`\n\n // TODO: test on latest safari, since it seems to have issues with grouped options\n return html`\n <div role=\"group\" aria-labelledby=${cond(section, sectionId)}>\n ${section ? html`<div class=\"n-group-header\" role=\"presentation\" id=${sectionId}>${section}</div>` : nothing}\n ${repeat(\n commands,\n command => command.id,\n command => html`\n <nord-command-menu-action\n id=${command.id}\n .command=${command}\n ?selected=${this.open && command.id === this.selected?.id}\n @click=${() => this.select(command)}\n role=\"option\"\n aria-selected=${cond(command.id === this.selected?.id, 'true')}\n ></nord-command-menu-action>\n `,\n )}\n </div>\n `\n }\n\n @observe('commands')\n protected handleCommandsChange() {\n this.keyboardController.registerCommandShortcuts()\n }\n\n @observe('open')\n protected handleBump() {\n if (this.open) {\n this.bump = true\n }\n }\n\n @observe('open', 'updated')\n protected focusOnOpen() {\n if (this.open) {\n this.previousFocus = getFocusedElement(document) as HTMLElement\n this.focus()\n\n if (this.listRef.value) {\n this.listRef.value.scrollTop = 0\n }\n }\n }\n\n private handleAnimationEnd() {\n this.bump = false\n }\n\n private handleBlur() {\n if (this.open) {\n this.focus()\n }\n }\n\n private handleInput(event: KeyboardEvent) {\n event.stopPropagation()\n\n const input = event.target as HTMLInputElement\n this.setSearch(input.value)\n\n // When exitNestedOnSearch is enabled, clear the parent to exit nested view and allow global search\n if (this.exitNestedOnSearch && input.value && this.parent) {\n this.parent = undefined\n }\n\n /**\n * Fired as the user types into the search input.\n */\n this.dispatchEvent(new NordEvent('input'))\n }\n\n private select(command: ICommandMenuAction = this.selected) {\n const isParent = this.commands.some(item => item.parent === command.id)\n\n if (isParent) {\n this.setParent(command.id)\n this.bump = true\n this.focus()\n }\n else {\n this.close()\n }\n\n this.setSearch('')\n command.handler?.(this)\n\n // this is separated into two parts because of a bug in Custom Elements Analyzer, where it gets the event name wrong.\n // TODO: cleanup when bug is fixed.\n const event = new SelectEvent(command)\n this.dispatchEvent(event)\n }\n\n private start() {\n this.selectedIndex = 0\n }\n\n private end() {\n this.selectedIndex = this.filteredCommands.length - 1\n }\n\n private next() {\n this.selectedIndex = wrap(this.selectedIndex + 1, 0, this.filteredCommands.length - 1)\n }\n\n private previous() {\n this.selectedIndex = wrap(this.selectedIndex - 1, 0, this.filteredCommands.length - 1)\n }\n\n private goBack() {\n if (this.searchQuery) {\n return\n }\n\n if (this.parent) {\n const parentCommand = this.commands.find(command => command.id === this.parent)\n this.setParent(parentCommand?.parent)\n }\n }\n\n private setParent(parent?: ICommandMenuAction['parent']) {\n this.parent = parent\n this.setSearch('')\n }\n\n private setSearch(str: string) {\n this.searchQuery = str\n this.selectedIndex = 0\n }\n\n @observe('searchQuery')\n @observe('parent')\n @observe('commands')\n @observe('externalFiltering')\n private filterCommands() {\n // sort commands in the same way as they are visually displayed\n // this is a quick fix for cases where the visual order of commands is different from order in the commands array\n // without ordering, the up/down arrow keys can end up navigating out of visual order.\n // but it feels wasteful to groupBy here, then discard the result, only to re-calculate in render.\n // TODO: is there a way to do this without grouping twice?\n const groupedBySection = groupBy(this.commands, 'section')\n const ordered = [...groupedBySection.values()].flat()\n\n if (this.externalFiltering) {\n // When external filtering is enabled, still filter by parent but skip search-based filtering\n this.filteredCommands = ordered.filter(\n ({ parent }) =>\n // use looser equality check so that it handles `null` as command's `parent` value\n // eslint-disable-next-line eqeqeq\n parent == this.parent,\n )\n return\n }\n\n const searchTerms = this.searchQuery.toLocaleLowerCase().split(/\\s+/)\n\n this.filteredCommands = ordered.filter(({ title, keywords = '', parent }) => {\n const searchSpace = `${title} ${keywords}`.toLocaleLowerCase()\n const matcher = searchTerms.every(term => searchSpace.includes(term))\n\n if (!this.parent && this.searchQuery) {\n // global search for items on root only (exclude nested items)\n return matcher && !parent\n }\n\n // use looser equality check so that it handles `null` as command's `parent` value\n // eslint-disable-next-line eqeqeq\n return parent == this.parent && matcher\n })\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-command-menu': CommandMenu\n }\n}\n","export default '<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m18 2h-2v-2h-2v2h-8v-2h-2v2h-2c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2v-14c0-1.1-.9-2-2-2zm-14 2v2h2v-2h8v2h2v-2h2v4h-16v-4zm-2 14v-8h16v8z\" fill=\"currentColor\"/></svg>';\nexport const title = \"interface-calendar\";\nexport const tags = \"nordicon interface calendar date time day week month year\";\n","export default '<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m12.1087 10.005 7.8867 7.8866-2.1087 2.1085-7.8866-7.8867-7.89154 7.8916-2.10356422-2.1036 7.89153422-7.8915-7.89653-7.89664 2.1137-2.11326 7.8915 7.90132 7.8864-7.89650372 2.1085 2.10861372z\" fill=\"currentColor\"/></svg>';\nexport const title = \"interface-close-small\";\nexport const tags =\n \"nordicon interface close remove small cross delete erase symbol\";\n","import type { LitElement } from 'lit'\nimport { property } from 'lit/decorators.js'\n\ntype Constructor<T = Record<string, unknown>> = new (...args: any[]) => T\n\nexport declare class ReadonlyMixinInterface {\n readonly: boolean\n}\n\nexport function ReadonlyMixin<T extends Constructor<LitElement>>(\n superClass: T,\n): Constructor<ReadonlyMixinInterface> & T {\n class ReadonlyElement extends superClass {\n /**\n * Makes the component readonly, so that it is not editable.\n * Readonly differs from disabled in that readonly fields are still focusable and will be submitted with a form.\n */\n @property({ type: Boolean, reflect: true }) readonly = false\n }\n\n return ReadonlyElement\n}\n","import type { createDate } from '../common/dates.js'\nimport { parseISODate, printISODate } from '../common/dates.js'\n\ntype CreateDate = typeof createDate\nexport type DateParser = (input: string, createDate: CreateDate) => Date | undefined\nexport type DateFormatter = (date: Date) => string\n\nexport interface DateAdapter {\n parse: DateParser\n format: DateFormatter\n}\n\nexport const isoAdapter: DateAdapter = { parse: parseISODate, format: printISODate }\n","export default '<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m16.03 14.61c1.23-1.54 1.97-3.49 1.97-5.61 0-4.97-4.03-9-9-9s-9 4.03-9 9 4.03 9 9 9c2.12 0 4.07-.74 5.61-1.97l3.97 3.97 1.41-1.41-3.97-3.97zm-7.03 1.39c-3.86 0-7-3.14-7-7s3.14-7 7-7 7 3.14 7 7-3.14 7-7 7z\" fill=\"currentColor\"/></svg>';\nexport const title = \"navigation-search\";\nexport const tags = \"nordicon navigation menu find search magnifying glass\";\n","import{noChange as t}from\"../lit-html.js\";import{directive as e,Directive as r,PartType as s}from\"../directive.js\";\n/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const n=\"important\",i=\" !\"+n,o=e(class extends r{constructor(t){if(super(t),t.type!==s.ATTRIBUTE||\"style\"!==t.name||t.strings?.length>2)throw Error(\"The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.\")}render(t){return Object.keys(t).reduce(((e,r)=>{const s=t[r];return null==s?e:e+`${r=r.includes(\"-\")?r:r.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,\"-$&\").toLowerCase()}:${s};`}),\"\")}update(e,[r]){const{style:s}=e.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(r)),this.render(r);for(const t of this.ft)null==r[t]&&(this.ft.delete(t),t.includes(\"-\")?s.removeProperty(t):s[t]=null);for(const t in r){const e=r[t];if(null!=e){this.ft.add(t);const r=\"string\"==typeof e&&e.endsWith(i);t.includes(\"-\")||r?s.setProperty(t,r?e.slice(0,-11):e,r?n:\"\"):s[t]=e}}return t}});export{o as styleMap};\n//# sourceMappingURL=style-map.js.map\n","import type { ReactiveController, ReactiveControllerHost } from 'lit'\nimport { isServer } from 'lit'\n\nexport class ResizeController implements ReactiveController {\n private observer?: ResizeObserver\n private hadFirstUpdate = false\n private borderBoxSize?: ResizeObserverSize\n\n constructor(\n host: ReactiveControllerHost,\n private target: () => HTMLElement,\n ) {\n host.addController(this)\n\n if (!isServer) {\n this.observer = new ResizeObserver(([entry]) => {\n const [borderBoxSize] = entry.borderBoxSize\n this.borderBoxSize = borderBoxSize\n host.requestUpdate()\n })\n }\n }\n\n get inlineSize() {\n return this.borderBoxSize?.inlineSize\n }\n\n get blockSize() {\n return this.borderBoxSize?.blockSize\n }\n\n hostUpdated() {\n if (!this.hadFirstUpdate && this.observer) {\n this.observer.observe(this.target())\n this.hadFirstUpdate = true\n }\n }\n\n hostConnected() {\n // in case the host has rendered, disconnected, and is now reconnected\n if (this.hadFirstUpdate && this.observer) {\n this.observer.observe(this.target())\n }\n }\n\n hostDisconnected() {\n if (this.observer) {\n this.observer.disconnect()\n }\n }\n}\n","import type { LitElement } from 'lit'\nimport { property } from 'lit/decorators.js'\n\ntype Constructor<T = Record<string, unknown>> = new (...args: any[]) => T\ntype AutocompleteAttribute\n = | 'off'\n | 'on'\n | 'name'\n | 'honorific-prefix'\n | 'given-name'\n | 'additional-name'\n | 'family-name'\n | 'honorific-suffix'\n | 'nickname'\n | 'email'\n | 'username'\n | 'new-password'\n | 'current-password'\n | 'one-time-code'\n | 'organization-title'\n | 'organization'\n | 'street-address'\n | 'address-line1'\n | 'address-line2'\n | 'address-line3'\n | 'address-level4'\n | 'address-level3'\n | 'address-level2'\n | 'address-level1'\n | 'country'\n | 'country-name'\n | 'postal-code'\n | 'cc-name'\n | 'cc-given-name'\n | 'cc-additional-name'\n | 'cc-family-name'\n | 'cc-number'\n | 'cc-exp'\n | 'cc-exp-month'\n | 'cc-exp-year'\n | 'cc-csc'\n | 'cc-type'\n | 'transaction-currency'\n | 'transaction-amount'\n | 'language'\n | 'bday'\n | 'bday-day'\n | 'bday-month'\n | 'bday-year'\n | 'sex'\n | 'tel'\n | 'tel-country-code'\n | 'tel-national'\n | 'tel-area-code'\n | 'tel-local'\n | 'tel-extension'\n | 'impp'\n | 'url'\n | 'photo'\n\nexport declare class AutocompleteMixinInterface {\n autocomplete: AutocompleteAttribute\n}\n\nexport function AutocompleteMixin<T extends Constructor<LitElement>>(\n superClass: T,\n): Constructor<AutocompleteMixinInterface> & T {\n class AutocompleteElement extends superClass {\n /**\n * Specifies the data type of the field, so that the browser may attempt to fill out the field automatically on behalf of the user.\n */\n @property() autocomplete: AutocompleteAttribute = 'off'\n }\n\n return AutocompleteElement\n}\n","import type { LitElement } from 'lit'\nimport type { Ref } from 'lit/directives/ref.js'\nimport type { InputMixinInterface } from './InputMixin.js'\nimport { createRef } from 'lit/directives/ref.js'\n\ntype Constructable<T = Record<string, unknown>> = new (...args: any[]) => T\n\nexport declare class TextSelectableMixinInterface {\n protected textSelectableRef: Ref<HTMLInputElement | HTMLTextAreaElement>\n set selectionStart(value: number | null)\n get selectionStart(): number | null\n set selectionEnd(value: number | null)\n get selectionEnd(): number | null\n select(): void\n setSelectionRange(start: number | null, end: number | null, direction?: 'forward' | 'backward' | 'none'): void\n setRangeText(\n replacement: string,\n start?: number,\n end?: number,\n selectMode?: 'select' | 'start' | 'end' | 'preserve'\n ): void\n}\n\nexport function TextSelectableMixin<T extends Constructable<InputMixinInterface & LitElement>>(superClass: T) {\n class TextSelectableElement extends superClass {\n protected textSelectableRef = createRef<HTMLInputElement | HTMLTextAreaElement>()\n\n /**\n * Gets or sets the starting position or offset of a text selection.\n *\n * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/selectionStart)\n */\n set selectionStart(value: number | null) {\n if (this.textSelectableRef.value) {\n this.textSelectableRef.value.selectionStart = value\n }\n }\n\n get selectionStart() {\n return this.textSelectableRef.value?.selectionStart ?? null\n }\n\n /**\n * Gets or sets the end position or offset of a text selection.\n *\n * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/selectionEnd)\n */\n set selectionEnd(value: number | null) {\n if (this.textSelectableRef.value) {\n this.textSelectableRef.value.selectionEnd = value\n }\n }\n\n get selectionEnd() {\n return this.textSelectableRef.value?.selectionEnd ?? null\n }\n\n /**\n * Gets or sets the direction in which selection occurred.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLInputElement/selectionDirection)\n */\n set selectionDirection(value: 'forward' | 'backward' | 'none' | null) {\n if (this.textSelectableRef.value) {\n this.textSelectableRef.value.selectionDirection = value\n }\n }\n\n get selectionDirection() {\n return this.textSelectableRef.value?.selectionDirection ?? null\n }\n\n /**\n * Selects all the text in the text field.\n *\n * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/select)\n */\n select() {\n if (this.textSelectableRef.value) {\n this.textSelectableRef.value.select()\n }\n }\n\n /**\n * Sets the start and end positions of a selection in the text field.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLInputElement/setSelectionRange)\n *\n * @param start The offset into the text field for the start of the selection.\n * @param end The offset into the text field for the end of the selection.\n * @param direction The direction in which the selection is performed.\n */\n setSelectionRange(start: number | null, end: number | null, direction?: 'forward' | 'backward' | 'none') {\n if (this.textSelectableRef.value) {\n this.textSelectableRef.value.setSelectionRange(start, end, direction)\n }\n }\n\n /**\n * Replaces a range of text with a new string.\n *\n * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLInputElement/setRangeText)\n *\n * @param replacement The string to insert.\n * @param start The 0-based index of the first character to replace. Defaults to the current `selectionStart` value (the start of the user's current selection).\n * @param end The 0-based index of the character after the last character to replace. Defaults to the current `selectionEnd` value (the end of the user's current selection).\n * @param selectMode A string defining how the selection should be set after the text has been replaced.\n */\n setRangeText(\n replacement: string,\n start?: number,\n end?: number,\n selectMode: 'select' | 'start' | 'end' | 'preserve' = 'preserve',\n ) {\n if (this.textSelectableRef.value) {\n const selectionStart = start ?? this.textSelectableRef.value.selectionStart!\n\n const selectionEnd = end ?? this.textSelectableRef.value.selectionEnd!\n\n this.textSelectableRef.value.setRangeText(replacement, selectionStart, selectionEnd, selectMode)\n\n if (this.value !== this.textSelectableRef.value.value) {\n this.value = this.textSelectableRef.value.value\n }\n }\n }\n\n /**\n * Returns the native `<input>` or `<textarea>` element used under the hood.\n */\n async getNativeElement() {\n // wait for the element to be rendered\n await this.updateComplete\n\n return this.textSelectableRef.value\n }\n }\n\n return TextSelectableElement as unknown as Constructable<TextSelectableMixinInterface> & T\n}\n","import * as searchIcon from '@nordhealth/icons/lib/assets/navigation-search.js'\nimport { html, LitElement, nothing } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { classMap } from 'lit/directives/class-map.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { ref } from 'lit/directives/ref.js'\n\nimport { styleMap } from 'lit/directives/style-map.js'\nimport { DirectionController } from '../common/controllers/DirectionController.js'\nimport { ResizeController } from '../common/controllers/ResizeController.js'\nimport { cond } from '../common/directives/cond.js'\nimport { NordEvent } from '../common/events.js'\nimport { getSubmitButton } from '../common/form.js'\nimport { cleanValue } from '../common/input.js'\nimport { AutocompleteMixin } from '../common/mixins/AutocompleteMixin.js'\n\nimport { FocusableMixin } from '../common/mixins/FocusableMixin.js'\nimport { FormAssociatedMixin } from '../common/mixins/FormAssociatedMixin.js'\nimport { InputMixin } from '../common/mixins/InputMixin.js'\nimport { ReadonlyMixin } from '../common/mixins/ReadonlyMixin.js'\nimport { SizeMixin } from '../common/mixins/SizeMixin.js'\nimport { TextSelectableMixin } from '../common/mixins/TextSelectableMixin.js'\nimport componentStyle from '../common/styles/Component.css'\nimport formFieldStyle from '../common/styles/FormField.css'\nimport textFieldStyle from '../common/styles/TextField.css'\nimport Icon from '../icon/Icon.js'\nimport style from './Input.css'\n\nIcon.registerIcon(searchIcon)\n\nconst px = (value?: number) => (value ? `${value}px` : undefined)\n\ntype InputMode = 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search'\nconst defaultInputmodeMap: Record<string, InputMode> = {\n number: 'numeric',\n email: 'email',\n tel: 'tel',\n url: 'url',\n search: 'search',\n}\n\n/**\n * Inputs are used to allow users to provide text input when the expected input is short.\n * As well as plain text, Input supports various types of text, including passwords and numbers.\n *\n * @status ready\n * @category form\n * @slot label - Use when a label requires more than plain text.\n * @slot hint - Optional slot that holds hint text for the input.\n * @slot error - Optional slot that holds error text for the input.\n * @slot start - Optional slot used to place an icon or prefix at the start of the input.\n * @slot end - Optional slot used to place an icon or suffix at the end of the input.\n *\n * @cssprop [--n-input-inline-size=240px] - Controls the inline size, or width, of the input.\n * @cssprop [--n-input-background=var(--n-color-surface)] - Controls the background of the input, using our [color tokens](/tokens/#color).\n * @cssprop [--n-input-color=var(--n-color-text)] - Controls the text color of the input, using our [color tokens](/tokens/#color).\n * @cssprop [--n-input-border-color=var(--n-color-border-strong)] - Controls the border color of the input, using our [color tokens](/tokens/#color).\n * @cssprop [--n-input-border-radius=var(--n-border-radius-s)] - Controls how rounded the corners are, using [border radius tokens](/tokens/#border-radius).\n * @cssprop [--n-input-text-align=start] - Controls the alignment of text within the input itself.\n * @cssprop [--n-label-color=var(--n-color-text)] - Controls the text color of the label, using our [color tokens](/tokens/#color).\n */\n@customElement('nord-input')\nexport default class Input extends SizeMixin(\n FormAssociatedMixin(AutocompleteMixin(ReadonlyMixin(TextSelectableMixin(InputMixin(FocusableMixin(LitElement)))))),\n) {\n static styles = [componentStyle, formFieldStyle, textFieldStyle, style]\n\n @query('slot[name=\\'start\\']') private startSlot!: HTMLSlotElement\n @query('slot[name=\\'end\\']') private endSlot!: HTMLSlotElement\n private startObserver = new ResizeController(this, () => this.startSlot)\n private endObserver = new ResizeController(this, () => this.endSlot)\n private direction = new DirectionController(this)\n\n /**\n * The type of the input.\n */\n @property({ reflect: true }) type:\n | 'text'\n | 'email'\n | 'password'\n | 'tel'\n | 'url'\n | 'search'\n | 'number'\n | 'unit'\n | 'button' = 'text'\n\n /**\n * Controls whether the input expands to fill the width of its container.\n */\n @property({ reflect: true, type: Boolean }) expand = false\n\n /**\n * Optionally disallow certain characters from being used inside the input, using a regex pattern.\n */\n @property({ reflect: true, attribute: 'disallow-pattern' }) disallowPattern?: string = undefined\n\n /**\n * The inputmode attribute provides a hint to the browser about what type of keyboard to open on mobile devices.\n * Valid values: none, text, decimal, numeric, tel, search, email, url\n * When not explicitly set, defaults based on input type:\n * - type=\"number\" → inputmode=\"numeric\"\n * - type=\"email\" → inputmode=\"email\"\n * - type=\"tel\" → inputmode=\"tel\"\n * - type=\"url\" → inputmode=\"url\"\n * - type=\"search\" → inputmode=\"search\"\n * Can be explicitly overridden for any type.\n */\n @property({ reflect: true }) inputmode?: 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url' = undefined\n\n render() {\n const isNumber = this.type === 'number'\n\n const inputmodeValue = this.inputmode || defaultInputmodeMap[this.type]\n\n return html`\n ${this.renderLabel()}\n\n <div\n class=${classMap({\n 'n-input-container': true,\n 'is-rtl': this.direction.dir === 'rtl',\n })}\n style=${styleMap({\n '--_n-input-start-inline-size': px(this.startObserver.inlineSize),\n '--_n-input-end-inline-size': px(this.endObserver.inlineSize),\n })}\n >\n <slot name=\"start\">\n ${this.type === 'search' ? html`<nord-icon name=\"navigation-search\"></nord-icon>` : nothing}\n </slot>\n <input\n ${ref(this.textSelectableRef)}\n ${ref(this.focusableRef)}\n id=${this.inputId}\n class=\"n-input\"\n type=${isNumber || this.type === 'unit' ? 'text' : this.type}\n inputmode=${ifDefined(inputmodeValue)}\n pattern=${cond(isNumber, '[0-9]*')}\n ?disabled=${this.disabled}\n ?required=${this.required}\n ?readonly=${this.readonly}\n name=${ifDefined(this.name)}\n .value=${this.value ?? ''}\n placeholder=${ifDefined(this.placeholder)}\n @input=${this.handleInputChange}\n @change=${this.handleChange}\n @keydown=${this.handleKeydown}\n @select=${this.handleSelect}\n aria-describedby=${ifDefined(this.getDescribedBy())}\n aria-invalid=${ifDefined(this.getInvalid())}\n spellcheck=\"false\"\n autocomplete=${this.autocomplete as any}\n />\n <slot name=\"end\"></slot>\n </div>\n\n ${this.renderError()}\n ${this.isHintBelow ? this.renderHint() : nothing}\n `\n }\n\n private handleKeydown(e: KeyboardEvent) {\n if (e.key !== 'Enter') {\n return\n }\n\n const { form } = this\n\n if (form) {\n const button = getSubmitButton(form)\n setTimeout(() => button?.click(), 0)\n }\n }\n\n private handleInputChange = (e: Event) => {\n const target = e.target as HTMLInputElement\n\n // clean up any invalid characters\n if (this.disallowPattern) {\n cleanValue(target, new RegExp(this.disallowPattern, 'g'))\n }\n this.handleInput(e)\n }\n\n protected handleSelect(e: Event) {\n e.stopPropagation()\n\n /**\n * Fired when some text has been selected.\n */\n this.dispatchEvent(new NordEvent('select'))\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-input': Input\n }\n}\n","export function cleanValue(inputEl: HTMLInputElement, regex: RegExp): string {\n const { value } = inputEl\n const cursor = inputEl.selectionStart as number\n\n const beforeCursor = value.slice(0, cursor)\n const afterCursor = value.slice(cursor, value.length)\n\n const filteredBeforeCursor = beforeCursor.replace(regex, '')\n const filterAfterCursor = afterCursor.replace(regex, '')\n\n const newValue = filteredBeforeCursor + filterAfterCursor\n const newCursor = filteredBeforeCursor.length\n\n inputEl.value = newValue\n inputEl.selectionStart = newCursor\n inputEl.selectionEnd = newCursor\n\n return newValue\n}\n","/**\n * Finds a form's submit button. First looking for a button inside form,\n * and then looking for a button whose form attribute is equal to the ID of the form.\n */\nexport function getSubmitButton(form: HTMLFormElement): HTMLButtonElement | null {\n // we can get away with just looking for native <button> elements,\n // rather than our component, since our button component renders one to light dom.\n let button = form.querySelector<HTMLButtonElement>(`button[type=\"submit\"]`)\n\n if (!button && form.id) {\n const root = form.getRootNode() as ShadowRoot | Document\n button = root.querySelector<HTMLButtonElement>(`button[form=${form.id}]`)\n }\n\n return button\n}\n","/**\n * Custom positioning reference element.\n * @see https://floating-ui.com/docs/virtual-elements\n */\n\nconst sides = ['top', 'right', 'bottom', 'left'];\nconst alignments = ['start', 'end'];\nconst placements = /*#__PURE__*/sides.reduce((acc, side) => acc.concat(side, side + \"-\" + alignments[0], side + \"-\" + alignments[1]), []);\nconst min = Math.min;\nconst max = Math.max;\nconst round = Math.round;\nconst floor = Math.floor;\nconst createCoords = v => ({\n x: v,\n y: v\n});\nconst oppositeSideMap = {\n left: 'right',\n right: 'left',\n bottom: 'top',\n top: 'bottom'\n};\nconst oppositeAlignmentMap = {\n start: 'end',\n end: 'start'\n};\nfunction clamp(start, value, end) {\n return max(start, min(value, end));\n}\nfunction evaluate(value, param) {\n return typeof value === 'function' ? value(param) : value;\n}\nfunction getSide(placement) {\n return placement.split('-')[0];\n}\nfunction getAlignment(placement) {\n return placement.split('-')[1];\n}\nfunction getOppositeAxis(axis) {\n return axis === 'x' ? 'y' : 'x';\n}\nfunction getAxisLength(axis) {\n return axis === 'y' ? 'height' : 'width';\n}\nconst yAxisSides = /*#__PURE__*/new Set(['top', 'bottom']);\nfunction getSideAxis(placement) {\n return yAxisSides.has(getSide(placement)) ? 'y' : 'x';\n}\nfunction getAlignmentAxis(placement) {\n return getOppositeAxis(getSideAxis(placement));\n}\nfunction getAlignmentSides(placement, rects, rtl) {\n if (rtl === void 0) {\n rtl = false;\n }\n const alignment = getAlignment(placement);\n const alignmentAxis = getAlignmentAxis(placement);\n const length = getAxisLength(alignmentAxis);\n let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';\n if (rects.reference[length] > rects.floating[length]) {\n mainAlignmentSide = getOppositePlacement(mainAlignmentSide);\n }\n return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];\n}\nfunction getExpandedPlacements(placement) {\n const oppositePlacement = getOppositePlacement(placement);\n return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];\n}\nfunction getOppositeAlignmentPlacement(placement) {\n return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);\n}\nconst lrPlacement = ['left', 'right'];\nconst rlPlacement = ['right', 'left'];\nconst tbPlacement = ['top', 'bottom'];\nconst btPlacement = ['bottom', 'top'];\nfunction getSideList(side, isStart, rtl) {\n switch (side) {\n case 'top':\n case 'bottom':\n if (rtl) return isStart ? rlPlacement : lrPlacement;\n return isStart ? lrPlacement : rlPlacement;\n case 'left':\n case 'right':\n return isStart ? tbPlacement : btPlacement;\n default:\n return [];\n }\n}\nfunction getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {\n const alignment = getAlignment(placement);\n let list = getSideList(getSide(placement), direction === 'start', rtl);\n if (alignment) {\n list = list.map(side => side + \"-\" + alignment);\n if (flipAlignment) {\n list = list.concat(list.map(getOppositeAlignmentPlacement));\n }\n }\n return list;\n}\nfunction getOppositePlacement(placement) {\n return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]);\n}\nfunction expandPaddingObject(padding) {\n return {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n ...padding\n };\n}\nfunction getPaddingObject(padding) {\n return typeof padding !== 'number' ? expandPaddingObject(padding) : {\n top: padding,\n right: padding,\n bottom: padding,\n left: padding\n };\n}\nfunction rectToClientRect(rect) {\n const {\n x,\n y,\n width,\n height\n } = rect;\n return {\n width,\n height,\n top: y,\n left: x,\n right: x + width,\n bottom: y + height,\n x,\n y\n };\n}\n\nexport { alignments, clamp, createCoords, evaluate, expandPaddingObject, floor, getAlignment, getAlignmentAxis, getAlignmentSides, getAxisLength, getExpandedPlacements, getOppositeAlignmentPlacement, getOppositeAxis, getOppositeAxisPlacements, getOppositePlacement, getPaddingObject, getSide, getSideAxis, max, min, placements, rectToClientRect, round, sides };\n","import { getSideAxis, getAlignmentAxis, getAxisLength, getSide, getAlignment, evaluate, getPaddingObject, rectToClientRect, min, clamp, placements, getAlignmentSides, getOppositeAlignmentPlacement, getOppositePlacement, getExpandedPlacements, getOppositeAxisPlacements, sides, max, getOppositeAxis } from '@floating-ui/utils';\nexport { rectToClientRect } from '@floating-ui/utils';\n\nfunction computeCoordsFromPlacement(_ref, placement, rtl) {\n let {\n reference,\n floating\n } = _ref;\n const sideAxis = getSideAxis(placement);\n const alignmentAxis = getAlignmentAxis(placement);\n const alignLength = getAxisLength(alignmentAxis);\n const side = getSide(placement);\n const isVertical = sideAxis === 'y';\n const commonX = reference.x + reference.width / 2 - floating.width / 2;\n const commonY = reference.y + reference.height / 2 - floating.height / 2;\n const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;\n let coords;\n switch (side) {\n case 'top':\n coords = {\n x: commonX,\n y: reference.y - floating.height\n };\n break;\n case 'bottom':\n coords = {\n x: commonX,\n y: reference.y + reference.height\n };\n break;\n case 'right':\n coords = {\n x: reference.x + reference.width,\n y: commonY\n };\n break;\n case 'left':\n coords = {\n x: reference.x - floating.width,\n y: commonY\n };\n break;\n default:\n coords = {\n x: reference.x,\n y: reference.y\n };\n }\n switch (getAlignment(placement)) {\n case 'start':\n coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);\n break;\n case 'end':\n coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);\n break;\n }\n return coords;\n}\n\n/**\n * Resolves with an object of overflow side offsets that determine how much the\n * element is overflowing a given clipping boundary on each side.\n * - positive = overflowing the boundary by that number of pixels\n * - negative = how many pixels left before it will overflow\n * - 0 = lies flush with the boundary\n * @see https://floating-ui.com/docs/detectOverflow\n */\nasync function detectOverflow(state, options) {\n var _await$platform$isEle;\n if (options === void 0) {\n options = {};\n }\n const {\n x,\n y,\n platform,\n rects,\n elements,\n strategy\n } = state;\n const {\n boundary = 'clippingAncestors',\n rootBoundary = 'viewport',\n elementContext = 'floating',\n altBoundary = false,\n padding = 0\n } = evaluate(options, state);\n const paddingObject = getPaddingObject(padding);\n const altContext = elementContext === 'floating' ? 'reference' : 'floating';\n const element = elements[altBoundary ? altContext : elementContext];\n const clippingClientRect = rectToClientRect(await platform.getClippingRect({\n element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),\n boundary,\n rootBoundary,\n strategy\n }));\n const rect = elementContext === 'floating' ? {\n x,\n y,\n width: rects.floating.width,\n height: rects.floating.height\n } : rects.reference;\n const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));\n const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {\n x: 1,\n y: 1\n } : {\n x: 1,\n y: 1\n };\n const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({\n elements,\n rect,\n offsetParent,\n strategy\n }) : rect);\n return {\n top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,\n bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,\n left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,\n right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x\n };\n}\n\n/**\n * Computes the `x` and `y` coordinates that will place the floating element\n * next to a given reference element.\n *\n * This export does not have any `platform` interface logic. You will need to\n * write one for the platform you are using Floating UI with.\n */\nconst computePosition = async (reference, floating, config) => {\n const {\n placement = 'bottom',\n strategy = 'absolute',\n middleware = [],\n platform\n } = config;\n const validMiddleware = middleware.filter(Boolean);\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));\n let rects = await platform.getElementRects({\n reference,\n floating,\n strategy\n });\n let {\n x,\n y\n } = computeCoordsFromPlacement(rects, placement, rtl);\n let statefulPlacement = placement;\n let middlewareData = {};\n let resetCount = 0;\n for (let i = 0; i < validMiddleware.length; i++) {\n var _platform$detectOverf;\n const {\n name,\n fn\n } = validMiddleware[i];\n const {\n x: nextX,\n y: nextY,\n data,\n reset\n } = await fn({\n x,\n y,\n initialPlacement: placement,\n placement: statefulPlacement,\n strategy,\n middlewareData,\n rects,\n platform: {\n ...platform,\n detectOverflow: (_platform$detectOverf = platform.detectOverflow) != null ? _platform$detectOverf : detectOverflow\n },\n elements: {\n reference,\n floating\n }\n });\n x = nextX != null ? nextX : x;\n y = nextY != null ? nextY : y;\n middlewareData = {\n ...middlewareData,\n [name]: {\n ...middlewareData[name],\n ...data\n }\n };\n if (reset && resetCount <= 50) {\n resetCount++;\n if (typeof reset === 'object') {\n if (reset.placement) {\n statefulPlacement = reset.placement;\n }\n if (reset.rects) {\n rects = reset.rects === true ? await platform.getElementRects({\n reference,\n floating,\n strategy\n }) : reset.rects;\n }\n ({\n x,\n y\n } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));\n }\n i = -1;\n }\n }\n return {\n x,\n y,\n placement: statefulPlacement,\n strategy,\n middlewareData\n };\n};\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = options => ({\n name: 'arrow',\n options,\n async fn(state) {\n const {\n x,\n y,\n placement,\n rects,\n platform,\n elements,\n middlewareData\n } = state;\n // Since `element` is required, we don't Partial<> the type.\n const {\n element,\n padding = 0\n } = evaluate(options, state) || {};\n if (element == null) {\n return {};\n }\n const paddingObject = getPaddingObject(padding);\n const coords = {\n x,\n y\n };\n const axis = getAlignmentAxis(placement);\n const length = getAxisLength(axis);\n const arrowDimensions = await platform.getDimensions(element);\n const isYAxis = axis === 'y';\n const minProp = isYAxis ? 'top' : 'left';\n const maxProp = isYAxis ? 'bottom' : 'right';\n const clientProp = isYAxis ? 'clientHeight' : 'clientWidth';\n const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];\n const startDiff = coords[axis] - rects.reference[axis];\n const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));\n let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;\n\n // DOM platform can return `window` as the `offsetParent`.\n if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) {\n clientSize = elements.floating[clientProp] || rects.floating[length];\n }\n const centerToReference = endDiff / 2 - startDiff / 2;\n\n // If the padding is large enough that it causes the arrow to no longer be\n // centered, modify the padding so that it is centered.\n const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;\n const minPadding = min(paddingObject[minProp], largestPossiblePadding);\n const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);\n\n // Make sure the arrow doesn't overflow the floating element if the center\n // point is outside the floating element's bounds.\n const min$1 = minPadding;\n const max = clientSize - arrowDimensions[length] - maxPadding;\n const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;\n const offset = clamp(min$1, center, max);\n\n // If the reference is small enough that the arrow's padding causes it to\n // to point to nothing for an aligned placement, adjust the offset of the\n // floating element itself. To ensure `shift()` continues to take action,\n // a single reset is performed when this is true.\n const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;\n const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0;\n return {\n [axis]: coords[axis] + alignmentOffset,\n data: {\n [axis]: offset,\n centerOffset: center - offset - alignmentOffset,\n ...(shouldAddOffset && {\n alignmentOffset\n })\n },\n reset: shouldAddOffset\n };\n }\n});\n\nfunction getPlacementList(alignment, autoAlignment, allowedPlacements) {\n const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => getSide(placement) === placement);\n return allowedPlacementsSortedByAlignment.filter(placement => {\n if (alignment) {\n return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false);\n }\n return true;\n });\n}\n/**\n * Optimizes the visibility of the floating element by choosing the placement\n * that has the most space available automatically, without needing to specify a\n * preferred placement. Alternative to `flip`.\n * @see https://floating-ui.com/docs/autoPlacement\n */\nconst autoPlacement = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'autoPlacement',\n options,\n async fn(state) {\n var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE;\n const {\n rects,\n middlewareData,\n placement,\n platform,\n elements\n } = state;\n const {\n crossAxis = false,\n alignment,\n allowedPlacements = placements,\n autoAlignment = true,\n ...detectOverflowOptions\n } = evaluate(options, state);\n const placements$1 = alignment !== undefined || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements;\n const overflow = await platform.detectOverflow(state, detectOverflowOptions);\n const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0;\n const currentPlacement = placements$1[currentIndex];\n if (currentPlacement == null) {\n return {};\n }\n const alignmentSides = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));\n\n // Make `computeCoords` start from the right place.\n if (placement !== currentPlacement) {\n return {\n reset: {\n placement: placements$1[0]\n }\n };\n }\n const currentOverflows = [overflow[getSide(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]];\n const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), {\n placement: currentPlacement,\n overflows: currentOverflows\n }];\n const nextPlacement = placements$1[currentIndex + 1];\n\n // There are more placements to check.\n if (nextPlacement) {\n return {\n data: {\n index: currentIndex + 1,\n overflows: allOverflows\n },\n reset: {\n placement: nextPlacement\n }\n };\n }\n const placementsSortedByMostSpace = allOverflows.map(d => {\n const alignment = getAlignment(d.placement);\n return [d.placement, alignment && crossAxis ?\n // Check along the mainAxis and main crossAxis side.\n d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0) :\n // Check only the mainAxis.\n d.overflows[0], d.overflows];\n }).sort((a, b) => a[1] - b[1]);\n const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter(d => d[2].slice(0,\n // Aligned placements should not check their opposite crossAxis\n // side.\n getAlignment(d[0]) ? 2 : 3).every(v => v <= 0));\n const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0];\n if (resetPlacement !== placement) {\n return {\n data: {\n index: currentIndex + 1,\n overflows: allOverflows\n },\n reset: {\n placement: resetPlacement\n }\n };\n }\n return {};\n }\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by flipping the `placement`\n * in order to keep it in view when the preferred placement(s) will overflow the\n * clipping boundary. Alternative to `autoPlacement`.\n * @see https://floating-ui.com/docs/flip\n */\nconst flip = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'flip',\n options,\n async fn(state) {\n var _middlewareData$arrow, _middlewareData$flip;\n const {\n placement,\n middlewareData,\n rects,\n initialPlacement,\n platform,\n elements\n } = state;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = true,\n fallbackPlacements: specifiedFallbackPlacements,\n fallbackStrategy = 'bestFit',\n fallbackAxisSideDirection = 'none',\n flipAlignment = true,\n ...detectOverflowOptions\n } = evaluate(options, state);\n\n // If a reset by the arrow was caused due to an alignment offset being\n // added, we should skip any logic now since `flip()` has already done its\n // work.\n // https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643\n if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {\n return {};\n }\n const side = getSide(placement);\n const initialSideAxis = getSideAxis(initialPlacement);\n const isBasePlacement = getSide(initialPlacement) === initialPlacement;\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));\n const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));\n const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none';\n if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {\n fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));\n }\n const placements = [initialPlacement, ...fallbackPlacements];\n const overflow = await platform.detectOverflow(state, detectOverflowOptions);\n const overflows = [];\n let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];\n if (checkMainAxis) {\n overflows.push(overflow[side]);\n }\n if (checkCrossAxis) {\n const sides = getAlignmentSides(placement, rects, rtl);\n overflows.push(overflow[sides[0]], overflow[sides[1]]);\n }\n overflowsData = [...overflowsData, {\n placement,\n overflows\n }];\n\n // One or more sides is overflowing.\n if (!overflows.every(side => side <= 0)) {\n var _middlewareData$flip2, _overflowsData$filter;\n const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;\n const nextPlacement = placements[nextIndex];\n if (nextPlacement) {\n const ignoreCrossAxisOverflow = checkCrossAxis === 'alignment' ? initialSideAxis !== getSideAxis(nextPlacement) : false;\n if (!ignoreCrossAxisOverflow ||\n // We leave the current main axis only if every placement on that axis\n // overflows the main axis.\n overflowsData.every(d => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) {\n // Try next placement and re-run the lifecycle.\n return {\n data: {\n index: nextIndex,\n overflows: overflowsData\n },\n reset: {\n placement: nextPlacement\n }\n };\n }\n }\n\n // First, find the candidates that fit on the mainAxis side of overflow,\n // then find the placement that fits the best on the main crossAxis side.\n let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;\n\n // Otherwise fallback.\n if (!resetPlacement) {\n switch (fallbackStrategy) {\n case 'bestFit':\n {\n var _overflowsData$filter2;\n const placement = (_overflowsData$filter2 = overflowsData.filter(d => {\n if (hasFallbackAxisSideDirection) {\n const currentSideAxis = getSideAxis(d.placement);\n return currentSideAxis === initialSideAxis ||\n // Create a bias to the `y` side axis due to horizontal\n // reading directions favoring greater width.\n currentSideAxis === 'y';\n }\n return true;\n }).map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];\n if (placement) {\n resetPlacement = placement;\n }\n break;\n }\n case 'initialPlacement':\n resetPlacement = initialPlacement;\n break;\n }\n }\n if (placement !== resetPlacement) {\n return {\n reset: {\n placement: resetPlacement\n }\n };\n }\n }\n return {};\n }\n };\n};\n\nfunction getSideOffsets(overflow, rect) {\n return {\n top: overflow.top - rect.height,\n right: overflow.right - rect.width,\n bottom: overflow.bottom - rect.height,\n left: overflow.left - rect.width\n };\n}\nfunction isAnySideFullyClipped(overflow) {\n return sides.some(side => overflow[side] >= 0);\n}\n/**\n * Provides data to hide the floating element in applicable situations, such as\n * when it is not in the same clipping context as the reference element.\n * @see https://floating-ui.com/docs/hide\n */\nconst hide = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'hide',\n options,\n async fn(state) {\n const {\n rects,\n platform\n } = state;\n const {\n strategy = 'referenceHidden',\n ...detectOverflowOptions\n } = evaluate(options, state);\n switch (strategy) {\n case 'referenceHidden':\n {\n const overflow = await platform.detectOverflow(state, {\n ...detectOverflowOptions,\n elementContext: 'reference'\n });\n const offsets = getSideOffsets(overflow, rects.reference);\n return {\n data: {\n referenceHiddenOffsets: offsets,\n referenceHidden: isAnySideFullyClipped(offsets)\n }\n };\n }\n case 'escaped':\n {\n const overflow = await platform.detectOverflow(state, {\n ...detectOverflowOptions,\n altBoundary: true\n });\n const offsets = getSideOffsets(overflow, rects.floating);\n return {\n data: {\n escapedOffsets: offsets,\n escaped: isAnySideFullyClipped(offsets)\n }\n };\n }\n default:\n {\n return {};\n }\n }\n }\n };\n};\n\nfunction getBoundingRect(rects) {\n const minX = min(...rects.map(rect => rect.left));\n const minY = min(...rects.map(rect => rect.top));\n const maxX = max(...rects.map(rect => rect.right));\n const maxY = max(...rects.map(rect => rect.bottom));\n return {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY\n };\n}\nfunction getRectsByLine(rects) {\n const sortedRects = rects.slice().sort((a, b) => a.y - b.y);\n const groups = [];\n let prevRect = null;\n for (let i = 0; i < sortedRects.length; i++) {\n const rect = sortedRects[i];\n if (!prevRect || rect.y - prevRect.y > prevRect.height / 2) {\n groups.push([rect]);\n } else {\n groups[groups.length - 1].push(rect);\n }\n prevRect = rect;\n }\n return groups.map(rect => rectToClientRect(getBoundingRect(rect)));\n}\n/**\n * Provides improved positioning for inline reference elements that can span\n * over multiple lines, such as hyperlinks or range selections.\n * @see https://floating-ui.com/docs/inline\n */\nconst inline = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'inline',\n options,\n async fn(state) {\n const {\n placement,\n elements,\n rects,\n platform,\n strategy\n } = state;\n // A MouseEvent's client{X,Y} coords can be up to 2 pixels off a\n // ClientRect's bounds, despite the event listener being triggered. A\n // padding of 2 seems to handle this issue.\n const {\n padding = 2,\n x,\n y\n } = evaluate(options, state);\n const nativeClientRects = Array.from((await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || []);\n const clientRects = getRectsByLine(nativeClientRects);\n const fallback = rectToClientRect(getBoundingRect(nativeClientRects));\n const paddingObject = getPaddingObject(padding);\n function getBoundingClientRect() {\n // There are two rects and they are disjoined.\n if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) {\n // Find the first rect in which the point is fully inside.\n return clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback;\n }\n\n // There are 2 or more connected rects.\n if (clientRects.length >= 2) {\n if (getSideAxis(placement) === 'y') {\n const firstRect = clientRects[0];\n const lastRect = clientRects[clientRects.length - 1];\n const isTop = getSide(placement) === 'top';\n const top = firstRect.top;\n const bottom = lastRect.bottom;\n const left = isTop ? firstRect.left : lastRect.left;\n const right = isTop ? firstRect.right : lastRect.right;\n const width = right - left;\n const height = bottom - top;\n return {\n top,\n bottom,\n left,\n right,\n width,\n height,\n x: left,\n y: top\n };\n }\n const isLeftSide = getSide(placement) === 'left';\n const maxRight = max(...clientRects.map(rect => rect.right));\n const minLeft = min(...clientRects.map(rect => rect.left));\n const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight);\n const top = measureRects[0].top;\n const bottom = measureRects[measureRects.length - 1].bottom;\n const left = minLeft;\n const right = maxRight;\n const width = right - left;\n const height = bottom - top;\n return {\n top,\n bottom,\n left,\n right,\n width,\n height,\n x: left,\n y: top\n };\n }\n return fallback;\n }\n const resetRects = await platform.getElementRects({\n reference: {\n getBoundingClientRect\n },\n floating: elements.floating,\n strategy\n });\n if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) {\n return {\n reset: {\n rects: resetRects\n }\n };\n }\n return {};\n }\n };\n};\n\nconst originSides = /*#__PURE__*/new Set(['left', 'top']);\n\n// For type backwards-compatibility, the `OffsetOptions` type was also\n// Derivable.\n\nasync function convertValueToCoords(state, options) {\n const {\n placement,\n platform,\n elements\n } = state;\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));\n const side = getSide(placement);\n const alignment = getAlignment(placement);\n const isVertical = getSideAxis(placement) === 'y';\n const mainAxisMulti = originSides.has(side) ? -1 : 1;\n const crossAxisMulti = rtl && isVertical ? -1 : 1;\n const rawValue = evaluate(options, state);\n\n // eslint-disable-next-line prefer-const\n let {\n mainAxis,\n crossAxis,\n alignmentAxis\n } = typeof rawValue === 'number' ? {\n mainAxis: rawValue,\n crossAxis: 0,\n alignmentAxis: null\n } : {\n mainAxis: rawValue.mainAxis || 0,\n crossAxis: rawValue.crossAxis || 0,\n alignmentAxis: rawValue.alignmentAxis\n };\n if (alignment && typeof alignmentAxis === 'number') {\n crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;\n }\n return isVertical ? {\n x: crossAxis * crossAxisMulti,\n y: mainAxis * mainAxisMulti\n } : {\n x: mainAxis * mainAxisMulti,\n y: crossAxis * crossAxisMulti\n };\n}\n\n/**\n * Modifies the placement by translating the floating element along the\n * specified axes.\n * A number (shorthand for `mainAxis` or distance), or an axes configuration\n * object may be passed.\n * @see https://floating-ui.com/docs/offset\n */\nconst offset = function (options) {\n if (options === void 0) {\n options = 0;\n }\n return {\n name: 'offset',\n options,\n async fn(state) {\n var _middlewareData$offse, _middlewareData$arrow;\n const {\n x,\n y,\n placement,\n middlewareData\n } = state;\n const diffCoords = await convertValueToCoords(state, options);\n\n // If the placement is the same and the arrow caused an alignment offset\n // then we don't need to change the positioning coordinates.\n if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {\n return {};\n }\n return {\n x: x + diffCoords.x,\n y: y + diffCoords.y,\n data: {\n ...diffCoords,\n placement\n }\n };\n }\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by shifting it in order to\n * keep it in view when it will overflow the clipping boundary.\n * @see https://floating-ui.com/docs/shift\n */\nconst shift = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'shift',\n options,\n async fn(state) {\n const {\n x,\n y,\n placement,\n platform\n } = state;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = false,\n limiter = {\n fn: _ref => {\n let {\n x,\n y\n } = _ref;\n return {\n x,\n y\n };\n }\n },\n ...detectOverflowOptions\n } = evaluate(options, state);\n const coords = {\n x,\n y\n };\n const overflow = await platform.detectOverflow(state, detectOverflowOptions);\n const crossAxis = getSideAxis(getSide(placement));\n const mainAxis = getOppositeAxis(crossAxis);\n let mainAxisCoord = coords[mainAxis];\n let crossAxisCoord = coords[crossAxis];\n if (checkMainAxis) {\n const minSide = mainAxis === 'y' ? 'top' : 'left';\n const maxSide = mainAxis === 'y' ? 'bottom' : 'right';\n const min = mainAxisCoord + overflow[minSide];\n const max = mainAxisCoord - overflow[maxSide];\n mainAxisCoord = clamp(min, mainAxisCoord, max);\n }\n if (checkCrossAxis) {\n const minSide = crossAxis === 'y' ? 'top' : 'left';\n const maxSide = crossAxis === 'y' ? 'bottom' : 'right';\n const min = crossAxisCoord + overflow[minSide];\n const max = crossAxisCoord - overflow[maxSide];\n crossAxisCoord = clamp(min, crossAxisCoord, max);\n }\n const limitedCoords = limiter.fn({\n ...state,\n [mainAxis]: mainAxisCoord,\n [crossAxis]: crossAxisCoord\n });\n return {\n ...limitedCoords,\n data: {\n x: limitedCoords.x - x,\n y: limitedCoords.y - y,\n enabled: {\n [mainAxis]: checkMainAxis,\n [crossAxis]: checkCrossAxis\n }\n }\n };\n }\n };\n};\n/**\n * Built-in `limiter` that will stop `shift()` at a certain point.\n */\nconst limitShift = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n options,\n fn(state) {\n const {\n x,\n y,\n placement,\n rects,\n middlewareData\n } = state;\n const {\n offset = 0,\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = true\n } = evaluate(options, state);\n const coords = {\n x,\n y\n };\n const crossAxis = getSideAxis(placement);\n const mainAxis = getOppositeAxis(crossAxis);\n let mainAxisCoord = coords[mainAxis];\n let crossAxisCoord = coords[crossAxis];\n const rawOffset = evaluate(offset, state);\n const computedOffset = typeof rawOffset === 'number' ? {\n mainAxis: rawOffset,\n crossAxis: 0\n } : {\n mainAxis: 0,\n crossAxis: 0,\n ...rawOffset\n };\n if (checkMainAxis) {\n const len = mainAxis === 'y' ? 'height' : 'width';\n const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;\n const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;\n if (mainAxisCoord < limitMin) {\n mainAxisCoord = limitMin;\n } else if (mainAxisCoord > limitMax) {\n mainAxisCoord = limitMax;\n }\n }\n if (checkCrossAxis) {\n var _middlewareData$offse, _middlewareData$offse2;\n const len = mainAxis === 'y' ? 'width' : 'height';\n const isOriginSide = originSides.has(getSide(placement));\n const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);\n const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);\n if (crossAxisCoord < limitMin) {\n crossAxisCoord = limitMin;\n } else if (crossAxisCoord > limitMax) {\n crossAxisCoord = limitMax;\n }\n }\n return {\n [mainAxis]: mainAxisCoord,\n [crossAxis]: crossAxisCoord\n };\n }\n };\n};\n\n/**\n * Provides data that allows you to change the size of the floating element —\n * for instance, prevent it from overflowing the clipping boundary or match the\n * width of the reference element.\n * @see https://floating-ui.com/docs/size\n */\nconst size = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'size',\n options,\n async fn(state) {\n var _state$middlewareData, _state$middlewareData2;\n const {\n placement,\n rects,\n platform,\n elements\n } = state;\n const {\n apply = () => {},\n ...detectOverflowOptions\n } = evaluate(options, state);\n const overflow = await platform.detectOverflow(state, detectOverflowOptions);\n const side = getSide(placement);\n const alignment = getAlignment(placement);\n const isYAxis = getSideAxis(placement) === 'y';\n const {\n width,\n height\n } = rects.floating;\n let heightSide;\n let widthSide;\n if (side === 'top' || side === 'bottom') {\n heightSide = side;\n widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right';\n } else {\n widthSide = side;\n heightSide = alignment === 'end' ? 'top' : 'bottom';\n }\n const maximumClippingHeight = height - overflow.top - overflow.bottom;\n const maximumClippingWidth = width - overflow.left - overflow.right;\n const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight);\n const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth);\n const noShift = !state.middlewareData.shift;\n let availableHeight = overflowAvailableHeight;\n let availableWidth = overflowAvailableWidth;\n if ((_state$middlewareData = state.middlewareData.shift) != null && _state$middlewareData.enabled.x) {\n availableWidth = maximumClippingWidth;\n }\n if ((_state$middlewareData2 = state.middlewareData.shift) != null && _state$middlewareData2.enabled.y) {\n availableHeight = maximumClippingHeight;\n }\n if (noShift && !alignment) {\n const xMin = max(overflow.left, 0);\n const xMax = max(overflow.right, 0);\n const yMin = max(overflow.top, 0);\n const yMax = max(overflow.bottom, 0);\n if (isYAxis) {\n availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right));\n } else {\n availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom));\n }\n }\n await apply({\n ...state,\n availableWidth,\n availableHeight\n });\n const nextDimensions = await platform.getDimensions(elements.floating);\n if (width !== nextDimensions.width || height !== nextDimensions.height) {\n return {\n reset: {\n rects: true\n }\n };\n }\n return {};\n }\n };\n};\n\nexport { arrow, autoPlacement, computePosition, detectOverflow, flip, hide, inline, limitShift, offset, shift, size };\n","function hasWindow() {\n return typeof window !== 'undefined';\n}\nfunction getNodeName(node) {\n if (isNode(node)) {\n return (node.nodeName || '').toLowerCase();\n }\n // Mocked nodes in testing environments may not be instances of Node. By\n // returning `#document` an infinite loop won't occur.\n // https://github.com/floating-ui/floating-ui/issues/2317\n return '#document';\n}\nfunction getWindow(node) {\n var _node$ownerDocument;\n return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;\n}\nfunction getDocumentElement(node) {\n var _ref;\n return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;\n}\nfunction isNode(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof Node || value instanceof getWindow(value).Node;\n}\nfunction isElement(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof Element || value instanceof getWindow(value).Element;\n}\nfunction isHTMLElement(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;\n}\nfunction isShadowRoot(value) {\n if (!hasWindow() || typeof ShadowRoot === 'undefined') {\n return false;\n }\n return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;\n}\nconst invalidOverflowDisplayValues = /*#__PURE__*/new Set(['inline', 'contents']);\nfunction isOverflowElement(element) {\n const {\n overflow,\n overflowX,\n overflowY,\n display\n } = getComputedStyle(element);\n return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !invalidOverflowDisplayValues.has(display);\n}\nconst tableElements = /*#__PURE__*/new Set(['table', 'td', 'th']);\nfunction isTableElement(element) {\n return tableElements.has(getNodeName(element));\n}\nconst topLayerSelectors = [':popover-open', ':modal'];\nfunction isTopLayer(element) {\n return topLayerSelectors.some(selector => {\n try {\n return element.matches(selector);\n } catch (_e) {\n return false;\n }\n });\n}\nconst transformProperties = ['transform', 'translate', 'scale', 'rotate', 'perspective'];\nconst willChangeValues = ['transform', 'translate', 'scale', 'rotate', 'perspective', 'filter'];\nconst containValues = ['paint', 'layout', 'strict', 'content'];\nfunction isContainingBlock(elementOrCss) {\n const webkit = isWebKit();\n const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n // https://drafts.csswg.org/css-transforms-2/#individual-transforms\n return transformProperties.some(value => css[value] ? css[value] !== 'none' : false) || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || willChangeValues.some(value => (css.willChange || '').includes(value)) || containValues.some(value => (css.contain || '').includes(value));\n}\nfunction getContainingBlock(element) {\n let currentNode = getParentNode(element);\n while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {\n if (isContainingBlock(currentNode)) {\n return currentNode;\n } else if (isTopLayer(currentNode)) {\n return null;\n }\n currentNode = getParentNode(currentNode);\n }\n return null;\n}\nfunction isWebKit() {\n if (typeof CSS === 'undefined' || !CSS.supports) return false;\n return CSS.supports('-webkit-backdrop-filter', 'none');\n}\nconst lastTraversableNodeNames = /*#__PURE__*/new Set(['html', 'body', '#document']);\nfunction isLastTraversableNode(node) {\n return lastTraversableNodeNames.has(getNodeName(node));\n}\nfunction getComputedStyle(element) {\n return getWindow(element).getComputedStyle(element);\n}\nfunction getNodeScroll(element) {\n if (isElement(element)) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n }\n return {\n scrollLeft: element.scrollX,\n scrollTop: element.scrollY\n };\n}\nfunction getParentNode(node) {\n if (getNodeName(node) === 'html') {\n return node;\n }\n const result =\n // Step into the shadow DOM of the parent of a slotted node.\n node.assignedSlot ||\n // DOM Element detected.\n node.parentNode ||\n // ShadowRoot detected.\n isShadowRoot(node) && node.host ||\n // Fallback.\n getDocumentElement(node);\n return isShadowRoot(result) ? result.host : result;\n}\nfunction getNearestOverflowAncestor(node) {\n const parentNode = getParentNode(node);\n if (isLastTraversableNode(parentNode)) {\n return node.ownerDocument ? node.ownerDocument.body : node.body;\n }\n if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {\n return parentNode;\n }\n return getNearestOverflowAncestor(parentNode);\n}\nfunction getOverflowAncestors(node, list, traverseIframes) {\n var _node$ownerDocument2;\n if (list === void 0) {\n list = [];\n }\n if (traverseIframes === void 0) {\n traverseIframes = true;\n }\n const scrollableAncestor = getNearestOverflowAncestor(node);\n const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);\n const win = getWindow(scrollableAncestor);\n if (isBody) {\n const frameElement = getFrameElement(win);\n return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);\n }\n return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));\n}\nfunction getFrameElement(win) {\n return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;\n}\n\nexport { getComputedStyle, getContainingBlock, getDocumentElement, getFrameElement, getNearestOverflowAncestor, getNodeName, getNodeScroll, getOverflowAncestors, getParentNode, getWindow, isContainingBlock, isElement, isHTMLElement, isLastTraversableNode, isNode, isOverflowElement, isShadowRoot, isTableElement, isTopLayer, isWebKit };\n","import { rectToClientRect, arrow as arrow$1, autoPlacement as autoPlacement$1, detectOverflow as detectOverflow$1, flip as flip$1, hide as hide$1, inline as inline$1, limitShift as limitShift$1, offset as offset$1, shift as shift$1, size as size$1, computePosition as computePosition$1 } from '@floating-ui/core';\nimport { round, createCoords, max, min, floor } from '@floating-ui/utils';\nimport { getComputedStyle as getComputedStyle$1, isHTMLElement, isElement, getWindow, isWebKit, getFrameElement, getNodeScroll, getDocumentElement, isTopLayer, getNodeName, isOverflowElement, getOverflowAncestors, getParentNode, isLastTraversableNode, isContainingBlock, isTableElement, getContainingBlock } from '@floating-ui/utils/dom';\nexport { getOverflowAncestors } from '@floating-ui/utils/dom';\n\nfunction getCssDimensions(element) {\n const css = getComputedStyle$1(element);\n // In testing environments, the `width` and `height` properties are empty\n // strings for SVG elements, returning NaN. Fallback to `0` in this case.\n let width = parseFloat(css.width) || 0;\n let height = parseFloat(css.height) || 0;\n const hasOffset = isHTMLElement(element);\n const offsetWidth = hasOffset ? element.offsetWidth : width;\n const offsetHeight = hasOffset ? element.offsetHeight : height;\n const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;\n if (shouldFallback) {\n width = offsetWidth;\n height = offsetHeight;\n }\n return {\n width,\n height,\n $: shouldFallback\n };\n}\n\nfunction unwrapElement(element) {\n return !isElement(element) ? element.contextElement : element;\n}\n\nfunction getScale(element) {\n const domElement = unwrapElement(element);\n if (!isHTMLElement(domElement)) {\n return createCoords(1);\n }\n const rect = domElement.getBoundingClientRect();\n const {\n width,\n height,\n $\n } = getCssDimensions(domElement);\n let x = ($ ? round(rect.width) : rect.width) / width;\n let y = ($ ? round(rect.height) : rect.height) / height;\n\n // 0, NaN, or Infinity should always fallback to 1.\n\n if (!x || !Number.isFinite(x)) {\n x = 1;\n }\n if (!y || !Number.isFinite(y)) {\n y = 1;\n }\n return {\n x,\n y\n };\n}\n\nconst noOffsets = /*#__PURE__*/createCoords(0);\nfunction getVisualOffsets(element) {\n const win = getWindow(element);\n if (!isWebKit() || !win.visualViewport) {\n return noOffsets;\n }\n return {\n x: win.visualViewport.offsetLeft,\n y: win.visualViewport.offsetTop\n };\n}\nfunction shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {\n return false;\n }\n return isFixed;\n}\n\nfunction getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {\n if (includeScale === void 0) {\n includeScale = false;\n }\n if (isFixedStrategy === void 0) {\n isFixedStrategy = false;\n }\n const clientRect = element.getBoundingClientRect();\n const domElement = unwrapElement(element);\n let scale = createCoords(1);\n if (includeScale) {\n if (offsetParent) {\n if (isElement(offsetParent)) {\n scale = getScale(offsetParent);\n }\n } else {\n scale = getScale(element);\n }\n }\n const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);\n let x = (clientRect.left + visualOffsets.x) / scale.x;\n let y = (clientRect.top + visualOffsets.y) / scale.y;\n let width = clientRect.width / scale.x;\n let height = clientRect.height / scale.y;\n if (domElement) {\n const win = getWindow(domElement);\n const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;\n let currentWin = win;\n let currentIFrame = getFrameElement(currentWin);\n while (currentIFrame && offsetParent && offsetWin !== currentWin) {\n const iframeScale = getScale(currentIFrame);\n const iframeRect = currentIFrame.getBoundingClientRect();\n const css = getComputedStyle$1(currentIFrame);\n const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;\n const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;\n x *= iframeScale.x;\n y *= iframeScale.y;\n width *= iframeScale.x;\n height *= iframeScale.y;\n x += left;\n y += top;\n currentWin = getWindow(currentIFrame);\n currentIFrame = getFrameElement(currentWin);\n }\n }\n return rectToClientRect({\n width,\n height,\n x,\n y\n });\n}\n\n// If <html> has a CSS width greater than the viewport, then this will be\n// incorrect for RTL.\nfunction getWindowScrollBarX(element, rect) {\n const leftScroll = getNodeScroll(element).scrollLeft;\n if (!rect) {\n return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;\n }\n return rect.left + leftScroll;\n}\n\nfunction getHTMLOffset(documentElement, scroll) {\n const htmlRect = documentElement.getBoundingClientRect();\n const x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect);\n const y = htmlRect.top + scroll.scrollTop;\n return {\n x,\n y\n };\n}\n\nfunction convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {\n let {\n elements,\n rect,\n offsetParent,\n strategy\n } = _ref;\n const isFixed = strategy === 'fixed';\n const documentElement = getDocumentElement(offsetParent);\n const topLayer = elements ? isTopLayer(elements.floating) : false;\n if (offsetParent === documentElement || topLayer && isFixed) {\n return rect;\n }\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n let scale = createCoords(1);\n const offsets = createCoords(0);\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isHTMLElement(offsetParent)) {\n const offsetRect = getBoundingClientRect(offsetParent);\n scale = getScale(offsetParent);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n }\n }\n const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);\n return {\n width: rect.width * scale.x,\n height: rect.height * scale.y,\n x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,\n y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y\n };\n}\n\nfunction getClientRects(element) {\n return Array.from(element.getClientRects());\n}\n\n// Gets the entire size of the scrollable document area, even extending outside\n// of the `<html>` and `<body>` rect bounds if horizontally scrollable.\nfunction getDocumentRect(element) {\n const html = getDocumentElement(element);\n const scroll = getNodeScroll(element);\n const body = element.ownerDocument.body;\n const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);\n const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);\n let x = -scroll.scrollLeft + getWindowScrollBarX(element);\n const y = -scroll.scrollTop;\n if (getComputedStyle$1(body).direction === 'rtl') {\n x += max(html.clientWidth, body.clientWidth) - width;\n }\n return {\n width,\n height,\n x,\n y\n };\n}\n\n// Safety check: ensure the scrollbar space is reasonable in case this\n// calculation is affected by unusual styles.\n// Most scrollbars leave 15-18px of space.\nconst SCROLLBAR_MAX = 25;\nfunction getViewportRect(element, strategy) {\n const win = getWindow(element);\n const html = getDocumentElement(element);\n const visualViewport = win.visualViewport;\n let width = html.clientWidth;\n let height = html.clientHeight;\n let x = 0;\n let y = 0;\n if (visualViewport) {\n width = visualViewport.width;\n height = visualViewport.height;\n const visualViewportBased = isWebKit();\n if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {\n x = visualViewport.offsetLeft;\n y = visualViewport.offsetTop;\n }\n }\n const windowScrollbarX = getWindowScrollBarX(html);\n // <html> `overflow: hidden` + `scrollbar-gutter: stable` reduces the\n // visual width of the <html> but this is not considered in the size\n // of `html.clientWidth`.\n if (windowScrollbarX <= 0) {\n const doc = html.ownerDocument;\n const body = doc.body;\n const bodyStyles = getComputedStyle(body);\n const bodyMarginInline = doc.compatMode === 'CSS1Compat' ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;\n const clippingStableScrollbarWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);\n if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) {\n width -= clippingStableScrollbarWidth;\n }\n } else if (windowScrollbarX <= SCROLLBAR_MAX) {\n // If the <body> scrollbar is on the left, the width needs to be extended\n // by the scrollbar amount so there isn't extra space on the right.\n width += windowScrollbarX;\n }\n return {\n width,\n height,\n x,\n y\n };\n}\n\nconst absoluteOrFixed = /*#__PURE__*/new Set(['absolute', 'fixed']);\n// Returns the inner client rect, subtracting scrollbars if present.\nfunction getInnerBoundingClientRect(element, strategy) {\n const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');\n const top = clientRect.top + element.clientTop;\n const left = clientRect.left + element.clientLeft;\n const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);\n const width = element.clientWidth * scale.x;\n const height = element.clientHeight * scale.y;\n const x = left * scale.x;\n const y = top * scale.y;\n return {\n width,\n height,\n x,\n y\n };\n}\nfunction getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {\n let rect;\n if (clippingAncestor === 'viewport') {\n rect = getViewportRect(element, strategy);\n } else if (clippingAncestor === 'document') {\n rect = getDocumentRect(getDocumentElement(element));\n } else if (isElement(clippingAncestor)) {\n rect = getInnerBoundingClientRect(clippingAncestor, strategy);\n } else {\n const visualOffsets = getVisualOffsets(element);\n rect = {\n x: clippingAncestor.x - visualOffsets.x,\n y: clippingAncestor.y - visualOffsets.y,\n width: clippingAncestor.width,\n height: clippingAncestor.height\n };\n }\n return rectToClientRect(rect);\n}\nfunction hasFixedPositionAncestor(element, stopNode) {\n const parentNode = getParentNode(element);\n if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {\n return false;\n }\n return getComputedStyle$1(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);\n}\n\n// A \"clipping ancestor\" is an `overflow` element with the characteristic of\n// clipping (or hiding) child elements. This returns all clipping ancestors\n// of the given element up the tree.\nfunction getClippingElementAncestors(element, cache) {\n const cachedResult = cache.get(element);\n if (cachedResult) {\n return cachedResult;\n }\n let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');\n let currentContainingBlockComputedStyle = null;\n const elementIsFixed = getComputedStyle$1(element).position === 'fixed';\n let currentNode = elementIsFixed ? getParentNode(element) : element;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {\n const computedStyle = getComputedStyle$1(currentNode);\n const currentNodeIsContaining = isContainingBlock(currentNode);\n if (!currentNodeIsContaining && computedStyle.position === 'fixed') {\n currentContainingBlockComputedStyle = null;\n }\n const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && absoluteOrFixed.has(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);\n if (shouldDropCurrentNode) {\n // Drop non-containing blocks.\n result = result.filter(ancestor => ancestor !== currentNode);\n } else {\n // Record last containing block for next iteration.\n currentContainingBlockComputedStyle = computedStyle;\n }\n currentNode = getParentNode(currentNode);\n }\n cache.set(element, result);\n return result;\n}\n\n// Gets the maximum area that the element is visible in due to any number of\n// clipping ancestors.\nfunction getClippingRect(_ref) {\n let {\n element,\n boundary,\n rootBoundary,\n strategy\n } = _ref;\n const elementClippingAncestors = boundary === 'clippingAncestors' ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);\n const clippingAncestors = [...elementClippingAncestors, rootBoundary];\n const firstClippingAncestor = clippingAncestors[0];\n const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {\n const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);\n accRect.top = max(rect.top, accRect.top);\n accRect.right = min(rect.right, accRect.right);\n accRect.bottom = min(rect.bottom, accRect.bottom);\n accRect.left = max(rect.left, accRect.left);\n return accRect;\n }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));\n return {\n width: clippingRect.right - clippingRect.left,\n height: clippingRect.bottom - clippingRect.top,\n x: clippingRect.left,\n y: clippingRect.top\n };\n}\n\nfunction getDimensions(element) {\n const {\n width,\n height\n } = getCssDimensions(element);\n return {\n width,\n height\n };\n}\n\nfunction getRectRelativeToOffsetParent(element, offsetParent, strategy) {\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n const documentElement = getDocumentElement(offsetParent);\n const isFixed = strategy === 'fixed';\n const rect = getBoundingClientRect(element, true, isFixed, offsetParent);\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n const offsets = createCoords(0);\n\n // If the <body> scrollbar appears on the left (e.g. RTL systems). Use\n // Firefox with layout.scrollbar.side = 3 in about:config to test this.\n function setLeftRTLScrollbarOffset() {\n offsets.x = getWindowScrollBarX(documentElement);\n }\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isOffsetParentAnElement) {\n const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n } else if (documentElement) {\n setLeftRTLScrollbarOffset();\n }\n }\n if (isFixed && !isOffsetParentAnElement && documentElement) {\n setLeftRTLScrollbarOffset();\n }\n const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);\n const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;\n const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;\n return {\n x,\n y,\n width: rect.width,\n height: rect.height\n };\n}\n\nfunction isStaticPositioned(element) {\n return getComputedStyle$1(element).position === 'static';\n}\n\nfunction getTrueOffsetParent(element, polyfill) {\n if (!isHTMLElement(element) || getComputedStyle$1(element).position === 'fixed') {\n return null;\n }\n if (polyfill) {\n return polyfill(element);\n }\n let rawOffsetParent = element.offsetParent;\n\n // Firefox returns the <html> element as the offsetParent if it's non-static,\n // while Chrome and Safari return the <body> element. The <body> element must\n // be used to perform the correct calculations even if the <html> element is\n // non-static.\n if (getDocumentElement(element) === rawOffsetParent) {\n rawOffsetParent = rawOffsetParent.ownerDocument.body;\n }\n return rawOffsetParent;\n}\n\n// Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\nfunction getOffsetParent(element, polyfill) {\n const win = getWindow(element);\n if (isTopLayer(element)) {\n return win;\n }\n if (!isHTMLElement(element)) {\n let svgOffsetParent = getParentNode(element);\n while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {\n if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {\n return svgOffsetParent;\n }\n svgOffsetParent = getParentNode(svgOffsetParent);\n }\n return win;\n }\n let offsetParent = getTrueOffsetParent(element, polyfill);\n while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {\n offsetParent = getTrueOffsetParent(offsetParent, polyfill);\n }\n if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {\n return win;\n }\n return offsetParent || getContainingBlock(element) || win;\n}\n\nconst getElementRects = async function (data) {\n const getOffsetParentFn = this.getOffsetParent || getOffsetParent;\n const getDimensionsFn = this.getDimensions;\n const floatingDimensions = await getDimensionsFn(data.floating);\n return {\n reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),\n floating: {\n x: 0,\n y: 0,\n width: floatingDimensions.width,\n height: floatingDimensions.height\n }\n };\n};\n\nfunction isRTL(element) {\n return getComputedStyle$1(element).direction === 'rtl';\n}\n\nconst platform = {\n convertOffsetParentRelativeRectToViewportRelativeRect,\n getDocumentElement,\n getClippingRect,\n getOffsetParent,\n getElementRects,\n getClientRects,\n getDimensions,\n getScale,\n isElement,\n isRTL\n};\n\nfunction rectsAreEqual(a, b) {\n return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;\n}\n\n// https://samthor.au/2021/observing-dom/\nfunction observeMove(element, onMove) {\n let io = null;\n let timeoutId;\n const root = getDocumentElement(element);\n function cleanup() {\n var _io;\n clearTimeout(timeoutId);\n (_io = io) == null || _io.disconnect();\n io = null;\n }\n function refresh(skip, threshold) {\n if (skip === void 0) {\n skip = false;\n }\n if (threshold === void 0) {\n threshold = 1;\n }\n cleanup();\n const elementRectForRootMargin = element.getBoundingClientRect();\n const {\n left,\n top,\n width,\n height\n } = elementRectForRootMargin;\n if (!skip) {\n onMove();\n }\n if (!width || !height) {\n return;\n }\n const insetTop = floor(top);\n const insetRight = floor(root.clientWidth - (left + width));\n const insetBottom = floor(root.clientHeight - (top + height));\n const insetLeft = floor(left);\n const rootMargin = -insetTop + \"px \" + -insetRight + \"px \" + -insetBottom + \"px \" + -insetLeft + \"px\";\n const options = {\n rootMargin,\n threshold: max(0, min(1, threshold)) || 1\n };\n let isFirstUpdate = true;\n function handleObserve(entries) {\n const ratio = entries[0].intersectionRatio;\n if (ratio !== threshold) {\n if (!isFirstUpdate) {\n return refresh();\n }\n if (!ratio) {\n // If the reference is clipped, the ratio is 0. Throttle the refresh\n // to prevent an infinite loop of updates.\n timeoutId = setTimeout(() => {\n refresh(false, 1e-7);\n }, 1000);\n } else {\n refresh(false, ratio);\n }\n }\n if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {\n // It's possible that even though the ratio is reported as 1, the\n // element is not actually fully within the IntersectionObserver's root\n // area anymore. This can happen under performance constraints. This may\n // be a bug in the browser's IntersectionObserver implementation. To\n // work around this, we compare the element's bounding rect now with\n // what it was at the time we created the IntersectionObserver. If they\n // are not equal then the element moved, so we refresh.\n refresh();\n }\n isFirstUpdate = false;\n }\n\n // Older browsers don't support a `document` as the root and will throw an\n // error.\n try {\n io = new IntersectionObserver(handleObserve, {\n ...options,\n // Handle <iframe>s\n root: root.ownerDocument\n });\n } catch (_e) {\n io = new IntersectionObserver(handleObserve, options);\n }\n io.observe(element);\n }\n refresh(true);\n return cleanup;\n}\n\n/**\n * Automatically updates the position of the floating element when necessary.\n * Should only be called when the floating element is mounted on the DOM or\n * visible on the screen.\n * @returns cleanup function that should be invoked when the floating element is\n * removed from the DOM or hidden from the screen.\n * @see https://floating-ui.com/docs/autoUpdate\n */\nfunction autoUpdate(reference, floating, update, options) {\n if (options === void 0) {\n options = {};\n }\n const {\n ancestorScroll = true,\n ancestorResize = true,\n elementResize = typeof ResizeObserver === 'function',\n layoutShift = typeof IntersectionObserver === 'function',\n animationFrame = false\n } = options;\n const referenceEl = unwrapElement(reference);\n const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...getOverflowAncestors(floating)] : [];\n ancestors.forEach(ancestor => {\n ancestorScroll && ancestor.addEventListener('scroll', update, {\n passive: true\n });\n ancestorResize && ancestor.addEventListener('resize', update);\n });\n const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;\n let reobserveFrame = -1;\n let resizeObserver = null;\n if (elementResize) {\n resizeObserver = new ResizeObserver(_ref => {\n let [firstEntry] = _ref;\n if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {\n // Prevent update loops when using the `size` middleware.\n // https://github.com/floating-ui/floating-ui/issues/1740\n resizeObserver.unobserve(floating);\n cancelAnimationFrame(reobserveFrame);\n reobserveFrame = requestAnimationFrame(() => {\n var _resizeObserver;\n (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);\n });\n }\n update();\n });\n if (referenceEl && !animationFrame) {\n resizeObserver.observe(referenceEl);\n }\n resizeObserver.observe(floating);\n }\n let frameId;\n let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;\n if (animationFrame) {\n frameLoop();\n }\n function frameLoop() {\n const nextRefRect = getBoundingClientRect(reference);\n if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {\n update();\n }\n prevRefRect = nextRefRect;\n frameId = requestAnimationFrame(frameLoop);\n }\n update();\n return () => {\n var _resizeObserver2;\n ancestors.forEach(ancestor => {\n ancestorScroll && ancestor.removeEventListener('scroll', update);\n ancestorResize && ancestor.removeEventListener('resize', update);\n });\n cleanupIo == null || cleanupIo();\n (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();\n resizeObserver = null;\n if (animationFrame) {\n cancelAnimationFrame(frameId);\n }\n };\n}\n\n/**\n * Resolves with an object of overflow side offsets that determine how much the\n * element is overflowing a given clipping boundary on each side.\n * - positive = overflowing the boundary by that number of pixels\n * - negative = how many pixels left before it will overflow\n * - 0 = lies flush with the boundary\n * @see https://floating-ui.com/docs/detectOverflow\n */\nconst detectOverflow = detectOverflow$1;\n\n/**\n * Modifies the placement by translating the floating element along the\n * specified axes.\n * A number (shorthand for `mainAxis` or distance), or an axes configuration\n * object may be passed.\n * @see https://floating-ui.com/docs/offset\n */\nconst offset = offset$1;\n\n/**\n * Optimizes the visibility of the floating element by choosing the placement\n * that has the most space available automatically, without needing to specify a\n * preferred placement. Alternative to `flip`.\n * @see https://floating-ui.com/docs/autoPlacement\n */\nconst autoPlacement = autoPlacement$1;\n\n/**\n * Optimizes the visibility of the floating element by shifting it in order to\n * keep it in view when it will overflow the clipping boundary.\n * @see https://floating-ui.com/docs/shift\n */\nconst shift = shift$1;\n\n/**\n * Optimizes the visibility of the floating element by flipping the `placement`\n * in order to keep it in view when the preferred placement(s) will overflow the\n * clipping boundary. Alternative to `autoPlacement`.\n * @see https://floating-ui.com/docs/flip\n */\nconst flip = flip$1;\n\n/**\n * Provides data that allows you to change the size of the floating element —\n * for instance, prevent it from overflowing the clipping boundary or match the\n * width of the reference element.\n * @see https://floating-ui.com/docs/size\n */\nconst size = size$1;\n\n/**\n * Provides data to hide the floating element in applicable situations, such as\n * when it is not in the same clipping context as the reference element.\n * @see https://floating-ui.com/docs/hide\n */\nconst hide = hide$1;\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = arrow$1;\n\n/**\n * Provides improved positioning for inline reference elements that can span\n * over multiple lines, such as hyperlinks or range selections.\n * @see https://floating-ui.com/docs/inline\n */\nconst inline = inline$1;\n\n/**\n * Built-in `limiter` that will stop `shift()` at a certain point.\n */\nconst limitShift = limitShift$1;\n\n/**\n * Computes the `x` and `y` coordinates that will place the floating element\n * next to a given reference element.\n */\nconst computePosition = (reference, floating, options) => {\n // This caches the expensive `getClippingElementAncestors` function so that\n // multiple lifecycle resets re-use the same result. It only lives for a\n // single call. If other functions become expensive, we can add them as well.\n const cache = new Map();\n const mergedOptions = {\n platform,\n ...options\n };\n const platformWithCache = {\n ...mergedOptions.platform,\n _c: cache\n };\n return computePosition$1(reference, floating, {\n ...mergedOptions,\n platform: platformWithCache\n });\n};\n\nexport { arrow, autoPlacement, autoUpdate, computePosition, detectOverflow, flip, hide, inline, limitShift, offset, platform, shift, size };\n","import type { ReactiveController, ReactiveControllerHost } from 'lit'\n\n/**\n * We can have any number of components open at a time, all of which lock scroll.\n * Consider multiple modals being open, plus some popouts, etc.\n *\n * So we need some bookkeeping to know when to unlock scroll...\n *\n * But we can't simply keep a count of how many components are open,\n * since a misbehaving component may call lockScroll() multiple times.\n *\n * Nor can we rely on the first component to call lockScroll() to be the last to unlockScroll(),\n * since we cannot guarantee order of operations.\n *\n * Therefore, we track instances of ScrollbarController in a Set,\n * and only unlock scroll when the set is empty.\n *\n * We also need to be careful to restore any styles that were there\n * before we locked scroll.\n */\nexport class ScrollbarController implements ReactiveController {\n private static locks = new Set<ScrollbarController>()\n private static resets: Array<() => void> = []\n\n constructor(host: ReactiveControllerHost) {\n host.addController(this)\n }\n\n hostDisconnected() {\n this.unlockScroll()\n }\n\n lockScroll() {\n if (ScrollbarController.locks.size === 0) {\n const documentWidth = document.documentElement.clientWidth\n const width = Math.abs(window.innerWidth - documentWidth)\n\n const computedStyle = getComputedStyle(document.body)\n const paddingRight = Number.parseInt(computedStyle.paddingRight, 10) || 0\n\n // hiding the scrollbar slightly increases the width of the inner viewport.\n // this is fine for the modal, since it is accounted for there. but it causes layout shift for any other fixed position components/elements.\n // so we define a custom property here for the gutter value, since it can be inherited/used by any other component that has a fixed position e.g. toast-group.\n ScrollbarController.setStyle('--n-scrollbar-gutter', `${width + paddingRight}px`)\n ScrollbarController.setStyle('overflow', 'hidden')\n // use physical padding property rather than the logical equivalent, since the scrollbar is on always right side of the viewport, even in RTL.\n ScrollbarController.setStyle('padding-right', `var(--n-scrollbar-gutter)`)\n }\n\n ScrollbarController.locks.add(this)\n }\n\n unlockScroll() {\n ScrollbarController.locks.delete(this)\n\n if (ScrollbarController.locks.size === 0) {\n ScrollbarController.resets.forEach(reset => reset())\n ScrollbarController.resets = []\n }\n }\n\n private static setStyle(property: string, value: string) {\n const { style } = document.body\n\n const previous = style.getPropertyValue(property)\n style.setProperty(property, value)\n\n ScrollbarController.resets.push(() => style.setProperty(property, previous))\n }\n}\n","import type { Alignment } from '@floating-ui/dom'\nimport type { LitElement } from 'lit'\nimport type { LogicalSide } from '../positioning.js'\nimport { property } from 'lit/decorators.js'\n\ntype Constructor<T = Record<string, unknown>> = new (...args: any[]) => T\n\nexport declare class FloatingMixinInterface {\n open: boolean\n align: Alignment\n position: LogicalSide | 'auto'\n}\n\nexport function FloatingMixin<T extends Constructor<LitElement>>(\n superClass: T,\n): Constructor<FloatingMixinInterface> & T {\n class FloatingElement extends superClass {\n /**\n * Controls whether the component is open or not.\n */\n @property({ type: Boolean, reflect: true }) open = false\n\n /**\n * Set the alignment in relation to the toggle (or anchor) depending on the position.\n * `start` will align it to the left of the toggle (or anchor).\n * `end` will align it to the right of the toggle (or anchor).\n * Setting the `position` to `inline-start` or `inline-end` will switch\n * `start` and `end` to the top and bottom respectively.\n */\n @property({ reflect: true }) align: 'start' | 'end' = 'start'\n\n /**\n * Set the position in relation to the toggle (or anchor).\n * Options follow logical properties.\n * `block-start` and `block-end` referring to top and bottom respectively,\n * `inline-start` and `inline-end` referring to left and right respectively.\n * You can also set it to `auto` for automatic positioning depending on\n * which side has the most space available.\n */\n @property({ reflect: true }) position: 'block-end' | 'block-start' | 'inline-start' | 'inline-end' | 'auto'\n = 'block-end'\n }\n\n return FloatingElement\n}\n","import type { Alignment, Placement, Side } from '@floating-ui/dom'\n\ntype FullPlacement = Exclude<Placement, Side>\nexport type LogicalSide = 'block-end' | 'block-start' | 'inline-start' | 'inline-end'\nexport type LogicalSideAlign = `${LogicalSide}-${Alignment}`\ntype Direction = 'ltr' | 'rtl'\n\nconst logicalMapLTR: Record<LogicalSideAlign, FullPlacement> = {\n 'inline-start-start': 'left-start',\n 'inline-start-end': 'left-end',\n 'inline-end-start': 'right-start',\n 'inline-end-end': 'right-end',\n 'block-start-start': 'top-start',\n 'block-start-end': 'top-end',\n 'block-end-start': 'bottom-start',\n 'block-end-end': 'bottom-end',\n}\n\nconst logicalMapRTL: Record<LogicalSideAlign, FullPlacement> = {\n 'inline-start-start': 'right-start',\n 'inline-start-end': 'right-end',\n 'inline-end-start': 'left-start',\n 'inline-end-end': 'left-end',\n 'block-start-start': 'top-start',\n 'block-start-end': 'top-end',\n 'block-end-start': 'bottom-start',\n 'block-end-end': 'bottom-end',\n}\n\nconst logicalMap: Record<LogicalSide, Side> = {\n 'block-end': 'bottom',\n 'block-start': 'top',\n 'inline-start': 'left',\n 'inline-end': 'right',\n}\n\n/**\n * Converts a single logical position to a physical position\n */\nexport function logicalToPhysical(logicalSide: LogicalSide): Side\n\n/**\n * Converts a logical side and alignment to floating-ui compatible placement\n */\nexport function logicalToPhysical(logicalSide: LogicalSide, alignment: Alignment, dir: Direction): Placement\n\nexport function logicalToPhysical(logicalSide: LogicalSide, alignment?: Alignment, dir?: Direction) {\n if (alignment != null && dir != null) {\n const logicalSideAlign: LogicalSideAlign = `${logicalSide}-${alignment}`\n return dir === 'ltr' ? logicalMapLTR[logicalSideAlign] : logicalMapRTL[logicalSideAlign]\n }\n\n return logicalMap[logicalSide]\n}\n","import type {\n ComputePositionConfig,\n Placement,\n} from '@floating-ui/dom'\nimport {\n autoPlacement,\n autoUpdate,\n computePosition,\n flip,\n hide,\n offset,\n shift,\n} from '@floating-ui/dom'\nimport { html, LitElement } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { DirectionController } from '../common/controllers/DirectionController.js'\nimport { EventController } from '../common/controllers/EventController.js'\nimport { LightDismissController } from '../common/controllers/LightDismissController.js'\nimport { ScrollbarController } from '../common/controllers/ScrollbarController.js'\n\nimport { observe } from '../common/decorators/observe.js'\nimport { NordEvent, transition } from '../common/events.js'\nimport { FloatingMixin } from '../common/mixins/FloatingComponentMixin.js'\nimport { logicalToPhysical } from '../common/positioning.js'\nimport componentStyle from '../common/styles/Component.css'\nimport style from './Popout.css'\n\n/*\n * The breakpoint width to switch between \"sheet\" design and floating design\n */\nconst mediaQuery\n = typeof matchMedia === 'undefined'\n ? ({\n matches: false,\n addEventListener() {\n /* noop */\n },\n } as unknown as MediaQueryList)\n : matchMedia('(max-width: 35.9375em)')\n\n/**\n * Popouts are small overlays that open on demand. They let users access additional content and actions without cluttering the page.\n *\n * @status ready\n * @category overlay\n * @slot - The popout content.\n */\n@customElement('nord-popout')\nexport default class Popout extends FloatingMixin(LitElement) {\n static styles = [componentStyle, style]\n\n private targetElement?: HTMLElement\n private anchorElement?: HTMLElement\n private cleanupAutoUpdate?: ReturnType<typeof autoUpdate>\n\n @query('.n-popout', true) private popout!: HTMLDivElement\n\n private scrollBar = new ScrollbarController(this)\n\n /**\n * Handle dismissal of the popout, clicking outside the target button and popout.\n */\n private dismiss = new LightDismissController(this, {\n isOpen: () => this.open,\n onDismiss: e => this.hide(e.type !== 'click'),\n isDismissible: node => node !== this.popout && node !== this.targetElement,\n })\n\n private events = new EventController(this)\n private direction = new DirectionController(this)\n\n @state() private computedPosition?: Placement\n\n @state() private smallViewport = mediaQuery.matches\n\n /**\n * The id for the active element to reference via aria-controls.\n */\n\n @property({ reflect: true }) id: string = ''\n\n /**\n * Set an optional anchor element to align against, replacing the triggering element.\n */\n @property({ reflect: true }) anchor?: string\n\n /**\n * Set to true to always display the popout as a floating overlay, even on smaller viewports.\n */\n @property({ reflect: true, type: Boolean, attribute: 'always-floating' }) alwaysFloating: boolean = false\n\n /**\n * Show the popout.\n * A promise that resolves to a `TransitionEvent` when the popout's show animation ends or is cancelled.\n * If the popout is already open, the promise resolves immediately with `undefined`.\n */\n async show(): Promise<TransitionEvent | void> {\n if (this.open) {\n return Promise.resolve()\n }\n\n this.enterTopLayer()\n this.open = true\n\n // we should only focus once the popout is visible after render is complete\n await this.updateComplete\n\n /**\n * Dispatched when the popout is opened.\n */\n this.dispatchEvent(new NordEvent('open'))\n\n return transition(this.popout)\n }\n\n /**\n * Hide the popout.\n * Returns a promise that resolves to a `TransitionEvent` when the popout's hide animation ends or is cancelled.\n * If the popout is already closed, the promise resolves immediately with `undefined`.\n * @param {boolean} moveFocusToButton prevent focus returning to the target button. Default is true.\n */\n async hide(moveFocusToButton: boolean = true): Promise<TransitionEvent | void> {\n if (!this.open) {\n return Promise.resolve()\n }\n\n this.open = false\n\n this.cleanupAutoUpdate?.()\n\n /**\n * Dispatched when the popout is closed.\n */\n this.dispatchEvent(new NordEvent('close'))\n\n if (moveFocusToButton) {\n this.targetElement?.focus({ preventScroll: true })\n }\n\n const result = await transition(this.popout)\n this.leaveTopLayer()\n return result\n }\n\n /**\n * Position the popout on load.\n */\n firstUpdated() {\n if (!this.smallViewport || this.alwaysFloating) {\n this.updatePosition()\n }\n }\n\n connectedCallback() {\n super.connectedCallback()\n\n this.events.listen(mediaQuery, 'change', this.handleMediaQueryChange)\n\n this.initializeElements()\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n\n this.cleanupAutoUpdate?.()\n this.targetElement?.removeAttribute('aria-expanded')\n }\n\n render() {\n return html`\n <div\n class=\"n-popout ${this.computedPosition} is-${this.direction.dir}\"\n aria-hidden=${this.open ? 'false' : 'true'}\n @transitionend=${this.enableScroll}\n >\n <slot></slot>\n </div>\n `\n }\n\n @observe('id')\n protected handleIdChange() {\n // clean up any old listeners\n this.targetElement?.removeEventListener('click', this.toggleOpen)\n\n if (!this.id) {\n console.warn('NORD: popout requires an id attribute and value')\n }\n else {\n this.initializeElements()\n }\n }\n\n private initializeElements() {\n this.targetElement = this.getToggle()\n this.anchorElement = this.getAnchor()\n\n this.events.listen(this.targetElement, 'click', this.toggleOpen)\n }\n\n @observe('open')\n protected handleOpenChange() {\n this.targetElement?.setAttribute('aria-expanded', `${this.open}`)\n\n if (this.open) {\n this.enterTopLayer()\n\n if (this.smallViewport && !this.alwaysFloating) {\n // hide scrollbar and prevent scroll on body\n this.scrollBar.lockScroll()\n }\n else if (this.anchorElement) {\n this.cleanupAutoUpdate = autoUpdate(this.anchorElement, this, this.updatePosition)\n }\n }\n else {\n this.cleanupAutoUpdate?.()\n }\n }\n\n @observe('anchor')\n protected handleAnchorChange() {\n this.cleanupAutoUpdate?.()\n this.anchorElement = this.getAnchor()\n\n // if the popout is already open when the anchor changes, we should update its position\n if (this.open && (!this.smallViewport || this.alwaysFloating) && this.anchorElement) {\n this.cleanupAutoUpdate = autoUpdate(this.anchorElement, this, this.updatePosition)\n }\n }\n\n private enableScroll = () => {\n // scrollbar should only be restored when the backdrop has transitioned\n // that way we avoid awkward double scrollbars.\n if (!this.open) {\n this.scrollBar.unlockScroll()\n this.leaveTopLayer()\n }\n }\n\n /**\n * Place the element in the top layer via the Popover API so that\n * position: fixed works relative to the viewport regardless of\n * container queries or other containing block ancestors.\n */\n private enterTopLayer() {\n if (typeof this.showPopover !== 'function')\n return\n\n try {\n this.setAttribute('popover', 'manual')\n this.showPopover()\n }\n catch {\n this.removeAttribute('popover')\n }\n }\n\n private leaveTopLayer() {\n this.removeAttribute('popover')\n }\n\n /**\n * Get the position of the element toggling the popout\n * and position the popout underneath it, taking into account the optional placement.\n */\n private updatePosition = async () => {\n if (!this.anchorElement) {\n return\n }\n\n const computePositionConfig: ComputePositionConfig = {\n strategy: 'fixed',\n }\n\n if (this.position === 'auto') {\n computePositionConfig.middleware = [\n offset(8),\n autoPlacement({ alignment: this.align, padding: 8 }),\n shift({\n padding: 8,\n }),\n hide(),\n ]\n }\n else {\n computePositionConfig.placement = logicalToPhysical(this.position, this.align, this.direction.dir)\n computePositionConfig.middleware = [\n offset(8),\n flip(),\n shift({\n padding: 8,\n }),\n hide(),\n ]\n }\n\n const { x, y, placement, middlewareData } = await computePosition(this.anchorElement, this, computePositionConfig)\n\n this.computedPosition = placement\n\n // use physical properties here since floating-ui\n // works exclusively in physical dimensions\n // we do all the mapping in logicalToPhysical\n this.style.setProperty('--_n-popout-position-x', `${x}px`)\n this.style.setProperty('--_n-popout-position-y', `${y}px`)\n\n if (middlewareData.hide?.referenceHidden) {\n this.hide()\n }\n }\n\n /**\n * Toggle the popout open or closed using state.\n * Updating the position to underneath the target button before the popout is opened.\n */\n private toggleOpen = (e: Event) => {\n e.preventDefault()\n if (this.open) {\n this.hide(false)\n }\n else if (!this.smallViewport || this.alwaysFloating) {\n this.enterTopLayer()\n this.updatePosition().then(() => this.show())\n }\n else {\n this.show()\n }\n }\n\n private getToggle() {\n const rootNode = this.getRootNode() as Document | ShadowRoot\n const allToggles = rootNode.querySelectorAll<HTMLElement>(`[aria-controls='${this.id}']`)\n\n let toggle = allToggles[0]\n\n // When multiple toggles share the same aria-controls (duplicate IDs on page),\n // pair each toggle with its corresponding popout by document order.\n if (allToggles.length > 1) {\n const index = [...rootNode.querySelectorAll<HTMLElement>(`[id='${this.id}']`)].indexOf(this)\n if (index >= 0 && index < allToggles.length) {\n toggle = allToggles[index]\n }\n }\n\n if (toggle instanceof HTMLSlotElement) {\n return toggle.assignedElements()[0] as HTMLElement\n }\n\n return toggle\n }\n\n private getAnchor() {\n if (!this.anchor) {\n return this.targetElement\n }\n\n const rootNode = this.getRootNode() as Document | ShadowRoot\n const anchor = <HTMLElement>rootNode.querySelector(`#${this.anchor}`)\n\n if (anchor instanceof HTMLSlotElement) {\n return anchor.assignedElements()[0] as HTMLElement\n }\n\n return anchor\n }\n\n /**\n * Update the smallViewport flag to switch between \"sheet\" and \"floating\".\n * autoUpdate is needed when a viewport gets larger and the popout is open.\n */\n private handleMediaQueryChange = () => {\n this.smallViewport = mediaQuery.matches\n\n this.cleanupAutoUpdate?.()\n\n if ((!this.smallViewport || this.alwaysFloating) && this.open && this.anchorElement) {\n this.cleanupAutoUpdate = autoUpdate(this.anchorElement, this, this.updatePosition)\n this.scrollBar.unlockScroll()\n }\n else if (this.open) {\n this.scrollBar.lockScroll()\n }\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-popout': Popout\n }\n}\n","import { html, LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport componentStyle from '../common/styles/Component.css'\nimport style from './Stack.css'\n\n/**\n * Stack component manages layout of immediate children along the\n * vertical or horizontal axis with optional spacing between each child.\n *\n * @status ready\n * @category structure\n * @slot - The stack content.\n *\n * @cssprop [--n-stack-gap=var(--n-space-m)] - Controls the spacing between items, using our [spacing tokens](/tokens/#space).\n */\n@customElement('nord-stack')\nexport default class Stack extends LitElement {\n static styles = [componentStyle, style]\n\n /**\n * The space injected between components.\n */\n @property({ reflect: true }) gap: 'none' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl' = 'm'\n\n /**\n * The direction of the stack.\n */\n @property({ reflect: true }) direction: 'vertical' | 'horizontal' = 'vertical'\n\n /**\n * How to align the child items inside the stack.\n */\n @property({ reflect: true, attribute: 'align-items' }) alignItems?:\n | 'center'\n | 'start'\n | 'end'\n | 'baseline'\n | 'stretch' = 'stretch'\n\n /**\n * Defines whether the Stack items are forced in a single line\n * or can be flowed into multiple lines.\n */\n @property({ reflect: true, type: Boolean }) wrap = false\n\n /**\n * How to justify the child items inside the stack.\n */\n @property({ reflect: true, attribute: 'justify-content' }) justifyContent?:\n | 'center'\n | 'start'\n | 'end'\n | 'space-between'\n | 'space-around'\n | 'space-evenly'\n\n render() {\n return html`<slot></slot>`\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-stack': Stack\n }\n}\n","import type Button from '../button/Button.js'\nimport type Calendar from '../calendar/Calendar.js'\nimport type { DatePredicate } from '../calendar/Calendar.js'\nimport type { DateSelectEvent } from '../calendar/DateSelectEvent.js'\nimport type Popout from '../popout/Popout.js'\nimport type { DateAdapter } from './date-adapter.js'\n\nimport * as calendarIcon from '@nordhealth/icons/lib/assets/interface-calendar.js'\nimport * as closeIcon from '@nordhealth/icons/lib/assets/interface-close-small.js'\nimport { html, LitElement, nothing } from 'lit'\n\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { ref } from 'lit/directives/ref.js'\nimport { isDownwardsSwipe, SwipeController } from '../common/controllers/SwipeController.js'\n\nimport { createDate, DaysOfWeek, parseISODate, printISODate } from '../common/dates.js'\nimport { cond } from '../common/directives/cond.js'\nimport { NordEvent } from '../common/events.js'\nimport { FocusableMixin } from '../common/mixins/FocusableMixin.js'\nimport { FormAssociatedMixin } from '../common/mixins/FormAssociatedMixin.js'\nimport { InputMixin } from '../common/mixins/InputMixin.js'\nimport { ReadonlyMixin } from '../common/mixins/ReadonlyMixin.js'\nimport { SizeMixin } from '../common/mixins/SizeMixin.js'\nimport componentStyle from '../common/styles/Component.css'\n\nimport formFieldStyle from '../common/styles/FormField.css'\nimport textFieldStyle from '../common/styles/TextField.css'\nimport Icon from '../icon/Icon.js'\n\nimport { LocalizeController } from '../localization/LocalizeController.js'\nimport { isoAdapter } from './date-adapter.js'\nimport style from './DatePicker.css'\nimport '../input/Input.js'\nimport '../button/Button.js'\n\nimport '../visually-hidden/VisuallyHidden.js'\nimport '../popout/Popout.js'\nimport '../stack/Stack.js'\nimport '../calendar/Calendar.js'\n\nIcon.registerIcon(calendarIcon)\nIcon.registerIcon(closeIcon)\n\nconst isDateDisabled = () => false\nconst isDateHighlighted = () => false\n\n/**\n *\n * Date Picker allows user to enter a date either through text input,\n * or by choosing a date from the calendar. Please note that the date\n * must be passed in ISO-8601 format: YYYY-MM-DD.\n *\n * @status ready\n * @category form\n *\n * @fires {NordEvent} open - Dispatched when the popout is opened.\n * @fires {NordEvent} close - Dispatched when the popout is closed.\n * @fires {DateSelectEvent} nord-focus-date - Dispatched when the calendar's focused date changes.\n *\n * @localization modalHeading - Heading for the date picker's modal.\n * @localization closeLabel - Accessible label for the close button.\n * @localization buttonLabel - Accessible label for the toggle button that opens the date picker modal.\n * @localization selectedDateMessage - Describes the selected date. This message is appended to the toggle button label when a date is selected.\n * @localization dateOutOfMinBound - Error message shown when the entered date is below the minimum allowed date.\n * @localization dateOutOfMaxBound - Error message shown when the entered date is above the maximum allowed date.\n *\n * @cssprop [--n-label-color=var(--n-color-text)] - Controls the text color of the label, using our [color tokens](/tokens/#color).\n */\n@customElement('nord-date-picker')\nexport default class DatePicker extends SizeMixin(\n FormAssociatedMixin(ReadonlyMixin(InputMixin(FocusableMixin(LitElement)))),\n) {\n static styles = [componentStyle, formFieldStyle, textFieldStyle, style]\n\n @query(`.n-date-picker-toggle`, true) private toggleButton!: Button\n @query(`.n-date-picker-close-button`, true) private closeButton!: HTMLButtonElement\n @query(`nord-calendar`, true) private calendar!: Calendar\n @query(`[role=\"dialog\"]`, true) private popout!: Popout\n\n private swipe = new SwipeController(this, {\n target: () => this.popout,\n matchesGesture: isDownwardsSwipe,\n onSwipeEnd: () => this.hide(),\n })\n\n private localize = new LocalizeController<'nord-date-picker'>(this, {\n onLangChange: () => this.createDateFormatters(),\n })\n\n /**\n * Whilst dateAdapter is used for handling the formatting/parsing dates in the input,\n * these are used to format dates exclusively for the benefit of screen readers.\n *\n * We prefer DateTimeFormat over date.toLocaleDateString, as the former has\n * better performance when formatting large number of dates. See:\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString#Performance\n */\n private dateFormatLong!: Intl.DateTimeFormat\n\n /**\n * Date value. Must be in IS0-8601 format: YYYY-MM-DD.\n */\n @property() value: string = ''\n\n /**\n * Internal validation error message. Set automatically when min/max validation fails.\n * This is a read-only property that's managed by the component.\n */\n @property({ attribute: false }) internalError?: string\n\n get valueAsDate(): Date | undefined {\n return parseISODate(this.value)\n }\n\n /**\n * Get/set the value of the picker as a Date object.\n */\n set valueAsDate(date: Date | undefined) {\n this.value = date ? printISODate(date) : ''\n }\n\n get valueAsNumber(): number {\n return this.valueAsDate?.getTime() ?? Number.NaN\n }\n\n /**\n * Get/set the value of the picker as the number of milliseconds elapsed since the UNIX epoch.\n */\n set valueAsNumber(date: number) {\n this.value = date ? printISODate(new Date(date)) : ''\n }\n\n /**\n * Get the raw value of the input field without date formatting. This is a read-only property.\n */\n @property({ attribute: false }) rawValue?: string\n\n /**\n * Controls whether date picker dialog is open or not.\n */\n @property({ type: Boolean, reflect: true }) open = false\n\n /**\n * Minimum date allowed to be picked. Must be in IS0-8601 format: YYYY-MM-DD.\n * This setting can be used alone or together with the max property.\n */\n @property({ reflect: true }) min?: string\n\n /**\n * Maximum date allowed to be picked. Must be in IS0-8601 format: YYYY-MM-DD.\n * This setting can be used alone or together with the min property.\n */\n @property({ reflect: true }) max?: string\n\n /**\n * The date that is considered today. Must be in IS0-8601 format: YYYY-MM-DD.\n * If not set, the current local date of the user is used.\n */\n @property({ reflect: true }) today?: string\n\n /**\n * Which day is considered first day of the week? `0` for Sunday, `1` for Monday, etc.\n * Default is Monday.\n */\n @property({ reflect: true, attribute: 'first-day-of-week', type: Number }) firstDayOfWeek: DaysOfWeek\n = DaysOfWeek.Monday\n\n /**\n * Date adapter, for custom parsing/formatting.\n * Must be object with a `parse` function which accepts a `string` and returns a `Date`,\n * and a `format` function which accepts a `Date` and returns a `string`.\n * Default is IS0-8601 parsing and formatting.\n */\n @property({ attribute: false }) dateAdapter: DateAdapter = isoAdapter\n\n /**\n * Controls which days are disabled and therefore disallowed.\n * For example, this can be used to disallow selection of weekends.\n */\n @property({ attribute: false }) isDateDisabled: DatePredicate = isDateDisabled\n\n /**\n * Controls which days are highlighted with a small indicator.\n * Returning `false` will not show an indicator.\n * Returning `true` will show the indicator, but without an accessible label. Therefore\n * Returning a string will show the indicator, and use the string as accessible label.\n * It is recommended to return a string rather than `true` whenever possible.\n */\n @property({ attribute: false }) isDateHighlighted: (date: Date) => string | boolean = isDateHighlighted\n\n /**\n * Controls whether the date picker expands to fill the width of its container.\n */\n @property({ reflect: true, type: Boolean }) expand = false\n\n firstUpdated() {\n // Make sure the date picker has a raw value when the value is initially set\n this.rawValue = (<HTMLInputElement | null> this.focusableRef.value)?.value\n }\n\n render() {\n const { valueAsDate } = this\n const formattedDate = valueAsDate ? this.dateAdapter.format(valueAsDate) : ''\n\n return html`\n <nord-input\n class=\"n-date-picker-input\"\n value=${formattedDate}\n label=${ifDefined(this.label)}\n hint=${ifDefined(this.hint)}\n error=${cond(this.error || this.internalError, this.error || this.internalError)}\n placeholder=${ifDefined(this.placeholder)}\n id=${this.inputId}\n size=${this.size}\n ?expand=${this.expand}\n ?disabled=${this.disabled}\n ?required=${this.required}\n ?readonly=${this.readonly}\n ?hint-below=${this.hintBelow}\n ?hide-label=${this.hideLabel}\n ?hide-required=${this.hideRequired}\n disallow-pattern=\"[^0-9./-]\"\n @focus=${this.handleFocus}\n @blur=${this.handleBlur}\n @input=${this.handleInputChange}\n ${ref(this.focusableRef)}\n aria-invalid=${cond(this.error || this.internalError, 'true')}\n aria-describedby=${ifDefined(this.getDescribedBy())}\n >\n ${!this.hintSlot.isEmpty ? html`<slot name=\"hint\" slot=\"hint\"></slot>` : nothing}\n ${!this.labelSlot.isEmpty ? html`<slot name=\"label\" slot=\"label\"></slot>` : nothing}\n <nord-button\n size=${this.size}\n ?disabled=${this.disabled || this.readonly}\n slot=\"end\"\n class=\"n-date-picker-toggle\"\n aria-controls=\"popout\"\n type=\"button\"\n >\n <nord-icon name=\"interface-calendar\"></nord-icon>\n <nord-visually-hidden>\n ${this.localize.term('buttonLabel')}\n ${valueAsDate\n ? html`\n <span>\n , ${this.localize.term('selectedDateMessage')} ${this.dateFormatLong.format(valueAsDate)}\n </span>\n `\n : nothing}\n </nord-visually-hidden>\n </nord-button>\n </nord-input>\n <nord-popout\n id=\"popout\"\n anchor=${this.inputId}\n align=\"end\"\n position=\"block-end\"\n role=\"dialog\"\n aria-modal=\"true\"\n ?open=${this.open}\n @open=${this.handleOpen}\n @close=${this.handleClose}\n aria-labelledby=\"header\"\n >\n <div aria-hidden=\"true\" tabindex=\"0\" @focus=${this.focusLast}></div>\n\n <nord-stack class=\"n-date-picker-header\" direction=\"horizontal\" justify-content=\"space-between\">\n <div class=\"n-date-picker-heading\" id=\"header\">${this.localize.term('modalHeading')}</div>\n <nord-button\n class=\"n-date-picker-close-button\"\n type=\"button\"\n size=\"s\"\n variant=\"plain\"\n @click=${this.handleClose}\n >\n <nord-visually-hidden>${this.localize.term('closeLabel')}</nord-visually-hidden>\n <nord-icon name=\"interface-close-small\"></nord-icon>\n </nord-button>\n </nord-stack>\n\n <nord-calendar\n class=\"n-date-picker-calendar\"\n expand\n value=${this.value}\n min=${ifDefined(this.min)}\n max=${ifDefined(this.max)}\n today=${ifDefined(this.today)}\n .firstDayOfWeek=${this.firstDayOfWeek}\n .isDateDisabled=${this.isDateDisabled}\n .isDateHighlighted=${this.isDateHighlighted}\n @change=${this.handleDaySelect}\n ></nord-calendar>\n\n <div aria-hidden=\"true\" tabindex=\"0\" @focus=${this.focusFirst}></div>\n </nord-popout>\n `\n }\n\n private createDateFormatters() {\n this.dateFormatLong = new Intl.DateTimeFormat(this.localize.resolvedLang, {\n day: 'numeric',\n month: 'long',\n year: 'numeric',\n })\n }\n\n private focusFirst() {\n this.closeButton.focus()\n }\n\n private focusLast() {\n this.calendar.focus({ target: 'day' })\n }\n\n private handleDaySelect = (e: DateSelectEvent) => {\n e.stopPropagation()\n this.setValue(e.date)\n this.hide()\n }\n\n private handleOpen() {\n this.open = true\n this.calendar.focus({ target: 'month' })\n }\n\n private handleClose() {\n this.open = false\n }\n\n private handleBlur = (event: Event) => {\n event.stopPropagation()\n\n // Validate on blur and set internal error\n this.internalError = this.validateDateBounds(this.valueAsDate)\n\n this.dispatchEvent(new NordEvent('blur'))\n }\n\n private handleFocus = (event: Event) => {\n event.stopPropagation()\n this.dispatchEvent(new NordEvent('focus'))\n }\n\n private handleInputChange = (e: Event) => {\n const target = e.target as HTMLInputElement\n\n const parsed = this.dateAdapter.parse(target.value, createDate)\n this.rawValue = (<HTMLInputElement | null> this.focusableRef.value)?.value\n\n if (parsed || target.value === '') {\n this.setValue(parsed)\n }\n }\n\n private setValue(date?: Date) {\n this.value = date ? printISODate(date) : ''\n\n const { valueAsDate } = this\n const formattedDate = valueAsDate ? this.dateAdapter.format(valueAsDate) : ''\n this.rawValue = formattedDate\n\n this.dispatchEvent(new NordEvent('change'))\n }\n\n private validateDateBounds(date: Date | undefined): string | undefined {\n if (!date)\n return undefined\n\n const minDate = parseISODate(this.min || '')\n const maxDate = parseISODate(this.max || '')\n\n if (minDate && date < minDate) {\n return this.localize.term('dateOutOfMinBound', this.min!)\n }\n if (maxDate && date > maxDate) {\n return this.localize.term('dateOutOfMaxBound', this.max!)\n }\n }\n\n /**\n * Hide the date picker programmatically.\n * @param moveFocusToButton A boolean option to move the focus to the original button that opens the popout.\n */\n hide(moveFocusToButton?: boolean) {\n this.popout.hide(moveFocusToButton)\n }\n\n /**\n * Show the date picker programmatically.\n */\n show() {\n this.popout.show()\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-date-picker': DatePicker\n }\n}\n","import { LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { observe } from '../common/decorators/observe.js'\n\nimport componentStyle from '../common/styles/Component.css'\nimport style from './Divider.css'\n\n/**\n * Divider components are used to separate and distinguish sections of\n * content or groups of menu items. Visually, they look like\n * horizontal or vertical lines.\n *\n * @status ready\n * @category structure\n *\n * @cssprop [--n-divider-color=var(--n-color-border)] - Controls the color of the divider, using our [color tokens](/tokens/#color).\n * @cssprop [--n-divider-size=1px] - Controls the size, or thickness, of the divider.\n */\n@customElement('nord-divider')\nexport default class Divider extends LitElement {\n static styles = [componentStyle, style]\n\n /**\n * The direction of the divider.\n */\n @property({ reflect: true }) direction: 'vertical' | 'horizontal' = 'horizontal'\n\n firstUpdated() {\n this.setAttribute('role', 'separator')\n }\n\n @observe('direction')\n private handleDirectionChange() {\n this.setAttribute('aria-orientation', this.direction === 'vertical' ? 'vertical' : 'horizontal')\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-divider': Divider\n }\n}\n","import { html, LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport componentStyle from '../common/styles/Component.css'\nimport style from './Footer.css'\n\n/**\n * The footer is a block of designated space for providing additional information or actions that are positioned below the main content.\n *\n * @status new\n * @category structure\n * @slot - The footer content.\n *\n * @cssprop [--n-footer-padding-inline=var(--n-space-l)] - Controls the inline padding around the footer’s main slot, using [spacing tokens](/tokens/#space).\n * @cssprop [--n-footer-box-shadow=var(--n-box-shadow-header)] - Controls the box shadow of the footer, using [box shadow tokens](/tokens/#box-shadow).\n * @cssprop [--n-footer-background-color=var(--n-color-surface)] - Controls the background color of the footer, using [color tokens](/tokens/#color).\n */\n@customElement('nord-footer')\nexport default class Footer extends LitElement {\n static styles = [componentStyle, style]\n\n /**\n * Controls the size of the footer component.\n */\n @property({ reflect: true }) size: 'm' | 's' = 'm'\n\n render() {\n return html`\n <footer class=\"n-footer\">\n <slot></slot>\n </footer>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-footer': Footer\n }\n}\n","import { html, LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { SlotController } from '../common/controllers/SlotController.js'\n\nimport componentStyle from '../common/styles/Component.css'\n\nimport style from './Drawer.css'\nimport '../footer/Footer.js'\n\n/**\n * Drawer is used to display context-sensitive actions and information.\n * Drawer doesn’t block users from completing their task, like a modal would.\n *\n * @status new\n * @category structure\n * @slot header - Optional slot that holds a header for the drawer.\n * @slot - Default slot.\n * @slot footer - Optional slot that holds footer content for the drawer.\n *\n * @cssprop [--n-drawer-padding=var(--n-space-l)] - Controls the padding around the main area (the default slot), using our [spacing tokens](/tokens/#space).\n */\n@customElement('nord-drawer')\nexport default class Drawer extends LitElement {\n static styles = [componentStyle, style]\n\n private footerSlot = new SlotController(this, 'footer')\n\n /**\n * Controls the padding of the drawer component.\n */\n @property({ reflect: true }) padding: 'm' | 'none' = 'm'\n\n render() {\n return html`\n <div class=\"n-drawer\">\n <slot name=\"header\"></slot>\n\n <div class=\"n-drawer-main\">\n <slot></slot>\n </div>\n\n <nord-footer ?hidden=${this.footerSlot.isEmpty}>\n <slot name=${this.footerSlot.slotName}></slot>\n </nord-footer>\n </div>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-drawer': Drawer\n }\n}\n","import { html, LitElement, nothing } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport componentStyle from '../common/styles/Component.css'\nimport style from './DropdownGroup.css'\n\n/**\n * Dropdown group includes all the actions or items in a single dropdown\n * group and is used for grouping items into related categories.\n *\n * @status ready\n * @category action\n * @slot - The dropdown group content.\n */\n@customElement('nord-dropdown-group')\nexport default class DropdownGroup extends LitElement {\n static styles = [componentStyle, style]\n\n /**\n * Heading and accessible label for the dropdown group.\n */\n @property({ reflect: true }) heading?: string\n\n render() {\n return html`\n <div class=\"n-dropdown-group\">\n ${this.heading\n ? html`<p id=\"heading\" aria-hidden=\"true\" class=\"n-dropdown-group-heading\">${this.heading}</p>`\n : nothing}\n <div class=\"n-dropdown-group-content\" role=\"group\" aria-labelledby=${this.heading ? 'heading' : nothing}>\n <slot></slot>\n </div>\n </div>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-dropdown-group': DropdownGroup\n }\n}\n","import type { TemplateResult } from 'lit'\nimport { html, LitElement, nothing } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { ref } from 'lit/directives/ref.js'\nimport { SlotController } from '../common/controllers/SlotController.js'\nimport { cond } from '../common/directives/cond.js'\nimport { FocusableMixin } from '../common/mixins/FocusableMixin.js'\n\nimport componentStyle from '../common/styles/Component.css'\nimport style from './DropdownItem.css'\n\n/**\n * Dropdown item populates dropdown with actions. Items can be\n * placed either inside a dropdown group or directly inside a\n * dropdown component.\n *\n * @status ready\n * @category action\n * @slot - The dropdown item content.\n * @slot start - Used to place content before dropdown item text. Typically used for icons.\n * @slot end - Used to place content after dropdown item text. Typically used for icons.\n *\n * @cssprop [--n-dropdown-item-background-color=transparent] - Controls the background color of the item, using our [color tokens](/tokens/#color).\n * @cssprop [--n-dropdown-item-color=var(--n-color-text)] - Controls the color of the text within the item, using our [color tokens](/tokens/#color).\n */\n@customElement('nord-dropdown-item')\nexport default class DropdownItem extends FocusableMixin(LitElement) {\n static styles = [componentStyle, style]\n\n private endSlot = new SlotController(this, 'end')\n\n /**\n * The url the dropdown item should link to.\n */\n @property({ reflect: true }) href?: string\n\n /**\n * When provided together with a href property, determines where\n * to open the linked URL. The keywords have special meanings for\n * where to load the URL: “_self” means the current browsing context,\n * “_blank” usually a new tab but users can configure browsers this to\n * open a new window instead, “_parent” means the parent browsing\n * context of the current one, but if no parent exists, behaves as\n * _self, and finally “top” means the topmost browsing context.\n */\n @property() target: '_self' | '_blank' | '_parent' | '_top' = '_self'\n\n /**\n * Makes the component disabled. This prevents users from\n * being able to interact with the component, and conveys\n * its inactive state to assistive technologies.\n */\n @property({ type: Boolean, reflect: true }) disabled = false\n\n render() {\n const innards = html`\n <slot name=\"start\"></slot>\n <div class=\"n-content\"><slot></slot></div>\n <slot name=\"end\" ?hidden=${this.endSlot.isEmpty}></slot>\n `\n\n return this.href ? this.renderLink(innards) : this.renderButton(innards)\n }\n\n /**\n * We jump through some hoops here to ensure the link is treated correctly when \"disabled\".\n * Links cannot be disabled natively, so we need to rely on some aria magic to get the correct semantics.\n * Along with the advice in the article below, we also set tabindex to \"-1\", so it is taken out of tab order.\n *\n * @see https://www.scottohara.me/blog/2021/05/28/disabled-links.html\n */\n private renderLink(innards: TemplateResult) {\n return html`\n <a\n ${ref(this.focusableRef)}\n class=\"n-dropdown-item\"\n target=${this.target}\n href=${cond(this.disabled, nothing, this.href)}\n tabindex=${cond(this.disabled, '-1')}\n aria-disabled=${cond(this.disabled, 'true')}\n role=${cond(this.disabled, 'link')}\n >${innards}\n </a>\n `\n }\n\n private renderButton(innards: TemplateResult) {\n return html`\n <button ${ref(this.focusableRef)} class=\"n-dropdown-item\" ?disabled=${this.disabled}>${innards}</button>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-dropdown-item': DropdownItem\n }\n}\n","import type Dropdown from '../dropdown/Dropdown.js'\nimport type Popout from '../popout/Popout.js'\nimport { html, LitElement } from 'lit'\nimport { customElement, query, state } from 'lit/decorators.js'\nimport { classMap } from 'lit/directives/class-map.js'\nimport { EventController } from '../common/controllers/EventController.js'\nimport componentStyle from '../common/styles/Component.css'\nimport style from './DropdownSubmenu.css'\nimport '../popout/Popout.js'\n\nlet popoutCounter = 0\n\n/**\n * Dropdown submenu nests a secondary menu within a parent dropdown.\n * The trigger slot contains the item that opens the submenu, and the default slot contains the submenu items.\n *\n * Supports both hover (non-touch) and click (touch-devices/accessibility) interactions.\n *\n * On small screens, uses mobile stack navigation: tapping a submenu trigger replaces the\n * dropdown's visible content with the submenu's items and shows a back button.\n *\n * @status ready\n * @category action\n *\n * @slot trigger - The element that opens the submenu (typically nord-dropdown-item).\n * @slot - The submenu content items.\n *\n * @fires {NordEvent} open - Forwarded from the internal nord-popout.\n * @fires {NordEvent} close - Forwarded from the internal nord-popout.\n * @fires {CustomEvent} nord-submenu-navigate - Fired when mobile stack navigation activates this submenu.\n */\n@customElement('nord-dropdown-submenu')\nexport default class DropdownSubmenu extends LitElement {\n static styles = [componentStyle, style]\n\n @query('nord-popout')\n private popout?: Popout\n\n /** @internal */\n @state() private mobileActive = false\n\n private readonly popoutId = `nord-dropdown-submenu-popout-${++popoutCounter}`\n private events = new EventController(this)\n private currentTriggerElement: HTMLElement | null = null\n private popoutOpen = false\n private readonly mobileMediaQuery = window.matchMedia('(max-width: 35.9375em)')\n @state() private isSmallScreen = this.mobileMediaQuery.matches\n @state() private parentDropdownAlwaysFloating = false\n private parentObserver?: MutationObserver\n\n private get shouldUseMobileStack(): boolean {\n return this.isSmallScreen && !this.parentDropdownAlwaysFloating\n }\n\n private get parentDropdown(): Dropdown | null {\n return this.closest<Dropdown>('nord-dropdown')\n }\n\n private get isInSubmenuStack(): boolean {\n const parent = this.parentDropdown\n if (!parent)\n return false\n return parent.submenuStackRef.includes(this)\n }\n\n private get isDeepestInStack(): boolean {\n const parent = this.parentDropdown\n if (!parent)\n return false\n return parent.deepestSubmenu === this\n }\n\n connectedCallback() {\n super.connectedCallback()\n\n // Set aria-haspopup on trigger before first render\n const triggerElement = this.querySelector<HTMLElement>('[slot=\"trigger\"]')\n triggerElement?.setAttribute('aria-haspopup', 'menu')\n\n // Read alwaysFloating from parent dropdown\n const parentDropdown = this.closest<Dropdown>('nord-dropdown')\n if (parentDropdown) {\n this.parentDropdownAlwaysFloating = parentDropdown.alwaysFloating\n // Close this submenu when a sibling regular item is hovered\n this.events.listen(parentDropdown, 'mouseover', this.handleParentDropdownMouseOver)\n\n // Observe always-floating attribute on parent dropdown for reactivity\n this.parentObserver = new MutationObserver((mutations) => {\n for (const mutation of mutations) {\n if (mutation.attributeName === 'always-floating') {\n this.parentDropdownAlwaysFloating = parentDropdown.alwaysFloating\n }\n }\n })\n this.parentObserver.observe(parentDropdown, {\n attributes: true,\n attributeFilter: ['always-floating'],\n })\n }\n\n // Listen for screen size changes (use correct breakpoint)\n this.events.listen(this.mobileMediaQuery, 'change', (event: MediaQueryListEvent) => {\n this.isSmallScreen = event.matches\n this.requestUpdate()\n })\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n this.parentObserver?.disconnect()\n }\n\n render() {\n // Mobile stack navigation: show content inline when active\n if (this.shouldUseMobileStack && this.mobileActive) {\n // Add active class for any submenu in the stack, and is-deepest-active for the deepest one\n return html`\n <slot name=\"trigger\"></slot>\n <div class=${classMap({\n 'n-dropdown-submenu-content': true,\n 'active': this.isInSubmenuStack,\n 'is-deepest-active': this.isDeepestInStack,\n })} @keydown=${this.handleContentKeydown}>\n <slot></slot>\n </div>\n `\n }\n\n // Desktop/always-floating mode: show popout\n return html`\n <slot\n name=\"trigger\"\n aria-controls=${this.popoutId}\n @slotchange=${this.handleTriggerSlotChange}\n ></slot>\n <nord-popout\n id=${this.popoutId}\n position=\"inline-end\"\n always-floating\n @open=${this.handlePopoutOpen}\n @close=${this.handlePopoutClose}\n >\n <div\n class=\"n-dropdown-submenu-content\"\n @keydown=${this.handleContentKeydown}\n >\n <slot></slot>\n </div>\n </nord-popout>\n `\n }\n\n private handleTriggerSlotChange() {\n const slot = this.shadowRoot?.querySelector<HTMLSlotElement>('slot[name=\"trigger\"]')\n const triggerElement = slot?.assignedElements()[0] as HTMLElement | undefined\n\n // Remove listeners from previous trigger element\n if (this.currentTriggerElement && this.currentTriggerElement !== triggerElement) {\n this.currentTriggerElement.removeEventListener('mouseenter', this.handleTriggerMouseEnter)\n this.currentTriggerElement.removeEventListener('click', this.handleTriggerClick)\n this.currentTriggerElement.removeEventListener('keydown', this.handleTriggerKeydown)\n }\n\n this.currentTriggerElement = triggerElement ?? null\n\n if (!triggerElement)\n return\n\n triggerElement.setAttribute('aria-haspopup', 'menu')\n\n const isTouchDevice = !window.matchMedia('(hover: hover)').matches\n\n // Non-touch devices: hover to open\n this.events.listen(triggerElement, 'mouseenter', this.handleTriggerMouseEnter)\n // Non-touch devices or small screens: click to navigate/open\n if (!isTouchDevice || this.isSmallScreen) {\n this.events.listen(triggerElement, 'click', this.handleTriggerClick)\n }\n // Keyboard: arrow keys for navigation\n this.events.listen(triggerElement, 'keydown', this.handleTriggerKeydown)\n }\n\n private handleTriggerMouseEnter = () => {\n // On mobile, don't open popout on hover — only on click\n if (this.shouldUseMobileStack)\n return\n\n this.closeOtherSubmenus()\n this.popout?.show()\n }\n\n private handleTriggerClick = (event: MouseEvent) => {\n event.preventDefault()\n event.stopImmediatePropagation()\n\n if (this.shouldUseMobileStack) {\n this.navigateIntoSubmenu()\n return\n }\n\n this.closeOtherSubmenus()\n this.popout?.show()\n }\n\n private handleTriggerKeydown = (event: KeyboardEvent) => {\n if (event.key === 'ArrowRight' || event.key === 'Enter') {\n event.preventDefault()\n\n if (this.shouldUseMobileStack) {\n this.navigateIntoSubmenu()\n return\n }\n\n this.closeOtherSubmenus()\n this.popout?.show()\n this.updateComplete.then(() => {\n this.querySelector<HTMLElement>('nord-dropdown-item')?.focus()\n })\n }\n }\n\n private handleContentKeydown = (event: KeyboardEvent) => {\n if (event.key === 'ArrowLeft') {\n event.preventDefault()\n event.stopPropagation()\n\n if (this.shouldUseMobileStack && this.mobileActive) {\n this.closest<Dropdown>('nord-dropdown')?.navigateBack()\n return\n }\n\n this.popout?.hide(true)\n }\n }\n\n private handlePopoutOpen = () => {\n this.popoutOpen = true\n this.closeOtherSubmenus()\n }\n\n private handlePopoutClose = (event: Event) => {\n event.stopPropagation()\n this.popoutOpen = false\n }\n\n private handleParentDropdownMouseOver = (event: MouseEvent) => {\n // Don't close on mouseover during mobile stack navigation\n if (this.shouldUseMobileStack)\n return\n\n const target = event.target as HTMLElement\n const isRegularDropdownItem = target.tagName === 'NORD-DROPDOWN-ITEM' && !this.contains(target)\n if (isRegularDropdownItem && this.popoutOpen) {\n event.stopImmediatePropagation()\n this.popout?.hide()\n }\n }\n\n private closeOtherSubmenus() {\n // Don't close siblings during mobile stack navigation\n if (this.shouldUseMobileStack)\n return\n\n // Find the immediate parent container (dropdown or submenu)\n const immediateParent = this.parentElement?.closest('nord-dropdown, nord-dropdown-submenu')\n if (!immediateParent)\n return\n\n // Close only siblings at the same level\n Array.from(\n immediateParent.querySelectorAll<DropdownSubmenu>(':scope > nord-dropdown-submenu'),\n ).forEach((sibling) => {\n if (sibling !== this)\n sibling.close()\n })\n }\n\n /**\n * Deactivate mobile stack navigation (remove from stack).\n * @internal\n */\n deactivateMobile() {\n this.mobileActive = false\n\n // NATIVELY REMOVE THE ATTRIBUTE FROM THE HOST\n this.removeAttribute('mobile-active')\n\n // Clear aria-expanded that may have been set by Popout during hover\n const triggerSlot = this.shadowRoot?.querySelector<HTMLSlotElement>('slot[name=\"trigger\"]')\n const triggerElement = triggerSlot?.assignedElements()[0] as HTMLElement | undefined\n triggerElement?.removeAttribute('aria-expanded')\n }\n\n /**\n * Read trigger text for back button title in Dropdown.\n * @internal\n */\n get label(): string {\n const triggerSlot = this.shadowRoot?.querySelector<HTMLSlotElement>('slot[name=\"trigger\"]')\n return triggerSlot?.assignedElements()[0]?.textContent?.trim() ?? ''\n }\n\n /**\n * Close the submenu programmatically.\n * Returns a promise that resolves when the close animation completes.\n */\n close(): Promise<TransitionEvent | void> {\n if (this.mobileActive) {\n this.deactivateMobile()\n return Promise.resolve()\n }\n\n if (!this.popout) {\n return Promise.reject(new Error('DropdownSubmenu: popout component not found or not ready'))\n }\n return this.popout.hide()\n }\n\n /**\n * Navigate into this submenu using mobile stack navigation.\n * @internal\n */\n private navigateIntoSubmenu() {\n this.mobileActive = true\n this.setAttribute('mobile-active', '')\n this.dispatchEvent(\n new CustomEvent('nord-submenu-navigate', { bubbles: true, detail: { submenu: this } }),\n )\n this.updateComplete.then(() => {\n // Focus on first submenu item (not back button in header)\n const contentDiv = this.querySelector('.n-dropdown-submenu-content')\n const firstItem = contentDiv?.querySelector<HTMLElement>('nord-dropdown-item')\n firstItem?.focus()\n })\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-dropdown-submenu': DropdownSubmenu\n }\n}\n","import type DropdownSubmenu from '../dropdown-submenu/DropdownSubmenu.js'\nimport type Popout from '../popout/Popout.js'\nimport { html, LitElement } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { SlotController } from '../common/controllers/SlotController.js'\nimport { observe } from '../common/decorators/observe.js'\n\nimport { FloatingMixin } from '../common/mixins/FloatingComponentMixin.js'\nimport componentStyle from '../common/styles/Component.css'\n\nimport style from './Dropdown.css'\nimport '../popout/Popout.js'\nimport '../icon/Icon.js'\nimport '../dropdown-item/DropdownItem.js'\n\n/**\n * Dropdown menu displays a list of actions or selectable options for\n * a user. Dropdown uses popout component internally to create\n * the overlay functionality.\n *\n * @status ready\n * @category action\n *\n * @slot - The dropdown content.\n * @slot toggle - Used to place the toggle for dropdown.\n * @slot header - Optional slot that holds a header for the dropdown.\n * @slot header-end - Optional slot that positions content at the end of the header. Useful for actions or additional info.\n *\n * @fires {NordEvent} open - Dispatched when the popout is opened.\n * @fires {NordEvent} close - Dispatched when the popout is closed.\n *\n * @cssprop [--n-dropdown-size=250px] - Controls the inline size, or width, of the dropdown. Will resize up to 1.5 times to account for larger content.\n * @cssprop [--n-dropdown-max-block-size=460px] - Controls the maximum block size, or height, of the dropdown. Larger content will get a scrollbar.\n */\n@customElement('nord-dropdown')\nexport default class Dropdown extends FloatingMixin(LitElement) {\n static styles = [componentStyle, style]\n\n /**\n * we delegate focus, to ensure focus does not move to body if you click\n * some whitespace or a dropdown-group heading, as this would close the dropdown\n * @internal\n */\n static shadowRootOptions = { ...LitElement.shadowRootOptions, delegatesFocus: true }\n\n private headerSlot = new SlotController(this, 'header')\n private headerEndSlot = new SlotController(this, 'header-end')\n\n @query('.n-dropdown-content') private list!: HTMLElement\n @query('nord-popout', true) private popout!: Popout\n\n @state() private submenuStack: DropdownSubmenu[] = []\n private isNavigating = false\n\n private get isShowingSubmenu(): boolean {\n return this.submenuStack.length > 0\n }\n\n /**\n * @internal\n */\n get submenuStackRef(): readonly DropdownSubmenu[] {\n return this.submenuStack\n }\n\n /**\n * @internal\n */\n get deepestSubmenu(): DropdownSubmenu | undefined {\n return this.submenuStack[this.submenuStack.length - 1]\n }\n\n /**\n * Controls whether the toggle slot expands to fill the width of its container.\n */\n @property({ reflect: true, type: Boolean }) expand = false\n\n /**\n * The size of the dropdown. This affects the minimum and maximum inline-size\n * of the dropdown.\n */\n @property({ reflect: true }) size: 's' | 'm' | 'l' = 'm'\n\n /**\n * Set to true to always display the dropdown as a floating overlay, even on smaller viewports.\n */\n @property({ reflect: true, type: Boolean, attribute: 'always-floating' })\n alwaysFloating: boolean = false\n\n @observe('alwaysFloating')\n protected handleAlwaysFloatingChange() {\n if (this.open) {\n this.open = false\n this.updateComplete.then(() => {\n this.open = true\n })\n }\n }\n\n connectedCallback() {\n super.connectedCallback()\n\n const toggle = this.querySelector(`[slot=\"toggle\"]`)\n toggle?.setAttribute('aria-haspopup', 'true')\n }\n\n render() {\n const activeSubmenu = this.submenuStack[this.submenuStack.length - 1]\n\n return html`\n <div class=\"n-dropdown\" @nord-submenu-navigate=${this.handleSubmenuNavigate} @focusout=${this.handleBlur}>\n <slot name=\"toggle\" aria-controls=\"popout\"></slot>\n <nord-popout\n id=\"popout\"\n align=${ifDefined(this.align)}\n position=${ifDefined(this.position)}\n ?open=${this.open}\n ?always-floating=${this.alwaysFloating}\n @open=${this.handleOpen}\n @close=${this.handleClose}\n >\n ${\n this.isShowingSubmenu\n ? html`\n <div class=\"n-dropdown-header is-navigation-header\">\n <nord-dropdown-item @click=${this.handleBackClick} class=\"n-dropdown-back-item\">\n <nord-icon slot=\"start\" name=\"arrow-left\" size=\"s\"></nord-icon>\n ${activeSubmenu?.label ?? ''}\n </nord-dropdown-item>\n </div>\n `\n : html`\n <div class=\"n-dropdown-header\" ?hidden=${this.headerSlot.isEmpty && this.headerEndSlot.isEmpty}>\n <slot name=${this.headerSlot.slotName}></slot>\n <slot name=${this.headerEndSlot.slotName}></slot>\n </div>\n `\n }\n <div class=\"n-dropdown-content ${this.isShowingSubmenu ? 'is-submenu-active' : ''}\">\n <slot></slot>\n </div>\n </nord-popout>\n </div>\n `\n }\n\n private handleBlur(e: FocusEvent) {\n const relatedTarget = e.relatedTarget as HTMLElement\n\n // Don't close during navigation or if we're still showing a submenu\n // (the blur event fires after back button is removed from DOM, but we're still in submenu mode)\n if (this.isNavigating || this.isShowingSubmenu)\n return\n\n // Safari will set relatedTarget to null when clicking on the trigger button\n // because it doesn't focus buttons on click.\n // this caused weird behavior where the dropdown closed _and_ opened with a single click.\n // so we only run this logic if relatedTarget is set, which sidesteps this issue\n if (!relatedTarget) {\n return\n }\n\n // Close dropdown if focus moved outside\n if (!this.contains(relatedTarget)) {\n this.popout.hide(false)\n }\n }\n\n private handleOpen() {\n this.open = true\n }\n\n private handleBackClick(event: MouseEvent) {\n event.preventDefault()\n event.stopPropagation()\n\n this.isNavigating = true\n this.navigateBack()\n\n // Reset navigation flag after updates complete\n this.updateComplete.then(() => {\n this.isNavigating = false\n // Focus the trigger of the submenu we're returning to, or the first item\n const newTop = this.submenuStack[this.submenuStack.length - 1]\n const focusTarget = newTop\n ? newTop.querySelector<HTMLElement>('[slot=\"trigger\"]')\n : this.querySelector<HTMLElement>('nord-dropdown-item')\n focusTarget?.focus()\n })\n }\n\n private handleClose(e: Event) {\n // Don't close during navigation\n if (this.isNavigating)\n return\n\n // Clear submenu stack on close\n this.clearSubmenuStack()\n\n // Ignore close events from child popouts (submenus)\n // The event target will be a nord-popout element that is a child of this dropdown\n const eventTarget = e.target as HTMLElement\n const isChildPopout = eventTarget?.tagName === 'NORD-POPOUT' && this.contains(eventTarget)\n\n if (isChildPopout) {\n return\n }\n\n this.open = false\n }\n\n @observe('open', 'updated')\n protected handleOpenChange() {\n if (this.open) {\n const focusTarget\n = this.querySelector<HTMLElement>('[autofocus]')\n ?? this.querySelector<HTMLElement>('nord-dropdown-item, nord-message')\n\n focusTarget?.focus()\n this.list.scrollTop = 0\n }\n else if (!this.isNavigating) {\n // Clear submenu stack when dropdown closes (but not during navigation)\n this.clearSubmenuStack()\n }\n }\n\n /**\n * Navigate back one level in the submenu stack.\n * @internal\n */\n navigateBack() {\n if (this.submenuStack.length === 0)\n return\n\n const topSubmenu = this.submenuStack[this.submenuStack.length - 1]\n topSubmenu.deactivateMobile()\n // Trigger re-render so it loses active and is-deepest-active classes\n topSubmenu.requestUpdate()\n\n const newTop = this.submenuStack[this.submenuStack.length - 2]\n if (newTop) {\n newTop.removeAttribute('has-active-child')\n // Trigger re-render so it gains is-deepest-active class back\n newTop.requestUpdate()\n }\n\n this.submenuStack = this.submenuStack.slice(0, -1)\n }\n\n /**\n * Clear the entire submenu stack.\n * @internal\n */\n private clearSubmenuStack() {\n for (const submenu of this.submenuStack) {\n submenu.deactivateMobile()\n submenu.removeAttribute('has-active-child')\n }\n this.submenuStack = []\n }\n\n /**\n * Handle submenu navigation event.\n * @internal\n */\n private handleSubmenuNavigate(event: Event) {\n const customEvent = event as CustomEvent<{ submenu: DropdownSubmenu }>\n customEvent.stopPropagation()\n\n const previousDeepest = this.submenuStack[this.submenuStack.length - 1]\n if (previousDeepest) {\n previousDeepest.setAttribute('has-active-child', '')\n // Trigger re-render so it loses is-deepest-active class\n previousDeepest.requestUpdate()\n }\n\n const newSubmenu = customEvent.detail.submenu\n this.submenuStack = [...this.submenuStack, newSubmenu]\n\n // Trigger re-render of new deepest so it gains is-deepest-active class\n this.updateComplete.then(() => {\n newSubmenu.requestUpdate()\n })\n }\n\n /**\n * Hide the dropdown programmatically.\n * This method delegates to the Dropdown's internal Popout component.\n * See [Popout's hide() method](/components/popout#methods-hide) for more details.\n * @param moveFocusToButton A boolean option to move the focus to the original button that opens the dropdown.\n */\n hide(moveFocusToButton?: boolean): Promise<TransitionEvent | void> {\n return this.popout.hide(moveFocusToButton)\n }\n\n /**\n * Show the dropdown programmatically.\n * This method delegates to the Dropdown's internal Popout component.\n * See [Popout's show() method](/components/popout#methods-hide) for more details.\n */\n show(): Promise<TransitionEvent | void> {\n return this.popout.show()\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-dropdown': Dropdown\n }\n}\n","import { html, LitElement } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\nimport componentStyle from '../common/styles/Component.css'\nimport style from './EmptyState.css'\n\n/**\n * Empty state can be used when there is no data to display to\n * describe what the user can do next. Empty state provides\n * explanation and guidance to help user progress.\n *\n * @status ready\n * @category feedback\n * @slot - default slot\n */\n@customElement('nord-empty-state')\nexport default class EmptyState extends LitElement {\n static styles = [componentStyle, style]\n\n render() {\n return html`<div class=\"n-empty-state\">\n <slot></slot>\n </div>`\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-empty-state': EmptyState\n }\n}\n","import { html, LitElement, nothing } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { SlotController } from '../common/controllers/SlotController.js'\nimport { cond } from '../common/directives/cond.js'\n\nimport componentStyle from '../common/styles/Component.css'\nimport formFieldStyle from '../common/styles/FormField.css'\nimport style from './Fieldset.css'\n\n/**\n * Fieldset is used for grouping sets of input components.\n * It is necessary to use a fieldset with radio and checkbox components.\n * It can also be useful for logically grouping other types of inputs.\n *\n * @status ready\n * @category form\n * @slot label - Use when a label requires more than plain text.\n * @slot hint - Optional slot that holds hint text for the fieldset.\n * @slot error - Optional slot that holds error text for the fieldset.\n *\n * @cssprop [--n-label-color=var(--n-color-text)] - Controls the text color of the label, using our [color tokens](/tokens/#color).\n */\n@customElement('nord-fieldset')\nexport default class Fieldset extends LitElement {\n static styles = [componentStyle, formFieldStyle, style]\n\n private errorSlot = new SlotController(this, 'error')\n private hintSlot = new SlotController(this, 'hint')\n private errorId = 'error'\n private hintId = 'hint'\n\n /**\n * Label for the fieldset. Rendered as a `<legend>` element.\n */\n @property({ reflect: true }) label: string = ''\n\n /**\n * Optional hint text to be displayed with the input. Alternatively use the hint slot.\n */\n @property({ reflect: true }) hint?: string\n\n /**\n * Renders the hint below the grouped controls and any error instead of below the legend.\n */\n @property({ reflect: true, type: Boolean, attribute: 'hint-below' }) hintBelow = false\n\n /**\n * Optional error to be shown with the fieldset. Alternatively use the error slot.\n */\n @property({ reflect: true }) error?: string\n\n /**\n * Determines whether the fieldset is required or not.\n * A fieldset marked as required will be announced as such to users of assistive technology.\n * When using this property you need to also set “novalidate” attribute on a form element to prevent browser from displaying its own validation errors.\n */\n @property({ reflect: true, type: Boolean }) required = false\n\n /**\n * Visually hide the required indicator, but still show\n * required attribute to assistive technologies like screen readers.\n */\n @property({ reflect: true, type: Boolean, attribute: 'hide-required' }) hideRequired = false\n\n /**\n * Visually hide the label, but still show it to assistive technologies like screen readers.\n */\n @property({ reflect: true, type: Boolean, attribute: 'hide-label' }) hideLabel = false\n\n /**\n * The size of the label.\n */\n @property({ reflect: true }) size: 's' | 'm' = 'm'\n\n render() {\n const { hasError } = this\n\n return html`\n <fieldset\n aria-invalid=${cond(hasError, 'true')}\n aria-describedby=${cond(this.getDescribedBy())}\n aria-required=${cond(this.required, 'true')}\n >\n <legend class=\"n-label-container ${this.hideLabel ? 'n-hidden' : ''}\">\n <div class=\"n-label\">\n <slot name=\"label\">${this.label}</slot\n ><span aria-hidden=\"true\" class=\"n-required\" ?hidden=${!this.required || this.hideRequired}>*</span>\n </div>\n\n ${this.isHintBelow ? nothing : this.renderHint()}\n </legend>\n\n <slot></slot>\n\n <div class=\"n-caption n-error\" id=${this.errorId} role=\"alert\" ?hidden=${!this.hasError}>\n <slot name=\"error\">${this.error}</slot>\n </div>\n ${this.isHintBelow ? this.renderHint() : nothing}\n </fieldset>\n `\n }\n\n private renderHint() {\n return html`\n <div class=\"n-caption n-hint\" id=${this.hintId} ?hidden=${!this.hasHint}>\n <slot name=\"hint\">${this.hint}</slot>\n </div>\n `\n }\n\n private getDescribedBy() {\n if (!this.isHintBelow) {\n return this.hasError ? this.errorId : undefined\n }\n\n if (this.hasHint && this.hasError) {\n return `${this.errorId} ${this.hintId}`\n }\n\n if (this.hasError) {\n return this.errorId\n }\n\n if (this.hasHint) {\n return this.hintId\n }\n\n return undefined\n }\n\n protected get hasHint() {\n return Boolean(this.hint) || this.hintSlot.hasContent\n }\n\n protected get hasError() {\n return Boolean(this.error) || this.errorSlot.hasContent\n }\n\n private get isHintBelow() {\n return this.hintBelow\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-fieldset': Fieldset\n }\n}\n","import { html, LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { SlotController } from '../common/controllers/SlotController.js'\nimport componentStyle from '../common/styles/Component.css'\nimport style from './Header.css'\n\n/**\n * The header is a block of designated space for labelling the currently\n * viewed context as well as providing primary actions.\n *\n * @status ready\n * @category structure\n * @slot - The header content.\n * @slot end - Optional slot for buttons, toggles, etc.\n *\n * @cssprop [--n-header-background-color=var(--n-color-surface)] - Background color of the header.\n */\n@customElement('nord-header')\nexport default class Header extends LitElement {\n static styles = [componentStyle, style]\n\n private endSlot = new SlotController(this, 'end')\n\n /**\n * Controls the size of the header component.\n */\n @property({ reflect: true }) size: 'm' | 's' = 'm'\n\n render() {\n return html`\n <header class=\"n-header\">\n <slot></slot>\n <div class=\"n-header-end\" ?hidden=${this.endSlot.isEmpty}>\n <slot name=\"end\"></slot>\n </div>\n </header>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-header': Header\n }\n}\n","export default '<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m19.7188 10.71-8 8-1.41-1.41 7.29-7.29-7.3-7.29996 1.41-1.41 8 8c.39.39.39 1.01996 0 1.40996zm-8-1.40996-7.99997-8.01-1.41 1.41 7.29 7.29-7.3 7.29996 1.41 1.41 8.00997-7.99c.39-.39.39-1.01996 0-1.40996z\" fill=\"currentColor\"/></svg>';\nexport const title = \"navigation-toggle-lock\";\nexport const tags =\n \"nordicon navigation hamburger menu toggle navigation arrow right double lock triangle chevron\";\n","import type { ReactiveController, ReactiveControllerHost } from 'lit'\n\ninterface Options<T> {\n channelName: string\n onMessage: (message: T) => void\n enabled?: () => boolean\n}\n\nconst defaultEnabled = () => true\n\nexport class BroadcastChannelController<T> implements ReactiveController {\n private channel?: BroadcastChannel\n private options: Required<Options<T>>\n\n constructor(host: ReactiveControllerHost, options: Options<T>) {\n host.addController(this)\n this.options = { enabled: defaultEnabled, ...options }\n }\n\n hostConnected(): void {\n if (typeof BroadcastChannel !== 'undefined') {\n this.channel = new BroadcastChannel(this.options.channelName)\n this.channel.addEventListener('message', this)\n }\n }\n\n hostDisconnected(): void {\n this.channel?.removeEventListener('message', this)\n this.channel?.close()\n }\n\n handleEvent(event: MessageEvent<T>) {\n if (this.options.enabled()) {\n this.options.onMessage(event.data)\n }\n }\n\n post(message: T) {\n if (this.options.enabled()) {\n this.channel?.postMessage(message)\n }\n }\n}\n","/**\n * Thin wrapper around local storage which simplifies (de)serialization and default values.\n * By default, (de)serializes as JSON.\n */\nexport function storage<T>(\n key: string,\n defaultValue: T,\n serialize: (value: T) => string = JSON.stringify,\n deserialize: (value: string) => T = JSON.parse,\n) {\n return {\n get value(): T {\n try {\n const value = localStorage.getItem(key)\n return value ? deserialize(value) : defaultValue\n }\n catch {\n return defaultValue\n }\n },\n\n set value(value: T) {\n try {\n localStorage.setItem(key, serialize(value))\n }\n catch {\n // nothing we can do here\n }\n },\n }\n}\n","export default '<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m18.9988 3v2h-16.00002v-2zm-16.00002 8h16.00002v-2h-16.00002zm0 6h16.00002v-2h-16.00002z\" fill=\"currentColor\"/></svg>';\nexport const title = \"navigation-toggle\";\nexport const tags =\n \"nordicon navigation hamburger menu toggle navigation three lines\";\n","import * as lockIcon from '@nordhealth/icons/lib/assets/navigation-toggle-lock.js'\nimport * as unlockIcon from '@nordhealth/icons/lib/assets/navigation-toggle.js'\nimport { html, LitElement } from 'lit'\nimport { customElement } from 'lit/decorators.js'\nimport { classMap } from 'lit/directives/class-map.js'\nimport { ref } from 'lit/directives/ref.js'\n\nimport { DirectionController } from '../common/controllers/DirectionController.js'\nimport { FocusableMixin } from '../common/mixins/FocusableMixin.js'\nimport componentStyle from '../common/styles/Component.css'\n\nimport Icon from '../icon/Icon.js'\nimport { LocalizeController } from '../localization/LocalizeController.js'\nimport style from './NavToggle.css'\n\nimport '../button/Button.js'\nimport '../visually-hidden/VisuallyHidden.js'\n\nIcon.registerIcon(unlockIcon)\nIcon.registerIcon(lockIcon)\n\n/**\n * Nav toggle is meant for hiding and showing the primary navigation.\n * This component is used internally in the Layout component, but can also be\n * used separate to further customize the behavior.\n *\n * @status ready\n * @category action\n *\n * @localization label - Accessible label for the nav toggle button.\n */\n@customElement('nord-nav-toggle')\nexport default class NavToggle extends FocusableMixin(LitElement) {\n static styles = [componentStyle, style]\n\n private direction = new DirectionController(this)\n private localization = new LocalizeController<'nord-nav-toggle'>(this)\n\n render() {\n return html`\n <nord-button variant=\"plain\" ${ref(this.focusableRef)} class=${classMap({ 'is-rtl': this.direction.isRTL })}>\n <nord-visually-hidden>${this.localization.term('label')}</nord-visually-hidden>\n <nord-icon size=\"m\" name=${unlockIcon.title}></nord-icon>\n <nord-icon size=\"m\" name=${lockIcon.title}></nord-icon>\n </nord-button>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-nav-toggle': NavToggle\n }\n}\n","import type { Events, States } from '../common/fsm.js'\nimport type NavItem from '../nav-item/NavItem.js'\nimport * as lockIcon from '@nordhealth/icons/lib/assets/navigation-toggle-lock.js'\nimport { html, LitElement, nothing } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { classMap } from 'lit/directives/class-map.js'\nimport { styleMap } from 'lit/directives/style-map.js'\nimport { BroadcastChannelController } from '../common/controllers/BroadcastChannelController.js'\nimport { DirectionController } from '../common/controllers/DirectionController.js'\nimport { EventController } from '../common/controllers/EventController.js'\nimport { LightDismissController } from '../common/controllers/LightDismissController.js'\nimport { SlotController } from '../common/controllers/SlotController.js'\nimport { observe } from '../common/decorators/observe.js'\nimport { cond } from '../common/directives/cond.js'\nimport { fsm } from '../common/fsm.js'\nimport { clamp } from '../common/number.js'\nimport { storage } from '../common/storage.js'\n\nimport componentStyle from '../common/styles/Component.css'\nimport stickyStyle from '../common/styles/Sticky.css'\n\nimport Icon from '../icon/Icon.js'\nimport style from './Layout.css'\nimport '../nav-toggle/NavToggle.js'\n\nIcon.registerIcon(lockIcon)\n\nconst NAV_DEFAULT_WIDTH = 250\nconst NAV_MIN_WIDTH = 220\nconst NAV_MAX_WIDTH = 400\nconst NAV_COLLAPSE_WIDTH = 100\nconst NAV_RESIZE_STEP = 30\nconst NAV_PEEK_DELAY = 300\n\nconst mediaQuery\n = typeof matchMedia !== 'undefined'\n ? matchMedia('(min-width: 768px)')\n : ({\n matches: false,\n addEventListener() {\n /* noop */\n },\n } as unknown as MediaQueryList)\n\nconst navWidthStore = storage('nord-layout.navWidth', NAV_DEFAULT_WIDTH)\n// Tracks the last `default-nav-width` we wrote, so we can re-seed the\n// stored width when consumers change the default between loads.\n// Initial default matches NAV_DEFAULT_WIDTH so existing consumers that\n// never set `default-nav-width` get no re-seed on upgrade — their users'\n// persisted widths are preserved.\nconst navWidthDefaultStore = storage('nord-layout.navWidthDefault', NAV_DEFAULT_WIDTH)\nconst navOpenStore = storage('nord-layout.navOpen', true)\n\nconst navMachine = fsm({\n opened: {\n toggle: 'closed',\n close: 'closed',\n },\n closed: {\n toggle: 'opened',\n open: 'opened',\n focusin: 'peek',\n pointerenter: 'peek',\n },\n peek: {\n toggle: 'opened',\n focusout: 'unpeek',\n pointerleave: 'wait',\n dropdownOpen: 'blocked',\n click: 'unpeek',\n open: 'opened',\n },\n blocked: {\n dropdownClose: 'peek',\n open: 'opened',\n },\n wait: {\n toggle: 'opened',\n focusin: 'peek',\n pointerenter: 'peek',\n timeout: 'unpeek',\n },\n unpeek: {\n toggle: 'opened',\n focusin: 'peek',\n pointerenter: 'peek',\n transitionend: 'closed',\n },\n})\n\ntype NavState = States<typeof navMachine>\ntype NavEvent = Events<typeof navMachine>\n\nconst isNavItem = (el: HTMLElement): el is NavItem => el.localName === 'nord-nav-item'\nconst isNavItemLeaf = (el: HTMLElement) => isNavItem(el) && !el.hasSubNav\n\n/**\n * Layout component is used to create the main layout of an app. Layout\n * currently comes with one main configuration: two-column.\n *\n * @status ready\n * @category structure\n * @slot - The default main section content.\n * @slot nav - Used to place content inside the navigation sidebar.\n * @slot top-bar - Used to place the [Top Bar](../top-bar/) component.\n * @slot header - Used to place content inside the header section. This slot can be made sticky by utilizing the `sticky` property on the layout component.\n * @slot footer - Used to place content inside the footer section. This slot can be made sticky by utilizing the `stickyFooter` property on the layout component.\n * @slot drawer - Used to place additional content/details relating to a selected item.\n * @slot nav-toggle - Used to place a own nav-toggle component, for cases where you might need to add a tooltip.\n *\n * @cssprop [--n-layout-padding=var(--n-space-l)] - Controls the padding around the main layout area (the main slot), using our [spacing tokens](/tokens/#space).\n * @cssprop [--n-layout-drawer-inline-size=320px] - Controls the width of the drawer area, when used.\n * @cssprop [--n-layout-background-color=var(--n-color-background)] - Controls the background color of the layout, using [color tokens](/tokens/#color).\n */\n@customElement('nord-layout')\nexport default class Layout extends LitElement {\n static styles = [componentStyle, stickyStyle, style]\n\n private peekTimeoutId?: ReturnType<typeof setTimeout>\n\n private navSlot = new SlotController(this, 'nav')\n private drawerSlot = new SlotController(this, 'drawer')\n private topBarSlot = new SlotController(this, 'top-bar')\n private headerSlot = new SlotController(this, 'header')\n private footerSlot = new SlotController(this, 'footer')\n private direction = new DirectionController(this)\n private events = new EventController(this)\n private lightDismiss = new LightDismissController(this, {\n isOpen: () => this.navState === 'opened' && !this.wideScreen,\n onDismiss: () => this.navTransition('close'),\n isDismissible: node => node !== this.navEl,\n })\n\n private broadcast = new BroadcastChannelController<{ navOpen: boolean } | { navWidth: number }>(this, {\n channelName: 'nord-layout-nav-state',\n enabled: () => this.syncNavState && this.wideScreen,\n onMessage: (data) => {\n if ('navOpen' in data) {\n this.navOpen = data.navOpen\n }\n if ('navWidth' in data) {\n this.navWidth = data.navWidth\n }\n },\n })\n\n @query('.n-layout-nav', true) private navEl!: HTMLDivElement\n\n @state() private navWidth = navWidthStore.value\n @state() private isDragging = false\n @state() private navState!: NavState\n @state() private wideScreen = mediaQuery.matches\n\n /**\n * Controls whether the navigation is hidden off-screen or not.\n * Defaults to `true` for wide viewports, and `false` otherwise.\n */\n @property({ reflect: true, type: Boolean, attribute: 'nav-open' }) navOpen!: boolean\n\n /**\n * Controls whether the navigation's open/closed state is persisted across page loads.\n * This is useful for multi-page apps, where clicks on links trigger a full page load.\n */\n @property({ reflect: true, type: Boolean, attribute: 'persist-nav-state' }) persistNavState = false\n\n /**\n * Controls whether the navigation's open/closed state and width is synced across tabs/windows on the same origin.\n * This is useful for long-lived app sessions where you may have multiple tabs/windows open at once.\n */\n @property({ type: Boolean, reflect: true, attribute: 'sync-nav-state' }) syncNavState = false\n\n /**\n * Initial width (in pixels) of the navigation sidebar when no value has been persisted.\n * Changing this value between loads also re-seeds the persisted width for existing users,\n * so design changes propagate without manual localStorage resets.\n */\n @property({ type: Number, reflect: true, attribute: 'default-nav-width' }) defaultNavWidth = NAV_DEFAULT_WIDTH\n\n /**\n * Minimum width (in pixels) the navigation sidebar can be resized to via drag or keyboard.\n */\n @property({ type: Number, reflect: true, attribute: 'min-nav-width' }) minNavWidth = NAV_MIN_WIDTH\n\n /**\n * Maximum width (in pixels) the navigation sidebar can be resized to via drag or keyboard.\n */\n @property({ type: Number, reflect: true, attribute: 'max-nav-width' }) maxNavWidth = NAV_MAX_WIDTH\n\n /**\n * Controls the padding of the default main section slot. When set to “none”,\n * the nav and header slots will still have padding.\n */\n @property({ reflect: true }) padding: 'm' | 'none' = 'm'\n\n /**\n * Controls whether the layout's header has sticky positioning.\n */\n @property({ type: Boolean, reflect: true }) sticky: boolean = false\n\n /**\n * Controls whether the layout's footer has sticky positioning.\n */\n @property({ type: Boolean, reflect: true, attribute: 'sticky-footer' }) stickyFooter: boolean = false\n\n /**\n * A getter whose values reflects whether the layout component considers the viewport to be narrow or not.\n * A narrow viewport is considered to be less than 768px wide.\n */\n get isNarrow(): boolean {\n return !this.wideScreen\n }\n\n connectedCallback(): void {\n super.connectedCallback()\n this.events.listen(mediaQuery, 'change', this.handleMediaQueryChange)\n }\n\n willUpdate() {\n // we only want this logic to run once, before first render\n if (this.hasUpdated) {\n return\n }\n\n // fall back to the built-in constants when consumer-provided attributes\n // are non-numeric (e.g. `min-nav-width=\"abc\"` produces NaN). reflect:true\n // also rewrites the attribute in the DOM to the sanitized value\n if (!Number.isFinite(this.defaultNavWidth)) {\n this.defaultNavWidth = NAV_DEFAULT_WIDTH\n }\n if (!Number.isFinite(this.minNavWidth)) {\n this.minNavWidth = NAV_MIN_WIDTH\n }\n if (!Number.isFinite(this.maxNavWidth)) {\n this.maxNavWidth = NAV_MAX_WIDTH\n }\n\n // re-seed persisted width when the consumer-provided default-nav-width\n // differs from the last default we applied. This lets apps roll out a\n // new sidebar default without manual localStorage migrations.\n if (navWidthDefaultStore.value !== this.defaultNavWidth) {\n this.setNavWidth(this.defaultNavWidth)\n navWidthStore.value = this.navWidth\n // store the raw consumer-provided default so mismatch detection is\n // independent of the min/max clamp\n navWidthDefaultStore.value = this.defaultNavWidth\n }\n else {\n // ensure a previously-persisted width still respects current min/max\n this.setNavWidth(this.navWidth)\n }\n\n // on mobile it should always start closed\n if (this.isNarrow) {\n this.navState = 'closed'\n }\n // if nav state is persisted, and it was previously closed, start closed\n else if (this.persistNavState && navOpenStore.value === false) {\n this.navState = 'closed'\n }\n // otherwise start open\n else {\n this.navState = 'opened'\n }\n }\n\n render() {\n const { navWidth, navState, navSlot, headerSlot, footerSlot, topBarSlot, drawerSlot, isDragging, direction } = this\n const adjustedNavWidth = navState === 'opened' && this.wideScreen ? navWidth : this.defaultNavWidth\n\n return html`\n <div\n class=${classMap({\n 'n-layout': true,\n 'n-rtl': direction.isRTL,\n 'n-dragging': isDragging,\n 'n-has-header': headerSlot.hasContent,\n 'n-has-footer': footerSlot.hasContent,\n 'n-has-top-bar': topBarSlot.hasContent,\n 'n-has-drawer': drawerSlot.hasContent,\n 'n-has-nav': navSlot.hasContent,\n })}\n style=${styleMap({\n '--_n-layout-nav-width': `${adjustedNavWidth}px`,\n })}\n data-nav=${navSlot.hasContent ? navState : 'closed'}\n data-screen=${this.wideScreen ? 'wide' : 'narrow'}\n >\n <div\n class=\"n-layout-nav\"\n ?hidden=${navSlot.isEmpty}\n @focusin=${this.handleNavFocus}\n @mouseenter=${this.handleMouseEnter}\n @mouseleave=${this.handleMouseLeave}\n @open=${this.handleDropdownOpen}\n @close=${this.handleDropdownClose}\n >\n <slot name=\"nav\" @click=${this.handleNavClick}></slot>\n <div\n class=\"n-resize\"\n role=\"separator\"\n aria-orientation=\"vertical\"\n tabindex=\"0\"\n @pointerdown=${cond(navState === 'opened', this.startDragging)}\n @pointermove=${cond(isDragging, this.handleDrag)}\n @pointerleave=${this.stopDragging}\n @pointerup=${this.stopDragging}\n @keydown=${this.handleKeyboardResize}\n ?hidden=${this.isNarrow}\n ></div>\n ${this.renderNavCollapse()}\n </div>\n\n <div class=\"n-layout-main\" @focusin=${this.handleMainFocus} @click=${this.handleMainClick}>\n ${navSlot.hasContent ? this.renderNavToggle() : nothing}\n\n <div class=\"n-top-bar-container\">\n <slot name=\"top-bar\"></slot>\n </div>\n\n <div class=\"n-layout-content\">\n <div class=\"n-sticky\">\n <slot name=\"header\"></slot>\n </div>\n <main>\n <slot></slot>\n </main>\n <slot name=\"footer\"></slot>\n </div>\n\n <aside ?hidden=${this.drawerSlot.isEmpty}>\n <slot name=\"drawer\"></slot>\n </aside>\n </div>\n </div>\n `\n }\n\n private renderNavToggle() {\n return html`\n <div class=\"n-nav-toggle-container\">\n <slot\n name=\"nav-toggle\"\n @click=${this.handleToggleClick}\n @mouseover=${this.handleMouseEnter}\n @mouseout=${this.handleMouseLeave}\n >\n <nord-nav-toggle></nord-nav-toggle>\n </slot>\n </div>\n `\n }\n\n private renderNavCollapse() {\n return html`\n <button class=\"n-collapse-btn\" @click=${this.handleToggleClick}>\n <nord-icon name=\"navigation-toggle-lock\" size=\"s\"></nord-icon>\n </button>\n `\n }\n\n @observe('navWidth', 'updated')\n protected handleNavWidthChange() {\n navWidthStore.value = this.navWidth\n }\n\n @observe('navState')\n protected handleNavStateChange(prev: NavState) {\n if (prev === 'wait' && this.peekTimeoutId) {\n clearTimeout(this.peekTimeoutId)\n }\n if (prev === 'unpeek') {\n this.navEl.removeEventListener('transitionend', this.handleTransitionEnd)\n }\n\n switch (this.navState) {\n case 'closed':\n this.navOpen = false\n break\n case 'opened':\n this.navOpen = true\n break\n case 'wait':\n this.peekTimeoutId = setTimeout(() => this.navTransition('timeout'), NAV_PEEK_DELAY)\n break\n case 'unpeek':\n this.navEl.addEventListener('transitionend', this.handleTransitionEnd, { once: true })\n break\n default:\n break\n }\n }\n\n @observe('navOpen', 'updated')\n protected handleOpenChange(prev: boolean) {\n if (!this.isDragging) {\n // when opening nav, it should restore to default width (or larger).\n // unless it is being dragged, in which case the drag width wins\n this.setNavWidth(Math.max(this.navWidth, this.defaultNavWidth))\n }\n\n this.navTransition(this.navOpen ? 'open' : 'close')\n\n if (this.persistNavState) {\n navOpenStore.value = this.navOpen\n }\n\n // skip first update, we only want subsequent changes\n if (prev != null) {\n this.broadcast.post({ navOpen: this.navOpen })\n }\n }\n\n /* ---------------------------------------------\n / NAVIGATION OPEN/CLOSE LOGIC\n / --------------------------------------------- */\n\n private navTransition(event: NavEvent) {\n this.navState = navMachine.transition(this.navState, event)\n }\n\n private handleNavClick(e: Event) {\n if (!e.defaultPrevented && !this.wideScreen) {\n const target = e.target as HTMLElement\n\n if (isNavItemLeaf(target)) {\n this.navTransition('close')\n }\n }\n }\n\n private handleMainClick() {\n this.navTransition('click')\n }\n\n private handleDropdownOpen(e: Event) {\n const target = e.target as Element\n\n if (target.localName === 'nord-dropdown') {\n this.navTransition('dropdownOpen')\n }\n }\n\n private handleDropdownClose(e: Event) {\n const target = e.target as Element\n\n if (target.localName === 'nord-dropdown') {\n this.navTransition('dropdownClose')\n }\n }\n\n private handleMediaQueryChange = () => {\n this.wideScreen = mediaQuery.matches\n this.navTransition(this.wideScreen ? 'open' : 'close')\n }\n\n private handleToggleClick = () => {\n this.navTransition('toggle')\n }\n\n private handleNavFocus = () => {\n this.navTransition('focusin')\n }\n\n private handleMainFocus = () => {\n this.navTransition('focusout')\n }\n\n private handleMouseEnter = () => {\n if (this.wideScreen) {\n this.navTransition('pointerenter')\n }\n }\n\n private handleMouseLeave = () => {\n this.navTransition('pointerleave')\n }\n\n private handleTransitionEnd = () => {\n this.navTransition('transitionend')\n }\n\n /* ---------------------------------------------\n / RESIZE LOGIC\n / --------------------------------------------- */\n\n private handleKeyboardResize(e: KeyboardEvent) {\n const {\n navWidth,\n direction: { isLTR },\n } = this\n\n switch (e.key) {\n case 'ArrowLeft':\n this.setNavWidth(navWidth + (isLTR ? -NAV_RESIZE_STEP : NAV_RESIZE_STEP))\n break\n case 'ArrowRight':\n this.setNavWidth(navWidth + (isLTR ? NAV_RESIZE_STEP : -NAV_RESIZE_STEP))\n break\n case 'Enter':\n this.navTransition('toggle')\n break\n case 'Home':\n this.setNavWidth(this.minNavWidth)\n break\n case 'End':\n this.setNavWidth(this.maxNavWidth)\n break\n default:\n return\n }\n\n this.broadcast.post({ navWidth: this.navWidth })\n e.preventDefault()\n }\n\n private setNavWidth(width: number) {\n this.navWidth = clamp(Math.round(width), this.minNavWidth, this.maxNavWidth)\n }\n\n private startDragging(e: PointerEvent) {\n if (e.button === 0) {\n const target = e.target as Element\n target.setPointerCapture(e.pointerId)\n this.isDragging = true\n }\n }\n\n private stopDragging() {\n this.isDragging = false\n this.broadcast.post({ navWidth: this.navWidth })\n }\n\n private handleDrag(e: PointerEvent) {\n const width = this.direction.isRTL ? this.clientWidth - e.clientX : e.clientX\n\n this.setNavWidth(width)\n this.navTransition(width >= NAV_COLLAPSE_WIDTH ? 'open' : 'close')\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-layout': Layout\n }\n}\n","import type { TemplateResult } from 'lit'\nimport { html, LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { ref } from 'lit/directives/ref.js'\nimport { FocusableMixin } from '../common/mixins/FocusableMixin.js'\n\nimport componentStyle from '../common/styles/Component.css'\nimport itemStyle from '../dropdown-item/DropdownItem.css'\nimport { LocalizeController } from '../localization/LocalizeController.js'\nimport style from './Message.css'\n\n/**\n * Message represents a specific item within a collection,\n * such as notifications, tasks or conversations. Message\n * can be placed directly inside a dropdown component.\n *\n * @status ready\n * @category action\n * @slot - The message content.\n * @slot footer - Used to place content after the message. Typically used for a timestamp.\n *\n * @cssprop [--n-message-border-color=var(--n-color-border)] - Controls the border color of the message, using our [color tokens](/tokens/#color).\n *\n * @localization unreadLabel - Label for the unread messages.\n */\n@customElement('nord-message')\nexport default class Message extends FocusableMixin(LitElement) {\n static styles = [componentStyle, itemStyle, style]\n\n private localize = new LocalizeController<'nord-message'>(this)\n\n /**\n * The url the message should link to.\n */\n @property({ reflect: true }) href?: string\n\n /**\n * Highlight the message visually. This is meant for highlighting\n * a new message that just appeared. Highlight style should be removed\n * after the user has seen the message and there’s been a timeout of\n * e.g. 30 seconds.\n */\n @property({ reflect: true, type: Boolean }) highlight?: boolean\n\n /**\n * Mark the message as unread. By default messages are read.\n */\n @property({ reflect: true, type: Boolean }) unread?: boolean\n\n // TODO: dropdown-item and message component have the same logic\n // for determining if it renders a link vs button. Perhaps we\n // can later see if both can use a mixin or similar instead?\n render() {\n const link = (content: TemplateResult) =>\n html`<a href=${ifDefined(this.href)} ${ref(this.focusableRef)} class=\"n-dropdown-item n-message\">${content}</a>`\n const button = (content: TemplateResult) =>\n html`<button ${ref(this.focusableRef)} class=\"n-dropdown-item n-message\">${content}</button>`\n\n const container = this.href ? link : button\n\n return container(html`\n <div role=\"img\" class=\"n-unread\" aria-label=${this.localize.term('unreadLabel')} ?hidden=${!this.unread}></div>\n <slot></slot>\n <slot name=\"footer\"></slot>\n `)\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-message': Message\n }\n}\n","/**\n * Set or remove the `inert` attribute on an element.\n *\n * @param element The element to set or remove the `inert` attribute on.\n * @param enabled Whether to set or remove the `inert` attribute.\n */\nfunction setInertAttribute(element: Element, enabled: boolean) {\n if (enabled) {\n const current = element.getAttribute('inert')\n\n // store previous value\n if (current !== null) {\n element.setAttribute('data-n-inert', current)\n }\n\n element.setAttribute('inert', '')\n }\n else {\n const current = element.getAttribute('data-n-inert')\n\n // restore previous value if necessary\n if (current !== null) {\n element.setAttribute('inert', current)\n element.removeAttribute('data-n-inert')\n }\n else {\n element.removeAttribute('inert')\n }\n }\n}\n\n/**\n * Set or remove the `inert` attribute on all given elements.\n *\n * @param elements The elements to set or remove the `inert` attribute on.\n * @param enabled Whether to set or remove the `inert` attribute.\n */\nexport function setInertAttributes(elements: Element[], enabled: boolean) {\n elements.forEach(element => setInertAttribute(element, enabled))\n}\n\n/**\n * Get all siblings of an element, including the siblings of its parents.\n * Use this to find all elements that should be inert when a modal is open.\n * And then use `setInertAttributes` to set or remove the `inert` attribute\n * on all of them.\n */\nexport function getElementsAround(element: Element): Element[] {\n const elements = []\n let next = element.nextElementSibling\n\n while (next) {\n elements.push(next)\n next = next.nextElementSibling\n }\n\n next = element.previousElementSibling\n\n while (next) {\n elements.push(next)\n next = next.previousElementSibling\n }\n\n if (element.parentElement && element.parentElement !== document.body) {\n elements.push(...getElementsAround(element.parentElement))\n }\n\n return elements\n}\n","import type { ReactiveController, ReactiveControllerHost } from 'lit'\nimport { getElementsAround, setInertAttributes } from '../../common/inert.js'\n\nexport class FocusTrapController implements ReactiveController {\n private inertElements: Element[] = []\n\n constructor(private host: ReactiveControllerHost & HTMLElement) {\n host.addController(this)\n }\n\n hostDisconnected() {\n this.release()\n }\n\n trap() {\n const elements = getElementsAround(this.host)\n\n setInertAttributes(elements, true)\n this.inertElements = elements\n }\n\n release() {\n setInertAttributes(this.inertElements, false)\n this.inertElements = []\n }\n}\n","import type { ReactiveController, ReactiveControllerHost } from 'lit'\nimport type { LightDismissOptions } from '../common/controllers/LightDismissController.js'\nimport { EventController } from '../common/controllers/EventController.js'\nimport { FocusTrapController } from '../common/controllers/FocusTrapController.js'\nimport { LightDismissController } from '../common/controllers/LightDismissController.js'\nimport { ScrollbarController } from '../common/controllers/ScrollbarController.js'\n\nclass Stack<T> {\n private items: T[] = []\n\n get length() {\n return this.items.length\n }\n\n get top(): T | undefined {\n return this.items[this.length - 1]\n }\n\n push(item: T) {\n this.items.push(item)\n }\n\n pop() {\n return this.items.pop()\n }\n\n remove(item: T) {\n const index = this.items.indexOf(item)\n\n if (index !== -1) {\n this.items.splice(index, 1)\n }\n }\n}\n\nconst isButton = (element: Element): element is HTMLButtonElement => element.localName === 'button'\n\ninterface ModalControllerOptions {\n isOpen: LightDismissOptions['isOpen']\n onDismiss: (trigger: Event) => void\n close: (returnValue?: string, trigger?: Event) => void\n isLightDismissEnabled: () => boolean\n backdrop: () => HTMLElement\n dialog: () => HTMLElement\n}\n\nexport class ModalController implements ReactiveController {\n private static openModals = new Stack<ModalController>()\n\n private scrollBar: ScrollbarController\n private focusTrap: FocusTrapController\n private lightDismiss: LightDismissController\n private events: EventController\n private options: ModalControllerOptions\n\n private trigger?: HTMLElement\n private lastButton?: HTMLButtonElement\n\n constructor(\n private host: ReactiveControllerHost & HTMLElement,\n options: ModalControllerOptions,\n ) {\n host.addController(this)\n this.options = options\n\n this.scrollBar = new ScrollbarController(host)\n this.focusTrap = new FocusTrapController(host)\n this.events = new EventController(host)\n this.lightDismiss = new LightDismissController(host, {\n isOpen: options.isOpen,\n isDismissible: node => node !== options.dialog(),\n onDismiss: this.handleLightDismiss,\n })\n }\n\n hostConnected() {\n // if submit event is not supported, let's do a basic polyfill\n if (!window.SubmitEvent) {\n this.events.listen(this.host, 'click', this.trackLastButton, true)\n this.events.listen(this.host, 'submit', this.polyfillSubmitter, true)\n }\n\n this.events.listen(this.host, 'transitionend', this.handleTransitionEnd)\n this.events.listen(this.host, 'submit', this.handleSubmit)\n }\n\n hostDisconnected(): void {\n ModalController.openModals.remove(this)\n }\n\n block() {\n // if there is already a modal open, release its focus trap\n ModalController.openModals.top?.focusTrap.release()\n\n // add this modal to the stack of open modals\n ModalController.openModals.push(this)\n\n // hide scrollbar and prevent scroll on body\n this.scrollBar.lockScroll()\n\n // store the element that was focused prior to modal opening\n this.trigger = document.activeElement as HTMLElement\n\n // handle initial (auto)focus\n const focusTarget = this.host.querySelector<HTMLElement>('[autofocus]') || this.host\n focusTarget.focus()\n\n // finally, we should enable the focus trap\n this.focusTrap.trap()\n }\n\n unblock() {\n // it does not make sense to unblock a modal if it is not the top-most modal\n if (ModalController.openModals.top !== this) {\n return\n }\n\n ModalController.openModals.pop()\n\n // ensure modal is scrolled to top ready for re-open\n this.options.backdrop().scrollTop = 0\n\n // we need to release the focus trap...\n this.focusTrap.release()\n\n // ...before we can return focus to the trigger\n this.trigger?.focus()\n this.trigger = undefined\n\n // if there are still modals open, enable the next modal's focus trap\n ModalController.openModals.top?.focusTrap.trap()\n }\n\n /**\n * capture the last button clicked, so that we can polyfill `submitter` property in submit event\n */\n private trackLastButton = (e: Event) => {\n const target = e.target as HTMLElement\n\n if (isButton(target)) {\n this.lastButton = target\n }\n }\n\n private polyfillSubmitter = (e: Event) => {\n // @ts-expect-error submitter is readonly, but this is only called if SubmitEvent is not supported\n e.submitter = this.lastButton\n }\n\n private handleTransitionEnd = (e: TransitionEvent) => {\n // scrollbar should only be restored when the modal has transitioned,\n // that way we avoid awkward double scrollbars.\n if (!this.options.isOpen() && e.target === this.host) {\n this.scrollBar.unlockScroll()\n }\n }\n\n private handleLightDismiss = (trigger: Event) => {\n if (this.host.contains(trigger.target as Node) && this.options.isLightDismissEnabled()) {\n this.options.onDismiss(trigger)\n }\n }\n\n private handleSubmit = (e: SubmitEvent) => {\n this.lastButton = undefined\n\n const target = e.target as HTMLFormElement\n const submitter = e.submitter as HTMLButtonElement\n\n const isDialogProperty = target.method === 'dialog'\n const isDialogAttr = target.getAttribute('method') === 'dialog'\n\n // if they mismatch, it means \"dialog\" method is not supported,\n // so we should polyfill the fact it does not do a full submit\n if (isDialogAttr && !isDialogProperty) {\n e.preventDefault()\n }\n\n if (isDialogAttr || isDialogProperty) {\n this.options.close(submitter?.value, e)\n }\n }\n}\n","import * as closeIcon from '@nordhealth/icons/lib/assets/interface-close-small.js'\nimport { html, LitElement } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { classMap } from 'lit/directives/class-map.js'\n\nimport { SlotController } from '../common/controllers/SlotController.js'\nimport { observe } from '../common/decorators/observe.js'\nimport { NordEvent } from '../common/events.js'\nimport componentStyle from '../common/styles/Component.css'\n\nimport Icon from '../icon/Icon.js'\nimport { LocalizeController } from '../localization/LocalizeController.js'\nimport style from './Modal.css'\nimport { ModalController } from './ModalController.js'\n\nimport '../footer/Footer.js'\n\nIcon.registerIcon(closeIcon)\n\n/**\n * Event dispatched when a modal is about to be dismissed.\n * The `trigger` property contains the original event that caused the dismiss.\n */\nexport class ModalCancelEvent extends NordEvent {\n declare trigger: Event\n\n constructor(trigger: Event) {\n super('cancel', { cancelable: true })\n Object.defineProperty(this, 'trigger', {\n value: trigger,\n enumerable: true,\n writable: false,\n })\n }\n}\n\n/**\n * Event dispatched when a modal is closed.\n * The `trigger` property contains the original event that caused the close, if available.\n */\nexport class ModalCloseEvent extends NordEvent {\n declare trigger: Event | undefined\n\n constructor(trigger?: Event) {\n super('close')\n Object.defineProperty(this, 'trigger', {\n value: trigger,\n enumerable: true,\n writable: false,\n })\n }\n}\n\n/**\n * Modal component is used to display content that temporarily blocks interactions\n * with the main view of an application. Modal should be used sparingly and\n * only when necessary.\n *\n * @status ready\n * @category overlay\n * @slot - Default slot\n * @slot header - Slot which holds the header of the modal, positioned next to the close button.\n * @slot feature - Slot for full bleed content like an image.\n * @slot footer - Slot which is typically used to hold call to action buttons, but can also be used to build custom footers.\n * @fires {ModalCancelEvent} cancel - Dispatched before the modal has closed when a user attempts to dismiss a modal. The event includes a trigger property containing the original event that caused the dismiss. Call preventDefault() on the event to prevent the modal closing.\n * @fires {ModalCloseEvent} close - Dispatched when a modal is closed for any reason. The event includes an optional trigger property containing the original event that caused the close, if the modal was closed by a user action.\n *\n * @cssprop [--n-modal-padding-inline=var(--n-space-m)] - Controls the padding on the sides of the modal, using our [spacing tokens](/tokens/#space).\n * @cssprop [--n-modal-padding-block=var(--n-space-m)] - Controls the padding above and below the header of the modal, using our [spacing tokens](/tokens/#space).\n * @cssprop [--n-modal-max-inline-size=620px] - Controls the width of the modal.\n *\n * @localization closeLabel - Accessible label for the close button.\n */\n@customElement('nord-modal')\nexport default class Modal extends LitElement {\n static styles = [componentStyle, style]\n\n @query('.n-modal', true) private modal!: HTMLDivElement\n @query('.n-modal-backdrop', true) private backdrop!: HTMLDivElement\n\n private lastTrigger?: Event\n\n private defaultSlot = new SlotController(this)\n private headerSlot = new SlotController(this, 'header')\n private featureSlot = new SlotController(this, 'feature')\n private footerSlot = new SlotController(this, 'footer')\n\n private localize = new LocalizeController<'nord-modal'>(this)\n private modalController = new ModalController(this, {\n isOpen: () => this.open,\n onDismiss: (e: Event) => this.handleDismiss(e),\n isLightDismissEnabled: () => !this.persistent,\n dialog: () => this.modal,\n backdrop: () => this.backdrop,\n close: (returnValue, trigger) => this.close(returnValue, trigger),\n })\n\n /**\n * Controls whether the modal is open or not.\n */\n @property({ type: Boolean, reflect: true }) open = false\n\n /**\n * Controls the max-width of the modal when open.\n */\n @property({ reflect: true }) size: 's' | 'm' | 'l' | 'xl' = 'm'\n\n /**\n * The reason why the modal was closed. This typically indicates\n * which button the user pressed to close the modal, though any value\n * can be supplied if the modal is programmatically closed.\n */\n @property({ attribute: false }) returnValue: string = ''\n\n /**\n * By default if a modal is too big for the browser window,\n * the entire modal will scroll. This setting changes that behavior\n * so that the body of the modal scrolls instead, with the modal\n * itself remaining fixed.\n */\n @property({ type: Boolean, reflect: true }) scrollable = false\n\n /**\n * When true, the modal will not close when clicking the backdrop or pressing Escape,\n * and the close button will be hidden. Only programmatic close or custom action buttons\n * can dismiss the modal.\n */\n @property({ type: Boolean, reflect: true }) persistent = false\n\n connectedCallback(): void {\n super.connectedCallback()\n\n this.setAttribute('role', 'dialog')\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback()\n\n // Clear trigger reference when modal is removed from DOM to prevent memory leaks\n this.lastTrigger = undefined\n }\n\n /**\n * Show the modal, automatically moving focus to the modal or a child\n * element with an `autofocus` attribute.\n */\n showModal() {\n this.open = true\n }\n\n /**\n * Programmatically close the modal.\n * @param returnValue An optional value to indicate why the modal was closed.\n * @param trigger An optional event that triggered the close.\n */\n close(returnValue?: string, trigger?: Event) {\n this.open = false\n\n if (returnValue != null) {\n this.returnValue = returnValue\n }\n\n const closeTrigger = trigger ?? this.lastTrigger\n this.dispatchEvent(new ModalCloseEvent(closeTrigger))\n this.lastTrigger = undefined\n }\n\n /**\n * Programmatically focus the modal.\n * @param options An object which controls aspects of the focusing process.\n */\n focus(options?: FocusOptions) {\n this.modal.focus({ preventScroll: true, ...options })\n }\n\n render() {\n return html`\n <div class=\"n-modal-backdrop\">\n <div\n class=${classMap({\n 'n-modal': true,\n 'n-overflow-hidden': this.featureSlot.hasContent && this.defaultSlot.isEmpty && this.footerSlot.isEmpty,\n })}\n tabindex=\"0\"\n >\n <!-- eslint-disable-next-line @nordhealth/no-unknown-legacy-classes -->\n <div class=\"n-modal-header n-rounded-top\" ?hidden=${this.headerSlot.isEmpty}>\n <slot class=\"n-padded\" name=${this.headerSlot.slotName}></slot>\n <button class=\"n-close\" @click=${(e: Event) => this.handleDismiss(e)} ?hidden=${this.persistent}>\n <nord-icon name=\"interface-close-small\" size=\"s\" label=${this.localize.term('closeLabel')}></nord-icon>\n </button>\n </div>\n\n <div class=\"n-modal-body\">\n <slot\n name=${this.featureSlot.slotName}\n class=${this.headerSlot.isEmpty ? 'n-rounded-top' : ''}\n ?hidden=${this.featureSlot.isEmpty}\n ></slot>\n <slot class=${this.defaultSlot.isEmpty ? '' : 'n-body-padded'}></slot>\n </div>\n\n <nord-footer ?hidden=${this.footerSlot.isEmpty}>\n <slot name=${this.footerSlot.slotName}></slot>\n </nord-footer>\n </div>\n </div>\n `\n }\n\n @observe('open', 'updated')\n protected handleOpenUpdated(prev: boolean) {\n if (this.open) {\n this.modalController.block()\n }\n else if (prev === true) {\n this.modalController.unblock()\n }\n }\n\n private handleDismiss(trigger: Event) {\n // allow cancelling of close\n const allowed = this.dispatchEvent(new ModalCancelEvent(trigger))\n\n if (allowed) {\n this.lastTrigger = trigger\n this.close()\n }\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-modal': Modal\n }\n}\n","import { html, LitElement, nothing } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport componentStyle from '../common/styles/Component.css'\n\nimport style from './NavGroup.css'\nimport '../icon/Icon.js'\n\n/**\n * Navigation group includes all the actions or items in a single\n * group and is used for grouping items into related categories.\n *\n * @category navigation\n * @status ready\n * @slot - The default slot used for the nav items.\n *\n * @fires {NordEvent} toggle - Dispatched whenever a nav item's state changes between open and closed.\n * @fires {NordEvent} activate - Dispatched whenever a nav item has been marked as active\n */\n@customElement('nord-nav-group')\nexport default class NavGroup extends LitElement {\n static styles = [componentStyle, style]\n\n /**\n * Heading and accessible label for the nav group\n */\n @property({ reflect: true }) heading?: string\n\n render() {\n return html`\n ${this.heading ? html`<p id=\"heading\" aria-hidden=\"true\" class=\"n-heading\">${this.heading}</p>` : nothing}\n <div role=\"list\" aria-labelledby=${this.heading ? 'heading' : nothing}>\n <slot></slot>\n </div>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-nav-group': NavGroup\n }\n}\n","import type { TemplateResult } from 'lit'\nimport { html, LitElement, nothing } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { classMap } from 'lit/directives/class-map.js'\nimport { ref } from 'lit/directives/ref.js'\nimport { DirectionController } from '../common/controllers/DirectionController.js'\nimport { SlotController } from '../common/controllers/SlotController.js'\nimport { observe } from '../common/decorators/observe.js'\nimport { cond } from '../common/directives/cond.js'\nimport { NordEvent } from '../common/events.js'\n\nimport { FocusableMixin } from '../common/mixins/FocusableMixin.js'\nimport componentStyle from '../common/styles/Component.css'\nimport style from './NavItem.css'\n\n/**\n * Navigation item populates sidebar navigation with links.\n * Every item should be placed inside a navigation group.\n *\n * @status ready\n * @category navigation\n * @slot - The default slot used for the nav item's text.\n * @slot subnav - Used for nesting navigation. When used the nav-item becomes a button to collapse the subnav, rather than a link.\n *\n * @fires toggle - Dispatched whenever a nav item's state changes between open and closed.\n * @fires activate - Dispatched whenever a nav item has been marked as active\n *\n * @cssprop [--n-nav-item-color=var(--n-color-text-weak)] - Text color in the default state.\n * @cssprop [--n-nav-item-background=transparent] - Background color in the default state.\n * @cssprop [--n-nav-item-border-radius=var(--n-border-radius-s)] - Border radius of the item and its active-parent overlay.\n * @cssprop [--n-nav-item-padding-block=var(--n-space-s)] - Block-axis (top/bottom) padding.\n * @cssprop [--n-nav-item-padding-inline=var(--n-space-s)] - Inline-axis (start/end) padding.\n * @cssprop [--n-nav-item-line-height=var(--n-line-height-tight)] - Line height of the item's text.\n * @cssprop [--n-nav-item-color-hover=var(--n-color-text)] - Text color on hover.\n * @cssprop [--n-nav-item-background-hover=var(--n-color-nav-hover)] - Background color on hover.\n * @cssprop [--n-nav-item-color-active=var(--n-color-text-on-accent)] - Text color when the item is `active`.\n * @cssprop [--n-nav-item-background-active=var(--n-color-accent)] - Background color when the item is `active`.\n * @cssprop [--n-nav-item-color-expanded=var(--n-color-text-weak)] - Text color when the item is an active parent (its subnav is expanded).\n * @cssprop [--n-nav-item-background-expanded=var(--n-color-accent)] - Background color of the overlay drawn behind an active-parent item.\n * @cssprop [--n-nav-item-expanded-overlay-opacity=0.12] - Opacity of the active-parent overlay. Set to `1` for a solid background.\n * @cssprop [--n-nav-item-expanded-overlay-filter=brightness(150%)] - Filter applied to the active-parent overlay. Set to `none` to disable.\n */\n@customElement('nord-nav-item')\nexport default class NavItem extends FocusableMixin(LitElement) {\n static styles = [componentStyle, style]\n\n private subnavSlot = new SlotController(this, 'subnav')\n private direction = new DirectionController(this)\n\n /**\n * Used for indicating the current page. This gives a prominent background to the nav item,\n * and marks the item as the current page for assistive technology.\n */\n @property({ type: Boolean, reflect: true }) active = false\n\n /**\n * The name of an icon from Nordicons to display for the nav item.\n */\n @property({ reflect: true }) icon?: string\n\n /**\n * The url the nav item should link to.\n * Note: this is not used if you have nested navigation using the \"subnav\" slot.\n */\n @property({ reflect: true }) href?: string\n\n /**\n * Allows you to add a notification badge with a number next to the nav item.\n */\n @property({ reflect: true }) badge?: string\n\n /**\n * When the nav items contains a subnav, controls whether the section is expanded or not.\n * Note: this is only used if you have nested navigation using the \"subnav\" slot.\n */\n @property({ reflect: true, type: Boolean }) open = false\n\n /**\n * @internal\n */\n get hasSubNav() {\n return this.subnavSlot.hasContent\n }\n\n render() {\n const innards = html`\n ${this.icon ? html`<nord-icon class=\"n-nav-icon\" name=${this.icon} size=\"m\"></nord-icon>` : nothing}\n <div class=\"n-nav-content\">\n <span class=\"n-nav-label\"><slot></slot></span>\n ${this.badge ? html`<span class=\"n-nav-badge\">${this.badge}</span>` : nothing}\n </div>\n `\n let element: TemplateResult\n\n if (this.subnavSlot.hasContent) {\n element = this.renderToggle(innards)\n }\n else if (this.href) {\n element = this.renderLink(innards)\n }\n else {\n element = this.renderButton(innards)\n }\n\n return html`\n <div role=\"listitem\">\n ${element}\n <slot name=${this.subnavSlot.slotName} ?hidden=${!this.open}></slot>\n </div>\n `\n }\n\n private renderLink(innards: TemplateResult) {\n return html`\n <a class=\"n-nav-item\" ${ref(this.focusableRef)} aria-current=${cond(this.active, 'page')} href=${this.href || ''}>\n ${innards}\n </a>\n `\n }\n\n private renderToggle(innards: TemplateResult) {\n return html`\n <button\n class=\"n-nav-item\"\n @click=${this.toggleOpen}\n aria-expanded=${this.open ? 'true' : 'false'}\n ${ref(this.focusableRef)}\n >\n ${innards}\n\n <nord-icon\n size=\"xxs\"\n class=${classMap({ 'n-toggle-icon': true, 'n-rtl': this.direction.isRTL })}\n name=\"arrow-expand-right-small\"\n ></nord-icon>\n </button>\n `\n }\n\n private renderButton(innards: TemplateResult) {\n return html`<button class=\"n-nav-item\" ${ref(this.focusableRef)}>${innards}</button>`\n }\n\n private toggleOpen() {\n this.open = !this.open\n this.dispatchEvent(new NordEvent('toggle'))\n }\n\n @observe('active', 'updated')\n protected handleActiveChange() {\n if (this.active && !this.hasSubNav) {\n this.dispatchEvent(new NordEvent('activate'))\n }\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-nav-item': NavItem\n }\n}\n","import type NavItem from '../nav-item/NavItem.js'\nimport { html, LitElement, nothing } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { EventController } from '../common/controllers/EventController.js'\nimport { SlotController } from '../common/controllers/SlotController.js'\nimport componentStyle from '../common/styles/Component.css'\nimport style from './Navigation.css'\n\n/**\n * Navigation is used to display the primary navigation in the sidebar\n * of an application. Navigation includes a list of links that users\n * use to move between sections of the application.\n *\n * @status ready\n * @category navigation\n * @slot - The main section of the sidebar, for holding nav components.\n * @slot header - The top section of the sidebar.\n * @slot footer - The bottom section of the sidebar.\n *\n * @fires {NordEvent} toggle - Dispatched whenever a nav item's state changes between open and closed.\n * @fires {NordEvent} activate - Dispatched whenever a nav item has been marked as active\n *\n * @cssprop [--n-navigation-background-color=var(--n-color-nav-surface)] - Controls the background color of the navigation element.\n * @cssprop [--n-navigation-scroll-shadow-color-start=rgb(0, 0, 0, 0.1)] - Color of the scroll-affordance shadow shown at the top of the scroll area (below the header) when `sticky-footer` is set. Set to `transparent` to disable.\n * @cssprop [--n-navigation-scroll-shadow-color-end=rgb(0, 0, 0, 0.1)] - Color of the scroll-affordance shadow shown at the bottom of the scroll area (above the footer) when `sticky-footer` is set. Set to `transparent` to disable.\n * @cssprop [--n-navigation-scroll-mask=none] - `mask-image` applied to the scrollable area when `sticky-footer` is set. Use with the shadow colors set to `transparent` to replace the dark scroll-shadow with a soft content fade at the edges. Example: `linear-gradient(to bottom, transparent 0, black 24px, black calc(100% - 24px), transparent 100%)`.\n * @cssprop [--n-navigation-padding-block=var(--n-space-m)] - Block-axis (top/bottom) padding of the `<nav>` element that wraps the slotted nav groups.\n * @cssprop [--n-navigation-padding-inline=var(--n-space-m)] - Inline-axis (start/end) padding of the `<nav>` element that wraps the slotted nav groups.\n * @cssprop [--n-navigation-footer-padding-block=var(--n-space-s)] - Block-axis (top/bottom) padding inside the footer slot when `sticky-footer` is set. Has no visual effect when the footer slot is empty (slot is hidden in that case).\n * @cssprop [--n-navigation-footer-padding-inline=var(--n-navigation-padding-inline)] - Inline-axis (start/end) padding inside the footer slot when `sticky-footer` is set. Defaults to `--n-navigation-padding-inline` so the footer aligns with the nav content unless overridden. Has no visual effect when the footer slot is empty.\n */\n@customElement('nord-navigation')\nexport default class Navigation extends LitElement {\n static styles = [componentStyle, style]\n\n private headerSlot = new SlotController(this, 'header')\n private events = new EventController(this)\n private footerObserver: MutationObserver | null = null\n private allowItemsToRemainOpen = false\n\n /**\n * Controls whether the navigations's footer has sticky positioning.\n */\n @property({ type: Boolean, reflect: true, attribute: 'sticky-footer' }) stickyFooter: boolean = false\n\n connectedCallback() {\n super.connectedCallback()\n // if we add this event listener during render\n // we seem to miss the first activate event.\n // so let's add it as early as possible.\n this.events.listen(this, 'activate', this.handleActivate)\n\n // in cases where there is an initially active nav-item,\n // we should allow any nav-items with the `open` attribute to remain open.\n const activeItem = this.querySelector('nord-nav-item[active]')\n this.allowItemsToRemainOpen = activeItem != null\n\n if (typeof window !== 'undefined') {\n this.observeFooter()\n }\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n this.footerObserver?.disconnect()\n this.footerObserver = null\n }\n\n /**\n * Observe the footer slot element for visibility changes.\n * Watches style and class attributes on the footer element itself, and\n * childList on the host to detect footer being added/removed (e.g. v-if).\n */\n private observeFooter() {\n this.footerObserver = new MutationObserver(() => this.requestUpdate())\n\n // Watch for footer element being added/removed from the host\n this.footerObserver.observe(this, { childList: true })\n\n // Watch hidden attribute on the footer element directly\n const footerEl = this.querySelector(':scope > [slot=\"footer\"]')\n if (footerEl) {\n this.footerObserver.observe(footerEl, {\n attributes: true,\n attributeFilter: ['style', 'class'],\n })\n }\n }\n\n private get isFooterVisible() {\n // In SSR, the element is backed by a minimal DOM shim that does not implement\n // querySelector or window.getComputedStyle. Return true so the footer slot\n // renders as visible during server-side rendering.\n if (typeof window === 'undefined') {\n return true\n }\n\n const footerEl = this.querySelector<HTMLElement>(':scope > [slot=\"footer\"]')\n if (!footerEl) {\n return false\n }\n\n const style = window.getComputedStyle(footerEl)\n return (\n style.display !== 'none'\n && style.visibility !== 'hidden'\n && style.visibility !== 'collapse'\n && style.opacity !== '0'\n && style.contentVisibility !== 'hidden'\n )\n }\n\n render() {\n return html`\n <slot name=\"header\" ?hidden=${this.headerSlot.isEmpty}></slot>\n <div class=\"n-navigation-main\">\n <nav>\n <slot></slot>\n </nav>\n ${!this.stickyFooter ? html`<slot name=\"footer\" ?hidden=${!this.isFooterVisible}></slot>` : nothing}\n </div>\n ${this.stickyFooter ? html`<slot name=\"footer\" ?hidden=${!this.isFooterVisible}></slot>` : nothing}\n `\n }\n\n private handleActivate = (e: Event) => {\n const target = e.target as NavItem\n const ancestors = new Set<NavItem>()\n\n // walk up the DOM, gathering all ancestors from the target to its top-most nav-item.\n // it's more efficient to first gather ancestors here,\n // than to repeatedly call item.contains(target) in the for-loop below.\n let parent = target.parentElement?.closest('nord-nav-item')\n while (parent) {\n ancestors.add(parent)\n parent = parent.parentElement?.closest('nord-nav-item')\n }\n\n // open and activate any items on the path, otherwise close and deactivate.\n // however, if the item is set to open initially, we should not close it.\n for (const item of this.querySelectorAll('nord-nav-item')) {\n if (item !== target) {\n const isAncestor = ancestors.has(item)\n item.open = isAncestor || (this.allowItemsToRemainOpen && item.open)\n item.active = isAncestor\n }\n }\n\n // this is a one-time thing, purely for initial open state\n this.allowItemsToRemainOpen = false\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-navigation': Navigation\n }\n}\n","import { html, LitElement } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\nimport componentStyle from '../common/styles/Component.css'\nimport style from './NotificationGroup.css'\n\n/**\n * Notification group is used to position and style a group of notifications.\n *\n * @status ready\n * @category feedback\n * @slot - Default slot in which to place notifications.\n *\n * @fires {NordEvent} dismiss - Fired when a notification is dismissed, and its exit animation has completed. This event should be used to remove the dismissed notification from the DOM.\n */\n@customElement('nord-notification-group')\nexport default class NotificationGroup extends LitElement {\n static styles = [componentStyle, style]\n\n render() {\n return html`\n <div class=\"n-notification-group\">\n <slot></slot>\n </div>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-notification-group': NotificationGroup\n }\n}\n","import type { LitElement } from 'lit'\nimport type { Ref } from 'lit/directives/ref.js'\nimport { state } from 'lit/decorators.js'\nimport { createRef } from 'lit/directives/ref.js'\nimport { animation, NordEvent } from '../events.js'\n\ntype Constructor<T = Record<string, unknown>> = new (...args: any[]) => T\n\nexport declare class NotificationMixinInterface {\n protected dismissed: boolean\n protected notificationRef: Ref<HTMLElement>\n dismiss(): Promise<void>\n}\n\nexport function NotificationMixin<T extends Constructor<LitElement>>(\n superClass: T,\n): Constructor<NotificationMixinInterface> & T {\n class NotificationElement extends superClass {\n protected notificationRef = createRef<HTMLElement>()\n\n @state() protected dismissed = false\n\n /**\n * Programmatically dismiss the notification.\n * The returned promise resolves when notification's exit animation is complete.\n */\n async dismiss() {\n if (this.notificationRef.value) {\n this.dismissed = true\n await animation(this.notificationRef.value)\n this.dispatchEvent(new NordEvent('dismiss'))\n }\n }\n }\n\n return NotificationElement as unknown as Constructor<NotificationMixinInterface> & T\n}\n","import { html, LitElement } from 'lit'\nimport { customElement } from 'lit/decorators.js'\nimport { classMap } from 'lit/directives/class-map.js'\nimport { ref } from 'lit/directives/ref.js'\n\nimport { NotificationMixin } from '../common/mixins/NotificationMixin.js'\nimport componentStyle from '../common/styles/Component.css'\nimport { LocalizeController } from '../localization/LocalizeController.js'\nimport style from './Notification.css'\nimport '../stack/Stack.js'\nimport '../icon/Icon.js'\n\n/**\n * Notifications provide important information that requires action or acknowledgement.\n * A notification is displayed until the user dismisses it.\n *\n * @status ready\n * @category feedback\n * @slot - Default slot used for the notification text/message.\n * @slot icon - Slot used for the notification icon.\n * @fires dismiss - Fired when the notification is dismissed, and its exit animation has completed. This event should be used to remove the dismissed notification from the DOM.\n * @localization dismissLabel - Accessible label for the dismiss button.\n */\n@customElement('nord-notification')\nexport default class Notification extends NotificationMixin(LitElement) {\n static styles = [componentStyle, style]\n\n private localize = new LocalizeController<'nord-notification'>(this)\n\n render() {\n return html`\n <div ${ref(this.notificationRef)} class=${classMap({ 'n-notification': true, 'n-dismissed': this.dismissed })}>\n <button class=\"n-dismiss\" @click=${this.dismiss}>\n <nord-icon name=\"interface-close-small\" size=\"xs\" label=${this.localize.term('dismissLabel')}></nord-icon>\n </button>\n\n <nord-stack align-items=\"stretch\" direction=\"horizontal\">\n <slot name=\"icon\">\n <nord-icon name=\"navigation-notifications\"></nord-icon>\n </slot>\n <div class=\"n-notification-body\">\n <slot></slot>\n </div>\n </nord-stack>\n </div>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-notification': Notification\n }\n}\n","import { html, LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { ref } from 'lit/directives/ref.js'\nimport { FocusableMixin } from '../common/mixins/FocusableMixin.js'\n\nimport componentStyle from '../common/styles/Component.css'\nimport style from './ProgressBar.css'\n\n/**\n * Progress Bar is used to visually represent the completion\n * of a task or process. It shows how much of the task has\n * been completed and how much is still left.\n *\n * @status ready\n * @category feedback\n *\n * @cssprop [--n-progress-size=var(--n-space-s)] - Controls the thickness of the progress bar, using our [spacing tokens](/tokens/#space).\n * @cssprop [--n-progress-border-radius=var(--n-border-radius-s)] - Controls how rounded the corners are, using [border radius tokens](/tokens/#border-radius).\n * @cssprop [--n-progress-color=var(--n-color-accent)] - Controls the color of the progress bar, using [color tokens](/tokens/#color).\n */\n@customElement('nord-progress-bar')\nexport default class ProgressBar extends FocusableMixin(LitElement) {\n static styles = [componentStyle, style]\n\n /**\n * Specifies how much of the task has been completed. Must be a valid floating\n * point number between 0 and max, or between 0 and 100 if max is omitted. If\n * there is no value, the progress bar is indeterminate; this indicates that\n * an activity is ongoing with no indication of how long it’s expected to take.\n */\n @property({ reflect: true, type: Number }) value?: number\n\n /**\n * Describes how much work the task indicated by the progress element requires.\n * The max attribute, if present, must have a value greater than 0 and be a\n * valid floating point number.\n */\n @property({ reflect: true, type: Number }) max: number = 100\n\n /**\n * Accessible label for the progress indicator. Visually hidden, but shown\n * for assistive technology.\n */\n @property({ reflect: true }) label: string = 'Current progress'\n\n render() {\n /**\n * The Aria properties are required for now due to a Chrome bug.\n * In the future we can probably get rid of them. For context:\n * https://bugs.chromium.org/p/chromium/issues/detail?id=1310779\n */\n return html`<label>\n <nord-visually-hidden>${this.label}</nord-visually-hidden>\n <progress\n ${ref(this.focusableRef)}\n aria-valuenow=${ifDefined(this.value)}\n aria-valuemin=\"0\"\n aria-valuemax=${this.max}\n tabindex=\"-1\"\n max=${this.max}\n value=${ifDefined(this.value)}\n ></progress>\n </label>`\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-progress-bar': ProgressBar\n }\n}\n","import { html, LitElement, svg } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { cond } from '../common/directives/cond.js'\nimport componentStyle from '../common/styles/Component.css'\nimport style from './Progress.css'\n\nconst CX = 11.25\nconst CY = 11.25\nconst OUTER_RADIUS = 9\nconst INNER_RADIUS = 6\n\nlet instanceCounter = 0\n\n/**\n * Generates an SVG path for a pie sector starting from 12 o'clock, sweeping clockwise.\n * @param percent - The progress percentage (0-100)\n * @returns The SVG path data string\n */\nfunction sectorPath(percent: number): string {\n const p = Math.max(0, Math.min(100, percent))\n if (p === 0)\n return ''\n if (p === 100) {\n return `M${CX},${CY - INNER_RADIUS}\n A${INNER_RADIUS},${INNER_RADIUS} 0 1 1 ${CX},${CY + INNER_RADIUS}\n A${INNER_RADIUS},${INNER_RADIUS} 0 1 1 ${CX},${CY - INNER_RADIUS} Z`\n }\n const sweep = (p / 100) * 360\n const theta = (-90 + sweep) * (Math.PI / 180)\n const ex = CX + INNER_RADIUS * Math.cos(theta)\n const ey = CY + INNER_RADIUS * Math.sin(theta)\n const large = sweep > 180 ? 1 : 0\n return `M${CX},${CY}\n L${CX},${CY - INNER_RADIUS}\n A${INNER_RADIUS},${INNER_RADIUS} 0 ${large},1 ${ex},${ey}\n Z`\n}\n\n/**\n * Progress component is used to display a circular pie-chart style progress indicator.\n * You can customize the size and color of the progress indicator with the\n * provided properties.\n *\n * @status ready\n * @category feedback\n * @cssprop [--n-progress-color=var(--n-color-accent)] - Controls the color of the progress indicator.\n */\n@customElement('nord-progress')\nexport default class Progress extends LitElement {\n static styles = [componentStyle, style]\n\n /**\n * The size of the progress indicator.\n */\n @property({ reflect: true }) size: 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl' = 'm'\n\n /**\n * The color of the progress indicator.\n * Can accept any valid CSS color value, including custom properties.\n * Takes precedence over the `--n-progress-color` CSS custom property.\n */\n @property({ reflect: true }) color?: string\n\n /**\n * An accessible label for the progress indicator.\n * If no label is supplied, the component is hidden from assistive technology.\n */\n @property({ reflect: true }) label?: string\n\n /**\n * The progress percentage value.\n */\n @property({ reflect: true, type: Number }) progress: number = 0\n\n /**\n * Internal state for the animated progress value.\n */\n @state() private _animatedProgress: number = 0\n\n /**\n * Animation frame ID for cleanup.\n */\n private _animationId: number | null = null\n\n /**\n * Target progress for animation.\n */\n private _targetProgress: number = 0\n\n /**\n * Unique ID for this component instance, used for SVG clipPath.\n */\n private _instanceId: number = 0\n\n constructor() {\n super()\n this._instanceId = instanceCounter++\n }\n\n connectedCallback() {\n super.connectedCallback()\n this._animatedProgress = this.progress\n this._targetProgress = this.progress\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n if (this._animationId !== null) {\n cancelAnimationFrame(this._animationId)\n this._animationId = null\n }\n }\n\n updated(changedProperties: Map<string, unknown>) {\n if (changedProperties.has('progress')) {\n this._targetProgress = Math.max(0, Math.min(100, this.progress))\n this._animate()\n }\n }\n\n private _animate() {\n if (this._animationId !== null) {\n cancelAnimationFrame(this._animationId)\n }\n\n const animate = () => {\n const diff = this._targetProgress - this._animatedProgress\n if (Math.abs(diff) < 0.5) {\n this._animatedProgress = this._targetProgress\n this._animationId = null\n return\n }\n // Ease towards target with smooth interpolation\n this._animatedProgress += diff * 0.15\n this._animationId = requestAnimationFrame(animate)\n }\n\n this._animationId = requestAnimationFrame(animate)\n }\n\n private get _clampedProgress(): number {\n return Math.max(0, Math.min(100, this._animatedProgress))\n }\n\n /**\n * Check if the color is a semantic value handled by CSS.\n */\n private get _isSemanticColor(): boolean {\n return ['success', 'warning', 'danger', 'highlight', 'info'].includes(this.color ?? '')\n }\n\n /**\n * Get the custom color style if not a semantic value.\n */\n private get _customColorStyle(): string | undefined {\n if (this.color && !this._isSemanticColor) {\n return `--_n-progress-color:${this.color}`\n }\n return undefined\n }\n\n render() {\n const hasLabel = Boolean(this.label)\n const pathData = sectorPath(this._clampedProgress)\n const clipId = `n-progress-clip-${this._instanceId}`\n\n return html`\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 22.5 22.5\"\n fill=\"none\"\n role=${cond(hasLabel, 'progressbar')}\n aria-label=${ifDefined(this.label)}\n aria-valuenow=${cond(hasLabel, Math.round(this._clampedProgress))}\n aria-valuemin=${cond(hasLabel, '0')}\n aria-valuemax=${cond(hasLabel, '100')}\n aria-hidden=${cond(!hasLabel, 'true')}\n style=${ifDefined(this._customColorStyle)}\n >\n <g clip-path=\"url(#${clipId})\">\n <rect x=\"1.25\" y=\"1.25\" width=\"20\" height=\"20\" rx=\"10\" fill=\"var(--_n-progress-background)\" />\n <circle\n cx=\"${CX}\"\n cy=\"${CY}\"\n r=\"${OUTER_RADIUS}\"\n fill=\"var(--_n-progress-background)\"\n stroke=\"var(--_n-progress-color)\"\n stroke-width=\"2\"\n />\n ${svg`<path fill=\"var(--_n-progress-color)\" d=\"${pathData}\" />`}\n </g>\n <rect\n x=\"0.625\"\n y=\"0.625\"\n width=\"21.25\"\n height=\"21.25\"\n rx=\"10.625\"\n stroke=\"var(--_n-progress-background)\"\n stroke-width=\"1.25\"\n />\n <defs>\n <clipPath id=\"${clipId}\">\n <rect x=\"1.25\" y=\"1.25\" width=\"20\" height=\"20\" rx=\"10\" fill=\"white\" />\n </clipPath>\n </defs>\n </svg>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-progress': Progress\n }\n}\n","/*!\nCopyright (c) 2023 Paul Miller (paulmillr.com)\nThe library paulmillr-qr is dual-licensed under the Apache 2.0 OR MIT license.\nYou can select a license of your choice.\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n/**\n * Methods for encoding (generating) QR code patterns.\n * Check out decode.ts for decoding (reading).\n * @module\n * @example\n```js\nimport encodeQR from '@paulmillr/qr';\nconst txt = 'Hello world';\nconst ascii = encodeQR(txt, 'ascii'); // Not all fonts are supported\nconst terminalFriendly = encodeQR(txt, 'term'); // 2x larger, all fonts are OK\nconst gifBytes = encodeQR(txt, 'gif'); // Uncompressed GIF\nconst svgElement = encodeQR(txt, 'svg'); // SVG vector image element\nconst array = encodeQR(txt, 'raw'); // 2d array for canvas or other libs\n// import decodeQR from '@paulmillr/qr/decode';\n```\n */\n// We do not use newline escape code directly in strings because it's not parser-friendly\nconst chCodes = { newline: 10, reset: 27 };\nfunction assertNumber(n) {\n if (!Number.isSafeInteger(n))\n throw new Error(`integer expected: ${n}`);\n}\nfunction validateVersion(ver) {\n if (!Number.isSafeInteger(ver) || ver < 1 || ver > 40)\n throw new Error(`Invalid version=${ver}. Expected number [1..40]`);\n}\nfunction bin(dec, pad) {\n return dec.toString(2).padStart(pad, '0');\n}\nfunction mod(a, b) {\n const result = a % b;\n return result >= 0 ? result : b + result;\n}\nfunction fillArr(length, val) {\n return new Array(length).fill(val);\n}\n/**\n * Interleaves byte blocks.\n * @param blocks [[1, 2, 3], [4, 5, 6]]\n * @returns [1, 4, 2, 5, 3, 6]\n */\nfunction interleaveBytes(...blocks) {\n let len = 0;\n for (const b of blocks)\n len = Math.max(len, b.length);\n const res = [];\n for (let i = 0; i < len; i++) {\n for (const b of blocks) {\n if (i >= b.length)\n continue; // outside of block, skip\n res.push(b[i]);\n }\n }\n return new Uint8Array(res);\n}\nfunction includesAt(lst, pattern, index) {\n if (index < 0 || index + pattern.length > lst.length)\n return false;\n for (let i = 0; i < pattern.length; i++)\n if (pattern[i] !== lst[index + i])\n return false;\n return true;\n}\n// Optimize for minimal score/penalty\nfunction best() {\n let best;\n let bestScore = Infinity;\n return {\n add(score, value) {\n if (score >= bestScore)\n return;\n best = value;\n bestScore = score;\n },\n get: () => best,\n score: () => bestScore,\n };\n}\n// Based on https://github.com/paulmillr/scure-base/blob/main/index.ts\nfunction alphabet(alphabet) {\n return {\n has: (char) => alphabet.includes(char),\n decode: (input) => {\n if (!Array.isArray(input) || (input.length && typeof input[0] !== 'string'))\n throw new Error('alphabet.decode input should be array of strings');\n return input.map((letter) => {\n if (typeof letter !== 'string')\n throw new Error(`alphabet.decode: not string element=${letter}`);\n const index = alphabet.indexOf(letter);\n if (index === -1)\n throw new Error(`Unknown letter: \"${letter}\". Allowed: ${alphabet}`);\n return index;\n });\n },\n encode: (digits) => {\n if (!Array.isArray(digits) || (digits.length && typeof digits[0] !== 'number'))\n throw new Error('alphabet.encode input should be an array of numbers');\n return digits.map((i) => {\n assertNumber(i);\n if (i < 0 || i >= alphabet.length)\n throw new Error(`Digit index outside alphabet: ${i} (alphabet: ${alphabet.length})`);\n return alphabet[i];\n });\n },\n };\n}\nexport class Bitmap {\n static size(size, limit) {\n if (typeof size === 'number')\n size = { height: size, width: size };\n if (!Number.isSafeInteger(size.height) && size.height !== Infinity)\n throw new Error(`Bitmap: invalid height=${size.height} (${typeof size.height})`);\n if (!Number.isSafeInteger(size.width) && size.width !== Infinity)\n throw new Error(`Bitmap: invalid width=${size.width} (${typeof size.width})`);\n if (limit !== undefined) {\n // Clamp length, so it won't overflow, also allows to use Infinity, so we draw until end\n size = {\n width: Math.min(size.width, limit.width),\n height: Math.min(size.height, limit.height),\n };\n }\n return size;\n }\n static fromString(s) {\n // Remove linebreaks on start and end, so we draw in `` section\n s = s.replace(/^\\n+/g, '').replace(/\\n+$/g, '');\n const lines = s.split(String.fromCharCode(chCodes.newline));\n const height = lines.length;\n const data = new Array(height);\n let width;\n for (const line of lines) {\n const row = line.split('').map((i) => {\n if (i === 'X')\n return true;\n if (i === ' ')\n return false;\n if (i === '?')\n return undefined;\n throw new Error(`Bitmap.fromString: unknown symbol=${i}`);\n });\n if (width && row.length !== width)\n throw new Error(`Bitmap.fromString different row sizes: width=${width} cur=${row.length}`);\n width = row.length;\n data.push(row);\n }\n if (!width)\n width = 0;\n return new Bitmap({ height, width }, data);\n }\n constructor(size, data) {\n const { height, width } = Bitmap.size(size);\n this.data = data || Array.from({ length: height }, () => fillArr(width, undefined));\n this.height = height;\n this.width = width;\n }\n point(p) {\n return this.data[p.y][p.x];\n }\n isInside(p) {\n return 0 <= p.x && p.x < this.width && 0 <= p.y && p.y < this.height;\n }\n size(offset) {\n if (!offset)\n return { height: this.height, width: this.width };\n const { x, y } = this.xy(offset);\n return { height: this.height - y, width: this.width - x };\n }\n xy(c) {\n if (typeof c === 'number')\n c = { x: c, y: c };\n if (!Number.isSafeInteger(c.x))\n throw new Error(`Bitmap: invalid x=${c.x}`);\n if (!Number.isSafeInteger(c.y))\n throw new Error(`Bitmap: invalid y=${c.y}`);\n // Do modulo, so we can use negative positions\n c.x = mod(c.x, this.width);\n c.y = mod(c.y, this.height);\n return c;\n }\n // Basically every operation can be represented as rect\n rect(c, size, value) {\n const { x, y } = this.xy(c);\n const { height, width } = Bitmap.size(size, this.size({ x, y }));\n for (let yPos = 0; yPos < height; yPos++) {\n for (let xPos = 0; xPos < width; xPos++) {\n // NOTE: we use give function relative coordinates inside box\n this.data[y + yPos][x + xPos] =\n typeof value === 'function'\n ? value({ x: xPos, y: yPos }, this.data[y + yPos][x + xPos])\n : value;\n }\n }\n return this;\n }\n // returns rectangular part of bitmap\n rectRead(c, size, fn) {\n return this.rect(c, size, (c, cur) => {\n fn(c, cur);\n return cur;\n });\n }\n // Horizontal & vertical lines\n hLine(c, len, value) {\n return this.rect(c, { width: len, height: 1 }, value);\n }\n vLine(c, len, value) {\n return this.rect(c, { width: 1, height: len }, value);\n }\n // add border\n border(border = 2, value) {\n const height = this.height + 2 * border;\n const width = this.width + 2 * border;\n const v = fillArr(border, value);\n const h = Array.from({ length: border }, () => fillArr(width, value));\n return new Bitmap({ height, width }, [...h, ...this.data.map((i) => [...v, ...i, ...v]), ...h]);\n }\n // Embed another bitmap on coordinates\n embed(c, bm) {\n return this.rect(c, bm.size(), ({ x, y }) => bm.data[y][x]);\n }\n // returns rectangular part of bitmap\n rectSlice(c, size = this.size()) {\n const rect = new Bitmap(Bitmap.size(size, this.size(this.xy(c))));\n this.rect(c, size, ({ x, y }, cur) => (rect.data[y][x] = cur));\n return rect;\n }\n // Change shape, replace rows with columns (data[y][x] -> data[x][y])\n inverse() {\n const { height, width } = this;\n const res = new Bitmap({ height: width, width: height });\n return res.rect({ x: 0, y: 0 }, Infinity, ({ x, y }) => this.data[x][y]);\n }\n // Each pixel size is multiplied by factor\n scale(factor) {\n if (!Number.isSafeInteger(factor) || factor > 1024)\n throw new Error(`invalid scale factor: ${factor}`);\n const { height, width } = this;\n const res = new Bitmap({ height: factor * height, width: factor * width });\n return res.rect({ x: 0, y: 0 }, Infinity, ({ x, y }) => this.data[Math.floor(y / factor)][Math.floor(x / factor)]);\n }\n clone() {\n const res = new Bitmap(this.size());\n return res.rect({ x: 0, y: 0 }, this.size(), ({ x, y }) => this.data[y][x]);\n }\n // Ensure that there is no undefined values left\n assertDrawn() {\n this.rectRead(0, Infinity, (_, cur) => {\n if (typeof cur !== 'boolean')\n throw new Error(`Invalid color type=${typeof cur}`);\n });\n }\n // Simple string representation for debugging\n toString() {\n return this.data\n .map((i) => i.map((j) => (j === undefined ? '?' : j ? 'X' : ' ')).join(''))\n .join(String.fromCharCode(chCodes.newline));\n }\n toASCII() {\n const { height, width, data } = this;\n let out = '';\n // Terminal character height is x2 of character width, so we process two rows of bitmap\n // to produce one row of ASCII\n for (let y = 0; y < height; y += 2) {\n for (let x = 0; x < width; x++) {\n const first = data[y][x];\n const second = y + 1 >= height ? true : data[y + 1][x]; // if last row outside bitmap, make it black\n if (!first && !second)\n out += '█'; // both rows white (empty)\n else if (!first && second)\n out += '▀'; // top row white\n else if (first && !second)\n out += '▄'; // down row white\n else if (first && second)\n out += ' '; // both rows black\n }\n out += String.fromCharCode(chCodes.newline);\n }\n return out;\n }\n toTerm() {\n const cc = String.fromCharCode(chCodes.reset);\n const reset = cc + '[0m';\n const whiteBG = cc + '[1;47m ' + reset;\n const darkBG = cc + `[40m ` + reset;\n return this.data\n .map((i) => i.map((j) => (j ? darkBG : whiteBG)).join(''))\n .join(String.fromCharCode(chCodes.newline));\n }\n toSVG(optimize = true) {\n let out = `<svg viewBox=\"0 0 ${this.width} ${this.height}\" xmlns=\"http://www.w3.org/2000/svg\">`;\n // Construct optimized SVG path data.\n let pathData = '';\n let prevPoint;\n this.rectRead(0, Infinity, (point, val) => {\n if (!val)\n return;\n const { x, y } = point;\n if (!optimize) {\n out += `<rect x=\"${x}\" y=\"${y}\" width=\"1\" height=\"1\" />`;\n return;\n }\n // https://developer.mozilla.org/en-US/docs/Web/SVG/Reference/Attribute/d#path_commands\n // Determine the shortest way to represent the initial cursor movement.\n // M - Move cursor (without drawing) to absolute coordinate pair.\n let m = `M${x} ${y}`;\n // Only allow using the relative cursor move command if previous points\n // were drawn.\n if (prevPoint) {\n // m - Move cursor (without drawing) to relative coordinate pair.\n const relM = `m${x - prevPoint.x} ${y - prevPoint.y}`;\n if (relM.length <= m.length)\n m = relM;\n }\n // Determine the shortest way to represent the cell's bottom line draw.\n // H - Draw line from cursor position to absolute x coordinate.\n // h - Draw line from cursor position to relative x coordinate.\n const bH = x < 10 ? `H${x}` : 'h-1';\n // v - Draw line from cursor position to relative y coordinate.\n // Z - Close path (draws line from cursor position to M coordinate).\n pathData += `${m}h1v1${bH}Z`;\n prevPoint = point;\n });\n if (optimize)\n out += `<path d=\"${pathData}\"/>`;\n out += `</svg>`;\n return out;\n }\n toGIF() {\n // NOTE: Small, but inefficient implementation.\n // Uses 1 byte per pixel.\n const u16le = (i) => [i & 0xff, (i >>> 8) & 0xff];\n const dims = [...u16le(this.width), ...u16le(this.height)];\n const data = [];\n this.rectRead(0, Infinity, (_, cur) => data.push(+(cur === true)));\n const N = 126; // Block size\n // prettier-ignore\n const bytes = [\n 0x47, 0x49, 0x46, 0x38, 0x37, 0x61, ...dims, 0xf6, 0x00, 0x00, 0xff, 0xff, 0xff,\n ...fillArr(3 * 127, 0x00), 0x2c, 0x00, 0x00, 0x00, 0x00, ...dims, 0x00, 0x07\n ];\n const fullChunks = Math.floor(data.length / N);\n // Full blocks\n for (let i = 0; i < fullChunks; i++)\n bytes.push(N + 1, 0x80, ...data.slice(N * i, N * (i + 1)).map((i) => +i));\n // Remaining bytes\n bytes.push((data.length % N) + 1, 0x80, ...data.slice(fullChunks * N).map((i) => +i));\n bytes.push(0x01, 0x81, 0x00, 0x3b);\n return new Uint8Array(bytes);\n }\n toImage(isRGB = false) {\n const { height, width } = this.size();\n const data = new Uint8Array(height * width * (isRGB ? 3 : 4));\n let i = 0;\n for (let y = 0; y < height; y++) {\n for (let x = 0; x < width; x++) {\n const value = !!this.data[y][x] ? 0 : 255;\n data[i++] = value;\n data[i++] = value;\n data[i++] = value;\n if (!isRGB)\n data[i++] = 255; // alpha channel\n }\n }\n return { height, width, data };\n }\n}\n// End of utils\n// Runtime type-checking\n/** Error correction mode. low: 7%, medium: 15%, quartile: 25%, high: 30% */\nexport const ECMode = ['low', 'medium', 'quartile', 'high'];\n/** QR Code encoding */\nexport const Encoding = ['numeric', 'alphanumeric', 'byte', 'kanji', 'eci'];\n// Various constants & tables\n// prettier-ignore\nconst BYTES = [\n // 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n 26, 44, 70, 100, 134, 172, 196, 242, 292, 346, 404, 466, 532, 581, 655, 733, 815, 901, 991, 1085,\n // 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40\n 1156, 1258, 1364, 1474, 1588, 1706, 1828, 1921, 2051, 2185, 2323, 2465, 2611, 2761, 2876, 3034, 3196, 3362, 3532, 3706,\n];\n// prettier-ignore\nconst WORDS_PER_BLOCK = {\n // Version 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40\n low: [7, 10, 15, 20, 26, 18, 20, 24, 30, 18, 20, 24, 26, 30, 22, 24, 28, 30, 28, 28, 28, 28, 30, 30, 26, 28, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30],\n medium: [10, 16, 26, 18, 24, 16, 18, 22, 22, 26, 30, 22, 22, 24, 24, 28, 28, 26, 26, 26, 26, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28],\n quartile: [13, 22, 18, 26, 18, 24, 18, 22, 20, 24, 28, 26, 24, 20, 30, 24, 28, 28, 26, 30, 28, 30, 30, 30, 30, 28, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30],\n high: [17, 28, 22, 16, 22, 28, 26, 26, 24, 28, 24, 28, 22, 24, 24, 30, 28, 28, 26, 28, 30, 24, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30],\n};\n// prettier-ignore\nconst ECC_BLOCKS = {\n // Version 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40\n low: [1, 1, 1, 1, 1, 2, 2, 2, 2, 4, 4, 4, 4, 4, 6, 6, 6, 6, 7, 8, 8, 9, 9, 10, 12, 12, 12, 13, 14, 15, 16, 17, 18, 19, 19, 20, 21, 22, 24, 25],\n medium: [1, 1, 1, 2, 2, 4, 4, 4, 5, 5, 5, 8, 9, 9, 10, 10, 11, 13, 14, 16, 17, 17, 18, 20, 21, 23, 25, 26, 28, 29, 31, 33, 35, 37, 38, 40, 43, 45, 47, 49],\n quartile: [1, 1, 2, 2, 4, 4, 6, 6, 8, 8, 8, 10, 12, 16, 12, 17, 16, 18, 21, 20, 23, 23, 25, 27, 29, 34, 34, 35, 38, 40, 43, 45, 48, 51, 53, 56, 59, 62, 65, 68],\n high: [1, 1, 2, 4, 4, 4, 5, 6, 8, 8, 11, 11, 16, 16, 18, 16, 19, 21, 25, 25, 25, 34, 30, 32, 35, 37, 40, 42, 45, 48, 51, 54, 57, 60, 63, 66, 70, 74, 77, 81],\n};\nconst info = {\n size: {\n encode: (ver) => 21 + 4 * (ver - 1), // ver1 = 21, ver40=177 blocks\n decode: (size) => (size - 17) / 4,\n },\n sizeType: (ver) => Math.floor((ver + 7) / 17),\n // Based on https://codereview.stackexchange.com/questions/74925/algorithm-to-generate-this-alignment-pattern-locations-table-for-qr-codes\n alignmentPatterns(ver) {\n if (ver === 1)\n return [];\n const first = 6;\n const last = info.size.encode(ver) - first - 1;\n const distance = last - first;\n const count = Math.ceil(distance / 28);\n let interval = Math.floor(distance / count);\n if (interval % 2)\n interval += 1;\n else if ((distance % count) * 2 >= count)\n interval += 2;\n const res = [first];\n for (let m = 1; m < count; m++)\n res.push(last - (count - m) * interval);\n res.push(last);\n return res;\n },\n ECCode: {\n low: 0b01,\n medium: 0b00,\n quartile: 0b11,\n high: 0b10,\n },\n formatMask: 0b101010000010010,\n formatBits(ecc, maskIdx) {\n const data = (info.ECCode[ecc] << 3) | maskIdx;\n let d = data;\n for (let i = 0; i < 10; i++)\n d = (d << 1) ^ ((d >> 9) * 0b10100110111);\n return ((data << 10) | d) ^ info.formatMask;\n },\n versionBits(ver) {\n let d = ver;\n for (let i = 0; i < 12; i++)\n d = (d << 1) ^ ((d >> 11) * 0b1111100100101);\n return (ver << 12) | d;\n },\n alphabet: {\n numeric: alphabet('0123456789'),\n alphanumerc: alphabet('0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:'),\n }, // as Record<EncodingType, ReturnType<typeof alphabet>>,\n lengthBits(ver, type) {\n const table = {\n numeric: [10, 12, 14],\n alphanumeric: [9, 11, 13],\n byte: [8, 16, 16],\n kanji: [8, 10, 12],\n eci: [0, 0, 0],\n };\n return table[type][info.sizeType(ver)];\n },\n modeBits: {\n numeric: '0001',\n alphanumeric: '0010',\n byte: '0100',\n kanji: '1000',\n eci: '0111',\n },\n capacity(ver, ecc) {\n const bytes = BYTES[ver - 1];\n const words = WORDS_PER_BLOCK[ecc][ver - 1];\n const numBlocks = ECC_BLOCKS[ecc][ver - 1];\n const blockLen = Math.floor(bytes / numBlocks) - words;\n const shortBlocks = numBlocks - (bytes % numBlocks);\n return {\n words,\n numBlocks,\n shortBlocks,\n blockLen,\n capacity: (bytes - words * numBlocks) * 8,\n total: (words + blockLen) * numBlocks + numBlocks - shortBlocks,\n };\n },\n};\nconst PATTERNS = [\n (x, y) => (x + y) % 2 == 0,\n (_x, y) => y % 2 == 0,\n (x, _y) => x % 3 == 0,\n (x, y) => (x + y) % 3 == 0,\n (x, y) => (Math.floor(y / 2) + Math.floor(x / 3)) % 2 == 0,\n (x, y) => ((x * y) % 2) + ((x * y) % 3) == 0,\n (x, y) => (((x * y) % 2) + ((x * y) % 3)) % 2 == 0,\n (x, y) => (((x + y) % 2) + ((x * y) % 3)) % 2 == 0,\n];\n// Galois field && reed-solomon encoding\nconst GF = {\n tables: ((p_poly) => {\n const exp = fillArr(256, 0);\n const log = fillArr(256, 0);\n for (let i = 0, x = 1; i < 256; i++) {\n exp[i] = x;\n log[x] = i;\n x <<= 1;\n if (x & 0x100)\n x ^= p_poly;\n }\n return { exp, log };\n })(0x11d),\n exp: (x) => GF.tables.exp[x],\n log(x) {\n if (x === 0)\n throw new Error(`GF.log: invalid arg=${x}`);\n return GF.tables.log[x] % 255;\n },\n mul(x, y) {\n if (x === 0 || y === 0)\n return 0;\n return GF.tables.exp[(GF.tables.log[x] + GF.tables.log[y]) % 255];\n },\n add: (x, y) => x ^ y,\n pow: (x, e) => GF.tables.exp[(GF.tables.log[x] * e) % 255],\n inv(x) {\n if (x === 0)\n throw new Error(`GF.inverse: invalid arg=${x}`);\n return GF.tables.exp[255 - GF.tables.log[x]];\n },\n polynomial(poly) {\n if (poly.length == 0)\n throw new Error('GF.polymomial: invalid length');\n if (poly[0] !== 0)\n return poly;\n // Strip leading zeros\n let i = 0;\n for (; i < poly.length - 1 && poly[i] == 0; i++)\n ;\n return poly.slice(i);\n },\n monomial(degree, coefficient) {\n if (degree < 0)\n throw new Error(`GF.monomial: invalid degree=${degree}`);\n if (coefficient == 0)\n return [0];\n let coefficients = fillArr(degree + 1, 0);\n coefficients[0] = coefficient;\n return GF.polynomial(coefficients);\n },\n degree: (a) => a.length - 1,\n coefficient: (a, degree) => a[GF.degree(a) - degree],\n mulPoly(a, b) {\n if (a[0] === 0 || b[0] === 0)\n return [0];\n const res = fillArr(a.length + b.length - 1, 0);\n for (let i = 0; i < a.length; i++) {\n for (let j = 0; j < b.length; j++) {\n res[i + j] = GF.add(res[i + j], GF.mul(a[i], b[j]));\n }\n }\n return GF.polynomial(res);\n },\n mulPolyScalar(a, scalar) {\n if (scalar == 0)\n return [0];\n if (scalar == 1)\n return a;\n const res = fillArr(a.length, 0);\n for (let i = 0; i < a.length; i++)\n res[i] = GF.mul(a[i], scalar);\n return GF.polynomial(res);\n },\n mulPolyMonomial(a, degree, coefficient) {\n if (degree < 0)\n throw new Error('GF.mulPolyMonomial: invalid degree');\n if (coefficient == 0)\n return [0];\n const res = fillArr(a.length + degree, 0);\n for (let i = 0; i < a.length; i++)\n res[i] = GF.mul(a[i], coefficient);\n return GF.polynomial(res);\n },\n addPoly(a, b) {\n if (a[0] === 0)\n return b;\n if (b[0] === 0)\n return a;\n let smaller = a;\n let larger = b;\n if (smaller.length > larger.length)\n [smaller, larger] = [larger, smaller];\n let sumDiff = fillArr(larger.length, 0);\n let lengthDiff = larger.length - smaller.length;\n let s = larger.slice(0, lengthDiff);\n for (let i = 0; i < s.length; i++)\n sumDiff[i] = s[i];\n for (let i = lengthDiff; i < larger.length; i++)\n sumDiff[i] = GF.add(smaller[i - lengthDiff], larger[i]);\n return GF.polynomial(sumDiff);\n },\n remainderPoly(data, divisor) {\n const out = Array.from(data);\n for (let i = 0; i < data.length - divisor.length + 1; i++) {\n const elm = out[i];\n if (elm === 0)\n continue;\n for (let j = 1; j < divisor.length; j++) {\n if (divisor[j] !== 0)\n out[i + j] = GF.add(out[i + j], GF.mul(divisor[j], elm));\n }\n }\n return out.slice(data.length - divisor.length + 1, out.length);\n },\n divisorPoly(degree) {\n let g = [1];\n for (let i = 0; i < degree; i++)\n g = GF.mulPoly(g, [1, GF.pow(2, i)]);\n return g;\n },\n evalPoly(poly, a) {\n if (a == 0)\n return GF.coefficient(poly, 0); // Just return the x^0 coefficient\n let res = poly[0];\n for (let i = 1; i < poly.length; i++)\n res = GF.add(GF.mul(a, res), poly[i]);\n return res;\n },\n // TODO: cleanup\n euclidian(a, b, R) {\n // Force degree(a) >= degree(b)\n if (GF.degree(a) < GF.degree(b))\n [a, b] = [b, a];\n let rLast = a;\n let r = b;\n let tLast = [0];\n let t = [1];\n // while degree of Ri ≥ t/2\n while (2 * GF.degree(r) >= R) {\n let rLastLast = rLast;\n let tLastLast = tLast;\n rLast = r;\n tLast = t;\n if (rLast[0] === 0)\n throw new Error('rLast[0] === 0');\n r = rLastLast;\n let q = [0];\n const dltInverse = GF.inv(rLast[0]);\n while (GF.degree(r) >= GF.degree(rLast) && r[0] !== 0) {\n const degreeDiff = GF.degree(r) - GF.degree(rLast);\n const scale = GF.mul(r[0], dltInverse);\n q = GF.addPoly(q, GF.monomial(degreeDiff, scale));\n r = GF.addPoly(r, GF.mulPolyMonomial(rLast, degreeDiff, scale));\n }\n q = GF.mulPoly(q, tLast);\n t = GF.addPoly(q, tLastLast);\n if (GF.degree(r) >= GF.degree(rLast))\n throw new Error(`Division failed r: ${r}, rLast: ${rLast}`);\n }\n const sigmaTildeAtZero = GF.coefficient(t, 0);\n if (sigmaTildeAtZero == 0)\n throw new Error('sigmaTilde(0) was zero');\n const inverse = GF.inv(sigmaTildeAtZero);\n return [GF.mulPolyScalar(t, inverse), GF.mulPolyScalar(r, inverse)];\n },\n};\nfunction RS(eccWords) {\n return {\n encode(from) {\n const d = GF.divisorPoly(eccWords);\n const pol = Array.from(from);\n pol.push(...d.slice(0, -1).fill(0));\n return Uint8Array.from(GF.remainderPoly(pol, d));\n },\n decode(to) {\n const res = to.slice();\n const poly = GF.polynomial(Array.from(to));\n // Find errors\n let syndrome = fillArr(eccWords, 0);\n let hasError = false;\n for (let i = 0; i < eccWords; i++) {\n const evl = GF.evalPoly(poly, GF.exp(i));\n syndrome[syndrome.length - 1 - i] = evl;\n if (evl !== 0)\n hasError = true;\n }\n if (!hasError)\n return res;\n syndrome = GF.polynomial(syndrome);\n const monomial = GF.monomial(eccWords, 1);\n const [errorLocator, errorEvaluator] = GF.euclidian(monomial, syndrome, eccWords);\n // Error locations\n const locations = fillArr(GF.degree(errorLocator), 0);\n let e = 0;\n for (let i = 1; i < 256 && e < locations.length; i++) {\n if (GF.evalPoly(errorLocator, i) === 0)\n locations[e++] = GF.inv(i);\n }\n if (e !== locations.length)\n throw new Error('RS.decode: invalid errors number');\n for (let i = 0; i < locations.length; i++) {\n const pos = res.length - 1 - GF.log(locations[i]);\n if (pos < 0)\n throw new Error('RS.decode: invalid error location');\n const xiInverse = GF.inv(locations[i]);\n let denominator = 1;\n for (let j = 0; j < locations.length; j++) {\n if (i === j)\n continue;\n denominator = GF.mul(denominator, GF.add(1, GF.mul(locations[j], xiInverse)));\n }\n res[pos] = GF.add(res[pos], GF.mul(GF.evalPoly(errorEvaluator, xiInverse), GF.inv(denominator)));\n }\n return res;\n },\n };\n}\n// Interleaves blocks\nfunction interleave(ver, ecc) {\n const { words, shortBlocks, numBlocks, blockLen, total } = info.capacity(ver, ecc);\n const rs = RS(words);\n return {\n encode(bytes) {\n // Add error correction to bytes\n const blocks = [];\n const eccBlocks = [];\n for (let i = 0; i < numBlocks; i++) {\n const isShort = i < shortBlocks;\n const len = blockLen + (isShort ? 0 : 1);\n blocks.push(bytes.subarray(0, len));\n eccBlocks.push(rs.encode(bytes.subarray(0, len)));\n bytes = bytes.subarray(len);\n }\n const resBlocks = interleaveBytes(...blocks);\n const resECC = interleaveBytes(...eccBlocks);\n const res = new Uint8Array(resBlocks.length + resECC.length);\n res.set(resBlocks);\n res.set(resECC, resBlocks.length);\n return res;\n },\n decode(data) {\n if (data.length !== total)\n throw new Error(`interleave.decode: len(data)=${data.length}, total=${total}`);\n const blocks = [];\n for (let i = 0; i < numBlocks; i++) {\n const isShort = i < shortBlocks;\n blocks.push(new Uint8Array(words + blockLen + (isShort ? 0 : 1)));\n }\n // Short blocks\n let pos = 0;\n for (let i = 0; i < blockLen; i++) {\n for (let j = 0; j < numBlocks; j++)\n blocks[j][i] = data[pos++];\n }\n // Long blocks\n for (let j = shortBlocks; j < numBlocks; j++)\n blocks[j][blockLen] = data[pos++];\n // ECC\n for (let i = blockLen; i < blockLen + words; i++) {\n for (let j = 0; j < numBlocks; j++) {\n const isShort = j < shortBlocks;\n blocks[j][i + (isShort ? 0 : 1)] = data[pos++];\n }\n }\n // Decode\n // Error-correct and copy data blocks together into a stream of bytes\n const res = [];\n for (const block of blocks)\n res.push(...Array.from(rs.decode(block)).slice(0, -words));\n return Uint8Array.from(res);\n },\n };\n}\n// Draw\n// Generic template per version+ecc+mask. Can be cached, to speedup calculations.\nfunction drawTemplate(ver, ecc, maskIdx, test = false) {\n const size = info.size.encode(ver);\n let b = new Bitmap(size + 2);\n // Finder patterns\n // We draw full pattern and later slice, since before addition of borders finder is truncated by one pixel on sides\n const finder = new Bitmap(3).rect(0, 3, true).border(1, false).border(1, true).border(1, false);\n b = b\n .embed(0, finder) // top left\n .embed({ x: -finder.width, y: 0 }, finder) // top right\n .embed({ x: 0, y: -finder.height }, finder); // bottom left\n b = b.rectSlice(1, size);\n // Alignment patterns\n const align = new Bitmap(1).rect(0, 1, true).border(1, false).border(1, true);\n const alignPos = info.alignmentPatterns(ver);\n for (const y of alignPos) {\n for (const x of alignPos) {\n if (b.data[y][x] !== undefined)\n continue;\n b.embed({ x: x - 2, y: y - 2 }, align); // center of pattern should be at position\n }\n }\n // Timing patterns\n b = b\n .hLine({ x: 0, y: 6 }, Infinity, ({ x }, cur) => (cur === undefined ? x % 2 == 0 : cur))\n .vLine({ x: 6, y: 0 }, Infinity, ({ y }, cur) => (cur === undefined ? y % 2 == 0 : cur));\n // Format information\n {\n const bits = info.formatBits(ecc, maskIdx);\n const getBit = (i) => !test && ((bits >> i) & 1) == 1;\n // vertical\n for (let i = 0; i < 6; i++)\n b.data[i][8] = getBit(i); // right of top-left finder\n // TODO: re-write as lines, like:\n // b.vLine({ x: 8, y: 0 }, 6, ({ x, y }) => getBit(y));\n for (let i = 6; i < 8; i++)\n b.data[i + 1][8] = getBit(i); // after timing pattern\n for (let i = 8; i < 15; i++)\n b.data[size - 15 + i][8] = getBit(i); // right of bottom-left finder\n // horizontal\n for (let i = 0; i < 8; i++)\n b.data[8][size - i - 1] = getBit(i); // under top-right finder\n for (let i = 8; i < 9; i++)\n b.data[8][15 - i - 1 + 1] = getBit(i); // VVV, after timing\n for (let i = 9; i < 15; i++)\n b.data[8][15 - i - 1] = getBit(i); // under top-left finder\n b.data[size - 8][8] = !test; // bottom-left finder, right\n }\n // Version information\n if (ver >= 7) {\n const bits = info.versionBits(ver);\n for (let i = 0; i < 18; i += 1) {\n const bit = !test && ((bits >> i) & 1) == 1;\n const x = Math.floor(i / 3);\n const y = (i % 3) + size - 8 - 3;\n // two copies\n b.data[x][y] = bit;\n b.data[y][x] = bit;\n }\n }\n return b;\n}\n// zigzag: bottom->top && top->bottom\nfunction zigzag(tpl, maskIdx, fn) {\n const size = tpl.height;\n const pattern = PATTERNS[maskIdx];\n // zig-zag pattern\n let dir = -1;\n let y = size - 1;\n // two columns at time\n for (let xOffset = size - 1; xOffset > 0; xOffset -= 2) {\n if (xOffset == 6)\n xOffset = 5; // skip vertical timing pattern\n for (;; y += dir) {\n for (let j = 0; j < 2; j += 1) {\n const x = xOffset - j;\n if (tpl.data[y][x] !== undefined)\n continue; // skip already written elements\n fn(x, y, pattern(x, y));\n }\n if (y + dir < 0 || y + dir >= size)\n break;\n }\n dir = -dir; // change direction\n }\n}\n// NOTE: byte encoding is just representation, QR works with strings only. Most decoders will fail on raw byte array,\n// since they expect unicode or other text encoding inside bytes\nfunction detectType(str) {\n let type = 'numeric';\n for (let x of str) {\n if (info.alphabet.numeric.has(x))\n continue;\n type = 'alphanumeric';\n if (!info.alphabet.alphanumerc.has(x))\n return 'byte';\n }\n return type;\n}\n/**\n * @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99])\n */\nexport function utf8ToBytes(str) {\n if (typeof str !== 'string')\n throw new Error(`utf8ToBytes expected string, got ${typeof str}`);\n return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809\n}\nfunction encode(ver, ecc, data, type) {\n let encoded = '';\n let dataLen = data.length;\n if (type === 'numeric') {\n const t = info.alphabet.numeric.decode(data.split(''));\n const n = t.length;\n for (let i = 0; i < n - 2; i += 3)\n encoded += bin(t[i] * 100 + t[i + 1] * 10 + t[i + 2], 10);\n if (n % 3 === 1) {\n encoded += bin(t[n - 1], 4);\n }\n else if (n % 3 === 2) {\n encoded += bin(t[n - 2] * 10 + t[n - 1], 7);\n }\n }\n else if (type === 'alphanumeric') {\n const t = info.alphabet.alphanumerc.decode(data.split(''));\n const n = t.length;\n for (let i = 0; i < n - 1; i += 2)\n encoded += bin(t[i] * 45 + t[i + 1], 11);\n if (n % 2 == 1)\n encoded += bin(t[n - 1], 6); // pad if odd number of chars\n }\n else if (type === 'byte') {\n const utf8 = utf8ToBytes(data);\n dataLen = utf8.length;\n encoded = Array.from(utf8)\n .map((i) => bin(i, 8))\n .join('');\n }\n else {\n throw new Error('encode: unsupported type');\n }\n const { capacity } = info.capacity(ver, ecc);\n const len = bin(dataLen, info.lengthBits(ver, type));\n let bits = info.modeBits[type] + len + encoded;\n if (bits.length > capacity)\n throw new Error('Capacity overflow');\n // Terminator\n bits += '0'.repeat(Math.min(4, Math.max(0, capacity - bits.length)));\n // Pad bits string untill full byte\n if (bits.length % 8)\n bits += '0'.repeat(8 - (bits.length % 8));\n // Add padding until capacity is full\n const padding = '1110110000010001';\n for (let idx = 0; bits.length !== capacity; idx++)\n bits += padding[idx % padding.length];\n // Convert a bitstring to array of bytes\n const bytes = Uint8Array.from(bits.match(/(.{8})/g).map((i) => Number(`0b${i}`)));\n return interleave(ver, ecc).encode(bytes);\n}\n// DRAW\nfunction drawQR(ver, ecc, data, maskIdx, test = false) {\n const b = drawTemplate(ver, ecc, maskIdx, test);\n let i = 0;\n const need = 8 * data.length;\n zigzag(b, maskIdx, (x, y, mask) => {\n let value = false;\n if (i < need) {\n value = ((data[i >>> 3] >> ((7 - i) & 7)) & 1) !== 0;\n i++;\n }\n b.data[y][x] = value !== mask; // !== as xor\n });\n if (i !== need)\n throw new Error('QR: bytes left after draw');\n return b;\n}\nfunction penalty(bm) {\n const inverse = bm.inverse();\n // Adjacent modules in row/column in same | No. of modules = (5 + i) color\n const sameColor = (row) => {\n let res = 0;\n for (let i = 0, same = 1, last = undefined; i < row.length; i++) {\n if (last === row[i]) {\n same++;\n if (i !== row.length - 1)\n continue; // handle last element\n }\n if (same >= 5)\n res += 3 + (same - 5);\n last = row[i];\n same = 1;\n }\n return res;\n };\n let adjacent = 0;\n bm.data.forEach((row) => (adjacent += sameColor(row)));\n inverse.data.forEach((column) => (adjacent += sameColor(column)));\n // Block of modules in same color (Block size = 2x2)\n let box = 0;\n let b = bm.data;\n const lastW = bm.width - 1;\n const lastH = bm.height - 1;\n for (let x = 0; x < lastW; x++) {\n for (let y = 0; y < lastH; y++) {\n const x1 = x + 1;\n const y1 = y + 1;\n if (b[x][y] === b[x1][y] && b[x1][y] === b[x][y1] && b[x1][y] === b[x1][y1]) {\n box += 3;\n }\n }\n }\n // 1:1:3:1:1 ratio (dark:light:dark:light:dark) pattern in row/column, preceded or followed by light area 4 modules wide\n const finderPattern = (row) => {\n const finderPattern = [true, false, true, true, true, false, true]; // dark:light:dark:light:dark\n const lightPattern = [false, false, false, false]; // light area 4 modules wide\n const p1 = [...finderPattern, ...lightPattern];\n const p2 = [...lightPattern, ...finderPattern];\n let res = 0;\n for (let i = 0; i < row.length; i++) {\n if (includesAt(row, p1, i))\n res += 40;\n if (includesAt(row, p2, i))\n res += 40;\n }\n return res;\n };\n let finder = 0;\n for (const row of bm.data)\n finder += finderPattern(row);\n for (const column of inverse.data)\n finder += finderPattern(column);\n // Proportion of dark modules in entire symbol\n // Add 10 points to a deviation of 5% increment or decrement in the proportion\n // ratio of dark module from the referential 50%\n let darkPixels = 0;\n bm.rectRead(0, Infinity, (_c, val) => (darkPixels += val ? 1 : 0));\n const darkPercent = (darkPixels / (bm.height * bm.width)) * 100;\n const dark = 10 * Math.floor(Math.abs(darkPercent - 50) / 5);\n return adjacent + box + finder + dark;\n}\n// Selects best mask according to penalty, if no mask is provided\nfunction drawQRBest(ver, ecc, data, maskIdx) {\n if (maskIdx === undefined) {\n const bestMask = best();\n for (let mask = 0; mask < PATTERNS.length; mask++)\n bestMask.add(penalty(drawQR(ver, ecc, data, mask, true)), mask);\n maskIdx = bestMask.get();\n }\n if (maskIdx === undefined)\n throw new Error('Cannot find mask'); // Should never happen\n return drawQR(ver, ecc, data, maskIdx);\n}\nfunction validateECC(ec) {\n if (!ECMode.includes(ec))\n throw new Error(`Invalid error correction mode=${ec}. Expected: ${ECMode}`);\n}\nfunction validateEncoding(enc) {\n if (!Encoding.includes(enc))\n throw new Error(`Encoding: invalid mode=${enc}. Expected: ${Encoding}`);\n if (enc === 'kanji' || enc === 'eci')\n throw new Error(`Encoding: ${enc} is not supported (yet?).`);\n}\nfunction validateMask(mask) {\n if (![0, 1, 2, 3, 4, 5, 6, 7].includes(mask) || !PATTERNS[mask])\n throw new Error(`Invalid mask=${mask}. Expected number [0..7]`);\n}\nexport function encodeQR(text, output = 'raw', opts = {}) {\n const ecc = opts.ecc !== undefined ? opts.ecc : 'medium';\n validateECC(ecc);\n const encoding = opts.encoding !== undefined ? opts.encoding : detectType(text);\n validateEncoding(encoding);\n if (opts.mask !== undefined)\n validateMask(opts.mask);\n let ver = opts.version;\n let data, err = new Error('Unknown error');\n if (ver !== undefined) {\n validateVersion(ver);\n data = encode(ver, ecc, text, encoding);\n }\n else {\n // If no version is provided, try to find smallest one which fits\n // Currently just scans all version, can be significantly speedup if needed\n for (let i = 1; i <= 40; i++) {\n try {\n data = encode(i, ecc, text, encoding);\n ver = i;\n break;\n }\n catch (e) {\n err = e;\n }\n }\n }\n if (!ver || !data)\n throw err;\n let res = drawQRBest(ver, ecc, data, opts.mask);\n res.assertDrawn();\n const border = opts.border === undefined ? 2 : opts.border;\n if (!Number.isSafeInteger(border))\n throw new Error(`invalid border type=${typeof border}`);\n res = res.border(border, false); // Add border\n if (opts.scale !== undefined)\n res = res.scale(opts.scale); // Scale image\n if (output === 'raw')\n return res.data;\n else if (output === 'ascii')\n return res.toASCII();\n else if (output === 'svg')\n return res.toSVG(opts.optimize);\n else if (output === 'gif')\n return res.toGIF();\n else if (output === 'term')\n return res.toTerm();\n else\n throw new Error(`Unknown output: ${output}`);\n}\nexport default encodeQR;\nexport const utils = {\n best,\n bin,\n drawTemplate,\n fillArr,\n info,\n interleave,\n validateVersion,\n zigzag,\n};\n// Unsafe API utils, exported only for tests\nexport const _tests = {\n Bitmap,\n info,\n detectType,\n encode,\n drawQR,\n penalty,\n PATTERNS,\n};\n// Type tests\n// const o1 = qr('test', 'ascii');\n// const o2 = qr('test', 'raw');\n// const o3 = qr('test', 'gif');\n// const o4 = qr('test', 'svg');\n// const o5 = qr('test', 'term');\n//# sourceMappingURL=index.js.map","import { html, LitElement } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { styleMap } from 'lit/directives/style-map.js'\nimport encodeQR from 'qr'\nimport { observe } from '../common/decorators/observe.js'\nimport componentStyle from '../common/styles/Component.css'\nimport style from './Qrcode.css'\n\nconst correctionMap: Record<'L' | 'M' | 'Q' | 'H', 'low' | 'medium' | 'quartile' | 'high'> = {\n L: 'low',\n M: 'medium',\n Q: 'quartile',\n H: 'high',\n}\n\n/**\n * QR Code component is used for providing information or links\n * to users which they can quickly scan with their smartphone.\n *\n * @status ready\n * @category image\n * @displayName QR Code\n */\n@customElement('nord-qrcode')\nexport default class Qrcode extends LitElement {\n static styles = [componentStyle, style]\n\n @query('canvas', true) private canvas!: HTMLCanvasElement\n @query('.computed', true) private computed!: HTMLElement\n\n /**\n * The value of the QR Code, most commonly an URL.\n */\n @property({ reflect: true }) value = ''\n\n /**\n * Label used by assistive technology. If unspecified, the value will\n * be used instead.\n */\n @property({ reflect: true }) label = ''\n\n /**\n * The size of the rendered QR Code in pixels.\n */\n @property({ reflect: true, type: Number }) size = 128\n\n /**\n * The fill color of the QR Code.\n * Can accept any valid CSS color value, including custom properties.\n */\n @property({ reflect: true }) color = 'var(--n-color-text)'\n\n /**\n * The background color of the QR Code.\n * Can accept any valid CSS color value, including custom properties.\n */\n @property({ reflect: true }) background = 'var(--n-color-surface)'\n\n /**\n * Error correction level makes the QR Code bigger and helps users to\n * scan it without issues. L, M, Q and H values will use 7%, 15%, 25%\n * and 30% of the QR code for error correction respectively.\n */\n @property({ reflect: true }) correction: 'L' | 'M' | 'Q' | 'H' = 'H'\n\n firstUpdated() {\n this.generate()\n }\n\n @observe('correction')\n @observe('color')\n @observe('background')\n @observe('size')\n @observe('value')\n private generate() {\n /**\n * Lit’s built-in hasUpdated property returns true if the component\n * has updated at least once.\n */\n if (!this.hasUpdated) {\n return\n }\n\n const { backgroundColor, color } = getComputedStyle(this.computed)\n\n const qrArray = encodeQR(this.value, 'raw', {\n ecc: correctionMap[this.correction],\n border: 0,\n })\n\n // Draw the canvas 2x larger to avoid blurring on high DPI displays\n const size = this.size * 2\n const ctx = this.canvas.getContext('2d')\n const scale = size / qrArray.length\n\n this.canvas.width = size\n this.canvas.height = size\n\n if (ctx) {\n ctx.fillStyle = backgroundColor\n ctx.fillRect(0, 0, size, size)\n qrArray.forEach((row, y) => {\n row.forEach((cell, x) => {\n if (cell) {\n ctx.fillStyle = color\n ctx.fillRect(x * scale, y * scale, scale, scale)\n }\n })\n })\n }\n }\n\n render() {\n return html`\n <div\n class=\"n-qrcode\"\n style=${styleMap({\n 'inline-size': `${this.size}px`,\n 'block-size': `${this.size}px`,\n })}\n >\n <canvas role=\"img\" aria-label=${this.label.length > 0 ? this.label : this.value}></canvas>\n </div>\n <div\n class=\"computed\"\n hidden\n style=${styleMap({\n 'background-color': `${this.background}`,\n 'color': `${this.color}`,\n })}\n ></div>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-qrcode': Qrcode\n }\n}\n","import type { ReactiveControllerHost } from 'lit'\nimport { isServer, nothing } from 'lit'\nimport { LightDomController } from './LightDomController.js'\nimport { SlotController } from './SlotController.js'\n\ninterface LightSlotOptions {\n slotName: string\n render: () => unknown\n syncLightDom: (element: Element) => void\n}\n\n/**\n * Handles cases where a component needs to render to light DOM,\n * and potentially sync component properties to user-supplied content.\n */\nexport class LightSlotController extends SlotController {\n private renderHook?: Comment\n private lightDom?: LightDomController\n\n constructor(\n host: ReactiveControllerHost & HTMLElement,\n private options: LightSlotOptions,\n ) {\n super(host, options.slotName)\n\n if (isServer) {\n return\n }\n\n // we need a node to hook onto for rendering\n // without this, multiple controllers rendering to the light DOM\n // will overwrite each others' content\n this.renderHook = document.createComment(this.slotName)\n\n this.lightDom = new LightDomController(host, {\n render: () => (this.hasContent ? nothing : this.options.render()),\n renderOptions: { renderBefore: this.renderHook },\n })\n }\n\n hostConnected() {\n super.hostConnected()\n\n if (this.renderHook) {\n this.host.appendChild(this.renderHook)\n this.syncLightDom()\n }\n }\n\n protected override onChange = () => {\n this.syncLightDom()\n }\n\n private syncLightDom() {\n const node = this.content\n\n if (node) {\n this.options.syncLightDom(node)\n }\n }\n}\n","import { html, LitElement, nothing } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { ref } from 'lit/directives/ref.js'\nimport { LightDomController } from '../common/controllers/LightDomController.js'\nimport { LightSlotController } from '../common/controllers/LightSlotController.js'\nimport { observe } from '../common/decorators/observe.js'\nimport { cond } from '../common/directives/cond.js'\nimport { wrapIf } from '../common/directives/wrapIf.js'\n\nimport { FocusableMixin } from '../common/mixins/FocusableMixin.js'\nimport { FormAssociatedMixin } from '../common/mixins/FormAssociatedMixin.js'\nimport { InputMixin } from '../common/mixins/InputMixin.js'\nimport { SizeMixin } from '../common/mixins/SizeMixin.js'\n\nimport componentStyle from '../common/styles/Component.css'\nimport formFieldStyle from '../common/styles/FormField.css'\nimport style from './Radio.css'\n\nlet id = 0\nconst createId = (suffix: string) => `nord-radio-${suffix}-${id++}`\n\nfunction isLabel(element: Element): element is HTMLLabelElement {\n return element.localName === 'label'\n}\n\n/**\n * Force reflow (and with it a repaint) of a radio button because of a macOS Safari rendering bug\n *\n * @see https://bugs.webkit.org/show_bug.cgi?id=249706\n */\nfunction forceReflow(radio: Radio) {\n radio.style.display = 'none'\n // eslint-disable-next-line ts/no-unused-expressions\n radio.offsetHeight // no need to store this anywhere, the reference is enough\n radio.style.display = 'inline-block'\n}\n\n/**\n * Radio buttons are graphical user interface elements that allow user to choose only one option from\n * a predefined set of mutually exclusive options.\n *\n * @status ready\n * @category form\n * @slot label - Use when a label requires more than plain text.\n * @slot hint - Optional slot that holds hint text for the input.\n * @slot error - Optional slot that holds error text for the input.\n *\n * @cssprop [--n-label-color=var(--n-color-text)] - Controls the text color of the label, using our [color tokens](/tokens/#color).\n */\n@customElement('nord-radio')\nexport default class Radio extends SizeMixin(FormAssociatedMixin(InputMixin(FocusableMixin(LitElement)))) {\n static styles = [componentStyle, formFieldStyle, style]\n\n protected override inputId = createId('input')\n protected override hintId = createId('hint')\n protected override errorId = createId('error')\n\n /**\n * For accessibility reasons, we render some parts of the component to the light DOM.\n */\n protected override hintSlot = new LightSlotController(this, {\n slotName: 'hint',\n render: () => (this.hint ? html`<div slot=\"hint-internal\" id=${this.hintId}>${this.hint}</div>` : nothing),\n syncLightDom: (element) => {\n element.id = this.hintId\n },\n })\n\n protected override labelSlot = new LightSlotController(this, {\n slotName: 'label',\n render: () => (this.label ? html`<label slot=\"label-internal\" for=${this.inputId}>${this.label}</label>` : nothing),\n syncLightDom: (element) => {\n if (!isLabel(element)) {\n console.warn(`NORD: Only <label> elements should be placed in radio's \"label\" slot`)\n }\n else {\n element.htmlFor = this.inputId\n }\n },\n })\n\n protected override errorSlot = new LightSlotController(this, {\n slotName: 'error',\n render: () => (this.error ? html`<div slot=\"error-internal\" id=${this.errorId}>${this.error}</div>` : nothing),\n syncLightDom: (element) => {\n element.id = this.hintId\n },\n })\n\n protected inputSlot = new LightDomController(this, {\n render: () => html`\n <input\n slot=\"input\"\n @blur=${this.handleBlur}\n @focus=${this.handleFocus}\n ${ref(this.focusableRef)}\n class=\"n-input\"\n id=${this.inputId}\n type=\"radio\"\n name=${cond(this.name)}\n .value=${cond(this.value)}\n .checked=${this.checked}\n ?disabled=${this.disabled}\n ?required=${this.required}\n aria-describedby=${cond(this.getDescribedBy())}\n aria-invalid=${cond(this.getInvalid())}\n form=${cond(this._formId)}\n />\n `,\n })\n\n protected override get formValue() {\n // opt out of formdata event, since radio button is in light dom\n return undefined\n }\n\n /**\n * Controls whether the checkbox is checked or not.\n */\n @property({ type: Boolean, reflect: true }) checked: boolean = false\n\n render() {\n const hint = html`\n <div class=\"n-caption n-hint\" ?hidden=${!this.hasHint}>\n <slot name=\"hint\"></slot>\n <slot name=\"hint-internal\"></slot>\n </div>\n `\n const error = html`\n <div class=\"n-caption n-error\" role=\"alert\" ?hidden=${!this.hasError}>\n <slot name=\"error\"></slot>\n <slot name=\"error-internal\"></slot>\n </div>\n `\n\n return html`\n <div class=\"n-flex\">\n <div class=\"n-input-container\" @change=${this.handleChange}>\n <slot name=\"input\"></slot>\n ${this.checked ? html`<div class=\"n-dot\"></div>` : nothing}\n </div>\n <div class=\"n-expand\">\n <div class=\"n-label-container\">\n ${wrapIf(\n this.hideLabel,\n () => html`\n <slot name=\"label\"></slot>\n <slot name=\"label-internal\"></slot>\n `,\n content => html`<nord-visually-hidden>${content}</nord-visually-hidden>`,\n )}\n ${this.isHintBelow ? nothing : hint}\n </div>\n ${this.isHintBelow ? nothing : error}\n </div>\n </div>\n ${this.isHintBelow ? error : nothing}\n ${this.isHintBelow ? hint : nothing}\n `\n }\n\n @observe('checked')\n protected handleCheckedChange(previousChecked: boolean) {\n // if this component was previous unchecked but is now checked,\n // then we need to uncheck any radios in the same group\n if (!previousChecked && this.checked) {\n this.uncheckSiblings()\n }\n }\n\n private uncheckSiblings() {\n const root = this.getRootNode() as Document | ShadowRoot\n\n root.querySelectorAll<Radio>(`nord-radio[name=\"${this.name}\"]`).forEach((radio) => {\n if (radio !== this && radio.checked) {\n radio.checked = false\n forceReflow(radio)\n }\n })\n }\n\n protected handleChange(e: Event): void {\n e.stopPropagation()\n const target = e.target as HTMLInputElement\n\n this.checked = target.checked\n super.handleChange(e)\n }\n\n private handleBlur = (e: Event) => {\n e.stopPropagation()\n this.dispatchEvent(new Event('blur', { bubbles: false, cancelable: true }))\n }\n\n private handleFocus = (e: Event) => {\n e.stopPropagation()\n this.dispatchEvent(new Event('focus', { bubbles: false, cancelable: true }))\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-radio': Radio\n }\n}\n","// some clever typing so that TS knows what happens if you pass true/false values\nexport function wrapIf<TInner, TWrapper>(\n condition: false,\n inner: () => TInner,\n wrapper: (inner: TInner) => TWrapper,\n): TInner\nexport function wrapIf<TInner, TWrapper>(\n condition: true,\n inner: () => TInner,\n wrapper: (inner: TInner) => TWrapper,\n): TWrapper\nexport function wrapIf<TInner, TWrapper>(\n condition: unknown,\n inner: () => TInner,\n wrapper: (inner: TInner) => TWrapper,\n): TInner | TWrapper\n\n/**\n * @returns if condition is truthy, return result of wrapper, passing result of inner as arg. if falsy, return result of inner\n */\nexport function wrapIf<TInner, TWrapper>(condition: any, inner: () => TInner, wrapper: (innards: TInner) => TWrapper) {\n return condition ? wrapper(inner()) : inner()\n}\n","import { html, LitElement, nothing } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { classMap } from 'lit/directives/class-map.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { ref } from 'lit/directives/ref.js'\nimport { DirectionController } from '../common/controllers/DirectionController.js'\n\nimport { NordEvent } from '../common/events.js'\nimport { AutocompleteMixin } from '../common/mixins/AutocompleteMixin.js'\nimport { FocusableMixin } from '../common/mixins/FocusableMixin.js'\nimport { FormAssociatedMixin } from '../common/mixins/FormAssociatedMixin.js'\nimport { InputMixin } from '../common/mixins/InputMixin.js'\nimport { ReadonlyMixin } from '../common/mixins/ReadonlyMixin.js'\n\nimport componentStyle from '../common/styles/Component.css'\nimport formFieldStyle from '../common/styles/FormField.css'\nimport textFieldStyle from '../common/styles/TextField.css'\nimport style from './Range.css'\n\n/**\n * Range input lets user specify a numeric value using a slider which\n * must be no less than a given value, and no more than another given value.\n *\n * @status ready\n * @category form\n * @slot label - Use when a label requires more than plain text.\n * @slot hint - Optional slot that holds hint text for the input.\n * @slot error - Optional slot that holds error text for the input.\n *\n * @cssprop [--n-range-thumb-size=20px] - Controls the size of the thumb.\n * @cssprop [--n-range-track-color-active=var(--n-color-accent)] - Controls the color of the portion of the track that represents the current value.\n * @cssprop [--n-range-track-color-inactive=var(--n-color-border-strong)] - Controls the color of the portion of the track that represents the remaining value.\n * @cssprop [--n-range-track-size=3px] - Controls the height of the track.\n */\n@customElement('nord-range')\nexport default class Range extends FormAssociatedMixin(\n AutocompleteMixin(ReadonlyMixin(InputMixin(FocusableMixin(LitElement)))),\n) {\n static styles = [componentStyle, formFieldStyle, textFieldStyle, style]\n\n private direction = new DirectionController(this)\n\n /**\n * Minimum value for the range slider.\n */\n @property({ reflect: true, type: Number }) min: number = 0\n\n /**\n * Maximum value for the range slider.\n */\n @property({ reflect: true, type: Number }) max: number = 10\n\n /**\n * Step amount for the range slider.\n */\n @property({ reflect: true, type: Number }) step: number = 1\n\n /**\n * Controls whether the input expands to fill the width of its container.\n */\n @property({ reflect: true, type: Boolean }) expand = false\n\n render() {\n const value = Number(this.value) || 0\n const percent = Math.max(0, (value - this.min) / (this.max - this.min))\n\n return html`\n <div class=\"n-input-container\">\n ${this.renderLabel(html`<span class=\"n-range-output\" aria-hidden=\"true\">${value}</span>`)}\n\n <input\n ${ref(this.focusableRef)}\n id=${this.inputId}\n type=\"range\"\n class=${classMap({\n 'n-range': true,\n 'is-rtl': this.direction.isRTL,\n })}\n name=${ifDefined(this.name)}\n min=${this.min}\n step=${this.step}\n max=${this.max}\n style=${`--_n-range-progress: ${percent * 100}%`}\n ?disabled=${this.disabled}\n ?required=${this.required}\n ?readonly=${this.readonly}\n .value=${this.value ? this.value : '0'}\n @input=${this.handleInput}\n @change=${this.handleChange}\n aria-describedby=${ifDefined(this.getDescribedBy())}\n aria-invalid=${ifDefined(this.getInvalid())}\n />\n </div>\n\n ${this.renderError()}\n ${this.isHintBelow ? this.renderHint() : nothing}\n `\n }\n\n protected handleInput(e: Event) {\n e.stopPropagation()\n const target = e.target as HTMLInputElement\n\n if (this.readonly) {\n e.preventDefault()\n target.value = this.value\n return\n }\n\n this.value = target.value\n\n /**\n * Fired as the user types into the input.\n */\n this.dispatchEvent(new NordEvent('input'))\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-range': Range\n }\n}\n","import { html, LitElement, nothing } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { ref } from 'lit/directives/ref.js'\nimport { LightDomController } from '../common/controllers/LightDomController.js'\nimport { LightSlotController } from '../common/controllers/LightSlotController.js'\nimport { observe } from '../common/decorators/observe.js'\nimport { cond } from '../common/directives/cond.js'\nimport { NordEvent } from '../common/events.js'\n\nimport { FocusableMixin } from '../common/mixins/FocusableMixin.js'\nimport { InputMixin } from '../common/mixins/InputMixin.js'\n\nimport componentStyle from '../common/styles/Component.css'\nimport style from './SegmentedControlItem.css'\n\nlet id = 0\nconst createId = (suffix: string) => `nord-segmented-control-item-${suffix}-${id++}`\n\nfunction isLabel(element: Element): element is HTMLLabelElement {\n return element.localName === 'label'\n}\n\ntype NativeInputElement = HTMLSelectElement | HTMLInputElement | HTMLTextAreaElement\n\n/**\n * Segmented control items populate a segmented control with options.\n * Every item should be placed inside a segmented control.\n *\n * @status new\n * @category action\n * @slot label - Use when a label requires more than plain text.\n *\n * @cssprop [--n-segmented-control-item-border-radius=var(--n-border-radius-s)] - Controls the rounded corners of the item, using [border radius tokens](/tokens/#border-radius).\n * @cssprop [--n-segmented-control-item-gap=var(--n-space-xs)] - Controls the spacing between elements within the item, using our [spacing tokens](/tokens/#space).\n * @cssprop [--n-segmented-control-item-gradient=linear-gradient(to bottom, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.013) 100%))] - Controls the overlayed gradient background on the item.\n * @cssprop [--n-segmented-control-item-background-color=var(--n-color-nav-hover)] - Controls the background color of the item, using our [color tokens](/tokens/#color).\n * @cssprop [--n-segmented-control-item-color=var(--n-color-text-weaker)] - Controls the color of the text within the item, using our [color tokens](/tokens/#color).\n * @cssprop [--n-segmented-control-item-padding-inline=calc(var(--n-space-m) / 1.2)] - Controls the inline, or left and right, padding of the item.\n * @cssprop [--n-segmented-control-item-box-shadow=none] - Controls the surrounding shadow, using our [box shadow tokens](/tokens/#box-shadow).\n * @cssprop [--n-segmented-control-item-font-size=var(--n-font-size-m)] - Controls the size of the text within the item, using our [font tokens](/tokens/#font).\n * @cssprop [--n-segmented-control-item-font-weight=var(--n-font-weight)] - Controls the weight of the text within the item, using our [font tokens](/tokens/#font).\n * @cssprop [--n-segmented-control-item-min-block-size=calc(var(--n-space-xl) - 2px)] - Controls the minimum block size, or height, of the item using our [spacing tokens](/tokens/#space).\n * @cssprop [--n-segmented-control-item-inline-size=auto] - Controls the inline size of the item.\n */\n@customElement('nord-segmented-control-item')\nexport default class SegmentedControlItem extends InputMixin(FocusableMixin(LitElement)) {\n static styles = [componentStyle, style]\n\n protected inputId = createId('input')\n\n /**\n * For accessibility reasons, we render the form parts of the component to the light DOM.\n */\n protected inputSlot = new LightDomController(this, {\n render: () => html`\n <input\n slot=\"input\"\n @blur=${this.handleBlur}\n @focus=${this.handleFocus}\n ${ref(this.focusableRef)}\n id=${this.inputId}\n type=\"radio\"\n class=\"n-input\"\n name=${cond(this.name)}\n .value=${cond(this.value)}\n .checked=${this.checked}\n ?disabled=${this.disabled}\n form=${cond(this._formId)}\n />\n `,\n })\n\n protected labelSlot = new LightSlotController(this, {\n slotName: 'label',\n render: () =>\n this.label\n ? html`<label slot=\"label-internal\" for=${this.inputId} class=\"n-segmented-control-item\">${this.label}</label>`\n : nothing,\n syncLightDom: (element) => {\n if (!isLabel(element)) {\n console.warn(`NORD: Only <label> elements should be placed in Segmented Control's \"label\" slot`)\n }\n else {\n element.htmlFor = this.inputId\n }\n },\n })\n\n /**\n * Controls whether the segmented control item is checked or not.\n */\n @property({ type: Boolean, reflect: true }) checked: boolean = false\n\n /**\n * The size of the segmented control item.\n * This affects font-size and padding.\n */\n @property({ reflect: true }) size: 's' | 'm' | 'l' = 'm'\n\n /**\n * Label for the segmented control item.\n */\n @property({ reflect: true }) label: string = ''\n\n render() {\n return html`<div class=\"n-segmented-control-item\" @change=${this.handleChange}>\n <slot name=\"input\"></slot>\n <slot name=\"label\"></slot>\n <slot name=\"label-internal\"></slot>\n </div>`\n }\n\n @observe('checked')\n protected handleCheckedChange(previousChecked: boolean) {\n // if this component was previous unchecked but is now checked,\n // then we need to uncheck any items in the same group\n if (!previousChecked && this.checked) {\n this.uncheckSiblings()\n }\n }\n\n private uncheckSiblings() {\n const root = this.getRootNode() as Document | ShadowRoot\n\n root\n .querySelectorAll<SegmentedControlItem>(`nord-segmented-control-item[name=\"${this.name}\"]`)\n .forEach((segmentedControlItem) => {\n if (segmentedControlItem !== this) {\n segmentedControlItem.checked = false\n }\n })\n }\n\n protected handleChange(e: Event): void {\n const target = e.target as HTMLInputElement\n this.checked = target.checked\n\n e.stopPropagation()\n\n /**\n * Fired whenever the segmented control item has been checked.\n */\n this.dispatchEvent(new NordEvent('change'))\n }\n\n private handleBlur = (e: Event) => {\n e.stopPropagation()\n this.dispatchEvent(new Event('blur', { bubbles: false, cancelable: true }))\n }\n\n private handleFocus = (e: Event) => {\n e.stopPropagation()\n this.dispatchEvent(new Event('focus', { bubbles: false, cancelable: true }))\n }\n\n protected handleInput(e: Event) {\n e.stopPropagation()\n const target = e.target as NativeInputElement\n this.value = target.value\n\n /**\n * Fired as the user types into the input.\n */\n this.dispatchEvent(new NordEvent('input'))\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-segmented-control-item': SegmentedControlItem\n }\n}\n","import { html, LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { classMap } from 'lit/directives/class-map.js'\nimport { SlotController } from '../common/controllers/SlotController.js'\n\nimport componentStyle from '../common/styles/Component.css'\nimport style from './SegmentedControl.css'\n\n/**\n * Segmented control is used to pick one choice from a set of\n * closely related choices, and immediately apply that selection.\n *\n * @status new\n * @category action\n * @slot - Default slot.\n *\n * @fires {NordEvent} change - Fired whenever a segmented control item has been checked.\n */\n@customElement('nord-segmented-control')\nexport default class SegmentedControl extends LitElement {\n static styles = [componentStyle, style]\n\n private defaultSlot = new SlotController(this)\n\n /**\n * Controls whether the segmented control expands to fill the width of its container.\n */\n @property({ reflect: true, type: Boolean }) expand = false\n\n render() {\n const isDisabled = this.defaultSlot.assigned.every((node) => {\n if (node.hasAttribute('disabled')) {\n return true\n }\n return false\n })\n\n return html`<div\n class=${classMap({\n 'n-segmented-control': true,\n 'n-disabled': isDisabled,\n })}\n >\n <slot></slot>\n </div>`\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-segmented-control': SegmentedControl\n }\n}\n","export default '<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m14.0864 12.0402 1.8138 1.8137-4.7724 4.7724c-.2573.2573-.5789.373-.9133.373-.33447 0-.65606-.1286-.91333-.373l-4.77238-4.7724 1.81377-1.8137 3.85904 3.859 3.8591-3.859zm-3.859-7.93687 3.859 3.85907 1.8138-1.81376-4.7724-4.77238c-.5017-.50168-1.31208-.50168-1.81376 0l-4.77238 4.77238 1.81376 1.81376 3.85908-3.85907z\" fill=\"currentColor\"/></svg>';\nexport const title = \"interface-dropdown-small\";\nexport const tags =\n \"nordicon small interface dropdown select arrow up down caret triangle chevron\";\n","import * as dropdownIcon from '@nordhealth/icons/lib/assets/interface-dropdown-small.js'\nimport { html, isServer, LitElement, nothing } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { ref } from 'lit/directives/ref.js'\n\nimport { SlotController } from '../common/controllers/SlotController.js'\nimport { AutocompleteMixin } from '../common/mixins/AutocompleteMixin.js'\n\nimport { FocusableMixin } from '../common/mixins/FocusableMixin.js'\nimport { FormAssociatedMixin } from '../common/mixins/FormAssociatedMixin.js'\nimport { InputMixin } from '../common/mixins/InputMixin.js'\nimport { SizeMixin } from '../common/mixins/SizeMixin.js'\nimport componentStyle from '../common/styles/Component.css'\n\nimport formFieldStyle from '../common/styles/FormField.css'\nimport Icon from '../icon/Icon.js'\nimport style from './Select.css'\nimport '../button/Button.js'\n\nIcon.registerIcon(dropdownIcon)\n\n/**\n * Select lets users choose one option from an options menu.\n * Consider using select when you have 5 or more options to choose from.\n *\n * @status ready\n * @category form\n * @slot - Default slot for holding <option> elements.\n * @slot label - Use when a label requires more than plain text.\n * @slot hint - Use when a hint requires more than plain text.\n * @slot error - Optional slot that holds error text for the input.\n * @slot icon - Used to place an icon at the start of select.\n *\n * @cssprop [--n-select-block-size=var(--n-space-xl)] - Controls the block size, or height, of the select using our [spacing tokens](/tokens/#space).\n * @cssprop [--n-select-inline-size=fit-content] - Controls the inline size, or width, of the select.\n * @cssprop [--n-label-color=var(--n-color-text)] - Controls the text color of the label, using our [color tokens](/tokens/#color).\n */\n@customElement('nord-select')\nexport default class Select extends SizeMixin(\n FormAssociatedMixin(AutocompleteMixin(InputMixin(FocusableMixin(LitElement)))),\n) {\n static styles = [componentStyle, formFieldStyle, style]\n\n protected override get formValue() {\n return this.value || undefined\n }\n\n private defaultSlot = new SlotController(this)\n private optionObserver?: MutationObserver\n\n protected inputId = 'select'\n\n firstUpdated() {\n this.setupOptionObserver()\n }\n\n connectedCallback() {\n super.connectedCallback()\n // Re-setup observer after reconnection (firstUpdated only runs once per instance)\n if (this.hasUpdated && !this.optionObserver) {\n this.setupOptionObserver()\n }\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n // Clean up observer to prevent memory leaks\n this.optionObserver?.disconnect()\n this.optionObserver = undefined\n }\n\n private setupOptionObserver() {\n // Avoid creating multiple observers\n if (this.optionObserver) {\n return\n }\n\n // Set up observer to watch for changes to slotted option content\n this.optionObserver = new MutationObserver(() => this.requestUpdate())\n this.optionObserver.observe(this, {\n subtree: true,\n childList: true,\n characterData: true,\n })\n }\n\n /**\n * Controls whether the select expands to fill the width of its container.\n */\n @property({ reflect: true, type: Boolean }) expand = false\n\n render() {\n const slottedOptions = this.options\n const buttonText = this.getButtonText(slottedOptions)\n\n return html`\n <slot></slot>\n ${this.renderLabel()}\n\n <div class=\"n-select-container\">\n <select\n ${ref(this.focusableRef)}\n id=${this.inputId}\n ?disabled=${this.disabled}\n ?required=${this.required}\n name=${ifDefined(this.name)}\n @change=${this.handleChange}\n @input=${this.handleInput}\n aria-describedby=${ifDefined(this.getDescribedBy())}\n aria-invalid=${ifDefined(this.getInvalid())}\n autocomplete=${this.autocomplete as any}\n >\n ${this.placeholder && html`<option value=\"\" disabled ?selected=${!this.value}>${this.placeholder}</option>`}\n ${slottedOptions.map(option => this.renderOption(option))}\n </select>\n\n <nord-button size=${this.size} ?disabled=${this.disabled} ?expand=${this.expand} type=\"button\" inert>\n <slot slot=\"start\" name=\"icon\"></slot>\n ${buttonText}\n <nord-icon slot=\"end\" name=\"interface-dropdown-small\"></nord-icon>\n </nord-button>\n </div>\n\n ${this.renderError()}\n ${this.isHintBelow ? this.renderHint() : nothing}\n `\n }\n\n private get options() {\n if (isServer) {\n return []\n }\n\n return Array.from(this.querySelectorAll('option'))\n }\n\n private getButtonText(options: HTMLOptionElement[]): string {\n const selected = options.find(option => option.value === this.value.toString())\n\n if (selected) {\n return selected.text\n }\n\n if (this.placeholder) {\n return this.placeholder\n }\n\n if (options[0]) {\n return options[0].text\n }\n\n return ''\n }\n\n private renderOption(option: HTMLOptionElement) {\n return html`\n <option\n value=${ifDefined(option.value)}\n ?disabled=${option.disabled}\n .selected=${option.value === this.value.toString()}\n >\n ${option.text}\n </option>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-select': Select\n }\n}\n","import { html, LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport componentStyle from '../common/styles/Component.css'\nimport style from './Skeleton.css'\n\n/**\n * Skeletons are used to provide a low fidelity representation of content\n * before it appears in a view. This improves the perceived loading time\n * for our users.\n *\n * @status ready\n * @category feedback\n *\n * @cssprop [--n-skeleton-border-radius=var(--n-border-radius)] - Controls how rounded the corners are, using [border radius tokens](/tokens/#border-radius).\n * @cssprop [--n-skeleton-color=var(--n-color-border)] - Controls the main color of the skeleton, using our [color tokens](/tokens/#color).\n * @cssprop [--n-skeleton-sheen-color=var(--n-color-border-strong)] - Controls the sheen color of the skeleton, using our [color tokens](/tokens/#color).\n */\n@customElement('nord-skeleton')\nexport default class Skeleton extends LitElement {\n static styles = [componentStyle, style]\n\n /**\n * Determines which animation effect the skeleton will use.\n * The default is no animation.\n */\n @property({ reflect: true }) effect?: 'pulse' | 'sheen'\n\n render() {\n return html`\n <div class=\"n-skeleton\" aria-hidden=\"true\">\n <div class=\"n-skeleton-indicator\"></div>\n </div>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-skeleton': Skeleton\n }\n}\n","import { html, LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { SlotController } from '../common/controllers/SlotController.js'\nimport { observe } from '../common/decorators/observe.js'\n\nimport componentStyle from '../common/styles/Component.css'\nimport style from './Tab.css'\n\n/**\n * The interactive tab button for use within the tab group component.\n *\n * @status ready\n * @category navigation\n * @slot - The tab button content.\n *\n * @cssprop [--n-tab-color=var(--n-color-text-weak)] - Controls the text color of the tab, using our [color tokens](/tokens/#color).\n * @cssprop [--n-tab-font-weight=var(--n-font-weight)] - Controls the font weight of the tab, using our [font tokens](/tokens/#font).\n */\n@customElement('nord-tab')\nexport default class Tab extends LitElement {\n static styles = [componentStyle, style]\n\n private defaultSlot = new SlotController(this)\n\n /**\n * Whether the tab item is selected\n */\n @property({ reflect: true, type: Boolean }) selected: boolean = false\n\n render() {\n return html`<div class=\"n-tab\" data-text=\"${this.defaultSlot.isEmpty ? this.textContent : ''}\">\n <slot></slot>\n </div>`\n }\n\n /**\n * Apply accessible attributes and values to the tab button.\n * Observe the selected property if it changes\n */\n @observe('selected')\n protected handleSelectionChange() {\n this.setAttribute('aria-selected', `${this.selected}`)\n this.setAttribute('tabindex', this.selected ? '0' : '-1')\n }\n\n connectedCallback() {\n super.connectedCallback()\n this.setAttribute('role', 'tab')\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-tab': Tab\n }\n}\n","import { html, isServer, LitElement } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\n\nimport { DirectionController } from '../common/controllers/DirectionController.js'\nimport componentStyle from '../common/styles/Component.css'\nimport stickyStyle from '../common/styles/Sticky.css'\nimport Tab from '../tab/Tab.js'\n\nimport style from './TabGroup.css'\n\nlet tabGroupCount = 1\n\n/**\n * Tab Group allows multiple panels to be contained within a single window,\n * using tabs as a navigational element.\n *\n * @status ready\n * @category navigation\n * @slot - The element which contains the content to be revealed.\n * @slot tab - The element which contains all tabs to reveal tabbed content.\n *\n * @cssprop [--n-tab-group-padding=0] - Controls the padding around the tab group (including the tab list), using our [spacing tokens](/tokens/#space).\n */\n@customElement('nord-tab-group')\nexport default class TabGroup extends LitElement {\n static styles = [componentStyle, stickyStyle, style]\n\n private direction = new DirectionController(this)\n\n private observer?: MutationObserver\n\n private static observerOptions = {\n attributes: true,\n subtree: true,\n attributeFilter: ['selected'],\n attributeOldValue: true,\n }\n\n /**\n * Unique ID for each tab group component present.\n */\n private tabGroupId = `nord-tab-group-${tabGroupCount++}`\n\n /**\n * Adds an accessible label to the tab list container.\n */\n @property({ reflect: true }) label: string = ''\n\n /**\n * Controls the padding of the tab group component.\n */\n @property({ reflect: true }) padding?: 'm' | 'l' | 'none' = 'm'\n\n /**\n * Whether the tab list sticks to the top of the tab group as you scroll.\n */\n @property({ reflect: true, type: Boolean }) sticky: boolean = false\n\n /**\n * The current tab node selected in the tab group.\n */\n @state() private selectedTab = this.initialSelectedTab\n\n render() {\n return html`\n <div class=\"n-tab-group is-${this.direction.dir}\">\n <div\n class=\"n-tab-group-list n-sticky\"\n role=\"tablist\"\n aria-label=\"${this.label}\"\n @click=${this.handleTabChange}\n @keydown=${this.handleKeydown}\n >\n <slot name=\"tab\"></slot>\n </div>\n <slot></slot>\n </div>\n `\n }\n\n connectedCallback() {\n super.connectedCallback()\n this.updateSlots()\n // Re-setup observer after reconnection (firstUpdated only runs once per instance)\n if (this.hasUpdated && !this.observer) {\n this.setupObserver()\n }\n }\n\n firstUpdated() {\n this.setupObserver()\n }\n\n private updateSlots() {\n this.setupTabs()\n this.setupPanels()\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n // Clean up observer to prevent memory leaks\n this.observer?.disconnect()\n this.observer = undefined\n }\n\n private setupObserver() {\n // Avoid creating multiple observers\n if (this.observer) {\n return\n }\n\n this.observer = new MutationObserver(this.handleMutation)\n this.observer.observe(this, TabGroup.observerOptions)\n }\n\n /**\n * If the selected tab is selected programmatically update all the tabs.\n */\n private handleMutation = (mutations: MutationRecord[]) => {\n mutations.forEach((mutation) => {\n if (mutation.attributeName === 'selected' && mutation.oldValue === null) {\n const selectedTab = <Tab>mutation.target\n this.observer?.disconnect()\n this.updateSelectedTab(selectedTab)\n this.observer?.observe(this, TabGroup.observerOptions)\n }\n })\n }\n\n /**\n * Get the selected tab button, or the first tab button.\n */\n private get initialSelectedTab() {\n if (isServer) {\n return null\n }\n\n return this.querySelector('nord-tab[selected]') || this.querySelector('nord-tab')\n }\n\n /**\n * Apply accessible attributes and values to the tab buttons.\n */\n private setupTabs() {\n const tabs = this.querySelectorAll('nord-tab')\n\n tabs.forEach((tab, index) => {\n tab.setAttribute('id', `${this.tabGroupId}-tab-${index + 1}`)\n tab.setAttribute('aria-controls', `${this.tabGroupId}-panel-${index + 1}`)\n tab.toggleAttribute('selected', tab === this.selectedTab)\n })\n }\n\n /**\n * Apply accessible attributes and values to the tab panels.\n */\n private setupPanels() {\n const panels = this.querySelectorAll('nord-tab-panel')\n const selectedPanelId = this.selectedTab?.getAttribute('aria-controls')\n\n panels.forEach((panel, index) => {\n panel.setAttribute('id', `${this.tabGroupId}-panel-${index + 1}`)\n panel.setAttribute('aria-labelledby', `${this.tabGroupId}-tab-${index + 1}`)\n panel.setAttribute('aria-hidden', `${panel.getAttribute('id') !== selectedPanelId}`)\n })\n }\n\n private handleTabChange(event: Event) {\n // Always reset the scroll when a tab is selected.\n this.scrollTo({ top: 0 })\n\n /**\n * Return handler if it's not a tab or if it's already selected\n */\n if (!(event.target instanceof Tab) || event.target === this.selectedTab)\n return\n\n this.updateSelectedTab(event.target)\n }\n\n /**\n * Get the previous tab button in the tab group\n */\n private previousTab(tab: Tab) {\n const tabs = [...this.querySelectorAll('nord-tab')]\n const selectedTabIndex = tabs.indexOf(tab)\n return tabs[selectedTabIndex - 1]\n }\n\n /**\n * Handle keyboard accessible controls.\n */\n private handleKeydown(event: KeyboardEvent) {\n const tab = <Tab>event.target\n\n const firstTab = <Tab> this.querySelector('nord-tab:first-of-type')\n const lastTab = <Tab> this.querySelector('nord-tab:last-of-type')\n const nextTab = <Tab> this.querySelector(`#${tab.getAttribute('id')} ~ nord-tab`) || firstTab\n const previousTab = <Tab> this.previousTab(tab) || lastTab\n\n const updateTab = (selectedTab: Tab, keyEvent: Event) => {\n keyEvent.preventDefault()\n\n // Always reset the scroll when a tab is selected.\n this.scrollTo({ top: 0 })\n this.updateSelectedTab(selectedTab)\n }\n\n switch (event.key) {\n case 'ArrowLeft':\n case 'ArrowUp':\n updateTab(this.direction.isLTR ? previousTab : nextTab, event)\n break\n\n case 'ArrowRight':\n case 'ArrowDown':\n updateTab(this.direction.isLTR ? nextTab : previousTab, event)\n break\n\n case 'Home':\n updateTab(firstTab, event)\n break\n\n case 'End':\n updateTab(lastTab, event)\n break\n\n default:\n break\n }\n }\n\n /**\n * Update the selected tab button with attributes and values.\n * Update the tab group state.\n */\n private updateSelectedTab(selectedTab: Tab) {\n const selectedPanel = this.querySelector(`#${selectedTab.getAttribute('aria-controls')}`)\n\n if (selectedTab === this.selectedTab)\n return\n\n /**\n * Reset all the selected state of the tabs, and select the clicked tab\n */\n this.querySelectorAll('nord-tab').forEach((tab) => {\n tab.removeAttribute('selected')\n if (tab === selectedTab) {\n tab.setAttribute('selected', '')\n tab.focus()\n tab.scrollIntoView({ block: 'nearest', inline: 'nearest' })\n this.selectedTab = tab\n }\n })\n\n /**\n * Reset all the visibility of the panels,\n * and show the panel related to the selected tab\n */\n this.querySelectorAll('nord-tab-panel').forEach((panel) => {\n panel.setAttribute('aria-hidden', `${panel !== selectedPanel}`)\n })\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-tab-group': TabGroup\n }\n}\n","import { html, LitElement } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\nimport componentStyle from '../common/styles/Component.css'\nimport style from './TabPanel.css'\n\n/**\n * The panel which contains content that can be revealed using a tab\n * in the tab group component.\n *\n * @status ready\n * @category navigation\n * @slot - The tab panel content.\n */\n@customElement('nord-tab-panel')\nexport default class TabPanel extends LitElement {\n static styles = [componentStyle, style]\n\n render() {\n return html`<div class=\"n-tab-panel\"><slot></slot></div>`\n }\n\n connectedCallback() {\n super.connectedCallback()\n\n /**\n * Apply accessible attributes and values to the tab panel.\n */\n this.setAttribute('role', 'tabpanel')\n this.setAttribute('tabindex', '0')\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-tab-panel': TabPanel\n }\n}\n","import { html, LitElement, render } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport style from './Table.css'\n\nfunction isDocument(node: Node): node is Document {\n return node.nodeType === Node.DOCUMENT_NODE\n}\n\n/**\n * Table is used to organize and display information from a data set.\n * Provides table styles in addition to features like sticky\n * headers and support for narrow viewports.\n *\n * @status ready\n * @category list\n * @slot - Default slot which holds the HTML `<table>` element.\n *\n * @cssprop [--n-table-td-padding=calc(var(--n-space-m) * 0.95)] - Controls the padding around the table cells.\n * @cssprop [--n-table-border-radius=var(--n-border-radius-s)] - Controls how rounded the corners are, using [border radius tokens](/tokens/#border-radius).\n *\n * @usage https://stackblitz.com/github/nordhealth/advanced-table-examples/tree/main/nord-react-tanstack-table?embed=1&file=src/DataTable/DataTable.tsx&hideNavigation=1&view=preview - with react and tanstack table\n * @usage https://stackblitz.com/github/nordhealth/advanced-table-examples/tree/main/nord-react-ag-grid?embed=1&file=src/DataTable/DataTable.tsx&hideNavigation=1&view=preview - with react and ag grid\n * @usage https://stackblitz.com/github/nordhealth/advanced-table-examples/tree/main/nord-vue-tanstack-table?embed=1&file=src/components/DataTable/DataTable.vue&hideNavigation=1&view=preview - with vue and tanstack table\n * @usage https://stackblitz.com/github/nordhealth/advanced-table-examples/tree/main/nord-vue-ag-grid?embed=1&file=src/components/DataTable/DataTable.vue&hideNavigation=1&view=preview - with vue and ag grid\n */\n@customElement('nord-table')\nexport default class Table extends LitElement {\n /**\n * Controls the density of the table's rows and headers.\n * Relaxed increases space, condensed reduces space.\n */\n @property({ reflect: true }) density: 'condensed' | 'default' | 'relaxed' = 'default'\n\n /**\n * Enables scroll-snapping, meaning the scroll position is always column-aligned.\n */\n @property({ reflect: true, type: Boolean, attribute: 'scroll-snap' }) scrollSnap = false\n\n /**\n * Controls whether to use zebra striping on tables, which can improve readability.\n */\n @property({ type: Boolean, reflect: true }) striped = false\n\n connectedCallback() {\n super.connectedCallback()\n this.renderStyles()\n }\n\n /**\n * renders table styles into nearest root.\n * this is necessary since we do not use shadow dom.\n */\n private renderStyles() {\n const rootNode = this.getRootNode() as Document | ShadowRoot\n const renderTarget = isDocument(rootNode) ? rootNode.head : rootNode\n const tagName = this.localName\n\n const componentStyles = rootNode.querySelector(`style[data-component=${tagName}]`)\n if (componentStyles) {\n return\n }\n\n const fragment = document.createDocumentFragment()\n render(\n html`\n <style data-component=${tagName}>\n ${style}\n </style>\n `,\n fragment,\n )\n renderTarget.appendChild(fragment)\n }\n\n /**\n * opt out of shadow dom\n */\n protected createRenderRoot() {\n return this\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-table': Table\n }\n}\n","import { html, LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { classMap } from 'lit/directives/class-map.js'\nimport { DirectionController } from '../common/controllers/DirectionController.js'\nimport { SlotController } from '../common/controllers/SlotController.js'\n\nimport componentStyle from '../common/styles/Component.css'\nimport style from './TagGroup.css'\n\n/**\n * Tag groups are designed to bring together selectable tags that are of a similar nature. For example categories you can filter by.\n *\n * @status new\n * @category structure\n * @slot - The tag group content\n *\n * @fires {NordEvent} change - Fired whenever a tag has been checked or unchecked via user interaction.\n * @fires {NordEvent} remove - Fired when the remove button is activated on a tag. This event should be used to remove the tag from the DOM.\n *\n * @cssprop [--n-tag-group-border-radius=var(--n-border-radius-s)] - Controls the rounded corners of the tag group, using [border radius tokens](/tokens/#border-radius). Only relevant for the default variant.\n * @cssprop [--n-tag-group-box-shadow=var(--n-box-shadow)] - Controls the surrounding shadow, using [box shadow tokens](/tokens/#box-shadow). Only relevant for the default variant.\n */\n@customElement('nord-tag-group')\nexport default class TagGroup extends LitElement {\n static styles = [componentStyle, style]\n\n private defaultSlot = new SlotController(this)\n private dirController = new DirectionController(this)\n\n /**\n * The style variant of the tag group.\n */\n @property({ reflect: true }) variant: 'default' | 'spaced' = 'default'\n\n /**\n * The direction of the tag group.\n */\n @property({ reflect: true }) direction: 'vertical' | 'horizontal' = 'horizontal'\n\n /**\n * Defines whether the tags are forced in a single line\n * or can be flowed into multiple lines (only applied when variant is set to `spaced`).\n */\n @property({ reflect: true, type: Boolean }) wrap = false\n\n /**\n * The appropriate role for the containing element.\n */\n\n @property({ reflect: true }) role: string = 'group'\n\n render() {\n const hasMultipleTags = this.defaultSlot.assigned.length > 1\n\n return html`<div\n class=${classMap({\n 'n-tag-group': true,\n 'n-rtl': this.dirController.isRTL,\n 'n-multiple-tags': hasMultipleTags,\n })}\n >\n <slot></slot>\n </div>`\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-tag-group': TagGroup\n }\n}\n","import * as checkedIcon from '@nordhealth/icons/lib/assets/interface-checked-small.js'\nimport * as closeIcon from '@nordhealth/icons/lib/assets/interface-close-small.js'\nimport { html, LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { ref } from 'lit/directives/ref.js'\nimport { FormDataController } from '../common/controllers/FormDataController.js'\nimport { NordEvent } from '../common/events.js'\nimport { FocusableMixin } from '../common/mixins/FocusableMixin.js'\nimport { InputMixin } from '../common/mixins/InputMixin.js'\nimport componentStyle from '../common/styles/Component.css'\nimport Icon from '../icon/Icon.js'\n\nimport { LocalizeController } from '../localization/LocalizeController.js'\nimport style from './Tag.css'\n\nIcon.registerIcon(checkedIcon)\nIcon.registerIcon(closeIcon)\n\n/**\n * Tags represent a set of keywords that help label, categorize,\n * and organize objects. Commonly used to signify the attributes of an object.\n *\n * @status new\n * @category text\n * @slot - The tag content.\n *\n * @localization removeLabel - Accessible label for the remove button.\n */\n@customElement('nord-tag')\nexport default class Tag extends InputMixin(FocusableMixin(LitElement)) {\n static styles = [componentStyle, style]\n\n private localize = new LocalizeController<'nord-tag'>(this)\n\n protected formData = new FormDataController(this, { value: () => this.formValue })\n\n protected get formValue() {\n return this.variant === 'selectable' && this.checked ? this.value || 'on' : undefined\n }\n\n protected inputId = 'input'\n\n /**\n * The behavioral variant of the tag.\n */\n @property({ reflect: true }) variant: 'default' | 'removable' | 'selectable' = 'default'\n\n /**\n * Controls whether the tag is checked or not (only relevant when variant is set to `selectable`).\n */\n @property({ reflect: true, type: Boolean }) checked: boolean = false\n\n /**\n * The size of the tag. This affects the font-size.\n */\n @property({ reflect: true }) size: 's' | 'm' = 'm'\n\n /**\n * Controls whether the tag expands to fill the width of its container.\n */\n @property({ reflect: true, type: Boolean }) expand = false\n\n protected handleChange(e: Event) {\n const target = e.target as HTMLInputElement\n this.checked = target.checked\n\n e.stopPropagation()\n\n /**\n * Fired whenever the tag has been checked or unchecked via user interaction.\n */\n this.dispatchEvent(new NordEvent('change'))\n }\n\n protected handleRemove() {\n /**\n * Fired when the remove button is activated. This event should be used to remove the tag from the DOM.\n */\n this.dispatchEvent(new NordEvent('remove'))\n }\n\n render() {\n switch (this.variant) {\n case 'selectable':\n return this.renderSelectableTag()\n case 'removable':\n return this.renderRemovableTag()\n case 'default':\n default:\n return this.renderStaticTag()\n }\n }\n\n private renderStaticTag() {\n return html`\n <div class=\"n-tag\">\n <div class=\"n-content\">\n <slot></slot>\n </div>\n </div>\n `\n }\n\n private renderRemovableTag() {\n return html`\n <div class=\"n-tag\">\n <div class=\"n-content\">\n <slot></slot>\n </div>\n <button class=\"n-remove-button\" @click=${this.handleRemove} ?disabled=${this.disabled}>\n <nord-icon name=\"interface-close-small\" label=${this.localize.term('removeLabel')}></nord-icon>\n </button>\n </div>\n `\n }\n\n private renderSelectableTag() {\n return html`\n <label for=${this.inputId} class=\"n-tag\">\n <div class=\"n-input-container\">\n <input\n ${ref(this.focusableRef)}\n class=\"n-input\"\n id=${this.inputId}\n type=\"checkbox\"\n name=${ifDefined(this.name)}\n .value=${this.value}\n .checked=${this.checked}\n ?disabled=${this.disabled}\n @change=${this.handleChange}\n />\n <nord-icon class=\"icon-checked\" name=\"interface-checked-small\"></nord-icon>\n </div>\n <div class=\"n-content\">\n <slot></slot>\n </div>\n </label>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-tag': Tag\n }\n}\n","import { html, LitElement, nothing } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { ref } from 'lit/directives/ref.js'\nimport { observe } from '../common/decorators/observe.js'\n\nimport { NordEvent } from '../common/events.js'\nimport { AutocompleteMixin } from '../common/mixins/AutocompleteMixin.js'\nimport { FocusableMixin } from '../common/mixins/FocusableMixin.js'\nimport { FormAssociatedMixin } from '../common/mixins/FormAssociatedMixin.js'\nimport { InputMixin } from '../common/mixins/InputMixin.js'\nimport { ReadonlyMixin } from '../common/mixins/ReadonlyMixin.js'\nimport { SizeMixin } from '../common/mixins/SizeMixin.js'\n\nimport { TextSelectableMixin } from '../common/mixins/TextSelectableMixin.js'\nimport componentStyle from '../common/styles/Component.css'\nimport formFieldStyle from '../common/styles/FormField.css'\nimport textFieldStyle from '../common/styles/TextField.css'\nimport { LocalizeController } from '../localization/LocalizeController.js'\nimport style from './Textarea.css'\n\nfunction createLengthMeasurer(locale: string) {\n if (Intl.Segmenter) {\n const segmenter = new Intl.Segmenter(locale)\n return (value: string) => [...segmenter.segment(value)].length\n }\n\n return (value: string) => value.length\n}\n\n/**\n * Textarea is a component that allows user to write text over\n * multiple rows. Used when the expected user input is long.\n * For shorter input, use the Input component.\n *\n * @status ready\n * @category form\n * @slot label - Use when a label requires more than plain text.\n * @slot hint - Optional slot that holds hint text for the textarea.\n * @slot error - Optional slot that holds error text for the textarea.\n *\n * @cssprop [--n-textarea-inline-size=240px] - Controls the inline size, or width, of the textarea.\n * @cssprop [--n-textarea-block-size=76px] - Controls the block size, or height, of the textarea.\n * @cssprop [--n-textarea-background=var(--n-color-active)] - Controls the background of the textarea, using our [color tokens](/tokens/#color).\n * @cssprop [--n-textarea-color=var(--n-color-text)] - Controls the text color of the textarea, using our [color tokens](/tokens/#color).\n * @cssprop [--n-textarea-border-color=var(--n-color-border-strong)] - Controls the border color of the textarea, using our [color tokens](/tokens/#color).\n * @cssprop [--n-textarea-border-radius=var(--n-border-radius-s)] - Controls how rounded the corners are, using [border radius tokens](/tokens/#border-radius).\n * @cssprop [--n-label-color=var(--n-color-text)] - Controls the text color of the label, using our [color tokens](/tokens/#color).\n *\n * @localization remainingCharacters - A function which receives the number of remaining characters and returns a string to be used as the aria-live message.\n */\n@customElement('nord-textarea')\nexport default class Textarea extends SizeMixin(\n FormAssociatedMixin(AutocompleteMixin(ReadonlyMixin(TextSelectableMixin(InputMixin(FocusableMixin(LitElement)))))),\n) {\n static styles = [componentStyle, formFieldStyle, textFieldStyle, style]\n\n protected inputId = 'textarea'\n\n private lengthMeasurer!: (value: string) => number\n private localize = new LocalizeController<'nord-textarea'>(this, {\n onLangChange: () => this.handleLangChange(),\n })\n\n /**\n * Controls whether the textarea is resizable.\n * By default is manually resizable vertically.\n * Set to \"auto\" to enable auto-resizing as content grows.\n */\n @property({ reflect: true }) resize: 'vertical' | 'auto' = 'vertical'\n\n /**\n * Controls whether the textarea expands to fill the width of its container.\n */\n @property({ reflect: true, type: Boolean }) expand = false\n\n /**\n * Controls the max allowed length for the textarea.\n */\n @property({ reflect: true, attribute: 'maxlength', type: Number }) maxLength?: number\n\n /**\n * Controls whether to show a count of the number of characters in the textarea.\n * When combined with `maxlength`, both the count and the max length are shown.\n */\n @property({ reflect: true, type: Boolean, attribute: 'character-counter' }) characterCounter = false\n\n render() {\n return html`\n ${this.renderLabel()}\n\n <div class=\"n-input-container\">\n <textarea\n ${ref(this.textSelectableRef)}\n ${ref(this.focusableRef)}\n id=${this.inputId}\n class=\"n-input\"\n ?disabled=${this.disabled}\n ?readonly=${this.readonly}\n ?required=${this.required}\n name=${ifDefined(this.name)}\n maxlength=${ifDefined(this.maxLength)}\n .value=${this.value ?? ''}\n placeholder=${ifDefined(this.placeholder)}\n @change=${this.handleChange}\n @input=${this.handleInput}\n @select=${this.handleSelect}\n aria-describedby=${ifDefined(this.getDescribedBy())}\n aria-invalid=${ifDefined(this.getInvalid())}\n autocomplete=${this.autocomplete as any}\n ></textarea>\n\n ${this.characterCounter ? this.renderCharacterCounter() : nothing}\n </div>\n\n ${this.renderError()}\n ${this.isHintBelow ? this.renderHint() : nothing}\n `\n }\n\n protected handleSelect(e: Event) {\n e.stopPropagation()\n\n /**\n * Fired when some text has been selected.\n */\n this.dispatchEvent(new NordEvent('select'))\n }\n\n private renderCharacterCounter() {\n const { value, maxLength } = this\n const length = typeof value === 'string' ? this.lengthMeasurer(value) : 0\n\n const remainder = maxLength ? maxLength - length : null\n const counter = maxLength ? `${length}/${maxLength}` : length\n\n return html`\n <nord-visually-hidden aria-live=\"polite\" aria-atomic=\"true\">\n ${remainder != null && remainder <= 10 ? this.localize.term('remainingCharacters', remainder) : ''}\n </nord-visually-hidden>\n <div class=\"n-character-counter\">${counter}</div>\n `\n }\n\n private handleLangChange() {\n const lang = this.localize.resolvedLang\n this.lengthMeasurer = createLengthMeasurer(lang)\n }\n\n @observe('resize', 'updated')\n @observe('value', 'updated')\n protected resizeToFitContent() {\n const textarea = this.focusableRef.value\n\n if (!textarea) {\n return\n }\n\n if (this.resize === 'auto') {\n textarea.style.height = 'auto'\n textarea.style.height = `${textarea.scrollHeight}px`\n }\n else {\n textarea.style.height = ''\n }\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-textarea': Textarea\n }\n}\n","import type Toast from '../toast/Toast.js'\nimport { html, LitElement } from 'lit'\n\nimport { customElement } from 'lit/decorators.js'\nimport componentStyle from '../common/styles/Component.css'\nimport style from './ToastGroup.css'\n\ntype ToastOptions = Partial<Pick<Toast, 'variant' | 'autoDismiss'>>\n\n/**\n * Toast group is used to position and style a group of toasts, whilst ensuring they are announced by screen readers.\n *\n * @status ready\n * @category feedback\n * @slot - Default slot in which to place toasts.\n *\n * @fires {NordEvent} dismiss - Fired when a toast is dismissed (via user action or auto-dismiss), and its exit animation has completed. This event should be used to remove the dismissed toast from the DOM.\n */\n@customElement('nord-toast-group')\nexport default class ToastGroup extends LitElement {\n static styles = [componentStyle, style]\n\n render() {\n return html`\n <div class=\"n-toast-group\" role=\"log\" aria-relevant=\"additions\">\n <slot></slot>\n </div>\n `\n }\n\n /**\n * Convenience method for creating and adding a toast to the group.\n * @param {string} text - The text/message of the toast.\n * @param options - An optional object for configuring the toast's `variant` and `autoDismiss`.\n * @returns {Toast} The toast instance.\n */\n addToast(text: string, options: ToastOptions = {}) {\n const { variant, autoDismiss } = options\n const toast = document.createElement('nord-toast')\n\n if (variant) {\n toast.variant = variant\n }\n\n if (autoDismiss != null) {\n toast.autoDismiss = autoDismiss\n }\n\n toast.textContent = text\n this.appendChild(toast)\n\n return toast\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-toast-group': ToastGroup\n }\n}\n","export default '<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m11.41 10 8.29 8.29-1.41 1.41-8.29-8.29-8.28996 8.3-1.410001-1.41 8.290001-8.3-8.300001-8.28996 1.420001-1.420001 8.28996 8.300001 8.29-8.300001 1.41 1.410001z\" fill=\"currentColor\"/></svg>';\nexport const title = \"interface-close\";\nexport const tags = \"nordicon interface close cross remove delete erase symbol\";\n","import * as closeIcon from '@nordhealth/icons/lib/assets/interface-close.js'\nimport { html, LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { classMap } from 'lit/directives/class-map.js'\nimport { ref } from 'lit/directives/ref.js'\n\nimport { observe } from '../common/decorators/observe.js'\nimport { NotificationMixin } from '../common/mixins/NotificationMixin.js'\nimport componentStyle from '../common/styles/Component.css'\nimport Icon from '../icon/Icon.js'\nimport style from './Toast.css'\n\nIcon.registerIcon(closeIcon)\n\n/**\n * Toasts are non-disruptive messages that appear in the interface\n * to provide quick, at-a-glance feedback on the outcome of an action.\n *\n * @status ready\n * @category feedback\n * @slot - Default slot used for the toast text/message.\n * @fires dismiss - Fired when the toast is dismissed (via user action or auto-dismiss), and its exit animation has completed. This event should be used to remove the dismissed toast from the DOM.\n */\n@customElement('nord-toast')\nexport default class Toast extends NotificationMixin(LitElement) {\n static styles = [componentStyle, style]\n\n private timeoutId?: ReturnType<typeof setTimeout>\n\n /**\n * The style variant of the toast.\n */\n @property({ reflect: true }) variant: 'default' | 'danger' = 'default'\n\n /**\n * Timeout in milliseconds before the toast is automatically dismissed.\n */\n @property({ reflect: true, type: Number, attribute: 'auto-dismiss' }) autoDismiss? = 10000\n\n disconnectedCallback() {\n super.disconnectedCallback()\n clearTimeout(this.timeoutId)\n }\n\n /**\n * Programmatically dismiss the toast.\n * The returned promise resolves when toast's exit animation is complete.\n */\n async dismiss() {\n clearTimeout(this.timeoutId)\n return super.dismiss()\n }\n\n render() {\n return html`\n <div ${ref(this.notificationRef)} class=${classMap({ 'n-toast': true, 'n-dismissed': this.dismissed })}>\n <div class=\"n-toast-inner\">\n <slot></slot>\n </div>\n\n <button class=\"n-dismiss\" @click=${this.dismiss} aria-hidden=\"true\">\n <nord-icon name=\"interface-close\" size=\"s\"></nord-icon>\n </button>\n </div>\n `\n }\n\n @observe('autoDismiss')\n protected handleAutoDismissChange() {\n clearTimeout(this.timeoutId)\n\n if (this.autoDismiss != null && this.autoDismiss >= 0) {\n setTimeout(() => this.dismiss(), this.autoDismiss)\n }\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-toast': Toast\n }\n}\n","/* eslint-disable lit-a11y/role-has-required-aria-attrs */\nimport { html, LitElement, nothing } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { ref } from 'lit/directives/ref.js'\n\nimport { FocusableMixin } from '../common/mixins/FocusableMixin.js'\nimport { FormAssociatedMixin } from '../common/mixins/FormAssociatedMixin.js'\nimport { InputMixin } from '../common/mixins/InputMixin.js'\n\nimport componentStyle from '../common/styles/Component.css'\nimport formFieldStyle from '../common/styles/FormField.css'\nimport style from './Toggle.css'\n\n/**\n * Toggle switch gives control over a feature or option that can be\n * turned on or off. If a physical switch would work for the action, a\n * toggle is probably the best component to use.\n *\n * @status ready\n * @category form\n * @slot label - Use when a label requires more than plain text.\n * @slot hint - Optional slot that holds hint text for the input.\n * @slot error - Optional slot that holds error text for the input.\n *\n * @cssprop [--n-label-color=var(--n-color-text)] - Controls the text color of the label, using our [color tokens](/tokens/#color).\n */\n@customElement('nord-toggle')\nexport default class Toggle extends FormAssociatedMixin(InputMixin(FocusableMixin(LitElement))) {\n static styles = [componentStyle, formFieldStyle, style]\n\n protected override get formValue() {\n return this.checked ? this.value || 'on' : undefined\n }\n\n /**\n * Controls whether the toggle is checked or not.\n */\n @property({ reflect: true, type: Boolean }) checked: boolean = false\n\n /**\n * Controls whether the contents are displayed in reverse order,\n * putting the label before the toggle.\n */\n @property({ reflect: true, type: Boolean }) reverse: boolean = false\n\n /**\n * The size of the toggle switch.\n */\n @property({ reflect: true }) size: 's' | 'm' | 'l' = 'm'\n\n render() {\n const label = html`\n <div class=\"n-expand\">\n ${this.renderLabel()}\n ${this.isHintBelow ? nothing : this.renderError()}\n </div>\n `\n const input = html`<div class=\"n-input-container\">\n <input\n ${ref(this.focusableRef)}\n class=\"n-toggle\"\n id=${this.inputId}\n type=\"checkbox\"\n role=\"switch\"\n name=${ifDefined(this.name)}\n .value=${this.value}\n .checked=${this.checked}\n ?disabled=${this.disabled}\n ?required=${this.required}\n aria-describedby=${ifDefined(this.getDescribedBy())}\n aria-invalid=${ifDefined(this.getInvalid())}\n @change=${this.handleChange}\n />\n </div>`\n\n return html`\n <div class=\"n-flex\">${this.reverse ? [label, input] : [input, label]}</div>\n ${this.isHintBelow ? this.renderError() : nothing}\n ${this.isHintBelow ? this.renderHint() : nothing}\n `\n }\n\n protected handleChange(e: Event): void {\n const target = e.target as HTMLInputElement\n this.checked = target.checked\n super.handleChange(e)\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-toggle': Toggle\n }\n}\n","function getTokens(element: Element, attr: string) {\n const value = element.getAttribute(attr)\n return value ? value.split(/\\s+/) : []\n}\n\nfunction setTokens(element: Element, attr: string, tokens: string[]) {\n element.setAttribute(attr, tokens.join(' '))\n}\n\n/**\n * Carefully adds a token to a space-separated attribute\n * Similar to classList, but for any attribute.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMTokenList/add\n */\nexport function add(element: Element, attr: string, token: string) {\n const tokens = getTokens(element, attr)\n\n if (!tokens.includes(token)) {\n setTokens(element, attr, tokens.concat(token))\n }\n}\n\n/**\n * Carefully removes a token from a space-separated attribute.\n * Similar to classList, but for any attribute.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMTokenList/remove\n */\nexport function remove(element: Element, attr: string, token: string) {\n const tokens = getTokens(element, attr)\n\n if (tokens.includes(token)) {\n setTokens(\n element,\n attr,\n tokens.filter(t => t !== token),\n )\n }\n}\n","import type { States } from '../common/fsm.js'\nimport type { FocusableMixinInterface } from '../common/mixins/FocusableMixin.js'\nimport { computePosition, flip, offset, shift } from '@floating-ui/dom'\n\nimport { html, LitElement } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport * as attr from '../common/attribute.js'\nimport { EventController } from '../common/controllers/EventController.js'\nimport { SlotController } from '../common/controllers/SlotController.js'\nimport { observe } from '../common/decorators/observe.js'\nimport { fsm } from '../common/fsm.js'\nimport { logicalToPhysical } from '../common/positioning.js'\nimport componentStyle from '../common/styles/Component.css'\nimport style from './Tooltip.css'\n\n// @ts-expect-error we're being naughty and accessing a protected field!\n// however this means we always get the correct types,\n// and it will ensure this file is not forgotten about if focusable mixin ever changes\ntype FocusableElement = HTMLElement & Pick<FocusableMixinInterface, 'focusableRef'>\n\nfunction isElement(el: Node): el is Element {\n return el.nodeType === Node.ELEMENT_NODE\n}\n\nfunction referencesTooltip(node: Node, tooltip: Tooltip) {\n return Boolean(tooltip.id) && isElement(node) && node.getAttribute('aria-describedby') === tooltip.id\n}\n\nfunction getFocusable(el?: FocusableElement): HTMLElement | undefined {\n const focusable = el?.focusableRef?.value as HTMLElement | FocusableElement | undefined\n\n if (focusable && 'focusableRef' in focusable) {\n return getFocusable(focusable)\n }\n\n return focusable\n}\n\nconst { transition } = fsm({\n hidden: {\n show: 'waiting',\n },\n visible: {\n hide: 'hidden',\n reposition: 'positioning',\n show: 'positioning',\n },\n waiting: {\n timeout: 'positioning',\n hide: 'hidden',\n },\n positioning: {\n positioned: 'visible',\n hide: 'hidden',\n },\n})\n\ntype TooltipStates = States<typeof transition>\n\n/**\n * Tooltips are floating containers for displaying additional information\n * for the currently focused element. A tooltip can be useful when you want\n * to e.g. give a hint about an existing Command Menu shortcut.\n *\n * @status ready\n * @category overlay\n * @slot - The tooltip content\n * @slot shortcut - Optional slot that holds shortcut keys to access the subject\n * @cssprop [--n-tooltip-max-size=50ch] - Controls the maximum inline size, or width, of the tooltip.\n */\n@customElement('nord-tooltip')\nexport default class Tooltip extends LitElement {\n static styles = [componentStyle, style]\n\n // tracks the last tooltip opened, so we can enforce only one is ever open at a time\n private static lastOpened?: Tooltip\n\n private shortcutSlot = new SlotController(this, 'shortcut')\n private events = new EventController(this)\n\n // The current element which revealed the tooltip shown\n private currentElement?: FocusableElement\n private timeoutId?: ReturnType<typeof setTimeout>\n\n /**\n * the proxy element is for cases where the targetElement is a web component,\n * and the WC has a focusable child in its shadow root e.g. a button component.\n * in this case, when the tooltip is shown, we inject the proxy into targetElement's shadow root\n * and wire up aria-describedby from the focusable element to the proxy.\n * when the tooltip is hidden, we remove the proxy and remove the aria-describedby relationship.\n */\n private proxy?: HTMLSpanElement\n\n /**\n * The current state of the tooltip, dependent on the state machine\n */\n @state() private state: TooltipStates = 'hidden'\n\n // The current coordinates for the tooltip\n private coords: [number, number] = [0, 0]\n\n /**\n * Control the position of the tooltip component.\n * When set to \"none\", the tooltip will be shown above\n * but accommodate for browser boundaries.\n */\n @property({ reflect: true }) position: 'block-end' | 'block-start' | 'inline-start' | 'inline-end' = 'block-start'\n\n /**\n * The tooltip role, set on the component by default.\n */\n\n @property({ reflect: true }) role = 'tooltip'\n\n /**\n * The id for the active element to reference via aria-describedby.\n */\n\n @property({ reflect: true }) id: string = ''\n\n /**\n * The delay in milliseconds before the tooltip is opened.\n */\n @property({ reflect: true, type: Number }) delay: number = 500\n\n /**\n * Apply all event listeners\n */\n connectedCallback() {\n super.connectedCallback()\n\n this.proxy = document.createElement('span')\n\n const rootNode = this.getRootNode() as Document\n\n this.events.listen(rootNode, 'keydown', this.hideOnEscape)\n\n // we treat mouseover and focusin the same, since they both show tooltip\n this.events.listen(rootNode, 'mouseover', this.handleShow)\n this.events.listen(rootNode, 'focusin', this.handleShow)\n\n // we treat focusout, mouseout, click the same, since they all hide tooltip\n this.events.listen(rootNode, 'mouseout', this.handleHide)\n this.events.listen(rootNode, 'focusout', this.handleHide)\n // we use event capture here to handle cases where e.g. a close button causes its ancestor to be removed from the DOM.\n // in this case the click event will never bubble up to the rootNode, so we never receive it, and the tooltip can remain open\n // by capturing, we get this event first, and can close the tooltip eagerly\n this.events.listen(rootNode, 'click', this.handleHide, { capture: true })\n\n this.events.listen(window, 'resize', this.reposition, { passive: true })\n this.events.listen(window, 'scroll', this.reposition, { passive: true })\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n\n this.proxy?.remove()\n this.proxy = undefined\n }\n\n render() {\n return html`\n <div class=\"n-tooltip\">\n <slot></slot>\n <div class=\"n-tooltip-shortcut\" ?hidden=${this.shortcutSlot.isEmpty}>\n <slot class=\"n-tooltip-key\" name=\"shortcut\"></slot>\n </div>\n </div>\n `\n }\n\n @observe('id')\n protected handleIdChange() {\n if (!this.id) {\n console.warn('NORD: The tooltip requires an id attribute and value')\n }\n }\n\n @observe('state')\n private handleStateChange(prevState: TooltipStates) {\n switch (this.state) {\n case 'hidden': {\n if (prevState === 'waiting' && this.timeoutId) {\n clearTimeout(this.timeoutId)\n }\n\n this.removeDescribedBy()\n this.currentElement = undefined\n this.style.visibility = 'hidden'\n this.style.opacity = '0'\n break\n }\n\n case 'visible': {\n this.timeoutId = undefined\n Tooltip.lastOpened = this\n this.addDescribedBy()\n\n const [x, y] = this.coords\n\n // use physical properties here since floating-ui\n // works exclusively in physical dimensions\n // we do all the mapping in logicalToPhysical\n this.style.left = `${x}px`\n this.style.top = `${y}px`\n this.style.visibility = 'visible'\n this.style.opacity = '1'\n break\n }\n\n case 'waiting': {\n this.timeoutId = setTimeout(() => {\n this.state = transition(this.state, 'timeout')\n }, this.delay)\n break\n }\n\n case 'positioning': {\n if (Tooltip.lastOpened !== this) {\n Tooltip.lastOpened?.hideTooltip()\n }\n\n if (this.currentElement) {\n this.updatePosition(this.currentElement)\n }\n break\n }\n }\n }\n\n /**\n * Setting and updating the position of the tooltip\n */\n private updatePosition = (currentElement: HTMLElement) =>\n computePosition(currentElement, this, {\n strategy: 'fixed',\n placement: logicalToPhysical(this.position),\n middleware: [\n offset(8),\n flip(),\n shift({\n padding: 8,\n }),\n ],\n }).then(({ x, y }) => {\n this.coords = [x, y]\n this.state = transition(this.state, 'positioned')\n })\n\n private hideTooltip = () => {\n this.state = transition(this.state, 'hide')\n }\n\n private reposition = () => {\n this.state = transition(this.state, 'reposition')\n }\n\n private handleShow = (e: Event) => {\n const target = e.target as FocusableElement\n\n if (referencesTooltip(target, this)) {\n this.currentElement = target\n this.state = transition(this.state, 'show')\n }\n }\n\n private handleHide = (e: Event) => {\n if (e.target === this.currentElement) {\n this.hideTooltip()\n }\n }\n\n private hideOnEscape = (e: KeyboardEvent) => {\n if (e.key === 'Escape') {\n this.hideTooltip()\n }\n }\n\n private addDescribedBy = () => {\n const focusable = getFocusable(this.currentElement)\n\n if (focusable && this.proxy) {\n this.proxy.hidden = true\n this.proxy.id = this.id\n this.proxy.textContent = this.textContent\n\n focusable.insertAdjacentElement('afterend', this.proxy)\n attr.add(focusable, 'aria-describedby', this.id)\n }\n }\n\n private removeDescribedBy = () => {\n const focusable = getFocusable(this.currentElement)\n\n if (focusable && this.proxy) {\n this.proxy.remove()\n attr.remove(focusable, 'aria-describedby', this.id)\n }\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-tooltip': Tooltip\n }\n}\n","import { html, LitElement } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\nimport componentStyle from '../common/styles/Component.css'\nimport style from './TopBar.css'\n\n/**\n * Top bar is a header component that is always visible at the top of the interface. Top bar allows functionality such as search and contextual menus to be placed at the top of the interface.\n *\n * @status ready\n * @category structure\n * @slot - Used for the main content of the top bar. We recommend placing your application’s global search functionality into this slot.\n * @slot end - Optional slot for menus, buttons, toggles, etc.\n */\n@customElement('nord-top-bar')\nexport default class TopBar extends LitElement {\n static styles = [componentStyle, style]\n\n render() {\n return html`\n <slot></slot>\n <slot name=\"end\"></slot>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-top-bar': TopBar\n }\n}\n"],"names":["__decorate","decorators","target","key","desc","d","c","arguments","length","r","Object","getOwnPropertyDescriptor","Reflect","decorate","i","defineProperty","SuppressedError","t","globalThis","e","ShadowRoot","ShadyCSS","nativeShadow","Document","prototype","CSSStyleSheet","s","Symbol","o","WeakMap","n$7","constructor","this","_$cssResult$","Error","cssText","styleSheet","get","replaceSync","set","toString","reduce","n","cssRules","is","h","getOwnPropertyNames","getOwnPropertySymbols","getPrototypeOf","a","trustedTypes","l","emptyScript","p","reactiveElementPolyfillSupport","u","toAttribute","Boolean","Array","JSON","stringify","fromAttribute","Number","parse","f","b","attribute","type","String","converter","reflect","useDefault","hasChanged","metadata","litPropertyMetadata","y$1","HTMLElement","addInitializer","_$Ei","push","observedAttributes","finalize","_$Eh","keys","createProperty","state","hasOwnProperty","create","wrapped","elementProperties","noAccessor","getPropertyDescriptor","call","requestUpdate","configurable","enumerable","getPropertyOptions","Map","finalized","properties","_$Eu","elementStyles","finalizeStyles","styles","isArray","Set","flat","reverse","unshift","toLowerCase","super","_$Ep","isUpdatePending","hasUpdated","_$Em","_$Ev","_$ES","Promise","enableUpdating","_$AL","_$E_","forEach","addController","_$EO","add","renderRoot","isConnected","hostConnected","removeController","delete","size","createRenderRoot","shadowRoot","attachShadow","shadowRootOptions","adoptedStyleSheets","map","document","createElement","litNonce","setAttribute","textContent","appendChild","connectedCallback","disconnectedCallback","hostDisconnected","attributeChangedCallback","_$AK","_$ET","removeAttribute","_$Ej","hasAttribute","C","_$EP","has","_$Eq","reject","scheduleUpdate","performUpdate","shouldUpdate","willUpdate","hostUpdate","update","_$EM","_$AE","hostUpdated","firstUpdated","updated","updateComplete","getUpdateComplete","y","mode","ReactiveElement","reactiveElementVersions","createPolicy","createHTML","Math","random","toFixed","slice","createComment","iterator","v","_","m","RegExp","g","$","_$litType$","strings","values","x","T","for","E","A","createTreeWalker","P","V","lastIndex","exec","test","startsWith","N","parts","el","currentNode","content","firstChild","replaceWith","childNodes","nextNode","nodeType","hasAttributes","getAttributeNames","endsWith","getAttribute","split","index","name","ctor","H","I","L","k","tagName","append","data","indexOf","innerHTML","S","_$Co","_$Cl","_$litDirective$","_$AO","_$AT","_$AS","_$AV","_$AN","_$AD","_$AM","parentNode","_$AU","creationScope","importNode","R","nextSibling","z","_$AI","_$Cv","_$AH","_$AA","_$AB","options","startNode","endNode","_$AR","O","insertBefore","createTextNode","_$AC","M","_$AP","remove","setConnected","element","fill","j","toggleAttribute","capture","once","passive","removeEventListener","addEventListener","handleEvent","host","Z","D","U","B","F","litHtmlPolyfillSupport","litHtmlVersions","renderBefore","_$litPart$","renderOptions","_$Do","render","_$litElement$","litElementHydrateSupport","LitElement","litElementPolyfillSupport","litElementVersions","customElements","define","kind","init","querySelector","PropertyObserverController","cb","lifecycle","handle","_value","newValue","observe","propertyName","methodName","fsm","config","transition","currentState","event","VisuallyHidden","html","style","customElement","i$2","_$Ct","_$Ci","e$3","it","directiveName","_t","raw","resultType","cond","condition","trueCase","falseCase","nothing","loadIconCdn","fetch","then","response","ok","TypeError","text","Icon","Icon_1","svg","registerResolver","resolver","manager","registerIcon","iconOrName","icon","label","color","ifDefined","unsafeHTML","handleNameChange","resolve","componentStyle","cache","onResolved","cached","catch","title","default","clear","property","initial","loading","load","error","loaded","Avatar","variant","renderImage","renderFallback","handleSrcChange","src","handleLoad","handleError","Badge","strong","warningIcon","dangerIcon","infoIcon","successIcon","iconMap","warning","warningIcon.title","danger","dangerIcon.title","info","infoIcon.title","success","successIcon.title","Banner","filter","join","st","nt","classList","DirectionController","dir","documentElement","isLTR","isRTL","observer","MutationObserver","attributes","attributeFilter","hosts","EventController","listeners","stop","listen","listener","SlotController","slotName","handleSlotChange","onChange","events","selector","hasContent","isEmpty","assigned","from","querySelectorAll","_e","ButtonGroup","defaultSlot","dirController","direction","wrap","role","hasSmallButtons","every","node","localName","hasMultipleButtons","classMap","_$AQ","reconnected","disconnected","setValue","G","rt","lt","ct","ht","value","LightDomController","container","FocusableMixin","superClass","focusableRef","createRef","focus","_a","blur","click","InputMixin","InputElement","disabled","formAncestor","form","id","oldVal","_formId","getRootNode","closest","Spinner","Button","buttonRef","lightDom","renderLightDom","download","expand","square","hideDropdownIcon","handleOuterClick","composedPath","some","stopPropagation","isDropdownToggle","assignedSlot","isIconButton","shouldShowDropdownIcon","href","innards","renderLink","renderButton","ref","handleProxyChange","handleClick","accessibleExpanded","accessibleHasPopup","slot","proxyButton","dt","ut","w","navigator","platform","getModifierState","trim","pop","timeout","KeyboardEvent","toUpperCase","code","find","includes","clearTimeout","setTimeout","bind","groupBy","array","grouped","item","collection","preventDefault","SwipeController","hadFirstUpdate","initialTouchX","initialTouchY","handleTouchStart","pageX","pageY","changedTouches","handleTouchEnd","matchesGesture","onSwipeEnd","distX","distY","details","initialX","initialY","isHorizontalSwipe","abs","isDownwardsSwipe","ISO_DATE_FORMAT","DaysOfWeek","createDate","year","month","day","dayInt","parseInt","monthInt","yearInt","isInteger","date","Date","setFullYear","parseISODate","matches","match","printISODate","getDate","getMonth","getFullYear","padStart","today","UTC","getDayNames","locale","weekday","days","getDay","toLocaleDateString","setDate","getMonthNames","months","setMonth","isEqualMonth","isEqual","addDays","startOfWeek","firstDayOfWeek","Monday","diff","endOfWeek","startOfMonth","endOfMonth","setYear","clamp","min","max","time","getTime","inRange","getViewOfMonth","start","end","current","getDaysInRange","val","en","$lang","$name","$dir","instructions","inputLabel","footerArrowKeys","footerEnterKey","footerEscapeKey","footerBackspaceKey","noResults","searchTerm","tip","placeholder","prevMonthLabel","nextMonthLabel","monthSelectLabel","yearSelectLabel","modalHeading","closeLabel","buttonLabel","selectedDateMessage","dateOutOfMinBound","minDate","dateOutOfMaxBound","maxDate","remainingCharacters","remainder","dismissLabel","unreadLabel","removeLabel","documentLangSubscribers","translationRegistrationSubscribers","translations","deepMerge","source","isObject","result","sourceValue","targetValue","subscriber","registerTranslation","translation","lang","existing","merged","notifyTranslationRegistration","isTranslationRegistered","resolveTranslation","langCode","langOnly","noop","LocalizeController","onLangChange","handleLangChange","resolved","resolvedTranslation","resolvedLang","unsubscribeTranslationRegistration","unsubscribeDocumentLang","subscribeToDocumentLang","_b","_c","disconnect","term","args","component","componentTranslation","console","warn","fallbackComponentTranslation","fallback","translationValue","NordEvent","Event","eventInitDict","bubbles","composed","oneEvent","race","DateSelectEvent","fn","arrowRightIcon","arrowLeftIcon","arrowDownIcon","isDateDisabled","isDateHighlighted","dialogLabelId","Calendar","swipe","addMonths","shortcuts","createKeybindingsHandler","ArrowRight","ArrowLeft","ArrowDown","ArrowUp","Home","End","PageUp","PageDown","addYears","localize","activeFocus","focusedDay","handleDaySelect","isInRange","isAllowed","dispatchEvent","handleMonthSelect","handleYearSelect","handleNextMonthClick","handlePreviousMonthClick","enableActiveFocus","disableActiveFocus","table","currentTarget","relatedTarget","contains","focusedDayNode","monthSelectNode","getToday","valueAsDate","focusedMonth","focusedYear","minDateStartOfMonth","undefined","maxDateEndOfMonth","currentYear","minYear","maxYear","monthNames","monthNamesShort","repeat","to","range","dayNames","startingOffset","mapFn","dayName","dayNamesShort","adjustedIndex","chunkSize","chunk","week","outsideRange","isToday","isDisabled","isSelected","isInMonth","isHighlighted","formattedDate","dateFormatShort","format","accessibleLabel","handleValueChange","setFocusedDay","handleFocusedDayChange","Intl","DateTimeFormat","years","query","Card","headerSlot","headerEndSlot","footerSlot","padding","footerDivider","FormDataController","_form","handleFormData","formData","cleanup","FormAssociatedMixin","FormAssociatedElement","labelSlot","errorSlot","hintSlot","formValue","inputId","errorId","hintId","hintBelow","hideLabel","required","hideRequired","handleInput","handleChange","renderLabel","additionalContent","isHintBelow","renderHint","hasHint","hint","renderError","hasError","getDescribedBy","getInvalid","SizeMixin","SizeElement","checkedIcon","indeterminateIcon","Checkbox","indeterminate","checked","formFieldStyle","ARROW_RE","ESC_RE","ShortcutController","unbind","unregister","tinykeys","window","normalised","keybinding","mapped","replace","_match","normalise","LightDismissController","isMouseDownOutside","handleEsc","isOpen","onDismiss","handleMouseDown","predicate","isDismissible","shortcut","Escape","getFocusedElement","root","activeElement","KeyboardController","actions","commandShortcuts","globalShortcuts","toggleOpen","navigationShortcuts","Enter","trigger","Backspace","goBack","next","previous","registerCommandShortcuts","command","commands","handler","SelectEvent","eventName","KEY_REGEX","chevronIconLeft","chevronIconRight","altKeyIcon","CommandMenuAction","selected","getIconName","renderShortcut","ensureInView","requestAnimationFrame","scrollIntoView","block","chevronIconRight.title","chevronIconLeft.title","altKeyIcon.title","navigateIcon","enterIcon","backspaceIcon","CommandMenu","inputRef","listRef","dismissController","open","close","keyboardController","select","externalFiltering","exitNestedOnSearch","searchQuery","bump","selectedIndex","filteredCommands","show","cancelable","setParent","parent","previousFocus","sections","activeDescendant","handleAnimationEnd","handleBlur","renderNoResults","section","renderSection","navigateIcon.title","enterIcon.title","backspaceIcon.title","sectionId","handleCommandsChange","handleBump","focusOnOpen","scrollTop","input","setSearch","parentCommand","str","filterCommands","ordered","searchTerms","toLocaleLowerCase","keywords","searchSpace","matcher","ReadonlyMixin","ReadonlyElement","readonly","isoAdapter","ft","removeProperty","setProperty","ResizeController","ResizeObserver","entry","borderBoxSize","inlineSize","blockSize","AutocompleteMixin","AutocompleteElement","autocomplete","TextSelectableMixin","textSelectableRef","selectionStart","selectionEnd","selectionDirection","setSelectionRange","setRangeText","replacement","selectMode","getNativeElement","searchIcon","px","defaultInputmodeMap","number","email","tel","url","search","Input","startObserver","startSlot","endObserver","endSlot","disallowPattern","inputmode","handleInputChange","inputEl","regex","cursor","beforeCursor","afterCursor","filteredBeforeCursor","newCursor","cleanValue","isNumber","inputmodeValue","styleMap","handleKeydown","handleSelect","button","getSubmitButton","textFieldStyle","sides","alignments","placements","acc","side","concat","round","floor","createCoords","oppositeSideMap","left","right","bottom","top","oppositeAlignmentMap","evaluate","param","getSide","placement","getAlignment","getOppositeAxis","axis","getAxisLength","yAxisSides","getSideAxis","getAlignmentAxis","getAlignmentSides","rects","rtl","alignment","alignmentAxis","mainAlignmentSide","reference","floating","getOppositePlacement","getOppositeAlignmentPlacement","lrPlacement","rlPlacement","tbPlacement","btPlacement","getOppositeAxisPlacements","flipAlignment","list","isStart","getSideList","rectToClientRect","rect","width","height","computeCoordsFromPlacement","_ref","sideAxis","alignLength","isVertical","commonX","commonY","commonAlign","coords","async","detectOverflow","_await$platform$isEle","elements","strategy","boundary","rootBoundary","elementContext","altBoundary","paddingObject","expandPaddingObject","getPaddingObject","clippingClientRect","getClippingRect","isElement","contextElement","getDocumentElement","offsetParent","getOffsetParent","offsetScale","getScale","elementClientRect","convertOffsetParentRelativeRectToViewportRelativeRect","getSideOffsets","overflow","isAnySideFullyClipped","originSides","hasWindow","getNodeName","isNode","nodeName","getWindow","_node$ownerDocument","ownerDocument","defaultView","Node","Element","isHTMLElement","isShadowRoot","invalidOverflowDisplayValues","isOverflowElement","overflowX","overflowY","display","getComputedStyle","tableElements","isTableElement","topLayerSelectors","isTopLayer","transformProperties","willChangeValues","containValues","isContainingBlock","elementOrCss","webkit","isWebKit","css","containerType","backdropFilter","willChange","contain","CSS","supports","lastTraversableNodeNames","isLastTraversableNode","getNodeScroll","scrollLeft","scrollX","scrollY","getParentNode","getNearestOverflowAncestor","body","getOverflowAncestors","traverseIframes","_node$ownerDocument2","scrollableAncestor","isBody","win","frameElement","getFrameElement","visualViewport","getCssDimensions","getComputedStyle$1","parseFloat","hasOffset","offsetWidth","offsetHeight","shouldFallback","unwrapElement","domElement","getBoundingClientRect","isFinite","noOffsets","getVisualOffsets","offsetLeft","offsetTop","includeScale","isFixedStrategy","clientRect","scale","visualOffsets","isFixed","floatingOffsetParent","shouldAddVisualOffsets","offsetWin","currentWin","currentIFrame","iframeScale","iframeRect","clientLeft","paddingLeft","clientTop","paddingTop","getWindowScrollBarX","leftScroll","getHTMLOffset","scroll","htmlRect","SCROLLBAR_MAX","absoluteOrFixed","getClientRectFromClippingAncestor","clippingAncestor","clientWidth","clientHeight","visualViewportBased","windowScrollbarX","doc","bodyStyles","bodyMarginInline","compatMode","marginLeft","marginRight","clippingStableScrollbarWidth","getViewportRect","scrollWidth","scrollHeight","getDocumentRect","getInnerBoundingClientRect","hasFixedPositionAncestor","stopNode","position","getRectRelativeToOffsetParent","isOffsetParentAnElement","offsets","setLeftRTLScrollbarOffset","offsetRect","htmlOffset","isStaticPositioned","getTrueOffsetParent","polyfill","rawOffsetParent","svgOffsetParent","getContainingBlock","topLayer","clippingAncestors","cachedResult","currentContainingBlockComputedStyle","elementIsFixed","computedStyle","currentNodeIsContaining","ancestor","getClippingElementAncestors","firstClippingAncestor","clippingRect","accRect","getElementRects","getOffsetParentFn","getDimensionsFn","getDimensions","floatingDimensions","getClientRects","rectsAreEqual","autoUpdate","ancestorScroll","ancestorResize","elementResize","layoutShift","IntersectionObserver","animationFrame","referenceEl","ancestors","cleanupIo","onMove","timeoutId","io","_io","refresh","skip","threshold","elementRectForRootMargin","rootMargin","isFirstUpdate","handleObserve","entries","ratio","intersectionRatio","observeMove","frameId","reobserveFrame","resizeObserver","firstEntry","unobserve","cancelAnimationFrame","_resizeObserver","prevRefRect","frameLoop","nextRefRect","_resizeObserver2","offset","_middlewareData$offse","_middlewareData$arrow","middlewareData","diffCoords","mainAxisMulti","crossAxisMulti","rawValue","mainAxis","crossAxis","convertValueToCoords","arrow","alignmentOffset","autoPlacement","_middlewareData$autoP","_middlewareData$autoP2","_placementsThatFitOnE","allowedPlacements","autoAlignment","detectOverflowOptions","placements$1","getPlacementList","currentIndex","currentPlacement","alignmentSides","reset","currentOverflows","allOverflows","overflows","nextPlacement","placementsSortedByMostSpace","sort","placementsThatFitOnEachSide","resetPlacement","shift","checkMainAxis","checkCrossAxis","limiter","mainAxisCoord","crossAxisCoord","maxSide","limitedCoords","enabled","flip","_middlewareData$flip","initialPlacement","fallbackPlacements","specifiedFallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","initialSideAxis","isBasePlacement","oppositePlacement","getExpandedPlacements","hasFallbackAxisSideDirection","overflowsData","_middlewareData$flip2","_overflowsData$filter","nextIndex","_overflowsData$filter2","currentSideAxis","hide","referenceHiddenOffsets","referenceHidden","escapedOffsets","escaped","computePosition","mergedOptions","platformWithCache","middleware","validMiddleware","statefulPlacement","resetCount","_platform$detectOverf","nextX","nextY","computePosition$1","ScrollbarController","unlockScroll","lockScroll","locks","documentWidth","innerWidth","paddingRight","setStyle","resets","getPropertyValue","FloatingMixin","FloatingElement","align","logicalMapLTR","logicalMapRTL","logicalMap","logicalToPhysical","logicalSide","logicalSideAlign","mediaQuery","matchMedia","Popout","scrollBar","dismiss","popout","targetElement","smallViewport","alwaysFloating","enableScroll","leaveTopLayer","updatePosition","anchorElement","computePositionConfig","computedPosition","enterTopLayer","handleMediaQueryChange","cleanupAutoUpdate","moveFocusToButton","preventScroll","initializeElements","handleIdChange","getToggle","getAnchor","handleOpenChange","handleAnchorChange","showPopover","rootNode","allToggles","toggle","HTMLSlotElement","assignedElements","anchor","Stack","gap","alignItems","calendarIcon","closeIcon","DatePicker","createDateFormatters","dateAdapter","internalError","validateDateBounds","handleFocus","parsed","valueAsNumber","NaN","dateFormatLong","handleOpen","handleClose","focusLast","focusFirst","closeButton","calendar","Divider","handleDirectionChange","Footer","Drawer","DropdownGroup","heading","DropdownItem","popoutCounter","DropdownSubmenu","mobileActive","popoutId","currentTriggerElement","popoutOpen","mobileMediaQuery","isSmallScreen","parentDropdownAlwaysFloating","handleTriggerMouseEnter","shouldUseMobileStack","closeOtherSubmenus","handleTriggerClick","stopImmediatePropagation","navigateIntoSubmenu","handleTriggerKeydown","handleContentKeydown","navigateBack","handlePopoutOpen","handlePopoutClose","handleParentDropdownMouseOver","parentDropdown","isInSubmenuStack","submenuStackRef","isDeepestInStack","deepestSubmenu","triggerElement","parentObserver","mutations","mutation","attributeName","active","handleTriggerSlotChange","isTouchDevice","immediateParent","parentElement","sibling","deactivateMobile","triggerSlot","_d","CustomEvent","detail","submenu","contentDiv","firstItem","Dropdown","submenuStack","isNavigating","isShowingSubmenu","handleAlwaysFloatingChange","activeSubmenu","handleSubmenuNavigate","handleBackClick","newTop","focusTarget","clearSubmenuStack","eventTarget","topSubmenu","customEvent","previousDeepest","newSubmenu","delegatesFocus","EmptyState","Fieldset","Header","defaultEnabled","BroadcastChannelController","BroadcastChannel","channel","channelName","onMessage","post","message","postMessage","storage","defaultValue","serialize","deserialize","localStorage","getItem","setItem","unlockIcon","lockIcon","NavToggle","localization","unlockIcon.title","lockIcon.title","NAV_DEFAULT_WIDTH","navWidthStore","navWidthDefaultStore","navOpenStore","navMachine","opened","closed","focusin","pointerenter","peek","focusout","pointerleave","dropdownOpen","blocked","dropdownClose","wait","unpeek","transitionend","Layout","navSlot","drawerSlot","topBarSlot","lightDismiss","navState","wideScreen","navTransition","navEl","broadcast","syncNavState","navOpen","navWidth","isDragging","persistNavState","defaultNavWidth","minNavWidth","maxNavWidth","sticky","stickyFooter","handleToggleClick","handleNavFocus","handleMainFocus","handleMouseEnter","handleMouseLeave","handleTransitionEnd","isNarrow","setNavWidth","adjustedNavWidth","handleDropdownOpen","handleDropdownClose","handleNavClick","startDragging","handleDrag","stopDragging","handleKeyboardResize","renderNavCollapse","handleMainClick","renderNavToggle","handleNavWidthChange","handleNavStateChange","prev","peekTimeoutId","defaultPrevented","isNavItem","hasSubNav","setPointerCapture","pointerId","clientX","stickyStyle","Message","unread","itemStyle","setInertAttributes","setInertAttribute","getElementsAround","nextElementSibling","previousElementSibling","FocusTrapController","inertElements","release","trap","ModalController","trackLastButton","lastButton","polyfillSubmitter","submitter","handleLightDismiss","isLightDismissEnabled","handleSubmit","isDialogProperty","method","isDialogAttr","focusTrap","dialog","SubmitEvent","openModals","unblock","backdrop","items","splice","ModalCancelEvent","writable","ModalCloseEvent","Modal","featureSlot","modalController","handleDismiss","persistent","modal","returnValue","scrollable","lastTrigger","showModal","closeTrigger","handleOpenUpdated","NavGroup","NavItem","subnavSlot","badge","renderToggle","handleActiveChange","Navigation","footerObserver","allowItemsToRemainOpen","handleActivate","isAncestor","activeItem","observeFooter","childList","footerEl","isFooterVisible","visibility","opacity","contentVisibility","NotificationGroup","NotificationMixin","NotificationElement","notificationRef","dismissed","Notification","ProgressBar","CX","CY","instanceCounter","Progress","progress","_animatedProgress","_animationId","_targetProgress","_instanceId","changedProperties","_animate","animate","_clampedProgress","_isSemanticColor","_customColorStyle","hasLabel","pathData","percent","sweep","theta","PI","cos","sin","sectorPath","clipId","chCodes","bin","dec","pad","mod","fillArr","interleaveBytes","blocks","len","res","Uint8Array","includesAt","lst","pattern","alphabet","char","decode","letter","encode","digits","isSafeInteger","assertNumber","Bitmap","limit","Infinity","fromString","lines","fromCharCode","line","row","point","isInside","xy","yPos","xPos","rectRead","cur","hLine","vLine","border","embed","bm","rectSlice","inverse","factor","clone","assertDrawn","toASCII","out","first","second","toTerm","cc","whiteBG","darkBG","toSVG","optimize","prevPoint","relM","toGIF","u16le","dims","bytes","fullChunks","toImage","isRGB","ECMode","Encoding","BYTES","WORDS_PER_BLOCK","low","medium","quartile","high","ECC_BLOCKS","ver","sizeType","alignmentPatterns","last","distance","count","ceil","interval","ECCode","formatMask","formatBits","ecc","maskIdx","versionBits","numeric","alphanumerc","lengthBits","alphanumeric","byte","kanji","eci","modeBits","capacity","words","numBlocks","blockLen","shortBlocks","total","PATTERNS","_x","_y","GF","tables","exp","log","mul","pow","inv","polynomial","poly","monomial","degree","coefficient","coefficients","mulPoly","mulPolyScalar","scalar","mulPolyMonomial","addPoly","smaller","larger","sumDiff","lengthDiff","remainderPoly","divisor","elm","divisorPoly","evalPoly","euclidian","rLast","tLast","rLastLast","tLastLast","q","dltInverse","degreeDiff","sigmaTildeAtZero","interleave","rs","eccWords","pol","syndrome","evl","errorLocator","errorEvaluator","locations","pos","xiInverse","denominator","eccBlocks","subarray","resBlocks","resECC","isShort","encoded","dataLen","utf8","TextEncoder","utf8ToBytes","bits","idx","drawQR","finder","alignPos","getBit","bit","drawTemplate","need","tpl","xOffset","zigzag","mask","penalty","sameColor","same","adjacent","column","box","lastW","lastH","x1","y1","finderPattern","lightPattern","p1","p2","darkPixels","darkPercent","dark","encodeQR","output","opts","ec","validateECC","encoding","detectType","enc","validateEncoding","validateMask","version","err","validateVersion","bestMask","best","bestScore","score","drawQRBest","correctionMap","Q","Qrcode","background","correction","generate","backgroundColor","computed","qrArray","ctx","canvas","getContext","fillStyle","fillRect","cell","LightSlotController","syncLightDom","renderHook","createId","suffix","Radio","isLabel","htmlFor","inputSlot","inner","wrapper","handleCheckedChange","previousChecked","uncheckSiblings","radio","forceReflow","Range","step","SegmentedControlItem","segmentedControlItem","SegmentedControl","dropdownIcon","Select","setupOptionObserver","optionObserver","subtree","characterData","slottedOptions","buttonText","getButtonText","option","renderOption","Skeleton","Tab","handleSelectionChange","tabGroupCount","TabGroup","TabGroup_1","tabGroupId","selectedTab","initialSelectedTab","handleMutation","oldValue","updateSelectedTab","observerOptions","handleTabChange","updateSlots","setupObserver","setupTabs","setupPanels","tab","panels","selectedPanelId","panel","scrollTo","previousTab","tabs","selectedTabIndex","firstTab","lastTab","nextTab","updateTab","keyEvent","selectedPanel","inline","attributeOldValue","TabPanel","Table","density","scrollSnap","striped","renderStyles","renderTarget","DOCUMENT_NODE","head","fragment","createDocumentFragment","TagGroup","hasMultipleTags","Tag","handleRemove","renderSelectableTag","renderRemovableTag","renderStaticTag","Textarea","resize","characterCounter","maxLength","renderCharacterCounter","lengthMeasurer","counter","Segmenter","segmenter","segment","createLengthMeasurer","resizeToFitContent","textarea","ToastGroup","addToast","autoDismiss","toast","Toast","handleAutoDismissChange","Toggle","getTokens","attr","setTokens","tokens","referencesTooltip","tooltip","ELEMENT_NODE","getFocusable","focusable","hidden","visible","reposition","waiting","positioning","positioned","Tooltip","Tooltip_1","shortcutSlot","delay","currentElement","hideTooltip","handleShow","handleHide","hideOnEscape","addDescribedBy","proxy","insertAdjacentElement","token","attr.add","removeDescribedBy","attr.remove","handleStateChange","prevState","lastOpened","TopBar"],"mappings":"AAsDO,SAASA,EAAWC,EAAYC,EAAQC,EAAKC,GAChD,IAA2HC,EAAvHC,EAAIC,UAAUC,OAAQC,EAAIH,EAAI,EAAIJ,EAAkB,OAATE,EAAgBA,EAAOM,OAAOC,yBAAyBT,EAAQC,GAAOC,EACrH,GAAuB,iBAAZQ,SAAoD,mBAArBA,QAAQC,SAAyBJ,EAAIG,QAAQC,SAASZ,EAAYC,EAAQC,EAAKC,QACpH,IAAK,IAAIU,EAAIb,EAAWO,OAAS,EAAGM,GAAK,EAAGA,KAAST,EAAIJ,EAAWa,MAAIL,GAAKH,EAAI,EAAID,EAAEI,GAAKH,EAAI,EAAID,EAAEH,EAAQC,EAAKM,GAAKJ,EAAEH,EAAQC,KAASM,GAChJ,OAAOH,EAAI,GAAKG,GAAKC,OAAOK,eAAeb,EAAQC,EAAKM,GAAIA,CAChE,CA6QkD,mBAApBO,iBAAiCA;;;;;;ACnU/D,MAAMC,EAAEC,WAAWC,EAAEF,EAAEG,kBAAa,IAASH,EAAEI,UAAUJ,EAAEI,SAASC,eAAe,uBAAuBC,SAASC,WAAW,YAAYC,cAAcD,UAAUE,EAAEC,SAASC,EAAE,IAAIC,QAAQ,IAAAC,EAAA,MAAQ,WAAAC,CAAYd,EAAEE,EAAES,GAAG,GAAGI,KAAKC,cAAa,EAAGL,IAAIF,EAAE,MAAMQ,MAAM,qEAAqEF,KAAKG,QAAQlB,EAAEe,KAAKf,EAAEE,CAAC,CAAC,cAAIiB,GAAa,IAAInB,EAAEe,KAAKJ,EAAE,MAAMF,EAAEM,KAAKf,EAAE,GAAGE,QAAG,IAASF,EAAE,CAAC,MAAME,OAAE,IAASO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