@davi-ai/retorik-framework 3.0.0 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +134 -11
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +134 -11
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1922,7 +1922,8 @@ const $1d4f8108de9ab73a$var$initialState = {
|
|
|
1922
1922
|
skipLoader: false,
|
|
1923
1923
|
displayAgentInNews: true,
|
|
1924
1924
|
submitDelayBeforeSendingMessage: undefined,
|
|
1925
|
-
disableHistory: false
|
|
1925
|
+
disableHistory: false,
|
|
1926
|
+
environmentPreset: "apartment"
|
|
1926
1927
|
};
|
|
1927
1928
|
let $1d4f8108de9ab73a$var$timer = null;
|
|
1928
1929
|
$1d4f8108de9ab73a$var$timer = setTimeout(()=>{
|
|
@@ -1972,6 +1973,11 @@ const $1d4f8108de9ab73a$var$createSpeechStore = (modeRef)=>{
|
|
|
1972
1973
|
userAlreadySet: value
|
|
1973
1974
|
});
|
|
1974
1975
|
},
|
|
1976
|
+
setEnvironmentPreset: (value)=>{
|
|
1977
|
+
set({
|
|
1978
|
+
environmentPreset: value
|
|
1979
|
+
});
|
|
1980
|
+
},
|
|
1975
1981
|
setFromTextToVocal: (value)=>{
|
|
1976
1982
|
set({
|
|
1977
1983
|
fromTextToVocal: value
|
|
@@ -3228,7 +3234,7 @@ var $c8770452d727244a$export$2e2bcd8739ae039 = $c8770452d727244a$var$activityMid
|
|
|
3228
3234
|
|
|
3229
3235
|
|
|
3230
3236
|
var $696df75883117d57$exports = {};
|
|
3231
|
-
$696df75883117d57$exports = JSON.parse("{\"name\":\"@davi-ai/retorik-framework\",\"version\":\"3.0.
|
|
3237
|
+
$696df75883117d57$exports = JSON.parse("{\"name\":\"@davi-ai/retorik-framework\",\"version\":\"3.0.2\",\"description\":\"Retorik Framework package\",\"author\":\"DAVI\",\"license\":\"MIT\",\"repository\":\"none\",\"main\":\"dist/index.js\",\"module\":\"dist/index.modern.js\",\"types\":\"dist/index.d.ts\",\"source\":\"src/index.tsx\",\"standalone\":\"standalone/index.js\",\"targets\":{\"standalone\":{\"context\":\"browser\",\"outputFormat\":\"esmodule\",\"distDir\":\"standalone\",\"includeNodeModules\":{\"@testing-library/jest-dom\":false,\"@testing-library/react\":false,\"@testing-library/react-hooks\":false,\"@testing-library/user-event\":false,\"eslint\":false,\"eslint-config-prettier\":false,\"eslint-config-standard\":false,\"eslint-config-standard-react\":false,\"eslint-plugin-import\":false,\"eslint-plugin-node\":false,\"eslint-plugin-prettier\":false,\"eslint-plugin-promise\":false,\"eslint-plugin-react\":false,\"eslint-plugin-standard\":false,\"jest-junit\":false,\"npm-run-all\":false,\"parcel\":false,\"prettier\":false,\"raw-loader\":false,\"react-docgen-typescript-plugin\":false,\"react-scripts\":false,\"react-test-renderer\":false,\"tailwindcss\":false,\"typescript\":false}},\"module\":{\"context\":\"browser\",\"outputFormat\":\"esmodule\",\"distDir\":\"dist\"}},\"engines\":{\"node\":\">=10\"},\"scripts\":{\"build\":\"parcel build\",\"start\":\"parcel watch\",\"test\":\"jest --env=jsdom --reporters=jest-junit\",\"test-console\":\"jest --env=jsdom\",\"test-update-snapshots\":\"jest --env=jsdom --updateSnapshot\",\"test-coverage-console\":\"jest --env=jsdom --reporters=jest-junit --coverage\",\"test-coverage\":\"jest --env=jsdom --reporters=jest-junit --coverage --coverageReporters=cobertura\",\"report\":\"npx parcel build src/index.tsx --reporter @parcel/reporter-bundle-analyzer\",\"credentials\":\"vsts-npm-auth -config .npmrc\"},\"peerDependencies\":{\"react\":\"18.3.1\",\"react-dom\":\"18.3.1\"},\"devDependencies\":{\"@babel/core\":\"^7.19.1\",\"@babel/plugin-proposal-decorators\":\"^7.24.7\",\"@babel/plugin-proposal-private-property-in-object\":\"^7.21.11\",\"@babel/preset-env\":\"^7.25.4\",\"@babel/preset-react\":\"^7.24.7\",\"@babel/preset-typescript\":\"^7.24.7\",\"@babel/runtime\":\"^7.23.8\",\"@parcel/packager-ts\":\"^2.13.2\",\"@parcel/reporter-bundle-analyzer\":\"^2.13.2\",\"@parcel/reporter-sourcemap-visualiser\":\"^2.13.2\",\"@parcel/transformer-inline-string\":\"^2.13.2\",\"@parcel/transformer-typescript-types\":\"^2.13.2\",\"@parcel/validator-eslint\":\"^2.13.2\",\"@parcel/validator-typescript\":\"^2.13.2\",\"@testing-library/dom\":\"^10.4.0\",\"@testing-library/jest-dom\":\"6.5.0\",\"@testing-library/react\":\"16.0.1\",\"@testing-library/react-hooks\":\"8.0.1\",\"@testing-library/user-event\":\"14.5.2\",\"@types/jest\":\"^27.5.1\",\"@types/leaflet\":\"^1.8.0\",\"@types/node\":\"^12.12.38\",\"@types/react\":\"18.3.12\",\"@types/react-dom\":\"18.3.1\",\"@types/testing-library__jest-dom\":\"^5.14.5\",\"@types/testing-library__react\":\"latest\",\"@typescript-eslint/eslint-plugin\":\"^8.19.0\",\"@typescript-eslint/parser\":\"^8.19.0\",\"autoprefixer\":\"^10.4.7\",\"babel-eslint\":\"^10.0.3\",\"babel-jest\":\"^29.7.0\",\"babel-loader\":\"^8.2.5\",\"buffer\":\"^5.7.1\",\"canvas\":\"^2.9.0\",\"cross-env\":\"^7.0.2\",\"crypto-browserify\":\"^3.12.0\",\"eslint\":\"^9.16.0\",\"eslint-config-prettier\":\"^9.1.0\",\"eslint-config-standard\":\"^17.1.0\",\"eslint-config-standard-react\":\"^13.0.0\",\"eslint-plugin-import\":\"^2.31.0\",\"eslint-plugin-node\":\"^11.1.0\",\"eslint-plugin-prettier\":\"^5.2.1\",\"eslint-plugin-promise\":\"^7.2.1\",\"eslint-plugin-react\":\"^7.37.2\",\"https-browserify\":\"^1.0.0\",\"jest\":\"^29.7.0\",\"jest-environment-jsdom\":\"^29.7.0\",\"jest-junit\":\"16.0.0\",\"npm-run-all\":\"^4.1.5\",\"parcel\":\"^2.13.2\",\"postcss\":\"^8.4.14\",\"postcss-url\":\"^10.1.3\",\"prettier\":\"^2.0.4\",\"process\":\"^0.11.10\",\"punycode\":\"^1.4.1\",\"querystring-es3\":\"^0.2.1\",\"react\":\"^18\",\"react-docgen-typescript-plugin\":\"^1.0.5\",\"react-dom\":\"18.3.1\",\"react-scripts\":\"5.0.1\",\"react-test-renderer\":\"^18.3.1\",\"resize-observer-polyfill\":\"^1.5.1\",\"stream-browserify\":\"^3.0.0\",\"stream-http\":\"^3.2.0\",\"string_decoder\":\"^1.3.0\",\"tailwindcss\":\"^3.1.0\",\"typescript\":\"5.3.2\",\"url\":\"^0.11.0\",\"util\":\"^0.12.4\"},\"files\":[\"dist\"],\"dependencies\":{\"@davi-ai/body-engine-sprite\":\"3.0.0\",\"@davi-ai/react-bodyengine-three\":\"1.0.0\",\"@davi-ai/retorik-weather\":\"2.0.0\",\"@davi-ai/speechmarkdown-davi-js\":\"1.0.6\",\"@davi-ai/web-speech-cognitive-services-davi\":\"2.0.10\",\"@fluentui/react\":\"^8.103.3\",\"@lottiefiles/react-lottie-player\":\"^3.4.1\",\"@opentelemetry/api\":\"^1.9.0\",\"@opentelemetry/exporter-trace-otlp-http\":\"^0.200.0\",\"@opentelemetry/instrumentation\":\"^0.200.0\",\"@opentelemetry/instrumentation-document-load\":\"^0.45.0\",\"@opentelemetry/instrumentation-fetch\":\"^0.200.0\",\"@opentelemetry/resources\":\"^2.0.0\",\"@opentelemetry/sdk-trace-web\":\"^2.0.0\",\"@opentelemetry/semantic-conventions\":\"^1.32.0\",\"@react-spring/types\":\"^9.7.3\",\"@react-spring/web\":\"^9.7.3\",\"@react-three/drei\":\"^9.106.0\",\"@swc/helpers\":\"^0.5.0\",\"@types/geojson\":\"^7946.0.10\",\"@types/jsdom\":\"^16.2.14\",\"@use-gesture/react\":\"^10.2.15\",\"adaptivecards\":\"3.0.1\",\"botframework-directlinejs\":\"^0.15.5\",\"classnames\":\"^2.3.1\",\"detect-gpu\":\"^5.0.70\",\"leaflet\":\"^1.9.2\",\"markdown-it\":\"14.1.0\",\"pdfjs-dist\":\"3.11.174\",\"postcss-copy\":\"^7.1.0\",\"qrcode\":\"^1.5.1\",\"react-device-detect\":\"^2.2.3\",\"react-error-boundary\":\"^4.0.10\",\"react-leaflet\":\"^4.1.0\",\"react-pdf\":\"7.7.1\",\"react-shadow\":\"^20.5.0\",\"react-webcam\":\"^6.0.0\",\"swiper\":\"^8.4.5\",\"three\":\"0.174.0\",\"zustand\":\"^5.0.3\"},\"overrides\":{\"@davi-ai/web-speech-cognitive-services-davi\":\"$@davi-ai/web-speech-cognitive-services-davi\",\"three\":\"$three\",\"zustand\":\"$zustand\"},\"@parcel/resolver-default\":{\"packageExports\":true}}");
|
|
3232
3238
|
|
|
3233
3239
|
|
|
3234
3240
|
const $328a7f03b0982320$var$initialState = {
|
|
@@ -4882,7 +4888,7 @@ const $a6eac66fec2e9cc5$var$ExternalHooksHandler = ({ instanceId: instanceId })=
|
|
|
4882
4888
|
document.addEventListener('retorik_call_loaderClosed', ()=>eventDispatch('retorik_loaderClosed', loaderClosedRef.current));
|
|
4883
4889
|
document.addEventListener('retorik_call_configuration', ()=>eventDispatch('retorik_configuration', configurationRef.current));
|
|
4884
4890
|
document.addEventListener('retorik_call_sendBoxRef', ()=>eventDispatch('retorik_sendBoxRef', sendBoxRefRef.current));
|
|
4885
|
-
document.addEventListener('retorik_call_isUsedOnBorne', ()=>eventDispatch('
|
|
4891
|
+
document.addEventListener('retorik_call_isUsedOnBorne', ()=>eventDispatch('retorik_isUsedOnBorne', isUsedOnBorneRef.current));
|
|
4886
4892
|
document.addEventListener('retorik_call_inputHintBehaviour', ()=>eventDispatch('retorik_inputHintBehaviour', inputHintBehaviourRef.current));
|
|
4887
4893
|
document.addEventListener('retorik_call_enableDocumentPrinting', ()=>eventDispatch('retorik_enableDocumentPrinting', enableDocumentPrintingRef.current));
|
|
4888
4894
|
document.addEventListener('retorik_call_conversationId', ()=>eventDispatch('retorik_conversationId', conversationIdRef.current));
|
|
@@ -4907,7 +4913,7 @@ const $a6eac66fec2e9cc5$var$ExternalHooksHandler = ({ instanceId: instanceId })=
|
|
|
4907
4913
|
document.removeEventListener('retorik_call_loaderClosed', ()=>eventDispatch('retorik_loaderClosed', loaderClosedRef.current));
|
|
4908
4914
|
document.removeEventListener('retorik_call_configuration', ()=>eventDispatch('retorik_configuration', configurationRef.current));
|
|
4909
4915
|
document.removeEventListener('retorik_call_sendBoxRef', ()=>eventDispatch('retorik_sendBoxRef', sendBoxRefRef.current));
|
|
4910
|
-
document.removeEventListener('retorik_call_isUsedOnBorne', ()=>eventDispatch('
|
|
4916
|
+
document.removeEventListener('retorik_call_isUsedOnBorne', ()=>eventDispatch('retorik_isUsedOnBorne', isUsedOnBorneRef.current));
|
|
4911
4917
|
document.removeEventListener('retorik_call_inputHintBehaviour', ()=>eventDispatch('retorik_inputHintBehaviour', inputHintBehaviourRef.current));
|
|
4912
4918
|
document.removeEventListener('retorik_call_enableDocumentPrinting', ()=>eventDispatch('retorik_enableDocumentPrinting', enableDocumentPrintingRef.current));
|
|
4913
4919
|
document.removeEventListener('retorik_call_conversationId', ()=>eventDispatch('retorik_conversationId', conversationIdRef.current));
|
|
@@ -5087,6 +5093,57 @@ const $9b7229e19d910060$export$284b58786299e6c5 = async ({ configurationData: co
|
|
|
5087
5093
|
userConsent: false
|
|
5088
5094
|
};
|
|
5089
5095
|
};
|
|
5096
|
+
const $9b7229e19d910060$export$5e05ceb0f0c2d3f = async ({ configurationData: configurationData, baseAddress: baseAddress })=>{
|
|
5097
|
+
if (configurationData) {
|
|
5098
|
+
if (typeof configurationData.userConsent === 'boolean') return {
|
|
5099
|
+
displayGDPR: false,
|
|
5100
|
+
userConsent: configurationData.userConsent
|
|
5101
|
+
};
|
|
5102
|
+
else return {
|
|
5103
|
+
displayGDPR: true,
|
|
5104
|
+
data: configurationData
|
|
5105
|
+
};
|
|
5106
|
+
} else {
|
|
5107
|
+
const fullAddress = `${baseAddress}api/gdpr/settings`;
|
|
5108
|
+
const response = await fetch(fullAddress).then((res)=>res.json()).catch((error)=>{
|
|
5109
|
+
console.warn(error);
|
|
5110
|
+
return undefined;
|
|
5111
|
+
});
|
|
5112
|
+
if (response) {
|
|
5113
|
+
// Format response data to get a GDPR-type object
|
|
5114
|
+
const responseToData = {
|
|
5115
|
+
title: {},
|
|
5116
|
+
message: {},
|
|
5117
|
+
link: {},
|
|
5118
|
+
linkURL: undefined,
|
|
5119
|
+
buttonAccept: {},
|
|
5120
|
+
buttonRefuse: {},
|
|
5121
|
+
messageAccepted: {},
|
|
5122
|
+
messageRefused: {}
|
|
5123
|
+
};
|
|
5124
|
+
// Title
|
|
5125
|
+
response.consentTitle && (responseToData.title = response.consentTitle);
|
|
5126
|
+
// Message
|
|
5127
|
+
(response === null || response === void 0 ? void 0 : response.consentBody) && (responseToData.message = response === null || response === void 0 ? void 0 : response.consentBody);
|
|
5128
|
+
// Link
|
|
5129
|
+
(response === null || response === void 0 ? void 0 : response.privacyStatementTitle) && (responseToData.link = response === null || response === void 0 ? void 0 : response.privacyStatementTitle);
|
|
5130
|
+
// Message accepted
|
|
5131
|
+
(response === null || response === void 0 ? void 0 : response.consentAknowledgementAccepted) && (responseToData.messageAccepted = response === null || response === void 0 ? void 0 : response.consentAknowledgementAccepted);
|
|
5132
|
+
// Message refused
|
|
5133
|
+
(response === null || response === void 0 ? void 0 : response.consentAknowledgementRefused) && (responseToData.messageRefused = response === null || response === void 0 ? void 0 : response.consentAknowledgementRefused);
|
|
5134
|
+
// LinkURl is the same for all languages
|
|
5135
|
+
responseToData.linkURL = response.privacyStatementUrl;
|
|
5136
|
+
return {
|
|
5137
|
+
displayGDPR: response.enableConsent,
|
|
5138
|
+
data: responseToData
|
|
5139
|
+
};
|
|
5140
|
+
}
|
|
5141
|
+
}
|
|
5142
|
+
return {
|
|
5143
|
+
displayGDPR: false,
|
|
5144
|
+
userConsent: false
|
|
5145
|
+
};
|
|
5146
|
+
};
|
|
5090
5147
|
|
|
5091
5148
|
|
|
5092
5149
|
|
|
@@ -22956,6 +23013,7 @@ var $248ff5c2ef55c790$export$2e2bcd8739ae039 = $248ff5c2ef55c790$var$Conversatio
|
|
|
22956
23013
|
|
|
22957
23014
|
|
|
22958
23015
|
|
|
23016
|
+
|
|
22959
23017
|
|
|
22960
23018
|
|
|
22961
23019
|
const $5cac5449d46d743a$var$Version = ({ isMobile: isMobile })=>{
|
|
@@ -22984,6 +23042,7 @@ var $5cac5449d46d743a$export$2e2bcd8739ae039 = $5cac5449d46d743a$var$Version;
|
|
|
22984
23042
|
|
|
22985
23043
|
|
|
22986
23044
|
|
|
23045
|
+
|
|
22987
23046
|
|
|
22988
23047
|
const $341aa389b3b9926d$var$springEnterDuration = 500;
|
|
22989
23048
|
const $341aa389b3b9926d$var$springQrcodeDuration = 500;
|
|
@@ -23195,6 +23254,8 @@ const $545d9948d3db0229$var$Dashboard = ({ toggleDashboard: toggleDashboard })=>
|
|
|
23195
23254
|
const translation = (0, $0db969f5e79ce01b$export$6650dace022cfacc)((state)=>state.currentTranslations);
|
|
23196
23255
|
const menus = (0, $1d4f8108de9ab73a$export$bd22554f31e5f96f)((state)=>state.configuration.menu);
|
|
23197
23256
|
const position = (0, $1d4f8108de9ab73a$export$bd22554f31e5f96f)((state)=>state.configuration.position);
|
|
23257
|
+
const isUsedOnBorne = (0, $1d4f8108de9ab73a$export$bd22554f31e5f96f)((state)=>state.configuration.isUsedOnBorne);
|
|
23258
|
+
const askForKioskParametersOpening = (0, $2793f2455cec0982$export$77e4cc5334565f28)((state)=>state.actions.askForKioskParametersOpening);
|
|
23198
23259
|
const sendEvent = (0, $328a7f03b0982320$export$adc771f45cf9b273)((state)=>state.actions.sendEvent);
|
|
23199
23260
|
const [justify, setJustify] = (0, $dWhh5$react.useState)();
|
|
23200
23261
|
const [opacityStyle, setOpacityStyle] = (0, $dWhh5$react.useState)('');
|
|
@@ -23218,6 +23279,12 @@ const $545d9948d3db0229$var$Dashboard = ({ toggleDashboard: toggleDashboard })=>
|
|
|
23218
23279
|
setOpacityStyle(`linear-gradient(to top, black ${100 - percentage}%, transparent 100%)`);
|
|
23219
23280
|
}
|
|
23220
23281
|
};
|
|
23282
|
+
/**
|
|
23283
|
+
* Called in borne mode to open retorik kiosk parameters
|
|
23284
|
+
*/ const handleClickParameters = ()=>{
|
|
23285
|
+
askForKioskParametersOpening();
|
|
23286
|
+
toggleDashboard === null || toggleDashboard === void 0 ? void 0 : toggleDashboard();
|
|
23287
|
+
};
|
|
23221
23288
|
return /*#__PURE__*/ (0, $dWhh5$reactjsxruntime.jsxs)((0, $9d2c3b646d8954b6$export$2e2bcd8739ae039), {
|
|
23222
23289
|
onClick: toggleDashboard,
|
|
23223
23290
|
children: [
|
|
@@ -23269,7 +23336,21 @@ const $545d9948d3db0229$var$Dashboard = ({ toggleDashboard: toggleDashboard })=>
|
|
|
23269
23336
|
})
|
|
23270
23337
|
]
|
|
23271
23338
|
}),
|
|
23272
|
-
/*#__PURE__*/ (0, $dWhh5$reactjsxruntime.
|
|
23339
|
+
isUsedOnBorne ? /*#__PURE__*/ (0, $dWhh5$reactjsxruntime.jsxs)("button", {
|
|
23340
|
+
// @ts-ignore
|
|
23341
|
+
part: "retorik-framework-parameters",
|
|
23342
|
+
className: "rf-absolute rf-left-4 rf-bottom-4 rf-h-8 rf-flex rf-flex-row rf-items-center",
|
|
23343
|
+
onClick: handleClickParameters,
|
|
23344
|
+
children: [
|
|
23345
|
+
/*#__PURE__*/ (0, $dWhh5$reactjsxruntime.jsx)((0, $30f87cc156c8645d$export$2e2bcd8739ae039), {
|
|
23346
|
+
color: "#A4A7AF"
|
|
23347
|
+
}),
|
|
23348
|
+
/*#__PURE__*/ (0, $dWhh5$reactjsxruntime.jsx)("p", {
|
|
23349
|
+
className: "rf-uppercase rf-ml-1 rf-text-xsl rf-text-[#A4A7AF]",
|
|
23350
|
+
children: translation.common.parameters
|
|
23351
|
+
})
|
|
23352
|
+
]
|
|
23353
|
+
}) : /*#__PURE__*/ (0, $dWhh5$reactjsxruntime.jsx)((0, $5cac5449d46d743a$export$2e2bcd8739ae039), {})
|
|
23273
23354
|
]
|
|
23274
23355
|
}),
|
|
23275
23356
|
/*#__PURE__*/ (0, $dWhh5$reactjsxruntime.jsx)((0, $e30af8373281dae5$export$2e2bcd8739ae039), {
|
|
@@ -25099,13 +25180,13 @@ var $d2c0480827389113$export$2e2bcd8739ae039 = $d2c0480827389113$var$ExtendIcon;
|
|
|
25099
25180
|
|
|
25100
25181
|
const $6c3069cd619942d1$var$HomeView = ({ externalComponents: externalComponents })=>{
|
|
25101
25182
|
const openWidget = (0, $a7af629b10128503$export$d95eb9b67812311f)((state)=>state.actions.openWidget);
|
|
25102
|
-
const displayChangeLayoutButton = (0, $1d4f8108de9ab73a$export$bd22554f31e5f96f)((state)=>state.configuration.allowSwitchLayout);
|
|
25103
25183
|
const currentLayout = (0, $1d4f8108de9ab73a$export$bd22554f31e5f96f)((state)=>state.currentLayout);
|
|
25104
25184
|
const loaderClosed = (0, $1d4f8108de9ab73a$export$bd22554f31e5f96f)((state)=>state.loaderClosed);
|
|
25105
25185
|
const configuration = (0, $1d4f8108de9ab73a$export$bd22554f31e5f96f)((state)=>state.configuration);
|
|
25106
25186
|
const mode = (0, $df401eb9a10f9e0e$export$f299240efcda25a2)((state)=>state.mode);
|
|
25107
25187
|
const isMobile = (0, $6acc5d637072b42e$export$d13b2577cb75f2ad)((state)=>state.isMobile);
|
|
25108
25188
|
const isBorne = (0, $6acc5d637072b42e$export$d13b2577cb75f2ad)((state)=>state.isBorne);
|
|
25189
|
+
const currentDeviceType = (0, $6acc5d637072b42e$export$d13b2577cb75f2ad)((state)=>state.currentDeviceType);
|
|
25109
25190
|
const configurations = (0, $6acc5d637072b42e$export$d13b2577cb75f2ad)((state)=>state.configurations);
|
|
25110
25191
|
const setDisplayControls = (0, $6acc5d637072b42e$export$d13b2577cb75f2ad)((state)=>state.actions.setDisplayControls);
|
|
25111
25192
|
const setLayout = (0, $1d4f8108de9ab73a$export$bd22554f31e5f96f)((state)=>state.actions.setLayout);
|
|
@@ -25123,7 +25204,7 @@ const $6c3069cd619942d1$var$HomeView = ({ externalComponents: externalComponents
|
|
|
25123
25204
|
};
|
|
25124
25205
|
return /*#__PURE__*/ (0, $dWhh5$reactjsxruntime.jsxs)((0, ($parcel$interopDefault($dWhh5$react))).Fragment, {
|
|
25125
25206
|
children: [
|
|
25126
|
-
!!
|
|
25207
|
+
!!configuration.allowSwitchLayout && currentLayout !== (0, $71c613e2e831c34c$export$a31c5a03aaeee5f).widget && (currentDeviceType === (0, $71c613e2e831c34c$export$ec1e04e4e5ef8233).widgetLandscape || currentDeviceType === (0, $71c613e2e831c34c$export$ec1e04e4e5ef8233).widgetBorne) && /*#__PURE__*/ (0, $dWhh5$reactjsxruntime.jsx)("button", {
|
|
25127
25208
|
onClick: extendButtonHandler,
|
|
25128
25209
|
"aria-label": "Minimize",
|
|
25129
25210
|
className: "rf-absolute rf-z-exitwidget rf-flex rf-top-1 rf-p-1 rf-bg-truewhite rf-border rf-border-trueblack rf-rounded-lg rf-right-10",
|
|
@@ -26869,6 +26950,7 @@ const $ad561f5c61e38c20$var$SynthesisManager = ({ isRetorikNews: isRetorikNews }
|
|
|
26869
26950
|
const lastBotActivity = (0, $8fc061e3e1dc64cb$export$b56465394e2b1287)((state)=>state.lastBotMessageActivity);
|
|
26870
26951
|
const checkReplacementLocale = (0, $0db969f5e79ce01b$export$6650dace022cfacc)((state)=>state.actions.checkReplacementLocale);
|
|
26871
26952
|
const setRetorikNewsEnded = (0, $2793f2455cec0982$export$77e4cc5334565f28)((state)=>state.actions.setRetorikNewsEnded);
|
|
26953
|
+
const isSpeaking = (0, $dWhh5$react.useRef)(false);
|
|
26872
26954
|
const { setVoice: setVoice, cancelCurrentUtterance: cancelCurrentUtterance, resetCancelCurrentUtterance: resetCancelCurrentUtterance, setSpeaking: setSpeaking, setCurrentPlaying: setCurrentPlaying, setCurrentReplyToId: setCurrentReplyToId, setEndedActivities: setEndedActivities, setBoundaryData: setBoundaryData, removeFirstFromStreamingQueue: removeFirstFromStreamingQueue, setCurrentStreaming: setCurrentStreaming, killCurrentStreaming: killCurrentStreaming, askPermission: askPermission, toggleMicrophone: toggleMicrophone } = (0, $df401eb9a10f9e0e$export$f299240efcda25a2)((state)=>state.actions);
|
|
26873
26955
|
const addEndedActivity = (0, $8fc061e3e1dc64cb$export$b56465394e2b1287)((state)=>state.actions.addEndedActivity);
|
|
26874
26956
|
const dispatchMarkActivity = (0, $328a7f03b0982320$export$adc771f45cf9b273)((state)=>state.actions.dispatchMarkActivity);
|
|
@@ -27016,7 +27098,11 @@ const $ad561f5c61e38c20$var$SynthesisManager = ({ isRetorikNews: isRetorikNews }
|
|
|
27016
27098
|
setUtterance(checkSayAsWordsAndCreateUtterance({
|
|
27017
27099
|
...params
|
|
27018
27100
|
}));
|
|
27019
|
-
|
|
27101
|
+
isSpeaking.current = true;
|
|
27102
|
+
} else {
|
|
27103
|
+
setUtterance(null);
|
|
27104
|
+
isSpeaking.current = false;
|
|
27105
|
+
}
|
|
27020
27106
|
}
|
|
27021
27107
|
}, [
|
|
27022
27108
|
currentNewsActivity,
|
|
@@ -27045,6 +27131,7 @@ const $ad561f5c61e38c20$var$SynthesisManager = ({ isRetorikNews: isRetorikNews }
|
|
|
27045
27131
|
queuedActivitiesRef.current = [];
|
|
27046
27132
|
resetCancelCurrentUtterance();
|
|
27047
27133
|
setUtterance(null);
|
|
27134
|
+
isSpeaking.current = false;
|
|
27048
27135
|
setNextUtterance(null);
|
|
27049
27136
|
!isRetorikNews && setIsNewsView(route === (0, $71c613e2e831c34c$export$3565eb3d00ca5a74).News);
|
|
27050
27137
|
}, [
|
|
@@ -27073,6 +27160,7 @@ const $ad561f5c61e38c20$var$SynthesisManager = ({ isRetorikNews: isRetorikNews }
|
|
|
27073
27160
|
queue.splice(0, 1);
|
|
27074
27161
|
queuedActivitiesRef.current = queue;
|
|
27075
27162
|
setUtterance(checkActivityAndCreateUtterance(params));
|
|
27163
|
+
isSpeaking.current = true;
|
|
27076
27164
|
}
|
|
27077
27165
|
}, [
|
|
27078
27166
|
appAvailable
|
|
@@ -27086,6 +27174,7 @@ const $ad561f5c61e38c20$var$SynthesisManager = ({ isRetorikNews: isRetorikNews }
|
|
|
27086
27174
|
cancelRef.current = cancel;
|
|
27087
27175
|
if (cancel) {
|
|
27088
27176
|
utterance ? setUtterance(null) : resetCancelCurrentUtterance();
|
|
27177
|
+
isSpeaking.current = false;
|
|
27089
27178
|
setNextUtterance(null);
|
|
27090
27179
|
killCurrentStreaming();
|
|
27091
27180
|
}
|
|
@@ -27175,6 +27264,7 @@ const $ad561f5c61e38c20$var$SynthesisManager = ({ isRetorikNews: isRetorikNews }
|
|
|
27175
27264
|
locale: replacementLocale
|
|
27176
27265
|
};
|
|
27177
27266
|
setUtterance(checkActivityAndCreateUtterance(params));
|
|
27267
|
+
isSpeaking.current = true;
|
|
27178
27268
|
}
|
|
27179
27269
|
}
|
|
27180
27270
|
}, [
|
|
@@ -27192,6 +27282,7 @@ const $ad561f5c61e38c20$var$SynthesisManager = ({ isRetorikNews: isRetorikNews }
|
|
|
27192
27282
|
};
|
|
27193
27283
|
removeFirstFromStreamingQueue();
|
|
27194
27284
|
setUtterance(checkSayAsWordsAndCreateUtterance(params));
|
|
27285
|
+
isSpeaking.current = true;
|
|
27195
27286
|
setCurrentPlaying(undefined);
|
|
27196
27287
|
currentPlayingRef.current = null;
|
|
27197
27288
|
currentActivityRef.current = null;
|
|
@@ -27224,6 +27315,7 @@ const $ad561f5c61e38c20$var$SynthesisManager = ({ isRetorikNews: isRetorikNews }
|
|
|
27224
27315
|
locale: locale
|
|
27225
27316
|
};
|
|
27226
27317
|
setUtterance(checkSayAsWordsAndCreateUtterance(params));
|
|
27318
|
+
isSpeaking.current = true;
|
|
27227
27319
|
}
|
|
27228
27320
|
}, [
|
|
27229
27321
|
externalTextToSpeech
|
|
@@ -27339,7 +27431,32 @@ const $ad561f5c61e38c20$var$SynthesisManager = ({ isRetorikNews: isRetorikNews }
|
|
|
27339
27431
|
}
|
|
27340
27432
|
currentPlayingRef.current = null;
|
|
27341
27433
|
setUtterance(futureUtterance);
|
|
27434
|
+
isSpeaking.current = !!futureUtterance;
|
|
27342
27435
|
};
|
|
27436
|
+
/**
|
|
27437
|
+
* If the previous audio stream ends before the next one is received, we relaunch the new stream as soon as it arrives.
|
|
27438
|
+
*/ (0, $dWhh5$react.useEffect)(()=>{
|
|
27439
|
+
if (!isSpeaking.current) {
|
|
27440
|
+
let futureUtterance = null;
|
|
27441
|
+
setCurrentPlaying(undefined);
|
|
27442
|
+
if (streamingQueue.length) {
|
|
27443
|
+
const tempActivity = streamingQueue[0];
|
|
27444
|
+
const params = {
|
|
27445
|
+
activity: tempActivity,
|
|
27446
|
+
voice: getVoiceAfterCheckingActivityLocale(locale),
|
|
27447
|
+
locale: locale
|
|
27448
|
+
};
|
|
27449
|
+
removeFirstFromStreamingQueue();
|
|
27450
|
+
futureUtterance = checkSayAsWordsAndCreateUtterance(params);
|
|
27451
|
+
tempCurrentStreamingRef.current = tempActivity.text || null;
|
|
27452
|
+
}
|
|
27453
|
+
currentPlayingRef.current = null;
|
|
27454
|
+
setUtterance(futureUtterance);
|
|
27455
|
+
isSpeaking.current = !!futureUtterance;
|
|
27456
|
+
}
|
|
27457
|
+
}, [
|
|
27458
|
+
streamingQueue
|
|
27459
|
+
]);
|
|
27343
27460
|
return ponyfill ? /*#__PURE__*/ (0, $dWhh5$reactjsxruntime.jsx)((0, $d31b268c3b702355$export$2e2bcd8739ae039), {
|
|
27344
27461
|
ponyfill: ponyfill,
|
|
27345
27462
|
appAvailable: appAvailable,
|
|
@@ -27954,6 +28071,7 @@ var $c6f26ebf51eadf8c$export$2e2bcd8739ae039 = $c6f26ebf51eadf8c$var$Subtitle;
|
|
|
27954
28071
|
|
|
27955
28072
|
|
|
27956
28073
|
const $929a5fce6d871a46$var$ThreeJsWrapper = ({ agentData: agentData, visible: visible, height: height, size: size, cameraPreset: cameraPreset })=>{
|
|
28074
|
+
const environmentPreset = (0, $1d4f8108de9ab73a$export$bd22554f31e5f96f)((state)=>state.environmentPreset);
|
|
27957
28075
|
const gpuData = (0, $1d4f8108de9ab73a$export$bd22554f31e5f96f)((state)=>state.gpuData);
|
|
27958
28076
|
const speaking = (0, $df401eb9a10f9e0e$export$f299240efcda25a2)((state)=>state.speaking);
|
|
27959
28077
|
const recognitionState = (0, $df401eb9a10f9e0e$export$f299240efcda25a2)((state)=>state.activeRecognitionState);
|
|
@@ -28021,7 +28139,7 @@ const $929a5fce6d871a46$var$ThreeJsWrapper = ({ agentData: agentData, visible: v
|
|
|
28021
28139
|
children: type && /*#__PURE__*/ (0, $dWhh5$reactjsxruntime.jsx)((0, $dWhh5$daviaireactbodyenginethree.Character), {
|
|
28022
28140
|
url: agentData.url,
|
|
28023
28141
|
type: type,
|
|
28024
|
-
animationsUrl: agentData.animationsUrl || 'https://cdn.retorik.ai/bodyengine-three/animations/cc4/female/standing/',
|
|
28142
|
+
animationsUrl: (agentData === null || agentData === void 0 ? void 0 : agentData.animationsUrl) || 'https://cdn.retorik.ai/bodyengine-three/animations/cc4/female/standing/',
|
|
28025
28143
|
gender: (agentData === null || agentData === void 0 ? void 0 : agentData.gender) === 'male' ? 'male' : 'female',
|
|
28026
28144
|
onLoadingCompleted: ()=>setCharacterLoaded(true),
|
|
28027
28145
|
camera: (0, $dWhh5$daviaireactbodyenginethree.presets)[cameraPreset || 'default'],
|
|
@@ -28441,14 +28559,14 @@ var $9765bd6ac5154ec8$export$2e2bcd8739ae039 = $9765bd6ac5154ec8$var$getBaseAddr
|
|
|
28441
28559
|
|
|
28442
28560
|
|
|
28443
28561
|
|
|
28444
|
-
const $ce7633a58d99dcca$var$RetorikConfigHandler = ({ config: config, viewsConfig: viewsConfig, chatbotData: chatbotData, chatbotDataWidget: chatbotDataWidget, agentData: agentData, ponyfillFactoryCredentials: ponyfillFactoryCredentials, customVoice: customVoice, colors: colors, skipLoader: skipLoader, defaultMode: defaultMode, GDPR: GDPR, addressData: addressData, externalEventHandler: externalEventHandler, externalComponents: externalComponents, userData: userData, width: width, height: height, menuConfig: menuConfig, parent: parent })=>{
|
|
28562
|
+
const $ce7633a58d99dcca$var$RetorikConfigHandler = ({ config: config, viewsConfig: viewsConfig, chatbotData: chatbotData, chatbotDataWidget: chatbotDataWidget, agentData: agentData, ponyfillFactoryCredentials: ponyfillFactoryCredentials, customVoice: customVoice, colors: colors, skipLoader: skipLoader, defaultMode: defaultMode, GDPR: GDPR, addressData: addressData, externalEventHandler: externalEventHandler, externalComponents: externalComponents, userData: userData, width: width, height: height, menuConfig: menuConfig, environmentPreset: environmentPreset, parent: parent })=>{
|
|
28445
28563
|
const { fetchSupportedLanguages: fetchSupportedLanguages, setLanguageData: setLanguageData } = (0, $0db969f5e79ce01b$export$6650dace022cfacc)((state)=>state.actions);
|
|
28446
28564
|
const setTheme = (0, $6acc5d637072b42e$export$d13b2577cb75f2ad)((state)=>state.actions.setTheme);
|
|
28447
28565
|
const baseAddress = (0, $1d4f8108de9ab73a$export$bd22554f31e5f96f)((state)=>state.baseAddress);
|
|
28448
28566
|
const [fetchedConfig, setFetchedConfig] = (0, $dWhh5$react.useState)();
|
|
28449
28567
|
const [mainConfig, setMainConfig] = (0, $dWhh5$react.useState)(undefined);
|
|
28450
28568
|
const { setGDPRDisplay: setGDPRDisplay, setGDPRUserConsent: setGDPRUserConsent, setGDPRWindowData: setGDPRWindowData } = (0, $2793f2455cec0982$export$77e4cc5334565f28)((state)=>state.actions);
|
|
28451
|
-
const { setBaseAddress: setBaseAddress, setDisableHistory: setDisableHistory } = (0, $1d4f8108de9ab73a$export$bd22554f31e5f96f)((state)=>state.actions);
|
|
28569
|
+
const { setBaseAddress: setBaseAddress, setDisableHistory: setDisableHistory, setEnvironmentPreset: setEnvironmentPreset } = (0, $1d4f8108de9ab73a$export$bd22554f31e5f96f)((state)=>state.actions);
|
|
28452
28570
|
const [isConfigUpdated, setIsConfigUpdated] = (0, $dWhh5$react.useState)(false);
|
|
28453
28571
|
/**
|
|
28454
28572
|
* Check if emergency data can be retrieved to remove the button in menu if no data available
|
|
@@ -28518,6 +28636,11 @@ const $ce7633a58d99dcca$var$RetorikConfigHandler = ({ config: config, viewsConfi
|
|
|
28518
28636
|
}, [
|
|
28519
28637
|
addressData
|
|
28520
28638
|
]);
|
|
28639
|
+
(0, $dWhh5$react.useEffect)(()=>{
|
|
28640
|
+
if (environmentPreset) setEnvironmentPreset(environmentPreset);
|
|
28641
|
+
}, [
|
|
28642
|
+
environmentPreset
|
|
28643
|
+
]);
|
|
28521
28644
|
(0, $dWhh5$react.useEffect)(()=>{
|
|
28522
28645
|
if (fetchedConfig) {
|
|
28523
28646
|
const { skipLoader: _skipLoader, defaultMode: _defaultMode, config: _config, viewsConfig: _viewsConfig, chatbotData: _chatbotData, chatbotDataWidget: _chatbotDataWidget, agentData: _agentData, addressData: _addressData, ponyfillFactoryCredentials: _ponyfillFactoryCredentials, customVoice: _customVoice, colors: _colors, defaultCulture: defaultCulture, supportedCultures: supportedCultures, disableHistory: disableHistory } = fetchedConfig;
|