@crh-fe/oava-customer-sdk 1.0.58 → 1.0.59

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,7 +1,7 @@
1
1
  /* eslint-disable */
2
2
  /*
3
- * Version: 1.0.58
4
- * Build Time: 2026/11/25 16:18:14
3
+ * Version: 1.0.59
4
+ * Build Time: 2026/11/26 15:07:18
5
5
  */
6
6
  var commonjsGlobal = 'undefined' != typeof globalThis ? globalThis : 'undefined' != typeof window ? window : 'undefined' != typeof global ? global : 'undefined' != typeof self ? self : {};
7
7
 
@@ -22031,6 +22031,355 @@ styleInject(css_248z);
22031
22031
 
22032
22032
  var kefu = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQMAAADACAYAAAAA2gZlAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAB5uSURBVHgB7Z3rctzGlcdPDymRFClSFMWLKMoiLZlxJOu2trOu3drE/rC1ldoPyRvYeQPnCWI/Qp4gzhOk8mUrqaTKymbXSVXstaS1tJJsibrGokxKJMU7h4PF6RlgGo1uDGYGA2Bm/j95PINGA2iA6D/OOX2BOD414ZCG4zi0urZOW1tbBADoDnq54qvs7u3RysoalUqlUOYjR47QpUuX6Cc/+Yn8PTs7SwCA/HH//n26du0aXblyha5evRprm151YXNzi9ZerocysQC8//779MEHH0gRAAC0DywMH3/8sRQG/m1DTE2OS9NgfWOD1tc3Ayu54v/iF7+gDz/8kAAA7Y0nCp988olxvRQDdg2eP18JrGBr4De/+Q1cAQA6DBaDn//85244IFjnxfixMef5ixXa39/3E1kIPv30U7gEAHQoHEd47733AoIgBgb6na2tbT+BLYEvv/wSQgBAh8OCcPnyZX+5p1gsfuQtsBCwRTA1NUUAgM6G6zk/9H//+9/LZeF+/LbFX/3qV7LFAADQPbC7wC0NvhiwVbCwsEAAgO6ChYAFoeAlcBMiAKD7ePfdd+XHtwxevHiBoCEA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IOFth7H4tz584G/2u7uLj1YWJDfKrOzs/TTn/6U3n//fbp06RIBAPINCwBXfO5DxC5BrQGJ/w+MiQFWh1rnOgAAAABJRU5ErkJggg==';
22033
22033
 
