obi-sdk 0.15.0 → 0.17.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.
@@ -1,4 +1,4 @@
1
- import { S as SDKState, E as EventEmitter, R as RoomEvent, T as Track, z as z$3, a as Room, A as API_BASE_URL, N as N$2 } from "./types-eb1fb85a.js";
1
+ import { S as SDKState, E as EventEmitter, R as RoomEvent, T as Track, z as z$3, a as Room, A as API_BASE_URL, N as N$2 } from "./types-f38a47f6.js";
2
2
  const PATH_PARAM_RE = /\{[^{}]+\}/g;
3
3
  function randomID() {
4
4
  return Math.random().toString(36).slice(2, 11);
@@ -620,12 +620,12 @@ class ObiClient {
620
620
  body: data
621
621
  });
622
622
  }
623
- async getJoinToken(token, { skipIntro, user } = {}) {
623
+ async getJoinToken(token, { clientType, user } = {}) {
624
624
  return await this.client.GET("/api/join-token", {
625
625
  params: {
626
626
  query: {
627
627
  token,
628
- ...skipIntro && { skip_intro: "true" },
628
+ ...clientType && { client_type: clientType },
629
629
  ...user && { user: encodeURIComponent(user) }
630
630
  }
631
631
  }
@@ -633,9 +633,17 @@ class ObiClient {
633
633
  }
634
634
  // Tracked events
635
635
  async trackEvent(data) {
636
- return await this.client.POST("/api/track", {
637
- body: data
638
- });
636
+ try {
637
+ return await this.client.POST("/api/track", {
638
+ body: {
639
+ sent_at: (/* @__PURE__ */ new Date()).toISOString(),
640
+ ...data
641
+ }
642
+ });
643
+ } catch (error) {
644
+ console.error("[obi] error tracking event:", error);
645
+ }
646
+ return {};
639
647
  }
640
648
  /**
641
649
  * Get the underlying openapi-fetch client for advanced usage
@@ -646,10 +654,10 @@ class ObiClient {
646
654
  }
647
655
  const DEFAULT_API_BASE_URL = "https://app.coragents.ai";
648
656
  class ObiSession {
649
- constructor({ sessionId, apiBaseUrl, embedded, user }) {
657
+ constructor({ sessionId, apiBaseUrl, clientType, user }) {
650
658
  this.currentState = SDKState.READY;
651
659
  this.livekitState = "speaking";
652
- this.embedded = false;
660
+ this.clientType = "lp";
653
661
  this.agentHasSpoken = false;
654
662
  this.assistantAudioContext = null;
655
663
  this.userAudioContext = null;
@@ -658,7 +666,7 @@ class ObiSession {
658
666
  this.user = void 0;
659
667
  this.sessionId = sessionId;
660
668
  this.apiBaseUrl = apiBaseUrl || DEFAULT_API_BASE_URL;
661
- this.embedded = embedded ?? true;
669
+ this.clientType = clientType ?? "lp";
662
670
  this.client = new ObiClient({
663
671
  baseUrl: this.apiBaseUrl
664
672
  });
@@ -720,6 +728,9 @@ class ObiSession {
720
728
  return;
721
729
  const state = attributes["lk.agent.state"];
722
730
  if (state === "speaking") {
731
+ if (!this.agentHasSpoken) {
732
+ this.emitter.emit("firstSpeech");
733
+ }
723
734
  this.agentHasSpoken = true;
724
735
  }
725
736
  if (!this.agentHasSpoken) {
@@ -807,7 +818,7 @@ class ObiSession {
807
818
  });
808
819
  this.setupRoomEventListeners();
809
820
  const joinToken = await this.client.getJoinToken(this.sessionId, {
810
- skipIntro: this.embedded,
821
+ clientType: this.clientType,
811
822
  ...this.user && { user: JSON.stringify(this.user) }
812
823
  });
813
824
  await this.room.connect(joinToken.data.url, joinToken.data.token);
@@ -896,6 +907,22 @@ class ObiSession {
896
907
  throw new Error("Microphone permission denied");
897
908
  }
898
909
  }
910
+ async requestMicrophoneAndPublish() {
911
+ if (!this.room) {
912
+ console.warn("[obi] shareMic called while not connected");
913
+ return;
914
+ }
915
+ await this.requestMicrophone();
916
+ if (!this.microphoneStream) {
917
+ console.warn("[obi] failed to share microphone");
918
+ return;
919
+ }
920
+ const micTrack = this.microphoneStream.getAudioTracks()[0];
921
+ await this.room.localParticipant.publishTrack(micTrack, {
922
+ name: "microphone",
923
+ source: Track.Source.Microphone
924
+ });
925
+ }
899
926
  async shareMic() {
900
927
  if (!this.room) {
901
928
  console.warn("[obi] shareMic called while not connected");
@@ -903,22 +930,18 @@ class ObiSession {
903
930
  }
904
931
  this.emitter.emit("preMicShare");
905
932
  try {
906
- await this.requestMicrophone();
907
- if (!this.microphoneStream) {
908
- console.warn("[obi] failed to share microphone");
909
- return;
910
- }
911
- const micTrack = this.microphoneStream.getAudioTracks()[0];
912
- await this.room.localParticipant.publishTrack(micTrack, {
913
- name: "microphone",
914
- source: Track.Source.Microphone
915
- });
933
+ await this.requestMicrophoneAndPublish();
916
934
  await this.room.localParticipant.publishData(new TextEncoder().encode(JSON.stringify({
917
935
  request: "share_mic",
918
936
  success: true
919
937
  })), { reliable: true });
920
- this.emitter.emit("micShared");
938
+ this.emitter.emit("micShared", true);
921
939
  } catch (error) {
940
+ await this.room.localParticipant.publishData(new TextEncoder().encode(JSON.stringify({
941
+ request: "share_mic",
942
+ success: false
943
+ })), { reliable: true });
944
+ this.emitter.emit("micShared", false);
922
945
  console.error("[obi] error sharing microphone:", error);
923
946
  this.emitter.emit("error", error instanceof Error ? error : new Error(String(error)));
924
947
  }
@@ -1098,6 +1121,19 @@ class ObiSession {
1098
1121
  throw error;
1099
1122
  }
1100
1123
  }
1124
+ /**
1125
+ * Track an event for the current session.
1126
+ * @param event The event to track
1127
+ * @param data Additional data to include in the event
1128
+ */
1129
+ track(event, data = {}) {
1130
+ this.client.trackEvent({
1131
+ event,
1132
+ session_id: this.sessionId,
1133
+ client_type: this.clientType,
1134
+ ...data
1135
+ });
1136
+ }
1101
1137
  }
1102
1138
  const OBI_PRIMARY_COLOR = "#a10fff";
1103
1139
  function hexToHsl(hex) {
@@ -1999,7 +2035,7 @@ var f$5 = 102;
1999
2035
  var u$2 = 117;
2000
2036
  var z$2 = 122;
2001
2037
  var A$2 = 65;
2002
- var E$2 = 69;
2038
+ var E$1 = 69;
2003
2039
  var F$1 = 70;
2004
2040
  var U$1 = 85;
2005
2041
  var Z$1 = 90;
@@ -2087,7 +2123,7 @@ var stringToNumber = function(codePoints) {
2087
2123
  }
2088
2124
  var fracd = fraction.length;
2089
2125
  var frac = fracd ? parseInt(fromCodePoint$1.apply(void 0, fraction), 10) : 0;
2090
- if (codePoints[c2] === E$2 || codePoints[c2] === e$5) {
2126
+ if (codePoints[c2] === E$1 || codePoints[c2] === e$5) {
2091
2127
  c2++;
2092
2128
  }
2093
2129
  var expsign = 1;
@@ -2557,7 +2593,7 @@ var Tokenizer = (
2557
2593
  c1 = this.peekCodePoint(0);
2558
2594
  c2 = this.peekCodePoint(1);
2559
2595
  var c3 = this.peekCodePoint(2);
2560
- if ((c1 === E$2 || c1 === e$5) && ((c2 === PLUS_SIGN || c2 === HYPHEN_MINUS) && isDigit(c3) || isDigit(c2))) {
2596
+ if ((c1 === E$1 || c1 === e$5) && ((c2 === PLUS_SIGN || c2 === HYPHEN_MINUS) && isDigit(c3) || isDigit(c2))) {
2561
2597
  repr.push(this.consumeCodePoint(), this.consumeCodePoint());
2562
2598
  type = FLAG_NUMBER;
2563
2599
  while (isDigit(this.peekCodePoint(0))) {
@@ -10029,8 +10065,8 @@ let y$1 = class y extends HTMLElement {
10029
10065
  }
10030
10066
  };
10031
10067
  y$1.elementStyles = [], y$1.shadowRootOptions = { mode: "open" }, y$1[d$1("elementProperties")] = /* @__PURE__ */ new Map(), y$1[d$1("finalized")] = /* @__PURE__ */ new Map(), p$1?.({ ReactiveElement: y$1 }), (a$2.reactiveElementVersions ?? (a$2.reactiveElementVersions = [])).push("2.1.0");
10032
- const t$1 = globalThis, i$2 = t$1.trustedTypes, s$2 = i$2 ? i$2.createPolicy("lit-html", { createHTML: (t2) => t2 }) : void 0, e$2 = "$lit$", h$2 = `lit$${Math.random().toFixed(9).slice(2)}$`, o$4 = "?" + h$2, n$3 = `<${o$4}>`, r$3 = document, l = () => r$3.createComment(""), c$1 = (t2) => null === t2 || "object" != typeof t2 && "function" != typeof t2, a$1 = Array.isArray, u = (t2) => a$1(t2) || "function" == typeof t2?.[Symbol.iterator], d = "[ \n\f\r]", f$3 = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, v$1 = /-->/g, _ = />/g, m$1 = RegExp(`>|${d}(?:([^\\s"'>=/]+)(${d}*=${d}*(?:[^
10033
- \f\r"'\`<>=]|("|')|))|$)`, "g"), p = /'/g, g = /"/g, $$1 = /^(?:script|style|textarea|title)$/i, y2 = (t2) => (i3, ...s2) => ({ _$litType$: t2, strings: i3, values: s2 }), x = y2(1), b = y2(2), T$1 = Symbol.for("lit-noChange"), E$1 = Symbol.for("lit-nothing"), A$1 = /* @__PURE__ */ new WeakMap(), C$1 = r$3.createTreeWalker(r$3, 129);
10068
+ const t$1 = globalThis, i$2 = t$1.trustedTypes, s$2 = i$2 ? i$2.createPolicy("lit-html", { createHTML: (t2) => t2 }) : void 0, e$2 = "$lit$", h$2 = `lit$${Math.random().toFixed(9).slice(2)}$`, o$4 = "?" + h$2, n$3 = `<${o$4}>`, r$3 = document, l = () => r$3.createComment(""), c$1 = (t2) => null === t2 || "object" != typeof t2 && "function" != typeof t2, a$1 = Array.isArray, u = (t2) => a$1(t2) || "function" == typeof t2?.[Symbol.iterator], d = "[ \n\f\r]", f$3 = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, v$1 = /-->/g, _$1 = />/g, m$1 = RegExp(`>|${d}(?:([^\\s"'>=/]+)(${d}*=${d}*(?:[^
10069
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), p = /'/g, g = /"/g, $$1 = /^(?:script|style|textarea|title)$/i, y2 = (t2) => (i3, ...s2) => ({ _$litType$: t2, strings: i3, values: s2 }), x = y2(1), b = y2(2), T$1 = Symbol.for("lit-noChange"), E = Symbol.for("lit-nothing"), A$1 = /* @__PURE__ */ new WeakMap(), C$1 = r$3.createTreeWalker(r$3, 129);
10034
10070
  function P$1(t2, i3) {
10035
10071
  if (!a$1(t2) || !t2.hasOwnProperty("raw"))
10036
10072
  throw Error("invalid template strings array");
@@ -10043,7 +10079,7 @@ const V$1 = (t2, i3) => {
10043
10079
  const s3 = t2[i4];
10044
10080
  let a2, u2, d2 = -1, y3 = 0;
10045
10081
  for (; y3 < s3.length && (c2.lastIndex = y3, u2 = c2.exec(s3), null !== u2); )
10046
- y3 = c2.lastIndex, c2 === f$3 ? "!--" === u2[1] ? c2 = v$1 : void 0 !== u2[1] ? c2 = _ : void 0 !== u2[2] ? ($$1.test(u2[2]) && (r2 = RegExp("</" + u2[2], "g")), c2 = m$1) : void 0 !== u2[3] && (c2 = m$1) : c2 === m$1 ? ">" === u2[0] ? (c2 = r2 ?? f$3, d2 = -1) : void 0 === u2[1] ? d2 = -2 : (d2 = c2.lastIndex - u2[2].length, a2 = u2[1], c2 = void 0 === u2[3] ? m$1 : '"' === u2[3] ? g : p) : c2 === g || c2 === p ? c2 = m$1 : c2 === v$1 || c2 === _ ? c2 = f$3 : (c2 = m$1, r2 = void 0);
10082
+ y3 = c2.lastIndex, c2 === f$3 ? "!--" === u2[1] ? c2 = v$1 : void 0 !== u2[1] ? c2 = _$1 : void 0 !== u2[2] ? ($$1.test(u2[2]) && (r2 = RegExp("</" + u2[2], "g")), c2 = m$1) : void 0 !== u2[3] && (c2 = m$1) : c2 === m$1 ? ">" === u2[0] ? (c2 = r2 ?? f$3, d2 = -1) : void 0 === u2[1] ? d2 = -2 : (d2 = c2.lastIndex - u2[2].length, a2 = u2[1], c2 = void 0 === u2[3] ? m$1 : '"' === u2[3] ? g : p) : c2 === g || c2 === p ? c2 = m$1 : c2 === v$1 || c2 === _$1 ? c2 = f$3 : (c2 = m$1, r2 = void 0);
10047
10083
  const x2 = c2 === m$1 && t2[i4 + 1].startsWith("/>") ? " " : "";
10048
10084
  l2 += c2 === f$3 ? s3 + n$3 : d2 >= 0 ? (o2.push(a2), s3.slice(0, d2) + e$2 + s3.slice(d2) + h$2 + x2) : s3 + h$2 + (-2 === d2 ? i4 : x2);
10049
10085
  }
@@ -10134,7 +10170,7 @@ let R$1 = class R {
10134
10170
  return this._$AM?._$AU ?? this._$Cv;
10135
10171
  }
10136
10172
  constructor(t2, i3, s2, e2) {
10137
- this.type = 2, this._$AH = E$1, this._$AN = void 0, this._$AA = t2, this._$AB = i3, this._$AM = s2, this.options = e2, this._$Cv = e2?.isConnected ?? true;
10173
+ this.type = 2, this._$AH = E, this._$AN = void 0, this._$AA = t2, this._$AB = i3, this._$AM = s2, this.options = e2, this._$Cv = e2?.isConnected ?? true;
10138
10174
  }
10139
10175
  get parentNode() {
10140
10176
  let t2 = this._$AA.parentNode;
@@ -10148,7 +10184,7 @@ let R$1 = class R {
10148
10184
  return this._$AB;
10149
10185
  }
10150
10186
  _$AI(t2, i3 = this) {
10151
- t2 = S$1(this, t2, i3), c$1(t2) ? t2 === E$1 || null == t2 || "" === t2 ? (this._$AH !== E$1 && this._$AR(), this._$AH = E$1) : t2 !== this._$AH && t2 !== T$1 && this._(t2) : void 0 !== t2._$litType$ ? this.$(t2) : void 0 !== t2.nodeType ? this.T(t2) : u(t2) ? this.k(t2) : this._(t2);
10187
+ t2 = S$1(this, t2, i3), c$1(t2) ? t2 === E || null == t2 || "" === t2 ? (this._$AH !== E && this._$AR(), this._$AH = E) : t2 !== this._$AH && t2 !== T$1 && this._(t2) : void 0 !== t2._$litType$ ? this.$(t2) : void 0 !== t2.nodeType ? this.T(t2) : u(t2) ? this.k(t2) : this._(t2);
10152
10188
  }
10153
10189
  O(t2) {
10154
10190
  return this._$AA.parentNode.insertBefore(t2, this._$AB);
@@ -10157,7 +10193,7 @@ let R$1 = class R {
10157
10193
  this._$AH !== t2 && (this._$AR(), this._$AH = this.O(t2));
10158
10194
  }
10159
10195
  _(t2) {
10160
- this._$AH !== E$1 && c$1(this._$AH) ? this._$AA.nextSibling.data = t2 : this.T(r$3.createTextNode(t2)), this._$AH = t2;
10196
+ this._$AH !== E && c$1(this._$AH) ? this._$AA.nextSibling.data = t2 : this.T(r$3.createTextNode(t2)), this._$AH = t2;
10161
10197
  }
10162
10198
  $(t2) {
10163
10199
  const { values: i3, _$litType$: s2 } = t2, e2 = "number" == typeof s2 ? this._$AC(t2) : (void 0 === s2.el && (s2.el = N$1.createElement(P$1(s2.h, s2.h[0]), this.options)), s2);
@@ -10198,7 +10234,7 @@ let k$1 = class k {
10198
10234
  return this._$AM._$AU;
10199
10235
  }
10200
10236
  constructor(t2, i3, s2, e2, h2) {
10201
- this.type = 1, this._$AH = E$1, this._$AN = void 0, this.element = t2, this.name = i3, this._$AM = e2, this.options = h2, s2.length > 2 || "" !== s2[0] || "" !== s2[1] ? (this._$AH = Array(s2.length - 1).fill(new String()), this.strings = s2) : this._$AH = E$1;
10237
+ this.type = 1, this._$AH = E, this._$AN = void 0, this.element = t2, this.name = i3, this._$AM = e2, this.options = h2, s2.length > 2 || "" !== s2[0] || "" !== s2[1] ? (this._$AH = Array(s2.length - 1).fill(new String()), this.strings = s2) : this._$AH = E;
10202
10238
  }
10203
10239
  _$AI(t2, i3 = this, s2, e2) {
10204
10240
  const h2 = this.strings;
@@ -10209,12 +10245,12 @@ let k$1 = class k {
10209
10245
  const e3 = t2;
10210
10246
  let n3, r2;
10211
10247
  for (t2 = h2[0], n3 = 0; n3 < h2.length - 1; n3++)
10212
- r2 = S$1(this, e3[s2 + n3], i3, n3), r2 === T$1 && (r2 = this._$AH[n3]), o2 || (o2 = !c$1(r2) || r2 !== this._$AH[n3]), r2 === E$1 ? t2 = E$1 : t2 !== E$1 && (t2 += (r2 ?? "") + h2[n3 + 1]), this._$AH[n3] = r2;
10248
+ r2 = S$1(this, e3[s2 + n3], i3, n3), r2 === T$1 && (r2 = this._$AH[n3]), o2 || (o2 = !c$1(r2) || r2 !== this._$AH[n3]), r2 === E ? t2 = E : t2 !== E && (t2 += (r2 ?? "") + h2[n3 + 1]), this._$AH[n3] = r2;
10213
10249
  }
10214
10250
  o2 && !e2 && this.j(t2);
10215
10251
  }
10216
10252
  j(t2) {
10217
- t2 === E$1 ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t2 ?? "");
10253
+ t2 === E ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t2 ?? "");
10218
10254
  }
10219
10255
  };
10220
10256
  let H$1 = class H extends k$1 {
@@ -10222,7 +10258,7 @@ let H$1 = class H extends k$1 {
10222
10258
  super(...arguments), this.type = 3;
10223
10259
  }
10224
10260
  j(t2) {
10225
- this.element[this.name] = t2 === E$1 ? void 0 : t2;
10261
+ this.element[this.name] = t2 === E ? void 0 : t2;
10226
10262
  }
10227
10263
  };
10228
10264
  let I$1 = class I extends k$1 {
@@ -10230,7 +10266,7 @@ let I$1 = class I extends k$1 {
10230
10266
  super(...arguments), this.type = 4;
10231
10267
  }
10232
10268
  j(t2) {
10233
- this.element.toggleAttribute(this.name, !!t2 && t2 !== E$1);
10269
+ this.element.toggleAttribute(this.name, !!t2 && t2 !== E);
10234
10270
  }
10235
10271
  };
10236
10272
  let L$1 = class L extends k$1 {
@@ -10238,9 +10274,9 @@ let L$1 = class L extends k$1 {
10238
10274
  super(t2, i3, s2, e2, h2), this.type = 5;
10239
10275
  }
10240
10276
  _$AI(t2, i3 = this) {
10241
- if ((t2 = S$1(this, t2, i3, 0) ?? E$1) === T$1)
10277
+ if ((t2 = S$1(this, t2, i3, 0) ?? E) === T$1)
10242
10278
  return;
10243
- const s2 = this._$AH, e2 = t2 === E$1 && s2 !== E$1 || t2.capture !== s2.capture || t2.once !== s2.once || t2.passive !== s2.passive, h2 = t2 !== E$1 && (s2 === E$1 || e2);
10279
+ const s2 = this._$AH, e2 = t2 === E && s2 !== E || t2.capture !== s2.capture || t2.once !== s2.once || t2.passive !== s2.passive, h2 = t2 !== E && (s2 === E || e2);
10244
10280
  e2 && this.element.removeEventListener(this.name, this, s2), h2 && this.element.addEventListener(this.name, this, t2), this._$AH = t2;
10245
10281
  }
10246
10282
  handleEvent(t2) {
@@ -17480,11 +17516,11 @@ class h {
17480
17516
  }
17481
17517
  const o = /* @__PURE__ */ new WeakMap(), n2 = e$1(class extends f$1 {
17482
17518
  render(i3) {
17483
- return E$1;
17519
+ return E;
17484
17520
  }
17485
17521
  update(i3, [s2]) {
17486
17522
  const e2 = s2 !== this.G;
17487
- return e2 && void 0 !== this.G && this.rt(void 0), (e2 || this.lt !== this.ct) && (this.G = s2, this.ht = i3.options?.host, this.rt(this.ct = i3.element)), E$1;
17523
+ return e2 && void 0 !== this.G && this.rt(void 0), (e2 || this.lt !== this.ct) && (this.G = s2, this.ht = i3.options?.host, this.rt(this.ct = i3.element)), E;
17488
17524
  }
17489
17525
  rt(t2) {
17490
17526
  if (this.isConnected || (t2 = void 0), "function" == typeof this.G) {
@@ -17870,7 +17906,7 @@ const ot = (s2) => new tt(typeof s2 == "string" ? s2 : s2 + "", void 0, qe), it
17870
17906
  i3 += o2.cssText;
17871
17907
  return ot(i3);
17872
17908
  })(s2) : s2;
17873
- const { is: st, defineProperty: rt, getOwnPropertyDescriptor: nt, getOwnPropertyNames: at, getOwnPropertySymbols: lt, getPrototypeOf: ct } = Object, C = globalThis, ze = C.trustedTypes, dt = ze ? ze.emptyScript : "", ht = C.reactiveElementPolyfillSupport, oe = (s2, e2) => s2, he = { toAttribute(s2, e2) {
17909
+ const { is: st, defineProperty: rt, getOwnPropertyDescriptor: nt, getOwnPropertyNames: at, getOwnPropertySymbols: lt, getPrototypeOf: ct } = Object, O = globalThis, Be = O.trustedTypes, dt = Be ? Be.emptyScript : "", ht = O.reactiveElementPolyfillSupport, oe = (s2, e2) => s2, he = { toAttribute(s2, e2) {
17874
17910
  switch (e2) {
17875
17911
  case Boolean:
17876
17912
  s2 = s2 ? dt : null;
@@ -17898,8 +17934,8 @@ const { is: st, defineProperty: rt, getOwnPropertyDescriptor: nt, getOwnProperty
17898
17934
  }
17899
17935
  }
17900
17936
  return i3;
17901
- } }, Pe = (s2, e2) => !st(s2, e2), Be = { attribute: true, type: String, converter: he, reflect: false, useDefault: false, hasChanged: Pe };
17902
- Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), C.litPropertyMetadata ?? (C.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
17937
+ } }, Pe = (s2, e2) => !st(s2, e2), ze = { attribute: true, type: String, converter: he, reflect: false, useDefault: false, hasChanged: Pe };
17938
+ Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), O.litPropertyMetadata ?? (O.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
17903
17939
  class ee extends HTMLElement {
17904
17940
  static addInitializer(e2) {
17905
17941
  this._$Ei(), (this.l ?? (this.l = [])).push(e2);
@@ -17907,7 +17943,7 @@ class ee extends HTMLElement {
17907
17943
  static get observedAttributes() {
17908
17944
  return this.finalize(), this._$Eh && [...this._$Eh.keys()];
17909
17945
  }
17910
- static createProperty(e2, i3 = Be) {
17946
+ static createProperty(e2, i3 = ze) {
17911
17947
  if (i3.state && (i3.attribute = false), this._$Ei(), this.prototype.hasOwnProperty(e2) && ((i3 = Object.create(i3)).wrapped = true), this.elementProperties.set(e2, i3), !i3.noAccessor) {
17912
17948
  const o2 = Symbol(), t2 = this.getPropertyDescriptor(e2, o2, i3);
17913
17949
  t2 !== void 0 && rt(this.prototype, e2, t2);
@@ -17925,7 +17961,7 @@ class ee extends HTMLElement {
17925
17961
  }, configurable: true, enumerable: true };
17926
17962
  }
17927
17963
  static getPropertyOptions(e2) {
17928
- return this.elementProperties.get(e2) ?? Be;
17964
+ return this.elementProperties.get(e2) ?? ze;
17929
17965
  }
17930
17966
  static _$Ei() {
17931
17967
  if (this.hasOwnProperty(oe("elementProperties")))
@@ -18091,7 +18127,7 @@ class ee extends HTMLElement {
18091
18127
  firstUpdated(e2) {
18092
18128
  }
18093
18129
  }
18094
- ee.elementStyles = [], ee.shadowRootOptions = { mode: "open" }, ee[oe("elementProperties")] = /* @__PURE__ */ new Map(), ee[oe("finalized")] = /* @__PURE__ */ new Map(), ht?.({ ReactiveElement: ee }), (C.reactiveElementVersions ?? (C.reactiveElementVersions = [])).push("2.1.0");
18130
+ ee.elementStyles = [], ee.shadowRootOptions = { mode: "open" }, ee[oe("elementProperties")] = /* @__PURE__ */ new Map(), ee[oe("finalized")] = /* @__PURE__ */ new Map(), ht?.({ ReactiveElement: ee }), (O.reactiveElementVersions ?? (O.reactiveElementVersions = [])).push("2.1.0");
18095
18131
  const pt = { attribute: true, type: String, converter: he, reflect: false, hasChanged: Pe }, ut = (s2 = pt, e2, i3) => {
18096
18132
  const { kind: o2, metadata: t2 } = i3;
18097
18133
  let r2 = globalThis.litPropertyMetadata.get(t2);
@@ -18145,9 +18181,9 @@ function bt(s2, e2) {
18145
18181
  } });
18146
18182
  };
18147
18183
  }
18148
- const ie = globalThis, pe = ie.trustedTypes, Me = pe ? pe.createPolicy("lit-html", { createHTML: (s2) => s2 }) : void 0, We = "$lit$", E = `lit$${Math.random().toFixed(9).slice(2)}$`, Ye = "?" + E, gt = `<${Ye}>`, k2 = document, ue = () => k2.createComment(""), se = (s2) => s2 === null || typeof s2 != "object" && typeof s2 != "function", De = Array.isArray, mt = (s2) => De(s2) || typeof s2?.[Symbol.iterator] == "function", Ce = `[
18184
+ const ie = globalThis, pe = ie.trustedTypes, Me = pe ? pe.createPolicy("lit-html", { createHTML: (s2) => s2 }) : void 0, We = "$lit$", C = `lit$${Math.random().toFixed(9).slice(2)}$`, Ye = "?" + C, gt = `<${Ye}>`, k2 = document, ue = () => k2.createComment(""), se = (s2) => s2 === null || typeof s2 != "object" && typeof s2 != "function", De = Array.isArray, mt = (s2) => De(s2) || typeof s2?.[Symbol.iterator] == "function", Ce = `[
18149
18185
  \f\r]`, te = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Re = /-->/g, Ue = />/g, T = RegExp(`>|${Ce}(?:([^\\s"'>=/]+)(${Ce}*=${Ce}*(?:[^
18150
- \f\r"'\`<>=]|("|')|))|$)`, "g"), He = /'/g, Ie = /"/g, Ge = /^(?:script|style|textarea|title)$/i, R2 = Symbol.for("lit-noChange"), f2 = Symbol.for("lit-nothing"), Ve = /* @__PURE__ */ new WeakMap(), N2 = k2.createTreeWalker(k2, 129);
18186
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), He = /'/g, Ie = /"/g, Ge = /^(?:script|style|textarea|title)$/i, U = Symbol.for("lit-noChange"), f2 = Symbol.for("lit-nothing"), Ve = /* @__PURE__ */ new WeakMap(), N2 = k2.createTreeWalker(k2, 129);
18151
18187
  function Xe(s2, e2) {
18152
18188
  if (!De(s2) || !s2.hasOwnProperty("raw"))
18153
18189
  throw Error("invalid template strings array");
@@ -18162,7 +18198,7 @@ const ft = (s2, e2) => {
18162
18198
  for (; b2 < l2.length && (n3.lastIndex = b2, h2 = n3.exec(l2), h2 !== null); )
18163
18199
  b2 = n3.lastIndex, n3 === te ? h2[1] === "!--" ? n3 = Re : h2[1] !== void 0 ? n3 = Ue : h2[2] !== void 0 ? (Ge.test(h2[2]) && (t2 = RegExp("</" + h2[2], "g")), n3 = T) : h2[3] !== void 0 && (n3 = T) : n3 === T ? h2[0] === ">" ? (n3 = t2 ?? te, p2 = -1) : h2[1] === void 0 ? p2 = -2 : (p2 = n3.lastIndex - h2[2].length, u2 = h2[1], n3 = h2[3] === void 0 ? T : h2[3] === '"' ? Ie : He) : n3 === Ie || n3 === He ? n3 = T : n3 === Re || n3 === Ue ? n3 = te : (n3 = T, t2 = void 0);
18164
18200
  const x2 = n3 === T && s2[d2 + 1].startsWith("/>") ? " " : "";
18165
- r2 += n3 === te ? l2 + gt : p2 >= 0 ? (o2.push(u2), l2.slice(0, p2) + We + l2.slice(p2) + E + x2) : l2 + E + (p2 === -2 ? d2 : x2);
18201
+ r2 += n3 === te ? l2 + gt : p2 >= 0 ? (o2.push(u2), l2.slice(0, p2) + We + l2.slice(p2) + C + x2) : l2 + C + (p2 === -2 ? d2 : x2);
18166
18202
  }
18167
18203
  return [Xe(s2, r2 + (s2[i3] || "<?>") + (e2 === 2 ? "</svg>" : e2 === 3 ? "</math>" : "")), o2];
18168
18204
  };
@@ -18181,12 +18217,12 @@ class re {
18181
18217
  if (t2.hasAttributes())
18182
18218
  for (const p2 of t2.getAttributeNames())
18183
18219
  if (p2.endsWith(We)) {
18184
- const b2 = h2[n3++], x2 = t2.getAttribute(p2).split(E), _2 = /([.?@])?(.*)/.exec(b2);
18185
- l2.push({ type: 1, index: r2, name: _2[2], strings: x2, ctor: _2[1] === "." ? yt : _2[1] === "?" ? xt : _2[1] === "@" ? wt : ge }), t2.removeAttribute(p2);
18220
+ const b2 = h2[n3++], x2 = t2.getAttribute(p2).split(C), E2 = /([.?@])?(.*)/.exec(b2);
18221
+ l2.push({ type: 1, index: r2, name: E2[2], strings: x2, ctor: E2[1] === "." ? yt : E2[1] === "?" ? xt : E2[1] === "@" ? $t : ge }), t2.removeAttribute(p2);
18186
18222
  } else
18187
- p2.startsWith(E) && (l2.push({ type: 6, index: r2 }), t2.removeAttribute(p2));
18223
+ p2.startsWith(C) && (l2.push({ type: 6, index: r2 }), t2.removeAttribute(p2));
18188
18224
  if (Ge.test(t2.tagName)) {
18189
- const p2 = t2.textContent.split(E), b2 = p2.length - 1;
18225
+ const p2 = t2.textContent.split(C), b2 = p2.length - 1;
18190
18226
  if (b2 > 0) {
18191
18227
  t2.textContent = pe ? pe.emptyScript : "";
18192
18228
  for (let x2 = 0; x2 < b2; x2++)
@@ -18199,8 +18235,8 @@ class re {
18199
18235
  l2.push({ type: 2, index: r2 });
18200
18236
  else {
18201
18237
  let p2 = -1;
18202
- for (; (p2 = t2.data.indexOf(E, p2 + 1)) !== -1; )
18203
- l2.push({ type: 7, index: r2 }), p2 += E.length - 1;
18238
+ for (; (p2 = t2.data.indexOf(C, p2 + 1)) !== -1; )
18239
+ l2.push({ type: 7, index: r2 }), p2 += C.length - 1;
18204
18240
  }
18205
18241
  r2++;
18206
18242
  }
@@ -18210,12 +18246,12 @@ class re {
18210
18246
  return o2.innerHTML = e2, o2;
18211
18247
  }
18212
18248
  }
18213
- function U(s2, e2, i3 = s2, o2) {
18214
- if (e2 === R2)
18249
+ function H4(s2, e2, i3 = s2, o2) {
18250
+ if (e2 === U)
18215
18251
  return e2;
18216
18252
  let t2 = o2 !== void 0 ? i3._$Co?.[o2] : i3._$Cl;
18217
18253
  const r2 = se(e2) ? void 0 : e2._$litDirective$;
18218
- return t2?.constructor !== r2 && (t2?._$AO?.(false), r2 === void 0 ? t2 = void 0 : (t2 = new r2(s2), t2._$AT(s2, i3, o2)), o2 !== void 0 ? (i3._$Co ?? (i3._$Co = []))[o2] = t2 : i3._$Cl = t2), t2 !== void 0 && (e2 = U(s2, t2._$AS(s2, e2.values), t2, o2)), e2;
18254
+ return t2?.constructor !== r2 && (t2?._$AO?.(false), r2 === void 0 ? t2 = void 0 : (t2 = new r2(s2), t2._$AT(s2, i3, o2)), o2 !== void 0 ? (i3._$Co ?? (i3._$Co = []))[o2] = t2 : i3._$Cl = t2), t2 !== void 0 && (e2 = H4(s2, t2._$AS(s2, e2.values), t2, o2)), e2;
18219
18255
  }
18220
18256
  class vt {
18221
18257
  constructor(e2, i3) {
@@ -18234,7 +18270,7 @@ class vt {
18234
18270
  for (; l2 !== void 0; ) {
18235
18271
  if (n3 === l2.index) {
18236
18272
  let u2;
18237
- l2.type === 2 ? u2 = new be(r2, r2.nextSibling, this, e2) : l2.type === 1 ? u2 = new l2.ctor(r2, l2.name, l2.strings, this, e2) : l2.type === 6 && (u2 = new $t(r2, this, e2)), this._$AV.push(u2), l2 = o2[++d2];
18273
+ l2.type === 2 ? u2 = new be(r2, r2.nextSibling, this, e2) : l2.type === 1 ? u2 = new l2.ctor(r2, l2.name, l2.strings, this, e2) : l2.type === 6 && (u2 = new wt(r2, this, e2)), this._$AV.push(u2), l2 = o2[++d2];
18238
18274
  }
18239
18275
  n3 !== l2?.index && (r2 = N2.nextNode(), n3++);
18240
18276
  }
@@ -18265,7 +18301,7 @@ class be {
18265
18301
  return this._$AB;
18266
18302
  }
18267
18303
  _$AI(e2, i3 = this) {
18268
- e2 = U(this, e2, i3), se(e2) ? e2 === f2 || e2 == null || e2 === "" ? (this._$AH !== f2 && this._$AR(), this._$AH = f2) : e2 !== this._$AH && e2 !== R2 && this._(e2) : e2._$litType$ !== void 0 ? this.$(e2) : e2.nodeType !== void 0 ? this.T(e2) : mt(e2) ? this.k(e2) : this._(e2);
18304
+ e2 = H4(this, e2, i3), se(e2) ? e2 === f2 || e2 == null || e2 === "" ? (this._$AH !== f2 && this._$AR(), this._$AH = f2) : e2 !== this._$AH && e2 !== U && this._(e2) : e2._$litType$ !== void 0 ? this.$(e2) : e2.nodeType !== void 0 ? this.T(e2) : mt(e2) ? this.k(e2) : this._(e2);
18269
18305
  }
18270
18306
  O(e2) {
18271
18307
  return this._$AA.parentNode.insertBefore(e2, this._$AB);
@@ -18321,12 +18357,12 @@ class ge {
18321
18357
  const r2 = this.strings;
18322
18358
  let n3 = false;
18323
18359
  if (r2 === void 0)
18324
- e2 = U(this, e2, i3, 0), n3 = !se(e2) || e2 !== this._$AH && e2 !== R2, n3 && (this._$AH = e2);
18360
+ e2 = H4(this, e2, i3, 0), n3 = !se(e2) || e2 !== this._$AH && e2 !== U, n3 && (this._$AH = e2);
18325
18361
  else {
18326
18362
  const d2 = e2;
18327
18363
  let l2, u2;
18328
18364
  for (e2 = r2[0], l2 = 0; l2 < r2.length - 1; l2++)
18329
- u2 = U(this, d2[o2 + l2], i3, l2), u2 === R2 && (u2 = this._$AH[l2]), n3 || (n3 = !se(u2) || u2 !== this._$AH[l2]), u2 === f2 ? e2 = f2 : e2 !== f2 && (e2 += (u2 ?? "") + r2[l2 + 1]), this._$AH[l2] = u2;
18365
+ u2 = H4(this, d2[o2 + l2], i3, l2), u2 === U && (u2 = this._$AH[l2]), n3 || (n3 = !se(u2) || u2 !== this._$AH[l2]), u2 === f2 ? e2 = f2 : e2 !== f2 && (e2 += (u2 ?? "") + r2[l2 + 1]), this._$AH[l2] = u2;
18330
18366
  }
18331
18367
  n3 && !t2 && this.j(e2);
18332
18368
  }
@@ -18350,12 +18386,12 @@ class xt extends ge {
18350
18386
  this.element.toggleAttribute(this.name, !!e2 && e2 !== f2);
18351
18387
  }
18352
18388
  }
18353
- class wt extends ge {
18389
+ class $t extends ge {
18354
18390
  constructor(e2, i3, o2, t2, r2) {
18355
18391
  super(e2, i3, o2, t2, r2), this.type = 5;
18356
18392
  }
18357
18393
  _$AI(e2, i3 = this) {
18358
- if ((e2 = U(this, e2, i3, 0) ?? f2) === R2)
18394
+ if ((e2 = H4(this, e2, i3, 0) ?? f2) === U)
18359
18395
  return;
18360
18396
  const o2 = this._$AH, t2 = e2 === f2 && o2 !== f2 || e2.capture !== o2.capture || e2.once !== o2.once || e2.passive !== o2.passive, r2 = e2 !== f2 && (o2 === f2 || t2);
18361
18397
  t2 && this.element.removeEventListener(this.name, this, o2), r2 && this.element.addEventListener(this.name, this, e2), this._$AH = e2;
@@ -18364,7 +18400,7 @@ class wt extends ge {
18364
18400
  typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, e2) : this._$AH.handleEvent(e2);
18365
18401
  }
18366
18402
  }
18367
- class $t {
18403
+ class wt {
18368
18404
  constructor(e2, i3, o2) {
18369
18405
  this.element = e2, this.type = 6, this._$AN = void 0, this._$AM = i3, this.options = o2;
18370
18406
  }
@@ -18372,7 +18408,7 @@ class $t {
18372
18408
  return this._$AM._$AU;
18373
18409
  }
18374
18410
  _$AI(e2) {
18375
- U(this, e2);
18411
+ H4(this, e2);
18376
18412
  }
18377
18413
  }
18378
18414
  const _t = ie.litHtmlPolyfillSupport;
@@ -18416,7 +18452,7 @@ const Oe = Ct(class extends Ot {
18416
18452
  const t2 = !!e2[o2];
18417
18453
  t2 === this.st.has(o2) || this.nt?.has(o2) || (t2 ? (i3.add(o2), this.st.add(o2)) : (i3.remove(o2), this.st.delete(o2)));
18418
18454
  }
18419
- return R2;
18455
+ return U;
18420
18456
  }
18421
18457
  }), me = i$4`
18422
18458
  :host {
@@ -18500,12 +18536,12 @@ const Oe = Ct(class extends Ot {
18500
18536
  box-sizing: inherit;
18501
18537
  }
18502
18538
  `;
18503
- var At = Object.defineProperty, Pt = Object.getOwnPropertyDescriptor, O = (s2, e2, i3, o2) => {
18539
+ var At = Object.defineProperty, Pt = Object.getOwnPropertyDescriptor, A = (s2, e2, i3, o2) => {
18504
18540
  for (var t2 = o2 > 1 ? void 0 : o2 ? Pt(e2, i3) : e2, r2 = s2.length - 1, n3; r2 >= 0; r2--)
18505
18541
  (n3 = s2[r2]) && (t2 = (o2 ? n3(e2, i3, t2) : n3(t2)) || t2);
18506
18542
  return o2 && t2 && At(e2, i3, t2), t2;
18507
18543
  };
18508
- class w extends i$1 {
18544
+ class $ extends i$1 {
18509
18545
  constructor() {
18510
18546
  super(...arguments), this.open = false, this.size = "medium", this.showClose = true, this.closeOnBackdropClick = true, this.closeOnEscape = true, this.closeDisabled = false, this.contentCentered = false, this.handleDialogClick = (e2) => {
18511
18547
  if (!this.closeOnBackdropClick || this.closeDisabled)
@@ -18589,7 +18625,7 @@ class w extends i$1 {
18589
18625
  `;
18590
18626
  }
18591
18627
  }
18592
- w.styles = [
18628
+ $.styles = [
18593
18629
  m,
18594
18630
  me,
18595
18631
  i$4`
@@ -18725,31 +18761,31 @@ w.styles = [
18725
18761
  }
18726
18762
  `
18727
18763
  ];
18728
- O([
18764
+ A([
18729
18765
  a({ type: Boolean, reflect: true })
18730
- ], w.prototype, "open", 2);
18731
- O([
18766
+ ], $.prototype, "open", 2);
18767
+ A([
18732
18768
  a({ reflect: true })
18733
- ], w.prototype, "size", 2);
18734
- O([
18769
+ ], $.prototype, "size", 2);
18770
+ A([
18735
18771
  a({ type: Boolean, attribute: "show-close" })
18736
- ], w.prototype, "showClose", 2);
18737
- O([
18772
+ ], $.prototype, "showClose", 2);
18773
+ A([
18738
18774
  a({ type: Boolean, attribute: "close-on-backdrop-click" })
18739
- ], w.prototype, "closeOnBackdropClick", 2);
18740
- O([
18775
+ ], $.prototype, "closeOnBackdropClick", 2);
18776
+ A([
18741
18777
  a({ type: Boolean, attribute: "close-on-escape" })
18742
- ], w.prototype, "closeOnEscape", 2);
18743
- O([
18778
+ ], $.prototype, "closeOnEscape", 2);
18779
+ A([
18744
18780
  a({ type: Boolean, attribute: "close-disabled" })
18745
- ], w.prototype, "closeDisabled", 2);
18746
- O([
18781
+ ], $.prototype, "closeDisabled", 2);
18782
+ A([
18747
18783
  a({ type: Boolean, attribute: "content-centered" })
18748
- ], w.prototype, "contentCentered", 2);
18749
- O([
18784
+ ], $.prototype, "contentCentered", 2);
18785
+ A([
18750
18786
  bt("dialog")
18751
- ], w.prototype, "dialog", 2);
18752
- customElements.get("obi-modal") || customElements.define("obi-modal", w);
18787
+ ], $.prototype, "dialog", 2);
18788
+ customElements.get("obi-modal") || customElements.define("obi-modal", $);
18753
18789
  var Dt = Object.defineProperty, St = Object.getOwnPropertyDescriptor, Ft = (s2, e2, i3, o2) => {
18754
18790
  for (var t2 = o2 > 1 ? void 0 : o2 ? St(e2, i3) : e2, r2 = s2.length - 1, n3; r2 >= 0; r2--)
18755
18791
  (n3 = s2[r2]) && (t2 = (o2 ? n3(e2, i3, t2) : n3(t2)) || t2);
@@ -18805,12 +18841,12 @@ Ft([
18805
18841
  a({ reflect: true })
18806
18842
  ], Se.prototype, "size", 2);
18807
18843
  customElements.get("obi-spinner") || customElements.define("obi-spinner", Se);
18808
- var jt = Object.defineProperty, Tt = Object.getOwnPropertyDescriptor, z2 = (s2, e2, i3, o2) => {
18844
+ var jt = Object.defineProperty, Tt = Object.getOwnPropertyDescriptor, B = (s2, e2, i3, o2) => {
18809
18845
  for (var t2 = o2 > 1 ? void 0 : o2 ? Tt(e2, i3) : e2, r2 = s2.length - 1, n3; r2 >= 0; r2--)
18810
18846
  (n3 = s2[r2]) && (t2 = (o2 ? n3(e2, i3, t2) : n3(t2)) || t2);
18811
18847
  return o2 && t2 && jt(e2, i3, t2), t2;
18812
18848
  };
18813
- class $ extends i$1 {
18849
+ class w extends i$1 {
18814
18850
  constructor() {
18815
18851
  super(...arguments), this.variant = "primary", this.size = "medium", this.disabled = false, this.loading = false, this.type = "button", this.fullWidth = false, this.loadingText = "";
18816
18852
  }
@@ -18861,7 +18897,7 @@ class $ extends i$1 {
18861
18897
  `;
18862
18898
  }
18863
18899
  }
18864
- $.styles = [
18900
+ w.styles = [
18865
18901
  m,
18866
18902
  me,
18867
18903
  i$4`
@@ -18985,34 +19021,34 @@ $.styles = [
18985
19021
  }
18986
19022
  `
18987
19023
  ];
18988
- z2([
19024
+ B([
18989
19025
  a({ reflect: true })
18990
- ], $.prototype, "variant", 2);
18991
- z2([
19026
+ ], w.prototype, "variant", 2);
19027
+ B([
18992
19028
  a({ reflect: true })
18993
- ], $.prototype, "size", 2);
18994
- z2([
19029
+ ], w.prototype, "size", 2);
19030
+ B([
18995
19031
  a({ type: Boolean, reflect: true })
18996
- ], $.prototype, "disabled", 2);
18997
- z2([
19032
+ ], w.prototype, "disabled", 2);
19033
+ B([
18998
19034
  a({ type: Boolean, reflect: true })
18999
- ], $.prototype, "loading", 2);
19000
- z2([
19035
+ ], w.prototype, "loading", 2);
19036
+ B([
19001
19037
  a()
19002
- ], $.prototype, "type", 2);
19003
- z2([
19038
+ ], w.prototype, "type", 2);
19039
+ B([
19004
19040
  a({ type: Boolean, reflect: true, attribute: "full-width" })
19005
- ], $.prototype, "fullWidth", 2);
19006
- z2([
19041
+ ], w.prototype, "fullWidth", 2);
19042
+ B([
19007
19043
  a({ attribute: "loading-text" })
19008
- ], $.prototype, "loadingText", 2);
19009
- customElements.get("obi-button") || customElements.define("obi-button", $);
19044
+ ], w.prototype, "loadingText", 2);
19045
+ customElements.get("obi-button") || customElements.define("obi-button", w);
19010
19046
  var Nt = Object.defineProperty, kt = Object.getOwnPropertyDescriptor, fe = (s2, e2, i3, o2) => {
19011
19047
  for (var t2 = o2 > 1 ? void 0 : o2 ? kt(e2, i3) : e2, r2 = s2.length - 1, n3; r2 >= 0; r2--)
19012
19048
  (n3 = s2[r2]) && (t2 = (o2 ? n3(e2, i3, t2) : n3(t2)) || t2);
19013
19049
  return o2 && t2 && Nt(e2, i3, t2), t2;
19014
19050
  };
19015
- class H4 extends i$1 {
19051
+ class I2 extends i$1 {
19016
19052
  constructor() {
19017
19053
  super(...arguments), this.showRetry = false, this.showDismiss = false, this.retryText = "Retry", this.dismissText = "Dismiss";
19018
19054
  }
@@ -19062,7 +19098,7 @@ class H4 extends i$1 {
19062
19098
  `;
19063
19099
  }
19064
19100
  }
19065
- H4.styles = [
19101
+ I2.styles = [
19066
19102
  m,
19067
19103
  me,
19068
19104
  i$4`
@@ -19126,17 +19162,17 @@ H4.styles = [
19126
19162
  ];
19127
19163
  fe([
19128
19164
  a({ type: Boolean, attribute: "show-retry" })
19129
- ], H4.prototype, "showRetry", 2);
19165
+ ], I2.prototype, "showRetry", 2);
19130
19166
  fe([
19131
19167
  a({ type: Boolean, attribute: "show-dismiss" })
19132
- ], H4.prototype, "showDismiss", 2);
19168
+ ], I2.prototype, "showDismiss", 2);
19133
19169
  fe([
19134
19170
  a({ attribute: "retry-text" })
19135
- ], H4.prototype, "retryText", 2);
19171
+ ], I2.prototype, "retryText", 2);
19136
19172
  fe([
19137
19173
  a({ attribute: "dismiss-text" })
19138
- ], H4.prototype, "dismissText", 2);
19139
- customElements.get("obi-error-message") || customElements.define("obi-error-message", H4);
19174
+ ], I2.prototype, "dismissText", 2);
19175
+ customElements.get("obi-error-message") || customElements.define("obi-error-message", I2);
19140
19176
  function Ze(s2, e2) {
19141
19177
  if (!s2)
19142
19178
  return "";
@@ -19148,19 +19184,19 @@ function Ze(s2, e2) {
19148
19184
  b: parseInt(x2)
19149
19185
  };
19150
19186
  }, o2 = (h2, p2, b2) => "#" + [h2, p2, b2].map((x2) => {
19151
- const _2 = x2.toString(16);
19152
- return _2.length === 1 ? "0" + _2 : _2;
19187
+ const E2 = x2.toString(16);
19188
+ return E2.length === 1 ? "0" + E2 : E2;
19153
19189
  }).join(""), { r: t2, g: r2, b: n3 } = i3(s2), d2 = Math.round(t2 + (255 - t2) * e2), l2 = Math.round(r2 + (255 - r2) * e2), u2 = Math.round(n3 + (255 - n3) * e2);
19154
19190
  return o2(d2, l2, u2);
19155
19191
  }
19156
- var zt = Object.defineProperty, Bt = Object.getOwnPropertyDescriptor, I2 = (s2, e2, i3, o2) => {
19157
- for (var t2 = o2 > 1 ? void 0 : o2 ? Bt(e2, i3) : e2, r2 = s2.length - 1, n3; r2 >= 0; r2--)
19192
+ var Bt = Object.defineProperty, zt = Object.getOwnPropertyDescriptor, z2 = (s2, e2, i3, o2) => {
19193
+ for (var t2 = o2 > 1 ? void 0 : o2 ? zt(e2, i3) : e2, r2 = s2.length - 1, n3; r2 >= 0; r2--)
19158
19194
  (n3 = s2[r2]) && (t2 = (o2 ? n3(e2, i3, t2) : n3(t2)) || t2);
19159
- return o2 && t2 && zt(e2, i3, t2), t2;
19195
+ return o2 && t2 && Bt(e2, i3, t2), t2;
19160
19196
  };
19161
- class A extends i$1 {
19197
+ class _ extends i$1 {
19162
19198
  constructor() {
19163
- super(...arguments), this.title = "", this.subtitle = "", this.agentName = "Obi", this.buttonText = "Continue", this.disabled = false, this.color = "#9500FF";
19199
+ super(...arguments), this.title = "", this.subtitle = "", this.agentName = "Obi", this.buttonText = "Continue", this.disabled = false, this.isLoading = false, this.color = "#9500FF";
19164
19200
  }
19165
19201
  getBackgroundColor() {
19166
19202
  return Ze(this.color, 0.95);
@@ -19172,6 +19208,7 @@ class A extends i$1 {
19172
19208
  }));
19173
19209
  }
19174
19210
  render() {
19211
+ const e2 = this.isLoading ? "Loading..." : this.disabled ? `${this.agentName} is speaking` : this.buttonText, i3 = this.disabled || this.isLoading;
19175
19212
  return x`
19176
19213
  <div class="content-container">
19177
19214
  <!-- Header -->
@@ -19196,9 +19233,9 @@ class A extends i$1 {
19196
19233
  <button
19197
19234
  class="action-button"
19198
19235
  @click=${this.handleAction}
19199
- ?disabled=${this.disabled}
19236
+ ?disabled=${i3}
19200
19237
  >
19201
- <span class="action-button-text">${this.disabled ? `${this.agentName} is speaking` : this.buttonText}</span>
19238
+ <span class="action-button-text">${e2}</span>
19202
19239
  </button>
19203
19240
  </slot>
19204
19241
 
@@ -19208,7 +19245,7 @@ class A extends i$1 {
19208
19245
  `;
19209
19246
  }
19210
19247
  }
19211
- A.styles = [
19248
+ _.styles = [
19212
19249
  m,
19213
19250
  i$4`
19214
19251
  :host {
@@ -19337,25 +19374,28 @@ A.styles = [
19337
19374
  }
19338
19375
  `
19339
19376
  ];
19340
- I2([
19377
+ z2([
19341
19378
  a()
19342
- ], A.prototype, "title", 2);
19343
- I2([
19379
+ ], _.prototype, "title", 2);
19380
+ z2([
19344
19381
  a()
19345
- ], A.prototype, "subtitle", 2);
19346
- I2([
19382
+ ], _.prototype, "subtitle", 2);
19383
+ z2([
19347
19384
  a({ attribute: "agent-name" })
19348
- ], A.prototype, "agentName", 2);
19349
- I2([
19385
+ ], _.prototype, "agentName", 2);
19386
+ z2([
19350
19387
  a({ attribute: "button-text" })
19351
- ], A.prototype, "buttonText", 2);
19352
- I2([
19388
+ ], _.prototype, "buttonText", 2);
19389
+ z2([
19353
19390
  a({ type: Boolean, reflect: true })
19354
- ], A.prototype, "disabled", 2);
19355
- I2([
19391
+ ], _.prototype, "disabled", 2);
19392
+ z2([
19393
+ a({ type: Boolean })
19394
+ ], _.prototype, "isLoading", 2);
19395
+ z2([
19356
19396
  a()
19357
- ], A.prototype, "color", 2);
19358
- customElements.get("obi-base-onboarding-content") || customElements.define("obi-base-onboarding-content", A);
19397
+ ], _.prototype, "color", 2);
19398
+ customElements.get("obi-base-onboarding-content") || customElements.define("obi-base-onboarding-content", _);
19359
19399
  var Lt = Object.defineProperty, Mt = Object.getOwnPropertyDescriptor, Je = (s2, e2, i3, o2) => {
19360
19400
  for (var t2 = o2 > 1 ? void 0 : o2 ? Mt(e2, i3) : e2, r2 = s2.length - 1, n3; r2 >= 0; r2--)
19361
19401
  (n3 = s2[r2]) && (t2 = (o2 ? n3(e2, i3, t2) : n3(t2)) || t2);
@@ -19471,7 +19511,7 @@ var Rt = Object.defineProperty, Ut = Object.getOwnPropertyDescriptor, ne = (s2,
19471
19511
  (n3 = s2[r2]) && (t2 = (o2 ? n3(e2, i3, t2) : n3(t2)) || t2);
19472
19512
  return o2 && t2 && Rt(e2, i3, t2), t2;
19473
19513
  };
19474
- class B extends i$1 {
19514
+ class L2 extends i$1 {
19475
19515
  constructor() {
19476
19516
  super(...arguments), this.color = "#9500FF", this.isLoading = false, this.error = null, this.navigateAttempts = 0;
19477
19517
  }
@@ -19557,23 +19597,23 @@ class B extends i$1 {
19557
19597
  `;
19558
19598
  }
19559
19599
  }
19560
- B.styles = [m];
19600
+ L2.styles = [m];
19561
19601
  ne([
19562
19602
  a({ type: Object })
19563
- ], B.prototype, "session", 2);
19603
+ ], L2.prototype, "session", 2);
19564
19604
  ne([
19565
19605
  a()
19566
- ], B.prototype, "color", 2);
19606
+ ], L2.prototype, "color", 2);
19567
19607
  ne([
19568
19608
  v()
19569
- ], B.prototype, "isLoading", 2);
19609
+ ], L2.prototype, "isLoading", 2);
19570
19610
  ne([
19571
19611
  v()
19572
- ], B.prototype, "error", 2);
19612
+ ], L2.prototype, "error", 2);
19573
19613
  ne([
19574
19614
  v()
19575
- ], B.prototype, "navigateAttempts", 2);
19576
- customElements.get("obi-navigate-to-content") || customElements.define("obi-navigate-to-content", B);
19615
+ ], L2.prototype, "navigateAttempts", 2);
19616
+ customElements.get("obi-navigate-to-content") || customElements.define("obi-navigate-to-content", L2);
19577
19617
  const Ht = x`
19578
19618
  <img
19579
19619
  src="data:image/svg+xml;base64,${btoa(`<?xml version="1.0" encoding="UTF-8"?>
@@ -19688,18 +19728,7 @@ class P extends i$1 {
19688
19728
  bubbles: true,
19689
19729
  composed: true,
19690
19730
  detail: { sessionId: this.session.id, attempt: this.startAttempts }
19691
- })), setTimeout(() => {
19692
- this.isConnected && (this.isLoading = false, this.showError(
19693
- "Something went wrong starting the session. Please refresh the window and try again."
19694
- ), this.dispatchEvent(new CustomEvent("obi-error", {
19695
- bubbles: true,
19696
- composed: true,
19697
- detail: {
19698
- error: new Error("Session start content did not get removed after 'Continue' was clicked"),
19699
- sessionId: this.session?.id
19700
- }
19701
- })));
19702
- }, 2e3);
19731
+ }));
19703
19732
  } catch (e2) {
19704
19733
  this.isLoading = false, this.dispatchEvent(new CustomEvent("obi-error", {
19705
19734
  bubbles: true,
@@ -19727,7 +19756,8 @@ class P extends i$1 {
19727
19756
  subtitle="AI Product Tour by ${this.session?.agentName || "Obi"}"
19728
19757
  agent-name=${this.session?.agentName || "Obi"}
19729
19758
  button-text="Continue"
19730
- ?disabled=${this.isLoading || this.disabled}
19759
+ ?disabled=${this.disabled}
19760
+ ?isLoading=${this.isLoading}
19731
19761
  color=${this.color}
19732
19762
  @obi-action=${this.handleAction}
19733
19763
  >
@@ -19761,7 +19791,7 @@ V([
19761
19791
  a()
19762
19792
  ], P.prototype, "color", 2);
19763
19793
  V([
19764
- v()
19794
+ a({ type: Boolean, reflect: true })
19765
19795
  ], P.prototype, "isLoading", 2);
19766
19796
  V([
19767
19797
  v()
@@ -20152,7 +20182,7 @@ var Kt = Object.defineProperty, Qt = Object.getOwnPropertyDescriptor, ae = (s2,
20152
20182
  (n3 = s2[r2]) && (t2 = (o2 ? n3(e2, i3, t2) : n3(t2)) || t2);
20153
20183
  return o2 && t2 && Kt(e2, i3, t2), t2;
20154
20184
  };
20155
- class L2 extends i$1 {
20185
+ class M2 extends i$1 {
20156
20186
  constructor() {
20157
20187
  super(...arguments), this.color = "#9500FF", this.disabled = false, this.loading = false, this.error = null;
20158
20188
  }
@@ -20224,23 +20254,23 @@ class L2 extends i$1 {
20224
20254
  `;
20225
20255
  }
20226
20256
  }
20227
- L2.styles = [m];
20257
+ M2.styles = [m];
20228
20258
  ae([
20229
20259
  a({ type: Object })
20230
- ], L2.prototype, "session", 2);
20260
+ ], M2.prototype, "session", 2);
20231
20261
  ae([
20232
20262
  a()
20233
- ], L2.prototype, "color", 2);
20263
+ ], M2.prototype, "color", 2);
20234
20264
  ae([
20235
20265
  a({ type: Boolean, reflect: true })
20236
- ], L2.prototype, "disabled", 2);
20266
+ ], M2.prototype, "disabled", 2);
20237
20267
  ae([
20238
20268
  a({ type: Boolean, reflect: true })
20239
- ], L2.prototype, "loading", 2);
20269
+ ], M2.prototype, "loading", 2);
20240
20270
  ae([
20241
20271
  v()
20242
- ], L2.prototype, "error", 2);
20243
- customElements.get("obi-voice-guidance-content") || customElements.define("obi-voice-guidance-content", L2);
20272
+ ], M2.prototype, "error", 2);
20273
+ customElements.get("obi-voice-guidance-content") || customElements.define("obi-voice-guidance-content", M2);
20244
20274
  class Qe extends i$1 {
20245
20275
  render() {
20246
20276
  return x`
@@ -20744,7 +20774,7 @@ et([
20744
20774
  a({ type: Boolean, attribute: "close-disabled" })
20745
20775
  ], xe.prototype, "closeDisabled", 2);
20746
20776
  customElements.get("obi-base-onboarding-modal") || customElements.define("obi-base-onboarding-modal", xe);
20747
- var ao = Object.defineProperty, lo = Object.getOwnPropertyDescriptor, we = (s2, e2, i3, o2) => {
20777
+ var ao = Object.defineProperty, lo = Object.getOwnPropertyDescriptor, $e = (s2, e2, i3, o2) => {
20748
20778
  for (var t2 = o2 > 1 ? void 0 : o2 ? lo(e2, i3) : e2, r2 = s2.length - 1, n3; r2 >= 0; r2--)
20749
20779
  (n3 = s2[r2]) && (t2 = (o2 ? n3(e2, i3, t2) : n3(t2)) || t2);
20750
20780
  return o2 && t2 && ao(e2, i3, t2), t2;
@@ -20769,16 +20799,16 @@ class G extends i$1 {
20769
20799
  }
20770
20800
  }
20771
20801
  G.styles = [m];
20772
- we([
20802
+ $e([
20773
20803
  a({ type: Object })
20774
20804
  ], G.prototype, "session", 2);
20775
- we([
20805
+ $e([
20776
20806
  a({ type: Boolean, reflect: true })
20777
20807
  ], G.prototype, "open", 2);
20778
- we([
20808
+ $e([
20779
20809
  a({ type: Boolean, reflect: true })
20780
20810
  ], G.prototype, "disabled", 2);
20781
- we([
20811
+ $e([
20782
20812
  a()
20783
20813
  ], G.prototype, "color", 2);
20784
20814
  customElements.get("obi-share-screen-modal") || customElements.define("obi-share-screen-modal", G);
@@ -20787,7 +20817,7 @@ var co = Object.defineProperty, ho = Object.getOwnPropertyDescriptor, le = (s2,
20787
20817
  (n3 = s2[r2]) && (t2 = (o2 ? n3(e2, i3, t2) : n3(t2)) || t2);
20788
20818
  return o2 && t2 && co(e2, i3, t2), t2;
20789
20819
  };
20790
- class M2 extends i$1 {
20820
+ class R2 extends i$1 {
20791
20821
  constructor() {
20792
20822
  super(...arguments), this.open = false, this.color = "#9500FF", this.disabled = false, this.closeDisabled = false;
20793
20823
  }
@@ -20807,24 +20837,24 @@ class M2 extends i$1 {
20807
20837
  `;
20808
20838
  }
20809
20839
  }
20810
- M2.styles = [m];
20840
+ R2.styles = [m];
20811
20841
  le([
20812
20842
  a({ type: Object })
20813
- ], M2.prototype, "session", 2);
20843
+ ], R2.prototype, "session", 2);
20814
20844
  le([
20815
20845
  a({ type: Boolean, reflect: true })
20816
- ], M2.prototype, "open", 2);
20846
+ ], R2.prototype, "open", 2);
20817
20847
  le([
20818
20848
  a()
20819
- ], M2.prototype, "color", 2);
20849
+ ], R2.prototype, "color", 2);
20820
20850
  le([
20821
20851
  a({ type: Boolean, reflect: true })
20822
- ], M2.prototype, "disabled", 2);
20852
+ ], R2.prototype, "disabled", 2);
20823
20853
  le([
20824
20854
  a({ type: Boolean, attribute: "close-disabled" })
20825
- ], M2.prototype, "closeDisabled", 2);
20826
- customElements.get("obi-navigate-to-modal") || customElements.define("obi-navigate-to-modal", M2);
20827
- var po = Object.defineProperty, uo = Object.getOwnPropertyDescriptor, $e = (s2, e2, i3, o2) => {
20855
+ ], R2.prototype, "closeDisabled", 2);
20856
+ customElements.get("obi-navigate-to-modal") || customElements.define("obi-navigate-to-modal", R2);
20857
+ var po = Object.defineProperty, uo = Object.getOwnPropertyDescriptor, we = (s2, e2, i3, o2) => {
20828
20858
  for (var t2 = o2 > 1 ? void 0 : o2 ? uo(e2, i3) : e2, r2 = s2.length - 1, n3; r2 >= 0; r2--)
20829
20859
  (n3 = s2[r2]) && (t2 = (o2 ? n3(e2, i3, t2) : n3(t2)) || t2);
20830
20860
  return o2 && t2 && po(e2, i3, t2), t2;
@@ -20846,16 +20876,16 @@ class X extends i$1 {
20846
20876
  }
20847
20877
  }
20848
20878
  X.styles = [m];
20849
- $e([
20879
+ we([
20850
20880
  a({ type: Object })
20851
20881
  ], X.prototype, "session", 2);
20852
- $e([
20882
+ we([
20853
20883
  a({ type: Boolean, reflect: true })
20854
20884
  ], X.prototype, "disabled", 2);
20855
- $e([
20885
+ we([
20856
20886
  a({ type: Boolean, reflect: true })
20857
20887
  ], X.prototype, "open", 2);
20858
- $e([
20888
+ we([
20859
20889
  a()
20860
20890
  ], X.prototype, "color", 2);
20861
20891
  customElements.get("obi-session-start-modal") || customElements.define("obi-session-start-modal", X);
@@ -21057,8 +21087,8 @@ Ee([
21057
21087
  v()
21058
21088
  ], K.prototype, "animationTimeouts", 2);
21059
21089
  customElements.get("obi-overview-visual") || customElements.define("obi-overview-visual", K);
21060
- var xo = Object.defineProperty, wo = Object.getOwnPropertyDescriptor, Te = (s2, e2, i3, o2) => {
21061
- for (var t2 = o2 > 1 ? void 0 : o2 ? wo(e2, i3) : e2, r2 = s2.length - 1, n3; r2 >= 0; r2--)
21090
+ var xo = Object.defineProperty, $o = Object.getOwnPropertyDescriptor, Te = (s2, e2, i3, o2) => {
21091
+ for (var t2 = o2 > 1 ? void 0 : o2 ? $o(e2, i3) : e2, r2 = s2.length - 1, n3; r2 >= 0; r2--)
21062
21092
  (n3 = s2[r2]) && (t2 = (o2 ? n3(e2, i3, t2) : n3(t2)) || t2);
21063
21093
  return o2 && t2 && xo(e2, i3, t2), t2;
21064
21094
  };
@@ -21069,7 +21099,7 @@ class ce extends i$1 {
21069
21099
  render() {
21070
21100
  return x`
21071
21101
  <obi-base-onboarding-content
21072
- title="Welcome to the tour"
21102
+ title="Welcome to the AI tour"
21073
21103
  subtitle="Let's get started!"
21074
21104
  agent-name=${this.session.agentName || "Obi"}
21075
21105
  color=${this.color}
@@ -21098,10 +21128,10 @@ Te([
21098
21128
  a({ type: Boolean, reflect: true })
21099
21129
  ], ce.prototype, "loading", 2);
21100
21130
  customElements.get("obi-overview-content") || customElements.define("obi-overview-content", ce);
21101
- var $o = Object.defineProperty, _o = Object.getOwnPropertyDescriptor, Q = (s2, e2, i3, o2) => {
21131
+ var wo = Object.defineProperty, _o = Object.getOwnPropertyDescriptor, Q = (s2, e2, i3, o2) => {
21102
21132
  for (var t2 = o2 > 1 ? void 0 : o2 ? _o(e2, i3) : e2, r2 = s2.length - 1, n3; r2 >= 0; r2--)
21103
21133
  (n3 = s2[r2]) && (t2 = (o2 ? n3(e2, i3, t2) : n3(t2)) || t2);
21104
- return o2 && t2 && $o(e2, i3, t2), t2;
21134
+ return o2 && t2 && wo(e2, i3, t2), t2;
21105
21135
  };
21106
21136
  class j extends i$1 {
21107
21137
  constructor() {
@@ -21290,6 +21320,7 @@ class ObiWidget extends i$1 {
21290
21320
  this.showSessionStartModal = false;
21291
21321
  this.showShareMicModal = false;
21292
21322
  this.showOverviewModal = false;
21323
+ this.trackEvent("plan_cancelled");
21293
21324
  };
21294
21325
  this.handleCourseSelectEvent = (event) => {
21295
21326
  const customEvent = event;
@@ -21301,6 +21332,7 @@ class ObiWidget extends i$1 {
21301
21332
  this.micShareEnabled = false;
21302
21333
  this.showVoiceGuidanceModal = false;
21303
21334
  this.voiceGuidanceEnabled = false;
21335
+ this.trackEvent("plan_selected");
21304
21336
  };
21305
21337
  this.handleUrlSessionEvent = withSentryAsyncHandler(
21306
21338
  async (sessionToken) => {
@@ -21379,8 +21411,7 @@ class ObiWidget extends i$1 {
21379
21411
  this.activeSession.disconnect();
21380
21412
  this.activeSession = null;
21381
21413
  }
21382
- this.showSessionStartModal = false;
21383
- this.showVoiceGuidanceModal = true;
21414
+ this.trackEvent("plan_started");
21384
21415
  this.state = SDKState.LOADING;
21385
21416
  setGlobalContext({ widgetState: this.state.toString() });
21386
21417
  await this.connectObi(sessionToken);
@@ -21518,6 +21549,7 @@ class ObiWidget extends i$1 {
21518
21549
  this.showVoiceGuidanceModal = false;
21519
21550
  this.voiceGuidanceEnabled = false;
21520
21551
  this.showOverviewModal = true;
21552
+ this.trackEvent("voice_continue");
21521
21553
  };
21522
21554
  this.handleVoiceGuidanceModalClose = () => {
21523
21555
  console.log("[obi] voice guidance modal close", {
@@ -21649,6 +21681,7 @@ class ObiWidget extends i$1 {
21649
21681
  if (window.obiWidgetConfig.showMenu === true) {
21650
21682
  this.state = SDKState.LOADING;
21651
21683
  this.showCourseModal = true;
21684
+ this.trackEvent("plans_opened");
21652
21685
  window.obiWidgetConfig.showMenu = false;
21653
21686
  }
21654
21687
  } else {
@@ -21693,6 +21726,7 @@ class ObiWidget extends i$1 {
21693
21726
  const session = new ObiSession({
21694
21727
  sessionId: sessionToken,
21695
21728
  apiBaseUrl: API_BASE_URL,
21729
+ clientType: "sdk",
21696
21730
  ...this.user && { user: this.user }
21697
21731
  });
21698
21732
  if (!session) {
@@ -21744,7 +21778,12 @@ class ObiWidget extends i$1 {
21744
21778
  onError();
21745
21779
  }
21746
21780
  });
21781
+ session.on("firstSpeech", () => {
21782
+ this.showSessionStartModal = false;
21783
+ this.showVoiceGuidanceModal = true;
21784
+ });
21747
21785
  session.on("micCheck", (permissionGranted) => {
21786
+ this.trackEvent("mic_check", { permission_granted: permissionGranted });
21748
21787
  this.showOverviewModal = false;
21749
21788
  if (!permissionGranted) {
21750
21789
  this.showShareMicModal = true;
@@ -21753,8 +21792,9 @@ class ObiWidget extends i$1 {
21753
21792
  session.on("micShareRequested", () => {
21754
21793
  this.micShareEnabled = true;
21755
21794
  });
21756
- session.on("micShared", () => {
21795
+ session.on("micShared", (shared) => {
21757
21796
  this.showOverviewModal = false;
21797
+ this.trackEvent("mic_shared", { shared });
21758
21798
  });
21759
21799
  session.on("promptUser", () => {
21760
21800
  this.voiceGuidanceEnabled = true;
@@ -21927,6 +21967,7 @@ class ObiWidget extends i$1 {
21927
21967
  handleItemSelect(id, itemIsActive) {
21928
21968
  if (id === "experiences") {
21929
21969
  this.showCourseModal = true;
21970
+ this.trackEvent("plans_opened");
21930
21971
  return;
21931
21972
  }
21932
21973
  z$3([id, itemIsActive]).with(["pause", true], () => {
@@ -22023,13 +22064,13 @@ class ObiWidget extends i$1 {
22023
22064
  }
22024
22065
  render() {
22025
22066
  if (!this.configLoaded)
22026
- return E$1;
22067
+ return E;
22027
22068
  if (!this.isActive)
22028
- return E$1;
22069
+ return E;
22029
22070
  if (this.linkOnlyAccess && this.state === SDKState.READY)
22030
- return E$1;
22071
+ return E;
22031
22072
  if (isCurrentUrlBlacklisted(this.urlBlacklist)) {
22032
- return E$1;
22073
+ return E;
22033
22074
  }
22034
22075
  const stateRender = z$3(this.state).with(SDKState.LOADING, () => x`<obi-dot-loader></obi-dot-loader>`).with(SDKState.RESEARCHING, () => x`<obi-searching-loader></obi-searching-loader>`).with(
22035
22076
  N$2.union(SDKState.USER_SPEAKING, SDKState.AGENT_SPEAKING),
@@ -22050,6 +22091,7 @@ class ObiWidget extends i$1 {
22050
22091
  isResearching ? "researching" : "",
22051
22092
  isUserSpeaking ? "user-speaking" : ""
22052
22093
  ].filter(Boolean).join(" ");
22094
+ console.log("show session start modal", this.showSessionStartModal);
22053
22095
  return x`
22054
22096
  <div
22055
22097
  class="${containerClasses}"
@@ -22065,14 +22107,14 @@ class ObiWidget extends i$1 {
22065
22107
  .currentState=${this.state}
22066
22108
  .onItemSelect=${this.handleItemSelect.bind(this)}
22067
22109
  ></obi-navigation-bar>
22068
- ` : E$1}
22110
+ ` : E}
22069
22111
  </div>
22070
22112
 
22071
22113
  ${this.showCourseModal ? x`<obi-course-modal
22072
22114
  .onClose=${this.handleCloseModals.bind(this)}
22073
22115
  .apiKey=${this.apiKey}
22074
22116
  @course-select=${this.handleCourseSelectEvent}
22075
- ></obi-course-modal>` : E$1}
22117
+ ></obi-course-modal>` : E}
22076
22118
  ${this.showSessionStartModal && !!this.selectedCourse ? x`
22077
22119
  <obi-session-start-modal
22078
22120
  .session=${this.selectedCourse ? {
@@ -22088,7 +22130,7 @@ class ObiWidget extends i$1 {
22088
22130
  @obi-error=${this.handleSessionModalError}
22089
22131
  >
22090
22132
  </obi-session-start-modal>
22091
- ` : E$1}
22133
+ ` : E}
22092
22134
  ${this.showVoiceGuidanceModal ? x`
22093
22135
  <obi-voice-guidance-modal
22094
22136
  .session=${this.selectedCourse ? {
@@ -22104,7 +22146,7 @@ class ObiWidget extends i$1 {
22104
22146
  @obi-close=${this.handleVoiceGuidanceModalClose}
22105
22147
  >
22106
22148
  </obi-voice-guidance-modal>
22107
- ` : E$1}
22149
+ ` : E}
22108
22150
  ${this.showOverviewModal ? x`
22109
22151
  <obi-overview-modal
22110
22152
  .session=${this.selectedCourse ? {
@@ -22118,7 +22160,7 @@ class ObiWidget extends i$1 {
22118
22160
  @obi-close=${this.handleOverviewModalClose}
22119
22161
  >
22120
22162
  </obi-voice-guidance-modal>
22121
- ` : E$1}
22163
+ ` : E}
22122
22164
  ${this.showShareMicModal ? x`
22123
22165
  <obi-share-mic-modal
22124
22166
  .session=${this.selectedCourse ? {
@@ -22134,9 +22176,27 @@ class ObiWidget extends i$1 {
22134
22176
  @obi-close=${this.handleShareMicModalClose}
22135
22177
  >
22136
22178
  </obi-share-mic-modal>
22137
- ` : E$1}
22179
+ ` : E}
22138
22180
  `;
22139
22181
  }
22182
+ trackEvent(event, data = {}) {
22183
+ if (this.activeSession) {
22184
+ this.activeSession.track(event, {
22185
+ ...data,
22186
+ session_id: this.selectedCourse ? `${this.selectedCourse?.id}` : void 0,
22187
+ onboardee_id: this.apiKey,
22188
+ client_type: "sdk"
22189
+ });
22190
+ } else if (this.obiClient) {
22191
+ this.obiClient.trackEvent({
22192
+ ...data,
22193
+ session_id: this.selectedCourse ? `${this.selectedCourse?.id}` : void 0,
22194
+ onboardee_id: this.apiKey,
22195
+ event,
22196
+ client_type: "sdk"
22197
+ });
22198
+ }
22199
+ }
22140
22200
  }
22141
22201
  ObiWidget.styles = i$4`
22142
22202
  :host {
@@ -22387,4 +22447,4 @@ export {
22387
22447
  withSentryAsyncHandler as w,
22388
22448
  x
22389
22449
  };
22390
- //# sourceMappingURL=obi-widget-315605ed.js.map
22450
+ //# sourceMappingURL=obi-widget-eab5da7a.js.map