@preline/tooltip 4.1.3 → 5.0.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/README.md ADDED
@@ -0,0 +1,315 @@
1
+ # Tooltip & Popover
2
+
3
+ A tooltip is a floating, non-actionable label used to explain a user interface element or feature.
4
+
5
+ [![npm](https://img.shields.io/badge/npm-v4.2.0-blue)](https://www.npmjs.com/package/@preline/tooltip) [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) [![Demo](https://img.shields.io/badge/demo-online-brightgreen)](https://preline.co/plugins/tooltip.html)
6
+
7
+ ## Contents
8
+
9
+ - [Overview](#overview)
10
+ - [Installation](#installation)
11
+ - [Basic usage](#basic-usage)
12
+ - [Configuration Options](#configuration-options)
13
+ - [JavaScript API](#javascript-api)
14
+ - [Events](#events)
15
+ - [Common Patterns](#common-patterns)
16
+ - [License](#license)
17
+
18
+ ## Overview
19
+
20
+ The Tooltip component provides contextual information when users hover over or focus on an element. It supports multiple placement options, customizable triggers, and integrates with Floating UI for advanced positioning.
21
+
22
+ **Key Features:**
23
+ - Multiple placement options (top, bottom, left, right, auto)
24
+ - Customizable trigger events (hover, focus)
25
+ - Floating UI integration for smart positioning
26
+ - Programmatic control via JavaScript API
27
+ - Event system for lifecycle hooks
28
+ - Accessibility support (ARIA attributes)
29
+
30
+ ## Installation
31
+
32
+ To get started, install Tooltip & Popover plugin via npm, else you can skip this step if you are already using Preline UI as a package.
33
+
34
+ ```bash
35
+ npm i @preline/tooltip
36
+ ```
37
+
38
+ ### CSS
39
+
40
+ Use [`@source`](https://tailwindcss.com/docs/functions-and-directives#source-directive) to register the plugin's JavaScript path for Tailwind CSS scanning, then [`@import`](https://tailwindcss.com/docs/functions-and-directives#import-directive) the plugin's CSS files into your Tailwind CSS file.
41
+
42
+ ```css
43
+ @import "tailwindcss";
44
+
45
+ /* @preline/tooltip */
46
+ @source "../node_modules/@preline/tooltip/*.js";
47
+ @import "./node_modules/@preline/tooltip/variants.css";
48
+ @import "./node_modules/@preline/tooltip/theme.css";
49
+ ```
50
+
51
+ ### JavaScript
52
+
53
+ Include the JavaScript that powers the interactive elements near the end of your `</body>` tag:
54
+
55
+ ```html
56
+ <script src="./node_modules/@preline/tooltip/index.js"></script>
57
+ ```
58
+
59
+ ### Manual Initialization
60
+
61
+ Use the `non-auto` entry if you need manual initialization. In this mode, automatic initialization on page load is not included, so the component should be initialized explicitly.
62
+
63
+ ```html
64
+ <script type="module">
65
+ import HSTooltip from "@preline/tooltip/non-auto.mjs";
66
+
67
+ new HSTooltip(document.querySelector("#tooltip"));
68
+ </script>
69
+ ```
70
+
71
+ ### Via Bundler
72
+
73
+ When using a bundler (Vite, webpack, etc.), import the plugin directly as an ES module.
74
+
75
+ `@preline/tooltip` is the auto-init entry: it scans the DOM and initializes matching elements automatically.
76
+
77
+ ```js
78
+ import "@preline/tooltip";
79
+ ```
80
+
81
+ `@preline/tooltip/non-auto` is the manual entry: use it when you want explicit control over when initialization happens, either via `autoInit()` or by creating a specific instance yourself.
82
+
83
+ ```js
84
+ import HSTooltip from "@preline/tooltip/non-auto";
85
+
86
+ HSTooltip.autoInit();
87
+
88
+ // Or initialize a specific element manually
89
+ const el = document.querySelector("#tooltip");
90
+ if (el) new HSTooltip(el);
91
+ ```
92
+
93
+ ### TypeScript
94
+
95
+ This package ships with TypeScript type definitions. No additional `@types/` package is needed.
96
+
97
+ ## Basic usage
98
+
99
+ The following example demonstrates the minimal HTML structure required for a tooltip component. This is a base template without custom styling - you can apply your own CSS classes and styles as needed. The tooltip appears when hovering over the button.
100
+
101
+ ```html
102
+ <div class="hs-tooltip [--placement:auto] inline-block">
103
+ <button type="button" class="hs-tooltip-toggle">
104
+ Hover me
105
+ <span class="hs-tooltip-content hs-tooltip-shown:opacity-100 hs-tooltip-shown:visible opacity-0 transition-opacity inline-block absolute invisible z-10 py-1 px-2 bg-gray-900 text-white" role="tooltip">
106
+ Tooltip on top
107
+ </span>
108
+ </button>
109
+ </div>
110
+ ```
111
+
112
+ **Structure Requirements:**
113
+ - `hs-tooltip`: Required container wrapper
114
+ - `hs-tooltip-toggle`: Required element that triggers the tooltip (button, link, etc.)
115
+ - `hs-tooltip-content`: Required element containing the tooltip content
116
+ - Proper ARIA attributes (`role="tooltip"`)
117
+
118
+ ## Configuration Options
119
+
120
+ ### CSS Classes (Modifiers)
121
+
122
+ CSS class modifiers use Tailwind-style syntax with `--` prefix to control tooltip behavior.
123
+
124
+ | Class Modifier | Target Element | Values | Default | Description |
125
+ | --- | --- | --- | --- | --- |
126
+ | `[--trigger:*]` | `hs-tooltip` (container) | `"focus"` \| `"hover"` | `"hover"` | Event to trigger a tooltip. `hover` shows on mouse enter, `focus` shows on focus. |
127
+ | `[--placement:*]` | `hs-tooltip` (container) | `"auto"` \| `"top"` \| `"top-left"` \| `"top-right"` \| `"bottom"` \| `"bottom-left"` \| `"bottom-right"` \| `"right"` \| `"right-top"` \| `"right-bottom"` \| `"left"` \| `"left-top"` \| `"left-bottom"` | `"auto"` (top → bottom, left → right) | Tooltip placement relative to the trigger element. If `"auto"`, the tooltip will be positioned based on available space. |
128
+ | `[--strategy:*]` | `hs-tooltip` (container) | `"fixed"` \| `"absolute"` | `"absolute"` | Sets the position strategy. `fixed` positions relative to viewport, `absolute` positions relative to the nearest positioned ancestor. |
129
+ | `[--prevent-popper:*]` | `hs-tooltip` (container) | `"true"` \| `"false"` | `"false"` | Prevents Floating UI positioning calculation issues. Set to `"true"` if experiencing positioning problems. |
130
+
131
+ **Example:**
132
+ ```html
133
+ <div class="hs-tooltip --trigger:focus --placement:bottom">
134
+ <button class="hs-tooltip-toggle">Focus me</button>
135
+ <span class="hs-tooltip-content">Tooltip content</span>
136
+ </div>
137
+ ```
138
+
139
+ ### Required CSS Classes
140
+
141
+ These classes define the structure and must be present for the tooltip to function.
142
+
143
+ | Class | Required On | Purpose |
144
+ | --- | --- | --- |
145
+ | `hs-tooltip` | Container wrapper | Groups the toggle and content elements together |
146
+ | `hs-tooltip-toggle` | Trigger element | The element that activates the tooltip (button, link, etc.) |
147
+ | `hs-tooltip-content` | Content element | The tooltip content that appears on trigger |
148
+
149
+ ## JavaScript API
150
+
151
+ The `HSTooltip` object is available in the global `window` object after the plugin is loaded.
152
+
153
+ ### Instance Methods
154
+
155
+ These methods are called on a tooltip instance.
156
+
157
+ | Method | Parameters | Return Type | Description |
158
+ | --- | --- | --- | --- |
159
+ | `show()` | None | `void` | Forces the tooltip to show programmatically. |
160
+ | `hide()` | None | `void` | Forces the tooltip to hide programmatically. |
161
+ | `destroy()` | None | `void` | Destroys the tooltip instance, removes all generated markup, classes, and event listeners. Use when removing tooltip from DOM. |
162
+
163
+ ### Static Methods
164
+
165
+ These methods are called directly on the `HSTooltip` class.
166
+
167
+ | Method | Parameters | Return Type | Description |
168
+ | --- | --- | --- | --- |
169
+ | `HSTooltip.getInstance(target, isInstance)` | `target`: `HTMLElement \| string` (CSS selector)<br>`isInstance`: `boolean` (optional) | `{ id: string \| number, element: HSTooltip } \| HTMLElement \| null` | Returns the tooltip instance or element associated with the target. If `isInstance` is `true`, returns collection item object `{ id, element }` where `element` is the `HSTooltip` instance. If `isInstance` is `false` or omitted, returns the DOM element (`HTMLElement`). Returns `null` if tooltip instance is not found. |
170
+ | `HSTooltip.show(target)` | `target`: `HSTooltip \| HTMLElement \| string` (CSS selector) | `void` | Shows the tooltip identified by target. Accepts a tooltip instance, DOM element, or CSS selector string. Static alternative to instance `show()` method. |
171
+ | `HSTooltip.hide(target)` | `target`: `HSTooltip \| HTMLElement \| string` (CSS selector) | `void` | Hides the tooltip identified by target. Accepts a tooltip instance, DOM element, or CSS selector string. Static alternative to instance `hide()` method. |
172
+
173
+ ### Usage Examples
174
+
175
+ **Example 1: Using instance methods (public API)**
176
+ ```javascript
177
+ // Create a new tooltip instance
178
+ const tooltip = new HSTooltip(document.querySelector('#hs-tooltip'));
179
+ const showBtn = document.querySelector('#hs-show-btn');
180
+
181
+ // Show tooltip programmatically
182
+ showBtn.addEventListener('click', () => {
183
+ tooltip.show();
184
+ });
185
+ ```
186
+
187
+ **Example 2: Using static methods**
188
+ ```javascript
189
+ const showBtn = document.querySelector('#hs-show-btn');
190
+
191
+ // Show tooltip using static method (no instance needed)
192
+ showBtn.addEventListener('click', () => {
193
+ HSTooltip.show(document.querySelector('#hs-tooltip'));
194
+ });
195
+ ```
196
+
197
+ **Example 3: Getting instance and using methods (recommended pattern)**
198
+ ```javascript
199
+ // Get the tooltip instance
200
+ const instance = HSTooltip.getInstance('#hs-tooltip', true);
201
+
202
+ if (instance) {
203
+ const { element } = instance; // element is the HSTooltip instance
204
+ const showBtn = document.querySelector('#hs-show-btn');
205
+
206
+ // Use instance methods
207
+ showBtn.addEventListener('click', () => {
208
+ element.show();
209
+ });
210
+
211
+ // Clean up when removing from DOM
212
+ function removeTooltip() {
213
+ element.destroy();
214
+ }
215
+ }
216
+ ```
217
+
218
+ **Example 4: Destroying tooltip instance**
219
+ ```javascript
220
+ const instance = HSTooltip.getInstance('#hs-tooltip', true);
221
+
222
+ if (instance) {
223
+ const { element } = instance;
224
+ const removeBtn = document.querySelector('#hs-remove-btn');
225
+
226
+ removeBtn.addEventListener('click', () => {
227
+ // Clean up before removing from DOM
228
+ element.destroy();
229
+ // Now safe to remove the element
230
+ document.querySelector('#hs-tooltip').remove();
231
+ });
232
+ }
233
+ ```
234
+
235
+ ## Events
236
+
237
+ Tooltip instances emit events that can be listened to for lifecycle hooks and custom behavior.
238
+
239
+ | Event Name | When Fired | Callback Parameter | Description |
240
+ | --- | --- | --- | --- |
241
+ | `on:show` | After tooltip is shown | `HSTooltip` (tooltip instance) | Fires after the tooltip has been displayed. Use for post-show actions like tracking analytics. |
242
+ | `on:hide` | After tooltip is hidden | `HSTooltip` (tooltip instance) | Fires after the tooltip has been hidden. Use for cleanup or state updates. |
243
+
244
+ ### Event Usage Example
245
+
246
+ ```javascript
247
+ // Get tooltip instance
248
+ const instance = HSTooltip.getInstance('#hs-tooltip', true);
249
+
250
+ if (instance) {
251
+ const { element } = instance;
252
+
253
+ // Listen to show event
254
+ element.on('show', (tooltipInstance) => {
255
+ console.log('Tooltip shown:', tooltipInstance);
256
+ // Perform actions after tooltip shows
257
+ // e.g., track analytics, update UI
258
+ });
259
+
260
+ // Listen to hide event
261
+ element.on('hide', (tooltipInstance) => {
262
+ console.log('Tooltip hidden:', tooltipInstance);
263
+ // Perform cleanup or state updates
264
+ });
265
+ }
266
+ ```
267
+
268
+ ## Common Patterns
269
+
270
+ ### Pattern 1: Focus-based Tooltip
271
+
272
+ Show tooltip on focus for keyboard accessibility.
273
+
274
+ ```html
275
+ <div class="hs-tooltip --trigger:focus --placement:bottom">
276
+ <button class="hs-tooltip-toggle">Focus me</button>
277
+ <span class="hs-tooltip-content">Helpful information</span>
278
+ </div>
279
+ ```
280
+
281
+ ### Pattern 2: Programmatic Control
282
+
283
+ Control tooltip from external buttons.
284
+
285
+ ```html
286
+ <div class="hs-tooltip" id="hs-tooltip-first">
287
+ <button class="hs-tooltip-toggle">Hover me</button>
288
+ <span class="hs-tooltip-content">Tooltip content</span>
289
+ </div>
290
+
291
+ <button id="hs-show-tooltip">Show Tooltip</button>
292
+ <button id="hs-hide-tooltip">Hide Tooltip</button>
293
+
294
+ <script>
295
+ const instance = HSTooltip.getInstance('#hs-tooltip-first', true);
296
+
297
+ if (instance) {
298
+ const { element } = instance;
299
+
300
+ document.querySelector('#hs-show-tooltip').addEventListener('click', () => {
301
+ element.show();
302
+ });
303
+
304
+ document.querySelector('#hs-hide-tooltip').addEventListener('click', () => {
305
+ element.hide();
306
+ });
307
+ }
308
+ </script>
309
+ ```
310
+
311
+ ## License
312
+
313
+ Copyright (c) 2024 Htmlstream.
314
+
315
+ Licensed under the [MIT License](https://opensource.org/licenses/MIT).
package/index.d.ts CHANGED
@@ -33,6 +33,8 @@ declare class HSTooltip extends HSBasePlugin<{}> implements ITooltip {
33
33
  private onToggleMouseEnterListener;
34
34
  private onToggleMouseLeaveListener;
35
35
  private onToggleHandleListener;
36
+ private onToggleTouchListener;
37
+ private onDocumentTouchListener;
36
38
  constructor(el: HTMLElement, options?: {}, events?: {});
37
39
  private toggleClick;
38
40
  private toggleFocus;
package/index.js CHANGED
@@ -1,24 +1,24 @@
1
- !function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var o in n)("object"==typeof exports?exports:t)[o]=n[o]}}(self,(()=>(()=>{"use strict";var t={292:function(t,e){
1
+ !function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var o in n)("object"==typeof exports?exports:t)[o]=n[o]}}(self,()=>(()=>{"use strict";var t={949(t,e,n){n.r(e),n.d(e,{arrow:()=>Pt,autoPlacement:()=>Ct,autoUpdate:()=>Tt,computePosition:()=>Ht,detectOverflow:()=>Lt,flip:()=>At,getOverflowAncestors:()=>it,hide:()=>Ot,inline:()=>Rt,limitShift:()=>_t,offset:()=>Et,platform:()=>xt,shift:()=>St,size:()=>It});const o=["top","right","bottom","left"],i=["start","end"],r=o.reduce((t,e)=>t.concat(e,e+"-"+i[0],e+"-"+i[1]),[]),s=Math.min,l=Math.max,a=Math.round,c=Math.floor,u=t=>({x:t,y:t}),f={left:"right",right:"left",bottom:"top",top:"bottom"};function h(t,e,n){return l(t,s(e,n))}function d(t,e){return"function"==typeof t?t(e):t}function g(t){return t.split("-")[0]}function p(t){return t.split("-")[1]}function m(t){return"x"===t?"y":"x"}function w(t){return"y"===t?"height":"width"}function y(t){const e=t[0];return"t"===e||"b"===e?"y":"x"}function v(t){return m(y(t))}function x(t,e,n){void 0===n&&(n=!1);const o=p(t),i=v(t),r=w(i);let s="x"===i?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return e.reference[r]>e.floating[r]&&(s=A(s)),[s,A(s)]}function b(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const T=["left","right"],L=["right","left"],E=["top","bottom"],C=["bottom","top"];function S(t,e,n,o){const i=p(t);let r=function(t,e,n){switch(t){case"top":case"bottom":return n?e?L:T:e?T:L;case"left":case"right":return e?E:C;default:return[]}}(g(t),"start"===n,o);return i&&(r=r.map(t=>t+"-"+i),e&&(r=r.concat(r.map(b)))),r}function A(t){const e=g(t);return f[e]+t.slice(e.length)}function I(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}}function O(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 P(t,e,n){let{reference:o,floating:i}=t;const r=y(e),s=v(e),l=w(s),a=g(e),c="y"===r,u=o.x+o.width/2-i.width/2,f=o.y+o.height/2-i.height/2,h=o[l]/2-i[l]/2;let d;switch(a){case"top":d={x:u,y:o.y-i.height};break;case"bottom":d={x:u,y:o.y+o.height};break;case"right":d={x:o.x+o.width,y:f};break;case"left":d={x:o.x-i.width,y:f};break;default:d={x:o.x,y:o.y}}switch(p(e)){case"start":d[s]-=h*(n&&c?-1:1);break;case"end":d[s]+=h*(n&&c?-1:1)}return d}async function R(t,e){var n;void 0===e&&(e={});const{x:o,y:i,platform:r,rects:s,elements:l,strategy:a}=t,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:g=0}=d(e,t),p=I(g),m=l[h?"floating"===f?"reference":"floating":f],w=O(await r.getClippingRect({element:null==(n=await(null==r.isElement?void 0:r.isElement(m)))||n?m:m.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(l.floating)),boundary:c,rootBoundary:u,strategy:a})),y="floating"===f?{x:o,y:i,width:s.floating.width,height:s.floating.height}:s.reference,v=await(null==r.getOffsetParent?void 0:r.getOffsetParent(l.floating)),x=await(null==r.isElement?void 0:r.isElement(v))&&await(null==r.getScale?void 0:r.getScale(v))||{x:1,y:1},b=O(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:v,strategy:a}):y);return{top:(w.top-b.top+p.top)/x.y,bottom:(b.bottom-w.bottom+p.bottom)/x.y,left:(w.left-b.left+p.left)/x.x,right:(b.right-w.right+p.right)/x.x}}function _(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function H(t){return o.some(e=>t[e]>=0)}function M(t){const e=s(...t.map(t=>t.left)),n=s(...t.map(t=>t.top));return{x:e,y:n,width:l(...t.map(t=>t.right))-e,height:l(...t.map(t=>t.bottom))-n}}const D=new Set(["left","top"]);function B(){return"undefined"!=typeof window}function F(t){return $(t)?(t.nodeName||"").toLowerCase():"#document"}function k(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function Y(t){var e;return null==(e=($(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function $(t){return!!B()&&(t instanceof Node||t instanceof k(t).Node)}function U(t){return!!B()&&(t instanceof Element||t instanceof k(t).Element)}function W(t){return!!B()&&(t instanceof HTMLElement||t instanceof k(t).HTMLElement)}function N(t){return!(!B()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof k(t).ShadowRoot)}function j(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=tt(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&"inline"!==i&&"contents"!==i}function V(t){return/^(table|td|th)$/.test(F(t))}function K(t){try{if(t.matches(":popover-open"))return!0}catch(t){}try{return t.matches(":modal")}catch(t){return!1}}const z=/transform|translate|scale|rotate|perspective|filter/,q=/paint|layout|strict|content/,X=t=>!!t&&"none"!==t;let Z;function J(t){const e=U(t)?tt(t):t;return X(e.transform)||X(e.translate)||X(e.scale)||X(e.rotate)||X(e.perspective)||!G()&&(X(e.backdropFilter)||X(e.filter))||z.test(e.willChange||"")||q.test(e.contain||"")}function G(){return null==Z&&(Z="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Z}function Q(t){return/^(html|body|#document)$/.test(F(t))}function tt(t){return k(t).getComputedStyle(t)}function et(t){return U(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function nt(t){if("html"===F(t))return t;const e=t.assignedSlot||t.parentNode||N(t)&&t.host||Y(t);return N(e)?e.host:e}function ot(t){const e=nt(t);return Q(e)?t.ownerDocument?t.ownerDocument.body:t.body:W(e)&&j(e)?e:ot(e)}function it(t,e,n){var o;void 0===e&&(e=[]),void 0===n&&(n=!0);const i=ot(t),r=i===(null==(o=t.ownerDocument)?void 0:o.body),s=k(i);if(r){const t=rt(s);return e.concat(s,s.visualViewport||[],j(i)?i:[],t&&n?it(t):[])}return e.concat(i,it(i,[],n))}function rt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function st(t){const e=tt(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=W(t),r=i?t.offsetWidth:n,s=i?t.offsetHeight:o,l=a(n)!==r||a(o)!==s;return l&&(n=r,o=s),{width:n,height:o,$:l}}function lt(t){return U(t)?t:t.contextElement}function at(t){const e=lt(t);if(!W(e))return u(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:r}=st(e);let s=(r?a(n.width):n.width)/o,l=(r?a(n.height):n.height)/i;return s&&Number.isFinite(s)||(s=1),l&&Number.isFinite(l)||(l=1),{x:s,y:l}}const ct=u(0);function ut(t){const e=k(t);return G()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:ct}function ft(t,e,n,o){void 0===e&&(e=!1),void 0===n&&(n=!1);const i=t.getBoundingClientRect(),r=lt(t);let s=u(1);e&&(o?U(o)&&(s=at(o)):s=at(t));const l=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==k(t))&&e}(r,n,o)?ut(r):u(0);let a=(i.left+l.x)/s.x,c=(i.top+l.y)/s.y,f=i.width/s.x,h=i.height/s.y;if(r){const t=k(r),e=o&&U(o)?k(o):o;let n=t,i=rt(n);for(;i&&o&&e!==n;){const t=at(i),e=i.getBoundingClientRect(),o=tt(i),r=e.left+(i.clientLeft+parseFloat(o.paddingLeft))*t.x,s=e.top+(i.clientTop+parseFloat(o.paddingTop))*t.y;a*=t.x,c*=t.y,f*=t.x,h*=t.y,a+=r,c+=s,n=k(i),i=rt(n)}}return O({width:f,height:h,x:a,y:c})}function ht(t,e){const n=et(t).scrollLeft;return e?e.left+n:ft(Y(t)).left+n}function dt(t,e){const n=t.getBoundingClientRect();return{x:n.left+e.scrollLeft-ht(t,n),y:n.top+e.scrollTop}}function gt(t,e,n){let o;if("viewport"===e)o=function(t,e){const n=k(t),o=Y(t),i=n.visualViewport;let r=o.clientWidth,s=o.clientHeight,l=0,a=0;if(i){r=i.width,s=i.height;const t=G();(!t||t&&"fixed"===e)&&(l=i.offsetLeft,a=i.offsetTop)}const c=ht(o);if(c<=0){const t=o.ownerDocument,e=t.body,n=getComputedStyle(e),i="CSS1Compat"===t.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,s=Math.abs(o.clientWidth-e.clientWidth-i);s<=25&&(r-=s)}else c<=25&&(r+=c);return{width:r,height:s,x:l,y:a}}(t,n);else if("document"===e)o=function(t){const e=Y(t),n=et(t),o=t.ownerDocument.body,i=l(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=l(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+ht(t);const a=-n.scrollTop;return"rtl"===tt(o).direction&&(s+=l(e.clientWidth,o.clientWidth)-i),{width:i,height:r,x:s,y:a}}(Y(t));else if(U(e))o=function(t,e){const n=ft(t,!0,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=W(t)?at(t):u(1);return{width:t.clientWidth*r.x,height:t.clientHeight*r.y,x:i*r.x,y:o*r.y}}(e,n);else{const n=ut(t);o={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height}}return O(o)}function pt(t,e){const n=nt(t);return!(n===e||!U(n)||Q(n))&&("fixed"===tt(n).position||pt(n,e))}function mt(t,e,n){const o=W(e),i=Y(e),r="fixed"===n,s=ft(t,!0,r,e);let l={scrollLeft:0,scrollTop:0};const a=u(0);function c(){a.x=ht(i)}if(o||!o&&!r)if(("body"!==F(e)||j(i))&&(l=et(e)),o){const t=ft(e,!0,r,e);a.x=t.x+e.clientLeft,a.y=t.y+e.clientTop}else i&&c();r&&!o&&i&&c();const f=!i||o||r?u(0):dt(i,l);return{x:s.left+l.scrollLeft-a.x-f.x,y:s.top+l.scrollTop-a.y-f.y,width:s.width,height:s.height}}function wt(t){return"static"===tt(t).position}function yt(t,e){if(!W(t)||"fixed"===tt(t).position)return null;if(e)return e(t);let n=t.offsetParent;return Y(t)===n&&(n=n.ownerDocument.body),n}function vt(t,e){const n=k(t);if(K(t))return n;if(!W(t)){let e=nt(t);for(;e&&!Q(e);){if(U(e)&&!wt(e))return e;e=nt(e)}return n}let o=yt(t,e);for(;o&&V(o)&&wt(o);)o=yt(o,e);return o&&Q(o)&&wt(o)&&!J(o)?n:o||function(t){let e=nt(t);for(;W(e)&&!Q(e);){if(J(e))return e;if(K(e))return null;e=nt(e)}return null}(t)||n}const xt={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const r="fixed"===i,s=Y(o),l=!!e&&K(e.floating);if(o===s||l&&r)return n;let a={scrollLeft:0,scrollTop:0},c=u(1);const f=u(0),h=W(o);if((h||!h&&!r)&&(("body"!==F(o)||j(s))&&(a=et(o)),h)){const t=ft(o);c=at(o),f.x=t.x+o.clientLeft,f.y=t.y+o.clientTop}const d=!s||h||r?u(0):dt(s,a);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-a.scrollLeft*c.x+f.x+d.x,y:n.y*c.y-a.scrollTop*c.y+f.y+d.y}},getDocumentElement:Y,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const r=[..."clippingAncestors"===n?K(e)?[]:function(t,e){const n=e.get(t);if(n)return n;let o=it(t,[],!1).filter(t=>U(t)&&"body"!==F(t)),i=null;const r="fixed"===tt(t).position;let s=r?nt(t):t;for(;U(s)&&!Q(s);){const e=tt(s),n=J(s);n||"fixed"!==e.position||(i=null),(r?!n&&!i:!n&&"static"===e.position&&i&&("absolute"===i.position||"fixed"===i.position)||j(s)&&!n&&pt(t,s))?o=o.filter(t=>t!==s):i=e,s=nt(s)}return e.set(t,o),o}(e,this._c):[].concat(n),o],a=gt(e,r[0],i);let c=a.top,u=a.right,f=a.bottom,h=a.left;for(let t=1;t<r.length;t++){const n=gt(e,r[t],i);c=l(n.top,c),u=s(n.right,u),f=s(n.bottom,f),h=l(n.left,h)}return{width:u-h,height:f-c,x:h,y:c}},getOffsetParent:vt,getElementRects:async function(t){const e=this.getOffsetParent||vt,n=this.getDimensions,o=await n(t.floating);return{reference:mt(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}=st(t);return{width:e,height:n}},getScale:at,isElement:U,isRTL:function(t){return"rtl"===tt(t).direction}};function bt(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Tt(t,e,n,o){void 0===o&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:u="function"==typeof IntersectionObserver,animationFrame:f=!1}=o,h=lt(t),d=i||r?[...h?it(h):[],...e?it(e):[]]:[];d.forEach(t=>{i&&t.addEventListener("scroll",n,{passive:!0}),r&&t.addEventListener("resize",n)});const g=h&&u?function(t,e){let n,o=null;const i=Y(t);function r(){var t;clearTimeout(n),null==(t=o)||t.disconnect(),o=null}return function a(u,f){void 0===u&&(u=!1),void 0===f&&(f=1),r();const h=t.getBoundingClientRect(),{left:d,top:g,width:p,height:m}=h;if(u||e(),!p||!m)return;const w={rootMargin:-c(g)+"px "+-c(i.clientWidth-(d+p))+"px "+-c(i.clientHeight-(g+m))+"px "+-c(d)+"px",threshold:l(0,s(1,f))||1};let y=!0;function v(e){const o=e[0].intersectionRatio;if(o!==f){if(!y)return a();o?a(!1,o):n=setTimeout(()=>{a(!1,1e-7)},1e3)}1!==o||bt(h,t.getBoundingClientRect())||a(),y=!1}try{o=new IntersectionObserver(v,{...w,root:i.ownerDocument})}catch(t){o=new IntersectionObserver(v,w)}o.observe(t)}(!0),r}(h,n):null;let p,m=-1,w=null;a&&(w=new ResizeObserver(t=>{let[o]=t;o&&o.target===h&&w&&e&&(w.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var t;null==(t=w)||t.observe(e)})),n()}),h&&!f&&w.observe(h),e&&w.observe(e));let y=f?ft(t):null;return f&&function e(){const o=ft(t);y&&!bt(y,o)&&n();y=o,p=requestAnimationFrame(e)}(),n(),()=>{var t;d.forEach(t=>{i&&t.removeEventListener("scroll",n),r&&t.removeEventListener("resize",n)}),null==g||g(),null==(t=w)||t.disconnect(),w=null,f&&cancelAnimationFrame(p)}}const Lt=R,Et=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:r,placement:s,middlewareData:l}=e,a=await async function(t,e){const{placement:n,platform:o,elements:i}=t,r=await(null==o.isRTL?void 0:o.isRTL(i.floating)),s=g(n),l=p(n),a="y"===y(n),c=D.has(s)?-1:1,u=r&&a?-1:1,f=d(e,t);let{mainAxis:h,crossAxis:m,alignmentAxis:w}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&"number"==typeof w&&(m="end"===l?-1*w:w),a?{x:m*u,y:h*c}:{x:h*c,y:m*u}}(e,t);return s===(null==(n=l.offset)?void 0:n.placement)&&null!=(o=l.arrow)&&o.alignmentOffset?{}:{x:i+a.x,y:r+a.y,data:{...a,placement:s}}}}},Ct=function(t){return void 0===t&&(t={}),{name:"autoPlacement",options:t,async fn(e){var n,o,i;const{rects:s,middlewareData:l,placement:a,platform:c,elements:u}=e,{crossAxis:f=!1,alignment:h,allowedPlacements:m=r,autoAlignment:w=!0,...y}=d(t,e),v=void 0!==h||m===r?function(t,e,n){return(t?[...n.filter(e=>p(e)===t),...n.filter(e=>p(e)!==t)]:n.filter(t=>g(t)===t)).filter(n=>!t||p(n)===t||!!e&&b(n)!==n)}(h||null,w,m):m,T=await c.detectOverflow(e,y),L=(null==(n=l.autoPlacement)?void 0:n.index)||0,E=v[L];if(null==E)return{};const C=x(E,s,await(null==c.isRTL?void 0:c.isRTL(u.floating)));if(a!==E)return{reset:{placement:v[0]}};const S=[T[g(E)],T[C[0]],T[C[1]]],A=[...(null==(o=l.autoPlacement)?void 0:o.overflows)||[],{placement:E,overflows:S}],I=v[L+1];if(I)return{data:{index:L+1,overflows:A},reset:{placement:I}};const O=A.map(t=>{const e=p(t.placement);return[t.placement,e&&f?t.overflows.slice(0,2).reduce((t,e)=>t+e,0):t.overflows[0],t.overflows]}).sort((t,e)=>t[1]-e[1]),P=(null==(i=O.filter(t=>t[2].slice(0,p(t[0])?2:3).every(t=>t<=0))[0])?void 0:i[0])||O[0][0];return P!==a?{data:{index:L+1,overflows:A},reset:{placement:P}}:{}}}},St=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i,platform:r}=e,{mainAxis:s=!0,crossAxis:l=!1,limiter:a={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...c}=d(t,e),u={x:n,y:o},f=await r.detectOverflow(e,c),p=y(g(i)),w=m(p);let v=u[w],x=u[p];if(s){const t="y"===w?"bottom":"right";v=h(v+f["y"===w?"top":"left"],v,v-f[t])}if(l){const t="y"===p?"bottom":"right";x=h(x+f["y"===p?"top":"left"],x,x-f[t])}const b=a.fn({...e,[w]:v,[p]:x});return{...b,data:{x:b.x-n,y:b.y-o,enabled:{[w]:s,[p]:l}}}}}},At=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:r,rects:s,initialPlacement:l,platform:a,elements:c}=e,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:w=!0,...v}=d(t,e);if(null!=(n=r.arrow)&&n.alignmentOffset)return{};const T=g(i),L=y(l),E=g(l)===l,C=await(null==a.isRTL?void 0:a.isRTL(c.floating)),I=h||(E||!w?[A(l)]:function(t){const e=A(t);return[b(t),e,b(e)]}(l)),O="none"!==m;!h&&O&&I.push(...S(l,w,m,C));const P=[l,...I],R=await a.detectOverflow(e,v),_=[];let H=(null==(o=r.flip)?void 0:o.overflows)||[];if(u&&_.push(R[T]),f){const t=x(i,s,C);_.push(R[t[0]],R[t[1]])}if(H=[...H,{placement:i,overflows:_}],!_.every(t=>t<=0)){var M,D;const t=((null==(M=r.flip)?void 0:M.index)||0)+1,e=P[t];if(e){if(!("alignment"===f&&L!==y(e))||H.every(t=>y(t.placement)!==L||t.overflows[0]>0))return{data:{index:t,overflows:H},reset:{placement:e}}}let n=null==(D=H.filter(t=>t.overflows[0]<=0).sort((t,e)=>t.overflows[1]-e.overflows[1])[0])?void 0:D.placement;if(!n)switch(p){case"bestFit":{var B;const t=null==(B=H.filter(t=>{if(O){const e=y(t.placement);return e===L||"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:B[0];t&&(n=t);break}case"initialPlacement":n=l}if(i!==n)return{reset:{placement:n}}}return{}}}},It=function(t){return void 0===t&&(t={}),{name:"size",options:t,async fn(e){var n,o;const{placement:i,rects:r,platform:a,elements:c}=e,{apply:u=()=>{},...f}=d(t,e),h=await a.detectOverflow(e,f),m=g(i),w=p(i),v="y"===y(i),{width:x,height:b}=r.floating;let T,L;"top"===m||"bottom"===m?(T=m,L=w===(await(null==a.isRTL?void 0:a.isRTL(c.floating))?"start":"end")?"left":"right"):(L=m,T="end"===w?"top":"bottom");const E=b-h.top-h.bottom,C=x-h.left-h.right,S=s(b-h[T],E),A=s(x-h[L],C),I=!e.middlewareData.shift;let O=S,P=A;if(null!=(n=e.middlewareData.shift)&&n.enabled.x&&(P=C),null!=(o=e.middlewareData.shift)&&o.enabled.y&&(O=E),I&&!w){const t=l(h.left,0),e=l(h.right,0),n=l(h.top,0),o=l(h.bottom,0);v?P=x-2*(0!==t||0!==e?t+e:l(h.left,h.right)):O=b-2*(0!==n||0!==o?n+o:l(h.top,h.bottom))}await u({...e,availableWidth:P,availableHeight:O});const R=await a.getDimensions(c.floating);return x!==R.width||b!==R.height?{reset:{rects:!0}}:{}}}},Ot=function(t){return void 0===t&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:o}=e,{strategy:i="referenceHidden",...r}=d(t,e);switch(i){case"referenceHidden":{const t=_(await o.detectOverflow(e,{...r,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:t,referenceHidden:H(t)}}}case"escaped":{const t=_(await o.detectOverflow(e,{...r,altBoundary:!0}),n.floating);return{data:{escapedOffsets:t,escaped:H(t)}}}default:return{}}}}},Pt=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:i,rects:r,platform:l,elements:a,middlewareData:c}=e,{element:u,padding:f=0}=d(t,e)||{};if(null==u)return{};const g=I(f),m={x:n,y:o},y=v(i),x=w(y),b=await l.getDimensions(u),T="y"===y,L=T?"top":"left",E=T?"bottom":"right",C=T?"clientHeight":"clientWidth",S=r.reference[x]+r.reference[y]-m[y]-r.floating[x],A=m[y]-r.reference[y],O=await(null==l.getOffsetParent?void 0:l.getOffsetParent(u));let P=O?O[C]:0;P&&await(null==l.isElement?void 0:l.isElement(O))||(P=a.floating[C]||r.floating[x]);const R=S/2-A/2,_=P/2-b[x]/2-1,H=s(g[L],_),M=s(g[E],_),D=H,B=P-b[x]-M,F=P/2-b[x]/2+R,k=h(D,F,B),Y=!c.arrow&&null!=p(i)&&F!==k&&r.reference[x]/2-(F<D?H:M)-b[x]/2<0,$=Y?F<D?F-D:F-B:0;return{[y]:m[y]+$,data:{[y]:k,centerOffset:F-k-$,...Y&&{alignmentOffset:$}},reset:Y}}}),Rt=function(t){return void 0===t&&(t={}),{name:"inline",options:t,async fn(e){const{placement:n,elements:o,rects:i,platform:r,strategy:a}=e,{padding:c=2,x:u,y:f}=d(t,e),h=Array.from(await(null==r.getClientRects?void 0:r.getClientRects(o.reference))||[]),p=function(t){const e=t.slice().sort((t,e)=>t.y-e.y),n=[];let o=null;for(let t=0;t<e.length;t++){const i=e[t];!o||i.y-o.y>o.height/2?n.push([i]):n[n.length-1].push(i),o=i}return n.map(t=>O(M(t)))}(h),m=O(M(h)),w=I(c);const v=await r.getElementRects({reference:{getBoundingClientRect:function(){if(2===p.length&&p[0].left>p[1].right&&null!=u&&null!=f)return p.find(t=>u>t.left-w.left&&u<t.right+w.right&&f>t.top-w.top&&f<t.bottom+w.bottom)||m;if(p.length>=2){if("y"===y(n)){const t=p[0],e=p[p.length-1],o="top"===g(n),i=t.top,r=e.bottom,s=o?t.left:e.left,l=o?t.right:e.right;return{top:i,bottom:r,left:s,right:l,width:l-s,height:r-i,x:s,y:i}}const t="left"===g(n),e=l(...p.map(t=>t.right)),o=s(...p.map(t=>t.left)),i=p.filter(n=>t?n.left===o:n.right===e),r=i[0].top,a=i[i.length-1].bottom;return{top:r,bottom:a,left:o,right:e,width:e-o,height:a-r,x:o,y:r}}return m}},floating:o.floating,strategy:a});return i.reference.x!==v.reference.x||i.reference.y!==v.reference.y||i.reference.width!==v.reference.width||i.reference.height!==v.reference.height?{reset:{rects:v}}:{}}}},_t=function(t){return void 0===t&&(t={}),{options:t,fn(e){const{x:n,y:o,placement:i,rects:r,middlewareData:s}=e,{offset:l=0,mainAxis:a=!0,crossAxis:c=!0}=d(t,e),u={x:n,y:o},f=y(i),h=m(f);let p=u[h],w=u[f];const v=d(l,e),x="number"==typeof v?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(a){const t="y"===h?"height":"width",e=r.reference[h]-r.floating[t]+x.mainAxis,n=r.reference[h]+r.reference[t]-x.mainAxis;p<e?p=e:p>n&&(p=n)}if(c){var b,T;const t="y"===h?"width":"height",e=D.has(g(i)),n=r.reference[f]-r.floating[t]+(e&&(null==(b=s.offset)?void 0:b[f])||0)+(e?0:x.crossAxis),o=r.reference[f]+r.reference[t]+(e?0:(null==(T=s.offset)?void 0:T[f])||0)-(e?x.crossAxis:0);w<n?w=n:w>o&&(w=o)}return{[h]:p,[f]:w}}}},Ht=(t,e,n)=>{const o=new Map,i={platform:xt,...n},r={...i.platform,_c:o};return(async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:s}=n,l=s.detectOverflow?s:{...s,detectOverflow:R},a=await(null==s.isRTL?void 0:s.isRTL(e));let c=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:f}=P(c,o,a),h=o,d=0;const g={};for(let n=0;n<r.length;n++){const p=r[n];if(!p)continue;const{name:m,fn:w}=p,{x:y,y:v,data:x,reset:b}=await w({x:u,y:f,initialPlacement:o,placement:h,strategy:i,middlewareData:g,rects:c,platform:l,elements:{reference:t,floating:e}});u=null!=y?y:u,f=null!=v?v:f,g[m]={...g[m],...x},b&&d<50&&(d++,"object"==typeof b&&(b.placement&&(h=b.placement),b.rects&&(c=!0===b.rects?await s.getElementRects({reference:t,floating:e,strategy:i}):b.rects),({x:u,y:f}=P(c,h,a))),n=-1)}return{x:u,y:f,placement:h,strategy:i,middlewareData:g}})(t,e,{...i,platform:r})}},8223(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BREAKPOINTS=e.COMBO_BOX_ACCESSIBILITY_KEY_SET=e.SELECT_ACCESSIBILITY_KEY_SET=e.TABS_ACCESSIBILITY_KEY_SET=e.OVERLAY_ACCESSIBILITY_KEY_SET=e.DROPDOWN_ACCESSIBILITY_KEY_SET=e.POSITIONS=void 0,e.POSITIONS={auto:"auto","auto-start":"auto-start","auto-end":"auto-end",top:"top","top-left":"top-start","top-right":"top-end",bottom:"bottom","bottom-left":"bottom-start","bottom-right":"bottom-end",right:"right","right-start":"right-start","right-end":"right-end",left:"left","left-start":"left-start","left-end":"left-end"},e.DROPDOWN_ACCESSIBILITY_KEY_SET=["Escape","ArrowUp","ArrowDown","ArrowRight","ArrowLeft","Home","End","Enter"],e.OVERLAY_ACCESSIBILITY_KEY_SET=["Escape","Tab"],e.TABS_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End"],e.SELECT_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End","Escape","Enter","Space","Tab"],e.COMBO_BOX_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End","Escape","Enter"],e.BREAKPOINTS={xs:0,sm:640,md:768,lg:1024,xl:1280,"2xl":1536}},2961(t,e){
2
2
  /*
3
- * @version: 4.1.3
3
+ * HSBasePlugin
4
+ * @version: 5.0.0
4
5
  * @author: Preline Labs Ltd.
5
6
  * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
6
7
  * Copyright 2024 Preline Labs Ltd.
7
8
  */
8
- Object.defineProperty(e,"__esModule",{value:!0}),e.stringToBoolean=e.menuSearchHistory=e.isScrollable=e.isParentOrElementHidden=e.isJson=e.isIpadOS=e.isIOS=e.isFormElement=e.isFocused=e.isEnoughSpace=e.isDirectChild=e.htmlToElement=e.getZIndex=e.getHighestZIndex=e.getClassPropertyAlt=e.getClassProperty=e.dispatch=e.debounce=e.classToClassList=e.afterTransition=void 0;e.stringToBoolean=t=>"true"===t;e.getClassProperty=(t,e,n="")=>(window.getComputedStyle(t).getPropertyValue(e)||n).replace(" ","");e.getClassPropertyAlt=(t,e,n="")=>{let o="";return t.classList.forEach((t=>{t.includes(e)&&(o=t)})),o.match(/:(.*)]/)?o.match(/:(.*)]/)[1]:n};const n=t=>window.getComputedStyle(t).getPropertyValue("z-index");e.getZIndex=n;e.getHighestZIndex=t=>{let e=Number.NEGATIVE_INFINITY;return t.forEach((t=>{let o=n(t);"auto"!==o&&(o=parseInt(o,10),o>e&&(e=o))})),e};e.isDirectChild=(t,e)=>{const n=t.children;for(let t=0;t<n.length;t++)if(n[t]===e)return!0;return!1};e.isEnoughSpace=(t,e,n="auto",o=10,i=null)=>{const r=e.getBoundingClientRect(),s=i?i.getBoundingClientRect():null,l=window.innerHeight,a=s?r.top-s.top:r.top,c=(i?s.bottom:l)-r.bottom,u=t.clientHeight+o;return"bottom"===n?c>=u:"top"===n?a>=u:a>=u||c>=u};e.isFocused=t=>document.activeElement===t;e.isFormElement=t=>t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement;e.isIOS=()=>!!/iPad|iPhone|iPod/.test(navigator.platform)||navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform);e.isIpadOS=()=>navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform);e.isJson=t=>{if("string"!=typeof t)return!1;const e=t.trim()[0],n=t.trim().slice(-1);if("{"===e&&"}"===n||"["===e&&"]"===n)try{return JSON.parse(t),!0}catch(t){return!1}return!1};const o=t=>{if(!t)return!1;return"none"===window.getComputedStyle(t).display||o(t.parentElement)};e.isParentOrElementHidden=o;e.isScrollable=t=>{const e=window.getComputedStyle(t),n=e.overflowY,o=e.overflowX,i=("scroll"===n||"auto"===n)&&t.scrollHeight>t.clientHeight,r=("scroll"===o||"auto"===o)&&t.scrollWidth>t.clientWidth;return i||r};e.debounce=(t,e=200)=>{let n;return(...o)=>{clearTimeout(n),n=setTimeout((()=>{t.apply(this,o)}),e)}};e.dispatch=(t,e,n=null)=>{const o=new CustomEvent(t,{detail:{payload:n},bubbles:!0,cancelable:!0,composed:!1});e.dispatchEvent(o)};e.afterTransition=(t,e)=>{const n=()=>{e(),t.removeEventListener("transitionend",n,!0)},o=window.getComputedStyle(t),i=o.getPropertyValue("transition-duration");"none"!==o.getPropertyValue("transition-property")&&parseFloat(i)>0?t.addEventListener("transitionend",n,!0):e()};e.htmlToElement=t=>{const e=document.createElement("template");return t=t.trim(),e.innerHTML=t,e.content.firstChild};e.classToClassList=(t,e,n=" ",o="add")=>{t.split(n).forEach((t=>{t.trim()&&("add"===o?e.classList.add(t):e.classList.remove(t))}))};const i={historyIndex:-1,addHistory(t){this.historyIndex=t},existsInHistory(t){return t>this.historyIndex},clearHistory(){this.historyIndex=-1}};e.menuSearchHistory=i},949:(t,e,n)=>{n.r(e),n.d(e,{arrow:()=>bt,autoPlacement:()=>mt,autoUpdate:()=>dt,computePosition:()=>Lt,detectOverflow:()=>gt,flip:()=>wt,getOverflowAncestors:()=>X,hide:()=>xt,inline:()=>Tt,limitShift:()=>Et,offset:()=>pt,platform:()=>ft,shift:()=>yt,size:()=>vt});const o=["top","right","bottom","left"],i=["start","end"],r=o.reduce(((t,e)=>t.concat(e,e+"-"+i[0],e+"-"+i[1])),[]),s=Math.min,l=Math.max,a=Math.round,c=Math.floor,u=t=>({x:t,y:t}),f={left:"right",right:"left",bottom:"top",top:"bottom"},h={start:"end",end:"start"};function d(t,e,n){return l(t,s(e,n))}function g(t,e){return"function"==typeof t?t(e):t}function p(t){return t.split("-")[0]}function m(t){return t.split("-")[1]}function y(t){return"x"===t?"y":"x"}function w(t){return"y"===t?"height":"width"}function v(t){return["top","bottom"].includes(p(t))?"y":"x"}function x(t){return y(v(t))}function b(t,e,n){void 0===n&&(n=!1);const o=m(t),i=x(t),r=w(i);let s="x"===i?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return e.reference[r]>e.floating[r]&&(s=E(s)),[s,E(s)]}function T(t){return t.replace(/start|end/g,(t=>h[t]))}function E(t){return t.replace(/left|right|bottom|top/g,(t=>f[t]))}function L(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}}function A(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 C(t,e,n){let{reference:o,floating:i}=t;const r=v(e),s=x(e),l=w(s),a=p(e),c="y"===r,u=o.x+o.width/2-i.width/2,f=o.y+o.height/2-i.height/2,h=o[l]/2-i[l]/2;let d;switch(a){case"top":d={x:u,y:o.y-i.height};break;case"bottom":d={x:u,y:o.y+o.height};break;case"right":d={x:o.x+o.width,y:f};break;case"left":d={x:o.x-i.width,y:f};break;default:d={x:o.x,y:o.y}}switch(m(e)){case"start":d[s]-=h*(n&&c?-1:1);break;case"end":d[s]+=h*(n&&c?-1:1)}return d}async function S(t,e){var n;void 0===e&&(e={});const{x:o,y:i,platform:r,rects:s,elements:l,strategy:a}=t,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:d=0}=g(e,t),p=L(d),m=l[h?"floating"===f?"reference":"floating":f],y=A(await r.getClippingRect({element:null==(n=await(null==r.isElement?void 0:r.isElement(m)))||n?m:m.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(l.floating)),boundary:c,rootBoundary:u,strategy:a})),w="floating"===f?{x:o,y:i,width:s.floating.width,height:s.floating.height}:s.reference,v=await(null==r.getOffsetParent?void 0:r.getOffsetParent(l.floating)),x=await(null==r.isElement?void 0:r.isElement(v))&&await(null==r.getScale?void 0:r.getScale(v))||{x:1,y:1},b=A(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:w,offsetParent:v,strategy:a}):w);return{top:(y.top-b.top+p.top)/x.y,bottom:(b.bottom-y.bottom+p.bottom)/x.y,left:(y.left-b.left+p.left)/x.x,right:(b.right-y.right+p.right)/x.x}}function I(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function P(t){return o.some((e=>t[e]>=0))}function O(t){const e=s(...t.map((t=>t.left))),n=s(...t.map((t=>t.top)));return{x:e,y:n,width:l(...t.map((t=>t.right)))-e,height:l(...t.map((t=>t.bottom)))-n}}function R(){return"undefined"!=typeof window}function _(t){return B(t)?(t.nodeName||"").toLowerCase():"#document"}function H(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function M(t){var e;return null==(e=(B(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function B(t){return!!R()&&(t instanceof Node||t instanceof H(t).Node)}function D(t){return!!R()&&(t instanceof Element||t instanceof H(t).Element)}function k(t){return!!R()&&(t instanceof HTMLElement||t instanceof H(t).HTMLElement)}function F(t){return!(!R()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof H(t).ShadowRoot)}function Y(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=j(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(i)}function U(t){return["table","td","th"].includes(_(t))}function $(t){return[":popover-open",":modal"].some((e=>{try{return t.matches(e)}catch(t){return!1}}))}function N(t){const e=W(),n=D(t)?j(t):t;return["transform","translate","scale","rotate","perspective"].some((t=>!!n[t]&&"none"!==n[t]))||!!n.containerType&&"normal"!==n.containerType||!e&&!!n.backdropFilter&&"none"!==n.backdropFilter||!e&&!!n.filter&&"none"!==n.filter||["transform","translate","scale","rotate","perspective","filter"].some((t=>(n.willChange||"").includes(t)))||["paint","layout","strict","content"].some((t=>(n.contain||"").includes(t)))}function W(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function V(t){return["html","body","#document"].includes(_(t))}function j(t){return H(t).getComputedStyle(t)}function K(t){return D(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function z(t){if("html"===_(t))return t;const e=t.assignedSlot||t.parentNode||F(t)&&t.host||M(t);return F(e)?e.host:e}function q(t){const e=z(t);return V(e)?t.ownerDocument?t.ownerDocument.body:t.body:k(e)&&Y(e)?e:q(e)}function X(t,e,n){var o;void 0===e&&(e=[]),void 0===n&&(n=!0);const i=q(t),r=i===(null==(o=t.ownerDocument)?void 0:o.body),s=H(i);if(r){const t=Z(s);return e.concat(s,s.visualViewport||[],Y(i)?i:[],t&&n?X(t):[])}return e.concat(i,X(i,[],n))}function Z(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function J(t){const e=j(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=k(t),r=i?t.offsetWidth:n,s=i?t.offsetHeight:o,l=a(n)!==r||a(o)!==s;return l&&(n=r,o=s),{width:n,height:o,$:l}}function G(t){return D(t)?t:t.contextElement}function Q(t){const e=G(t);if(!k(e))return u(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:r}=J(e);let s=(r?a(n.width):n.width)/o,l=(r?a(n.height):n.height)/i;return s&&Number.isFinite(s)||(s=1),l&&Number.isFinite(l)||(l=1),{x:s,y:l}}const tt=u(0);function et(t){const e=H(t);return W()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:tt}function nt(t,e,n,o){void 0===e&&(e=!1),void 0===n&&(n=!1);const i=t.getBoundingClientRect(),r=G(t);let s=u(1);e&&(o?D(o)&&(s=Q(o)):s=Q(t));const l=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==H(t))&&e}(r,n,o)?et(r):u(0);let a=(i.left+l.x)/s.x,c=(i.top+l.y)/s.y,f=i.width/s.x,h=i.height/s.y;if(r){const t=H(r),e=o&&D(o)?H(o):o;let n=t,i=Z(n);for(;i&&o&&e!==n;){const t=Q(i),e=i.getBoundingClientRect(),o=j(i),r=e.left+(i.clientLeft+parseFloat(o.paddingLeft))*t.x,s=e.top+(i.clientTop+parseFloat(o.paddingTop))*t.y;a*=t.x,c*=t.y,f*=t.x,h*=t.y,a+=r,c+=s,n=H(i),i=Z(n)}}return A({width:f,height:h,x:a,y:c})}function ot(t,e){const n=K(t).scrollLeft;return e?e.left+n:nt(M(t)).left+n}function it(t,e,n){void 0===n&&(n=!1);const o=t.getBoundingClientRect();return{x:o.left+e.scrollLeft-(n?0:ot(t,o)),y:o.top+e.scrollTop}}function rt(t,e,n){let o;if("viewport"===e)o=function(t,e){const n=H(t),o=M(t),i=n.visualViewport;let r=o.clientWidth,s=o.clientHeight,l=0,a=0;if(i){r=i.width,s=i.height;const t=W();(!t||t&&"fixed"===e)&&(l=i.offsetLeft,a=i.offsetTop)}return{width:r,height:s,x:l,y:a}}(t,n);else if("document"===e)o=function(t){const e=M(t),n=K(t),o=t.ownerDocument.body,i=l(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=l(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+ot(t);const a=-n.scrollTop;return"rtl"===j(o).direction&&(s+=l(e.clientWidth,o.clientWidth)-i),{width:i,height:r,x:s,y:a}}(M(t));else if(D(e))o=function(t,e){const n=nt(t,!0,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=k(t)?Q(t):u(1);return{width:t.clientWidth*r.x,height:t.clientHeight*r.y,x:i*r.x,y:o*r.y}}(e,n);else{const n=et(t);o={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height}}return A(o)}function st(t,e){const n=z(t);return!(n===e||!D(n)||V(n))&&("fixed"===j(n).position||st(n,e))}function lt(t,e,n){const o=k(e),i=M(e),r="fixed"===n,s=nt(t,!0,r,e);let l={scrollLeft:0,scrollTop:0};const a=u(0);if(o||!o&&!r)if(("body"!==_(e)||Y(i))&&(l=K(e)),o){const t=nt(e,!0,r,e);a.x=t.x+e.clientLeft,a.y=t.y+e.clientTop}else i&&(a.x=ot(i));const c=!i||o||r?u(0):it(i,l);return{x:s.left+l.scrollLeft-a.x-c.x,y:s.top+l.scrollTop-a.y-c.y,width:s.width,height:s.height}}function at(t){return"static"===j(t).position}function ct(t,e){if(!k(t)||"fixed"===j(t).position)return null;if(e)return e(t);let n=t.offsetParent;return M(t)===n&&(n=n.ownerDocument.body),n}function ut(t,e){const n=H(t);if($(t))return n;if(!k(t)){let e=z(t);for(;e&&!V(e);){if(D(e)&&!at(e))return e;e=z(e)}return n}let o=ct(t,e);for(;o&&U(o)&&at(o);)o=ct(o,e);return o&&V(o)&&at(o)&&!N(o)?n:o||function(t){let e=z(t);for(;k(e)&&!V(e);){if(N(e))return e;if($(e))return null;e=z(e)}return null}(t)||n}const ft={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const r="fixed"===i,s=M(o),l=!!e&&$(e.floating);if(o===s||l&&r)return n;let a={scrollLeft:0,scrollTop:0},c=u(1);const f=u(0),h=k(o);if((h||!h&&!r)&&(("body"!==_(o)||Y(s))&&(a=K(o)),k(o))){const t=nt(o);c=Q(o),f.x=t.x+o.clientLeft,f.y=t.y+o.clientTop}const d=!s||h||r?u(0):it(s,a,!0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-a.scrollLeft*c.x+f.x+d.x,y:n.y*c.y-a.scrollTop*c.y+f.y+d.y}},getDocumentElement:M,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const r=[..."clippingAncestors"===n?$(e)?[]:function(t,e){const n=e.get(t);if(n)return n;let o=X(t,[],!1).filter((t=>D(t)&&"body"!==_(t))),i=null;const r="fixed"===j(t).position;let s=r?z(t):t;for(;D(s)&&!V(s);){const e=j(s),n=N(s);n||"fixed"!==e.position||(i=null),(r?!n&&!i:!n&&"static"===e.position&&i&&["absolute","fixed"].includes(i.position)||Y(s)&&!n&&st(t,s))?o=o.filter((t=>t!==s)):i=e,s=z(s)}return e.set(t,o),o}(e,this._c):[].concat(n),o],a=r[0],c=r.reduce(((t,n)=>{const o=rt(e,n,i);return t.top=l(o.top,t.top),t.right=s(o.right,t.right),t.bottom=s(o.bottom,t.bottom),t.left=l(o.left,t.left),t}),rt(e,a,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}},getOffsetParent:ut,getElementRects:async function(t){const e=this.getOffsetParent||ut,n=this.getDimensions,o=await n(t.floating);return{reference:lt(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:Q,isElement:D,isRTL:function(t){return"rtl"===j(t).direction}};function ht(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function dt(t,e,n,o){void 0===o&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:u="function"==typeof IntersectionObserver,animationFrame:f=!1}=o,h=G(t),d=i||r?[...h?X(h):[],...X(e)]:[];d.forEach((t=>{i&&t.addEventListener("scroll",n,{passive:!0}),r&&t.addEventListener("resize",n)}));const g=h&&u?function(t,e){let n,o=null;const i=M(t);function r(){var t;clearTimeout(n),null==(t=o)||t.disconnect(),o=null}return function a(u,f){void 0===u&&(u=!1),void 0===f&&(f=1),r();const h=t.getBoundingClientRect(),{left:d,top:g,width:p,height:m}=h;if(u||e(),!p||!m)return;const y={rootMargin:-c(g)+"px "+-c(i.clientWidth-(d+p))+"px "+-c(i.clientHeight-(g+m))+"px "+-c(d)+"px",threshold:l(0,s(1,f))||1};let w=!0;function v(e){const o=e[0].intersectionRatio;if(o!==f){if(!w)return a();o?a(!1,o):n=setTimeout((()=>{a(!1,1e-7)}),1e3)}1!==o||ht(h,t.getBoundingClientRect())||a(),w=!1}try{o=new IntersectionObserver(v,{...y,root:i.ownerDocument})}catch(t){o=new IntersectionObserver(v,y)}o.observe(t)}(!0),r}(h,n):null;let p,m=-1,y=null;a&&(y=new ResizeObserver((t=>{let[o]=t;o&&o.target===h&&y&&(y.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame((()=>{var t;null==(t=y)||t.observe(e)}))),n()})),h&&!f&&y.observe(h),y.observe(e));let w=f?nt(t):null;return f&&function e(){const o=nt(t);w&&!ht(w,o)&&n();w=o,p=requestAnimationFrame(e)}(),n(),()=>{var t;d.forEach((t=>{i&&t.removeEventListener("scroll",n),r&&t.removeEventListener("resize",n)})),null==g||g(),null==(t=y)||t.disconnect(),y=null,f&&cancelAnimationFrame(p)}}const gt=S,pt=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:r,placement:s,middlewareData:l}=e,a=await async function(t,e){const{placement:n,platform:o,elements:i}=t,r=await(null==o.isRTL?void 0:o.isRTL(i.floating)),s=p(n),l=m(n),a="y"===v(n),c=["left","top"].includes(s)?-1:1,u=r&&a?-1:1,f=g(e,t);let{mainAxis:h,crossAxis:d,alignmentAxis:y}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&"number"==typeof y&&(d="end"===l?-1*y:y),a?{x:d*u,y:h*c}:{x:h*c,y:d*u}}(e,t);return s===(null==(n=l.offset)?void 0:n.placement)&&null!=(o=l.arrow)&&o.alignmentOffset?{}:{x:i+a.x,y:r+a.y,data:{...a,placement:s}}}}},mt=function(t){return void 0===t&&(t={}),{name:"autoPlacement",options:t,async fn(e){var n,o,i;const{rects:s,middlewareData:l,placement:a,platform:c,elements:u}=e,{crossAxis:f=!1,alignment:h,allowedPlacements:d=r,autoAlignment:y=!0,...w}=g(t,e),v=void 0!==h||d===r?function(t,e,n){return(t?[...n.filter((e=>m(e)===t)),...n.filter((e=>m(e)!==t))]:n.filter((t=>p(t)===t))).filter((n=>!t||m(n)===t||!!e&&T(n)!==n))}(h||null,y,d):d,x=await S(e,w),E=(null==(n=l.autoPlacement)?void 0:n.index)||0,L=v[E];if(null==L)return{};const A=b(L,s,await(null==c.isRTL?void 0:c.isRTL(u.floating)));if(a!==L)return{reset:{placement:v[0]}};const C=[x[p(L)],x[A[0]],x[A[1]]],I=[...(null==(o=l.autoPlacement)?void 0:o.overflows)||[],{placement:L,overflows:C}],P=v[E+1];if(P)return{data:{index:E+1,overflows:I},reset:{placement:P}};const O=I.map((t=>{const e=m(t.placement);return[t.placement,e&&f?t.overflows.slice(0,2).reduce(((t,e)=>t+e),0):t.overflows[0],t.overflows]})).sort(((t,e)=>t[1]-e[1])),R=(null==(i=O.filter((t=>t[2].slice(0,m(t[0])?2:3).every((t=>t<=0))))[0])?void 0:i[0])||O[0][0];return R!==a?{data:{index:E+1,overflows:I},reset:{placement:R}}:{}}}},yt=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:s=!1,limiter:l={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...a}=g(t,e),c={x:n,y:o},u=await S(e,a),f=v(p(i)),h=y(f);let m=c[h],w=c[f];if(r){const t="y"===h?"bottom":"right";m=d(m+u["y"===h?"top":"left"],m,m-u[t])}if(s){const t="y"===f?"bottom":"right";w=d(w+u["y"===f?"top":"left"],w,w-u[t])}const x=l.fn({...e,[h]:m,[f]:w});return{...x,data:{x:x.x-n,y:x.y-o,enabled:{[h]:r,[f]:s}}}}}},wt=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:r,rects:s,initialPlacement:l,platform:a,elements:c}=e,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:w=!0,...x}=g(t,e);if(null!=(n=r.arrow)&&n.alignmentOffset)return{};const L=p(i),A=v(l),C=p(l)===l,I=await(null==a.isRTL?void 0:a.isRTL(c.floating)),P=h||(C||!w?[E(l)]:function(t){const e=E(t);return[T(t),e,T(e)]}(l)),O="none"!==y;!h&&O&&P.push(...function(t,e,n,o){const i=m(t);let r=function(t,e,n){const o=["left","right"],i=["right","left"],r=["top","bottom"],s=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:o:e?o:i;case"left":case"right":return e?r:s;default:return[]}}(p(t),"start"===n,o);return i&&(r=r.map((t=>t+"-"+i)),e&&(r=r.concat(r.map(T)))),r}(l,w,y,I));const R=[l,...P],_=await S(e,x),H=[];let M=(null==(o=r.flip)?void 0:o.overflows)||[];if(u&&H.push(_[L]),f){const t=b(i,s,I);H.push(_[t[0]],_[t[1]])}if(M=[...M,{placement:i,overflows:H}],!H.every((t=>t<=0))){var B,D;const t=((null==(B=r.flip)?void 0:B.index)||0)+1,e=R[t];if(e)return{data:{index:t,overflows:M},reset:{placement:e}};let n=null==(D=M.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:D.placement;if(!n)switch(d){case"bestFit":{var k;const t=null==(k=M.filter((t=>{if(O){const e=v(t.placement);return e===A||"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:k[0];t&&(n=t);break}case"initialPlacement":n=l}if(i!==n)return{reset:{placement:n}}}return{}}}},vt=function(t){return void 0===t&&(t={}),{name:"size",options:t,async fn(e){var n,o;const{placement:i,rects:r,platform:a,elements:c}=e,{apply:u=()=>{},...f}=g(t,e),h=await S(e,f),d=p(i),y=m(i),w="y"===v(i),{width:x,height:b}=r.floating;let T,E;"top"===d||"bottom"===d?(T=d,E=y===(await(null==a.isRTL?void 0:a.isRTL(c.floating))?"start":"end")?"left":"right"):(E=d,T="end"===y?"top":"bottom");const L=b-h.top-h.bottom,A=x-h.left-h.right,C=s(b-h[T],L),I=s(x-h[E],A),P=!e.middlewareData.shift;let O=C,R=I;if(null!=(n=e.middlewareData.shift)&&n.enabled.x&&(R=A),null!=(o=e.middlewareData.shift)&&o.enabled.y&&(O=L),P&&!y){const t=l(h.left,0),e=l(h.right,0),n=l(h.top,0),o=l(h.bottom,0);w?R=x-2*(0!==t||0!==e?t+e:l(h.left,h.right)):O=b-2*(0!==n||0!==o?n+o:l(h.top,h.bottom))}await u({...e,availableWidth:R,availableHeight:O});const _=await a.getDimensions(c.floating);return x!==_.width||b!==_.height?{reset:{rects:!0}}:{}}}},xt=function(t){return void 0===t&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:o="referenceHidden",...i}=g(t,e);switch(o){case"referenceHidden":{const t=I(await S(e,{...i,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:t,referenceHidden:P(t)}}}case"escaped":{const t=I(await S(e,{...i,altBoundary:!0}),n.floating);return{data:{escapedOffsets:t,escaped:P(t)}}}default:return{}}}}},bt=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:i,rects:r,platform:l,elements:a,middlewareData:c}=e,{element:u,padding:f=0}=g(t,e)||{};if(null==u)return{};const h=L(f),p={x:n,y:o},y=x(i),v=w(y),b=await l.getDimensions(u),T="y"===y,E=T?"top":"left",A=T?"bottom":"right",C=T?"clientHeight":"clientWidth",S=r.reference[v]+r.reference[y]-p[y]-r.floating[v],I=p[y]-r.reference[y],P=await(null==l.getOffsetParent?void 0:l.getOffsetParent(u));let O=P?P[C]:0;O&&await(null==l.isElement?void 0:l.isElement(P))||(O=a.floating[C]||r.floating[v]);const R=S/2-I/2,_=O/2-b[v]/2-1,H=s(h[E],_),M=s(h[A],_),B=H,D=O-b[v]-M,k=O/2-b[v]/2+R,F=d(B,k,D),Y=!c.arrow&&null!=m(i)&&k!==F&&r.reference[v]/2-(k<B?H:M)-b[v]/2<0,U=Y?k<B?k-B:k-D:0;return{[y]:p[y]+U,data:{[y]:F,centerOffset:k-F-U,...Y&&{alignmentOffset:U}},reset:Y}}}),Tt=function(t){return void 0===t&&(t={}),{name:"inline",options:t,async fn(e){const{placement:n,elements:o,rects:i,platform:r,strategy:a}=e,{padding:c=2,x:u,y:f}=g(t,e),h=Array.from(await(null==r.getClientRects?void 0:r.getClientRects(o.reference))||[]),d=function(t){const e=t.slice().sort(((t,e)=>t.y-e.y)),n=[];let o=null;for(let t=0;t<e.length;t++){const i=e[t];!o||i.y-o.y>o.height/2?n.push([i]):n[n.length-1].push(i),o=i}return n.map((t=>A(O(t))))}(h),m=A(O(h)),y=L(c);const w=await r.getElementRects({reference:{getBoundingClientRect:function(){if(2===d.length&&d[0].left>d[1].right&&null!=u&&null!=f)return d.find((t=>u>t.left-y.left&&u<t.right+y.right&&f>t.top-y.top&&f<t.bottom+y.bottom))||m;if(d.length>=2){if("y"===v(n)){const t=d[0],e=d[d.length-1],o="top"===p(n),i=t.top,r=e.bottom,s=o?t.left:e.left,l=o?t.right:e.right;return{top:i,bottom:r,left:s,right:l,width:l-s,height:r-i,x:s,y:i}}const t="left"===p(n),e=l(...d.map((t=>t.right))),o=s(...d.map((t=>t.left))),i=d.filter((n=>t?n.left===o:n.right===e)),r=i[0].top,a=i[i.length-1].bottom;return{top:r,bottom:a,left:o,right:e,width:e-o,height:a-r,x:o,y:r}}return m}},floating:o.floating,strategy:a});return i.reference.x!==w.reference.x||i.reference.y!==w.reference.y||i.reference.width!==w.reference.width||i.reference.height!==w.reference.height?{reset:{rects:w}}:{}}}},Et=function(t){return void 0===t&&(t={}),{options:t,fn(e){const{x:n,y:o,placement:i,rects:r,middlewareData:s}=e,{offset:l=0,mainAxis:a=!0,crossAxis:c=!0}=g(t,e),u={x:n,y:o},f=v(i),h=y(f);let d=u[h],m=u[f];const w=g(l,e),x="number"==typeof w?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(a){const t="y"===h?"height":"width",e=r.reference[h]-r.floating[t]+x.mainAxis,n=r.reference[h]+r.reference[t]-x.mainAxis;d<e?d=e:d>n&&(d=n)}if(c){var b,T;const t="y"===h?"width":"height",e=["top","left"].includes(p(i)),n=r.reference[f]-r.floating[t]+(e&&(null==(b=s.offset)?void 0:b[f])||0)+(e?0:x.crossAxis),o=r.reference[f]+r.reference[t]+(e?0:(null==(T=s.offset)?void 0:T[f])||0)-(e?x.crossAxis:0);m<n?m=n:m>o&&(m=o)}return{[h]:d,[f]:m}}}},Lt=(t,e,n)=>{const o=new Map,i={platform:ft,...n},r={...i.platform,_c:o};return(async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:s}=n,l=r.filter(Boolean),a=await(null==s.isRTL?void 0:s.isRTL(e));let c=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:f}=C(c,o,a),h=o,d={},g=0;for(let n=0;n<l.length;n++){const{name:r,fn:p}=l[n],{x:m,y,data:w,reset:v}=await p({x:u,y:f,initialPlacement:o,placement:h,strategy:i,middlewareData:d,rects:c,platform:s,elements:{reference:t,floating:e}});u=null!=m?m:u,f=null!=y?y:f,d={...d,[r]:{...d[r],...w}},v&&g<=50&&(g++,"object"==typeof v&&(v.placement&&(h=v.placement),v.rects&&(c=!0===v.rects?await s.getElementRects({reference:t,floating:e,strategy:i}):v.rects),({x:u,y:f}=C(c,h,a))),n=-1)}return{x:u,y:f,placement:h,strategy:i,middlewareData:d}})(t,e,{...i,platform:r})}},2961:(t,e)=>{
9
+ Object.defineProperty(e,"__esModule",{value:!0});e.default=class{constructor(t,e,n){this.el=t,this.options=e,this.events=n,this.el=t,this.options=e,this.events={}}createCollection(t,e){var n,o;let i=t;if(!Array.isArray(i)&&"undefined"!=typeof window){const t=null===(n=this.constructor)||void 0===n?void 0:n.name,e="string"==typeof t&&t.startsWith("HS")?`$hs${t.slice(2)}Collection`:null;e&&(Array.isArray(window[e])||(window[e]=[]),i=window[e])}Array.isArray(i)&&i.push({id:(null===(o=null==e?void 0:e.el)||void 0===o?void 0:o.id)||i.length+1,element:e})}fireEvent(t,e=null){if(this.events.hasOwnProperty(t))return this.events[t](e)}on(t,e){this.events[t]=e}}},8490(t,e,n){var o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const i=o(n(4986));window.addEventListener("load",()=>{i.default.autoInit()}),"undefined"!=typeof window&&(window.HSTooltip=i.default)},4986(t,e,n){
9
10
  /*
10
- * HSBasePlugin
11
- * @version: 4.1.3
11
+ * HSTooltip
12
+ * @version: 5.0.0
12
13
  * @author: Preline Labs Ltd.
13
14
  * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
14
15
  * Copyright 2024 Preline Labs Ltd.
15
16
  */
16
- Object.defineProperty(e,"__esModule",{value:!0});e.default=class{constructor(t,e,n){this.el=t,this.options=e,this.events=n,this.el=t,this.options=e,this.events={}}createCollection(t,e){var n,o;let i=t;if(!Array.isArray(i)&&"undefined"!=typeof window){const t=null===(n=this.constructor)||void 0===n?void 0:n.name,e="string"==typeof t&&t.startsWith("HS")?`$hs${t.slice(2)}Collection`:null;e&&(Array.isArray(window[e])||(window[e]=[]),i=window[e])}Array.isArray(i)&&i.push({id:(null===(o=null==e?void 0:e.el)||void 0===o?void 0:o.id)||i.length+1,element:e})}fireEvent(t,e=null){if(this.events.hasOwnProperty(t))return this.events[t](e)}on(t,e){this.events[t]=e}}},4986:function(t,e,n){
17
+ var o=this&&this.__awaiter||function(t,e,n,o){return new(n||(n=Promise))(function(i,r){function s(t){try{a(o.next(t))}catch(t){r(t)}}function l(t){try{a(o.throw(t))}catch(t){r(t)}}function a(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(s,l)}a((o=o.apply(t,e||[])).next())})},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const r=n(949),s=n(292),l=i(n(2961)),a=n(8223);class c extends l.default{constructor(t,e,n){super(t,e,n),this.cleanupAutoUpdate=null,window.$hsTooltipCollection||(window.$hsTooltipCollection=[]),this.el&&(this.toggle=this.el.querySelector(".hs-tooltip-toggle")||this.el,this.content=this.el.querySelector(".hs-tooltip-content"),this.eventMode=(0,s.getClassProperty)(this.el,"--trigger")||"hover",this.preventFloatingUI=(0,s.getClassProperty)(this.el,"--prevent-popper","false"),this.placement=(0,s.getClassProperty)(this.el,"--placement")||"top",this.strategy=(0,s.getClassProperty)(this.el,"--strategy"),this.scope=(0,s.getClassProperty)(this.el,"--scope")||"parent"),this.el&&this.toggle&&this.content&&this.init()}toggleClick(){this.click()}toggleFocus(){this.focus()}toggleMouseEnter(){this.enter()}toggleMouseLeave(){this.leave()}toggleHandle(){this.hide(),this.toggle.removeEventListener("click",this.onToggleHandleListener,!0),this.toggle.removeEventListener("blur",this.onToggleHandleListener,!0)}hideOtherTooltips(){window.$hsTooltipCollection&&window.$hsTooltipCollection.forEach(({element:t})=>t.el!==this.el&&(!!t.el.classList.contains("show")&&void t.hide()))}init(){this.createCollection(window.$hsTooltipCollection,this),this.onToggleFocusListener=()=>this.enter(),this.onToggleBlurListener=()=>this.hide(),this.toggle.addEventListener("focus",this.onToggleFocusListener),this.toggle.addEventListener("blur",this.onToggleBlurListener),"focus"===this.eventMode?(this.onToggleTouchListener=t=>{"touch"===t.pointerType&&this.enter()},this.toggle.addEventListener("pointerdown",this.onToggleTouchListener),this.onDocumentTouchListener=t=>{"touch"===t.pointerType&&(this.el.contains(t.target)||this.leave())},document.addEventListener("pointerdown",this.onDocumentTouchListener)):"click"===this.eventMode?(this.onToggleClickListener=()=>this.toggleClick(),this.toggle.addEventListener("click",this.onToggleClickListener)):"hover"===this.eventMode&&(this.onToggleMouseEnterListener=()=>this.toggleMouseEnter(),this.onToggleMouseLeaveListener=()=>this.toggleMouseLeave(),this.toggle.addEventListener("mouseenter",this.onToggleMouseEnterListener),this.toggle.addEventListener("mouseleave",this.onToggleMouseLeaveListener))}enter(){this._show()}leave(){this.hide()}click(){if(this.el.classList.contains("show"))return!1;this._show(),this.onToggleHandleListener=()=>{setTimeout(()=>this.toggleHandle())},this.toggle.addEventListener("click",this.onToggleHandleListener,!0),this.toggle.addEventListener("blur",this.onToggleHandleListener,!0)}focus(){this._show()}positionTooltip(t){return o(this,void 0,void 0,function*(){const e="auto"===t?"top":t,n="auto"===t?["bottom","left","right"]:this.getFallbackPlacements(e),o=[(0,r.offset)(5),(0,r.flip)({fallbackPlacements:n})];return yield(0,r.computePosition)(this.toggle,this.content,{placement:e,strategy:this.strategy||"fixed",middleware:o})})}getFallbackPlacements(t){switch(t){case"top":return["bottom","left","right"];case"bottom":return["top","left","right"];case"left":return["right","top","bottom"];case"right":return["left","top","bottom"];case"top-start":return["bottom-start","top-end","bottom-end"];case"top-end":return["bottom-end","top-start","bottom-start"];case"bottom-start":return["top-start","bottom-end","top-end"];case"bottom-end":return["top-end","bottom-start","top-start"];case"left-start":return["right-start","left-end","right-end"];case"left-end":return["right-end","left-start","right-start"];case"right-start":return["left-start","right-end","left-end"];case"right-end":return["left-end","right-start","left-start"];default:return["top","bottom","left","right"]}}applyTooltipPosition(t,e,n){Object.assign(this.content.style,{position:this.strategy||"fixed",left:`${t}px`,top:`${e}px`}),this.content.setAttribute("data-placement",n)}buildFloatingUI(){"window"===this.scope&&document.body.appendChild(this.content);const t=this.placement.startsWith("auto"),e=(0,s.getClassProperty)(this.el,"--placement"),n=t||(!e||""===e)?"auto":a.POSITIONS[this.placement]||this.placement;this.positionTooltip(n).then(t=>{this.applyTooltipPosition(t.x,t.y,t.placement)}),this.cleanupAutoUpdate=(0,r.autoUpdate)(this.toggle,this.content,()=>{this.positionTooltip(n).then(t=>{Object.assign(this.content.style,{position:this.strategy||"fixed",left:`${t.x}px`,top:`${t.y}px`}),this.content.setAttribute("data-placement",t.placement)})})}_show(){if(this.el.classList.contains("show"))return!1;this.hideOtherTooltips(),this.content.classList.remove("hidden"),"window"===this.scope&&this.content.classList.add("show"),"false"!==this.preventFloatingUI||this.cleanupAutoUpdate||this.buildFloatingUI(),setTimeout(()=>{this.el.classList.add("show"),this.fireEvent("show",this.el),(0,s.dispatch)("show.hs.tooltip",this.el,this.el)})}show(){"click"===this.eventMode?this.click():this.enter(),this.toggle.focus(),this.toggle.style.outline="none"}hide(){this.el.classList.remove("show"),"window"===this.scope&&this.content.classList.remove("show"),"false"===this.preventFloatingUI&&this.cleanupAutoUpdate&&(this.cleanupAutoUpdate(),this.cleanupAutoUpdate=null),this.fireEvent("hide",this.el),(0,s.dispatch)("hide.hs.tooltip",this.el,this.el),(0,s.afterTransition)(this.content,()=>{if(this.el.classList.contains("show"))return!1;this.content.classList.add("hidden"),this.toggle.style.outline=""})}destroy(){this.el.classList.remove("show"),this.content.classList.add("hidden"),this.toggle.removeEventListener("focus",this.onToggleFocusListener),this.toggle.removeEventListener("blur",this.onToggleBlurListener),"focus"===this.eventMode?(this.onToggleTouchListener&&this.toggle.removeEventListener("pointerdown",this.onToggleTouchListener),this.onDocumentTouchListener&&document.removeEventListener("pointerdown",this.onDocumentTouchListener)):"click"===this.eventMode?this.toggle.removeEventListener("click",this.onToggleClickListener):"hover"===this.eventMode&&(this.toggle.removeEventListener("mouseenter",this.onToggleMouseEnterListener),this.toggle.removeEventListener("mouseleave",this.onToggleMouseLeaveListener)),this.toggle.removeEventListener("click",this.onToggleHandleListener,!0),this.toggle.removeEventListener("blur",this.onToggleHandleListener,!0),this.cleanupAutoUpdate&&(this.cleanupAutoUpdate(),this.cleanupAutoUpdate=null),window.$hsTooltipCollection=window.$hsTooltipCollection.filter(({element:t})=>t.el!==this.el)}static findInCollection(t){return window.$hsTooltipCollection.find(e=>t instanceof c?e.element.el===t.el:"string"==typeof t?e.element.el===document.querySelector(t):e.element.el===t)||null}static getInstance(t,e=!1){const n=window.$hsTooltipCollection.find(e=>e.element.el===("string"==typeof t?document.querySelector(t):t));return n?e?n:n.element.el:null}static autoInit(){window.$hsTooltipCollection||(window.$hsTooltipCollection=[]),window.$hsTooltipCollection&&(window.$hsTooltipCollection=window.$hsTooltipCollection.filter(({element:t})=>document.contains(t.el))),document.querySelectorAll(".hs-tooltip:not(.--prevent-on-load-init)").forEach(t=>{window.$hsTooltipCollection.find(e=>{var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t})||new c(t)})}static show(t){const e=c.findInCollection(t);e&&e.element.show()}static hide(t){const e=c.findInCollection(t);e&&e.element.hide()}static on(t,e,n){const o=c.findInCollection(e);o&&(o.element.events[t]=n)}}e.default=c},292(t,e){
17
18
  /*
18
- * HSTooltip
19
- * @version: 4.1.3
19
+ * @version: 5.0.0
20
20
  * @author: Preline Labs Ltd.
21
21
  * @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
22
22
  * Copyright 2024 Preline Labs Ltd.
23
23
  */
24
- var o=this&&this.__awaiter||function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function s(t){try{a(o.next(t))}catch(t){r(t)}}function l(t){try{a(o.throw(t))}catch(t){r(t)}}function a(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,l)}a((o=o.apply(t,e||[])).next())}))},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const r=n(949),s=n(292),l=i(n(2961)),a=n(8223);class c extends l.default{constructor(t,e,n){super(t,e,n),this.cleanupAutoUpdate=null,this.el&&(this.toggle=this.el.querySelector(".hs-tooltip-toggle")||this.el,this.content=this.el.querySelector(".hs-tooltip-content"),this.eventMode=(0,s.getClassProperty)(this.el,"--trigger")||"hover",this.preventFloatingUI=(0,s.getClassProperty)(this.el,"--prevent-popper","false"),this.placement=(0,s.getClassProperty)(this.el,"--placement")||"top",this.strategy=(0,s.getClassProperty)(this.el,"--strategy"),this.scope=(0,s.getClassProperty)(this.el,"--scope")||"parent"),this.el&&this.toggle&&this.content&&this.init()}toggleClick(){this.click()}toggleFocus(){this.focus()}toggleMouseEnter(){this.enter()}toggleMouseLeave(){this.leave()}toggleHandle(){this.hide(),this.toggle.removeEventListener("click",this.onToggleHandleListener,!0),this.toggle.removeEventListener("blur",this.onToggleHandleListener,!0)}hideOtherTooltips(){window.$hsTooltipCollection.forEach((({element:t})=>t.el!==this.el&&(!!t.el.classList.contains("show")&&void t.hide())))}init(){this.createCollection(window.$hsTooltipCollection,this),this.onToggleFocusListener=()=>this.enter(),this.onToggleBlurListener=()=>this.hide(),this.toggle.addEventListener("focus",this.onToggleFocusListener),this.toggle.addEventListener("blur",this.onToggleBlurListener),"click"===this.eventMode?(this.onToggleClickListener=()=>this.toggleClick(),this.toggle.addEventListener("click",this.onToggleClickListener)):"hover"===this.eventMode&&(this.onToggleMouseEnterListener=()=>this.toggleMouseEnter(),this.onToggleMouseLeaveListener=()=>this.toggleMouseLeave(),this.toggle.addEventListener("mouseenter",this.onToggleMouseEnterListener),this.toggle.addEventListener("mouseleave",this.onToggleMouseLeaveListener))}enter(){this._show()}leave(){this.hide()}click(){if(this.el.classList.contains("show"))return!1;this._show(),this.onToggleHandleListener=()=>{setTimeout((()=>this.toggleHandle()))},this.toggle.addEventListener("click",this.onToggleHandleListener,!0),this.toggle.addEventListener("blur",this.onToggleHandleListener,!0)}focus(){this._show()}positionTooltip(t){return o(this,void 0,void 0,(function*(){const e="auto"===t?"top":t,n="auto"===t?["bottom","left","right"]:this.getFallbackPlacements(e),o=[(0,r.offset)(5),(0,r.flip)({fallbackPlacements:n})];return yield(0,r.computePosition)(this.toggle,this.content,{placement:e,strategy:this.strategy||"fixed",middleware:o})}))}getFallbackPlacements(t){switch(t){case"top":return["bottom","left","right"];case"bottom":return["top","left","right"];case"left":return["right","top","bottom"];case"right":return["left","top","bottom"];case"top-start":return["bottom-start","top-end","bottom-end"];case"top-end":return["bottom-end","top-start","bottom-start"];case"bottom-start":return["top-start","bottom-end","top-end"];case"bottom-end":return["top-end","bottom-start","top-start"];case"left-start":return["right-start","left-end","right-end"];case"left-end":return["right-end","left-start","right-start"];case"right-start":return["left-start","right-end","left-end"];case"right-end":return["left-end","right-start","left-start"];default:return["top","bottom","left","right"]}}applyTooltipPosition(t,e,n){Object.assign(this.content.style,{position:this.strategy||"fixed",left:`${t}px`,top:`${e}px`}),this.content.setAttribute("data-placement",n)}buildFloatingUI(){"window"===this.scope&&document.body.appendChild(this.content);const t=this.placement.startsWith("auto"),e=(0,s.getClassProperty)(this.el,"--placement"),n=t||(!e||""===e)?"auto":a.POSITIONS[this.placement]||this.placement;this.positionTooltip(n).then((t=>{this.applyTooltipPosition(t.x,t.y,t.placement)})),this.cleanupAutoUpdate=(0,r.autoUpdate)(this.toggle,this.content,(()=>{this.positionTooltip(n).then((t=>{Object.assign(this.content.style,{position:this.strategy||"fixed",left:`${t.x}px`,top:`${t.y}px`}),this.content.setAttribute("data-placement",t.placement)}))}))}_show(){if(this.el.classList.contains("show"))return!1;this.hideOtherTooltips(),this.content.classList.remove("hidden"),"window"===this.scope&&this.content.classList.add("show"),"false"!==this.preventFloatingUI||this.cleanupAutoUpdate||this.buildFloatingUI(),setTimeout((()=>{this.el.classList.add("show"),this.fireEvent("show",this.el),(0,s.dispatch)("show.hs.tooltip",this.el,this.el)}))}show(){"click"===this.eventMode?this.click():this.enter(),this.toggle.focus(),this.toggle.style.outline="none"}hide(){this.el.classList.remove("show"),"window"===this.scope&&this.content.classList.remove("show"),"false"===this.preventFloatingUI&&this.cleanupAutoUpdate&&(this.cleanupAutoUpdate(),this.cleanupAutoUpdate=null),this.fireEvent("hide",this.el),(0,s.dispatch)("hide.hs.tooltip",this.el,this.el),(0,s.afterTransition)(this.content,(()=>{if(this.el.classList.contains("show"))return!1;this.content.classList.add("hidden"),this.toggle.style.outline=""}))}destroy(){this.el.classList.remove("show"),this.content.classList.add("hidden"),this.toggle.removeEventListener("focus",this.onToggleFocusListener),this.toggle.removeEventListener("blur",this.onToggleBlurListener),"click"===this.eventMode?this.toggle.removeEventListener("click",this.onToggleClickListener):"hover"===this.eventMode&&(this.toggle.removeEventListener("mouseenter",this.onToggleMouseEnterListener),this.toggle.removeEventListener("mouseleave",this.onToggleMouseLeaveListener)),this.toggle.removeEventListener("click",this.onToggleHandleListener,!0),this.toggle.removeEventListener("blur",this.onToggleHandleListener,!0),this.cleanupAutoUpdate&&(this.cleanupAutoUpdate(),this.cleanupAutoUpdate=null),window.$hsTooltipCollection=window.$hsTooltipCollection.filter((({element:t})=>t.el!==this.el))}static findInCollection(t){return window.$hsTooltipCollection.find((e=>t instanceof c?e.element.el===t.el:"string"==typeof t?e.element.el===document.querySelector(t):e.element.el===t))||null}static getInstance(t,e=!1){const n=window.$hsTooltipCollection.find((e=>e.element.el===("string"==typeof t?document.querySelector(t):t)));return n?e?n:n.element.el:null}static autoInit(){window.$hsTooltipCollection||(window.$hsTooltipCollection=[]),window.$hsTooltipCollection&&(window.$hsTooltipCollection=window.$hsTooltipCollection.filter((({element:t})=>document.contains(t.el)))),document.querySelectorAll(".hs-tooltip:not(.--prevent-on-load-init)").forEach((t=>{window.$hsTooltipCollection.find((e=>{var n;return(null===(n=null==e?void 0:e.element)||void 0===n?void 0:n.el)===t}))||new c(t)}))}static show(t){const e=c.findInCollection(t);e&&e.element.show()}static hide(t){const e=c.findInCollection(t);e&&e.element.hide()}static on(t,e,n){const o=c.findInCollection(e);o&&(o.element.events[t]=n)}}e.default=c},8223:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BREAKPOINTS=e.COMBO_BOX_ACCESSIBILITY_KEY_SET=e.SELECT_ACCESSIBILITY_KEY_SET=e.TABS_ACCESSIBILITY_KEY_SET=e.OVERLAY_ACCESSIBILITY_KEY_SET=e.DROPDOWN_ACCESSIBILITY_KEY_SET=e.POSITIONS=void 0,e.POSITIONS={auto:"auto","auto-start":"auto-start","auto-end":"auto-end",top:"top","top-left":"top-start","top-right":"top-end",bottom:"bottom","bottom-left":"bottom-start","bottom-right":"bottom-end",right:"right","right-start":"right-start","right-end":"right-end",left:"left","left-start":"left-start","left-end":"left-end"},e.DROPDOWN_ACCESSIBILITY_KEY_SET=["Escape","ArrowUp","ArrowDown","ArrowRight","ArrowLeft","Home","End","Enter"],e.OVERLAY_ACCESSIBILITY_KEY_SET=["Escape","Tab"],e.TABS_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End"],e.SELECT_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End","Escape","Enter","Space","Tab"],e.COMBO_BOX_ACCESSIBILITY_KEY_SET=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End","Escape","Enter"],e.BREAKPOINTS={xs:0,sm:640,md:768,lg:1024,xl:1280,"2xl":1536}}},e={};function n(o){var i=e[o];if(void 0!==i)return i.exports;var r=e[o]={exports:{}};return t[o].call(r.exports,r,r.exports,n),r.exports}return n.d=(t,e)=>{for(var o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n(4986)})()));
24
+ Object.defineProperty(e,"__esModule",{value:!0}),e.stringToBoolean=e.menuSearchHistory=e.isScrollable=e.isParentOrElementHidden=e.isJson=e.isIpadOS=e.isIOS=e.isFormElement=e.isFocused=e.isEnoughSpace=e.isDirectChild=e.htmlToElement=e.getZIndex=e.getHighestZIndex=e.getClassPropertyAlt=e.getClassProperty=e.dispatch=e.debounce=e.classToClassList=e.afterTransition=void 0;e.stringToBoolean=t=>"true"===t;e.getClassProperty=(t,e,n="")=>(window.getComputedStyle(t).getPropertyValue(e)||n).replace(" ","");e.getClassPropertyAlt=(t,e,n="")=>{let o="";return t.classList.forEach(t=>{t.includes(e)&&(o=t)}),o.match(/:(.*)]/)?o.match(/:(.*)]/)[1]:n};const n=t=>window.getComputedStyle(t).getPropertyValue("z-index");e.getZIndex=n;e.getHighestZIndex=t=>{let e=Number.NEGATIVE_INFINITY;return t.forEach(t=>{let o=n(t);"auto"!==o&&(o=parseInt(o,10),o>e&&(e=o))}),e};e.isDirectChild=(t,e)=>{const n=t.children;for(let t=0;t<n.length;t++)if(n[t]===e)return!0;return!1};e.isEnoughSpace=(t,e,n="auto",o=10,i=null)=>{const r=e.getBoundingClientRect(),s=i?i.getBoundingClientRect():null,l=window.innerHeight,a=s?r.top-s.top:r.top,c=(i?s.bottom:l)-r.bottom,u=t.clientHeight+o;return"bottom"===n?c>=u:"top"===n?a>=u:a>=u||c>=u};e.isFocused=t=>document.activeElement===t;e.isFormElement=t=>t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement;e.isIOS=()=>!!/iPad|iPhone|iPod/.test(navigator.platform)||navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform);e.isIpadOS=()=>navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform);e.isJson=t=>{if("string"!=typeof t)return!1;const e=t.trim()[0],n=t.trim().slice(-1);if("{"===e&&"}"===n||"["===e&&"]"===n)try{return JSON.parse(t),!0}catch(t){return!1}return!1};const o=t=>{if(!t)return!1;return"none"===window.getComputedStyle(t).display||o(t.parentElement)};e.isParentOrElementHidden=o;e.isScrollable=t=>{const e=window.getComputedStyle(t),n=e.overflowY,o=e.overflowX,i=("scroll"===n||"auto"===n)&&t.scrollHeight>t.clientHeight,r=("scroll"===o||"auto"===o)&&t.scrollWidth>t.clientWidth;return i||r};e.debounce=(t,e=200)=>{let n;return(...o)=>{clearTimeout(n),n=setTimeout(()=>{t.apply(this,o)},e)}};e.dispatch=(t,e,n=null)=>{const o=new CustomEvent(t,{detail:{payload:n},bubbles:!0,cancelable:!0,composed:!1});e.dispatchEvent(o)};e.afterTransition=(t,e)=>{const n=()=>{e(),t.removeEventListener("transitionend",n,!0)},o=window.getComputedStyle(t),i=o.getPropertyValue("transition-duration");"none"!==o.getPropertyValue("transition-property")&&parseFloat(i)>0?t.addEventListener("transitionend",n,!0):e()};e.htmlToElement=t=>{const e=document.createElement("template");return t=t.trim(),e.innerHTML=t,e.content.firstChild};e.classToClassList=(t,e,n=" ",o="add")=>{t.split(n).forEach(t=>{t.trim()&&("add"===o?e.classList.add(t):e.classList.remove(t))})};const i={historyIndex:-1,addHistory(t){this.historyIndex=t},existsInHistory(t){return t>this.historyIndex},clearHistory(){this.historyIndex=-1}};e.menuSearchHistory=i}},e={};function n(o){var i=e[o];if(void 0!==i)return i.exports;var r=e[o]={exports:{}};return t[o].call(r.exports,r,r.exports,n),r.exports}return n.d=(t,e)=>{for(var o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n(8490)})());