webim-adapter 2.7.12 → 2.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -845,6 +845,7 @@ async function Je({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
845
845
  "MenuTreeBlock",
846
846
  "CalendarBlock",
847
847
  "MasonryBlock",
848
+ "LightboxGallery",
848
849
  "LogoCarousel"
849
850
  ].includes(e?.type?.resolvedName) ? e.props?.source : null).filter(Boolean))];
850
851
  if (m.length) {
@@ -899,7 +900,13 @@ var Xe = {
899
900
  item: "Item {n}",
900
901
  frame: "Embedded content",
901
902
  video: "Video",
902
- transcript: "Transcript"
903
+ transcript: "Transcript",
904
+ close: "Close",
905
+ prevItem: "Previous",
906
+ nextItem: "Next",
907
+ openItem: "Open {name}",
908
+ itemOf: "{n} of {total}",
909
+ gallery: "Gallery"
903
910
  },
904
911
  tr: {
905
912
  skip: "Ana içeriğe geç",
@@ -927,7 +934,13 @@ var Xe = {
927
934
  item: "Öğe {n}",
928
935
  frame: "Gömülü içerik",
929
936
  video: "Video",
930
- transcript: "Metin dökümü"
937
+ transcript: "Metin dökümü",
938
+ close: "Kapat",
939
+ prevItem: "Önceki",
940
+ nextItem: "Sonraki",
941
+ openItem: "{name} öğesini aç",
942
+ itemOf: "{n} / {total}",
943
+ gallery: "Galeri"
931
944
  }
932
945
  };
933
946
  function Ze(e) {
@@ -14748,35 +14761,555 @@ function Ml({ src: e, poster: t, alt: n, height: r, bg: i, artboard: a, mode: o
14748
14761
  }), /* @__PURE__ */ h("span", { children: "Pick a .riv file in the Settings panel." })]
14749
14762
  }) : null;
14750
14763
  }
