@sapia-ai/chatbot-v3 1.3.1-beta.8.gaa82161 → 1.4.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.
Files changed (85) hide show
  1. package/dist/{EmbeddedVideoPlayer-DsoMwCbP.js → EmbeddedVideoPlayer-G554aRrZ.js} +141 -109
  2. package/dist/{Preview-BJXCAMet.js → Preview-CSE0hI6e.js} +3 -3
  3. package/dist/api/client.d.ts +33 -4
  4. package/dist/api/config.d.ts +1 -1
  5. package/dist/api/errors.d.ts +25 -0
  6. package/dist/api/fiToken.d.ts +23 -0
  7. package/dist/api/index.d.ts +1 -0
  8. package/dist/api/types/branding.d.ts +3 -1
  9. package/dist/api/types/messages.d.ts +57 -3
  10. package/dist/api/types/responses.d.ts +154 -5
  11. package/dist/api.js +2 -2
  12. package/dist/{messages-DhmdgtVq.js → client-DG-5x86F.js} +706 -575
  13. package/dist/core/bubbles/cards.d.ts +7 -1
  14. package/dist/core/bubbles/convert.d.ts +3 -2
  15. package/dist/core/bubbles/counters.d.ts +18 -7
  16. package/dist/core/bubbles/customerSatisfactionRun.d.ts +62 -0
  17. package/dist/core/bubbles/mutations.d.ts +29 -0
  18. package/dist/core/bubbles/piiRun.d.ts +63 -0
  19. package/dist/core/bubbles/selection.d.ts +40 -0
  20. package/dist/core/bubbles/types.d.ts +39 -0
  21. package/dist/core/constants.d.ts +27 -10
  22. package/dist/core/{interview.d.ts → interview/engine.d.ts} +99 -56
  23. package/dist/core/interview/errors.d.ts +14 -0
  24. package/dist/core/interview/liveBubble.d.ts +26 -0
  25. package/dist/core/interview/reveal.d.ts +78 -0
  26. package/dist/core/persistence.d.ts +6 -7
  27. package/dist/core/store.d.ts +35 -6
  28. package/dist/core/theme/cssVariables.d.ts +0 -1
  29. package/dist/core/validation/pii.d.ts +1 -0
  30. package/dist/core/validation/piiAnswer.d.ts +38 -0
  31. package/dist/core/validation/piiForm.d.ts +76 -0
  32. package/dist/{dist-BcVYIqYW.js → dist-DsGdVwdi.js} +3 -3
  33. package/dist/embed/createChatbot.d.ts +2 -0
  34. package/dist/{fix-webm-duration-C_2_s-pb.js → fix-webm-duration-Bie2OG-n.js} +2 -2
  35. package/dist/index.d.ts +1 -1
  36. package/dist/index.js +7493 -5963
  37. package/dist/{jsx-runtime-n3Sufh_D.js → jsx-runtime-B5vw3nIj.js} +2 -2
  38. package/dist/react/AnswerInput.d.ts +1 -1
  39. package/dist/react/SapiaChatbot.d.ts +3 -1
  40. package/dist/react/bubbleViewModel.d.ts +56 -24
  41. package/dist/react/strings.d.ts +59 -11
  42. package/dist/react/useCustomerSatisfactionForm.d.ts +14 -0
  43. package/dist/react/usePiiForm.d.ts +52 -0
  44. package/dist/react/useSessionExpiryCheck.d.ts +3 -0
  45. package/dist/{react-xf6AdbdB.js → react-B46N_vb_.js} +3 -3
  46. package/dist/{react-B0vf2MBf.js → react-CN-F_7qV.js} +3 -3
  47. package/dist/{react-DVuMKYmt.js → react-CpnhkRge.js} +3 -3
  48. package/dist/{react-n_76t7t4.js → react-DHdgNnK2.js} +2 -2
  49. package/dist/{react-7TPcBgC1.js → react-Dd6J2Pyv.js} +3 -3
  50. package/dist/{react-BjMTT8OK.js → react-SKFkpgRr.js} +3 -3
  51. package/dist/{react-Cxd6prOd.js → react-T5LsuM9r.js} +3 -3
  52. package/dist/{react-_3Fe4HUu.js → react-_TUsDaHa.js} +3 -3
  53. package/dist/{react-BQay9cEy.js → react-abEVBgXB.js} +3 -3
  54. package/dist/ui/chat/ActionDock/ActionDock.d.ts +15 -3
  55. package/dist/ui/chat/AgcGuidanceCard/AgcGuidanceCard.d.ts +15 -0
  56. package/dist/ui/chat/AnswerDisclosure/AnswerDisclosure.d.ts +18 -0
  57. package/dist/ui/chat/ChatBubble/ChatBubble.d.ts +11 -1
  58. package/dist/ui/chat/ChatLog/ChatLog.d.ts +10 -2
  59. package/dist/ui/chat/PiiDetailsCard/PiiDetailsCard.d.ts +23 -0
  60. package/dist/ui/chat/ScrollToLatestButton/ScrollToLatestButton.d.ts +11 -0
  61. package/dist/ui/chat/SummaryCard/SummaryCard.d.ts +1 -3
  62. package/dist/ui/chat/TypingIndicator/TiaMark.d.ts +14 -0
  63. package/dist/ui/chat/TypingIndicator/TypingIndicator.d.ts +21 -7
  64. package/dist/ui/chat/types.d.ts +32 -1
  65. package/dist/ui/inputs/CustomerSatisfactionForm/CustomerSatisfactionForm.d.ts +30 -0
  66. package/dist/ui/inputs/LocationAnswerInput/LocationAnswerInput.d.ts +6 -13
  67. package/dist/ui/inputs/LocationAnswerInput/LocationCombobox.d.ts +52 -0
  68. package/dist/ui/inputs/OptionList/OptionList.d.ts +16 -4
  69. package/dist/ui/inputs/PhoneAnswerInput/PhoneAnswerInput.d.ts +4 -8
  70. package/dist/ui/inputs/PhoneAnswerInput/PhoneCountrySelect.d.ts +19 -0
  71. package/dist/ui/inputs/PiiForm/PiiForm.d.ts +59 -0
  72. package/dist/ui/inputs/PiiForm/PiiFormField.d.ts +19 -0
  73. package/dist/ui/inputs/RatingScale/RatingScale.d.ts +20 -0
  74. package/dist/ui/inputs/TextAnswerInput/TextAnswerInput.d.ts +1 -3
  75. package/dist/ui/inputs/formCard.d.ts +2 -0
  76. package/dist/ui/media/EmbeddedVideo/EmbeddedVideoPlayer.d.ts +5 -4
  77. package/dist/ui/media/EmbeddedVideo/YouTubePlayer.d.ts +24 -0
  78. package/dist/ui/primitives/Button/Button.d.ts +6 -0
  79. package/dist/ui/primitives/Dialog/Dialog.d.ts +0 -2
  80. package/dist/ui/richText.d.ts +2 -2
  81. package/dist/ui/shell/AccessVerificationForm/AccessVerificationForm.d.ts +0 -1
  82. package/dist/ui/shell/Header/Header.d.ts +8 -12
  83. package/dist-umd/sapia-chatbot.umd.js +311 -308
  84. package/package.json +1 -1
  85. package/dist/ui/shell/AgcGuidanceDialog/AgcGuidanceDialog.d.ts +0 -14
