@nordhealth/components 3.19.0 → 3.21.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 +4529 -4472
- package/lib/DatePicker.js +1 -1
- package/lib/Dropdown.js +1 -1
- package/lib/{DropdownItem-DpwKwVOT.js → DropdownItem-CPeMIqN8.js} +2 -2
- package/lib/DropdownItem-CPeMIqN8.js.map +1 -0
- package/lib/DropdownItem.js +1 -1
- package/lib/DropdownItem.js.map +1 -1
- package/lib/IconManager.js +1 -1
- package/lib/Message.js +1 -1
- package/lib/Modal.js +1 -1
- package/lib/Modal.js.map +1 -1
- package/lib/Popout-C5zTBGWo.js +2 -0
- package/lib/Popout-C5zTBGWo.js.map +1 -0
- package/lib/Popout.js +1 -1
- package/lib/Radio.js +1 -1
- package/lib/Radio.js.map +1 -1
- package/lib/Select.js +1 -1
- package/lib/Select.js.map +1 -1
- package/lib/Stack.js +1 -1
- package/lib/Stack.js.map +1 -1
- package/lib/Tooltip.js +1 -1
- package/lib/bundle.js +9 -9
- package/lib/bundle.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/positioning-D0xRzCXq.js +2 -0
- package/lib/{positioning-BIzQxDMX.js.map → positioning-D0xRzCXq.js.map} +1 -1
- package/lib/src/common/mixins/FloatingComponentMixin.d.ts +1 -1
- package/lib/src/dropdown-item/DropdownItem.d.ts +15 -0
- package/lib/src/modal/Modal.d.ts +3 -1
- package/lib/src/stack/Stack.d.ts +2 -2
- package/package.json +4 -4
- package/lib/DropdownItem-DpwKwVOT.js.map +0 -1
- package/lib/Popout-8ZXIGZFg.js +0 -2
- package/lib/Popout-8ZXIGZFg.js.map +0 -1
- package/lib/positioning-BIzQxDMX.js +0 -2
package/lib/src/stack/Stack.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ export default class Stack extends LitElement {
|
|
|
22
22
|
/**
|
|
23
23
|
* How to align the child items inside the stack.
|
|
24
24
|
*/
|
|
25
|
-
alignItems?: "center" | "start" | "end" | "stretch";
|
|
25
|
+
alignItems?: "center" | "start" | "end" | "baseline" | "stretch";
|
|
26
26
|
/**
|
|
27
27
|
* Defines whether the Stack items are forced in a single line
|
|
28
28
|
* or can be flowed into multiple lines.
|
|
@@ -31,7 +31,7 @@ export default class Stack extends LitElement {
|
|
|
31
31
|
/**
|
|
32
32
|
* How to justify the child items inside the stack.
|
|
33
33
|
*/
|
|
34
|
-
justifyContent?: "center" | "start" | "end" | "
|
|
34
|
+
justifyContent?: "center" | "start" | "end" | "space-between" | "space-around" | "space-evenly";
|
|
35
35
|
render(): import("lit").TemplateResult<1>;
|
|
36
36
|
}
|
|
37
37
|
declare global {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nordhealth/components",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.21.0",
|
|
4
4
|
"description": "This package includes Nord Design System Web Components",
|
|
5
5
|
"author": "Nordhealth <support@nordhealth.design>",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -34,14 +34,14 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@floating-ui/dom": "^1.6.11",
|
|
37
|
-
"@nordhealth/icons": "^3.
|
|
37
|
+
"@nordhealth/icons": "^3.7.0",
|
|
38
38
|
"lit": "^3.2.0",
|
|
39
39
|
"qr-creator": "^1.0.0",
|
|
40
40
|
"tinykeys": "^1.4.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@custom-elements-manifest/analyzer": "^0.10.3",
|
|
44
|
-
"@nordhealth/css": "^3.
|
|
44
|
+
"@nordhealth/css": "^3.4.0",
|
|
45
45
|
"@nordhealth/fonts": "^3.0.2",
|
|
46
46
|
"@nordhealth/themes": "^8.1.1",
|
|
47
47
|
"@nordhealth/tokens": "^7.1.2",
|
|
@@ -175,5 +175,5 @@
|
|
|
175
175
|
}
|
|
176
176
|
]
|
|
177
177
|
},
|
|
178
|
-
"gitHead": "
|
|
178
|
+
"gitHead": "f3962023cb75bc1a48e90d359b9f99fc0cdb4379"
|
|
179
179
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownItem-DpwKwVOT.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/lib/Popout-8ZXIGZFg.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{_ as t,i as e,k as o,t as i,h as s}from"./custom-element-CDWT-yC_.js";import{n}from"./property-DeTTNf1t.js";import{r}from"./state-BFYKuryf.js";import{e as a}from"./query-hiZs21fO.js";import{c as l,l as p,o as h,f as d,s as c,h as m,a as u}from"./positioning-BIzQxDMX.js";import{L as v}from"./LightDismissController-BBolVMtn.js";import{S as f}from"./ScrollbarController-C5CMxfb3.js";import{N as g,t as y}from"./events-Bv6wNHwJ.js";import{s as b}from"./Component-BuB0QgQM.js";import{D as w}from"./DirectionController-DiJ1Su1I.js";import{o as E}from"./observe-D0n0zOfU.js";import{E as x}from"./EventController-BG-WpaBb.js";function C(e){class o extends e{constructor(){super(...arguments),this.open=!1,this.align="start",this.position="block-end"}}return t([n({type:Boolean,reflect:!0})],o.prototype,"open",void 0),t([n({reflect:!0})],o.prototype,"align",void 0),t([n({reflect:!0})],o.prototype,"position",void 0),o}const k=e`:host{position:fixed;pointer-events:none;z-index:var(--n-index-popout);left:var(--_n-popout-position-x);top:var(--_n-popout-position-y);color:var(--n-color-text);opacity:0;transition:opacity var(--n-transition-slowly)}.n-popout{pointer-events:none;transform:translateY(-10px) scale(.97);visibility:hidden;transition:transform var(--n-transition-slowly),visibility var(--n-transition-slowly);transform-origin:top left;will-change:transform,opacity,visibility;background:var(--n-color-surface);box-shadow:var(--n-box-shadow-popout);border-radius:var(--n-border-radius-s)}:host([open]){opacity:1}:host([open]) .n-popout{transition-property:transform;visibility:visible;pointer-events:auto;transform:translateY(0) translateX(0) scale(1)}@media (max-width:35.9375em){:host{position:fixed;inset:0;overflow-y:auto;opacity:1;background:0 0;transition:background var(--n-transition-mobile)}:host([open]){pointer-events:auto;background:var(--n-color-overlay)}:host .n-popout{position:fixed;inset:0;inset-block-start:auto;transform:translateY(100%);transition:transform var(--n-transition-mobile),visibility var(--n-transition-mobile);transform-origin:bottom center;border-radius:0}}.top-end,.top-start{transform:translateY(10px) scale(.97)}.left-end,.left-start{transform:translateX(10px) scale(.97)}.right-end,.right-start{transform:translateX(-10px) scale(.97)}.bottom-start.is-rtl,.left-end,.top-end{transform-origin:bottom right}.bottom-end,.left-start,.top-start.is-rtl{transform-origin:top right}.bottom-end.is-rtl,.right-end,.right-start{transform-origin:bottom left}.right-start,.top-end.is-rtl{transform-origin:top left}`,A="undefined"==typeof matchMedia?{matches:!1,addEventListener(){}}:matchMedia("(max-width: 35.9375em)");let P=class extends(C(s)){constructor(){super(...arguments),this.scrollBar=new f(this),this.dismiss=new v(this,{isOpen:()=>this.open,onDismiss:t=>this.hide("click"!==t.type),isDismissible:t=>t!==this.popout&&t!==this.targetElement}),this.events=new x(this),this.direction=new w(this),this.smallViewport=A.matches,this.id="",this.enableScroll=()=>{this.open||this.scrollBar.unlockScroll()},this.updatePosition=async()=>{var t;if(!this.anchorElement)return;const{x:e,y:o,placement:i,middlewareData:s}=await l(this.anchorElement,this,{strategy:"fixed",placement:p(this.position,this.align,this.direction.dir),middleware:[h(8),d(),c({padding:8}),m()]});this.computedPosition=i,this.style.setProperty("--_n-popout-position-x",`${e}px`),this.style.setProperty("--_n-popout-position-y",`${o}px`),(null===(t=s.hide)||void 0===t?void 0:t.referenceHidden)&&this.hide()},this.toggleOpen=t=>{t.preventDefault(),this.open?this.hide(!1):this.smallViewport?this.show():this.updatePosition().then((()=>this.show()))},this.handleMediaQueryChange=()=>{var t;this.smallViewport=A.matches,null===(t=this.cleanupAutoUpdate)||void 0===t||t.call(this),!this.smallViewport&&this.open&&this.anchorElement?(this.cleanupAutoUpdate=u(this.anchorElement,this,this.updatePosition),this.scrollBar.unlockScroll()):this.open&&this.scrollBar.lockScroll()}}async show(){return this.open?Promise.resolve():(this.open=!0,await this.updateComplete,this.dispatchEvent(new g("open")),y(this.popout))}async hide(t=!0){var e,o;return this.open?(this.open=!1,null===(e=this.cleanupAutoUpdate)||void 0===e||e.call(this),this.dispatchEvent(new g("close")),t&&(null===(o=this.targetElement)||void 0===o||o.focus({preventScroll:!0})),y(this.popout)):Promise.resolve()}firstUpdated(){this.smallViewport||this.updatePosition()}connectedCallback(){super.connectedCallback(),this.events.listen(A,"change",this.handleMediaQueryChange)}disconnectedCallback(){var t,e;super.disconnectedCallback(),null===(t=this.cleanupAutoUpdate)||void 0===t||t.call(this),null===(e=this.targetElement)||void 0===e||e.removeAttribute("aria-expanded")}render(){return o`<div class="n-popout ${this.computedPosition} is-${this.direction.dir}" aria-hidden="${this.open?"false":"true"}" @transitionend="${this.enableScroll}"><slot></slot></div>`}handleIdChange(){var t;null===(t=this.targetElement)||void 0===t||t.removeEventListener("click",this.toggleOpen),this.id?(this.targetElement=this.getToggle(),this.anchorElement=this.getAnchor(),this.events.listen(this.targetElement,"click",this.toggleOpen)):console.warn("NORD: popout requires an id attribute and value")}handleOpenChange(){var t,e;null===(t=this.targetElement)||void 0===t||t.setAttribute("aria-expanded",`${this.open}`),this.open?this.smallViewport?this.scrollBar.lockScroll():this.anchorElement&&(this.cleanupAutoUpdate=u(this.anchorElement,this,this.updatePosition)):null===(e=this.cleanupAutoUpdate)||void 0===e||e.call(this)}handleAnchorChange(){var t;null===(t=this.cleanupAutoUpdate)||void 0===t||t.call(this),this.anchorElement=this.getAnchor(),this.open&&!this.smallViewport&&this.anchorElement&&(this.cleanupAutoUpdate=u(this.anchorElement,this,this.updatePosition))}getToggle(){const t=this.getRootNode().querySelector(`[aria-controls='${this.id}']`);return t instanceof HTMLSlotElement?t.assignedElements()[0]:t}getAnchor(){if(!this.anchor)return this.targetElement;const t=this.getRootNode().querySelector(`#${this.anchor}`);return t instanceof HTMLSlotElement?t.assignedElements()[0]:t}};P.styles=[b,k],t([a(".n-popout",!0)],P.prototype,"popout",void 0),t([r()],P.prototype,"computedPosition",void 0),t([r()],P.prototype,"smallViewport",void 0),t([n({reflect:!0})],P.prototype,"id",void 0),t([n({reflect:!0})],P.prototype,"anchor",void 0),t([E("id")],P.prototype,"handleIdChange",null),t([E("open")],P.prototype,"handleOpenChange",null),t([E("anchor")],P.prototype,"handleAnchorChange",null),P=t([i("nord-popout")],P);var S=P;export{C as F,S as P};
|
|
2
|
-
//# sourceMappingURL=Popout-8ZXIGZFg.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Popout-8ZXIGZFg.js","sources":["../src/common/mixins/FloatingComponentMixin.ts","../src/popout/Popout.ts"],"sourcesContent":["/* eslint-disable max-classes-per-file */\nimport { LitElement } from \"lit\"\nimport { property } from \"lit/decorators.js\"\nimport { Alignment } from \"@floating-ui/dom\"\nimport { LogicalSide } from \"../positioning.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\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 */\n @property({ reflect: true }) position: \"block-end\" | \"block-start\" | \"inline-start\" | \"inline-end\" = \"block-end\"\n }\n\n return FloatingElement\n}\n","import { LitElement, html } from \"lit\"\nimport { customElement, property, query, state } from \"lit/decorators.js\"\nimport { computePosition, shift, offset, flip, hide, autoUpdate, Placement } from \"@floating-ui/dom\"\nimport { LightDismissController } from \"../common/controllers/LightDismissController.js\"\nimport { ScrollbarController } from \"../common/controllers/ScrollbarController.js\"\nimport { NordEvent, transition } from \"../common/events.js\"\nimport { FloatingMixin } from \"../common/mixins/FloatingComponentMixin.js\"\n\nimport componentStyle from \"../common/styles/Component.css\"\nimport style from \"./Popout.css\"\nimport { logicalToPhysical } from \"../common/positioning.js\"\nimport { DirectionController } from \"../common/controllers/DirectionController.js\"\nimport { observe } from \"../common/decorators/observe.js\"\nimport { EventController } from \"../common/controllers/EventController.js\"\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 // eslint-disable-next-line lit/no-native-attributes\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 * 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.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 return transition(this.popout)\n }\n\n /**\n * Position the popout on load.\n */\n firstUpdated() {\n if (!this.smallViewport) {\n this.updatePosition()\n }\n }\n\n connectedCallback() {\n super.connectedCallback()\n this.events.listen(mediaQuery, \"change\", this.handleMediaQueryChange)\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 // eslint-disable-next-line no-console\n console.warn(\"NORD: popout requires an id attribute and value\")\n } else {\n this.targetElement = this.getToggle()\n this.anchorElement = this.getAnchor()\n\n this.events.listen(this.targetElement, \"click\", this.toggleOpen)\n }\n }\n\n @observe(\"open\")\n protected handleOpenChange() {\n this.targetElement?.setAttribute(\"aria-expanded\", `${this.open}`)\n\n if (this.open) {\n if (this.smallViewport) {\n // hide scrollbar and prevent scroll on body\n this.scrollBar.lockScroll()\n } else if (this.anchorElement) {\n this.cleanupAutoUpdate = autoUpdate(this.anchorElement, this, this.updatePosition)\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.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 }\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 { x, y, placement, middlewareData } = await computePosition(this.anchorElement, this, {\n strategy: \"fixed\",\n placement: logicalToPhysical(this.position, this.align, this.direction.dir),\n middleware: [\n offset(8),\n flip(),\n shift({\n padding: 8,\n }),\n hide(),\n ],\n })\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 } else if (!this.smallViewport) {\n this.updatePosition().then(() => this.show())\n } else {\n this.show()\n }\n }\n\n private getToggle() {\n const rootNode = this.getRootNode() as Document | ShadowRoot\n const toggle = <HTMLElement>rootNode.querySelector(`[aria-controls='${this.id}']`)\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.open && this.anchorElement) {\n this.cleanupAutoUpdate = autoUpdate(this.anchorElement, this, this.updatePosition)\n this.scrollBar.unlockScroll()\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"],"names":["FloatingMixin","superClass","FloatingElement","constructor","this","open","align","position","__decorate","property","type","Boolean","reflect","prototype","mediaQuery","matchMedia","matches","addEventListener","Popout","LitElement","scrollBar","ScrollbarController","dismiss","LightDismissController","isOpen","onDismiss","e","hide","isDismissible","node","popout","targetElement","events","EventController","direction","DirectionController","smallViewport","id","enableScroll","unlockScroll","updatePosition","async","anchorElement","x","y","placement","middlewareData","computePosition","strategy","logicalToPhysical","dir","middleware","offset","flip","shift","padding","computedPosition","style","setProperty","_a","referenceHidden","toggleOpen","preventDefault","show","then","handleMediaQueryChange","cleanupAutoUpdate","call","autoUpdate","lockScroll","Promise","resolve","updateComplete","dispatchEvent","NordEvent","transition","moveFocusToButton","_b","focus","preventScroll","firstUpdated","connectedCallback","super","listen","disconnectedCallback","removeAttribute","render","html","handleIdChange","removeEventListener","getToggle","getAnchor","console","warn","handleOpenChange","setAttribute","handleAnchorChange","toggle","getRootNode","querySelector","HTMLSlotElement","assignedElements","anchor","styles","componentStyle","query","state","observe","customElement"],"mappings":"mnBAcM,SAAUA,EACdC,GAEA,MAAMC,UAAwBD,EAA9B,WAAAE,uBAI8CC,KAAIC,MAAG,EAStBD,KAAKE,MAAoB,QAQzBF,KAAQG,SAAgE,WACtG,EAED,OApB8CC,EAAA,CAA3CC,EAAS,CAAEC,KAAMC,QAASC,SAAS,KAAoBV,EAAAW,UAAA,YAAA,GAS3BL,EAAA,CAA5BC,EAAS,CAAEG,SAAS,KAAwCV,EAAAW,UAAA,aAAA,GAQhCL,EAAA,CAA5BC,EAAS,CAAEG,SAAS,KAA2FV,EAAAW,UAAA,gBAAA,GAG3GX,CACT,gmDCxBMY,EACkB,oBAAfC,WACF,CACCC,SAAS,EACT,gBAAAC,GAEC,GAEHF,WAAW,0BAUF,IAAMG,EAAN,cAAqBlB,EAAcmB,IAAnC,WAAAhB,uBASLC,KAAAgB,UAAY,IAAIC,EAAoBjB,MAKpCA,KAAAkB,QAAU,IAAIC,EAAuBnB,KAAM,CACjDoB,OAAQ,IAAMpB,KAAKC,KACnBoB,UAAWC,GAAKtB,KAAKuB,KAAgB,UAAXD,EAAEhB,MAC5BkB,cAAeC,GAAQA,IAASzB,KAAK0B,QAAUD,IAASzB,KAAK2B,gBAGvD3B,KAAA4B,OAAS,IAAIC,EAAgB7B,MAC7BA,KAAA8B,UAAY,IAAIC,EAAoB/B,MAI3BA,KAAAgC,cAAgBtB,EAAWE,QAMfZ,KAAEiC,GAAW,GAqIlCjC,KAAYkC,aAAG,KAGhBlC,KAAKC,MACRD,KAAKgB,UAAUmB,cAChB,EAOKnC,KAAcoC,eAAGC,gBACvB,IAAKrC,KAAKsC,cACR,OAGF,MAAMC,EAAEA,EAACC,EAA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={left:"right",right:"left",bottom:"top",top:"bottom"},c={start:"end",end:"start"};function s(t,o,i){return n(t,e(o,i))}function a(t,e){return"function"==typeof t?t(e):t}function f(t){return t.split("-")[0]}function u(t){return t.split("-")[1]}function d(t){return"x"===t?"y":"x"}function h(t){return"y"===t?"height":"width"}function p(t){return["top","bottom"].includes(f(t))?"y":"x"}function m(t){return d(p(t))}function g(t){return t.replace(/start|end/g,(t=>c[t]))}function y(t){return t.replace(/left|right|bottom|top/g,(t=>l[t]))}function w(t){const{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function x(t,e,n){let{reference:o,floating:i}=t;const r=p(e),l=m(e),c=h(l),s=f(e),a="y"===r,d=o.x+o.width/2-i.width/2,g=o.y+o.height/2-i.height/2,y=o[c]/2-i[c]/2;let w;switch(s){case"top":w={x:d,y:o.y-i.height};break;case"bottom":w={x:d,y:o.y+o.height};break;case"right":w={x:o.x+o.width,y:g};break;case"left":w={x:o.x-i.width,y:g};break;default:w={x:o.x,y:o.y}}switch(u(e)){case"start":w[l]-=y*(n&&a?-1:1);break;case"end":w[l]+=y*(n&&a?-1:1)}return w}async function b(t,e){var n;void 0===e&&(e={});const{x:o,y:i,platform:r,rects:l,elements:c,strategy:s}=t,{boundary:f="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:p=0}=a(e,t),m=function(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}(p),g=c[h?"floating"===d?"reference":"floating":d],y=w(await r.getClippingRect({element:null==(n=await(null==r.isElement?void 0:r.isElement(g)))||n?g:g.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(c.floating)),boundary:f,rootBoundary:u,strategy:s})),x="floating"===d?{x:o,y:i,width:l.floating.width,height:l.floating.height}:l.reference,b=await(null==r.getOffsetParent?void 0:r.getOffsetParent(c.floating)),v=await(null==r.isElement?void 0:r.isElement(b))&&await(null==r.getScale?void 0:r.getScale(b))||{x:1,y:1},R=w(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:x,offsetParent:b,strategy:s}):x);return{top:(y.top-R.top+m.top)/v.y,bottom:(R.bottom-y.bottom+m.bottom)/v.y,left:(y.left-R.left+m.left)/v.x,right:(R.right-y.right+m.right)/v.x}}function v(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function R(e){return t.some((t=>e[t]>=0))}function T(){return"undefined"!=typeof window}function L(t){return k(t)?(t.nodeName||"").toLowerCase():"#document"}function A(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function E(t){var e;return null==(e=(k(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function k(t){return!!T()&&(t instanceof Node||t instanceof A(t).Node)}function D(t){return!!T()&&(t instanceof Element||t instanceof A(t).Element)}function O(t){return!!T()&&(t instanceof HTMLElement||t instanceof A(t).HTMLElement)}function S(t){return!(!T()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof A(t).ShadowRoot)}function C(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=V(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(i)}function F(t){return["table","td","th"].includes(L(t))}function P(t){return[":popover-open",":modal"].some((e=>{try{return t.matches(e)}catch(t){return!1}}))}function H(t){const e=B(),n=D(t)?V(t):t;return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!e&&!!n.backdropFilter&&"none"!==n.backdropFilter||!e&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((t=>(n.willChange||"").includes(t)))||["paint","layout","strict","content"].some((t=>(n.contain||"").includes(t)))}function B(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function W(t){return["html","body","#document"].includes(L(t))}function V(t){return A(t).getComputedStyle(t)}function M(t){return D(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function z(t){if("html"===L(t))return t;const e=t.assignedSlot||t.parentNode||S(t)&&t.host||E(t);return S(e)?e.host:e}function N(t){const e=z(t);return W(e)?t.ownerDocument?t.ownerDocument.body:t.body:O(e)&&C(e)?e:N(e)}function $(t,e,n){var o;void 0===e&&(e=[]),void 0===n&&(n=!0);const i=N(t),r=i===(null==(o=t.ownerDocument)?void 0:o.body),l=A(i);if(r){const t=I(l);return e.concat(l,l.visualViewport||[],C(i)?i:[],t&&n?$(t):[])}return e.concat(i,$(i,[],n))}function I(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function j(t){const e=V(t);let n=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const r=O(t),l=r?t.offsetWidth:n,c=r?t.offsetHeight:i,s=o(n)!==l||o(i)!==c;return s&&(n=l,i=c),{width:n,height:i,$:s}}function q(t){return D(t)?t:t.contextElement}function X(t){const e=q(t);if(!O(e))return r(1);const n=e.getBoundingClientRect(),{width:i,height:l,$:c}=j(e);let s=(c?o(n.width):n.width)/i,a=(c?o(n.height):n.height)/l;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const Y=r(0);function _(t){const e=A(t);return B()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:Y}function G(t,e,n,o){void 0===e&&(e=!1),void 0===n&&(n=!1);const i=t.getBoundingClientRect(),l=q(t);let c=r(1);e&&(o?D(o)&&(c=X(o)):c=X(t));const s=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==A(t))&&e}(l,n,o)?_(l):r(0);let a=(i.left+s.x)/c.x,f=(i.top+s.y)/c.y,u=i.width/c.x,d=i.height/c.y;if(l){const t=A(l),e=o&&D(o)?A(o):o;let n=t,i=I(n);for(;i&&o&&e!==n;){const t=X(i),e=i.getBoundingClientRect(),o=V(i),r=e.left+(i.clientLeft+parseFloat(o.paddingLeft))*t.x,l=e.top+(i.clientTop+parseFloat(o.paddingTop))*t.y;a*=t.x,f*=t.y,u*=t.x,d*=t.y,a+=r,f+=l,n=A(i),i=I(n)}}return w({width:u,height:d,x:a,y:f})}function J(t,e){const n=M(t).scrollLeft;return e?e.left+n:G(E(t)).left+n}function K(t,e,o){let i;if("viewport"===e)i=function(t,e){const n=A(t),o=E(t),i=n.visualViewport;let r=o.clientWidth,l=o.clientHeight,c=0,s=0;if(i){r=i.width,l=i.height;const t=B();(!t||t&&"fixed"===e)&&(c=i.offsetLeft,s=i.offsetTop)}return{width:r,height:l,x:c,y:s}}(t,o);else if("document"===e)i=function(t){const e=E(t),o=M(t),i=t.ownerDocument.body,r=n(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),l=n(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let c=-o.scrollLeft+J(t);const s=-o.scrollTop;return"rtl"===V(i).direction&&(c+=n(e.clientWidth,i.clientWidth)-r),{width:r,height:l,x:c,y:s}}(E(t));else if(D(e))i=function(t,e){const n=G(t,!0,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft,l=O(t)?X(t):r(1);return{width:t.clientWidth*l.x,height:t.clientHeight*l.y,x:i*l.x,y:o*l.y}}(e,o);else{const n=_(t);i={...e,x:e.x-n.x,y:e.y-n.y}}return w(i)}function Q(t,e){const n=z(t);return!(n===e||!D(n)||W(n))&&("fixed"===V(n).position||Q(n,e))}function U(t,e,n){const o=O(e),i=E(e),l="fixed"===n,c=G(t,!0,l,e);let s={scrollLeft:0,scrollTop:0};const a=r(0);if(o||!o&&!l)if(("body"!==L(e)||C(i))&&(s=M(e)),o){const t=G(e,!0,l,e);a.x=t.x+e.clientLeft,a.y=t.y+e.clientTop}else i&&(a.x=J(i));let f=0,u=0;if(i&&!o&&!l){const t=i.getBoundingClientRect();u=t.top+s.scrollTop,f=t.left+s.scrollLeft-J(i,t)}return{x:c.left+s.scrollLeft-a.x-f,y:c.top+s.scrollTop-a.y-u,width:c.width,height:c.height}}function Z(t){return"static"===V(t).position}function tt(t,e){if(!O(t)||"fixed"===V(t).position)return null;if(e)return e(t);let n=t.offsetParent;return E(t)===n&&(n=n.ownerDocument.body),n}function et(t,e){const n=A(t);if(P(t))return n;if(!O(t)){let e=z(t);for(;e&&!W(e);){if(D(e)&&!Z(e))return e;e=z(e)}return n}let o=tt(t,e);for(;o&&F(o)&&Z(o);)o=tt(o,e);return o&&W(o)&&Z(o)&&!H(o)?n:o||function(t){let e=z(t);for(;O(e)&&!W(e);){if(H(e))return e;if(P(e))return null;e=z(e)}return null}(t)||n}const nt={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const l="fixed"===i,c=E(o),s=!!e&&P(e.floating);if(o===c||s&&l)return n;let a={scrollLeft:0,scrollTop:0},f=r(1);const u=r(0),d=O(o);if((d||!d&&!l)&&(("body"!==L(o)||C(c))&&(a=M(o)),O(o))){const t=G(o);f=X(o),u.x=t.x+o.clientLeft,u.y=t.y+o.clientTop}return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-a.scrollLeft*f.x+u.x,y:n.y*f.y-a.scrollTop*f.y+u.y}},getDocumentElement:E,getClippingRect:function(t){let{element:o,boundary:i,rootBoundary:r,strategy:l}=t;const c=[..."clippingAncestors"===i?P(o)?[]:function(t,e){const n=e.get(t);if(n)return n;let o=$(t,[],!1).filter((t=>D(t)&&"body"!==L(t))),i=null;const r="fixed"===V(t).position;let l=r?z(t):t;for(;D(l)&&!W(l);){const e=V(l),n=H(l);n||"fixed"!==e.position||(i=null),(r?!n&&!i:!n&&"static"===e.position&&i&&["absolute","fixed"].includes(i.position)||C(l)&&!n&&Q(t,l))?o=o.filter((t=>t!==l)):i=e,l=z(l)}return e.set(t,o),o}(o,this._c):[].concat(i),r],s=c[0],a=c.reduce(((t,i)=>{const r=K(o,i,l);return t.top=n(r.top,t.top),t.right=e(r.right,t.right),t.bottom=e(r.bottom,t.bottom),t.left=n(r.left,t.left),t}),K(o,s,l));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:et,getElementRects:async function(t){const e=this.getOffsetParent||et,n=this.getDimensions,o=await n(t.floating);return{reference:U(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:n}=j(t);return{width:e,height:n}},getScale:X,isElement:D,isRTL:function(t){return"rtl"===V(t).direction}};function ot(t,o,r,l){void 0===l&&(l={});const{ancestorScroll:c=!0,ancestorResize:s=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:f="function"==typeof IntersectionObserver,animationFrame:u=!1}=l,d=q(t),h=c||s?[...d?$(d):[],...$(o)]:[];h.forEach((t=>{c&&t.addEventListener("scroll",r,{passive:!0}),s&&t.addEventListener("resize",r)}));const p=d&&f?function(t,o){let r,l=null;const c=E(t);function s(){var t;clearTimeout(r),null==(t=l)||t.disconnect(),l=null}return function a(f,u){void 0===f&&(f=!1),void 0===u&&(u=1),s();const{left:d,top:h,width:p,height:m}=t.getBoundingClientRect();if(f||o(),!p||!m)return;const g={rootMargin:-i(h)+"px "+-i(c.clientWidth-(d+p))+"px "+-i(c.clientHeight-(h+m))+"px "+-i(d)+"px",threshold:n(0,e(1,u))||1};let y=!0;function w(t){const e=t[0].intersectionRatio;if(e!==u){if(!y)return a();e?a(!1,e):r=setTimeout((()=>{a(!1,1e-7)}),1e3)}y=!1}try{l=new IntersectionObserver(w,{...g,root:c.ownerDocument})}catch(t){l=new IntersectionObserver(w,g)}l.observe(t)}(!0),s}(d,r):null;let m,g=-1,y=null;a&&(y=new ResizeObserver((t=>{let[e]=t;e&&e.target===d&&y&&(y.unobserve(o),cancelAnimationFrame(g),g=requestAnimationFrame((()=>{var t;null==(t=y)||t.observe(o)}))),r()})),d&&!u&&y.observe(d),y.observe(o));let w=u?G(t):null;return u&&function e(){const n=G(t);!w||n.x===w.x&&n.y===w.y&&n.width===w.width&&n.height===w.height||r();w=n,m=requestAnimationFrame(e)}(),r(),()=>{var t;h.forEach((t=>{c&&t.removeEventListener("scroll",r),s&&t.removeEventListener("resize",r)})),null==p||p(),null==(t=y)||t.disconnect(),y=null,u&&cancelAnimationFrame(m)}}const it=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:r,placement:l,middlewareData:c}=e,s=await async function(t,e){const{placement:n,platform:o,elements:i}=t,r=await(null==o.isRTL?void 0:o.isRTL(i.floating)),l=f(n),c=u(n),s="y"===p(n),d=["left","top"].includes(l)?-1:1,h=r&&s?-1:1,m=a(e,t);let{mainAxis:g,crossAxis:y,alignmentAxis:w}="number"==typeof m?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return c&&"number"==typeof w&&(y="end"===c?-1*w:w),s?{x:y*h,y:g*d}:{x:g*d,y:y*h}}(e,t);return l===(null==(n=c.offset)?void 0:n.placement)&&null!=(o=c.arrow)&&o.alignmentOffset?{}:{x:i+s.x,y:r+s.y,data:{...s,placement:l}}}}},rt=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i}=e,{mainAxis:r=!0,crossAxis:l=!1,limiter:c={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...u}=a(t,e),h={x:n,y:o},m=await b(e,u),g=p(f(i)),y=d(g);let w=h[y],x=h[g];if(r){const t="y"===y?"bottom":"right";w=s(w+m["y"===y?"top":"left"],w,w-m[t])}if(l){const t="y"===g?"bottom":"right";x=s(x+m["y"===g?"top":"left"],x,x-m[t])}const v=c.fn({...e,[y]:w,[g]:x});return{...v,data:{x:v.x-n,y:v.y-o,enabled:{[y]:r,[g]:l}}}}}},lt=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:r,rects:l,initialPlacement:c,platform:s,elements:d}=e,{mainAxis:w=!0,crossAxis:x=!0,fallbackPlacements:v,fallbackStrategy:R="bestFit",fallbackAxisSideDirection:T="none",flipAlignment:L=!0,...A}=a(t,e);if(null!=(n=r.arrow)&&n.alignmentOffset)return{};const E=f(i),k=p(c),D=f(c)===c,O=await(null==s.isRTL?void 0:s.isRTL(d.floating)),S=v||(D||!L?[y(c)]:function(t){const e=y(t);return[g(t),e,g(e)]}(c)),C="none"!==T;!v&&C&&S.push(...function(t,e,n,o){const i=u(t);let r=function(t,e,n){const o=["left","right"],i=["right","left"],r=["top","bottom"],l=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:o:e?o:i;case"left":case"right":return e?r:l;default:return[]}}(f(t),"start"===n,o);return i&&(r=r.map((t=>t+"-"+i)),e&&(r=r.concat(r.map(g)))),r}(c,L,T,O));const F=[c,...S],P=await b(e,A),H=[];let B=(null==(o=r.flip)?void 0:o.overflows)||[];if(w&&H.push(P[E]),x){const t=function(t,e,n){void 0===n&&(n=!1);const o=u(t),i=m(t),r=h(i);let l="x"===i?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return e.reference[r]>e.floating[r]&&(l=y(l)),[l,y(l)]}(i,l,O);H.push(P[t[0]],P[t[1]])}if(B=[...B,{placement:i,overflows:H}],!H.every((t=>t<=0))){var W,V;const t=((null==(W=r.flip)?void 0:W.index)||0)+1,e=F[t];if(e)return{data:{index:t,overflows:B},reset:{placement:e}};let n=null==(V=B.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:V.placement;if(!n)switch(R){case"bestFit":{var M;const t=null==(M=B.filter((t=>{if(C){const e=p(t.placement);return e===k||"y"===e}return!0})).map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:M[0];t&&(n=t);break}case"initialPlacement":n=c}if(i!==n)return{reset:{placement:n}}}return{}}}},ct=function(t){return void 0===t&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:o="referenceHidden",...i}=a(t,e);switch(o){case"referenceHidden":{const t=v(await b(e,{...i,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:t,referenceHidden:R(t)}}}case"escaped":{const t=v(await b(e,{...i,altBoundary:!0}),n.floating);return{data:{escapedOffsets:t,escaped:R(t)}}}default:return{}}}}},st=(t,e,n)=>{const o=new Map,i={platform:nt,...n},r={...i.platform,_c:o};return(async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:l}=n,c=r.filter(Boolean),s=await(null==l.isRTL?void 0:l.isRTL(e));let a=await l.getElementRects({reference:t,floating:e,strategy:i}),{x:f,y:u}=x(a,o,s),d=o,h={},p=0;for(let n=0;n<c.length;n++){const{name:r,fn:m}=c[n],{x:g,y,data:w,reset:b}=await m({x:f,y:u,initialPlacement:o,placement:d,strategy:i,middlewareData:h,rects:a,platform:l,elements:{reference:t,floating:e}});f=null!=g?g:f,u=null!=y?y:u,h={...h,[r]:{...h[r],...w}},b&&p<=50&&(p++,"object"==typeof b&&(b.placement&&(d=b.placement),b.rects&&(a=!0===b.rects?await l.getElementRects({reference:t,floating:e,strategy:i}):b.rects),({x:f,y:u}=x(a,d,s))),n=-1)}return{x:f,y:u,placement:d,strategy:i,middlewareData:h}})(t,e,{...i,platform:r})},at={"inline-start-start":"left-start","inline-start-end":"left-end","inline-end-start":"right-start","inline-end-end":"right-end","block-start-start":"top-start","block-start-end":"top-end","block-end-start":"bottom-start","block-end-end":"bottom-end"},ft={"inline-start-start":"right-start","inline-start-end":"right-end","inline-end-start":"left-start","inline-end-end":"left-end","block-start-start":"top-start","block-start-end":"top-end","block-end-start":"bottom-start","block-end-end":"bottom-end"},ut={"block-end":"bottom","block-start":"top","inline-start":"left","inline-end":"right"};function dt(t,e,n){if(null!=e&&null!=n){const o=`${t}-${e}`;return"ltr"===n?at[o]:ft[o]}return ut[t]}export{ot as a,st as c,lt as f,ct as h,dt as l,it as o,rt as s};
|
|
2
|
-
//# sourceMappingURL=positioning-BIzQxDMX.js.map
|