@sapia-ai/chatbot-v3 1.0.0 → 1.0.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.
Files changed (44) hide show
  1. package/dist/{EmbeddedVideoPlayer-SaMMfDIW.js → EmbeddedVideoPlayer-CNcds-dW.js} +283 -282
  2. package/dist/Preview-Dmns6UWL.js +84 -0
  3. package/dist/api.js +1 -1
  4. package/dist/{dist-DGBYKC8c.js → dist-B9SbMqZU.js} +2693 -2693
  5. package/dist/embed/createChatbot.d.ts +2 -0
  6. package/dist/{fix-webm-duration-BW9Fbdzt.js → fix-webm-duration-BWL-ZRDX.js} +2 -2
  7. package/dist/index.d.ts +0 -1
  8. package/dist/index.js +15479 -2067
  9. package/dist/jsx-runtime-8QqjHL5t.js +24 -0
  10. package/dist/messages-Czlp86gl.js +1963 -0
  11. package/dist/react-B0K-sClg.js +295 -0
  12. package/dist/{react-Bujo1aK5.js → react-ChCcxVnw.js} +90 -89
  13. package/dist/{react-GXf8sbzf.js → react-DJysvNxz.js} +72 -71
  14. package/dist/{react-BVzcquey.js → react-Dbs-sPBo.js} +93 -92
  15. package/dist/{react-lp7yfM94.js → react-NauLB_WU.js} +91 -90
  16. package/dist/{react-BGJ7Szvq.js → react-QrtEtv1G.js} +76 -74
  17. package/dist/{react-BrCGR7Ca.js → react-be7q6yw_.js} +312 -310
  18. package/dist/{react-CRTg4gz8.js → react-czRIxT0g.js} +85 -84
  19. package/dist/{react-BMxM8TWJ.js → react-dE7BdGuR.js} +49 -48
  20. package/dist-umd/sapia-chatbot.umd.js +1 -1
  21. package/package.json +14 -25
  22. package/dist/EmbeddedVideoPlayer-SaMMfDIW.js.map +0 -1
  23. package/dist/Preview-Db-hgkTh.js +0 -83
  24. package/dist/Preview-Db-hgkTh.js.map +0 -1
  25. package/dist/dash.all.min-DZ1yEcJk.js.map +0 -1
  26. package/dist/dist-BSi28_cP.js.map +0 -1
  27. package/dist/dist-DGBYKC8c.js.map +0 -1
  28. package/dist/dist-FvHBWiRa.js.map +0 -1
  29. package/dist/fix-webm-duration-BW9Fbdzt.js.map +0 -1
  30. package/dist/hls-mBncGwsE.js.map +0 -1
  31. package/dist/index.js.map +0 -1
  32. package/dist/max-Btet1snX.js.map +0 -1
  33. package/dist/messages-C4jqrtSG.js +0 -187
  34. package/dist/messages-C4jqrtSG.js.map +0 -1
  35. package/dist/react-BGJ7Szvq.js.map +0 -1
  36. package/dist/react-BMxM8TWJ.js.map +0 -1
  37. package/dist/react-BVzcquey.js.map +0 -1
  38. package/dist/react-BrCGR7Ca.js.map +0 -1
  39. package/dist/react-Bujo1aK5.js.map +0 -1
  40. package/dist/react-CRTg4gz8.js.map +0 -1
  41. package/dist/react-GXf8sbzf.js.map +0 -1
  42. package/dist/react-lp7yfM94.js.map +0 -1
  43. package/dist/sapia-chatbot.css +0 -3
  44. package/dist-umd/sapia-chatbot.umd.js.map +0 -1