@@ -1,6 +1,6 @@
1
- import { E as e } from "./messages-DhmdgtVq.js";
2
- import { t } from "./react-n_76t7t4.js";
3
- import { t as n } from "./jsx-runtime-n3Sufh_D.js";
1
+ import { z as e } from "./client-DG-5x86F.js";
2
+ import { t } from "./react-DHdgNnK2.js";
3
+ import { t as n } from "./jsx-runtime-B5vw3nIj.js";
4
4
  import { t as r } from "./defineProperty-DiFpLzd2.js";
5
5
  //#region ../../node_modules/.pnpm/react-player@3.4.0_@svta+cml-cta@1.0.6_@svta+cml-structured-field-values@1.1.3_@svta+cm_a4f64f295cc2a316f39ce360b0a6e480/node_modules/react-player/dist/patterns.js
6
6
  var i = /* @__PURE__ */ e(t(), 1), a = /\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\?)/i, o = /\.(mp4|og[gv]|webm|mov|m4v)(#t=[,\d+]+)?($|\?)/i, s = /\.(m3u8)($|\?)/i, c = /\.(mpd)($|\?)/i, l = /stream\.mux\.com\/(?!\w+\.m3u8)(\w+)/, u = /(?:youtu\.be\/|youtube(?:-nocookie|education)?\.com\/(?:embed\/|v\/|watch\/|watch\?v=|watch\?.+&v=|shorts\/|live\/))((\w|-){11})|youtube\.com\/playlist\?list=|youtube\.com\/user\//, d = /vimeo\.com\/(?!progressive_redirect).+/, f = /(?:wistia\.(?:com|net)|wi\.st)\/(?:medias|embed)\/(?:iframe\/)?([^?]+)/, p = /open\.spotify\.com\/(\w+)\/(\w+)/i, m = /(?:www\.|go\.)?twitch\.tv\/([a-zA-Z0-9_]+|(videos?\/|\?video=)\d+)($|\?)/, h = /tiktok\.com\/(?:player\/v1\/|share\/video\/|@[^/]+\/video\/)([0-9]+)/, g = (e, t) => {
@@ -34,7 +34,7 @@ var i = /* @__PURE__ */ e(t(), 1), a = /\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3
34
34
  canEnablePIP: () => !0,
35
35
  player: (0, i.lazy)(() => import(
36
36
  /* webpackChunkName: 'reactPlayerHls' */
37
- "./react-Cxd6prOd.js"
37
+ "./react-T5LsuM9r.js"
38
38
  ))
39
39
  },
40
40
  {
@@ -44,7 +44,7 @@ var i = /* @__PURE__ */ e(t(), 1), a = /\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3
44
44
  canEnablePIP: () => !0,
45
45
  player: (0, i.lazy)(() => import(
46
46
  /* webpackChunkName: 'reactPlayerDash' */
47
- "./react-_3Fe4HUu.js"
47
+ "./react-_TUsDaHa.js"
48
48
  ))
49
49
  },
50
50
  {
@@ -54,7 +54,7 @@ var i = /* @__PURE__ */ e(t(), 1), a = /\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3
54
54
  canEnablePIP: () => !0,
55
55
  player: (0, i.lazy)(() => import(
56
56
  /* webpackChunkName: 'reactPlayerMux' */
57
- "./dist-BcVYIqYW.js"
57
+ "./dist-DsGdVwdi.js"
58
58
  ))
59
59
  },
60
60
  {
@@ -63,7 +63,7 @@ var i = /* @__PURE__ */ e(t(), 1), a = /\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3
63
63
  canPlay: _.youtube,
64
64
  player: (0, i.lazy)(() => import(
65
65
  /* webpackChunkName: 'reactPlayerYouTube' */
66
- "./react-xf6AdbdB.js"
66
+ "./react-B46N_vb_.js"
67
67
  ))
68
68
  },
