@floe-ai/sdk 0.1.0-dev.31 → 0.1.0-dev.32
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.
- package/dist-sdk/floe-sdk.es.js +215 -186
- package/dist-sdk/floe-sdk.es.js.map +1 -1
- package/dist-sdk/floe-sdk.iife.js +14 -14
- package/dist-sdk/floe-sdk.iife.js.map +1 -1
- package/dist-sdk/floe-sdk.umd.js +14 -14
- package/dist-sdk/floe-sdk.umd.js.map +1 -1
- package/dist-sdk/index.d.ts +8 -0
- package/package.json +1 -1
package/dist-sdk/floe-sdk.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var mc = Object.defineProperty;
|
|
2
2
|
var bc = (r, e, t) => e in r ? mc(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
|
-
var
|
|
3
|
+
var M = (r, e, t) => bc(r, typeof e != "symbol" ? e + "" : e, t);
|
|
4
4
|
import Us, { useState as Ue, useEffect as Ye, useRef as wn, useCallback as We, useMemo as yc } from "react";
|
|
5
5
|
import vc from "react-dom/client";
|
|
6
6
|
import { jsx as T, jsxs as G, Fragment as fn } from "react/jsx-runtime";
|
|
@@ -3412,7 +3412,7 @@ class Qe extends qc {
|
|
|
3412
3412
|
this._sendMessage(new we(Y.DISCONNECT_BOT, {}));
|
|
3413
3413
|
}
|
|
3414
3414
|
handleMessage(e) {
|
|
3415
|
-
var t, n, i, o, s, a, c, u, d, h, g, b, y, m, v, w, x, C, D, P, R, B, re, se, me, $, j, H, X, N, U, Q, le, Z, Te, ve, $e, l, f, p, S, k, E,
|
|
3415
|
+
var t, n, i, o, s, a, c, u, d, h, g, b, y, m, v, w, x, C, D, P, R, B, re, se, me, $, j, H, X, N, U, Q, le, Z, Te, ve, $e, l, f, p, S, k, E, A, L, I, K, te, Me, tt, nt, be;
|
|
3416
3416
|
switch (ne.debug("[RTVI Message]", e), e.type) {
|
|
3417
3417
|
case Y.BOT_READY: {
|
|
3418
3418
|
const ee = e.data, Ve = ee.version ? ee.version.split(".").map(Number) : [
|
|
@@ -3494,7 +3494,7 @@ class Qe extends qc {
|
|
|
3494
3494
|
}
|
|
3495
3495
|
case Y.LLM_FUNCTION_CALL_IN_PROGRESS: {
|
|
3496
3496
|
const ee = e.data;
|
|
3497
|
-
this._maybeTriggerFunctionCallCallback(ee), (L = (
|
|
3497
|
+
this._maybeTriggerFunctionCallCallback(ee), (L = (A = this._options.callbacks) == null ? void 0 : A.onLLMFunctionCallInProgress) == null || L.call(A, ee), this.emit(z.LLMFunctionCallInProgress, ee);
|
|
3498
3498
|
break;
|
|
3499
3499
|
}
|
|
3500
3500
|
case Y.LLM_FUNCTION_CALL_STOPPED: {
|
|
@@ -7893,7 +7893,7 @@ Promise.any || (Promise.any = function() {
|
|
|
7893
7893
|
}());
|
|
7894
7894
|
var jd = function() {
|
|
7895
7895
|
function r(l) {
|
|
7896
|
-
var f, p, S, k, E,
|
|
7896
|
+
var f, p, S, k, E, A, L = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
7897
7897
|
if (Be(this, r), S = this, k = Ze(k = r), ot(p = lr(S, Ja() ? Reflect.construct(k, [], Ze(S).constructor) : k.apply(S, E)), "startListeningForDeviceChanges", function() {
|
|
7898
7898
|
Dd(p.handleDeviceChange);
|
|
7899
7899
|
}), ot(p, "stopListeningForDeviceChanges", function() {
|
|
@@ -7920,7 +7920,7 @@ var jd = function() {
|
|
|
7920
7920
|
if (p.strictMode) throw new Error("Duplicate DailyIframe instances are not allowed");
|
|
7921
7921
|
console.warn("Using strictMode: false to allow multiple call instances is now deprecated. Set `allowMultipleCallInstances: true`");
|
|
7922
7922
|
}
|
|
7923
|
-
if (window._daily || (window._daily = { pendings: [], instances: {} }), p.callClientId = dr(), Mt[(
|
|
7923
|
+
if (window._daily || (window._daily = { pendings: [], instances: {} }), p.callClientId = dr(), Mt[(A = p).callClientId] = A, window._daily.instances[p.callClientId] = {}, p._sharedTracks = {}, window._daily.instances[p.callClientId].tracks = p._sharedTracks, L.dailyJsVersion = r.version(), p._iframe = l, p._callObjectMode = L.layout === "none" && !p._iframe, p._preloadCache = { subscribeToTracksAutomatically: !0, outputDeviceId: null, inputSettings: null, sendSettings: null, videoTrackForNetworkConnectivityTest: null, videoTrackForConnectionQualityTest: null }, L.showLocalVideo !== void 0 ? p._callObjectMode ? console.error("showLocalVideo is not available in call object mode") : p._showLocalVideo = !!L.showLocalVideo : p._showLocalVideo = !0, L.showParticipantsBar !== void 0 ? p._callObjectMode ? console.error("showParticipantsBar is not available in call object mode") : p._showParticipantsBar = !!L.showParticipantsBar : p._showParticipantsBar = !0, L.customIntegrations !== void 0 ? p._callObjectMode ? console.error("customIntegrations is not available in call object mode") : p._customIntegrations = L.customIntegrations : p._customIntegrations = {}, L.customTrayButtons !== void 0 ? p._callObjectMode ? console.error("customTrayButtons is not available in call object mode") : p._customTrayButtons = L.customTrayButtons : p._customTrayButtons = {}, L.activeSpeakerMode !== void 0 ? p._callObjectMode ? console.error("activeSpeakerMode is not available in call object mode") : p._activeSpeakerMode = !!L.activeSpeakerMode : p._activeSpeakerMode = !1, L.receiveSettings ? p._callObjectMode ? p._receiveSettings = L.receiveSettings : console.error("receiveSettings is only available in call object mode") : p._receiveSettings = {}, p.validateProperties(L), p.properties = F({}, L), p._inputSettings || (p._inputSettings = {}), p._callObjectLoader = p._callObjectMode ? new wd(p.callClientId) : null, p._callState = Vo, p._isPreparingToJoin = !1, p._accessState = { access: Tr }, p._meetingSessionSummary = {}, p._finalSummaryOfPrevSession = {}, p._meetingSessionState = Br(Cs, p._callObjectMode), p._nativeInCallAudioMode = _s, p._participants = {}, p._isScreenSharing = !1, p._participantCounts = Es, p._rmpPlayerState = {}, p._waitingParticipants = {}, p._network = { threshold: "good", quality: 100, networkState: "unknown", stats: {} }, p._activeSpeaker = {}, p._localAudioLevel = 0, p._isLocalAudioLevelObserverRunning = !1, p._remoteParticipantsAudioLevel = {}, p._isRemoteParticipantsAudioLevelObserverRunning = !1, p._maxAppMessageSize = Mr, p._messageChannel = oe() ? new yd() : new bd(), p._iframe && (p._iframe.requestFullscreen ? p._iframe.addEventListener("fullscreenchange", function() {
|
|
7924
7924
|
document.fullscreenElement === p._iframe ? (p.emitDailyJSEvent({ action: $n }), p.sendMessageToCallMachine({ action: $n })) : (p.emitDailyJSEvent({ action: jn }), p.sendMessageToCallMachine({ action: jn }));
|
|
7925
7925
|
}) : p._iframe.webkitRequestFullscreen && p._iframe.addEventListener("webkitfullscreenchange", function() {
|
|
7926
7926
|
document.webkitFullscreenElement === p._iframe ? (p.emitDailyJSEvent({ action: $n }), p.sendMessageToCallMachine({ action: $n })) : (p.emitDailyJSEvent({ action: jn }), p.sendMessageToCallMachine({ action: jn }));
|
|
@@ -7998,9 +7998,9 @@ var jd = function() {
|
|
|
7998
7998
|
return Te.apply(this, arguments);
|
|
7999
7999
|
}) }, { key: "requestAccess", value: (Z = W(function* () {
|
|
8000
8000
|
var l = this, f = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, p = f.access, S = p === void 0 ? { level: hu } : p, k = f.name, E = k === void 0 ? "" : k;
|
|
8001
|
-
return Ke(this._callObjectMode, "requestAccess()"), fe(this._callState, "requestAccess()"), new Promise(function(
|
|
8001
|
+
return Ke(this._callObjectMode, "requestAccess()"), fe(this._callState, "requestAccess()"), new Promise(function(A, L) {
|
|
8002
8002
|
l.sendMessageToCallMachine({ action: "daily-method-request-access", access: S, name: E }, function(I) {
|
|
8003
|
-
I.error && L(I.error), I.access || L(new Error("unknown error in requestAccess()")),
|
|
8003
|
+
I.error && L(I.error), I.access || L(new Error("unknown error in requestAccess()")), A({ access: I.access, granted: I.granted });
|
|
8004
8004
|
});
|
|
8005
8005
|
});
|
|
8006
8006
|
}), function() {
|
|
@@ -8058,8 +8058,8 @@ var jd = function() {
|
|
|
8058
8058
|
if (l.audio) {
|
|
8059
8059
|
var S, k, E;
|
|
8060
8060
|
l.audio.settings && (!Object.keys(l.audio.settings).length && f || (p.audio = { settings: F({}, l.audio.settings) })), f && (S = p.audio) !== null && S !== void 0 && (S = S.settings) !== null && S !== void 0 && S.customTrack && (p.audio.settings = { customTrack: this._sharedTracks.audioTrack });
|
|
8061
|
-
var
|
|
8062
|
-
if (l.audio.processor && !
|
|
8061
|
+
var A = ((k = l.audio.processor) === null || k === void 0 ? void 0 : k.type) === "none" && ((E = l.audio.processor) === null || E === void 0 ? void 0 : E._isDefaultWhenNone);
|
|
8062
|
+
if (l.audio.processor && !A) {
|
|
8063
8063
|
var L = F({}, l.audio.processor);
|
|
8064
8064
|
delete L._isDefaultWhenNone, p.audio = F(F({}, p.audio), {}, { processor: L });
|
|
8065
8065
|
}
|
|
@@ -8081,15 +8081,15 @@ var jd = function() {
|
|
|
8081
8081
|
f(l._getInputSettings());
|
|
8082
8082
|
});
|
|
8083
8083
|
} }, { key: "_getInputSettings", value: function() {
|
|
8084
|
-
var l, f, p, S, k, E,
|
|
8085
|
-
this._inputSettings ? (l = ((p = this._inputSettings) === null || p === void 0 ? void 0 : p.video) ||
|
|
8084
|
+
var l, f, p, S, k, E, A = { processor: { type: "none", _isDefaultWhenNone: !0 } };
|
|
8085
|
+
this._inputSettings ? (l = ((p = this._inputSettings) === null || p === void 0 ? void 0 : p.video) || A, f = ((S = this._inputSettings) === null || S === void 0 ? void 0 : S.audio) || A) : (l = ((k = this._preloadCache) === null || k === void 0 || (k = k.inputSettings) === null || k === void 0 ? void 0 : k.video) || A, f = ((E = this._preloadCache) === null || E === void 0 || (E = E.inputSettings) === null || E === void 0 ? void 0 : E.audio) || A);
|
|
8086
8086
|
var L = { audio: f, video: l };
|
|
8087
8087
|
return this._prepInputSettingsForSharing(L, !0);
|
|
8088
8088
|
} }, { key: "_updatePreloadCacheInputSettings", value: function(l, f) {
|
|
8089
8089
|
var p = this._inputSettings || {}, S = {};
|
|
8090
8090
|
if (l.video) {
|
|
8091
|
-
var k, E,
|
|
8092
|
-
S.video = {}, l.video.settings ? (S.video.settings = {}, f || l.video.settings.customTrack || (
|
|
8091
|
+
var k, E, A;
|
|
8092
|
+
S.video = {}, l.video.settings ? (S.video.settings = {}, f || l.video.settings.customTrack || (A = p.video) === null || A === void 0 || !A.settings ? S.video.settings = l.video.settings : S.video.settings = F(F({}, p.video.settings), l.video.settings), Object.keys(S.video.settings).length || delete S.video.settings) : (k = p.video) !== null && k !== void 0 && k.settings && (S.video.settings = p.video.settings), l.video.processor ? S.video.processor = l.video.processor : (E = p.video) !== null && E !== void 0 && E.processor && (S.video.processor = p.video.processor);
|
|
8093
8093
|
} else p.video && (S.video = p.video);
|
|
8094
8094
|
if (l.audio) {
|
|
8095
8095
|
var L, I, K;
|
|
@@ -8283,10 +8283,10 @@ var jd = function() {
|
|
|
8283
8283
|
} }, { key: "setInputDevicesAsync", value: ($ = W(function* (l) {
|
|
8284
8284
|
var f = this, p = l.audioDeviceId, S = l.videoDeviceId, k = l.audioSource, E = l.videoSource;
|
|
8285
8285
|
if (ie(), k !== void 0 && (p = k), E !== void 0 && (S = E), typeof p == "boolean" && (this._setAllowLocalAudio(p), p = void 0), typeof S == "boolean" && (this._setAllowLocalVideo(S), S = void 0), !p && !S) return yield this.getInputDevices();
|
|
8286
|
-
var
|
|
8287
|
-
return p && (p instanceof MediaStreamTrack ? (this._sharedTracks.audioTrack = p, p = ht,
|
|
8286
|
+
var A = {};
|
|
8287
|
+
return p && (p instanceof MediaStreamTrack ? (this._sharedTracks.audioTrack = p, p = ht, A.audio = { settings: { customTrack: p } }) : (delete this._sharedTracks.audioTrack, A.audio = { settings: { deviceId: p } })), S && (S instanceof MediaStreamTrack ? (this._sharedTracks.videoTrack = S, S = ht, A.video = { settings: { customTrack: S } }) : (delete this._sharedTracks.videoTrack, A.video = { settings: { deviceId: S } })), this._callObjectMode && this.needsLoad() ? (this._updatePreloadCacheInputSettings(A, !1), this._devicesFromInputSettings(this._inputSettings)) : new Promise(function(L) {
|
|
8288
8288
|
f.sendMessageToCallMachine({ action: "set-input-devices", audioDeviceId: p, videoDeviceId: S }, function(I) {
|
|
8289
|
-
if (delete I.action, delete I.callbackStamp, I.returnPreloadCache) return f._updatePreloadCacheInputSettings(
|
|
8289
|
+
if (delete I.action, delete I.callbackStamp, I.returnPreloadCache) return f._updatePreloadCacheInputSettings(A, !1), void L(f._devicesFromInputSettings(f._inputSettings));
|
|
8290
8290
|
L(I);
|
|
8291
8291
|
});
|
|
8292
8292
|
});
|
|
@@ -8298,8 +8298,8 @@ var jd = function() {
|
|
|
8298
8298
|
return this._preloadCache.outputDeviceId = p, this._callObjectMode && this.needsLoad() ? this._devicesFromInputSettings(this._inputSettings) : new Promise(function(S, k) {
|
|
8299
8299
|
f.sendMessageToCallMachine({ action: "set-output-device", outputDeviceId: p }, function(E) {
|
|
8300
8300
|
if (delete E.action, delete E.callbackStamp, E.error) {
|
|
8301
|
-
var
|
|
8302
|
-
return
|
|
8301
|
+
var A = new Error(E.error.message);
|
|
8302
|
+
return A.type = E.error.type, void k(A);
|
|
8303
8303
|
}
|
|
8304
8304
|
E.returnPreloadCache ? S(f._devicesFromInputSettings(f._inputSettings)) : S(E);
|
|
8305
8305
|
});
|
|
@@ -8341,8 +8341,8 @@ var jd = function() {
|
|
|
8341
8341
|
var k = Date.now();
|
|
8342
8342
|
f._callObjectLoader.load(f.properties.dailyConfig, function(E) {
|
|
8343
8343
|
f._bundleLoadTime = E ? "no-op" : Date.now() - k, f._updateCallState(Wo), E && f.emitDailyJSEvent({ action: Go }), p();
|
|
8344
|
-
}, function(E,
|
|
8345
|
-
if (f.emitDailyJSEvent({ action: wu }), !
|
|
8344
|
+
}, function(E, A) {
|
|
8345
|
+
if (f.emitDailyJSEvent({ action: wu }), !A) {
|
|
8346
8346
|
f._updateCallState(mt), f.resetMeetingDependentVars();
|
|
8347
8347
|
var L = { action: es, errorMsg: E.msg, error: { type: "connection-error", msg: "Failed to load call object bundle.", details: { on: "load", sourceError: E, bundleUrl: Xn(f.properties.dailyConfig) } } };
|
|
8348
8348
|
f._maybeSendToSentry(L), f.emitDailyJSEvent(L), S(E.msg);
|
|
@@ -8381,17 +8381,17 @@ var jd = function() {
|
|
|
8381
8381
|
return f.showLocalVideo !== void 0 && (this._callObjectMode ? console.error("showLocalVideo is not available in callObject mode") : this._showLocalVideo = !!f.showLocalVideo), f.showParticipantsBar !== void 0 && (this._callObjectMode ? console.error("showParticipantsBar is not available in callObject mode") : this._showParticipantsBar = !!f.showParticipantsBar), this._callState === Lt || this._callState === ni ? (console.warn("already joined meeting, call leave() before joining again"), void this.updateIsPreparingToJoin(!1)) : (this._updateCallState(ni, !1), this.emitDailyJSEvent({ action: xu }), this._preloadCache.inputSettings = this._prepInputSettingsForSharing(this._inputSettings || {}, !1), this.sendMessageToCallMachine({ action: "join-meeting", properties: qt(this.properties, this.callClientId), preloadCache: qt(this._preloadCache, this.callClientId) }, function(k) {
|
|
8382
8382
|
k.error && l._joinedCallback && (l._joinedCallback(null, k.error), l._joinedCallback = null);
|
|
8383
8383
|
}), new Promise(function(k, E) {
|
|
8384
|
-
l._joinedCallback = function(
|
|
8384
|
+
l._joinedCallback = function(A, L) {
|
|
8385
8385
|
if (l._callState !== mt) {
|
|
8386
8386
|
if (L) return l._updateCallState(gt), void E(L);
|
|
8387
|
-
if (l._updateCallState(Lt),
|
|
8387
|
+
if (l._updateCallState(Lt), A) for (var I in A) {
|
|
8388
8388
|
if (l._callObjectMode) {
|
|
8389
8389
|
var K = l._callMachine().store;
|
|
8390
|
-
hs(
|
|
8390
|
+
hs(A[I], K), ps(A[I], K), fs(A[I], l._participants[I], K);
|
|
8391
8391
|
}
|
|
8392
|
-
l._participants[I] = F({},
|
|
8392
|
+
l._participants[I] = F({}, A[I]), l.toggleParticipantAudioBasedOnNativeAudioFocus();
|
|
8393
8393
|
}
|
|
8394
|
-
S && l.loadCss(l.properties), k(
|
|
8394
|
+
S && l.loadCss(l.properties), k(A);
|
|
8395
8395
|
} else E(L);
|
|
8396
8396
|
};
|
|
8397
8397
|
}));
|
|
@@ -8454,7 +8454,7 @@ var jd = function() {
|
|
|
8454
8454
|
for (var E in this._validateEncodingLayerHasValidProperties(k), k) if (Ir.includes(E)) {
|
|
8455
8455
|
if (typeof k[E] != "number") throw new Error("".concat(E, " must be a number"));
|
|
8456
8456
|
if (f) {
|
|
8457
|
-
var
|
|
8457
|
+
var A = f[E], L = A.min, I = A.max;
|
|
8458
8458
|
if (!Ps(k[E], L, I)) throw new Error("".concat(E, " value not in range. valid range: ").concat(L, " to ").concat(I));
|
|
8459
8459
|
}
|
|
8460
8460
|
} else if (!["active", "scalabilityMode"].includes(E)) throw new Error("Invalid key ".concat(E, ", valid keys are:") + Object.values(Ir));
|
|
@@ -8467,7 +8467,7 @@ var jd = function() {
|
|
|
8467
8467
|
(function(E) {
|
|
8468
8468
|
if (typeof E != "string") throw new Error('url parameter must be "string" type');
|
|
8469
8469
|
})(p), Ls(k), function(E) {
|
|
8470
|
-
for (var
|
|
8470
|
+
for (var A in E) if (!Ts.includes(A)) throw new Error("Invalid key ".concat(A, ", valid keys are: ").concat(Ts));
|
|
8471
8471
|
E.simulcastEncodings && this.validateSimulcastEncodings(E.simulcastEncodings, Ga, !0);
|
|
8472
8472
|
}(k);
|
|
8473
8473
|
} catch (E) {
|
|
@@ -8476,9 +8476,9 @@ var jd = function() {
|
|
|
8476
8476
|
settings?:
|
|
8477
8477
|
{state: "play"|"pause", simulcastEncodings?: [{}] } }`), E;
|
|
8478
8478
|
}
|
|
8479
|
-
return new Promise(function(E,
|
|
8479
|
+
return new Promise(function(E, A) {
|
|
8480
8480
|
f.sendMessageToCallMachine({ action: "daily-method-start-remote-media-player", url: p, settings: k }, function(L) {
|
|
8481
|
-
L.error ?
|
|
8481
|
+
L.error ? A({ error: L.error, errorMsg: L.errorMsg }) : E({ session_id: L.session_id, remoteMediaPlayerState: { state: L.state, settings: L.settings } });
|
|
8482
8482
|
});
|
|
8483
8483
|
});
|
|
8484
8484
|
}), function(l) {
|
|
@@ -8503,8 +8503,8 @@ var jd = function() {
|
|
|
8503
8503
|
{ settings?: {state: "play"|"pause"} }`), k;
|
|
8504
8504
|
}
|
|
8505
8505
|
return new Promise(function(k, E) {
|
|
8506
|
-
f.sendMessageToCallMachine({ action: "daily-method-update-remote-media-player", session_id: p, settings: S }, function(
|
|
8507
|
-
|
|
8506
|
+
f.sendMessageToCallMachine({ action: "daily-method-update-remote-media-player", session_id: p, settings: S }, function(A) {
|
|
8507
|
+
A.error ? E({ error: A.error, errorMsg: A.errorMsg }) : k({ session_id: A.session_id, remoteMediaPlayerState: { state: A.state, settings: A.settings } });
|
|
8508
8508
|
});
|
|
8509
8509
|
});
|
|
8510
8510
|
}), function(l) {
|
|
@@ -8523,11 +8523,11 @@ var jd = function() {
|
|
|
8523
8523
|
} }, { key: "startDialOut", value: (v = W(function* (l) {
|
|
8524
8524
|
var f = this;
|
|
8525
8525
|
fe(this._callState, "startDialOut()");
|
|
8526
|
-
var p = function(
|
|
8527
|
-
if (
|
|
8528
|
-
if (!Array.isArray(
|
|
8529
|
-
if (
|
|
8530
|
-
|
|
8526
|
+
var p = function(A) {
|
|
8527
|
+
if (A) {
|
|
8528
|
+
if (!Array.isArray(A)) throw new Error("Error starting dial out: audio codec must be an array");
|
|
8529
|
+
if (A.length <= 0) throw new Error("Error starting dial out: audio codec array specified but empty");
|
|
8530
|
+
A.forEach(function(L) {
|
|
8531
8531
|
if (typeof L != "string") throw new Error("Error starting dial out: audio codec must be a string");
|
|
8532
8532
|
if (L !== "OPUS" && L !== "PCMU" && L !== "PCMA" && L !== "G722") throw new Error("Error starting dial out: audio codec must be one of OPUS, PCMU, PCMA, G722");
|
|
8533
8533
|
});
|
|
@@ -8539,11 +8539,11 @@ var jd = function() {
|
|
|
8539
8539
|
if (typeof l.sipUri != "string") throw new Error("Error starting dial out: sipUri must be a string");
|
|
8540
8540
|
if (!l.sipUri.startsWith("sip:")) throw new Error("Error starting dial out: Invalid SIP URI, must start with 'sip:'");
|
|
8541
8541
|
if (l.video && typeof l.video != "boolean") throw new Error("Error starting dial out: video must be a boolean value");
|
|
8542
|
-
(function(
|
|
8543
|
-
if (
|
|
8544
|
-
if (!Array.isArray(
|
|
8545
|
-
if (
|
|
8546
|
-
|
|
8542
|
+
(function(A) {
|
|
8543
|
+
if (A && (p(A.audio), A.video)) {
|
|
8544
|
+
if (!Array.isArray(A.video)) throw new Error("Error starting dial out: video codec must be an array");
|
|
8545
|
+
if (A.video.length <= 0) throw new Error("Error starting dial out: video codec array specified but empty");
|
|
8546
|
+
A.video.forEach(function(L) {
|
|
8547
8547
|
if (typeof L != "string") throw new Error("Error starting dial out: video codec must be a string");
|
|
8548
8548
|
if (L !== "H264" && L !== "VP8") throw new Error("Error starting dial out: video codec must be H264 or VP8");
|
|
8549
8549
|
});
|
|
@@ -8576,9 +8576,9 @@ var jd = function() {
|
|
|
8576
8576
|
if (l.phoneNumber) throw new Error("Error starting dial out: provider valid only for sipUri, not phoneNumber");
|
|
8577
8577
|
console.warn("(pre-beta) provider=daily is currently in pre-beta, things might break!");
|
|
8578
8578
|
}
|
|
8579
|
-
return new Promise(function(
|
|
8579
|
+
return new Promise(function(A, L) {
|
|
8580
8580
|
f.sendMessageToCallMachine(F({ action: "dialout-start" }, l), function(I) {
|
|
8581
|
-
I.error ? L(I.error) :
|
|
8581
|
+
I.error ? L(I.error) : A(I);
|
|
8582
8582
|
});
|
|
8583
8583
|
});
|
|
8584
8584
|
}), function(l) {
|
|
@@ -8617,8 +8617,8 @@ var jd = function() {
|
|
|
8617
8617
|
if (!S || !k) throw new Error("sessionId and tones are mandatory parameter");
|
|
8618
8618
|
if (typeof S != "string" || typeof k != "string") throw new Error("sessionId and tones should be of string type");
|
|
8619
8619
|
if (k.length > 20) throw new Error("tones string must be upto 20 characters");
|
|
8620
|
-
var E = /[^0-9A-D*#]/g,
|
|
8621
|
-
if (
|
|
8620
|
+
var E = /[^0-9A-D*#]/g, A = k.match(E);
|
|
8621
|
+
if (A && A[0]) throw new Error("".concat(A[0], " is not valid DTMF tone"));
|
|
8622
8622
|
}(l), new Promise(function(p, S) {
|
|
8623
8623
|
f.sendMessageToCallMachine(F({ action: "send-dtmf" }, l), function(k) {
|
|
8624
8624
|
k.error ? S(k.error) : p(k);
|
|
@@ -8665,7 +8665,7 @@ var jd = function() {
|
|
|
8665
8665
|
}
|
|
8666
8666
|
return new Promise(function(k) {
|
|
8667
8667
|
l.sendMessageToCallMachine({ action: "test-call-quality", dailyJsVersion: l.properties.dailyJsVersion }, function(E) {
|
|
8668
|
-
var
|
|
8668
|
+
var A = E.results, L = A.result, I = $i(A, Bd);
|
|
8669
8669
|
if (L === "failed") {
|
|
8670
8670
|
var K, te = F({}, I);
|
|
8671
8671
|
(K = I.error) !== null && K !== void 0 && K.details ? (I.error.details = JSON.parse(I.error.details), te.error = F(F({}, te.error), {}, { details: F({}, te.error.details) }), te.error.details.duringTest = "testCallQuality") : (te.error = te.error ? F({}, te.error) : {}, te.error.details = { duringTest: "testCallQuality" }), l._maybeSendToSentry(te);
|
|
@@ -8694,8 +8694,8 @@ var jd = function() {
|
|
|
8694
8694
|
var p = l.videoTrack, S = l.duration;
|
|
8695
8695
|
if (!this._validateVideoTrackForNetworkTests(p)) throw new Error("Video track error");
|
|
8696
8696
|
return this._sharedTracks.videoTrackForConnectionQualityTest = p, new Promise(function(k, E) {
|
|
8697
|
-
f.sendMessageToCallMachine({ action: "test-p2p-call-quality", duration: S }, function(
|
|
8698
|
-
|
|
8697
|
+
f.sendMessageToCallMachine({ action: "test-p2p-call-quality", duration: S }, function(A) {
|
|
8698
|
+
A.error ? E(A.error) : k(A.results);
|
|
8699
8699
|
});
|
|
8700
8700
|
});
|
|
8701
8701
|
}), function(l) {
|
|
@@ -8946,10 +8946,10 @@ var jd = function() {
|
|
|
8946
8946
|
E.audio = ((S = l.inputSettings) === null || S === void 0 ? void 0 : S.audio) || {}, E.audio.settings = ((k = l.inputSettings) === null || k === void 0 || (k = k.audio) === null || k === void 0 ? void 0 : k.settings) || {}, E.audio.settings = F(F({}, E.audio.settings), l.dailyConfig.userMediaAudioConstraints), l.inputSettings = E, delete l.dailyConfig.userMediaAudioConstraints;
|
|
8947
8947
|
}
|
|
8948
8948
|
if (l != null && (p = l.dailyConfig) !== null && p !== void 0 && p.userMediaVideoConstraints) {
|
|
8949
|
-
var
|
|
8949
|
+
var A, L;
|
|
8950
8950
|
oe() || console.warn("userMediaVideoConstraints is deprecated. You can override constraints with inputSettings.video.settings, found in DailyCallOptions.");
|
|
8951
8951
|
var I = l.inputSettings || {};
|
|
8952
|
-
I.video = ((
|
|
8952
|
+
I.video = ((A = l.inputSettings) === null || A === void 0 ? void 0 : A.video) || {}, I.video.settings = ((L = l.inputSettings) === null || L === void 0 || (L = L.video) === null || L === void 0 ? void 0 : L.settings) || {}, I.video.settings = F(F({}, I.video.settings), l.dailyConfig.userMediaVideoConstraints), l.inputSettings = I, delete l.dailyConfig.userMediaVideoConstraints;
|
|
8953
8953
|
}
|
|
8954
8954
|
for (var K in l) if (At[K]) {
|
|
8955
8955
|
if (At[K].validate && !At[K].validate(l[K], this)) throw new Error("property '".concat(K, "': ").concat(At[K].help));
|
|
@@ -9008,8 +9008,8 @@ var jd = function() {
|
|
|
9008
9008
|
break;
|
|
9009
9009
|
case Mu:
|
|
9010
9010
|
if (l.participant && l.participant.session_id) {
|
|
9011
|
-
var
|
|
9012
|
-
|
|
9011
|
+
var A = this._participants[l.participant.session_id];
|
|
9012
|
+
A && this.maybeParticipantTracksStopped(A, null), delete this._participants[l.participant.session_id], this.emitDailyJSEvent(l);
|
|
9013
9013
|
}
|
|
9014
9014
|
break;
|
|
9015
9015
|
case Au:
|
|
@@ -9159,15 +9159,15 @@ var jd = function() {
|
|
|
9159
9159
|
} }, { key: "_trackChanged", value: function(l, f) {
|
|
9160
9160
|
return (l == null ? void 0 : l.id) !== (f == null ? void 0 : f.id);
|
|
9161
9161
|
} }, { key: "maybeEventTrackStopped", value: function(l, f, p) {
|
|
9162
|
-
var S, k, E = (S = f == null ? void 0 : f.tracks[l]) !== null && S !== void 0 ? S : null,
|
|
9162
|
+
var S, k, E = (S = f == null ? void 0 : f.tracks[l]) !== null && S !== void 0 ? S : null, A = (k = p == null ? void 0 : p.tracks[l]) !== null && k !== void 0 ? k : null, L = E == null ? void 0 : E.track;
|
|
9163
9163
|
if (L) {
|
|
9164
|
-
var I = this._trackStatePlayable(E), K = this._trackStatePlayable(
|
|
9164
|
+
var I = this._trackStatePlayable(E), K = this._trackStatePlayable(A), te = this._trackChanged(L, A == null ? void 0 : A.track);
|
|
9165
9165
|
I && (K && !te || this.emitDailyJSEvent({ action: Bu, track: L, participant: p ?? f, type: l }));
|
|
9166
9166
|
}
|
|
9167
9167
|
} }, { key: "maybeEventTrackStarted", value: function(l, f, p) {
|
|
9168
|
-
var S, k, E = (S = f == null ? void 0 : f.tracks[l]) !== null && S !== void 0 ? S : null,
|
|
9168
|
+
var S, k, E = (S = f == null ? void 0 : f.tracks[l]) !== null && S !== void 0 ? S : null, A = (k = p == null ? void 0 : p.tracks[l]) !== null && k !== void 0 ? k : null, L = A == null ? void 0 : A.track;
|
|
9169
9169
|
if (L) {
|
|
9170
|
-
var I = this._trackStatePlayable(E), K = this._trackStatePlayable(
|
|
9170
|
+
var I = this._trackStatePlayable(E), K = this._trackStatePlayable(A), te = this._trackChanged(E == null ? void 0 : E.track, L);
|
|
9171
9171
|
K && (I && !te || this.emitDailyJSEvent({ action: Nu, track: L, participant: p, type: l }));
|
|
9172
9172
|
}
|
|
9173
9173
|
} }, { key: "maybeParticipantTracksStopped", value: function(l, f) {
|
|
@@ -9196,8 +9196,8 @@ var jd = function() {
|
|
|
9196
9196
|
this._callState = l, this._isPreparingToJoin = f;
|
|
9197
9197
|
var k = this._callState === Lt;
|
|
9198
9198
|
this.updateShowAndroidOngoingMeetingNotification(k);
|
|
9199
|
-
var E = Yn(p, S),
|
|
9200
|
-
E !==
|
|
9199
|
+
var E = Yn(p, S), A = Yn(this._callState, this._isPreparingToJoin);
|
|
9200
|
+
E !== A && (this.updateKeepDeviceAwake(A), this.updateDeviceAudioMode(A), this.updateNoOpRecordingEnsuringBackgroundContinuity(A));
|
|
9201
9201
|
}
|
|
9202
9202
|
} }, { key: "resetMeetingDependentVars", value: function() {
|
|
9203
9203
|
this._participants = {}, this._participantCounts = Es, this._waitingParticipants = {}, this._activeSpeaker = {}, this._activeSpeakerMode = !1, this._didPreAuth = !1, this._accessState = { access: Tr }, this._finalSummaryOfPrevSession = this._meetingSessionSummary, this._meetingSessionSummary = {}, this._meetingSessionState = Br(Cs, this._callObjectMode), this._isScreenSharing = !1, this._receiveSettings = {}, this._inputSettings = void 0, this._sendSettings = {}, this._localAudioLevel = 0, this._isLocalAudioLevelObserverRunning = !1, this._remoteParticipantsAudioLevel = {}, this._isRemoteParticipantsAudioLevelObserverRunning = !1, this._maxAppMessageSize = Mr, this._callMachineInitialized = !1, this._bundleLoadTime = void 0, this._preloadCache;
|
|
@@ -9257,14 +9257,14 @@ var jd = function() {
|
|
|
9257
9257
|
} }, { key: "_maybeSendToSentry", value: function(l) {
|
|
9258
9258
|
var f, p, S, k;
|
|
9259
9259
|
if (!((f = l.error) !== null && f !== void 0 && f.type && (![gu, fu, Jo].includes(l.error.type) || l.error.type === Jo && l.error.msg.includes("deleted")))) {
|
|
9260
|
-
var E = (p = this.properties) !== null && p !== void 0 && p.url ? new URL(this.properties.url) : void 0,
|
|
9261
|
-
E && E.host.includes(".staging.daily") && (
|
|
9260
|
+
var E = (p = this.properties) !== null && p !== void 0 && p.url ? new URL(this.properties.url) : void 0, A = "production";
|
|
9261
|
+
E && E.host.includes(".staging.daily") && (A = "staging");
|
|
9262
9262
|
var L, I, K, te, Me, tt = function(cn) {
|
|
9263
9263
|
const ln = [Dl(), Al(), ru(), tu(), cu(), uu(), Rl(), lu()];
|
|
9264
9264
|
return cn.autoSessionTracking !== !1 && ln.push(au()), ln;
|
|
9265
9265
|
}({}).filter(function(cn) {
|
|
9266
9266
|
return !["BrowserApiErrors", "Breadcrumbs", "GlobalHandlers"].includes(cn.name);
|
|
9267
|
-
}), nt = new zl({ dsn: "https://f10f1c81e5d44a4098416c0867a8b740@o77906.ingest.sentry.io/168844", transport: Jl, stackParser: eu, integrations: tt, environment:
|
|
9267
|
+
}), nt = new zl({ dsn: "https://f10f1c81e5d44a4098416c0867a8b740@o77906.ingest.sentry.io/168844", transport: Jl, stackParser: eu, integrations: tt, environment: A }), be = new Ct();
|
|
9268
9268
|
if (be.setClient(nt), nt.init(), this.session_id && be.setExtra("sessionId", this.session_id), this.properties) {
|
|
9269
9269
|
var ee = F({}, this.properties);
|
|
9270
9270
|
ee.userName = ee.userName ? "[Filtered]" : void 0, ee.userData = ee.userData ? "[Filtered]" : void 0, ee.token = ee.token ? "[Filtered]" : void 0, be.setExtra("properties", ee);
|
|
@@ -9310,13 +9310,13 @@ var jd = function() {
|
|
|
9310
9310
|
var k = S.iframeStyle;
|
|
9311
9311
|
k || (k = p === document.body ? { position: "fixed", border: "1px solid black", backgroundColor: "white", width: "375px", height: "450px", right: "1em", bottom: "1em" } : { border: 0, width: "100%", height: "100%" });
|
|
9312
9312
|
var E = document.createElement("iframe");
|
|
9313
|
-
window.navigator && window.navigator.userAgent.match(/Chrome\/61\./) ? E.allow = "microphone, camera" : E.allow = "microphone; camera; autoplay; display-capture; screen-wake-lock", E.style.visibility = "hidden", p.appendChild(E), E.style.visibility = null, Object.keys(k).forEach(function(
|
|
9314
|
-
return E.style[
|
|
9313
|
+
window.navigator && window.navigator.userAgent.match(/Chrome\/61\./) ? E.allow = "microphone, camera" : E.allow = "microphone; camera; autoplay; display-capture; screen-wake-lock", E.style.visibility = "hidden", p.appendChild(E), E.style.visibility = null, Object.keys(k).forEach(function(A) {
|
|
9314
|
+
return E.style[A] = k[A];
|
|
9315
9315
|
}), S.layout || (S.customLayout ? S.layout = "custom-v1" : S.layout = "browser");
|
|
9316
9316
|
try {
|
|
9317
9317
|
return new r(E, S);
|
|
9318
|
-
} catch (
|
|
9319
|
-
throw p.removeChild(E),
|
|
9318
|
+
} catch (A) {
|
|
9319
|
+
throw p.removeChild(E), A;
|
|
9320
9320
|
}
|
|
9321
9321
|
} }, { key: "createTransparentFrame", value: function() {
|
|
9322
9322
|
var l = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
@@ -12679,9 +12679,9 @@ const Ot = (r) => ({
|
|
|
12679
12679
|
}, Ie = class Ie {
|
|
12680
12680
|
constructor() {
|
|
12681
12681
|
// Ref counters for generating unique IDs
|
|
12682
|
-
|
|
12682
|
+
M(this, "refCounters", {});
|
|
12683
12683
|
// Cache for last snapshot (for change detection)
|
|
12684
|
-
|
|
12684
|
+
M(this, "lastSnapshotHash", "");
|
|
12685
12685
|
}
|
|
12686
12686
|
// -------------------------------------------------------------------------
|
|
12687
12687
|
// Main Capture Method
|
|
@@ -13347,7 +13347,7 @@ const Ot = (r) => ({
|
|
|
13347
13347
|
// Static Configuration
|
|
13348
13348
|
// -------------------------------------------------------------------------
|
|
13349
13349
|
/** Implicit ARIA roles by HTML tag (W3C spec) */
|
|
13350
|
-
|
|
13350
|
+
M(Ie, "IMPLICIT_ROLES", {
|
|
13351
13351
|
button: "button",
|
|
13352
13352
|
a: "link",
|
|
13353
13353
|
input: "textbox",
|
|
@@ -13373,7 +13373,7 @@ A(Ie, "IMPLICIT_ROLES", {
|
|
|
13373
13373
|
progress: "progressbar",
|
|
13374
13374
|
meter: "meter"
|
|
13375
13375
|
}), /** Input type to role mapping */
|
|
13376
|
-
|
|
13376
|
+
M(Ie, "INPUT_TYPE_ROLES", {
|
|
13377
13377
|
button: "button",
|
|
13378
13378
|
submit: "button",
|
|
13379
13379
|
reset: "button",
|
|
@@ -13389,7 +13389,7 @@ A(Ie, "INPUT_TYPE_ROLES", {
|
|
|
13389
13389
|
text: "textbox",
|
|
13390
13390
|
number: "spinbutton"
|
|
13391
13391
|
}), /** Role prefixes for ref generation */
|
|
13392
|
-
|
|
13392
|
+
M(Ie, "ROLE_PREFIXES", {
|
|
13393
13393
|
button: "B",
|
|
13394
13394
|
link: "L",
|
|
13395
13395
|
textbox: "T",
|
|
@@ -13410,7 +13410,7 @@ A(Ie, "ROLE_PREFIXES", {
|
|
|
13410
13410
|
switch: "SW",
|
|
13411
13411
|
navigation: "NAV"
|
|
13412
13412
|
}), /** Interactive element selector */
|
|
13413
|
-
|
|
13413
|
+
M(Ie, "INTERACTIVE_SELECTOR", `
|
|
13414
13414
|
button,
|
|
13415
13415
|
a[href],
|
|
13416
13416
|
input:not([type="hidden"]),
|
|
@@ -13434,7 +13434,7 @@ A(Ie, "INTERACTIVE_SELECTOR", `
|
|
|
13434
13434
|
[contenteditable="true"],
|
|
13435
13435
|
summary
|
|
13436
13436
|
`.replace(/\s+/g, " ").trim()), /** Selectors to skip (our own UI, scripts, etc.) */
|
|
13437
|
-
|
|
13437
|
+
M(Ie, "SKIP_SELECTORS", [
|
|
13438
13438
|
"#onboarding-overlay",
|
|
13439
13439
|
"#onboarding-sdk-react-ui",
|
|
13440
13440
|
"#hse-highlight-element",
|
|
@@ -13578,17 +13578,17 @@ function dc(r, e = {}) {
|
|
|
13578
13578
|
}
|
|
13579
13579
|
class $s {
|
|
13580
13580
|
constructor() {
|
|
13581
|
-
|
|
13582
|
-
|
|
13583
|
-
|
|
13584
|
-
|
|
13585
|
-
|
|
13586
|
-
|
|
13587
|
-
|
|
13581
|
+
M(this, "audioContext", null);
|
|
13582
|
+
M(this, "analyzerNode", null);
|
|
13583
|
+
M(this, "sourceNode", null);
|
|
13584
|
+
M(this, "dataArray", new Uint8Array(0));
|
|
13585
|
+
M(this, "isRunning", !1);
|
|
13586
|
+
M(this, "onLevelsCallback", null);
|
|
13587
|
+
M(this, "animationId", null);
|
|
13588
13588
|
/**
|
|
13589
13589
|
* Analysis loop - runs via requestAnimationFrame
|
|
13590
13590
|
*/
|
|
13591
|
-
|
|
13591
|
+
M(this, "analyze", () => {
|
|
13592
13592
|
if (!this.isRunning || !this.analyzerNode || this.dataArray.length === 0) return;
|
|
13593
13593
|
this.analyzerNode.getByteFrequencyData(this.dataArray);
|
|
13594
13594
|
const e = [];
|
|
@@ -13624,7 +13624,7 @@ class $s {
|
|
|
13624
13624
|
}
|
|
13625
13625
|
class dh {
|
|
13626
13626
|
constructor() {
|
|
13627
|
-
|
|
13627
|
+
M(this, "events", {});
|
|
13628
13628
|
}
|
|
13629
13629
|
on(e, t) {
|
|
13630
13630
|
return this.events[e] || (this.events[e] = []), this.events[e].push(t), this;
|
|
@@ -13643,13 +13643,13 @@ class dh {
|
|
|
13643
13643
|
}
|
|
13644
13644
|
class hh {
|
|
13645
13645
|
constructor() {
|
|
13646
|
-
|
|
13647
|
-
|
|
13648
|
-
|
|
13649
|
-
|
|
13650
|
-
|
|
13646
|
+
M(this, "lastSnapshot", null);
|
|
13647
|
+
M(this, "lastSnapshotHash", "");
|
|
13648
|
+
M(this, "snapshotInterval", null);
|
|
13649
|
+
M(this, "sendCallback", null);
|
|
13650
|
+
M(this, "correlationCounter", 0);
|
|
13651
13651
|
// For tracking snapshots across client/server
|
|
13652
|
-
|
|
13652
|
+
M(this, "INTERACTIVE_TAGS", /* @__PURE__ */ new Set([
|
|
13653
13653
|
"button",
|
|
13654
13654
|
"a",
|
|
13655
13655
|
"input",
|
|
@@ -13661,7 +13661,7 @@ class hh {
|
|
|
13661
13661
|
"option",
|
|
13662
13662
|
"menuitem"
|
|
13663
13663
|
]));
|
|
13664
|
-
|
|
13664
|
+
M(this, "INTERACTIVE_ROLES", /* @__PURE__ */ new Set([
|
|
13665
13665
|
"button",
|
|
13666
13666
|
"link",
|
|
13667
13667
|
"menuitem",
|
|
@@ -13678,8 +13678,8 @@ class hh {
|
|
|
13678
13678
|
/**
|
|
13679
13679
|
* Setup mutation observer for significant DOM changes
|
|
13680
13680
|
*/
|
|
13681
|
-
|
|
13682
|
-
|
|
13681
|
+
M(this, "mutationObserver", null);
|
|
13682
|
+
M(this, "mutationDebounceTimer", null);
|
|
13683
13683
|
}
|
|
13684
13684
|
/**
|
|
13685
13685
|
* Start periodic DOM snapshots
|
|
@@ -15553,13 +15553,13 @@ const St = class St {
|
|
|
15553
15553
|
}
|
|
15554
15554
|
};
|
|
15555
15555
|
// Static reference to DOMIntrospector for bounding box lookups
|
|
15556
|
-
|
|
15556
|
+
M(St, "domIntrospector", null);
|
|
15557
15557
|
let ue = St;
|
|
15558
15558
|
class wh {
|
|
15559
15559
|
constructor() {
|
|
15560
|
-
|
|
15560
|
+
M(this, "confirmationSound");
|
|
15561
15561
|
/** Last error message from a failed action (e.g., modal overlay blocking click) */
|
|
15562
|
-
|
|
15562
|
+
M(this, "lastError", null);
|
|
15563
15563
|
this.confirmationSound = new Audio("data:audio/wav;base64,UklGRiQAAABXQVZFZm10IBAAAAABAAEARKwAAIhYAQACABAAZGF0YQAAAAA=");
|
|
15564
15564
|
}
|
|
15565
15565
|
/**
|
|
@@ -16244,11 +16244,11 @@ ${e.description || ""}`;
|
|
|
16244
16244
|
}
|
|
16245
16245
|
class Sh {
|
|
16246
16246
|
constructor() {
|
|
16247
|
-
|
|
16248
|
-
|
|
16249
|
-
|
|
16250
|
-
|
|
16251
|
-
|
|
16247
|
+
M(this, "container", null);
|
|
16248
|
+
M(this, "highlightEl", null);
|
|
16249
|
+
M(this, "tooltipElement", null);
|
|
16250
|
+
M(this, "floeCursor", null);
|
|
16251
|
+
M(this, "cursorHasBeenPositioned", !1);
|
|
16252
16252
|
}
|
|
16253
16253
|
// Track if cursor has been shown at least once
|
|
16254
16254
|
/**
|
|
@@ -16813,7 +16813,7 @@ class Sh {
|
|
|
16813
16813
|
}
|
|
16814
16814
|
class Pi {
|
|
16815
16815
|
constructor(e) {
|
|
16816
|
-
|
|
16816
|
+
M(this, "piiPatterns");
|
|
16817
16817
|
this.piiPatterns = {
|
|
16818
16818
|
email: /[\w.-]+@[\w.-]+\.\w+/,
|
|
16819
16819
|
phone: /[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,6}/,
|
|
@@ -16884,7 +16884,9 @@ class Pi {
|
|
|
16884
16884
|
* Get all text nodes in the document
|
|
16885
16885
|
*/
|
|
16886
16886
|
getAllTextNodes() {
|
|
16887
|
-
const e = []
|
|
16887
|
+
const e = [];
|
|
16888
|
+
if (!document.body) return e;
|
|
16889
|
+
const t = document.createTreeWalker(
|
|
16888
16890
|
document.body,
|
|
16889
16891
|
NodeFilter.SHOW_TEXT,
|
|
16890
16892
|
{
|
|
@@ -16967,7 +16969,11 @@ class Pi {
|
|
|
16967
16969
|
const u = window.innerWidth * n, d = window.innerHeight * n;
|
|
16968
16970
|
return a.width = u, a.height = d, new Promise((h, g) => {
|
|
16969
16971
|
const b = document.createElement("iframe");
|
|
16970
|
-
b.style.position = "fixed", b.style.top = "0", b.style.left = "0", b.style.width = "100%", b.style.height = "100%", b.style.border = "none", b.style.zIndex = "-999999", document.body
|
|
16972
|
+
if (b.style.position = "fixed", b.style.top = "0", b.style.left = "0", b.style.width = "100%", b.style.height = "100%", b.style.border = "none", b.style.zIndex = "-999999", !document.body) {
|
|
16973
|
+
console.warn("[ScreenCapture] Document body became null before iframe append"), this.safeCanvasToDataURL(a, o, i).then(h, g);
|
|
16974
|
+
return;
|
|
16975
|
+
}
|
|
16976
|
+
document.body.appendChild(b);
|
|
16971
16977
|
const y = b.contentDocument;
|
|
16972
16978
|
if (y.open(), y.write(document.documentElement.outerHTML), y.close(), Pi.sanitizeClonedDocument(y), t && s.length > 0) {
|
|
16973
16979
|
const v = y.createElement("style");
|
|
@@ -17030,22 +17036,22 @@ class Pi {
|
|
|
17030
17036
|
}
|
|
17031
17037
|
class kh {
|
|
17032
17038
|
constructor(e) {
|
|
17033
|
-
|
|
17034
|
-
|
|
17035
|
-
|
|
17036
|
-
|
|
17037
|
-
|
|
17038
|
-
|
|
17039
|
-
|
|
17040
|
-
|
|
17041
|
-
|
|
17042
|
-
|
|
17039
|
+
M(this, "sdk");
|
|
17040
|
+
M(this, "domIntrospector", null);
|
|
17041
|
+
M(this, "lastUrl", "");
|
|
17042
|
+
M(this, "clickHandler", null);
|
|
17043
|
+
M(this, "focusHandler", null);
|
|
17044
|
+
M(this, "blurHandler", null);
|
|
17045
|
+
M(this, "inputHandler", null);
|
|
17046
|
+
M(this, "keydownHandler", null);
|
|
17047
|
+
M(this, "inputDebounceTimers", /* @__PURE__ */ new Map());
|
|
17048
|
+
M(this, "isTracking", !1);
|
|
17043
17049
|
// Scroll tracking for Fast Execution System
|
|
17044
|
-
|
|
17045
|
-
|
|
17050
|
+
M(this, "scrollHandler", null);
|
|
17051
|
+
M(this, "scrollDebounceTimer", null);
|
|
17046
17052
|
// URL tracking for SPAs
|
|
17047
|
-
|
|
17048
|
-
|
|
17053
|
+
M(this, "urlCheckInterval", null);
|
|
17054
|
+
M(this, "popstateHandler", null);
|
|
17049
17055
|
this.sdk = e, this.lastUrl = window.location.href;
|
|
17050
17056
|
}
|
|
17051
17057
|
/**
|
|
@@ -17305,7 +17311,7 @@ class kh {
|
|
|
17305
17311
|
}
|
|
17306
17312
|
class hc {
|
|
17307
17313
|
constructor() {
|
|
17308
|
-
|
|
17314
|
+
M(this, "loadingSelectors", [
|
|
17309
17315
|
'[role="progressbar"]',
|
|
17310
17316
|
".loading",
|
|
17311
17317
|
".spinner",
|
|
@@ -17318,6 +17324,8 @@ class hc {
|
|
|
17318
17324
|
".MuiCircularProgress-root",
|
|
17319
17325
|
".MuiLinearProgress-root"
|
|
17320
17326
|
]);
|
|
17327
|
+
/** Track last detected selector to avoid flooding logs on every 50ms poll */
|
|
17328
|
+
M(this, "_lastLoggedSelector", null);
|
|
17321
17329
|
}
|
|
17322
17330
|
/**
|
|
17323
17331
|
* Check if page is currently showing loading indicators
|
|
@@ -17327,10 +17335,10 @@ class hc {
|
|
|
17327
17335
|
try {
|
|
17328
17336
|
const t = document.querySelector(e);
|
|
17329
17337
|
if (t && this.isVisible(t))
|
|
17330
|
-
return console.log("[LoadingDetector] Found loading indicator:", e), !0;
|
|
17338
|
+
return this._lastLoggedSelector !== e && (console.log("[LoadingDetector] Found loading indicator:", e), this._lastLoggedSelector = e), !0;
|
|
17331
17339
|
} catch {
|
|
17332
17340
|
}
|
|
17333
|
-
return !1;
|
|
17341
|
+
return this._lastLoggedSelector = null, !1;
|
|
17334
17342
|
}
|
|
17335
17343
|
/**
|
|
17336
17344
|
* Wait for loading indicators to disappear
|
|
@@ -17389,15 +17397,15 @@ class xh {
|
|
|
17389
17397
|
}
|
|
17390
17398
|
class _h {
|
|
17391
17399
|
constructor() {
|
|
17392
|
-
|
|
17393
|
-
|
|
17394
|
-
|
|
17395
|
-
|
|
17396
|
-
|
|
17397
|
-
|
|
17398
|
-
|
|
17399
|
-
|
|
17400
|
-
|
|
17400
|
+
M(this, "lastUrl", "");
|
|
17401
|
+
M(this, "urlChangeCallback", null);
|
|
17402
|
+
M(this, "loadingDetector");
|
|
17403
|
+
M(this, "domStabilityChecker");
|
|
17404
|
+
M(this, "originalPushState", null);
|
|
17405
|
+
M(this, "originalReplaceState", null);
|
|
17406
|
+
M(this, "popstateHandler", null);
|
|
17407
|
+
M(this, "isStarted", !1);
|
|
17408
|
+
M(this, "handleUrlChange", async () => {
|
|
17401
17409
|
const e = window.location.href;
|
|
17402
17410
|
if (e !== this.lastUrl) {
|
|
17403
17411
|
console.log("[NavigationCompleteDetector] URL changed:", e), this.lastUrl = e;
|
|
@@ -17446,10 +17454,10 @@ class _h {
|
|
|
17446
17454
|
}
|
|
17447
17455
|
class Ch {
|
|
17448
17456
|
constructor(e, t) {
|
|
17449
|
-
|
|
17450
|
-
|
|
17451
|
-
|
|
17452
|
-
|
|
17457
|
+
M(this, "overlay");
|
|
17458
|
+
M(this, "loadingDetector");
|
|
17459
|
+
M(this, "domIntrospector", null);
|
|
17460
|
+
M(this, "isExecuting", !1);
|
|
17453
17461
|
this.overlay = e, this.loadingDetector = new hc();
|
|
17454
17462
|
}
|
|
17455
17463
|
/**
|
|
@@ -17630,77 +17638,78 @@ class Ch {
|
|
|
17630
17638
|
return !1;
|
|
17631
17639
|
}
|
|
17632
17640
|
}
|
|
17641
|
+
const Eh = 50, Th = 3e4;
|
|
17633
17642
|
class pc extends dh {
|
|
17634
17643
|
constructor(t) {
|
|
17635
17644
|
super();
|
|
17636
|
-
|
|
17637
|
-
|
|
17638
|
-
|
|
17639
|
-
|
|
17640
|
-
|
|
17641
|
-
|
|
17642
|
-
|
|
17643
|
-
|
|
17644
|
-
|
|
17645
|
-
|
|
17646
|
-
|
|
17647
|
-
|
|
17645
|
+
M(this, "config");
|
|
17646
|
+
M(this, "sessionId");
|
|
17647
|
+
M(this, "overlay");
|
|
17648
|
+
M(this, "capture");
|
|
17649
|
+
M(this, "actionExecutor");
|
|
17650
|
+
M(this, "pipecatClient", null);
|
|
17651
|
+
M(this, "transport", null);
|
|
17652
|
+
M(this, "isInitialized", !1);
|
|
17653
|
+
M(this, "reactRoot", null);
|
|
17654
|
+
M(this, "reactContainer", null);
|
|
17655
|
+
M(this, "agentState", "idle");
|
|
17656
|
+
M(this, "pausedSessionId", null);
|
|
17648
17657
|
// UI state only - tracks which session is paused
|
|
17649
|
-
|
|
17658
|
+
M(this, "pendingResumeSessionId", null);
|
|
17650
17659
|
// Explicit resume intent - set only by resumeSession(), cleared after use
|
|
17651
|
-
|
|
17652
|
-
|
|
17653
|
-
|
|
17654
|
-
|
|
17660
|
+
M(this, "botTranscript", "");
|
|
17661
|
+
M(this, "userTranscript", "");
|
|
17662
|
+
M(this, "transcriptHistory", []);
|
|
17663
|
+
M(this, "lastUserTranscript", "");
|
|
17655
17664
|
// Track final user transcript for history
|
|
17656
|
-
|
|
17657
|
-
|
|
17665
|
+
M(this, "isConnected", !1);
|
|
17666
|
+
M(this, "connectInFlight", !1);
|
|
17658
17667
|
// Guard against concurrent connect/cancel races
|
|
17659
|
-
|
|
17668
|
+
M(this, "micEnabled", !0);
|
|
17660
17669
|
// Track actual mute state
|
|
17661
|
-
|
|
17670
|
+
M(this, "userIsSpeaking", !1);
|
|
17662
17671
|
// Track if user is actively speaking
|
|
17663
|
-
|
|
17672
|
+
M(this, "botIsSpeaking", !1);
|
|
17664
17673
|
// Track if bot is actively speaking
|
|
17665
|
-
|
|
17674
|
+
M(this, "audioLevels", []);
|
|
17666
17675
|
// Real-time audio levels for visualization
|
|
17667
|
-
|
|
17676
|
+
M(this, "_discoveryPopupShown", !1);
|
|
17668
17677
|
// Track if discovery popup was shown this session
|
|
17669
|
-
|
|
17678
|
+
M(this, "_pendingDiscoveryStart", !1);
|
|
17670
17679
|
// User chose discovery, waiting to start after connect
|
|
17671
|
-
|
|
17680
|
+
M(this, "botAudioAnalyzer", null);
|
|
17672
17681
|
// Audio analyzer for bot FFT
|
|
17673
|
-
|
|
17682
|
+
M(this, "userAudioAnalyzer", null);
|
|
17674
17683
|
// Audio analyzer for user mic FFT
|
|
17675
|
-
|
|
17684
|
+
M(this, "userMicStream", null);
|
|
17676
17685
|
// User's mic stream for analysis
|
|
17677
|
-
|
|
17686
|
+
M(this, "userMicStreamRequestId", 0);
|
|
17678
17687
|
// Guards async getUserMedia against disconnect races
|
|
17679
|
-
|
|
17680
|
-
|
|
17681
|
-
|
|
17682
|
-
|
|
17683
|
-
|
|
17688
|
+
M(this, "audioElements", []);
|
|
17689
|
+
M(this, "pageTracker");
|
|
17690
|
+
M(this, "screenShareEnabled", !1);
|
|
17691
|
+
M(this, "domIntrospector");
|
|
17692
|
+
M(this, "accessibleSnapshot");
|
|
17684
17693
|
// Fast Execution System
|
|
17685
|
-
|
|
17686
|
-
|
|
17687
|
-
|
|
17694
|
+
M(this, "fastExecutionMode", !1);
|
|
17695
|
+
M(this, "batchedActionExecutor", null);
|
|
17696
|
+
M(this, "navigationCompleteDetector", null);
|
|
17688
17697
|
// Bot Action Tracking - counter for nested/concurrent bot actions
|
|
17689
17698
|
// Use counter instead of boolean to handle nested actions correctly
|
|
17690
|
-
|
|
17699
|
+
M(this, "_botActionDepth", 0);
|
|
17691
17700
|
// EndUser status from API (for skip onboarding logic)
|
|
17692
|
-
|
|
17701
|
+
M(this, "endUserStatus", null);
|
|
17693
17702
|
// UX Polish - Connection progress and returning user tracking
|
|
17694
|
-
|
|
17695
|
-
|
|
17703
|
+
M(this, "connectionProgress", null);
|
|
17704
|
+
M(this, "isReturningUser", !1);
|
|
17696
17705
|
// True only for actual returning users (detected via API or localStorage)
|
|
17697
|
-
|
|
17706
|
+
M(this, "hasSkippedOnboarding", !1);
|
|
17698
17707
|
// True when new user skips the welcome modal
|
|
17699
|
-
|
|
17708
|
+
M(this, "_isMinimized", !1);
|
|
17700
17709
|
// Text mode state
|
|
17701
|
-
|
|
17710
|
+
M(this, "textModeEnabled", !1);
|
|
17702
17711
|
// Plan progress state (sent from bot during guided plan execution)
|
|
17703
|
-
|
|
17712
|
+
M(this, "planProgress", null);
|
|
17704
17713
|
if (!t.clientKey)
|
|
17705
17714
|
throw new Error("Client key is required");
|
|
17706
17715
|
const n = "https://api.dev.floe.so";
|
|
@@ -18096,7 +18105,9 @@ class pc extends dh {
|
|
|
18096
18105
|
}, 500));
|
|
18097
18106
|
},
|
|
18098
18107
|
onUserTranscript: (t) => {
|
|
18099
|
-
console.log("[OnboardingSDK] 🎤 User transcript:", t.text, t.final ? "(final)" : "(interim)"), t.text && (this.userTranscript = t.text), t.final && t.text && (this.lastUserTranscript = t.text), this.emit("userTranscript", t), this.handleUserInput(t.text)
|
|
18108
|
+
console.log("[OnboardingSDK] 🎤 User transcript:", t.text, t.final ? "(final)" : "(interim)"), t.text && (this.userTranscript = t.text), t.final && t.text && (this.lastUserTranscript = t.text), this.emit("userTranscript", t), this.handleUserInput(t.text).catch((n) => {
|
|
18109
|
+
console.warn("[OnboardingSDK] Context capture failed:", n == null ? void 0 : n.message);
|
|
18110
|
+
}), this.renderReactUI();
|
|
18100
18111
|
},
|
|
18101
18112
|
onBotTtsText: (t) => {
|
|
18102
18113
|
this.textModeEnabled || (console.log("[OnboardingSDK] 🤖 Bot TTS text:", t.text), t.text && (this.botTranscript && !this.botTranscript.endsWith(" ") && !t.text.startsWith(" ") && (this.botTranscript += " "), this.botTranscript += t.text, this.renderReactUI()));
|
|
@@ -18113,7 +18124,7 @@ class pc extends dh {
|
|
|
18113
18124
|
role: "assistant",
|
|
18114
18125
|
content: this.botTranscript,
|
|
18115
18126
|
timestamp: Date.now()
|
|
18116
|
-
}), console.log("[OnboardingSDK] 📝 Added assistant message to history (text mode):", this.botTranscript.substring(0, 50) + "...")), this.botTranscript = "", this.renderReactUI());
|
|
18127
|
+
}), this.pruneTranscriptHistory(), console.log("[OnboardingSDK] 📝 Added assistant message to history (text mode):", this.botTranscript.substring(0, 50) + "...")), this.botTranscript = "", this.renderReactUI());
|
|
18117
18128
|
},
|
|
18118
18129
|
onUserStartedSpeaking: () => {
|
|
18119
18130
|
console.log("[OnboardingSDK] 🎤 User started speaking"), this.agentState = "listening", this.userIsSpeaking = !0, this.renderReactUI(), this.emit("userSpeaking", !0);
|
|
@@ -18124,7 +18135,7 @@ class pc extends dh {
|
|
|
18124
18135
|
role: "user",
|
|
18125
18136
|
content: this.lastUserTranscript,
|
|
18126
18137
|
timestamp: Date.now()
|
|
18127
|
-
}), console.log("[OnboardingSDK] 📝 Added user message to history:", this.lastUserTranscript), this.lastUserTranscript = ""), this.userTranscript = "", this.renderReactUI(), this.emit("userSpeaking", !1);
|
|
18138
|
+
}), this.pruneTranscriptHistory(), console.log("[OnboardingSDK] 📝 Added user message to history:", this.lastUserTranscript), this.lastUserTranscript = ""), this.userTranscript = "", this.renderReactUI(), this.emit("userSpeaking", !1);
|
|
18128
18139
|
},
|
|
18129
18140
|
onBotStartedSpeaking: () => {
|
|
18130
18141
|
console.log("[OnboardingSDK] 🔊 Bot started speaking"), this.agentState = "speaking", this.botIsSpeaking = !0, this.userTranscript = "", this.botTranscript = "", this.renderReactUI(), this.emit("botSpeaking", !0);
|
|
@@ -18135,7 +18146,7 @@ class pc extends dh {
|
|
|
18135
18146
|
role: "assistant",
|
|
18136
18147
|
content: this.botTranscript,
|
|
18137
18148
|
timestamp: Date.now()
|
|
18138
|
-
}), console.log("[OnboardingSDK] 📝 Added assistant message to history:", this.botTranscript.substring(0, 50) + "...")), this.botTranscript = "", this.renderReactUI(), this.emit("botSpeaking", !1);
|
|
18149
|
+
}), this.pruneTranscriptHistory(), console.log("[OnboardingSDK] 📝 Added assistant message to history:", this.botTranscript.substring(0, 50) + "...")), this.botTranscript = "", this.renderReactUI(), this.emit("botSpeaking", !1);
|
|
18139
18150
|
},
|
|
18140
18151
|
onServerMessage: (t) => {
|
|
18141
18152
|
console.log("[OnboardingSDK] Server message:", t), this.handleServerMessage(t);
|
|
@@ -18224,6 +18235,24 @@ class pc extends dh {
|
|
|
18224
18235
|
* Handle server messages from bot (via Pipecat ServerMessage events)
|
|
18225
18236
|
* Supports both legacy selector-based commands and new hybrid target format
|
|
18226
18237
|
*
|
|
18238
|
+
/**
|
|
18239
|
+
* Prune transcript history to stay within the configured cap.
|
|
18240
|
+
* When the cap is reached:
|
|
18241
|
+
* 1. Merge rapid sequential same-role messages within MERGE_WINDOW_MS
|
|
18242
|
+
* 2. If still over cap, keep the most recent messages
|
|
18243
|
+
*/
|
|
18244
|
+
pruneTranscriptHistory() {
|
|
18245
|
+
const t = this.config.maxTranscriptMessages ?? Eh;
|
|
18246
|
+
if (this.transcriptHistory.length <= t)
|
|
18247
|
+
return;
|
|
18248
|
+
const n = [];
|
|
18249
|
+
for (let i = 0; i < this.transcriptHistory.length; i++) {
|
|
18250
|
+
const o = this.transcriptHistory[i], s = n[n.length - 1];
|
|
18251
|
+
s && s.role === o.role && o.timestamp - s.timestamp < Th ? (s.content = s.content + " " + o.content, s.timestamp = o.timestamp) : n.push({ ...o });
|
|
18252
|
+
}
|
|
18253
|
+
n.length > t ? this.transcriptHistory = n.slice(-t) : this.transcriptHistory = n;
|
|
18254
|
+
}
|
|
18255
|
+
/**
|
|
18227
18256
|
* Message formats supported:
|
|
18228
18257
|
* 1. RTVIServerMessageFrame: { data: { type: 'ui_action', action: '...', target: {...} } }
|
|
18229
18258
|
* 2. Direct ui_action: { type: 'ui_action', action: '...', target: {...} }
|
|
@@ -19647,7 +19676,7 @@ class pc extends dh {
|
|
|
19647
19676
|
role: "user",
|
|
19648
19677
|
content: t.trim(),
|
|
19649
19678
|
timestamp: Date.now()
|
|
19650
|
-
}), this.renderReactUI(), this.pipecatClient && this.isConnected && this.pipecatClient.sendClientMessage("text_message", {
|
|
19679
|
+
}), this.pruneTranscriptHistory(), this.renderReactUI(), this.pipecatClient && this.isConnected && this.pipecatClient.sendClientMessage("text_message", {
|
|
19651
19680
|
text: t.trim(),
|
|
19652
19681
|
audio_response: !this.textModeEnabled
|
|
19653
19682
|
// Voice response only if NOT in text mode
|
|
@@ -20040,7 +20069,7 @@ class pc extends dh {
|
|
|
20040
20069
|
}
|
|
20041
20070
|
}
|
|
20042
20071
|
typeof window < "u" && (window.OnboardingSDK = pc);
|
|
20043
|
-
function
|
|
20072
|
+
function Mh(r) {
|
|
20044
20073
|
return {
|
|
20045
20074
|
clientKey: r.clientKey,
|
|
20046
20075
|
// Only include apiUrl if explicitly provided - this allows the SDK constructor
|
|
@@ -20068,16 +20097,16 @@ function Eh(r) {
|
|
|
20068
20097
|
} : void 0
|
|
20069
20098
|
};
|
|
20070
20099
|
}
|
|
20071
|
-
function
|
|
20100
|
+
function Ah(r) {
|
|
20072
20101
|
if (!r.clientKey)
|
|
20073
20102
|
throw new Error("[Floe] clientKey is required");
|
|
20074
|
-
const e =
|
|
20103
|
+
const e = Mh(r), t = new pc(e);
|
|
20075
20104
|
return t.ready = t.init().catch((n) => {
|
|
20076
20105
|
throw console.error("[Floe] Initialization failed:", n), n;
|
|
20077
20106
|
}), t;
|
|
20078
20107
|
}
|
|
20079
|
-
typeof window < "u" && (window.Floe =
|
|
20108
|
+
typeof window < "u" && (window.Floe = Ah);
|
|
20080
20109
|
export {
|
|
20081
|
-
|
|
20110
|
+
Ah as Floe
|
|
20082
20111
|
};
|
|
20083
20112
|
//# sourceMappingURL=floe-sdk.es.js.map
|