22034
+ function asrDebug(event, detail = {}) {
22035
+ console.log(`[ASR DEBUG] ${event}`, _objectSpread2({
22036
+ at: (new Date).toISOString()
22037
+ }, detail));
22038
+ }
22039
+
22040
+ function describeAsrUrl(value) {
22041
+ try {
22042
+ const url = new URL(value), signedAt = url.searchParams.get('date'), signedTime = Date.parse(signedAt);
22043
+ return {
22044
+ endpoint: `${url.origin}${url.pathname}`,
22045
+ queryKeys: [ ...url.searchParams.keys() ],
22046
+ signedHost: url.searchParams.get('host'),
22047
+ signedAt,
22048
+ signatureAgeSeconds: Number.isFinite(signedTime) ? Math.round((Date.now() - signedTime) / 1e3) : null,
22049
+ authorizationLength: (url.searchParams.get('authorization') || '').length
22050
+ };
22051
+ } catch (_) {
22052
+ return {
22053
+ validUrl: !1
22054
+ };
22055
+ }
22056
+ }
22057
+
22058
+ const isJsonString = str => {
22059
+ try {
22060
+ const toObj = JSON.parse(str);
22061
+ if (toObj && 'object' == typeof toObj) {
22062
+ return !0;
22063
+ }
22064
+ } catch (_unused) {
22065
+ return !1;
22066
+ }
22067
+ return !1;
22068
+ };
22069
+
22070
+ class Request {
22071
+ constructor() {}
22072
+ get(url, config) {
22073
+ const configs = config || {
22074
+ headers: {}
22075
+ };
22076
+ return new Promise(((resolve, reject) => {
22077
+ const xhr = new XMLHttpRequest;
22078
+ xhr.onload = response => {
22079
+ resolve({
22080
+ data: JSON.parse(xhr.responseText),
22081
+ status: xhr.status,
22082
+ statusText: xhr.statusText
22083
+ });
22084
+ }, xhr.open('get', url, !0);
22085
+ for (const key in configs.headers) {
22086
+ xhr.setRequestHeader(key, configs.headers[key]);
22087
+ }
22088
+ xhr.onerror = e => {
22089
+ reject(e);
22090
+ }, xhr.ontimeout = e => {
22091
+ reject(e);
22092
+ }, xhr.onabort = e => {}, xhr.send();
22093
+ }));
22094
+ }
22095
+ post(url, data, config, timeout) {
22096
+ const configs = config || {
22097
+ headers: {}
22098
+ };
22099
+ return new Promise(((resolve, reject) => {
22100
+ const xhr = new XMLHttpRequest;
22101
+ xhr.timeout = timeout || 6e4, xhr.onload = response => {
22102
+ 4 == xhr.readyState && '200' == xhr.status ? resolve({
22103
+ data: isJsonString(xhr.responseText) ? JSON.parse(xhr.responseText) : xhr.responseText,
22104
+ status: xhr.status,
22105
+ statusText: xhr.statusText
22106
+ }) : 4 == xhr.readyState && '200' !== xhr.status && reject({
22107
+ data: isJsonString(xhr.responseText) ? JSON.parse(xhr.responseText) : xhr.responseText,
22108
+ status: xhr.status,
22109
+ statusText: xhr.statusText
22110
+ });
22111
+ }, xhr.onreadystatechange = () => {
22112
+ xhr.readyState;
22113
+ }, xhr.open('post', url, !0);
22114
+ for (const key in configs.headers) {
22115
+ xhr.setRequestHeader(key, configs.headers[key]);
22116
+ }
22117
+ xhr.onerror = e => {
22118
+ reject(e);
22119
+ }, xhr.ontimeout = e => {
22120
+ reject(e);
22121
+ }, xhr.onabort = e => {
22122
+ reject(e);
22123
+ }, xhr.upload.onprogress = function(event) {}, xhr.send(isJsonString(data) ? JSON.stringify(data) : data);
22124
+ }));
22125
+ }
22126
+ delete(url, config) {
22127
+ const configs = config || {
22128
+ headers: {}
22129
+ };
22130
+ return new Promise(((resolve, reject) => {
22131
+ const xhr = new XMLHttpRequest;
22132
+ xhr.onload = response => {
22133
+ 4 == xhr.readyState && '200' == xhr.status ? resolve({
22134
+ data: isJsonString(xhr.responseText) ? JSON.parse(xhr.responseText) : xhr.responseText,
22135
+ status: xhr.status,
22136
+ statusText: xhr.statusText
22137
+ }) : 4 == xhr.readyState && '200' !== xhr.status && reject({
22138
+ data: isJsonString(xhr.responseText) ? JSON.parse(xhr.responseText) : xhr.responseText,
22139
+ status: xhr.status,
22140
+ statusText: xhr.statusText
22141
+ });
22142
+ }, xhr.open('delete', url, !0), xhr.onreadystatechange = () => {
22143
+ xhr.readyState;
22144
+ };
22145
+ for (const key in configs.headers) {
22146
+ xhr.setRequestHeader(key, configs.headers[key]);
22147
+ }
22148
+ xhr.onerror = e => {
22149
+ reject(e);
22150
+ }, xhr.ontimeout = e => {
22151
+ reject(e);
22152
+ }, xhr.onabort = e => {
22153
+ reject(e);
22154
+ }, xhr.send();
22155
+ }));
22156
+ }
22157
+ patch(url, data, config) {
22158
+ const configs = config || {
22159
+ headers: {}
22160
+ };
22161
+ return new Promise(((resolve, reject) => {
22162
+ const xhr = new XMLHttpRequest;
22163
+ xhr.onload = response => {
22164
+ 4 == xhr.readyState && '200' == xhr.status ? resolve({
22165
+ data: isJsonString(xhr.responseText) ? JSON.parse(xhr.responseText) : xhr.responseText,
22166
+ status: xhr.status,
22167
+ statusText: xhr.statusText
22168
+ }) : 4 == xhr.readyState && '200' !== xhr.status && reject({
22169
+ data: isJsonString(xhr.responseText) ? JSON.parse(xhr.responseText) : xhr.responseText,
22170
+ status: xhr.status,
22171
+ statusText: xhr.statusText
22172
+ });
22173
+ }, xhr.open('PATCH', url, !0), xhr.onreadystatechange = () => {
22174
+ xhr.readyState;
22175
+ };
22176
+ for (const key in configs.headers) {
22177
+ xhr.setRequestHeader(key, configs.headers[key]);
22178
+ }
22179
+ xhr.onerror = e => {
22180
+ reject(e);
22181
+ }, xhr.ontimeout = e => {
22182
+ reject(e);
22183
+ }, xhr.onabort = e => {
22184
+ reject(e);
22185
+ }, console.log('data', JSON.stringify(data)), xhr.send(JSON.stringify(data));
22186
+ }));
22187
+ }
22188
+ post2(url, data, config, timeout = 5e3) {
22189
+ const configs = config || {
22190
+ headers: {}
22191
+ };
22192
+ return console.log('configs', configs), new Promise(((resolve, reject) => {
22193
+ const xhr = new XMLHttpRequest;
22194
+ xhr.onload = response => {
22195
+ 4 == xhr.readyState && '200' == xhr.status ? resolve({
22196
+ data: isJsonString(xhr.responseText) ? JSON.parse(xhr.responseText) : xhr.responseText,
22197
+ status: xhr.status,
22198
+ statusText: xhr.statusText
22199
+ }) : 4 == xhr.readyState && '200' !== xhr.status && reject({
22200
+ data: isJsonString(xhr.responseText) ? JSON.parse(xhr.responseText) : xhr.responseText,
22201
+ status: xhr.status,
22202
+ statusText: xhr.statusText
22203
+ });
22204
+ }, xhr.open('POST', url, !0), xhr.onreadystatechange = () => {
22205
+ xhr.readyState;
22206
+ };
22207
+ for (const key in configs.headers) {
22208
+ xhr.setRequestHeader(key, configs.headers[key]);
22209
+ }
22210
+ xhr.onerror = e => {
22211
+ reject(e);
22212
+ }, xhr.ontimeout = e => {
22213
+ reject(e);
22214
+ }, xhr.onabort = e => {
22215
+ reject(e);
22216
+ }, xhr.timeout = timeout, xhr.send(JSON.stringify(data));
22217
+ }));
22218
+ }
22219
+ put(url, data, config) {
22220
+ const configs = config || {
22221
+ headers: {}
22222
+ };
22223
+ return new Promise(((resolve, reject) => {
22224
+ const xhr = new XMLHttpRequest;
22225
+ xhr.onload = response => {
22226
+ 4 == xhr.readyState && '200' == xhr.status ? resolve({
22227
+ data: isJsonString(xhr.responseText) ? JSON.parse(xhr.responseText) : xhr.responseText,
22228
+ status: xhr.status,
22229
+ statusText: xhr.statusText
22230
+ }) : 4 == xhr.readyState && '200' !== xhr.status && reject({
22231
+ data: isJsonString(xhr.responseText) ? JSON.parse(xhr.responseText) : xhr.responseText,
22232
+ status: xhr.status,
22233
+ statusText: xhr.statusText
22234
+ });
22235
+ }, xhr.open('PUT', url, !0), xhr.onreadystatechange = () => {
22236
+ xhr.readyState;
22237
+ };
22238
+ for (const key in configs.headers) {
22239
+ xhr.setRequestHeader(key, configs.headers[key]);
22240
+ }
22241
+ xhr.onerror = e => {
22242
+ reject(e);
22243
+ }, xhr.ontimeout = e => {
22244
+ reject(e);
22245
+ }, xhr.onabort = e => {
22246
+ reject(e);
22247
+ }, console.log('data', JSON.stringify(data)), xhr.send(JSON.stringify(data));
22248
+ }));
22249
+ }
22250
+ }
22251
+
22252
+ const XFYUN_IAT_BUSINESS = Object.freeze({
22253
+ language: 'zh_cn',
22254
+ domain: 'iat',
22255
+ ltc: 2,
22256
+ ptt: 0,
22257
+ pcm: 0,
22258
+ accent: 'mandarin',
22259
+ vad_eos: 5e3,
22260
+ dwa: 'wpgs'
22261
+ });
22262
+
22263
+ function getRealtimeAsrDuration(seconds) {
22264
+ const value = Number(seconds);
22265
+ return !Number.isFinite(value) || value <= 0 ? 5 : Math.max(1, Math.round(1e3 * Math.min(value, 10))) / 1e3;
22266
+ }
22267
+
22268
+ function getAsrConfig(config, requireLicenseCode = !1) {
22269
+ if (null == config) {
22270
+ return {
22271
+ type: 0
22272
+ };
22273
+ }
22274
+ if ('object' != typeof config || Array.isArray(config)) {
22275
+ throw new Error('asrConfig 必须是配置对象');
22276
+ }
22277
+ if (0 !== config.type && 1 !== config.type) {
22278
+ throw new Error('asrConfig.type 必须为 0(离线)或 1(实时)');
22279
+ }
22280
+ if (1 === config.type && requireLicenseCode) {
22281
+ if ('string' != typeof config.licenseCode || !config.licenseCode.trim()) {
22282
+ throw new Error('asrConfig.licenseCode 不能为空');
22283
+ }
22284
+ return {
22285
+ type: 1,
22286
+ licenseCode: config.licenseCode.trim()
22287
+ };
22288
+ }
22289
+ return {
22290
+ type: config.type
22291
+ };
22292
+ }
22293
+
22294
+ function normalizeRealtimeAsrCredentials(config) {
22295
+ const wsUrl = 'string' == typeof (null == config ? void 0 : config.ws_url) ? config.ws_url.trim() : '', appId = 'string' == typeof (null == config ? void 0 : config.token) ? config.token.trim() : '';
22296
+ let validUrl = !1;
22297
+ try {
22298
+ const url = new URL(wsUrl);
22299
+ validUrl = [ 'wss:', 'ws:' ].includes(url.protocol) && Boolean(url.hostname);
22300
+ } catch (_) {}
22301
+ if (!validUrl) {
22302
+ throw new Error('实时 ASR 接口返回的 ws_url 必须是完整 WebSocket 地址');
22303
+ }
22304
+ if (!appId) {
22305
+ throw new Error('实时 ASR 接口返回的 token 不能为空');
22306
+ }
22307
+ return {
22308
+ wsUrl,
22309
+ appId
22310
+ };
22311
+ }
22312
+
22313
+ function getRealtimeAsrBusiness(_config, seconds) {
22314
+ return _objectSpread2(_objectSpread2({}, XFYUN_IAT_BUSINESS), {}, {
22315
+ vad_eos: 1e3 * getRealtimeAsrDuration(seconds)
22316
+ });
22317
+ }
22318
+
22319
+ function redactRealtimeAsrOptions(options) {
22320
+ return null != options && options.asrConfig ? _objectSpread2(_objectSpread2({}, options), {}, {
22321
+ asrConfig: _objectSpread2(_objectSpread2({}, options.asrConfig), null != options.asrConfig.licenseCode ? {
22322
+ licenseCode: '[redacted]'
22323
+ } : {})
22324
+ }) : options;
22325
+ }
22326
+
22327
+ function queryRealtimeAsrConfig(_x, _x2) {
22328
+ return _queryRealtimeAsrConfig.apply(this, arguments);
22329
+ }
22330
+
22331
+ function _queryRealtimeAsrConfig() {
22332
+ return (_queryRealtimeAsrConfig = _asyncToGenerator((function*(aiServerUrl, asrConfig) {
22333
+ var _response$data$data, _response$data;
22334
+ const config = getAsrConfig(asrConfig, !0);
22335
+ if (0 === config.type) {
22336
+ return null;
22337
+ }
22338
+ if ('string' != typeof aiServerUrl || !aiServerUrl.trim()) {
22339
+ throw new Error('实时 ASR 需要配置 aiServerUrl');
22340
+ }
22341
+ const url = `${aiServerUrl.trim().replace(/\/+$/, '')}/witness/queryRealAsrConfig`;
22342
+ let response;
22343
+ asrDebug('config.request', {
22344
+ url,
22345
+ method: 'POST',
22346
+ hasBody: !1,
22347
+ hasLicenseCode: Boolean(config.licenseCode)
22348
+ });
22349
+ try {
22350
+ response = yield (new Request).post(url, null, {
22351
+ headers: {
22352
+ 'license-code': config.licenseCode
22353
+ }
22354
+ }, 5e3);
22355
+ } catch (error) {
22356
+ throw asrDebug('config.request.failed', {
22357
+ status: null == error ? void 0 : error.status,
22358
+ errorType: (null == error ? void 0 : error.name) || (null == error ? void 0 : error.type) || 'request-error'
22359
+ }), error;
22360
+ }
22361
+ const body = null !== (_response$data$data = null === (_response$data = response.data) || void 0 === _response$data ? void 0 : _response$data.data) && void 0 !== _response$data$data ? _response$data$data : response.data;
22362
+ asrDebug('config.response', {
22363
+ status: response.status,
22364
+ responseKeys: Object.keys(response.data || {}),
22365
+ credentialKeys: Object.keys(body || {}),
22366
+ token: null == body ? void 0 : body.token,
22367
+ url: describeAsrUrl(null == body ? void 0 : body.ws_url)
22368
+ });
22369
+ try {
22370
+ const credentials = normalizeRealtimeAsrCredentials(body);
22371
+ return asrDebug('config.ready', {
22372
+ appId: credentials.appId,
22373
+ url: describeAsrUrl(credentials.wsUrl)
22374
+ }), credentials;
22375
+ } catch (error) {
22376
+ throw asrDebug('config.invalid', {
22377
+ message: error.message
22378
+ }), error;
22379
+ }
22380
+ }))).apply(this, arguments);
22381
+ }
22382
+
22034
22383
  class Pcm16Encoder {
22035
22384
  constructor(inputRate, outputRate = 16e3) {
22036
22385
  if (!(inputRate > 0 && outputRate > 0)) {
@@ -22135,72 +22484,7 @@ class Transcript {
22135
22484
  }
22136
22485
  }
22137
22486
 
22138
- const pcmWorkletSource = '\nclass PcmCaptureProcessor extends AudioWorkletProcessor {\n constructor() {\n super();\n this.pending = [];\n this.size = 0;\n this.active = true;\n this.port.onmessage = ({ data }) => {\n if (data === \'stop\') {\n this.active = false;\n this.flush();\n this.port.postMessage({ type: \'stopped\' });\n }\n };\n }\n flush() {\n if (!this.size) return;\n const samples = new Float32Array(this.size);\n let offset = 0;\n for (const chunk of this.pending) { samples.set(chunk, offset); offset += chunk.length; }\n this.pending = [];\n this.size = 0;\n this.port.postMessage({ type: \'samples\', samples }, [samples.buffer]);\n }\n process(inputs) {\n const channels = inputs[0];\n if (this.active && channels && channels.length && channels[0].length) {\n const mono = new Float32Array(channels[0].length);\n for (const channel of channels) {\n for (let i = 0; i < mono.length; i++) mono[i] += channel[i] / channels.length;\n }\n this.pending.push(mono);\n this.size += mono.length;\n if (this.size >= 1024) this.flush();\n }\n return true;\n }\n}\nregisterProcessor(\'sdk-iat-pcm-capture\', PcmCaptureProcessor);\n', XFYUN_IAT_BUSINESS = Object.freeze({
22139
- language: 'zh_cn',
22140
- domain: 'iat',
22141
- ltc: 2,
22142
- ptt: 0,
22143
- pcm: 0,
22144
- accent: 'mandarin',
22145
- vad_eos: 5e3,
22146
- dwa: 'wpgs'
22147
- });
22148
-
22149
- function getRealtimeAsrDuration(seconds) {
22150
- const value = Number(seconds);
22151
- return !Number.isFinite(value) || value <= 0 ? 5 : Math.max(1, Math.round(1e3 * Math.min(value, 10))) / 1e3;
22152
- }
22153
-
22154
- function getRealtimeAsrConfig(config) {
22155
- if (null == config || !1 === config) {
22156
- return null;
22157
- }
22158
- if ('object' != typeof config || Array.isArray(config)) {
22159
- throw new Error('realtimeAsrConfig 必须是配置对象');
22160
- }
22161
- const type = String(config.type || '').toLowerCase();
22162
- if ('xfyun' !== type) {
22163
- throw new Error('realtimeAsrConfig.type 目前仅支持 xfyun');
22164
- }
22165
- const wsUrl = String(config.ws_url || config.wsUrl || '').trim(), appId = String(config.token || config.appId || '').trim();
22166
- let validUrl = !1;
22167
- try {
22168
- const url = new URL(wsUrl);
22169
- validUrl = [ 'wss:', 'ws:' ].includes(url.protocol) && Boolean(url.hostname);
22170
- } catch (_) {}
22171
- if (!validUrl) {
22172
- throw new Error('realtimeAsrConfig.ws_url 必须是完整 WebSocket 地址');
22173
- }
22174
- if (!appId) {
22175
- throw new Error('realtimeAsrConfig.token 必须填写讯飞 APPID');
22176
- }
22177
- return {
22178
- type,
22179
- wsUrl,
22180
- appId
22181
- };
22182
- }
22183
-
22184
- function getRealtimeAsrBusiness(_config, seconds) {
22185
- return _objectSpread2(_objectSpread2({}, XFYUN_IAT_BUSINESS), {}, {
22186
- vad_eos: 1e3 * getRealtimeAsrDuration(seconds)
22187
- });
22188
- }
22189
-
22190
- function redactRealtimeAsrOptions(options) {
22191
- return null != options && options.realtimeAsrConfig ? _objectSpread2(_objectSpread2({}, options), {}, {
22192
- realtimeAsrConfig: _objectSpread2(_objectSpread2(_objectSpread2({}, options.realtimeAsrConfig), {}, {
22193
- ws_url: '[redacted]',
22194
- token: '[redacted]'
22195
- }, options.realtimeAsrConfig.wsUrl ? {
22196
- wsUrl: '[redacted]'
22197
- } : {}), options.realtimeAsrConfig.appId ? {
22198
- appId: '[redacted]'
22199
- } : {})
22200
- }) : options;
22201
- }
22202
-
22203
- const FRAME_BYTES = 1280, MAX_QUEUE_BYTES = 16e4, aborted = () => Object.assign(new Error('已取消语音识别'), {
22487
+ const pcmWorkletSource = '\nclass PcmCaptureProcessor extends AudioWorkletProcessor {\n constructor() {\n super();\n this.pending = [];\n this.size = 0;\n this.active = true;\n this.port.onmessage = ({ data }) => {\n if (data === \'stop\') {\n this.active = false;\n this.flush();\n this.port.postMessage({ type: \'stopped\' });\n }\n };\n }\n flush() {\n if (!this.size) return;\n const samples = new Float32Array(this.size);\n let offset = 0;\n for (const chunk of this.pending) { samples.set(chunk, offset); offset += chunk.length; }\n this.pending = [];\n this.size = 0;\n this.port.postMessage({ type: \'samples\', samples }, [samples.buffer]);\n }\n process(inputs) {\n const channels = inputs[0];\n if (this.active && channels && channels.length && channels[0].length) {\n const mono = new Float32Array(channels[0].length);\n for (const channel of channels) {\n for (let i = 0; i < mono.length; i++) mono[i] += channel[i] / channels.length;\n }\n this.pending.push(mono);\n this.size += mono.length;\n if (this.size >= 1024) this.flush();\n }\n return true;\n }\n}\nregisterProcessor(\'sdk-iat-pcm-capture\', PcmCaptureProcessor);\n', FRAME_BYTES = 1280, MAX_QUEUE_BYTES = 16e4, aborted = () => Object.assign(new Error('已取消语音识别'), {
22204
22488
  name: 'AbortError'
22205
22489
  });
22206
22490
 
@@ -22246,7 +22530,9 @@ class RealtimeAsrClient extends EventTargetBase {
22246
22530
  }), this.dispatchEvent(event);
22247
22531
  }
22248
22532
  _state(state) {
22249
- this.state = state, this._emit('statechange', {
22533
+ this.state = state, asrDebug('client.state', {
22534
+ state
22535
+ }), this._emit('statechange', {
22250
22536
  state
22251
22537
  });
22252
22538
  }
@@ -22321,9 +22607,20 @@ class RealtimeAsrClient extends EventTargetBase {
22321
22607
  }
22322
22608
  return session.onTrackEnded = () => _this._fail(session, new Error('麦克风音轨已断开')),
22323
22609
  tracks.forEach((track => track.addEventListener('ended', session.onTrackEnded))),
22324
- session.encoder = new Pcm16Encoder(session.context.sampleRate), yield _this._prepareCapture(session),
22325
- _this._check(session), yield _this._connect(session, url.href, _this.appId.trim()),
22326
- _this._check(session), session.capturing = !0, session.source = session.context.createMediaStreamSource(session.stream),
22610
+ asrDebug('audio.ready', {
22611
+ contextState: session.context.state,
22612
+ sampleRate: session.context.sampleRate,
22613
+ trackCount: tracks.length,
22614
+ tracks: tracks.map((track => ({
22615
+ readyState: track.readyState,
22616
+ enabled: track.enabled,
22617
+ muted: track.muted
22618
+ })))
22619
+ }), session.encoder = new Pcm16Encoder(session.context.sampleRate), yield _this._prepareCapture(session),
22620
+ _this._check(session), asrDebug('audio.capture.prepared', {
22621
+ processor: session.worklet ? 'AudioWorklet' : 'ScriptProcessor'
22622
+ }), yield _this._connect(session, url.href, _this.appId.trim()), _this._check(session),
22623
+ session.capturing = !0, session.source = session.context.createMediaStreamSource(session.stream),
22327
22624
  session.silentGain = session.context.createGain(), session.silentGain.gain.value = 0,
22328
22625
  session.source.connect(session.processor), session.processor.connect(session.silentGain),
22329
22626
  session.silentGain.connect(session.context.destination), session.context.onstatechange = () => {
@@ -22396,6 +22693,11 @@ class RealtimeAsrClient extends EventTargetBase {
22396
22693
  const error = new Error('ASR WebSocket 连接超时');
22397
22694
  settle(error), this._fail(session, error);
22398
22695
  }), 1e4);
22696
+ let opened = !1;
22697
+ asrDebug('ws.connect', {
22698
+ appId,
22699
+ url: describeAsrUrl(url)
22700
+ });
22399
22701
  try {
22400
22702
  socket = new globalThis.WebSocket(url);
22401
22703
  } catch (_unused2) {
@@ -22403,8 +22705,12 @@ class RealtimeAsrClient extends EventTargetBase {
22403
22705
  }
22404
22706
  session.socket = socket, socket.onopen = () => {
22405
22707
  if (session.active) {
22708
+ opened = !0, asrDebug('ws.open', {
22709
+ readyState: socket.readyState,
22710
+ protocol: socket.protocol
22711
+ });
22406
22712
  try {
22407
- socket.send(JSON.stringify({
22713
+ const firstFrame = {
22408
22714
  common: {
22409
22715
  app_id: appId
22410
22716
  },
@@ -22415,7 +22721,13 @@ class RealtimeAsrClient extends EventTargetBase {
22415
22721
  encoding: 'raw',
22416
22722
  audio: ''
22417
22723
  }
22418
- })), settle();
22724
+ };
22725
+ asrDebug('ws.first-frame.sending', {
22726
+ frame: firstFrame
22727
+ }), socket.send(JSON.stringify(firstFrame)), asrDebug('ws.first-frame.sent', {
22728
+ appId,
22729
+ readyState: socket.readyState
22730
+ }), settle();
22419
22731
  } catch (_unused3) {
22420
22732
  settle(new Error('ASR 参数帧发送失败'));
22421
22733
  }
@@ -22425,7 +22737,9 @@ class RealtimeAsrClient extends EventTargetBase {
22425
22737
  try {
22426
22738
  var _message$data, _message$data2;
22427
22739
  const message = JSON.parse(event.data);
22428
- if (message.sid && (session.sid = message.sid), null != message.code && '0' !== String(message.code)) {
22740
+ if (asrDebug('ws.message', {
22741
+ message
22742
+ }), message.sid && (session.sid = message.sid), null != message.code && '0' !== String(message.code)) {
22429
22743
  const error = Object.assign(new Error(message.message || message.desc || 'ASR 服务返回错误'), {
22430
22744
  code: message.code,
22431
22745
  sid: message.sid
@@ -22441,12 +22755,32 @@ class RealtimeAsrClient extends EventTargetBase {
22441
22755
  }
22442
22756
  }
22443
22757
  }, socket.onerror = () => {
22444
- const error = new Error('ASR WebSocket 连接异常,请检查签名、网络和服务授权');
22758
+ let message = opened ? 'ASR WebSocket 传输异常,连接已建立后发生网络错误' : 'ASR WebSocket 握手失败,浏览器未提供 HTTP 状态;请查看 Network/WS 握手响应,检查签名、网络和服务授权';
22759
+ if (!opened) {
22760
+ const signedAt = Date.parse(new URL(url).searchParams.get('date'));
22761
+ if (Number.isFinite(signedAt)) {
22762
+ message += `;签名时间与本机时间相差 ${Math.round(Math.abs(Date.now() - signedAt) / 1e3)} 秒,请核对服务端时间及签名有效期`;
22763
+ }
22764
+ }
22765
+ asrDebug('ws.error', {
22766
+ opened,
22767
+ readyState: socket.readyState,
22768
+ message,
22769
+ url: describeAsrUrl(url)
22770
+ });
22771
+ const error = new Error(message);
22445
22772
  settle(error), this._fail(session, error);
22446
22773
  }, socket.onclose = event => {
22447
22774
  if (!session.active) {
22448
22775
  return;
22449
22776
  }
22777
+ asrDebug('ws.close', {
22778
+ code: event.code,
22779
+ wasClean: event.wasClean,
22780
+ opened,
22781
+ sentFrames: session.sentFrames,
22782
+ sentBytes: session.sentBytes
22783
+ });
22450
22784
  const error = new Error(`ASR WebSocket 已断开,未收到最终结果(${event.code})`);
22451
22785
  settle(error), this._finish(session, 'closed', error);
22452
22786
  };
@@ -22474,7 +22808,10 @@ class RealtimeAsrClient extends EventTargetBase {
22474
22808
  encoding: 'raw',
22475
22809
  audio: toBase64(bytes)
22476
22810
  }
22477
- })), session.sentFrames++, session.sentBytes += bytes.length;
22811
+ })), session.sentFrames++, session.sentBytes += bytes.length, 1 === session.sentFrames && asrDebug('audio.first-frame.sent', {
22812
+ status: 1,
22813
+ bytes: bytes.length
22814
+ });
22478
22815
  } else {
22479
22816
  session.draining && (socket.send(JSON.stringify({
22480
22817
  data: {
@@ -22483,7 +22820,11 @@ class RealtimeAsrClient extends EventTargetBase {
22483
22820
  encoding: 'raw',
22484
22821
  audio: ''
22485
22822
  }
22486
- })), session.endSent = !0, clearInterval(session.sendTimer), session.finalTimer = setTimeout((() => this._fail(session, new Error('等待 ASR 最终结果超时'))), 1e4));
22823
+ })), asrDebug('audio.end-frame.sent', {
22824
+ status: 2,
22825
+ sentFrames: session.sentFrames,
22826
+ sentBytes: session.sentBytes
22827
+ }), session.endSent = !0, clearInterval(session.sendTimer), session.finalTimer = setTimeout((() => this._fail(session, new Error('等待 ASR 最终结果超时'))), 1e4));
22487
22828
  }