69
69
  {
@@ -72,7 +72,7 @@ var i = /* @__PURE__ */ e(t(), 1), a = /\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3
72
72
  canPlay: _.vimeo,
73
73
  player: (0, i.lazy)(() => import(
74
74
  /* webpackChunkName: 'reactPlayerVimeo' */
75
- "./react-BjMTT8OK.js"
75
+ "./react-SKFkpgRr.js"
76
76
  ))
77
77
  },
78
78
  {
@@ -82,7 +82,7 @@ var i = /* @__PURE__ */ e(t(), 1), a = /\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3
82
82
  canEnablePIP: () => !0,
83
83
  player: (0, i.lazy)(() => import(
84
84
  /* webpackChunkName: 'reactPlayerWistia' */
85
- "./react-7TPcBgC1.js"
85
+ "./react-Dd6J2Pyv.js"
86
86
  ))
87
87
  },
88
88
  {
@@ -92,7 +92,7 @@ var i = /* @__PURE__ */ e(t(), 1), a = /\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3
92
92
  canEnablePIP: () => !1,
93
93
  player: (0, i.lazy)(() => import(
94
94
  /* webpackChunkName: 'reactPlayerSpotify' */
95
- "./react-B0vf2MBf.js"
95
+ "./react-CN-F_7qV.js"
96
96
  ))
97
97
  },
98
98
  {
@@ -102,7 +102,7 @@ var i = /* @__PURE__ */ e(t(), 1), a = /\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3
102
102
  canEnablePIP: () => !1,
103
103
  player: (0, i.lazy)(() => import(
104
104
  /* webpackChunkName: 'reactPlayerTwitch' */
105
- "./react-DVuMKYmt.js"
105
+ "./react-CpnhkRge.js"
106
106
  ))
107
107
  },
108
108
  {
@@ -112,7 +112,7 @@ var i = /* @__PURE__ */ e(t(), 1), a = /\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3
112
112
  canEnablePIP: () => !1,
113
113
  player: (0, i.lazy)(() => import(
114
114
  /* webpackChunkName: 'reactPlayerTiktok' */
115
- "./react-BQay9cEy.js"
115
+ "./react-abEVBgXB.js"
116
116
  ))
117
117
  },
118
118
  {
@@ -179,12 +179,12 @@ var i = /* @__PURE__ */ e(t(), 1), a = /\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3
179
179
  }, e.children);
180
180
  });
181
181
  x.displayName = "Player";
