siteguide.js 0.3.0 → 0.4.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 +57 -1
- package/dist/css/siteguide.css +1 -1
- package/dist/index.d.ts +97 -26
- package/dist/index.js +3 -3
- package/dist/index.mjs +544 -529
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1 +1,57 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
# Siteguide.js
|
|
3
|
+
|
|
4
|
+
Siteguide.js is an open source library made with vanilla Javascript and CSS to help you build website guides and onboarding tours.
|
|
5
|
+
|
|
6
|
+
Siteguide empowers you to create personalized tours and interactive guides for users within your application or website. With its simple and minimalistic design, Siteguide offers extensive customization options while remaining user-friendly and intuitive.
|
|
7
|
+
|
|
8
|
+
## Installation
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm install siteguide.js --save
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Quick Start Example
|
|
15
|
+
|
|
16
|
+
The following example is a simple tour with two steps.
|
|
17
|
+
|
|
18
|
+
```javascript
|
|
19
|
+
import { Tour } from 'siteguide.js';
|
|
20
|
+
|
|
21
|
+
const tour = new Tour({
|
|
22
|
+
scrollTo: {
|
|
23
|
+
behavior: 'smooth',
|
|
24
|
+
block: 'center',
|
|
25
|
+
inline: 'center',
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const stepList = [
|
|
30
|
+
{
|
|
31
|
+
id: '1',
|
|
32
|
+
host: '.step-1',
|
|
33
|
+
popup: {
|
|
34
|
+
text: "I'm step 1",
|
|
35
|
+
title: 'Step 1',
|
|
36
|
+
type: 'text',
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
id: '2',
|
|
41
|
+
host: '.step-2',
|
|
42
|
+
popup: {
|
|
43
|
+
title: 'Step 2',
|
|
44
|
+
text: "I'm step 2",
|
|
45
|
+
type: 'text',
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
];
|
|
49
|
+
|
|
50
|
+
tour.addSteps(stepList);
|
|
51
|
+
|
|
52
|
+
tour.start();
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## License
|
|
56
|
+
|
|
57
|
+
Siteguide.js is open source and free to use under the MIT license. See the [LICENSE](LICENSE) file for more information.
|
package/dist/css/siteguide.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--bg:
|
|
1
|
+
:root{--sg-bg: var(--sg-mono-100);--sg-text: var(--sg-mono-900);--sg-line: var(--sg-mono-500);--primary: #2e62d9;--primary-hover: #2ca2fd;--secondary: #2ca2fd;--secondary-hover: #2ca2fd;--sg-mono-900: #101828;--sg-mono-800: #4c525e;--sg-mono-700: #7c8089;--sg-mono-600: #acaeb5;--sg-mono-500: #d5d6d9;--sg-mono-400: #e6e7e8;--sg-mono-300: #f4f4f5;--sg-mono-200: #f9f9fa;--sg-mono-100: #fff;--padding-s: 8px;--padding-m: 12px;--padding-l: 16px;--padding-2l: 20px;--sg-text-m: 16px;--sg-text-l: 18px}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.siteguide{color:var(--sg-text);box-sizing:border-box;font-family:Inter,sans-serif;font-size:var(--sg-text-m);width:280px;min-height:150px;background-color:var(--sg-bg);border-radius:8px;border:1px solid var(--sg-line);display:flex;flex-direction:column;position:absolute;box-shadow:0 10px 10px #0001;z-index:1000001;max-height:400px}.siteguide-animation{animation:fadeIn .3s ease-out}.siteguide-highlight{box-shadow:0 0 #212121cc,0 0 0 5000px #21212180;border:2px solid var(--sg-mono-900);border-radius:4px;opacity:1;z-index:1000000;position:absolute;transition:all .3s ease-out;pointer-events:none}.siteguide-header{display:flex;align-items:center;width:100%;padding:var(--padding-m) var(--padding-2l) 0}.siteguide-content{width:100%;padding:var(--padding-m) var(--padding-2l);overflow-y:auto}.siteguide-content::-webkit-scrollbar{width:4px}.siteguide-content::-webkit-scrollbar-thumb{background-color:var(--primary);border-radius:4px}.siteguide-title{display:block;font-size:var(--sg-text-l);font-weight:800;color:var(--sg-text)}.siteguide-image{width:100%;height:auto;border-radius:4px;object-fit:cover;margin-bottom:var(--padding-m)}.siteguide-description{font-size:14px;font-weight:400;color:var(--sg-text)}.siteguide-footer{width:100%;display:flex;align-items:center;justify-content:space-between;padding:var(--padding-m);border-top:1px solid var(--sg-line);gap:var(--padding-l);margin-top:auto}.siteguide-button{padding:var(--padding-s) var(--padding-l);border-radius:4px;cursor:pointer;font-size:14px;line-height:20px;transition:background-color .3s ease-out;color:var(--sg-mono-100)}.siteguide-button-secondary{background-color:var(--secondary)}.siteguide-button-secondary:hover{background-color:var(--secondary-hover)}.siteguide-button-primary{background-color:var(--primary)}.siteguide-button-primary:hover{background-color:var(--primary-hover)}.siteguide-button-link{color:var(--primary);background-color:transparent;cursor:pointer;transition:color .3s ease-out}.siteguide-button-link:hover{color:var(--primary-hover)}.siteguide-close{width:20px;height:20px;display:flex;align-items:center;justify-content:center;background-color:transparent;border-radius:4px;cursor:pointer;position:absolute;top:10px;right:10px;transition:background-color .3s ease-out}.siteguide-close:hover{background-color:var(--secondary-hover);color:#fff}.siteguide-close-icon{height:10px}
|
package/dist/index.d.ts
CHANGED
|
@@ -11,6 +11,9 @@ export declare function createElement<T extends keyof HTMLElementTagNameMap>(tag
|
|
|
11
11
|
* Represents the data for a custom popup
|
|
12
12
|
*/
|
|
13
13
|
export declare type CustomPopupData = SharedPopupData & {
|
|
14
|
+
/**
|
|
15
|
+
* The type of the popup
|
|
16
|
+
*/
|
|
14
17
|
type: Extract<PopupType, 'custom'>;
|
|
15
18
|
/**
|
|
16
19
|
* The HTML element to use as the content of the custom popup
|
|
@@ -22,6 +25,9 @@ export declare type CustomPopupData = SharedPopupData & {
|
|
|
22
25
|
* Represents the data for a custom popup
|
|
23
26
|
*/
|
|
24
27
|
declare type CustomPopupData_2 = SharedPopupData_2 & {
|
|
28
|
+
/**
|
|
29
|
+
* The type of the popup
|
|
30
|
+
*/
|
|
25
31
|
type: Extract<PopupType_2, 'custom'>;
|
|
26
32
|
/**
|
|
27
33
|
* The HTML element to use as the content of the custom popup
|
|
@@ -92,9 +98,9 @@ declare interface ITour {
|
|
|
92
98
|
get stepList(): readonly ITourStep[];
|
|
93
99
|
get config(): RequiredTourConfig;
|
|
94
100
|
get popup(): HTMLElement | null;
|
|
95
|
-
get
|
|
101
|
+
get highlight(): HTMLElement | null;
|
|
96
102
|
get popupRenderer(): IRenderer;
|
|
97
|
-
get
|
|
103
|
+
get highlightRenderer(): IRenderer;
|
|
98
104
|
addStep(config: TourStepConfig_2): void;
|
|
99
105
|
addSteps(steps: TourStepConfig_2[]): void;
|
|
100
106
|
removeStep(stepId: StepId): void;
|
|
@@ -112,9 +118,9 @@ declare interface ITour_2 {
|
|
|
112
118
|
get stepList(): readonly ITourStep_2[];
|
|
113
119
|
get config(): RequiredTourConfig_2;
|
|
114
120
|
get popup(): HTMLElement | null;
|
|
115
|
-
get
|
|
121
|
+
get highlight(): HTMLElement | null;
|
|
116
122
|
get popupRenderer(): IRenderer;
|
|
117
|
-
get
|
|
123
|
+
get highlightRenderer(): IRenderer;
|
|
118
124
|
addStep(config: TourStepConfig): void;
|
|
119
125
|
addSteps(steps: TourStepConfig[]): void;
|
|
120
126
|
removeStep(stepId: StepId_2): void;
|
|
@@ -129,15 +135,17 @@ declare interface ITour_2 {
|
|
|
129
135
|
* Made for resolving circular dependencies
|
|
130
136
|
*/
|
|
131
137
|
declare interface ITourStep {
|
|
132
|
-
|
|
133
|
-
readonly popupData: PopupData_2;
|
|
134
|
-
readonly tour: ITour;
|
|
138
|
+
get direction(): StepDirection;
|
|
135
139
|
get isFirst(): boolean;
|
|
136
140
|
get nextStep(): ITourStep | null;
|
|
137
141
|
get prevStep(): ITourStep | null;
|
|
138
142
|
get hasHost(): boolean;
|
|
139
143
|
get hostElement(): HTMLElement | null;
|
|
140
|
-
|
|
144
|
+
readonly id: StepId;
|
|
145
|
+
readonly popupData: PopupData_2;
|
|
146
|
+
readonly tour: ITour;
|
|
147
|
+
readonly index: number | null;
|
|
148
|
+
show(direction: StepDirection): Promise<void>;
|
|
141
149
|
}
|
|
142
150
|
|
|
143
151
|
/**
|
|
@@ -145,15 +153,17 @@ declare interface ITourStep {
|
|
|
145
153
|
* Made for resolving circular dependencies
|
|
146
154
|
*/
|
|
147
155
|
declare interface ITourStep_2 {
|
|
148
|
-
|
|
149
|
-
readonly popupData: PopupData_2;
|
|
150
|
-
readonly tour: ITour_2;
|
|
156
|
+
get direction(): StepDirection_2;
|
|
151
157
|
get isFirst(): boolean;
|
|
152
158
|
get nextStep(): ITourStep_2 | null;
|
|
153
159
|
get prevStep(): ITourStep_2 | null;
|
|
154
160
|
get hasHost(): boolean;
|
|
155
161
|
get hostElement(): HTMLElement | null;
|
|
156
|
-
|
|
162
|
+
readonly id: StepId_2;
|
|
163
|
+
readonly popupData: PopupData_2;
|
|
164
|
+
readonly tour: ITour_2;
|
|
165
|
+
readonly index: number | null;
|
|
166
|
+
show(direction: StepDirection_2): Promise<void>;
|
|
157
167
|
}
|
|
158
168
|
|
|
159
169
|
export declare type PopupCloseIconElement = InnerHTML | HTMLElement;
|
|
@@ -261,7 +271,7 @@ declare type PopupData_2 = TextPopupData_2 | CustomPopupData_2;
|
|
|
261
271
|
* // Example 4: Function returning string as host
|
|
262
272
|
* { host: () => '.example-element' };
|
|
263
273
|
*/
|
|
264
|
-
export declare type PopupHost = string |
|
|
274
|
+
export declare type PopupHost = string | Element | (() => Element | string);
|
|
265
275
|
|
|
266
276
|
/**
|
|
267
277
|
* Represents the host of a tour step. It can be a string, an HTMLElement, or a function that returns either an HTMLElement or a string.
|
|
@@ -278,7 +288,7 @@ export declare type PopupHost = string | HTMLElement | (() => HTMLElement | stri
|
|
|
278
288
|
* // Example 4: Function returning string as host
|
|
279
289
|
* { host: () => '.example-element' };
|
|
280
290
|
*/
|
|
281
|
-
declare type PopupHost_2 = string |
|
|
291
|
+
declare type PopupHost_2 = string | Element | (() => Element | string);
|
|
282
292
|
|
|
283
293
|
/**
|
|
284
294
|
* The position of a popup
|
|
@@ -375,6 +385,10 @@ declare type SharedPopupData_2 = {
|
|
|
375
385
|
buttonList?: TourButtonConfig_2[];
|
|
376
386
|
};
|
|
377
387
|
|
|
388
|
+
declare type StepDirection = 'toNext' | 'fromBack';
|
|
389
|
+
|
|
390
|
+
declare type StepDirection_2 = 'toNext' | 'fromBack';
|
|
391
|
+
|
|
378
392
|
declare type StepId = string;
|
|
379
393
|
|
|
380
394
|
declare type StepId_2 = string;
|
|
@@ -383,6 +397,9 @@ declare type StepId_2 = string;
|
|
|
383
397
|
* Represents the data for a text popup
|
|
384
398
|
*/
|
|
385
399
|
export declare type TextPopupData = SharedPopupData & {
|
|
400
|
+
/**
|
|
401
|
+
* The type of the popup
|
|
402
|
+
*/
|
|
386
403
|
type: Extract<PopupType, 'text'>;
|
|
387
404
|
/**
|
|
388
405
|
* The text to display in the popup
|
|
@@ -398,6 +415,9 @@ export declare type TextPopupData = SharedPopupData & {
|
|
|
398
415
|
* Represents the data for a text popup
|
|
399
416
|
*/
|
|
400
417
|
declare type TextPopupData_2 = SharedPopupData_2 & {
|
|
418
|
+
/**
|
|
419
|
+
* The type of the popup
|
|
420
|
+
*/
|
|
401
421
|
type: Extract<PopupType_2, 'text'>;
|
|
402
422
|
/**
|
|
403
423
|
* The text to display in the popup
|
|
@@ -413,20 +433,20 @@ export declare class Tour implements ITour {
|
|
|
413
433
|
get stepList(): readonly ITourStep[];
|
|
414
434
|
get config(): RequiredTourConfig_2;
|
|
415
435
|
get popup(): HTMLElement | null;
|
|
416
|
-
get
|
|
436
|
+
get highlight(): HTMLElement | null;
|
|
417
437
|
readonly popupRenderer: IRenderer_2;
|
|
418
|
-
readonly
|
|
438
|
+
readonly highlightRenderer: IRenderer_2;
|
|
419
439
|
/**
|
|
420
440
|
* TODO remove
|
|
421
441
|
* @deprecated remove later
|
|
422
442
|
*/
|
|
423
443
|
isStarted: boolean;
|
|
424
444
|
private _popup;
|
|
425
|
-
private
|
|
445
|
+
private _highlight;
|
|
426
446
|
private _stepList;
|
|
427
447
|
private _activeStep;
|
|
428
448
|
private _bodyResizeObserver;
|
|
429
|
-
private
|
|
449
|
+
private _config;
|
|
430
450
|
private readonly _stepMap;
|
|
431
451
|
constructor(config: TourConfig);
|
|
432
452
|
addStep(config: TourStepConfig): void;
|
|
@@ -436,6 +456,7 @@ export declare class Tour implements ITour {
|
|
|
436
456
|
complete(): void;
|
|
437
457
|
prev(): void;
|
|
438
458
|
next(): void;
|
|
459
|
+
setConfig(config: TourConfig): void;
|
|
439
460
|
private getBodyResizeObserver;
|
|
440
461
|
}
|
|
441
462
|
|
|
@@ -488,12 +509,12 @@ declare type TourButtonConfig_2 = {
|
|
|
488
509
|
/**
|
|
489
510
|
* Type of a button
|
|
490
511
|
*/
|
|
491
|
-
export declare type TourButtonType = 'primary' | 'secondary';
|
|
512
|
+
export declare type TourButtonType = 'primary' | 'secondary' | 'link';
|
|
492
513
|
|
|
493
514
|
/**
|
|
494
515
|
* Type of a button
|
|
495
516
|
*/
|
|
496
|
-
declare type TourButtonType_2 = 'primary' | 'secondary';
|
|
517
|
+
declare type TourButtonType_2 = 'primary' | 'secondary' | 'link';
|
|
497
518
|
|
|
498
519
|
/**
|
|
499
520
|
* Represents the configuration for a tour.
|
|
@@ -511,6 +532,11 @@ export declare type TourConfig = {
|
|
|
511
532
|
* @default true
|
|
512
533
|
*/
|
|
513
534
|
allowClose?: boolean;
|
|
535
|
+
/**
|
|
536
|
+
* Indicates if the tour popup can be closed by clicking outside the popup
|
|
537
|
+
* @default true
|
|
538
|
+
*/
|
|
539
|
+
allowClickoutClose?: boolean;
|
|
514
540
|
/**
|
|
515
541
|
* Specifies if the tour should scroll to the current step and how to scroll
|
|
516
542
|
* Can be a boolean to enable or disable scrolling, or an object with options for scrollIntoView
|
|
@@ -524,7 +550,12 @@ export declare type TourConfig = {
|
|
|
524
550
|
/**
|
|
525
551
|
* Configuration for the helper layout.
|
|
526
552
|
*/
|
|
527
|
-
|
|
553
|
+
highlight?: {
|
|
554
|
+
/**
|
|
555
|
+
* Indicates if the helper layout should be disabled
|
|
556
|
+
* @default false
|
|
557
|
+
*/
|
|
558
|
+
disable?: boolean;
|
|
528
559
|
/**
|
|
529
560
|
* The horizontal padding for the helper layout.
|
|
530
561
|
* @default 8
|
|
@@ -535,7 +566,16 @@ export declare type TourConfig = {
|
|
|
535
566
|
* @default 8
|
|
536
567
|
*/
|
|
537
568
|
paddingY?: number;
|
|
569
|
+
/**
|
|
570
|
+
* The class to apply to the highlight
|
|
571
|
+
*/
|
|
572
|
+
class?: string;
|
|
538
573
|
};
|
|
574
|
+
/**
|
|
575
|
+
* The class to apply to the tour popup animation
|
|
576
|
+
* @default 'siteguide-animation'
|
|
577
|
+
*/
|
|
578
|
+
animationClass?: string;
|
|
539
579
|
};
|
|
540
580
|
|
|
541
581
|
/**
|
|
@@ -554,6 +594,11 @@ declare type TourConfig_2 = {
|
|
|
554
594
|
* @default true
|
|
555
595
|
*/
|
|
556
596
|
allowClose?: boolean;
|
|
597
|
+
/**
|
|
598
|
+
* Indicates if the tour popup can be closed by clicking outside the popup
|
|
599
|
+
* @default true
|
|
600
|
+
*/
|
|
601
|
+
allowClickoutClose?: boolean;
|
|
557
602
|
/**
|
|
558
603
|
* Specifies if the tour should scroll to the current step and how to scroll
|
|
559
604
|
* Can be a boolean to enable or disable scrolling, or an object with options for scrollIntoView
|
|
@@ -567,7 +612,12 @@ declare type TourConfig_2 = {
|
|
|
567
612
|
/**
|
|
568
613
|
* Configuration for the helper layout.
|
|
569
614
|
*/
|
|
570
|
-
|
|
615
|
+
highlight?: {
|
|
616
|
+
/**
|
|
617
|
+
* Indicates if the helper layout should be disabled
|
|
618
|
+
* @default false
|
|
619
|
+
*/
|
|
620
|
+
disable?: boolean;
|
|
571
621
|
/**
|
|
572
622
|
* The horizontal padding for the helper layout.
|
|
573
623
|
* @default 8
|
|
@@ -578,24 +628,37 @@ declare type TourConfig_2 = {
|
|
|
578
628
|
* @default 8
|
|
579
629
|
*/
|
|
580
630
|
paddingY?: number;
|
|
631
|
+
/**
|
|
632
|
+
* The class to apply to the highlight
|
|
633
|
+
*/
|
|
634
|
+
class?: string;
|
|
581
635
|
};
|
|
636
|
+
|
|
637
|
+
/**
|
|
638
|
+
* The class to apply to the tour popup animation
|
|
639
|
+
* @default 'siteguide-animation'
|
|
640
|
+
*/
|
|
641
|
+
animationClass?: string;
|
|
582
642
|
};
|
|
583
643
|
|
|
584
644
|
export declare class TourStep implements ITourStep_2 {
|
|
585
645
|
get isFirst(): boolean;
|
|
586
646
|
get nextStep(): ITourStep_2 | null;
|
|
587
647
|
get prevStep(): ITourStep_2 | null;
|
|
648
|
+
get direction(): StepDirection_2;
|
|
588
649
|
get hasHost(): boolean;
|
|
589
650
|
get hostElement(): HTMLElement | null;
|
|
590
651
|
readonly id: StepId_2;
|
|
591
652
|
readonly popupData: PopupData;
|
|
592
|
-
readonly tour:
|
|
653
|
+
readonly tour: ITour_2;
|
|
654
|
+
readonly index: number | null;
|
|
593
655
|
private _hostElement;
|
|
656
|
+
private _direction;
|
|
594
657
|
private readonly _hostData;
|
|
595
658
|
private readonly _popupRenderer;
|
|
596
|
-
private readonly
|
|
597
|
-
constructor(tour:
|
|
598
|
-
show(): Promise<void>;
|
|
659
|
+
private readonly _highlightRenderer;
|
|
660
|
+
constructor(tour: ITour_2, config: TourStepConfig);
|
|
661
|
+
show(direction: StepDirection_2): Promise<void>;
|
|
599
662
|
private resolveHostElement;
|
|
600
663
|
}
|
|
601
664
|
|
|
@@ -607,6 +670,10 @@ export declare type TourStepConfig = {
|
|
|
607
670
|
* The unique identifier for the tour step.
|
|
608
671
|
*/
|
|
609
672
|
id: StepId_2;
|
|
673
|
+
/**
|
|
674
|
+
* The index of the step in the tour
|
|
675
|
+
*/
|
|
676
|
+
index?: number;
|
|
610
677
|
/**
|
|
611
678
|
* The host element or a function that returns the host element for the tour step
|
|
612
679
|
*/
|
|
@@ -625,6 +692,10 @@ declare type TourStepConfig_2 = {
|
|
|
625
692
|
* The unique identifier for the tour step.
|
|
626
693
|
*/
|
|
627
694
|
id: StepId;
|
|
695
|
+
/**
|
|
696
|
+
* The index of the step in the tour
|
|
697
|
+
*/
|
|
698
|
+
index?: number;
|
|
628
699
|
/**
|
|
629
700
|
* The host element or a function that returns the host element for the tour step
|
|
630
701
|
*/
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";var Nt=Object.defineProperty,Vt=Object.defineProperties;var Ft=Object.getOwnPropertyDescriptors;var U=Object.getOwnPropertySymbols;var dt=Object.prototype.hasOwnProperty,ht=Object.prototype.propertyIsEnumerable;var Z=(t,e,n)=>e in t?Nt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,O=(t,e)=>{for(var n in e||(e={}))dt.call(e,n)&&Z(t,n,e[n]);if(U)for(var n of U(e))ht.call(e,n)&&Z(t,n,e[n]);return t},z=(t,e)=>Vt(t,Ft(e));var pt=(t,e)=>{var n={};for(var i in t)dt.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(t!=null&&U)for(var i of U(t))e.indexOf(i)<0&&ht.call(t,i)&&(n[i]=t[i]);return n};var w=(t,e,n)=>Z(t,typeof e!="symbol"?e+"":e,n);var A=(t,e,n)=>new Promise((i,o)=>{var r=a=>{try{l(n.next(a))}catch(c){o(c)}},s=a=>{try{l(n.throw(a))}catch(c){o(c)}},l=a=>a.done?i(a.value):Promise.resolve(a.value).then(r,s);l((n=n.apply(t,e)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Wt=["top","right","bottom","left"],mt=["start","end"],gt=Wt.reduce((t,e)=>t.concat(e,e+"-"+mt[0],e+"-"+mt[1]),[]),yt=Math.min,I=Math.max,q=Math.round,E=t=>({x:t,y:t}),zt={left:"right",right:"left",bottom:"top",top:"bottom"},It={start:"end",end:"start"};function it(t,e){return typeof t=="function"?t(e):t}function j(t){return t.split("-")[0]}function D(t){return t.split("-")[1]}function Yt(t){return t==="x"?"y":"x"}function bt(t){return t==="y"?"height":"width"}function ot(t){return["top","bottom"].includes(j(t))?"y":"x"}function Ct(t){return Yt(ot(t))}function jt(t,e,n){n===void 0&&(n=!1);const i=D(t),o=Ct(t),r=bt(o);let s=o==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(s=wt(s)),[s,wt(s)]}function Xt(t){return t.replace(/start|end/g,e=>It[e])}function wt(t){return t.replace(/left|right|bottom|top/g,e=>zt[e])}function Ut(t){return O({top:0,right:0,bottom:0,left:0},t)}function qt(t){return typeof t!="number"?Ut(t):{top:t,right:t,bottom:t,left:t}}function K(t){const{x:e,y:n,width:i,height:o}=t;return{width:i,height:o,top:n,left:e,right:e+i,bottom:n+o,x:e,y:n}}function xt(t,e,n){let{reference:i,floating:o}=t;const r=ot(e),s=Ct(e),l=bt(s),a=j(e),c=r==="y",f=i.x+i.width/2-o.width/2,u=i.y+i.height/2-o.height/2,p=i[l]/2-o[l]/2;let d;switch(a){case"top":d={x:f,y:i.y-o.height};break;case"bottom":d={x:f,y:i.y+i.height};break;case"right":d={x:i.x+i.width,y:u};break;case"left":d={x:i.x-o.width,y:u};break;default:d={x:i.x,y:i.y}}switch(D(e)){case"start":d[s]-=p*(n&&c?-1:1);break;case"end":d[s]+=p*(n&&c?-1:1);break}return d}const Kt=(t,e,n)=>A(exports,null,function*(){const{placement:i="bottom",strategy:o="absolute",middleware:r=[],platform:s}=n,l=r.filter(Boolean),a=yield s.isRTL==null?void 0:s.isRTL(e);let c=yield s.getElementRects({reference:t,floating:e,strategy:o}),{x:f,y:u}=xt(c,i,a),p=i,d={},m=0;for(let y=0;y<l.length;y++){const{name:g,fn:v}=l[y],{x:_,y:h,data:L,reset:x}=yield v({x:f,y:u,initialPlacement:i,placement:p,strategy:o,middlewareData:d,rects:c,platform:s,elements:{reference:t,floating:e}});f=_!=null?_:f,u=h!=null?h:u,d=z(O({},d),{[g]:O(O({},d[g]),L)}),x&&m<=50&&(m++,typeof x=="object"&&(x.placement&&(p=x.placement),x.rects&&(c=x.rects===!0?yield s.getElementRects({reference:t,floating:e,strategy:o}):x.rects),{x:f,y:u}=xt(c,p,a)),y=-1)}return{x:f,y:u,placement:p,strategy:o,middlewareData:d}});function Gt(t,e){return A(this,null,function*(){var n;e===void 0&&(e={});const{x:i,y:o,platform:r,rects:s,elements:l,strategy:a}=t,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:u="floating",altBoundary:p=!1,padding:d=0}=it(e,t),m=qt(d),g=l[p?u==="floating"?"reference":"floating":u],v=K(yield r.getClippingRect({element:(n=yield r.isElement==null?void 0:r.isElement(g))==null||n?g:g.contextElement||(yield r.getDocumentElement==null?void 0:r.getDocumentElement(l.floating)),boundary:c,rootBoundary:f,strategy:a})),_=u==="floating"?{x:i,y:o,width:s.floating.width,height:s.floating.height}:s.reference,h=yield r.getOffsetParent==null?void 0:r.getOffsetParent(l.floating),L=(yield r.isElement==null?void 0:r.isElement(h))?(yield r.getScale==null?void 0:r.getScale(h))||{x:1,y:1}:{x:1,y:1},x=K(r.convertOffsetParentRelativeRectToViewportRelativeRect?yield r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:_,offsetParent:h,strategy:a}):_);return{top:(v.top-x.top+m.top)/L.y,bottom:(x.bottom-v.bottom+m.bottom)/L.y,left:(v.left-x.left+m.left)/L.x,right:(x.right-v.right+m.right)/L.x}})}function Jt(t,e,n){return(t?[...n.filter(o=>D(o)===t),...n.filter(o=>D(o)!==t)]:n.filter(o=>j(o)===o)).filter(o=>t?D(o)===t||(e?Xt(o)!==o:!1):!0)}const Qt=function(t){return t===void 0&&(t={}),{name:"autoPlacement",options:t,fn(n){return A(this,null,function*(){var i,o,r;const{rects:s,middlewareData:l,placement:a,platform:c,elements:f}=n,ut=it(t,n),{crossAxis:u=!1,alignment:p,allowedPlacements:d=gt,autoAlignment:m=!0}=ut,y=pt(ut,["crossAxis","alignment","allowedPlacements","autoAlignment"]),g=p!==void 0||d===gt?Jt(p||null,m,d):d,v=yield Gt(n,y),_=((i=l.autoPlacement)==null?void 0:i.index)||0,h=g[_];if(h==null)return{};const L=jt(h,s,yield c.isRTL==null?void 0:c.isRTL(f.floating));if(a!==h)return{reset:{placement:g[0]}};const x=[v[j(h)],v[L[0]],v[L[1]]],k=[...((o=l.autoPlacement)==null?void 0:o.overflows)||[],{placement:h,overflows:x}],ct=g[_+1];if(ct)return{data:{index:_+1,overflows:k},reset:{placement:ct}};const at=k.map(R=>{const W=D(R.placement);return[R.placement,W&&u?R.overflows.slice(0,2).reduce((kt,Bt)=>kt+Bt,0):R.overflows[0],R.overflows]}).sort((R,W)=>R[1]-W[1]),ft=((r=at.filter(R=>R[2].slice(0,D(R[0])?2:3).every(W=>W<=0))[0])==null?void 0:r[0])||at[0][0];return ft!==a?{data:{index:_+1,overflows:k},reset:{placement:ft}}:{}})}}};function Zt(t,e){return A(this,null,function*(){const{placement:n,platform:i,elements:o}=t,r=yield i.isRTL==null?void 0:i.isRTL(o.floating),s=j(n),l=D(n),a=ot(n)==="y",c=["left","top"].includes(s)?-1:1,f=r&&a?-1:1,u=it(e,t);let{mainAxis:p,crossAxis:d,alignmentAxis:m}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return l&&typeof m=="number"&&(d=l==="end"?m*-1:m),a?{x:d*f,y:p*c}:{x:p*c,y:d*f}})}const te=function(t){return t===void 0&&(t=0),{name:"offset",options:t,fn(n){return A(this,null,function*(){var i,o;const{x:r,y:s,placement:l,middlewareData:a}=n,c=yield Zt(n,t);return l===((i=a.offset)==null?void 0:i.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:r+c.x,y:s+c.y,data:z(O({},c),{placement:l})}})}}};function G(){return typeof window!="undefined"}function F(t){return St(t)?(t.nodeName||"").toLowerCase():"#document"}function b(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function $(t){var e;return(e=(St(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function St(t){return G()?t instanceof Node||t instanceof b(t).Node:!1}function S(t){return G()?t instanceof Element||t instanceof b(t).Element:!1}function P(t){return G()?t instanceof HTMLElement||t instanceof b(t).HTMLElement:!1}function vt(t){return!G()||typeof ShadowRoot=="undefined"?!1:t instanceof ShadowRoot||t instanceof b(t).ShadowRoot}function X(t){const{overflow:e,overflowX:n,overflowY:i,display:o}=T(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&!["inline","contents"].includes(o)}function ee(t){return["table","td","th"].includes(F(t))}function J(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch(n){return!1}})}function st(t){const e=rt(),n=S(t)?T(t):t;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(i=>(n.willChange||"").includes(i))||["paint","layout","strict","content"].some(i=>(n.contain||"").includes(i))}function ne(t){let e=M(t);for(;P(e)&&!V(e);){if(st(e))return e;if(J(e))return null;e=M(e)}return null}function rt(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function V(t){return["html","body","#document"].includes(F(t))}function T(t){return b(t).getComputedStyle(t)}function Q(t){return S(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function M(t){if(F(t)==="html")return t;const e=t.assignedSlot||t.parentNode||vt(t)&&t.host||$(t);return vt(e)?e.host:e}function Tt(t){const e=M(t);return V(e)?t.ownerDocument?t.ownerDocument.body:t.body:P(e)&&X(e)?e:Tt(e)}function et(t,e,n){var i;e===void 0&&(e=[]),n===void 0&&(n=!0);const o=Tt(t),r=o===((i=t.ownerDocument)==null?void 0:i.body),s=b(o);if(r){const l=nt(s);return e.concat(s,s.visualViewport||[],X(o)?o:[],l&&n?et(l):[])}return e.concat(o,et(o,[],n))}function nt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Rt(t){const e=T(t);let n=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const o=P(t),r=o?t.offsetWidth:n,s=o?t.offsetHeight:i,l=q(n)!==r||q(i)!==s;return l&&(n=r,i=s),{width:n,height:i,$:l}}function Et(t){return S(t)?t:t.contextElement}function N(t){const e=Et(t);if(!P(e))return E(1);const n=e.getBoundingClientRect(),{width:i,height:o,$:r}=Rt(e);let s=(r?q(n.width):n.width)/i,l=(r?q(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const ie=E(0);function Pt(t){const e=b(t);return!rt()||!e.visualViewport?ie:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function oe(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==b(t)?!1:e}function Y(t,e,n,i){e===void 0&&(e=!1),n===void 0&&(n=!1);const o=t.getBoundingClientRect(),r=Et(t);let s=E(1);e&&(i?S(i)&&(s=N(i)):s=N(t));const l=oe(r,n,i)?Pt(r):E(0);let a=(o.left+l.x)/s.x,c=(o.top+l.y)/s.y,f=o.width/s.x,u=o.height/s.y;if(r){const p=b(r),d=i&&S(i)?b(i):i;let m=p,y=nt(m);for(;y&&i&&d!==m;){const g=N(y),v=y.getBoundingClientRect(),_=T(y),h=v.left+(y.clientLeft+parseFloat(_.paddingLeft))*g.x,L=v.top+(y.clientTop+parseFloat(_.paddingTop))*g.y;a*=g.x,c*=g.y,f*=g.x,u*=g.y,a+=h,c+=L,m=b(y),y=nt(m)}}return K({width:f,height:u,x:a,y:c})}function lt(t,e){const n=Q(t).scrollLeft;return e?e.left+n:Y($(t)).left+n}function Ot(t,e,n){n===void 0&&(n=!1);const i=t.getBoundingClientRect(),o=i.left+e.scrollLeft-(n?0:lt(t,i)),r=i.top+e.scrollTop;return{x:o,y:r}}function se(t){let{elements:e,rect:n,offsetParent:i,strategy:o}=t;const r=o==="fixed",s=$(i),l=e?J(e.floating):!1;if(i===s||l&&r)return n;let a={scrollLeft:0,scrollTop:0},c=E(1);const f=E(0),u=P(i);if((u||!u&&!r)&&((F(i)!=="body"||X(s))&&(a=Q(i)),P(i))){const d=Y(i);c=N(i),f.x=d.x+i.clientLeft,f.y=d.y+i.clientTop}const p=s&&!u&&!r?Ot(s,a,!0):E(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-a.scrollLeft*c.x+f.x+p.x,y:n.y*c.y-a.scrollTop*c.y+f.y+p.y}}function re(t){return Array.from(t.getClientRects())}function le(t){const e=$(t),n=Q(t),i=t.ownerDocument.body,o=I(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),r=I(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let s=-n.scrollLeft+lt(t);const l=-n.scrollTop;return T(i).direction==="rtl"&&(s+=I(e.clientWidth,i.clientWidth)-o),{width:o,height:r,x:s,y:l}}function ce(t,e){const n=b(t),i=$(t),o=n.visualViewport;let r=i.clientWidth,s=i.clientHeight,l=0,a=0;if(o){r=o.width,s=o.height;const c=rt();(!c||c&&e==="fixed")&&(l=o.offsetLeft,a=o.offsetTop)}return{width:r,height:s,x:l,y:a}}function ae(t,e){const n=Y(t,!0,e==="fixed"),i=n.top+t.clientTop,o=n.left+t.clientLeft,r=P(t)?N(t):E(1),s=t.clientWidth*r.x,l=t.clientHeight*r.y,a=o*r.x,c=i*r.y;return{width:s,height:l,x:a,y:c}}function _t(t,e,n){let i;if(e==="viewport")i=ce(t,n);else if(e==="document")i=le($(t));else if(S(e))i=ae(e,n);else{const o=Pt(t);i={x:e.x-o.x,y:e.y-o.y,width:e.width,height:e.height}}return K(i)}function $t(t,e){const n=M(t);return n===e||!S(n)||V(n)?!1:T(n).position==="fixed"||$t(n,e)}function fe(t,e){const n=e.get(t);if(n)return n;let i=et(t,[],!1).filter(l=>S(l)&&F(l)!=="body"),o=null;const r=T(t).position==="fixed";let s=r?M(t):t;for(;S(s)&&!V(s);){const l=T(s),a=st(s);!a&&l.position==="fixed"&&(o=null),(r?!a&&!o:!a&&l.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||X(s)&&!a&&$t(t,s))?i=i.filter(f=>f!==s):o=l,s=M(s)}return e.set(t,i),i}function ue(t){let{element:e,boundary:n,rootBoundary:i,strategy:o}=t;const s=[...n==="clippingAncestors"?J(e)?[]:fe(e,this._c):[].concat(n),i],l=s[0],a=s.reduce((c,f)=>{const u=_t(e,f,o);return c.top=I(u.top,c.top),c.right=yt(u.right,c.right),c.bottom=yt(u.bottom,c.bottom),c.left=I(u.left,c.left),c},_t(e,l,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function de(t){const{width:e,height:n}=Rt(t);return{width:e,height:n}}function he(t,e,n){const i=P(e),o=$(e),r=n==="fixed",s=Y(t,!0,r,e);let l={scrollLeft:0,scrollTop:0};const a=E(0);if(i||!i&&!r)if((F(e)!=="body"||X(o))&&(l=Q(e)),i){const p=Y(e,!0,r,e);a.x=p.x+e.clientLeft,a.y=p.y+e.clientTop}else o&&(a.x=lt(o));const c=o&&!i&&!r?Ot(o,l):E(0),f=s.left+l.scrollLeft-a.x-c.x,u=s.top+l.scrollTop-a.y-c.y;return{x:f,y:u,width:s.width,height:s.height}}function tt(t){return T(t).position==="static"}function Lt(t,e){if(!P(t)||T(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return $(t)===n&&(n=n.ownerDocument.body),n}function At(t,e){const n=b(t);if(J(t))return n;if(!P(t)){let o=M(t);for(;o&&!V(o);){if(S(o)&&!tt(o))return o;o=M(o)}return n}let i=Lt(t,e);for(;i&&ee(i)&&tt(i);)i=Lt(i,e);return i&&V(i)&&tt(i)&&!st(i)?n:i||ne(t)||n}const pe=function(t){return A(this,null,function*(){const e=this.getOffsetParent||At,n=this.getDimensions,i=yield n(t.floating);return{reference:he(t.reference,yield e(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}})};function me(t){return T(t).direction==="rtl"}const ge={convertOffsetParentRelativeRectToViewportRelativeRect:se,getDocumentElement:$,getClippingRect:ue,getOffsetParent:At,getElementRects:pe,getClientRects:re,getDimensions:de,getScale:N,isElement:S,isRTL:me},ye=te,we=Qt,xe=(t,e,n)=>{const i=new Map,o=O({platform:ge},n),r=z(O({},o.platform),{_c:i});return Kt(t,e,z(O({},o),{platform:r}))};function H(t){return t===null||typeof t=="undefined"}function B(t){return!H(t)}function ve(t){return new Promise(e=>setTimeout(e,t))}function Dt(t){var i;const e=t.parentElement;return!e||e.nodeName==="HTML"?!1:((i=document.defaultView)==null?void 0:i.getComputedStyle(t,null).getPropertyValue("position"))==="fixed"?!0:Dt(e)}function Mt(t){return Dt(t)?"fixed":"absolute"}class _e{renderContent(e,n,i){e.querySelector(`.${i.classPrefix}-content`).appendChild(n.node)}}function C(t,e){const n=document.createElement(t);return e&&e.length>0&&(e=e.filter(i=>i),n.classList.add(...e)),n}class Le{renderContent(e,n,i){var r,s,l,a;const o=e.querySelector(`.${i.classPrefix}-content`);if(n.imgSrc){const c=C("img",[`${i.classPrefix}-image`,`${(s=(r=n.customization)==null?void 0:r.imageClass)!=null?s:""}`]);c.src=n.imgSrc,o.appendChild(c)}if(n.text){const c=C("p",[`${i.classPrefix}-description`,`${(a=(l=n.customization)==null?void 0:l.descriptionClass)!=null?a:""}`]);c.innerText=n.text,o.appendChild(c)}}}function be(t,e,n){var l,a,c,f,u,p,d,m,y,g,v,_;t.innerHTML="",t.className=`${n.config.classPrefix}`,(l=e.customization)!=null&&l.class&&t.classList.add(e.customization.class);const i=C("div",[`${n.config.classPrefix}-header`,`${(c=(a=e.customization)==null?void 0:a.headerClass)!=null?c:""}`]);t.appendChild(i);const o=C("h1",[`${n.config.classPrefix}-title`,`${(u=(f=e.customization)==null?void 0:f.titleClass)!=null?u:""}`]);if(o.innerHTML=(p=e.title)!=null?p:"",i.appendChild(o),n.config.allowClose){const h=C("button",[`${n.config.classPrefix}-close`,`${(m=(d=e.customization)==null?void 0:d.closeButtonClass)!=null?m:""}`]);Ce(h,n.config.closeIcon),h.onclick=n.complete.bind(n),i.appendChild(h)}const r=C("div",[`${n.config.classPrefix}-content`,`${(g=(y=e.customization)==null?void 0:y.contentClass)!=null?g:""}`]);t.appendChild(r);const s=C("div",[`${n.config.classPrefix}-footer`,`${(_=(v=e.customization)==null?void 0:v.footerClass)!=null?_:""}`]);H(e.buttonList)&&(e.buttonList=Se(n)),e.buttonList.forEach(h=>{var k;h.action=h.action.bind(n);const L=[`${n.config.classPrefix}-button`,(k=h.class)!=null?k:""];H(h.type)||h.type==="secondary"?L.push(`${n.config.classPrefix}-button-secondary`):h.type==="primary"&&L.push(`${n.config.classPrefix}-button-primary`),!H(h.class)&&h.class!==""&&L.push(h.class);const x=C("button",L);x.innerText=h.text,x.onclick=()=>{h.action()},s.appendChild(x)}),t.appendChild(s)}function Ce(t,e){e instanceof HTMLElement?t.appendChild(e):t.innerHTML=e.innerHTML}function Se(t){return[{text:"Back",action:t.prev},{text:"Next",type:"primary",action:t.next}]}class Te{constructor(){w(this,"_renderContentStrategy",new Map);this.setUpStrategies()}render(e,n){return new Promise(i=>{var o,r;if(!this._renderContentStrategy.has(n.popupData.type))throw new Error("Missing popup creator strategy");e.style.animation="none",e.style.opacity="0",n.hostElement?e.style.position=Mt(n.hostElement):e.style.position="fixed",be(e,n.popupData,n.tour),(o=this._renderContentStrategy.get(n.popupData.type))==null||o.renderContent(e,n.popupData,n.tour.config),(r=n.hostElement)==null||r.scrollIntoView(n.tour.config.scrollTo),i()}).then(()=>{var i,o;return n.isFirst||!n.hasHost&&!((i=n.prevStep)!=null&&i.hasHost)||!n.hasHost&&!((o=n.nextStep)!=null&&o.hasHost)?Promise.resolve():ve(400)}).then(()=>{this.updatePosition(e,n),e.style.opacity="1",e.style.animation="fadeIn 0.3s ease-out"})}updatePosition(e,n){const i=e.style.position==="fixed"?window.scrollY||document.documentElement.scrollTop:0,o=[],r=B(n.popupData.position)&&n.popupData.position!=="auto"?n.popupData.position:void 0;(n.popupData.position==="auto"||H(r))&&o.push(we()),n.hostElement?xe(n.hostElement,e,{placement:r,middleware:[...o,ye(20)]}).then(({x:s,y:l})=>{Object.assign(e.style,{top:`${l-i}px`,left:`${s}px`,transform:""})}):Object.assign(e.style,{top:"50%",left:"50%",transform:"translate(-50%, -50%)"})}setUpStrategies(){this._renderContentStrategy.set("text",new Le),this._renderContentStrategy.set("custom",new _e)}}class Re{render(e,n){return new Promise(i=>{n.hostElement&&(e.style.position=Mt(n.hostElement)),i()}).then(()=>{this.updatePosition(e,n)})}updatePosition(e,n){var l,a,c,f;if(!n.hostElement){e.style.width="0",e.style.height="0",e.style.top="50%",e.style.left="50%",e.style.transform="translate(-50%, -50%)",e.style.borderWidth="0";return}const i=n.hostElement.getBoundingClientRect(),o=(a=(l=n.tour.config.helperLayout)==null?void 0:l.paddingX)!=null?a:8,r=(f=(c=n.tour.config.helperLayout)==null?void 0:c.paddingY)!=null?f:8,s=e.style.position==="fixed"?0:window.scrollY||document.documentElement.scrollTop;e.style.transform="",e.style.borderWidth="2px",e.style.left=`${i.left-o}px`,e.style.top=`${i.top+s-r}px`,e.style.width=`${i.width+2*o}px`,e.style.height=`${i.height+2*r}px`}}class Ht{constructor(e,n){w(this,"id");w(this,"popupData");w(this,"tour");w(this,"_hostElement",null);w(this,"_hostData");w(this,"_popupRenderer");w(this,"_helperRenderer");this.id=n.id,this.popupData=n.popup,this.tour=e,this._hostData=n.host,this._popupRenderer=e.popupRenderer,this._helperRenderer=e.helperRenderer}get isFirst(){return this.tour.stepList.indexOf(this)===0}get nextStep(){var e;return(e=this.tour.stepList[this.tour.stepList.indexOf(this)+1])!=null?e:null}get prevStep(){var e;return(e=this.tour.stepList[this.tour.stepList.indexOf(this)-1])!=null?e:null}get hasHost(){return B(this._hostElement)}get hostElement(){return this._hostElement}show(){return A(this,null,function*(){var e;H(this.tour.popup)||H(this.tour.helperLayout)||(this._hostData&&(this._hostElement=this.resolveHostElement(typeof this._hostData=="function"?this._hostData():(e=this._hostData)!=null?e:null)),yield Promise.all([this._helperRenderer.render(this.tour.helperLayout,this),this._popupRenderer.render(this.tour.popup,this)]))})}resolveHostElement(e){return typeof this._hostData=="string"?document.querySelector(this._hostData):e}}function Ee(t){return{innerHTML:`
|
|
1
|
+
"use strict";var Vt=Object.defineProperty,Ft=Object.defineProperties;var Wt=Object.getOwnPropertyDescriptors;var U=Object.getOwnPropertySymbols;var ut=Object.prototype.hasOwnProperty,dt=Object.prototype.propertyIsEnumerable;var tt=(e,t,n)=>t in e?Vt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,L=(e,t)=>{for(var n in t||(t={}))ut.call(t,n)&&tt(e,n,t[n]);if(U)for(var n of U(t))dt.call(t,n)&&tt(e,n,t[n]);return e},z=(e,t)=>Ft(e,Wt(t));var gt=(e,t)=>{var n={};for(var i in e)ut.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(e!=null&&U)for(var i of U(e))t.indexOf(i)<0&&dt.call(e,i)&&(n[i]=e[i]);return n};var w=(e,t,n)=>tt(e,typeof t!="symbol"?t+"":t,n);var A=(e,t,n)=>new Promise((i,o)=>{var r=a=>{try{l(n.next(a))}catch(c){o(c)}},s=a=>{try{l(n.throw(a))}catch(c){o(c)}},l=a=>a.done?i(a.value):Promise.resolve(a.value).then(r,s);l((n=n.apply(e,t)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const zt=["top","right","bottom","left"],pt=["start","end"],mt=zt.reduce((e,t)=>e.concat(t,t+"-"+pt[0],t+"-"+pt[1]),[]),yt=Math.min,Y=Math.max,q=Math.round,P=e=>({x:e,y:e}),Yt={left:"right",right:"left",bottom:"top",top:"bottom"},It={start:"end",end:"start"};function ot(e,t){return typeof e=="function"?e(t):e}function j(e){return e.split("-")[0]}function D(e){return e.split("-")[1]}function jt(e){return e==="x"?"y":"x"}function Lt(e){return e==="y"?"height":"width"}function st(e){return["top","bottom"].includes(j(e))?"y":"x"}function St(e){return jt(st(e))}function Xt(e,t,n){n===void 0&&(n=!1);const i=D(e),o=St(e),r=Lt(o);let s=o==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[r]>t.floating[r]&&(s=wt(s)),[s,wt(s)]}function Ut(e){return e.replace(/start|end/g,t=>It[t])}function wt(e){return e.replace(/left|right|bottom|top/g,t=>Yt[t])}function qt(e){return L({top:0,right:0,bottom:0,left:0},e)}function Kt(e){return typeof e!="number"?qt(e):{top:e,right:e,bottom:e,left:e}}function K(e){const{x:t,y:n,width:i,height:o}=e;return{width:i,height:o,top:n,left:t,right:t+i,bottom:n+o,x:t,y:n}}function xt(e,t,n){let{reference:i,floating:o}=e;const r=st(t),s=St(t),l=Lt(s),a=j(t),c=r==="y",h=i.x+i.width/2-o.width/2,f=i.y+i.height/2-o.height/2,g=i[l]/2-o[l]/2;let u;switch(a){case"top":u={x:h,y:i.y-o.height};break;case"bottom":u={x:h,y:i.y+i.height};break;case"right":u={x:i.x+i.width,y:f};break;case"left":u={x:i.x-o.width,y:f};break;default:u={x:i.x,y:i.y}}switch(D(t)){case"start":u[s]-=g*(n&&c?-1:1);break;case"end":u[s]+=g*(n&&c?-1:1);break}return u}const Gt=(e,t,n)=>A(exports,null,function*(){const{placement:i="bottom",strategy:o="absolute",middleware:r=[],platform:s}=n,l=r.filter(Boolean),a=yield s.isRTL==null?void 0:s.isRTL(t);let c=yield s.getElementRects({reference:e,floating:t,strategy:o}),{x:h,y:f}=xt(c,i,a),g=i,u={},p=0;for(let y=0;y<l.length;y++){const{name:m,fn:_}=l[y],{x:b,y:d,data:v,reset:x}=yield _({x:h,y:f,initialPlacement:i,placement:g,strategy:o,middlewareData:u,rects:c,platform:s,elements:{reference:e,floating:t}});h=b!=null?b:h,f=d!=null?d:f,u=z(L({},u),{[m]:L(L({},u[m]),v)}),x&&p<=50&&(p++,typeof x=="object"&&(x.placement&&(g=x.placement),x.rects&&(c=x.rects===!0?yield s.getElementRects({reference:e,floating:t,strategy:o}):x.rects),{x:h,y:f}=xt(c,g,a)),y=-1)}return{x:h,y:f,placement:g,strategy:o,middlewareData:u}});function Jt(e,t){return A(this,null,function*(){var n;t===void 0&&(t={});const{x:i,y:o,platform:r,rects:s,elements:l,strategy:a}=e,{boundary:c="clippingAncestors",rootBoundary:h="viewport",elementContext:f="floating",altBoundary:g=!1,padding:u=0}=ot(t,e),p=Kt(u),m=l[g?f==="floating"?"reference":"floating":f],_=K(yield r.getClippingRect({element:(n=yield r.isElement==null?void 0:r.isElement(m))==null||n?m:m.contextElement||(yield r.getDocumentElement==null?void 0:r.getDocumentElement(l.floating)),boundary:c,rootBoundary:h,strategy:a})),b=f==="floating"?{x:i,y:o,width:s.floating.width,height:s.floating.height}:s.reference,d=yield r.getOffsetParent==null?void 0:r.getOffsetParent(l.floating),v=(yield r.isElement==null?void 0:r.isElement(d))?(yield r.getScale==null?void 0:r.getScale(d))||{x:1,y:1}:{x:1,y:1},x=K(r.convertOffsetParentRelativeRectToViewportRelativeRect?yield r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:b,offsetParent:d,strategy:a}):b);return{top:(_.top-x.top+p.top)/v.y,bottom:(x.bottom-_.bottom+p.bottom)/v.y,left:(_.left-x.left+p.left)/v.x,right:(x.right-_.right+p.right)/v.x}})}function Qt(e,t,n){return(e?[...n.filter(o=>D(o)===e),...n.filter(o=>D(o)!==e)]:n.filter(o=>j(o)===o)).filter(o=>e?D(o)===e||(t?Ut(o)!==o:!1):!0)}const Zt=function(e){return e===void 0&&(e={}),{name:"autoPlacement",options:e,fn(n){return A(this,null,function*(){var i,o,r;const{rects:s,middlewareData:l,placement:a,platform:c,elements:h}=n,ht=ot(e,n),{crossAxis:f=!1,alignment:g,allowedPlacements:u=mt,autoAlignment:p=!0}=ht,y=gt(ht,["crossAxis","alignment","allowedPlacements","autoAlignment"]),m=g!==void 0||u===mt?Qt(g||null,p,u):u,_=yield Jt(n,y),b=((i=l.autoPlacement)==null?void 0:i.index)||0,d=m[b];if(d==null)return{};const v=Xt(d,s,yield c.isRTL==null?void 0:c.isRTL(h.floating));if(a!==d)return{reset:{placement:m[0]}};const x=[_[j(d)],_[v[0]],_[v[1]]],N=[...((o=l.autoPlacement)==null?void 0:o.overflows)||[],{placement:d,overflows:x}],Z=m[b+1];if(Z)return{data:{index:b+1,overflows:N},reset:{placement:Z}};const at=N.map(E=>{const W=D(E.placement);return[E.placement,W&&f?E.overflows.slice(0,2).reduce((Nt,Ht)=>Nt+Ht,0):E.overflows[0],E.overflows]}).sort((E,W)=>E[1]-W[1]),ft=((r=at.filter(E=>E[2].slice(0,D(E[0])?2:3).every(W=>W<=0))[0])==null?void 0:r[0])||at[0][0];return ft!==a?{data:{index:b+1,overflows:N},reset:{placement:ft}}:{}})}}};function te(e,t){return A(this,null,function*(){const{placement:n,platform:i,elements:o}=e,r=yield i.isRTL==null?void 0:i.isRTL(o.floating),s=j(n),l=D(n),a=st(n)==="y",c=["left","top"].includes(s)?-1:1,h=r&&a?-1:1,f=ot(t,e);let{mainAxis:g,crossAxis:u,alignmentAxis:p}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof p=="number"&&(u=l==="end"?p*-1:p),a?{x:u*h,y:g*c}:{x:g*c,y:u*h}})}const ee=function(e){return e===void 0&&(e=0),{name:"offset",options:e,fn(n){return A(this,null,function*(){var i,o;const{x:r,y:s,placement:l,middlewareData:a}=n,c=yield te(n,e);return l===((i=a.offset)==null?void 0:i.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:r+c.x,y:s+c.y,data:z(L({},c),{placement:l})}})}}};function G(){return typeof window!="undefined"}function F(e){return Tt(e)?(e.nodeName||"").toLowerCase():"#document"}function C(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function $(e){var t;return(t=(Tt(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Tt(e){return G()?e instanceof Node||e instanceof C(e).Node:!1}function T(e){return G()?e instanceof Element||e instanceof C(e).Element:!1}function O(e){return G()?e instanceof HTMLElement||e instanceof C(e).HTMLElement:!1}function vt(e){return!G()||typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof C(e).ShadowRoot}function X(e){const{overflow:t,overflowX:n,overflowY:i,display:o}=R(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+n)&&!["inline","contents"].includes(o)}function ne(e){return["table","td","th"].includes(F(e))}function J(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch(n){return!1}})}function rt(e){const t=lt(),n=T(e)?R(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(i=>(n.willChange||"").includes(i))||["paint","layout","strict","content"].some(i=>(n.contain||"").includes(i))}function ie(e){let t=M(e);for(;O(t)&&!V(t);){if(rt(t))return t;if(J(t))return null;t=M(t)}return null}function lt(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function V(e){return["html","body","#document"].includes(F(e))}function R(e){return C(e).getComputedStyle(e)}function Q(e){return T(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function M(e){if(F(e)==="html")return e;const t=e.assignedSlot||e.parentNode||vt(e)&&e.host||$(e);return vt(t)?t.host:t}function Rt(e){const t=M(e);return V(t)?e.ownerDocument?e.ownerDocument.body:e.body:O(t)&&X(t)?t:Rt(t)}function nt(e,t,n){var i;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Rt(e),r=o===((i=e.ownerDocument)==null?void 0:i.body),s=C(o);if(r){const l=it(s);return t.concat(s,s.visualViewport||[],X(o)?o:[],l&&n?nt(l):[])}return t.concat(o,nt(o,[],n))}function it(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Et(e){const t=R(e);let n=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const o=O(e),r=o?e.offsetWidth:n,s=o?e.offsetHeight:i,l=q(n)!==r||q(i)!==s;return l&&(n=r,i=s),{width:n,height:i,$:l}}function Pt(e){return T(e)?e:e.contextElement}function H(e){const t=Pt(e);if(!O(t))return P(1);const n=t.getBoundingClientRect(),{width:i,height:o,$:r}=Et(t);let s=(r?q(n.width):n.width)/i,l=(r?q(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const oe=P(0);function Ot(e){const t=C(e);return!lt()||!t.visualViewport?oe:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function se(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==C(e)?!1:t}function I(e,t,n,i){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),r=Pt(e);let s=P(1);t&&(i?T(i)&&(s=H(i)):s=H(e));const l=se(r,n,i)?Ot(r):P(0);let a=(o.left+l.x)/s.x,c=(o.top+l.y)/s.y,h=o.width/s.x,f=o.height/s.y;if(r){const g=C(r),u=i&&T(i)?C(i):i;let p=g,y=it(p);for(;y&&i&&u!==p;){const m=H(y),_=y.getBoundingClientRect(),b=R(y),d=_.left+(y.clientLeft+parseFloat(b.paddingLeft))*m.x,v=_.top+(y.clientTop+parseFloat(b.paddingTop))*m.y;a*=m.x,c*=m.y,h*=m.x,f*=m.y,a+=d,c+=v,p=C(y),y=it(p)}}return K({width:h,height:f,x:a,y:c})}function ct(e,t){const n=Q(e).scrollLeft;return t?t.left+n:I($(e)).left+n}function $t(e,t,n){n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=i.left+t.scrollLeft-(n?0:ct(e,i)),r=i.top+t.scrollTop;return{x:o,y:r}}function re(e){let{elements:t,rect:n,offsetParent:i,strategy:o}=e;const r=o==="fixed",s=$(i),l=t?J(t.floating):!1;if(i===s||l&&r)return n;let a={scrollLeft:0,scrollTop:0},c=P(1);const h=P(0),f=O(i);if((f||!f&&!r)&&((F(i)!=="body"||X(s))&&(a=Q(i)),O(i))){const u=I(i);c=H(i),h.x=u.x+i.clientLeft,h.y=u.y+i.clientTop}const g=s&&!f&&!r?$t(s,a,!0):P(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-a.scrollLeft*c.x+h.x+g.x,y:n.y*c.y-a.scrollTop*c.y+h.y+g.y}}function le(e){return Array.from(e.getClientRects())}function ce(e){const t=$(e),n=Q(e),i=e.ownerDocument.body,o=Y(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),r=Y(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight);let s=-n.scrollLeft+ct(e);const l=-n.scrollTop;return R(i).direction==="rtl"&&(s+=Y(t.clientWidth,i.clientWidth)-o),{width:o,height:r,x:s,y:l}}function ae(e,t){const n=C(e),i=$(e),o=n.visualViewport;let r=i.clientWidth,s=i.clientHeight,l=0,a=0;if(o){r=o.width,s=o.height;const c=lt();(!c||c&&t==="fixed")&&(l=o.offsetLeft,a=o.offsetTop)}return{width:r,height:s,x:l,y:a}}function fe(e,t){const n=I(e,!0,t==="fixed"),i=n.top+e.clientTop,o=n.left+e.clientLeft,r=O(e)?H(e):P(1),s=e.clientWidth*r.x,l=e.clientHeight*r.y,a=o*r.x,c=i*r.y;return{width:s,height:l,x:a,y:c}}function _t(e,t,n){let i;if(t==="viewport")i=ae(e,n);else if(t==="document")i=ce($(e));else if(T(t))i=fe(t,n);else{const o=Ot(e);i={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return K(i)}function At(e,t){const n=M(e);return n===t||!T(n)||V(n)?!1:R(n).position==="fixed"||At(n,t)}function he(e,t){const n=t.get(e);if(n)return n;let i=nt(e,[],!1).filter(l=>T(l)&&F(l)!=="body"),o=null;const r=R(e).position==="fixed";let s=r?M(e):e;for(;T(s)&&!V(s);){const l=R(s),a=rt(s);!a&&l.position==="fixed"&&(o=null),(r?!a&&!o:!a&&l.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||X(s)&&!a&&At(e,s))?i=i.filter(h=>h!==s):o=l,s=M(s)}return t.set(e,i),i}function ue(e){let{element:t,boundary:n,rootBoundary:i,strategy:o}=e;const s=[...n==="clippingAncestors"?J(t)?[]:he(t,this._c):[].concat(n),i],l=s[0],a=s.reduce((c,h)=>{const f=_t(t,h,o);return c.top=Y(f.top,c.top),c.right=yt(f.right,c.right),c.bottom=yt(f.bottom,c.bottom),c.left=Y(f.left,c.left),c},_t(t,l,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function de(e){const{width:t,height:n}=Et(e);return{width:t,height:n}}function ge(e,t,n){const i=O(t),o=$(t),r=n==="fixed",s=I(e,!0,r,t);let l={scrollLeft:0,scrollTop:0};const a=P(0);if(i||!i&&!r)if((F(t)!=="body"||X(o))&&(l=Q(t)),i){const g=I(t,!0,r,t);a.x=g.x+t.clientLeft,a.y=g.y+t.clientTop}else o&&(a.x=ct(o));const c=o&&!i&&!r?$t(o,l):P(0),h=s.left+l.scrollLeft-a.x-c.x,f=s.top+l.scrollTop-a.y-c.y;return{x:h,y:f,width:s.width,height:s.height}}function et(e){return R(e).position==="static"}function bt(e,t){if(!O(e)||R(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return $(e)===n&&(n=n.ownerDocument.body),n}function kt(e,t){const n=C(e);if(J(e))return n;if(!O(e)){let o=M(e);for(;o&&!V(o);){if(T(o)&&!et(o))return o;o=M(o)}return n}let i=bt(e,t);for(;i&&ne(i)&&et(i);)i=bt(i,t);return i&&V(i)&&et(i)&&!rt(i)?n:i||ie(e)||n}const pe=function(e){return A(this,null,function*(){const t=this.getOffsetParent||kt,n=this.getDimensions,i=yield n(e.floating);return{reference:ge(e.reference,yield t(e.floating),e.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}})};function me(e){return R(e).direction==="rtl"}const ye={convertOffsetParentRelativeRectToViewportRelativeRect:re,getDocumentElement:$,getClippingRect:ue,getOffsetParent:kt,getElementRects:pe,getClientRects:le,getDimensions:de,getScale:H,isElement:T,isRTL:me},we=ee,xe=Zt,ve=(e,t,n)=>{const i=new Map,o=L({platform:ye},n),r=z(L({},o.platform),{_c:i});return Gt(e,t,z(L({},o),{platform:r}))};function B(e){return e===null||typeof e=="undefined"}function k(e){return!B(e)}function Ct(e){return new Promise(t=>setTimeout(t,e))}function Dt(e){var i;const t=e.parentElement;return!t||t.nodeName==="HTML"?!1:((i=document.defaultView)==null?void 0:i.getComputedStyle(e,null).getPropertyValue("position"))==="fixed"?!0:Dt(t)}function Mt(e){return Dt(e)?"fixed":"absolute"}class _e{renderContent(t,n,i){t.querySelector(`.${i.classPrefix}-content`).appendChild(n.node)}}function S(e,t){const n=document.createElement(e);return t&&t.length>0&&(t=t.filter(i=>i),n.classList.add(...t)),n}class be{renderContent(t,n,i){var r,s,l,a;const o=t.querySelector(`.${i.classPrefix}-content`);if(n.imgSrc){const c=S("img",[`${i.classPrefix}-image`,`${(s=(r=n.customization)==null?void 0:r.imageClass)!=null?s:""}`]);c.src=n.imgSrc,o.appendChild(c)}if(n.text){const c=S("p",[`${i.classPrefix}-description`,`${(a=(l=n.customization)==null?void 0:l.descriptionClass)!=null?a:""}`]);c.innerText=n.text,o.appendChild(c)}}}function Ce(e,t,n){var l,a,c,h,f,g,u,p,y,m,_,b;e.innerHTML="",e.className=`${n.config.classPrefix} ${n.config.animationClass}`,(l=t.customization)!=null&&l.class&&e.classList.add(t.customization.class);const i=S("div",[`${n.config.classPrefix}-header`,`${(c=(a=t.customization)==null?void 0:a.headerClass)!=null?c:""}`]);e.appendChild(i);const o=S("h1",[`${n.config.classPrefix}-title`,`${(f=(h=t.customization)==null?void 0:h.titleClass)!=null?f:""}`]);if(o.innerHTML=(g=t.title)!=null?g:"",i.appendChild(o),n.config.allowClose){const d=S("button",[`${n.config.classPrefix}-close`,`${(p=(u=t.customization)==null?void 0:u.closeButtonClass)!=null?p:""}`]);Le(d,n.config.closeIcon),d.onclick=n.complete.bind(n),i.appendChild(d)}const r=S("div",[`${n.config.classPrefix}-content`,`${(m=(y=t.customization)==null?void 0:y.contentClass)!=null?m:""}`]);e.appendChild(r);const s=S("div",[`${n.config.classPrefix}-footer`,`${(b=(_=t.customization)==null?void 0:_.footerClass)!=null?b:""}`]);B(t.buttonList)&&(t.buttonList=Se(n)),t.buttonList.forEach(d=>{var N;d.action=d.action.bind(n);const v=[`${n.config.classPrefix}-button`,(N=d.class)!=null?N:""];B(d.type)||d.type==="secondary"?v.push(`${n.config.classPrefix}-button-secondary`):d.type==="primary"?v.push(`${n.config.classPrefix}-button-primary`):d.type==="link"&&v.push(`${n.config.classPrefix}-button-link`),!B(d.class)&&d.class!==""&&v.push(d.class);const x=S("button",v);x.innerText=d.text,x.onclick=Z=>{d.action.call(n)},s.appendChild(x)}),e.appendChild(s)}function Le(e,t){t instanceof HTMLElement?e.appendChild(t):e.innerHTML=t.innerHTML}function Se(e){return[{text:"Back",action:e.prev},{text:"Next",type:"primary",action:e.next}]}class Te{constructor(){w(this,"_renderContentStrategy",new Map);this.setUpStrategies()}render(t,n){return new Promise(i=>{var o,r;if(!this._renderContentStrategy.has(n.popupData.type))throw new Error("Missing popup creator strategy");t.style.display="none",t.classList.remove(n.tour.config.animationClass),n.hostElement?t.style.position=Mt(n.hostElement):t.style.position="fixed",Ce(t,n.popupData,n.tour),(o=this._renderContentStrategy.get(n.popupData.type))==null||o.renderContent(t,n.popupData,n.tour.config),(r=n.hostElement)==null||r.scrollIntoView(n.tour.config.scrollTo),i()}).then(()=>n.isFirst&&n.direction==="toNext"?Ct(0):Ct(400)).then(()=>{t.style.display="block",this.updatePosition(t,n),t.classList.add(n.tour.config.animationClass)})}updatePosition(t,n){const i=t.style.position==="fixed"?window.scrollY||document.documentElement.scrollTop:0,o=[],r=k(n.popupData.position)&&n.popupData.position!=="auto"?n.popupData.position:void 0;(n.popupData.position==="auto"||B(r))&&o.push(xe()),n.hostElement?ve(n.hostElement,t,{placement:r,middleware:[...o,we(20)]}).then(({x:s,y:l})=>{Object.assign(t.style,{top:`${l-i}px`,left:`${s}px`,marginTop:"0",marginLeft:"0"})}):Object.assign(t.style,{top:"50%",left:"50%",marginTop:`-${t.clientHeight/2}px`,marginLeft:`-${t.clientWidth/2}px`})}setUpStrategies(){this._renderContentStrategy.set("text",new be),this._renderContentStrategy.set("custom",new _e)}}class Re{render(t,n){return new Promise(i=>{n.hostElement&&(t.style.position=Mt(n.hostElement)),i()}).then(()=>{this.updatePosition(t,n)})}updatePosition(t,n){var l,a,c,h;if(!n.hostElement){t.style.width="0",t.style.height="0",t.style.top="50%",t.style.left="50%",t.style.transform="translate(-50%, -50%)",t.style.borderWidth="0";return}const i=n.hostElement.getBoundingClientRect(),o=(a=(l=n.tour.config.highlight)==null?void 0:l.paddingX)!=null?a:8,r=(h=(c=n.tour.config.highlight)==null?void 0:c.paddingY)!=null?h:8,s=t.style.position==="fixed"?0:window.scrollY||document.documentElement.scrollTop;t.style.transform="",t.style.borderWidth="2px",t.style.left=`${i.left-o}px`,t.style.top=`${i.top+s-r}px`,t.style.width=`${i.width+2*o}px`,t.style.height=`${i.height+2*r}px`}}class Bt{constructor(t,n){w(this,"id");w(this,"popupData");w(this,"tour");w(this,"index");w(this,"_hostElement",null);w(this,"_direction","toNext");w(this,"_hostData");w(this,"_popupRenderer");w(this,"_highlightRenderer");var i;this.id=n.id,this.popupData=n.popup,this.tour=t,this.index=(i=n.index)!=null?i:null,this._hostData=n.host,this._popupRenderer=t.popupRenderer,this._highlightRenderer=t.highlightRenderer}get isFirst(){return this.index===0}get nextStep(){var t;return(t=this.tour.stepList[this.tour.stepList.indexOf(this)+1])!=null?t:null}get prevStep(){var t;return(t=this.tour.stepList[this.tour.stepList.indexOf(this)-1])!=null?t:null}get direction(){return this._direction}get hasHost(){return k(this._hostElement)}get hostElement(){return this._hostElement}show(t){return A(this,null,function*(){var i;if(B(this.tour.popup))return;this._direction=t,this._hostData&&(this._hostElement=this.resolveHostElement(typeof this._hostData=="function"?this._hostData():(i=this._hostData)!=null?i:null));const n=[this._popupRenderer.render(this.tour.popup,this)];!this.tour.config.highlight.disable&&!B(this.tour.highlight)&&n.push(this._highlightRenderer.render(this.tour.highlight,this)),yield Promise.all(n)})}resolveHostElement(t){return typeof this._hostData=="string"?document.querySelector(this._hostData):t}}function Ee(e){return{innerHTML:`
|
|
2
2
|
<svg
|
|
3
3
|
xmlns="http://www.w3.org/2000/svg"
|
|
4
4
|
fill="none"
|
|
5
5
|
viewBox="0 0 162 162"
|
|
6
|
-
class="${
|
|
6
|
+
class="${e}-close-icon"
|
|
7
7
|
>
|
|
8
8
|
<path
|
|
9
9
|
stroke-linecap="round"
|
|
@@ -18,4 +18,4 @@
|
|
|
18
18
|
d="M9.01074 153L153.021 8.98926"
|
|
19
19
|
></path>
|
|
20
20
|
</svg>
|
|
21
|
-
`}}class Pe{constructor(
|
|
21
|
+
`}}class Pe{constructor(t){w(this,"popupRenderer",new Te);w(this,"highlightRenderer",new Re);w(this,"isStarted",!1);w(this,"_popup",null);w(this,"_highlight",null);w(this,"_stepList",[]);w(this,"_activeStep",null);w(this,"_bodyResizeObserver");w(this,"_config");w(this,"_stepMap",new Map);var n,i,o,r,s,l,a,c,h,f,g,u,p,y,m;this._bodyResizeObserver=this.getBodyResizeObserver(),this._config={classPrefix:(n=t.classPrefix)!=null?n:"siteguide",animationClass:(i=t.animationClass)!=null?i:"siteguide-animation",allowClose:(o=t.allowClose)!=null?o:!0,scrollTo:(r=t.scrollTo)!=null?r:{behavior:"smooth",block:"center",inline:"center"},allowClickoutClose:(s=t.allowClickoutClose)!=null?s:!1,closeIcon:(a=t.closeIcon)!=null?a:Ee((l=t.classPrefix)!=null?l:"siteguide"),highlight:{disable:(h=(c=t.highlight)==null?void 0:c.disable)!=null?h:!1,paddingX:(g=(f=t.highlight)==null?void 0:f.paddingX)!=null?g:8,paddingY:(p=(u=t.highlight)==null?void 0:u.paddingY)!=null?p:8,class:(m=(y=t.highlight)==null?void 0:y.class)!=null?m:"siteguide-highlight"}}}get stepList(){return this._stepList}get config(){return this._config}get popup(){return this._popup}get highlight(){return this._highlight}addStep(t){if(this._stepMap.has(t.id))throw new Error("Step with provided id has been already registered");const n=new Bt(this,t);k(t.index)?this._stepList.splice(t.index,0,n):this._stepList.push(n),this._stepMap.set(t.id,n)}addSteps(t){t.forEach(n=>this.addStep(n))}removeStep(t){this._stepList=this._stepList.filter(n=>t!==n.id),this._stepMap.delete(t)}start(){this.isStarted=!0,this._popup=S("div",[this._config.classPrefix]),document.body.appendChild(this._popup),this._config.highlight.disable||(this._highlight=S("div",[k(this._config.highlight.class)?this._config.highlight.class:`${this._config.classPrefix}-highlight`]),document.body.appendChild(this._highlight)),this.next()}complete(){this.isStarted=!1,this._popup&&document.body.removeChild(this._popup),this._highlight&&document.body.removeChild(this._highlight),this._activeStep=null}prev(){const t=k(this._activeStep)?this._stepList.indexOf(this._activeStep)-1:this._stepList.indexOf(this._stepList[this._stepList.length-1]);if(t<0){this.complete();return}this._activeStep=this._stepList[t],this._activeStep.show("fromBack")}next(){const t=k(this._activeStep)?this._stepList.indexOf(this._activeStep)+1:this._stepList.indexOf(this._stepList[0]);if(t>=this._stepList.length){this.complete();return}this._activeStep=this._stepList[t],this._activeStep.show("toNext")}setConfig(t){this._config=L(L({},this._config),t)}getBodyResizeObserver(){const t=new ResizeObserver(()=>{!this.isStarted||!this._activeStep||(k(this._popup)&&this.popupRenderer.updatePosition(this._popup,this._activeStep),k(this._highlight)&&!this.config.highlight.disable&&this.highlightRenderer.updatePosition(this._highlight,this._activeStep))});return t.observe(document.body),t}}exports.Tour=Pe;exports.TourStep=Bt;exports.createElement=S;
|