@telia-ace/widget-types-grid 1.0.23 → 1.0.24

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.js CHANGED
@@ -1,70 +1,71 @@
1
- var Oe = Object.defineProperty, Se = Object.defineProperties;
2
- var xe = Object.getOwnPropertyDescriptors;
3
- var W = Object.getOwnPropertySymbols;
4
- var ce = Object.prototype.hasOwnProperty, le = Object.prototype.propertyIsEnumerable;
5
- var ae = (t, e, n) => e in t ? Oe(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, f = (t, e) => {
6
- for (var n in e || (e = {}))
7
- ce.call(e, n) && ae(t, n, e[n]);
8
- if (W)
9
- for (var n of W(e))
10
- le.call(e, n) && ae(t, n, e[n]);
1
+ var ve = Object.defineProperty, Ee = Object.defineProperties;
2
+ var Ce = Object.getOwnPropertyDescriptors;
3
+ var F = Object.getOwnPropertySymbols;
4
+ var re = Object.prototype.hasOwnProperty, ae = Object.prototype.propertyIsEnumerable;
5
+ var Z = (t, n, e) => n in t ? ve(t, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[n] = e, m = (t, n) => {
6
+ for (var e in n || (n = {}))
7
+ re.call(n, e) && Z(t, e, n[e]);
8
+ if (F)
9
+ for (var e of F(n))
10
+ ae.call(n, e) && Z(t, e, n[e]);
11
11
  return t;
12
- }, E = (t, e) => Se(t, xe(e));
13
- var M = (t, e) => {
14
- var n = {};
15
- for (var i in t)
16
- ce.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
17
- if (t != null && W)
18
- for (var i of W(t))
19
- e.indexOf(i) < 0 && le.call(t, i) && (n[i] = t[i]);
20
- return n;
12
+ }, C = (t, n) => Ee(t, Ce(n));
13
+ var N = (t, n) => {
14
+ var e = {};
15
+ for (var s in t)
16
+ re.call(t, s) && n.indexOf(s) < 0 && (e[s] = t[s]);
17
+ if (t != null && F)
18
+ for (var s of F(t))
19
+ n.indexOf(s) < 0 && ae.call(t, s) && (e[s] = t[s]);
20
+ return e;
21
21
  };
22
- import { asDescriptor as ue, ComponentPlatform as Ae, createComponentModel as De, ComponentQuery as Me, WidgetRenderState as C } from "@telia-ace/widget-core";
23
- import { Grid as pe, useRouteData as Ne, useRouter as Le, useProperties as me, useContext as te, useContainer as j, useComponentNode as ne, useScroll as fe, transitionComposer as $e, paddedBorderTabStyle as ke, useComponent as Pe, useComponentDescriptor as Re, filterCssPropsStyle as Ve, Typography as _e, useComponentPlatform as ge, useIsMounted as Ie, useColumns as ze, useLayout as Te, ComponentNodeContext as Be, ComponentPropertyContext as je, filterCssProps as Ge } from "@telia-ace/widget-ui";
24
- import d, { useState as T, forwardRef as ye, useMemo as He, Suspense as We, useEffect as B, useContext as Fe } from "react";
25
- import R, { css as be, ThemeContext as we, ThemeProvider as Ke } from "styled-components";
26
- import { appendClassNames as U, notifyDataLoaded as Ue, lock as Z, removeNullAndUndefinedValues as he, uuid as Ye } from "@telia-ace/widget-utilities";
27
- import { TransitionGroup as qe, Transition as Qe } from "react-transition-group";
28
- import { Switch as Ze, Route as J } from "react-router";
29
- import { onWidgetUrl as Je } from "@telia-ace/widget-routing";
30
- import { readStorage as N, StorageMedium as v, createStorageWriter as _, StorageCategory as I, StorageScope as Xe } from "@telia-ace/widget-services";
31
- import { supportBootstrapping as et } from "@webprovisions/bootstrapping";
32
- import { WidgetState as tt, WidgetType as nt } from "@webprovisions/platform";
33
- var ee = /* @__PURE__ */ ((t) => (t.back = "back", t.forth = "forth", t))(ee || {});
34
- const it = (t, e, n) => typeof n[t] == "number" && typeof n[e] == "number" && n[t] > n[e] ? "back" : "forth", ve = ({ views: t, location: e, render: n }) => /* @__PURE__ */ d.createElement(Ze, {
35
- location: e && E(f({}, e), {
36
- pathname: e.pathname.split("?")[0]
22
+ var $ = (t, n, e) => (Z(t, typeof n != "symbol" ? n + "" : n, e), e);
23
+ import { asDescriptor as ce, ComponentPlatform as Oe, createComponentModel as Se, ComponentQuery as xe, WidgetRenderState as O } from "@telia-ace/widget-core";
24
+ import { Grid as de, useRouteData as Ae, useRouter as De, useProperties as he, useContext as ne, useContainer as T, useComponentNode as se, useScroll as pe, transitionComposer as Me, paddedBorderTabStyle as Ne, useComponent as Le, useComponentDescriptor as $e, filterCssPropsStyle as ke, Typography as Pe, useComponentPlatform as me, useIsMounted as Re, useColumns as Ve, useLayout as _e, ComponentNodeContext as Ie, ComponentPropertyContext as ze, filterCssProps as Be } from "@telia-ace/widget-ui";
25
+ import d, { useState as B, forwardRef as fe, useMemo as je, Suspense as Te, useEffect as j, useContext as Ge } from "react";
26
+ import P, { css as ge, ThemeProvider as He, ThemeContext as We } from "styled-components";
27
+ import { appendClassNames as Y, notifyDataLoaded as Fe, lock as J, removeNullAndUndefinedValues as le, uuid as Ke } from "@telia-ace/widget-utilities";
28
+ import { TransitionGroup as Ue, Transition as Ye } from "react-transition-group";
29
+ import { Switch as qe, Route as X } from "react-router";
30
+ import { onWidgetUrl as Qe } from "@telia-ace/widget-routing";
31
+ import { readStorage as L, StorageMedium as E, createStorageWriter as _, StorageCategory as I, StorageScope as Ze } from "@telia-ace/widget-services";
32
+ import { supportBootstrapping as Je } from "@webprovisions/bootstrapping";
33
+ import { WidgetState as Xe, WidgetType as et } from "@webprovisions/platform";
34
+ var te = /* @__PURE__ */ ((t) => (t.back = "back", t.forth = "forth", t))(te || {});
35
+ const tt = (t, n, e) => typeof e[t] == "number" && typeof e[n] == "number" && e[t] > e[n] ? "back" : "forth", ye = ({ views: t, location: n, render: e }) => /* @__PURE__ */ d.createElement(qe, {
36
+ location: n && C(m({}, n), {
37
+ pathname: n.pathname.split("?")[0]
37
38
  })
38
39
  }, [
39
- ...Object.keys(t).filter((i) => !!t[i].path),
40
- ...Object.keys(t).filter((i) => !t[i].path)
41
- ].map((i) => {
42
- const { path: s } = t[i];
43
- return s ? Array.isArray(s) ? s.map((o) => /* @__PURE__ */ d.createElement(J, {
44
- key: i,
40
+ ...Object.keys(t).filter((s) => !!t[s].path),
41
+ ...Object.keys(t).filter((s) => !t[s].path)
42
+ ].map((s) => {
43
+ const { path: i } = t[s];
44
+ return i ? Array.isArray(i) ? i.map((o) => /* @__PURE__ */ d.createElement(X, {
45
+ key: s,
45
46
  exact: !0,
46
47
  path: o,
47
- render: () => n(i)
48
- })) : /* @__PURE__ */ d.createElement(J, {
49
- key: i,
48
+ render: () => e(s)
49
+ })) : /* @__PURE__ */ d.createElement(X, {
50
+ key: s,
50
51
  exact: !0,
51
- path: s,
52
- render: () => n(i)
53
- }) : /* @__PURE__ */ d.createElement(J, {
54
- key: i,
55
- render: () => n(i)
52
+ path: i,
53
+ render: () => e(s)
54
+ }) : /* @__PURE__ */ d.createElement(X, {
55
+ key: s,
56
+ render: () => e(s)
56
57
  });
57
- })), st = R.div`
58
+ })), nt = P.div`
58
59
  position: relative;
59
60
  width: 100%;
60
61
  flex: 1;
61
- `, ot = R(pe)`
62
+ `, st = P(de)`
62
63
  position: absolute;
63
64
  left: 0;
64
65
  right: 0;
65
66
  ${(t) => !!t.animationCss && t.animationCss}
66
67
  ${(t) => !!t.scrollableCss && t.scrollableCss}
67
- `, rt = {
68
+ `, it = {
68
69
  index: 1,
69
70
  search: 2,
70
71
  browse: 3,
@@ -72,90 +73,91 @@ const it = (t, e, n) => typeof n[t] == "number" && typeof n[e] == "number" && n[
72
73
  contact: 5,
73
74
  "contact-method": 6,
74
75
  conversation: 7
75
- }, at = (n) => {
76
- var i = n, { className: t = "" } = i, e = M(i, ["className"]);
77
- const [s, o] = T("index"), [r, c] = T(ee.forth), a = Ne(), l = Le(), h = me(), u = te(), p = j(), g = ne(), { gap: m = "0" } = u, O = h, { columns: b = 1, animation: y = "none", scrollable: S = !1 } = O, L = M(O, ["columns", "animation", "scrollable"]), [x, $] = fe(S);
78
- if (!g || !l)
76
+ }, ot = (e) => {
77
+ var s = e, { className: t = "" } = s, n = N(s, ["className"]);
78
+ const [i, o] = B("index"), [r, a] = B(te.forth), c = Ae(), h = De(), l = he(), u = ne(), p = T(), f = se(), { gap: w = "0" } = u, W = l, { columns: y = 1, animation: g = "none", scrollable: b = !1 } = W, S = N(W, ["columns", "animation", "scrollable"]), [G, R] = pe(b);
79
+ if (!f || !h)
79
80
  return null;
80
- const { location: q } = l;
81
- a.name !== s && a.name !== "" && y && (c(it(s, a.name, rt)), o(a.name));
82
- const { views: V } = p.get("$settings");
83
- if (!Object.keys(V).length)
81
+ const { location: H } = h;
82
+ c.name !== i && c.name !== "" && g && (a(tt(i, c.name, it)), o(c.name));
83
+ const { views: A } = p.get("$settings");
84
+ if (!Object.keys(A).length)
84
85
  return null;
85
- const oe = (w, k, z) => {
86
- const G = D(k, z), H = g.getChildren(w)[0];
87
- return /* @__PURE__ */ d.createElement(ot, E(f(E(f(f({}, e), L), {
88
- scrollableCss: x,
89
- ref: $,
90
- columns: b,
91
- gap: m
92
- }), G), {
93
- className: U(t, "humany-view")
86
+ const D = (v, M, V) => {
87
+ const x = Q(M, V), z = f.getChildren(v)[0];
88
+ return /* @__PURE__ */ d.createElement(st, C(m(C(m(m({}, n), S), {
89
+ scrollableCss: G,
90
+ ref: R,
91
+ columns: y,
92
+ gap: w
93
+ }), x), {
94
+ className: Y(t, "humany-view")
94
95
  }), /* @__PURE__ */ d.createElement(ie, {
95
- id: H.id,
96
+ id: z.id,
96
97
  branch: "default"
97
98
  }));
98
- }, D = (w, k) => {
99
- if (y === "slide" || y === "fade")
99
+ }, Q = (v, M) => {
100
+ if (g === "slide" || g === "fade")
100
101
  return {
101
- animationCss: $e.composeViewTransition(w, y, k),
102
- ["data-state"]: w
102
+ animationCss: Me.composeViewTransition(
103
+ v,
104
+ g,
105
+ M
106
+ ),
107
+ ["data-state"]: v
103
108
  };
104
109
  };
105
- return /* @__PURE__ */ d.createElement(st, {
110
+ return /* @__PURE__ */ d.createElement(nt, {
106
111
  className: "humany-animated-view"
107
- }, /* @__PURE__ */ d.createElement(qe, {
112
+ }, /* @__PURE__ */ d.createElement(Ue, {
108
113
  component: null,
109
- childFactory: (w) => d.cloneElement(w, { direction: r })
110
- }, /* @__PURE__ */ d.createElement(Qe, {
111
- key: s,
114
+ childFactory: (v) => d.cloneElement(v, { direction: r })
115
+ }, /* @__PURE__ */ d.createElement(Ye, {
116
+ key: i,
112
117
  timeout: { enter: 500, exit: 500 },
113
- onEnter: (w) => w == null ? void 0 : w.clientHeight,
118
+ onEnter: (v) => v == null ? void 0 : v.clientHeight,
114
119
  unmountOnExit: !0,
115
- direction: ee.forth
116
- }, (w, { direction: k }) => /* @__PURE__ */ d.createElement(ve, {
117
- views: V,
118
- location: q,
119
- render: (z) => oe(z, w, k)
120
+ direction: te.forth
121
+ }, (v, { direction: M }) => /* @__PURE__ */ d.createElement(ye, {
122
+ views: A,
123
+ location: H,
124
+ render: (V) => D(V, v, M)
120
125
  }))));
121
- }, ct = R(pe)`
126
+ }, rt = P(de)`
122
127
  ${(t) => !!t.scrollableCss && t.scrollableCss}
123
- `, lt = (n) => {
124
- var i = n, { className: t = "" } = i, e = M(i, ["className"]);
125
- const s = me(), o = te(), r = j(), c = ne(), { views: a } = r.get("$settings"), { gap: l = "0" } = o, y = s, { columns: h = 1, animation: u = "none", scrollable: p = !1 } = y, g = M(y, ["columns", "animation", "scrollable"]), [m, b] = fe(p);
126
- return c ? /* @__PURE__ */ d.createElement(ct, E(f(f({}, e), g), {
127
- scrollableCss: m,
128
- ref: b,
129
- columns: h,
130
- gap: l,
131
- className: U(t, "humany-view")
132
- }), /* @__PURE__ */ d.createElement(ve, {
133
- views: a,
134
- render: (S) => {
135
- const L = c.getChildren(S)[0];
128
+ `, at = (e) => {
129
+ var s = e, { className: t = "" } = s, n = N(s, ["className"]);
130
+ const i = he(), o = ne(), r = T(), a = se(), { views: c } = r.get("$settings"), { gap: h = "0" } = o, g = i, { columns: l = 1, animation: u = "none", scrollable: p = !1 } = g, f = N(g, ["columns", "animation", "scrollable"]), [w, y] = pe(p);
131
+ return a ? /* @__PURE__ */ d.createElement(rt, C(m(m({}, n), f), {
132
+ scrollableCss: w,
133
+ ref: y,
134
+ columns: l,
135
+ gap: h,
136
+ className: Y(t, "humany-view")
137
+ }), /* @__PURE__ */ d.createElement(ye, {
138
+ views: c,
139
+ render: (b) => {
140
+ const S = a.getChildren(b)[0];
136
141
  return /* @__PURE__ */ d.createElement(ie, {
137
- id: L.id,
138
- node: L,
142
+ id: S.id,
143
+ node: S,
139
144
  branch: "default"
140
145
  });
141
146
  }
142
147
  })) : null;
143
- }, Y = be`
148
+ }, q = ge`
144
149
  outline: none;
145
150
  box-sizing: border-box;
146
151
  * {
147
- ${(t) => {
148
- var e;
149
- return !((e = t.theme.accessibility) != null && e.isTabbing) && "outline: none;";
150
- }}
151
152
  box-sizing: border-box;
153
+ outline: none;
152
154
  }
153
155
 
154
156
  grid-column: ${(t) => t["data-indent"] ? `${t["data-indent"] + 1} / ${t["data-indent"] + t["data-width"] + 1}` : `span ${t["data-width"]}`};
155
157
 
156
158
  ${(t) => {
157
- var e;
158
- return ((e = t.theme.fonts) == null ? void 0 : e.type) && `
159
+ var n;
160
+ return ((n = t.theme.fonts) == null ? void 0 : n.type) && `
159
161
  font-family: ${t.theme.fonts.type};
160
162
 
161
163
  input, textarea {
@@ -165,239 +167,234 @@ const it = (t, e, n) => typeof n[t] == "number" && typeof n[e] == "number" && n[
165
167
  }}
166
168
 
167
169
  ${(t) => {
168
- var e;
169
- return ((e = t.theme.fonts) == null ? void 0 : e.base) && `
170
+ var n;
171
+ return ((n = t.theme.fonts) == null ? void 0 : n.base) && `
170
172
  font-size: ${t.theme.fonts.base};
171
173
  `;
172
174
  }}
173
175
 
174
- &:focus {
175
- ${(t) => {
176
- var e;
177
- return ((e = t.theme.accessibility) == null ? void 0 : e.isTabbing) && ke;
178
- }};
176
+ &:focus-visible {
177
+ ${Ne};
179
178
  }
180
- `, ut = R(lt)`
181
- ${Y}
182
- `, ht = R(at)`
183
- ${Y}
184
- `, dt = R.div`
179
+ `, ct = P(at)`
180
+ ${q}
181
+ `, lt = P(ot)`
182
+ ${q}
183
+ `, ut = P.div`
185
184
  text-align: center;
186
185
  ${(t) => {
187
- var e, n, i;
188
- return typeof ((e = t.theme.colors) == null ? void 0 : e.warning) != "undefined" && be`
189
- color: ${(n = t.theme.colors) == null ? void 0 : n.warning};
190
- border: 2px dashed ${(i = t.theme.colors) == null ? void 0 : i.warning};
186
+ var n, e, s;
187
+ return typeof ((n = t.theme.colors) == null ? void 0 : n.warning) != "undefined" && ge`
188
+ color: ${(e = t.theme.colors) == null ? void 0 : e.warning};
189
+ border: 2px dashed ${(s = t.theme.colors) == null ? void 0 : s.warning};
191
190
  `;
192
191
  }}
193
192
  ${(t) => typeof t.theme.borderRadius != "undefined" && `border-radius: ${t.theme.borderRadius};`}
194
- ${Y}
195
- `, pt = ye((s, i) => {
196
- var o = s, { className: t = "", children: e } = o, n = M(o, ["className", "children"]);
197
- const r = Pe(), { name: c, type: a, id: l } = Re(), h = He(() => r ? R(r)`
198
- ${Y}
199
- ${Ve}
193
+ ${q}
194
+ `, dt = fe(
195
+ (i, s) => {
196
+ var o = i, { className: t = "", children: n } = o, e = N(o, ["className", "children"]);
197
+ const r = Le(), { name: a, type: c, id: h } = $e(), l = je(() => r ? P(r)`
198
+ ${q}
199
+ ${ke}
200
200
  ` : null, [r]);
201
- return typeof r == "undefined" ? null : r === null || h === null ? process.env.NODE_ENV !== "production" ? /* @__PURE__ */ d.createElement(dt, E(f({}, n), {
202
- title: `type: ${a}, definition-id: ${c}, instance-id: ${l}`,
203
- className: U(t, "humany-non-resolved-component")
204
- }), /* @__PURE__ */ d.createElement(_e, {
205
- variant: "h5"
206
- }, "Non Resolved Component Type")) : null : /* @__PURE__ */ d.createElement(We, {
207
- fallback: null
208
- }, /* @__PURE__ */ d.createElement(h, E(f({
209
- ref: i
210
- }, n), {
211
- className: U(t, "humany-component", `humany-component-${c}`)
212
- }), e));
213
- }), mt = (t) => {
214
- const e = ne(t), n = ge(), [i, s] = T({}), o = Ie();
215
- return B(() => {
216
- e && o.current && s(e.attributes.properties);
217
- }, [e, t, o]), B(() => {
218
- if (n) {
219
- const r = n.events.subscribe("components:properties-changed", (c, a) => {
220
- e === a.node && o.current && s(a.node.attributes.properties);
221
- });
201
+ return typeof r == "undefined" ? null : r === null || l === null ? process.env.NODE_ENV !== "production" ? /* @__PURE__ */ d.createElement(ut, C(m({}, e), {
202
+ title: `type: ${c}, definition-id: ${a}, instance-id: ${h}`,
203
+ className: Y(t, "humany-non-resolved-component")
204
+ }), /* @__PURE__ */ d.createElement(Pe, {
205
+ variant: "h5"
206
+ }, "Non Resolved Component Type")) : null : /* @__PURE__ */ d.createElement(Te, {
207
+ fallback: null
208
+ }, /* @__PURE__ */ d.createElement(l, C(m({
209
+ ref: s
210
+ }, e), {
211
+ className: Y(
212
+ t,
213
+ "humany-component",
214
+ `humany-component-${a}`
215
+ )
216
+ }), n));
217
+ }
218
+ ), ht = (t) => {
219
+ const n = se(t), e = me(), [s, i] = B({}), o = Re();
220
+ return j(() => {
221
+ n && o.current && i(n.attributes.properties);
222
+ }, [n, t, o]), j(() => {
223
+ if (e) {
224
+ const r = e.events.subscribe(
225
+ "components:properties-changed",
226
+ (a, c) => {
227
+ n === c.node && o.current && i(c.node.attributes.properties);
228
+ }
229
+ );
222
230
  return () => {
223
231
  r();
224
232
  };
225
233
  }
226
- }, [n, o, t, e]), i;
227
- }, ft = (t, e) => e ? !0 : typeof t == "string" ? t === "full" : t > 0, ie = ye((h, l) => {
228
- var u = h, {
229
- className: t = "",
230
- isTabbing: e = !1,
231
- id: n,
232
- branch: i,
233
- node: s,
234
- ariaLabel: o,
235
- tabIndex: r,
236
- context: c
237
- } = u, a = M(u, [
238
- "className",
239
- "isTabbing",
240
- "id",
241
- "branch",
242
- "node",
243
- "ariaLabel",
244
- "tabIndex",
245
- "context"
246
- ]);
247
- var re;
248
- const p = ge(), g = j(), [m, b] = T(), y = d.useContext(we) || {}, S = ze(), L = te(n), x = mt(n), { size: $ = "none", indent: q = 0 } = Te(n), V = ft($, s);
249
- if (B(() => {
250
- if (p) {
251
- if (n && !s) {
252
- const A = p.nodes.get(n);
253
- if (A && (b(ue(A, i)), V)) {
254
- const Q = A.mount(g);
234
+ }, [e, o, t, n]), s;
235
+ }, pt = (t, n) => n ? !0 : typeof t == "string" ? t === "full" : t > 0, ie = fe(
236
+ (h, c) => {
237
+ var l = h, { className: t = "", id: n, branch: e, node: s, ariaLabel: i, tabIndex: o, context: r } = l, a = N(l, ["className", "id", "branch", "node", "ariaLabel", "tabIndex", "context"]);
238
+ const u = me(), p = T(), [f, w] = B(), y = Ve(), g = ne(n), b = ht(n), { size: S = "none", indent: G = 0 } = _e(n), R = pt(S, s);
239
+ if (j(() => {
240
+ if (u) {
241
+ if (n && !s) {
242
+ const x = u.nodes.get(n);
243
+ if (x && (w(ce(x, e)), R)) {
244
+ const z = x.mount(p);
245
+ return () => {
246
+ z();
247
+ };
248
+ }
249
+ } else if (s) {
250
+ w(ce(s, e));
251
+ const x = s.mount(p);
255
252
  return () => {
256
- Q();
253
+ x();
257
254
  };
258
255
  }
259
- } else if (s) {
260
- b(ue(s, i));
261
- const A = s.mount(g);
262
- return () => {
263
- A();
264
- };
265
256
  }
266
- }
267
- }, [p, n, s, V]), !m || !V)
268
- return null;
269
- const H = f(f({}, L), c || {}), {
270
- cardinal: D,
271
- fonts: O = {},
272
- accessibility: w = {}
273
- } = H, k = M(H, [
274
- "cardinal",
275
- "fonts",
276
- "accessibility"
277
- ]), z = {
278
- type: O.type,
279
- base: O.base || "16px",
280
- small: O.small || "0.8em",
281
- normal: O.normal || "1em",
282
- medium: O.medium || "1.2em",
283
- large: O.large || "1.6em",
284
- huge: O.huge || "2.5em"
285
- }, G = E(f({}, k), {
286
- fonts: z,
287
- accessibility: E(f({}, w), {
288
- isTabbing: ((re = y.accessibility) == null ? void 0 : re.isTabbing) || e
289
- })
290
- });
291
- return typeof D == "number" && (G.sizes = {
292
- cardinal: D,
293
- small: `${D}px`,
294
- normal: `${D * 3}px`,
295
- medium: `${D * 5}px`,
296
- large: `${D * 8}px`
297
- }), /* @__PURE__ */ d.createElement(Ke, {
298
- theme: G
299
- }, /* @__PURE__ */ d.createElement(Be.Provider, {
300
- value: m
301
- }, /* @__PURE__ */ d.createElement(je.Provider, {
302
- value: x
303
- }, (() => {
304
- const A = f({
305
- "data-width": $ === "full" ? S : Math.min($, S),
306
- "data-indent": q,
307
- "data-name": m.name,
308
- "data-node-id": m.id,
309
- "data-component-type": m.type,
310
- "aria-label": o,
311
- tabIndex: r,
312
- id: m.id,
313
- role: x && x.role
314
- }, a);
315
- switch (m.type) {
316
- case "view":
317
- return typeof x.animation == "string" && x.animation !== "none" ? /* @__PURE__ */ d.createElement(ht, E(f({}, A), {
318
- className: t
319
- })) : /* @__PURE__ */ d.createElement(ut, E(f({}, A), {
320
- className: t
321
- }));
322
- default: {
323
- const Q = Ge(x);
324
- return /* @__PURE__ */ d.createElement(pt, E(f(f({
325
- ref: l
326
- }, A), Q), {
327
- className: t
328
- }));
257
+ }, [u, n, s, R]), !f || !R)
258
+ return null;
259
+ const V = m(m({}, g), r || {}), {
260
+ cardinal: A,
261
+ fonts: D = {},
262
+ accessibility: Q = {}
263
+ } = V, W = N(V, [
264
+ "cardinal",
265
+ "fonts",
266
+ "accessibility"
267
+ ]), v = {
268
+ type: D.type,
269
+ base: D.base || "16px",
270
+ small: D.small || "0.8em",
271
+ normal: D.normal || "1em",
272
+ medium: D.medium || "1.2em",
273
+ large: D.large || "1.6em",
274
+ huge: D.huge || "2.5em"
275
+ }, M = C(m({}, W), {
276
+ fonts: v,
277
+ accessibility: m({}, Q)
278
+ });
279
+ return typeof A == "number" && (M.sizes = {
280
+ cardinal: A,
281
+ small: `${A}px`,
282
+ normal: `${A * 3}px`,
283
+ medium: `${A * 5}px`,
284
+ large: `${A * 8}px`
285
+ }), /* @__PURE__ */ d.createElement(He, {
286
+ theme: M
287
+ }, /* @__PURE__ */ d.createElement(Ie.Provider, {
288
+ value: f
289
+ }, /* @__PURE__ */ d.createElement(ze.Provider, {
290
+ value: b
291
+ }, (() => {
292
+ const x = m({
293
+ "data-width": S === "full" ? y : Math.min(S, y),
294
+ "data-indent": G,
295
+ "data-name": f.name,
296
+ "data-node-id": f.id,
297
+ "data-component-type": f.type,
298
+ "aria-label": i,
299
+ tabIndex: o,
300
+ id: f.id,
301
+ role: b && b.role
302
+ }, a);
303
+ switch (f.type) {
304
+ case "view":
305
+ return typeof b.animation == "string" && b.animation !== "none" ? /* @__PURE__ */ d.createElement(lt, C(m({}, x), {
306
+ className: t
307
+ })) : /* @__PURE__ */ d.createElement(ct, C(m({}, x), {
308
+ className: t
309
+ }));
310
+ default: {
311
+ const z = Be(b);
312
+ return /* @__PURE__ */ d.createElement(dt, C(m(m({
313
+ ref: c
314
+ }, x), z), {
315
+ className: t
316
+ }));
317
+ }
329
318
  }
330
- }
331
- })())));
332
- }), gt = ({ builder: t }) => {
333
- const e = j(), [n, i] = T(null);
334
- return B(() => {
335
- e.getAsync("components").then((s) => t(s).then((o) => {
336
- i(o);
319
+ })())));
320
+ }
321
+ ), mt = ({ builder: t }) => {
322
+ const n = T(), [e, s] = B(null);
323
+ return j(() => {
324
+ n.getAsync("components").then((i) => t(i).then((o) => {
325
+ s(o);
337
326
  }));
338
- }, []), B(() => () => {
339
- n && e.getAsync("components").then((s) => {
340
- s.nodes.detached = s.nodes.detached.filter((o) => o.id !== n.id);
327
+ }, []), j(() => () => {
328
+ e && n.getAsync("components").then((i) => {
329
+ i.nodes.detached = i.nodes.detached.filter(
330
+ (o) => o.id !== e.id
331
+ );
341
332
  });
342
- }, [n]), n ? /* @__PURE__ */ d.createElement(ie, {
343
- id: n.id,
344
- node: n,
333
+ }, [e]), e ? /* @__PURE__ */ d.createElement(ie, {
334
+ id: e.id,
335
+ node: e,
345
336
  branch: "default"
346
337
  }) : null;
347
- }, yt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
338
+ }, ft = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
348
339
  __proto__: null,
349
- default: gt
350
- }, Symbol.toStringTag, { value: "Module" })), bt = d.lazy(() => Promise.resolve().then(() => yt)), qt = ({ showSearch: t = !1 }) => {
351
- const e = Fe(we), n = j();
340
+ default: mt
341
+ }, Symbol.toStringTag, { value: "Module" })), gt = d.lazy(() => Promise.resolve().then(() => ft)), Ut = ({ showSearch: t = !1 }) => {
342
+ const n = Ge(We), e = T();
352
343
  return /* @__PURE__ */ d.createElement(d.Suspense, {
353
344
  fallback: null
354
- }, /* @__PURE__ */ d.createElement(bt, {
355
- builder: (i) => n.get("settings").then((s) => {
356
- var l;
357
- const { properties: o, context: r } = Object.keys(s.components).reduce((h, u) => (s.components[u].type === "not-found" && (h.properties = s.components[u].properties, h.context = s.components[u].context), h), { properties: {}, context: {} });
345
+ }, /* @__PURE__ */ d.createElement(gt, {
346
+ builder: (s) => e.get("settings").then((i) => {
347
+ var h;
348
+ const { properties: o, context: r } = Object.keys(i.components).reduce(
349
+ (l, u) => (i.components[u].type === "not-found" && (l.properties = i.components[u].properties, l.context = i.components[u].context), l),
350
+ { properties: {}, context: {} }
351
+ );
358
352
  o.showSearch = t;
359
- const c = i.createNode("area", { detached: !0 });
360
- if (c.name = "not-found-area", c.writeLayout({
353
+ const a = s.createNode("area", { detached: !0 });
354
+ if (a.name = "not-found-area", a.writeLayout({
361
355
  size: "full"
362
356
  }), t) {
363
- const h = Object.keys(s.components).reduce((p, g) => s.components[g].type === "search" ? s.components[g].properties : p, {}), u = i.createNode("search", { detached: !0 });
364
- u.writeLayout({ size: "full" }), u.writeProperties(f({
365
- "css-margin-bottom": ((l = e == null ? void 0 : e.sizes) == null ? void 0 : l.normal) || "15px"
366
- }, h)), c.appendChild(u);
357
+ const l = Object.keys(i.components).reduce(
358
+ (p, f) => i.components[f].type === "search" ? i.components[f].properties : p,
359
+ {}
360
+ ), u = s.createNode("search", { detached: !0 });
361
+ u.writeLayout({ size: "full" }), u.writeProperties(m({
362
+ "css-margin-bottom": ((h = n == null ? void 0 : n.sizes) == null ? void 0 : h.normal) || "15px"
363
+ }, l)), a.appendChild(u);
367
364
  }
368
- const a = i.createNode("not-found", { detached: !0 });
369
- return a.writeLayout({ size: "full" }), a.writeProperties(o), a.writeContext(r), c.appendChild(a), c;
365
+ const c = s.createNode("not-found", { detached: !0 });
366
+ return c.writeLayout({ size: "full" }), c.writeProperties(o), c.writeContext(r), a.appendChild(c), a;
370
367
  })
371
368
  }));
372
- }, wt = (t) => {
369
+ }, yt = (t) => {
373
370
  if (t) {
374
- const { type: e, content: n } = t;
375
- switch (e) {
371
+ const { type: n, content: e } = t;
372
+ switch (n) {
376
373
  case "FontAwesome":
377
- return `<i class="humany-icon fa fa-${n}"></i>`;
374
+ return `<i class="humany-icon fa fa-${e}"></i>`;
378
375
  case "Uri":
379
- return `<i class="humany-icon humany-custom-icon" style="background: url(${n}) no-repeat center center;background-size: contain;"></i>`;
376
+ return `<i class="humany-icon humany-custom-icon" style="background: url(${e}) no-repeat center center;background-size: contain;"></i>`;
380
377
  default:
381
378
  return "";
382
379
  }
383
380
  }
384
- }, vt = (t) => {
385
- const e = (s, o) => {
386
- !s || (o ? s.classList.add("humany-tabbing") : s.classList.remove("humany-tabbing"));
387
- }, n = (s) => {
388
- s.key === "Tab" ? e(t, !0) : s.key === "Enter" && document.activeElement && document.activeElement.classList.contains("humany-trigger") || e(t, !1);
389
- }, i = (s) => {
390
- document.activeElement && document.activeElement.classList.contains("humany-trigger") && document.activeElement.classList.contains("humany-tabbing") || e(t, !1);
381
+ }, bt = (t) => {
382
+ const n = (i, o) => {
383
+ !i || (o ? i.classList.add("humany-tabbing") : i.classList.remove("humany-tabbing"));
384
+ }, e = (i) => {
385
+ i.key === "Tab" ? n(t, !0) : i.key === "Enter" && document.activeElement && document.activeElement.classList.contains("humany-trigger") || n(t, !1);
386
+ }, s = (i) => {
387
+ document.activeElement && document.activeElement.classList.contains("humany-trigger") && document.activeElement.classList.contains("humany-tabbing") || n(t, !1);
391
388
  };
392
- return document.addEventListener("keydown", n), document.addEventListener("click", i), () => {
393
- document.removeEventListener("keydown", n), document.removeEventListener("click", i);
389
+ return document.addEventListener("keydown", e), document.addEventListener("click", s), () => {
390
+ document.removeEventListener("keydown", e), document.removeEventListener("click", s);
394
391
  };
395
392
  };
396
- function Et(t, e) {
397
- const { symbol: n, widgetName: i, label: s = "", ariaLabel: o = "", tooltip: r = "" } = e;
398
- t.classList.add("humany-trigger"), t.classList.add(`humany_${i}`), s.length && t.classList.add("humany-has-text"), o.length && !t.getAttribute("aria-label") && t.setAttribute("aria-label", o), o.length && !t.getAttribute("tabindex") && t.setAttribute("tabindex", "0"), r.length && !t.getAttribute("title") && t.setAttribute("title", r);
399
- const c = wt(n) || "";
400
- return t.innerHTML = `${c}
393
+ function wt(t, n) {
394
+ const { symbol: e, widgetName: s, label: i = "", ariaLabel: o = "", tooltip: r = "" } = n;
395
+ t.classList.add("humany-trigger"), t.classList.add(`humany_${s}`), i.length && t.classList.add("humany-has-text"), o.length && !t.getAttribute("aria-label") && t.setAttribute("aria-label", o), o.length && !t.getAttribute("tabindex") && t.setAttribute("tabindex", "0"), r.length && !t.getAttribute("title") && t.setAttribute("title", r);
396
+ const a = yt(e) || "";
397
+ return t.innerHTML = `${a}
401
398
  <span class="humany-close">
402
399
  <svg width="18" height="9" viewBox="0 0 18 9" fill="none" xmlns="http://www.w3.org/2000/svg">
403
400
  <path d="M9 9C8.81794 9.00045 8.63759 8.96634 8.46939 8.89965C8.3012 8.83295 8.14851 8.735 8.02015 8.61145L0.194523 1.12367C0.068294 0.99862 -0.00155266 0.831133 2.61958e-05 0.657285C0.00160506 0.483436 0.0744832 0.317136 0.202964 0.194202C0.331445 0.0712675 0.505249 0.00153576 0.686941 2.50649e-05C0.868634 -0.00148563 1.04368 0.0653456 1.17437 0.186125L9 7.6739L16.8256 0.186125C16.9563 0.0653456 17.1314 -0.00148563 17.3131 2.50649e-05C17.4948 0.00153576 17.6686 0.0712675 17.797 0.194202C17.9255 0.317136 17.9984 0.483436 18 0.657285C18.0016 0.831133 17.9317 0.99862 17.8055 1.12367L9.97985 8.61145C9.85149 8.735 9.6988 8.83295 9.53061 8.89965C9.36241 8.96634 9.18206 9.00045 9 9Z" fill="white"/>
@@ -415,303 +412,375 @@ function Et(t, e) {
415
412
  stroke-miterlimit="10" />
416
413
  </svg>
417
414
  </span>
418
- ${s.length ? `<span>${s}</span>` : ""}`, setTimeout(() => t && t.classList.add("humany-rendered")), vt(t);
415
+ ${i.length ? `<span>${i}</span>` : ""}`, setTimeout(() => t && t.classList.add("humany-rendered")), bt(t);
419
416
  }
420
- function Ct(t, e) {
421
- t instanceof HTMLElement ? (e && t.setAttribute("title", e), t.classList.remove("humany-active"), t.classList.remove("humany-loading")) : t instanceof Array && t.forEach((n) => {
422
- e && n.setAttribute("title", e), n.classList.remove("humany-active"), n.classList.remove("humany-loading");
417
+ function vt(t, n) {
418
+ t instanceof HTMLElement ? (n && t.setAttribute("title", n), t.classList.remove("humany-active"), t.classList.remove("humany-loading")) : t instanceof Array && t.forEach((e) => {
419
+ n && e.setAttribute("title", n), e.classList.remove("humany-active"), e.classList.remove("humany-loading");
423
420
  });
424
421
  }
425
- function Ot(t) {
426
- t instanceof HTMLElement ? (t.classList.remove("humany-active"), t.classList.add("humany-loading")) : t instanceof Array && t.forEach((e) => {
427
- e.classList.remove("humany-active"), e.classList.add("humany-loading");
422
+ function Et(t) {
423
+ t instanceof HTMLElement ? (t.classList.remove("humany-active"), t.classList.add("humany-loading")) : t instanceof Array && t.forEach((n) => {
424
+ n.classList.remove("humany-active"), n.classList.add("humany-loading");
428
425
  });
429
426
  }
430
- function Ee(t, e) {
431
- t instanceof HTMLElement ? (e && t.setAttribute("title", e), t.classList.add("humany-active"), t.classList.remove("humany-loading")) : t instanceof Array && t.forEach((n) => {
432
- e && n.setAttribute("title", e), n.classList.add("humany-active"), n.classList.remove("humany-loading");
427
+ function be(t, n) {
428
+ t instanceof HTMLElement ? (n && t.setAttribute("title", n), t.classList.add("humany-active"), t.classList.remove("humany-loading")) : t instanceof Array && t.forEach((e) => {
429
+ n && e.setAttribute("title", n), e.classList.add("humany-active"), e.classList.remove("humany-loading");
433
430
  });
434
431
  }
435
- var P = /* @__PURE__ */ ((t) => (t.Inline = "inline", t.Link = "link", t.Badge = "badge", t.Unsupported = "unsupported", t))(P || {});
436
- const St = (t, e) => t && e ? "both" : t ? "widgetDOM" : e ? "triggerDOM" : "none", Ce = (t) => t ? typeof t == "boolean" && t ? "link" : typeof t == "object" && !Array.isArray(t) ? "badge" : "unsupported" : "inline", xt = (t, e, n, i, s = !1) => {
437
- var l, h;
438
- const o = St(e, n), r = Ce(i), c = {
439
- widgetDOMElement: e ? e.cloneNode(!0) : void 0,
440
- triggerDOMElement: n ? n.cloneNode(!0) : void 0
441
- }, a = {
432
+ var k = /* @__PURE__ */ ((t) => (t.Inline = "inline", t.Link = "link", t.Badge = "badge", t.Unsupported = "unsupported", t))(k || {});
433
+ const Ct = (t, n) => t && n ? "both" : t ? "widgetDOM" : n ? "triggerDOM" : "none", we = (t) => t ? typeof t == "boolean" && t ? "link" : typeof t == "object" && !Array.isArray(t) ? "badge" : "unsupported" : "inline", Ot = (t, n, e, s, i = !1) => {
434
+ var h, l;
435
+ const o = Ct(
436
+ n,
437
+ e
438
+ ), r = we(s), a = {
439
+ widgetDOMElement: n ? n.cloneNode(!0) : void 0,
440
+ triggerDOMElement: e ? e.cloneNode(!0) : void 0
441
+ }, c = {
442
442
  triggerType: r,
443
- cachedOriginals: c,
443
+ cachedOriginals: a,
444
444
  widgetDOMElement: document.createElement("div")
445
445
  };
446
446
  switch (o) {
447
447
  case "both": {
448
- a.widgetDOMElement = e || document.createElement("div"), r !== "inline" && (a.triggerDOMElement = n);
448
+ c.widgetDOMElement = n || document.createElement("div"), r !== "inline" && (c.triggerDOMElement = e);
449
449
  break;
450
450
  }
451
451
  case "widgetDOM": {
452
- if (a.widgetDOMElement = e || document.createElement("div"), r !== "inline") {
452
+ if (c.widgetDOMElement = n || document.createElement("div"), r !== "inline") {
453
453
  const u = document.body.appendChild(document.createElement("a"));
454
- r === "link" && (u.innerText = t), a.triggerDOMElement = u;
454
+ r === "link" && (u.innerText = t), c.triggerDOMElement = u;
455
455
  }
456
456
  break;
457
457
  }
458
458
  case "triggerDOM": {
459
459
  const u = document.createElement("div");
460
- a.widgetDOMElement = u, r === "inline" ? (u.id = (n == null ? void 0 : n.id) || "", s ? (u.style.display = "none", (l = n == null ? void 0 : n.parentNode) == null || l.appendChild(u), a.callback = () => {
460
+ c.widgetDOMElement = u, r === "inline" ? (u.id = (e == null ? void 0 : e.id) || "", i ? (u.style.display = "none", (h = e == null ? void 0 : e.parentNode) == null || h.appendChild(u), c.callback = () => {
461
461
  var p;
462
- (p = n == null ? void 0 : n.parentNode) == null || p.replaceChild(u, n), u.style.display = (n == null ? void 0 : n.style.display) || "block";
463
- }) : (h = n == null ? void 0 : n.parentNode) == null || h.replaceChild(u, n), a.cachedOriginals.widgetDOMElement = n, a.cachedOriginals.triggerDOMElement = void 0) : (a.widgetDOMElement = document.body.appendChild(u), a.triggerDOMElement = n);
462
+ (p = e == null ? void 0 : e.parentNode) == null || p.replaceChild(
463
+ u,
464
+ e
465
+ ), u.style.display = (e == null ? void 0 : e.style.display) || "block";
466
+ }) : (l = e == null ? void 0 : e.parentNode) == null || l.replaceChild(
467
+ u,
468
+ e
469
+ ), c.cachedOriginals.widgetDOMElement = e, c.cachedOriginals.triggerDOMElement = void 0) : (c.widgetDOMElement = document.body.appendChild(u), c.triggerDOMElement = e);
464
470
  break;
465
471
  }
466
472
  case "none": {
467
473
  const u = document.body.appendChild(document.createElement("div"));
468
- if (a.widgetDOMElement = u, r !== "inline") {
474
+ if (c.widgetDOMElement = u, r !== "inline") {
469
475
  const p = document.body.appendChild(document.createElement("a"));
470
- r === "link" && (p.innerText = t), a.triggerDOMElement = p;
476
+ r === "link" && (p.innerText = t), c.triggerDOMElement = p;
471
477
  }
472
478
  break;
473
479
  }
474
480
  }
475
- return a;
476
- }, At = "modals";
477
- class Dt {
478
- constructor(e, n) {
479
- this.options = n, this.unsubscribe = [], this.container = e.createChild(this), this.container.register("widgetDOMElement", this.options.widgetDOMElement), this.container.register("triggerDOMElement", this.options.triggerDOMElement);
480
- const i = this.container.get("$widget");
481
- this.options.widgetDOMElement.classList.add("humany-widget"), this.options.widgetDOMElement.classList.add(`humany_${i.name}`);
482
- const s = e.get("widgetDOMElements") || [];
483
- e.register("widgetDOMElements", [
484
- ...s,
481
+ return c;
482
+ }, St = "modals";
483
+ class xt {
484
+ constructor(n, e) {
485
+ $(this, "container");
486
+ $(this, "unsubscribe", []);
487
+ this.options = e, this.container = n.createChild(this), this.container.register("widgetDOMElement", this.options.widgetDOMElement), this.container.register("triggerDOMElement", this.options.triggerDOMElement);
488
+ const s = this.container.get("$widget");
489
+ this.options.widgetDOMElement.classList.add("humany-widget"), this.options.widgetDOMElement.classList.add(`humany_${s.name}`);
490
+ const i = n.get("widgetDOMElements") || [];
491
+ n.register("widgetDOMElements", [
492
+ ...i,
485
493
  this.options.widgetDOMElement
486
494
  ]);
487
495
  }
488
496
  render() {
489
- const { widgetDOMElement: e, triggerDOMElement: n } = this.options, i = this.container.get("$widget");
490
- return e.getAttribute("data-rendered") === "true" ? Promise.resolve() : (n && this.options.triggerType === P.Badge && Ot(n), import("./render.20e0f363.js").then((s) => s.default(this.container, e)).then(() => {
491
- if (e.setAttribute("data-rendered", "true"), n && this.options.triggerType === P.Badge) {
497
+ const { widgetDOMElement: n, triggerDOMElement: e } = this.options, s = this.container.get("$widget");
498
+ return n.getAttribute("data-rendered") === "true" ? Promise.resolve() : (e && this.options.triggerType === k.Badge && Et(e), import("./render.1ff5268d.js").then((i) => i.default(this.container, n)).then(() => {
499
+ if (n.setAttribute("data-rendered", "true"), e && this.options.triggerType === k.Badge) {
492
500
  const o = this.options.triggerOptions.openTooltip;
493
- Ee(n, o);
501
+ be(e, o);
494
502
  }
495
- Ue(this.container, e);
496
- const s = this.container.get("$environment").widgets.all();
497
- N(this.container, At, v.Session).then((o) => {
503
+ Fe(this.container, n);
504
+ const i = this.container.get("$environment").widgets.all();
505
+ L(
506
+ this.container,
507
+ St,
508
+ E.Session
509
+ ).then((o) => {
498
510
  o && o.forEach((r) => {
499
- s.find((c) => c.name === r.name && c.state === "activated") && i.events.dispatch("widget:modal-opened", r);
511
+ i.find(
512
+ (a) => a.name === r.name && a.state === "activated"
513
+ ) && s.events.dispatch("widget:modal-opened", r);
500
514
  });
501
515
  });
502
516
  }));
503
517
  }
504
- renderBadge(e) {
505
- const { triggerDOMElement: n } = this.options;
506
- if (!n)
518
+ renderBadge(n) {
519
+ const { triggerDOMElement: e } = this.options;
520
+ if (!e)
507
521
  return;
508
- n.getAttribute("role") || n.setAttribute("role", "button");
509
- const { name: i } = this.container.get("$widget"), { label: s, symbol: o, ariaLabel: r, closedTooltip: c, openTooltip: a } = e, l = { closedTooltip: c, openTooltip: a };
510
- this.options.triggerOptions = l;
511
- const h = Et(n, {
512
- label: s,
522
+ e.getAttribute("role") || e.setAttribute("role", "button");
523
+ const { name: s } = this.container.get("$widget"), { label: i, symbol: o, ariaLabel: r, closedTooltip: a, openTooltip: c } = n, h = { closedTooltip: a, openTooltip: c };
524
+ this.options.triggerOptions = h;
525
+ const l = wt(e, {
526
+ label: i,
513
527
  symbol: o,
514
528
  ariaLabel: r,
515
- widgetName: i,
516
- tooltip: c
529
+ widgetName: s,
530
+ tooltip: a
517
531
  });
518
- this.unsubscribe.push(h);
532
+ this.unsubscribe.push(l);
519
533
  }
520
534
  dispose() {
521
- return import("./unmount.b0816844.js").then((e) => {
522
- var s, o, r, c;
523
- const { triggerDOMElement: n, widgetDOMElement: i } = this.options;
524
- e.default(i), this.options.cachedOriginals.widgetDOMElement && i && ((s = i.parentNode) == null || s.replaceChild(this.options.cachedOriginals.widgetDOMElement, i)), this.options.cachedOriginals.triggerDOMElement && n && ((o = n.parentNode) == null || o.replaceChild(this.options.cachedOriginals.triggerDOMElement, n)), this.unsubscribe.forEach((a) => {
525
- a();
526
- }), (r = i.parentNode) == null || r.removeChild(i), (c = n == null ? void 0 : n.parentNode) == null || c.removeChild(n);
535
+ return import("./unmount.b0816844.js").then((n) => {
536
+ var i, o, r, a;
537
+ const { triggerDOMElement: e, widgetDOMElement: s } = this.options;
538
+ n.default(s), this.options.cachedOriginals.widgetDOMElement && s && ((i = s.parentNode) == null || i.replaceChild(
539
+ this.options.cachedOriginals.widgetDOMElement,
540
+ s
541
+ )), this.options.cachedOriginals.triggerDOMElement && e && ((o = e.parentNode) == null || o.replaceChild(
542
+ this.options.cachedOriginals.triggerDOMElement,
543
+ e
544
+ )), this.unsubscribe.forEach((c) => {
545
+ c();
546
+ }), (r = s.parentNode) == null || r.removeChild(s), (a = e == null ? void 0 : e.parentNode) == null || a.removeChild(e);
527
547
  });
528
548
  }
529
549
  }
530
- const F = "changesets", Mt = (t) => {
531
- const e = { tags: t.tags };
532
- return t.context && typeof t.context != "function" && (e.context = t.context), t.properties && typeof t.properties != "function" && (e.properties = t.properties), t.layout && typeof t.layout != "function" && (e.layout = t.layout), e;
550
+ const K = "changesets", At = (t) => {
551
+ const n = { tags: t.tags };
552
+ return t.context && typeof t.context != "function" && (n.context = t.context), t.properties && typeof t.properties != "function" && (n.properties = t.properties), t.layout && typeof t.layout != "function" && (n.layout = t.layout), n;
533
553
  };
534
- class se {
535
- constructor(e, n) {
536
- this.container = e, this.storageWriter = n;
537
- }
538
- static create(e) {
539
- return _(e, F, I.Necessary, {
540
- medium: v.Local
541
- }).then((n) => new se(e, n));
542
- }
543
- write(e, n, i, s) {
544
- return Z(this)(() => N(this.container, F, v.Local).then((o = {}) => {
545
- const { keys: r = [], items: c = {} } = o, a = r.indexOf(e);
546
- return a > -1 && r.splice(a, 1), r.push(e), c[e] = {
547
- options: s,
548
- attributes: Mt(i),
549
- rules: n.rules
550
- }, this.storageWriter({ keys: r, items: c });
554
+ class oe {
555
+ constructor(n, e) {
556
+ this.container = n, this.storageWriter = e;
557
+ }
558
+ static create(n) {
559
+ return _(n, K, I.Necessary, {
560
+ medium: E.Local
561
+ }).then((e) => new oe(n, e));
562
+ }
563
+ write(n, e, s, i) {
564
+ return J(this)(() => L(
565
+ this.container,
566
+ K,
567
+ E.Local
568
+ ).then((o = {}) => {
569
+ const { keys: r = [], items: a = {} } = o, c = r.indexOf(n);
570
+ return c > -1 && r.splice(c, 1), r.push(n), a[n] = {
571
+ options: i,
572
+ attributes: At(s),
573
+ rules: e.rules
574
+ }, this.storageWriter({ keys: r, items: a });
551
575
  }));
552
576
  }
553
- remove(e) {
554
- return Z(this)(() => N(this.container, F, v.Local).then((n = {}) => {
555
- const { keys: i = [], items: s = {} } = n, o = i.indexOf(e);
577
+ remove(n) {
578
+ return J(this)(() => L(
579
+ this.container,
580
+ K,
581
+ E.Local
582
+ ).then((e = {}) => {
583
+ const { keys: s = [], items: i = {} } = e, o = s.indexOf(n);
556
584
  if (o > -1)
557
- return i.splice(o, 1), delete s[e], this.storageWriter(n);
585
+ return s.splice(o, 1), delete i[n], this.storageWriter(e);
558
586
  }));
559
587
  }
560
- load(e) {
561
- return Z(this)(() => N(this.container, F, v.Local).then((n = {}) => {
562
- const { keys: i = [], items: s = {} } = n;
563
- i.forEach((o) => {
564
- const r = s[o];
588
+ load(n) {
589
+ return J(this)(() => L(
590
+ this.container,
591
+ K,
592
+ E.Local
593
+ ).then((e = {}) => {
594
+ const { keys: s = [], items: i = {} } = e;
595
+ s.forEach((o) => {
596
+ const r = i[o];
565
597
  if (r) {
566
- const { rules: c, attributes: a, options: l } = r;
567
- e.write({
568
- attributes: a,
569
- options: l,
570
- target: new Me(e, c)
598
+ const { rules: a, attributes: c, options: h } = r;
599
+ n.write({
600
+ attributes: c,
601
+ options: h,
602
+ target: new xe(n, a)
571
603
  });
572
604
  }
573
605
  });
574
606
  }));
575
607
  }
576
608
  }
577
- const Nt = (t) => {
578
- const { container: e } = t;
579
- return se.create(e).then((n) => {
580
- const i = e.get("$settings"), s = { localStorage: n }, o = new Ae(t, s), r = De(o, i);
581
- return t.events.subscribe("widget:state-change", (c, a) => {
582
- a.state === tt.Deactivating && r();
609
+ const Dt = (t) => {
610
+ const { container: n } = t;
611
+ return oe.create(n).then((e) => {
612
+ const s = n.get("$settings"), i = { localStorage: e }, o = new Oe(t, i), r = Se(o, s);
613
+ return t.events.subscribe("widget:state-change", (a, c) => {
614
+ c.state === Xe.Deactivating && r();
583
615
  }), o;
584
616
  });
585
- }, Lt = (t, e) => () => {
586
- const n = (s) => {
617
+ }, Mt = (t, n) => () => {
618
+ const e = (i) => {
587
619
  const o = document.createElement("a");
588
- return o.href = s, o;
620
+ return o.href = i, o;
589
621
  };
590
- let i = window.location;
591
- return t === "referrer" && document.referrer && (i = n(document.referrer)), [e ? "https:" : "", "//", i.host, i.pathname].join("");
592
- }, $t = (t) => import("@telia-ace/widget-routing").then(({ RoutingService: e, HistoryMode: n }) => t.get("settings").then((i) => {
622
+ let s = window.location;
623
+ return t === "referrer" && document.referrer && (s = e(document.referrer)), [n ? "https:" : "", "//", s.host, s.pathname].join("");
624
+ }, Nt = (t) => import("@telia-ace/widget-routing").then(({ RoutingService: n, HistoryMode: e }) => t.get("settings").then((s) => {
593
625
  const {
594
- routing: { initialPath: s = "/", mode: o = n.scopedHash, basePath: r },
595
- views: c
596
- } = i;
597
- return new e(t, {
598
- initialPath: s,
626
+ routing: { initialPath: i = "/", mode: o = e.scopedHash, basePath: r },
627
+ views: a
628
+ } = s;
629
+ return new n(t, {
630
+ initialPath: i,
599
631
  mode: o,
600
- routes: Object.keys(c).map((l) => ({
601
- name: l,
602
- path: c[l].path
632
+ routes: Object.keys(a).map((h) => ({
633
+ name: h,
634
+ path: a[h].path
603
635
  })),
604
636
  basePath: r
605
637
  });
606
- })), kt = (t) => import("@telia-ace/widget-services").then(({ StorageProvider: e }) => new e()), Pt = (t) => import("@telia-ace/knowledge-serviceclient").then(({ ServiceClient: e, ServiceProxy: n }) => t.get("settings").then((i) => {
607
- const { name: s, events: o } = t.get("$widget"), {
608
- data: { projection: r = "", site: c = "current", forceHttps: a = !1 }
609
- } = i, l = new n(r, { credentials: "same-origin" }), h = new e(l, {
610
- funnel: s.replace("_contact-method", "").replace("_contact", ""),
611
- site: Lt(c, a)
612
- }, null, t);
638
+ })), Lt = (t) => import("@telia-ace/widget-services").then(({ StorageProvider: n }) => new n()), $t = (t) => import("@telia-ace/knowledge-serviceclient").then(({ ServiceClient: n, ServiceProxy: e }) => t.get("settings").then((s) => {
639
+ const { name: i, events: o } = t.get("$widget"), {
640
+ data: { projection: r = "", site: a = "current", forceHttps: c = !1 }
641
+ } = s, h = new e(r, { credentials: "same-origin" }), l = new n(
642
+ h,
643
+ {
644
+ funnel: i.replace("_contact-method", "").replace("_contact", ""),
645
+ site: Mt(a, c)
646
+ },
647
+ null,
648
+ t
649
+ );
613
650
  return o.subscribe("widget:settings-updated", (u, { data: p }) => {
614
- p && p.projection !== r && h.proxy.setBaseUrl(p.projection);
615
- }), h;
616
- })), Rt = (t) => import("@telia-ace/widget-core").then(({ ActionResolver: e }) => new e(t)), Vt = (t) => import("@telia-ace/widget-core").then(({ ComponentResolver: e }) => new e(t)), _t = (t) => import("@telia-ace/widget-core").then(({ ComponentPlatform: e, createComponentModel: n }) => Nt(t.get("$widget"))), X = "$settings", K = "open", de = "activeStickyWidget";
617
- class Qt extends nt {
651
+ p && p.projection !== r && l.proxy.setBaseUrl(p.projection);
652
+ }), l;
653
+ })), kt = (t) => import("@telia-ace/widget-core").then(({ ActionResolver: n }) => new n(t)), Pt = (t) => import("@telia-ace/widget-core").then(({ ComponentResolver: n }) => new n(t)), Rt = (t) => import("@telia-ace/widget-core").then(({ ComponentPlatform: n, createComponentModel: e }) => Dt(t.get("$widget"))), ee = "$settings", U = "open", ue = "activeStickyWidget";
654
+ class Yt extends et {
618
655
  constructor(e) {
619
- super(e), this.outlets = /* @__PURE__ */ new Map(), this.activated = void 0, this.subs = [], this.handleBootstrapping = (n) => {
620
- const i = {
621
- triggerDOMElement: n.sourceDOMElement,
656
+ super(e);
657
+ $(this, "outlets", /* @__PURE__ */ new Map());
658
+ $(this, "activated");
659
+ $(this, "subs", []);
660
+ $(this, "handleBootstrapping", (e) => {
661
+ const s = {
662
+ triggerDOMElement: e.sourceDOMElement,
622
663
  withRenderState: "storage"
623
664
  };
624
- this.container.get("settings").then((s) => {
625
- const { activate: o } = s;
626
- (typeof o == "undefined" || o === null || o === !0) && (this.activated = (this.activated || this.widget.activate()).then(() => this.attach(i)));
665
+ this.container.get("settings").then((i) => {
666
+ const { activate: o } = i;
667
+ (typeof o == "undefined" || o === null || o === !0) && (this.activated = (this.activated || this.widget.activate()).then(
668
+ () => this.attach(s)
669
+ ));
627
670
  });
628
- }, this.container.registerAsync("storage", () => kt(this.container)), this.container.registerFactory("settings", () => N(this.container, X, v.Local).then((n = {}) => f(f({}, this.container.get("$settings")), n))), et(this, "load", this.handleBootstrapping), this.container.registerAsync("componentResolver", () => Vt(this.container)), this.container.registerAsync("matchingClient", () => Pt(this.container)), this.container.registerAsync("router", () => $t(this.container)), this.container.registerAsync("actionResolver", () => Rt(this.container)), this.container.register("matchMedia", window.matchMedia), this.container.registerAsync("components", () => _t(this.container));
671
+ });
672
+ this.container.registerAsync("storage", () => Lt(this.container)), this.container.registerFactory("settings", () => L(
673
+ this.container,
674
+ ee,
675
+ E.Local
676
+ ).then((s = {}) => m(m({}, this.container.get("$settings")), s))), Je(this, "load", this.handleBootstrapping), this.container.registerAsync(
677
+ "componentResolver",
678
+ () => Pt(this.container)
679
+ ), this.container.registerAsync("matchingClient", () => $t(this.container)), this.container.registerAsync("router", () => Nt(this.container)), this.container.registerAsync("actionResolver", () => kt(this.container)), this.container.register("matchMedia", window.matchMedia), this.container.registerAsync("components", () => Rt(this.container));
629
680
  }
630
681
  initialize() {
631
- const e = this.container.getManyAsync("actionResolver", "router", "components");
632
- return Promise.all([e, this.container.get("settings")]).then(([{ actionResolver: n, router: i, components: s }, o]) => {
633
- var a;
634
- n.subscribe(this.widget.name, (l, h, u) => this.onAction(h, u));
635
- const r = (l) => {
636
- s.nodes.query({ type: "view" }).forEach((h) => {
637
- s.setSwitch(h, l);
638
- });
639
- }, c = ((a = i.getInitialRoute()) == null ? void 0 : a.name) || "index";
640
- return r(c), this.events.subscribe("widget:data-loaded", (l, { element: h }) => {
641
- this.widget.container.get("seoConfiguration") && this.events.dispatch("widget:preloaded-replaced", {
642
- element: h
643
- });
644
- }), this.events.subscribe("router:change", (l, { previous: h = { routeData: {} }, next: u = { routeData: {} } }) => {
645
- const { routeData: p } = h, { routeData: g } = u, m = Object.keys(o.views).reduce((b, y) => typeof o.views[y].path == "undefined" ? y : b, "");
646
- !g.name && m ? r(m) : r(g.name), he(p && p.params), he(g && g.params), this.container.getAsync("actionResolver").then((b) => {
647
- b.action(this.widget.name, "routeChange", {
648
- next: g,
649
- previous: p
682
+ const e = this.container.getManyAsync(
683
+ "actionResolver",
684
+ "router",
685
+ "components"
686
+ );
687
+ return Promise.all([e, this.container.get("settings")]).then(
688
+ ([{ actionResolver: s, router: i, components: o }, r]) => {
689
+ var h;
690
+ s.subscribe(
691
+ this.widget.name,
692
+ (l, u, p) => this.onAction(u, p)
693
+ );
694
+ const a = (l) => {
695
+ o.nodes.query({ type: "view" }).forEach((u) => {
696
+ o.setSwitch(u, l);
650
697
  });
651
- });
652
- }), i.initialize();
653
- });
698
+ }, c = ((h = i.getInitialRoute()) == null ? void 0 : h.name) || "index";
699
+ return a(c), this.events.subscribe("widget:data-loaded", (l, { element: u }) => {
700
+ this.widget.container.get("seoConfiguration") && this.events.dispatch("widget:preloaded-replaced", {
701
+ element: u
702
+ });
703
+ }), this.events.subscribe(
704
+ "router:change",
705
+ (l, { previous: u = { routeData: {} }, next: p = { routeData: {} } }) => {
706
+ const { routeData: f } = u, { routeData: w } = p, y = Object.keys(r.views).reduce((g, b) => typeof r.views[b].path == "undefined" ? b : g, "");
707
+ !w.name && y ? a(y) : a(w.name), le(f && f.params), le(w && w.params), this.container.getAsync("actionResolver").then((g) => {
708
+ g.action(this.widget.name, "routeChange", {
709
+ next: w,
710
+ previous: f
711
+ });
712
+ });
713
+ }
714
+ ), i.initialize();
715
+ }
716
+ );
654
717
  }
655
718
  attach(e = {}) {
656
- return this.container.get("settings").then(({ trigger: n }) => {
657
- var p, g;
719
+ return this.container.get("settings").then(({ trigger: s }) => {
720
+ var f, w;
658
721
  const {
659
722
  widgetDOMElement: i,
660
- key: s = Ye(),
661
- triggerDOMElement: o,
662
- withRenderState: r
663
- } = e, a = Ce(n) === P.Inline && ((o == null ? void 0 : o.childElementCount) || 0) > 0, l = xt(this.widget.name, i, o, n, a);
664
- this.outlets.size < 1 && !r && this.setRenderState("unset");
665
- const h = () => {
666
- const m = () => b.querySelectorAll("[data-loading=true]").length === 0, [b] = this.widget.container.get("widgetDOMElements"), y = (x, $) => {
667
- m() && (l.callback && l.callback(), $.disconnect());
723
+ key: o = Ke(),
724
+ triggerDOMElement: r,
725
+ withRenderState: a
726
+ } = e, h = we(s) === k.Inline && ((r == null ? void 0 : r.childElementCount) || 0) > 0, l = Ot(
727
+ this.widget.name,
728
+ i,
729
+ r,
730
+ s,
731
+ h
732
+ );
733
+ this.outlets.size < 1 && !a && this.setRenderState("unset");
734
+ const u = () => {
735
+ const y = () => g.querySelectorAll("[data-loading=true]").length === 0, [g] = this.widget.container.get("widgetDOMElements"), b = (R, H) => {
736
+ y() && (l.callback && l.callback(), H.disconnect());
668
737
  }, S = {
669
738
  attributes: !0,
670
739
  subtree: !0,
671
740
  childList: !0
672
741
  };
673
- m() && l.callback && l.callback(), new MutationObserver(y).observe(b, S);
742
+ y() && l.callback && l.callback(), new MutationObserver(b).observe(g, S);
674
743
  };
675
- a && this.widget.container.getAsync("dataClient").then(({ events: m }) => {
676
- m.subscribe("data-client:fetched", (b, y) => {
677
- y.unresolvedQueries === 0 && h();
744
+ h && this.widget.container.getAsync("dataClient").then(({ events: y }) => {
745
+ y.subscribe("data-client:fetched", (g, b) => {
746
+ b.unresolvedQueries === 0 && u();
678
747
  });
679
748
  });
680
- const u = this.getOrCreateViewOutlet(s, l);
681
- if (this.outlets.set(s, u), this.widget.events.dispatch("widget:attached", {}, { bubbles: !0 }), l.triggerType === P.Badge && n && ((p = l.triggerDOMElement) == null || p.setAttribute("aria-expanded", "false"), u == null || u.renderBadge(n)), l.triggerType !== P.Inline && ((g = l.triggerDOMElement) == null || g.addEventListener("click", (m) => {
682
- m.preventDefault(), this.container.get("settings").then(({ trigger: b }) => {
683
- u.render().then(() => this.renderState()).then((y) => b && b.action && b.action === "hide" ? y === C.open ? this.hide() : this.open() : y === C.open ? this.close() : this.open());
749
+ const p = this.getOrCreateViewOutlet(o, l);
750
+ if (this.outlets.set(o, p), this.widget.events.dispatch("widget:attached", {}, { bubbles: !0 }), l.triggerType === k.Badge && s && ((f = l.triggerDOMElement) == null || f.setAttribute("aria-expanded", "false"), p == null || p.renderBadge(s)), l.triggerType !== k.Inline && ((w = l.triggerDOMElement) == null || w.addEventListener("click", (y) => {
751
+ y.preventDefault(), this.container.get("settings").then(({ trigger: g }) => {
752
+ p.render().then(() => this.renderState()).then((b) => g && g.action && g.action === "hide" ? b === O.open ? this.hide() : this.open() : b === O.open ? this.close() : this.open());
684
753
  });
685
754
  })), this.outlets.size > 1)
686
- return this.renderState().then((m) => {
687
- this.triggerStateIfApplicable(m);
755
+ return this.renderState().then((y) => {
756
+ this.triggerStateIfApplicable(y);
688
757
  });
689
- if (r)
690
- return r === "storage" ? this.renderState().then((m) => {
691
- if (l.triggerType === P.Inline) {
758
+ if (a)
759
+ return a === "storage" ? this.renderState().then((y) => {
760
+ if (l.triggerType === k.Inline) {
692
761
  this.triggerStateIfApplicable("open");
693
762
  return;
694
763
  }
695
- this.triggerStateIfApplicable(m);
696
- }) : this.triggerStateIfApplicable(r);
764
+ this.triggerStateIfApplicable(y);
765
+ }) : this.triggerStateIfApplicable(a);
697
766
  });
698
767
  }
699
768
  detach(e) {
700
769
  if (e) {
701
770
  if (this.outlets.has(e)) {
702
- const n = this.outlets.get(e);
703
- n == null || n.dispose(), this.outlets.delete(e);
771
+ const s = this.outlets.get(e);
772
+ s == null || s.dispose(), this.outlets.delete(e);
704
773
  return;
705
774
  }
706
775
  process.env.NODE_ENV !== "production" && console.warn(`detach(): Could not find View Outlet with key ${e}`);
707
776
  return;
708
777
  }
709
- this.outlets.forEach((n) => {
710
- n.dispose();
778
+ this.outlets.forEach((s) => {
779
+ s.dispose();
711
780
  }), this.outlets.clear();
712
781
  }
713
782
  triggerStateIfApplicable(e) {
714
- return this.container.getAsync("router").then((n) => {
783
+ return this.container.getAsync("router").then((s) => {
715
784
  switch (e) {
716
785
  case "closed":
717
786
  this.close();
@@ -720,22 +789,22 @@ class Qt extends nt {
720
789
  this.open();
721
790
  break;
722
791
  case "hidden":
723
- this.hide(), n.start();
792
+ this.hide(), s.start();
724
793
  break;
725
794
  default:
726
795
  return;
727
796
  }
728
797
  });
729
798
  }
730
- getOrCreateViewOutlet(e, n) {
731
- return this.outlets.has(e) ? this.outlets.get(e) : new Dt(this.container, n);
799
+ getOrCreateViewOutlet(e, s) {
800
+ return this.outlets.has(e) ? this.outlets.get(e) : new xt(this.container, s);
732
801
  }
733
802
  render(e = {}) {
734
803
  if (process.env.NODE_ENV !== "production" && console.warn("widget.render() is deprecated. Use widget.attach() instead."), e.open) {
735
- const n = E(f({}, e), {
804
+ const s = C(m({}, e), {
736
805
  withRenderState: "open"
737
806
  });
738
- return this.attach(n);
807
+ return this.attach(s);
739
808
  }
740
809
  return this.attach(e);
741
810
  }
@@ -745,126 +814,166 @@ class Qt extends nt {
745
814
  setSettings(e) {
746
815
  return Promise.all([
747
816
  this.container.get("settings"),
748
- _(this.container, X, I.Necessary, {
749
- medium: v.Local
817
+ _(this.container, ee, I.Necessary, {
818
+ medium: E.Local
750
819
  })
751
- ]).then(([n, i]) => Promise.resolve(e(n)).then((s) => i(s).then(() => {
752
- const o = f(f({}, n), s);
753
- return this.widget.events.dispatch("widget:settings-updated", o), o;
820
+ ]).then(([s, i]) => Promise.resolve(e(s)).then((o) => i(o).then(() => {
821
+ const r = m(m({}, s), o);
822
+ return this.widget.events.dispatch("widget:settings-updated", r), r;
754
823
  })));
755
824
  }
756
825
  clearSettings() {
757
- return _(this.container, X, I.Necessary, { medium: v.Local }).then((e) => e()).then(() => this.container.get("settings")).then((e) => {
826
+ return _(
827
+ this.container,
828
+ ee,
829
+ I.Necessary,
830
+ { medium: E.Local }
831
+ ).then((e) => e()).then(() => this.container.get("settings")).then((e) => {
758
832
  this.widget.events.dispatch("widget:settings-updated", e);
759
833
  });
760
834
  }
761
- action({ action: e, value: n }) {
835
+ action({ action: e, value: s }) {
762
836
  return this.container.getAsync("actionResolver").then((i) => {
763
- i.action(this.widget.name, e, n);
837
+ i.action(this.widget.name, e, s);
764
838
  });
765
839
  }
766
840
  renderState() {
767
- if (Je(this.container))
768
- return Promise.resolve(C.open);
769
- const e = () => N(this.container, K, v.Session).then((i = C.closed) => i), n = () => N(this.container, K, v.Session).then((i = C.closed) => i);
770
- return this.container.getAsync("router").then((i) => i.isSticky() ? n().then((s) => s === C.open ? s : e()) : e());
841
+ if (Qe(this.container))
842
+ return Promise.resolve(O.open);
843
+ const e = () => L(
844
+ this.container,
845
+ U,
846
+ E.Session
847
+ ).then((i = O.closed) => i), s = () => L(
848
+ this.container,
849
+ U,
850
+ E.Session
851
+ ).then((i = O.closed) => i);
852
+ return this.container.getAsync("router").then((i) => i.isSticky() ? s().then((o) => o === O.open ? o : e()) : e());
771
853
  }
772
854
  hide() {
773
- return this.outlets.size < 1 ? (process.env.NODE_ENV !== "production" && console.warn("hide(): No-op as no view outlets are registered. Invoke the attach() command first."), Promise.resolve()) : (this.outlets.forEach((e) => e.render()), this.action({ action: "hide" }).then(() => {
855
+ return this.outlets.size < 1 ? (process.env.NODE_ENV !== "production" && console.warn(
856
+ "hide(): No-op as no view outlets are registered. Invoke the attach() command first."
857
+ ), Promise.resolve()) : (this.outlets.forEach((e) => e.render()), this.action({ action: "hide" }).then(() => {
774
858
  this.setTriggerState(!1);
775
859
  }));
776
860
  }
777
861
  open() {
778
- return this.outlets.size < 1 ? (process.env.NODE_ENV !== "production" && console.warn("open(): No-op as no view outlets are registered. Invoke the attach() command first."), Promise.resolve()) : (this.outlets.forEach((e) => e.render()), this.action({ action: "open" }).then(() => (this.widget.events.dispatch("tracking:widget-rendered", {}), this.onOpen())));
862
+ return this.outlets.size < 1 ? (process.env.NODE_ENV !== "production" && console.warn(
863
+ "open(): No-op as no view outlets are registered. Invoke the attach() command first."
864
+ ), Promise.resolve()) : (this.outlets.forEach((e) => e.render()), this.action({ action: "open" }).then(() => (this.widget.events.dispatch("tracking:widget-rendered", {}), this.onOpen())));
779
865
  }
780
866
  close() {
781
- return this.outlets.size < 1 ? (process.env.NODE_ENV !== "production" && console.warn("close(): No-op as no view outlets are registered. Invoke the attach() command first."), Promise.resolve()) : this.action({ action: "close" }).then(() => this.onClose());
867
+ return this.outlets.size < 1 ? (process.env.NODE_ENV !== "production" && console.warn(
868
+ "close(): No-op as no view outlets are registered. Invoke the attach() command first."
869
+ ), Promise.resolve()) : this.action({ action: "close" }).then(() => this.onClose());
782
870
  }
783
871
  show() {
784
- return process.env.NODE_ENV !== "production" && console.warn("show(): Command is deprecated and will be removed in the future. Use open() instead."), this.open();
872
+ return process.env.NODE_ENV !== "production" && console.warn(
873
+ "show(): Command is deprecated and will be removed in the future. Use open() instead."
874
+ ), this.open();
785
875
  }
786
- onAction(e, n) {
876
+ onAction(e, s) {
787
877
  switch (e) {
788
878
  case "close":
789
879
  case "open":
790
880
  case "hide":
791
- const i = e === "open" ? C.open : e === "close" ? C.closed : C.hidden;
881
+ const i = e === "open" ? O.open : e === "close" ? O.closed : O.hidden;
792
882
  return this.setRenderState(i).then(() => {
793
- this.setTriggerState(i === C.open), i !== C.hidden ? i === C.open ? this.onOpen() : this.onClose() : this.outlets.forEach((s) => {
794
- var o;
795
- return (o = s.options.triggerDOMElement) == null ? void 0 : o.setAttribute("aria-expanded", "false");
796
- });
883
+ this.setTriggerState(i === O.open), i !== O.hidden ? i === O.open ? this.onOpen() : this.onClose() : this.outlets.forEach(
884
+ (o) => {
885
+ var r;
886
+ return (r = o.options.triggerDOMElement) == null ? void 0 : r.setAttribute("aria-expanded", "false");
887
+ }
888
+ );
797
889
  });
798
890
  }
799
891
  }
800
892
  setRenderState(e) {
801
- const { invoke: n, events: i } = this.container.get("$widget");
893
+ const { invoke: s, events: i } = this.container.get("$widget");
802
894
  return Promise.all([
803
- _(this.container, K, I.Necessary, {
804
- medium: v.Session
895
+ _(this.container, U, I.Necessary, {
896
+ medium: E.Session
805
897
  }),
806
- _(this.container, K, I.Necessary, {
807
- medium: v.Local,
898
+ _(this.container, U, I.Necessary, {
899
+ medium: E.Local,
808
900
  duration: { minutes: 5 }
809
901
  }),
810
902
  this.container.getAsync("router"),
811
- n("renderState")
812
- ]).then(([s, o, r, c]) => {
813
- e === "unset" || !e ? (o(), s()) : (r.isSticky() && o(e), s(e)), i.dispatch("widget:render-state-changed", {
903
+ s("renderState")
904
+ ]).then(([o, r, a, c]) => {
905
+ e === "unset" || !e ? (r(), o()) : (a.isSticky() && r(e), o(e)), i.dispatch("widget:render-state-changed", {
814
906
  previous: c,
815
907
  next: e
816
908
  });
817
909
  });
818
910
  }
819
911
  onOpen() {
820
- return this.container.getAsync("router").then((e) => (this.outlets.forEach((n) => {
821
- var i;
822
- return (i = n.options.triggerDOMElement) == null ? void 0 : i.setAttribute("aria-expanded", "true");
823
- }), e.start()));
912
+ return this.container.getAsync("router").then((e) => (this.outlets.forEach(
913
+ (s) => {
914
+ var i;
915
+ return (i = s.options.triggerDOMElement) == null ? void 0 : i.setAttribute("aria-expanded", "true");
916
+ }
917
+ ), e.start()));
824
918
  }
825
919
  onClose() {
826
920
  const e = this.container.getManyAsync("router", "components");
827
921
  return (() => this.container.get("settings").then((i) => {
828
- const { activate: s } = this.container.get("$settings");
829
- return i.activate !== s ? this.setSettings(() => Promise.resolve({ activate: s })) : Promise.resolve();
830
- }))().then(() => e).then(({
831
- router: i,
832
- components: s
833
- }) => {
834
- const o = s.nodes.visible;
835
- return this.outlets.forEach((r) => {
836
- var c;
837
- return (c = r.options.triggerDOMElement) == null ? void 0 : c.setAttribute("aria-expanded", "false");
838
- }), o.filter((r) => r.attributes.properties.animation && r.attributes.properties.animation !== "none").length ? new Promise((r) => {
839
- setTimeout(() => {
840
- r(i);
841
- }, 200);
842
- }) : Promise.resolve(i);
843
- }).then((i) => i.stop());
922
+ const { activate: o } = this.container.get("$settings");
923
+ return i.activate !== o ? this.setSettings(() => Promise.resolve({ activate: o })) : Promise.resolve();
924
+ }))().then(() => e).then(
925
+ ({
926
+ router: i,
927
+ components: o
928
+ }) => {
929
+ const r = o.nodes.visible;
930
+ return this.outlets.forEach(
931
+ (a) => {
932
+ var c;
933
+ return (c = a.options.triggerDOMElement) == null ? void 0 : c.setAttribute("aria-expanded", "false");
934
+ }
935
+ ), r.filter(
936
+ (a) => a.attributes.properties.animation && a.attributes.properties.animation !== "none"
937
+ ).length ? new Promise((a) => {
938
+ setTimeout(() => {
939
+ a(i);
940
+ }, 200);
941
+ }) : Promise.resolve(i);
942
+ }
943
+ ).then((i) => i.stop());
844
944
  }
845
945
  setTriggerState(e) {
846
- this.outlets.forEach((n) => {
946
+ this.outlets.forEach((s) => {
847
947
  const {
848
- options: { triggerDOMElement: i, triggerOptions: s }
849
- } = n, { openTooltip: o, closedTooltip: r } = s || {};
850
- i && (e ? Ee(i, o) : Ct(i, r));
948
+ options: { triggerDOMElement: i, triggerOptions: o }
949
+ } = s, { openTooltip: r, closedTooltip: a } = o || {};
950
+ i && (e ? be(i, r) : vt(i, a));
851
951
  });
852
952
  }
853
953
  deactivate() {
854
- this.subs.forEach((n) => n());
954
+ this.subs.forEach((s) => s());
855
955
  const e = [];
856
- return this.outlets.forEach((n) => e.push(n.dispose())), N(this.container, de, v.Local).then((n) => n === this.widget.name ? _(this.container, de, I.Necessary, {
857
- medium: v.Local,
858
- scope: Xe.Implementation
859
- }).then((i) => i()).then(() => Promise.all(e)) : Promise.all(e));
956
+ return this.outlets.forEach((s) => e.push(s.dispose())), L(
957
+ this.container,
958
+ ue,
959
+ E.Local
960
+ ).then((s) => s === this.widget.name ? _(
961
+ this.container,
962
+ ue,
963
+ I.Necessary,
964
+ {
965
+ medium: E.Local,
966
+ scope: Ze.Implementation
967
+ }
968
+ ).then((i) => i()).then(() => Promise.all(e)) : Promise.all(e));
860
969
  }
861
970
  }
862
971
  export {
863
972
  ie as Component,
864
- gt as DetachedComponent,
865
- Qt as GridWidget,
866
- qt as NotFound,
867
- Qt as Widget,
868
- Y as genericComponentStyling
973
+ mt as DetachedComponent,
974
+ Yt as GridWidget,
975
+ Ut as NotFound,
976
+ Yt as Widget,
977
+ q as genericComponentStyling
869
978
  };
870
979
  //# sourceMappingURL=index.js.map