14751
- var Nl = { RiveBlock: Ml }, Pl = /* @__PURE__ */ new Map();
14752
- function Fl(e) {
14753
- if (Pl.has(e)) return Pl.get(e);
14764
+ var Nl = { RiveBlock: Ml }, Pl = /\.(mp4|webm|ogv|ogg|mov|m4v)(\?|#|$)/i, Fl = /\.(jpe?g|png|gif|webp|avif|svg|bmp)(\?|#|$)/i, Il = /\.(pdf|docx?|xlsx?|pptx?|odt|ods|odp|txt|csv|zip|rar|7z|mp3|wav|m4a)(\?|#|$)/i, Ll = /vimeo\.com\/(?:video\/)?(\d+)/i, Rl = "data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20320%20240%22%3E%3Crect%20width%3D%22320%22%20height%3D%22240%22%20fill%3D%22%231e293b%22%2F%3E%3Ccircle%20cx%3D%22160%22%20cy%3D%22120%22%20r%3D%2234%22%20fill%3D%22rgba(255%2C255%2C255%2C0.16)%22%2F%3E%3Cpath%20d%3D%22M150%20102%20L178%20120%20L150%20138%20Z%22%20fill%3D%22%23fff%22%2F%3E%3C%2Fsvg%3E";
14765
+ function zl(e, t = "") {
14766
+ let n = String(e ?? "");
14767
+ return Ur(n) && /youtu/i.test(n) ? "youtube" : Ll.test(n) ? "vimeo" : String(t).startsWith("video/") || Pl.test(n) ? "video" : String(t).startsWith("image/") || Fl.test(n) ? "image" : t || Il.test(n) ? "document" : "unknown";
14768
+ }
14769
+ var Bl = /* @__PURE__ */ new Map();
14770
+ function Vl(e) {
14771
+ return Bl.has(e) || Bl.set(e, new Promise((t) => {
14772
+ let n = new Image();
14773
+ n.onload = () => t("image"), n.onerror = () => {
14774
+ fetch(e, { method: "HEAD" }).then((e) => t(String(e.headers.get("content-type") ?? "").startsWith("video/") ? "video" : "drop")).catch(() => t("drop"));
14775
+ }, n.src = e;
14776
+ })), Bl.get(e);
14777
+ }
14778
+ function Hl(e, t = 0) {
14779
+ let [n, r] = d({}), i = e.filter((e) => e.kind === "unknown" && !(e.src in n)).map((e) => e.src).join("|");
14780
+ return s(() => {
14781
+ if (!i || typeof window > "u") return;
14782
+ let e = !0;
14783
+ return i.split("|").forEach((t) => {
14784
+ Vl(t).then((n) => e && r((e) => ({
14785
+ ...e,
14786
+ [t]: n
14787
+ })));
14788
+ }), () => {
14789
+ e = !1;
14790
+ };
14791
+ }, [i]), e.map((e) => {
14792
+ if (e.kind !== "unknown") return e;
14793
+ let t = n[e.src] ?? "image";
14794
+ return t === "drop" ? null : {
14795
+ ...e,
14796
+ kind: t,
14797
+ thumb: t === "video" ? Wl(e.src, "video", e.poster) : e.thumb
14798
+ };
14799
+ }).filter(Boolean).slice(0, Math.max(0, Number(t) || 0) || void 0).map((e, t) => ({
14800
+ ...e,
14801
+ index: t + 1
14802
+ }));
14803
+ }
14804
+ var Ul = (e) => e === "video" || e === "youtube" || e === "vimeo";
14805
+ function Wl(e, t, n) {
14806
+ return n || (t === "image" || t === "unknown" ? e : t === "youtube" ? `https://i.ytimg.com/vi/${Ur(e)}/hqdefault.jpg` : Rl);
14807
+ }
14808
+ var Gl = (e) => e == null ? "" : Gn(e), Kl = (e) => (Array.isArray(e) ? e : [e]).map((e) => e && typeof e == "object" ? {
14809
+ url: e.url ?? e.src ?? "",
14810
+ mime: e.mime ?? ""
14811
+ } : {
14812
+ url: e,
14813
+ mime: ""
14814
+ }).filter((e) => typeof e.url == "string" && e.url.trim()), ql = (e) => {
14815
+ try {
14816
+ return decodeURIComponent(String(e).split(/[?#]/)[0].split("/").pop() ?? "");
14817
+ } catch {
14818
+ return "";
14819
+ }
14820
+ };
14821
+ function Jl({ items: e, entries: t, mediaField: n, nameField: r, posterField: i, limit: a }) {
14822
+ let o = Math.max(0, Number(a) || 0), s = [], c = (e) => o && s.length >= o ? !1 : (s.push({
14823
+ ...e,
14824
+ index: s.length + 1
14825
+ }), !0);
14826
+ if (Array.isArray(t)) {
14827
+ for (let e of t) {
14828
+ if (!e || typeof e != "object") continue;
14829
+ let t = e.data ?? e, a = Gl(r ? Un(t, r) : t.name), o = i ? Kl(Un(t, i))[0]?.url ?? "" : "";
14830
+ for (let { url: r, mime: i } of Kl(Un(t, n))) {
14831
+ let t = zl(r, i);
14832
+ if (t !== "document" && !c({
14833
+ src: r,
14834
+ kind: t,
14835
+ poster: o,
14836
+ thumb: Wl(r, t, o),
14837
+ name: a,
14838
+ alt: a,
14839
+ entry: e
14840
+ })) return s;
14841
+ }
14842
+ }
14843
+ return s;
14844
+ }
14845
+ for (let t of Array.isArray(e) ? e : []) {
14846
+ if (!t || typeof t != "object" || !t.src) continue;
14847
+ let e = zl(t.src, t.mime), n = t.name || "";
14848
+ if (e !== "document" && !c({
14849
+ src: t.src,
14850
+ kind: e,
14851
+ poster: t.poster,
14852
+ thumb: Wl(t.src, e, t.poster),
14853
+ name: n,
14854
+ alt: t.alt || n,
14855
+ entry: null
14856
+ })) break;
14857
+ }
14858
+ return s;
14859
+ }
14860
+ function Yl(e) {
14861
+ let t = e.entry && typeof e.entry == "object" ? e.entry : { id: `item-${e.index}` };
14862
+ return {
14863
+ ...t,
14864
+ data: {
14865
+ ...t.data ?? {},
14866
+ src: e.src,
14867
+ thumb: e.thumb,
14868
+ name: e.name || ql(e.src),
14869
+ kind: Ul(e.kind) ? "video" : "image",
14870
+ index: e.index
14871
+ }
14872
+ };
14873
+ }
14874
+ function Xl({ item: e }) {
14875
+ return /* @__PURE__ */ g("span", {
14876
+ ...Z("tile-media"),
14877
+ style: {
14878
+ position: "relative",
14879
+ display: "block",
14880
+ borderRadius: "inherit",
14881
+ overflow: "hidden"
14882
+ },
14883
+ children: [/* @__PURE__ */ h("img", {
14884
+ ...Z("thumb"),
14885
+ src: e.thumb,
14886
+ alt: e.alt || "",
14887
+ loading: "lazy",
14888
+ style: {
14889
+ display: "block",
14890
+ width: "100%",
14891
+ aspectRatio: "1 / 1",
14892
+ objectFit: "cover",
14893
+ borderRadius: "inherit"
14894
+ }
14895
+ }), Ul(e.kind) && /* @__PURE__ */ h(Zl, {})]
14896
+ });
14897
+ }
14898
+ function Zl() {
14899
+ return /* @__PURE__ */ h("span", {
14900
+ ...Z("play"),
14901
+ "aria-hidden": "true",
14902
+ style: {
14903
+ position: "absolute",
14904
+ left: "50%",
14905
+ top: "50%",
14906
+ width: 44,
14907
+ height: 44,
14908
+ marginLeft: -22,
14909
+ marginTop: -22,
14910
+ borderRadius: "50%",
14911
+ background: "rgba(0, 0, 0, 0.55)",
14912
+ display: "flex",
14913
+ alignItems: "center",
14914
+ justifyContent: "center",
14915
+ pointerEvents: "none"
14916
+ },
14917
+ children: /* @__PURE__ */ h("svg", {
14918
+ width: "18",
14919
+ height: "18",
14920
+ viewBox: "0 0 24 24",
14921
+ fill: "#fff",
14922
+ children: /* @__PURE__ */ h("path", { d: "M8 5v14l11-7z" })
14923
+ })
14924
+ });
14925
+ }
14926
+ function Ql({ item: e, autoplay: t }) {
14927
+ let n = {
14928
+ maxWidth: "92vw",
14929
+ maxHeight: "80vh",
14930
+ borderRadius: 8,
14931
+ boxShadow: "0 12px 48px rgba(0,0,0,0.5)",
14932
+ display: "block"
14933
+ };
14934
+ if (e.kind === "youtube" || e.kind === "vimeo") {
14935
+ let r = e.kind === "youtube" ? `https://www.youtube-nocookie.com/embed/${Ur(e.src)}?rel=0${t ? "&autoplay=1" : ""}` : `https://player.vimeo.com/video/${e.src.match(Ll)?.[1]}${t ? "?autoplay=1" : ""}`;
14936
+ return /* @__PURE__ */ h("iframe", {
14937
+ ...Z("media"),
14938
+ src: r,
14939
+ title: e.name || "Video",
14940
+ allow: "autoplay; encrypted-media; fullscreen; picture-in-picture",
14941
+ allowFullScreen: !0,
14942
+ style: {
14943
+ ...n,
14944
+ width: "min(92vw, calc(80vh * 16 / 9))",
14945
+ aspectRatio: "16 / 9",
14946
+ border: 0,
14947
+ background: "#000"
14948
+ }
14949
+ });
14950
+ }
14951
+ return e.kind === "video" ? /* @__PURE__ */ h("video", {
14952
+ ...Z("media"),
14953
+ src: e.src,
14954
+ poster: e.thumb === Rl ? void 0 : e.thumb,
14955
+ controls: !0,
14956
+ autoPlay: t,
14957
+ playsInline: !0,
14958
+ style: {
14959
+ ...n,
14960
+ background: "#000"
14961
+ }
14962
+ }) : /* @__PURE__ */ h("img", {
14963
+ ...Z("media"),
14964
+ src: e.src,
14965
+ alt: e.alt || "",
14966
+ style: n
14967
+ });
14968
+ }
14969
+ var $l = {
14970
+ position: "absolute",
14971
+ top: "50%",
14972
+ transform: "translateY(-50%)",
14973
+ width: 48,
14974
+ height: 48,
14975
+ borderRadius: "50%",
14976
+ border: 0,
14977
+ background: "rgba(255, 255, 255, 0.12)",
14978
+ color: "inherit",
14979
+ cursor: "pointer",
14980
+ display: "flex",
14981
+ alignItems: "center",
14982
+ justifyContent: "center"
14983
+ };
14984
+ function eu({ list: e, index: t, onIndex: n, onClose: r, options: i, locale: a }) {
14985
+ let o = Ze(a), { loop: c = !0, caption: l = !0, counter: d = !0, thumbs: f = !1, backdrop: p = "", color: _ = "", autoplay: v = !0 } = i, y = e[t], b = u(null), x = e.length, S = c || t > 0, C = c || t < x - 1, w = (e) => n((t) => {
14986
+ let n = t + e;
14987
+ return c ? (n + x) % x : Math.min(Math.max(n, 0), x - 1);
14988
+ });
14989
+ if (s(() => {
14990
+ let e = (e) => {
14991
+ e.key === "Escape" && r(), e.key === "ArrowRight" && w(1), e.key === "ArrowLeft" && w(-1);
14992
+ }, t = document.body, n = t.style.overflow;
14993
+ return window.addEventListener("keydown", e), t.style.overflow = "hidden", b.current?.focus(), () => {
14994
+ window.removeEventListener("keydown", e), t.style.overflow = n;
14995
+ };
14996
+ }, [x, c]), !y) return null;
14997
+ let T = (e) => e.stopPropagation(), E = y.name || ql(y.src);
14998
+ return /* @__PURE__ */ g("div", {
14999
+ ...Z("backdrop"),
15000
+ role: "dialog",
15001
+ "aria-modal": "true",
15002
+ "aria-label": o("gallery"),
15003
+ onClick: r,
15004
+ style: {
15005
+ position: "fixed",
15006
+ inset: 0,
15007
+ zIndex: 2147483e3,
15008
+ background: p || "rgba(0, 0, 0, 0.88)",
15009
+ color: _ || "#fff",
15010
+ display: "flex",
15011
+ flexDirection: "column",
15012
+ alignItems: "center",
15013
+ justifyContent: "center",
15014
+ padding: 24,
15015
+ gap: 12
15016
+ },
15017
+ children: [
15018
+ /* @__PURE__ */ h("div", {
15019
+ ...Z("stage"),
15020
+ onClick: T,
15021
+ style: {
15022
+ display: "flex",
15023
+ alignItems: "center",
15024
+ justifyContent: "center"
15025
+ },
15026
+ children: /* @__PURE__ */ h(Ql, {
15027
+ item: y,
15028
+ autoplay: v
15029
+ }, t)
15030
+ }),
15031
+ (l && E || d && x > 1) && /* @__PURE__ */ g("div", {
15032
+ onClick: T,
15033
+ style: {
15034
+ display: "flex",
15035
+ gap: 12,
15036
+ alignItems: "baseline",
15037
+ fontSize: 14
15038
+ },
15039
+ children: [l && E && /* @__PURE__ */ h("span", {
15040
+ ...Z("caption"),
15041
+ style: { opacity: .9 },
15042
+ children: E
15043
+ }), d && x > 1 && /* @__PURE__ */ h("span", {
15044
+ ...Z("counter"),
15045
+ style: {
15046
+ opacity: .6,
15047
+ fontVariantNumeric: "tabular-nums"
15048
+ },
15049
+ children: o("itemOf", {
15050
+ n: t + 1,
15051
+ total: x
15052
+ })
15053
+ })]
15054
+ }),
15055
+ f && x > 1 && /* @__PURE__ */ h("div", {
15056
+ ...Z("thumbs"),
15057
+ onClick: T,
15058
+ style: {
15059
+ display: "flex",
15060
+ gap: 6,
15061
+ maxWidth: "92vw",
15062
+ overflowX: "auto",
15063
+ padding: 4
15064
+ },
15065
+ children: e.map((e, r) => /* @__PURE__ */ h("button", {
15066
+ type: "button",
15067
+ ...Z("thumb-button", r === t && "thumb-button-active"),
15068
+ "aria-label": o("itemOf", {
15069
+ n: r + 1,
15070
+ total: x
15071
+ }),
15072
+ "aria-current": r === t || void 0,
15073
+ onClick: () => n(r),
15074
+ style: {
15075
+ flexShrink: 0,
15076
+ padding: 0,
15077
+ border: `2px solid ${r === t ? "currentColor" : "transparent"}`,
15078
+ borderRadius: 6,
15079
+ background: "none",
15080
+ cursor: "pointer",
15081
+ opacity: r === t ? 1 : .6
15082
+ },
15083
+ children: /* @__PURE__ */ h("img", {
15084
+ src: e.thumb,
15085
+ alt: "",
15086
+ style: {
15087
+ display: "block",
15088
+ width: 56,
15089
+ height: 42,
15090
+ objectFit: "cover",
15091
+ borderRadius: 4
15092
+ }
15093
+ })
15094
+ }, r))
15095
+ }),
15096
+ /* @__PURE__ */ h("button", {
15097
+ ref: b,
15098
+ type: "button",
15099
+ ...Z("close-button"),
15100
+ "aria-label": o("close"),
15101
+ onClick: r,
15102
+ style: {
15103
+ position: "absolute",
15104
+ top: 16,
15105
+ right: 16,
15106
+ width: 44,
15107
+ height: 44,
15108
+ borderRadius: "50%",
15109
+ border: 0,
15110
+ background: "rgba(255, 255, 255, 0.12)",
15111
+ color: "inherit",
15112
+ cursor: "pointer",
15113
+ fontSize: 24,
15114
+ lineHeight: 1
15115
+ },
15116
+ children: "×"
15117
+ }),
15118
+ x > 1 && /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h("button", {
15119
+ type: "button",
15120
+ ...Z("arrow", "arrow-prev"),
15121
+ "aria-label": o("prevItem"),
15122
+ disabled: !S,
15123
+ onClick: (e) => {
15124
+ T(e), w(-1);
15125
+ },
15126
+ style: {
15127
+ ...$l,
15128
+ left: 16,
15129
+ opacity: S ? 1 : .3
15130
+ },
15131
+ children: /* @__PURE__ */ h("svg", {
15132
+ width: "22",
15133
+ height: "22",
15134
+ viewBox: "0 0 24 24",
15135
+ fill: "none",
15136
+ stroke: "currentColor",
15137
+ strokeWidth: "2.2",
15138
+ strokeLinecap: "round",
15139
+ strokeLinejoin: "round",
15140
+ children: /* @__PURE__ */ h("path", { d: "M15 18l-6-6 6-6" })
15141
+ })
15142
+ }), /* @__PURE__ */ h("button", {
15143
+ type: "button",
15144
+ ...Z("arrow", "arrow-next"),
15145
+ "aria-label": o("nextItem"),
15146
+ disabled: !C,
15147
+ onClick: (e) => {
15148
+ T(e), w(1);
15149
+ },
15150
+ style: {
15151
+ ...$l,
15152
+ right: 16,
15153
+ opacity: C ? 1 : .3
15154
+ },
15155
+ children: /* @__PURE__ */ h("svg", {
15156
+ width: "22",
15157
+ height: "22",
15158
+ viewBox: "0 0 24 24",
15159
+ fill: "none",
15160
+ stroke: "currentColor",
15161
+ strokeWidth: "2.2",
15162
+ strokeLinecap: "round",
15163
+ strokeLinejoin: "round",
15164
+ children: /* @__PURE__ */ h("path", { d: "M9 18l6-6-6-6" })
15165
+ })
15166
+ })] })
15167
+ ]
15168
+ });
15169
+ }
15170
+ function tu(e, t, n) {
15171
+ let [r, i] = d(null);
15172
+ return {
15173
+ open: i,
15174
+ overlay: r !== null && e[r] && typeof document < "u" ? p(/* @__PURE__ */ h(eu, {
15175
+ list: e,
15176
+ index: r,
15177
+ onIndex: i,
15178
+ onClose: () => i(null),
15179
+ options: t,
15180
+ locale: n
15181
+ }), document.body) : null
15182
+ };
15183
+ }
15184
+ function nu(e, t, n) {
15185
+ return {
15186
+ role: "button",
15187
+ tabIndex: 0,
15188
+ "aria-label": Ze(n)("openItem", { name: t }),
15189
+ onClick: (t) => {
15190
+ t.target?.closest?.("a[href]") || e();
15191
+ },
15192
+ onKeyDown: (t) => {
15193
+ (t.key === "Enter" || t.key === " ") && (t.preventDefault(), e());
15194
+ }
15195
+ };
15196
+ }
15197
+ function ru(e) {
15198
+ let { tenant: t, apiUrl: n, revision: r, locale: i } = o(X), a = o(jn)?.[e], [c, l] = d(null);
15199
+ return s(() => {
15200
+ if (!e || a) return;
15201
+ let r = !0, o = new URLSearchParams({
15202
+ all: "1",
15203
+ ...i ? { locale: i } : {}
15204
+ });
15205
+ return fetch(`${n}/dynamic/${encodeURIComponent(e)}?${o}`, { headers: t ? { "x-tenant": t } : {} }).then((e) => e.json()).then((e) => {
15206
+ let t = Array.isArray(e?.payload) ? e.payload : Array.isArray(e?.payload?.data) ? e.payload.data : [];
15207
+ r && l(t.filter((e) => e && typeof e == "object"));
15208
+ }).catch(() => r && l([])), () => {
15209
+ r = !1;
15210
+ };
15211
+ }, [
15212
+ r,
15213
+ e,
15214
+ t,
15215
+ n,
15216
+ i,
15217
+ a
15218
+ ]), e ? a ?? c : null;
15219
+ }
15220
+ var iu = (e, t) => t ? e.filter((e) => e?.id === t || e?.data?.slug === t || e?.slug === t) : e, au = (e, t) => ({
15221
+ display: "grid",
15222
+ gridTemplateColumns: `repeat(${Math.min(Math.max(Number(e) || 4, 1), 8)}, minmax(0, 1fr))`,
15223
+ gap: t === "" || t == null || !Number.isFinite(Number(t)) ? 12 : Math.max(0, Number(t))
15224
+ }), ou = (e) => ({
15225
+ loop: e.loop !== !1,
15226
+ caption: e.caption !== !1,
15227
+ counter: e.counter !== !1,
15228
+ thumbs: !!e.thumbs,
15229
+ autoplay: e.autoplay !== !1,
15230
+ backdrop: e.backdrop || "",
15231
+ color: e.color || ""
15232
+ });
15233
+ function su(e) {
15234
+ let { items: t = [], source: n = "", entry: r = "", mediaField: i = "", nameField: a = "", posterField: s = "", limit: c = 0, emptyText: l = "", columns: u = 4, gap: d = "", templateId: f, renderTemplate: p, style: _, nodeRef: v, inert: y } = e, { locale: b } = o(X), x = o(Fn), S = o(In), C = ru(n), w = Hl(Jl({
15235
+ items: t,
15236
+ entries: n ? iu(C ?? [], r) : null,
15237
+ mediaField: i,
15238
+ nameField: a,
15239
+ posterField: s
15240
+ }), c), { open: T, overlay: E } = tu(w, ou(e), b), D = p ?? (f && x?.render ? (e) => x.render(f, e) : null), O = !!n && C === null;
15241
+ return /* @__PURE__ */ g("div", {
15242
+ ref: v,
15243
+ ...Z("grid"),
15244
+ style: {
15245
+ width: "100%",
15246
+ ...au(u, d),
15247
+ ...G(_)
15248
+ },
15249
+ children: [
15250
+ w.map((t) => {
15251
+ let n = Yl(t);
15252
+ return /* @__PURE__ */ h("div", {
15253
+ ...Z("item", Ul(t.kind) && "item-video"),
15254
+ ...y ? null : nu(() => T(t.index - 1), n.data.name, b),
15255
+ style: {
15256
+ minWidth: 0,
15257
+ position: "relative",
15258
+ cursor: y ? void 0 : "zoom-in"
15259
+ },
15260
+ children: D ? /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(In.Provider, {
15261
+ value: {
15262
+ ...S ?? {},
15263
+ entry: n
15264
+ },
15265
+ children: D((e) => Qn(e, n, b))
15266
+ }), e.playMark !== !1 && Ul(t.kind) && /* @__PURE__ */ h(Zl, {})] }) : /* @__PURE__ */ h(Xl, { item: t })
15267
+ }, `${t.index}-${t.src}`);
15268
+ }),
15269
+ !w.length && !O && (n ? l : null) && /* @__PURE__ */ h("div", {
15270
+ ...Z("empty"),
15271
+ style: {
15272
+ gridColumn: "1 / -1",
15273
+ padding: "24px 12px",
15274
+ fontSize: 13,
15275
+ opacity: .55,
15276
+ textAlign: "center"
15277
+ },
15278
+ children: l
15279
+ }),
15280
+ E
15281
+ ]
15282
+ });
15283
+ }
15284
+ var cu = { LightboxGallery: su }, lu = /* @__PURE__ */ new Map();
15285
+ function uu(e) {
15286
+ if (lu.has(e)) return lu.get(e);
14754
15287
  let t = URL.createObjectURL(new Blob([e], { type: "text/javascript" })), n = import(
14755
15288
  /* @vite-ignore */
14756
15289
  /* webpackIgnore: true */
14757
15290
  t
14758
15291
  ).finally(() => URL.revokeObjectURL(t));
14759
- return Pl.set(e, n), n;
15292
+ return lu.set(e, n), n;
14760
15293
  }
