webim-adapter 2.6.1 → 2.6.2

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.
@@ -12456,24 +12456,28 @@ function Hs(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
12456
12456
  var Us = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), Ws = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(q(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
12457
12457
  .webim-page[data-webim-mode="dark"] { ${Object.entries(q(e.dark)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }`;
12458
12458
  function Gs({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, custom: a, animations: o, tenant: c, apiUrl: u, datasets: d, locale: f, direction: p, settings: g, siteUser: _, param: v }) {
12459
- let y = a?.js?.trim();
12459
+ let y = a?.js?.trim(), x = g && g["site.code"] && typeof g["site.code"] == "object" ? g["site.code"] : null, S = typeof x?.js == "string" ? x.js.trim() : "", w = typeof x?.css == "string" ? x.css.trim() : "";
12460
12460
  if (s(() => {
12461
+ if (!S) return;
12462
+ let e = document.createElement("script");
12463
+ return e.text = S, document.body.appendChild(e), () => e.remove();
12464
+ }, [S]), s(() => {
12461
12465
  if (!y) return;
12462
12466
  let e = document.createElement("script");
12463
12467
  return e.text = y, document.body.appendChild(e), () => e.remove();
12464
12468
  }, [y]), !e?.ROOT) return null;
12465
- let x = {
12469
+ let T = {
12466
12470
  lang: f || void 0,
12467
12471
  dir: Fe(p, f)
12468
- }, S = ".webim-page, .webim-page *, .webim-page *::before, .webim-page *::after { box-sizing: border-box; }\n" + pe, w = {
12472
+ }, E = ".webim-page, .webim-page *, .webim-page *::before, .webim-page *::after { box-sizing: border-box; }\n" + pe, D = {
12469
12473
  minHeight: "100%",
12470
12474
  display: "flex",
12471
12475
  flexDirection: "column"
12472
- }, T = Hs("ROOT", e, n), E = l(() => ({ render: (t, r) => Hs(t, e, n, void 0, { mapProps: r }) }), [e, n]), D = fe(e, n), O = de(e, n), k = a?.css?.trim(), j = A(o), M = Ce(t), N = [M.font, M.headingFont].filter((e) => typeof e == "string" && e.trim() && e !== "inherit" && !be[e]), P = [.../* @__PURE__ */ new Set([...C(e, n), ...N])].map((e) => /* @__PURE__ */ m("link", {
12476
+ }, O = Hs("ROOT", e, n), k = l(() => ({ render: (t, r) => Hs(t, e, n, void 0, { mapProps: r }) }), [e, n]), j = fe(e, n), M = de(e, n), N = a?.css?.trim(), P = A(o), F = Ce(t), I = [F.font, F.headingFont].filter((e) => typeof e == "string" && e.trim() && e !== "inherit" && !be[e]), L = [.../* @__PURE__ */ new Set([...C(e, n), ...I])].map((e) => /* @__PURE__ */ m("link", {
12473
12477
  rel: "stylesheet",
12474
12478
  precedence: "default",
12475
12479
  href: b(e)
12476
- }, e)), F = Ws(M);
12480
+ }, e)), R = Ws(F);
12477
12481
  return r === "auto" ? /* @__PURE__ */ m(Y.Provider, {
12478
12482
  value: {
12479
12483
  tenant: c || "",
@@ -12487,25 +12491,26 @@ function Gs({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
12487
12491
  children: /* @__PURE__ */ m(gt.Provider, {
12488
12492
  value: d ?? null,
12489
12493
  children: /* @__PURE__ */ m(bt.Provider, {
12490
- value: E,
12494
+ value: k,
12491
12495
  children: /* @__PURE__ */ h("div", {
12492
- ...x,
12496
+ ...T,
12493
12497
  className: "webim-page",
12494
12498
  style: {
12495
- ...w,
12499
+ ...D,
12496
12500
  ...J(t),
12497
12501
  ...i
12498
12502
  },
12499
12503
  children: [
12500
- /* @__PURE__ */ m("style", { children: `.webim-page { ${Us(q(M.light))} }
12501
- @media (prefers-color-scheme: dark) { .webim-page { ${Us(q(M.dark))} } }` }),
12502
- /* @__PURE__ */ m("style", { children: F }),
12503
- P,
12504
- /* @__PURE__ */ m("style", { children: S }),
12505
- D && /* @__PURE__ */ m("style", { children: D }),
12506
- O && /* @__PURE__ */ m("style", { children: O }),
12507
- k && /* @__PURE__ */ m("style", { children: k }),
12508
- T
12504
+ /* @__PURE__ */ m("style", { children: `.webim-page { ${Us(q(F.light))} }
12505
+ @media (prefers-color-scheme: dark) { .webim-page { ${Us(q(F.dark))} } }` }),
12506
+ /* @__PURE__ */ m("style", { children: R }),
12507
+ L,
12508
+ /* @__PURE__ */ m("style", { children: E }),
12509
+ j && /* @__PURE__ */ m("style", { children: j }),
12510
+ M && /* @__PURE__ */ m("style", { children: M }),
12511
+ w && /* @__PURE__ */ m("style", { children: w }),
12512
+ N && /* @__PURE__ */ m("style", { children: N }),
12513
+ O
12509
12514
  ]
12510
12515
  })
12511
12516
  })
@@ -12524,25 +12529,26 @@ function Gs({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
12524
12529
  children: /* @__PURE__ */ m(gt.Provider, {
12525
12530
  value: d ?? null,
12526
12531
  children: /* @__PURE__ */ m(bt.Provider, {
12527
- value: E,
12532
+ value: k,
12528
12533
  children: /* @__PURE__ */ h("div", {
12529
- ...x,
12534
+ ...T,
12530
12535
  className: "webim-page",
12531
12536
  style: {
12532
- ...w,
12537
+ ...D,
12533
12538
  ...Ee(t, r),
12534
12539
  ...i
12535
12540
  },
12536
12541
  children: [
12537
- P,
12538
- /* @__PURE__ */ m("style", { children: F }),
12539
- /* @__PURE__ */ m("style", { children: S }),
12540
- D && /* @__PURE__ */ m("style", { children: D }),
12541
- O && /* @__PURE__ */ m("style", { children: O }),
12542
- j && /* @__PURE__ */ m("style", { children: j }),
12542
+ L,
12543
+ /* @__PURE__ */ m("style", { children: R }),
12544
+ /* @__PURE__ */ m("style", { children: E }),
12543
12545
  j && /* @__PURE__ */ m("style", { children: j }),
12544
- k && /* @__PURE__ */ m("style", { children: k }),
12545
- T
12546
+ M && /* @__PURE__ */ m("style", { children: M }),
12547
+ P && /* @__PURE__ */ m("style", { children: P }),
12548
+ P && /* @__PURE__ */ m("style", { children: P }),
12549
+ w && /* @__PURE__ */ m("style", { children: w }),
12550
+ N && /* @__PURE__ */ m("style", { children: N }),
12551
+ O
12546
12552
  ]
12547
12553
  })
12548
12554
  })