182
- var ee = x, S = (0, i.lazy)(() => import(
182
+ var ee = x, te = (0, i.lazy)(() => import(
183
183
  /* webpackChunkName: 'reactPlayerPreview' */
184
- "./Preview-BJXCAMet.js"
185
- )), C = [], w = (e, t) => {
184
+ "./Preview-CSE0hI6e.js"
185
+ )), S = [], ne = (e, t) => {
186
186
  let n = (n) => {
187
- for (let t of [...C, ...e]) if (n && t.canPlay(n)) return t;
187
+ for (let t of [...S, ...e]) if (n && t.canPlay(n)) return t;
188
188
  return t || null;
189
189
  }, r = i.forwardRef((e, t) => {
190
190
  let r = {
@@ -200,7 +200,7 @@ var ee = x, S = (0, i.lazy)(() => import(
200
200
  }, g = (e) => {
201
201
  if (!e) return null;
202
202
  let { light: t, playIcon: n, previewTabIndex: a, oEmbedUrl: o, previewAriaLabel: s } = r;
203
- return /* @__PURE__ */ i.createElement(S, {
203
+ return /* @__PURE__ */ i.createElement(te, {
204
204
  src: e,
205
205
  light: t,
206
206
  playIcon: n,
@@ -232,7 +232,7 @@ var ee = x, S = (0, i.lazy)(() => import(
232
232
  },
233
233
  config: m
234
234
  });
235
- }, v = f == null ? T : f, y = d === !1 ? T : i.Suspense;
235
+ }, v = f == null ? C : f, y = d === !1 ? C : i.Suspense;
236
236
  return /* @__PURE__ */ i.createElement(v, {
237
237
  slot: o,
238
238
  className: s,
@@ -244,38 +244,38 @@ var ee = x, S = (0, i.lazy)(() => import(
244
244
  }, /* @__PURE__ */ i.createElement(y, { fallback: d }, p ? g(a) : _(a)));
245
245
  });
246
246
  return r.displayName = "ReactPlayer", r.addCustomPlayer = (e) => {
247
- C.push(e);
247
+ S.push(e);
248
248
  }, r.removeCustomPlayers = () => {
249
- C.length = 0;
249
+ S.length = 0;
250
250
  }, r.canPlay = (t) => {
251
251
  if (t) {
252
- for (let n of [...C, ...e]) if (n.canPlay(t)) return !0;
252
+ for (let n of [...S, ...e]) if (n.canPlay(t)) return !0;
253
253
  }
254
254
  return !1;
255
255
  }, r.canEnablePIP = (t) => {
256
256
  var n;
257
257
  if (t) {
258
- for (let r of [...C, ...e]) if (r.canPlay(t) && (n = r.canEnablePIP) != null && n.call(r)) return !0;
258
+ for (let r of [...S, ...e]) if (r.canPlay(t) && (n = r.canEnablePIP) != null && n.call(r)) return !0;
259
259
  }
260
260
  return !1;
261
261
  }, r;
262
- }, T = ({ children: e }) => e, te = y[y.length - 1], E = w(y, te), D, ne = typeof global < "u" && {}.toString.call(global) === "[object global]", re = typeof Bun < "u", ie = typeof Deno < "u", O = typeof WebSocketPair == "function" && ((D = caches) == null ? void 0 : D.default) !== void 0, k = ne || re || ie || O;
263
- function A(e, t) {
262
+ }, C = ({ children: e }) => e, w = y[y.length - 1], re = ne(y, w), T, E = typeof global < "u" && {}.toString.call(global) === "[object global]", ie = typeof Bun < "u", ae = typeof Deno < "u", D = typeof WebSocketPair == "function" && ((T = caches) == null ? void 0 : T.default) !== void 0, O = E || ie || ae || D;
263
+ function k(e, t) {
264
264
  return e.indexOf(t.toLowerCase()) === 0 ? e : `${t.toLowerCase()}${e.substr(0, 1).toUpperCase()}${e.substr(1)}`;
265
265
  }
266
- function ae(e) {
266
+ function oe(e) {
267
267
  return !!(e && e.nodeType === 1 && "nodeName" in e && e.ownerDocument && e.ownerDocument.defaultView);
268
268
  }
269
- function j(e) {
269
+ function se(e) {
270
270
  return !isNaN(parseFloat(e)) && isFinite(e) && Math.floor(e) == e;
271
271
  }
272
- function M(e) {
272
+ function A(e) {
273
273
  return /^(https?:)?\/\/((((player|www)\.)?vimeo\.com)|((player\.)?[a-zA-Z0-9-]+\.(videoji\.(hk|cn)|vimeo\.work)))(?=$|\/)/.test(e);
274
274
  }
275
- function N(e) {
275
+ function j(e) {
276
276
  return /^https:\/\/player\.((vimeo\.com)|([a-zA-Z0-9-]+\.(videoji\.(hk|cn)|vimeo\.work)))\/video\/\d+/.test(e);
277
277
  }
278
- function oe(e) {
278
+ function M(e) {
279
279
  let t = (e || "").match(/^(?:https?:)?(?:\/\/)?([^/?]+)/), n = (t && t[1] || "").replace("player.", "");
280
280
  for (let e of [
281
281
  ".videoji.hk",
@@ -284,30 +284,30 @@ function oe(e) {
284
284
  ]) if (n.endsWith(e)) return n;
285
285
  return "vimeo.com";
286
286
  }
287
- function P() {
287
+ function N() {
288
288
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = e.id, n = e.url, r = t || n;
289
289
  if (!r) throw Error("An id or url must be passed, either in an options object or as a data-vimeo-id or data-vimeo-url attribute.");
290
- if (j(r)) return `https://vimeo.com/${r}`;
291
- if (M(r)) return r.replace("http:", "https:");
290
+ if (se(r)) return `https://vimeo.com/${r}`;
291
+ if (A(r)) return r.replace("http:", "https:");
292
292
  throw TypeError(t ? `“${t}” is not a valid video id.` : `“${r}” is not a vimeo.com url.`);
293
293
  }
294
- var F = function(e, t, n) {
294
+ var P = function(e, t, n) {
295
295
  let r = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : "addEventListener", i = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : "removeEventListener", a = typeof t == "string" ? [t] : t;
296
296
  return a.forEach((t) => {
297
297
  e[r](t, n);
298
298
  }), { cancel: () => a.forEach((t) => e[i](t, n)) };
299
299
  };
300
- function I(e) {
300
+ function F(e) {
301
301
  let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : document;
302
302
  if (!e || !t || typeof t.querySelectorAll != "function") return null;
303
303
  let n = t.querySelectorAll("iframe");
304
304
  for (let t = 0; t < n.length; t++) if (n[t] && n[t].contentWindow === e) return n[t];
305
305
  return null;
306
306
  }
307
- var se = Array.prototype.indexOf !== void 0, ce = typeof window < "u" && window.postMessage !== void 0;
308
- if (!k && (!se || !ce)) throw Error("Sorry, the Vimeo Player API is not available in this browser.");
309
- var L = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
310
- function le(e, t) {
307
+ var ce = Array.prototype.indexOf !== void 0, le = typeof window < "u" && window.postMessage !== void 0;
308
+ if (!O && (!ce || !le)) throw Error("Sorry, the Vimeo Player API is not available in this browser.");
309
+ var I = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
310
+ function ue(e, t) {
311
311
  return t = { exports: {} }, e(t, t.exports), t.exports;
312
312
  }
313
313
  (function(e) {
@@ -360,11 +360,11 @@ function le(e, t) {
360
360
  function i(e) {
361
361
  return Object(e) === e;
362
362
  }
363
- })(typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : L);
364
- var R = le(function(e) {
363
+ })(typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : I);
364
+ var L = ue(function(e) {
365
365
  (function(t, n, r) {
366
366
  n[t] = n[t] || r(), e.exports && (e.exports = n[t]);
367
- })("Promise", L, function() {
367
+ })("Promise", I, function() {
368
368
  var e, t, n, r = Object.prototype.toString, i = typeof setImmediate < "u" ? function(e) {
369
369
  return setImmediate(e);
370
370
  } : setTimeout;
@@ -512,30 +512,30 @@ var R = le(function(e) {
512
512
  }) : t.reject(TypeError("Not an array"));
513
513
  }), m;
514
514
  });
515
- }), z = /* @__PURE__ */ new WeakMap();
516
- function B(e, t, n) {
517
- let r = z.get(e.element) || {};
518
- t in r || (r[t] = []), r[t].push(n), z.set(e.element, r);
515
+ }), R = /* @__PURE__ */ new WeakMap();
516
+ function z(e, t, n) {
517
+ let r = R.get(e.element) || {};
518
+ t in r || (r[t] = []), r[t].push(n), R.set(e.element, r);
519
519
  }
520
- function V(e, t) {
521
- return (z.get(e.element) || {})[t] || [];
520
+ function B(e, t) {
521
+ return (R.get(e.element) || {})[t] || [];
522
522
  }
523
- function H(e, t, n) {
524
- let r = z.get(e.element) || {};
523
+ function V(e, t, n) {
524
+ let r = R.get(e.element) || {};
525
525
  if (!r[t]) return !0;
526
- if (!n) return r[t] = [], z.set(e.element, r), !0;
526
+ if (!n) return r[t] = [], R.set(e.element, r), !0;
527
527
  let i = r[t].indexOf(n);
528
- return i !== -1 && r[t].splice(i, 1), z.set(e.element, r), r[t] && r[t].length === 0;
528
+ return i !== -1 && r[t].splice(i, 1), R.set(e.element, r), r[t] && r[t].length === 0;
529
529
  }
530
- function U(e, t) {
531
- let n = V(e, t);
530
+ function H(e, t) {
531
+ let n = B(e, t);
532
532
  if (n.length < 1) return !1;
533
533
  let r = n.shift();
534
- return H(e, t, r), r;
534
+ return V(e, t, r), r;
535
535
  }
536
- function ue(e, t) {
537
- let n = z.get(e);
538
- z.set(t, n), z.delete(e);
536
+ function U(e, t) {
537
+ let n = R.get(e);
538
+ R.set(t, n), R.delete(e);
539
539
  }
540
540
  function W(e) {
541
541
  if (typeof e == "string") try {
@@ -555,12 +555,12 @@ function G(e, t, n) {
555
555
  function de(e, t) {
556
556
  t = W(t);
557
557
  let n = [], r;
558
- if (t.event) t.event === "error" && V(e, t.data.method).forEach((n) => {
558
+ if (t.event) t.event === "error" && B(e, t.data.method).forEach((n) => {
559
559
  let r = Error(t.data.message);
560
- r.name = t.data.name, n.reject(r), H(e, t.data.method, n);
561
- }), n = V(e, `event:${t.event}`), r = t.data;
560
+ r.name = t.data.name, n.reject(r), V(e, t.data.method, n);
561
+ }), n = B(e, `event:${t.event}`), r = t.data;
562
562
  else if (t.method) {
563
- let i = U(e, t.method);
563
+ let i = H(e, t.method);
564
564
  i && (n.push(i), r = t.value);
565
565
  }
566
566
  n.forEach((t) => {
@@ -591,8 +591,8 @@ function q(e, t) {
591
591
  function J(e) {
592
592
  let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = arguments.length > 2 ? arguments[2] : void 0;
593
593
  return new Promise((r, i) => {
594
- if (!M(e)) throw TypeError(`“${e}” is not a vimeo.com url.`);
595
- let a = `https://${oe(e)}/api/oembed.json?url=${encodeURIComponent(e)}`;
594
+ if (!A(e)) throw TypeError(`“${e}” is not a vimeo.com url.`);
595
+ let a = `https://${M(e)}/api/oembed.json?url=${encodeURIComponent(e)}`;
596
596
  for (let e in t) t.hasOwnProperty(e) && (a += `&${e}=${encodeURIComponent(t[e])}`);
597
597
  let o = "XDomainRequest" in window ? new XDomainRequest() : new XMLHttpRequest();
598
598
  o.open("GET", a, !0), o.onload = function() {
@@ -628,7 +628,7 @@ function pe() {
628
628
  try {
629
629
  if (e.getAttribute("data-vimeo-defer") !== null) return;
630
630
  let t = K(e);
631
- J(P(t), t, e).then((t) => q(t, e)).catch(n);
631
+ J(N(t), t, e).then((t) => q(t, e)).catch(n);
632
632
  } catch (e) {
633
633
  n(e);
634
634
  }
@@ -637,8 +637,8 @@ function pe() {
637
637
  function me() {
638
638
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : document;
639
639
  window.VimeoPlayerResizeEmbeds_ || (window.VimeoPlayerResizeEmbeds_ = !0, window.addEventListener("message", (t) => {
640
- if (!M(t.origin) || !t.data || t.data.event !== "spacechange") return;
641
- let n = t.source ? I(t.source, e) : null;
640
+ if (!A(t.origin) || !t.data || t.data.event !== "spacechange") return;
641
+ let n = t.source ? F(t.source, e) : null;
642
642
  if (n) {
643
643
  let e = n.parentElement;
644
644
  e.style.paddingBottom = `${t.data.data[0].bottom}px`;
@@ -648,11 +648,11 @@ function me() {
648
648
  function he() {
649
649
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : document;
650
650
  window.VimeoSeoMetadataAppended || (window.VimeoSeoMetadataAppended = !0, window.addEventListener("message", (t) => {
651
- if (!M(t.origin)) return;
651
+ if (!A(t.origin)) return;
652
652
  let n = W(t.data);
653
653
  if (!n || n.event !== "ready") return;
654
- let r = t.source ? I(t.source, e) : null;
655
- r && N(r.src) && new Q(r).callMethod("appendVideoMetadata", window.location.href);
654
+ let r = t.source ? F(t.source, e) : null;
655
+ r && j(r.src) && new Q(r).callMethod("appendVideoMetadata", window.location.href);
656
656
  }));
657
657
  }
658
658
  function ge() {
@@ -663,11 +663,11 @@ function ge() {
663
663
  "console" in window && console.error && console.error(`There was an error getting video Id: ${e}`);
664
664
  };
665
665
  window.addEventListener("message", (n) => {
666
- if (!M(n.origin)) return;
666
+ if (!A(n.origin)) return;
667
667
  let r = W(n.data);
668
668
  if (!r || r.event !== "ready") return;
669
- let i = n.source ? I(n.source, e) : null;
670
- if (i && N(i.src)) {
669
+ let i = n.source ? F(n.source, e) : null;
670
+ if (i && j(i.src)) {
671
671
  let e = new Q(i);
672
672
  e.getVideoId().then((t) => {
673
673
  let n = RegExp(`[?&]vimeo_t_${t}=([^&#]*)`).exec(window.location.href);
@@ -681,10 +681,10 @@ function ge() {
681
681
  }
682
682
  function _e() {
683
683
  window.VimeoDRMEmbedsUpdated || (window.VimeoDRMEmbedsUpdated = !0, window.addEventListener("message", (e) => {
684
- if (!M(e.origin)) return;
684
+ if (!A(e.origin)) return;
685
685
  let t = W(e.data);
686
686
  if (!t || t.event !== "drminitfailed") return;
687
- let n = e.source ? I(e.source) : null;
687
+ let n = e.source ? F(e.source) : null;
688
688
  if (!n) return;
689
689
  let r = n.getAttribute("allow") || "";
690
690
  if (!r.includes("encrypted-media")) {
@@ -825,13 +825,13 @@ var ye = {
825
825
  async init(e, t, n) {
826
826
  if (await this.waitForTOReadyState(e, "open"), n.role === "viewer") {
827
827
  await this.updatePlayer(e, t, n);
828
- let r = F(e, "change", () => this.updatePlayer(e, t, n)), i = this.maintainPlaybackPosition(e, t, n);
828
+ let r = P(e, "change", () => this.updatePlayer(e, t, n)), i = this.maintainPlaybackPosition(e, t, n);
829
829
  this.addEventListener("disconnect", () => {
830
830
  i.cancel(), r.cancel();
831
831
  });
832
832
  } else {
833
833
  await this.updateTimingObject(e, t);
834
- let n = F(t, [
834
+ let n = P(t, [
835
835
  "seeked",
836
836
  "play",
837
837
  "pause",
@@ -884,17 +884,17 @@ var ye = {
884
884
  }, Y = /* @__PURE__ */ new WeakMap(), X = /* @__PURE__ */ new WeakMap(), Z = {}, Q = class {
885
885
  constructor(e) {
886
886
  let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
887
- if (window.jQuery && e instanceof jQuery && (e.length > 1 && window.console && console.warn && console.warn("A jQuery object with multiple elements was passed, using the first element."), e = e[0]), typeof document < "u" && typeof e == "string" && (e = document.getElementById(e)), !ae(e)) throw TypeError("You must pass either a valid element or a valid id.");
887
+ if (window.jQuery && e instanceof jQuery && (e.length > 1 && window.console && console.warn && console.warn("A jQuery object with multiple elements was passed, using the first element."), e = e[0]), typeof document < "u" && typeof e == "string" && (e = document.getElementById(e)), !oe(e)) throw TypeError("You must pass either a valid element or a valid id.");
888
888
  if (e.nodeName !== "IFRAME") {
889
889
  let t = e.querySelector("iframe");
890
890
  t && (e = t);
891
891
  }
892
- if (e.nodeName === "IFRAME" && !M(e.getAttribute("src") || "")) throw Error("The player element passed isn’t a Vimeo embed.");
892
+ if (e.nodeName === "IFRAME" && !A(e.getAttribute("src") || "")) throw Error("The player element passed isn’t a Vimeo embed.");
893
893
  if (Y.has(e)) return Y.get(e);
894
894
  this._window = e.ownerDocument.defaultView, this.element = e, this.origin = "*";
895
- let n = new R((n, r) => {
895
+ let n = new L((n, r) => {
896
896
  if (this._onMessage = (e) => {
897
- if (!M(e.origin) || this.element.contentWindow !== e.source) return;
897
+ if (!A(e.origin) || this.element.contentWindow !== e.source) return;
898
898
  this.origin === "*" && (this.origin = e.origin);
899
899
  let t = W(e.data);
900
900
  if (t && t.event === "error" && t.data && t.data.method === "ready") {
@@ -910,16 +910,16 @@ var ye = {
910
910
  de(this, t);
911
911
  }, this._window.addEventListener("message", this._onMessage), this.element.nodeName !== "IFRAME") {
912
912
  let n = K(e, t);
913
- J(P(n), n, e).then((t) => {
913
+ J(N(n), n, e).then((t) => {
914
914
  let n = q(t, e);
915
- return this.element = n, this._originalElement = e, ue(e, n), Y.set(this.element, this), t;
915
+ return this.element = n, this._originalElement = e, U(e, n), Y.set(this.element, this), t;
916
916
  }).catch(r);
917
917
  }
918
918
  });
919
919
  if (X.set(this, n), Y.set(this.element, this), this.element.nodeName === "IFRAME" && G(this, "ping"), Z.isEnabled) {
920
920
  let e = () => Z.exit();
921
921
  this.fullscreenchangeHandler = () => {
922
- Z.isFullscreen ? B(this, "event:exitFullscreen", e) : H(this, "event:exitFullscreen", e), this.ready().then(() => {
922
+ Z.isFullscreen ? z(this, "event:exitFullscreen", e) : V(this, "event:exitFullscreen", e), this.ready().then(() => {
923
923
  G(this, "fullscreenchange", Z.isFullscreen);
924
924
  });
925
925
  }, Z.on("fullscreenchange", this.fullscreenchangeHandler);
@@ -927,31 +927,31 @@ var ye = {
927
927
  return this;
928
928
  }
929
929
  static isVimeoUrl(e) {
930
- return M(e);
930
+ return A(e);
931
931
  }
932
932
  callMethod(e) {
933
933
  var t = [...arguments].slice(1);
934
934
  if (e == null) throw TypeError("You must pass a method name.");
935
- return new R((n, r) => this.ready().then(() => {
936
- B(this, e, {
935
+ return new L((n, r) => this.ready().then(() => {
936
+ z(this, e, {
937
937
  resolve: n,
938
938
  reject: r
939
939
  }), t.length === 0 ? t = {} : t.length === 1 && (t = t[0]), G(this, e, t);
940
940
  }).catch(r));
941
941
  }
942
942
  get(e) {
943
- return new R((t, n) => (e = A(e, "get"), this.ready().then(() => {
944
- B(this, e, {
943
+ return new L((t, n) => (e = k(e, "get"), this.ready().then(() => {
944
+ z(this, e, {
945
945
  resolve: t,
946
946
  reject: n
947
947
  }), G(this, e);
948
948
  }).catch(n)));
949
949
  }
950
950
  set(e, t) {
951
- return new R((n, r) => {
952
- if (e = A(e, "set"), t == null) throw TypeError("There must be a value to set.");
951
+ return new L((n, r) => {
952
+ if (e = k(e, "set"), t == null) throw TypeError("There must be a value to set.");
953
953
  return this.ready().then(() => {
954
- B(this, e, {
954
+ z(this, e, {
955
955
  resolve: n,
956
956
  reject: r
957
957
  }), G(this, e, t);
@@ -962,21 +962,21 @@ var ye = {
962
962
  if (!e) throw TypeError("You must pass an event name.");
963
963
  if (!t) throw TypeError("You must pass a callback function.");
964
964
  if (typeof t != "function") throw TypeError("The callback must be a function.");
965
- V(this, `event:${e}`).length === 0 && this.callMethod("addEventListener", e).catch(() => {}), B(this, `event:${e}`, t);
965
+ B(this, `event:${e}`).length === 0 && this.callMethod("addEventListener", e).catch(() => {}), z(this, `event:${e}`, t);
966
966
  }
967
967
  off(e, t) {
968
968
  if (!e) throw TypeError("You must pass an event name.");
969
969
  if (t && typeof t != "function") throw TypeError("The callback must be a function.");
970
- H(this, `event:${e}`, t) && this.callMethod("removeEventListener", e).catch((e) => {});
970
+ V(this, `event:${e}`, t) && this.callMethod("removeEventListener", e).catch((e) => {});
971
971
  }
972
972
  loadVideo(e) {
973
973
  return this.callMethod("loadVideo", e);
974
974
  }
975
975
  ready() {
976
- let e = X.get(this) || new R((e, t) => {
976
+ let e = X.get(this) || new L((e, t) => {
977
977
  t(/* @__PURE__ */ Error("Unknown player. Probably unloaded."));
978
978
  });
979
- return R.resolve(e);
979
+ return L.resolve(e);
980
980
  }
981
981
  addCuePoint(e) {
982
982
  let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
@@ -1023,7 +1023,7 @@ var ye = {
1023
1023
  return Z.isEnabled ? Z.exit() : this.callMethod("exitFullscreen");
1024
1024
  }
1025
1025
  getFullscreen() {
1026
- return Z.isEnabled ? R.resolve(Z.isFullscreen) : this.get("fullscreen");
1026
+ return Z.isEnabled ? L.resolve(Z.isFullscreen) : this.get("fullscreen");
1027
1027
  }
1028
1028
  requestPictureInPicture() {
1029
1029
  return this.callMethod("requestPictureInPicture");
@@ -1041,7 +1041,7 @@ var ye = {
1041
1041
  return this.callMethod("unload");
1042
1042
  }
1043
1043
  destroy() {
1044
- return new R((e) => {
1044
+ return new L((e) => {
1045
1045
  if (X.delete(this), Y.delete(this.element), this._originalElement && (Y.delete(this._originalElement), this._originalElement.removeAttribute("data-vimeo-initialized")), this.element && this.element.nodeName === "IFRAME" && this.element.parentNode && (this.element.parentNode.parentNode && this._originalElement && this._originalElement !== this.element.parentNode ? this.element.parentNode.parentNode.removeChild(this.element.parentNode) : this.element.parentNode.removeChild(this.element)), this.element && this.element.nodeName === "DIV" && this.element.parentNode) {
1046
1046
  this.element.removeAttribute("data-vimeo-initialized");
1047
1047
  let e = this.element.querySelector("iframe");
@@ -1075,7 +1075,7 @@ var ye = {
1075
1075
  return this.get("color");
1076
1076
  }
1077
1077
  getColors() {
1078
- return R.all([
1078
+ return L.all([
1079
1079
  this.get("colorOne"),
1080
1080
  this.get("colorTwo"),
1081
1081
  this.get("colorThree"),
@@ -1086,14 +1086,14 @@ var ye = {
1086
1086
  return this.set("color", e);
1087
1087
  }
1088
1088
  setColors(e) {
1089
- if (!Array.isArray(e)) return new R((e, t) => t(/* @__PURE__ */ TypeError("Argument must be an array.")));
1090
- let t = new R((e) => e(null)), n = [
1089
+ if (!Array.isArray(e)) return new L((e, t) => t(/* @__PURE__ */ TypeError("Argument must be an array.")));
1090
+ let t = new L((e) => e(null)), n = [
1091
1091
  e[0] ? this.set("colorOne", e[0]) : t,
1092
1092
  e[1] ? this.set("colorTwo", e[1]) : t,
1093
1093
  e[2] ? this.set("colorThree", e[2]) : t,
1094
1094
  e[3] ? this.set("colorFour", e[3]) : t
1095
1095
  ];
1096
- return R.all(n);
1096
+ return L.all(n);
1097
1097
  }
1098
1098
  getCuePoints() {
1099
1099
  return this.get("cuePoints");
@@ -1198,7 +1198,7 @@ var ye = {
1198
1198
  return G(this, "notifyTimingObjectConnect"), n.addEventListener("disconnect", () => G(this, "notifyTimingObjectDisconnect")), n;
1199
1199
  }
1200
1200
  };
1201
- k || (Z = ve(), pe(), me(), he(), ge(), _e());
1201
+ O || (Z = ve(), pe(), me(), he(), ge(), _e());
1202
1202
  //#endregion
1203
1203
  //#region src/ui/media/EmbeddedVideo/VimeoPlayer.tsx
1204
1204
  var $ = n(), xe = (e) => {
@@ -1242,27 +1242,59 @@ var $ = n(), xe = (e) => {
1242
1242
  maxHeight: "100%"
1243
1243
  }
1244
1244
  });
1245
- }, we = (e) => /vimeo\.com/.test(e), Te = ({ url: e, label: t }) => {
1245
+ }, we = /(?:^|\.)(?:youtube\.com|youtube-nocookie\.com|youtu\.be)$/, Te = /^[\w-]{11}$/, Ee = /^\/(?:embed|v|shorts|live)\/([\w-]{11})(?:$|[/?])/, De = /^\/([\w-]{11})(?:$|[/?])/, Oe = (e) => {
1246
+ var t, n;
1247
+ let r;
1248
+ try {
1249
+ r = new URL(e);
1250
+ } catch {
1251
+ return null;
1252
+ }
1253
+ if (!we.test(r.hostname)) return null;
1254
+ if (r.hostname.endsWith("youtu.be")) {
1255
+ var i, a;
1256
+ return (i = (a = r.pathname.match(De)) == null ? void 0 : a[1]) == null ? null : i;
1257
+ }
1258
+ let o = r.searchParams.get("v");
1259
+ return o && Te.test(o) ? o : (t = (n = r.pathname.match(Ee)) == null ? void 0 : n[1]) == null ? null : t;
1260
+ }, ke = (e) => `https://www.youtube.com/embed/${e}?${new URLSearchParams({
1261
+ rel: "0",
1262
+ modestbranding: "1",
1263
+ playsinline: "1",
1264
+ cc_load_policy: "1",
1265
+ iv_load_policy: "3"
1266
+ }).toString()}`, Ae = ({ videoId: e, title: t }) => /* @__PURE__ */ (0, $.jsx)("iframe", {
1267
+ referrerPolicy: "strict-origin-when-cross-origin",
1268
+ src: ke(e),
1269
+ title: t,
1270
+ allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",
1271
+ allowFullScreen: !0,
1272
+ className: "sc:h-full sc:w-full sc:border-0"
1273
+ }), je = (e) => /vimeo\.com/.test(e), Me = ({ url: e, label: t }) => {
1246
1274
  let [n, r] = (0, i.useState)(!1);
1247
- return we(e) ? /* @__PURE__ */ (0, $.jsx)(Ce, {
1275
+ if (je(e)) return /* @__PURE__ */ (0, $.jsx)(Ce, {
1248
1276
  src: e,
1249
1277
  title: t,
1250
1278
  width: "100%",
1251
1279
  height: "100%",
1252
1280
  onPlay: () => r(!0),
1253
1281
  onPause: () => r(!1)
1254
- }) : /* @__PURE__ */ (0, $.jsx)(E, {
1282
+ });
1283
+ let a = Oe(e);
1284
+ return a ? /* @__PURE__ */ (0, $.jsx)(Ae, {
1285
+ videoId: a,
1286
+ title: t
1287
+ }) : /* @__PURE__ */ (0, $.jsx)(re, {
1255
1288
  src: e,
1256
1289
  controls: !0,
1257
1290
  width: "100%",
1258
1291
  height: "100%",
1259
1292
  playing: n,
1260
1293
  onPlay: () => r(!0),
1261
- onPause: () => r(!1),
1262
- config: { youtube: { referrerpolicy: "strict-origin-when-cross-origin" } }
1294
+ onPause: () => r(!1)
1263
1295
  });
1264
1296
  };
1265
1297
  //#endregion
1266
- export { Te as EmbeddedVideoPlayer };
1298
+ export { Me as EmbeddedVideoPlayer };
1267
1299
 
1268
- //# sourceMappingURL=EmbeddedVideoPlayer-DsoMwCbP.js.map
1300
+ //# sourceMappingURL=EmbeddedVideoPlayer-G554aRrZ.js.map
@@ -1,5 +1,5 @@
1
- import { E as e } from "./messages-DhmdgtVq.js";
2
- import { t } from "./react-n_76t7t4.js";
1
+ import { z as e } from "./client-DG-5x86F.js";
2
+ import { t } from "./react-DHdgNnK2.js";
3
3
  //#region ../../node_modules/.pnpm/react-player@3.4.0_@svta+cml-cta@1.0.6_@svta+cml-structured-field-values@1.1.3_@svta+cm_a4f64f295cc2a316f39ce360b0a6e480/node_modules/react-player/dist/Preview.js
4
4
  var n = /* @__PURE__ */ e(t(), 1), r = "64px", i = {}, a = ({ src: e, light: t, oEmbedUrl: a, onClickPreview: o, playIcon: s, previewTabIndex: c, previewAriaLabel: l }) => {
5
5
  let [u, d] = (0, n.useState)(null);
@@ -81,4 +81,4 @@ var n = /* @__PURE__ */ e(t(), 1), r = "64px", i = {}, a = ({ src: e, light: t,
81
81
  //#endregion
82
82
  export { a as default };
83
83
 
84
- //# sourceMappingURL=Preview-BJXCAMet.js.map
84
+ //# sourceMappingURL=Preview-CSE0hI6e.js.map