22488
22829
  } catch (_unused5) {
22489
22830
  this._fail(session, new Error('ASR 音频发送失败'));
@@ -22568,7 +22909,12 @@ class RealtimeAsrClient extends EventTargetBase {
22568
22909
  sid: error.sid || session.sid
22569
22910
  };
22570
22911
  }
22571
- return session.endDetail = detail, this._lastEnd = detail, this._state(error ? 'error' : 'idle'),
22912
+ return asrDebug('client.end', {
22913
+ reason,
22914
+ error: detail.error,
22915
+ sentFrames: session.sentFrames,
22916
+ sentBytes: session.sentBytes
22917
+ }), session.endDetail = detail, this._lastEnd = detail, this._state(error ? 'error' : 'idle'),
22572
22918
  detail.error && this._emit('error', detail.error), this._emit('end', detail), null === (_session$resolveStop = session.resolveStop) || void 0 === _session$resolveStop || _session$resolveStop.call(session, detail),
22573
22919
  detail;
22574
22920
  }
@@ -22580,200 +22926,6 @@ class RealtimeAsrClient extends EventTargetBase {
22580
22926
  }
22581
22927
  }
22582
22928
 
22583
- const isJsonString = str => {
22584
- try {
22585
- const toObj = JSON.parse(str);
22586
- if (toObj && 'object' == typeof toObj) {
22587
- return !0;
22588
- }
22589
- } catch (_unused) {
22590
- return !1;
22591
- }
22592
- return !1;
22593
- };
22594
-
22595
- class Request {
22596
- constructor() {}
22597
- get(url, config) {
22598
- const configs = config || {
22599
- headers: {}
22600
- };
22601
- return new Promise(((resolve, reject) => {
22602
- const xhr = new XMLHttpRequest;
22603
- xhr.onload = response => {
22604
- resolve({
22605
- data: JSON.parse(xhr.responseText),
22606
- status: xhr.status,
22607
- statusText: xhr.statusText
22608
- });
22609
- }, xhr.open('get', url, !0);
22610
- for (const key in configs.headers) {
22611
- xhr.setRequestHeader(key, configs.headers[key]);
22612
- }
22613
- xhr.onerror = e => {
22614
- reject(e);
22615
- }, xhr.ontimeout = e => {
22616
- reject(e);
22617
- }, xhr.onabort = e => {}, xhr.send();
22618
- }));
22619
- }
22620
- post(url, data, config, timeout) {
22621
- const configs = config || {
22622
- headers: {}
22623
- };
22624
- return new Promise(((resolve, reject) => {
22625
- const xhr = new XMLHttpRequest;
22626
- xhr.timeout = timeout || 6e4, xhr.onload = response => {
22627
- 4 == xhr.readyState && '200' == xhr.status ? resolve({
22628
- data: isJsonString(xhr.responseText) ? JSON.parse(xhr.responseText) : xhr.responseText,
22629
- status: xhr.status,
22630
- statusText: xhr.statusText
22631
- }) : 4 == xhr.readyState && '200' !== xhr.status && reject({
22632
- data: isJsonString(xhr.responseText) ? JSON.parse(xhr.responseText) : xhr.responseText,
22633
- status: xhr.status,
22634
- statusText: xhr.statusText
22635
- });
22636
- }, xhr.onreadystatechange = () => {
22637
- xhr.readyState;
22638
- }, xhr.open('post', url, !0);
22639
- for (const key in configs.headers) {
22640
- xhr.setRequestHeader(key, configs.headers[key]);
22641
- }
22642
- xhr.onerror = e => {
22643
- reject(e);
22644
- }, xhr.ontimeout = e => {
22645
- reject(e);
22646
- }, xhr.onabort = e => {
22647
- reject(e);
22648
- }, xhr.upload.onprogress = function(event) {}, xhr.send(isJsonString(data) ? JSON.stringify(data) : data);
22649
- }));
22650
- }
22651
- delete(url, config) {
22652
- const configs = config || {
22653
- headers: {}
22654
- };
22655
- return new Promise(((resolve, reject) => {
22656
- const xhr = new XMLHttpRequest;
22657
- xhr.onload = response => {
22658
- 4 == xhr.readyState && '200' == xhr.status ? resolve({
22659
- data: isJsonString(xhr.responseText) ? JSON.parse(xhr.responseText) : xhr.responseText,
22660
- status: xhr.status,
22661
- statusText: xhr.statusText
22662
- }) : 4 == xhr.readyState && '200' !== xhr.status && reject({
22663
- data: isJsonString(xhr.responseText) ? JSON.parse(xhr.responseText) : xhr.responseText,
22664
- status: xhr.status,
22665
- statusText: xhr.statusText
22666
- });
22667
- }, xhr.open('delete', url, !0), xhr.onreadystatechange = () => {
22668
- xhr.readyState;
22669
- };
22670
- for (const key in configs.headers) {
22671
- xhr.setRequestHeader(key, configs.headers[key]);
22672
- }
22673
- xhr.onerror = e => {
22674
- reject(e);
22675
- }, xhr.ontimeout = e => {
22676
- reject(e);
22677
- }, xhr.onabort = e => {
22678
- reject(e);
22679
- }, xhr.send();
22680
- }));
22681
- }
22682
- patch(url, data, config) {
22683
- const configs = config || {
22684
- headers: {}
22685
- };
22686
- return new Promise(((resolve, reject) => {
22687
- const xhr = new XMLHttpRequest;
22688
- xhr.onload = response => {
22689
- 4 == xhr.readyState && '200' == xhr.status ? resolve({
22690
- data: isJsonString(xhr.responseText) ? JSON.parse(xhr.responseText) : xhr.responseText,
22691
- status: xhr.status,
22692
- statusText: xhr.statusText
22693
- }) : 4 == xhr.readyState && '200' !== xhr.status && reject({
22694
- data: isJsonString(xhr.responseText) ? JSON.parse(xhr.responseText) : xhr.responseText,
22695
- status: xhr.status,
22696
- statusText: xhr.statusText
22697
- });
22698
- }, xhr.open('PATCH', url, !0), xhr.onreadystatechange = () => {
22699
- xhr.readyState;
22700
- };
22701
- for (const key in configs.headers) {
22702
- xhr.setRequestHeader(key, configs.headers[key]);
22703
- }
22704
- xhr.onerror = e => {
22705
- reject(e);
22706
- }, xhr.ontimeout = e => {
22707
- reject(e);
22708
- }, xhr.onabort = e => {
22709
- reject(e);
22710
- }, console.log('data', JSON.stringify(data)), xhr.send(JSON.stringify(data));
22711
- }));
22712
- }
22713
- post2(url, data, config, timeout = 5e3) {
22714
- const configs = config || {
22715
- headers: {}
22716
- };
22717
- return console.log('configs', configs), new Promise(((resolve, reject) => {
22718
- const xhr = new XMLHttpRequest;
22719
- xhr.onload = response => {
22720
- 4 == xhr.readyState && '200' == xhr.status ? resolve({
22721
- data: isJsonString(xhr.responseText) ? JSON.parse(xhr.responseText) : xhr.responseText,
22722
- status: xhr.status,
22723
- statusText: xhr.statusText
22724
- }) : 4 == xhr.readyState && '200' !== xhr.status && reject({
22725
- data: isJsonString(xhr.responseText) ? JSON.parse(xhr.responseText) : xhr.responseText,
22726
- status: xhr.status,
22727
- statusText: xhr.statusText
22728
- });
22729
- }, xhr.open('POST', url, !0), xhr.onreadystatechange = () => {
22730
- xhr.readyState;
22731
- };
22732
- for (const key in configs.headers) {
22733
- xhr.setRequestHeader(key, configs.headers[key]);
22734
- }
22735
- xhr.onerror = e => {
22736
- reject(e);
22737
- }, xhr.ontimeout = e => {
22738
- reject(e);
22739
- }, xhr.onabort = e => {
22740
- reject(e);
22741
- }, xhr.timeout = timeout, xhr.send(JSON.stringify(data));
22742
- }));
22743
- }
22744
- put(url, data, config) {
22745
- const configs = config || {
22746
- headers: {}
22747
- };
22748
- return new Promise(((resolve, reject) => {
22749
- const xhr = new XMLHttpRequest;
22750
- xhr.onload = response => {
22751
- 4 == xhr.readyState && '200' == xhr.status ? resolve({
22752
- data: isJsonString(xhr.responseText) ? JSON.parse(xhr.responseText) : xhr.responseText,
22753
- status: xhr.status,
22754
- statusText: xhr.statusText
22755
- }) : 4 == xhr.readyState && '200' !== xhr.status && reject({
22756
- data: isJsonString(xhr.responseText) ? JSON.parse(xhr.responseText) : xhr.responseText,
22757
- status: xhr.status,
22758
- statusText: xhr.statusText
22759
- });
22760
- }, xhr.open('PUT', url, !0), xhr.onreadystatechange = () => {
22761
- xhr.readyState;
22762
- };
22763
- for (const key in configs.headers) {
22764
- xhr.setRequestHeader(key, configs.headers[key]);
22765
- }
22766
- xhr.onerror = e => {
22767
- reject(e);
22768
- }, xhr.ontimeout = e => {
22769
- reject(e);
22770
- }, xhr.onabort = e => {
22771
- reject(e);
22772
- }, console.log('data', JSON.stringify(data)), xhr.send(JSON.stringify(data));
22773
- }));
22774
- }
22775
- }
22776
-
22777
22929
  const faceCheckRequest = (url, faceBase64, userFaceBase64) => new Promise(function() {
22778
22930
  var _ref = _asyncToGenerator((function*(resolve, reject) {
22779
22931
  let r = new Request;
@@ -22830,7 +22982,7 @@ const faceCheckRequest = (url, faceBase64, userFaceBase64) => new Promise(functi
22830
22982
  };
22831
22983
  }());
22832
22984
 
22833
- var name = '@crh-fe/oava-customer-sdk', version = '1.0.58', description = 'Customer JS SDK package for oava-widget', type = 'module', main = './dist/customerComponent.js', files = [ 'dist', 'README.md' ], publishConfig = {
22985
+ var name = '@crh-fe/oava-customer-sdk', version = '1.0.59', description = 'Customer JS SDK package for oava-widget', type = 'module', main = './dist/customerComponent.js', files = [ 'dist', 'README.md' ], publishConfig = {
22834
22986
  access: 'public'
22835
22987
  }, pkg = {
22836
22988
  name,
@@ -53220,7 +53372,7 @@ var CpeProductsCicSDK_umdExports = CpeProductsCicSDK_umd.exports, CpeProductsCic
53220
53372
  const FACE_CHECK_TRANSFER_REASON = 'face-check-transfer', CUSTOMER_FACE_CHECK_TRANSFER_CODE = '402', SUBTITLE_REVIEW = '正在审核您的开户资料,请稍等…', ASR_MATCH_STABLE_MS = 1e3, ASR_MATCH_SILENCE_MS = 800, ASR_SPEECH_LEVEL = .015;
53221
53373
 
53222
53374
  function IndexWidget({customer, options}) {
53223
- const {roomToken, aiServerUrl, faceCheckTimer, userFaceBase64, maxWaitTime = 180, authorization, apiUrl, logServiceUrl, request_no, isBrowserEnv = !0, showBackButton = !1, recordAnswerOnly = !1, realtimeAsrConfig} = options, [asrWaitTimes, setAsrWaitTimes] = reactExports.useState(5), [subtitle, setSubtitle] = reactExports.useState(''), [textMessage, setTextMessage] = reactExports.useState(''), reviewTextMessageRef = reactExports.useRef(''), [playingList, setPlayingList] = reactExports.useState([]), [readyCount, setReadyCount] = reactExports.useState(0), [asrText, setAsrText] = reactExports.useState(''), asrResultTimerRef = reactExports.useRef(null), asrCountdownTimerRef = reactExports.useRef(null), realtimeAsrRoundRef = reactExports.useRef(null), seenRealtimeAsrRoundsRef = reactExports.useRef(new Set), isAwaitingAnswerRef = reactExports.useRef(!1), isAnsweringRef = reactExports.useRef(!1), isCustomerAudioMutedRef = reactExports.useRef(!1), audioOperationRef = reactExports.useRef(Promise.resolve()), isUnmountedRef = reactExports.useRef(!1), sessionEndingRef = reactExports.useRef(!1), answerFailureShownRef = reactExports.useRef(!1), recordFailureTimerRef = reactExports.useRef(null), [recordFailureType, setRecordFailureType] = reactExports.useState('face'), [noFaceCount, setNoFaceCount] = reactExports.useState(0), [isNoFace, setIsNoFace] = reactExports.useState(!1), [hasCompareResultFailed, setHasCompareResultFailed] = reactExports.useState(!1), [playingIndexs, setPlayingIndexs] = reactExports.useState([]), playingIndexsRef = reactExports.useRef(playingIndexs), [aiAgentStreamId, setAiAgentStreamId] = reactExports.useState(''), [customerStreamId, setCustomerStreamId] = reactExports.useState(''), [customerImage, setCustomerImage] = reactExports.useState(''), [isSend, setIsSend] = reactExports.useState(!1), [isSubscribeAgent, setIsSubscribeAgent] = reactExports.useState(!1), [showAgentInfo, setShowAgentInfo] = reactExports.useState(!1), [agentInfo, setAgentInfo] = reactExports.useState(''), aiAgentStreamIdRef = reactExports.useRef(aiAgentStreamId), silentAgentStreamIdRef = reactExports.useRef(null), playingListRef = reactExports.useRef(playingList), asrWaitTimesRef = reactExports.useRef(asrWaitTimes), customerImageRef = reactExports.useRef(customerImage), joinRoomTimes = reactExports.useRef(0), publishStreamTimes = reactExports.useRef(0), createStreamTimes = reactExports.useRef(0), subscribeStreamTimes = reactExports.useRef(0), [isReady, setIsReady] = reactExports.useState(!1), [isTransferring, setIsTransferring] = reactExports.useState(!1), [h5ExtraData, setH5ExtraData] = reactExports.useState(''), [isRecording, setIsRecording] = reactExports.useState(!1), [recordId, setRecordId] = reactExports.useState(''), recordIdRef = reactExports.useRef(recordId), isRecordingRef = reactExports.useRef(isRecording), recordFaceCheckFailCountRef = reactExports.useRef(0), recordFaceCheckFailReportedRef = reactExports.useRef(!1), recordFaceCheckFailThresholdRef = reactExports.useRef(0), [isCustomerVideoReady, setIsCustomerVideoReady] = reactExports.useState(!1), [showExitDialog, setShowExitDialog] = reactExports.useState(!1), [showPlayTip, setShowPlayTip] = reactExports.useState(!1), [playTipTarget, setPlayTipTarget] = reactExports.useState(''), [showAudioCallToast, setShowAudioCallToast] = reactExports.useState(!1), [isSilentAgentAudioMode, setIsSilentAgentAudioMode] = reactExports.useState(!1), isSilentAgentAudioModeRef = reactExports.useRef(isSilentAgentAudioMode), [showWaitView, setShowWaitView] = reactExports.useState(!1), [isHumanSilentAgent, setIsHumanSilentAgent] = reactExports.useState(!1);
53375
+ const {roomToken, aiServerUrl, faceCheckTimer, userFaceBase64, maxWaitTime = 180, authorization, apiUrl, logServiceUrl, request_no, isBrowserEnv = !0, showBackButton = !1, recordAnswerOnly = !1, asrConfig} = options, realtimeAsrCredentialsRef = reactExports.useRef(null), realtimeAsrConfigRecordIdRef = reactExports.useRef(null), [asrWaitTimes, setAsrWaitTimes] = reactExports.useState(5), [subtitle, setSubtitle] = reactExports.useState(''), [textMessage, setTextMessage] = reactExports.useState(''), reviewTextMessageRef = reactExports.useRef(''), [playingList, setPlayingList] = reactExports.useState([]), [readyCount, setReadyCount] = reactExports.useState(0), [asrText, setAsrText] = reactExports.useState(''), asrResultTimerRef = reactExports.useRef(null), asrCountdownTimerRef = reactExports.useRef(null), realtimeAsrRoundRef = reactExports.useRef(null), seenRealtimeAsrRoundsRef = reactExports.useRef(new Set), isAwaitingAnswerRef = reactExports.useRef(!1), isAnsweringRef = reactExports.useRef(!1), isCustomerAudioMutedRef = reactExports.useRef(!1), audioOperationRef = reactExports.useRef(Promise.resolve()), isUnmountedRef = reactExports.useRef(!1), sessionEndingRef = reactExports.useRef(!1), answerFailureShownRef = reactExports.useRef(!1), recordFailureTimerRef = reactExports.useRef(null), [recordFailureType, setRecordFailureType] = reactExports.useState('face'), [noFaceCount, setNoFaceCount] = reactExports.useState(0), [isNoFace, setIsNoFace] = reactExports.useState(!1), [hasCompareResultFailed, setHasCompareResultFailed] = reactExports.useState(!1), [playingIndexs, setPlayingIndexs] = reactExports.useState([]), playingIndexsRef = reactExports.useRef(playingIndexs), [aiAgentStreamId, setAiAgentStreamId] = reactExports.useState(''), [customerStreamId, setCustomerStreamId] = reactExports.useState(''), [customerImage, setCustomerImage] = reactExports.useState(''), [isSend, setIsSend] = reactExports.useState(!1), [isSubscribeAgent, setIsSubscribeAgent] = reactExports.useState(!1), [showAgentInfo, setShowAgentInfo] = reactExports.useState(!1), [agentInfo, setAgentInfo] = reactExports.useState(''), aiAgentStreamIdRef = reactExports.useRef(aiAgentStreamId), silentAgentStreamIdRef = reactExports.useRef(null), playingListRef = reactExports.useRef(playingList), asrWaitTimesRef = reactExports.useRef(asrWaitTimes), customerImageRef = reactExports.useRef(customerImage), joinRoomTimes = reactExports.useRef(0), publishStreamTimes = reactExports.useRef(0), createStreamTimes = reactExports.useRef(0), subscribeStreamTimes = reactExports.useRef(0), [isReady, setIsReady] = reactExports.useState(!1), [isTransferring, setIsTransferring] = reactExports.useState(!1), [h5ExtraData, setH5ExtraData] = reactExports.useState(''), [isRecording, setIsRecording] = reactExports.useState(!1), [recordId, setRecordId] = reactExports.useState(''), recordIdRef = reactExports.useRef(recordId), isRecordingRef = reactExports.useRef(isRecording), recordFaceCheckFailCountRef = reactExports.useRef(0), recordFaceCheckFailReportedRef = reactExports.useRef(!1), recordFaceCheckFailThresholdRef = reactExports.useRef(0), [isCustomerVideoReady, setIsCustomerVideoReady] = reactExports.useState(!1), [showExitDialog, setShowExitDialog] = reactExports.useState(!1), [showPlayTip, setShowPlayTip] = reactExports.useState(!1), [playTipTarget, setPlayTipTarget] = reactExports.useState(''), [showAudioCallToast, setShowAudioCallToast] = reactExports.useState(!1), [isSilentAgentAudioMode, setIsSilentAgentAudioMode] = reactExports.useState(!1), isSilentAgentAudioModeRef = reactExports.useRef(isSilentAgentAudioMode), [showWaitView, setShowWaitView] = reactExports.useState(!1), [isHumanSilentAgent, setIsHumanSilentAgent] = reactExports.useState(!1);
53224
53376
  reactExports.useRef(isHumanSilentAgent);
53225
53377
  const [frameRateThreshold, setFrameRateThreshold] = reactExports.useState(null), [maxFrameRateCheckCount, setMaxFrameRateCheckCount] = reactExports.useState(3), maxFrameRateCheckCountRef = reactExports.useRef(maxFrameRateCheckCount), frameRateThresholdRef = reactExports.useRef(frameRateThreshold), [frameRateCheckCount, setFrameRateCheckCount] = reactExports.useState(0), frameRateCheckCountRef = reactExports.useRef(frameRateCheckCount), [showErrorToast, setShowErrorToast] = reactExports.useState(!1), [showRecordFaceCheckFailToast, setShowRecordFaceCheckFailToast] = reactExports.useState(!1), isCallConnected = Boolean(aiAgentStreamId && isReady), frameRateAlertReportedRef = reactExports.useRef(!1), reportLog = createBusinessTraceReporter({
53226
53378
  logServiceUrl,
@@ -53341,7 +53493,15 @@ function IndexWidget({customer, options}) {
53341
53493
  round.matchTimer = null, isCurrentRealtimeRound(round) && !round.stopping && (null == round.lastAudioAt || Date.now() - round.lastAudioAt > 250 || 3 !== matchAnswerResult(round.text.replace(/[,,]/g, ''), round.correctAnswer, round.errorAnswer) && (Date.now() - round.textChangedAt >= ASR_MATCH_STABLE_MS && Date.now() - round.lastSpeechAt >= ASR_MATCH_SILENCE_MS ? stopRealtimeAsr(round, 'matched') : scheduleRealtimeAsrMatch(round)));
53342
53494
  }), delay);
53343
53495
  }, startRealtimeAsr = (data, view) => {
53344
- const duration = getRealtimeAsrDuration(data.durationSeconds || asrWaitTimesRef.current), round = {
53496
+ const duration = getRealtimeAsrDuration(data.durationSeconds || asrWaitTimesRef.current);
53497
+ asrDebug('round.start', {
53498
+ roundId: data.roundId,
53499
+ questionKey: data.questionKey,
53500
+ duration,
53501
+ recordId: realtimeAsrConfigRecordIdRef.current,
53502
+ hasConfigPromise: Boolean(realtimeAsrCredentialsRef.current)
53503
+ });
53504
+ const round = {
53345
53505
  roundId: data.roundId,
53346
53506
  questionKey: data.questionKey,
53347
53507
  correctAnswer: 'string' == typeof data.correctAnswer ? data.correctAnswer : void 0,
@@ -53360,8 +53520,8 @@ function IndexWidget({customer, options}) {
53360
53520
  realtimeAsrRoundRef.current = round;
53361
53521
  try {
53362
53522
  var _customer$localStream;
53363
- if (config = getRealtimeAsrConfig(realtimeAsrConfig), !config) {
53364
- throw new Error('坐席已启用实时识别,但客户端未配置 realtimeAsrConfig');
53523
+ if (config = getAsrConfig(asrConfig, !0), 1 !== config.type) {
53524
+ throw new Error('坐席已启用实时识别,但客户端 asrConfig.type 未设为 1');
53365
53525
  }
53366
53526
  if (!data.roundId || null == data.questionKey || '' === data.questionKey) {
53367
53527
  throw new Error('实时识别消息缺少 roundId 或 questionKey');
@@ -53372,16 +53532,31 @@ function IndexWidget({customer, options}) {
53372
53532
  }
53373
53533
  setShowWaitView(!0), renderCir(duration, view, (() => stopRealtimeAsr(round, 'timeout')), round.deadlineAt),
53374
53534
  round.deadlineTimer = setTimeout((() => stopRealtimeAsr(round, 'timeout')), 1e3 * duration),
53375
- Promise.resolve(updateAnswerAudio(!0)).then((() => {
53535
+ Promise.resolve(updateAnswerAudio(!0)).then(_asyncToGenerator((function*() {
53536
+ if (!isCurrentRealtimeRound(round)) {
53537
+ return;
53538
+ }
53539
+ const result = yield realtimeAsrCredentialsRef.current;
53376
53540
  if (!isCurrentRealtimeRound(round)) {
53377
53541
  return;
53378
53542
  }
53543
+ if (null != result && result.error) {
53544
+ throw result.error;
53545
+ }
53546
+ const credentials = null == result ? void 0 : result.credentials;
53547
+ if (asrDebug('round.config', {
53548
+ roundId: round.roundId,
53549
+ appId: null == credentials ? void 0 : credentials.appId,
53550
+ remainingMs: round.deadlineAt - Date.now()
53551
+ }), !credentials) {
53552
+ throw new Error('尚未收到开始录制通知,未获取实时 ASR 配置');
53553
+ }
53379
53554
  if (Date.now() >= round.deadlineAt) {
53380
53555
  return void stopRealtimeAsr(round, 'timeout');
53381
53556
  }
53382
53557
  const client = new RealtimeAsrClient({
53383
- wsUrl: config.wsUrl,
53384
- appId: config.appId,
53558
+ wsUrl: credentials.wsUrl,
53559
+ appId: credentials.appId,
53385
53560
  mediaStream: stream,
53386
53561
  business: getRealtimeAsrBusiness(config, duration)
53387
53562
  });
@@ -53415,7 +53590,7 @@ function IndexWidget({customer, options}) {
53415
53590
  })(round, detail))), Promise.resolve(client.start()).catch((error => completeRealtimeAsr(round, {
53416
53591
  error
53417
53592
  })));
53418
- })).catch((error => completeRealtimeAsr(round, {
53593
+ }))).catch((error => completeRealtimeAsr(round, {
53419
53594
  error
53420
53595
  })));
53421
53596
  } catch (error) {
@@ -53438,7 +53613,7 @@ function IndexWidget({customer, options}) {
53438
53613
  syncRecordingAudio();
53439
53614
  }), [ isRecording ]);
53440
53615
  const subscribeRemoteStream = function() {
53441
- var _ref2 = _asyncToGenerator((function*(streamId, streamLabel) {
53616
+ var _ref3 = _asyncToGenerator((function*(streamId, streamLabel) {
53442
53617
  const startTime = Date.now();
53443
53618
  try {
53444
53619
  return yield customer.subscribeStream(streamId), subscribeStreamTimes.current = Date.now() - startTime,
@@ -53458,10 +53633,10 @@ function IndexWidget({customer, options}) {
53458
53633
  }
53459
53634
  }));
53460
53635
  return function(_x, _x2) {
53461
- return _ref2.apply(this, arguments);
53636
+ return _ref3.apply(this, arguments);
53462
53637
  };
53463
53638
  }(), joinRoom = function() {
53464
- var _ref3 = _asyncToGenerator((function*() {
53639
+ var _ref4 = _asyncToGenerator((function*() {
53465
53640
  console.log('joinRoom');
53466
53641
  try {
53467
53642
  listen();
@@ -53489,11 +53664,11 @@ function IndexWidget({customer, options}) {
53489
53664
  }
53490
53665
  }));
53491
53666
  return function() {
53492
- return _ref3.apply(this, arguments);
53667
+ return _ref4.apply(this, arguments);
53493
53668
  };
53494
53669
  }(), listen = () => {
53495
53670
  customer.onStreamAdd(function() {
53496
- var _ref4 = _asyncToGenerator((function*(info) {
53671
+ var _ref5 = _asyncToGenerator((function*(info) {
53497
53672
  console.log('onStreamAdd', info);
53498
53673
  let streamId = info.id;
53499
53674
  reportLog('stream_add', 'info', 'info', {
@@ -53604,12 +53779,12 @@ function IndexWidget({customer, options}) {
53604
53779
  }
53605
53780
  }));
53606
53781
  return function(_x3) {
53607
- return _ref4.apply(this, arguments);
53782
+ return _ref5.apply(this, arguments);
53608
53783
  };
53609
53784
  }()), customer.onMessageReceived((msg => {
53610
53785
  console.log('message received', msg), dealWithMessage(msg.message);
53611
53786
  })), customer.onPlayingEvent(function() {
53612
- var _ref5 = _asyncToGenerator((function*(data) {
53787
+ var _ref6 = _asyncToGenerator((function*(data) {
53613
53788
  let msg = data.data;
53614
53789
  if (console.log('playingIndexs', playingIndexsRef.current), msg.streamId === aiAgentStreamIdRef.current) {
53615
53790
  if ('started' === msg.playingProgress || 'switched' === msg.playingProgress) {
@@ -53629,7 +53804,7 @@ function IndexWidget({customer, options}) {
53629
53804
  }
53630
53805
  }));
53631
53806
  return function(_x4) {
53632
- return _ref5.apply(this, arguments);
53807
+ return _ref6.apply(this, arguments);
53633
53808
  };
53634
53809
  }()), customer.onParticipantAdded((e => {
53635
53810
  console.log('有新用户加入', e);
@@ -53768,7 +53943,7 @@ function IndexWidget({customer, options}) {
53768
53943
  whiteList: answerLists.whiteList,
53769
53944
  blackList: answerLists.blackList,
53770
53945
  matchRule: '完整答案相等'
53771
- }), isAwaitingAnswerRef.current = !0, setSubtitle('请在倒计时结束前用"是"或"否"完成回复'), !0 === data.realtimeAsr ? startRealtimeAsr(data, view) : (realtimeAsrConfig && reportLog('realtime_asr_mode_mismatch', 'warn', 'info', {
53946
+ }), isAwaitingAnswerRef.current = !0, setSubtitle('请在倒计时结束前用"是"或"否"完成回复'), !0 === data.realtimeAsr ? startRealtimeAsr(data, view) : (1 === (null == asrConfig ? void 0 : asrConfig.type) && reportLog('realtime_asr_mode_mismatch', 'warn', 'info', {
53772
53947
  phase: 'business',
53773
53948
  message: '客户端配置了实时识别,坐席本轮使用离线识别'
53774
53949
  }), updateAnswerAudio(!0), setShowWaitView(!0), renderCir(asrWaitTimesRef.current, view));
@@ -53788,18 +53963,34 @@ function IndexWidget({customer, options}) {
53788
53963
  setShowWaitView(!1), setAsrText(text), asrResultTimerRef.current = setTimeout((() => {
53789
53964
  asrResultTimerRef.current = null, setAsrText('');
53790
53965
  }), 1e3);
53791
- } else {
53792
- 'update-playingIndex' === data.type ? (realtimeAsrRoundRef.current && resetAsrDisplay(),
53793
- Array.isArray(data.playingAiList) && (playingListRef.current = data.playingAiList,
53794
- setPlayingList(data.playingAiList)), playingIndexsRef.current = data.data, setPlayingIndexs(data.data)) : 'agent-info' === data.type ? (console.log('agent-info', data),
53795
- setAgentInfo(data.message), setFrameRateThreshold(data.frameRateThreshold), setMaxFrameRateCheckCount(data.maxFrameRateCheckCount)) : 'h5-link' === data.type ? setH5ExtraData(data.extraData) : 'system-recordId' === data.type ? (console.log('data.recordId', data.recordId),
53796
- setRecordId(data.recordId), setIsRecording(!0), recordIdRef.current = data.recordId,
53797
- resetRecordFaceCheckFailState(), reportLog('record_state_change', 'info', 'success', {
53966
+ } else if ('update-playingIndex' === data.type) {
53967
+ realtimeAsrRoundRef.current && resetAsrDisplay(), Array.isArray(data.playingAiList) && (playingListRef.current = data.playingAiList,
53968
+ setPlayingList(data.playingAiList)), playingIndexsRef.current = data.data, setPlayingIndexs(data.data);
53969
+ } else if ('agent-info' === data.type) {
53970
+ console.log('agent-info', data), setAgentInfo(data.message), setFrameRateThreshold(data.frameRateThreshold),
53971
+ setMaxFrameRateCheckCount(data.maxFrameRateCheckCount);
53972
+ } else if ('h5-link' === data.type) {
53973
+ setH5ExtraData(data.extraData);
53974
+ } else if ('system-recordId' === data.type) {
53975
+ var _asrConfig$type;
53976
+ asrDebug('record.start', {
53977
+ recordId: data.recordId,
53978
+ asrType: null !== (_asrConfig$type = null == asrConfig ? void 0 : asrConfig.type) && void 0 !== _asrConfig$type ? _asrConfig$type : 0,
53979
+ duplicate: realtimeAsrConfigRecordIdRef.current === data.recordId
53980
+ }), 1 === getAsrConfig(asrConfig).type && data.recordId && realtimeAsrConfigRecordIdRef.current !== data.recordId && (cancelRealtimeAsr(),
53981
+ realtimeAsrConfigRecordIdRef.current = data.recordId, realtimeAsrCredentialsRef.current = queryRealtimeAsrConfig(aiServerUrl, asrConfig).then((credentials => ({
53982
+ credentials
53983
+ })), (error => ({
53984
+ error
53985
+ })))), console.log('data.recordId', data.recordId), setRecordId(data.recordId),
53986
+ setIsRecording(!0), recordIdRef.current = data.recordId, resetRecordFaceCheckFailState(),
53987
+ reportLog('record_state_change', 'info', 'success', {
53798
53988
  phase: 'business',
53799
53989
  recordStatus: 'start',
53800
53990
  recordId: data.recordId || ''
53801
- })) : 'playing-audio-message' === data.type ? (reviewTextMessageRef.current = '',
53802
- updatePlaybackSubtitle(data.message)) : 'hangup-audio-call' === data.type && (setIsSilentAgentAudioMode(!1),
53991
+ });
53992
+ } else {
53993
+ 'playing-audio-message' === data.type ? (reviewTextMessageRef.current = '', updatePlaybackSubtitle(data.message)) : 'hangup-audio-call' === data.type && (setIsSilentAgentAudioMode(!1),
53803
53994
  setShowAudioCallToast(!1));
53804
53995
  }
53805
53996
  }
@@ -53879,7 +54070,7 @@ function IndexWidget({customer, options}) {
53879
54070
  })), faceCheckTimer || 2e3), checkFaceAndCaptureOnce = () => {
53880
54071
  let timer = null, isChecking = !1;
53881
54072
  const runCheck = function() {
53882
- var _ref7 = _asyncToGenerator((function*() {
54073
+ var _ref8 = _asyncToGenerator((function*() {
53883
54074
  if (!isChecking) {
53884
54075
  isChecking = !0;
53885
54076
  try {
@@ -53895,12 +54086,12 @@ function IndexWidget({customer, options}) {
53895
54086
  }
53896
54087
  }));
53897
54088
  return function() {
53898
- return _ref7.apply(this, arguments);
54089
+ return _ref8.apply(this, arguments);
53899
54090
  };
53900
54091
  }();
53901
54092
  return timer = setInterval(runCheck, faceCheckTimer || 2e3), timer;
53902
54093
  }, publishStream = function() {
53903
- var _ref8 = _asyncToGenerator((function*(stream) {
54094
+ var _ref9 = _asyncToGenerator((function*(stream) {
53904
54095
  try {
53905
54096
  let startTime = Date.now(), publish = yield customer.publish(stream);
53906
54097
  setCustomerStreamId(publish.id);
@@ -53935,7 +54126,7 @@ function IndexWidget({customer, options}) {
53935
54126
  }
53936
54127
  }));
53937
54128
  return function(_x5) {
53938
- return _ref8.apply(this, arguments);
54129
+ return _ref9.apply(this, arguments);
53939
54130
  };
53940
54131
  }();
53941
54132
  reactExports.useEffect((() => (isUnmountedRef.current = !1, reportLog('component_mount', 'info', 'info', {
@@ -54460,7 +54651,7 @@ class CustomerComponent extends EventTarget {
54460
54651
  this.disconnectedParticipantId = null;
54461
54652
  }
54462
54653
  init(id, options) {
54463
- getRealtimeAsrConfig(null == options ? void 0 : options.realtimeAsrConfig), console.log('init', id, redactRealtimeAsrOptions(options)),
54654
+ getAsrConfig(null == options ? void 0 : options.asrConfig, !0), console.log('init', id, redactRealtimeAsrOptions(options)),
54464
54655
  this.traceReporter = createBusinessTraceReporter({
54465
54656
  logServiceUrl: null == options ? void 0 : options.logServiceUrl,
54466
54657
  requestNo: null == options ? void 0 : options.request_no,