@@ -1,67 +1,69 @@
1
- import { n as e } from "./hls-mBncGwsE.js";
2
- import { a as t, i as n, n as r, r as i, t as a } from "./classPrivateFieldSet2-DtQPURVD.js";
3
- import { t as o } from "./defineProperty-DiFpLzd2.js";
4
- import { n as s, t as c } from "./dist-BSi28_cP.js";
5
- import l from "react";
6
- var u = ((s) => {
7
- var c, l, u, d, f;
8
- return l = /* @__PURE__ */ new WeakMap(), u = /* @__PURE__ */ new WeakMap(), d = /* @__PURE__ */ new WeakSet(), f = /* @__PURE__ */ new WeakMap(), c = class extends s {
1
+ import { b as e } from "./messages-Czlp86gl.js";
2
+ import { t } from "./react-B0K-sClg.js";
3
+ import { n } from "./hls-mBncGwsE.js";
4
+ import { a as r, i, n as a, r as o, t as s } from "./classPrivateFieldSet2-DtQPURVD.js";
5
+ import { t as c } from "./defineProperty-DiFpLzd2.js";
6
+ import { n as l, t as u } from "./dist-BSi28_cP.js";
7
+ //#region ../../node_modules/.pnpm/hls-video-element@1.5.11/node_modules/hls-video-element/dist/hls-video-element.js
8
+ var d = /* @__PURE__ */ e(t(), 1), f = ((e) => {
9
+ var t, l, u, d, f;
10
+ return l = /* @__PURE__ */ new WeakMap(), u = /* @__PURE__ */ new WeakMap(), d = /* @__PURE__ */ new WeakSet(), f = /* @__PURE__ */ new WeakMap(), t = class extends e {
9
11
  constructor() {
10
- super(), t(this, d), n(this, l, null), n(this, u, null), n(this, f, () => {
12
+ super(), r(this, d), i(this, l, null), i(this, u, null), i(this, f, () => {
11
13
  var e, t, n;
12
14
  (e = this.nativeEl) != null && e.webkitCurrentPlaybackTargetIsWireless ? (t = this.api) == null || t.stopLoad() : (n = this.api) == null || n.startLoad();
13
- }), i(d, this, m).call(this, "config");
15
+ }), o(d, this, m).call(this, "config");
14
16
  }
15
17
  get config() {
16
- return r(u, this);
18
+ return a(u, this);
17
19
  }
18
20
  set config(e) {
19
- a(u, this, e);
21
+ s(u, this, e);
20
22
  }
21
23
  attributeChangedCallback(e, t, n) {
22
24
  e !== "src" && super.attributeChangedCallback(e, t, n), e === "src" && t != n && this.load();
23
25
  }
24
26
  async load() {
25
- var t, n;
26
- let o = !this.api;
27
- if (i(d, this, p).call(this), this.src) {
28
- if (o && !r(u, this) && a(u, this, JSON.parse(((t = this.shadowRoot.getElementById("config")) == null ? void 0 : t.textContent) || "{}")), e.isSupported()) {
29
- switch (await Promise.resolve(), this.api = new e({
27
+ var e, t;
28
+ let r = !this.api;
29
+ if (o(d, this, p).call(this), this.src) {
30
+ if (r && !a(u, this) && s(u, this, JSON.parse(((e = this.shadowRoot.getElementById("config")) == null ? void 0 : e.textContent) || "{}")), n.isSupported()) {
31
+ switch (await Promise.resolve(), this.api = new n({
30
32
  liveDurationInfinity: !0,
31
33
  autoStartLoad: !1,
32
34
  ...this.config
33
35
  }), this.api.loadSource(this.src), this.api.attachMedia(this.nativeEl), this.nativeEl.preload) {
34
36
  case "none": {
35
- let t = () => this.api.startLoad();
36
- this.nativeEl.addEventListener("play", t, { once: !0 }), this.api.on(e.Events.DESTROYING, () => {
37
- this.nativeEl.removeEventListener("play", t);
37
+ let e = () => this.api.startLoad();
38
+ this.nativeEl.addEventListener("play", e, { once: !0 }), this.api.on(n.Events.DESTROYING, () => {
39
+ this.nativeEl.removeEventListener("play", e);
38
40
  });
39
41
  break;
40
42
  }
41
43
  case "metadata": {
42
- let t = this.api.config.maxBufferLength, n = this.api.config.maxBufferSize;
44
+ let e = this.api.config.maxBufferLength, t = this.api.config.maxBufferSize;
43
45
  this.api.config.maxBufferLength = 1, this.api.config.maxBufferSize = 1;
44
46
  let r = () => {
45
- this.api.config.maxBufferLength = t, this.api.config.maxBufferSize = n;
47
+ this.api.config.maxBufferLength = e, this.api.config.maxBufferSize = t;
46
48
  };
47
- this.nativeEl.addEventListener("play", r, { once: !0 }), this.api.on(e.Events.DESTROYING, () => {
49
+ this.nativeEl.addEventListener("play", r, { once: !0 }), this.api.on(n.Events.DESTROYING, () => {
48
50
  this.nativeEl.removeEventListener("play", r);
49
51
  }), this.api.startLoad();
50
52
  break;
51
53
  }
52
54
  default: this.api.startLoad();
53
55
  }
54
- this.nativeEl.webkitCurrentPlaybackTargetIsWireless && this.api.stopLoad(), this.nativeEl.addEventListener("webkitcurrentplaybacktargetiswirelesschanged", r(f, this)), a(l, this, document.createElement("source")), r(l, this).setAttribute("type", "application/x-mpegURL"), r(l, this).setAttribute("src", this.src), this.nativeEl.disableRemotePlayback = !1, this.nativeEl.append(r(l, this));
55
- let t = /* @__PURE__ */ new WeakMap();
56
- this.api.on(e.Events.MANIFEST_PARSED, (e, n) => {
56
+ this.nativeEl.webkitCurrentPlaybackTargetIsWireless && this.api.stopLoad(), this.nativeEl.addEventListener("webkitcurrentplaybacktargetiswirelesschanged", a(f, this)), s(l, this, document.createElement("source")), a(l, this).setAttribute("type", "application/x-mpegURL"), a(l, this).setAttribute("src", this.src), this.nativeEl.disableRemotePlayback = !1, this.nativeEl.append(a(l, this));
57
+ let e = /* @__PURE__ */ new WeakMap();
58
+ this.api.on(n.Events.MANIFEST_PARSED, (t, n) => {
57
59
  this.nativeEl.autoplay && this.nativeEl.paused && this.nativeEl.play().catch((e) => {
58
60
  console.warn("Autoplay failed:", e);
59
- }), o();
61
+ }), i();
60
62
  let r = this.videoTracks.getTrackById("main");
61
63
  r || (r = this.addVideoTrack("main"), r.id = "main", r.selected = !0);
62
- for (let [e, i] of n.levels.entries()) {
64
+ for (let [t, i] of n.levels.entries()) {
63
65
  let n = r.addRendition(i.url[0], i.width, i.height, i.videoCodec, i.bitrate);
64
- t.set(i, `${e}`), n.id = `${e}`;
66
+ e.set(i, `${t}`), n.id = `${t}`;
65
67
  }
66
68
  for (let [e, t] of n.audioTracks.entries()) {
67
69
  let n = t.default ? "main" : "alternative", r = this.addAudioTrack(n, t.name, t.lang);
@@ -71,45 +73,45 @@ var u = ((s) => {
71
73
  var e;
72
74
  let t = +((e = [...this.audioTracks].find((e) => e.enabled)) == null ? void 0 : e.id), n = this.api.audioTracks.map((e) => e.id);
73
75
  t != this.api.audioTrack && n.includes(t) && (this.api.audioTrack = t);
74
- }), this.api.on(e.Events.LEVELS_UPDATED, (e, n) => {
76
+ }), this.api.on(n.Events.LEVELS_UPDATED, (t, n) => {
75
77
  var r;
76
78
  let i = this.videoTracks[(r = this.videoTracks.selectedIndex) == null ? 0 : r];
77
79
  if (!i) return;
78
- let a = n.levels.map((e) => t.get(e));
80
+ let a = n.levels.map((t) => e.get(t));
79
81
  for (let e of this.videoRenditions) e.id && !a.includes(e.id) && i.removeRendition(e);
80
82
  });
81
- let i = null;
82
- this.api.on(e.Events.ERROR, (t, n) => {
83
- n.type === e.ErrorTypes.NETWORK_ERROR && n.details === e.ErrorDetails.FRAG_LOAD_ERROR && (i = n.frag.level);
84
- }), this.api.on(e.Events.LEVEL_SWITCHED, (e, t) => {
83
+ let r = null;
84
+ this.api.on(n.Events.ERROR, (e, t) => {
85
+ t.type === n.ErrorTypes.NETWORK_ERROR && t.details === n.ErrorDetails.FRAG_LOAD_ERROR && (r = t.frag.level);
86
+ }), this.api.on(n.Events.LEVEL_SWITCHED, (e, t) => {
85
87
  let n = t.level;
86
- i !== null && n < i && (console.warn(`\u26A0\uFE0F hls.js downgraded quality from level ${i} to ${n} due to fragment load failure.`), this.videoRenditions.selectedIndex = n, i = null);
87
- }), (n = this.videoRenditions) == null || n.addEventListener("change", (e) => {
88
+ r !== null && n < r && (console.warn(`\u26A0\uFE0F hls.js downgraded quality from level ${r} to ${n} due to fragment load failure.`), this.videoRenditions.selectedIndex = n, r = null);
89
+ }), (t = this.videoRenditions) == null || t.addEventListener("change", (e) => {
88
90
  let t = e.target.selectedIndex;
89
91
  t != this.api.nextLevel && (this.api.nextLevel = t);
90
92
  });
91
- let o = () => {
93
+ let i = () => {
92
94
  for (let e of this.videoTracks) this.removeVideoTrack(e);
93
95
  for (let e of this.audioTracks) this.removeAudioTrack(e);
94
96
  };
95
- this.api.once(e.Events.DESTROYING, o);
97
+ this.api.once(n.Events.DESTROYING, i);
96
98
  return;
97
99
  }
98
100
  await Promise.resolve(), this.nativeEl.canPlayType("application/vnd.apple.mpegurl") && (this.nativeEl.src = this.src);
99
101
  }
100
102
  }
101
- }, o(c, "shadowRootOptions", { ...s.shadowRootOptions }), o(c, "getTemplateHTML", (e, t = {}) => {
102
- let { src: n, ...r } = e;
103
+ }, c(t, "shadowRootOptions", { ...e.shadowRootOptions }), c(t, "getTemplateHTML", (t, n = {}) => {
104
+ let { src: r, ...i } = t;
103
105
  return `
104
106
  <script type="application/json" id="config">
105
- ${JSON.stringify(t.config || {})}
107
+ ${JSON.stringify(n.config || {})}
106
108
  <\/script>
107
- ${s.getTemplateHTML(r)}
109
+ ${e.getTemplateHTML(i)}
108
110
  `;
109
- }), c;
111
+ }), t;
110
112
  function p() {
111
113
  var e, t;
112
- (e = r(l, this)) == null || e.remove(), (t = this.nativeEl) == null || t.removeEventListener("webkitcurrentplaybacktargetiswirelesschanged", r(f, this)), this.api && (this.api.detachMedia(), this.api.destroy(), this.api = null);
114
+ (e = a(l, this)) == null || e.remove(), (t = this.nativeEl) == null || t.removeEventListener("webkitcurrentplaybacktargetiswirelesschanged", a(f, this)), this.api && (this.api.detachMedia(), this.api.destroy(), this.api = null);
113
115
  }
114
116
  function m(e) {
115
117
  if (Object.prototype.hasOwnProperty.call(this, e)) {
@@ -117,9 +119,9 @@ var u = ((s) => {
117
119
  delete this[e], this[e] = t;
118
120
  }
119
121
  }
120
- })(c(s));
121
- globalThis.customElements && !globalThis.customElements.get("hls-video") && globalThis.customElements.define("hls-video", u);
122
- var d = u, f = /* @__PURE__ */ new Set([
122
+ })(u(l));
123
+ globalThis.customElements && !globalThis.customElements.get("hls-video") && globalThis.customElements.define("hls-video", f);
124
+ var p = f, m = /* @__PURE__ */ new Set([
123
125
  "style",
124
126
  "children",
125
127
  "ref",
@@ -127,56 +129,56 @@ var d = u, f = /* @__PURE__ */ new Set([
127
129
  "suppressContentEditableWarning",
128
130
  "suppressHydrationWarning",
129
131
  "dangerouslySetInnerHTML"
130
- ]), p = {
132
+ ]), h = {
131
133
  className: "class",
132
134
  htmlFor: "for"
133
135
  };
134
- function m(e) {
136
+ function g(e) {
135
137
  return e.toLowerCase();
136
138
  }
137
- function h(e) {
139
+ function _(e) {
138
140
  if (typeof e == "boolean") return e ? "" : void 0;
139
141
  if (typeof e != "function" && !(typeof e == "object" && e)) return e;
140
142
  }
141
- function g({ react: e, tagName: t, elementClass: n, events: r, displayName: i, defaultProps: a, toAttributeName: o = m, toAttributeValue: s = h }) {
143
+ function v({ react: e, tagName: t, elementClass: n, events: r, displayName: i, defaultProps: a, toAttributeName: o = g, toAttributeValue: s = _ }) {
142
144
  let c = Number.parseInt(e.version) >= 19, l = e.forwardRef((i, l) => {
143
145
  var u, d;
144
- let m = e.useRef(null), g = e.useRef(/* @__PURE__ */ new Map()), v = {}, y = {}, b = {}, x = {};
146
+ let f = e.useRef(null), p = e.useRef(/* @__PURE__ */ new Map()), g = {}, v = {}, b = {}, x = {};
145
147
  for (let [e, t] of Object.entries(i)) {
146
148
  var S, C;
147
- if (f.has(e)) {
149
+ if (m.has(e)) {
148
150
  b[e] = t;
149
151
  continue;
150
152
  }
151
- let r = o((S = p[e]) == null ? e : S);
153
+ let r = o((S = h[e]) == null ? e : S);
152
154
  if (n.prototype && e in n.prototype && !(e in ((C = (u = globalThis.HTMLElement) == null ? void 0 : u.prototype) == null ? {} : C)) && !((d = n.observedAttributes) != null && d.some((e) => e === r))) {
153
155
  x[e] = t;
154
156
  continue;
155
157
  }
156
158
  if (e.startsWith("on")) {
157
- v[e] = t;
159
+ g[e] = t;
158
160
  continue;
159
161
  }
160
162
  let i = s(t);
161
- r && i != null && (y[r] = String(i), c || (b[r] = i)), r && c && (i === h(t) ? b[r] = t : b[r] = i);
163
+ r && i != null && (v[r] = String(i), c || (b[r] = i)), r && c && (i === _(t) ? b[r] = t : b[r] = i);
162
164
  }
163
165
  if (typeof window < "u") {
164
- for (let t in v) {
166
+ for (let t in g) {
165
167
  var w;
166
- let n = v[t], i = t.endsWith("Capture"), a = ((w = r == null ? void 0 : r[t]) == null ? t.slice(2).toLowerCase() : w).slice(0, i ? -7 : void 0);
168
+ let n = g[t], i = t.endsWith("Capture"), a = ((w = r == null ? void 0 : r[t]) == null ? t.slice(2).toLowerCase() : w).slice(0, i ? -7 : void 0);
167
169
  e.useLayoutEffect(() => {
168
- let e = m == null ? void 0 : m.current;
170
+ let e = f == null ? void 0 : f.current;
169
171
  if (!(!e || typeof n != "function")) return e.addEventListener(a, n, i), () => {
170
172
  e.removeEventListener(a, n, i);
171
173
  };
172
- }, [m == null ? void 0 : m.current, n]);
174
+ }, [f == null ? void 0 : f.current, n]);
173
175
  }
174
176
  e.useLayoutEffect(() => {
175
- if (m.current === null) return;
177
+ if (f.current === null) return;
176
178
  let e = /* @__PURE__ */ new Map();
177
- for (let t in x) _(m.current, t, x[t]), g.current.delete(t), e.set(t, x[t]);
178
- for (let [e, t] of g.current) _(m.current, e, void 0);
179
- g.current = e;
179
+ for (let t in x) y(f.current, t, x[t]), p.current.delete(t), e.set(t, x[t]);
180
+ for (let [e, t] of p.current) y(f.current, e, void 0);
181
+ p.current = e;
180
182
  });
181
183
  }
182
184
  if (typeof window > "u" && n != null && n.getTemplateHTML && n != null && n.shadowRootOptions) {
@@ -184,7 +186,7 @@ function g({ react: e, tagName: t, elementClass: n, events: r, displayName: i, d
184
186
  b.children = [e.createElement("template", {
185
187
  shadowrootmode: t,
186
188
  shadowrootdelegatesfocus: r,
187
- dangerouslySetInnerHTML: { __html: n.getTemplateHTML(y, i) },
189
+ dangerouslySetInnerHTML: { __html: n.getTemplateHTML(v, i) },
188
190
  key: "ce-la-react-ssr-template-shadow-root"
189
191
  }), b.children];
190
192
  }
@@ -192,25 +194,25 @@ function g({ react: e, tagName: t, elementClass: n, events: r, displayName: i, d
192
194
  ...a,
193
195
  ...b,
194
196
  ref: e.useCallback((e) => {
195
- m.current = e, typeof l == "function" ? l(e) : l !== null && (l.current = e);
197
+ f.current = e, typeof l == "function" ? l(e) : l !== null && (l.current = e);
196
198
  }, [l])
197
199
  }, b.children);
198
200
  });
199
201
  return l.displayName = i == null ? n.name : i, l;
200
202
  }
201
- function _(e, t, n) {
203
+ function y(e, t, n) {
202
204
  var r, i;
203
205
  e[t] = n, n == null && t in ((r = (i = globalThis.HTMLElement) == null ? void 0 : i.prototype) == null ? {} : r) && e.removeAttribute(t);
204
206
  }
205
- var v = g({
206
- react: l,
207
+ var b = v({
208
+ react: d.default,
207
209
  tagName: "hls-video",
208
- elementClass: d,
210
+ elementClass: p,
209
211
  toAttributeName(e) {
210
- return e === "muted" ? "" : e === "defaultMuted" ? "muted" : m(e);
212
+ return e === "muted" ? "" : e === "defaultMuted" ? "muted" : g(e);
211
213
  }
212
214
  });
213
215
  //#endregion
214
- export { v as default };
216
+ export { b as default };
215
217
 
216
- //# sourceMappingURL=react-BGJ7Szvq.js.map
218
+ //# sourceMappingURL=react-QrtEtv1G.js.map