siteguide.js 0.3.0 → 0.5.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/dist/index.mjs CHANGED
@@ -1,26 +1,26 @@
1
- var Bt = Object.defineProperty, Nt = Object.defineProperties;
2
- var Vt = Object.getOwnPropertyDescriptors;
3
- var U = Object.getOwnPropertySymbols;
4
- var dt = Object.prototype.hasOwnProperty, ht = Object.prototype.propertyIsEnumerable;
5
- var Z = (t, e, n) => e in t ? Bt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, O = (t, e) => {
6
- for (var n in e || (e = {}))
7
- dt.call(e, n) && Z(t, n, e[n]);
8
- if (U)
9
- for (var n of U(e))
10
- ht.call(e, n) && Z(t, n, e[n]);
11
- return t;
12
- }, z = (t, e) => Nt(t, Vt(e));
13
- var pt = (t, e) => {
1
+ var It = Object.defineProperty, Yt = Object.defineProperties;
2
+ var qt = Object.getOwnPropertyDescriptors;
3
+ var tt = Object.getOwnPropertySymbols;
4
+ var bt = Object.prototype.hasOwnProperty, _t = Object.prototype.propertyIsEnumerable;
5
+ var Ct = Math.pow, ft = (e, t, n) => t in e ? It(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, L = (e, t) => {
6
+ for (var n in t || (t = {}))
7
+ bt.call(t, n) && ft(e, n, t[n]);
8
+ if (tt)
9
+ for (var n of tt(t))
10
+ _t.call(t, n) && ft(e, n, t[n]);
11
+ return e;
12
+ }, X = (e, t) => Yt(e, qt(t));
13
+ var Pt = (e, t) => {
14
14
  var n = {};
15
- for (var i in t)
16
- dt.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
17
- if (t != null && U)
18
- for (var i of U(t))
19
- e.indexOf(i) < 0 && ht.call(t, i) && (n[i] = t[i]);
15
+ for (var i in e)
16
+ bt.call(e, i) && t.indexOf(i) < 0 && (n[i] = e[i]);
17
+ if (e != null && tt)
18
+ for (var i of tt(e))
19
+ t.indexOf(i) < 0 && _t.call(e, i) && (n[i] = e[i]);
20
20
  return n;
21
21
  };
22
- var w = (t, e, n) => Z(t, typeof e != "symbol" ? e + "" : e, n);
23
- var A = (t, e, n) => new Promise((i, o) => {
22
+ var y = (e, t, n) => ft(e, typeof t != "symbol" ? t + "" : t, n);
23
+ var k = (e, t, n) => new Promise((i, o) => {
24
24
  var r = (a) => {
25
25
  try {
26
26
  l(n.next(a));
@@ -34,196 +34,199 @@ var A = (t, e, n) => new Promise((i, o) => {
34
34
  o(c);
35
35
  }
36
36
  }, l = (a) => a.done ? i(a.value) : Promise.resolve(a.value).then(r, s);
37
- l((n = n.apply(t, e)).next());
37
+ l((n = n.apply(e, t)).next());
38
38
  });
39
- const Ft = ["top", "right", "bottom", "left"], mt = ["start", "end"], gt = /* @__PURE__ */ Ft.reduce((t, e) => t.concat(e, e + "-" + mt[0], e + "-" + mt[1]), []), yt = Math.min, I = Math.max, q = Math.round, E = (t) => ({
40
- x: t,
41
- y: t
42
- }), Wt = {
39
+ const Ut = ["top", "right", "bottom", "left"], Lt = ["start", "end"], St = /* @__PURE__ */ Ut.reduce((e, t) => e.concat(t, t + "-" + Lt[0], t + "-" + Lt[1]), []), K = Math.min, z = Math.max, et = Math.round, $ = (e) => ({
40
+ x: e,
41
+ y: e
42
+ }), Xt = {
43
43
  left: "right",
44
44
  right: "left",
45
45
  bottom: "top",
46
46
  top: "bottom"
47
- }, zt = {
47
+ }, Kt = {
48
48
  start: "end",
49
49
  end: "start"
50
50
  };
51
- function it(t, e) {
52
- return typeof t == "function" ? t(e) : t;
51
+ function Gt(e, t, n) {
52
+ return z(e, K(t, n));
53
53
  }
54
- function j(t) {
55
- return t.split("-")[0];
54
+ function it(e, t) {
55
+ return typeof e == "function" ? e(t) : e;
56
56
  }
57
- function D(t) {
58
- return t.split("-")[1];
57
+ function J(e) {
58
+ return e.split("-")[0];
59
59
  }
60
- function It(t) {
61
- return t === "x" ? "y" : "x";
60
+ function M(e) {
61
+ return e.split("-")[1];
62
62
  }
63
- function bt(t) {
64
- return t === "y" ? "height" : "width";
63
+ function Jt(e) {
64
+ return e === "x" ? "y" : "x";
65
65
  }
66
- function ot(t) {
67
- return ["top", "bottom"].includes(j(t)) ? "y" : "x";
66
+ function gt(e) {
67
+ return e === "y" ? "height" : "width";
68
68
  }
69
- function Ct(t) {
70
- return It(ot(t));
69
+ function pt(e) {
70
+ return ["top", "bottom"].includes(J(e)) ? "y" : "x";
71
71
  }
72
- function Yt(t, e, n) {
72
+ function mt(e) {
73
+ return Jt(pt(e));
74
+ }
75
+ function Qt(e, t, n) {
73
76
  n === void 0 && (n = !1);
74
- const i = D(t), o = Ct(t), r = bt(o);
77
+ const i = M(e), o = mt(e), r = gt(o);
75
78
  let s = o === "x" ? i === (n ? "end" : "start") ? "right" : "left" : i === "start" ? "bottom" : "top";
76
- return e.reference[r] > e.floating[r] && (s = wt(s)), [s, wt(s)];
79
+ return t.reference[r] > t.floating[r] && (s = Rt(s)), [s, Rt(s)];
77
80
  }
78
- function jt(t) {
79
- return t.replace(/start|end/g, (e) => zt[e]);
81
+ function Zt(e) {
82
+ return e.replace(/start|end/g, (t) => Kt[t]);
80
83
  }
81
- function wt(t) {
82
- return t.replace(/left|right|bottom|top/g, (e) => Wt[e]);
84
+ function Rt(e) {
85
+ return e.replace(/left|right|bottom|top/g, (t) => Xt[t]);
83
86
  }
84
- function Xt(t) {
85
- return O({
87
+ function te(e) {
88
+ return L({
86
89
  top: 0,
87
90
  right: 0,
88
91
  bottom: 0,
89
92
  left: 0
90
- }, t);
91
- }
92
- function Ut(t) {
93
- return typeof t != "number" ? Xt(t) : {
94
- top: t,
95
- right: t,
96
- bottom: t,
97
- left: t
93
+ }, e);
94
+ }
95
+ function Dt(e) {
96
+ return typeof e != "number" ? te(e) : {
97
+ top: e,
98
+ right: e,
99
+ bottom: e,
100
+ left: e
98
101
  };
99
102
  }
100
- function K(t) {
103
+ function nt(e) {
101
104
  const {
102
- x: e,
105
+ x: t,
103
106
  y: n,
104
107
  width: i,
105
108
  height: o
106
- } = t;
109
+ } = e;
107
110
  return {
108
111
  width: i,
109
112
  height: o,
110
113
  top: n,
111
- left: e,
112
- right: e + i,
114
+ left: t,
115
+ right: t + i,
113
116
  bottom: n + o,
114
- x: e,
117
+ x: t,
115
118
  y: n
116
119
  };
117
120
  }
118
- function xt(t, e, n) {
121
+ function Tt(e, t, n) {
119
122
  let {
120
123
  reference: i,
121
124
  floating: o
122
- } = t;
123
- 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;
124
- let d;
125
+ } = e;
126
+ const r = pt(t), s = mt(t), l = gt(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;
127
+ let u;
125
128
  switch (a) {
126
129
  case "top":
127
- d = {
128
- x: f,
130
+ u = {
131
+ x: h,
129
132
  y: i.y - o.height
130
133
  };
131
134
  break;
132
135
  case "bottom":
133
- d = {
134
- x: f,
136
+ u = {
137
+ x: h,
135
138
  y: i.y + i.height
136
139
  };
137
140
  break;
138
141
  case "right":
139
- d = {
142
+ u = {
140
143
  x: i.x + i.width,
141
- y: u
144
+ y: f
142
145
  };
143
146
  break;
144
147
  case "left":
145
- d = {
148
+ u = {
146
149
  x: i.x - o.width,
147
- y: u
150
+ y: f
148
151
  };
149
152
  break;
150
153
  default:
151
- d = {
154
+ u = {
152
155
  x: i.x,
153
156
  y: i.y
154
157
  };
155
158
  }
156
- switch (D(e)) {
159
+ switch (M(t)) {
157
160
  case "start":
158
- d[s] -= p * (n && c ? -1 : 1);
161
+ u[s] -= g * (n && c ? -1 : 1);
159
162
  break;
160
163
  case "end":
161
- d[s] += p * (n && c ? -1 : 1);
164
+ u[s] += g * (n && c ? -1 : 1);
162
165
  break;
163
166
  }
164
- return d;
167
+ return u;
165
168
  }
166
- const qt = (t, e, n) => A(void 0, null, function* () {
169
+ const ee = (e, t, n) => k(void 0, null, function* () {
167
170
  const {
168
171
  placement: i = "bottom",
169
172
  strategy: o = "absolute",
170
173
  middleware: r = [],
171
174
  platform: s
172
- } = n, l = r.filter(Boolean), a = yield s.isRTL == null ? void 0 : s.isRTL(e);
175
+ } = n, l = r.filter(Boolean), a = yield s.isRTL == null ? void 0 : s.isRTL(t);
173
176
  let c = yield s.getElementRects({
174
- reference: t,
175
- floating: e,
177
+ reference: e,
178
+ floating: t,
176
179
  strategy: o
177
180
  }), {
178
- x: f,
179
- y: u
180
- } = xt(c, i, a), p = i, d = {}, m = 0;
181
- for (let y = 0; y < l.length; y++) {
181
+ x: h,
182
+ y: f
183
+ } = Tt(c, i, a), g = i, u = {}, d = 0;
184
+ for (let p = 0; p < l.length; p++) {
182
185
  const {
183
- name: g,
184
- fn: v
185
- } = l[y], {
186
+ name: w,
187
+ fn: x
188
+ } = l[p], {
186
189
  x: _,
187
- y: h,
188
- data: L,
189
- reset: x
190
- } = yield v({
191
- x: f,
192
- y: u,
190
+ y: m,
191
+ data: v,
192
+ reset: b
193
+ } = yield x({
194
+ x: h,
195
+ y: f,
193
196
  initialPlacement: i,
194
- placement: p,
197
+ placement: g,
195
198
  strategy: o,
196
- middlewareData: d,
199
+ middlewareData: u,
197
200
  rects: c,
198
201
  platform: s,
199
202
  elements: {
200
- reference: t,
201
- floating: e
203
+ reference: e,
204
+ floating: t
202
205
  }
203
206
  });
204
- f = _ != null ? _ : f, u = h != null ? h : u, d = z(O({}, d), {
205
- [g]: O(O({}, d[g]), L)
206
- }), x && m <= 50 && (m++, typeof x == "object" && (x.placement && (p = x.placement), x.rects && (c = x.rects === !0 ? yield s.getElementRects({
207
- reference: t,
208
- floating: e,
207
+ h = _ != null ? _ : h, f = m != null ? m : f, u = X(L({}, u), {
208
+ [w]: L(L({}, u[w]), v)
209
+ }), b && d <= 50 && (d++, typeof b == "object" && (b.placement && (g = b.placement), b.rects && (c = b.rects === !0 ? yield s.getElementRects({
210
+ reference: e,
211
+ floating: t,
209
212
  strategy: o
210
- }) : x.rects), {
211
- x: f,
212
- y: u
213
- } = xt(c, p, a)), y = -1);
213
+ }) : b.rects), {
214
+ x: h,
215
+ y: f
216
+ } = Tt(c, g, a)), p = -1);
214
217
  }
215
218
  return {
216
- x: f,
217
- y: u,
218
- placement: p,
219
+ x: h,
220
+ y: f,
221
+ placement: g,
219
222
  strategy: o,
220
- middlewareData: d
223
+ middlewareData: u
221
224
  };
222
225
  });
223
- function Kt(t, e) {
224
- return A(this, null, function* () {
226
+ function ne(e, t) {
227
+ return k(this, null, function* () {
225
228
  var n;
226
- e === void 0 && (e = {});
229
+ t === void 0 && (t = {});
227
230
  const {
228
231
  x: i,
229
232
  y: o,
@@ -231,166 +234,205 @@ function Kt(t, e) {
231
234
  rects: s,
232
235
  elements: l,
233
236
  strategy: a
234
- } = t, {
237
+ } = e, {
235
238
  boundary: c = "clippingAncestors",
236
- rootBoundary: f = "viewport",
237
- elementContext: u = "floating",
238
- altBoundary: p = !1,
239
- padding: d = 0
240
- } = it(e, t), m = Ut(d), g = l[p ? u === "floating" ? "reference" : "floating" : u], v = K(yield r.getClippingRect({
241
- 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)),
239
+ rootBoundary: h = "viewport",
240
+ elementContext: f = "floating",
241
+ altBoundary: g = !1,
242
+ padding: u = 0
243
+ } = it(t, e), d = Dt(u), w = l[g ? f === "floating" ? "reference" : "floating" : f], x = nt(yield r.getClippingRect({
244
+ element: (n = yield r.isElement == null ? void 0 : r.isElement(w)) == null || n ? w : w.contextElement || (yield r.getDocumentElement == null ? void 0 : r.getDocumentElement(l.floating)),
242
245
  boundary: c,
243
- rootBoundary: f,
246
+ rootBoundary: h,
244
247
  strategy: a
245
- })), _ = u === "floating" ? {
248
+ })), _ = f === "floating" ? {
246
249
  x: i,
247
250
  y: o,
248
251
  width: s.floating.width,
249
252
  height: s.floating.height
250
- } : 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)) || {
253
+ } : s.reference, m = yield r.getOffsetParent == null ? void 0 : r.getOffsetParent(l.floating), v = (yield r.isElement == null ? void 0 : r.isElement(m)) ? (yield r.getScale == null ? void 0 : r.getScale(m)) || {
251
254
  x: 1,
252
255
  y: 1
253
256
  } : {
254
257
  x: 1,
255
258
  y: 1
256
- }, x = K(r.convertOffsetParentRelativeRectToViewportRelativeRect ? yield r.convertOffsetParentRelativeRectToViewportRelativeRect({
259
+ }, b = nt(r.convertOffsetParentRelativeRectToViewportRelativeRect ? yield r.convertOffsetParentRelativeRectToViewportRelativeRect({
257
260
  elements: l,
258
261
  rect: _,
259
- offsetParent: h,
262
+ offsetParent: m,
260
263
  strategy: a
261
264
  }) : _);
262
265
  return {
263
- top: (v.top - x.top + m.top) / L.y,
264
- bottom: (x.bottom - v.bottom + m.bottom) / L.y,
265
- left: (v.left - x.left + m.left) / L.x,
266
- right: (x.right - v.right + m.right) / L.x
266
+ top: (x.top - b.top + d.top) / v.y,
267
+ bottom: (b.bottom - x.bottom + d.bottom) / v.y,
268
+ left: (x.left - b.left + d.left) / v.x,
269
+ right: (b.right - x.right + d.right) / v.x
267
270
  };
268
271
  });
269
272
  }
270
- function Gt(t, e, n) {
271
- 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 ? jt(o) !== o : !1) : !0);
273
+ const ie = (e) => ({
274
+ name: "arrow",
275
+ options: e,
276
+ fn(n) {
277
+ return k(this, null, function* () {
278
+ const {
279
+ x: i,
280
+ y: o,
281
+ placement: r,
282
+ rects: s,
283
+ platform: l,
284
+ elements: a,
285
+ middlewareData: c
286
+ } = n, {
287
+ element: h,
288
+ padding: f = 0
289
+ } = it(e, n) || {};
290
+ if (h == null)
291
+ return {};
292
+ const g = Dt(f), u = {
293
+ x: i,
294
+ y: o
295
+ }, d = mt(r), p = gt(d), w = yield l.getDimensions(h), x = d === "y", _ = x ? "top" : "left", m = x ? "bottom" : "right", v = x ? "clientHeight" : "clientWidth", b = s.reference[p] + s.reference[d] - u[d] - s.floating[p], B = u[d] - s.reference[d], V = yield l.getOffsetParent == null ? void 0 : l.getOffsetParent(h);
296
+ let H = V ? V[v] : 0;
297
+ (!H || !(yield l.isElement == null ? void 0 : l.isElement(V))) && (H = a.floating[v] || s.floating[p]);
298
+ const vt = b / 2 - B / 2, q = H / 2 - w[p] / 2 - 1, U = K(g[_], q), C = K(g[m], q), E = U, Z = H - w[p] - C, D = H / 2 - w[p] / 2 + vt, lt = Gt(E, D, Z), ct = !c.arrow && M(r) != null && D !== lt && s.reference[p] / 2 - (D < E ? U : C) - w[p] / 2 < 0, at = ct ? D < E ? D - E : D - Z : 0;
299
+ return {
300
+ [d]: u[d] + at,
301
+ data: L({
302
+ [d]: lt,
303
+ centerOffset: D - lt - at
304
+ }, ct && {
305
+ alignmentOffset: at
306
+ }),
307
+ reset: ct
308
+ };
309
+ });
310
+ }
311
+ });
312
+ function oe(e, t, n) {
313
+ return (e ? [...n.filter((o) => M(o) === e), ...n.filter((o) => M(o) !== e)] : n.filter((o) => J(o) === o)).filter((o) => e ? M(o) === e || (t ? Zt(o) !== o : !1) : !0);
272
314
  }
273
- const Jt = function(t) {
274
- return t === void 0 && (t = {}), {
315
+ const se = function(e) {
316
+ return e === void 0 && (e = {}), {
275
317
  name: "autoPlacement",
276
- options: t,
318
+ options: e,
277
319
  fn(n) {
278
- return A(this, null, function* () {
320
+ return k(this, null, function* () {
279
321
  var i, o, r;
280
322
  const {
281
323
  rects: s,
282
324
  middlewareData: l,
283
325
  placement: a,
284
326
  platform: c,
285
- elements: f
286
- } = n, ut = it(t, n), {
287
- crossAxis: u = !1,
288
- alignment: p,
289
- allowedPlacements: d = gt,
290
- autoAlignment: m = !0
291
- } = ut, y = pt(ut, [
327
+ elements: h
328
+ } = n, U = it(e, n), {
329
+ crossAxis: f = !1,
330
+ alignment: g,
331
+ allowedPlacements: u = St,
332
+ autoAlignment: d = !0
333
+ } = U, p = Pt(U, [
292
334
  "crossAxis",
293
335
  "alignment",
294
336
  "allowedPlacements",
295
337
  "autoAlignment"
296
- ]), g = p !== void 0 || d === gt ? Gt(p || null, m, d) : d, v = yield Kt(n, y), _ = ((i = l.autoPlacement) == null ? void 0 : i.index) || 0, h = g[_];
297
- if (h == null)
338
+ ]), w = g !== void 0 || u === St ? oe(g || null, d, u) : u, x = yield ne(n, p), _ = ((i = l.autoPlacement) == null ? void 0 : i.index) || 0, m = w[_];
339
+ if (m == null)
298
340
  return {};
299
- const L = Yt(h, s, yield c.isRTL == null ? void 0 : c.isRTL(f.floating));
300
- if (a !== h)
341
+ const v = Qt(m, s, yield c.isRTL == null ? void 0 : c.isRTL(h.floating));
342
+ if (a !== m)
301
343
  return {
302
344
  reset: {
303
- placement: g[0]
345
+ placement: w[0]
304
346
  }
305
347
  };
306
- const x = [v[j(h)], v[L[0]], v[L[1]]], k = [...((o = l.autoPlacement) == null ? void 0 : o.overflows) || [], {
307
- placement: h,
308
- overflows: x
309
- }], ct = g[_ + 1];
310
- if (ct)
348
+ const b = [x[J(m)], x[v[0]], x[v[1]]], B = [...((o = l.autoPlacement) == null ? void 0 : o.overflows) || [], {
349
+ placement: m,
350
+ overflows: b
351
+ }], V = w[_ + 1];
352
+ if (V)
311
353
  return {
312
354
  data: {
313
355
  index: _ + 1,
314
- overflows: k
356
+ overflows: B
315
357
  },
316
358
  reset: {
317
- placement: ct
359
+ placement: V
318
360
  }
319
361
  };
320
- const at = k.map((R) => {
321
- const W = D(R.placement);
322
- return [R.placement, W && u ? (
362
+ const H = B.map((C) => {
363
+ const E = M(C.placement);
364
+ return [C.placement, E && f ? (
323
365
  // Check along the mainAxis and main crossAxis side.
324
- R.overflows.slice(0, 2).reduce((Ht, kt) => Ht + kt, 0)
366
+ C.overflows.slice(0, 2).reduce((Z, D) => Z + D, 0)
325
367
  ) : (
326
368
  // Check only the mainAxis.
327
- R.overflows[0]
328
- ), R.overflows];
329
- }).sort((R, W) => R[1] - W[1]), ft = ((r = at.filter((R) => R[2].slice(
369
+ C.overflows[0]
370
+ ), C.overflows];
371
+ }).sort((C, E) => C[1] - E[1]), q = ((r = H.filter((C) => C[2].slice(
330
372
  0,
331
373
  // Aligned placements should not check their opposite crossAxis
332
374
  // side.
333
- D(R[0]) ? 2 : 3
334
- ).every((W) => W <= 0))[0]) == null ? void 0 : r[0]) || at[0][0];
335
- return ft !== a ? {
375
+ M(C[0]) ? 2 : 3
376
+ ).every((E) => E <= 0))[0]) == null ? void 0 : r[0]) || H[0][0];
377
+ return q !== a ? {
336
378
  data: {
337
379
  index: _ + 1,
338
- overflows: k
380
+ overflows: B
339
381
  },
340
382
  reset: {
341
- placement: ft
383
+ placement: q
342
384
  }
343
385
  } : {};
344
386
  });
345
387
  }
346
388
  };
347
389
  };
348
- function Qt(t, e) {
349
- return A(this, null, function* () {
390
+ function re(e, t) {
391
+ return k(this, null, function* () {
350
392
  const {
351
393
  placement: n,
352
394
  platform: i,
353
395
  elements: o
354
- } = 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);
396
+ } = e, r = yield i.isRTL == null ? void 0 : i.isRTL(o.floating), s = J(n), l = M(n), a = pt(n) === "y", c = ["left", "top"].includes(s) ? -1 : 1, h = r && a ? -1 : 1, f = it(t, e);
355
397
  let {
356
- mainAxis: p,
357
- crossAxis: d,
358
- alignmentAxis: m
359
- } = typeof u == "number" ? {
360
- mainAxis: u,
398
+ mainAxis: g,
399
+ crossAxis: u,
400
+ alignmentAxis: d
401
+ } = typeof f == "number" ? {
402
+ mainAxis: f,
361
403
  crossAxis: 0,
362
404
  alignmentAxis: null
363
405
  } : {
364
- mainAxis: u.mainAxis || 0,
365
- crossAxis: u.crossAxis || 0,
366
- alignmentAxis: u.alignmentAxis
406
+ mainAxis: f.mainAxis || 0,
407
+ crossAxis: f.crossAxis || 0,
408
+ alignmentAxis: f.alignmentAxis
367
409
  };
368
- return l && typeof m == "number" && (d = l === "end" ? m * -1 : m), a ? {
369
- x: d * f,
370
- y: p * c
410
+ return l && typeof d == "number" && (u = l === "end" ? d * -1 : d), a ? {
411
+ x: u * h,
412
+ y: g * c
371
413
  } : {
372
- x: p * c,
373
- y: d * f
414
+ x: g * c,
415
+ y: u * h
374
416
  };
375
417
  });
376
418
  }
377
- const Zt = function(t) {
378
- return t === void 0 && (t = 0), {
419
+ const le = function(e) {
420
+ return e === void 0 && (e = 0), {
379
421
  name: "offset",
380
- options: t,
422
+ options: e,
381
423
  fn(n) {
382
- return A(this, null, function* () {
424
+ return k(this, null, function* () {
383
425
  var i, o;
384
426
  const {
385
427
  x: r,
386
428
  y: s,
387
429
  placement: l,
388
430
  middlewareData: a
389
- } = n, c = yield Qt(n, t);
431
+ } = n, c = yield re(n, e);
390
432
  return l === ((i = a.offset) == null ? void 0 : i.placement) && (o = a.arrow) != null && o.alignmentOffset ? {} : {
391
433
  x: r + c.x,
392
434
  y: s + c.y,
393
- data: z(O({}, c), {
435
+ data: X(L({}, c), {
394
436
  placement: l
395
437
  })
396
438
  };
@@ -398,239 +440,239 @@ const Zt = function(t) {
398
440
  }
399
441
  };
400
442
  };
401
- function G() {
443
+ function ot() {
402
444
  return typeof window != "undefined";
403
445
  }
404
- function F(t) {
405
- return St(t) ? (t.nodeName || "").toLowerCase() : "#document";
446
+ function Y(e) {
447
+ return kt(e) ? (e.nodeName || "").toLowerCase() : "#document";
406
448
  }
407
- function b(t) {
408
- var e;
409
- return (t == null || (e = t.ownerDocument) == null ? void 0 : e.defaultView) || window;
449
+ function P(e) {
450
+ var t;
451
+ return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
410
452
  }
411
- function $(t) {
412
- var e;
413
- return (e = (St(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
453
+ function F(e) {
454
+ var t;
455
+ return (t = (kt(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
414
456
  }
415
- function St(t) {
416
- return G() ? t instanceof Node || t instanceof b(t).Node : !1;
457
+ function kt(e) {
458
+ return ot() ? e instanceof Node || e instanceof P(e).Node : !1;
417
459
  }
418
- function C(t) {
419
- return G() ? t instanceof Element || t instanceof b(t).Element : !1;
460
+ function T(e) {
461
+ return ot() ? e instanceof Element || e instanceof P(e).Element : !1;
420
462
  }
421
- function P(t) {
422
- return G() ? t instanceof HTMLElement || t instanceof b(t).HTMLElement : !1;
463
+ function A(e) {
464
+ return ot() ? e instanceof HTMLElement || e instanceof P(e).HTMLElement : !1;
423
465
  }
424
- function vt(t) {
425
- return !G() || typeof ShadowRoot == "undefined" ? !1 : t instanceof ShadowRoot || t instanceof b(t).ShadowRoot;
466
+ function Ot(e) {
467
+ return !ot() || typeof ShadowRoot == "undefined" ? !1 : e instanceof ShadowRoot || e instanceof P(e).ShadowRoot;
426
468
  }
427
- function X(t) {
469
+ function Q(e) {
428
470
  const {
429
- overflow: e,
471
+ overflow: t,
430
472
  overflowX: n,
431
473
  overflowY: i,
432
474
  display: o
433
- } = S(t);
434
- return /auto|scroll|overlay|hidden|clip/.test(e + i + n) && !["inline", "contents"].includes(o);
475
+ } = O(e);
476
+ return /auto|scroll|overlay|hidden|clip/.test(t + i + n) && !["inline", "contents"].includes(o);
435
477
  }
436
- function te(t) {
437
- return ["table", "td", "th"].includes(F(t));
478
+ function ce(e) {
479
+ return ["table", "td", "th"].includes(Y(e));
438
480
  }
439
- function J(t) {
440
- return [":popover-open", ":modal"].some((e) => {
481
+ function st(e) {
482
+ return [":popover-open", ":modal"].some((t) => {
441
483
  try {
442
- return t.matches(e);
484
+ return e.matches(t);
443
485
  } catch (n) {
444
486
  return !1;
445
487
  }
446
488
  });
447
489
  }
448
- function st(t) {
449
- const e = rt(), n = C(t) ? S(t) : t;
450
- 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));
490
+ function wt(e) {
491
+ const t = xt(), n = T(e) ? O(e) : e;
492
+ 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));
451
493
  }
452
- function ee(t) {
453
- let e = M(t);
454
- for (; P(e) && !V(e); ) {
455
- if (st(e))
456
- return e;
457
- if (J(e))
494
+ function ae(e) {
495
+ let t = N(e);
496
+ for (; A(t) && !I(t); ) {
497
+ if (wt(t))
498
+ return t;
499
+ if (st(t))
458
500
  return null;
459
- e = M(e);
501
+ t = N(t);
460
502
  }
461
503
  return null;
462
504
  }
463
- function rt() {
505
+ function xt() {
464
506
  return typeof CSS == "undefined" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
465
507
  }
466
- function V(t) {
467
- return ["html", "body", "#document"].includes(F(t));
508
+ function I(e) {
509
+ return ["html", "body", "#document"].includes(Y(e));
468
510
  }
469
- function S(t) {
470
- return b(t).getComputedStyle(t);
511
+ function O(e) {
512
+ return P(e).getComputedStyle(e);
471
513
  }
472
- function Q(t) {
473
- return C(t) ? {
474
- scrollLeft: t.scrollLeft,
475
- scrollTop: t.scrollTop
514
+ function rt(e) {
515
+ return T(e) ? {
516
+ scrollLeft: e.scrollLeft,
517
+ scrollTop: e.scrollTop
476
518
  } : {
477
- scrollLeft: t.scrollX,
478
- scrollTop: t.scrollY
519
+ scrollLeft: e.scrollX,
520
+ scrollTop: e.scrollY
479
521
  };
480
522
  }
481
- function M(t) {
482
- if (F(t) === "html")
483
- return t;
484
- const e = (
523
+ function N(e) {
524
+ if (Y(e) === "html")
525
+ return e;
526
+ const t = (
485
527
  // Step into the shadow DOM of the parent of a slotted node.
486
- t.assignedSlot || // DOM Element detected.
487
- t.parentNode || // ShadowRoot detected.
488
- vt(t) && t.host || // Fallback.
489
- $(t)
528
+ e.assignedSlot || // DOM Element detected.
529
+ e.parentNode || // ShadowRoot detected.
530
+ Ot(e) && e.host || // Fallback.
531
+ F(e)
490
532
  );
491
- return vt(e) ? e.host : e;
533
+ return Ot(t) ? t.host : t;
492
534
  }
493
- function Rt(t) {
494
- const e = M(t);
495
- return V(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : P(e) && X(e) ? e : Rt(e);
535
+ function Mt(e) {
536
+ const t = N(e);
537
+ return I(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : A(t) && Q(t) ? t : Mt(t);
496
538
  }
497
- function et(t, e, n) {
539
+ function ut(e, t, n) {
498
540
  var i;
499
- e === void 0 && (e = []), n === void 0 && (n = !0);
500
- const o = Rt(t), r = o === ((i = t.ownerDocument) == null ? void 0 : i.body), s = b(o);
541
+ t === void 0 && (t = []), n === void 0 && (n = !0);
542
+ const o = Mt(e), r = o === ((i = e.ownerDocument) == null ? void 0 : i.body), s = P(o);
501
543
  if (r) {
502
- const l = nt(s);
503
- return e.concat(s, s.visualViewport || [], X(o) ? o : [], l && n ? et(l) : []);
544
+ const l = dt(s);
545
+ return t.concat(s, s.visualViewport || [], Q(o) ? o : [], l && n ? ut(l) : []);
504
546
  }
505
- return e.concat(o, et(o, [], n));
547
+ return t.concat(o, ut(o, [], n));
506
548
  }
507
- function nt(t) {
508
- return t.parent && Object.getPrototypeOf(t.parent) ? t.frameElement : null;
549
+ function dt(e) {
550
+ return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
509
551
  }
510
- function Tt(t) {
511
- const e = S(t);
512
- let n = parseFloat(e.width) || 0, i = parseFloat(e.height) || 0;
513
- const o = P(t), r = o ? t.offsetWidth : n, s = o ? t.offsetHeight : i, l = q(n) !== r || q(i) !== s;
552
+ function Ft(e) {
553
+ const t = O(e);
554
+ let n = parseFloat(t.width) || 0, i = parseFloat(t.height) || 0;
555
+ const o = A(e), r = o ? e.offsetWidth : n, s = o ? e.offsetHeight : i, l = et(n) !== r || et(i) !== s;
514
556
  return l && (n = r, i = s), {
515
557
  width: n,
516
558
  height: i,
517
559
  $: l
518
560
  };
519
561
  }
520
- function Et(t) {
521
- return C(t) ? t : t.contextElement;
562
+ function Bt(e) {
563
+ return T(e) ? e : e.contextElement;
522
564
  }
523
- function N(t) {
524
- const e = Et(t);
525
- if (!P(e))
526
- return E(1);
527
- const n = e.getBoundingClientRect(), {
565
+ function j(e) {
566
+ const t = Bt(e);
567
+ if (!A(t))
568
+ return $(1);
569
+ const n = t.getBoundingClientRect(), {
528
570
  width: i,
529
571
  height: o,
530
572
  $: r
531
- } = Tt(e);
532
- let s = (r ? q(n.width) : n.width) / i, l = (r ? q(n.height) : n.height) / o;
573
+ } = Ft(t);
574
+ let s = (r ? et(n.width) : n.width) / i, l = (r ? et(n.height) : n.height) / o;
533
575
  return (!s || !Number.isFinite(s)) && (s = 1), (!l || !Number.isFinite(l)) && (l = 1), {
534
576
  x: s,
535
577
  y: l
536
578
  };
537
579
  }
538
- const ne = /* @__PURE__ */ E(0);
539
- function Pt(t) {
540
- const e = b(t);
541
- return !rt() || !e.visualViewport ? ne : {
542
- x: e.visualViewport.offsetLeft,
543
- y: e.visualViewport.offsetTop
580
+ const fe = /* @__PURE__ */ $(0);
581
+ function Ht(e) {
582
+ const t = P(e);
583
+ return !xt() || !t.visualViewport ? fe : {
584
+ x: t.visualViewport.offsetLeft,
585
+ y: t.visualViewport.offsetTop
544
586
  };
545
587
  }
546
- function ie(t, e, n) {
547
- return e === void 0 && (e = !1), !n || e && n !== b(t) ? !1 : e;
588
+ function he(e, t, n) {
589
+ return t === void 0 && (t = !1), !n || t && n !== P(e) ? !1 : t;
548
590
  }
549
- function Y(t, e, n, i) {
550
- e === void 0 && (e = !1), n === void 0 && (n = !1);
551
- const o = t.getBoundingClientRect(), r = Et(t);
552
- let s = E(1);
553
- e && (i ? C(i) && (s = N(i)) : s = N(t));
554
- const l = ie(r, n, i) ? Pt(r) : E(0);
555
- 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;
591
+ function G(e, t, n, i) {
592
+ t === void 0 && (t = !1), n === void 0 && (n = !1);
593
+ const o = e.getBoundingClientRect(), r = Bt(e);
594
+ let s = $(1);
595
+ t && (i ? T(i) && (s = j(i)) : s = j(e));
596
+ const l = he(r, n, i) ? Ht(r) : $(0);
597
+ 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;
556
598
  if (r) {
557
- const p = b(r), d = i && C(i) ? b(i) : i;
558
- let m = p, y = nt(m);
559
- for (; y && i && d !== m; ) {
560
- const g = N(y), v = y.getBoundingClientRect(), _ = S(y), h = v.left + (y.clientLeft + parseFloat(_.paddingLeft)) * g.x, L = v.top + (y.clientTop + parseFloat(_.paddingTop)) * g.y;
561
- a *= g.x, c *= g.y, f *= g.x, u *= g.y, a += h, c += L, m = b(y), y = nt(m);
599
+ const g = P(r), u = i && T(i) ? P(i) : i;
600
+ let d = g, p = dt(d);
601
+ for (; p && i && u !== d; ) {
602
+ const w = j(p), x = p.getBoundingClientRect(), _ = O(p), m = x.left + (p.clientLeft + parseFloat(_.paddingLeft)) * w.x, v = x.top + (p.clientTop + parseFloat(_.paddingTop)) * w.y;
603
+ a *= w.x, c *= w.y, h *= w.x, f *= w.y, a += m, c += v, d = P(p), p = dt(d);
562
604
  }
563
605
  }
564
- return K({
565
- width: f,
566
- height: u,
606
+ return nt({
607
+ width: h,
608
+ height: f,
567
609
  x: a,
568
610
  y: c
569
611
  });
570
612
  }
571
- function lt(t, e) {
572
- const n = Q(t).scrollLeft;
573
- return e ? e.left + n : Y($(t)).left + n;
613
+ function yt(e, t) {
614
+ const n = rt(e).scrollLeft;
615
+ return t ? t.left + n : G(F(e)).left + n;
574
616
  }
575
- function Ot(t, e, n) {
617
+ function Nt(e, t, n) {
576
618
  n === void 0 && (n = !1);
577
- const i = t.getBoundingClientRect(), o = i.left + e.scrollLeft - (n ? 0 : (
619
+ const i = e.getBoundingClientRect(), o = i.left + t.scrollLeft - (n ? 0 : (
578
620
  // RTL <body> scrollbar.
579
- lt(t, i)
580
- )), r = i.top + e.scrollTop;
621
+ yt(e, i)
622
+ )), r = i.top + t.scrollTop;
581
623
  return {
582
624
  x: o,
583
625
  y: r
584
626
  };
585
627
  }
586
- function oe(t) {
628
+ function ue(e) {
587
629
  let {
588
- elements: e,
630
+ elements: t,
589
631
  rect: n,
590
632
  offsetParent: i,
591
633
  strategy: o
592
- } = t;
593
- const r = o === "fixed", s = $(i), l = e ? J(e.floating) : !1;
634
+ } = e;
635
+ const r = o === "fixed", s = F(i), l = t ? st(t.floating) : !1;
594
636
  if (i === s || l && r)
595
637
  return n;
596
638
  let a = {
597
639
  scrollLeft: 0,
598
640
  scrollTop: 0
599
- }, c = E(1);
600
- const f = E(0), u = P(i);
601
- if ((u || !u && !r) && ((F(i) !== "body" || X(s)) && (a = Q(i)), P(i))) {
602
- const d = Y(i);
603
- c = N(i), f.x = d.x + i.clientLeft, f.y = d.y + i.clientTop;
641
+ }, c = $(1);
642
+ const h = $(0), f = A(i);
643
+ if ((f || !f && !r) && ((Y(i) !== "body" || Q(s)) && (a = rt(i)), A(i))) {
644
+ const u = G(i);
645
+ c = j(i), h.x = u.x + i.clientLeft, h.y = u.y + i.clientTop;
604
646
  }
605
- const p = s && !u && !r ? Ot(s, a, !0) : E(0);
647
+ const g = s && !f && !r ? Nt(s, a, !0) : $(0);
606
648
  return {
607
649
  width: n.width * c.x,
608
650
  height: n.height * c.y,
609
- x: n.x * c.x - a.scrollLeft * c.x + f.x + p.x,
610
- y: n.y * c.y - a.scrollTop * c.y + f.y + p.y
651
+ x: n.x * c.x - a.scrollLeft * c.x + h.x + g.x,
652
+ y: n.y * c.y - a.scrollTop * c.y + h.y + g.y
611
653
  };
612
654
  }
613
- function se(t) {
614
- return Array.from(t.getClientRects());
655
+ function de(e) {
656
+ return Array.from(e.getClientRects());
615
657
  }
616
- function re(t) {
617
- 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);
618
- let s = -n.scrollLeft + lt(t);
658
+ function ge(e) {
659
+ const t = F(e), n = rt(e), i = e.ownerDocument.body, o = z(t.scrollWidth, t.clientWidth, i.scrollWidth, i.clientWidth), r = z(t.scrollHeight, t.clientHeight, i.scrollHeight, i.clientHeight);
660
+ let s = -n.scrollLeft + yt(e);
619
661
  const l = -n.scrollTop;
620
- return S(i).direction === "rtl" && (s += I(e.clientWidth, i.clientWidth) - o), {
662
+ return O(i).direction === "rtl" && (s += z(t.clientWidth, i.clientWidth) - o), {
621
663
  width: o,
622
664
  height: r,
623
665
  x: s,
624
666
  y: l
625
667
  };
626
668
  }
627
- function le(t, e) {
628
- const n = b(t), i = $(t), o = n.visualViewport;
669
+ function pe(e, t) {
670
+ const n = P(e), i = F(e), o = n.visualViewport;
629
671
  let r = i.clientWidth, s = i.clientHeight, l = 0, a = 0;
630
672
  if (o) {
631
673
  r = o.width, s = o.height;
632
- const c = rt();
633
- (!c || c && e === "fixed") && (l = o.offsetLeft, a = o.offsetTop);
674
+ const c = xt();
675
+ (!c || c && t === "fixed") && (l = o.offsetLeft, a = o.offsetTop);
634
676
  }
635
677
  return {
636
678
  width: r,
@@ -639,8 +681,8 @@ function le(t, e) {
639
681
  y: a
640
682
  };
641
683
  }
642
- function ce(t, e) {
643
- 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;
684
+ function me(e, t) {
685
+ const n = G(e, !0, t === "fixed"), i = n.top + e.clientTop, o = n.left + e.clientLeft, r = A(e) ? j(e) : $(1), s = e.clientWidth * r.x, l = e.clientHeight * r.y, a = o * r.x, c = i * r.y;
644
686
  return {
645
687
  width: s,
646
688
  height: l,
@@ -648,53 +690,53 @@ function ce(t, e) {
648
690
  y: c
649
691
  };
650
692
  }
651
- function _t(t, e, n) {
693
+ function Et(e, t, n) {
652
694
  let i;
653
- if (e === "viewport")
654
- i = le(t, n);
655
- else if (e === "document")
656
- i = re($(t));
657
- else if (C(e))
658
- i = ce(e, n);
695
+ if (t === "viewport")
696
+ i = pe(e, n);
697
+ else if (t === "document")
698
+ i = ge(F(e));
699
+ else if (T(t))
700
+ i = me(t, n);
659
701
  else {
660
- const o = Pt(t);
702
+ const o = Ht(e);
661
703
  i = {
662
- x: e.x - o.x,
663
- y: e.y - o.y,
664
- width: e.width,
665
- height: e.height
704
+ x: t.x - o.x,
705
+ y: t.y - o.y,
706
+ width: t.width,
707
+ height: t.height
666
708
  };
667
709
  }
668
- return K(i);
710
+ return nt(i);
669
711
  }
670
- function $t(t, e) {
671
- const n = M(t);
672
- return n === e || !C(n) || V(n) ? !1 : S(n).position === "fixed" || $t(n, e);
712
+ function Vt(e, t) {
713
+ const n = N(e);
714
+ return n === t || !T(n) || I(n) ? !1 : O(n).position === "fixed" || Vt(n, t);
673
715
  }
674
- function ae(t, e) {
675
- const n = e.get(t);
716
+ function we(e, t) {
717
+ const n = t.get(e);
676
718
  if (n)
677
719
  return n;
678
- let i = et(t, [], !1).filter((l) => C(l) && F(l) !== "body"), o = null;
679
- const r = S(t).position === "fixed";
680
- let s = r ? M(t) : t;
681
- for (; C(s) && !V(s); ) {
682
- const l = S(s), a = st(s);
683
- !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);
720
+ let i = ut(e, [], !1).filter((l) => T(l) && Y(l) !== "body"), o = null;
721
+ const r = O(e).position === "fixed";
722
+ let s = r ? N(e) : e;
723
+ for (; T(s) && !I(s); ) {
724
+ const l = O(s), a = wt(s);
725
+ !a && l.position === "fixed" && (o = null), (r ? !a && !o : !a && l.position === "static" && !!o && ["absolute", "fixed"].includes(o.position) || Q(s) && !a && Vt(e, s)) ? i = i.filter((h) => h !== s) : o = l, s = N(s);
684
726
  }
685
- return e.set(t, i), i;
727
+ return t.set(e, i), i;
686
728
  }
687
- function fe(t) {
729
+ function xe(e) {
688
730
  let {
689
- element: e,
731
+ element: t,
690
732
  boundary: n,
691
733
  rootBoundary: i,
692
734
  strategy: o
693
- } = t;
694
- const s = [...n === "clippingAncestors" ? J(e) ? [] : ae(e, this._c) : [].concat(n), i], l = s[0], a = s.reduce((c, f) => {
695
- const u = _t(e, f, o);
696
- 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;
697
- }, _t(e, l, o));
735
+ } = e;
736
+ const s = [...n === "clippingAncestors" ? st(t) ? [] : we(t, this._c) : [].concat(n), i], l = s[0], a = s.reduce((c, h) => {
737
+ const f = Et(t, h, o);
738
+ return c.top = z(f.top, c.top), c.right = K(f.right, c.right), c.bottom = K(f.bottom, c.bottom), c.left = z(f.left, c.left), c;
739
+ }, Et(t, l, o));
698
740
  return {
699
741
  width: a.right - a.left,
700
742
  height: a.bottom - a.top,
@@ -702,70 +744,70 @@ function fe(t) {
702
744
  y: a.top
703
745
  };
704
746
  }
705
- function ue(t) {
747
+ function ye(e) {
706
748
  const {
707
- width: e,
749
+ width: t,
708
750
  height: n
709
- } = Tt(t);
751
+ } = Ft(e);
710
752
  return {
711
- width: e,
753
+ width: t,
712
754
  height: n
713
755
  };
714
756
  }
715
- function de(t, e, n) {
716
- const i = P(e), o = $(e), r = n === "fixed", s = Y(t, !0, r, e);
757
+ function ve(e, t, n) {
758
+ const i = A(t), o = F(t), r = n === "fixed", s = G(e, !0, r, t);
717
759
  let l = {
718
760
  scrollLeft: 0,
719
761
  scrollTop: 0
720
762
  };
721
- const a = E(0);
763
+ const a = $(0);
722
764
  if (i || !i && !r)
723
- if ((F(e) !== "body" || X(o)) && (l = Q(e)), i) {
724
- const p = Y(e, !0, r, e);
725
- a.x = p.x + e.clientLeft, a.y = p.y + e.clientTop;
726
- } else o && (a.x = lt(o));
727
- 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;
765
+ if ((Y(t) !== "body" || Q(o)) && (l = rt(t)), i) {
766
+ const g = G(t, !0, r, t);
767
+ a.x = g.x + t.clientLeft, a.y = g.y + t.clientTop;
768
+ } else o && (a.x = yt(o));
769
+ const c = o && !i && !r ? Nt(o, l) : $(0), h = s.left + l.scrollLeft - a.x - c.x, f = s.top + l.scrollTop - a.y - c.y;
728
770
  return {
729
- x: f,
730
- y: u,
771
+ x: h,
772
+ y: f,
731
773
  width: s.width,
732
774
  height: s.height
733
775
  };
734
776
  }
735
- function tt(t) {
736
- return S(t).position === "static";
777
+ function ht(e) {
778
+ return O(e).position === "static";
737
779
  }
738
- function Lt(t, e) {
739
- if (!P(t) || S(t).position === "fixed")
780
+ function $t(e, t) {
781
+ if (!A(e) || O(e).position === "fixed")
740
782
  return null;
741
- if (e)
742
- return e(t);
743
- let n = t.offsetParent;
744
- return $(t) === n && (n = n.ownerDocument.body), n;
745
- }
746
- function At(t, e) {
747
- const n = b(t);
748
- if (J(t))
783
+ if (t)
784
+ return t(e);
785
+ let n = e.offsetParent;
786
+ return F(e) === n && (n = n.ownerDocument.body), n;
787
+ }
788
+ function Wt(e, t) {
789
+ const n = P(e);
790
+ if (st(e))
749
791
  return n;
750
- if (!P(t)) {
751
- let o = M(t);
752
- for (; o && !V(o); ) {
753
- if (C(o) && !tt(o))
792
+ if (!A(e)) {
793
+ let o = N(e);
794
+ for (; o && !I(o); ) {
795
+ if (T(o) && !ht(o))
754
796
  return o;
755
- o = M(o);
797
+ o = N(o);
756
798
  }
757
799
  return n;
758
800
  }
759
- let i = Lt(t, e);
760
- for (; i && te(i) && tt(i); )
761
- i = Lt(i, e);
762
- return i && V(i) && tt(i) && !st(i) ? n : i || ee(t) || n;
763
- }
764
- const he = function(t) {
765
- return A(this, null, function* () {
766
- const e = this.getOffsetParent || At, n = this.getDimensions, i = yield n(t.floating);
801
+ let i = $t(e, t);
802
+ for (; i && ce(i) && ht(i); )
803
+ i = $t(i, t);
804
+ return i && I(i) && ht(i) && !wt(i) ? n : i || ae(e) || n;
805
+ }
806
+ const be = function(e) {
807
+ return k(this, null, function* () {
808
+ const t = this.getOffsetParent || Wt, n = this.getDimensions, i = yield n(e.floating);
767
809
  return {
768
- reference: de(t.reference, yield e(t.floating), t.strategy),
810
+ reference: ve(e.reference, yield t(e.floating), e.strategy),
769
811
  floating: {
770
812
  x: 0,
771
813
  y: 0,
@@ -775,245 +817,279 @@ const he = function(t) {
775
817
  };
776
818
  });
777
819
  };
778
- function pe(t) {
779
- return S(t).direction === "rtl";
780
- }
781
- const me = {
782
- convertOffsetParentRelativeRectToViewportRelativeRect: oe,
783
- getDocumentElement: $,
784
- getClippingRect: fe,
785
- getOffsetParent: At,
786
- getElementRects: he,
787
- getClientRects: se,
788
- getDimensions: ue,
789
- getScale: N,
790
- isElement: C,
791
- isRTL: pe
792
- }, ge = Zt, ye = Jt, we = (t, e, n) => {
793
- const i = /* @__PURE__ */ new Map(), o = O({
794
- platform: me
795
- }, n), r = z(O({}, o.platform), {
820
+ function _e(e) {
821
+ return O(e).direction === "rtl";
822
+ }
823
+ const Ce = {
824
+ convertOffsetParentRelativeRectToViewportRelativeRect: ue,
825
+ getDocumentElement: F,
826
+ getClippingRect: xe,
827
+ getOffsetParent: Wt,
828
+ getElementRects: be,
829
+ getClientRects: de,
830
+ getDimensions: ye,
831
+ getScale: j,
832
+ isElement: T,
833
+ isRTL: _e
834
+ }, Pe = le, Le = se, Se = ie, Re = (e, t, n) => {
835
+ const i = /* @__PURE__ */ new Map(), o = L({
836
+ platform: Ce
837
+ }, n), r = X(L({}, o.platform), {
796
838
  _c: i
797
839
  });
798
- return qt(t, e, z(O({}, o), {
840
+ return ee(e, t, X(L({}, o), {
799
841
  platform: r
800
842
  }));
801
843
  };
802
- function H(t) {
803
- return t === null || typeof t == "undefined";
844
+ function W(e) {
845
+ return e === null || typeof e == "undefined";
804
846
  }
805
- function B(t) {
806
- return !H(t);
847
+ function R(e) {
848
+ return !W(e);
807
849
  }
808
- function xe(t) {
809
- return new Promise((e) => setTimeout(e, t));
850
+ function At(e) {
851
+ return new Promise((t) => setTimeout(t, e));
810
852
  }
811
- function Dt(t) {
853
+ function zt(e) {
812
854
  var i;
813
- const e = t.parentElement;
814
- return !e || e.nodeName === "HTML" ? !1 : ((i = document.defaultView) == null ? void 0 : i.getComputedStyle(t, null).getPropertyValue("position")) === "fixed" ? !0 : Dt(e);
855
+ const t = e.parentElement;
856
+ return !t || t.nodeName === "HTML" ? !1 : ((i = document.defaultView) == null ? void 0 : i.getComputedStyle(e, null).getPropertyValue("position")) === "fixed" ? !0 : zt(t);
815
857
  }
816
- function Mt(t) {
817
- return Dt(t) ? "fixed" : "absolute";
858
+ function jt(e) {
859
+ return zt(e) ? "fixed" : "absolute";
818
860
  }
819
- class ve {
861
+ class Te {
820
862
  /** @inheritdoc */
821
- renderContent(e, n, i) {
822
- e.querySelector(`.${i.classPrefix}-content`).appendChild(n.node);
863
+ renderContent(t, n, i) {
864
+ t.querySelector(`.${i.classPrefix}-content`).appendChild(n.node);
823
865
  }
824
866
  }
825
- function T(t, e) {
826
- const n = document.createElement(t);
827
- return e && e.length > 0 && (e = e.filter((i) => i), n.classList.add(...e)), n;
867
+ function S(e, t) {
868
+ const n = document.createElement(e);
869
+ return t && t.length > 0 && (t = t.filter((i) => i), n.classList.add(...t)), n;
828
870
  }
829
- class _e {
871
+ class Oe {
830
872
  /** @inheritdoc */
831
- renderContent(e, n, i) {
873
+ renderContent(t, n, i) {
832
874
  var r, s, l, a;
833
- const o = e.querySelector(`.${i.classPrefix}-content`);
875
+ const o = t.querySelector(`.${i.classPrefix}-content`);
834
876
  if (n.imgSrc) {
835
- const c = T("img", [
877
+ const c = S("img", [
836
878
  `${i.classPrefix}-image`,
837
879
  `${(s = (r = n.customization) == null ? void 0 : r.imageClass) != null ? s : ""}`
838
880
  ]);
839
881
  c.src = n.imgSrc, o.appendChild(c);
840
882
  }
841
883
  if (n.text) {
842
- const c = T("p", [
884
+ const c = S("p", [
843
885
  `${i.classPrefix}-description`,
844
886
  `${(a = (l = n.customization) == null ? void 0 : l.descriptionClass) != null ? a : ""}`
845
887
  ]);
846
- c.innerText = n.text, o.appendChild(c);
888
+ c.innerText = i.translateFn(n.text), o.appendChild(c);
847
889
  }
848
890
  }
849
891
  }
850
- function Le(t, e, n) {
851
- var l, a, c, f, u, p, d, m, y, g, v, _;
852
- t.innerHTML = "", t.className = `${n.config.classPrefix}`, (l = e.customization) != null && l.class && t.classList.add(e.customization.class);
853
- const i = T("div", [
892
+ function Ee(e, t, n) {
893
+ var l, a, c, h, f, g, u, d, p, w, x, _;
894
+ if (e.innerHTML = "", e.className = `${n.config.classPrefix} ${n.config.animationClass}`, n.config.enableArrow) {
895
+ const m = S("div", [`${n.config.classPrefix}-arrow`]);
896
+ e.appendChild(m);
897
+ }
898
+ (l = t.customization) != null && l.class && e.classList.add(t.customization.class);
899
+ const i = S("div", [
854
900
  `${n.config.classPrefix}-header`,
855
- `${(c = (a = e.customization) == null ? void 0 : a.headerClass) != null ? c : ""}`
901
+ `${(c = (a = t.customization) == null ? void 0 : a.headerClass) != null ? c : ""}`
856
902
  ]);
857
- t.appendChild(i);
858
- const o = T("h1", [
903
+ e.appendChild(i);
904
+ const o = S("h1", [
859
905
  `${n.config.classPrefix}-title`,
860
- `${(u = (f = e.customization) == null ? void 0 : f.titleClass) != null ? u : ""}`
906
+ `${(f = (h = t.customization) == null ? void 0 : h.titleClass) != null ? f : ""}`
861
907
  ]);
862
- if (o.innerHTML = (p = e.title) != null ? p : "", i.appendChild(o), n.config.allowClose) {
863
- const h = T("button", [
908
+ if (o.innerHTML = n.config.translateFn((g = t.title) != null ? g : ""), i.appendChild(o), n.config.allowClose) {
909
+ const m = S("button", [
864
910
  `${n.config.classPrefix}-close`,
865
- `${(m = (d = e.customization) == null ? void 0 : d.closeButtonClass) != null ? m : ""}`
911
+ `${(d = (u = t.customization) == null ? void 0 : u.closeButtonClass) != null ? d : ""}`
866
912
  ]);
867
- be(h, n.config.closeIcon), h.onclick = n.complete.bind(n), i.appendChild(h);
913
+ $e(m, n.config.closeIcon), m.onclick = n.complete.bind(n), i.appendChild(m);
868
914
  }
869
- const r = T("div", [
915
+ const r = S("div", [
870
916
  `${n.config.classPrefix}-content`,
871
- `${(g = (y = e.customization) == null ? void 0 : y.contentClass) != null ? g : ""}`
917
+ `${(w = (p = t.customization) == null ? void 0 : p.contentClass) != null ? w : ""}`
872
918
  ]);
873
- t.appendChild(r);
874
- const s = T("div", [
919
+ e.appendChild(r);
920
+ const s = S("div", [
875
921
  `${n.config.classPrefix}-footer`,
876
- `${(_ = (v = e.customization) == null ? void 0 : v.footerClass) != null ? _ : ""}`
922
+ `${(_ = (x = t.customization) == null ? void 0 : x.footerClass) != null ? _ : ""}`
877
923
  ]);
878
- H(e.buttonList) && (e.buttonList = Ce(n)), e.buttonList.forEach((h) => {
879
- var k;
880
- h.action = h.action.bind(n);
881
- const L = [`${n.config.classPrefix}-button`, (k = h.class) != null ? k : ""];
882
- 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);
883
- const x = T("button", L);
884
- x.innerText = h.text, x.onclick = () => {
885
- h.action();
886
- }, s.appendChild(x);
887
- }), t.appendChild(s);
888
- }
889
- function be(t, e) {
890
- e instanceof HTMLElement ? t.appendChild(e) : t.innerHTML = e.innerHTML;
891
- }
892
- function Ce(t) {
924
+ W(t.buttonList) && (t.buttonList = Ae(n)), t.buttonList.forEach((m) => {
925
+ var B;
926
+ const v = [`${n.config.classPrefix}-button`, (B = m.class) != null ? B : ""];
927
+ W(m.type) || m.type === "secondary" ? v.push(`${n.config.classPrefix}-button-secondary`) : m.type === "primary" ? v.push(`${n.config.classPrefix}-button-primary`) : m.type === "link" && v.push(`${n.config.classPrefix}-button-link`), !W(m.class) && m.class !== "" && v.push(m.class);
928
+ const b = S("button", v);
929
+ b.innerText = n.config.translateFn(m.text), b.onclick = (V) => {
930
+ m.action.call(n);
931
+ }, s.appendChild(b);
932
+ }), e.appendChild(s);
933
+ }
934
+ function $e(e, t) {
935
+ t instanceof HTMLElement ? e.appendChild(t) : e.innerHTML = t.innerHTML;
936
+ }
937
+ function Ae(e) {
893
938
  return [
894
939
  {
895
940
  text: "Back",
896
- action: t.prev
941
+ action: e.prev
897
942
  },
898
943
  {
899
944
  text: "Next",
900
945
  type: "primary",
901
- action: t.next
946
+ action: e.next
902
947
  }
903
948
  ];
904
949
  }
905
- class Se {
950
+ class De {
906
951
  constructor() {
907
- w(this, "_renderContentStrategy", /* @__PURE__ */ new Map());
952
+ y(this, "_renderContentStrategy", /* @__PURE__ */ new Map());
953
+ y(this, "_staticSides", {
954
+ top: "bottom",
955
+ right: "left",
956
+ bottom: "top",
957
+ left: "right"
958
+ });
908
959
  this.setUpStrategies();
909
960
  }
910
961
  /** @inheritdoc */
911
- render(e, n) {
962
+ render(t, n) {
912
963
  return new Promise((i) => {
913
964
  var o, r;
914
965
  if (!this._renderContentStrategy.has(n.popupData.type))
915
966
  throw new Error("Missing popup creator strategy");
916
- e.style.animation = "none", e.style.opacity = "0", n.hostElement ? e.style.position = Mt(n.hostElement) : e.style.position = "fixed", Le(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();
917
- }).then(() => {
918
- var i, o;
919
- return n.isFirst || !n.hasHost && !((i = n.prevStep) != null && i.hasHost) || !n.hasHost && !((o = n.nextStep) != null && o.hasHost) ? Promise.resolve() : xe(400);
920
- }).then(() => {
921
- this.updatePosition(e, n), e.style.opacity = "1", e.style.animation = "fadeIn 0.3s ease-out";
967
+ t.style.display = "none", t.classList.remove(n.tour.config.animationClass), n.hostElement ? t.style.position = jt(n.hostElement) : t.style.position = "fixed", Ee(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();
968
+ }).then(() => n.isFirst && n.direction === "toNext" ? At(0) : At(400)).then(() => {
969
+ t.style.display = "block", this.updatePosition(t, n), t.classList.add(n.tour.config.animationClass);
922
970
  });
923
971
  }
924
972
  /** @inheritdoc */
925
- updatePosition(e, n) {
926
- 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;
927
- (n.popupData.position === "auto" || H(r)) && o.push(ye()), n.hostElement ? we(n.hostElement, e, {
928
- placement: r,
929
- middleware: [...o, ge(20)]
930
- }).then(({ x: s, y: l }) => {
931
- Object.assign(e.style, {
932
- top: `${l - i}px`,
933
- left: `${s}px`,
934
- transform: ""
973
+ updatePosition(t, n) {
974
+ R(n.hostElement) ? this.renderFloatingPopup(t, n) : this.renderCenterPopup(t);
975
+ }
976
+ renderFloatingPopup(t, n) {
977
+ var c;
978
+ const i = t.style.position === "fixed" ? window.scrollY || document.documentElement.scrollTop : 0, o = t.querySelector(`.${n.tour.config.classPrefix}-arrow`), r = [], s = R(n.popupData.position) && n.popupData.position !== "auto" ? n.popupData.position : void 0, l = (c = o == null ? void 0 : o.offsetWidth) != null ? c : 10, a = Math.sqrt(2 * Ct(l, 2)) / 2 + n.tour.config.highlight.padding;
979
+ r.push(Pe(a)), (n.popupData.position === "auto" || W(s)) && r.push(Le()), n.tour.config.enableArrow && R(o) && r.push(Se({ element: o })), Re(n.hostElement, t, {
980
+ placement: s,
981
+ middleware: [...r]
982
+ }).then(({ x: h, y: f, middlewareData: g, placement: u }) => {
983
+ Object.assign(t.style, {
984
+ top: `${f - i}px`,
985
+ left: `${h}px`,
986
+ marginTop: "0",
987
+ marginLeft: "0"
935
988
  });
936
- }) : Object.assign(e.style, {
989
+ const d = u.split("-")[0], p = this._staticSides[d];
990
+ if (g.arrow && R(o)) {
991
+ const { x: w, y: x } = g.arrow;
992
+ Object.assign(o.style, {
993
+ left: w != null ? `${w}px` : "",
994
+ top: x != null ? `${x}px` : "",
995
+ right: "",
996
+ bottom: "",
997
+ [p]: `${-l / 2}px`,
998
+ transform: "rotate(45deg)"
999
+ });
1000
+ }
1001
+ });
1002
+ }
1003
+ renderCenterPopup(t) {
1004
+ Object.assign(t.style, {
937
1005
  top: "50%",
938
1006
  left: "50%",
939
- transform: "translate(-50%, -50%)"
1007
+ marginTop: `-${t.clientHeight / 2}px`,
1008
+ marginLeft: `-${t.clientWidth / 2}px`
940
1009
  });
941
1010
  }
942
1011
  setUpStrategies() {
943
- this._renderContentStrategy.set("text", new _e()), this._renderContentStrategy.set("custom", new ve());
1012
+ this._renderContentStrategy.set("text", new Oe()), this._renderContentStrategy.set("custom", new Te());
944
1013
  }
945
1014
  }
946
- class Re {
1015
+ class ke {
947
1016
  /** @inheritdoc */
948
- render(e, n) {
1017
+ render(t, n) {
949
1018
  return new Promise((i) => {
950
- n.hostElement && (e.style.position = Mt(n.hostElement)), i();
1019
+ n.hostElement && (t.style.position = jt(n.hostElement)), i();
951
1020
  }).then(() => {
952
- this.updatePosition(e, n);
1021
+ this.updatePosition(t, n);
953
1022
  });
954
1023
  }
955
1024
  /** @inheritdoc */
956
- updatePosition(e, n) {
957
- var l, a, c, f;
1025
+ updatePosition(t, n) {
1026
+ var s, l;
958
1027
  if (!n.hostElement) {
959
- 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";
1028
+ 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";
960
1029
  return;
961
1030
  }
962
- 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;
963
- 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`;
1031
+ const i = n.hostElement.getBoundingClientRect(), o = (l = (s = n.tour.config.highlight) == null ? void 0 : s.padding) != null ? l : 8, r = t.style.position === "fixed" ? 0 : window.scrollY || document.documentElement.scrollTop;
1032
+ t.style.transform = "", t.style.borderWidth = "2px", t.style.left = `${i.left - o}px`, t.style.top = `${i.top + r - o}px`, t.style.width = `${i.width + 2 * o}px`, t.style.height = `${i.height + 2 * o}px`;
964
1033
  }
965
1034
  }
966
- class Te {
967
- constructor(e, n) {
968
- w(this, "id");
969
- w(this, "popupData");
970
- w(this, "tour");
971
- w(this, "_hostElement", null);
972
- w(this, "_hostData");
973
- w(this, "_popupRenderer");
974
- w(this, "_helperRenderer");
975
- this.id = n.id, this.popupData = n.popup, this.tour = e, this._hostData = n.host, this._popupRenderer = e.popupRenderer, this._helperRenderer = e.helperRenderer;
1035
+ class Me {
1036
+ constructor(t, n) {
1037
+ y(this, "id");
1038
+ y(this, "popupData");
1039
+ y(this, "tour");
1040
+ y(this, "index");
1041
+ y(this, "_hostElement", null);
1042
+ y(this, "_direction", "toNext");
1043
+ y(this, "_hostData");
1044
+ y(this, "_popupRenderer");
1045
+ y(this, "_highlightRenderer");
1046
+ var i;
1047
+ 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;
976
1048
  }
977
1049
  get isFirst() {
978
- return this.tour.stepList.indexOf(this) === 0;
1050
+ return this.index === 0;
979
1051
  }
980
1052
  get nextStep() {
981
- var e;
982
- return (e = this.tour.stepList[this.tour.stepList.indexOf(this) + 1]) != null ? e : null;
1053
+ var t;
1054
+ return (t = this.tour.stepList[this.tour.stepList.indexOf(this) + 1]) != null ? t : null;
983
1055
  }
984
1056
  get prevStep() {
985
- var e;
986
- return (e = this.tour.stepList[this.tour.stepList.indexOf(this) - 1]) != null ? e : null;
1057
+ var t;
1058
+ return (t = this.tour.stepList[this.tour.stepList.indexOf(this) - 1]) != null ? t : null;
1059
+ }
1060
+ get direction() {
1061
+ return this._direction;
987
1062
  }
988
1063
  get hasHost() {
989
- return B(this._hostElement);
1064
+ return R(this._hostElement);
990
1065
  }
991
1066
  get hostElement() {
992
1067
  return this._hostElement;
993
1068
  }
994
- show() {
995
- return A(this, null, function* () {
996
- var e;
997
- H(this.tour.popup) || H(this.tour.helperLayout) || (this._hostData && (this._hostElement = this.resolveHostElement(
998
- typeof this._hostData == "function" ? this._hostData() : (e = this._hostData) != null ? e : null
999
- )), yield Promise.all([
1000
- this._helperRenderer.render(this.tour.helperLayout, this),
1001
- this._popupRenderer.render(this.tour.popup, this)
1002
- ]));
1069
+ show(t) {
1070
+ return k(this, null, function* () {
1071
+ var i;
1072
+ if (W(this.tour.popup))
1073
+ return;
1074
+ this._direction = t, this._hostData && (this._hostElement = this.resolveHostElement(
1075
+ typeof this._hostData == "function" ? this._hostData() : (i = this._hostData) != null ? i : null
1076
+ ));
1077
+ const n = [this._popupRenderer.render(this.tour.popup, this)];
1078
+ !this.tour.config.highlight.disable && !W(this.tour.highlight) && n.push(this._highlightRenderer.render(this.tour.highlight, this)), yield Promise.all(n);
1003
1079
  });
1004
1080
  }
1005
- resolveHostElement(e) {
1006
- return typeof this._hostData == "string" ? document.querySelector(this._hostData) : e;
1081
+ resolveHostElement(t) {
1082
+ return typeof this._hostData == "string" ? document.querySelector(this._hostData) : t;
1007
1083
  }
1008
1084
  }
1009
- function Ee(t) {
1085
+ function Fe(e) {
1010
1086
  return {
1011
1087
  innerHTML: `
1012
1088
  <svg
1013
1089
  xmlns="http://www.w3.org/2000/svg"
1014
1090
  fill="none"
1015
1091
  viewBox="0 0 162 162"
1016
- class="${t}-close-icon"
1092
+ class="${e}-close-icon"
1017
1093
  >
1018
1094
  <path
1019
1095
  stroke-linecap="round"
@@ -1031,36 +1107,37 @@ function Ee(t) {
1031
1107
  `
1032
1108
  };
1033
1109
  }
1034
- class $e {
1035
- constructor(e) {
1036
- w(this, "popupRenderer", new Se());
1037
- w(this, "helperRenderer", new Re());
1038
- /**
1039
- * TODO remove
1040
- * @deprecated remove later
1041
- */
1042
- w(this, "isStarted", !1);
1043
- w(this, "_popup", null);
1044
- w(this, "_helperLayout", null);
1045
- w(this, "_stepList", []);
1046
- w(this, "_activeStep", null);
1047
- w(this, "_bodyResizeObserver");
1048
- w(this, "_config");
1049
- w(this, "_stepMap", /* @__PURE__ */ new Map());
1050
- var n, i, o, r, s, l, a, c, f;
1110
+ class He {
1111
+ constructor(t) {
1112
+ y(this, "popupRenderer", new De());
1113
+ y(this, "highlightRenderer", new ke());
1114
+ y(this, "_popup", null);
1115
+ y(this, "_highlight", null);
1116
+ y(this, "_stepList", []);
1117
+ y(this, "_activeStep", null);
1118
+ y(this, "_bodyResizeObserver");
1119
+ y(this, "_config");
1120
+ y(this, "_stepMap", /* @__PURE__ */ new Map());
1121
+ var n, i, o, r, s, l, a, c, h, f, g, u, d, p, w;
1051
1122
  this._bodyResizeObserver = this.getBodyResizeObserver(), this._config = {
1052
- classPrefix: (n = e.classPrefix) != null ? n : "siteguide",
1053
- allowClose: (i = e.allowClose) != null ? i : !0,
1054
- scrollTo: (o = e.scrollTo) != null ? o : {
1123
+ classPrefix: (n = t.classPrefix) != null ? n : "siteguide",
1124
+ animationClass: (i = t.animationClass) != null ? i : "siteguide-animation",
1125
+ allowClose: (o = t.allowClose) != null ? o : !0,
1126
+ // @ts-expect-error
1127
+ scrollTo: (r = t.scrollTo) != null ? r : {
1055
1128
  behavior: "smooth",
1056
1129
  block: "center",
1057
1130
  inline: "center"
1058
1131
  },
1059
- closeIcon: (s = e.closeIcon) != null ? s : Ee((r = e.classPrefix) != null ? r : "siteguide"),
1060
- helperLayout: {
1061
- paddingX: (a = (l = e.helperLayout) == null ? void 0 : l.paddingX) != null ? a : 8,
1062
- paddingY: (f = (c = e.helperLayout) == null ? void 0 : c.paddingY) != null ? f : 8
1063
- }
1132
+ allowClickoutClose: (s = t.allowClickoutClose) != null ? s : !1,
1133
+ closeIcon: (a = t.closeIcon) != null ? a : Fe((l = t.classPrefix) != null ? l : "siteguide"),
1134
+ enableArrow: (c = t.enableArrow) != null ? c : !0,
1135
+ highlight: {
1136
+ disable: (f = (h = t.highlight) == null ? void 0 : h.disable) != null ? f : !1,
1137
+ padding: (u = (g = t.highlight) == null ? void 0 : g.padding) != null ? u : 8,
1138
+ class: (p = (d = t.highlight) == null ? void 0 : d.class) != null ? p : "siteguide-highlight"
1139
+ },
1140
+ translateFn: (w = t.translateFn) != null ? w : (x) => x
1064
1141
  };
1065
1142
  }
1066
1143
  get stepList() {
@@ -1072,52 +1149,57 @@ class $e {
1072
1149
  get popup() {
1073
1150
  return this._popup;
1074
1151
  }
1075
- get helperLayout() {
1076
- return this._helperLayout;
1152
+ get highlight() {
1153
+ return this._highlight;
1077
1154
  }
1078
- addStep(e) {
1079
- if (this._stepMap.has(e.id))
1155
+ addStep(t) {
1156
+ if (this._stepMap.has(t.id))
1080
1157
  throw new Error("Step with provided id has been already registered");
1081
- const n = new Te(this, e);
1082
- this._stepList.push(n), this._stepMap.set(e.id, n);
1158
+ const n = new Me(this, t);
1159
+ R(t.index) ? this._stepList.splice(t.index, 0, n) : this._stepList.push(n), this._stepMap.set(t.id, n);
1083
1160
  }
1084
- addSteps(e) {
1085
- e.forEach((n) => this.addStep(n));
1161
+ addSteps(t) {
1162
+ t.forEach((n) => this.addStep(n));
1086
1163
  }
1087
- removeStep(e) {
1088
- this._stepList = this._stepList.filter((n) => e !== n.id), this._stepMap.delete(e);
1164
+ removeStep(t) {
1165
+ this._stepList = this._stepList.filter((n) => t !== n.id), this._stepMap.delete(t);
1089
1166
  }
1090
1167
  start() {
1091
- this.isStarted = !0, this._popup = T("div", [this._config.classPrefix]), document.body.appendChild(this._popup), this._helperLayout = T("div", [`${this._config.classPrefix}-helper`]), document.body.appendChild(this._helperLayout), this.next();
1168
+ this._popup = S("div", [this._config.classPrefix]), document.body.appendChild(this._popup), this._config.highlight.disable || (this._highlight = S("div", [
1169
+ R(this._config.highlight.class) ? this._config.highlight.class : `${this._config.classPrefix}-highlight`
1170
+ ]), document.body.appendChild(this._highlight)), this.next();
1092
1171
  }
1093
1172
  complete() {
1094
- this.isStarted = !1, this._popup && document.body.removeChild(this._popup), this._helperLayout && document.body.removeChild(this._helperLayout), this._activeStep = null;
1173
+ this._popup && document.body.removeChild(this._popup), this._highlight && document.body.removeChild(this._highlight), this._activeStep = null;
1095
1174
  }
1096
1175
  prev() {
1097
- const e = B(this._activeStep) ? this._stepList.indexOf(this._activeStep) - 1 : this._stepList.indexOf(this._stepList[this._stepList.length - 1]);
1098
- if (e < 0) {
1176
+ const t = R(this._activeStep) ? this._stepList.indexOf(this._activeStep) - 1 : this._stepList.indexOf(this._stepList[this._stepList.length - 1]);
1177
+ if (t < 0) {
1099
1178
  this.complete();
1100
1179
  return;
1101
1180
  }
1102
- this._activeStep = this._stepList[e], this._activeStep.show();
1181
+ this._activeStep = this._stepList[t], this._activeStep.show("fromBack");
1103
1182
  }
1104
1183
  next() {
1105
- const e = B(this._activeStep) ? this._stepList.indexOf(this._activeStep) + 1 : this._stepList.indexOf(this._stepList[0]);
1106
- if (e >= this._stepList.length) {
1184
+ const t = R(this._activeStep) ? this._stepList.indexOf(this._activeStep) + 1 : this._stepList.indexOf(this._stepList[0]);
1185
+ if (t >= this._stepList.length) {
1107
1186
  this.complete();
1108
1187
  return;
1109
1188
  }
1110
- this._activeStep = this._stepList[e], this._activeStep.show();
1189
+ this._activeStep = this._stepList[t], this._activeStep.show("toNext");
1190
+ }
1191
+ setConfig(t) {
1192
+ this._config = L(L({}, this._config), t);
1111
1193
  }
1112
1194
  getBodyResizeObserver() {
1113
- const e = new ResizeObserver(() => {
1114
- !this.isStarted || !this._activeStep || (B(this._popup) && this.popupRenderer.updatePosition(this._popup, this._activeStep), B(this._helperLayout) && this.helperRenderer.updatePosition(this._helperLayout, this._activeStep));
1195
+ const t = new ResizeObserver(() => {
1196
+ this._activeStep && (R(this._popup) && this.popupRenderer.updatePosition(this._popup, this._activeStep), R(this._highlight) && !this.config.highlight.disable && this.highlightRenderer.updatePosition(this._highlight, this._activeStep));
1115
1197
  });
1116
- return e.observe(document.body), e;
1198
+ return t.observe(document.body), t;
1117
1199
  }
1118
1200
  }
1119
1201
  export {
1120
- $e as Tour,
1121
- Te as TourStep,
1122
- T as createElement
1202
+ He as Tour,
1203
+ Me as TourStep,
1204
+ S as createElement
1123
1205
  };