14761
- function Il(e) {
15294
+ function du(e) {
14762
15295
  let t = e && typeof e == "object" ? e.builder_plugins : null, n = t && typeof t == "object" ? t.plugins : null;
14763
15296
  return n && typeof n == "object" ? n : {};
14764
15297
  }
14765
15298
  //#endregion
14766
15299
  //#region ../ui/src/components/builder/plugins/view.jsx
14767
- async function Ll(e, t) {
14768
- let n = await Fl(e);
15300
+ async function fu(e, t) {
15301
+ let n = await uu(e);
14769
15302
  return (Array.isArray(n?.default?.blocks) ? n.default.blocks : []).find((e) => e?.id === t && typeof e.mount == "function") ?? null;
14770
15303
  }
14771
- var Rl = {
15304
+ var pu = {
14772
15305
  padding: "10px 12px",
14773
15306
  border: "1px dashed rgba(148, 163, 184, 0.5)",
14774
15307
  borderRadius: 8,
14775
15308
  fontSize: 12,
14776
15309
  opacity: .6
14777
15310
  };
14778
- function zl({ pluginId: e, blockId: t, props: n, style: r, nodeRef: i }) {
14779
- let a = o(X), c = Il(a?.settings)[e], l = u(null), d = u(null), f = {
15311
+ function mu({ pluginId: e, blockId: t, props: n, style: r, nodeRef: i }) {
15312
+ let a = o(X), c = du(a?.settings)[e], l = u(null), d = u(null), f = {
14780
15313
  tenant: a?.tenant ?? "",
14781
15314
  apiUrl: a?.apiUrl ?? "/api",
14782
15315
  locale: a?.locale ?? "",
@@ -14788,7 +15321,7 @@ function zl({ pluginId: e, blockId: t, props: n, style: r, nodeRef: i }) {
14788
15321
  let e = l.current;
14789
15322
  if (!c?.code || !e) return;
14790
15323
  let n = !0;
14791
- return Ll(c.code, t).then((e) => {
15324
+ return fu(c.code, t).then((e) => {
14792
15325
  if (!(!n || !e || !l.current)) {
14793
15326
  d.current = e;
14794
15327
  try {
@@ -14818,7 +15351,7 @@ function zl({ pluginId: e, blockId: t, props: n, style: r, nodeRef: i }) {
14818
15351
  }) : /* @__PURE__ */ g("div", {
14819
15352
  ref: i,
14820
15353
  style: {
14821
- ...Rl,
15354
+ ...pu,
14822
15355
  ...G(r)
14823
15356
  },
14824
15357
  children: [
@@ -14830,7 +15363,7 @@ function zl({ pluginId: e, blockId: t, props: n, style: r, nodeRef: i }) {
14830
15363
  }
14831
15364
  //#endregion
14832
15365
  //#region ../ui/src/components/builder/render.jsx
14833
- function Bl(e, t, n) {
15366
+ function hu(e, t, n) {
14834
15367
  let r = { "data-wb": e };
14835
15368
  t.htmlId && (r.id = t.htmlId), n && n.id === e && (r.id = t.htmlId || n.htmlId, r.tabIndex = -1);
14836
15369
  let i = q(t.classNames);
@@ -14844,7 +15377,7 @@ function Bl(e, t, n) {
14844
15377
  classes: i
14845
15378
  };
14846
15379
  }
14847
- function Vl({ View: e, markup: n, ...r }) {
15380
+ function gu({ View: e, markup: n, ...r }) {
14848
15381
  let a = e(r);
14849
15382
  if (!i(a) || typeof a.type != "string") return a;
14850
15383
  let o = [a.props.className, ...n.classes].filter(Boolean).join(" ");
@@ -14853,56 +15386,61 @@ function Vl({ View: e, markup: n, ...r }) {
14853
15386
  ...o ? { className: o } : {}
14854
15387
  });
14855
15388
  }
14856
- var Hl = /* @__PURE__ */ new Set([
15389
+ var _u = /* @__PURE__ */ new Set([
14857
15390
  "FormInput",
14858
15391
  "FormTextarea",
14859
15392
  "FormSelect"
14860
15393
  ]);
14861
- function Ul(e, t, n, r) {
15394
+ function vu(e, t, n, r) {
14862
15395
  if (t.forNode === "__none") return "";
14863
15396
  let i = t.forNode ? n[t.forNode] : null;
14864
15397
  if (!t.forNode) {
14865
15398
  let t = n[r]?.nodes ?? [];
14866
15399
  i = n[t[t.indexOf(e) + 1]] ?? null;
14867
15400
  }
14868
- return !i || !Hl.has(i.type?.resolvedName) ? "" : i.props?.htmlId || ea(i.props?.name) || "";
15401
+ return !i || !_u.has(i.type?.resolvedName) ? "" : i.props?.htmlId || ea(i.props?.name) || "";
14869
15402
  }
14870
- var Wl = "slot-", Gl = {
15403
+ var yu = "slot-", bu = {
14871
15404
  ...Eo,
14872
15405
  ...Mc,
14873
15406
  ...ml,
14874
15407
  ...Nl,
14875
- PluginBlock: zl
15408
+ ...cu,
15409
+ PluginBlock: mu
14876
15410
  };
14877
- function Kl(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
15411
+ function xu(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
14878
15412
  let o = n[t];
14879
15413
  if (!o || o.hidden) return null;
14880
15414
  let s = o.type?.resolvedName, c = a?.mapProps ? a.mapProps(o.props ?? {}, s) : o.props ?? {};
14881
15415
  if (s === "ComponentInstance") {
14882
15416
  let s = o.props?.componentId, l = r?.[s];
14883
15417
  if (!l?.template || i.has(s)) return null;
14884
- let u = new Set(i).add(s), d = Object.fromEntries(Object.entries(o.linkedNodes ?? {}).filter(([e]) => e.startsWith(Wl)).map(([e, t]) => [e.slice(5), Kl(t, n, r, i, a)]));
14885
- return /* @__PURE__ */ h(e, { children: Kl(l.template.rootId, l.template.nodes, r, u, {
15418
+ let u = new Set(i).add(s), d = Object.fromEntries(Object.entries(o.linkedNodes ?? {}).filter(([e]) => e.startsWith(yu)).map(([e, t]) => [e.slice(5), xu(t, n, r, i, a)]));
15419
+ return /* @__PURE__ */ h(e, { children: xu(l.template.rootId, l.template.nodes, r, u, {
14886
15420
  ...mt(c.values, a),
14887
15421
  slots: d
14888
15422
  }) }, t);
14889
15423
  }
14890
- let l = Gl[s];
15424
+ let l = bu[s];
14891
15425
  if (!l) return null;
14892
- let u = c.compSlot?.id, d = u && a?.slots && Object.hasOwn(a.slots, u) ? a.slots[u] : void 0, f = d === void 0 ? (o.nodes ?? []).map((e) => Kl(e, n, r, i, a)).filter(Boolean) : [d].filter(Boolean), p = Object.entries(o.linkedNodes ?? {}), m = p.length ? Object.fromEntries(p.map(([e, t]) => [e, Kl(t, n, r, i, a)])) : void 0, g = /* @__PURE__ */ h(typeof l == "function" ? Vl : l, {
15426
+ let u = c.compSlot?.id, d = u && a?.slots && Object.hasOwn(a.slots, u) ? a.slots[u] : void 0, f = d === void 0 ? (o.nodes ?? []).map((e) => xu(e, n, r, i, a)).filter(Boolean) : [d].filter(Boolean), p = Object.entries(o.linkedNodes ?? {}), m = p.length ? Object.fromEntries(p.map(([e, t]) => [e, xu(t, n, r, i, a)])) : void 0, g = /* @__PURE__ */ h(typeof l == "function" ? gu : l, {
14893
15427
  ...typeof l == "function" ? {
14894
15428
  View: l,
14895
- markup: Bl(t, c, a?.skipTarget)
15429
+ markup: hu(t, c, a?.skipTarget)
14896
15430
  } : null,
14897
15431
  ...c,
14898
15432
  ...s === "CollectionList" ? {
14899
15433
  templateId: o.linkedNodes?.card,
14900
- renderTemplate: o.linkedNodes?.card ? (e) => Kl(o.linkedNodes.card, n, r, i, {
15434
+ renderTemplate: o.linkedNodes?.card ? (e) => xu(o.linkedNodes.card, n, r, i, {
14901
15435
  ...a,
14902
15436
  mapProps: a?.mapProps ? (t, n) => a.mapProps(e(t, n), n) : e
14903
15437
  }) : void 0
14904
15438
  } : null,
14905
- ...s === "FormLabel" ? { htmlFor: Ul(t, c, n, o.parent) } : null,
15439
+ ...s === "LightboxGallery" && o.linkedNodes?.item ? { renderTemplate: (e) => xu(o.linkedNodes.item, n, r, i, {
15440
+ ...a,
15441
+ mapProps: a?.mapProps ? (t, n) => a.mapProps(e(t, n), n) : e
15442
+ }) } : null,
15443
+ ...s === "FormLabel" ? { htmlFor: vu(t, c, n, o.parent) } : null,
14906
15444
  linked: m,
14907
15445
  nodeRef: (e) => {
14908
15446
  e && (e.setAttribute("data-wb", t), le(e, c), a?.skipTarget?.id === t && (e.id = c.htmlId || a.skipTarget.htmlId, e.tabIndex = -1), ce(e, a?.events === !1 ? [] : c.events));
@@ -14919,9 +15457,9 @@ function Kl(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
14919
15457
  }
14920
15458
  //#endregion
14921
15459
  //#region ../ui/src/components/builder/PageRenderer.jsx
14922
- var ql = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), Jl = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(Fe(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
15460
+ var Su = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), Cu = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(Fe(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
14923
15461
  .webim-page[data-webim-mode="dark"] { ${Object.entries(Fe(e.dark)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }`;
14924
- function Yl({ 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: _, siteUser: v, param: y }) {
15462
+ function wu({ 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: _, siteUser: v, param: y }) {
14925
15463
  let b = a?.js?.trim(), S = _ && _["site.code"] && typeof _["site.code"] == "object" ? _["site.code"] : null, C = typeof S?.js == "string" ? S.js.trim() : "", T = typeof S?.css == "string" ? S.css.trim() : "";
14926
15464
  if (s(() => {
14927
15465
  if (!C) return;
@@ -14939,15 +15477,15 @@ function Yl({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
14939
15477
  minHeight: "100%",
14940
15478
  display: "flex",
14941
15479
  flexDirection: "column"
14942
- }, k = ot(e, n), A = Kl("ROOT", e, n, void 0, k ? { skipTarget: k } : void 0), j = k ? /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h("style", { children: et }), /* @__PURE__ */ h("a", {
15480
+ }, k = ot(e, n), A = xu("ROOT", e, n, void 0, k ? { skipTarget: k } : void 0), j = k ? /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h("style", { children: et }), /* @__PURE__ */ h("a", {
14943
15481
  className: "webim-skip",
14944
15482
  href: `#${k.htmlId}`,
14945
15483
  children: Ze(f || _?.locales?.default)("skip")
14946
- })] }) : null, M = l(() => ({ render: (t, r) => Kl(t, e, n, void 0, { mapProps: r }) }), [e, n]), N = we(e, n), P = Ce(e, n), F = a?.css?.trim(), I = V(o), L = Pe(t), R = [L.font, L.headingFont].filter((e) => typeof e == "string" && e.trim() && e !== "inherit" && !je[e]), z = [.../* @__PURE__ */ new Set([...w(e, n), ...R])].map((e) => /* @__PURE__ */ h("link", {
15484
+ })] }) : null, M = l(() => ({ render: (t, r) => xu(t, e, n, void 0, { mapProps: r }) }), [e, n]), N = we(e, n), P = Ce(e, n), F = a?.css?.trim(), I = V(o), L = Pe(t), R = [L.font, L.headingFont].filter((e) => typeof e == "string" && e.trim() && e !== "inherit" && !je[e]), z = [.../* @__PURE__ */ new Set([...w(e, n), ...R])].map((e) => /* @__PURE__ */ h("link", {
14947
15485
  rel: "stylesheet",
14948
15486
  precedence: "default",
14949
15487
  href: x(e)
14950
- }, e)), B = Jl(L), H = Be(t);
15488
+ }, e)), B = Cu(L), H = Be(t);
14951
15489
  return r === "auto" ? /* @__PURE__ */ h(X.Provider, {
14952
15490
  value: {
14953
15491
  tenant: c || "",
@@ -14972,8 +15510,8 @@ function Yl({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
14972
15510
  },
14973
15511
  children: [
14974
15512
  j,
14975
- /* @__PURE__ */ h("style", { children: `.webim-page { ${ql(Fe(L.light))} }
14976
- @media (prefers-color-scheme: dark) { .webim-page { ${ql(Fe(L.dark))} } }` }),
15513
+ /* @__PURE__ */ h("style", { children: `.webim-page { ${Su(Fe(L.light))} }
15514
+ @media (prefers-color-scheme: dark) { .webim-page { ${Su(Fe(L.dark))} } }` }),
14977
15515
  /* @__PURE__ */ h("style", { children: B }),
14978
15516
  z,
14979
15517
  /* @__PURE__ */ h("style", { children: D }),
@@ -15032,8 +15570,8 @@ function Yl({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
15032
15570
  }
15033
15571
  //#endregion
15034
15572
  //#region src/WebimContent.jsx
15035
- function Xl({ bundle: e, mode: t = "auto", style: n }) {
15036
- return e?.blocks?.ROOT ? /* @__PURE__ */ h(Yl, {
15573
+ function Tu({ bundle: e, mode: t = "auto", style: n }) {
15574
+ return e?.blocks?.ROOT ? /* @__PURE__ */ h(wu, {
15037
15575
  blocks: e.blocks,
15038
15576
  theme: e.theme,
15039
15577
  components: e.components,
@@ -15052,7 +15590,7 @@ function Xl({ bundle: e, mode: t = "auto", style: n }) {
15052
15590
  }
15053
15591
  //#endregion
15054
15592
  //#region src/WebimPage.jsx
15055
- function Zl({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, mode: o = "auto", style: c, fallback: l = null, errorFallback: f = null, onLoad: p, onError: m }) {
15593
+ function Eu({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, mode: o = "auto", style: c, fallback: l = null, errorFallback: f = null, onLoad: p, onError: m }) {
15056
15594
  let [g, _] = d({ status: "loading" }), v = u({
15057
15595
  onLoad: p,
15058
15596
  onError: m
@@ -15089,11 +15627,11 @@ function Zl({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, mo
15089
15627
  r,
15090
15628
  i,
15091
15629
  a
15092
- ]), g.status === "loading" ? l : g.status === "error" ? typeof f == "function" ? f(g.error) : f : /* @__PURE__ */ h(Xl, {
15630
+ ]), g.status === "loading" ? l : g.status === "error" ? typeof f == "function" ? f(g.error) : f : /* @__PURE__ */ h(Tu, {
15093
15631
  bundle: g.bundle,
15094
15632
  mode: o,
15095
15633
  style: c
15096
15634
  });
15097
15635
  }
15098
15636
  //#endregion
15099
- export { Yl as PageRenderer, Xl as WebimContent, Zl as WebimPage, Je as fetchPage, Or as renderRichContent, We as resolveTheme };
15637
+ export { wu as PageRenderer, Tu as WebimContent, Eu as WebimPage, Je as fetchPage, Or as renderRichContent, We as resolveTheme };