@telia-ace/knowledge-widget-components-guide 0.0.1

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.
@@ -0,0 +1,923 @@
1
+ import { jsx as a, Fragment as X, jsxs as w } from "react/jsx-runtime";
2
+ import { css as P } from "@emotion/react";
3
+ import r from "@emotion/styled";
4
+ import { ContactList as Y, contactLink as me } from "@telia-ace/knowledge-widget-adapters";
5
+ import { List as he, TextLink as Z, paddedBorderTabStyle as _, useRouteData as A, Feedback as ue, StyledHeaderText as ge, useDispatch as ee, useProperties as V, Text as G, SymbolBadge as F, useContainer as te, Tooltip as fe, StyledListButton as T, DropdownList as ne, useFavorites as be, StyledText as Q, FavoriteButton as ye, DrawerList as ae, DrawerAnimationType as oe, useChildren as pe, Lightbox as $e, DialogLink as ke, embeddedLinkMapper as we, createEmptyComponent as xe, Loader as ze, loadingOpacity as Le, Paragraph as Se, genericHtml as Be, headingElement as Ne, DialogList as Ce, contentBox as ve, Metadata as De, Button as Re, linkTabStyle as Oe } from "@telia-ace/knowledge-widget-ui";
6
+ import { NotFound as Te, Component as Fe } from "@telia-ace/widget-types-grid";
7
+ import { appendClassNames as I, buildCategoryTrail as Ie, createParams as Ee } from "@telia-ace/widget-utilities";
8
+ import { useMemo as E, useState as se, useEffect as le, useCallback as M, forwardRef as We } from "react";
9
+ import { PickerTypes as $ } from "@telia-ace/knowledge-widget-core";
10
+ const He = ({
11
+ className: e,
12
+ defaultAnswerVersionLabel: t,
13
+ guide: { perspective: n, perspectives: s },
14
+ availablePerspectives: d = []
15
+ }) => {
16
+ const { name: l, params: i } = A(), h = E(() => !s || !d.length ? [] : d.filter(({ name: c }) => !!s[c]).map(({ name: c, title: u }) => ({ label: u, connection: s[c] })), [s, d]);
17
+ return /* @__PURE__ */ a(
18
+ je,
19
+ {
20
+ className: I(
21
+ e,
22
+ "humany-guide-answer-version-picker"
23
+ ),
24
+ items: h,
25
+ renderItem: (c) => {
26
+ const u = c.label === "Default" ? t : c.label, b = n === c.connection, m = b && (!i.connection || n === i.connection);
27
+ return /* @__PURE__ */ a(
28
+ "li",
29
+ {
30
+ "data-version": c.connection,
31
+ children: /* @__PURE__ */ a(
32
+ Me,
33
+ {
34
+ as: m ? "span" : void 0,
35
+ text: u,
36
+ routeName: l,
37
+ selected: b,
38
+ "aria-label": u,
39
+ title: u,
40
+ params: {
41
+ ...i,
42
+ connection: c.connection
43
+ }
44
+ },
45
+ c.connection
46
+ )
47
+ },
48
+ c.connection
49
+ );
50
+ }
51
+ }
52
+ );
53
+ }, je = r(he)`
54
+ display: flex;
55
+ align-items: center;
56
+ flex-wrap: wrap;
57
+
58
+ list-style: none;
59
+ padding: 0;
60
+ margin: 0;
61
+
62
+ li:not(:last-child) {
63
+ margin: 0 calc(${(e) => {
64
+ var t;
65
+ return (t = e.theme.sizes) == null ? void 0 : t.small;
66
+ }} * 2) 0 0;
67
+ }
68
+
69
+ li > span {
70
+ cursor: default;
71
+ }
72
+ `, Me = r(Z)`
73
+ font-weight: 300;
74
+ color: ${(e) => {
75
+ var t;
76
+ return (t = e.theme.colors) == null ? void 0 : t.text;
77
+ }};
78
+ text-decoration: none;
79
+
80
+ ${(e) => e.selected && P`
81
+ font-weight: bold;
82
+ text-decoration: underline;
83
+ `}
84
+
85
+ &:focus-visible {
86
+ ${_};
87
+ }
88
+ `, Pe = r(Y)`
89
+ border-top: ${(e) => e.theme.border};
90
+ ${(e) => e.backButtonShown === "true" && `border-bottom: ${e.theme.border};`}
91
+ `, Ae = r(ue)`
92
+ ${(e) => {
93
+ var t, n;
94
+ return `padding: ${(t = e.theme.sizes) == null ? void 0 : t.large} ${(n = e.theme.sizes) == null ? void 0 : n.large};`;
95
+ }}
96
+ `, Ve = r(ge)`
97
+ ${(e) => {
98
+ var t, n;
99
+ return `padding: ${(t = e.theme.sizes) == null ? void 0 : t.large} ${(n = e.theme.sizes) == null ? void 0 : n.large};`;
100
+ }}
101
+
102
+ display: block;
103
+ font-size: ${(e) => {
104
+ var t;
105
+ return (t = e.theme.fonts) == null ? void 0 : t.normal;
106
+ }};
107
+ font-weight: bold;
108
+ `, Ge = ({
109
+ backButtonShown: e = !1,
110
+ accordion: t = !1
111
+ }) => {
112
+ const n = ee(), {
113
+ loading: s = !1,
114
+ dialog: d = [],
115
+ guide: l,
116
+ handoverContactMethods: i = [],
117
+ contactHeader: h,
118
+ showFeedback: c,
119
+ feedbackDirection: u = "horizontal",
120
+ feedbackRecognitionLabel: b,
121
+ feedbackGiven: m,
122
+ feedbackHeader: y,
123
+ positiveFeedbackLabel: g,
124
+ negativeFeedbackLabel: S,
125
+ contactFeedbackLabel: f
126
+ } = V(), [p, o] = se(!1);
127
+ return le(() => {
128
+ m || o(!1);
129
+ }, [m]), !c || !l || !l.allowFeedback || s && !m || d.length ? null : m && b && !i.length && !s ? /* @__PURE__ */ a(
130
+ Ve,
131
+ {
132
+ accordion: t ? "true" : "false",
133
+ tabindex: -1,
134
+ ref: (k) => {
135
+ !p && k && (o(!0), k.focus());
136
+ },
137
+ children: b
138
+ }
139
+ ) : l.hasHandover && i.length ? /* @__PURE__ */ a(
140
+ Pe,
141
+ {
142
+ backButtonShown: e ? "true" : "false",
143
+ accordion: t ? "true" : "false",
144
+ header: h,
145
+ contactMethods: i,
146
+ dispatch: n
147
+ }
148
+ ) : /* @__PURE__ */ a(
149
+ Ae,
150
+ {
151
+ accordion: t ? "true" : "false",
152
+ positive: g,
153
+ negative: l.hasHandover ? f : S,
154
+ header: y,
155
+ selected: m,
156
+ onFeedback: (k) => n("feedback", k),
157
+ direction: u
158
+ }
159
+ );
160
+ }, qe = ({
161
+ guide: { categories: e = [] },
162
+ toolbar: { picker: t = $.NONE }
163
+ }) => {
164
+ const [n, s] = se([]), d = te();
165
+ return le(() => {
166
+ Ie(
167
+ "index",
168
+ e.map((l) => l.toString()),
169
+ d
170
+ ).then((l) => {
171
+ s(l);
172
+ });
173
+ }, [e]), n.length ? /* @__PURE__ */ a(
174
+ fe,
175
+ {
176
+ className: "humany-guide-category-tooltip",
177
+ sticky: t === $.DRAWER,
178
+ content: /* @__PURE__ */ a(X, { children: n.map((l) => /* @__PURE__ */ a(
179
+ Je,
180
+ {
181
+ className: "humany-guide-category-trail",
182
+ children: l.map((i, h) => /* @__PURE__ */ w(
183
+ G,
184
+ {
185
+ className: "humany-guide-category-trail-segment",
186
+ children: [
187
+ i.symbol && h === 0 && /* @__PURE__ */ a(F, { size: 14, symbol: i.symbol }),
188
+ i.title,
189
+ h !== l.length - 1 && /* @__PURE__ */ a(Ke, { className: "humany-category-separator", children: "/" })
190
+ ]
191
+ },
192
+ i.id
193
+ ))
194
+ },
195
+ l.map((i) => i.id).join(".")
196
+ )) }),
197
+ children: t === $.DRAWER ? /* @__PURE__ */ a(
198
+ T,
199
+ {
200
+ className: "humany-guide-category-tooltip-button",
201
+ "data-has-label": "false",
202
+ "data-has-symbol": "true",
203
+ children: /* @__PURE__ */ a(
204
+ U,
205
+ {
206
+ size: 19,
207
+ symbol: { type: "Svg", content: "information" }
208
+ }
209
+ )
210
+ }
211
+ ) : /* @__PURE__ */ a(
212
+ U,
213
+ {
214
+ size: 19,
215
+ symbol: { type: "Svg", content: "information" }
216
+ }
217
+ )
218
+ }
219
+ ) : null;
220
+ }, Je = r.div`
221
+ i,
222
+ svg {
223
+ margin: 0 ${(e) => {
224
+ var t;
225
+ return (t = e.theme.sizes) == null ? void 0 : t.small;
226
+ }} 0 0;
227
+ }
228
+
229
+ &:not(:last-child) {
230
+ margin: 0 0 ${(e) => {
231
+ var t;
232
+ return (t = e.theme.sizes) == null ? void 0 : t.small;
233
+ }};
234
+ }
235
+ `, Ke = r(G)`
236
+ margin: 0 ${(e) => {
237
+ var t;
238
+ return (t = e.theme.sizes) == null ? void 0 : t.small;
239
+ }};
240
+ `, U = r(F)`
241
+ display: block;
242
+ `, Qe = ({
243
+ header: e,
244
+ tooltip: t,
245
+ printActionLabel: n,
246
+ copyActionLabel: s,
247
+ addFavoriteTooltip: d,
248
+ removeFavoriteCancelLabel: l,
249
+ removeFavoriteConfirmLabel: i,
250
+ removeFavoriteHeader: h,
251
+ removeFavoriteLabel: c,
252
+ removeFavoriteTooltip: u,
253
+ toolbarFunctionsCloseButtonAriaLabel: b,
254
+ allowCopy: m = !1,
255
+ allowPrint: y = !1,
256
+ showFavoriteToggle: g = !1,
257
+ picker: S = $.NONE,
258
+ guide: f,
259
+ dispatch: p
260
+ }) => {
261
+ const [o, k] = be(), D = M(
262
+ (B) => {
263
+ f && p("copy", f);
264
+ },
265
+ [f, p]
266
+ ), C = M(() => {
267
+ f && p("print");
268
+ }, [f, p]), x = E(() => {
269
+ const { id: B, title: R } = f, v = [];
270
+ if (m && v.push({
271
+ type: "copy",
272
+ child: /* @__PURE__ */ w(
273
+ T,
274
+ {
275
+ "data-has-label": s ? "true" : "false",
276
+ "data-has-symbol": "true",
277
+ title: s,
278
+ "aria-label": n,
279
+ onClick: D,
280
+ children: [
281
+ /* @__PURE__ */ a(
282
+ j,
283
+ {
284
+ size: 16,
285
+ symbol: { type: "Svg", content: "copy" }
286
+ }
287
+ ),
288
+ s && /* @__PURE__ */ a(Q, { children: s })
289
+ ]
290
+ }
291
+ )
292
+ }), y && v.push({
293
+ type: "print",
294
+ child: /* @__PURE__ */ w(
295
+ T,
296
+ {
297
+ "data-has-label": n ? "true" : "false",
298
+ "data-has-symbol": "true",
299
+ title: n,
300
+ "aria-label": n,
301
+ onClick: C,
302
+ children: [
303
+ /* @__PURE__ */ a(
304
+ j,
305
+ {
306
+ size: 16,
307
+ symbol: { type: "Svg", content: "print" }
308
+ }
309
+ ),
310
+ n && /* @__PURE__ */ a(Q, { children: n })
311
+ ]
312
+ }
313
+ )
314
+ }), g) {
315
+ const O = o.indexOf(B) > -1;
316
+ v.push({
317
+ type: "favorite",
318
+ child: /* @__PURE__ */ a(
319
+ ye,
320
+ {
321
+ id: B,
322
+ guideTitle: R,
323
+ isFavorite: O,
324
+ buttonLabel: O ? u : d,
325
+ addFavoriteTooltip: d,
326
+ removeFavoriteCancelLabel: l,
327
+ removeFavoriteConfirmLabel: i,
328
+ removeFavoriteHeader: h,
329
+ removeFavoriteLabel: c,
330
+ removeFavoriteTooltip: u,
331
+ actions: k
332
+ }
333
+ )
334
+ });
335
+ }
336
+ return v;
337
+ }, [
338
+ o,
339
+ f,
340
+ m,
341
+ y,
342
+ g,
343
+ n,
344
+ s,
345
+ d,
346
+ l,
347
+ i,
348
+ h,
349
+ c,
350
+ u
351
+ ]);
352
+ if (!x.length)
353
+ return null;
354
+ const N = /* @__PURE__ */ a(
355
+ Xe,
356
+ {
357
+ tabIndex: 0,
358
+ title: t,
359
+ "data-has-symbol": "true",
360
+ "data-has-label": "false",
361
+ children: /* @__PURE__ */ a(
362
+ j,
363
+ {
364
+ symbol: { type: "Svg", content: "options" },
365
+ size: 18
366
+ }
367
+ )
368
+ }
369
+ ), z = ({ type: B, child: R }) => /* @__PURE__ */ a("li", { "data-function-type": B, children: R }, B);
370
+ return S === $.DROPDOWN ? /* @__PURE__ */ a(
371
+ Ue,
372
+ {
373
+ className: "humany-guide-functions-dropdown-list",
374
+ header: e,
375
+ items: x,
376
+ trigger: N,
377
+ renderItem: z,
378
+ closeButtonAriaLabel: b
379
+ }
380
+ ) : S === $.DRAWER ? /* @__PURE__ */ a(
381
+ ae,
382
+ {
383
+ className: "humany-guide-functions-drawer-list",
384
+ animation: { type: oe.SlideInBottom },
385
+ header: e,
386
+ items: x,
387
+ trigger: N,
388
+ renderItem: z,
389
+ closeButtonAriaLabel: b
390
+ }
391
+ ) : null;
392
+ }, j = r(F)`
393
+ circle {
394
+ fill: ${(e) => {
395
+ var t;
396
+ return (t = e.theme.colors) == null ? void 0 : t.text;
397
+ }};
398
+ }
399
+
400
+ line,
401
+ path,
402
+ rect {
403
+ stroke: ${(e) => {
404
+ var t;
405
+ return (t = e.theme.colors) == null ? void 0 : t.text;
406
+ }};
407
+ }
408
+ `, Ue = r(ne)`
409
+ display: block;
410
+ min-height: auto;
411
+ `, Xe = r(T)`
412
+ padding: calc(${(e) => {
413
+ var t;
414
+ return (t = e.theme.sizes) == null ? void 0 : t.small;
415
+ }} * 2) 0;
416
+ `, Ye = (e, t) => {
417
+ var n;
418
+ return ((n = t.find((s) => s.id === e.id)) == null ? void 0 : n.label) || "";
419
+ }, Ze = ({
420
+ header: e,
421
+ tooltip: t,
422
+ picker: n = $.NONE,
423
+ guide: s,
424
+ ...d
425
+ }) => {
426
+ const { name: l, params: i } = A(), h = E(() => Object.keys(s.translations || {}).reduce(
427
+ (m, y) => {
428
+ const g = {};
429
+ return g.key = y, g.id = (s.translations || {})[y], g.label = d[`${y}LanguageLabel`], (g.id || g.label) && m.push(g), m;
430
+ },
431
+ []
432
+ ), [s, d]);
433
+ if (!h.length)
434
+ return null;
435
+ const c = Ye(s, h), u = /* @__PURE__ */ w(
436
+ _e,
437
+ {
438
+ tabIndex: 0,
439
+ title: t,
440
+ "data-has-symbol": "true",
441
+ "data-has-label": n === $.DROPDOWN && c ? "true" : "false",
442
+ children: [
443
+ n === $.DROPDOWN && /* @__PURE__ */ w(X, { children: [
444
+ c && /* @__PURE__ */ a(tt, { children: c }),
445
+ /* @__PURE__ */ a(
446
+ nt,
447
+ {
448
+ symbol: { type: "Svg", content: "caret-down" },
449
+ size: 11
450
+ }
451
+ )
452
+ ] }),
453
+ n === $.DRAWER && /* @__PURE__ */ a(
454
+ et,
455
+ {
456
+ symbol: { type: "Svg", content: "language" },
457
+ size: 20
458
+ }
459
+ )
460
+ ]
461
+ }
462
+ ), b = ({ label: m, key: y, id: g }) => /* @__PURE__ */ a("li", { "data-language": y, children: /* @__PURE__ */ a(
463
+ ot,
464
+ {
465
+ tabIndex: 0,
466
+ text: m,
467
+ routeName: l,
468
+ selected: s.id === g,
469
+ params: Ee({
470
+ ...i,
471
+ connection: void 0,
472
+ guide: g
473
+ })
474
+ }
475
+ ) }, y);
476
+ return n === $.DROPDOWN ? /* @__PURE__ */ a(
477
+ at,
478
+ {
479
+ className: "humany-guide-languages-dropdown-list",
480
+ header: e,
481
+ items: h,
482
+ trigger: u,
483
+ renderItem: b
484
+ }
485
+ ) : n === $.DRAWER ? /* @__PURE__ */ a(
486
+ ae,
487
+ {
488
+ className: "humany-guide-languages-drawer-list",
489
+ animation: { type: oe.SlideInBottom },
490
+ header: e,
491
+ items: h,
492
+ trigger: u,
493
+ renderItem: b
494
+ }
495
+ ) : null;
496
+ }, _e = r(T)`
497
+ &&& {
498
+ margin: 0 ${(e) => {
499
+ var t;
500
+ return `calc(${(t = e.theme.sizes) == null ? void 0 : t.small} * 2)`;
501
+ }} 0 0;
502
+ }
503
+ `, et = r(F)`
504
+ circle {
505
+ fill: ${(e) => {
506
+ var t;
507
+ return (t = e.theme.colors) == null ? void 0 : t.text;
508
+ }};
509
+ }
510
+
511
+ line,
512
+ path,
513
+ rect {
514
+ stroke: ${(e) => {
515
+ var t;
516
+ return (t = e.theme.colors) == null ? void 0 : t.text;
517
+ }};
518
+ }
519
+ `, tt = r(G)`
520
+ margin: 0 ${(e) => {
521
+ var t;
522
+ return (t = e.theme.sizes) == null ? void 0 : t.small;
523
+ }} 0 0;
524
+ font-size: ${(e) => {
525
+ var t;
526
+ return (t = e.theme.fonts) == null ? void 0 : t.normal;
527
+ }};
528
+ `, nt = r(F)`
529
+ align-self: flex-end;
530
+ stroke-width: 2px;
531
+ stroke-linecap: round;
532
+
533
+ && {
534
+ width: 0.6em;
535
+ height: 1em;
536
+ }
537
+ line {
538
+ stroke: ${(e) => {
539
+ var t;
540
+ return (t = e.theme.colors) == null ? void 0 : t.text;
541
+ }};
542
+ }
543
+ `, at = r(ne)`
544
+ display: block;
545
+ min-height: auto;
546
+ `, ot = r(Z)`
547
+ color: ${(e) => {
548
+ var t, n;
549
+ return e.selected ? (t = e.theme.colors) == null ? void 0 : t.primary : (n = e.theme.colors) == null ? void 0 : n.text;
550
+ }};
551
+ ${(e) => e.selected && "font-weight: bold;"}
552
+
553
+ outline: none;
554
+ &:focus-visible {
555
+ ${_}
556
+ text-decoration: underline;
557
+ }
558
+ `, st = (e) => {
559
+ const {
560
+ allowCopy: t = !1,
561
+ allowPrint: n = !1,
562
+ guideCategories: s = !1,
563
+ language: d = !1,
564
+ showFavoriteToggle: l = !1,
565
+ picker: i = $.NONE
566
+ } = e;
567
+ return !t && !n && !d && !l && !s || i === $.NONE;
568
+ }, lt = ({ className: e = "", dispatch: t }) => {
569
+ const {
570
+ toolbarLanguageHeader: n,
571
+ toolbarFunctionsHeader: s,
572
+ toolbarLanguageTooltip: d,
573
+ toolbarFunctionsTooltip: l,
574
+ toolbarFunctionsCloseButtonAriaLabel: i,
575
+ printActionLabel: h,
576
+ copyActionLabel: c,
577
+ addFavoriteTooltip: u,
578
+ removeFavoriteCancelLabel: b,
579
+ removeFavoriteConfirmLabel: m,
580
+ removeFavoriteHeader: y,
581
+ removeFavoriteLabel: g,
582
+ removeFavoriteTooltip: S,
583
+ guide: f,
584
+ toolbar: p,
585
+ ...o
586
+ } = V();
587
+ if (!f || !p || st(p))
588
+ return null;
589
+ const {
590
+ language: k,
591
+ guideCategories: D,
592
+ allowCopy: C,
593
+ allowPrint: x,
594
+ showFavoriteToggle: N,
595
+ picker: z
596
+ } = p;
597
+ return /* @__PURE__ */ w(rt, { className: I("humany-guide-toolbar", e), children: [
598
+ k && Object.keys(f.translations || {}).length > 1 && /* @__PURE__ */ a(
599
+ Ze,
600
+ {
601
+ guide: f,
602
+ header: n,
603
+ tooltip: d,
604
+ picker: z,
605
+ ...o
606
+ }
607
+ ),
608
+ D && /* @__PURE__ */ a(qe, { guide: f, toolbar: p }),
609
+ (C || x || N) && /* @__PURE__ */ a(
610
+ Qe,
611
+ {
612
+ guide: f,
613
+ header: s,
614
+ tooltip: l,
615
+ printActionLabel: h,
616
+ copyActionLabel: c,
617
+ addFavoriteTooltip: u,
618
+ removeFavoriteCancelLabel: b,
619
+ removeFavoriteConfirmLabel: m,
620
+ removeFavoriteHeader: y,
621
+ removeFavoriteLabel: g,
622
+ removeFavoriteTooltip: S,
623
+ toolbarFunctionsCloseButtonAriaLabel: i,
624
+ allowCopy: C,
625
+ allowPrint: x,
626
+ showFavoriteToggle: N,
627
+ picker: z,
628
+ dispatch: t
629
+ }
630
+ )
631
+ ] });
632
+ }, rt = r.div`
633
+ display: flex;
634
+ align-items: center;
635
+ justify-content: space-between;
636
+ margin: 0 0 0 auto;
637
+
638
+ > :not(:last-child) {
639
+ margin: 0 calc(${(e) => {
640
+ var t;
641
+ return (t = e.theme.sizes) == null ? void 0 : t.small;
642
+ }} * 2) 0 0;
643
+ }
644
+ `, Ct = We(
645
+ ({ className: e, accordion: t = !1, ...n }, s) => {
646
+ const {
647
+ loading: d = !1,
648
+ dialog: l = [],
649
+ contactMethods: i = [],
650
+ showHeader: h = !0,
651
+ showAnswerVersions: c = !1,
652
+ defaultAnswerVersionLabel: u = "Default",
653
+ backButtonLabel: b,
654
+ metadataByLabel: m,
655
+ metadataModifiedLabel: y,
656
+ metadataPublishedLabel: g,
657
+ availablePerspectives: S,
658
+ metadata: f,
659
+ toolbar: p,
660
+ guide: o,
661
+ error: k
662
+ } = V(), {
663
+ params: { connection: D, guide: C }
664
+ } = A(), x = te(), N = pe(), z = ee(), B = E(() => ({
665
+ transform: {
666
+ img: (L) => /* @__PURE__ */ a($e, { attrs: L, htmlBody: (o == null ? void 0 : o.body) || "" }),
667
+ a: (L) => {
668
+ const { children: ie, ...ce } = L, J = ce["data-target"];
669
+ if (J && l.length) {
670
+ const K = l.find(
671
+ ({ connection: de }) => de === J
672
+ );
673
+ if (K)
674
+ return /* @__PURE__ */ a(ke, { ...K, children: ie });
675
+ }
676
+ return we(x)(L);
677
+ }
678
+ }
679
+ }), [o, x, l]), R = M(() => {
680
+ z("back");
681
+ }, [z]);
682
+ if (!o && !k && !d)
683
+ return xe(x, {
684
+ ...n,
685
+ className: I(e, "humany-guide")
686
+ });
687
+ const { id: v = "", title: O = "", body: W = "", translations: q = {} } = o || {};
688
+ if (k && k.status === 404)
689
+ return /* @__PURE__ */ a(Te, { showSearch: !1 });
690
+ const H = !!t && !!D, re = Object.keys(q).find(
691
+ (L) => q[L] === `${v}`
692
+ );
693
+ return /* @__PURE__ */ w(
694
+ it,
695
+ {
696
+ ref: s,
697
+ ...n,
698
+ "data-loading": d,
699
+ className: I(e, "humany-guide"),
700
+ children: [
701
+ /* @__PURE__ */ w(
702
+ ut,
703
+ {
704
+ "data-loading": d,
705
+ accordion: t ? "true" : "false",
706
+ className: "humany-guide-content",
707
+ children: [
708
+ (c && o || !!p) && /* @__PURE__ */ w(ht, { className: "humany-guide-top", children: [
709
+ c && o && /* @__PURE__ */ a(
710
+ He,
711
+ {
712
+ defaultAnswerVersionLabel: u,
713
+ availablePerspectives: S,
714
+ guide: o
715
+ }
716
+ ),
717
+ !!p && /* @__PURE__ */ a(lt, { dispatch: z })
718
+ ] }),
719
+ !!(O || W) && /* @__PURE__ */ a(
720
+ ct,
721
+ {
722
+ className: "humany-guide-body",
723
+ accordion: t ? "true" : "false",
724
+ header: h && O || void 0,
725
+ html: W,
726
+ htmlParseInstruction: B,
727
+ lang: re
728
+ }
729
+ ),
730
+ l && W.indexOf("h-option-link") === -1 && /* @__PURE__ */ a(mt, { dialog: l }),
731
+ /* @__PURE__ */ a(
732
+ dt,
733
+ {
734
+ backButtonShown: H ? "true" : "false",
735
+ contactMethods: i,
736
+ dispatch: z,
737
+ guideId: o && o.id
738
+ }
739
+ ),
740
+ !i.length && C === (o == null ? void 0 : o.id) && /* @__PURE__ */ a(Ge, { backButtonShown: H, accordion: t }),
741
+ H && /* @__PURE__ */ w(
742
+ bt,
743
+ {
744
+ "aria-label": b,
745
+ onClick: R,
746
+ children: [
747
+ /* @__PURE__ */ w(
748
+ yt,
749
+ {
750
+ width: "7",
751
+ height: "13",
752
+ viewBox: "0 0 7 13",
753
+ fill: "none",
754
+ xmlns: "http://www.w3.org/2000/svg",
755
+ children: [
756
+ /* @__PURE__ */ a("line", { x1: "6.64645", y1: "12.5513", x2: "0.648357", y2: "6.55319" }),
757
+ /* @__PURE__ */ a("line", { x1: "0.646447", y1: "6.64455", x2: "6.64454", y2: "0.646465" })
758
+ ]
759
+ }
760
+ ),
761
+ b && /* @__PURE__ */ a("span", { children: b })
762
+ ]
763
+ }
764
+ ),
765
+ f && /* @__PURE__ */ a(
766
+ gt,
767
+ {
768
+ ...f,
769
+ modified: o == null ? void 0 : o.modified,
770
+ published: o == null ? void 0 : o.published,
771
+ modifiedBy: o == null ? void 0 : o.modifiedBy,
772
+ publishedBy: o == null ? void 0 : o.publishedBy,
773
+ byLabel: m,
774
+ modifiedLabel: y,
775
+ publishedLabel: g
776
+ }
777
+ ),
778
+ N.map((L) => /* @__PURE__ */ a(
779
+ ft,
780
+ {
781
+ id: L.id,
782
+ branch: "default",
783
+ embedded: !0
784
+ },
785
+ L.id
786
+ ))
787
+ ]
788
+ }
789
+ ),
790
+ /* @__PURE__ */ a(ze, { loading: d })
791
+ ]
792
+ }
793
+ );
794
+ }
795
+ ), it = r.div`
796
+ ${Le}
797
+ min-width: 0;
798
+ `, ct = r(Se)`
799
+ ${Be}
800
+ ${(e) => {
801
+ var t;
802
+ return `padding: ${(t = e.theme.sizes) == null ? void 0 : t.large};`;
803
+ }}
804
+ display: block;
805
+ line-height: 1.6em;
806
+
807
+ ${(e) => {
808
+ var t, n;
809
+ return Ne(e)(
810
+ "h1",
811
+ P`
812
+ font-size: ${(t = e.theme.fonts) == null ? void 0 : t.large};
813
+ font-weight: normal;
814
+ line-height: 1.6em;
815
+ line-height: 1.6em;
816
+ margin: 0 0 ${(n = e.theme.sizes) == null ? void 0 : n.small};
817
+ `
818
+ );
819
+ }}
820
+
821
+ p {
822
+ font-weight: 300;
823
+ font-size: ${(e) => {
824
+ var t;
825
+ return (t = e.theme.fonts) == null ? void 0 : t.normal;
826
+ }};
827
+ color: ${(e) => {
828
+ var t;
829
+ return (t = e.theme.colors) == null ? void 0 : t.text;
830
+ }};
831
+ a {
832
+ display: inline;
833
+ }
834
+ }
835
+ `, dt = r(Y)`
836
+ border-top: ${(e) => e.theme.border};
837
+ ${(e) => e.backButtonShown === "true" && `border-bottom: ${e.theme.border};`}
838
+ `, mt = r(Ce)`
839
+ ${(e) => {
840
+ var t, n;
841
+ return `padding: 0 ${(t = e.theme.sizes) == null ? void 0 : t.large} ${(n = e.theme.sizes) == null ? void 0 : n.large};`;
842
+ }}
843
+ display: block;
844
+ `, ht = r.div`
845
+ ${(e) => {
846
+ var t, n;
847
+ return `padding: calc(${(t = e.theme.sizes) == null ? void 0 : t.normal}*2) ${(n = e.theme.sizes) == null ? void 0 : n.large};`;
848
+ }}
849
+ display: flex;
850
+ justify-content: space-between;
851
+ align-items: center;
852
+ border-bottom: ${(e) => e.theme.border};
853
+ border-radius: ${(e) => `${e.theme.borderRadius} ${e.theme.borderRadius}`} 0 0;
854
+ background-color: #ffffff;
855
+ `, ut = r.div`
856
+ ${ve}
857
+ display: block;
858
+ > a {
859
+ ${me}
860
+ }
861
+
862
+ ${(e) => e.accordion === "true" && P`
863
+ white-space: normal;
864
+ box-shadow: none;
865
+ background-color: #fafafa;
866
+ `}
867
+ `, gt = r(De)`
868
+ display: block;
869
+ ${(e) => {
870
+ var t, n;
871
+ return `padding: calc(${(t = e.theme.sizes) == null ? void 0 : t.normal}*2) ${(n = e.theme.sizes) == null ? void 0 : n.large};`;
872
+ }}
873
+ font-weight: 300;
874
+ font-size: ${(e) => {
875
+ var t;
876
+ return (t = e.theme.fonts) == null ? void 0 : t.normal;
877
+ }};
878
+ color: ${(e) => {
879
+ var t;
880
+ return (t = e.theme.colors) == null ? void 0 : t.text;
881
+ }};
882
+ border-top: ${(e) => e.theme.border};
883
+ `, ft = r(Fe)`
884
+ border-top: ${(e) => e.theme.border};
885
+ `, bt = r(Re)`
886
+ ${(e) => {
887
+ var t, n;
888
+ return `padding: ${(t = e.theme.sizes) == null ? void 0 : t.normal} calc(${(n = e.theme.sizes) == null ? void 0 : n.normal} * 2);`;
889
+ }}
890
+ color: ${(e) => {
891
+ var t;
892
+ return (t = e.theme.colors) == null ? void 0 : t.primary;
893
+ }};
894
+ text-decoration: underline;
895
+ font-size: ${(e) => {
896
+ var t;
897
+ return (t = e.theme.fonts) == null ? void 0 : t.normal;
898
+ }};
899
+ span {
900
+ font-weight: 300;
901
+ }
902
+ &:focus-visible {
903
+ ${Oe}
904
+ padding: ${(e) => {
905
+ var t, n;
906
+ return `calc(${(t = e.theme.sizes) == null ? void 0 : t.small} / 2) ${(n = e.theme.sizes) == null ? void 0 : n.small}`;
907
+ }};
908
+ }
909
+ `, yt = r.svg`
910
+ margin-right: ${(e) => {
911
+ var t;
912
+ return (t = e.theme.sizes) == null ? void 0 : t.small;
913
+ }};
914
+ line {
915
+ stroke: ${(e) => {
916
+ var t;
917
+ return (t = e.theme.colors) == null ? void 0 : t.primary;
918
+ }};
919
+ }
920
+ `;
921
+ export {
922
+ Ct as default
923
+ };