quickblox-react-ui-kit 0.1.3 → 0.1.4

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-ui.js CHANGED
@@ -124,7 +124,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _nod
124
124
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
125
125
 
126
126
  "use strict";
127
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js */ \"./node_modules/css-loader/dist/runtime/noSourceMaps.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../../../node_modules/css-loader/dist/runtime/api.js */ \"./node_modules/css-loader/dist/runtime/api.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);\n// Imports\n\n\nvar ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));\n___CSS_LOADER_EXPORT___.push([module.id, \"@import url(https://fonts.googleapis.com/css2?family=Ubuntu:ital,wght@0,400;0,500;0,700;1,700&display=swap);\"]);\n___CSS_LOADER_EXPORT___.push([module.id, \"@import url(https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;600;700&display=swap);\"]);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \"@charset \\\"UTF-8\\\";\\n/* http://meyerweb.com/eric/tools/css/reset/\\n v2.0-modified | 20110126\\n License: none (public domain)\\n*/\\nhtml, body, div, span, applet, object, iframe,\\nh1, h2, h3, h4, h5, h6, p, blockquote, pre,\\na, abbr, acronym, address, big, cite, code,\\ndel, dfn, em, img, ins, kbd, q, s, samp,\\nsmall, strike, strong, sub, sup, tt, var,\\nb, u, i, center,\\ndl, dt, dd, ol, ul, li,\\nfieldset, form, label, legend,\\ntable, caption, tbody, tfoot, thead, tr, th, td,\\narticle, aside, canvas, details, embed,\\nfigure, figcaption, footer, header, hgroup,\\nmenu, nav, output, ruby, section, summary,\\ntime, mark, audio, video {\\n margin: 0;\\n padding: 0;\\n border: 0;\\n font-size: 100%;\\n font: inherit;\\n vertical-align: baseline;\\n}\\n\\n/* make sure to set some focus styles for accessibility */\\n:focus {\\n outline: 0;\\n}\\n\\n/* HTML5 display-role reset for older browsers */\\narticle, aside, details, figcaption, figure,\\nfooter, header, hgroup, menu, nav, section {\\n display: block;\\n}\\n\\nbody {\\n line-height: 1;\\n}\\n\\nol, ul {\\n list-style: none;\\n}\\n\\nblockquote, q {\\n quotes: none;\\n}\\n\\nblockquote:before, blockquote:after,\\nq:before, q:after {\\n content: \\\"\\\";\\n content: none;\\n}\\n\\ntable {\\n border-collapse: collapse;\\n border-spacing: 0;\\n}\\n\\ninput[type=search]::-webkit-search-cancel-button,\\ninput[type=search]::-webkit-search-decoration,\\ninput[type=search]::-webkit-search-results-button,\\ninput[type=search]::-webkit-search-results-decoration {\\n -webkit-appearance: none;\\n -moz-appearance: none;\\n}\\n\\ninput[type=search] {\\n -webkit-appearance: none;\\n -moz-appearance: none;\\n -webkit-box-sizing: content-box;\\n -moz-box-sizing: content-box;\\n box-sizing: content-box;\\n}\\n\\ntextarea {\\n overflow: auto;\\n vertical-align: top;\\n resize: vertical;\\n}\\n\\n/**\\n * Correct `inline-block` display not defined in IE 6/7/8/9 and Firefox 3.\\n */\\naudio,\\ncanvas,\\nvideo {\\n display: inline-block;\\n *display: inline;\\n *zoom: 1;\\n max-width: 100%;\\n}\\n\\n/**\\n * Prevent modern browsers from displaying `audio` without controls.\\n * Remove excess height in iOS 5 devices.\\n */\\naudio:not([controls]) {\\n display: none;\\n height: 0;\\n}\\n\\n/**\\n * Address styling not present in IE 7/8/9, Firefox 3, and Safari 4.\\n * Known issue: no IE 6 support.\\n */\\n[hidden] {\\n display: none;\\n}\\n\\n/**\\n * 1. Correct text resizing oddly in IE 6/7 when body `font-size` is set using\\n * `em` units.\\n * 2. Prevent iOS text size adjust after orientation change, without disabling\\n * user zoom.\\n */\\nhtml {\\n font-size: 100%; /* 1 */\\n -webkit-text-size-adjust: 100%; /* 2 */\\n -ms-text-size-adjust: 100%; /* 2 */\\n}\\n\\n/**\\n * Address `outline` inconsistency between Chrome and other browsers.\\n */\\na:focus {\\n outline: thin dotted;\\n}\\n\\n/**\\n * Improve readability when focused and also mouse hovered in all browsers.\\n */\\na:active,\\na:hover {\\n outline: 0;\\n}\\n\\n/**\\n * 1. Remove border when inside `a` element in IE 6/7/8/9 and Firefox 3.\\n * 2. Improve image quality when scaled in IE 7.\\n */\\nimg {\\n border: 0; /* 1 */\\n -ms-interpolation-mode: bicubic; /* 2 */\\n}\\n\\n/**\\n * Address margin not present in IE 6/7/8/9, Safari 5, and Opera 11.\\n */\\nfigure {\\n margin: 0;\\n}\\n\\n/**\\n * Correct margin displayed oddly in IE 6/7.\\n */\\nform {\\n margin: 0;\\n}\\n\\n/**\\n * Define consistent border, margin, and padding.\\n */\\nfieldset {\\n border: 1px solid #c0c0c0;\\n margin: 0 2px;\\n padding: 0.35em 0.625em 0.75em;\\n}\\n\\n/**\\n * 1. Correct color not being inherited in IE 6/7/8/9.\\n * 2. Correct text not wrapping in Firefox 3.\\n * 3. Correct alignment displayed oddly in IE 6/7.\\n */\\nlegend {\\n border: 0; /* 1 */\\n padding: 0;\\n white-space: normal; /* 2 */\\n *margin-left: -7px; /* 3 */\\n}\\n\\n/**\\n * 1. Correct font size not being inherited in all browsers.\\n * 2. Address margins set differently in IE 6/7, Firefox 3+, Safari 5,\\n * and Chrome.\\n * 3. Improve appearance and consistency in all browsers.\\n */\\nbutton,\\ninput,\\nselect,\\ntextarea {\\n font-size: 100%; /* 1 */\\n margin: 0; /* 2 */\\n vertical-align: baseline; /* 3 */\\n *vertical-align: middle; /* 3 */\\n}\\n\\n/**\\n * Address Firefox 3+ setting `line-height` on `input` using `!important` in\\n * the UA stylesheet.\\n */\\nbutton,\\ninput {\\n line-height: normal;\\n}\\n\\n/**\\n * Address inconsistent `text-transform` inheritance for `button` and `select`.\\n * All other form control elements do not inherit `text-transform` values.\\n * Correct `button` style inheritance in Chrome, Safari 5+, and IE 6+.\\n * Correct `select` style inheritance in Firefox 4+ and Opera.\\n */\\nbutton,\\nselect {\\n text-transform: none;\\n}\\n\\n/**\\n * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`\\n * and `video` controls.\\n * 2. Correct inability to style clickable `input` types in iOS.\\n * 3. Improve usability and consistency of cursor style between image-type\\n * `input` and others.\\n * 4. Remove inner spacing in IE 7 without affecting normal text inputs.\\n * Known issue: inner spacing remains in IE 6.\\n */\\nbutton,\\nhtml input[type=button],\\ninput[type=reset],\\ninput[type=submit] {\\n -webkit-appearance: button; /* 2 */\\n cursor: pointer; /* 3 */\\n *overflow: visible; /* 4 */\\n}\\n\\n/**\\n * Re-set default cursor for disabled elements.\\n */\\nbutton[disabled],\\nhtml input[disabled] {\\n cursor: default;\\n}\\n\\n/**\\n * 1. Address box sizing set to content-box in IE 8/9.\\n * 2. Remove excess padding in IE 8/9.\\n * 3. Remove excess padding in IE 7.\\n * Known issue: excess padding remains in IE 6.\\n */\\ninput[type=checkbox],\\ninput[type=radio] {\\n box-sizing: border-box; /* 1 */\\n padding: 0; /* 2 */\\n *height: 13px; /* 3 */\\n *width: 13px; /* 3 */\\n}\\n\\n/**\\n * 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome.\\n * 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome\\n * (include `-moz` to future-proof).\\n */\\ninput[type=search] {\\n -webkit-appearance: textfield; /* 1 */\\n -moz-box-sizing: content-box;\\n -webkit-box-sizing: content-box; /* 2 */\\n box-sizing: content-box;\\n}\\n\\n/**\\n * Remove inner padding and search cancel button in Safari 5 and Chrome\\n * on OS X.\\n */\\ninput[type=search]::-webkit-search-cancel-button,\\ninput[type=search]::-webkit-search-decoration {\\n -webkit-appearance: none;\\n}\\n\\n/**\\n * Remove inner padding and border in Firefox 3+.\\n */\\nbutton::-moz-focus-inner,\\ninput::-moz-focus-inner {\\n border: 0;\\n padding: 0;\\n}\\n\\n/**\\n * 1. Remove default vertical scrollbar in IE 6/7/8/9.\\n * 2. Improve readability and alignment in all browsers.\\n */\\ntextarea {\\n overflow: auto; /* 1 */\\n vertical-align: top; /* 2 */\\n}\\n\\n/**\\n * Remove most spacing between table cells.\\n */\\ntable {\\n border-collapse: collapse;\\n border-spacing: 0;\\n}\\n\\nhtml,\\nbutton,\\ninput,\\nselect,\\ntextarea {\\n color: #222;\\n}\\n\\n::-moz-selection {\\n background: #b3d4fc;\\n text-shadow: none;\\n}\\n\\n::selection {\\n background: #b3d4fc;\\n text-shadow: none;\\n}\\n\\nimg {\\n vertical-align: middle;\\n}\\n\\nfieldset {\\n border: 0;\\n margin: 0;\\n padding: 0;\\n}\\n\\ntextarea {\\n resize: vertical;\\n}\\n\\n.chromeframe {\\n margin: 0.2em 0;\\n background: #ccc;\\n color: #000;\\n padding: 0.2em 0;\\n}\\n\\n* {\\n padding: 0;\\n margin: 0;\\n border: 0;\\n}\\n\\n*, *:before, *:after {\\n -moz-box-sizing: border-box;\\n -webkit-box-sizing: border-box;\\n box-sizing: border-box;\\n}\\n\\n:focus, :active {\\n outline: none;\\n}\\n\\na:focus, a:active {\\n outline: none;\\n}\\n\\nnav, footer, header, aside {\\n display: block;\\n}\\n\\nhtml, body {\\n height: 100%;\\n width: 100%;\\n font-size: 100%;\\n line-height: 1;\\n font-size: 14px;\\n -ms-text-size-adjust: 100%;\\n -moz-text-size-adjust: 100%;\\n -webkit-text-size-adjust: 100%;\\n}\\n\\ninput, button, textarea {\\n font-family: inherit;\\n}\\n\\ninput::-ms-clear {\\n display: none;\\n}\\n\\nbutton {\\n cursor: pointer;\\n}\\n\\nbutton::-moz-focus-inner {\\n padding: 0;\\n border: 0;\\n}\\n\\na, a:visited {\\n text-decoration: none;\\n}\\n\\nul li {\\n list-style: none;\\n}\\n\\nimg {\\n vertical-align: top;\\n}\\n\\nh1, h2, h3, h4, h5, h6 {\\n font-size: inherit;\\n font-weight: 400;\\n}\\n\\n/*\\n@font-face {\\n font-family: \\\"Roboto-Regular\\\";\\n src: url(\\\"../fonts/Roboto-Regular.eot\\\");\\n src: local(\\\"☺\\\"), url(\\\"../fonts/Roboto-Regular.woff\\\") format(\\\"woff\\\"),\\n url(\\\"../fonts/Roboto-Regular.ttf\\\") format(\\\"truetype\\\");\\n font-weight: normal;\\n font-style: normal;\\n}\\n\\n@font-face {\\n font-family: \\\"Roboto-Medium\\\";\\n src: url(\\\"../fonts/Roboto-Medium.eot\\\");\\n src: local(\\\"☺\\\"), url(\\\"../fonts/Roboto-Medium.woff\\\") format(\\\"woff\\\"),\\n url(\\\"../fonts/Roboto-Medium.ttf\\\") format(\\\"truetype\\\");\\n font-weight: normal;\\n font-style: normal;\\n}\\n\\n@font-face {\\n font-family: \\\"Roboto-Bold\\\";\\n src: url(\\\"../fonts/Roboto-Bold.eot\\\");\\n src: local(\\\"☺\\\"), url(\\\"../fonts/Roboto-Bold.woff\\\") format(\\\"woff\\\"),\\n url(\\\"../fonts/Roboto-Bold.ttf\\\") format(\\\"truetype\\\");\\n font-weight: normal;\\n font-style: normal;\\n}\\n*/\\n:root {\\n --primary: #3978FC;\\n --color-background: #FFFFFF;\\n --color-background-modal: #C4D7FE;\\n --color-background-overlay: #0B121B;\\n --color-divider: #E7EFFF;\\n --color-font: #0B121B;\\n --color-icon: #3978FC;\\n --color-background-info:#C4D7FE;\\n --tertiary-elements: #636D78;\\n --main-elements: #3978FC;\\n --secondary-elements: #202F3E;\\n --input-elements: #202F3E;\\n --disabled-elements: #BCC1C5;\\n --field-border: #90979F;\\n --main-text: #0B121B;\\n --secondary-text: #636D78;\\n --caption: #90979F;\\n --main-background: #FFFFFF;\\n --secondary-background: #FFFFFF;\\n --secondary-background-modal: rgba(19, 29, 40, 0.8);\\n --incoming-background: #E4E6E8;\\n --outgoing-background: #E7EFFF;\\n --dropdown-background: #FFFFFF;\\n --chat-input: #F7F9FF;\\n --divider: #E7EFFF;\\n --error: #FF3B30;\\n --hightlight: #FFFDC1;\\n}\\n\\nhtml[data-theme=dark] {\\n --primary: #3978FC;\\n --color-background: #0B121B;\\n --color-background-modal: #90979F;\\n --color-background-overlay: #0B121B;\\n --color-divider: #414E5B;\\n --color-font: #FFFFFF;\\n --color-icon: #3978FC;\\n --color-background-info: #3978FC;\\n --tertiary-elements: rgba(144, 151, 159, 0.8);\\n --main-elements: #74A1FD;\\n --secondary-elements: #FFFFFF;\\n --input-elements: #90979F;\\n --disabled-elements: #636D78;\\n --field-border: #90979F;\\n --main-text: #FFFFFF;\\n --secondary-text: #90979F;\\n --caption: #BCC1C5;\\n --main-background: #202F3E;\\n --secondary-background: #131D28;\\n --incoming-background: #414E5B;\\n --outgoing-background: #3978FC;\\n --dropdown-background: #414E5B;\\n --chat-input: #131D28;\\n --divider: #414E5B;\\n --error: #FF766E;\\n --hightlight: #FFFDC1;\\n}\\n\\n* {\\n box-sizing: border-box;\\n}\\n\\nbody {\\n font-family: \\\"Roboto\\\";\\n color: var(--main-text);\\n background-color: var(--main-background);\\n overflow: hidden !important;\\n scrollbar-width: none !important;\\n max-height: 810px;\\n max-width: 1380px;\\n}\\n\\n.header-dialogs-container {\\n display: flex;\\n height: 64px;\\n gap: 0 30px;\\n padding: 16px 16px 16px 20px;\\n}\\n.header-dialogs-container--title_wrapper {\\n font-family: \\\"Roboto\\\";\\n font-style: normal;\\n font-weight: 500;\\n font-size: 20px;\\n line-height: 24px;\\n letter-spacing: 0.0015em;\\n width: 180px;\\n text-align: left;\\n text-overflow: ellipsis;\\n white-space: nowrap;\\n overflow: hidden;\\n}\\n.header-dialogs-container__buttons {\\n display: flex;\\n align-items: center;\\n gap: 29px;\\n background: none;\\n color: var(--color-icon);\\n}\\n.header-dialogs-container__buttons svg {\\n width: 32px;\\n height: 32px;\\n viewBox: 0 0 32px 32px;\\n}\\n.header-dialogs-container__buttons svg path {\\n fill: var(--color-icon);\\n}\\n\\n.header-dialogs {\\n border: 1px solid var(--color-divider);\\n}\", \"\"]);\n// Exports\n/* harmony default export */ __webpack_exports__[\"default\"] = (___CSS_LOADER_EXPORT___);\n\n\n//# sourceURL=webpack://quickblox-react-ui-kit/./src/Presentation/components/UI/Dialogs/HeaderDialogs/HeaderDialogs.scss?./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js");
127
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js */ \"./node_modules/css-loader/dist/runtime/noSourceMaps.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../../../node_modules/css-loader/dist/runtime/api.js */ \"./node_modules/css-loader/dist/runtime/api.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);\n// Imports\n\n\nvar ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));\n___CSS_LOADER_EXPORT___.push([module.id, \"@import url(https://fonts.googleapis.com/css2?family=Ubuntu:ital,wght@0,400;0,500;0,700;1,700&display=swap);\"]);\n___CSS_LOADER_EXPORT___.push([module.id, \"@import url(https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;600;700&display=swap);\"]);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \"@charset \\\"UTF-8\\\";\\n/* http://meyerweb.com/eric/tools/css/reset/\\n v2.0-modified | 20110126\\n License: none (public domain)\\n*/\\nhtml, body, div, span, applet, object, iframe,\\nh1, h2, h3, h4, h5, h6, p, blockquote, pre,\\na, abbr, acronym, address, big, cite, code,\\ndel, dfn, em, img, ins, kbd, q, s, samp,\\nsmall, strike, strong, sub, sup, tt, var,\\nb, u, i, center,\\ndl, dt, dd, ol, ul, li,\\nfieldset, form, label, legend,\\ntable, caption, tbody, tfoot, thead, tr, th, td,\\narticle, aside, canvas, details, embed,\\nfigure, figcaption, footer, header, hgroup,\\nmenu, nav, output, ruby, section, summary,\\ntime, mark, audio, video {\\n margin: 0;\\n padding: 0;\\n border: 0;\\n font-size: 100%;\\n font: inherit;\\n vertical-align: baseline;\\n}\\n\\n/* make sure to set some focus styles for accessibility */\\n:focus {\\n outline: 0;\\n}\\n\\n/* HTML5 display-role reset for older browsers */\\narticle, aside, details, figcaption, figure,\\nfooter, header, hgroup, menu, nav, section {\\n display: block;\\n}\\n\\nbody {\\n line-height: 1;\\n}\\n\\nol, ul {\\n list-style: none;\\n}\\n\\nblockquote, q {\\n quotes: none;\\n}\\n\\nblockquote:before, blockquote:after,\\nq:before, q:after {\\n content: \\\"\\\";\\n content: none;\\n}\\n\\ntable {\\n border-collapse: collapse;\\n border-spacing: 0;\\n}\\n\\ninput[type=search]::-webkit-search-cancel-button,\\ninput[type=search]::-webkit-search-decoration,\\ninput[type=search]::-webkit-search-results-button,\\ninput[type=search]::-webkit-search-results-decoration {\\n -webkit-appearance: none;\\n -moz-appearance: none;\\n}\\n\\ninput[type=search] {\\n -webkit-appearance: none;\\n -moz-appearance: none;\\n -webkit-box-sizing: content-box;\\n -moz-box-sizing: content-box;\\n box-sizing: content-box;\\n}\\n\\ntextarea {\\n overflow: auto;\\n vertical-align: top;\\n resize: vertical;\\n}\\n\\n/**\\n * Correct `inline-block` display not defined in IE 6/7/8/9 and Firefox 3.\\n */\\naudio,\\ncanvas,\\nvideo {\\n display: inline-block;\\n *display: inline;\\n *zoom: 1;\\n max-width: 100%;\\n}\\n\\n/**\\n * Prevent modern browsers from displaying `audio` without controls.\\n * Remove excess height in iOS 5 devices.\\n */\\naudio:not([controls]) {\\n display: none;\\n height: 0;\\n}\\n\\n/**\\n * Address styling not present in IE 7/8/9, Firefox 3, and Safari 4.\\n * Known issue: no IE 6 support.\\n */\\n[hidden] {\\n display: none;\\n}\\n\\n/**\\n * 1. Correct text resizing oddly in IE 6/7 when body `font-size` is set using\\n * `em` units.\\n * 2. Prevent iOS text size adjust after orientation change, without disabling\\n * user zoom.\\n */\\nhtml {\\n font-size: 100%; /* 1 */\\n -webkit-text-size-adjust: 100%; /* 2 */\\n -ms-text-size-adjust: 100%; /* 2 */\\n}\\n\\n/**\\n * Address `outline` inconsistency between Chrome and other browsers.\\n */\\na:focus {\\n outline: thin dotted;\\n}\\n\\n/**\\n * Improve readability when focused and also mouse hovered in all browsers.\\n */\\na:active,\\na:hover {\\n outline: 0;\\n}\\n\\n/**\\n * 1. Remove border when inside `a` element in IE 6/7/8/9 and Firefox 3.\\n * 2. Improve image quality when scaled in IE 7.\\n */\\nimg {\\n border: 0; /* 1 */\\n -ms-interpolation-mode: bicubic; /* 2 */\\n}\\n\\n/**\\n * Address margin not present in IE 6/7/8/9, Safari 5, and Opera 11.\\n */\\nfigure {\\n margin: 0;\\n}\\n\\n/**\\n * Correct margin displayed oddly in IE 6/7.\\n */\\nform {\\n margin: 0;\\n}\\n\\n/**\\n * Define consistent border, margin, and padding.\\n */\\nfieldset {\\n border: 1px solid #c0c0c0;\\n margin: 0 2px;\\n padding: 0.35em 0.625em 0.75em;\\n}\\n\\n/**\\n * 1. Correct color not being inherited in IE 6/7/8/9.\\n * 2. Correct text not wrapping in Firefox 3.\\n * 3. Correct alignment displayed oddly in IE 6/7.\\n */\\nlegend {\\n border: 0; /* 1 */\\n padding: 0;\\n white-space: normal; /* 2 */\\n *margin-left: -7px; /* 3 */\\n}\\n\\n/**\\n * 1. Correct font size not being inherited in all browsers.\\n * 2. Address margins set differently in IE 6/7, Firefox 3+, Safari 5,\\n * and Chrome.\\n * 3. Improve appearance and consistency in all browsers.\\n */\\nbutton,\\ninput,\\nselect,\\ntextarea {\\n font-size: 100%; /* 1 */\\n margin: 0; /* 2 */\\n vertical-align: baseline; /* 3 */\\n *vertical-align: middle; /* 3 */\\n}\\n\\n/**\\n * Address Firefox 3+ setting `line-height` on `input` using `!important` in\\n * the UA stylesheet.\\n */\\nbutton,\\ninput {\\n line-height: normal;\\n}\\n\\n/**\\n * Address inconsistent `text-transform` inheritance for `button` and `select`.\\n * All other form control elements do not inherit `text-transform` values.\\n * Correct `button` style inheritance in Chrome, Safari 5+, and IE 6+.\\n * Correct `select` style inheritance in Firefox 4+ and Opera.\\n */\\nbutton,\\nselect {\\n text-transform: none;\\n}\\n\\n/**\\n * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`\\n * and `video` controls.\\n * 2. Correct inability to style clickable `input` types in iOS.\\n * 3. Improve usability and consistency of cursor style between image-type\\n * `input` and others.\\n * 4. Remove inner spacing in IE 7 without affecting normal text inputs.\\n * Known issue: inner spacing remains in IE 6.\\n */\\nbutton,\\nhtml input[type=button],\\ninput[type=reset],\\ninput[type=submit] {\\n -webkit-appearance: button; /* 2 */\\n cursor: pointer; /* 3 */\\n *overflow: visible; /* 4 */\\n}\\n\\n/**\\n * Re-set default cursor for disabled elements.\\n */\\nbutton[disabled],\\nhtml input[disabled] {\\n cursor: default;\\n}\\n\\n/**\\n * 1. Address box sizing set to content-box in IE 8/9.\\n * 2. Remove excess padding in IE 8/9.\\n * 3. Remove excess padding in IE 7.\\n * Known issue: excess padding remains in IE 6.\\n */\\ninput[type=checkbox],\\ninput[type=radio] {\\n box-sizing: border-box; /* 1 */\\n padding: 0; /* 2 */\\n *height: 13px; /* 3 */\\n *width: 13px; /* 3 */\\n}\\n\\n/**\\n * 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome.\\n * 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome\\n * (include `-moz` to future-proof).\\n */\\ninput[type=search] {\\n -webkit-appearance: textfield; /* 1 */\\n -moz-box-sizing: content-box;\\n -webkit-box-sizing: content-box; /* 2 */\\n box-sizing: content-box;\\n}\\n\\n/**\\n * Remove inner padding and search cancel button in Safari 5 and Chrome\\n * on OS X.\\n */\\ninput[type=search]::-webkit-search-cancel-button,\\ninput[type=search]::-webkit-search-decoration {\\n -webkit-appearance: none;\\n}\\n\\n/**\\n * Remove inner padding and border in Firefox 3+.\\n */\\nbutton::-moz-focus-inner,\\ninput::-moz-focus-inner {\\n border: 0;\\n padding: 0;\\n}\\n\\n/**\\n * 1. Remove default vertical scrollbar in IE 6/7/8/9.\\n * 2. Improve readability and alignment in all browsers.\\n */\\ntextarea {\\n overflow: auto; /* 1 */\\n vertical-align: top; /* 2 */\\n}\\n\\n/**\\n * Remove most spacing between table cells.\\n */\\ntable {\\n border-collapse: collapse;\\n border-spacing: 0;\\n}\\n\\nhtml,\\nbutton,\\ninput,\\nselect,\\ntextarea {\\n color: #222;\\n}\\n\\n::-moz-selection {\\n background: #b3d4fc;\\n text-shadow: none;\\n}\\n\\n::selection {\\n background: #b3d4fc;\\n text-shadow: none;\\n}\\n\\nimg {\\n vertical-align: middle;\\n}\\n\\nfieldset {\\n border: 0;\\n margin: 0;\\n padding: 0;\\n}\\n\\ntextarea {\\n resize: vertical;\\n}\\n\\n.chromeframe {\\n margin: 0.2em 0;\\n background: #ccc;\\n color: #000;\\n padding: 0.2em 0;\\n}\\n\\n* {\\n padding: 0;\\n margin: 0;\\n border: 0;\\n}\\n\\n*, *:before, *:after {\\n -moz-box-sizing: border-box;\\n -webkit-box-sizing: border-box;\\n box-sizing: border-box;\\n}\\n\\n:focus, :active {\\n outline: none;\\n}\\n\\na:focus, a:active {\\n outline: none;\\n}\\n\\nnav, footer, header, aside {\\n display: block;\\n}\\n\\nhtml, body {\\n height: 100%;\\n width: 100%;\\n font-size: 100%;\\n line-height: 1;\\n font-size: 14px;\\n -ms-text-size-adjust: 100%;\\n -moz-text-size-adjust: 100%;\\n -webkit-text-size-adjust: 100%;\\n}\\n\\ninput, button, textarea {\\n font-family: inherit;\\n}\\n\\ninput::-ms-clear {\\n display: none;\\n}\\n\\nbutton {\\n cursor: pointer;\\n}\\n\\nbutton::-moz-focus-inner {\\n padding: 0;\\n border: 0;\\n}\\n\\na, a:visited {\\n text-decoration: none;\\n}\\n\\nul li {\\n list-style: none;\\n}\\n\\nimg {\\n vertical-align: top;\\n}\\n\\nh1, h2, h3, h4, h5, h6 {\\n font-size: inherit;\\n font-weight: 400;\\n}\\n\\n/*\\n@font-face {\\n font-family: \\\"Roboto-Regular\\\";\\n src: url(\\\"../fonts/Roboto-Regular.eot\\\");\\n src: local(\\\"☺\\\"), url(\\\"../fonts/Roboto-Regular.woff\\\") format(\\\"woff\\\"),\\n url(\\\"../fonts/Roboto-Regular.ttf\\\") format(\\\"truetype\\\");\\n font-weight: normal;\\n font-style: normal;\\n}\\n\\n@font-face {\\n font-family: \\\"Roboto-Medium\\\";\\n src: url(\\\"../fonts/Roboto-Medium.eot\\\");\\n src: local(\\\"☺\\\"), url(\\\"../fonts/Roboto-Medium.woff\\\") format(\\\"woff\\\"),\\n url(\\\"../fonts/Roboto-Medium.ttf\\\") format(\\\"truetype\\\");\\n font-weight: normal;\\n font-style: normal;\\n}\\n\\n@font-face {\\n font-family: \\\"Roboto-Bold\\\";\\n src: url(\\\"../fonts/Roboto-Bold.eot\\\");\\n src: local(\\\"☺\\\"), url(\\\"../fonts/Roboto-Bold.woff\\\") format(\\\"woff\\\"),\\n url(\\\"../fonts/Roboto-Bold.ttf\\\") format(\\\"truetype\\\");\\n font-weight: normal;\\n font-style: normal;\\n}\\n*/\\n:root {\\n --primary: #3978FC;\\n --color-background: #FFFFFF;\\n --color-background-modal: #C4D7FE;\\n --color-background-overlay: #0B121B;\\n --color-divider: #E7EFFF;\\n --color-font: #0B121B;\\n --color-icon: #3978FC;\\n --color-background-info:#C4D7FE;\\n --tertiary-elements: #636D78;\\n --main-elements: #3978FC;\\n --secondary-elements: #202F3E;\\n --input-elements: #202F3E;\\n --disabled-elements: #BCC1C5;\\n --field-border: #90979F;\\n --main-text: #0B121B;\\n --secondary-text: #636D78;\\n --caption: #90979F;\\n --main-background: #FFFFFF;\\n --secondary-background: #FFFFFF;\\n --secondary-background-modal: rgba(19, 29, 40, 0.8);\\n --incoming-background: #E4E6E8;\\n --outgoing-background: #E7EFFF;\\n --dropdown-background: #FFFFFF;\\n --chat-input: #F7F9FF;\\n --divider: #E7EFFF;\\n --error: #FF3B30;\\n --hightlight: #FFFDC1;\\n}\\n\\nhtml[data-theme=dark] {\\n --primary: #3978FC;\\n --color-background: #0B121B;\\n --color-background-modal: #131D28;\\n --color-background-overlay: #0B121B;\\n --color-divider: #414E5B;\\n --color-font: #FFFFFF;\\n --color-icon: #74A1FD;\\n --color-background-info: #3978FC;\\n --tertiary-elements: rgba(144, 151, 159, 0.8);\\n --main-elements: #74A1FD;\\n --secondary-elements: #FFFFFF;\\n --input-elements: #90979F;\\n --disabled-elements: #636D78;\\n --field-border: #90979F;\\n --main-text: #FFFFFF;\\n --secondary-text: #90979F;\\n --caption: #BCC1C5;\\n --main-background: #202F3E;\\n --secondary-background: #131D28;\\n --incoming-background: #414E5B;\\n --outgoing-background: #3978FC;\\n --dropdown-background: #414E5B;\\n --chat-input: #131D28;\\n --divider: #414E5B;\\n --error: #FF766E;\\n --hightlight: #FFFDC1;\\n}\\n\\n* {\\n box-sizing: border-box;\\n}\\n\\nbody {\\n font-family: \\\"Roboto\\\";\\n color: var(--main-text);\\n background-color: var(--main-background);\\n overflow: hidden !important;\\n scrollbar-width: none !important;\\n max-height: 810px;\\n max-width: 1380px;\\n}\\n\\n.header-dialogs-container {\\n display: flex;\\n height: 64px;\\n gap: 0 30px;\\n padding: 16px 16px 16px 20px;\\n}\\n.header-dialogs-container--title_wrapper {\\n font-family: \\\"Roboto\\\";\\n font-style: normal;\\n font-weight: 500;\\n font-size: 20px;\\n line-height: 24px;\\n letter-spacing: 0.0015em;\\n width: 180px;\\n text-align: left;\\n text-overflow: ellipsis;\\n white-space: nowrap;\\n overflow: hidden;\\n}\\n.header-dialogs-container__buttons {\\n display: flex;\\n align-items: center;\\n gap: 29px;\\n background: none;\\n color: var(--color-icon);\\n}\\n.header-dialogs-container__buttons svg {\\n width: 32px;\\n height: 32px;\\n viewBox: 0 0 32px 32px;\\n}\\n.header-dialogs-container__buttons svg path {\\n fill: var(--color-icon);\\n}\\n\\n.header-dialogs {\\n border: 1px solid var(--color-divider);\\n}\", \"\"]);\n// Exports\n/* harmony default export */ __webpack_exports__[\"default\"] = (___CSS_LOADER_EXPORT___);\n\n\n//# sourceURL=webpack://quickblox-react-ui-kit/./src/Presentation/components/UI/Dialogs/HeaderDialogs/HeaderDialogs.scss?./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js");
128
128
 
129
129
  /***/ }),
130
130
 
@@ -194,6 +194,17 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _nod
194
194
 
195
195
  /***/ }),
196
196
 
197
+ /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/Presentation/components/UI/Dialogs/MessagesView/HighLightLink/HighLightLink.scss":
198
+ /*!***************************************************************************************************************************************************************************!*\
199
+ !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/Presentation/components/UI/Dialogs/MessagesView/HighLightLink/HighLightLink.scss ***!
200
+ \***************************************************************************************************************************************************************************/
201
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
202
+
203
+ "use strict";
204
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js */ \"./node_modules/css-loader/dist/runtime/noSourceMaps.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../../../../node_modules/css-loader/dist/runtime/api.js */ \"./node_modules/css-loader/dist/runtime/api.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);\n// Imports\n\n\nvar ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".high-light-link-container {\\n display: flex;\\n flex-direction: column;\\n align-items: flex-start;\\n padding: 0px;\\n width: 240px;\\n height: 70px;\\n background: #E4E6E8;\\n border-radius: 8px;\\n flex: none;\\n order: 0;\\n flex-grow: 0;\\n}\\n.high-light-link-container--header-wrapper {\\n display: flex;\\n flex-direction: row;\\n align-items: center;\\n padding: 6px 16px;\\n width: 240px;\\n height: 32px;\\n flex: none;\\n order: 0;\\n align-self: stretch;\\n flex-grow: 0;\\n}\\n.high-light-link-container--header-wrapper__link_url {\\n width: 208px;\\n height: 20px;\\n text-decoration: none;\\n cursor: pointer;\\n font-family: \\\"Roboto\\\";\\n font-style: normal;\\n font-weight: 400;\\n font-size: 14px;\\n line-height: 20px;\\n display: flex;\\n align-items: center;\\n letter-spacing: 0.25px;\\n color: #636D78;\\n flex: none;\\n order: 0;\\n flex-grow: 1;\\n}\\n.high-light-link-container--footer-wrapper {\\n display: flex;\\n flex-direction: row;\\n align-items: center;\\n padding: 8px 16px;\\n width: 240px;\\n height: 32px;\\n flex: none;\\n order: 4;\\n align-self: stretch;\\n flex-grow: 0;\\n}\\n.high-light-link-container--footer-wrapper__content {\\n width: 208px;\\n height: 16px;\\n font-family: \\\"Roboto\\\";\\n font-style: normal;\\n font-weight: 500;\\n font-size: 11px;\\n line-height: 16px;\\n display: flex;\\n align-items: center;\\n letter-spacing: 0.5px;\\n color: #636D78;\\n flex: none;\\n order: 0;\\n flex-grow: 1;\\n}\", \"\"]);\n// Exports\n/* harmony default export */ __webpack_exports__[\"default\"] = (___CSS_LOADER_EXPORT___);\n\n\n//# sourceURL=webpack://quickblox-react-ui-kit/./src/Presentation/components/UI/Dialogs/MessagesView/HighLightLink/HighLightLink.scss?./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js");
205
+
206
+ /***/ }),
207
+
197
208
  /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/Presentation/components/UI/Dialogs/MessagesView/ImageAttachmentComponent/ImageAttachmentComponent.scss":
198
209
  /*!*************************************************************************************************************************************************************************************************!*\
199
210
  !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/Presentation/components/UI/Dialogs/MessagesView/ImageAttachmentComponent/ImageAttachmentComponent.scss ***!
@@ -245,7 +256,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _nod
245
256
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
246
257
 
247
258
  "use strict";
248
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js */ \"./node_modules/css-loader/dist/runtime/noSourceMaps.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../../../node_modules/css-loader/dist/runtime/api.js */ \"./node_modules/css-loader/dist/runtime/api.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);\n// Imports\n\n\nvar ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));\n___CSS_LOADER_EXPORT___.push([module.id, \"@import url(https://fonts.googleapis.com/css2?family=Ubuntu:ital,wght@0,400;0,500;0,700;1,700&display=swap);\"]);\n___CSS_LOADER_EXPORT___.push([module.id, \"@import url(https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;600;700&display=swap);\"]);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \"@charset \\\"UTF-8\\\";\\n/* http://meyerweb.com/eric/tools/css/reset/\\n v2.0-modified | 20110126\\n License: none (public domain)\\n*/\\nhtml, body, div, span, applet, object, iframe,\\nh1, h2, h3, h4, h5, h6, p, blockquote, pre,\\na, abbr, acronym, address, big, cite, code,\\ndel, dfn, em, img, ins, kbd, q, s, samp,\\nsmall, strike, strong, sub, sup, tt, var,\\nb, u, i, center,\\ndl, dt, dd, ol, ul, li,\\nfieldset, form, label, legend,\\ntable, caption, tbody, tfoot, thead, tr, th, td,\\narticle, aside, canvas, details, embed,\\nfigure, figcaption, footer, header, hgroup,\\nmenu, nav, output, ruby, section, summary,\\ntime, mark, audio, video {\\n margin: 0;\\n padding: 0;\\n border: 0;\\n font-size: 100%;\\n font: inherit;\\n vertical-align: baseline;\\n}\\n\\n/* make sure to set some focus styles for accessibility */\\n:focus {\\n outline: 0;\\n}\\n\\n/* HTML5 display-role reset for older browsers */\\narticle, aside, details, figcaption, figure,\\nfooter, header, hgroup, menu, nav, section {\\n display: block;\\n}\\n\\nbody {\\n line-height: 1;\\n}\\n\\nol, ul {\\n list-style: none;\\n}\\n\\nblockquote, q {\\n quotes: none;\\n}\\n\\nblockquote:before, blockquote:after,\\nq:before, q:after {\\n content: \\\"\\\";\\n content: none;\\n}\\n\\ntable {\\n border-collapse: collapse;\\n border-spacing: 0;\\n}\\n\\ninput[type=search]::-webkit-search-cancel-button,\\ninput[type=search]::-webkit-search-decoration,\\ninput[type=search]::-webkit-search-results-button,\\ninput[type=search]::-webkit-search-results-decoration {\\n -webkit-appearance: none;\\n -moz-appearance: none;\\n}\\n\\ninput[type=search] {\\n -webkit-appearance: none;\\n -moz-appearance: none;\\n -webkit-box-sizing: content-box;\\n -moz-box-sizing: content-box;\\n box-sizing: content-box;\\n}\\n\\ntextarea {\\n overflow: auto;\\n vertical-align: top;\\n resize: vertical;\\n}\\n\\n/**\\n * Correct `inline-block` display not defined in IE 6/7/8/9 and Firefox 3.\\n */\\naudio,\\ncanvas,\\nvideo {\\n display: inline-block;\\n *display: inline;\\n *zoom: 1;\\n max-width: 100%;\\n}\\n\\n/**\\n * Prevent modern browsers from displaying `audio` without controls.\\n * Remove excess height in iOS 5 devices.\\n */\\naudio:not([controls]) {\\n display: none;\\n height: 0;\\n}\\n\\n/**\\n * Address styling not present in IE 7/8/9, Firefox 3, and Safari 4.\\n * Known issue: no IE 6 support.\\n */\\n[hidden] {\\n display: none;\\n}\\n\\n/**\\n * 1. Correct text resizing oddly in IE 6/7 when body `font-size` is set using\\n * `em` units.\\n * 2. Prevent iOS text size adjust after orientation change, without disabling\\n * user zoom.\\n */\\nhtml {\\n font-size: 100%; /* 1 */\\n -webkit-text-size-adjust: 100%; /* 2 */\\n -ms-text-size-adjust: 100%; /* 2 */\\n}\\n\\n/**\\n * Address `outline` inconsistency between Chrome and other browsers.\\n */\\na:focus {\\n outline: thin dotted;\\n}\\n\\n/**\\n * Improve readability when focused and also mouse hovered in all browsers.\\n */\\na:active,\\na:hover {\\n outline: 0;\\n}\\n\\n/**\\n * 1. Remove border when inside `a` element in IE 6/7/8/9 and Firefox 3.\\n * 2. Improve image quality when scaled in IE 7.\\n */\\nimg {\\n border: 0; /* 1 */\\n -ms-interpolation-mode: bicubic; /* 2 */\\n}\\n\\n/**\\n * Address margin not present in IE 6/7/8/9, Safari 5, and Opera 11.\\n */\\nfigure {\\n margin: 0;\\n}\\n\\n/**\\n * Correct margin displayed oddly in IE 6/7.\\n */\\nform {\\n margin: 0;\\n}\\n\\n/**\\n * Define consistent border, margin, and padding.\\n */\\nfieldset {\\n border: 1px solid #c0c0c0;\\n margin: 0 2px;\\n padding: 0.35em 0.625em 0.75em;\\n}\\n\\n/**\\n * 1. Correct color not being inherited in IE 6/7/8/9.\\n * 2. Correct text not wrapping in Firefox 3.\\n * 3. Correct alignment displayed oddly in IE 6/7.\\n */\\nlegend {\\n border: 0; /* 1 */\\n padding: 0;\\n white-space: normal; /* 2 */\\n *margin-left: -7px; /* 3 */\\n}\\n\\n/**\\n * 1. Correct font size not being inherited in all browsers.\\n * 2. Address margins set differently in IE 6/7, Firefox 3+, Safari 5,\\n * and Chrome.\\n * 3. Improve appearance and consistency in all browsers.\\n */\\nbutton,\\ninput,\\nselect,\\ntextarea {\\n font-size: 100%; /* 1 */\\n margin: 0; /* 2 */\\n vertical-align: baseline; /* 3 */\\n *vertical-align: middle; /* 3 */\\n}\\n\\n/**\\n * Address Firefox 3+ setting `line-height` on `input` using `!important` in\\n * the UA stylesheet.\\n */\\nbutton,\\ninput {\\n line-height: normal;\\n}\\n\\n/**\\n * Address inconsistent `text-transform` inheritance for `button` and `select`.\\n * All other form control elements do not inherit `text-transform` values.\\n * Correct `button` style inheritance in Chrome, Safari 5+, and IE 6+.\\n * Correct `select` style inheritance in Firefox 4+ and Opera.\\n */\\nbutton,\\nselect {\\n text-transform: none;\\n}\\n\\n/**\\n * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`\\n * and `video` controls.\\n * 2. Correct inability to style clickable `input` types in iOS.\\n * 3. Improve usability and consistency of cursor style between image-type\\n * `input` and others.\\n * 4. Remove inner spacing in IE 7 without affecting normal text inputs.\\n * Known issue: inner spacing remains in IE 6.\\n */\\nbutton,\\nhtml input[type=button],\\ninput[type=reset],\\ninput[type=submit] {\\n -webkit-appearance: button; /* 2 */\\n cursor: pointer; /* 3 */\\n *overflow: visible; /* 4 */\\n}\\n\\n/**\\n * Re-set default cursor for disabled elements.\\n */\\nbutton[disabled],\\nhtml input[disabled] {\\n cursor: default;\\n}\\n\\n/**\\n * 1. Address box sizing set to content-box in IE 8/9.\\n * 2. Remove excess padding in IE 8/9.\\n * 3. Remove excess padding in IE 7.\\n * Known issue: excess padding remains in IE 6.\\n */\\ninput[type=checkbox],\\ninput[type=radio] {\\n box-sizing: border-box; /* 1 */\\n padding: 0; /* 2 */\\n *height: 13px; /* 3 */\\n *width: 13px; /* 3 */\\n}\\n\\n/**\\n * 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome.\\n * 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome\\n * (include `-moz` to future-proof).\\n */\\ninput[type=search] {\\n -webkit-appearance: textfield; /* 1 */\\n -moz-box-sizing: content-box;\\n -webkit-box-sizing: content-box; /* 2 */\\n box-sizing: content-box;\\n}\\n\\n/**\\n * Remove inner padding and search cancel button in Safari 5 and Chrome\\n * on OS X.\\n */\\ninput[type=search]::-webkit-search-cancel-button,\\ninput[type=search]::-webkit-search-decoration {\\n -webkit-appearance: none;\\n}\\n\\n/**\\n * Remove inner padding and border in Firefox 3+.\\n */\\nbutton::-moz-focus-inner,\\ninput::-moz-focus-inner {\\n border: 0;\\n padding: 0;\\n}\\n\\n/**\\n * 1. Remove default vertical scrollbar in IE 6/7/8/9.\\n * 2. Improve readability and alignment in all browsers.\\n */\\ntextarea {\\n overflow: auto; /* 1 */\\n vertical-align: top; /* 2 */\\n}\\n\\n/**\\n * Remove most spacing between table cells.\\n */\\ntable {\\n border-collapse: collapse;\\n border-spacing: 0;\\n}\\n\\nhtml,\\nbutton,\\ninput,\\nselect,\\ntextarea {\\n color: #222;\\n}\\n\\n::-moz-selection {\\n background: #b3d4fc;\\n text-shadow: none;\\n}\\n\\n::selection {\\n background: #b3d4fc;\\n text-shadow: none;\\n}\\n\\nimg {\\n vertical-align: middle;\\n}\\n\\nfieldset {\\n border: 0;\\n margin: 0;\\n padding: 0;\\n}\\n\\ntextarea {\\n resize: vertical;\\n}\\n\\n.chromeframe {\\n margin: 0.2em 0;\\n background: #ccc;\\n color: #000;\\n padding: 0.2em 0;\\n}\\n\\n* {\\n padding: 0;\\n margin: 0;\\n border: 0;\\n}\\n\\n*, *:before, *:after {\\n -moz-box-sizing: border-box;\\n -webkit-box-sizing: border-box;\\n box-sizing: border-box;\\n}\\n\\n:focus, :active {\\n outline: none;\\n}\\n\\na:focus, a:active {\\n outline: none;\\n}\\n\\nnav, footer, header, aside {\\n display: block;\\n}\\n\\nhtml, body {\\n height: 100%;\\n width: 100%;\\n font-size: 100%;\\n line-height: 1;\\n font-size: 14px;\\n -ms-text-size-adjust: 100%;\\n -moz-text-size-adjust: 100%;\\n -webkit-text-size-adjust: 100%;\\n}\\n\\ninput, button, textarea {\\n font-family: inherit;\\n}\\n\\ninput::-ms-clear {\\n display: none;\\n}\\n\\nbutton {\\n cursor: pointer;\\n}\\n\\nbutton::-moz-focus-inner {\\n padding: 0;\\n border: 0;\\n}\\n\\na, a:visited {\\n text-decoration: none;\\n}\\n\\nul li {\\n list-style: none;\\n}\\n\\nimg {\\n vertical-align: top;\\n}\\n\\nh1, h2, h3, h4, h5, h6 {\\n font-size: inherit;\\n font-weight: 400;\\n}\\n\\n/*\\n@font-face {\\n font-family: \\\"Roboto-Regular\\\";\\n src: url(\\\"../fonts/Roboto-Regular.eot\\\");\\n src: local(\\\"☺\\\"), url(\\\"../fonts/Roboto-Regular.woff\\\") format(\\\"woff\\\"),\\n url(\\\"../fonts/Roboto-Regular.ttf\\\") format(\\\"truetype\\\");\\n font-weight: normal;\\n font-style: normal;\\n}\\n\\n@font-face {\\n font-family: \\\"Roboto-Medium\\\";\\n src: url(\\\"../fonts/Roboto-Medium.eot\\\");\\n src: local(\\\"☺\\\"), url(\\\"../fonts/Roboto-Medium.woff\\\") format(\\\"woff\\\"),\\n url(\\\"../fonts/Roboto-Medium.ttf\\\") format(\\\"truetype\\\");\\n font-weight: normal;\\n font-style: normal;\\n}\\n\\n@font-face {\\n font-family: \\\"Roboto-Bold\\\";\\n src: url(\\\"../fonts/Roboto-Bold.eot\\\");\\n src: local(\\\"☺\\\"), url(\\\"../fonts/Roboto-Bold.woff\\\") format(\\\"woff\\\"),\\n url(\\\"../fonts/Roboto-Bold.ttf\\\") format(\\\"truetype\\\");\\n font-weight: normal;\\n font-style: normal;\\n}\\n*/\\n:root {\\n --primary: #3978FC;\\n --color-background: #FFFFFF;\\n --color-background-modal: #C4D7FE;\\n --color-background-overlay: #0B121B;\\n --color-divider: #E7EFFF;\\n --color-font: #0B121B;\\n --color-icon: #3978FC;\\n --color-background-info:#C4D7FE;\\n --tertiary-elements: #636D78;\\n --main-elements: #3978FC;\\n --secondary-elements: #202F3E;\\n --input-elements: #202F3E;\\n --disabled-elements: #BCC1C5;\\n --field-border: #90979F;\\n --main-text: #0B121B;\\n --secondary-text: #636D78;\\n --caption: #90979F;\\n --main-background: #FFFFFF;\\n --secondary-background: #FFFFFF;\\n --secondary-background-modal: rgba(19, 29, 40, 0.8);\\n --incoming-background: #E4E6E8;\\n --outgoing-background: #E7EFFF;\\n --dropdown-background: #FFFFFF;\\n --chat-input: #F7F9FF;\\n --divider: #E7EFFF;\\n --error: #FF3B30;\\n --hightlight: #FFFDC1;\\n}\\n\\nhtml[data-theme=dark] {\\n --primary: #3978FC;\\n --color-background: #0B121B;\\n --color-background-modal: #90979F;\\n --color-background-overlay: #0B121B;\\n --color-divider: #414E5B;\\n --color-font: #FFFFFF;\\n --color-icon: #3978FC;\\n --color-background-info: #3978FC;\\n --tertiary-elements: rgba(144, 151, 159, 0.8);\\n --main-elements: #74A1FD;\\n --secondary-elements: #FFFFFF;\\n --input-elements: #90979F;\\n --disabled-elements: #636D78;\\n --field-border: #90979F;\\n --main-text: #FFFFFF;\\n --secondary-text: #90979F;\\n --caption: #BCC1C5;\\n --main-background: #202F3E;\\n --secondary-background: #131D28;\\n --incoming-background: #414E5B;\\n --outgoing-background: #3978FC;\\n --dropdown-background: #414E5B;\\n --chat-input: #131D28;\\n --divider: #414E5B;\\n --error: #FF766E;\\n --hightlight: #FFFDC1;\\n}\\n\\n* {\\n box-sizing: border-box;\\n}\\n\\nbody {\\n font-family: \\\"Roboto\\\";\\n color: var(--main-text);\\n background-color: var(--main-background);\\n overflow: hidden !important;\\n scrollbar-width: none !important;\\n max-height: 810px;\\n max-width: 1380px;\\n}\\n\\n.preview-dialog-container {\\n height: 72px;\\n min-height: 72px;\\n min-width: 320px;\\n padding: 8px 16px;\\n border: 1px solid var(--color-divider);\\n}\\n.preview-dialog-container.preview-selected {\\n background-color: var(--color-divider);\\n}\\n.preview-dialog-container__text-title {\\n text-align: left;\\n max-width: 120px;\\n text-overflow: ellipsis;\\n white-space: nowrap;\\n overflow: hidden;\\n}\\n.preview-dialog-container__text {\\n position: relative;\\n font-size: 12px;\\n font-family: \\\"Roboto\\\";\\n color: var(--color-font);\\n width: 200px; /* Could be anything you like. */\\n}\\n.preview-dialog-container__text-left {\\n position: relative;\\n font-size: 12px;\\n font-family: \\\"Roboto\\\";\\n color: var(--color-font);\\n width: 180px; /* Could be anything you like. */\\n}\\n.preview-dialog-container__text-concat {\\n position: relative;\\n display: inline-block;\\n word-wrap: break-word;\\n overflow: hidden;\\n max-height: 24px; /* (Number of lines you want visible) * (line-height) */\\n line-height: 12px;\\n text-align: justify;\\n}\\n\\n.avatar-wrapper {\\n background: var(--caption);\\n width: 55px;\\n height: 55px;\\n border-radius: 50%;\\n display: flex;\\n align-items: center;\\n text-align: center;\\n margin: 0 auto;\\n}\\n.avatar-wrapper.public_avatar {\\n background: var(--color-background-modal);\\n}\\n.avatar-wrapper.icon_colors {\\n color: var(--color-icon);\\n background-color: var(--secondary-text);\\n}\\n\\n.badge-text-style {\\n align-items: center;\\n text-align: center;\\n margin: 0 auto;\\n padding-top: 2px;\\n}\", \"\"]);\n// Exports\n/* harmony default export */ __webpack_exports__[\"default\"] = (___CSS_LOADER_EXPORT___);\n\n\n//# sourceURL=webpack://quickblox-react-ui-kit/./src/Presentation/components/UI/Dialogs/PreviewDialog/PreviewDialog.scss?./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js");
259
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js */ \"./node_modules/css-loader/dist/runtime/noSourceMaps.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../../../node_modules/css-loader/dist/runtime/api.js */ \"./node_modules/css-loader/dist/runtime/api.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);\n// Imports\n\n\nvar ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));\n___CSS_LOADER_EXPORT___.push([module.id, \"@import url(https://fonts.googleapis.com/css2?family=Ubuntu:ital,wght@0,400;0,500;0,700;1,700&display=swap);\"]);\n___CSS_LOADER_EXPORT___.push([module.id, \"@import url(https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;600;700&display=swap);\"]);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \"@charset \\\"UTF-8\\\";\\n/* http://meyerweb.com/eric/tools/css/reset/\\n v2.0-modified | 20110126\\n License: none (public domain)\\n*/\\nhtml, body, div, span, applet, object, iframe,\\nh1, h2, h3, h4, h5, h6, p, blockquote, pre,\\na, abbr, acronym, address, big, cite, code,\\ndel, dfn, em, img, ins, kbd, q, s, samp,\\nsmall, strike, strong, sub, sup, tt, var,\\nb, u, i, center,\\ndl, dt, dd, ol, ul, li,\\nfieldset, form, label, legend,\\ntable, caption, tbody, tfoot, thead, tr, th, td,\\narticle, aside, canvas, details, embed,\\nfigure, figcaption, footer, header, hgroup,\\nmenu, nav, output, ruby, section, summary,\\ntime, mark, audio, video {\\n margin: 0;\\n padding: 0;\\n border: 0;\\n font-size: 100%;\\n font: inherit;\\n vertical-align: baseline;\\n}\\n\\n/* make sure to set some focus styles for accessibility */\\n:focus {\\n outline: 0;\\n}\\n\\n/* HTML5 display-role reset for older browsers */\\narticle, aside, details, figcaption, figure,\\nfooter, header, hgroup, menu, nav, section {\\n display: block;\\n}\\n\\nbody {\\n line-height: 1;\\n}\\n\\nol, ul {\\n list-style: none;\\n}\\n\\nblockquote, q {\\n quotes: none;\\n}\\n\\nblockquote:before, blockquote:after,\\nq:before, q:after {\\n content: \\\"\\\";\\n content: none;\\n}\\n\\ntable {\\n border-collapse: collapse;\\n border-spacing: 0;\\n}\\n\\ninput[type=search]::-webkit-search-cancel-button,\\ninput[type=search]::-webkit-search-decoration,\\ninput[type=search]::-webkit-search-results-button,\\ninput[type=search]::-webkit-search-results-decoration {\\n -webkit-appearance: none;\\n -moz-appearance: none;\\n}\\n\\ninput[type=search] {\\n -webkit-appearance: none;\\n -moz-appearance: none;\\n -webkit-box-sizing: content-box;\\n -moz-box-sizing: content-box;\\n box-sizing: content-box;\\n}\\n\\ntextarea {\\n overflow: auto;\\n vertical-align: top;\\n resize: vertical;\\n}\\n\\n/**\\n * Correct `inline-block` display not defined in IE 6/7/8/9 and Firefox 3.\\n */\\naudio,\\ncanvas,\\nvideo {\\n display: inline-block;\\n *display: inline;\\n *zoom: 1;\\n max-width: 100%;\\n}\\n\\n/**\\n * Prevent modern browsers from displaying `audio` without controls.\\n * Remove excess height in iOS 5 devices.\\n */\\naudio:not([controls]) {\\n display: none;\\n height: 0;\\n}\\n\\n/**\\n * Address styling not present in IE 7/8/9, Firefox 3, and Safari 4.\\n * Known issue: no IE 6 support.\\n */\\n[hidden] {\\n display: none;\\n}\\n\\n/**\\n * 1. Correct text resizing oddly in IE 6/7 when body `font-size` is set using\\n * `em` units.\\n * 2. Prevent iOS text size adjust after orientation change, without disabling\\n * user zoom.\\n */\\nhtml {\\n font-size: 100%; /* 1 */\\n -webkit-text-size-adjust: 100%; /* 2 */\\n -ms-text-size-adjust: 100%; /* 2 */\\n}\\n\\n/**\\n * Address `outline` inconsistency between Chrome and other browsers.\\n */\\na:focus {\\n outline: thin dotted;\\n}\\n\\n/**\\n * Improve readability when focused and also mouse hovered in all browsers.\\n */\\na:active,\\na:hover {\\n outline: 0;\\n}\\n\\n/**\\n * 1. Remove border when inside `a` element in IE 6/7/8/9 and Firefox 3.\\n * 2. Improve image quality when scaled in IE 7.\\n */\\nimg {\\n border: 0; /* 1 */\\n -ms-interpolation-mode: bicubic; /* 2 */\\n}\\n\\n/**\\n * Address margin not present in IE 6/7/8/9, Safari 5, and Opera 11.\\n */\\nfigure {\\n margin: 0;\\n}\\n\\n/**\\n * Correct margin displayed oddly in IE 6/7.\\n */\\nform {\\n margin: 0;\\n}\\n\\n/**\\n * Define consistent border, margin, and padding.\\n */\\nfieldset {\\n border: 1px solid #c0c0c0;\\n margin: 0 2px;\\n padding: 0.35em 0.625em 0.75em;\\n}\\n\\n/**\\n * 1. Correct color not being inherited in IE 6/7/8/9.\\n * 2. Correct text not wrapping in Firefox 3.\\n * 3. Correct alignment displayed oddly in IE 6/7.\\n */\\nlegend {\\n border: 0; /* 1 */\\n padding: 0;\\n white-space: normal; /* 2 */\\n *margin-left: -7px; /* 3 */\\n}\\n\\n/**\\n * 1. Correct font size not being inherited in all browsers.\\n * 2. Address margins set differently in IE 6/7, Firefox 3+, Safari 5,\\n * and Chrome.\\n * 3. Improve appearance and consistency in all browsers.\\n */\\nbutton,\\ninput,\\nselect,\\ntextarea {\\n font-size: 100%; /* 1 */\\n margin: 0; /* 2 */\\n vertical-align: baseline; /* 3 */\\n *vertical-align: middle; /* 3 */\\n}\\n\\n/**\\n * Address Firefox 3+ setting `line-height` on `input` using `!important` in\\n * the UA stylesheet.\\n */\\nbutton,\\ninput {\\n line-height: normal;\\n}\\n\\n/**\\n * Address inconsistent `text-transform` inheritance for `button` and `select`.\\n * All other form control elements do not inherit `text-transform` values.\\n * Correct `button` style inheritance in Chrome, Safari 5+, and IE 6+.\\n * Correct `select` style inheritance in Firefox 4+ and Opera.\\n */\\nbutton,\\nselect {\\n text-transform: none;\\n}\\n\\n/**\\n * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`\\n * and `video` controls.\\n * 2. Correct inability to style clickable `input` types in iOS.\\n * 3. Improve usability and consistency of cursor style between image-type\\n * `input` and others.\\n * 4. Remove inner spacing in IE 7 without affecting normal text inputs.\\n * Known issue: inner spacing remains in IE 6.\\n */\\nbutton,\\nhtml input[type=button],\\ninput[type=reset],\\ninput[type=submit] {\\n -webkit-appearance: button; /* 2 */\\n cursor: pointer; /* 3 */\\n *overflow: visible; /* 4 */\\n}\\n\\n/**\\n * Re-set default cursor for disabled elements.\\n */\\nbutton[disabled],\\nhtml input[disabled] {\\n cursor: default;\\n}\\n\\n/**\\n * 1. Address box sizing set to content-box in IE 8/9.\\n * 2. Remove excess padding in IE 8/9.\\n * 3. Remove excess padding in IE 7.\\n * Known issue: excess padding remains in IE 6.\\n */\\ninput[type=checkbox],\\ninput[type=radio] {\\n box-sizing: border-box; /* 1 */\\n padding: 0; /* 2 */\\n *height: 13px; /* 3 */\\n *width: 13px; /* 3 */\\n}\\n\\n/**\\n * 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome.\\n * 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome\\n * (include `-moz` to future-proof).\\n */\\ninput[type=search] {\\n -webkit-appearance: textfield; /* 1 */\\n -moz-box-sizing: content-box;\\n -webkit-box-sizing: content-box; /* 2 */\\n box-sizing: content-box;\\n}\\n\\n/**\\n * Remove inner padding and search cancel button in Safari 5 and Chrome\\n * on OS X.\\n */\\ninput[type=search]::-webkit-search-cancel-button,\\ninput[type=search]::-webkit-search-decoration {\\n -webkit-appearance: none;\\n}\\n\\n/**\\n * Remove inner padding and border in Firefox 3+.\\n */\\nbutton::-moz-focus-inner,\\ninput::-moz-focus-inner {\\n border: 0;\\n padding: 0;\\n}\\n\\n/**\\n * 1. Remove default vertical scrollbar in IE 6/7/8/9.\\n * 2. Improve readability and alignment in all browsers.\\n */\\ntextarea {\\n overflow: auto; /* 1 */\\n vertical-align: top; /* 2 */\\n}\\n\\n/**\\n * Remove most spacing between table cells.\\n */\\ntable {\\n border-collapse: collapse;\\n border-spacing: 0;\\n}\\n\\nhtml,\\nbutton,\\ninput,\\nselect,\\ntextarea {\\n color: #222;\\n}\\n\\n::-moz-selection {\\n background: #b3d4fc;\\n text-shadow: none;\\n}\\n\\n::selection {\\n background: #b3d4fc;\\n text-shadow: none;\\n}\\n\\nimg {\\n vertical-align: middle;\\n}\\n\\nfieldset {\\n border: 0;\\n margin: 0;\\n padding: 0;\\n}\\n\\ntextarea {\\n resize: vertical;\\n}\\n\\n.chromeframe {\\n margin: 0.2em 0;\\n background: #ccc;\\n color: #000;\\n padding: 0.2em 0;\\n}\\n\\n* {\\n padding: 0;\\n margin: 0;\\n border: 0;\\n}\\n\\n*, *:before, *:after {\\n -moz-box-sizing: border-box;\\n -webkit-box-sizing: border-box;\\n box-sizing: border-box;\\n}\\n\\n:focus, :active {\\n outline: none;\\n}\\n\\na:focus, a:active {\\n outline: none;\\n}\\n\\nnav, footer, header, aside {\\n display: block;\\n}\\n\\nhtml, body {\\n height: 100%;\\n width: 100%;\\n font-size: 100%;\\n line-height: 1;\\n font-size: 14px;\\n -ms-text-size-adjust: 100%;\\n -moz-text-size-adjust: 100%;\\n -webkit-text-size-adjust: 100%;\\n}\\n\\ninput, button, textarea {\\n font-family: inherit;\\n}\\n\\ninput::-ms-clear {\\n display: none;\\n}\\n\\nbutton {\\n cursor: pointer;\\n}\\n\\nbutton::-moz-focus-inner {\\n padding: 0;\\n border: 0;\\n}\\n\\na, a:visited {\\n text-decoration: none;\\n}\\n\\nul li {\\n list-style: none;\\n}\\n\\nimg {\\n vertical-align: top;\\n}\\n\\nh1, h2, h3, h4, h5, h6 {\\n font-size: inherit;\\n font-weight: 400;\\n}\\n\\n/*\\n@font-face {\\n font-family: \\\"Roboto-Regular\\\";\\n src: url(\\\"../fonts/Roboto-Regular.eot\\\");\\n src: local(\\\"☺\\\"), url(\\\"../fonts/Roboto-Regular.woff\\\") format(\\\"woff\\\"),\\n url(\\\"../fonts/Roboto-Regular.ttf\\\") format(\\\"truetype\\\");\\n font-weight: normal;\\n font-style: normal;\\n}\\n\\n@font-face {\\n font-family: \\\"Roboto-Medium\\\";\\n src: url(\\\"../fonts/Roboto-Medium.eot\\\");\\n src: local(\\\"☺\\\"), url(\\\"../fonts/Roboto-Medium.woff\\\") format(\\\"woff\\\"),\\n url(\\\"../fonts/Roboto-Medium.ttf\\\") format(\\\"truetype\\\");\\n font-weight: normal;\\n font-style: normal;\\n}\\n\\n@font-face {\\n font-family: \\\"Roboto-Bold\\\";\\n src: url(\\\"../fonts/Roboto-Bold.eot\\\");\\n src: local(\\\"☺\\\"), url(\\\"../fonts/Roboto-Bold.woff\\\") format(\\\"woff\\\"),\\n url(\\\"../fonts/Roboto-Bold.ttf\\\") format(\\\"truetype\\\");\\n font-weight: normal;\\n font-style: normal;\\n}\\n*/\\n:root {\\n --primary: #3978FC;\\n --color-background: #FFFFFF;\\n --color-background-modal: #C4D7FE;\\n --color-background-overlay: #0B121B;\\n --color-divider: #E7EFFF;\\n --color-font: #0B121B;\\n --color-icon: #3978FC;\\n --color-background-info:#C4D7FE;\\n --tertiary-elements: #636D78;\\n --main-elements: #3978FC;\\n --secondary-elements: #202F3E;\\n --input-elements: #202F3E;\\n --disabled-elements: #BCC1C5;\\n --field-border: #90979F;\\n --main-text: #0B121B;\\n --secondary-text: #636D78;\\n --caption: #90979F;\\n --main-background: #FFFFFF;\\n --secondary-background: #FFFFFF;\\n --secondary-background-modal: rgba(19, 29, 40, 0.8);\\n --incoming-background: #E4E6E8;\\n --outgoing-background: #E7EFFF;\\n --dropdown-background: #FFFFFF;\\n --chat-input: #F7F9FF;\\n --divider: #E7EFFF;\\n --error: #FF3B30;\\n --hightlight: #FFFDC1;\\n}\\n\\nhtml[data-theme=dark] {\\n --primary: #3978FC;\\n --color-background: #0B121B;\\n --color-background-modal: #131D28;\\n --color-background-overlay: #0B121B;\\n --color-divider: #414E5B;\\n --color-font: #FFFFFF;\\n --color-icon: #74A1FD;\\n --color-background-info: #3978FC;\\n --tertiary-elements: rgba(144, 151, 159, 0.8);\\n --main-elements: #74A1FD;\\n --secondary-elements: #FFFFFF;\\n --input-elements: #90979F;\\n --disabled-elements: #636D78;\\n --field-border: #90979F;\\n --main-text: #FFFFFF;\\n --secondary-text: #90979F;\\n --caption: #BCC1C5;\\n --main-background: #202F3E;\\n --secondary-background: #131D28;\\n --incoming-background: #414E5B;\\n --outgoing-background: #3978FC;\\n --dropdown-background: #414E5B;\\n --chat-input: #131D28;\\n --divider: #414E5B;\\n --error: #FF766E;\\n --hightlight: #FFFDC1;\\n}\\n\\n* {\\n box-sizing: border-box;\\n}\\n\\nbody {\\n font-family: \\\"Roboto\\\";\\n color: var(--main-text);\\n background-color: var(--main-background);\\n overflow: hidden !important;\\n scrollbar-width: none !important;\\n max-height: 810px;\\n max-width: 1380px;\\n}\\n\\n.preview-dialog-container {\\n height: 72px;\\n min-height: 72px;\\n min-width: 320px;\\n padding: 8px 16px;\\n border: 1px solid var(--color-divider);\\n}\\n.preview-dialog-container.preview-selected {\\n background-color: var(--color-divider);\\n}\\n.preview-dialog-container__text-title {\\n text-align: left;\\n max-width: 120px;\\n text-overflow: ellipsis;\\n white-space: nowrap;\\n overflow: hidden;\\n}\\n.preview-dialog-container__text {\\n position: relative;\\n font-size: 12px;\\n font-family: \\\"Roboto\\\";\\n color: var(--color-font);\\n width: 200px; /* Could be anything you like. */\\n}\\n.preview-dialog-container__text-left {\\n position: relative;\\n font-size: 12px;\\n font-family: \\\"Roboto\\\";\\n color: var(--color-font);\\n width: 180px; /* Could be anything you like. */\\n}\\n.preview-dialog-container__text-concat {\\n position: relative;\\n display: inline-block;\\n word-wrap: break-word;\\n overflow: hidden;\\n max-height: 24px; /* (Number of lines you want visible) * (line-height) */\\n line-height: 12px;\\n text-align: justify;\\n}\\n\\n.avatar-wrapper {\\n background: var(--caption);\\n width: 55px;\\n height: 55px;\\n border-radius: 50%;\\n display: flex;\\n align-items: center;\\n text-align: center;\\n margin: 0 auto;\\n}\\n.avatar-wrapper.public_avatar {\\n background: var(--color-background-modal);\\n}\\n.avatar-wrapper.icon_colors {\\n color: var(--color-icon);\\n background-color: var(--secondary-text);\\n}\\n\\n.badge-text-style {\\n align-items: center;\\n text-align: center;\\n margin: 0 auto;\\n padding-top: 2px;\\n}\", \"\"]);\n// Exports\n/* harmony default export */ __webpack_exports__[\"default\"] = (___CSS_LOADER_EXPORT___);\n\n\n//# sourceURL=webpack://quickblox-react-ui-kit/./src/Presentation/components/UI/Dialogs/PreviewDialog/PreviewDialog.scss?./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js");
249
260
 
250
261
  /***/ }),
251
262
 
@@ -388,7 +399,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _nod
388
399
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
389
400
 
390
401
  "use strict";
391
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/noSourceMaps.js */ \"./node_modules/css-loader/dist/runtime/noSourceMaps.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/api.js */ \"./node_modules/css-loader/dist/runtime/api.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);\n// Imports\n\n\nvar ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));\n___CSS_LOADER_EXPORT___.push([module.id, \"@import url(https://fonts.googleapis.com/css2?family=Ubuntu:ital,wght@0,400;0,500;0,700;1,700&display=swap);\"]);\n___CSS_LOADER_EXPORT___.push([module.id, \"@import url(https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;600;700&display=swap);\"]);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \"@charset \\\"UTF-8\\\";\\n/* http://meyerweb.com/eric/tools/css/reset/\\n v2.0-modified | 20110126\\n License: none (public domain)\\n*/\\nhtml, body, div, span, applet, object, iframe,\\nh1, h2, h3, h4, h5, h6, p, blockquote, pre,\\na, abbr, acronym, address, big, cite, code,\\ndel, dfn, em, img, ins, kbd, q, s, samp,\\nsmall, strike, strong, sub, sup, tt, var,\\nb, u, i, center,\\ndl, dt, dd, ol, ul, li,\\nfieldset, form, label, legend,\\ntable, caption, tbody, tfoot, thead, tr, th, td,\\narticle, aside, canvas, details, embed,\\nfigure, figcaption, footer, header, hgroup,\\nmenu, nav, output, ruby, section, summary,\\ntime, mark, audio, video {\\n margin: 0;\\n padding: 0;\\n border: 0;\\n font-size: 100%;\\n font: inherit;\\n vertical-align: baseline;\\n}\\n\\n/* make sure to set some focus styles for accessibility */\\n:focus {\\n outline: 0;\\n}\\n\\n/* HTML5 display-role reset for older browsers */\\narticle, aside, details, figcaption, figure,\\nfooter, header, hgroup, menu, nav, section {\\n display: block;\\n}\\n\\nbody {\\n line-height: 1;\\n}\\n\\nol, ul {\\n list-style: none;\\n}\\n\\nblockquote, q {\\n quotes: none;\\n}\\n\\nblockquote:before, blockquote:after,\\nq:before, q:after {\\n content: \\\"\\\";\\n content: none;\\n}\\n\\ntable {\\n border-collapse: collapse;\\n border-spacing: 0;\\n}\\n\\ninput[type=search]::-webkit-search-cancel-button,\\ninput[type=search]::-webkit-search-decoration,\\ninput[type=search]::-webkit-search-results-button,\\ninput[type=search]::-webkit-search-results-decoration {\\n -webkit-appearance: none;\\n -moz-appearance: none;\\n}\\n\\ninput[type=search] {\\n -webkit-appearance: none;\\n -moz-appearance: none;\\n -webkit-box-sizing: content-box;\\n -moz-box-sizing: content-box;\\n box-sizing: content-box;\\n}\\n\\ntextarea {\\n overflow: auto;\\n vertical-align: top;\\n resize: vertical;\\n}\\n\\n/**\\n * Correct `inline-block` display not defined in IE 6/7/8/9 and Firefox 3.\\n */\\naudio,\\ncanvas,\\nvideo {\\n display: inline-block;\\n *display: inline;\\n *zoom: 1;\\n max-width: 100%;\\n}\\n\\n/**\\n * Prevent modern browsers from displaying `audio` without controls.\\n * Remove excess height in iOS 5 devices.\\n */\\naudio:not([controls]) {\\n display: none;\\n height: 0;\\n}\\n\\n/**\\n * Address styling not present in IE 7/8/9, Firefox 3, and Safari 4.\\n * Known issue: no IE 6 support.\\n */\\n[hidden] {\\n display: none;\\n}\\n\\n/**\\n * 1. Correct text resizing oddly in IE 6/7 when body `font-size` is set using\\n * `em` units.\\n * 2. Prevent iOS text size adjust after orientation change, without disabling\\n * user zoom.\\n */\\nhtml {\\n font-size: 100%; /* 1 */\\n -webkit-text-size-adjust: 100%; /* 2 */\\n -ms-text-size-adjust: 100%; /* 2 */\\n}\\n\\n/**\\n * Address `outline` inconsistency between Chrome and other browsers.\\n */\\na:focus {\\n outline: thin dotted;\\n}\\n\\n/**\\n * Improve readability when focused and also mouse hovered in all browsers.\\n */\\na:active,\\na:hover {\\n outline: 0;\\n}\\n\\n/**\\n * 1. Remove border when inside `a` element in IE 6/7/8/9 and Firefox 3.\\n * 2. Improve image quality when scaled in IE 7.\\n */\\nimg {\\n border: 0; /* 1 */\\n -ms-interpolation-mode: bicubic; /* 2 */\\n}\\n\\n/**\\n * Address margin not present in IE 6/7/8/9, Safari 5, and Opera 11.\\n */\\nfigure {\\n margin: 0;\\n}\\n\\n/**\\n * Correct margin displayed oddly in IE 6/7.\\n */\\nform {\\n margin: 0;\\n}\\n\\n/**\\n * Define consistent border, margin, and padding.\\n */\\nfieldset {\\n border: 1px solid #c0c0c0;\\n margin: 0 2px;\\n padding: 0.35em 0.625em 0.75em;\\n}\\n\\n/**\\n * 1. Correct color not being inherited in IE 6/7/8/9.\\n * 2. Correct text not wrapping in Firefox 3.\\n * 3. Correct alignment displayed oddly in IE 6/7.\\n */\\nlegend {\\n border: 0; /* 1 */\\n padding: 0;\\n white-space: normal; /* 2 */\\n *margin-left: -7px; /* 3 */\\n}\\n\\n/**\\n * 1. Correct font size not being inherited in all browsers.\\n * 2. Address margins set differently in IE 6/7, Firefox 3+, Safari 5,\\n * and Chrome.\\n * 3. Improve appearance and consistency in all browsers.\\n */\\nbutton,\\ninput,\\nselect,\\ntextarea {\\n font-size: 100%; /* 1 */\\n margin: 0; /* 2 */\\n vertical-align: baseline; /* 3 */\\n *vertical-align: middle; /* 3 */\\n}\\n\\n/**\\n * Address Firefox 3+ setting `line-height` on `input` using `!important` in\\n * the UA stylesheet.\\n */\\nbutton,\\ninput {\\n line-height: normal;\\n}\\n\\n/**\\n * Address inconsistent `text-transform` inheritance for `button` and `select`.\\n * All other form control elements do not inherit `text-transform` values.\\n * Correct `button` style inheritance in Chrome, Safari 5+, and IE 6+.\\n * Correct `select` style inheritance in Firefox 4+ and Opera.\\n */\\nbutton,\\nselect {\\n text-transform: none;\\n}\\n\\n/**\\n * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`\\n * and `video` controls.\\n * 2. Correct inability to style clickable `input` types in iOS.\\n * 3. Improve usability and consistency of cursor style between image-type\\n * `input` and others.\\n * 4. Remove inner spacing in IE 7 without affecting normal text inputs.\\n * Known issue: inner spacing remains in IE 6.\\n */\\nbutton,\\nhtml input[type=button],\\ninput[type=reset],\\ninput[type=submit] {\\n -webkit-appearance: button; /* 2 */\\n cursor: pointer; /* 3 */\\n *overflow: visible; /* 4 */\\n}\\n\\n/**\\n * Re-set default cursor for disabled elements.\\n */\\nbutton[disabled],\\nhtml input[disabled] {\\n cursor: default;\\n}\\n\\n/**\\n * 1. Address box sizing set to content-box in IE 8/9.\\n * 2. Remove excess padding in IE 8/9.\\n * 3. Remove excess padding in IE 7.\\n * Known issue: excess padding remains in IE 6.\\n */\\ninput[type=checkbox],\\ninput[type=radio] {\\n box-sizing: border-box; /* 1 */\\n padding: 0; /* 2 */\\n *height: 13px; /* 3 */\\n *width: 13px; /* 3 */\\n}\\n\\n/**\\n * 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome.\\n * 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome\\n * (include `-moz` to future-proof).\\n */\\ninput[type=search] {\\n -webkit-appearance: textfield; /* 1 */\\n -moz-box-sizing: content-box;\\n -webkit-box-sizing: content-box; /* 2 */\\n box-sizing: content-box;\\n}\\n\\n/**\\n * Remove inner padding and search cancel button in Safari 5 and Chrome\\n * on OS X.\\n */\\ninput[type=search]::-webkit-search-cancel-button,\\ninput[type=search]::-webkit-search-decoration {\\n -webkit-appearance: none;\\n}\\n\\n/**\\n * Remove inner padding and border in Firefox 3+.\\n */\\nbutton::-moz-focus-inner,\\ninput::-moz-focus-inner {\\n border: 0;\\n padding: 0;\\n}\\n\\n/**\\n * 1. Remove default vertical scrollbar in IE 6/7/8/9.\\n * 2. Improve readability and alignment in all browsers.\\n */\\ntextarea {\\n overflow: auto; /* 1 */\\n vertical-align: top; /* 2 */\\n}\\n\\n/**\\n * Remove most spacing between table cells.\\n */\\ntable {\\n border-collapse: collapse;\\n border-spacing: 0;\\n}\\n\\nhtml,\\nbutton,\\ninput,\\nselect,\\ntextarea {\\n color: #222;\\n}\\n\\n::-moz-selection {\\n background: #b3d4fc;\\n text-shadow: none;\\n}\\n\\n::selection {\\n background: #b3d4fc;\\n text-shadow: none;\\n}\\n\\nimg {\\n vertical-align: middle;\\n}\\n\\nfieldset {\\n border: 0;\\n margin: 0;\\n padding: 0;\\n}\\n\\ntextarea {\\n resize: vertical;\\n}\\n\\n.chromeframe {\\n margin: 0.2em 0;\\n background: #ccc;\\n color: #000;\\n padding: 0.2em 0;\\n}\\n\\n* {\\n padding: 0;\\n margin: 0;\\n border: 0;\\n}\\n\\n*, *:before, *:after {\\n -moz-box-sizing: border-box;\\n -webkit-box-sizing: border-box;\\n box-sizing: border-box;\\n}\\n\\n:focus, :active {\\n outline: none;\\n}\\n\\na:focus, a:active {\\n outline: none;\\n}\\n\\nnav, footer, header, aside {\\n display: block;\\n}\\n\\nhtml, body {\\n height: 100%;\\n width: 100%;\\n font-size: 100%;\\n line-height: 1;\\n font-size: 14px;\\n -ms-text-size-adjust: 100%;\\n -moz-text-size-adjust: 100%;\\n -webkit-text-size-adjust: 100%;\\n}\\n\\ninput, button, textarea {\\n font-family: inherit;\\n}\\n\\ninput::-ms-clear {\\n display: none;\\n}\\n\\nbutton {\\n cursor: pointer;\\n}\\n\\nbutton::-moz-focus-inner {\\n padding: 0;\\n border: 0;\\n}\\n\\na, a:visited {\\n text-decoration: none;\\n}\\n\\nul li {\\n list-style: none;\\n}\\n\\nimg {\\n vertical-align: top;\\n}\\n\\nh1, h2, h3, h4, h5, h6 {\\n font-size: inherit;\\n font-weight: 400;\\n}\\n\\n/*\\n@font-face {\\n font-family: \\\"Roboto-Regular\\\";\\n src: url(\\\"../fonts/Roboto-Regular.eot\\\");\\n src: local(\\\"☺\\\"), url(\\\"../fonts/Roboto-Regular.woff\\\") format(\\\"woff\\\"),\\n url(\\\"../fonts/Roboto-Regular.ttf\\\") format(\\\"truetype\\\");\\n font-weight: normal;\\n font-style: normal;\\n}\\n\\n@font-face {\\n font-family: \\\"Roboto-Medium\\\";\\n src: url(\\\"../fonts/Roboto-Medium.eot\\\");\\n src: local(\\\"☺\\\"), url(\\\"../fonts/Roboto-Medium.woff\\\") format(\\\"woff\\\"),\\n url(\\\"../fonts/Roboto-Medium.ttf\\\") format(\\\"truetype\\\");\\n font-weight: normal;\\n font-style: normal;\\n}\\n\\n@font-face {\\n font-family: \\\"Roboto-Bold\\\";\\n src: url(\\\"../fonts/Roboto-Bold.eot\\\");\\n src: local(\\\"☺\\\"), url(\\\"../fonts/Roboto-Bold.woff\\\") format(\\\"woff\\\"),\\n url(\\\"../fonts/Roboto-Bold.ttf\\\") format(\\\"truetype\\\");\\n font-weight: normal;\\n font-style: normal;\\n}\\n*/\\n:root {\\n --primary: #3978FC;\\n --color-background: #FFFFFF;\\n --color-background-modal: #C4D7FE;\\n --color-background-overlay: #0B121B;\\n --color-divider: #E7EFFF;\\n --color-font: #0B121B;\\n --color-icon: #3978FC;\\n --color-background-info:#C4D7FE;\\n --tertiary-elements: #636D78;\\n --main-elements: #3978FC;\\n --secondary-elements: #202F3E;\\n --input-elements: #202F3E;\\n --disabled-elements: #BCC1C5;\\n --field-border: #90979F;\\n --main-text: #0B121B;\\n --secondary-text: #636D78;\\n --caption: #90979F;\\n --main-background: #FFFFFF;\\n --secondary-background: #FFFFFF;\\n --secondary-background-modal: rgba(19, 29, 40, 0.8);\\n --incoming-background: #E4E6E8;\\n --outgoing-background: #E7EFFF;\\n --dropdown-background: #FFFFFF;\\n --chat-input: #F7F9FF;\\n --divider: #E7EFFF;\\n --error: #FF3B30;\\n --hightlight: #FFFDC1;\\n}\\n\\nhtml[data-theme=dark] {\\n --primary: #3978FC;\\n --color-background: #0B121B;\\n --color-background-modal: #90979F;\\n --color-background-overlay: #0B121B;\\n --color-divider: #414E5B;\\n --color-font: #FFFFFF;\\n --color-icon: #3978FC;\\n --color-background-info: #3978FC;\\n --tertiary-elements: rgba(144, 151, 159, 0.8);\\n --main-elements: #74A1FD;\\n --secondary-elements: #FFFFFF;\\n --input-elements: #90979F;\\n --disabled-elements: #636D78;\\n --field-border: #90979F;\\n --main-text: #FFFFFF;\\n --secondary-text: #90979F;\\n --caption: #BCC1C5;\\n --main-background: #202F3E;\\n --secondary-background: #131D28;\\n --incoming-background: #414E5B;\\n --outgoing-background: #3978FC;\\n --dropdown-background: #414E5B;\\n --chat-input: #131D28;\\n --divider: #414E5B;\\n --error: #FF766E;\\n --hightlight: #FFFDC1;\\n}\\n\\n* {\\n box-sizing: border-box;\\n}\\n\\nbody {\\n font-family: \\\"Roboto\\\";\\n color: var(--main-text);\\n background-color: var(--main-background);\\n overflow: hidden !important;\\n scrollbar-width: none !important;\\n max-height: 810px;\\n max-width: 1380px;\\n}\", \"\"]);\n// Exports\n/* harmony default export */ __webpack_exports__[\"default\"] = (___CSS_LOADER_EXPORT___);\n\n\n//# sourceURL=webpack://quickblox-react-ui-kit/./src/index.scss?./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js");
402
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/noSourceMaps.js */ \"./node_modules/css-loader/dist/runtime/noSourceMaps.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/api.js */ \"./node_modules/css-loader/dist/runtime/api.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);\n// Imports\n\n\nvar ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));\n___CSS_LOADER_EXPORT___.push([module.id, \"@import url(https://fonts.googleapis.com/css2?family=Ubuntu:ital,wght@0,400;0,500;0,700;1,700&display=swap);\"]);\n___CSS_LOADER_EXPORT___.push([module.id, \"@import url(https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;600;700&display=swap);\"]);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \"@charset \\\"UTF-8\\\";\\n/* http://meyerweb.com/eric/tools/css/reset/\\n v2.0-modified | 20110126\\n License: none (public domain)\\n*/\\nhtml, body, div, span, applet, object, iframe,\\nh1, h2, h3, h4, h5, h6, p, blockquote, pre,\\na, abbr, acronym, address, big, cite, code,\\ndel, dfn, em, img, ins, kbd, q, s, samp,\\nsmall, strike, strong, sub, sup, tt, var,\\nb, u, i, center,\\ndl, dt, dd, ol, ul, li,\\nfieldset, form, label, legend,\\ntable, caption, tbody, tfoot, thead, tr, th, td,\\narticle, aside, canvas, details, embed,\\nfigure, figcaption, footer, header, hgroup,\\nmenu, nav, output, ruby, section, summary,\\ntime, mark, audio, video {\\n margin: 0;\\n padding: 0;\\n border: 0;\\n font-size: 100%;\\n font: inherit;\\n vertical-align: baseline;\\n}\\n\\n/* make sure to set some focus styles for accessibility */\\n:focus {\\n outline: 0;\\n}\\n\\n/* HTML5 display-role reset for older browsers */\\narticle, aside, details, figcaption, figure,\\nfooter, header, hgroup, menu, nav, section {\\n display: block;\\n}\\n\\nbody {\\n line-height: 1;\\n}\\n\\nol, ul {\\n list-style: none;\\n}\\n\\nblockquote, q {\\n quotes: none;\\n}\\n\\nblockquote:before, blockquote:after,\\nq:before, q:after {\\n content: \\\"\\\";\\n content: none;\\n}\\n\\ntable {\\n border-collapse: collapse;\\n border-spacing: 0;\\n}\\n\\ninput[type=search]::-webkit-search-cancel-button,\\ninput[type=search]::-webkit-search-decoration,\\ninput[type=search]::-webkit-search-results-button,\\ninput[type=search]::-webkit-search-results-decoration {\\n -webkit-appearance: none;\\n -moz-appearance: none;\\n}\\n\\ninput[type=search] {\\n -webkit-appearance: none;\\n -moz-appearance: none;\\n -webkit-box-sizing: content-box;\\n -moz-box-sizing: content-box;\\n box-sizing: content-box;\\n}\\n\\ntextarea {\\n overflow: auto;\\n vertical-align: top;\\n resize: vertical;\\n}\\n\\n/**\\n * Correct `inline-block` display not defined in IE 6/7/8/9 and Firefox 3.\\n */\\naudio,\\ncanvas,\\nvideo {\\n display: inline-block;\\n *display: inline;\\n *zoom: 1;\\n max-width: 100%;\\n}\\n\\n/**\\n * Prevent modern browsers from displaying `audio` without controls.\\n * Remove excess height in iOS 5 devices.\\n */\\naudio:not([controls]) {\\n display: none;\\n height: 0;\\n}\\n\\n/**\\n * Address styling not present in IE 7/8/9, Firefox 3, and Safari 4.\\n * Known issue: no IE 6 support.\\n */\\n[hidden] {\\n display: none;\\n}\\n\\n/**\\n * 1. Correct text resizing oddly in IE 6/7 when body `font-size` is set using\\n * `em` units.\\n * 2. Prevent iOS text size adjust after orientation change, without disabling\\n * user zoom.\\n */\\nhtml {\\n font-size: 100%; /* 1 */\\n -webkit-text-size-adjust: 100%; /* 2 */\\n -ms-text-size-adjust: 100%; /* 2 */\\n}\\n\\n/**\\n * Address `outline` inconsistency between Chrome and other browsers.\\n */\\na:focus {\\n outline: thin dotted;\\n}\\n\\n/**\\n * Improve readability when focused and also mouse hovered in all browsers.\\n */\\na:active,\\na:hover {\\n outline: 0;\\n}\\n\\n/**\\n * 1. Remove border when inside `a` element in IE 6/7/8/9 and Firefox 3.\\n * 2. Improve image quality when scaled in IE 7.\\n */\\nimg {\\n border: 0; /* 1 */\\n -ms-interpolation-mode: bicubic; /* 2 */\\n}\\n\\n/**\\n * Address margin not present in IE 6/7/8/9, Safari 5, and Opera 11.\\n */\\nfigure {\\n margin: 0;\\n}\\n\\n/**\\n * Correct margin displayed oddly in IE 6/7.\\n */\\nform {\\n margin: 0;\\n}\\n\\n/**\\n * Define consistent border, margin, and padding.\\n */\\nfieldset {\\n border: 1px solid #c0c0c0;\\n margin: 0 2px;\\n padding: 0.35em 0.625em 0.75em;\\n}\\n\\n/**\\n * 1. Correct color not being inherited in IE 6/7/8/9.\\n * 2. Correct text not wrapping in Firefox 3.\\n * 3. Correct alignment displayed oddly in IE 6/7.\\n */\\nlegend {\\n border: 0; /* 1 */\\n padding: 0;\\n white-space: normal; /* 2 */\\n *margin-left: -7px; /* 3 */\\n}\\n\\n/**\\n * 1. Correct font size not being inherited in all browsers.\\n * 2. Address margins set differently in IE 6/7, Firefox 3+, Safari 5,\\n * and Chrome.\\n * 3. Improve appearance and consistency in all browsers.\\n */\\nbutton,\\ninput,\\nselect,\\ntextarea {\\n font-size: 100%; /* 1 */\\n margin: 0; /* 2 */\\n vertical-align: baseline; /* 3 */\\n *vertical-align: middle; /* 3 */\\n}\\n\\n/**\\n * Address Firefox 3+ setting `line-height` on `input` using `!important` in\\n * the UA stylesheet.\\n */\\nbutton,\\ninput {\\n line-height: normal;\\n}\\n\\n/**\\n * Address inconsistent `text-transform` inheritance for `button` and `select`.\\n * All other form control elements do not inherit `text-transform` values.\\n * Correct `button` style inheritance in Chrome, Safari 5+, and IE 6+.\\n * Correct `select` style inheritance in Firefox 4+ and Opera.\\n */\\nbutton,\\nselect {\\n text-transform: none;\\n}\\n\\n/**\\n * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`\\n * and `video` controls.\\n * 2. Correct inability to style clickable `input` types in iOS.\\n * 3. Improve usability and consistency of cursor style between image-type\\n * `input` and others.\\n * 4. Remove inner spacing in IE 7 without affecting normal text inputs.\\n * Known issue: inner spacing remains in IE 6.\\n */\\nbutton,\\nhtml input[type=button],\\ninput[type=reset],\\ninput[type=submit] {\\n -webkit-appearance: button; /* 2 */\\n cursor: pointer; /* 3 */\\n *overflow: visible; /* 4 */\\n}\\n\\n/**\\n * Re-set default cursor for disabled elements.\\n */\\nbutton[disabled],\\nhtml input[disabled] {\\n cursor: default;\\n}\\n\\n/**\\n * 1. Address box sizing set to content-box in IE 8/9.\\n * 2. Remove excess padding in IE 8/9.\\n * 3. Remove excess padding in IE 7.\\n * Known issue: excess padding remains in IE 6.\\n */\\ninput[type=checkbox],\\ninput[type=radio] {\\n box-sizing: border-box; /* 1 */\\n padding: 0; /* 2 */\\n *height: 13px; /* 3 */\\n *width: 13px; /* 3 */\\n}\\n\\n/**\\n * 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome.\\n * 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome\\n * (include `-moz` to future-proof).\\n */\\ninput[type=search] {\\n -webkit-appearance: textfield; /* 1 */\\n -moz-box-sizing: content-box;\\n -webkit-box-sizing: content-box; /* 2 */\\n box-sizing: content-box;\\n}\\n\\n/**\\n * Remove inner padding and search cancel button in Safari 5 and Chrome\\n * on OS X.\\n */\\ninput[type=search]::-webkit-search-cancel-button,\\ninput[type=search]::-webkit-search-decoration {\\n -webkit-appearance: none;\\n}\\n\\n/**\\n * Remove inner padding and border in Firefox 3+.\\n */\\nbutton::-moz-focus-inner,\\ninput::-moz-focus-inner {\\n border: 0;\\n padding: 0;\\n}\\n\\n/**\\n * 1. Remove default vertical scrollbar in IE 6/7/8/9.\\n * 2. Improve readability and alignment in all browsers.\\n */\\ntextarea {\\n overflow: auto; /* 1 */\\n vertical-align: top; /* 2 */\\n}\\n\\n/**\\n * Remove most spacing between table cells.\\n */\\ntable {\\n border-collapse: collapse;\\n border-spacing: 0;\\n}\\n\\nhtml,\\nbutton,\\ninput,\\nselect,\\ntextarea {\\n color: #222;\\n}\\n\\n::-moz-selection {\\n background: #b3d4fc;\\n text-shadow: none;\\n}\\n\\n::selection {\\n background: #b3d4fc;\\n text-shadow: none;\\n}\\n\\nimg {\\n vertical-align: middle;\\n}\\n\\nfieldset {\\n border: 0;\\n margin: 0;\\n padding: 0;\\n}\\n\\ntextarea {\\n resize: vertical;\\n}\\n\\n.chromeframe {\\n margin: 0.2em 0;\\n background: #ccc;\\n color: #000;\\n padding: 0.2em 0;\\n}\\n\\n* {\\n padding: 0;\\n margin: 0;\\n border: 0;\\n}\\n\\n*, *:before, *:after {\\n -moz-box-sizing: border-box;\\n -webkit-box-sizing: border-box;\\n box-sizing: border-box;\\n}\\n\\n:focus, :active {\\n outline: none;\\n}\\n\\na:focus, a:active {\\n outline: none;\\n}\\n\\nnav, footer, header, aside {\\n display: block;\\n}\\n\\nhtml, body {\\n height: 100%;\\n width: 100%;\\n font-size: 100%;\\n line-height: 1;\\n font-size: 14px;\\n -ms-text-size-adjust: 100%;\\n -moz-text-size-adjust: 100%;\\n -webkit-text-size-adjust: 100%;\\n}\\n\\ninput, button, textarea {\\n font-family: inherit;\\n}\\n\\ninput::-ms-clear {\\n display: none;\\n}\\n\\nbutton {\\n cursor: pointer;\\n}\\n\\nbutton::-moz-focus-inner {\\n padding: 0;\\n border: 0;\\n}\\n\\na, a:visited {\\n text-decoration: none;\\n}\\n\\nul li {\\n list-style: none;\\n}\\n\\nimg {\\n vertical-align: top;\\n}\\n\\nh1, h2, h3, h4, h5, h6 {\\n font-size: inherit;\\n font-weight: 400;\\n}\\n\\n/*\\n@font-face {\\n font-family: \\\"Roboto-Regular\\\";\\n src: url(\\\"../fonts/Roboto-Regular.eot\\\");\\n src: local(\\\"☺\\\"), url(\\\"../fonts/Roboto-Regular.woff\\\") format(\\\"woff\\\"),\\n url(\\\"../fonts/Roboto-Regular.ttf\\\") format(\\\"truetype\\\");\\n font-weight: normal;\\n font-style: normal;\\n}\\n\\n@font-face {\\n font-family: \\\"Roboto-Medium\\\";\\n src: url(\\\"../fonts/Roboto-Medium.eot\\\");\\n src: local(\\\"☺\\\"), url(\\\"../fonts/Roboto-Medium.woff\\\") format(\\\"woff\\\"),\\n url(\\\"../fonts/Roboto-Medium.ttf\\\") format(\\\"truetype\\\");\\n font-weight: normal;\\n font-style: normal;\\n}\\n\\n@font-face {\\n font-family: \\\"Roboto-Bold\\\";\\n src: url(\\\"../fonts/Roboto-Bold.eot\\\");\\n src: local(\\\"☺\\\"), url(\\\"../fonts/Roboto-Bold.woff\\\") format(\\\"woff\\\"),\\n url(\\\"../fonts/Roboto-Bold.ttf\\\") format(\\\"truetype\\\");\\n font-weight: normal;\\n font-style: normal;\\n}\\n*/\\n:root {\\n --primary: #3978FC;\\n --color-background: #FFFFFF;\\n --color-background-modal: #C4D7FE;\\n --color-background-overlay: #0B121B;\\n --color-divider: #E7EFFF;\\n --color-font: #0B121B;\\n --color-icon: #3978FC;\\n --color-background-info:#C4D7FE;\\n --tertiary-elements: #636D78;\\n --main-elements: #3978FC;\\n --secondary-elements: #202F3E;\\n --input-elements: #202F3E;\\n --disabled-elements: #BCC1C5;\\n --field-border: #90979F;\\n --main-text: #0B121B;\\n --secondary-text: #636D78;\\n --caption: #90979F;\\n --main-background: #FFFFFF;\\n --secondary-background: #FFFFFF;\\n --secondary-background-modal: rgba(19, 29, 40, 0.8);\\n --incoming-background: #E4E6E8;\\n --outgoing-background: #E7EFFF;\\n --dropdown-background: #FFFFFF;\\n --chat-input: #F7F9FF;\\n --divider: #E7EFFF;\\n --error: #FF3B30;\\n --hightlight: #FFFDC1;\\n}\\n\\nhtml[data-theme=dark] {\\n --primary: #3978FC;\\n --color-background: #0B121B;\\n --color-background-modal: #131D28;\\n --color-background-overlay: #0B121B;\\n --color-divider: #414E5B;\\n --color-font: #FFFFFF;\\n --color-icon: #74A1FD;\\n --color-background-info: #3978FC;\\n --tertiary-elements: rgba(144, 151, 159, 0.8);\\n --main-elements: #74A1FD;\\n --secondary-elements: #FFFFFF;\\n --input-elements: #90979F;\\n --disabled-elements: #636D78;\\n --field-border: #90979F;\\n --main-text: #FFFFFF;\\n --secondary-text: #90979F;\\n --caption: #BCC1C5;\\n --main-background: #202F3E;\\n --secondary-background: #131D28;\\n --incoming-background: #414E5B;\\n --outgoing-background: #3978FC;\\n --dropdown-background: #414E5B;\\n --chat-input: #131D28;\\n --divider: #414E5B;\\n --error: #FF766E;\\n --hightlight: #FFFDC1;\\n}\\n\\n* {\\n box-sizing: border-box;\\n}\\n\\nbody {\\n font-family: \\\"Roboto\\\";\\n color: var(--main-text);\\n background-color: var(--main-background);\\n overflow: hidden !important;\\n scrollbar-width: none !important;\\n max-height: 810px;\\n max-width: 1380px;\\n}\", \"\"]);\n// Exports\n/* harmony default export */ __webpack_exports__[\"default\"] = (___CSS_LOADER_EXPORT___);\n\n\n//# sourceURL=webpack://quickblox-react-ui-kit/./src/index.scss?./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js");
392
403
 
393
404
  /***/ }),
394
405
 
@@ -601,6 +612,17 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _nod
601
612
 
602
613
  /***/ }),
603
614
 
615
+ /***/ "./src/Presentation/components/UI/Dialogs/MessagesView/HighLightLink/HighLightLink.scss":
616
+ /*!**********************************************************************************************!*\
617
+ !*** ./src/Presentation/components/UI/Dialogs/MessagesView/HighLightLink/HighLightLink.scss ***!
618
+ \**********************************************************************************************/
619
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
620
+
621
+ "use strict";
622
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ \"./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\");\n/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ \"./node_modules/style-loader/dist/runtime/styleDomAPI.js\");\n/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ \"./node_modules/style-loader/dist/runtime/insertBySelector.js\");\n/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ \"./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\");\n/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ \"./node_modules/style-loader/dist/runtime/insertStyleElement.js\");\n/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ \"./node_modules/style-loader/dist/runtime/styleTagTransform.js\");\n/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _node_modules_css_loader_dist_cjs_js_node_modules_sass_loader_dist_cjs_js_HighLightLink_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../../../../node_modules/css-loader/dist/cjs.js!../../../../../../../node_modules/sass-loader/dist/cjs.js!./HighLightLink.scss */ \"./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/Presentation/components/UI/Dialogs/MessagesView/HighLightLink/HighLightLink.scss\");\n\n \n \n \n \n \n \n \n \n \n\nvar options = {};\n\noptions.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());\noptions.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());\n\n options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, \"head\");\n \noptions.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());\noptions.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());\n\nvar update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_node_modules_sass_loader_dist_cjs_js_HighLightLink_scss__WEBPACK_IMPORTED_MODULE_6__[\"default\"], options);\n\n\n\n\n /* harmony default export */ __webpack_exports__[\"default\"] = (_node_modules_css_loader_dist_cjs_js_node_modules_sass_loader_dist_cjs_js_HighLightLink_scss__WEBPACK_IMPORTED_MODULE_6__[\"default\"] && _node_modules_css_loader_dist_cjs_js_node_modules_sass_loader_dist_cjs_js_HighLightLink_scss__WEBPACK_IMPORTED_MODULE_6__[\"default\"].locals ? _node_modules_css_loader_dist_cjs_js_node_modules_sass_loader_dist_cjs_js_HighLightLink_scss__WEBPACK_IMPORTED_MODULE_6__[\"default\"].locals : undefined);\n\n\n//# sourceURL=webpack://quickblox-react-ui-kit/./src/Presentation/components/UI/Dialogs/MessagesView/HighLightLink/HighLightLink.scss?");
623
+
624
+ /***/ }),
625
+
604
626
  /***/ "./src/Presentation/components/UI/Dialogs/MessagesView/ImageAttachmentComponent/ImageAttachmentComponent.scss":
605
627
  /*!********************************************************************************************************************!*\
606
628
  !*** ./src/Presentation/components/UI/Dialogs/MessagesView/ImageAttachmentComponent/ImageAttachmentComponent.scss ***!
@@ -1037,7 +1059,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
1037
1059
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
1038
1060
 
1039
1061
  "use strict";
1040
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"DialogRemoteDTOMapper\": function() { return /* binding */ DialogRemoteDTOMapper; }\n/* harmony export */ });\n/* harmony import */ var _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../Domain/entity/DialogTypes */ \"./src/Domain/entity/DialogTypes.ts\");\n/* harmony import */ var _dto_dialog_RemoteDialogDTO__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../dto/dialog/RemoteDialogDTO */ \"./src/Data/dto/dialog/RemoteDialogDTO.ts\");\n/* harmony import */ var _Domain_entity_PublicDialogEntity__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../Domain/entity/PublicDialogEntity */ \"./src/Domain/entity/PublicDialogEntity.ts\");\n/* harmony import */ var _Domain_entity_PrivateDialogEntity__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../Domain/entity/PrivateDialogEntity */ \"./src/Domain/entity/PrivateDialogEntity.ts\");\n/* harmony import */ var _Domain_entity_GroupDialogEntity__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../Domain/entity/GroupDialogEntity */ \"./src/Domain/entity/GroupDialogEntity.ts\");\n/* harmony import */ var _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../source/exception/MapperDTOException */ \"./src/Data/source/exception/MapperDTOException.ts\");\n\n\n\n\n\n\nvar DialogRemoteDTOMapper = /** @class */ (function () {\n function DialogRemoteDTOMapper() {\n }\n // eslint-disable-next-line class-methods-use-this\n DialogRemoteDTOMapper.prototype.fromEntity = function (entity) {\n var dialog = new _dto_dialog_RemoteDialogDTO__WEBPACK_IMPORTED_MODULE_1__.RemoteDialogDTO();\n var dialogEntity = this.defineType(entity);\n DialogRemoteDTOMapper.validateEntity(dialogEntity);\n dialog.id = dialogEntity.id;\n dialog.type = dialogEntity.type;\n dialog.ownerId = dialogEntity.ownerId;\n dialog.participantsIds =\n DialogRemoteDTOMapper.getParticipantsIds(dialogEntity);\n dialog.newParticipantsIds =\n DialogRemoteDTOMapper.getNewParticipantsIds(dialogEntity);\n if (dialog.participantsIds.length > 0) {\n dialog.participantId = dialog.participantsIds[0].toString();\n }\n else {\n dialog.participantId =\n DialogRemoteDTOMapper.getParticipantId(dialogEntity);\n }\n dialog.updatedAt = dialogEntity.updatedAt;\n dialog.lastMessageText = dialogEntity.lastMessage.text;\n dialog.lastMessageUserId = dialogEntity.lastMessage.userId.toString();\n dialog.lastMessageDateSent = dialogEntity.lastMessage.dateSent;\n dialog.unreadMessageCount = dialogEntity.unreadMessageCount;\n dialog.name = DialogRemoteDTOMapper.getDialogName(dialogEntity);\n dialog.photo = DialogRemoteDTOMapper.getPhoto(dialogEntity) || '';\n return Promise.resolve(dialog);\n };\n // eslint-disable-next-line class-methods-use-this\n DialogRemoteDTOMapper.prototype.toEntity = function (data) {\n var dialog = data;\n DialogRemoteDTOMapper.validateRemoteDTO(dialog);\n var entity = DialogRemoteDTOMapper.createDefaultDialogEntity(dialog.ownerId);\n function formatPhotoUrl() {\n if (dialog.photo && dialog.photo !== 'null') {\n return dialog.photo && QB.content.privateUrl(dialog.photo);\n }\n return '';\n }\n switch (dialog.type) {\n case _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_0__.DialogType[\"private\"]:\n entity = new _Domain_entity_PrivateDialogEntity__WEBPACK_IMPORTED_MODULE_3__.PrivateDialogEntity({ todo: '' }, dialog.id, dialog.name, {\n dateSent: dialog.lastMessageDateSent\n ? dialog.lastMessageDateSent\n : '',\n text: dialog.lastMessageText ? dialog.lastMessageText : '',\n userId: parseInt(dialog.lastMessageUserId, 10),\n }, dialog.ownerId, dialog.type, dialog.unreadMessageCount, dialog.updatedAt, parseInt(dialog.participantId, 10));\n break;\n case _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_0__.DialogType[\"public\"]:\n entity = new _Domain_entity_PublicDialogEntity__WEBPACK_IMPORTED_MODULE_2__.PublicDialogEntity({ todo: '' }, dialog.id, {\n dateSent: dialog.lastMessageDateSent\n ? dialog.lastMessageDateSent\n : '',\n text: dialog.lastMessageText ? dialog.lastMessageText : '',\n userId: parseInt(dialog.lastMessageUserId, 10),\n }, dialog.ownerId, dialog.type, dialog.unreadMessageCount, dialog.updatedAt, dialog.name, formatPhotoUrl());\n break;\n case _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_0__.DialogType.group:\n entity = new _Domain_entity_GroupDialogEntity__WEBPACK_IMPORTED_MODULE_4__.GroupDialogEntity({ todo: '' }, dialog.id, {\n dateSent: dialog.lastMessageDateSent\n ? dialog.lastMessageDateSent\n : '',\n text: dialog.lastMessageText ? dialog.lastMessageText : '',\n userId: parseInt(dialog.lastMessageUserId, 10),\n }, dialog.ownerId, dialog.type, dialog.unreadMessageCount, dialog.updatedAt, dialog.participantsIds, dialog.name, formatPhotoUrl());\n break;\n default:\n return Promise.reject(new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.UNEXPECTED_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.UNEXPECTED_MAPPER_DTO_EXCEPTION_EXCEPTION_CODE, 'undefinded type dialog in DTO'));\n }\n return Promise.resolve(entity);\n };\n DialogRemoteDTOMapper.getPhoto = function (entity) {\n // if (\n // dialogEntity instanceof GroupDialogEntity ||\n // dialogEntity instanceof PublicDialogEntity\n // )\n var dialogEntity = entity;\n if (dialogEntity && dialogEntity.type === _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_0__.DialogType[\"public\"])\n return dialogEntity.photo;\n if (dialogEntity && dialogEntity.type === _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_0__.DialogType.group)\n return dialogEntity.photo;\n return '';\n };\n DialogRemoteDTOMapper.getDialogName = function (dialogEntity) {\n // if (\n // dialogEntity instanceof GroupDialogEntity ||\n // dialogEntity instanceof PublicDialogEntity ||\n // dialogEntity instanceof PrivateDialogEntity\n // )\n return dialogEntity.name;\n };\n DialogRemoteDTOMapper.getParticipantId = function (dialogEntity) {\n if (dialogEntity instanceof _Domain_entity_PrivateDialogEntity__WEBPACK_IMPORTED_MODULE_3__.PrivateDialogEntity)\n return dialogEntity.participantId.toString();\n return '';\n };\n DialogRemoteDTOMapper.getParticipantsIds = function (dialogEntity) {\n return _Domain_entity_PublicDialogEntity__WEBPACK_IMPORTED_MODULE_2__.PublicDialogEntity.getParticipants(dialogEntity);\n };\n DialogRemoteDTOMapper.getNewParticipantsIds = function (dialogEntity) {\n return _Domain_entity_PublicDialogEntity__WEBPACK_IMPORTED_MODULE_2__.PublicDialogEntity.getNewParticipants(dialogEntity);\n };\n DialogRemoteDTOMapper.createDefaultDialogEntity = function (owner_id) {\n return {\n customData: { todo: '' },\n lastMessage: { dateSent: '', text: '', userId: 0 },\n ownerId: owner_id,\n type: _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_0__.DialogType[\"public\"],\n unreadMessageCount: 0,\n updatedAt: '',\n id: '',\n name: '_',\n };\n };\n DialogRemoteDTOMapper.validateEntity = function (dialogEntity) {\n if (dialogEntity instanceof _Domain_entity_PrivateDialogEntity__WEBPACK_IMPORTED_MODULE_3__.PrivateDialogEntity) {\n return DialogRemoteDTOMapper.validateIsPrivateDialogCorrect(dialogEntity);\n }\n if (dialogEntity instanceof _Domain_entity_PublicDialogEntity__WEBPACK_IMPORTED_MODULE_2__.PublicDialogEntity) {\n return DialogRemoteDTOMapper.validateIsPublicDialogCorrect(dialogEntity);\n }\n if (dialogEntity instanceof _Domain_entity_GroupDialogEntity__WEBPACK_IMPORTED_MODULE_4__.GroupDialogEntity) {\n return DialogRemoteDTOMapper.validateIsGroupDialogCorrect(dialogEntity);\n }\n return Promise.resolve();\n };\n DialogRemoteDTOMapper.validateIsPrivateDialogCorrect = function (dialogEntity) {\n var privateDialogEntityValidator = {\n name: function (v) {\n var name = v.name;\n return name !== undefined && name !== null && name.length > 0;\n },\n customData: function (v) {\n var customData = v.customData;\n return customData !== undefined && customData.todo !== undefined;\n },\n id: function (v) {\n var id = v.id;\n return id !== undefined && id !== null;\n },\n lastMessage: function (v) {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n var lastMessage = v.lastMessage;\n // return (\n // lastMessage !== undefined &&\n // lastMessage !== null &&\n // lastMessage.dateSent !== undefined &&\n // lastMessage.text !== undefined &&\n // lastMessage.userId !== undefined\n // );\n return true;\n },\n ownerId: function (v) {\n var ownerId = v.ownerId;\n return ownerId !== undefined && ownerId !== null;\n },\n participantId: function (v) {\n var participantId = v.participantId;\n return participantId !== undefined && participantId !== null;\n },\n type: function (v) {\n var type = v.type;\n return type !== undefined && type !== null;\n },\n unreadMessageCount: function (v) {\n var unreadMessageCount = v.unreadMessageCount;\n return unreadMessageCount !== undefined && unreadMessageCount !== null;\n },\n updatedAt: function (v) {\n var updatedAt = v.updatedAt;\n return updatedAt !== undefined && updatedAt !== null;\n },\n };\n if (!privateDialogEntityValidator.id(dialogEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {id} does not exist or empty');\n if (!privateDialogEntityValidator.name(dialogEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {name} does not exist or empty');\n if (!privateDialogEntityValidator.customData(dialogEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {customData} does not exist or empty');\n if (!privateDialogEntityValidator.lastMessage(dialogEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {lastMessage} does not exist or empty');\n if (!privateDialogEntityValidator.ownerId(dialogEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {ownerId} does not exist or empty');\n if (!privateDialogEntityValidator.participantId(dialogEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {participantId} does not exist or empty');\n if (!privateDialogEntityValidator.type(dialogEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {type} does not exist or empty');\n if (!privateDialogEntityValidator.unreadMessageCount(dialogEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {unreadMessageCount} does not exist or empty');\n if (!privateDialogEntityValidator.updatedAt(dialogEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {updatedAt} does not exist or empty');\n };\n DialogRemoteDTOMapper.validateIsPublicDialogCorrect = function (dialogEntity) {\n var publicDialogEntityValidator = {\n customData: function (v) {\n var customData = v.customData;\n return customData !== undefined && customData.todo !== undefined;\n },\n id: function (v) {\n var id = v.id;\n return id !== undefined && id !== null;\n },\n lastMessage: function (v) {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n var lastMessage = v.lastMessage;\n // return (\n // lastMessage !== undefined &&\n // lastMessage !== null &&\n // lastMessage.dateSent !== undefined &&\n // lastMessage.text !== undefined &&\n // lastMessage.userId !== undefined\n // );\n return true;\n },\n ownerId: function (v) {\n var ownerId = v.ownerId;\n return ownerId !== undefined && ownerId !== null;\n },\n type: function (v) {\n var type = v.type;\n return type !== undefined && type !== null;\n },\n unreadMessageCount: function (v) {\n var unreadMessageCount = v.unreadMessageCount;\n return unreadMessageCount !== undefined && unreadMessageCount !== null;\n },\n updatedAt: function (v) {\n var updatedAt = v.updatedAt;\n return updatedAt !== undefined && updatedAt !== null;\n },\n name: function (v) {\n var name = v.name;\n return name !== undefined && name !== null;\n },\n photo: function (v) {\n var photo = v.photo;\n return photo !== undefined && photo !== null;\n },\n };\n if (!publicDialogEntityValidator.id(dialogEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {id} does not exist or empty');\n if (!publicDialogEntityValidator.customData(dialogEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {customData} does not exist or empty');\n if (!publicDialogEntityValidator.lastMessage(dialogEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {lastMessage} does not exist or empty');\n if (!publicDialogEntityValidator.ownerId(dialogEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {ownerId} does not exist or empty');\n if (!publicDialogEntityValidator.type(dialogEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {type} does not exist or empty');\n if (!publicDialogEntityValidator.unreadMessageCount(dialogEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {unreadMessageCount} does not exist or empty');\n if (!publicDialogEntityValidator.updatedAt(dialogEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {updatedAt} does not exist or empty');\n if (!publicDialogEntityValidator.name(dialogEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {name} does not exist or empty');\n if (!publicDialogEntityValidator.photo(dialogEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {photo} does not exist or empty');\n };\n DialogRemoteDTOMapper.validateIsGroupDialogCorrect = function (dialogEntity) {\n var groupDialogEntityValidator = {\n customData: function (v) {\n var customData = v.customData;\n return customData !== undefined && customData.todo !== undefined;\n },\n id: function (v) {\n var id = v.id;\n return id !== undefined && id !== null;\n },\n lastMessage: function (v) {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n var lastMessage = v.lastMessage;\n // return (\n // lastMessage !== undefined &&\n // lastMessage !== null &&\n // lastMessage.dateSent !== undefined &&\n // lastMessage.text !== undefined &&\n // lastMessage.userId !== undefined\n // );\n return true;\n },\n ownerId: function (v) {\n var ownerId = v.ownerId;\n return ownerId !== undefined && ownerId !== null;\n },\n type: function (v) {\n var type = v.type;\n return type !== undefined && type !== null;\n },\n unreadMessageCount: function (v) {\n var unreadMessageCount = v.unreadMessageCount;\n return unreadMessageCount !== undefined && unreadMessageCount !== null;\n },\n updatedAt: function (v) {\n var updatedAt = v.updatedAt;\n return updatedAt !== undefined && updatedAt !== null;\n },\n name: function (v) {\n var name = v.name;\n return name !== undefined && name !== null;\n },\n photo: function (v) {\n var photo = v.photo;\n return photo !== undefined && photo !== null;\n },\n participantIds: function (v) {\n var participantIds = v.participantIds;\n return participantIds !== undefined && participantIds !== null;\n },\n };\n if (!groupDialogEntityValidator.id(dialogEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {id} does not exist or empty');\n if (!groupDialogEntityValidator.customData(dialogEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {customData} does not exist or empty');\n if (!groupDialogEntityValidator.lastMessage(dialogEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {lastMessage} does not exist or empty');\n if (!groupDialogEntityValidator.ownerId(dialogEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {ownerId} does not exist or empty');\n if (!groupDialogEntityValidator.type(dialogEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {type} does not exist or empty');\n if (!groupDialogEntityValidator.unreadMessageCount(dialogEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {unreadMessageCount} does not exist or empty');\n if (!groupDialogEntityValidator.updatedAt(dialogEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {updatedAt} does not exist or empty');\n if (!groupDialogEntityValidator.name(dialogEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {name} does not exist or empty');\n if (!groupDialogEntityValidator.photo(dialogEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {photo} does not exist or empty');\n if (!groupDialogEntityValidator.participantIds(dialogEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {participantIds} does not exist or empty');\n };\n // eslint-disable-next-line class-methods-use-this\n DialogRemoteDTOMapper.prototype.defineType = function (entity) {\n var dialogEntity = entity;\n var dialogType = entity.type;\n switch (dialogType) {\n case _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_0__.DialogType[\"private\"]:\n dialogEntity =\n entity instanceof _Domain_entity_PrivateDialogEntity__WEBPACK_IMPORTED_MODULE_3__.PrivateDialogEntity\n ? entity\n : null;\n break;\n case _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_0__.DialogType[\"public\"]:\n dialogEntity =\n entity instanceof _Domain_entity_PublicDialogEntity__WEBPACK_IMPORTED_MODULE_2__.PublicDialogEntity\n ? entity\n : null;\n break;\n case _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_0__.DialogType.group:\n dialogEntity = entity;\n // entity instanceof GroupDialogEntity\n // ? (entity as unknown as GroupDialogEntity)\n // : null;\n break;\n default:\n dialogEntity = null;\n }\n if (!dialogEntity)\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.UNEXPECTED_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.UNEXPECTED_MAPPER_DTO_EXCEPTION_EXCEPTION_CODE, 'wrong entity type');\n return dialogEntity;\n };\n DialogRemoteDTOMapper.validateRemoteDTO = function (data) {\n var dtoValidator = {\n id: function (v) {\n var id = v.id;\n return id !== undefined;\n },\n lastMessageId: function (v) {\n var lastMessageId = v.lastMessageId;\n return lastMessageId !== undefined;\n },\n lastMessageDateSent: function (v) {\n var lastMessageDateSent = v.lastMessageDateSent;\n return lastMessageDateSent !== undefined;\n },\n lastMessageText: function (v) {\n var lastMessageText = v.lastMessageText;\n return lastMessageText !== undefined;\n },\n lastMessageUserId: function (v) {\n var lastMessageUserId = v.lastMessageUserId;\n return lastMessageUserId !== undefined;\n },\n name: function (v) {\n var name = v.name;\n return name !== undefined;\n },\n ownerId: function (v) {\n var ownerId = v.ownerId;\n return ownerId !== undefined;\n },\n participantId: function (v) {\n var participantId = v.participantId;\n return participantId !== undefined;\n },\n participantsIds: function (v) {\n var participantsIds = v.participantsIds;\n return participantsIds !== undefined;\n },\n photo: function (v) {\n var photo = v.photo;\n return photo !== undefined;\n },\n type: function (v) {\n var type = v.type;\n return type !== undefined;\n },\n unreadMessageCount: function (v) {\n var unreadMessageCount = v.unreadMessageCount;\n return unreadMessageCount !== undefined;\n },\n updatedAt: function (v) {\n var updatedAt = v.updatedAt;\n return updatedAt !== undefined;\n },\n };\n if (!dtoValidator.id(data))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {id} does not exist or empty in DTO');\n if (!dtoValidator.lastMessageDateSent(data))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {lastMessageDateSent} does not exist or empty in DTO');\n if (!dtoValidator.lastMessageText(data))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {lastMessageText} does not exist or empty in DTO');\n if (!dtoValidator.name(data))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {name} does not exist or empty in DTO');\n if (!dtoValidator.ownerId(data))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {ownerId} does not exist or empty in DTO');\n if (!dtoValidator.participantId(data))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {participantId} does not exist or empty in DTO');\n if (!dtoValidator.participantsIds(data))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {participantsIds} does not exist or empty in DTO');\n if (!dtoValidator.photo(data))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {photo} does not exist or empty in DTO');\n if (!dtoValidator.type(data))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {type} does not exist or empty in DTO');\n if (!dtoValidator.unreadMessageCount(data))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {unreadMessageCount} does not exist or empty in DTO');\n if (!dtoValidator.updatedAt(data))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {updatedAt} does not exist or empty in DTO');\n };\n return DialogRemoteDTOMapper;\n}());\n\n\n\n//# sourceURL=webpack://quickblox-react-ui-kit/./src/Data/mapper/DialogRemoteDTOMapper.ts?");
1062
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"DialogRemoteDTOMapper\": function() { return /* binding */ DialogRemoteDTOMapper; }\n/* harmony export */ });\n/* harmony import */ var _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../Domain/entity/DialogTypes */ \"./src/Domain/entity/DialogTypes.ts\");\n/* harmony import */ var _dto_dialog_RemoteDialogDTO__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../dto/dialog/RemoteDialogDTO */ \"./src/Data/dto/dialog/RemoteDialogDTO.ts\");\n/* harmony import */ var _Domain_entity_PublicDialogEntity__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../Domain/entity/PublicDialogEntity */ \"./src/Domain/entity/PublicDialogEntity.ts\");\n/* harmony import */ var _Domain_entity_PrivateDialogEntity__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../Domain/entity/PrivateDialogEntity */ \"./src/Domain/entity/PrivateDialogEntity.ts\");\n/* harmony import */ var _Domain_entity_GroupDialogEntity__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../Domain/entity/GroupDialogEntity */ \"./src/Domain/entity/GroupDialogEntity.ts\");\n/* harmony import */ var _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../source/exception/MapperDTOException */ \"./src/Data/source/exception/MapperDTOException.ts\");\n\n\n\n\n\n\nvar DialogRemoteDTOMapper = /** @class */ (function () {\n function DialogRemoteDTOMapper() {\n }\n // eslint-disable-next-line class-methods-use-this\n DialogRemoteDTOMapper.prototype.fromEntity = function (entity) {\n var dialog = new _dto_dialog_RemoteDialogDTO__WEBPACK_IMPORTED_MODULE_1__.RemoteDialogDTO();\n var dialogEntity = this.defineType(entity);\n DialogRemoteDTOMapper.validateEntity(dialogEntity);\n dialog.id = dialogEntity.id;\n dialog.type = dialogEntity.type;\n dialog.ownerId = dialogEntity.ownerId;\n dialog.participantsIds =\n DialogRemoteDTOMapper.getParticipantsIds(dialogEntity);\n dialog.newParticipantsIds =\n DialogRemoteDTOMapper.getNewParticipantsIds(dialogEntity);\n if (dialog.participantsIds.length > 0) {\n dialog.participantId = dialog.participantsIds[0].toString();\n }\n else {\n dialog.participantId =\n DialogRemoteDTOMapper.getParticipantId(dialogEntity);\n }\n dialog.updatedAt = dialogEntity.updatedAt;\n dialog.lastMessageText = dialogEntity.lastMessage.text;\n dialog.lastMessageUserId = dialogEntity.lastMessage.userId.toString();\n dialog.lastMessageDateSent = dialogEntity.lastMessage.dateSent;\n dialog.unreadMessageCount = dialogEntity.unreadMessageCount;\n dialog.name = DialogRemoteDTOMapper.getDialogName(dialogEntity);\n dialog.photo = DialogRemoteDTOMapper.getPhoto(dialogEntity) || '';\n return Promise.resolve(dialog);\n };\n // eslint-disable-next-line class-methods-use-this\n DialogRemoteDTOMapper.prototype.toEntity = function (data) {\n var dialog = data;\n DialogRemoteDTOMapper.validateRemoteDTO(dialog);\n var entity = DialogRemoteDTOMapper.createDefaultDialogEntity(dialog.ownerId);\n function formatPhotoUrl() {\n if (dialog.photo && dialog.photo !== 'null') {\n return dialog.photo && QB.content.privateUrl(dialog.photo);\n }\n return '';\n }\n switch (dialog.type) {\n case _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_0__.DialogType[\"private\"]:\n entity = new _Domain_entity_PrivateDialogEntity__WEBPACK_IMPORTED_MODULE_3__.PrivateDialogEntity({ todo: '' }, dialog.id, dialog.name, {\n dateSent: dialog.lastMessageDateSent\n ? dialog.lastMessageDateSent\n : '',\n text: dialog.lastMessageText ? dialog.lastMessageText : '',\n userId: parseInt(dialog.lastMessageUserId, 10),\n }, dialog.ownerId, dialog.type, dialog.unreadMessageCount, dialog.updatedAt, \n // interlocutorId,\n parseInt(dialog.participantId, 10));\n break;\n case _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_0__.DialogType[\"public\"]:\n entity = new _Domain_entity_PublicDialogEntity__WEBPACK_IMPORTED_MODULE_2__.PublicDialogEntity({ todo: '' }, dialog.id, {\n dateSent: dialog.lastMessageDateSent\n ? dialog.lastMessageDateSent\n : '',\n text: dialog.lastMessageText ? dialog.lastMessageText : '',\n userId: parseInt(dialog.lastMessageUserId, 10),\n }, dialog.ownerId, dialog.type, dialog.unreadMessageCount, dialog.updatedAt, dialog.name, formatPhotoUrl());\n break;\n case _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_0__.DialogType.group:\n entity = new _Domain_entity_GroupDialogEntity__WEBPACK_IMPORTED_MODULE_4__.GroupDialogEntity({ todo: '' }, dialog.id, {\n dateSent: dialog.lastMessageDateSent\n ? dialog.lastMessageDateSent\n : '',\n text: dialog.lastMessageText ? dialog.lastMessageText : '',\n userId: parseInt(dialog.lastMessageUserId, 10),\n }, dialog.ownerId, dialog.type, dialog.unreadMessageCount, dialog.updatedAt, dialog.participantsIds, dialog.name, formatPhotoUrl());\n break;\n default:\n return Promise.reject(new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.UNEXPECTED_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.UNEXPECTED_MAPPER_DTO_EXCEPTION_EXCEPTION_CODE, 'undefinded type dialog in DTO'));\n }\n return Promise.resolve(entity);\n };\n DialogRemoteDTOMapper.getPhoto = function (entity) {\n // if (\n // dialogEntity instanceof GroupDialogEntity ||\n // dialogEntity instanceof PublicDialogEntity\n // )\n var dialogEntity = entity;\n if (dialogEntity && dialogEntity.type === _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_0__.DialogType[\"public\"])\n return dialogEntity.photo;\n if (dialogEntity && dialogEntity.type === _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_0__.DialogType.group)\n return dialogEntity.photo;\n return '';\n };\n DialogRemoteDTOMapper.getDialogName = function (dialogEntity) {\n // if (\n // dialogEntity instanceof GroupDialogEntity ||\n // dialogEntity instanceof PublicDialogEntity ||\n // dialogEntity instanceof PrivateDialogEntity\n // )\n return dialogEntity.name;\n };\n DialogRemoteDTOMapper.getParticipantId = function (dialogEntity) {\n if (dialogEntity instanceof _Domain_entity_PrivateDialogEntity__WEBPACK_IMPORTED_MODULE_3__.PrivateDialogEntity)\n return dialogEntity.participantId.toString();\n return '';\n };\n DialogRemoteDTOMapper.getParticipantsIds = function (dialogEntity) {\n return _Domain_entity_PublicDialogEntity__WEBPACK_IMPORTED_MODULE_2__.PublicDialogEntity.getParticipants(dialogEntity);\n };\n DialogRemoteDTOMapper.getNewParticipantsIds = function (dialogEntity) {\n return _Domain_entity_PublicDialogEntity__WEBPACK_IMPORTED_MODULE_2__.PublicDialogEntity.getNewParticipants(dialogEntity);\n };\n DialogRemoteDTOMapper.createDefaultDialogEntity = function (owner_id) {\n return {\n customData: { todo: '' },\n lastMessage: { dateSent: '', text: '', userId: 0 },\n ownerId: owner_id,\n type: _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_0__.DialogType[\"public\"],\n unreadMessageCount: 0,\n updatedAt: '',\n id: '',\n name: '_',\n };\n };\n DialogRemoteDTOMapper.validateEntity = function (dialogEntity) {\n if (dialogEntity instanceof _Domain_entity_PrivateDialogEntity__WEBPACK_IMPORTED_MODULE_3__.PrivateDialogEntity) {\n return DialogRemoteDTOMapper.validateIsPrivateDialogCorrect(dialogEntity);\n }\n if (dialogEntity instanceof _Domain_entity_PublicDialogEntity__WEBPACK_IMPORTED_MODULE_2__.PublicDialogEntity) {\n return DialogRemoteDTOMapper.validateIsPublicDialogCorrect(dialogEntity);\n }\n if (dialogEntity instanceof _Domain_entity_GroupDialogEntity__WEBPACK_IMPORTED_MODULE_4__.GroupDialogEntity) {\n return DialogRemoteDTOMapper.validateIsGroupDialogCorrect(dialogEntity);\n }\n return Promise.resolve();\n };\n DialogRemoteDTOMapper.validateIsPrivateDialogCorrect = function (dialogEntity) {\n var privateDialogEntityValidator = {\n name: function (v) {\n var name = v.name;\n return name !== undefined && name !== null && name.length > 0;\n },\n customData: function (v) {\n var customData = v.customData;\n return customData !== undefined && customData.todo !== undefined;\n },\n id: function (v) {\n var id = v.id;\n return id !== undefined && id !== null;\n },\n lastMessage: function (v) {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n var lastMessage = v.lastMessage;\n // return (\n // lastMessage !== undefined &&\n // lastMessage !== null &&\n // lastMessage.dateSent !== undefined &&\n // lastMessage.text !== undefined &&\n // lastMessage.userId !== undefined\n // );\n return true;\n },\n ownerId: function (v) {\n var ownerId = v.ownerId;\n return ownerId !== undefined && ownerId !== null;\n },\n participantId: function (v) {\n var participantId = v.participantId;\n return participantId !== undefined && participantId !== null;\n },\n type: function (v) {\n var type = v.type;\n return type !== undefined && type !== null;\n },\n unreadMessageCount: function (v) {\n var unreadMessageCount = v.unreadMessageCount;\n return unreadMessageCount !== undefined && unreadMessageCount !== null;\n },\n updatedAt: function (v) {\n var updatedAt = v.updatedAt;\n return updatedAt !== undefined && updatedAt !== null;\n },\n };\n if (!privateDialogEntityValidator.id(dialogEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {id} does not exist or empty');\n if (!privateDialogEntityValidator.name(dialogEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {name} does not exist or empty');\n if (!privateDialogEntityValidator.customData(dialogEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {customData} does not exist or empty');\n if (!privateDialogEntityValidator.lastMessage(dialogEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {lastMessage} does not exist or empty');\n if (!privateDialogEntityValidator.ownerId(dialogEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {ownerId} does not exist or empty');\n if (!privateDialogEntityValidator.participantId(dialogEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {participantId} does not exist or empty');\n if (!privateDialogEntityValidator.type(dialogEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {type} does not exist or empty');\n if (!privateDialogEntityValidator.unreadMessageCount(dialogEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {unreadMessageCount} does not exist or empty');\n if (!privateDialogEntityValidator.updatedAt(dialogEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {updatedAt} does not exist or empty');\n };\n DialogRemoteDTOMapper.validateIsPublicDialogCorrect = function (dialogEntity) {\n var publicDialogEntityValidator = {\n customData: function (v) {\n var customData = v.customData;\n return customData !== undefined && customData.todo !== undefined;\n },\n id: function (v) {\n var id = v.id;\n return id !== undefined && id !== null;\n },\n lastMessage: function (v) {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n var lastMessage = v.lastMessage;\n // return (\n // lastMessage !== undefined &&\n // lastMessage !== null &&\n // lastMessage.dateSent !== undefined &&\n // lastMessage.text !== undefined &&\n // lastMessage.userId !== undefined\n // );\n return true;\n },\n ownerId: function (v) {\n var ownerId = v.ownerId;\n return ownerId !== undefined && ownerId !== null;\n },\n type: function (v) {\n var type = v.type;\n return type !== undefined && type !== null;\n },\n unreadMessageCount: function (v) {\n var unreadMessageCount = v.unreadMessageCount;\n return unreadMessageCount !== undefined && unreadMessageCount !== null;\n },\n updatedAt: function (v) {\n var updatedAt = v.updatedAt;\n return updatedAt !== undefined && updatedAt !== null;\n },\n name: function (v) {\n var name = v.name;\n return name !== undefined && name !== null;\n },\n photo: function (v) {\n var photo = v.photo;\n return photo !== undefined && photo !== null;\n },\n };\n if (!publicDialogEntityValidator.id(dialogEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {id} does not exist or empty');\n if (!publicDialogEntityValidator.customData(dialogEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {customData} does not exist or empty');\n if (!publicDialogEntityValidator.lastMessage(dialogEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {lastMessage} does not exist or empty');\n if (!publicDialogEntityValidator.ownerId(dialogEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {ownerId} does not exist or empty');\n if (!publicDialogEntityValidator.type(dialogEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {type} does not exist or empty');\n if (!publicDialogEntityValidator.unreadMessageCount(dialogEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {unreadMessageCount} does not exist or empty');\n if (!publicDialogEntityValidator.updatedAt(dialogEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {updatedAt} does not exist or empty');\n if (!publicDialogEntityValidator.name(dialogEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {name} does not exist or empty');\n if (!publicDialogEntityValidator.photo(dialogEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {photo} does not exist or empty');\n };\n DialogRemoteDTOMapper.validateIsGroupDialogCorrect = function (dialogEntity) {\n var groupDialogEntityValidator = {\n customData: function (v) {\n var customData = v.customData;\n return customData !== undefined && customData.todo !== undefined;\n },\n id: function (v) {\n var id = v.id;\n return id !== undefined && id !== null;\n },\n lastMessage: function (v) {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n var lastMessage = v.lastMessage;\n // return (\n // lastMessage !== undefined &&\n // lastMessage !== null &&\n // lastMessage.dateSent !== undefined &&\n // lastMessage.text !== undefined &&\n // lastMessage.userId !== undefined\n // );\n return true;\n },\n ownerId: function (v) {\n var ownerId = v.ownerId;\n return ownerId !== undefined && ownerId !== null;\n },\n type: function (v) {\n var type = v.type;\n return type !== undefined && type !== null;\n },\n unreadMessageCount: function (v) {\n var unreadMessageCount = v.unreadMessageCount;\n return unreadMessageCount !== undefined && unreadMessageCount !== null;\n },\n updatedAt: function (v) {\n var updatedAt = v.updatedAt;\n return updatedAt !== undefined && updatedAt !== null;\n },\n name: function (v) {\n var name = v.name;\n return name !== undefined && name !== null;\n },\n photo: function (v) {\n var photo = v.photo;\n return photo !== undefined && photo !== null;\n },\n participantIds: function (v) {\n var participantIds = v.participantIds;\n return participantIds !== undefined && participantIds !== null;\n },\n };\n if (!groupDialogEntityValidator.id(dialogEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {id} does not exist or empty');\n if (!groupDialogEntityValidator.customData(dialogEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {customData} does not exist or empty');\n if (!groupDialogEntityValidator.lastMessage(dialogEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {lastMessage} does not exist or empty');\n if (!groupDialogEntityValidator.ownerId(dialogEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {ownerId} does not exist or empty');\n if (!groupDialogEntityValidator.type(dialogEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {type} does not exist or empty');\n if (!groupDialogEntityValidator.unreadMessageCount(dialogEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {unreadMessageCount} does not exist or empty');\n if (!groupDialogEntityValidator.updatedAt(dialogEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {updatedAt} does not exist or empty');\n if (!groupDialogEntityValidator.name(dialogEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {name} does not exist or empty');\n if (!groupDialogEntityValidator.photo(dialogEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {photo} does not exist or empty');\n if (!groupDialogEntityValidator.participantIds(dialogEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {participantIds} does not exist or empty');\n };\n // eslint-disable-next-line class-methods-use-this\n DialogRemoteDTOMapper.prototype.defineType = function (entity) {\n var dialogEntity = entity;\n var dialogType = entity.type;\n switch (dialogType) {\n case _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_0__.DialogType[\"private\"]:\n dialogEntity =\n entity instanceof _Domain_entity_PrivateDialogEntity__WEBPACK_IMPORTED_MODULE_3__.PrivateDialogEntity\n ? entity\n : null;\n break;\n case _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_0__.DialogType[\"public\"]:\n dialogEntity =\n entity instanceof _Domain_entity_PublicDialogEntity__WEBPACK_IMPORTED_MODULE_2__.PublicDialogEntity\n ? entity\n : null;\n break;\n case _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_0__.DialogType.group:\n dialogEntity = entity;\n // entity instanceof GroupDialogEntity\n // ? (entity as unknown as GroupDialogEntity)\n // : null;\n break;\n default:\n dialogEntity = null;\n }\n if (!dialogEntity)\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.UNEXPECTED_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.UNEXPECTED_MAPPER_DTO_EXCEPTION_EXCEPTION_CODE, 'wrong entity type');\n return dialogEntity;\n };\n DialogRemoteDTOMapper.validateRemoteDTO = function (data) {\n var dtoValidator = {\n id: function (v) {\n var id = v.id;\n return id !== undefined;\n },\n lastMessageId: function (v) {\n var lastMessageId = v.lastMessageId;\n return lastMessageId !== undefined;\n },\n lastMessageDateSent: function (v) {\n var lastMessageDateSent = v.lastMessageDateSent;\n return lastMessageDateSent !== undefined;\n },\n lastMessageText: function (v) {\n var lastMessageText = v.lastMessageText;\n return lastMessageText !== undefined;\n },\n lastMessageUserId: function (v) {\n var lastMessageUserId = v.lastMessageUserId;\n return lastMessageUserId !== undefined;\n },\n name: function (v) {\n var name = v.name;\n return name !== undefined;\n },\n ownerId: function (v) {\n var ownerId = v.ownerId;\n return ownerId !== undefined;\n },\n participantId: function (v) {\n var participantId = v.participantId;\n return participantId !== undefined;\n },\n participantsIds: function (v) {\n var participantsIds = v.participantsIds;\n return participantsIds !== undefined;\n },\n photo: function (v) {\n var photo = v.photo;\n return photo !== undefined;\n },\n type: function (v) {\n var type = v.type;\n return type !== undefined;\n },\n unreadMessageCount: function (v) {\n var unreadMessageCount = v.unreadMessageCount;\n return unreadMessageCount !== undefined;\n },\n updatedAt: function (v) {\n var updatedAt = v.updatedAt;\n return updatedAt !== undefined;\n },\n };\n if (!dtoValidator.id(data))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {id} does not exist or empty in DTO');\n if (!dtoValidator.lastMessageDateSent(data))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {lastMessageDateSent} does not exist or empty in DTO');\n if (!dtoValidator.lastMessageText(data))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {lastMessageText} does not exist or empty in DTO');\n if (!dtoValidator.name(data))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {name} does not exist or empty in DTO');\n if (!dtoValidator.ownerId(data))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {ownerId} does not exist or empty in DTO');\n if (!dtoValidator.participantId(data))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {participantId} does not exist or empty in DTO');\n if (!dtoValidator.participantsIds(data))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {participantsIds} does not exist or empty in DTO');\n if (!dtoValidator.photo(data))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {photo} does not exist or empty in DTO');\n if (!dtoValidator.type(data))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {type} does not exist or empty in DTO');\n if (!dtoValidator.unreadMessageCount(data))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {unreadMessageCount} does not exist or empty in DTO');\n if (!dtoValidator.updatedAt(data))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_5__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {updatedAt} does not exist or empty in DTO');\n };\n return DialogRemoteDTOMapper;\n}());\n\n\n\n//# sourceURL=webpack://quickblox-react-ui-kit/./src/Data/mapper/DialogRemoteDTOMapper.ts?");
1041
1063
 
1042
1064
  /***/ }),
1043
1065
 
@@ -1081,7 +1103,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
1081
1103
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
1082
1104
 
1083
1105
  "use strict";
1084
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"MessageRemoteDTOMapper\": function() { return /* binding */ MessageRemoteDTOMapper; }\n/* harmony export */ });\n/* harmony import */ var _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../source/exception/MapperDTOException */ \"./src/Data/source/exception/MapperDTOException.ts\");\n/* harmony import */ var _dto_message_RemoteMessageDTO__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../dto/message/RemoteMessageDTO */ \"./src/Data/dto/message/RemoteMessageDTO.ts\");\nvar __assign = (undefined && undefined.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\n\n\nvar MessageRemoteDTOMapper = /** @class */ (function () {\n function MessageRemoteDTOMapper() {\n }\n // eslint-disable-next-line class-methods-use-this\n MessageRemoteDTOMapper.prototype.fromEntity = function (entity) {\n var messageEntity = entity;\n if (messageEntity === null || messageEntity === undefined) {\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.UNEXPECTED_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.UNEXPECTED_MAPPER_DTO_EXCEPTION_EXCEPTION_CODE, 'entity is null or undefined');\n }\n var messageDTO = new _dto_message_RemoteMessageDTO__WEBPACK_IMPORTED_MODULE_1__.RemoteMessageDTO();\n MessageRemoteDTOMapper.validateEntity(messageEntity);\n messageDTO.id = messageEntity.id.toString();\n messageDTO.dialogId = messageEntity.dialogId;\n messageDTO.created_at = messageEntity.created_at;\n messageDTO.date_sent = messageEntity.date_sent;\n messageDTO.delivered_ids = messageEntity.delivered_ids;\n messageDTO.message = messageEntity.message;\n messageDTO.read_ids = messageEntity.read_ids;\n messageDTO.read = messageEntity.read ? 1 : 0;\n if (messageEntity.recipient_id !== null) {\n messageDTO.recipient_id = messageEntity.recipient_id;\n }\n messageDTO.notification_type = messageEntity.notification_type;\n messageDTO.dialog_type = messageEntity.dialogType;\n messageDTO.sender_id = messageEntity.sender_id;\n messageDTO.updated_at = messageEntity.updated_at;\n if (messageEntity.attachments && messageEntity.attachments.length) {\n messageEntity.attachments.forEach(function (att) {\n var newAtt = __assign({}, att);\n messageDTO.attachments.push(newAtt);\n });\n }\n return Promise.resolve(messageDTO);\n };\n // eslint-disable-next-line class-methods-use-this\n MessageRemoteDTOMapper.prototype.toEntity = function (data) {\n var messageDTO = data;\n if (messageDTO === null || messageDTO === undefined) {\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.UNEXPECTED_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.UNEXPECTED_MAPPER_DTO_EXCEPTION_EXCEPTION_CODE, 'messageDTO is null or undefined');\n }\n MessageRemoteDTOMapper.validateDTO(messageDTO);\n var messageEntity = MessageRemoteDTOMapper.createDefaultMessageEntity();\n messageEntity.id = parseInt(messageDTO.id, 10);\n messageEntity.dialogId = messageDTO.dialogId;\n messageEntity.created_at = messageDTO.created_at;\n messageEntity.date_sent = messageDTO.date_sent;\n messageEntity.delivered_ids = messageDTO.delivered_ids;\n messageEntity.message = messageDTO.message;\n messageEntity.read_ids = messageDTO.read_ids;\n messageEntity.read = messageDTO.read;\n messageEntity.recipient_id = messageDTO.recipient_id;\n messageEntity.sender_id = messageDTO.sender_id;\n messageEntity.updated_at = messageDTO.updated_at;\n //\n if (messageDTO.attachments && messageDTO.attachments.length) {\n messageEntity.attachments = [];\n messageDTO.attachments.forEach(function (att) {\n var _a;\n var newAtt = __assign({}, att);\n (_a = messageEntity.attachments) === null || _a === void 0 ? void 0 : _a.push(newAtt);\n });\n }\n messageEntity.notification_type = (messageDTO === null || messageDTO === void 0 ? void 0 : messageDTO.notification_type)\n ? messageDTO === null || messageDTO === void 0 ? void 0 : messageDTO.notification_type\n : '';\n messageEntity.markable = (messageDTO === null || messageDTO === void 0 ? void 0 : messageDTO.markable) ? messageDTO === null || messageDTO === void 0 ? void 0 : messageDTO.markable : '';\n //\n return Promise.resolve(messageEntity);\n };\n MessageRemoteDTOMapper.validateEntity = function (messageEntity) {\n var messageEntityValidator = {\n created_at: function (v) {\n var created_at = v.created_at;\n return (created_at !== undefined &&\n created_at !== null &&\n created_at.length > 0);\n },\n date_sent: function (v) {\n var date_sent = v.date_sent;\n return date_sent !== undefined && date_sent !== null;\n },\n delivered_ids: function (v) {\n var delivered_ids = v.delivered_ids;\n return delivered_ids !== undefined && delivered_ids !== null;\n // && delivered_ids.length >= 0\n },\n dialogId: function (v) {\n var dialogId = v.dialogId;\n return (dialogId !== undefined && dialogId !== null && dialogId.length > 0);\n },\n id: function (v) {\n var id = v.id;\n return id !== undefined && id !== null;\n },\n message: function (v) {\n var message = v.message;\n return message !== undefined && message !== null && message.length > 0;\n },\n read: function (v) {\n var read = v.read;\n return read !== undefined && read !== null;\n },\n read_ids: function (v) {\n var read_ids = v.read_ids;\n return (read_ids !== undefined && read_ids !== null\n // && read_ids.length >= 0\n );\n },\n recipient_id: function (v) {\n var recipient_id = v.recipient_id;\n return recipient_id !== undefined && recipient_id !== null;\n },\n sender_id: function (v) {\n var sender_id = v.sender_id;\n return sender_id !== undefined && sender_id !== null;\n },\n updated_at: function (v) {\n var updated_at = v.updated_at;\n return (updated_at !== undefined &&\n updated_at !== null &&\n updated_at.length > 0);\n },\n };\n if (!messageEntityValidator.created_at(messageEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {created_at} does not exist or empty');\n if (!messageEntityValidator.date_sent(messageEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {date_sent} does not exist or empty');\n if (!messageEntityValidator.delivered_ids(messageEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {delivered_ids} does not exist or empty');\n if (!messageEntityValidator.dialogId(messageEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {dialogId} does not exist or empty');\n if (!messageEntityValidator.id(messageEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {id} does not exist or empty');\n if (!messageEntityValidator.message(messageEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {message} does not exist or empty');\n if (!messageEntityValidator.read(messageEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {read} does not exist or empty');\n if (!messageEntityValidator.read_ids(messageEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {read_ids} does not exist or empty');\n if (!messageEntityValidator.recipient_id(messageEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {recipient_id} does not exist or empty');\n if (!messageEntityValidator.sender_id(messageEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {sender_id} does not exist or empty');\n if (!messageEntityValidator.updated_at(messageEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {updated_at} does not exist or empty');\n };\n MessageRemoteDTOMapper.validateDTO = function (messageDTO) {\n var dtoValidator = {\n created_at: function (v) {\n var created_at = v.created_at;\n return (created_at !== undefined &&\n created_at !== null &&\n created_at.length > 0);\n },\n date_sent: function (v) {\n var date_sent = v.date_sent;\n return date_sent !== undefined && date_sent !== null;\n },\n delivered_ids: function (v) {\n var delivered_ids = v.delivered_ids;\n return (delivered_ids !== undefined && delivered_ids !== null\n // && delivered_ids.length >= 0\n );\n },\n dialogId: function (v) {\n var dialogId = v.dialogId;\n return (dialogId !== undefined && dialogId !== null && dialogId.length > 0);\n },\n id: function (v) {\n var id = v.id;\n return id !== undefined && id !== null;\n },\n message: function (v) {\n var message = v.message;\n return message !== undefined && message !== null && message.length > 0;\n },\n read: function (v) {\n var read = v.read;\n return read !== undefined && read !== null;\n },\n read_ids: function (v) {\n var read_ids = v.read_ids;\n return (read_ids !== undefined && read_ids !== null\n // && read_ids.length >= 0\n );\n },\n recipient_id: function (v) {\n var recipient_id = v.recipient_id;\n return recipient_id !== undefined && recipient_id !== null;\n },\n sender_id: function (v) {\n var sender_id = v.sender_id;\n return sender_id !== undefined && sender_id !== null;\n },\n updated_at: function (v) {\n var updated_at = v.updated_at;\n return (updated_at !== undefined &&\n updated_at !== null &&\n updated_at.length > 0);\n },\n attachments: function (v) {\n var attachments = v.attachments;\n return attachments !== undefined && attachments !== null;\n },\n };\n if (!dtoValidator.created_at(messageDTO))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {created_at} does not exist or empty');\n if (!dtoValidator.date_sent(messageDTO))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {date_sent} does not exist or empty');\n if (!dtoValidator.delivered_ids(messageDTO))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {delivered_ids} does not exist or empty');\n if (!dtoValidator.dialogId(messageDTO))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {dialogId} does not exist or empty');\n if (!dtoValidator.id(messageDTO))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {id} does not exist or empty');\n if (!dtoValidator.message(messageDTO))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {message} does not exist or empty');\n if (!dtoValidator.read(messageDTO))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {read} does not exist or empty');\n if (!dtoValidator.read_ids(messageDTO))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {read_ids} does not exist or empty');\n if (!dtoValidator.recipient_id(messageDTO))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {recipient_id} does not exist or empty');\n if (!dtoValidator.sender_id(messageDTO))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {sender_id} does not exist or empty');\n if (!dtoValidator.updated_at(messageDTO))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {updated_at} does not exist or empty');\n };\n MessageRemoteDTOMapper.createDefaultMessageEntity = function () {\n return {\n created_at: '',\n date_sent: 0,\n delivered_ids: new Array(),\n dialogId: '',\n id: 0,\n message: '',\n read: 0,\n read_ids: new Array(),\n recipient_id: 0,\n sender_id: 0,\n updated_at: '',\n };\n };\n return MessageRemoteDTOMapper;\n}());\n\n\n\n//# sourceURL=webpack://quickblox-react-ui-kit/./src/Data/mapper/MessageRemoteDTOMapper.ts?");
1106
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"MessageRemoteDTOMapper\": function() { return /* binding */ MessageRemoteDTOMapper; }\n/* harmony export */ });\n/* harmony import */ var _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../source/exception/MapperDTOException */ \"./src/Data/source/exception/MapperDTOException.ts\");\n/* harmony import */ var _dto_message_RemoteMessageDTO__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../dto/message/RemoteMessageDTO */ \"./src/Data/dto/message/RemoteMessageDTO.ts\");\nvar __assign = (undefined && undefined.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\n\n\nvar MessageRemoteDTOMapper = /** @class */ (function () {\n function MessageRemoteDTOMapper() {\n }\n // eslint-disable-next-line class-methods-use-this\n MessageRemoteDTOMapper.prototype.fromEntity = function (entity) {\n var messageEntity = entity;\n if (messageEntity === null || messageEntity === undefined) {\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.UNEXPECTED_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.UNEXPECTED_MAPPER_DTO_EXCEPTION_EXCEPTION_CODE, 'entity is null or undefined');\n }\n var messageDTO = new _dto_message_RemoteMessageDTO__WEBPACK_IMPORTED_MODULE_1__.RemoteMessageDTO();\n MessageRemoteDTOMapper.validateEntity(messageEntity);\n messageDTO.id = messageEntity.id.toString();\n messageDTO.dialogId = messageEntity.dialogId;\n messageDTO.created_at = messageEntity.created_at;\n messageDTO.date_sent = messageEntity.date_sent;\n messageDTO.delivered_ids = messageEntity.delivered_ids;\n messageDTO.message = messageEntity.message;\n messageDTO.read_ids = messageEntity.read_ids;\n messageDTO.read = messageEntity.read ? 1 : 0;\n if (messageEntity.recipient_id !== null) {\n messageDTO.recipient_id = messageEntity.recipient_id;\n }\n messageDTO.notification_type = messageEntity.notification_type;\n messageDTO.dialog_type = messageEntity.dialogType;\n messageDTO.sender_id = messageEntity.sender_id;\n messageDTO.updated_at = messageEntity.updated_at;\n if (messageEntity.attachments && messageEntity.attachments.length) {\n messageEntity.attachments.forEach(function (att) {\n var newAtt = __assign({}, att);\n messageDTO.attachments.push(newAtt);\n });\n }\n return Promise.resolve(messageDTO);\n };\n // eslint-disable-next-line class-methods-use-this\n MessageRemoteDTOMapper.prototype.toEntity = function (data) {\n var messageDTO = data;\n if (messageDTO === null || messageDTO === undefined) {\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.UNEXPECTED_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.UNEXPECTED_MAPPER_DTO_EXCEPTION_EXCEPTION_CODE, 'messageDTO is null or undefined');\n }\n MessageRemoteDTOMapper.validateDTO(messageDTO);\n var messageEntity = MessageRemoteDTOMapper.createDefaultMessageEntity();\n messageEntity.id = parseInt(messageDTO.id, 10);\n messageEntity.dialogId = messageDTO.dialogId;\n messageEntity.created_at = messageDTO.created_at;\n messageEntity.date_sent = messageDTO.date_sent;\n messageEntity.delivered_ids = messageDTO.delivered_ids;\n messageEntity.message = messageDTO.message;\n messageEntity.read_ids = messageDTO.read_ids;\n messageEntity.read = messageDTO.read;\n messageEntity.recipient_id = messageDTO.recipient_id;\n messageEntity.sender_id = messageDTO.sender_id;\n messageEntity.updated_at = messageDTO.updated_at;\n //\n if (messageDTO.attachments && messageDTO.attachments.length) {\n messageEntity.attachments = [];\n messageDTO.attachments.forEach(function (att) {\n var _a;\n var newAtt = __assign({}, att);\n (_a = messageEntity.attachments) === null || _a === void 0 ? void 0 : _a.push(newAtt);\n });\n }\n messageEntity.notification_type = (messageDTO === null || messageDTO === void 0 ? void 0 : messageDTO.notification_type)\n ? messageDTO === null || messageDTO === void 0 ? void 0 : messageDTO.notification_type\n : '';\n messageEntity.markable = (messageDTO === null || messageDTO === void 0 ? void 0 : messageDTO.markable) ? messageDTO === null || messageDTO === void 0 ? void 0 : messageDTO.markable : '';\n //\n return Promise.resolve(messageEntity);\n };\n MessageRemoteDTOMapper.validateEntity = function (messageEntity) {\n var messageEntityValidator = {\n created_at: function (v) {\n var created_at = v.created_at;\n return (created_at !== undefined &&\n created_at !== null &&\n created_at.length > 0);\n },\n date_sent: function (v) {\n var date_sent = v.date_sent;\n return date_sent !== undefined && date_sent !== null;\n },\n delivered_ids: function (v) {\n var delivered_ids = v.delivered_ids;\n return delivered_ids !== undefined && delivered_ids !== null;\n // && delivered_ids.length >= 0\n },\n dialogId: function (v) {\n var dialogId = v.dialogId;\n return (dialogId !== undefined && dialogId !== null && dialogId.length > 0);\n },\n id: function (v) {\n var id = v.id;\n return id !== undefined && id !== null;\n },\n message: function (v) {\n var message = v.message;\n return message !== undefined && message !== null && message.length > 0;\n },\n read: function (v) {\n var read = v.read;\n return read !== undefined && read !== null;\n },\n read_ids: function (v) {\n var read_ids = v.read_ids;\n return (read_ids !== undefined && read_ids !== null\n // && read_ids.length >= 0\n );\n },\n recipient_id: function (v) {\n var recipient_id = v.recipient_id;\n return recipient_id !== undefined && recipient_id !== null;\n },\n sender_id: function (v) {\n var sender_id = v.sender_id;\n return sender_id !== undefined && sender_id !== null;\n },\n updated_at: function (v) {\n var updated_at = v.updated_at;\n return (updated_at !== undefined &&\n updated_at !== null &&\n updated_at.length > 0);\n },\n };\n if (!messageEntityValidator.created_at(messageEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {created_at} does not exist or empty');\n if (!messageEntityValidator.date_sent(messageEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {date_sent} does not exist or empty');\n if (!messageEntityValidator.delivered_ids(messageEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {delivered_ids} does not exist or empty');\n if (!messageEntityValidator.dialogId(messageEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {dialogId} does not exist or empty');\n if (!messageEntityValidator.id(messageEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {id} does not exist or empty');\n if (!messageEntityValidator.message(messageEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {message} does not exist or empty');\n if (!messageEntityValidator.read(messageEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {read} does not exist or empty');\n if (!messageEntityValidator.read_ids(messageEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {read_ids} does not exist or empty');\n if (!messageEntityValidator.recipient_id(messageEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {recipient_id} does not exist or empty');\n if (!messageEntityValidator.sender_id(messageEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {sender_id} does not exist or empty');\n if (!messageEntityValidator.updated_at(messageEntity))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {updated_at} does not exist or empty');\n };\n MessageRemoteDTOMapper.validateDTO = function (messageDTO) {\n var dtoValidator = {\n created_at: function (v) {\n var created_at = v.created_at;\n return (created_at !== undefined &&\n created_at !== null &&\n created_at.length > 0);\n },\n date_sent: function (v) {\n var date_sent = v.date_sent;\n return date_sent !== undefined && date_sent !== null;\n },\n delivered_ids: function (v) {\n var delivered_ids = v.delivered_ids;\n return (delivered_ids !== undefined && delivered_ids !== null\n // && delivered_ids.length >= 0\n );\n },\n dialogId: function (v) {\n var dialogId = v.dialogId;\n return (dialogId !== undefined && dialogId !== null && dialogId.length > 0);\n },\n id: function (v) {\n var id = v.id;\n return id !== undefined && id !== null;\n },\n message: function (v) {\n var message = v.message;\n return message !== undefined && message !== null;\n // && message.length > 0;\n },\n read: function (v) {\n var read = v.read;\n return read !== undefined && read !== null;\n },\n read_ids: function (v) {\n var read_ids = v.read_ids;\n return (read_ids !== undefined && read_ids !== null\n // && read_ids.length >= 0\n );\n },\n recipient_id: function (v) {\n var recipient_id = v.recipient_id;\n return recipient_id !== undefined && recipient_id !== null;\n },\n sender_id: function (v) {\n var sender_id = v.sender_id;\n return sender_id !== undefined && sender_id !== null;\n },\n updated_at: function (v) {\n var updated_at = v.updated_at;\n return (updated_at !== undefined &&\n updated_at !== null &&\n updated_at.length > 0);\n },\n attachments: function (v) {\n var attachments = v.attachments;\n return attachments !== undefined && attachments !== null;\n },\n };\n if (!dtoValidator.created_at(messageDTO))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {created_at} does not exist or empty');\n if (!dtoValidator.date_sent(messageDTO))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {date_sent} does not exist or empty');\n if (!dtoValidator.delivered_ids(messageDTO))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {delivered_ids} does not exist or empty');\n if (!dtoValidator.dialogId(messageDTO))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {dialogId} does not exist or empty');\n if (!dtoValidator.id(messageDTO))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {id} does not exist or empty');\n if (!dtoValidator.message(messageDTO))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {message} does not exist or empty');\n if (!dtoValidator.read(messageDTO))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {read} does not exist or empty');\n if (!dtoValidator.read_ids(messageDTO))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {read_ids} does not exist or empty');\n if (!dtoValidator.recipient_id(messageDTO))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {recipient_id} does not exist or empty');\n if (!dtoValidator.sender_id(messageDTO))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {sender_id} does not exist or empty');\n if (!dtoValidator.updated_at(messageDTO))\n throw new _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.MapperDTOException(_source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _source_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {updated_at} does not exist or empty');\n };\n MessageRemoteDTOMapper.createDefaultMessageEntity = function () {\n return {\n created_at: '',\n date_sent: 0,\n delivered_ids: new Array(),\n dialogId: '',\n id: 0,\n message: '',\n read: 0,\n read_ids: new Array(),\n recipient_id: 0,\n sender_id: 0,\n updated_at: '',\n };\n };\n return MessageRemoteDTOMapper;\n}());\n\n\n\n//# sourceURL=webpack://quickblox-react-ui-kit/./src/Data/mapper/MessageRemoteDTOMapper.ts?");
1085
1107
 
1086
1108
  /***/ }),
1087
1109
 
@@ -1235,7 +1257,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
1235
1257
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
1236
1258
 
1237
1259
  "use strict";
1238
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"DialogDTOMapper\": function() { return /* binding */ DialogDTOMapper; }\n/* harmony export */ });\n/* harmony import */ var _dto_dialog_RemoteDialogDTO__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../dto/dialog/RemoteDialogDTO */ \"./src/Data/dto/dialog/RemoteDialogDTO.ts\");\n/* harmony import */ var _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../Domain/entity/DialogTypes */ \"./src/Domain/entity/DialogTypes.ts\");\n/* harmony import */ var _exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../exception/MapperDTOException */ \"./src/Data/source/exception/MapperDTOException.ts\");\n\n\n\nvar DialogDTOMapper = /** @class */ (function () {\n function DialogDTOMapper() {\n }\n // eslint-disable-next-line class-methods-use-this\n DialogDTOMapper.prototype.fromDTO = function (dto) {\n var dialogDTO = dto;\n DialogDTOMapper.validateDTO(dialogDTO);\n var dialog = {\n _id: dialogDTO.id,\n created_at: '',\n last_message: dialogDTO.lastMessageText,\n last_message_date_sent: dialogDTO.lastMessageDateSent,\n last_message_id: null,\n last_message_user_id: parseInt(dialogDTO.lastMessageUserId, 10),\n name: dialogDTO.name,\n occupants_ids: dialogDTO.participantsIds,\n new_occupants_ids: dialogDTO.newParticipantsIds\n ? dialogDTO.newParticipantsIds\n : [],\n photo: dialogDTO.photo !== '' ? dialogDTO.photo : null,\n type: dialogDTO.type,\n unread_messages_count: dialogDTO.unreadMessageCount,\n updated_at: dialogDTO.updatedAt,\n user_id: parseInt(dialogDTO.ownerId, 10),\n xmpp_room_jid: null,\n };\n return Promise.resolve(dialog);\n };\n // eslint-disable-next-line class-methods-use-this\n DialogDTOMapper.prototype.toTDO = function (qbEntity) {\n var qbDialog = qbEntity;\n DialogDTOMapper.validateQBChatDialog(qbDialog);\n var dto = new _dto_dialog_RemoteDialogDTO__WEBPACK_IMPORTED_MODULE_0__.RemoteDialogDTO();\n dto.id = qbDialog._id;\n dto.lastMessageId = qbDialog.last_message_id || '';\n dto.lastMessageText = qbDialog.last_message;\n dto.lastMessageDateSent = qbDialog.last_message_date_sent;\n dto.lastMessageUserId =\n qbDialog.last_message_user_id === null\n ? ''\n : qbDialog.last_message_user_id.toString();\n dto.ownerId = qbDialog.user_id.toString();\n dto.type = qbDialog.type;\n dto.unreadMessageCount =\n qbDialog.unread_messages_count === null\n ? 0\n : qbDialog.unread_messages_count;\n dto.updatedAt = qbDialog.updated_at;\n dto.participantId = qbDialog.user_id.toString();\n dto.name = qbDialog.name;\n dto.photo = qbDialog.photo === null ? '' : qbDialog.photo;\n dto.participantsIds = qbDialog.occupants_ids;\n dto.newParticipantsIds = qbDialog.new_occupants_ids;\n switch (qbDialog.type) {\n case _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_1__.DialogType[\"private\"]:\n dto.id = qbDialog._id;\n dto.lastMessageText = qbDialog.last_message;\n dto.lastMessageDateSent = qbDialog.last_message_date_sent;\n dto.lastMessageUserId =\n qbDialog.last_message_user_id === null\n ? ''\n : qbDialog.last_message_user_id.toString();\n dto.ownerId = qbDialog.user_id.toString();\n dto.type = qbDialog.type;\n dto.unreadMessageCount =\n qbDialog.unread_messages_count === null\n ? 0\n : qbDialog.unread_messages_count;\n dto.updatedAt = qbDialog.updated_at;\n break;\n case _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_1__.DialogType[\"public\"]:\n dto.id = qbDialog._id;\n dto.lastMessageText = qbDialog.last_message;\n dto.lastMessageDateSent = qbDialog.last_message_date_sent;\n dto.lastMessageUserId =\n qbDialog.last_message_user_id === null\n ? ''\n : qbDialog.last_message_user_id.toString();\n dto.ownerId = qbDialog.user_id.toString();\n dto.type = qbDialog.type;\n dto.unreadMessageCount =\n qbDialog.unread_messages_count === null\n ? 0\n : qbDialog.unread_messages_count;\n dto.updatedAt = qbDialog.updated_at;\n dto.participantId = qbDialog.user_id.toString();\n dto.name = qbDialog.name;\n dto.photo = qbDialog.photo === null ? '' : qbDialog.photo;\n break;\n case _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_1__.DialogType.group:\n dto.id = qbDialog._id;\n dto.lastMessageText = qbDialog.last_message;\n dto.lastMessageDateSent = qbDialog.last_message_date_sent;\n dto.lastMessageUserId =\n qbDialog.last_message_user_id === null\n ? ''\n : qbDialog.last_message_user_id.toString();\n dto.ownerId = qbDialog.user_id.toString();\n dto.type = qbDialog.type;\n dto.unreadMessageCount =\n qbDialog.unread_messages_count === null\n ? 0\n : qbDialog.unread_messages_count;\n dto.updatedAt = qbDialog.updated_at;\n dto.name = qbDialog.name;\n dto.photo = qbDialog.photo === null ? '' : qbDialog.photo;\n dto.participantsIds = qbDialog.occupants_ids;\n break;\n default:\n return Promise.reject(new _exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.MapperDTOException(_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.UNEXPECTED_MAPPER_DTO_EXCEPTION_MESSAGE, _exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.UNEXPECTED_MAPPER_DTO_EXCEPTION_EXCEPTION_CODE, 'undefinded type dialog in QBChatDialog'));\n }\n return Promise.resolve(dto);\n };\n // TODO: check field for validate RemoteDialogDTO\n DialogDTOMapper.validateDTO = function (dto) {\n var dialogDTOValidator = {\n id: function (v) {\n var id = v.id;\n return id !== undefined && id !== null;\n },\n lastMessageDateSent: function (v) {\n var lastMessageDateSent = v.lastMessageDateSent;\n return (lastMessageDateSent !== undefined && lastMessageDateSent !== null);\n },\n lastMessageText: function (v) {\n var lastMessageText = v.lastMessageText;\n return lastMessageText !== undefined && lastMessageText !== null;\n },\n lastMessageUserId: function (v) {\n var lastMessageUserId = v.lastMessageUserId;\n return lastMessageUserId !== undefined && lastMessageUserId !== null;\n },\n lastMessageId: function (v) {\n var lastMessageId = v.lastMessageId;\n return lastMessageId !== undefined && lastMessageId !== null;\n },\n name: function (v) {\n var name = v.name;\n return name !== undefined && name !== null;\n },\n ownerId: function (v) {\n var ownerId = v.ownerId;\n // todo: need check to empty string or string with len <= 3\n return ownerId !== undefined && ownerId !== null;\n },\n participantId: function (v) {\n var participantId = v.participantId;\n return participantId !== undefined && participantId !== null;\n },\n participantsIds: function (v) {\n var participantsIds = v.participantsIds;\n return participantsIds !== undefined && participantsIds !== null;\n },\n photo: function (v) {\n var photo = v.photo;\n return photo !== undefined && photo !== null;\n },\n type: function (v) {\n var type = v.type;\n return type !== undefined && type !== null;\n },\n unreadMessageCount: function (v) {\n var unreadMessageCount = v.unreadMessageCount;\n return unreadMessageCount !== undefined && unreadMessageCount !== null;\n },\n updatedAt: function (v) {\n var updatedAt = v.updatedAt;\n return updatedAt !== undefined && updatedAt !== null;\n },\n };\n if (!dialogDTOValidator.id(dto))\n throw new _exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.MapperDTOException(_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {id} does not exist or empty');\n if (!dialogDTOValidator.lastMessageText(dto))\n throw new _exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.MapperDTOException(_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {lastMessage} does not exist or empty');\n if (!dialogDTOValidator.ownerId(dto))\n throw new _exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.MapperDTOException(_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {ownerId} does not exist or empty');\n if (!dialogDTOValidator.type(dto))\n throw new _exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.MapperDTOException(_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {type} does not exist or empty');\n if (!dialogDTOValidator.unreadMessageCount(dto))\n throw new _exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.MapperDTOException(_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {unreadMessageCount} does not exist or empty');\n if (!dialogDTOValidator.updatedAt(dto))\n throw new _exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.MapperDTOException(_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {updatedAt} does not exist or empty');\n if (!dialogDTOValidator.name(dto))\n throw new _exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.MapperDTOException(_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {name} does not exist or empty');\n if (!dialogDTOValidator.photo(dto))\n throw new _exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.MapperDTOException(_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {photo} does not exist or empty');\n };\n // TODO: check field for validate QBChatDialog\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n DialogDTOMapper.validateQBChatDialog = function (qbDialog) {\n var qbDialogValidator = {\n _id: function (v) {\n var _id = v._id;\n return _id !== undefined && _id !== null;\n },\n created_at: function (v) {\n var created_at = v.created_at;\n return created_at !== undefined && created_at !== null;\n },\n data: function (v) {\n var data = v.data;\n return data !== undefined && data !== null;\n },\n joined: function (v) {\n var joined = v.joined;\n return joined !== undefined && joined !== null;\n },\n last_message: function (v) {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n var last_message = v.last_message;\n // return last_message !== undefined && last_message !== null;\n return true;\n },\n last_message_date_sent: function (v) {\n var last_message_date_sent = v.last_message_date_sent;\n return (last_message_date_sent !== undefined &&\n last_message_date_sent !== null);\n },\n last_message_id: function (v) {\n var last_message_id = v.last_message_id;\n return last_message_id !== undefined && last_message_id !== null;\n },\n last_message_user_id: function (v) {\n var last_message_user_id = v.last_message_user_id;\n return (last_message_user_id !== undefined && last_message_user_id !== null);\n },\n name: function (v) {\n var name = v.name;\n return name !== undefined && name !== null;\n },\n occupants_ids: function (v) {\n var occupants_ids = v.occupants_ids;\n return occupants_ids !== undefined && occupants_ids !== null;\n },\n new_occupants_ids: function (v) {\n var new_occupants_ids = v.new_occupants_ids;\n return new_occupants_ids !== undefined && new_occupants_ids !== null;\n },\n photo: function (v) {\n var photo = v.photo;\n return photo !== undefined && photo !== null;\n },\n type: function (v) {\n var type = v.type;\n return type !== undefined && type !== null;\n },\n unread_messages_count: function (v) {\n var unread_messages_count = v.unread_messages_count;\n return (unread_messages_count !== undefined && unread_messages_count !== null);\n },\n updated_at: function (v) {\n var updated_at = v.updated_at;\n return updated_at !== undefined && updated_at !== null;\n },\n user_id: function (v) {\n var user_id = v.user_id;\n return user_id !== undefined && user_id !== null;\n },\n xmpp_room_jid: function (v) {\n var xmpp_room_jid = v.xmpp_room_jid;\n return xmpp_room_jid !== undefined && xmpp_room_jid !== null;\n },\n };\n if (!qbDialogValidator._id(qbDialog))\n throw new _exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.MapperDTOException(_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {id} does not exist or empty');\n if (!qbDialogValidator.last_message(qbDialog)) {\n console.log('last_message is does not exist or empty. qbDialog: ', JSON.stringify(qbDialog));\n throw new _exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.MapperDTOException(_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {lastMessage} does not exist or empty');\n }\n if (!qbDialogValidator.user_id(qbDialog))\n throw new _exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.MapperDTOException(_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {user_id} does not exist or empty');\n };\n return DialogDTOMapper;\n}());\n\n\n\n//# sourceURL=webpack://quickblox-react-ui-kit/./src/Data/source/remote/Mapper/DialogDTOMapper.ts?");
1260
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"DialogDTOMapper\": function() { return /* binding */ DialogDTOMapper; }\n/* harmony export */ });\n/* harmony import */ var _dto_dialog_RemoteDialogDTO__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../dto/dialog/RemoteDialogDTO */ \"./src/Data/dto/dialog/RemoteDialogDTO.ts\");\n/* harmony import */ var _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../Domain/entity/DialogTypes */ \"./src/Domain/entity/DialogTypes.ts\");\n/* harmony import */ var _exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../exception/MapperDTOException */ \"./src/Data/source/exception/MapperDTOException.ts\");\n\n\n\nvar DialogDTOMapper = /** @class */ (function () {\n function DialogDTOMapper(currentUserId) {\n this.currentUserId = currentUserId;\n }\n // eslint-disable-next-line class-methods-use-this\n DialogDTOMapper.prototype.fromDTO = function (dto) {\n var dialogDTO = dto;\n DialogDTOMapper.validateDTO(dialogDTO);\n var dialog = {\n _id: dialogDTO.id,\n created_at: '',\n last_message: dialogDTO.lastMessageText,\n last_message_date_sent: dialogDTO.lastMessageDateSent,\n last_message_id: null,\n last_message_user_id: parseInt(dialogDTO.lastMessageUserId, 10),\n name: dialogDTO.name,\n occupants_ids: dialogDTO.participantsIds,\n new_occupants_ids: dialogDTO.newParticipantsIds\n ? dialogDTO.newParticipantsIds\n : [],\n photo: dialogDTO.photo !== '' ? dialogDTO.photo : null,\n type: dialogDTO.type,\n unread_messages_count: dialogDTO.unreadMessageCount,\n updated_at: dialogDTO.updatedAt,\n user_id: parseInt(dialogDTO.ownerId, 10),\n xmpp_room_jid: null,\n };\n return Promise.resolve(dialog);\n };\n // eslint-disable-next-line class-methods-use-this\n DialogDTOMapper.prototype.toTDO = function (qbEntity) {\n var _this = this;\n var qbDialog = qbEntity;\n DialogDTOMapper.validateQBChatDialog(qbDialog);\n var dto = new _dto_dialog_RemoteDialogDTO__WEBPACK_IMPORTED_MODULE_0__.RemoteDialogDTO();\n dto.id = qbDialog._id;\n dto.lastMessageId = qbDialog.last_message_id || '';\n dto.lastMessageText = qbDialog.last_message;\n dto.lastMessageDateSent = qbDialog.last_message_date_sent;\n dto.lastMessageUserId =\n qbDialog.last_message_user_id === null\n ? ''\n : qbDialog.last_message_user_id.toString();\n dto.ownerId = qbDialog.user_id.toString();\n dto.type = qbDialog.type;\n dto.unreadMessageCount =\n qbDialog.unread_messages_count === null\n ? 0\n : qbDialog.unread_messages_count;\n dto.updatedAt = qbDialog.updated_at;\n dto.participantId = qbDialog.user_id.toString();\n dto.name = qbDialog.name;\n dto.photo = qbDialog.photo === null ? '' : qbDialog.photo;\n dto.participantsIds = qbDialog.occupants_ids;\n dto.newParticipantsIds = qbDialog.new_occupants_ids;\n switch (qbDialog.type) {\n case _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_1__.DialogType[\"private\"]:\n // eslint-disable-next-line no-case-declarations\n var interlocutorId = dto.participantsIds.find(function (p) { return p !== _this.currentUserId; }); // ;\n dto.participantId = interlocutorId\n ? interlocutorId.toString()\n : qbDialog.user_id.toString();\n dto.id = qbDialog._id;\n dto.lastMessageText = qbDialog.last_message;\n dto.lastMessageDateSent = qbDialog.last_message_date_sent;\n dto.lastMessageUserId =\n qbDialog.last_message_user_id === null\n ? ''\n : qbDialog.last_message_user_id.toString();\n dto.ownerId = qbDialog.user_id.toString();\n dto.type = qbDialog.type;\n dto.unreadMessageCount =\n qbDialog.unread_messages_count === null\n ? 0\n : qbDialog.unread_messages_count;\n dto.updatedAt = qbDialog.updated_at;\n break;\n case _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_1__.DialogType[\"public\"]:\n dto.id = qbDialog._id;\n dto.lastMessageText = qbDialog.last_message;\n dto.lastMessageDateSent = qbDialog.last_message_date_sent;\n dto.lastMessageUserId =\n qbDialog.last_message_user_id === null\n ? ''\n : qbDialog.last_message_user_id.toString();\n dto.ownerId = qbDialog.user_id.toString();\n dto.type = qbDialog.type;\n dto.unreadMessageCount =\n qbDialog.unread_messages_count === null\n ? 0\n : qbDialog.unread_messages_count;\n dto.updatedAt = qbDialog.updated_at;\n dto.participantId = qbDialog.user_id.toString();\n dto.name = qbDialog.name;\n dto.photo = qbDialog.photo === null ? '' : qbDialog.photo;\n break;\n case _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_1__.DialogType.group:\n dto.id = qbDialog._id;\n dto.lastMessageText = qbDialog.last_message;\n dto.lastMessageDateSent = qbDialog.last_message_date_sent;\n dto.lastMessageUserId =\n qbDialog.last_message_user_id === null\n ? ''\n : qbDialog.last_message_user_id.toString();\n dto.ownerId = qbDialog.user_id.toString();\n dto.type = qbDialog.type;\n dto.unreadMessageCount =\n qbDialog.unread_messages_count === null\n ? 0\n : qbDialog.unread_messages_count;\n dto.updatedAt = qbDialog.updated_at;\n dto.name = qbDialog.name;\n dto.photo = qbDialog.photo === null ? '' : qbDialog.photo;\n dto.participantsIds = qbDialog.occupants_ids;\n break;\n default:\n return Promise.reject(new _exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.MapperDTOException(_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.UNEXPECTED_MAPPER_DTO_EXCEPTION_MESSAGE, _exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.UNEXPECTED_MAPPER_DTO_EXCEPTION_EXCEPTION_CODE, 'undefinded type dialog in QBChatDialog'));\n }\n return Promise.resolve(dto);\n };\n // TODO: check field for validate RemoteDialogDTO\n DialogDTOMapper.validateDTO = function (dto) {\n var dialogDTOValidator = {\n id: function (v) {\n var id = v.id;\n return id !== undefined && id !== null;\n },\n lastMessageDateSent: function (v) {\n var lastMessageDateSent = v.lastMessageDateSent;\n return (lastMessageDateSent !== undefined && lastMessageDateSent !== null);\n },\n lastMessageText: function (v) {\n var lastMessageText = v.lastMessageText;\n return lastMessageText !== undefined && lastMessageText !== null;\n },\n lastMessageUserId: function (v) {\n var lastMessageUserId = v.lastMessageUserId;\n return lastMessageUserId !== undefined && lastMessageUserId !== null;\n },\n lastMessageId: function (v) {\n var lastMessageId = v.lastMessageId;\n return lastMessageId !== undefined && lastMessageId !== null;\n },\n name: function (v) {\n var name = v.name;\n return name !== undefined && name !== null;\n },\n ownerId: function (v) {\n var ownerId = v.ownerId;\n // todo: need check to empty string or string with len <= 3\n return ownerId !== undefined && ownerId !== null;\n },\n participantId: function (v) {\n var participantId = v.participantId;\n return participantId !== undefined && participantId !== null;\n },\n participantsIds: function (v) {\n var participantsIds = v.participantsIds;\n return participantsIds !== undefined && participantsIds !== null;\n },\n photo: function (v) {\n var photo = v.photo;\n return photo !== undefined && photo !== null;\n },\n type: function (v) {\n var type = v.type;\n return type !== undefined && type !== null;\n },\n unreadMessageCount: function (v) {\n var unreadMessageCount = v.unreadMessageCount;\n return unreadMessageCount !== undefined && unreadMessageCount !== null;\n },\n updatedAt: function (v) {\n var updatedAt = v.updatedAt;\n return updatedAt !== undefined && updatedAt !== null;\n },\n };\n if (!dialogDTOValidator.id(dto))\n throw new _exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.MapperDTOException(_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {id} does not exist or empty');\n if (!dialogDTOValidator.lastMessageText(dto))\n throw new _exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.MapperDTOException(_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {lastMessage} does not exist or empty');\n if (!dialogDTOValidator.ownerId(dto))\n throw new _exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.MapperDTOException(_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {ownerId} does not exist or empty');\n if (!dialogDTOValidator.type(dto))\n throw new _exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.MapperDTOException(_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {type} does not exist or empty');\n if (!dialogDTOValidator.unreadMessageCount(dto))\n throw new _exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.MapperDTOException(_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {unreadMessageCount} does not exist or empty');\n if (!dialogDTOValidator.updatedAt(dto))\n throw new _exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.MapperDTOException(_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {updatedAt} does not exist or empty');\n if (!dialogDTOValidator.name(dto))\n throw new _exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.MapperDTOException(_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {name} does not exist or empty');\n if (!dialogDTOValidator.photo(dto))\n throw new _exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.MapperDTOException(_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {photo} does not exist or empty');\n };\n // TODO: check field for validate QBChatDialog\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n DialogDTOMapper.validateQBChatDialog = function (qbDialog) {\n var qbDialogValidator = {\n _id: function (v) {\n var _id = v._id;\n return _id !== undefined && _id !== null;\n },\n created_at: function (v) {\n var created_at = v.created_at;\n return created_at !== undefined && created_at !== null;\n },\n data: function (v) {\n var data = v.data;\n return data !== undefined && data !== null;\n },\n joined: function (v) {\n var joined = v.joined;\n return joined !== undefined && joined !== null;\n },\n last_message: function (v) {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n var last_message = v.last_message;\n // return last_message !== undefined && last_message !== null;\n return true;\n },\n last_message_date_sent: function (v) {\n var last_message_date_sent = v.last_message_date_sent;\n return (last_message_date_sent !== undefined &&\n last_message_date_sent !== null);\n },\n last_message_id: function (v) {\n var last_message_id = v.last_message_id;\n return last_message_id !== undefined && last_message_id !== null;\n },\n last_message_user_id: function (v) {\n var last_message_user_id = v.last_message_user_id;\n return (last_message_user_id !== undefined && last_message_user_id !== null);\n },\n name: function (v) {\n var name = v.name;\n return name !== undefined && name !== null;\n },\n occupants_ids: function (v) {\n var occupants_ids = v.occupants_ids;\n return occupants_ids !== undefined && occupants_ids !== null;\n },\n new_occupants_ids: function (v) {\n var new_occupants_ids = v.new_occupants_ids;\n return new_occupants_ids !== undefined && new_occupants_ids !== null;\n },\n photo: function (v) {\n var photo = v.photo;\n return photo !== undefined && photo !== null;\n },\n type: function (v) {\n var type = v.type;\n return type !== undefined && type !== null;\n },\n unread_messages_count: function (v) {\n var unread_messages_count = v.unread_messages_count;\n return (unread_messages_count !== undefined && unread_messages_count !== null);\n },\n updated_at: function (v) {\n var updated_at = v.updated_at;\n return updated_at !== undefined && updated_at !== null;\n },\n user_id: function (v) {\n var user_id = v.user_id;\n return user_id !== undefined && user_id !== null;\n },\n xmpp_room_jid: function (v) {\n var xmpp_room_jid = v.xmpp_room_jid;\n return xmpp_room_jid !== undefined && xmpp_room_jid !== null;\n },\n };\n if (!qbDialogValidator._id(qbDialog))\n throw new _exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.MapperDTOException(_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {id} does not exist or empty');\n if (!qbDialogValidator.last_message(qbDialog)) {\n console.log('last_message is does not exist or empty. qbDialog: ', JSON.stringify(qbDialog));\n throw new _exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.MapperDTOException(_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {lastMessage} does not exist or empty');\n }\n if (!qbDialogValidator.user_id(qbDialog))\n throw new _exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.MapperDTOException(_exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, _exception_MapperDTOException__WEBPACK_IMPORTED_MODULE_2__.INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {user_id} does not exist or empty');\n };\n return DialogDTOMapper;\n}());\n\n\n\n//# sourceURL=webpack://quickblox-react-ui-kit/./src/Data/source/remote/Mapper/DialogDTOMapper.ts?");
1239
1261
 
1240
1262
  /***/ }),
1241
1263
 
@@ -1279,7 +1301,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
1279
1301
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
1280
1302
 
1281
1303
  "use strict";
1282
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"RemoteDataSource\": function() { return /* binding */ RemoteDataSource; }\n/* harmony export */ });\n/* harmony import */ var _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../exception/RemoteDataSourceException */ \"./src/Data/source/exception/RemoteDataSourceException.ts\");\n/* harmony import */ var _dto_dialog_RemoteDialogsDTO__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../dto/dialog/RemoteDialogsDTO */ \"./src/Data/dto/dialog/RemoteDialogsDTO.ts\");\n/* harmony import */ var _dto_message_RemoteMessageDTO__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../dto/message/RemoteMessageDTO */ \"./src/Data/dto/message/RemoteMessageDTO.ts\");\n/* harmony import */ var _dto_user_RemoteUsersDTO__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../dto/user/RemoteUsersDTO */ \"./src/Data/dto/user/RemoteUsersDTO.ts\");\n/* harmony import */ var _dto_message_RemoteMessagesDTO__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../dto/message/RemoteMessagesDTO */ \"./src/Data/dto/message/RemoteMessagesDTO.ts\");\n/* harmony import */ var _Domain_repository_Pagination__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../Domain/repository/Pagination */ \"./src/Domain/repository/Pagination.ts\");\n/* harmony import */ var _Mapper_DialogDTOMapper__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Mapper/DialogDTOMapper */ \"./src/Data/source/remote/Mapper/DialogDTOMapper.ts\");\n/* harmony import */ var _Stubs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../Stubs */ \"./src/Data/Stubs.ts\");\n/* harmony import */ var _qb_api_calls__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../qb-api-calls */ \"./src/qb-api-calls/index.ts\");\n/* harmony import */ var _Mapper_UserDTOMapper__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./Mapper/UserDTOMapper */ \"./src/Data/source/remote/Mapper/UserDTOMapper.ts\");\n/* harmony import */ var _Mapper_MessageDTOMapper__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./Mapper/MessageDTOMapper */ \"./src/Data/source/remote/Mapper/MessageDTOMapper.ts\");\n/* harmony import */ var _mapper_DialogRemoteDTOMapper__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../mapper/DialogRemoteDTOMapper */ \"./src/Data/mapper/DialogRemoteDTOMapper.ts\");\n/* harmony import */ var _utils_parse__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../utils/parse */ \"./src/utils/parse.ts\");\n/* harmony import */ var _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../Domain/entity/DialogTypes */ \"./src/Domain/entity/DialogTypes.ts\");\n/* harmony import */ var _Domain_entity_NotificationTypes__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../Domain/entity/NotificationTypes */ \"./src/Domain/entity/NotificationTypes.ts\");\n/* harmony import */ var _Domain_entity_EventMessageType__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../../Domain/entity/EventMessageType */ \"./src/Domain/entity/EventMessageType.ts\");\n/* harmony import */ var _Domain_use_cases_base_Subscribable_SubscriptionPerformer__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../../Domain/use_cases/base/Subscribable/SubscriptionPerformer */ \"./src/Domain/use_cases/base/Subscribable/SubscriptionPerformer.ts\");\n/* harmony import */ var _Mapper_FileDTOMapper__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./Mapper/FileDTOMapper */ \"./src/Data/source/remote/Mapper/FileDTOMapper.ts\");\n/* harmony import */ var _QBconfig__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../../QBconfig */ \"./src/QBconfig.ts\");\nvar __assign = (undefined && undefined.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (undefined && undefined.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvar RemoteDataSource = /** @class */ (function () {\n //\n function RemoteDataSource() {\n this.subscriptionOnSystemMessages = {};\n this.subscriptionOnChatMessages = new _Domain_use_cases_base_Subscribable_SubscriptionPerformer__WEBPACK_IMPORTED_MODULE_16__.SubscriptionPerformer();\n this.subscriptionOnMessageStatus = new _Domain_use_cases_base_Subscribable_SubscriptionPerformer__WEBPACK_IMPORTED_MODULE_16__.SubscriptionPerformer();\n this.subscriptionOnSessionExpiredListener = new _Domain_use_cases_base_Subscribable_SubscriptionPerformer__WEBPACK_IMPORTED_MODULE_16__.SubscriptionPerformer();\n console.log('CONSTRUCTOR RemoteDataSourceMock');\n this.dialogDTOMapper = new _Mapper_DialogDTOMapper__WEBPACK_IMPORTED_MODULE_6__.DialogDTOMapper();\n this.userDTOMapper = new _Mapper_UserDTOMapper__WEBPACK_IMPORTED_MODULE_9__.UserDTOMapper();\n this.messageDTOMapper = new _Mapper_MessageDTOMapper__WEBPACK_IMPORTED_MODULE_10__.MessageDTOMapper();\n this.fileDTOMapper = new _Mapper_FileDTOMapper__WEBPACK_IMPORTED_MODULE_17__.FileDTOMapper();\n this._needInit = true;\n this._authProcessed = false;\n this.subscriptionOnSystemMessages[_Domain_entity_NotificationTypes__WEBPACK_IMPORTED_MODULE_14__.NotificationTypes.UPDATE_DIALOG] =\n new _Domain_use_cases_base_Subscribable_SubscriptionPerformer__WEBPACK_IMPORTED_MODULE_16__.SubscriptionPerformer();\n this.subscriptionOnSystemMessages[_Domain_entity_NotificationTypes__WEBPACK_IMPORTED_MODULE_14__.NotificationTypes.DELETE_LEAVE_DIALOG] =\n new _Domain_use_cases_base_Subscribable_SubscriptionPerformer__WEBPACK_IMPORTED_MODULE_16__.SubscriptionPerformer();\n this.subscriptionOnSystemMessages[_Domain_entity_NotificationTypes__WEBPACK_IMPORTED_MODULE_14__.NotificationTypes.NEW_DIALOG] =\n new _Domain_use_cases_base_Subscribable_SubscriptionPerformer__WEBPACK_IMPORTED_MODULE_16__.SubscriptionPerformer();\n }\n Object.defineProperty(RemoteDataSource.prototype, \"needInit\", {\n get: function () {\n return this._needInit;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(RemoteDataSource.prototype, \"authProcessed\", {\n get: function () {\n return this._authProcessed;\n },\n enumerable: false,\n configurable: true\n });\n RemoteDataSource.prototype.setAuthProcessedSuccessed = function () {\n this._authProcessed = true;\n this.setInitSDKSuccessed();\n };\n RemoteDataSource.prototype.setInitSDKSuccessed = function () {\n this._needInit = false;\n };\n Object.defineProperty(RemoteDataSource.prototype, \"authInformation\", {\n get: function () {\n return this._authInformation;\n },\n enumerable: false,\n configurable: true\n });\n RemoteDataSource.prototype.setUpMockStorage = function () {\n return __awaiter(this, void 0, void 0, function () {\n var dialogsDTOtoEntityMapper, dialogsEntities, _loop_1, this_1, _i, dialogsEntities_1, item;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n dialogsDTOtoEntityMapper = new _mapper_DialogRemoteDTOMapper__WEBPACK_IMPORTED_MODULE_11__.DialogRemoteDTOMapper();\n dialogsEntities = _Stubs__WEBPACK_IMPORTED_MODULE_7__.Stubs.createDialogsForTest();\n _loop_1 = function (item) {\n var dialogDTO;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0: \n // eslint-disable-next-line no-await-in-loop\n return [4 /*yield*/, dialogsDTOtoEntityMapper.fromEntity(item)];\n case 1:\n dialogDTO = \n // eslint-disable-next-line no-await-in-loop\n _b.sent();\n // eslint-disable-next-line @typescript-eslint/no-unused-vars,promise/catch-or-return,promise/always-return\n this_1.createDialog(dialogDTO)\n // eslint-disable-next-line @typescript-eslint/no-unused-vars,promise/always-return\n .then(function (_) {\n console.log(\"added mock item \".concat(JSON.stringify(dialogDTO)));\n })\n .catch(function (e) {\n console.log('EXCEPTION:', e.message);\n });\n return [2 /*return*/];\n }\n });\n };\n this_1 = this;\n _i = 0, dialogsEntities_1 = dialogsEntities;\n _a.label = 1;\n case 1:\n if (!(_i < dialogsEntities_1.length)) return [3 /*break*/, 4];\n item = dialogsEntities_1[_i];\n return [5 /*yield**/, _loop_1(item)];\n case 2:\n _a.sent();\n _a.label = 3;\n case 3:\n _i++;\n return [3 /*break*/, 1];\n case 4: return [2 /*return*/];\n }\n });\n });\n };\n // eslint-disable-next-line class-methods-use-this\n RemoteDataSource.prototype.createUserSession = function (loginData) {\n return __awaiter(this, void 0, void 0, function () {\n var session;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, (0,_qb_api_calls__WEBPACK_IMPORTED_MODULE_8__.QBCreateSession)(loginData)];\n case 1:\n session = _a.sent();\n return [2 /*return*/, session];\n }\n });\n });\n };\n // eslint-disable-next-line class-methods-use-this\n RemoteDataSource.initSDK = function (sdkParams) {\n console.log('2. call initSDK in RemoteDataSourceMock');\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n if (!window.QB) {\n throw new Error('HAVE NO SDK');\n }\n else {\n console.log('2. start init actions');\n (0,_qb_api_calls__WEBPACK_IMPORTED_MODULE_8__.QBInit)({\n appIdOrToken: sdkParams.appIdOrToken,\n authKeyOrAppId: sdkParams.authKeyOrAppId,\n authSecret: sdkParams.authSecret,\n accountKey: sdkParams.accountKey,\n config: sdkParams.config,\n });\n var QuickBloxVersion = \"CALL initData: Init SDK was success: version \".concat(QB.version, \" build \").concat(QB.buildNumber);\n console.log(QuickBloxVersion);\n return true;\n }\n };\n RemoteDataSource.prototype.initSDKWithUser = function (sdkParams, authData) {\n return __awaiter(this, void 0, void 0, function () {\n var QuickBloxVersion;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n console.log('2. call initSDK in RemoteDataSourceMock');\n if (!this._needInit) return [3 /*break*/, 2];\n console.log('2. start init actions');\n (0,_qb_api_calls__WEBPACK_IMPORTED_MODULE_8__.QBInit)({\n appIdOrToken: sdkParams.appIdOrToken,\n authKeyOrAppId: sdkParams.authKeyOrAppId,\n authSecret: sdkParams.authSecret,\n accountKey: sdkParams.accountKey,\n config: sdkParams.config,\n });\n QuickBloxVersion = \"CALL initData: Init SDK was success: version \".concat(QB.version, \" build \").concat(QB.buildNumber);\n console.log(QuickBloxVersion);\n //\n this._needInit = false;\n return [4 /*yield*/, this.loginWithUser(authData)];\n case 1:\n _a.sent();\n _a.label = 2;\n case 2: return [2 /*return*/];\n }\n });\n });\n };\n RemoteDataSource.prototype.disconnectAndLogoutUser = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!this._authProcessed) return [3 /*break*/, 2];\n (0,_qb_api_calls__WEBPACK_IMPORTED_MODULE_8__.QBChatDisconnect)();\n return [4 /*yield*/, (0,_qb_api_calls__WEBPACK_IMPORTED_MODULE_8__.QBLogout)()];\n case 1:\n _a.sent();\n this._authProcessed = false;\n this.releaseSubscriptions();\n this.releaseEventsHandlers();\n _a.label = 2;\n case 2: return [2 /*return*/];\n }\n });\n });\n };\n RemoteDataSource.prototype.releaseSubscriptions = function () {\n var _this = this;\n Object.entries(this.subscriptionOnSystemMessages).map(function (x) {\n var eventName = x[0];\n return _this.subscriptionOnSystemMessages[eventName].release();\n });\n };\n RemoteDataSource.prototype.subscribeOnSystemMessaging = function (notificationType, callback) {\n var SystemMessageType = _Domain_entity_NotificationTypes__WEBPACK_IMPORTED_MODULE_14__.NotificationTypes.NEW_DIALOG;\n switch (notificationType) {\n case _Domain_entity_NotificationTypes__WEBPACK_IMPORTED_MODULE_14__.NotificationTypes.DELETE_LEAVE_DIALOG:\n SystemMessageType = _Domain_entity_NotificationTypes__WEBPACK_IMPORTED_MODULE_14__.NotificationTypes.DELETE_LEAVE_DIALOG;\n break;\n case _Domain_entity_NotificationTypes__WEBPACK_IMPORTED_MODULE_14__.NotificationTypes.UPDATE_DIALOG:\n SystemMessageType = _Domain_entity_NotificationTypes__WEBPACK_IMPORTED_MODULE_14__.NotificationTypes.UPDATE_DIALOG;\n break;\n default:\n SystemMessageType = _Domain_entity_NotificationTypes__WEBPACK_IMPORTED_MODULE_14__.NotificationTypes.NEW_DIALOG;\n break;\n }\n this.subscriptionOnSystemMessages[SystemMessageType].subscribe(callback, _Domain_entity_EventMessageType__WEBPACK_IMPORTED_MODULE_15__[\"default\"].SystemMessage);\n };\n RemoteDataSource.prototype.subscribeOnMessaging = function (callback) {\n this.subscriptionOnChatMessages.subscribe(callback, _Domain_entity_EventMessageType__WEBPACK_IMPORTED_MODULE_15__[\"default\"].RegularMessage);\n };\n RemoteDataSource.prototype.subscribeOnSessionExpiredListener = function (callback) {\n var _this = this;\n console.log('subscribe On Session Expired Event');\n this.subscriptionOnSessionExpiredListener.subscribe(callback, _Domain_entity_EventMessageType__WEBPACK_IMPORTED_MODULE_15__[\"default\"].LocalMessage);\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n var sessionTimeOut = _QBconfig__WEBPACK_IMPORTED_MODULE_18__.QBConfig.appConfig.sessionTimeOut || 122;\n setTimeout(function () {\n console.log('NEED LOGOUT');\n if (_this._authProcessed) {\n _this.subscriptionOnSessionExpiredListener.informSubscribers(true, _Domain_entity_EventMessageType__WEBPACK_IMPORTED_MODULE_15__[\"default\"].LocalMessage);\n }\n }, sessionTimeOut * 60 * 1000);\n };\n RemoteDataSource.prototype.subscribeOnUpdateMessageStatus = function (callback) {\n this.subscriptionOnMessageStatus.subscribe(callback, _Domain_entity_EventMessageType__WEBPACK_IMPORTED_MODULE_15__[\"default\"].LocalMessage);\n };\n RemoteDataSource.prototype.initEventsHandlers = function () {\n var _this = this;\n QB.chat.onSystemMessageListener = function (message) {\n var _a;\n console.log(\"EVENT: receive system message: \".concat(JSON.stringify(message)));\n var resultMessage = new _dto_message_RemoteMessageDTO__WEBPACK_IMPORTED_MODULE_2__.RemoteMessageDTO();\n resultMessage.sender_id = message.userId;\n resultMessage.message = message.body || 'system message';\n resultMessage.notification_type =\n message.extension.notification_type || _Domain_entity_NotificationTypes__WEBPACK_IMPORTED_MODULE_14__.NotificationTypes.UPDATE_DIALOG;\n resultMessage.dialogId = ((_a = message === null || message === void 0 ? void 0 : message.extension) === null || _a === void 0 ? void 0 : _a.dialog_id) || '';\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n function getEventNameFromNotification(notification_type) {\n var EventName = _Domain_use_cases_base_Subscribable_SubscriptionPerformer__WEBPACK_IMPORTED_MODULE_16__.SubscriptionPerformer.DEFAULT_SUBSCRIPTION_NAME;\n if (notification_type === _Domain_entity_NotificationTypes__WEBPACK_IMPORTED_MODULE_14__.NotificationTypes.UPDATE_DIALOG ||\n notification_type === _Domain_entity_NotificationTypes__WEBPACK_IMPORTED_MODULE_14__.NotificationTypes.NEW_DIALOG) {\n EventName = 'UPDATE_DIALOG_LIST_INFO';\n }\n return EventName;\n }\n _this.subscriptionOnSystemMessages[resultMessage.notification_type].informSubscribers(resultMessage, _Domain_entity_EventMessageType__WEBPACK_IMPORTED_MODULE_15__[\"default\"].SystemMessage);\n };\n function ToRemoteMessageDTO(message) {\n var _a, _b, _c, _d, _e;\n var resultMessage = new _dto_message_RemoteMessageDTO__WEBPACK_IMPORTED_MODULE_2__.RemoteMessageDTO();\n resultMessage.id = message.id;\n resultMessage.message = message.body;\n resultMessage.markable = message.markable\n ? message.markable.toString()\n : '0';\n resultMessage.dialogId = ((_a = message === null || message === void 0 ? void 0 : message.extension) === null || _a === void 0 ? void 0 : _a.dialog_id) || '';\n // eslint-disable-next-line no-nested-ternary\n resultMessage.recipient_id = (message === null || message === void 0 ? void 0 : message.recipient_id)\n ? parseInt(message === null || message === void 0 ? void 0 : message.recipient_id, 10)\n : ((_b = message === null || message === void 0 ? void 0 : message.extension) === null || _b === void 0 ? void 0 : _b.sender_id)\n ? (_c = message === null || message === void 0 ? void 0 : message.extension) === null || _c === void 0 ? void 0 : _c.sender_id\n : 0;\n resultMessage.sender_id = ((_d = message === null || message === void 0 ? void 0 : message.extension) === null || _d === void 0 ? void 0 : _d.sender_id)\n ? (_e = message === null || message === void 0 ? void 0 : message.extension) === null || _e === void 0 ? void 0 : _e.sender_id\n : 0;\n resultMessage.notification_type =\n message.notification_type || message.extension.notification_type;\n resultMessage.date_sent = message.extension.date_sent\n ? parseInt(message.extension.date_sent, 10)\n : 0;\n resultMessage.delivered_ids = [];\n // resultMessage.attachments = message.extension.attachments || [];\n resultMessage.attachments = _Mapper_MessageDTOMapper__WEBPACK_IMPORTED_MODULE_10__.MessageDTOMapper.transformAttachment(message.extension.attachments ? message.extension.attachments : []);\n return resultMessage;\n }\n QB.chat.onMessageListener = function (userId, message) {\n console.log(\"EVENT: receive message for userid: \".concat(userId, \", error: \").concat((0,_utils_parse__WEBPACK_IMPORTED_MODULE_12__.stringifyError)(message)));\n var resultMessage = ToRemoteMessageDTO(message);\n _this.subscriptionOnChatMessages.informSubscribers(resultMessage, _Domain_entity_EventMessageType__WEBPACK_IMPORTED_MODULE_15__[\"default\"].RegularMessage);\n };\n QB.chat.onMessageTypingListener = function (isTyping, userId, dialogId) {\n var _a;\n console.log(\"EVENT: receive typing: \".concat(isTyping ? 'true' : 'false', \", dialog id: \").concat(dialogId, \" userid: \").concat(userId));\n if (_this._authProcessed && ((_a = _this.authInformation) === null || _a === void 0 ? void 0 : _a.userId) === userId)\n return;\n var resultMessage = {\n eventMessageType: _Domain_entity_EventMessageType__WEBPACK_IMPORTED_MODULE_15__[\"default\"].LocalMessage,\n messageInfo: undefined,\n messageStatus: { isTyping: isTyping, userId: userId, dialogId: dialogId },\n notificationTypes: undefined,\n };\n _this.subscriptionOnMessageStatus.informSubscribers(resultMessage, _Domain_entity_EventMessageType__WEBPACK_IMPORTED_MODULE_15__[\"default\"].LocalMessage);\n };\n QB.chat.onSessionExpiredListener = function (error) {\n console.log('call onSessionExpiredListener');\n console.timeLog('onSessionExpiredListener');\n var result = true;\n if (error) {\n console.log('EVENT:onSessionExpiredListener - error: ', (0,_utils_parse__WEBPACK_IMPORTED_MODULE_12__.stringifyError)(error));\n result = false;\n }\n else {\n console.log('EVENT: Hello from SessionExpiredListener. session is expired.');\n result = true;\n }\n _this.subscriptionOnSessionExpiredListener.informSubscribers(result, _Domain_entity_EventMessageType__WEBPACK_IMPORTED_MODULE_15__[\"default\"].LocalMessage);\n };\n QB.chat.onDisconnectedListener = function () {\n console.log('EVENT: disconnect');\n };\n QB.chat.onReconnectListener = function () {\n console.log('EVENT: reconnect');\n };\n QB.chat.onMessageErrorListener = function (messageId, error) {\n console.log(\"EVENT: receive error messageid: \".concat(messageId, \", error: \").concat((0,_utils_parse__WEBPACK_IMPORTED_MODULE_12__.stringifyError)(error)));\n };\n QB.chat.onDeliveredStatusListener = function (messageId, dialogId, userId) {\n console.log(\"EVENT: receive delivered message id: \".concat(messageId, \", dialogid: \").concat(dialogId, \" userid: \").concat(userId));\n };\n QB.chat.onReadStatusListener = function (messageId, dialogId, userId) {\n console.log(\"EVENT: receive read message id: \".concat(messageId, \", dialogid: \").concat(dialogId, \" userid: \").concat(userId));\n };\n //\n };\n // eslint-disable-next-line class-methods-use-this\n RemoteDataSource.prototype.releaseEventsHandlers = function () {\n QB.chat.onSessionExpiredListener = undefined;\n QB.chat.onReconnectListener = undefined;\n QB.chat.onDisconnectedListener = undefined;\n QB.chat.onSystemMessageListener = undefined;\n QB.chat.onMessageListener = undefined;\n QB.chat.onMessageErrorListener = undefined;\n QB.chat.onDeliveredStatusListener = undefined;\n QB.chat.onReadStatusListener = undefined;\n QB.chat.onMessageTypingListener = undefined;\n };\n RemoteDataSource.prototype.loginWithUser = function (authParams) {\n return __awaiter(this, void 0, void 0, function () {\n var userRequiredParams, sessionResult, session, sessionDataTmp, sessionData, authInformation, paramsConnect, connectResult;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (this._needInit)\n return [2 /*return*/];\n if (this._authProcessed)\n return [2 /*return*/];\n //\n console.log('CALL createUserSession....');\n userRequiredParams = {\n login: authParams.userName,\n password: authParams.password,\n };\n return [4 /*yield*/, this.createUserSession(userRequiredParams).catch(function (e) {\n _this._needInit = true;\n _this._authProcessed = false;\n console.log(\"EXCEPTION IN CREATE USER SESSION (\".concat(userRequiredParams.login, \") : \").concat((0,_utils_parse__WEBPACK_IMPORTED_MODULE_12__.stringifyError)(e)));\n })];\n case 1:\n sessionResult = _a.sent();\n if (!sessionResult)\n return [2 /*return*/];\n //\n //\n this.initEventsHandlers();\n //\n //\n console.log('USER DATA : ', userRequiredParams);\n console.log('USER SESSION DATA : ', sessionResult);\n console.log('Session token : ', sessionResult.token);\n session = sessionResult;\n sessionDataTmp = JSON.stringify(session);\n sessionData = JSON.parse(sessionDataTmp);\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n console.log(\"user_id = \".concat(sessionData.user_id));\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n console.log(\"session token to chat init = \".concat(sessionData.token));\n authInformation = {\n userName: authParams.userName,\n userId: sessionData.user_id,\n sessionToken: sessionData.token,\n password: sessionData.token,\n };\n paramsConnect = {\n userId: authInformation.userId,\n password: authInformation.password,\n };\n console.log(paramsConnect);\n return [4 /*yield*/, (0,_qb_api_calls__WEBPACK_IMPORTED_MODULE_8__.QBChatConnect)(paramsConnect)];\n case 2:\n connectResult = _a.sent();\n if (connectResult) {\n //\n this._authInformation = authInformation;\n this.setAuthProcessedSuccessed();\n console.log('CHAT CONNECTED. CAN WORK!');\n console.log('CONNECTION DATA: ', JSON.stringify(authInformation));\n // //\n // this.initEventsHandlers();\n // //\n }\n else {\n console.log('could not connect to chat');\n }\n return [2 /*return*/];\n }\n });\n });\n };\n RemoteDataSource.prototype.getDialogsFirstPage = function () {\n return __awaiter(this, void 0, void 0, function () {\n var params, qbDialogs, prevDialogs, _i, _a, item, _b, _c, item, qbEntity, newDTO;\n return __generator(this, function (_d) {\n switch (_d.label) {\n case 0:\n params = {\n created_at: {\n lt: Date.now() / 1000,\n },\n sort_desc: 'created_at',\n limit: 100,\n };\n console.log('Chat connected. Get dialog.list....');\n return [4 /*yield*/, (0,_qb_api_calls__WEBPACK_IMPORTED_MODULE_8__.QBGetDialogs)(params)];\n case 1:\n qbDialogs = _d.sent();\n if (!qbDialogs) return [3 /*break*/, 12];\n console.log('Ok... have dialog.list: ', JSON.stringify(qbDialogs));\n return [4 /*yield*/, this.getDialogs()];\n case 2:\n prevDialogs = _d.sent();\n _i = 0, _a = prevDialogs.dialogs;\n _d.label = 3;\n case 3:\n if (!(_i < _a.length)) return [3 /*break*/, 6];\n item = _a[_i];\n // eslint-disable-next-line no-await-in-loop\n return [4 /*yield*/, this.deleteDialog(item)];\n case 4:\n // eslint-disable-next-line no-await-in-loop\n _d.sent();\n _d.label = 5;\n case 5:\n _i++;\n return [3 /*break*/, 3];\n case 6:\n _b = 0, _c = qbDialogs.items;\n _d.label = 7;\n case 7:\n if (!(_b < _c.length)) return [3 /*break*/, 11];\n item = _c[_b];\n qbEntity = item;\n return [4 /*yield*/, this.dialogDTOMapper.toTDO(qbEntity)];\n case 8:\n newDTO = _d.sent();\n // eslint-disable-next-line no-await-in-loop\n return [4 /*yield*/, this.createDialog(newDTO)];\n case 9:\n // eslint-disable-next-line no-await-in-loop\n _d.sent();\n _d.label = 10;\n case 10:\n _b++;\n return [3 /*break*/, 7];\n case 11:\n console.log('DATA COMPLETED');\n _d.label = 12;\n case 12: return [2 /*return*/];\n }\n });\n });\n };\n RemoteDataSource.prototype.getDialogs = function (pagination) {\n return __awaiter(this, void 0, void 0, function () {\n var currentPagination, pageNumber, perPage, params, dialogsDTO, qbDialogs, _i, _a, item, qbEntity, newDTO;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n currentPagination = pagination || new _Domain_repository_Pagination__WEBPACK_IMPORTED_MODULE_5__.Pagination();\n console.log('call getDialogs in RemoteDataSourceMock param pagination: ', JSON.stringify(pagination));\n console.log('call getDialogs in RemoteDataSourceMock with result pagination: ', JSON.stringify(currentPagination));\n pageNumber = currentPagination.getCurrentPage() || 1;\n console.log('pageNumber: ', pageNumber);\n perPage = currentPagination.perPage || 100;\n console.log('perPage: ', perPage);\n params = {\n created_at: {\n lt: Date.now() / 1000,\n },\n sort_desc: 'created_at',\n page: pageNumber,\n // per_page: perPage,\n limit: perPage,\n type: {\n in: [2, 3],\n },\n };\n // filter['type[in]'] = [3, 2].join(',');\n console.log('call getDialogs in RemoteDataSourceMock with params: ', JSON.stringify(params));\n dialogsDTO = [];\n return [4 /*yield*/, (0,_qb_api_calls__WEBPACK_IMPORTED_MODULE_8__.QBGetDialogs)(params)];\n case 1:\n qbDialogs = _b.sent();\n if (!qbDialogs) return [3 /*break*/, 5];\n console.log(\"request completed. have: total_entries \".concat(qbDialogs.total_entries, \", limit: \").concat(qbDialogs.limit, \", skip: \").concat(qbDialogs.skip, \" items: \").concat(JSON.stringify(qbDialogs.items)));\n currentPagination = new _Domain_repository_Pagination__WEBPACK_IMPORTED_MODULE_5__.Pagination(0, perPage);\n currentPagination.totalPages = qbDialogs.total_entries / perPage;\n currentPagination.setCurrentPage(pageNumber);\n _i = 0, _a = qbDialogs.items;\n _b.label = 2;\n case 2:\n if (!(_i < _a.length)) return [3 /*break*/, 5];\n item = _a[_i];\n qbEntity = item;\n return [4 /*yield*/, this.dialogDTOMapper.toTDO(qbEntity)];\n case 3:\n newDTO = _b.sent();\n dialogsDTO.push(newDTO);\n _b.label = 4;\n case 4:\n _i++;\n return [3 /*break*/, 2];\n case 5: \n /*\n await Promise.all(\n fromRemote.ResultData.map(async (entity) => {\n // eslint-disable-next-line no-return-await\n return await this.dialogRepository.saveDialogToLocal(entity);\n }),\n );\n */\n return [2 /*return*/, Promise.resolve(new _dto_dialog_RemoteDialogsDTO__WEBPACK_IMPORTED_MODULE_1__.RemoteDialogsDTO(dialogsDTO, currentPagination))];\n }\n });\n });\n };\n // eslint-disable-next-line class-methods-use-this\n RemoteDataSource.prototype.createDialog = function (dto) {\n return __awaiter(this, void 0, void 0, function () {\n var qbEntity, qbDialog, participantId, participants, data, newDTO;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n console.log('call createDialog in remote with params: ', JSON.stringify(dto));\n return [4 /*yield*/, this.dialogDTOMapper.fromDTO(dto)];\n case 1:\n qbEntity = _a.sent();\n if (!(qbEntity.type === _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_13__.DialogType[\"private\"])) return [3 /*break*/, 3];\n participantId = qbEntity.occupants_ids[0];\n return [4 /*yield*/, (0,_qb_api_calls__WEBPACK_IMPORTED_MODULE_8__.QBCreatePrivateDialog)(participantId, qbEntity.name)];\n case 2:\n qbDialog = _a.sent();\n return [3 /*break*/, 5];\n case 3:\n if (!(qbEntity.type === _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_13__.DialogType.group)) return [3 /*break*/, 5];\n participants = qbEntity.occupants_ids;\n data = { photo: qbEntity.photo };\n return [4 /*yield*/, (0,_qb_api_calls__WEBPACK_IMPORTED_MODULE_8__.QBCreateGroupDialog)(participants, qbEntity.name, data)];\n case 4:\n qbDialog = _a.sent();\n _a.label = 5;\n case 5:\n if (qbDialog === null || qbDialog === undefined) {\n return [2 /*return*/, Promise.reject(new _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.RemoteDataSourceException(_exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_MESSAGE, _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_CODE))];\n }\n return [4 /*yield*/, this.dialogDTOMapper.toTDO(qbDialog)];\n case 6:\n newDTO = _a.sent();\n console.log('have result in createDialog in remote ds: ', JSON.stringify(newDTO));\n return [2 /*return*/, Promise.resolve(newDTO)];\n }\n });\n });\n };\n RemoteDataSource.prototype.updateDialog = function (dto) {\n var _a;\n return __awaiter(this, void 0, void 0, function () {\n var qbEntity, data, qbDialogs, newDTO;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0: return [4 /*yield*/, this.dialogDTOMapper.fromDTO(dto)];\n case 1:\n qbEntity = _b.sent();\n data = {};\n if (qbEntity.name && qbEntity.name.length > 0) {\n data = __assign({ name: qbEntity.name }, data);\n }\n if (qbEntity.photo) {\n data = __assign(__assign({}, data), { photo: qbEntity.photo });\n }\n if (((_a = qbEntity.new_occupants_ids) === null || _a === void 0 ? void 0 : _a.length) > 0) {\n data = __assign(__assign({}, data), { push_all: { occupants_ids: qbEntity.new_occupants_ids } });\n }\n return [4 /*yield*/, (0,_qb_api_calls__WEBPACK_IMPORTED_MODULE_8__.QBUpdateDialog)(qbEntity._id, data)];\n case 2:\n qbDialogs = _b.sent();\n if (qbDialogs === null || qbDialogs === undefined) {\n return [2 /*return*/, Promise.reject(new _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.RemoteDataSourceException(_exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_MESSAGE, _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_CODE))];\n }\n return [4 /*yield*/, this.dialogDTOMapper.toTDO(qbDialogs)];\n case 3:\n newDTO = _b.sent();\n return [2 /*return*/, Promise.resolve(newDTO)];\n }\n });\n });\n };\n // eslint-disable-next-line class-methods-use-this\n RemoteDataSource.prototype.getDialog = function (dto) {\n return __awaiter(this, void 0, void 0, function () {\n var qbEntity, qbDialog, qbEntityFromDB, resultDTO;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.dialogDTOMapper.fromDTO(dto)];\n case 1:\n qbEntity = _a.sent();\n return [4 /*yield*/, (0,_qb_api_calls__WEBPACK_IMPORTED_MODULE_8__.QBGetDialogById)(qbEntity._id)];\n case 2:\n qbDialog = _a.sent();\n if (qbDialog === null || qbDialog === undefined) {\n return [2 /*return*/, Promise.reject(new _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.RemoteDataSourceException(_exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_MESSAGE, _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_CODE))];\n }\n qbEntityFromDB = qbDialog.items[0];\n return [4 /*yield*/, this.dialogDTOMapper.toTDO(qbEntityFromDB)];\n case 3:\n resultDTO = _a.sent();\n return [2 /*return*/, Promise.resolve(resultDTO)];\n }\n });\n });\n };\n // eslint-disable-next-line class-methods-use-this\n RemoteDataSource.prototype.deleteDialog = function (dto) {\n return __awaiter(this, void 0, void 0, function () {\n var qbEntity;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.dialogDTOMapper.fromDTO(dto)];\n case 1:\n qbEntity = _a.sent();\n return [4 /*yield*/, (0,_qb_api_calls__WEBPACK_IMPORTED_MODULE_8__.QBDeleteDialog)([qbEntity._id]).catch(function () {\n throw new _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.RemoteDataSourceException(_exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_MESSAGE, _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_CODE);\n })];\n case 2:\n _a.sent();\n return [2 /*return*/, Promise.resolve()];\n }\n });\n });\n };\n RemoteDataSource.prototype.deleteUsersFromDialog = function (dialogDTO, usersDTO) {\n return __awaiter(this, void 0, void 0, function () {\n var qbEntity, usersIds, data, qbDialogs;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.dialogDTOMapper.fromDTO(dialogDTO)];\n case 1:\n qbEntity = _a.sent();\n usersIds = [];\n usersDTO.forEach(function (item) {\n usersIds.push(item.id);\n });\n data = {};\n if (usersIds.length > 0) {\n data = {\n pull_all: { occupants_ids: usersIds },\n };\n }\n return [4 /*yield*/, (0,_qb_api_calls__WEBPACK_IMPORTED_MODULE_8__.QBUpdateDialog)(qbEntity._id, data)];\n case 2:\n qbDialogs = _a.sent();\n if (qbDialogs === null || qbDialogs === undefined) {\n return [2 /*return*/, Promise.reject(new _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.RemoteDataSourceException(_exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_MESSAGE, _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_CODE))];\n }\n return [2 /*return*/, Promise.resolve()];\n }\n });\n });\n };\n // eslint-disable-next-line @typescript-eslint/require-await,class-methods-use-this,@typescript-eslint/no-unused-vars\n RemoteDataSource.prototype.getUser = function (dto) {\n return __awaiter(this, void 0, void 0, function () {\n var currentItem, dtoUser, e_1;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, (0,_qb_api_calls__WEBPACK_IMPORTED_MODULE_8__.QBUsersGetById)(parseInt(dto.id, 10))];\n case 1:\n currentItem = _a.sent();\n if (currentItem === null || currentItem === undefined) {\n return [2 /*return*/, Promise.reject(new _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.RemoteDataSourceException(_exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_MESSAGE, _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_CODE))];\n }\n _a.label = 2;\n case 2:\n _a.trys.push([2, 4, , 5]);\n return [4 /*yield*/, this.userDTOMapper.toTDO(currentItem)];\n case 3:\n dtoUser = _a.sent();\n return [3 /*break*/, 5];\n case 4:\n e_1 = _a.sent();\n console.log('problem with:');\n console.log(JSON.stringify(currentItem));\n console.log(e_1.message);\n console.log(e_1._description);\n return [3 /*break*/, 5];\n case 5:\n if (dtoUser !== null || dtoUser !== undefined) {\n return [2 /*return*/, Promise.resolve(dtoUser)];\n }\n return [2 /*return*/, Promise.reject(new _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.RemoteDataSourceException(_exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.NOT_FOUND_REMOTE_DATASOURCE_EXCEPTION_MESSAGE, _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.NOT_FOUND_REMOTE_DATASOURCE_EXCEPTION_CODE, \"not found user with id: \".concat(dto.id, \" (\").concat(dto.full_name, \")\")))];\n }\n });\n });\n };\n // eslint-disable-next-line @typescript-eslint/require-await,class-methods-use-this,@typescript-eslint/no-unused-vars\n RemoteDataSource.prototype.getUsers = function (remoteUsersDTO) {\n return __awaiter(this, void 0, void 0, function () {\n var usersDTO, _i, _a, item, userDTO;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n usersDTO = new Array();\n _i = 0, _a = remoteUsersDTO.users;\n _b.label = 1;\n case 1:\n if (!(_i < _a.length)) return [3 /*break*/, 4];\n item = _a[_i];\n return [4 /*yield*/, this.getUser(item)];\n case 2:\n userDTO = _b.sent();\n usersDTO.push(userDTO);\n _b.label = 3;\n case 3:\n _i++;\n return [3 /*break*/, 1];\n case 4: return [2 /*return*/, Promise.resolve(new _dto_user_RemoteUsersDTO__WEBPACK_IMPORTED_MODULE_3__.RemoteUsersDTO(usersDTO, new _Domain_repository_Pagination__WEBPACK_IMPORTED_MODULE_5__.Pagination()))];\n }\n });\n });\n };\n //\n // eslint-disable-next-line class-methods-use-this\n RemoteDataSource.prototype.getAllUsers = function (pagination, \n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n filter) {\n return __awaiter(this, void 0, void 0, function () {\n var users, pageTemplate, pageNumber, resultPagination, params, response, currentItem, _i, _a, item, dtoUser, e_2;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n console.log('call getAllUsers');\n console.log('pagination: ', JSON.stringify(pagination));\n users = [];\n pageTemplate = {\n pageSize: pagination.perPage,\n startPageNumber: pagination.getCurrentPage(),\n };\n pageNumber = pageTemplate.startPageNumber;\n resultPagination = new _Domain_repository_Pagination__WEBPACK_IMPORTED_MODULE_5__.Pagination(pageNumber, pageTemplate.startPageNumber);\n params = {\n per_page: pageTemplate.pageSize,\n page: pageNumber,\n };\n if (filter && filter.length > 2) {\n params = {\n full_name: filter,\n per_page: pageTemplate.pageSize,\n page: pageNumber > 0 ? pageNumber : 1,\n };\n }\n console.log('params: ', JSON.stringify(params));\n return [4 /*yield*/, (0,_qb_api_calls__WEBPACK_IMPORTED_MODULE_8__.QBUsersGet)(params).catch(function (err) {\n console.log('catch call QBUsersGet : ', (0,_utils_parse__WEBPACK_IMPORTED_MODULE_12__.stringifyError)(err));\n })];\n case 1:\n response = _b.sent();\n if (response === undefined || response === null) {\n throw new _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.RemoteDataSourceException(_exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.NOT_FOUND_REMOTE_DATASOURCE_EXCEPTION_MESSAGE, _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.NOT_FOUND_REMOTE_DATASOURCE_EXCEPTION_CODE, \"params: \".concat(JSON.stringify(params)));\n }\n console.log('response: total_entries: ', response.total_entries);\n console.log('response: per_page: ', response.per_page);\n console.log('response: current_page: ', response.current_page);\n resultPagination.totalPages =\n response.total_entries / pageTemplate.pageSize;\n resultPagination.setCurrentPage(response.current_page);\n console.log(\"response result: count of items \".concat(response.items.length, \" items: \").concat(JSON.stringify(response.items)));\n _b.label = 2;\n case 2:\n _b.trys.push([2, 7, , 8]);\n _i = 0, _a = response.items;\n _b.label = 3;\n case 3:\n if (!(_i < _a.length)) return [3 /*break*/, 6];\n item = _a[_i];\n currentItem = item.user;\n return [4 /*yield*/, this.userDTOMapper.toTDO(currentItem)];\n case 4:\n dtoUser = _b.sent();\n users.push(dtoUser);\n _b.label = 5;\n case 5:\n _i++;\n return [3 /*break*/, 3];\n case 6: return [3 /*break*/, 8];\n case 7:\n e_2 = _b.sent();\n console.log('problem with:');\n console.log(JSON.stringify(currentItem));\n console.log(e_2.message);\n console.log(e_2._description);\n return [3 /*break*/, 8];\n case 8: return [2 /*return*/, { ResultData: users, PaginationResult: resultPagination }];\n }\n });\n });\n };\n //\n //\n // eslint-disable-next-line @typescript-eslint/require-await,class-methods-use-this,@typescript-eslint/no-unused-vars,@typescript-eslint/ban-ts-comment\n // @ts-ignore\n // eslint-disable-next-line @typescript-eslint/require-await,class-methods-use-this\n RemoteDataSource.prototype.getMessages = function (dialogId, \n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n pagination) {\n var _a;\n return __awaiter(this, void 0, void 0, function () {\n var messagesDTO, qbMessages, currentUserId;\n var _this = this;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n messagesDTO = new Array();\n //\n return [4 /*yield*/, (0,_qb_api_calls__WEBPACK_IMPORTED_MODULE_8__.QBJoinDialog)(dialogId).catch(function () {\n throw new _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.RemoteDataSourceException(_exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_MESSAGE, _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_CODE);\n })];\n case 1:\n //\n _b.sent();\n return [4 /*yield*/, (0,_qb_api_calls__WEBPACK_IMPORTED_MODULE_8__.QBChatGetMessages)(dialogId)];\n case 2:\n qbMessages = _b.sent();\n if (qbMessages === null || qbMessages === undefined) {\n return [2 /*return*/, Promise.reject(new _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.RemoteDataSourceException(_exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_MESSAGE, _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_CODE))];\n }\n console.log(\"GET MESSAGES \".concat(qbMessages.items.length, \" FROM SERVER: \").concat(JSON.stringify(qbMessages), \" \"));\n currentUserId = (_a = this._authInformation) === null || _a === void 0 ? void 0 : _a.userId;\n return [4 /*yield*/, Promise.all(qbMessages.items.map(function (currentItem) { return __awaiter(_this, void 0, void 0, function () {\n var dtoMessage;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.messageDTOMapper.toTDO(currentItem)];\n case 1:\n dtoMessage = _a.sent();\n if (this._authProcessed &&\n currentUserId &&\n dtoMessage.read_ids &&\n dtoMessage.read_ids.length > 0 &&\n dtoMessage.read_ids.includes(currentUserId) === false) {\n (0,_qb_api_calls__WEBPACK_IMPORTED_MODULE_8__.QBChatMarkMessageRead)({\n messageId: dtoMessage.id,\n dialogId: dtoMessage.dialogId,\n userId: currentUserId,\n });\n }\n messagesDTO.push(dtoMessage);\n return [2 /*return*/, dtoMessage];\n }\n });\n }); }))];\n case 3:\n _b.sent();\n return [2 /*return*/, Promise.resolve(new _dto_message_RemoteMessagesDTO__WEBPACK_IMPORTED_MODULE_4__.RemoteMessagesDTO(messagesDTO, new _Domain_repository_Pagination__WEBPACK_IMPORTED_MODULE_5__.Pagination()))];\n }\n });\n });\n };\n // eslint-disable-next-line class-methods-use-this\n RemoteDataSource.prototype.typingMessageStart = function (dialogDTO, senderId) {\n return __awaiter(this, void 0, void 0, function () {\n var qbEntity;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.dialogDTOMapper.fromDTO(dialogDTO)];\n case 1:\n qbEntity = _a.sent();\n return [4 /*yield*/, (0,_qb_api_calls__WEBPACK_IMPORTED_MODULE_8__.QBJoinDialog)(dialogDTO.id).catch(function () {\n throw new _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.RemoteDataSourceException(_exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_MESSAGE, _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_CODE);\n })];\n case 2:\n _a.sent();\n (0,_qb_api_calls__WEBPACK_IMPORTED_MODULE_8__.QBSendIsTypingStatus)(qbEntity, senderId);\n return [2 /*return*/, Promise.resolve()];\n }\n });\n });\n };\n // eslint-disable-next-line class-methods-use-this\n RemoteDataSource.prototype.typingMessageStop = function (dialogDTO, senderId) {\n return __awaiter(this, void 0, void 0, function () {\n var qbEntity;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.dialogDTOMapper.fromDTO(dialogDTO)];\n case 1:\n qbEntity = _a.sent();\n (0,_qb_api_calls__WEBPACK_IMPORTED_MODULE_8__.QBSendIsStopTypingStatus)(qbEntity, senderId);\n return [2 /*return*/, Promise.resolve()];\n }\n });\n });\n };\n // eslint-disable-next-line @typescript-eslint/require-await,class-methods-use-this,@typescript-eslint/no-unused-vars\n RemoteDataSource.prototype.sendMessage = function (dto) {\n var _a, _b, _c, _d;\n return __awaiter(this, void 0, void 0, function () {\n var messageText, qbEntity, dialogJid, qbMessages;\n return __generator(this, function (_e) {\n switch (_e.label) {\n case 0:\n console.log('call sendMessage');\n messageText = '';\n switch (dto.notification_type) {\n case _Domain_entity_NotificationTypes__WEBPACK_IMPORTED_MODULE_14__.NotificationTypes.DELETE_LEAVE_DIALOG: {\n messageText = \"\".concat(((_a = this.authInformation) === null || _a === void 0 ? void 0 : _a.userName) || 'owner', \" has left the chat.\");\n break;\n }\n case _Domain_entity_NotificationTypes__WEBPACK_IMPORTED_MODULE_14__.NotificationTypes.NEW_DIALOG: {\n messageText = \"\".concat(((_b = this.authInformation) === null || _b === void 0 ? void 0 : _b.userName) || 'owner', \" create the chat\");\n break;\n }\n case _Domain_entity_NotificationTypes__WEBPACK_IMPORTED_MODULE_14__.NotificationTypes.UPDATE_DIALOG: {\n messageText = \"\".concat(((_c = this.authInformation) === null || _c === void 0 ? void 0 : _c.userName) || 'owner', \" update the chat\");\n break;\n }\n default: {\n messageText = dto.message;\n break;\n }\n }\n qbEntity = {\n type: dto.dialog_type === _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_13__.DialogType[\"private\"] ? 'chat' : 'groupchat',\n body: messageText,\n notification_type: dto.notification_type,\n dialog_id: dto.dialogId,\n extension: {\n save_to_history: 1,\n dialog_id: dto.dialogId,\n notification_type: dto.notification_type,\n sender_id: dto.sender_id || dto.recipient_id,\n },\n markable: 1,\n };\n if (((_d = dto.attachments) === null || _d === void 0 ? void 0 : _d.length) > 0) {\n qbEntity.extension.attachments = [];\n dto.attachments.forEach(function (att) {\n var _a;\n var chatMessageAttachment = {\n id: att.id,\n name: att.name,\n size: att.size,\n type: att.type.toString(),\n uid: att.uid,\n };\n (_a = qbEntity.extension.attachments) === null || _a === void 0 ? void 0 : _a.push(chatMessageAttachment);\n });\n }\n return [4 /*yield*/, (0,_qb_api_calls__WEBPACK_IMPORTED_MODULE_8__.QBJoinDialog)(dto.dialogId).catch(function () {\n throw new _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.RemoteDataSourceException(_exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_MESSAGE, _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_CODE);\n })];\n case 1:\n _e.sent();\n dialogJid = QB.chat.helpers.getRoomJidFromDialogId(dto.dialogId);\n return [4 /*yield*/, (0,_qb_api_calls__WEBPACK_IMPORTED_MODULE_8__.QBChatSendMessage)(dialogJid, qbEntity)];\n case 2:\n qbMessages = _e.sent();\n if (qbMessages === null || qbMessages === undefined) {\n return [2 /*return*/, Promise.reject(new _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.RemoteDataSourceException(_exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_MESSAGE, _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_CODE))];\n }\n console.log('regular message was sent');\n return [2 /*return*/, Promise.resolve(dto)];\n }\n });\n });\n };\n // eslint-disable-next-line class-methods-use-this\n RemoteDataSource.prototype.sendSystemMessage = function (dto) {\n var _a;\n return __awaiter(this, void 0, void 0, function () {\n var qbMessages, systemMessage;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n if (!(dto.notification_type && dto.notification_type.length > 0)) return [3 /*break*/, 2];\n systemMessage = {\n body: null,\n id: '',\n userId: ((_a = this.authInformation) === null || _a === void 0 ? void 0 : _a.userId) || 0,\n extension: {\n notification_type: dto.notification_type,\n dialog_id: dto.dialogId,\n },\n };\n return [4 /*yield*/, (0,_qb_api_calls__WEBPACK_IMPORTED_MODULE_8__.QBChatSendSystemMessage)(dto.recipient_id, systemMessage)];\n case 1:\n qbMessages = _b.sent();\n _b.label = 2;\n case 2:\n if (qbMessages === null || qbMessages === undefined) {\n return [2 /*return*/, Promise.reject(new _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.RemoteDataSourceException(_exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_MESSAGE, _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_CODE))];\n }\n console.log('system message was sent');\n return [2 /*return*/, Promise.resolve(true)];\n }\n });\n });\n };\n // eslint-disable-next-line @typescript-eslint/require-await,class-methods-use-this,@typescript-eslint/no-unused-vars\n RemoteDataSource.prototype.updateMessage = function (\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n dto) {\n return __awaiter(this, void 0, void 0, function () {\n var qbEntity, storageValue, result, qbMessages, newDTO;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.messageDTOMapper.fromDTO(dto)];\n case 1:\n qbEntity = _a.sent();\n storageValue = localStorage.getItem('qbMessages');\n result = storageValue !== null && storageValue !== void 0 ? storageValue : '';\n qbMessages = result === '' ? {} : JSON.parse(result);\n if (qbMessages === null || qbMessages === undefined) {\n return [2 /*return*/, Promise.reject(new _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.RemoteDataSourceException(_exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_MESSAGE, _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_CODE))];\n }\n qbMessages[qbEntity._id] = qbEntity;\n // TODO: How get updated QBChatDialog and return to DTO\n localStorage.setItem('qbMessages', JSON.stringify(qbMessages));\n return [4 /*yield*/, this.messageDTOMapper.toTDO(qbEntity)];\n case 2:\n newDTO = _a.sent();\n return [2 /*return*/, Promise.resolve(newDTO)];\n }\n });\n });\n };\n // eslint-disable-next-line @typescript-eslint/require-await,class-methods-use-this,@typescript-eslint/no-unused-vars\n RemoteDataSource.prototype.deleteMessage = function (dto) {\n return __awaiter(this, void 0, void 0, function () {\n var qbEntity, storageValue, result, qbMessages, filteredqbMessages;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.messageDTOMapper.fromDTO(dto)];\n case 1:\n qbEntity = _a.sent();\n storageValue = localStorage.getItem('qbMessages');\n result = storageValue !== null && storageValue !== void 0 ? storageValue : '';\n qbMessages = result === '' ? {} : JSON.parse(result);\n if (qbMessages === null || qbMessages === undefined) {\n return [2 /*return*/, Promise.reject(new _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.RemoteDataSourceException(_exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_MESSAGE, _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_CODE))];\n }\n filteredqbMessages = {};\n Object.keys(qbMessages).forEach(function (key) {\n if (key !== qbEntity._id) {\n filteredqbMessages[key] = qbMessages[key];\n }\n });\n localStorage.setItem('qbMessages', JSON.stringify(filteredqbMessages));\n return [2 /*return*/, Promise.resolve()];\n }\n });\n });\n };\n // eslint-disable-next-line @typescript-eslint/require-await,class-methods-use-this,@typescript-eslint/no-unused-vars\n RemoteDataSource.prototype.createFile = function (dto) {\n return __awaiter(this, void 0, void 0, function () {\n var qbParam, result, qbContentObject, newDto;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n console.log('call createFile in remote with params: ', JSON.stringify(dto));\n return [4 /*yield*/, this.fileDTOMapper.fromDTO(dto)];\n case 1:\n qbParam = _a.sent();\n return [4 /*yield*/, (0,_qb_api_calls__WEBPACK_IMPORTED_MODULE_8__.QBCreateAndUploadContent)(qbParam).catch(function (err) {\n console.log('Error: ', (0,_utils_parse__WEBPACK_IMPORTED_MODULE_12__.stringifyError)(err));\n throw new _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.RemoteDataSourceException(_exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_MESSAGE, _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_CODE, \"exception: \".concat((0,_utils_parse__WEBPACK_IMPORTED_MODULE_12__.stringifyError)(err)));\n })];\n case 2:\n result = _a.sent();\n if (result === null || result === undefined) {\n return [2 /*return*/, Promise.reject(new _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.RemoteDataSourceException(_exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_MESSAGE, _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_CODE))];\n }\n qbContentObject = result;\n return [4 /*yield*/, this.fileDTOMapper.toTDO(qbContentObject)];\n case 3:\n newDto = _a.sent();\n console.log('have result in createFile in remote ds: ', JSON.stringify(newDto));\n return [2 /*return*/, Promise.resolve(newDto)];\n }\n });\n });\n };\n // eslint-disable-next-line @typescript-eslint/require-await,class-methods-use-this,@typescript-eslint/no-unused-vars\n RemoteDataSource.prototype.getFile = function (dto) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n throw new Error('Method not implemented.');\n });\n });\n };\n // eslint-disable-next-line @typescript-eslint/require-await,class-methods-use-this,@typescript-eslint/no-unused-vars\n RemoteDataSource.prototype.deleteFile = function (dto) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n throw new Error('Method not implemented.');\n });\n });\n };\n // eslint-disable-next-line @typescript-eslint/require-await,class-methods-use-this,@typescript-eslint/no-unused-vars\n RemoteDataSource.prototype.subscribeToChatConnectionEvents = function (\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n fileId) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n throw new Error('Method not implemented.');\n });\n });\n };\n return RemoteDataSource;\n}());\n\n\n\n//# sourceURL=webpack://quickblox-react-ui-kit/./src/Data/source/remote/RemoteDataSource.ts?");
1304
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"RemoteDataSource\": function() { return /* binding */ RemoteDataSource; }\n/* harmony export */ });\n/* harmony import */ var _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../exception/RemoteDataSourceException */ \"./src/Data/source/exception/RemoteDataSourceException.ts\");\n/* harmony import */ var _dto_dialog_RemoteDialogsDTO__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../dto/dialog/RemoteDialogsDTO */ \"./src/Data/dto/dialog/RemoteDialogsDTO.ts\");\n/* harmony import */ var _dto_message_RemoteMessageDTO__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../dto/message/RemoteMessageDTO */ \"./src/Data/dto/message/RemoteMessageDTO.ts\");\n/* harmony import */ var _dto_user_RemoteUsersDTO__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../dto/user/RemoteUsersDTO */ \"./src/Data/dto/user/RemoteUsersDTO.ts\");\n/* harmony import */ var _dto_message_RemoteMessagesDTO__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../dto/message/RemoteMessagesDTO */ \"./src/Data/dto/message/RemoteMessagesDTO.ts\");\n/* harmony import */ var _Domain_repository_Pagination__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../Domain/repository/Pagination */ \"./src/Domain/repository/Pagination.ts\");\n/* harmony import */ var _Mapper_DialogDTOMapper__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Mapper/DialogDTOMapper */ \"./src/Data/source/remote/Mapper/DialogDTOMapper.ts\");\n/* harmony import */ var _Stubs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../Stubs */ \"./src/Data/Stubs.ts\");\n/* harmony import */ var _qb_api_calls__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../qb-api-calls */ \"./src/qb-api-calls/index.ts\");\n/* harmony import */ var _Mapper_UserDTOMapper__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./Mapper/UserDTOMapper */ \"./src/Data/source/remote/Mapper/UserDTOMapper.ts\");\n/* harmony import */ var _Mapper_MessageDTOMapper__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./Mapper/MessageDTOMapper */ \"./src/Data/source/remote/Mapper/MessageDTOMapper.ts\");\n/* harmony import */ var _mapper_DialogRemoteDTOMapper__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../mapper/DialogRemoteDTOMapper */ \"./src/Data/mapper/DialogRemoteDTOMapper.ts\");\n/* harmony import */ var _utils_parse__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../utils/parse */ \"./src/utils/parse.ts\");\n/* harmony import */ var _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../Domain/entity/DialogTypes */ \"./src/Domain/entity/DialogTypes.ts\");\n/* harmony import */ var _Domain_entity_NotificationTypes__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../Domain/entity/NotificationTypes */ \"./src/Domain/entity/NotificationTypes.ts\");\n/* harmony import */ var _Domain_entity_EventMessageType__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../../Domain/entity/EventMessageType */ \"./src/Domain/entity/EventMessageType.ts\");\n/* harmony import */ var _Domain_use_cases_base_Subscribable_SubscriptionPerformer__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../../Domain/use_cases/base/Subscribable/SubscriptionPerformer */ \"./src/Domain/use_cases/base/Subscribable/SubscriptionPerformer.ts\");\n/* harmony import */ var _Mapper_FileDTOMapper__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./Mapper/FileDTOMapper */ \"./src/Data/source/remote/Mapper/FileDTOMapper.ts\");\n/* harmony import */ var _QBconfig__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../../QBconfig */ \"./src/QBconfig.ts\");\nvar __assign = (undefined && undefined.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (undefined && undefined.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvar RemoteDataSource = /** @class */ (function () {\n //\n function RemoteDataSource() {\n this.subscriptionOnSystemMessages = {};\n this.subscriptionOnChatMessages = new _Domain_use_cases_base_Subscribable_SubscriptionPerformer__WEBPACK_IMPORTED_MODULE_16__.SubscriptionPerformer();\n this.subscriptionOnMessageStatus = new _Domain_use_cases_base_Subscribable_SubscriptionPerformer__WEBPACK_IMPORTED_MODULE_16__.SubscriptionPerformer();\n this.subscriptionOnSessionExpiredListener = new _Domain_use_cases_base_Subscribable_SubscriptionPerformer__WEBPACK_IMPORTED_MODULE_16__.SubscriptionPerformer();\n console.log('CONSTRUCTOR RemoteDataSourceMock');\n this.userDTOMapper = new _Mapper_UserDTOMapper__WEBPACK_IMPORTED_MODULE_9__.UserDTOMapper();\n this.messageDTOMapper = new _Mapper_MessageDTOMapper__WEBPACK_IMPORTED_MODULE_10__.MessageDTOMapper();\n this.fileDTOMapper = new _Mapper_FileDTOMapper__WEBPACK_IMPORTED_MODULE_17__.FileDTOMapper();\n this._needInit = true;\n this._authProcessed = false;\n this.subscriptionOnSystemMessages[_Domain_entity_NotificationTypes__WEBPACK_IMPORTED_MODULE_14__.NotificationTypes.UPDATE_DIALOG] =\n new _Domain_use_cases_base_Subscribable_SubscriptionPerformer__WEBPACK_IMPORTED_MODULE_16__.SubscriptionPerformer();\n this.subscriptionOnSystemMessages[_Domain_entity_NotificationTypes__WEBPACK_IMPORTED_MODULE_14__.NotificationTypes.DELETE_LEAVE_DIALOG] =\n new _Domain_use_cases_base_Subscribable_SubscriptionPerformer__WEBPACK_IMPORTED_MODULE_16__.SubscriptionPerformer();\n this.subscriptionOnSystemMessages[_Domain_entity_NotificationTypes__WEBPACK_IMPORTED_MODULE_14__.NotificationTypes.NEW_DIALOG] =\n new _Domain_use_cases_base_Subscribable_SubscriptionPerformer__WEBPACK_IMPORTED_MODULE_16__.SubscriptionPerformer();\n }\n Object.defineProperty(RemoteDataSource.prototype, \"needInit\", {\n get: function () {\n return this._needInit;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(RemoteDataSource.prototype, \"authProcessed\", {\n get: function () {\n return this._authProcessed;\n },\n enumerable: false,\n configurable: true\n });\n RemoteDataSource.prototype.setAuthProcessedSuccessed = function () {\n this._authProcessed = true;\n this.setInitSDKSuccessed();\n };\n RemoteDataSource.prototype.setInitSDKSuccessed = function () {\n this._needInit = false;\n };\n Object.defineProperty(RemoteDataSource.prototype, \"authInformation\", {\n get: function () {\n return this._authInformation;\n },\n enumerable: false,\n configurable: true\n });\n //\n RemoteDataSource.prototype.getCurrentDialogDTOMapper = function () {\n var _a;\n var currentUserId = ((_a = this._authInformation) === null || _a === void 0 ? void 0 : _a.userId) || -1;\n var dialogDTOMapper = new _Mapper_DialogDTOMapper__WEBPACK_IMPORTED_MODULE_6__.DialogDTOMapper(currentUserId);\n return dialogDTOMapper;\n };\n RemoteDataSource.prototype.setUpMockStorage = function () {\n return __awaiter(this, void 0, void 0, function () {\n var dialogsDTOtoEntityMapper, dialogsEntities, _loop_1, this_1, _i, dialogsEntities_1, item;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n dialogsDTOtoEntityMapper = new _mapper_DialogRemoteDTOMapper__WEBPACK_IMPORTED_MODULE_11__.DialogRemoteDTOMapper();\n dialogsEntities = _Stubs__WEBPACK_IMPORTED_MODULE_7__.Stubs.createDialogsForTest();\n _loop_1 = function (item) {\n var dialogDTO;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0: \n // eslint-disable-next-line no-await-in-loop\n return [4 /*yield*/, dialogsDTOtoEntityMapper.fromEntity(item)];\n case 1:\n dialogDTO = \n // eslint-disable-next-line no-await-in-loop\n _b.sent();\n // eslint-disable-next-line @typescript-eslint/no-unused-vars,promise/catch-or-return,promise/always-return\n this_1.createDialog(dialogDTO)\n // eslint-disable-next-line @typescript-eslint/no-unused-vars,promise/always-return\n .then(function (_) {\n console.log(\"added mock item \".concat(JSON.stringify(dialogDTO)));\n })\n .catch(function (e) {\n console.log('EXCEPTION:', e.message);\n });\n return [2 /*return*/];\n }\n });\n };\n this_1 = this;\n _i = 0, dialogsEntities_1 = dialogsEntities;\n _a.label = 1;\n case 1:\n if (!(_i < dialogsEntities_1.length)) return [3 /*break*/, 4];\n item = dialogsEntities_1[_i];\n return [5 /*yield**/, _loop_1(item)];\n case 2:\n _a.sent();\n _a.label = 3;\n case 3:\n _i++;\n return [3 /*break*/, 1];\n case 4: return [2 /*return*/];\n }\n });\n });\n };\n // eslint-disable-next-line class-methods-use-this\n RemoteDataSource.prototype.createUserSession = function (loginData) {\n return __awaiter(this, void 0, void 0, function () {\n var session;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, (0,_qb_api_calls__WEBPACK_IMPORTED_MODULE_8__.QBCreateSession)(loginData)];\n case 1:\n session = _a.sent();\n return [2 /*return*/, session];\n }\n });\n });\n };\n // eslint-disable-next-line class-methods-use-this\n RemoteDataSource.initSDK = function (sdkParams) {\n console.log('2. call initSDK in RemoteDataSourceMock');\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n if (!window.QB) {\n throw new Error('HAVE NO SDK');\n }\n else {\n console.log('2. start init actions');\n (0,_qb_api_calls__WEBPACK_IMPORTED_MODULE_8__.QBInit)({\n appIdOrToken: sdkParams.appIdOrToken,\n authKeyOrAppId: sdkParams.authKeyOrAppId,\n authSecret: sdkParams.authSecret,\n accountKey: sdkParams.accountKey,\n config: sdkParams.config,\n });\n var QuickBloxVersion = \"CALL initData: Init SDK was success: version \".concat(QB.version, \" build \").concat(QB.buildNumber);\n console.log(QuickBloxVersion);\n return true;\n }\n };\n RemoteDataSource.prototype.initSDKWithUser = function (sdkParams, authData) {\n return __awaiter(this, void 0, void 0, function () {\n var QuickBloxVersion;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n console.log('2. call initSDK in RemoteDataSourceMock');\n if (!this._needInit) return [3 /*break*/, 2];\n console.log('2. start init actions');\n (0,_qb_api_calls__WEBPACK_IMPORTED_MODULE_8__.QBInit)({\n appIdOrToken: sdkParams.appIdOrToken,\n authKeyOrAppId: sdkParams.authKeyOrAppId,\n authSecret: sdkParams.authSecret,\n accountKey: sdkParams.accountKey,\n config: sdkParams.config,\n });\n QuickBloxVersion = \"CALL initData: Init SDK was success: version \".concat(QB.version, \" build \").concat(QB.buildNumber);\n console.log(QuickBloxVersion);\n //\n this._needInit = false;\n return [4 /*yield*/, this.loginWithUser(authData)];\n case 1:\n _a.sent();\n _a.label = 2;\n case 2: return [2 /*return*/];\n }\n });\n });\n };\n RemoteDataSource.prototype.disconnectAndLogoutUser = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!this._authProcessed) return [3 /*break*/, 2];\n (0,_qb_api_calls__WEBPACK_IMPORTED_MODULE_8__.QBChatDisconnect)();\n return [4 /*yield*/, (0,_qb_api_calls__WEBPACK_IMPORTED_MODULE_8__.QBLogout)()];\n case 1:\n _a.sent();\n this._authProcessed = false;\n this.releaseSubscriptions();\n this.releaseEventsHandlers();\n _a.label = 2;\n case 2: return [2 /*return*/];\n }\n });\n });\n };\n RemoteDataSource.prototype.releaseSubscriptions = function () {\n var _this = this;\n Object.entries(this.subscriptionOnSystemMessages).map(function (x) {\n var eventName = x[0];\n return _this.subscriptionOnSystemMessages[eventName].release();\n });\n };\n RemoteDataSource.prototype.subscribeOnSystemMessaging = function (notificationType, callback) {\n var SystemMessageType = _Domain_entity_NotificationTypes__WEBPACK_IMPORTED_MODULE_14__.NotificationTypes.NEW_DIALOG;\n switch (notificationType) {\n case _Domain_entity_NotificationTypes__WEBPACK_IMPORTED_MODULE_14__.NotificationTypes.DELETE_LEAVE_DIALOG:\n SystemMessageType = _Domain_entity_NotificationTypes__WEBPACK_IMPORTED_MODULE_14__.NotificationTypes.DELETE_LEAVE_DIALOG;\n break;\n case _Domain_entity_NotificationTypes__WEBPACK_IMPORTED_MODULE_14__.NotificationTypes.UPDATE_DIALOG:\n SystemMessageType = _Domain_entity_NotificationTypes__WEBPACK_IMPORTED_MODULE_14__.NotificationTypes.UPDATE_DIALOG;\n break;\n default:\n SystemMessageType = _Domain_entity_NotificationTypes__WEBPACK_IMPORTED_MODULE_14__.NotificationTypes.NEW_DIALOG;\n break;\n }\n this.subscriptionOnSystemMessages[SystemMessageType].subscribe(callback, _Domain_entity_EventMessageType__WEBPACK_IMPORTED_MODULE_15__[\"default\"].SystemMessage);\n };\n RemoteDataSource.prototype.subscribeOnMessaging = function (callback) {\n this.subscriptionOnChatMessages.subscribe(callback, _Domain_entity_EventMessageType__WEBPACK_IMPORTED_MODULE_15__[\"default\"].RegularMessage);\n };\n RemoteDataSource.prototype.subscribeOnSessionExpiredListener = function (callback) {\n var _this = this;\n console.log('subscribe On Session Expired Event');\n this.subscriptionOnSessionExpiredListener.subscribe(callback, _Domain_entity_EventMessageType__WEBPACK_IMPORTED_MODULE_15__[\"default\"].LocalMessage);\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n var sessionTimeOut = _QBconfig__WEBPACK_IMPORTED_MODULE_18__.QBConfig.appConfig.sessionTimeOut || 122;\n setTimeout(function () {\n console.log('NEED LOGOUT');\n if (_this._authProcessed) {\n _this.subscriptionOnSessionExpiredListener.informSubscribers(true, _Domain_entity_EventMessageType__WEBPACK_IMPORTED_MODULE_15__[\"default\"].LocalMessage);\n }\n }, sessionTimeOut * 60 * 1000);\n };\n RemoteDataSource.prototype.subscribeOnUpdateMessageStatus = function (callback) {\n this.subscriptionOnMessageStatus.subscribe(callback, _Domain_entity_EventMessageType__WEBPACK_IMPORTED_MODULE_15__[\"default\"].LocalMessage);\n };\n RemoteDataSource.prototype.initEventsHandlers = function () {\n var _this = this;\n QB.chat.onSystemMessageListener = function (message) {\n var _a;\n console.log(\"EVENT: receive system message: \".concat(JSON.stringify(message)));\n var resultMessage = new _dto_message_RemoteMessageDTO__WEBPACK_IMPORTED_MODULE_2__.RemoteMessageDTO();\n resultMessage.sender_id = message.userId;\n resultMessage.message = message.body || 'system message';\n resultMessage.notification_type =\n message.extension.notification_type || _Domain_entity_NotificationTypes__WEBPACK_IMPORTED_MODULE_14__.NotificationTypes.UPDATE_DIALOG;\n resultMessage.dialogId = ((_a = message === null || message === void 0 ? void 0 : message.extension) === null || _a === void 0 ? void 0 : _a.dialog_id) || '';\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n function getEventNameFromNotification(notification_type) {\n var EventName = _Domain_use_cases_base_Subscribable_SubscriptionPerformer__WEBPACK_IMPORTED_MODULE_16__.SubscriptionPerformer.DEFAULT_SUBSCRIPTION_NAME;\n if (notification_type === _Domain_entity_NotificationTypes__WEBPACK_IMPORTED_MODULE_14__.NotificationTypes.UPDATE_DIALOG ||\n notification_type === _Domain_entity_NotificationTypes__WEBPACK_IMPORTED_MODULE_14__.NotificationTypes.NEW_DIALOG) {\n EventName = 'UPDATE_DIALOG_LIST_INFO';\n }\n return EventName;\n }\n _this.subscriptionOnSystemMessages[resultMessage.notification_type].informSubscribers(resultMessage, _Domain_entity_EventMessageType__WEBPACK_IMPORTED_MODULE_15__[\"default\"].SystemMessage);\n };\n function ToRemoteMessageDTO(message) {\n var _a, _b, _c, _d, _e;\n var resultMessage = new _dto_message_RemoteMessageDTO__WEBPACK_IMPORTED_MODULE_2__.RemoteMessageDTO();\n resultMessage.id = message.id;\n resultMessage.message = message.body;\n resultMessage.markable = message.markable\n ? message.markable.toString()\n : '0';\n resultMessage.dialogId = ((_a = message === null || message === void 0 ? void 0 : message.extension) === null || _a === void 0 ? void 0 : _a.dialog_id) || '';\n // eslint-disable-next-line no-nested-ternary\n resultMessage.recipient_id = (message === null || message === void 0 ? void 0 : message.recipient_id)\n ? parseInt(message === null || message === void 0 ? void 0 : message.recipient_id, 10)\n : ((_b = message === null || message === void 0 ? void 0 : message.extension) === null || _b === void 0 ? void 0 : _b.sender_id)\n ? (_c = message === null || message === void 0 ? void 0 : message.extension) === null || _c === void 0 ? void 0 : _c.sender_id\n : 0;\n resultMessage.sender_id = ((_d = message === null || message === void 0 ? void 0 : message.extension) === null || _d === void 0 ? void 0 : _d.sender_id)\n ? (_e = message === null || message === void 0 ? void 0 : message.extension) === null || _e === void 0 ? void 0 : _e.sender_id\n : 0;\n resultMessage.notification_type =\n message.notification_type || message.extension.notification_type;\n resultMessage.date_sent = message.extension.date_sent\n ? parseInt(message.extension.date_sent, 10)\n : 0;\n resultMessage.delivered_ids = [];\n // resultMessage.attachments = message.extension.attachments || [];\n resultMessage.attachments = _Mapper_MessageDTOMapper__WEBPACK_IMPORTED_MODULE_10__.MessageDTOMapper.transformAttachment(message.extension.attachments ? message.extension.attachments : []);\n return resultMessage;\n }\n QB.chat.onMessageListener = function (userId, message) {\n console.log(\"EVENT: receive message for userid: \".concat(userId, \", error: \").concat((0,_utils_parse__WEBPACK_IMPORTED_MODULE_12__.stringifyError)(message)));\n // нужно получить реализовать так как при обработке onDeliveredStatusListener\n var dialogId = message.dialog_id || message.extension.dialog_id || '-1';\n // eslint-disable-next-line promise/catch-or-return\n (0,_qb_api_calls__WEBPACK_IMPORTED_MODULE_8__.QBGetDialogById)(dialogId).then(function (result) {\n var dialogs = result === null || result === void 0 ? void 0 : result.items.filter(function (v) { return v._id === dialogId; });\n var current = dialogs && dialogs.length > 0 ? dialogs[0] : undefined;\n // eslint-disable-next-line promise/always-return\n if (current && current.type === _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_13__.DialogType.group) {\n // const messageId = message.id;\n var resultMessage = ToRemoteMessageDTO(message);\n _this.subscriptionOnChatMessages.informSubscribers(resultMessage, _Domain_entity_EventMessageType__WEBPACK_IMPORTED_MODULE_15__[\"default\"].RegularMessage);\n }\n //\n });\n };\n QB.chat.onMessageTypingListener = function (isTyping, userId, dialogId) {\n var _a;\n console.log(\"EVENT: receive typing: \".concat(isTyping ? 'true' : 'false', \", dialog id: \").concat(dialogId, \" userid: \").concat(userId));\n if (_this._authProcessed && ((_a = _this.authInformation) === null || _a === void 0 ? void 0 : _a.userId) === userId)\n return;\n var resultMessage = {\n eventMessageType: _Domain_entity_EventMessageType__WEBPACK_IMPORTED_MODULE_15__[\"default\"].LocalMessage,\n messageInfo: undefined,\n messageStatus: { isTyping: isTyping, userId: userId, dialogId: dialogId },\n notificationTypes: undefined,\n };\n _this.subscriptionOnMessageStatus.informSubscribers(resultMessage, _Domain_entity_EventMessageType__WEBPACK_IMPORTED_MODULE_15__[\"default\"].LocalMessage);\n };\n QB.chat.onSessionExpiredListener = function (error) {\n console.log('call onSessionExpiredListener');\n console.timeLog('onSessionExpiredListener');\n var result = true;\n if (error) {\n console.log('EVENT:onSessionExpiredListener - error: ', (0,_utils_parse__WEBPACK_IMPORTED_MODULE_12__.stringifyError)(error));\n result = false;\n }\n else {\n console.log('EVENT: Hello from SessionExpiredListener. session is expired.');\n result = true;\n }\n _this.subscriptionOnSessionExpiredListener.informSubscribers(result, _Domain_entity_EventMessageType__WEBPACK_IMPORTED_MODULE_15__[\"default\"].LocalMessage);\n };\n QB.chat.onDisconnectedListener = function () {\n console.log('EVENT: disconnect');\n };\n QB.chat.onReconnectListener = function () {\n console.log('EVENT: reconnect');\n };\n QB.chat.onMessageErrorListener = function (messageId, error) {\n console.log(\"EVENT: receive error messageid: \".concat(messageId, \", error: \").concat((0,_utils_parse__WEBPACK_IMPORTED_MODULE_12__.stringifyError)(error)));\n };\n QB.chat.onDeliveredStatusListener = function (messageId, dialogId, userId) {\n console.log(\"EVENT: receive delivered message id: \".concat(messageId, \", dialogid: \").concat(dialogId, \" userid: \").concat(userId));\n (0,_qb_api_calls__WEBPACK_IMPORTED_MODULE_8__.QBGetDialogById)(dialogId)\n .then(function (result) {\n //\n var dialogs = result === null || result === void 0 ? void 0 : result.items.filter(function (v) { return v._id === dialogId; });\n var current = dialogs && dialogs.length > 0 ? dialogs[0] : undefined;\n // eslint-disable-next-line promise/always-return\n if (current && current.type === _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_13__.DialogType[\"private\"]) {\n //\n (0,_qb_api_calls__WEBPACK_IMPORTED_MODULE_8__.qbChatGetMessagesExtended)(dialogId, {\n _id: messageId,\n })\n // eslint-disable-next-line promise/always-return\n .then(function (qbMessages) {\n ///\n qbMessages.items.map(function (currentItem) { return __awaiter(_this, void 0, void 0, function () {\n var dtoMessage;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.messageDTOMapper.toTDO(currentItem)];\n case 1:\n dtoMessage = _a.sent();\n dtoMessage.dialogId = dialogId;\n this.subscriptionOnChatMessages.informSubscribers(dtoMessage, _Domain_entity_EventMessageType__WEBPACK_IMPORTED_MODULE_15__[\"default\"].RegularMessage);\n return [2 /*return*/, dtoMessage];\n }\n });\n }); });\n ///\n })\n .catch();\n //\n }\n })\n .catch();\n };\n QB.chat.onReadStatusListener = function (messageId, dialogId, userId) {\n console.log(\"EVENT: receive read message id: \".concat(messageId, \", dialogid: \").concat(dialogId, \" userid: \").concat(userId));\n };\n //\n };\n // eslint-disable-next-line class-methods-use-this\n RemoteDataSource.prototype.releaseEventsHandlers = function () {\n QB.chat.onSessionExpiredListener = undefined;\n QB.chat.onReconnectListener = undefined;\n QB.chat.onDisconnectedListener = undefined;\n QB.chat.onSystemMessageListener = undefined;\n QB.chat.onMessageListener = undefined;\n QB.chat.onMessageErrorListener = undefined;\n QB.chat.onDeliveredStatusListener = undefined;\n QB.chat.onReadStatusListener = undefined;\n QB.chat.onMessageTypingListener = undefined;\n };\n RemoteDataSource.prototype.loginWithUser = function (authParams) {\n return __awaiter(this, void 0, void 0, function () {\n var userRequiredParams, sessionResult, session, sessionDataTmp, sessionData, authInformation, paramsConnect, connectResult;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (this._needInit)\n return [2 /*return*/];\n if (this._authProcessed)\n return [2 /*return*/];\n //\n console.log('CALL createUserSession....');\n userRequiredParams = {\n login: authParams.userName,\n password: authParams.password,\n };\n return [4 /*yield*/, this.createUserSession(userRequiredParams).catch(function (e) {\n _this._needInit = true;\n _this._authProcessed = false;\n console.log(\"EXCEPTION IN CREATE USER SESSION (\".concat(userRequiredParams.login, \") : \").concat((0,_utils_parse__WEBPACK_IMPORTED_MODULE_12__.stringifyError)(e)));\n })];\n case 1:\n sessionResult = _a.sent();\n if (!sessionResult)\n return [2 /*return*/];\n //\n //\n this.initEventsHandlers();\n //\n //\n console.log('USER DATA : ', userRequiredParams);\n console.log('USER SESSION DATA : ', sessionResult);\n console.log('Session token : ', sessionResult.token);\n session = sessionResult;\n sessionDataTmp = JSON.stringify(session);\n sessionData = JSON.parse(sessionDataTmp);\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n console.log(\"user_id = \".concat(sessionData.user_id));\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n console.log(\"session token to chat init = \".concat(sessionData.token));\n authInformation = {\n userName: authParams.userName,\n userId: sessionData.user_id,\n sessionToken: sessionData.token,\n password: sessionData.token,\n };\n paramsConnect = {\n userId: authInformation.userId,\n password: authInformation.password,\n };\n console.log(paramsConnect);\n return [4 /*yield*/, (0,_qb_api_calls__WEBPACK_IMPORTED_MODULE_8__.QBChatConnect)(paramsConnect)];\n case 2:\n connectResult = _a.sent();\n if (connectResult) {\n //\n this._authInformation = authInformation;\n this.setAuthProcessedSuccessed();\n console.log('CHAT CONNECTED. CAN WORK!');\n console.log('CONNECTION DATA: ', JSON.stringify(authInformation));\n // //\n // this.initEventsHandlers();\n // //\n }\n else {\n console.log('could not connect to chat');\n }\n return [2 /*return*/];\n }\n });\n });\n };\n RemoteDataSource.prototype.getDialogs = function (pagination) {\n return __awaiter(this, void 0, void 0, function () {\n var currentPagination, pageNumber, perPage, params, dialogsDTO, qbDialogs, _i, _a, item, qbEntity, newDTO;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n currentPagination = pagination || new _Domain_repository_Pagination__WEBPACK_IMPORTED_MODULE_5__.Pagination();\n console.log('call getDialogs in RemoteDataSourceMock param pagination: ', JSON.stringify(pagination));\n console.log('call getDialogs in RemoteDataSourceMock with result pagination: ', JSON.stringify(currentPagination));\n pageNumber = currentPagination.getCurrentPage() || 1;\n console.log('pageNumber: ', pageNumber);\n perPage = currentPagination.perPage || 100;\n console.log('perPage: ', perPage);\n params = {\n created_at: {\n lt: Date.now() / 1000,\n },\n sort_desc: 'created_at',\n page: pageNumber,\n // per_page: perPage,\n limit: perPage,\n type: {\n in: [2, 3],\n },\n };\n // filter['type[in]'] = [3, 2].join(',');\n console.log('call getDialogs in RemoteDataSourceMock with params: ', JSON.stringify(params));\n dialogsDTO = [];\n return [4 /*yield*/, (0,_qb_api_calls__WEBPACK_IMPORTED_MODULE_8__.QBGetDialogs)(params)];\n case 1:\n qbDialogs = _b.sent();\n if (!qbDialogs) return [3 /*break*/, 7];\n console.log(\"request completed. have: total_entries \".concat(qbDialogs.total_entries, \", limit: \").concat(qbDialogs.limit, \", skip: \").concat(qbDialogs.skip, \" items: \").concat(JSON.stringify(qbDialogs.items)));\n currentPagination = new _Domain_repository_Pagination__WEBPACK_IMPORTED_MODULE_5__.Pagination(0, perPage);\n currentPagination.totalPages = qbDialogs.total_entries / perPage;\n currentPagination.setCurrentPage(pageNumber);\n _i = 0, _a = qbDialogs.items;\n _b.label = 2;\n case 2:\n if (!(_i < _a.length)) return [3 /*break*/, 7];\n item = _a[_i];\n qbEntity = item;\n // eslint-disable-next-line no-await-in-loop\n return [4 /*yield*/, this.getCurrentDialogDTOMapper().toTDO(qbEntity)];\n case 3:\n newDTO = \n // eslint-disable-next-line no-await-in-loop\n _b.sent();\n if (!(newDTO.type === _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_13__.DialogType.group)) return [3 /*break*/, 5];\n // eslint-disable-next-line no-await-in-loop\n return [4 /*yield*/, (0,_qb_api_calls__WEBPACK_IMPORTED_MODULE_8__.QBJoinGroupDialog)(newDTO.id).catch(function () {\n throw new _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.RemoteDataSourceException(_exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_MESSAGE, _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_CODE);\n })];\n case 4:\n // eslint-disable-next-line no-await-in-loop\n _b.sent();\n _b.label = 5;\n case 5:\n //\n dialogsDTO.push(newDTO);\n _b.label = 6;\n case 6:\n _i++;\n return [3 /*break*/, 2];\n case 7: \n /*\n await Promise.all(\n fromRemote.ResultData.map(async (entity) => {\n // eslint-disable-next-line no-return-await\n return await this.dialogRepository.saveDialogToLocal(entity);\n }),\n );\n */\n return [2 /*return*/, Promise.resolve(new _dto_dialog_RemoteDialogsDTO__WEBPACK_IMPORTED_MODULE_1__.RemoteDialogsDTO(dialogsDTO, currentPagination))];\n }\n });\n });\n };\n // eslint-disable-next-line class-methods-use-this\n RemoteDataSource.prototype.createDialog = function (dto) {\n return __awaiter(this, void 0, void 0, function () {\n var qbEntity, qbDialog, participantId, participants, data, newDTO;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n console.log('call createDialog in remote with params: ', JSON.stringify(dto));\n return [4 /*yield*/, this.getCurrentDialogDTOMapper().fromDTO(dto)];\n case 1:\n qbEntity = _a.sent();\n if (!(qbEntity.type === _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_13__.DialogType[\"private\"])) return [3 /*break*/, 3];\n participantId = qbEntity.occupants_ids[0];\n return [4 /*yield*/, (0,_qb_api_calls__WEBPACK_IMPORTED_MODULE_8__.QBCreatePrivateDialog)(participantId, qbEntity.name)];\n case 2:\n qbDialog = _a.sent();\n return [3 /*break*/, 5];\n case 3:\n if (!(qbEntity.type === _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_13__.DialogType.group)) return [3 /*break*/, 5];\n participants = qbEntity.occupants_ids;\n data = { photo: qbEntity.photo };\n return [4 /*yield*/, (0,_qb_api_calls__WEBPACK_IMPORTED_MODULE_8__.QBCreateGroupDialog)(participants, qbEntity.name, data)];\n case 4:\n qbDialog = _a.sent();\n _a.label = 5;\n case 5:\n if (qbDialog === null || qbDialog === undefined) {\n return [2 /*return*/, Promise.reject(new _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.RemoteDataSourceException(_exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_MESSAGE, _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_CODE))];\n }\n return [4 /*yield*/, this.getCurrentDialogDTOMapper().toTDO(qbDialog)];\n case 6:\n newDTO = _a.sent();\n console.log('have result in createDialog in remote ds: ', JSON.stringify(newDTO));\n return [2 /*return*/, Promise.resolve(newDTO)];\n }\n });\n });\n };\n RemoteDataSource.prototype.updateDialog = function (dto) {\n var _a;\n return __awaiter(this, void 0, void 0, function () {\n var qbEntity, data, qbDialogs, newDTO;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0: return [4 /*yield*/, this.getCurrentDialogDTOMapper().fromDTO(dto)];\n case 1:\n qbEntity = _b.sent();\n data = {};\n if (qbEntity.name && qbEntity.name.length > 0) {\n data = __assign({ name: qbEntity.name }, data);\n }\n if (qbEntity.photo) {\n data = __assign(__assign({}, data), { photo: qbEntity.photo });\n }\n if (((_a = qbEntity.new_occupants_ids) === null || _a === void 0 ? void 0 : _a.length) > 0) {\n data = __assign(__assign({}, data), { push_all: { occupants_ids: qbEntity.new_occupants_ids } });\n }\n return [4 /*yield*/, (0,_qb_api_calls__WEBPACK_IMPORTED_MODULE_8__.QBUpdateDialog)(qbEntity._id, data)];\n case 2:\n qbDialogs = _b.sent();\n if (qbDialogs === null || qbDialogs === undefined) {\n return [2 /*return*/, Promise.reject(new _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.RemoteDataSourceException(_exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_MESSAGE, _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_CODE))];\n }\n return [4 /*yield*/, this.getCurrentDialogDTOMapper().toTDO(qbDialogs)];\n case 3:\n newDTO = _b.sent();\n return [2 /*return*/, Promise.resolve(newDTO)];\n }\n });\n });\n };\n // eslint-disable-next-line class-methods-use-this\n RemoteDataSource.prototype.getDialog = function (dto) {\n return __awaiter(this, void 0, void 0, function () {\n var qbEntity, qbDialog, qbEntityFromDB, resultDTO;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.getCurrentDialogDTOMapper().fromDTO(dto)];\n case 1:\n qbEntity = _a.sent();\n return [4 /*yield*/, (0,_qb_api_calls__WEBPACK_IMPORTED_MODULE_8__.QBGetDialogById)(qbEntity._id)];\n case 2:\n qbDialog = _a.sent();\n if (qbDialog === null || qbDialog === undefined) {\n return [2 /*return*/, Promise.reject(new _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.RemoteDataSourceException(_exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_MESSAGE, _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_CODE))];\n }\n qbEntityFromDB = qbDialog.items[0];\n return [4 /*yield*/, this.getCurrentDialogDTOMapper().toTDO(qbEntityFromDB)];\n case 3:\n resultDTO = _a.sent();\n return [2 /*return*/, Promise.resolve(resultDTO)];\n }\n });\n });\n };\n // eslint-disable-next-line class-methods-use-this\n RemoteDataSource.prototype.deleteDialog = function (dto) {\n return __awaiter(this, void 0, void 0, function () {\n var qbEntity;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.getCurrentDialogDTOMapper().fromDTO(dto)];\n case 1:\n qbEntity = _a.sent();\n return [4 /*yield*/, (0,_qb_api_calls__WEBPACK_IMPORTED_MODULE_8__.QBDeleteDialog)([qbEntity._id]).catch(function () {\n throw new _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.RemoteDataSourceException(_exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_MESSAGE, _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_CODE);\n })];\n case 2:\n _a.sent();\n return [2 /*return*/, Promise.resolve()];\n }\n });\n });\n };\n RemoteDataSource.prototype.deleteUsersFromDialog = function (dialogDTO, usersDTO) {\n return __awaiter(this, void 0, void 0, function () {\n var qbEntity, usersIds, data, qbDialogs;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.getCurrentDialogDTOMapper().fromDTO(dialogDTO)];\n case 1:\n qbEntity = _a.sent();\n usersIds = [];\n usersDTO.forEach(function (item) {\n usersIds.push(item.id);\n });\n data = {};\n if (usersIds.length > 0) {\n data = {\n pull_all: { occupants_ids: usersIds },\n };\n }\n return [4 /*yield*/, (0,_qb_api_calls__WEBPACK_IMPORTED_MODULE_8__.QBUpdateDialog)(qbEntity._id, data)];\n case 2:\n qbDialogs = _a.sent();\n if (qbDialogs === null || qbDialogs === undefined) {\n return [2 /*return*/, Promise.reject(new _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.RemoteDataSourceException(_exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_MESSAGE, _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_CODE))];\n }\n return [2 /*return*/, Promise.resolve()];\n }\n });\n });\n };\n // eslint-disable-next-line @typescript-eslint/require-await,class-methods-use-this,@typescript-eslint/no-unused-vars\n RemoteDataSource.prototype.getUser = function (dto) {\n return __awaiter(this, void 0, void 0, function () {\n var currentItem, dtoUser, e_1;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, (0,_qb_api_calls__WEBPACK_IMPORTED_MODULE_8__.QBUsersGetById)(parseInt(dto.id, 10))];\n case 1:\n currentItem = _a.sent();\n if (currentItem === null || currentItem === undefined) {\n return [2 /*return*/, Promise.reject(new _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.RemoteDataSourceException(_exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_MESSAGE, _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_CODE))];\n }\n _a.label = 2;\n case 2:\n _a.trys.push([2, 4, , 5]);\n return [4 /*yield*/, this.userDTOMapper.toTDO(currentItem)];\n case 3:\n dtoUser = _a.sent();\n return [3 /*break*/, 5];\n case 4:\n e_1 = _a.sent();\n console.log('problem with:');\n console.log(JSON.stringify(currentItem));\n console.log(e_1.message);\n console.log(e_1._description);\n return [3 /*break*/, 5];\n case 5:\n if (dtoUser !== null || dtoUser !== undefined) {\n return [2 /*return*/, Promise.resolve(dtoUser)];\n }\n return [2 /*return*/, Promise.reject(new _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.RemoteDataSourceException(_exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.NOT_FOUND_REMOTE_DATASOURCE_EXCEPTION_MESSAGE, _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.NOT_FOUND_REMOTE_DATASOURCE_EXCEPTION_CODE, \"not found user with id: \".concat(dto.id, \" (\").concat(dto.full_name, \")\")))];\n }\n });\n });\n };\n // eslint-disable-next-line @typescript-eslint/require-await,class-methods-use-this,@typescript-eslint/no-unused-vars\n RemoteDataSource.prototype.getUsers = function (remoteUsersDTO) {\n return __awaiter(this, void 0, void 0, function () {\n var usersDTO, _i, _a, item, userDTO;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n usersDTO = new Array();\n _i = 0, _a = remoteUsersDTO.users;\n _b.label = 1;\n case 1:\n if (!(_i < _a.length)) return [3 /*break*/, 4];\n item = _a[_i];\n return [4 /*yield*/, this.getUser(item)];\n case 2:\n userDTO = _b.sent();\n usersDTO.push(userDTO);\n _b.label = 3;\n case 3:\n _i++;\n return [3 /*break*/, 1];\n case 4: return [2 /*return*/, Promise.resolve(new _dto_user_RemoteUsersDTO__WEBPACK_IMPORTED_MODULE_3__.RemoteUsersDTO(usersDTO, new _Domain_repository_Pagination__WEBPACK_IMPORTED_MODULE_5__.Pagination()))];\n }\n });\n });\n };\n //\n // eslint-disable-next-line class-methods-use-this\n RemoteDataSource.prototype.getAllUsers = function (pagination, \n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n filter) {\n return __awaiter(this, void 0, void 0, function () {\n var users, pageTemplate, pageNumber, resultPagination, params, response, currentItem, _i, _a, item, dtoUser, e_2;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n console.log('call getAllUsers');\n console.log('pagination: ', JSON.stringify(pagination));\n users = [];\n pageTemplate = {\n pageSize: pagination.perPage,\n startPageNumber: pagination.getCurrentPage(),\n };\n pageNumber = pageTemplate.startPageNumber;\n resultPagination = new _Domain_repository_Pagination__WEBPACK_IMPORTED_MODULE_5__.Pagination(pageNumber, pageTemplate.startPageNumber);\n params = {\n per_page: pageTemplate.pageSize,\n page: pageNumber,\n };\n if (filter && filter.length > 2) {\n params = {\n full_name: filter,\n per_page: pageTemplate.pageSize,\n page: pageNumber > 0 ? pageNumber : 1,\n };\n }\n console.log('params: ', JSON.stringify(params));\n return [4 /*yield*/, (0,_qb_api_calls__WEBPACK_IMPORTED_MODULE_8__.QBUsersGet)(params).catch(function (err) {\n console.log('catch call QBUsersGet : ', (0,_utils_parse__WEBPACK_IMPORTED_MODULE_12__.stringifyError)(err));\n })];\n case 1:\n response = _b.sent();\n if (response === undefined || response === null) {\n throw new _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.RemoteDataSourceException(_exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.NOT_FOUND_REMOTE_DATASOURCE_EXCEPTION_MESSAGE, _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.NOT_FOUND_REMOTE_DATASOURCE_EXCEPTION_CODE, \"params: \".concat(JSON.stringify(params)));\n }\n console.log('response: total_entries: ', response.total_entries);\n console.log('response: per_page: ', response.per_page);\n console.log('response: current_page: ', response.current_page);\n resultPagination.totalPages =\n response.total_entries / pageTemplate.pageSize;\n resultPagination.setCurrentPage(response.current_page);\n console.log(\"response result: count of items \".concat(response.items.length, \" items: \").concat(JSON.stringify(response.items)));\n _b.label = 2;\n case 2:\n _b.trys.push([2, 7, , 8]);\n _i = 0, _a = response.items;\n _b.label = 3;\n case 3:\n if (!(_i < _a.length)) return [3 /*break*/, 6];\n item = _a[_i];\n currentItem = item.user;\n return [4 /*yield*/, this.userDTOMapper.toTDO(currentItem)];\n case 4:\n dtoUser = _b.sent();\n users.push(dtoUser);\n _b.label = 5;\n case 5:\n _i++;\n return [3 /*break*/, 3];\n case 6: return [3 /*break*/, 8];\n case 7:\n e_2 = _b.sent();\n console.log('problem with:');\n console.log(JSON.stringify(currentItem));\n console.log(e_2.message);\n console.log(e_2._description);\n return [3 /*break*/, 8];\n case 8: return [2 /*return*/, { ResultData: users, PaginationResult: resultPagination }];\n }\n });\n });\n };\n //\n //\n // eslint-disable-next-line @typescript-eslint/require-await,class-methods-use-this,@typescript-eslint/no-unused-vars,@typescript-eslint/ban-ts-comment\n // @ts-ignore\n // eslint-disable-next-line @typescript-eslint/require-await,class-methods-use-this\n RemoteDataSource.prototype.getMessages = function (dialogId, \n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n pagination) {\n var _a;\n return __awaiter(this, void 0, void 0, function () {\n var messagesDTO, qbMessages, currentUserId;\n var _this = this;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n messagesDTO = new Array();\n return [4 /*yield*/, (0,_qb_api_calls__WEBPACK_IMPORTED_MODULE_8__.qbChatGetMessagesExtended)(dialogId)];\n case 1:\n qbMessages = _b.sent();\n // const qbMessages: GetMessagesResult & { dialogId: QBChatDialog['_id'] } =\n // await QBChatGetMessages(dialogId);\n if (qbMessages === null || qbMessages === undefined) {\n return [2 /*return*/, Promise.reject(new _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.RemoteDataSourceException(_exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_MESSAGE, _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_CODE))];\n }\n console.log(\"GET MESSAGES \".concat(qbMessages.items.length, \" FROM SERVER: \").concat(JSON.stringify(qbMessages), \" \"));\n currentUserId = (_a = this._authInformation) === null || _a === void 0 ? void 0 : _a.userId;\n return [4 /*yield*/, Promise.all(qbMessages.items.map(function (currentItem) { return __awaiter(_this, void 0, void 0, function () {\n var dtoMessage;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.messageDTOMapper.toTDO(currentItem)];\n case 1:\n dtoMessage = _a.sent();\n if (this._authProcessed &&\n currentUserId &&\n dtoMessage.read_ids &&\n dtoMessage.read_ids.length > 0 &&\n dtoMessage.read_ids.includes(currentUserId) === false) {\n (0,_qb_api_calls__WEBPACK_IMPORTED_MODULE_8__.QBChatMarkMessageRead)({\n messageId: dtoMessage.id,\n dialogId: dtoMessage.dialogId,\n userId: currentUserId,\n });\n }\n messagesDTO.push(dtoMessage);\n return [2 /*return*/, dtoMessage];\n }\n });\n }); }))];\n case 2:\n _b.sent();\n return [2 /*return*/, Promise.resolve(new _dto_message_RemoteMessagesDTO__WEBPACK_IMPORTED_MODULE_4__.RemoteMessagesDTO(messagesDTO, new _Domain_repository_Pagination__WEBPACK_IMPORTED_MODULE_5__.Pagination()))];\n }\n });\n });\n };\n // eslint-disable-next-line class-methods-use-this\n RemoteDataSource.prototype.typingMessageStart = function (dialogDTO, senderId) {\n return __awaiter(this, void 0, void 0, function () {\n var qbEntity;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.getCurrentDialogDTOMapper().fromDTO(dialogDTO)];\n case 1:\n qbEntity = _a.sent();\n if (!(dialogDTO.type === _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_13__.DialogType.group)) return [3 /*break*/, 3];\n return [4 /*yield*/, (0,_qb_api_calls__WEBPACK_IMPORTED_MODULE_8__.QBJoinGroupDialog)(dialogDTO.id).catch(function () {\n throw new _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.RemoteDataSourceException(_exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_MESSAGE, _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_CODE);\n })];\n case 2:\n _a.sent();\n _a.label = 3;\n case 3:\n (0,_qb_api_calls__WEBPACK_IMPORTED_MODULE_8__.QBSendIsTypingStatus)(qbEntity, senderId);\n return [2 /*return*/, Promise.resolve()];\n }\n });\n });\n };\n // eslint-disable-next-line class-methods-use-this\n RemoteDataSource.prototype.typingMessageStop = function (dialogDTO, senderId) {\n return __awaiter(this, void 0, void 0, function () {\n var qbEntity;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.getCurrentDialogDTOMapper().fromDTO(dialogDTO)];\n case 1:\n qbEntity = _a.sent();\n (0,_qb_api_calls__WEBPACK_IMPORTED_MODULE_8__.QBSendIsStopTypingStatus)(qbEntity, senderId);\n return [2 /*return*/, Promise.resolve()];\n }\n });\n });\n };\n // eslint-disable-next-line @typescript-eslint/require-await,class-methods-use-this,@typescript-eslint/no-unused-vars\n RemoteDataSource.prototype.sendMessage = function (dto) {\n var _a, _b, _c, _d;\n return __awaiter(this, void 0, void 0, function () {\n var messageText, qbEntity, qbMessages, dialogJid;\n return __generator(this, function (_e) {\n switch (_e.label) {\n case 0:\n console.log('call sendMessage');\n messageText = '';\n switch (dto.notification_type) {\n case _Domain_entity_NotificationTypes__WEBPACK_IMPORTED_MODULE_14__.NotificationTypes.DELETE_LEAVE_DIALOG: {\n messageText = \"\".concat(((_a = this.authInformation) === null || _a === void 0 ? void 0 : _a.userName) || 'owner', \" has left the chat.\");\n break;\n }\n case _Domain_entity_NotificationTypes__WEBPACK_IMPORTED_MODULE_14__.NotificationTypes.NEW_DIALOG: {\n messageText = \"\".concat(((_b = this.authInformation) === null || _b === void 0 ? void 0 : _b.userName) || 'owner', \" create the chat\");\n break;\n }\n case _Domain_entity_NotificationTypes__WEBPACK_IMPORTED_MODULE_14__.NotificationTypes.UPDATE_DIALOG: {\n messageText = \"\".concat(((_c = this.authInformation) === null || _c === void 0 ? void 0 : _c.userName) || 'owner', \" update the chat\");\n break;\n }\n default: {\n messageText = dto.message;\n break;\n }\n }\n qbEntity = {\n type: dto.dialog_type === _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_13__.DialogType[\"private\"] ? 'chat' : 'groupchat',\n body: messageText,\n notification_type: dto.notification_type,\n dialog_id: dto.dialogId,\n extension: {\n save_to_history: 1,\n dialog_id: dto.dialogId,\n notification_type: dto.notification_type,\n sender_id: dto.sender_id || dto.recipient_id,\n },\n markable: 1,\n };\n if (((_d = dto.attachments) === null || _d === void 0 ? void 0 : _d.length) > 0) {\n qbEntity.extension.attachments = [];\n dto.attachments.forEach(function (att) {\n var _a;\n var chatMessageAttachment = {\n id: att.id,\n name: att.name,\n size: att.size,\n type: att.type.toString(),\n uid: att.uid,\n };\n (_a = qbEntity.extension.attachments) === null || _a === void 0 ? void 0 : _a.push(chatMessageAttachment);\n });\n }\n if (!(dto.dialog_type === _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_13__.DialogType[\"private\"])) return [3 /*break*/, 2];\n return [4 /*yield*/, (0,_qb_api_calls__WEBPACK_IMPORTED_MODULE_8__.QBChatSendMessage)(dto.recipient_id, qbEntity)];\n case 1:\n qbMessages = _e.sent();\n return [3 /*break*/, 5];\n case 2: return [4 /*yield*/, (0,_qb_api_calls__WEBPACK_IMPORTED_MODULE_8__.QBJoinGroupDialog)(dto.dialogId).catch(function () {\n throw new _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.RemoteDataSourceException(_exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_MESSAGE, _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_CODE);\n })];\n case 3:\n _e.sent();\n dialogJid = QB.chat.helpers.getRoomJidFromDialogId(dto.dialogId);\n return [4 /*yield*/, (0,_qb_api_calls__WEBPACK_IMPORTED_MODULE_8__.QBChatSendMessage)(dialogJid, qbEntity)];\n case 4:\n qbMessages = _e.sent();\n _e.label = 5;\n case 5:\n if (qbMessages === null || qbMessages === undefined) {\n return [2 /*return*/, Promise.reject(new _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.RemoteDataSourceException(_exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_MESSAGE, _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_CODE))];\n }\n console.log('regular message was sent');\n return [2 /*return*/, Promise.resolve(dto)];\n }\n });\n });\n };\n // eslint-disable-next-line class-methods-use-this\n RemoteDataSource.prototype.sendSystemMessage = function (dto) {\n var _a;\n return __awaiter(this, void 0, void 0, function () {\n var qbMessages, systemMessage;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n if (!(dto.notification_type && dto.notification_type.length > 0)) return [3 /*break*/, 2];\n systemMessage = {\n body: null,\n id: '',\n userId: ((_a = this.authInformation) === null || _a === void 0 ? void 0 : _a.userId) || 0,\n extension: {\n notification_type: dto.notification_type,\n dialog_id: dto.dialogId,\n },\n };\n return [4 /*yield*/, (0,_qb_api_calls__WEBPACK_IMPORTED_MODULE_8__.QBChatSendSystemMessage)(dto.recipient_id, systemMessage)];\n case 1:\n qbMessages = _b.sent();\n _b.label = 2;\n case 2:\n if (qbMessages === null || qbMessages === undefined) {\n return [2 /*return*/, Promise.reject(new _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.RemoteDataSourceException(_exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_MESSAGE, _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_CODE))];\n }\n console.log('system message was sent');\n return [2 /*return*/, Promise.resolve(true)];\n }\n });\n });\n };\n // eslint-disable-next-line @typescript-eslint/require-await,class-methods-use-this,@typescript-eslint/no-unused-vars\n RemoteDataSource.prototype.updateMessage = function (\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n dto) {\n return __awaiter(this, void 0, void 0, function () {\n var qbEntity, storageValue, result, qbMessages, newDTO;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.messageDTOMapper.fromDTO(dto)];\n case 1:\n qbEntity = _a.sent();\n storageValue = localStorage.getItem('qbMessages');\n result = storageValue !== null && storageValue !== void 0 ? storageValue : '';\n qbMessages = result === '' ? {} : JSON.parse(result);\n if (qbMessages === null || qbMessages === undefined) {\n return [2 /*return*/, Promise.reject(new _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.RemoteDataSourceException(_exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_MESSAGE, _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_CODE))];\n }\n qbMessages[qbEntity._id] = qbEntity;\n // TODO: How get updated QBChatDialog and return to DTO\n localStorage.setItem('qbMessages', JSON.stringify(qbMessages));\n return [4 /*yield*/, this.messageDTOMapper.toTDO(qbEntity)];\n case 2:\n newDTO = _a.sent();\n return [2 /*return*/, Promise.resolve(newDTO)];\n }\n });\n });\n };\n // eslint-disable-next-line @typescript-eslint/require-await,class-methods-use-this,@typescript-eslint/no-unused-vars\n RemoteDataSource.prototype.deleteMessage = function (dto) {\n return __awaiter(this, void 0, void 0, function () {\n var qbEntity, storageValue, result, qbMessages, filteredqbMessages;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.messageDTOMapper.fromDTO(dto)];\n case 1:\n qbEntity = _a.sent();\n storageValue = localStorage.getItem('qbMessages');\n result = storageValue !== null && storageValue !== void 0 ? storageValue : '';\n qbMessages = result === '' ? {} : JSON.parse(result);\n if (qbMessages === null || qbMessages === undefined) {\n return [2 /*return*/, Promise.reject(new _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.RemoteDataSourceException(_exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_MESSAGE, _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_CODE))];\n }\n filteredqbMessages = {};\n Object.keys(qbMessages).forEach(function (key) {\n if (key !== qbEntity._id) {\n filteredqbMessages[key] = qbMessages[key];\n }\n });\n localStorage.setItem('qbMessages', JSON.stringify(filteredqbMessages));\n return [2 /*return*/, Promise.resolve()];\n }\n });\n });\n };\n // eslint-disable-next-line @typescript-eslint/require-await,class-methods-use-this,@typescript-eslint/no-unused-vars\n RemoteDataSource.prototype.createFile = function (dto) {\n return __awaiter(this, void 0, void 0, function () {\n var qbParam, result, qbContentObject, newDto;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n console.log('call createFile in remote with params: ', JSON.stringify(dto));\n return [4 /*yield*/, this.fileDTOMapper.fromDTO(dto)];\n case 1:\n qbParam = _a.sent();\n return [4 /*yield*/, (0,_qb_api_calls__WEBPACK_IMPORTED_MODULE_8__.QBCreateAndUploadContent)(qbParam).catch(function (err) {\n console.log('Error: ', (0,_utils_parse__WEBPACK_IMPORTED_MODULE_12__.stringifyError)(err));\n throw new _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.RemoteDataSourceException(_exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_MESSAGE, _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_CODE, \"exception: \".concat((0,_utils_parse__WEBPACK_IMPORTED_MODULE_12__.stringifyError)(err)));\n })];\n case 2:\n result = _a.sent();\n if (result === null || result === undefined) {\n return [2 /*return*/, Promise.reject(new _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.RemoteDataSourceException(_exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_MESSAGE, _exception_RemoteDataSourceException__WEBPACK_IMPORTED_MODULE_0__.INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_CODE))];\n }\n qbContentObject = result;\n return [4 /*yield*/, this.fileDTOMapper.toTDO(qbContentObject)];\n case 3:\n newDto = _a.sent();\n console.log('have result in createFile in remote ds: ', JSON.stringify(newDto));\n return [2 /*return*/, Promise.resolve(newDto)];\n }\n });\n });\n };\n // eslint-disable-next-line @typescript-eslint/require-await,class-methods-use-this,@typescript-eslint/no-unused-vars\n RemoteDataSource.prototype.getFile = function (dto) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n throw new Error('Method not implemented.');\n });\n });\n };\n // eslint-disable-next-line @typescript-eslint/require-await,class-methods-use-this,@typescript-eslint/no-unused-vars\n RemoteDataSource.prototype.deleteFile = function (dto) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n throw new Error('Method not implemented.');\n });\n });\n };\n // eslint-disable-next-line @typescript-eslint/require-await,class-methods-use-this,@typescript-eslint/no-unused-vars\n RemoteDataSource.prototype.subscribeToChatConnectionEvents = function (\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n fileId) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n throw new Error('Method not implemented.');\n });\n });\n };\n return RemoteDataSource;\n}());\n\n\n\n//# sourceURL=webpack://quickblox-react-ui-kit/./src/Data/source/remote/RemoteDataSource.ts?");
1283
1305
 
1284
1306
  /***/ }),
1285
1307
 
@@ -1356,7 +1378,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
1356
1378
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
1357
1379
 
1358
1380
  "use strict";
1359
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"PublicDialogEntity\": function() { return /* binding */ PublicDialogEntity; }\n/* harmony export */ });\n/* harmony import */ var _DialogTypes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./DialogTypes */ \"./src/Domain/entity/DialogTypes.ts\");\n\nvar PublicDialogEntity = /** @class */ (function () {\n function PublicDialogEntity(customData, id, lastMessage, ownerId, type, unreadMessageCount, updatedAt, name, photo) {\n this.customData = customData;\n this.id = id;\n this.lastMessage = lastMessage;\n this.ownerId = ownerId;\n this.type = type;\n this.unreadMessageCount = unreadMessageCount;\n this.updatedAt = updatedAt;\n this.name = name;\n this.photo = photo;\n }\n PublicDialogEntity.getParticipants = function (d) {\n if (d.type === _DialogTypes__WEBPACK_IMPORTED_MODULE_0__.DialogType.group) {\n return d.participantIds;\n }\n if (d.type === _DialogTypes__WEBPACK_IMPORTED_MODULE_0__.DialogType[\"private\"] &&\n d.participantIds.length > 0) {\n // return [(d as PrivateDialogEntity).participantId];\n return [d.participantIds[0]];\n }\n return [];\n };\n PublicDialogEntity.getNewParticipants = function (d) {\n if (d.type === _DialogTypes__WEBPACK_IMPORTED_MODULE_0__.DialogType.group) {\n var newParticipants = d.newParticipantIds;\n return newParticipants || [];\n }\n return [];\n };\n return PublicDialogEntity;\n}());\n\n\n\n//# sourceURL=webpack://quickblox-react-ui-kit/./src/Domain/entity/PublicDialogEntity.ts?");
1381
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"PublicDialogEntity\": function() { return /* binding */ PublicDialogEntity; }\n/* harmony export */ });\n/* harmony import */ var _DialogTypes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./DialogTypes */ \"./src/Domain/entity/DialogTypes.ts\");\n\nvar PublicDialogEntity = /** @class */ (function () {\n function PublicDialogEntity(customData, id, lastMessage, ownerId, type, unreadMessageCount, updatedAt, name, photo) {\n this.customData = customData;\n this.id = id;\n this.lastMessage = lastMessage;\n this.ownerId = ownerId;\n this.type = type;\n this.unreadMessageCount = unreadMessageCount;\n this.updatedAt = updatedAt;\n this.name = name;\n this.photo = photo;\n }\n PublicDialogEntity.getParticipants = function (d) {\n if (d.type === _DialogTypes__WEBPACK_IMPORTED_MODULE_0__.DialogType.group) {\n return d.participantIds;\n }\n if (d.type === _DialogTypes__WEBPACK_IMPORTED_MODULE_0__.DialogType[\"private\"] &&\n d.participantIds &&\n d.participantIds.length > 0) {\n return [d.participantIds[0]];\n }\n // artan 22.06.23\n if (d.type === _DialogTypes__WEBPACK_IMPORTED_MODULE_0__.DialogType[\"private\"] &&\n d.participantId) {\n return [d.participantId];\n }\n return [];\n };\n PublicDialogEntity.getNewParticipants = function (d) {\n if (d.type === _DialogTypes__WEBPACK_IMPORTED_MODULE_0__.DialogType.group) {\n var newParticipants = d.newParticipantIds;\n return newParticipants || [];\n }\n return [];\n };\n return PublicDialogEntity;\n}());\n\n\n\n//# sourceURL=webpack://quickblox-react-ui-kit/./src/Domain/entity/PublicDialogEntity.ts?");
1360
1382
 
1361
1383
  /***/ }),
1362
1384
 
@@ -1811,6 +1833,17 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var reac
1811
1833
 
1812
1834
  /***/ }),
1813
1835
 
1836
+ /***/ "./src/Presentation/components/UI/Dialogs/MessagesView/HighLightLink/HighLightLink.tsx":
1837
+ /*!*********************************************************************************************!*\
1838
+ !*** ./src/Presentation/components/UI/Dialogs/MessagesView/HighLightLink/HighLightLink.tsx ***!
1839
+ \*********************************************************************************************/
1840
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
1841
+
1842
+ "use strict";
1843
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"HighLightLink\": function() { return /* binding */ HighLightLink; },\n/* harmony export */ \"isURL\": function() { return /* binding */ isURL; },\n/* harmony export */ \"messageHasUrls\": function() { return /* binding */ messageHasUrls; }\n/* harmony export */ });\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n/* harmony import */ var _HighLightLink_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./HighLightLink.scss */ \"./src/Presentation/components/UI/Dialogs/MessagesView/HighLightLink/HighLightLink.scss\");\nvar __assign = (undefined && undefined.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\n\n\nvar pattern = '^(https?:\\\\/\\\\/)?' + // protocol\n '((([a-zA-Z\\\\d]([a-zA-Z\\\\d-]{0,61}[a-zA-Z\\\\d])*\\\\.)+' + // sub-domain + domain name\n '[a-zA-Z]{2,13})' + // extension\n '|((\\\\d{1,3}\\\\.){3}\\\\d{1,3})' + // OR ip (v4) address\n '|localhost)' + // OR localhost\n '(\\\\:\\\\d{1,5})?' + // port\n '(\\\\/[a-zA-Z\\\\&\\\\d%_.~+-:@]*)*' + // path\n '(\\\\?[a-zA-Z\\\\&\\\\d%_.,~+-:@=;&]*)?' + // query string\n '(\\\\#[-a-zA-Z&\\\\d_]*)?$'; // fragment locator\nfunction removeLastPunctuation(str) {\n var punctuationRegex = /[!;%:?*_.,:-]/;\n var decimalSeparatorRegex = /[.,]/;\n if (str.length > 0) {\n var lastChar = str.charAt(str.length - 1);\n if (punctuationRegex.test(lastChar) ||\n decimalSeparatorRegex.test(lastChar)) {\n return str.slice(0, -1);\n }\n }\n return str;\n}\nvar isURL = function (str) {\n var regex = new RegExp(pattern);\n // return regex.test(str);\n var result = regex.test(str) || regex.test(removeLastPunctuation(str));\n // const result = str.match(pattern);\n return result;\n};\nvar getURIParts = function (url) {\n var matches = url.match(/^(\\w+?:\\/\\/)?([\\w-\\\\.]+(?=\\/?))?:?(\\d*)?([^:]*)/);\n return {\n scheme: matches ? matches[1] : undefined,\n host: matches ? matches[2] : '',\n port: matches ? matches[3] : undefined,\n pathname: matches ? matches[4] : '',\n };\n};\nvar getRuleUrl = function (url) {\n var uriParts = getURIParts(url);\n var result = url;\n if (uriParts.scheme === undefined) {\n result = \"http://\".concat(url);\n }\n return result;\n};\nvar messageHasUrls = function (message) {\n var result = 0;\n var strings = message.split(/\\n| /);\n strings.forEach(function (s) {\n if (s.match(pattern) || removeLastPunctuation(s).match(pattern)) {\n result += 1;\n }\n });\n return result > 0;\n};\n// eslint-disable-next-line react/function-component-definition\n//\n// export const HighLightLink: React.FC<HighLightLinkProps> = ({\n// urlText,\n// }: HighLightLinkProps) => {\n// return (\n// <div className=\"high-light-link-container\">\n// <div className=\"high-light-link-container--header-wrapper\">\n// <a\n// href={urlText}\n// target=\"blank\"\n// className=\"high-light-link-container--header-wrapper__link_url\"\n// >\n// {getNameUrl(urlText)}\n// </a>\n// </div>\n// <div className=\"high-light-link-container--footer-wrapper\">\n// <div className=\"high-light-link-container--footer-wrapper__content\">\n// {getURIParts(urlText).host}\n// </div>\n// </div>\n// </div>\n// );\n// };\n// eslint-disable-next-line react/function-component-definition\nvar HighLightLink = function (_a) {\n var messageText = _a.messageText;\n var strings = messageText.split(/\\n| /);\n var elements = strings.map(function (item, index) {\n if (isURL(item)) {\n return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(\"span\", { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(\"a\", __assign({ href: \"\".concat(getRuleUrl(item)), target: \"blank\" }, { children: item }), index), ' '] }));\n }\n return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(\"span\", { children: [item, \" \"] });\n });\n return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(\"div\", { children: elements });\n};\n\n\n//# sourceURL=webpack://quickblox-react-ui-kit/./src/Presentation/components/UI/Dialogs/MessagesView/HighLightLink/HighLightLink.tsx?");
1844
+
1845
+ /***/ }),
1846
+
1814
1847
  /***/ "./src/Presentation/components/UI/Dialogs/MessagesView/ImageAttachmentComponent/ImageAttachmentComponent.tsx":
1815
1848
  /*!*******************************************************************************************************************!*\
1816
1849
  !*** ./src/Presentation/components/UI/Dialogs/MessagesView/ImageAttachmentComponent/ImageAttachmentComponent.tsx ***!
@@ -1829,7 +1862,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var reac
1829
1862
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
1830
1863
 
1831
1864
  "use strict";
1832
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _MessagesView_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./MessagesView.scss */ \"./src/Presentation/components/UI/Dialogs/MessagesView/MessagesView.scss\");\n/* harmony import */ var _providers_QuickBloxUIKitProvider_useQBConnection__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../providers/QuickBloxUIKitProvider/useQBConnection */ \"./src/Presentation/components/providers/QuickBloxUIKitProvider/useQBConnection.ts\");\n/* harmony import */ var _containers_ScrollableContainer_ScrollableContainer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../containers/ScrollableContainer/ScrollableContainer */ \"./src/Presentation/components/containers/ScrollableContainer/ScrollableContainer.tsx\");\n/* harmony import */ var _Domain_entity_FileTypes__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../../../Domain/entity/FileTypes */ \"./src/Domain/entity/FileTypes.ts\");\n/* harmony import */ var _svgs_Icons_Media_ImageEmpty__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../svgs/Icons/Media/ImageEmpty */ \"./src/Presentation/components/UI/svgs/Icons/Media/ImageEmpty/index.tsx\");\n/* harmony import */ var _svgs_Icons_Toggle_ImagePlay__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../svgs/Icons/Toggle/ImagePlay */ \"./src/Presentation/components/UI/svgs/Icons/Toggle/ImagePlay/index.tsx\");\n/* harmony import */ var _containers_ColumnContainer_ColumnContainer__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../containers/ColumnContainer/ColumnContainer */ \"./src/Presentation/components/containers/ColumnContainer/ColumnContainer.tsx\");\n/* harmony import */ var _svgs_Icons_Media_ImageFile__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../svgs/Icons/Media/ImageFile */ \"./src/Presentation/components/UI/svgs/Icons/Media/ImageFile/index.tsx\");\n/* harmony import */ var _useMessagesViewModel__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./useMessagesViewModel */ \"./src/Presentation/components/UI/Dialogs/MessagesView/useMessagesViewModel.ts\");\n/* harmony import */ var _Placeholders_LoaderComponent_LoaderComponent__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../Placeholders/LoaderComponent/LoaderComponent */ \"./src/Presentation/components/UI/Placeholders/LoaderComponent/LoaderComponent.tsx\");\n/* harmony import */ var _Placeholders_ErrorComponent_ErrorComponent__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../Placeholders/ErrorComponent/ErrorComponent */ \"./src/Presentation/components/UI/Placeholders/ErrorComponent/ErrorComponent.tsx\");\n/* harmony import */ var _HeaderMessages_HeaderMessages__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./HeaderMessages/HeaderMessages */ \"./src/Presentation/components/UI/Dialogs/MessagesView/HeaderMessages/HeaderMessages.tsx\");\n/* harmony import */ var _VideoAttachmentComponent_VideoAttachmentComponent__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./VideoAttachmentComponent/VideoAttachmentComponent */ \"./src/Presentation/components/UI/Dialogs/MessagesView/VideoAttachmentComponent/VideoAttachmentComponent.tsx\");\n/* harmony import */ var _ImageAttachmentComponent_ImageAttachmentComponent__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./ImageAttachmentComponent/ImageAttachmentComponent */ \"./src/Presentation/components/UI/Dialogs/MessagesView/ImageAttachmentComponent/ImageAttachmentComponent.tsx\");\n/* harmony import */ var _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../../../../Domain/entity/DialogTypes */ \"./src/Domain/entity/DialogTypes.ts\");\n/* harmony import */ var _providers_QuickBloxUIKitProvider_useQbDataContext__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../../providers/QuickBloxUIKitProvider/useQbDataContext */ \"./src/Presentation/components/providers/QuickBloxUIKitProvider/useQbDataContext.ts\");\n/* harmony import */ var _Domain_repository_Pagination__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../../../../Domain/repository/Pagination */ \"./src/Domain/repository/Pagination.ts\");\n/* harmony import */ var _utils_DateTimeFormatter__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../../../../../utils/DateTimeFormatter */ \"./src/utils/DateTimeFormatter.ts\");\n/* harmony import */ var _svgs_Icons_Contents_User__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../../svgs/Icons/Contents/User */ \"./src/Presentation/components/UI/svgs/Icons/Contents/User/index.tsx\");\n/* harmony import */ var _svgs_ActiveSvg_ActiveSvg__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../../svgs/ActiveSvg/ActiveSvg */ \"./src/Presentation/components/UI/svgs/ActiveSvg/ActiveSvg.tsx\");\n/* harmony import */ var _svgs_Icons_Media_Attachment__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../../svgs/Icons/Media/Attachment */ \"./src/Presentation/components/UI/svgs/Icons/Media/Attachment/index.tsx\");\n/* harmony import */ var _svgs_Icons_Actions_Send__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../../svgs/Icons/Actions/Send */ \"./src/Presentation/components/UI/svgs/Icons/Actions/Send/index.tsx\");\n/* harmony import */ var _AudioAttachmentComponent_AudioAttachmentComponent__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./AudioAttachmentComponent/AudioAttachmentComponent */ \"./src/Presentation/components/UI/Dialogs/MessagesView/AudioAttachmentComponent/AudioAttachmentComponent.tsx\");\n/* harmony import */ var _svgs_Icons_Media_AudioFile__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../../svgs/Icons/Media/AudioFile */ \"./src/Presentation/components/UI/svgs/Icons/Media/AudioFile/index.tsx\");\n/* harmony import */ var _svgs_Icons_Actions_Voice__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../../svgs/Icons/Actions/Voice */ \"./src/Presentation/components/UI/svgs/Icons/Actions/Voice/index.tsx\");\n/* harmony import */ var _svgs_Icons_Status_Sent__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../../svgs/Icons/Status/Sent */ \"./src/Presentation/components/UI/svgs/Icons/Status/Sent/index.tsx\");\n/* harmony import */ var _svgs_Icons_Status_ViewedDelivered__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../../svgs/Icons/Status/ViewedDelivered */ \"./src/Presentation/components/UI/svgs/Icons/Status/ViewedDelivered/index.tsx\");\n/* harmony import */ var _utils_parse__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../../../../../utils/parse */ \"./src/utils/parse.ts\");\n/* harmony import */ var _VoiceRecordingProgress_VoiceRecordingProgress__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./VoiceRecordingProgress/VoiceRecordingProgress */ \"./src/Presentation/components/UI/Dialogs/MessagesView/VoiceRecordingProgress/VoiceRecordingProgress.tsx\");\nvar __assign = (undefined && undefined.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (undefined && undefined.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __spreadArray = (undefined && undefined.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n// eslint-disable-next-line react/function-component-definition\nvar MessagesView = function (_a) {\n var _b, _c, _d;\n var dialogsViewModel = _a.dialogsViewModel, InformationHandler = _a.InformationHandler, \n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _e = _a.maxWidthToResize, \n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n maxWidthToResize = _e === void 0 ? undefined : _e, \n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _f = _a.theme, \n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n theme = _f === void 0 ? undefined : _f;\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n var maxWidthToResizing = maxWidthToResize || '$message-view-container-wrapper-min-width';\n // const maxWidthToResizing = '720px'; // $message-view-container-wrapper-min-width:\n var currentContext = (0,_providers_QuickBloxUIKitProvider_useQbDataContext__WEBPACK_IMPORTED_MODULE_17__[\"default\"])();\n var currentUserId = (_b = currentContext.storage.REMOTE_DATA_SOURCE.authInformation) === null || _b === void 0 ? void 0 : _b.userId;\n var currentUserName = (_c = currentContext.storage.REMOTE_DATA_SOURCE.authInformation) === null || _c === void 0 ? void 0 : _c.userName;\n var _g = (0,_providers_QuickBloxUIKitProvider_useQBConnection__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(), connectionRepository = _g.connectionRepository, browserOnline = _g.browserOnline;\n var _h = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(100), dialogMessagesCount = _h[0], setDialogMessageCount = _h[1];\n var _j = react__WEBPACK_IMPORTED_MODULE_1___default().useState(true), hasMore = _j[0], setHasMore = _j[1];\n var _k = react__WEBPACK_IMPORTED_MODULE_1___default().useState(false), scrollUpToDown = _k[0], setScrollUpToDown = _k[1];\n var _l = react__WEBPACK_IMPORTED_MODULE_1___default().useState([]), messagesToView = _l[0], setMessagesToView = _l[1];\n var messagesViewModel = (0,_useMessagesViewModel__WEBPACK_IMPORTED_MODULE_10__[\"default\"])((_d = dialogsViewModel.entity) === null || _d === void 0 ? void 0 : _d.type, dialogsViewModel.entity);\n var maxFileSize = currentContext.InitParams.maxFileSize;\n (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {\n console.log('HAVE NEW DIALOG');\n // messagesViewModel.getMessages(new Pagination());\n messagesViewModel.entity = dialogsViewModel.entity;\n setMessagesToView([]);\n }, [dialogsViewModel.entity]);\n (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {\n console.log('HAVE NEW ENTITY');\n messagesViewModel.getMessages(new _Domain_repository_Pagination__WEBPACK_IMPORTED_MODULE_18__.Pagination());\n }, [messagesViewModel.entity]);\n //\n (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {\n console.log('HAVE NEW ENTITY');\n dialogsViewModel.setWaitLoadingStatus(messagesViewModel === null || messagesViewModel === void 0 ? void 0 : messagesViewModel.loading);\n }, [messagesViewModel === null || messagesViewModel === void 0 ? void 0 : messagesViewModel.loading]);\n //\n function prepareFirstPage(initData) {\n var firstPageSize = messagesViewModel.messages.length < 47\n ? messagesViewModel.messages.length\n : 47;\n // for (let i = 0; i < firstPageSize; i += 1) {\n for (var i = firstPageSize - 1; i >= 0; i -= 1) {\n initData.push(messagesViewModel.messages[i]);\n }\n }\n var fetchMoreData = function () {\n if (messagesToView.length >= dialogMessagesCount) {\n setHasMore(false);\n return;\n }\n if (hasMore &&\n messagesToView.length > 0 &&\n messagesToView.length < dialogMessagesCount) {\n setMessagesToView(function (prevState) {\n var newState = __spreadArray([], prevState, true);\n var newMessageEntity = messagesViewModel.messages[prevState.length];\n newState.push(newMessageEntity);\n return newState;\n });\n }\n };\n //\n (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {\n var _a;\n console.log('Messages have changed');\n setDialogMessageCount(((_a = messagesViewModel === null || messagesViewModel === void 0 ? void 0 : messagesViewModel.messages) === null || _a === void 0 ? void 0 : _a.length) || 0);\n if ((messagesToView === null || messagesToView === void 0 ? void 0 : messagesToView.length) === 0 && messagesViewModel.messages.length > 0) {\n // setDialogMessageCount(messagesViewModel.messages.length);\n var initData = [];\n console.log(JSON.stringify(messagesViewModel.messages));\n prepareFirstPage(initData);\n setMessagesToView(initData);\n }\n else if (messagesViewModel.messages.length - messagesToView.length >= 1) {\n setHasMore(true);\n setScrollUpToDown(true);\n }\n }, [messagesViewModel.messages]);\n //\n (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {\n console.log('dialogMessagesCount have changed');\n if (messagesViewModel.messages.length - messagesToView.length >= 1) {\n fetchMoreData();\n }\n }, [dialogMessagesCount]);\n //\n var getSenderName = function (sender) {\n if (!sender)\n return undefined;\n return (sender.full_name || sender.login || sender.email || sender.id.toString());\n };\n var renderMessage = function (message, index) {\n var SystemMessage = 'SystemMessage';\n var IncomingMessage = 'IncomingMessage';\n var OutgoingMessage = 'OutgoingMessage';\n console.log('render message: ', JSON.stringify(message), ' index: ', index);\n var messageView;\n var checkMessageType = function (m) {\n if (m.notification_type && m.notification_type.length > 0) {\n return SystemMessage;\n }\n if (m.sender && m.sender.id !== currentUserId) {\n return IncomingMessage;\n }\n return OutgoingMessage;\n };\n var messageTypes = checkMessageType(message);\n var messageContentRender = function (mc) {\n var messageText = (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(\"div\", { children: mc.message });\n var messageContent = messageText;\n var attachmentContentRender = function (att) {\n var contentPlaceHolder = (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(\"div\", { children: att.type.toString() });\n if (att.type.toString().includes(_Domain_entity_FileTypes__WEBPACK_IMPORTED_MODULE_5__.FileType.video)) {\n contentPlaceHolder = att.file ? ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_VideoAttachmentComponent_VideoAttachmentComponent__WEBPACK_IMPORTED_MODULE_14__[\"default\"], { videoFile: att.file })) : ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_svgs_Icons_Toggle_ImagePlay__WEBPACK_IMPORTED_MODULE_7__[\"default\"], {}));\n }\n if (att.type.toString().includes(_Domain_entity_FileTypes__WEBPACK_IMPORTED_MODULE_5__.FileType.audio)) {\n contentPlaceHolder = att.file ? ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_AudioAttachmentComponent_AudioAttachmentComponent__WEBPACK_IMPORTED_MODULE_24__[\"default\"], { audioFile: att.file })) : ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_svgs_Icons_Media_AudioFile__WEBPACK_IMPORTED_MODULE_25__[\"default\"], {}));\n }\n if (att.type.toString().includes(_Domain_entity_FileTypes__WEBPACK_IMPORTED_MODULE_5__.FileType.image)) {\n contentPlaceHolder = att.file ? ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_ImageAttachmentComponent_ImageAttachmentComponent__WEBPACK_IMPORTED_MODULE_15__[\"default\"], { imageFile: att.file })) : ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_svgs_Icons_Media_ImageEmpty__WEBPACK_IMPORTED_MODULE_6__[\"default\"], {}));\n }\n if (att.type.toString().includes(_Domain_entity_FileTypes__WEBPACK_IMPORTED_MODULE_5__.FileType.text)) {\n contentPlaceHolder = att.file ? ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(\"div\", { children: \"TEXT\" })) : ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_svgs_Icons_Media_ImageFile__WEBPACK_IMPORTED_MODULE_9__[\"default\"], { applyZoom: true }));\n }\n var contentResult = ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(\"div\", __assign({ className: \"message-view-container--message-content-wrapper\" }, { children: contentPlaceHolder })));\n if (att.type === _Domain_entity_FileTypes__WEBPACK_IMPORTED_MODULE_5__.FileType.text) {\n contentResult = ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(\"div\", __assign({ className: \"message-view-container--file-message-content-wrapper\" }, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(\"div\", __assign({ style: theme ? { backgroundColor: theme.caption() } : {}, className: \"message-view-container__file-message-icon\" }, { children: contentPlaceHolder })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(\"div\", { children: att.name || 'file' })] })));\n }\n return contentResult;\n };\n if (mc.attachments && mc.attachments.length > 0) {\n messageContent = ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_containers_ColumnContainer_ColumnContainer__WEBPACK_IMPORTED_MODULE_8__[\"default\"], __assign({ maxWidth: \"100%\" }, { children: [mc.attachments.map(function (attachment) {\n return attachmentContentRender(attachment);\n }), messageText] })));\n }\n return messageContent;\n };\n if (messageTypes === SystemMessage) {\n messageView = ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(\"div\", __assign({ className: \"message-view-container--system-message-wrapper\" }, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(\"div\", __assign({ style: theme ? { backgroundColor: theme.disabledElements() } : {}, className: \"message-view-container--system-message-wrapper__date_container\" }, { children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(\"div\", { children: [(0,_utils_DateTimeFormatter__WEBPACK_IMPORTED_MODULE_19__.getDateShortFormatEU)(message.date_sent), \",\"] }) })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(\"div\", { children: message.message })] }), message.id));\n }\n else if (messageTypes === IncomingMessage) {\n messageView = ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(\"div\", __assign({ className: \"message-view-container--incoming-message-wrapper\" }, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(\"div\", __assign({ className: \"message-view-container--incoming-message-wrapper__avatar\" }, { children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(\"div\", __assign({ style: theme ? { backgroundColor: theme.disabledElements() } : {}, className: \"message-view-container__sender-avatar\" }, { children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_svgs_Icons_Contents_User__WEBPACK_IMPORTED_MODULE_20__[\"default\"], { width: \"24\", height: \"24\", applyZoom: true, color: \"var(--secondary-text)\" }) })) })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(\"div\", __assign({ className: \"message-view-container--incoming-message-container\" }, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(\"div\", __assign({ style: theme ? { color: theme.secondaryText() } : {}, className: \"message-view-container__sender-name\" }, { children: getSenderName(message.sender) || message.sender_id.toString() })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(\"div\", __assign({ style: theme\n ? {\n color: theme.mainText(),\n backgroundColor: theme.incomingBackground(),\n }\n : {}, className: \"message-view-container__sender-message\" }, { children: messageContentRender(message) }))] })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(\"div\", __assign({ style: theme ? { color: theme.mainText() } : {}, className: \"message-view-container__incoming-time\" }, { children: (0,_utils_DateTimeFormatter__WEBPACK_IMPORTED_MODULE_19__.getTimeShort24hFormat)(message.date_sent) }))] }), message.id));\n }\n else {\n messageView = ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(\"div\", __assign({ className: \"message-view-container--outgoing-message-wrapper\" }, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(\"div\", __assign({ className: \"message-view-container__status-message\" }, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(\"div\", __assign({ className: \"message-view-container__incoming-time\" }, { children: message.delivered_ids && message.delivered_ids.length > 0 ? ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_svgs_Icons_Status_ViewedDelivered__WEBPACK_IMPORTED_MODULE_28__[\"default\"], { width: \"13\", height: \"13\", applyZoom: true, color: theme ? theme.mainElements() : 'var(--main-elements)' })) : ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_svgs_Icons_Status_Sent__WEBPACK_IMPORTED_MODULE_27__[\"default\"], { width: \"13\", height: \"13\", applyZoom: true, color: theme ? theme.mainElements() : 'var(--main-elements)' })) })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(\"div\", __assign({ style: theme ? { color: theme.mainText() } : {}, className: \"message-view-container__incoming-time\" }, { children: (0,_utils_DateTimeFormatter__WEBPACK_IMPORTED_MODULE_19__.getTimeShort24hFormat)(message.date_sent) }))] })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(\"div\", __assign({ style: theme\n ? {\n color: theme.mainText(),\n backgroundColor: theme.outgoingBackground(),\n }\n : {}, className: \"message-view-container__outgoing-message\" }, { children: messageContentRender(message) }))] }), message.id));\n }\n return messageView;\n };\n var getCountDialogMembers = function (dialogEntity) {\n var participants = [];\n if (dialogEntity.type === _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_16__.DialogType.group) {\n participants = dialogEntity.participantIds;\n }\n else if (dialogEntity.type === _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_16__.DialogType[\"private\"]) {\n participants = [dialogEntity.participantId];\n }\n else if (dialogEntity.type === _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_16__.DialogType[\"public\"]) {\n participants = [];\n }\n return participants.length;\n };\n var _m = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null), fileToSend = _m[0], setFileToSend = _m[1];\n var _o = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''), messageText = _o[0], setMessageText = _o[1];\n var _p = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''), warningErrorText = _p[0], setWarningErrorText = _p[1];\n (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {\n setWarningErrorText(messagesViewModel.typingText);\n }, [messagesViewModel.typingText]);\n var ChangeFileHandler = function (event) {\n var reader = new FileReader();\n var file = event.currentTarget.files\n ? event.currentTarget.files[0]\n : null;\n reader.onloadend = function () {\n setFileToSend(file);\n };\n if (file !== null)\n reader.readAsDataURL(file);\n };\n var showErrorMessage = function (errorMessage) {\n setWarningErrorText(errorMessage);\n setTimeout(function () {\n setWarningErrorText('');\n }, 3000);\n };\n (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {\n console.log('have Attachments');\n var MAXSIZE = maxFileSize || 90 * 1000000;\n var MAXSIZE_FOR_MESSAGE = MAXSIZE / (1024 * 1024);\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n var flag = (fileToSend === null || fileToSend === void 0 ? void 0 : fileToSend.size) && (fileToSend === null || fileToSend === void 0 ? void 0 : fileToSend.size) < MAXSIZE;\n if ((fileToSend === null || fileToSend === void 0 ? void 0 : fileToSend.size) && (fileToSend === null || fileToSend === void 0 ? void 0 : fileToSend.size) < MAXSIZE) {\n messagesViewModel.sendAttachmentMessage(fileToSend);\n }\n else if (fileToSend) {\n showErrorMessage(\"file size \".concat(fileToSend === null || fileToSend === void 0 ? void 0 : fileToSend.size, \" must be less then \").concat(MAXSIZE_FOR_MESSAGE, \" mb.\"));\n }\n }, [fileToSend]);\n var _q = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(true), isVoiceMessage = _q[0], setVoiceMessage = _q[1];\n var _r = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false), isRecording = _r[0], setIsRecording = _r[1];\n //\n var _s = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false), permission = _s[0], setPermission = _s[1];\n // const [recordingStatus, setRecordingStatus] = useState('inactive');\n var _t = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(), stream = _t[0], setStream = _t[1];\n // const [mediaRecorder, setMediaRecorder] = useState<MediaRecorder>();\n var mediaRecorder = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)();\n var _u = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(), resultAudioBlob = _u[0], setResultAudioBlob = _u[1];\n var _v = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]), audioChunks = _v[0], setAudioChunks = _v[1];\n var mimeType = 'audio/webm;codecs=opus'; // audio/ogg audio/mpeg audio/webm audio/x-wav audio/mp4\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n var getMicrophonePermission = function () { return __awaiter(void 0, void 0, void 0, function () {\n var mediaStream, err_1;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!window) return [3 /*break*/, 5];\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, , 4]);\n return [4 /*yield*/, navigator.mediaDevices.getUserMedia({\n audio: true,\n video: false,\n })];\n case 2:\n mediaStream = _a.sent();\n setPermission(true);\n setStream(mediaStream);\n return [3 /*break*/, 4];\n case 3:\n err_1 = _a.sent();\n // setWarningErrorText(\n // 'The MediaRecorder API is not supported in your browser.',\n // );\n showErrorMessage(\"The MediaRecorder API throws exception \".concat((0,_utils_parse__WEBPACK_IMPORTED_MODULE_29__.stringifyError)(err_1), \" .\"));\n return [3 /*break*/, 4];\n case 4: return [3 /*break*/, 6];\n case 5:\n // setWarningErrorText(\n // 'The MediaRecorder API is not supported in your browser.',\n // );\n showErrorMessage('The MediaRecorder API is not supported in your browser.');\n _a.label = 6;\n case 6: return [2 /*return*/];\n }\n });\n }); };\n // eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/require-await\n var startRecording = function () { return __awaiter(void 0, void 0, void 0, function () {\n var mimeContent, media, localAudioChunks;\n return __generator(this, function (_a) {\n if (!stream)\n return [2 /*return*/];\n mimeContent = window.MediaRecorder.isTypeSupported('audio/mp4;codecs=mp4a')\n ? 'audio/mp4;codecs=mp4a'\n : 'audio/webm;codecs=opus';\n media = new MediaRecorder(stream, { mimeType: mimeContent });\n mediaRecorder.current = media;\n mediaRecorder.current.start();\n localAudioChunks = [];\n mediaRecorder.current.ondataavailable = function (event) {\n // const localAudioChunks: any[] = [];\n if (typeof event.data === 'undefined')\n return;\n if (event.data.size === 0)\n return;\n localAudioChunks.push(event.data);\n console.log('voice data');\n // setAudioChunks(localAudioChunks);\n };\n setAudioChunks(localAudioChunks);\n return [2 /*return*/];\n });\n }); };\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n var stopRecording = function () {\n if (!mediaRecorder.current)\n return;\n // setRecordingStatus('inactive');\n mediaRecorder.current.stop();\n mediaRecorder.current.onstop = function () {\n var audioBlob = new Blob(audioChunks, { type: mimeType });\n setResultAudioBlob(audioBlob);\n setAudioChunks([]);\n //\n stream === null || stream === void 0 ? void 0 : stream.getAudioTracks().forEach(function (track) {\n track.stop();\n });\n setPermission(false);\n //\n };\n };\n //\n var blobToFile = function (theBlob, fileName) {\n var b = theBlob;\n // A Blob() is almost a File() - it's just missing the two properties below which we will add\n b.lastModifiedDate = new Date();\n b.name = fileName;\n // Cast to a File() type\n var resultFile = theBlob;\n return resultFile;\n };\n (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {\n if (resultAudioBlob) {\n var voiceMessage = blobToFile(resultAudioBlob, \"\".concat(currentUserName || '', \"_voice_message.webm\"));\n setFileToSend(voiceMessage);\n }\n }, [resultAudioBlob]);\n // test component version\n // useEffect(() => {\n // if (isRecording) {\n // setWarningErrorText(`Your voice is recording during for 1 minute`);\n // } else {\n // setWarningErrorText('');\n // }\n // }, [isRecording]);\n // work version below:\n (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {\n // setFileToSend(null);\n if (isRecording) {\n if (!permission) {\n // eslint-disable-next-line promise/catch-or-return,promise/always-return\n getMicrophonePermission().catch(function () {\n // setWarningErrorText(`Have no audio.`);\n showErrorMessage(\"Have no audio.\");\n });\n }\n else {\n // eslint-disable-next-line promise/catch-or-return,promise/always-return\n startRecording().then(function () {\n setWarningErrorText(\"Your voice is recording during for 1 minutes\");\n });\n }\n }\n else {\n if (permission && mediaRecorder.current) {\n stopRecording();\n }\n setWarningErrorText('');\n }\n }, [isRecording]);\n (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {\n if (isRecording && permission) {\n // eslint-disable-next-line promise/always-return,promise/catch-or-return\n startRecording().then(function () {\n setWarningErrorText(\"Your voice is recording during for 1 minutes\");\n });\n }\n }, [permission]);\n function sendTextMessageActions() {\n if (messagesViewModel === null || messagesViewModel === void 0 ? void 0 : messagesViewModel.loading)\n return;\n setVoiceMessage(true);\n if (messageText.length > 0 && messageText.length <= 1000) {\n var messageTextToSend = messageText;\n setMessageText('');\n messagesViewModel.sendTextMessage(messageTextToSend);\n setMessageText('');\n }\n else {\n setWarningErrorText('length of text message must be less then 1000 chars.');\n setTimeout(function () {\n setWarningErrorText('');\n }, 3000);\n }\n }\n return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(\"div\", __assign({ style: maxWidthToResize\n ? {\n maxWidth: \"\".concat(maxWidthToResizing),\n minWidth: \"$message-view-container-wrapper-min-width\",\n // width: `${maxWidthToResizing}`,\n width: '100%',\n }\n : {}, className: \"message-view-container\" }, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(\"div\", __assign({ style: {\n flexGrow: \"1\",\n flexShrink: \"1\",\n flexBasis: \"\".concat(maxWidthToResizing),\n }, className: \"message-view-container--header\" }, { children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_HeaderMessages_HeaderMessages__WEBPACK_IMPORTED_MODULE_13__[\"default\"], { dialog: messagesViewModel.entity, InformationHandler: InformationHandler, countMembers: getCountDialogMembers(dialogsViewModel.entity) }) })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(\"div\", __assign({ style: theme\n ? {\n flexGrow: \"1\",\n flexShrink: \"1\",\n flexBasis: \"\".concat(maxWidthToResizing),\n backgroundColor: theme.mainElements(),\n }\n : {\n flexGrow: \"1\",\n flexShrink: \"1\",\n flexBasis: \"\".concat(maxWidthToResizing),\n }, className: \"message-view-container--information\" }, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(\"div\", { children: [\"connection status:\", browserOnline ? 'online ' : 'offline ', connectionRepository.isChatConnected() === undefined\n ? 'unexpected undefined'\n : connectionRepository.isChatConnected()\n ? 'connected'\n : 'disconnected'] }), hasMore && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(\"div\", __assign({ style: { color: 'red' } }, { children: [\"unread: \", dialogMessagesCount - messagesToView.length] }))), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(\"div\", { children: \" current user id: \".concat(currentUserId || 'no user') })] })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(\"div\", __assign({ style: theme\n ? {\n flexGrow: \"1\",\n flexShrink: \"1\",\n flexBasis: \"\".concat(maxWidthToResizing),\n backgroundColor: theme.secondaryBackground(), // var(--secondary-background);\n }\n : {\n flexGrow: \"1\",\n flexShrink: \"1\",\n flexBasis: \"\".concat(maxWidthToResizing),\n }, className: \"message-view-container--messages\" }, { children: [(messagesViewModel === null || messagesViewModel === void 0 ? void 0 : messagesViewModel.error) && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_Placeholders_ErrorComponent_ErrorComponent__WEBPACK_IMPORTED_MODULE_12__[\"default\"], { title: messagesViewModel === null || messagesViewModel === void 0 ? void 0 : messagesViewModel.error, ClickActionHandler: function () {\n alert('call click retry');\n } })), messagesViewModel &&\n messagesViewModel.messages &&\n messagesViewModel.messages.length > 0 &&\n messagesToView &&\n messagesToView.length > 0 && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_containers_ScrollableContainer_ScrollableContainer__WEBPACK_IMPORTED_MODULE_4__[\"default\"], { data: messagesToView, renderItem: renderMessage, onEndReached: fetchMoreData, onEndReachedThreshold: 0.8, refreshing: messagesViewModel === null || messagesViewModel === void 0 ? void 0 : messagesViewModel.loading, autoScrollToBottom: scrollUpToDown })), (messagesViewModel === null || messagesViewModel === void 0 ? void 0 : messagesViewModel.loading) && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(\"div\", __assign({ style: {\n height: '44px',\n width: '44px',\n } }, { children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_Placeholders_LoaderComponent_LoaderComponent__WEBPACK_IMPORTED_MODULE_11__[\"default\"], { width: \"44\", height: \"44\", color: \"var(--color-background-info)\" }) }))), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(\"div\", __assign({ style: theme ? { color: theme.mainElements() } : {}, className: \"message-view-container--warning-error\" }, { children: warningErrorText }))] })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(\"div\", __assign({ style: {\n flex: \"flex: 1 1 \".concat(maxWidthToResizing),\n }, onBlur: function () {\n if (!(messageText && messageText.length > 0)) {\n setVoiceMessage(true);\n }\n }, className: \"message-view-container--chat-input\" }, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(\"label\", __assign({ htmlFor: \"btnUploadAttachment\", style: {\n cursor: 'pointer',\n } }, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(\"div\", { children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_svgs_ActiveSvg_ActiveSvg__WEBPACK_IMPORTED_MODULE_21__[\"default\"], { content: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_svgs_Icons_Media_Attachment__WEBPACK_IMPORTED_MODULE_22__[\"default\"], { width: \"32\", height: \"32\", applyZoom: true, color: theme ? theme.inputElements() : 'var(--input-elements)' }), clickAction: function () {\n console.log('click send message');\n }, touchAction: function () {\n console.log('touch send message');\n } }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(\"input\", { id: \"btnUploadAttachment\", type: \"file\", accept: \"image/*, audio/*, video/*, .pdf, .txt,\", style: { display: 'none' }, onChange: function (event) {\n ChangeFileHandler(event);\n } })] })), !isRecording && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(\"textarea\", { style: theme ? { backgroundColor: theme.chatInput() } : {}, disabled: messagesViewModel === null || messagesViewModel === void 0 ? void 0 : messagesViewModel.loading, value: messageText, onFocus: function () {\n setVoiceMessage(false);\n }, onChange: function (event) {\n setMessageText(event.target.value);\n }, onInput: function () {\n messagesViewModel.sendTypingTextMessage();\n }, onKeyDown: function (e) {\n console.log(\"onKeyDown: \".concat(e.key, \" shift \").concat(e.shiftKey ? 'true' : 'false', \" ctrl \").concat(e.ctrlKey ? 'true' : 'false'));\n if (e.key === 'Enter' && !e.shiftKey && !e.ctrlKey) {\n sendTextMessageActions();\n }\n }, placeholder: \"enter text to send\" })), isRecording && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_VoiceRecordingProgress_VoiceRecordingProgress__WEBPACK_IMPORTED_MODULE_30__[\"default\"], { startStatus: isRecording, longRecInSec: 60, ClickActionHandler: function () {\n console.log('click send voice message');\n if (messagesViewModel === null || messagesViewModel === void 0 ? void 0 : messagesViewModel.loading)\n return;\n setIsRecording(!isRecording);\n }, TouchActionHandler: function () {\n console.log('touch send voice message');\n if (messagesViewModel === null || messagesViewModel === void 0 ? void 0 : messagesViewModel.loading)\n return;\n setIsRecording(!isRecording);\n } })), !isVoiceMessage && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(\"div\", { children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_svgs_ActiveSvg_ActiveSvg__WEBPACK_IMPORTED_MODULE_21__[\"default\"], { content: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_svgs_Icons_Actions_Send__WEBPACK_IMPORTED_MODULE_23__[\"default\"], { width: \"21\", height: \"18\", applyZoom: true, color: theme ? theme.mainElements() : 'var(--main-elements)' }), clickAction: function () {\n console.log('click send message');\n sendTextMessageActions();\n }, touchAction: function () {\n console.log('touch send message');\n } }) })), isVoiceMessage && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(\"div\", { children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_svgs_ActiveSvg_ActiveSvg__WEBPACK_IMPORTED_MODULE_21__[\"default\"], { content: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_svgs_Icons_Actions_Voice__WEBPACK_IMPORTED_MODULE_26__[\"default\"], { width: \"21\", height: \"18\", applyZoom: true, color: isRecording ? 'var(--error)' : 'var(--input-elements)' }), clickAction: function () {\n console.log('click send voice message');\n if (messagesViewModel === null || messagesViewModel === void 0 ? void 0 : messagesViewModel.loading)\n return;\n setIsRecording(!isRecording);\n }, touchAction: function () {\n console.log('touch send message');\n if (messagesViewModel === null || messagesViewModel === void 0 ? void 0 : messagesViewModel.loading)\n return;\n setIsRecording(!isRecording);\n } }) }))] }))] })));\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (MessagesView);\n\n\n//# sourceURL=webpack://quickblox-react-ui-kit/./src/Presentation/components/UI/Dialogs/MessagesView/MessagesView.tsx?");
1865
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _MessagesView_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./MessagesView.scss */ \"./src/Presentation/components/UI/Dialogs/MessagesView/MessagesView.scss\");\n/* harmony import */ var _providers_QuickBloxUIKitProvider_useQBConnection__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../providers/QuickBloxUIKitProvider/useQBConnection */ \"./src/Presentation/components/providers/QuickBloxUIKitProvider/useQBConnection.ts\");\n/* harmony import */ var _containers_ScrollableContainer_ScrollableContainer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../containers/ScrollableContainer/ScrollableContainer */ \"./src/Presentation/components/containers/ScrollableContainer/ScrollableContainer.tsx\");\n/* harmony import */ var _Domain_entity_FileTypes__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../../../Domain/entity/FileTypes */ \"./src/Domain/entity/FileTypes.ts\");\n/* harmony import */ var _svgs_Icons_Media_ImageEmpty__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../svgs/Icons/Media/ImageEmpty */ \"./src/Presentation/components/UI/svgs/Icons/Media/ImageEmpty/index.tsx\");\n/* harmony import */ var _svgs_Icons_Toggle_ImagePlay__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../svgs/Icons/Toggle/ImagePlay */ \"./src/Presentation/components/UI/svgs/Icons/Toggle/ImagePlay/index.tsx\");\n/* harmony import */ var _containers_ColumnContainer_ColumnContainer__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../containers/ColumnContainer/ColumnContainer */ \"./src/Presentation/components/containers/ColumnContainer/ColumnContainer.tsx\");\n/* harmony import */ var _svgs_Icons_Media_ImageFile__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../svgs/Icons/Media/ImageFile */ \"./src/Presentation/components/UI/svgs/Icons/Media/ImageFile/index.tsx\");\n/* harmony import */ var _useMessagesViewModel__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./useMessagesViewModel */ \"./src/Presentation/components/UI/Dialogs/MessagesView/useMessagesViewModel.ts\");\n/* harmony import */ var _Placeholders_LoaderComponent_LoaderComponent__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../Placeholders/LoaderComponent/LoaderComponent */ \"./src/Presentation/components/UI/Placeholders/LoaderComponent/LoaderComponent.tsx\");\n/* harmony import */ var _Placeholders_ErrorComponent_ErrorComponent__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../Placeholders/ErrorComponent/ErrorComponent */ \"./src/Presentation/components/UI/Placeholders/ErrorComponent/ErrorComponent.tsx\");\n/* harmony import */ var _HeaderMessages_HeaderMessages__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./HeaderMessages/HeaderMessages */ \"./src/Presentation/components/UI/Dialogs/MessagesView/HeaderMessages/HeaderMessages.tsx\");\n/* harmony import */ var _VideoAttachmentComponent_VideoAttachmentComponent__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./VideoAttachmentComponent/VideoAttachmentComponent */ \"./src/Presentation/components/UI/Dialogs/MessagesView/VideoAttachmentComponent/VideoAttachmentComponent.tsx\");\n/* harmony import */ var _ImageAttachmentComponent_ImageAttachmentComponent__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./ImageAttachmentComponent/ImageAttachmentComponent */ \"./src/Presentation/components/UI/Dialogs/MessagesView/ImageAttachmentComponent/ImageAttachmentComponent.tsx\");\n/* harmony import */ var _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../../../../Domain/entity/DialogTypes */ \"./src/Domain/entity/DialogTypes.ts\");\n/* harmony import */ var _providers_QuickBloxUIKitProvider_useQbDataContext__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../../providers/QuickBloxUIKitProvider/useQbDataContext */ \"./src/Presentation/components/providers/QuickBloxUIKitProvider/useQbDataContext.ts\");\n/* harmony import */ var _Domain_repository_Pagination__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../../../../Domain/repository/Pagination */ \"./src/Domain/repository/Pagination.ts\");\n/* harmony import */ var _utils_DateTimeFormatter__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../../../../../utils/DateTimeFormatter */ \"./src/utils/DateTimeFormatter.ts\");\n/* harmony import */ var _svgs_Icons_Contents_User__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../../svgs/Icons/Contents/User */ \"./src/Presentation/components/UI/svgs/Icons/Contents/User/index.tsx\");\n/* harmony import */ var _svgs_ActiveSvg_ActiveSvg__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../../svgs/ActiveSvg/ActiveSvg */ \"./src/Presentation/components/UI/svgs/ActiveSvg/ActiveSvg.tsx\");\n/* harmony import */ var _svgs_Icons_Media_Attachment__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../../svgs/Icons/Media/Attachment */ \"./src/Presentation/components/UI/svgs/Icons/Media/Attachment/index.tsx\");\n/* harmony import */ var _svgs_Icons_Actions_Send__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../../svgs/Icons/Actions/Send */ \"./src/Presentation/components/UI/svgs/Icons/Actions/Send/index.tsx\");\n/* harmony import */ var _AudioAttachmentComponent_AudioAttachmentComponent__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./AudioAttachmentComponent/AudioAttachmentComponent */ \"./src/Presentation/components/UI/Dialogs/MessagesView/AudioAttachmentComponent/AudioAttachmentComponent.tsx\");\n/* harmony import */ var _svgs_Icons_Media_AudioFile__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../../svgs/Icons/Media/AudioFile */ \"./src/Presentation/components/UI/svgs/Icons/Media/AudioFile/index.tsx\");\n/* harmony import */ var _svgs_Icons_Actions_Voice__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../../svgs/Icons/Actions/Voice */ \"./src/Presentation/components/UI/svgs/Icons/Actions/Voice/index.tsx\");\n/* harmony import */ var _svgs_Icons_Status_Sent__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../../svgs/Icons/Status/Sent */ \"./src/Presentation/components/UI/svgs/Icons/Status/Sent/index.tsx\");\n/* harmony import */ var _svgs_Icons_Status_ViewedDelivered__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../../svgs/Icons/Status/ViewedDelivered */ \"./src/Presentation/components/UI/svgs/Icons/Status/ViewedDelivered/index.tsx\");\n/* harmony import */ var _utils_parse__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../../../../../utils/parse */ \"./src/utils/parse.ts\");\n/* harmony import */ var _VoiceRecordingProgress_VoiceRecordingProgress__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./VoiceRecordingProgress/VoiceRecordingProgress */ \"./src/Presentation/components/UI/Dialogs/MessagesView/VoiceRecordingProgress/VoiceRecordingProgress.tsx\");\n/* harmony import */ var _HighLightLink_HighLightLink__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./HighLightLink/HighLightLink */ \"./src/Presentation/components/UI/Dialogs/MessagesView/HighLightLink/HighLightLink.tsx\");\nvar __assign = (undefined && undefined.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (undefined && undefined.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __spreadArray = (undefined && undefined.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n// eslint-disable-next-line react/function-component-definition\nvar MessagesView = function (_a) {\n var _b, _c, _d;\n var dialogsViewModel = _a.dialogsViewModel, InformationHandler = _a.InformationHandler, \n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _e = _a.maxWidthToResize, \n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n maxWidthToResize = _e === void 0 ? undefined : _e, \n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _f = _a.theme, \n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n theme = _f === void 0 ? undefined : _f;\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n var maxWidthToResizing = maxWidthToResize || '$message-view-container-wrapper-min-width';\n // const maxWidthToResizing = '720px'; // $message-view-container-wrapper-min-width:\n var currentContext = (0,_providers_QuickBloxUIKitProvider_useQbDataContext__WEBPACK_IMPORTED_MODULE_17__[\"default\"])();\n var currentUserId = (_b = currentContext.storage.REMOTE_DATA_SOURCE.authInformation) === null || _b === void 0 ? void 0 : _b.userId;\n var currentUserName = (_c = currentContext.storage.REMOTE_DATA_SOURCE.authInformation) === null || _c === void 0 ? void 0 : _c.userName;\n var _g = (0,_providers_QuickBloxUIKitProvider_useQBConnection__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(), connectionRepository = _g.connectionRepository, browserOnline = _g.browserOnline;\n var _h = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(100), dialogMessagesCount = _h[0], setDialogMessageCount = _h[1];\n var _j = react__WEBPACK_IMPORTED_MODULE_1___default().useState(true), hasMore = _j[0], setHasMore = _j[1];\n var _k = react__WEBPACK_IMPORTED_MODULE_1___default().useState(false), scrollUpToDown = _k[0], setScrollUpToDown = _k[1];\n var _l = react__WEBPACK_IMPORTED_MODULE_1___default().useState([]), messagesToView = _l[0], setMessagesToView = _l[1];\n var messagesViewModel = (0,_useMessagesViewModel__WEBPACK_IMPORTED_MODULE_10__[\"default\"])((_d = dialogsViewModel.entity) === null || _d === void 0 ? void 0 : _d.type, dialogsViewModel.entity);\n var maxFileSize = currentContext.InitParams.maxFileSize;\n (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {\n console.log('HAVE NEW DIALOG');\n // messagesViewModel.getMessages(new Pagination());\n messagesViewModel.entity = dialogsViewModel.entity;\n setMessagesToView([]);\n }, [dialogsViewModel.entity]);\n (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {\n console.log('HAVE NEW ENTITY');\n messagesViewModel.getMessages(new _Domain_repository_Pagination__WEBPACK_IMPORTED_MODULE_18__.Pagination());\n }, [messagesViewModel.entity]);\n //\n (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {\n console.log('HAVE NEW ENTITY');\n dialogsViewModel.setWaitLoadingStatus(messagesViewModel === null || messagesViewModel === void 0 ? void 0 : messagesViewModel.loading);\n }, [messagesViewModel === null || messagesViewModel === void 0 ? void 0 : messagesViewModel.loading]);\n //\n function prepareFirstPage(initData) {\n var firstPageSize = messagesViewModel.messages.length < 47\n ? messagesViewModel.messages.length\n : 47;\n // for (let i = 0; i < firstPageSize; i += 1) {\n for (var i = firstPageSize - 1; i >= 0; i -= 1) {\n initData.push(messagesViewModel.messages[i]);\n }\n }\n var fetchMoreData = function () {\n if (messagesToView.length >= dialogMessagesCount) {\n setHasMore(false);\n return;\n }\n if (hasMore &&\n messagesToView.length > 0 &&\n messagesToView.length < dialogMessagesCount) {\n setMessagesToView(function (prevState) {\n var newState = __spreadArray([], prevState, true);\n var newMessageEntity = messagesViewModel.messages[prevState.length];\n newState.push(newMessageEntity);\n return newState;\n });\n }\n };\n //\n (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {\n var _a;\n console.log('Messages have changed');\n setDialogMessageCount(((_a = messagesViewModel === null || messagesViewModel === void 0 ? void 0 : messagesViewModel.messages) === null || _a === void 0 ? void 0 : _a.length) || 0);\n if ((messagesToView === null || messagesToView === void 0 ? void 0 : messagesToView.length) === 0 && messagesViewModel.messages.length > 0) {\n // setDialogMessageCount(messagesViewModel.messages.length);\n var initData = [];\n console.log(JSON.stringify(messagesViewModel.messages));\n prepareFirstPage(initData);\n setMessagesToView(initData);\n }\n else if (messagesViewModel.messages.length - messagesToView.length >= 1) {\n setHasMore(true);\n setScrollUpToDown(true);\n }\n }, [messagesViewModel.messages]);\n //\n (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {\n console.log('dialogMessagesCount have changed');\n if (messagesViewModel.messages.length - messagesToView.length >= 1) {\n fetchMoreData();\n }\n }, [dialogMessagesCount]);\n //\n var getSenderName = function (sender) {\n if (!sender)\n return undefined;\n return (sender.full_name || sender.login || sender.email || sender.id.toString());\n };\n var renderMessage = function (message, index) {\n var SystemMessage = 'SystemMessage';\n var IncomingMessage = 'IncomingMessage';\n var OutgoingMessage = 'OutgoingMessage';\n console.log('render message: ', JSON.stringify(message), ' index: ', index);\n var messageView;\n var checkMessageType = function (m) {\n if (m.notification_type && m.notification_type.length > 0) {\n return SystemMessage;\n }\n if ((m.sender && m.sender.id.toString() !== (currentUserId === null || currentUserId === void 0 ? void 0 : currentUserId.toString())) ||\n m.sender_id.toString() !== (currentUserId === null || currentUserId === void 0 ? void 0 : currentUserId.toString())) {\n return IncomingMessage;\n }\n return OutgoingMessage;\n };\n var messageTypes = checkMessageType(message);\n var messageContentRender = function (mc) {\n var messageText = (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(\"div\", { children: mc.message });\n var messageContent = messageText;\n var attachmentContentRender = function (att) {\n var contentPlaceHolder = (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(\"div\", { children: att.type.toString() });\n if (att.type.toString().includes(_Domain_entity_FileTypes__WEBPACK_IMPORTED_MODULE_5__.FileType.video)) {\n contentPlaceHolder = att.file ? ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_VideoAttachmentComponent_VideoAttachmentComponent__WEBPACK_IMPORTED_MODULE_14__[\"default\"], { videoFile: att.file })) : ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_svgs_Icons_Toggle_ImagePlay__WEBPACK_IMPORTED_MODULE_7__[\"default\"], {}));\n }\n if (att.type.toString().includes(_Domain_entity_FileTypes__WEBPACK_IMPORTED_MODULE_5__.FileType.audio)) {\n contentPlaceHolder = att.file ? ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_AudioAttachmentComponent_AudioAttachmentComponent__WEBPACK_IMPORTED_MODULE_24__[\"default\"], { audioFile: att.file })) : ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_svgs_Icons_Media_AudioFile__WEBPACK_IMPORTED_MODULE_25__[\"default\"], {}));\n }\n if (att.type.toString().includes(_Domain_entity_FileTypes__WEBPACK_IMPORTED_MODULE_5__.FileType.image)) {\n contentPlaceHolder = att.file ? ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_ImageAttachmentComponent_ImageAttachmentComponent__WEBPACK_IMPORTED_MODULE_15__[\"default\"], { imageFile: att.file })) : ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_svgs_Icons_Media_ImageEmpty__WEBPACK_IMPORTED_MODULE_6__[\"default\"], {}));\n }\n if (att.type.toString().includes(_Domain_entity_FileTypes__WEBPACK_IMPORTED_MODULE_5__.FileType.text)) {\n contentPlaceHolder = att.file ? ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(\"div\", { children: \"TEXT\" })) : ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_svgs_Icons_Media_ImageFile__WEBPACK_IMPORTED_MODULE_9__[\"default\"], { applyZoom: true }));\n }\n var contentResult = ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(\"div\", __assign({ className: \"message-view-container--message-content-wrapper\" }, { children: contentPlaceHolder })));\n if (att.type === _Domain_entity_FileTypes__WEBPACK_IMPORTED_MODULE_5__.FileType.text) {\n contentResult = ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(\"div\", __assign({ className: \"message-view-container--file-message-content-wrapper\" }, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(\"div\", __assign({ style: theme ? { backgroundColor: theme.caption() } : {}, className: \"message-view-container__file-message-icon\" }, { children: contentPlaceHolder })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(\"div\", { children: att.name || 'file' })] })));\n }\n return contentResult;\n };\n if (mc.attachments && mc.attachments.length > 0) {\n messageContent = ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_containers_ColumnContainer_ColumnContainer__WEBPACK_IMPORTED_MODULE_8__[\"default\"], __assign({ maxWidth: \"100%\" }, { children: [mc.attachments.map(function (attachment) {\n return attachmentContentRender(attachment);\n }), messageText] })));\n }\n if ((0,_HighLightLink_HighLightLink__WEBPACK_IMPORTED_MODULE_31__.messageHasUrls)(mc.message)) {\n return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_HighLightLink_HighLightLink__WEBPACK_IMPORTED_MODULE_31__.HighLightLink, { messageText: mc.message });\n }\n return messageContent;\n };\n if (messageTypes === SystemMessage) {\n messageView = ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(\"div\", __assign({ className: \"message-view-container--system-message-wrapper\" }, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(\"div\", __assign({ style: theme ? { backgroundColor: theme.disabledElements() } : {}, className: \"message-view-container--system-message-wrapper__date_container\" }, { children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(\"div\", { children: [(0,_utils_DateTimeFormatter__WEBPACK_IMPORTED_MODULE_19__.getDateShortFormatEU)(message.date_sent), \",\"] }) })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(\"div\", { children: message.message })] }), message.id));\n }\n else if (messageTypes === IncomingMessage) {\n messageView = ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(\"div\", __assign({ className: \"message-view-container--incoming-message-wrapper\" }, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(\"div\", __assign({ className: \"message-view-container--incoming-message-wrapper__avatar\" }, { children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(\"div\", __assign({ style: theme ? { backgroundColor: theme.disabledElements() } : {}, className: \"message-view-container__sender-avatar\" }, { children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_svgs_Icons_Contents_User__WEBPACK_IMPORTED_MODULE_20__[\"default\"], { width: \"24\", height: \"24\", applyZoom: true, color: \"var(--secondary-text)\" }) })) })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(\"div\", __assign({ className: \"message-view-container--incoming-message-container\" }, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(\"div\", __assign({ style: theme ? { color: theme.secondaryText() } : {}, className: \"message-view-container__sender-name\" }, { children: getSenderName(message.sender) || message.sender_id.toString() })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(\"div\", __assign({ style: theme\n ? {\n color: theme.mainText(),\n backgroundColor: theme.incomingBackground(),\n }\n : {}, className: \"message-view-container__sender-message\" }, { children: messageContentRender(message) }))] })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(\"div\", __assign({ style: theme ? { color: theme.mainText() } : {}, className: \"message-view-container__incoming-time\" }, { children: (0,_utils_DateTimeFormatter__WEBPACK_IMPORTED_MODULE_19__.getTimeShort24hFormat)(message.date_sent) }))] }), message.id));\n }\n else {\n messageView = ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(\"div\", __assign({ className: \"message-view-container--outgoing-message-wrapper\" }, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(\"div\", __assign({ className: \"message-view-container__status-message\" }, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(\"div\", __assign({ className: \"message-view-container__incoming-time\" }, { children: message.delivered_ids && message.delivered_ids.length > 0 ? ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_svgs_Icons_Status_ViewedDelivered__WEBPACK_IMPORTED_MODULE_28__[\"default\"], { width: \"13\", height: \"13\", applyZoom: true, color: theme ? theme.mainElements() : 'var(--main-elements)' })) : ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_svgs_Icons_Status_Sent__WEBPACK_IMPORTED_MODULE_27__[\"default\"], { width: \"13\", height: \"13\", applyZoom: true, color: theme ? theme.mainElements() : 'var(--main-elements)' })) })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(\"div\", __assign({ style: theme ? { color: theme.mainText() } : {}, className: \"message-view-container__incoming-time\" }, { children: (0,_utils_DateTimeFormatter__WEBPACK_IMPORTED_MODULE_19__.getTimeShort24hFormat)(message.date_sent) }))] })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(\"div\", __assign({ style: theme\n ? {\n color: theme.mainText(),\n backgroundColor: theme.outgoingBackground(),\n }\n : {}, className: \"message-view-container__outgoing-message\" }, { children: messageContentRender(message) }))] }), message.id));\n }\n return messageView;\n };\n var getCountDialogMembers = function (dialogEntity) {\n var participants = [];\n if (dialogEntity.type === _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_16__.DialogType.group) {\n participants = dialogEntity.participantIds;\n }\n else if (dialogEntity.type === _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_16__.DialogType[\"private\"]) {\n participants = [dialogEntity.participantId];\n }\n else if (dialogEntity.type === _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_16__.DialogType[\"public\"]) {\n participants = [];\n }\n return participants.length;\n };\n var _m = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null), fileToSend = _m[0], setFileToSend = _m[1];\n var _o = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''), messageText = _o[0], setMessageText = _o[1];\n var _p = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''), warningErrorText = _p[0], setWarningErrorText = _p[1];\n (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {\n setWarningErrorText(messagesViewModel.typingText);\n }, [messagesViewModel.typingText]);\n var ChangeFileHandler = function (event) {\n var reader = new FileReader();\n var file = event.currentTarget.files\n ? event.currentTarget.files[0]\n : null;\n reader.onloadend = function () {\n setFileToSend(file);\n };\n if (file !== null)\n reader.readAsDataURL(file);\n };\n var showErrorMessage = function (errorMessage) {\n setWarningErrorText(errorMessage);\n setTimeout(function () {\n setWarningErrorText('');\n }, 3000);\n };\n (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {\n console.log('have Attachments');\n var MAXSIZE = maxFileSize || 90 * 1000000;\n var MAXSIZE_FOR_MESSAGE = MAXSIZE / (1024 * 1024);\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n var flag = (fileToSend === null || fileToSend === void 0 ? void 0 : fileToSend.size) && (fileToSend === null || fileToSend === void 0 ? void 0 : fileToSend.size) < MAXSIZE;\n if ((fileToSend === null || fileToSend === void 0 ? void 0 : fileToSend.size) && (fileToSend === null || fileToSend === void 0 ? void 0 : fileToSend.size) < MAXSIZE) {\n messagesViewModel.sendAttachmentMessage(fileToSend);\n }\n else if (fileToSend) {\n showErrorMessage(\"file size \".concat(fileToSend === null || fileToSend === void 0 ? void 0 : fileToSend.size, \" must be less then \").concat(MAXSIZE_FOR_MESSAGE, \" mb.\"));\n }\n }, [fileToSend]);\n var _q = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(true), isVoiceMessage = _q[0], setVoiceMessage = _q[1];\n var _r = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false), isRecording = _r[0], setIsRecording = _r[1];\n //\n var _s = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false), permission = _s[0], setPermission = _s[1];\n // const [recordingStatus, setRecordingStatus] = useState('inactive');\n var _t = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(), stream = _t[0], setStream = _t[1];\n // const [mediaRecorder, setMediaRecorder] = useState<MediaRecorder>();\n var mediaRecorder = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)();\n var _u = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(), resultAudioBlob = _u[0], setResultAudioBlob = _u[1];\n var _v = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]), audioChunks = _v[0], setAudioChunks = _v[1];\n var mimeType = 'audio/webm;codecs=opus'; // audio/ogg audio/mpeg audio/webm audio/x-wav audio/mp4\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n var getMicrophonePermission = function () { return __awaiter(void 0, void 0, void 0, function () {\n var mediaStream, err_1;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!window) return [3 /*break*/, 5];\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, , 4]);\n return [4 /*yield*/, navigator.mediaDevices.getUserMedia({\n audio: true,\n video: false,\n })];\n case 2:\n mediaStream = _a.sent();\n setPermission(true);\n setStream(mediaStream);\n return [3 /*break*/, 4];\n case 3:\n err_1 = _a.sent();\n // setWarningErrorText(\n // 'The MediaRecorder API is not supported in your browser.',\n // );\n showErrorMessage(\"The MediaRecorder API throws exception \".concat((0,_utils_parse__WEBPACK_IMPORTED_MODULE_29__.stringifyError)(err_1), \" .\"));\n return [3 /*break*/, 4];\n case 4: return [3 /*break*/, 6];\n case 5:\n // setWarningErrorText(\n // 'The MediaRecorder API is not supported in your browser.',\n // );\n showErrorMessage('The MediaRecorder API is not supported in your browser.');\n _a.label = 6;\n case 6: return [2 /*return*/];\n }\n });\n }); };\n // eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/require-await\n var startRecording = function () { return __awaiter(void 0, void 0, void 0, function () {\n var mimeContent, media, localAudioChunks;\n return __generator(this, function (_a) {\n if (!stream)\n return [2 /*return*/];\n mimeContent = window.MediaRecorder.isTypeSupported('audio/mp4;codecs=mp4a')\n ? 'audio/mp4;codecs=mp4a'\n : 'audio/webm;codecs=opus';\n media = new MediaRecorder(stream, { mimeType: mimeContent });\n mediaRecorder.current = media;\n mediaRecorder.current.start();\n localAudioChunks = [];\n mediaRecorder.current.ondataavailable = function (event) {\n // const localAudioChunks: any[] = [];\n if (typeof event.data === 'undefined')\n return;\n if (event.data.size === 0)\n return;\n localAudioChunks.push(event.data);\n console.log('voice data');\n // setAudioChunks(localAudioChunks);\n };\n setAudioChunks(localAudioChunks);\n return [2 /*return*/];\n });\n }); };\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n var stopRecording = function () {\n if (!mediaRecorder.current)\n return;\n // setRecordingStatus('inactive');\n mediaRecorder.current.stop();\n mediaRecorder.current.onstop = function () {\n var audioBlob = new Blob(audioChunks, { type: mimeType });\n setResultAudioBlob(audioBlob);\n setAudioChunks([]);\n //\n stream === null || stream === void 0 ? void 0 : stream.getAudioTracks().forEach(function (track) {\n track.stop();\n });\n setPermission(false);\n //\n };\n };\n //\n var blobToFile = function (theBlob, fileName) {\n var b = theBlob;\n // A Blob() is almost a File() - it's just missing the two properties below which we will add\n b.lastModifiedDate = new Date();\n b.name = fileName;\n // Cast to a File() type\n var resultFile = theBlob;\n return resultFile;\n };\n (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {\n if (resultAudioBlob) {\n var voiceMessage = blobToFile(resultAudioBlob, \"\".concat(currentUserName || '', \"_voice_message.webm\"));\n setFileToSend(voiceMessage);\n }\n }, [resultAudioBlob]);\n // test component version\n // useEffect(() => {\n // if (isRecording) {\n // setWarningErrorText(`Your voice is recording during for 1 minute`);\n // } else {\n // setWarningErrorText('');\n // }\n // }, [isRecording]);\n // work version below:\n (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {\n // setFileToSend(null);\n if (isRecording) {\n if (!permission) {\n // eslint-disable-next-line promise/catch-or-return,promise/always-return\n getMicrophonePermission().catch(function () {\n // setWarningErrorText(`Have no audio.`);\n showErrorMessage(\"Have no audio.\");\n });\n }\n else {\n // eslint-disable-next-line promise/catch-or-return,promise/always-return\n startRecording().then(function () {\n setWarningErrorText(\"Your voice is recording during for 1 minutes\");\n });\n }\n }\n else {\n if (permission && mediaRecorder.current) {\n stopRecording();\n }\n setWarningErrorText('');\n }\n }, [isRecording]);\n (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {\n if (isRecording && permission) {\n // eslint-disable-next-line promise/always-return,promise/catch-or-return\n startRecording().then(function () {\n setWarningErrorText(\"Your voice is recording during for 1 minutes\");\n });\n }\n }, [permission]);\n function sendTextMessageActions() {\n if (messagesViewModel === null || messagesViewModel === void 0 ? void 0 : messagesViewModel.loading)\n return;\n setVoiceMessage(true);\n if (messageText.length > 0 && messageText.length <= 1000) {\n var messageTextToSend = messageText;\n setMessageText('');\n messagesViewModel.sendTextMessage(messageTextToSend);\n setMessageText('');\n }\n else {\n setWarningErrorText('length of text message must be less then 1000 chars.');\n setTimeout(function () {\n setWarningErrorText('');\n }, 3000);\n }\n }\n return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(\"div\", __assign({ style: maxWidthToResize\n ? {\n maxWidth: \"\".concat(maxWidthToResizing),\n minWidth: \"$message-view-container-wrapper-min-width\",\n // width: `${maxWidthToResizing}`,\n width: '100%',\n }\n : {}, className: \"message-view-container\" }, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(\"div\", __assign({ style: {\n flexGrow: \"1\",\n flexShrink: \"1\",\n flexBasis: \"\".concat(maxWidthToResizing),\n }, className: \"message-view-container--header\" }, { children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_HeaderMessages_HeaderMessages__WEBPACK_IMPORTED_MODULE_13__[\"default\"], { dialog: messagesViewModel.entity, InformationHandler: InformationHandler, countMembers: getCountDialogMembers(dialogsViewModel.entity) }) })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(\"div\", __assign({ style: theme\n ? {\n flexGrow: \"1\",\n flexShrink: \"1\",\n flexBasis: \"\".concat(maxWidthToResizing),\n backgroundColor: theme.mainElements(),\n }\n : {\n flexGrow: \"1\",\n flexShrink: \"1\",\n flexBasis: \"\".concat(maxWidthToResizing),\n }, className: \"message-view-container--information\" }, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(\"div\", { children: [\"connection status:\", browserOnline ? 'online ' : 'offline ', connectionRepository.isChatConnected() === undefined\n ? 'unexpected undefined'\n : connectionRepository.isChatConnected()\n ? 'connected'\n : 'disconnected'] }), hasMore && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(\"div\", __assign({ style: { color: 'red' } }, { children: [\"unread: \", dialogMessagesCount - messagesToView.length] }))), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(\"div\", { children: \" current user id: \".concat(currentUserId || 'no user') })] })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(\"div\", __assign({ style: theme\n ? {\n flexGrow: \"1\",\n flexShrink: \"1\",\n flexBasis: \"\".concat(maxWidthToResizing),\n backgroundColor: theme.secondaryBackground(), // var(--secondary-background);\n }\n : {\n flexGrow: \"1\",\n flexShrink: \"1\",\n flexBasis: \"\".concat(maxWidthToResizing),\n }, className: \"message-view-container--messages\" }, { children: [(messagesViewModel === null || messagesViewModel === void 0 ? void 0 : messagesViewModel.error) && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_Placeholders_ErrorComponent_ErrorComponent__WEBPACK_IMPORTED_MODULE_12__[\"default\"], { title: messagesViewModel === null || messagesViewModel === void 0 ? void 0 : messagesViewModel.error, ClickActionHandler: function () {\n alert('call click retry');\n } })), messagesViewModel &&\n messagesViewModel.messages &&\n messagesViewModel.messages.length > 0 &&\n messagesToView &&\n messagesToView.length > 0 && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_containers_ScrollableContainer_ScrollableContainer__WEBPACK_IMPORTED_MODULE_4__[\"default\"], { data: messagesToView, renderItem: renderMessage, onEndReached: fetchMoreData, onEndReachedThreshold: 0.8, refreshing: messagesViewModel === null || messagesViewModel === void 0 ? void 0 : messagesViewModel.loading, autoScrollToBottom: scrollUpToDown })), (messagesViewModel === null || messagesViewModel === void 0 ? void 0 : messagesViewModel.loading) && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(\"div\", __assign({ style: {\n height: '44px',\n width: '44px',\n } }, { children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_Placeholders_LoaderComponent_LoaderComponent__WEBPACK_IMPORTED_MODULE_11__[\"default\"], { width: \"44\", height: \"44\", color: \"var(--color-background-info)\" }) }))), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(\"div\", __assign({ style: theme ? { color: theme.mainElements() } : {}, className: \"message-view-container--warning-error\" }, { children: warningErrorText }))] })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(\"div\", __assign({ style: {\n flex: \"flex: 1 1 \".concat(maxWidthToResizing),\n }, onBlur: function () {\n if (!(messageText && messageText.length > 0)) {\n setVoiceMessage(true);\n }\n }, className: \"message-view-container--chat-input\" }, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(\"label\", __assign({ htmlFor: \"btnUploadAttachment\", style: {\n cursor: 'pointer',\n } }, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(\"div\", { children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_svgs_ActiveSvg_ActiveSvg__WEBPACK_IMPORTED_MODULE_21__[\"default\"], { content: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_svgs_Icons_Media_Attachment__WEBPACK_IMPORTED_MODULE_22__[\"default\"], { width: \"32\", height: \"32\", applyZoom: true, color: theme ? theme.inputElements() : 'var(--input-elements)' }), clickAction: function () {\n console.log('click send message');\n }, touchAction: function () {\n console.log('touch send message');\n } }) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(\"input\", { id: \"btnUploadAttachment\", type: \"file\", accept: \"image/*, audio/*, video/*, .pdf, .txt,\", style: { display: 'none' }, onChange: function (event) {\n ChangeFileHandler(event);\n } })] })), !isRecording && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(\"textarea\", { style: theme ? { backgroundColor: theme.chatInput() } : {}, disabled: messagesViewModel === null || messagesViewModel === void 0 ? void 0 : messagesViewModel.loading, value: messageText, onFocus: function () {\n setVoiceMessage(false);\n }, onChange: function (event) {\n setMessageText(event.target.value);\n }, onInput: function () {\n messagesViewModel.sendTypingTextMessage();\n }, onKeyDown: function (e) {\n console.log(\"onKeyDown: \".concat(e.key, \" shift \").concat(e.shiftKey ? 'true' : 'false', \" ctrl \").concat(e.ctrlKey ? 'true' : 'false'));\n if (e.key === 'Enter' && !e.shiftKey && !e.ctrlKey) {\n sendTextMessageActions();\n }\n }, placeholder: \"enter text to send\" })), isRecording && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_VoiceRecordingProgress_VoiceRecordingProgress__WEBPACK_IMPORTED_MODULE_30__[\"default\"], { startStatus: isRecording, longRecInSec: 60, ClickActionHandler: function () {\n console.log('click send voice message');\n if (messagesViewModel === null || messagesViewModel === void 0 ? void 0 : messagesViewModel.loading)\n return;\n setIsRecording(!isRecording);\n }, TouchActionHandler: function () {\n console.log('touch send voice message');\n if (messagesViewModel === null || messagesViewModel === void 0 ? void 0 : messagesViewModel.loading)\n return;\n setIsRecording(!isRecording);\n } })), !isVoiceMessage && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(\"div\", { children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_svgs_ActiveSvg_ActiveSvg__WEBPACK_IMPORTED_MODULE_21__[\"default\"], { content: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_svgs_Icons_Actions_Send__WEBPACK_IMPORTED_MODULE_23__[\"default\"], { width: \"21\", height: \"18\", applyZoom: true, color: theme ? theme.mainElements() : 'var(--main-elements)' }), clickAction: function () {\n console.log('click send message');\n sendTextMessageActions();\n }, touchAction: function () {\n console.log('touch send message');\n } }) })), isVoiceMessage && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(\"div\", { children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_svgs_ActiveSvg_ActiveSvg__WEBPACK_IMPORTED_MODULE_21__[\"default\"], { content: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_svgs_Icons_Actions_Voice__WEBPACK_IMPORTED_MODULE_26__[\"default\"], { width: \"21\", height: \"18\", applyZoom: true, color: isRecording ? 'var(--error)' : 'var(--input-elements)' }), clickAction: function () {\n console.log('click send voice message');\n if (messagesViewModel === null || messagesViewModel === void 0 ? void 0 : messagesViewModel.loading)\n return;\n setIsRecording(!isRecording);\n }, touchAction: function () {\n console.log('touch send message');\n if (messagesViewModel === null || messagesViewModel === void 0 ? void 0 : messagesViewModel.loading)\n return;\n setIsRecording(!isRecording);\n } }) }))] }))] })));\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (MessagesView);\n\n\n//# sourceURL=webpack://quickblox-react-ui-kit/./src/Presentation/components/UI/Dialogs/MessagesView/MessagesView.tsx?");
1833
1866
 
1834
1867
  /***/ }),
1835
1868
 
@@ -1862,7 +1895,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var reac
1862
1895
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
1863
1896
 
1864
1897
  "use strict";
1865
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": function() { return /* binding */ useMessagesViewModel; }\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../../Domain/entity/DialogTypes */ \"./src/Domain/entity/DialogTypes.ts\");\n/* harmony import */ var _providers_QuickBloxUIKitProvider_useQbDataContext__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../providers/QuickBloxUIKitProvider/useQbDataContext */ \"./src/Presentation/components/providers/QuickBloxUIKitProvider/useQbDataContext.ts\");\n/* harmony import */ var _Domain_use_cases_GetUsersByIdsUseCase__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../../Domain/use_cases/GetUsersByIdsUseCase */ \"./src/Domain/use_cases/GetUsersByIdsUseCase.ts\");\n/* harmony import */ var _Data_repository_UsersRepository__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../../../Data/repository/UsersRepository */ \"./src/Data/repository/UsersRepository.ts\");\n/* harmony import */ var _Domain_use_cases_GetAllMessagesForDialog__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../../../Domain/use_cases/GetAllMessagesForDialog */ \"./src/Domain/use_cases/GetAllMessagesForDialog.ts\");\n/* harmony import */ var _Data_repository_MessagesRepository__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../../../Data/repository/MessagesRepository */ \"./src/Data/repository/MessagesRepository.ts\");\n/* harmony import */ var _Domain_repository_Pagination__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../../../Domain/repository/Pagination */ \"./src/Domain/repository/Pagination.ts\");\n/* harmony import */ var _Data_Stubs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../../../Data/Stubs */ \"./src/Data/Stubs.ts\");\n/* harmony import */ var _Domain_use_cases_UploadFileUseCase__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../../../Domain/use_cases/UploadFileUseCase */ \"./src/Domain/use_cases/UploadFileUseCase.ts\");\n/* harmony import */ var _Data_repository_FileRepository__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../../../Data/repository/FileRepository */ \"./src/Data/repository/FileRepository.ts\");\n/* harmony import */ var _utils_parse__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../../../utils/parse */ \"./src/utils/parse.ts\");\n/* harmony import */ var _Domain_use_cases_SendTextMessageUseCase__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../../../Domain/use_cases/SendTextMessageUseCase */ \"./src/Domain/use_cases/SendTextMessageUseCase.ts\");\n/* harmony import */ var _Domain_use_cases_SubscribeToDialogEventsUseCase__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../../../Domain/use_cases/SubscribeToDialogEventsUseCase */ \"./src/Domain/use_cases/SubscribeToDialogEventsUseCase.ts\");\n/* harmony import */ var _providers_QuickBloxUIKitProvider_useEventMessagesRepository__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../providers/QuickBloxUIKitProvider/useEventMessagesRepository */ \"./src/Presentation/components/providers/QuickBloxUIKitProvider/useEventMessagesRepository.ts\");\n/* harmony import */ var _Domain_entity_EventMessageType__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../../../../Domain/entity/EventMessageType */ \"./src/Domain/entity/EventMessageType.ts\");\n/* harmony import */ var _Domain_entity_NotificationTypes__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../../../../Domain/entity/NotificationTypes */ \"./src/Domain/entity/NotificationTypes.ts\");\n/* harmony import */ var _Domain_use_cases_GetDialogByIdUseCase__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../../../../Domain/use_cases/GetDialogByIdUseCase */ \"./src/Domain/use_cases/GetDialogByIdUseCase.ts\");\n/* harmony import */ var _Data_repository_DialogsRepository__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../../../../Data/repository/DialogsRepository */ \"./src/Data/repository/DialogsRepository.ts\");\n/* harmony import */ var _Domain_use_cases_UserTypingMessageUseCase__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../../../../../Domain/use_cases/UserTypingMessageUseCase */ \"./src/Domain/use_cases/UserTypingMessageUseCase.ts\");\nvar __assign = (undefined && undefined.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (undefined && undefined.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __spreadArray = (undefined && undefined.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nfunction useMessagesViewModel(dialogType, dialogEntity) {\n var _this = this;\n var _a;\n console.log('useMessagesViewModel');\n var _b = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false), loading = _b[0], setLoading = _b[1];\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n var _c = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)('error: wrong message list'), error = _c[0], setError = _c[1];\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n var _d = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]), messages = _d[0], setMessages = _d[1];\n // const [users, setUsers] = useState<Record<number, UserEntity>>();\n var _e = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(dialogEntity), dialog = _e[0], setDialog = _e[1];\n // const [dialogsParticipants, setDialogsParticipants] = useState<number[]>([]);\n var currentContext = (0,_providers_QuickBloxUIKitProvider_useQbDataContext__WEBPACK_IMPORTED_MODULE_2__[\"default\"])();\n var eventMessaging = (0,_providers_QuickBloxUIKitProvider_useEventMessagesRepository__WEBPACK_IMPORTED_MODULE_14__[\"default\"])();\n var subscribeToDialogEventsUseCase = new _Domain_use_cases_SubscribeToDialogEventsUseCase__WEBPACK_IMPORTED_MODULE_13__.SubscribeToDialogEventsUseCase(eventMessaging, 'MessagesViewModel');\n var _f = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(''), typingText = _f[0], setTypingText = _f[1];\n var dialogUpdateHandler = function (dialogInfo) {\n console.log('call dialogUpdateHandler in useMessagesViewModel');\n var getSender = function (sender_id) { return __awaiter(_this, void 0, void 0, function () {\n var getUser, userEntity;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n getUser = new _Domain_use_cases_GetUsersByIdsUseCase__WEBPACK_IMPORTED_MODULE_3__.GetUsersByIdsUseCase(new _Data_repository_UsersRepository__WEBPACK_IMPORTED_MODULE_4__[\"default\"](currentContext.storage.LOCAL_DATA_SOURCE, currentContext.storage.REMOTE_DATA_SOURCE), [sender_id]);\n return [4 /*yield*/, getUser\n .execute()\n // eslint-disable-next-line promise/always-return\n .then(function (data) {\n // eslint-disable-next-line prefer-destructuring\n userEntity = data[0];\n })\n .catch(function (e) {\n console.log('have ERROR get users :', JSON.stringify(e));\n })];\n case 1:\n _a.sent();\n return [2 /*return*/, userEntity];\n }\n });\n }); };\n if (dialogInfo.eventMessageType === _Domain_entity_EventMessageType__WEBPACK_IMPORTED_MODULE_15__[\"default\"].LocalMessage) {\n if (dialogInfo.messageStatus) {\n if (dialogInfo.messageStatus.isTyping) {\n // eslint-disable-next-line promise/catch-or-return\n getSender(dialogInfo.messageStatus.userId).then(function (senderUser) {\n var typingMessage = \"User \".concat(\n // eslint-disable-next-line promise/always-return\n (senderUser === null || senderUser === void 0 ? void 0 : senderUser.full_name) ||\n (senderUser === null || senderUser === void 0 ? void 0 : senderUser.login) ||\n (senderUser === null || senderUser === void 0 ? void 0 : senderUser.email) ||\n (senderUser === null || senderUser === void 0 ? void 0 : senderUser.id) ||\n '', \" is typing message\");\n setTypingText(typingMessage);\n });\n }\n else {\n setTypingText('');\n }\n }\n }\n if (dialogInfo.eventMessageType === _Domain_entity_EventMessageType__WEBPACK_IMPORTED_MODULE_15__[\"default\"].RegularMessage) {\n if (dialogInfo.messageInfo) {\n var messageId = dialogInfo.messageInfo.id;\n var messageText = dialogInfo.messageInfo.message;\n console.log(\"new message id = \".concat(messageId, \", new message text: \").concat(messageText, \", found messages:\"));\n var ResultMessage_1 = __assign({}, dialogInfo.messageInfo);\n // eslint-disable-next-line promise/catch-or-return,promise/always-return\n getSender(dialogInfo.messageInfo.sender_id)\n // eslint-disable-next-line promise/always-return\n .then(function (user) {\n ResultMessage_1.sender = user;\n ResultMessage_1.sender_id = dialogInfo.messageInfo.sender_id;\n })\n .finally(function () {\n setMessages(function (prevState) {\n var newState = __spreadArray([], prevState, true);\n newState.push(ResultMessage_1);\n return newState;\n });\n });\n }\n }\n if (dialogInfo.eventMessageType === _Domain_entity_EventMessageType__WEBPACK_IMPORTED_MODULE_15__[\"default\"].SystemMessage) {\n if (dialogInfo.notificationTypes === _Domain_entity_NotificationTypes__WEBPACK_IMPORTED_MODULE_16__.NotificationTypes.UPDATE_DIALOG) {\n if (dialogInfo.messageInfo) {\n var dialogId = dialogInfo.messageInfo.dialogId;\n var getDialogByIdUseCase = new _Domain_use_cases_GetDialogByIdUseCase__WEBPACK_IMPORTED_MODULE_17__.GetDialogByIdUseCase(new _Data_repository_DialogsRepository__WEBPACK_IMPORTED_MODULE_18__[\"default\"](currentContext.storage.LOCAL_DATA_SOURCE, currentContext.storage.REMOTE_DATA_SOURCE), dialogId);\n // eslint-disable-next-line promise/catch-or-return,promise/always-return\n getDialogByIdUseCase.execute().then(function (updatedDialog) {\n setDialog(updatedDialog);\n });\n }\n }\n }\n };\n subscribeToDialogEventsUseCase\n .execute(dialogUpdateHandler)\n .catch(function (reason) {\n console.log((0,_utils_parse__WEBPACK_IMPORTED_MODULE_11__.stringifyError)(reason));\n });\n //\n // eslint-disable-next-line @typescript-eslint/require-await\n function getMessages() {\n return __awaiter(this, void 0, void 0, function () {\n var participants, userDictionary, getAllUsersFromDialogByIdsUseCase, getDialogMessages;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n console.log('call getMessages in MessagesViewModelWithMockUseCase for dialog: ', JSON.stringify(dialog));\n setLoading(true);\n participants = [];\n userDictionary = {};\n if (dialog.type === _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_1__.DialogType.group) {\n participants = dialog.participantIds;\n }\n else if (dialog.type === _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_1__.DialogType[\"private\"]) {\n participants = [dialog.participantId];\n }\n else if (dialog.type === _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_1__.DialogType[\"public\"]) {\n participants = [];\n }\n getAllUsersFromDialogByIdsUseCase = new _Domain_use_cases_GetUsersByIdsUseCase__WEBPACK_IMPORTED_MODULE_3__.GetUsersByIdsUseCase(new _Data_repository_UsersRepository__WEBPACK_IMPORTED_MODULE_4__[\"default\"](currentContext.storage.LOCAL_DATA_SOURCE, currentContext.storage.REMOTE_DATA_SOURCE), participants);\n //\n return [4 /*yield*/, getAllUsersFromDialogByIdsUseCase\n .execute()\n // eslint-disable-next-line promise/always-return\n .then(function (data) {\n console.log(\"use Message have dialog: \".concat(JSON.stringify(dialogEntity), \" getUsers:\").concat(JSON.stringify(data)));\n console.log('have users ids :', JSON.stringify(participants));\n userDictionary = data.reduce(function (acc, item) {\n var obj = acc;\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n acc[item.id] = item;\n return obj;\n }, {});\n console.log('have dictionary of users:', JSON.stringify(userDictionary));\n setLoading(false);\n setError('');\n })\n .catch(function (e) {\n console.log('have ERROR get users :', JSON.stringify(e));\n setLoading(false);\n setError(e.message);\n })];\n case 1:\n //\n _a.sent();\n getDialogMessages = new _Domain_use_cases_GetAllMessagesForDialog__WEBPACK_IMPORTED_MODULE_5__.GetAllMessagesForDialogMock(new _Data_repository_MessagesRepository__WEBPACK_IMPORTED_MODULE_6__[\"default\"](currentContext.storage.LOCAL_DATA_SOURCE, currentContext.storage.REMOTE_DATA_SOURCE), dialog.id, new _Domain_repository_Pagination__WEBPACK_IMPORTED_MODULE_7__.Pagination());\n //\n return [4 /*yield*/, getDialogMessages\n .execute()\n // eslint-disable-next-line promise/always-return\n .then(function (data) {\n console.log(\"DIALOG: \".concat(JSON.stringify(dialogEntity), \" WITH \").concat(data.length, \" messages:\").concat(JSON.stringify(data)));\n var ResultMessages = data.map(function (message) {\n var obj = __assign({}, message);\n console.log('have sender id:', message.sender_id);\n if (userDictionary) {\n obj.sender = userDictionary[message.sender_id];\n }\n return obj;\n });\n console.log(\"result messages:\".concat(JSON.stringify(ResultMessages)));\n setMessages(ResultMessages);\n setLoading(false);\n setError('');\n })\n .catch(function (e) {\n console.log('have ERROR get users :', JSON.stringify(e));\n setLoading(false);\n setError(e.message);\n })];\n case 2:\n //\n _a.sent();\n //\n console.log('EXECUTE USE CASE MessagesViewModelWithMockUseCase EXECUTED');\n return [2 /*return*/];\n }\n });\n });\n }\n var release = function () {\n console.log('call release in MessagesViewModelWithMockUseCase');\n };\n var userTypingMessageUseCase = new _Domain_use_cases_UserTypingMessageUseCase__WEBPACK_IMPORTED_MODULE_19__.UserTypingMessageUseCase(new _Data_repository_MessagesRepository__WEBPACK_IMPORTED_MODULE_6__[\"default\"](currentContext.storage.LOCAL_DATA_SOURCE, currentContext.storage.REMOTE_DATA_SOURCE), dialog || dialogEntity, ((_a = currentContext.storage.REMOTE_DATA_SOURCE.authInformation) === null || _a === void 0 ? void 0 : _a.userId) || 0);\n var sendTypingTextMessage = function () {\n console.log('call release in MessagesViewModelWithMockUseCase');\n userTypingMessageUseCase.execute().catch(function (reason) {\n var errorMessage = (0,_utils_parse__WEBPACK_IMPORTED_MODULE_11__.stringifyError)(reason);\n console.log('have exception in sendTypingTextMessage: ', errorMessage);\n throw new Error(errorMessage);\n });\n };\n var uploadFile = function (file) { return __awaiter(_this, void 0, void 0, function () {\n var fileEntity, uploadFileUseCase, resultEnity;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n console.log('call uploadFile(), file: ', file);\n fileEntity = _Data_Stubs__WEBPACK_IMPORTED_MODULE_8__.Stubs.createFileEntityWithDefaultValues();\n fileEntity.data = file;\n fileEntity.uid = '';\n fileEntity.name = file.name;\n fileEntity.size = file.size;\n fileEntity.type = file.type;\n uploadFileUseCase = new _Domain_use_cases_UploadFileUseCase__WEBPACK_IMPORTED_MODULE_9__.UploadFileUseCase(new _Data_repository_FileRepository__WEBPACK_IMPORTED_MODULE_10__.FileRepository(currentContext.storage.LOCAL_DATA_SOURCE, currentContext.storage.REMOTE_DATA_SOURCE), fileEntity);\n return [4 /*yield*/, uploadFileUseCase\n .execute()\n .catch(function (e) {\n console.log('Error UploadFileUseCase: ', (0,_utils_parse__WEBPACK_IMPORTED_MODULE_11__.stringifyError)(e));\n throw new Error((0,_utils_parse__WEBPACK_IMPORTED_MODULE_11__.stringifyError)(e));\n })];\n case 1:\n resultEnity = _a.sent();\n return [2 /*return*/, Promise.resolve(resultEnity)];\n }\n });\n }); };\n function sendMessage(messageToSend) {\n var sendTextMessageUseCase = new _Domain_use_cases_SendTextMessageUseCase__WEBPACK_IMPORTED_MODULE_12__.SendTextMessageUseCase(new _Data_repository_MessagesRepository__WEBPACK_IMPORTED_MODULE_6__[\"default\"](currentContext.storage.LOCAL_DATA_SOURCE, currentContext.storage.REMOTE_DATA_SOURCE), messageToSend);\n // eslint-disable-next-line promise/catch-or-return\n sendTextMessageUseCase\n .execute()\n .catch(function (reason) {\n var errorMessage = (0,_utils_parse__WEBPACK_IMPORTED_MODULE_11__.stringifyError)(reason);\n console.log('exception in sendMessage in useMessagesViewModel', errorMessage);\n setLoading(false);\n throw new Error(errorMessage);\n })\n .finally(function () {\n setLoading(false);\n });\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n var sendTextMessage = function (newMessage) {\n var _a;\n setLoading(true);\n var currentUserId = ((_a = currentContext.storage.REMOTE_DATA_SOURCE.authInformation) === null || _a === void 0 ? void 0 : _a.userId) || 0;\n var messageToSend = _Data_Stubs__WEBPACK_IMPORTED_MODULE_8__.Stubs.createMessageEntityWithParams(0, dialog.id, newMessage, Date.now().toString(), Date.now(), Date.now().toString(), [], [], 1, currentUserId, currentUserId, [], '', _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_1__.DialogType.group);\n messageToSend.dialogType = dialog.type;\n sendMessage(messageToSend);\n };\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n var sendAttachmentMessage = function (newMessage) {\n var _a;\n console.log('call sendTextMessage');\n setLoading(true);\n var currentUserId = ((_a = currentContext.storage.REMOTE_DATA_SOURCE.authInformation) === null || _a === void 0 ? void 0 : _a.userId) || 0;\n uploadFile(newMessage)\n // eslint-disable-next-line promise/always-return\n .then(function (fileMessage) {\n console.log(JSON.stringify(fileMessage));\n // '[attachment]'\n var messageToSend = _Data_Stubs__WEBPACK_IMPORTED_MODULE_8__.Stubs.createMessageEntityWithParams(0, dialog.id, \n // eslint-disable-next-line promise/always-return\n fileMessage.name || '[attachment]', Date.now().toString(), Date.now(), Date.now().toString(), [], [], 1, currentUserId, currentUserId, [], '', _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_1__.DialogType.group);\n messageToSend.dialogType = dialog.type;\n var attachments = [\n {\n id: fileMessage.uid,\n type: fileMessage.type,\n file: fileMessage,\n name: fileMessage.name,\n size: fileMessage.size,\n },\n ];\n messageToSend.attachments = attachments;\n sendMessage(messageToSend);\n //\n })\n .catch(function (reason) {\n var errorMessage = (0,_utils_parse__WEBPACK_IMPORTED_MODULE_11__.stringifyError)(reason);\n console.log('EXCEPTION in sendAttachmentMessage');\n throw new Error(errorMessage);\n });\n };\n return {\n get entity() {\n return dialog;\n },\n set entity(newDialog) {\n setDialog(newDialog);\n },\n messages: messages,\n loading: loading,\n error: error,\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n getMessages: getMessages,\n release: release,\n sendTextMessage: sendTextMessage,\n sendAttachmentMessage: sendAttachmentMessage,\n sendTypingTextMessage: sendTypingTextMessage,\n typingText: typingText,\n };\n}\n\n\n//# sourceURL=webpack://quickblox-react-ui-kit/./src/Presentation/components/UI/Dialogs/MessagesView/useMessagesViewModel.ts?");
1898
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": function() { return /* binding */ useMessagesViewModel; }\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../../Domain/entity/DialogTypes */ \"./src/Domain/entity/DialogTypes.ts\");\n/* harmony import */ var _providers_QuickBloxUIKitProvider_useQbDataContext__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../providers/QuickBloxUIKitProvider/useQbDataContext */ \"./src/Presentation/components/providers/QuickBloxUIKitProvider/useQbDataContext.ts\");\n/* harmony import */ var _Domain_use_cases_GetUsersByIdsUseCase__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../../Domain/use_cases/GetUsersByIdsUseCase */ \"./src/Domain/use_cases/GetUsersByIdsUseCase.ts\");\n/* harmony import */ var _Data_repository_UsersRepository__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../../../Data/repository/UsersRepository */ \"./src/Data/repository/UsersRepository.ts\");\n/* harmony import */ var _Domain_use_cases_GetAllMessagesForDialog__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../../../Domain/use_cases/GetAllMessagesForDialog */ \"./src/Domain/use_cases/GetAllMessagesForDialog.ts\");\n/* harmony import */ var _Data_repository_MessagesRepository__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../../../Data/repository/MessagesRepository */ \"./src/Data/repository/MessagesRepository.ts\");\n/* harmony import */ var _Domain_repository_Pagination__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../../../Domain/repository/Pagination */ \"./src/Domain/repository/Pagination.ts\");\n/* harmony import */ var _Data_Stubs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../../../Data/Stubs */ \"./src/Data/Stubs.ts\");\n/* harmony import */ var _Domain_use_cases_UploadFileUseCase__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../../../Domain/use_cases/UploadFileUseCase */ \"./src/Domain/use_cases/UploadFileUseCase.ts\");\n/* harmony import */ var _Data_repository_FileRepository__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../../../Data/repository/FileRepository */ \"./src/Data/repository/FileRepository.ts\");\n/* harmony import */ var _utils_parse__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../../../utils/parse */ \"./src/utils/parse.ts\");\n/* harmony import */ var _Domain_use_cases_SendTextMessageUseCase__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../../../Domain/use_cases/SendTextMessageUseCase */ \"./src/Domain/use_cases/SendTextMessageUseCase.ts\");\n/* harmony import */ var _Domain_use_cases_SubscribeToDialogEventsUseCase__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../../../Domain/use_cases/SubscribeToDialogEventsUseCase */ \"./src/Domain/use_cases/SubscribeToDialogEventsUseCase.ts\");\n/* harmony import */ var _providers_QuickBloxUIKitProvider_useEventMessagesRepository__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../providers/QuickBloxUIKitProvider/useEventMessagesRepository */ \"./src/Presentation/components/providers/QuickBloxUIKitProvider/useEventMessagesRepository.ts\");\n/* harmony import */ var _Domain_entity_EventMessageType__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../../../../Domain/entity/EventMessageType */ \"./src/Domain/entity/EventMessageType.ts\");\n/* harmony import */ var _Domain_entity_NotificationTypes__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../../../../Domain/entity/NotificationTypes */ \"./src/Domain/entity/NotificationTypes.ts\");\n/* harmony import */ var _Domain_use_cases_GetDialogByIdUseCase__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../../../../Domain/use_cases/GetDialogByIdUseCase */ \"./src/Domain/use_cases/GetDialogByIdUseCase.ts\");\n/* harmony import */ var _Data_repository_DialogsRepository__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../../../../Data/repository/DialogsRepository */ \"./src/Data/repository/DialogsRepository.ts\");\n/* harmony import */ var _Domain_use_cases_UserTypingMessageUseCase__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../../../../../Domain/use_cases/UserTypingMessageUseCase */ \"./src/Domain/use_cases/UserTypingMessageUseCase.ts\");\nvar __assign = (undefined && undefined.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (undefined && undefined.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __spreadArray = (undefined && undefined.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nfunction useMessagesViewModel(dialogType, dialogEntity) {\n var _this = this;\n var _a;\n console.log('useMessagesViewModel');\n var _b = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false), loading = _b[0], setLoading = _b[1];\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n var _c = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)('error: wrong message list'), error = _c[0], setError = _c[1];\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n var _d = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]), messages = _d[0], setMessages = _d[1];\n // const [users, setUsers] = useState<Record<number, UserEntity>>();\n var _e = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(dialogEntity), dialog = _e[0], setDialog = _e[1];\n // const [dialogsParticipants, setDialogsParticipants] = useState<number[]>([]);\n var currentContext = (0,_providers_QuickBloxUIKitProvider_useQbDataContext__WEBPACK_IMPORTED_MODULE_2__[\"default\"])();\n var eventMessaging = (0,_providers_QuickBloxUIKitProvider_useEventMessagesRepository__WEBPACK_IMPORTED_MODULE_14__[\"default\"])();\n var subscribeToDialogEventsUseCase = new _Domain_use_cases_SubscribeToDialogEventsUseCase__WEBPACK_IMPORTED_MODULE_13__.SubscribeToDialogEventsUseCase(eventMessaging, 'MessagesViewModel');\n var _f = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(''), typingText = _f[0], setTypingText = _f[1];\n function getMessages() {\n return __awaiter(this, void 0, void 0, function () {\n var participants, userDictionary, getAllUsersFromDialogByIdsUseCase, getDialogMessages;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n console.log('call getMessages in MessagesViewModelWithMockUseCase for dialog: ', JSON.stringify(dialog));\n setLoading(true);\n participants = [];\n userDictionary = {};\n if (dialog.type === _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_1__.DialogType.group) {\n participants = dialog.participantIds;\n }\n else if (dialog.type === _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_1__.DialogType[\"private\"]) {\n participants = [dialog.participantId];\n }\n else if (dialog.type === _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_1__.DialogType[\"public\"]) {\n participants = [];\n }\n getAllUsersFromDialogByIdsUseCase = new _Domain_use_cases_GetUsersByIdsUseCase__WEBPACK_IMPORTED_MODULE_3__.GetUsersByIdsUseCase(new _Data_repository_UsersRepository__WEBPACK_IMPORTED_MODULE_4__[\"default\"](currentContext.storage.LOCAL_DATA_SOURCE, currentContext.storage.REMOTE_DATA_SOURCE), participants);\n //\n return [4 /*yield*/, getAllUsersFromDialogByIdsUseCase\n .execute()\n // eslint-disable-next-line promise/always-return\n .then(function (data) {\n console.log(\"use Message have dialog: \".concat(JSON.stringify(dialogEntity), \" getUsers:\").concat(JSON.stringify(data)));\n console.log('have users ids :', JSON.stringify(participants));\n userDictionary = data.reduce(function (acc, item) {\n var obj = acc;\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n acc[item.id] = item;\n return obj;\n }, {});\n console.log('have dictionary of users:', JSON.stringify(userDictionary));\n setLoading(false);\n setError('');\n })\n .catch(function (e) {\n console.log('have ERROR get users :', JSON.stringify(e));\n setLoading(false);\n setError(e.message);\n })];\n case 1:\n //\n _a.sent();\n getDialogMessages = new _Domain_use_cases_GetAllMessagesForDialog__WEBPACK_IMPORTED_MODULE_5__.GetAllMessagesForDialogMock(new _Data_repository_MessagesRepository__WEBPACK_IMPORTED_MODULE_6__[\"default\"](currentContext.storage.LOCAL_DATA_SOURCE, currentContext.storage.REMOTE_DATA_SOURCE), dialog.id, new _Domain_repository_Pagination__WEBPACK_IMPORTED_MODULE_7__.Pagination());\n //\n return [4 /*yield*/, getDialogMessages\n .execute()\n // eslint-disable-next-line promise/always-return\n .then(function (data) {\n console.log(\"DIALOG: \".concat(JSON.stringify(dialogEntity), \" WITH \").concat(data.length, \" messages:\").concat(JSON.stringify(data)));\n var ResultMessages = data.map(function (message) {\n var obj = __assign({}, message);\n console.log('have sender id:', message.sender_id);\n if (userDictionary) {\n obj.sender = userDictionary[message.sender_id];\n }\n return obj;\n });\n console.log(\"result messages:\".concat(JSON.stringify(ResultMessages)));\n setMessages(ResultMessages);\n setLoading(false);\n setError('');\n })\n .catch(function (e) {\n console.log('have ERROR get users :', JSON.stringify(e));\n setLoading(false);\n setError(e.message);\n })];\n case 2:\n //\n _a.sent();\n //\n console.log('EXECUTE USE CASE MessagesViewModelWithMockUseCase EXECUTED');\n return [2 /*return*/];\n }\n });\n });\n }\n var dialogUpdateHandler = function (dialogInfo) {\n console.log('call dialogUpdateHandler in useMessagesViewModel');\n var getSender = function (sender_id) { return __awaiter(_this, void 0, void 0, function () {\n var getUser, userEntity;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n getUser = new _Domain_use_cases_GetUsersByIdsUseCase__WEBPACK_IMPORTED_MODULE_3__.GetUsersByIdsUseCase(new _Data_repository_UsersRepository__WEBPACK_IMPORTED_MODULE_4__[\"default\"](currentContext.storage.LOCAL_DATA_SOURCE, currentContext.storage.REMOTE_DATA_SOURCE), [sender_id]);\n return [4 /*yield*/, getUser\n .execute()\n // eslint-disable-next-line promise/always-return\n .then(function (data) {\n // eslint-disable-next-line prefer-destructuring\n userEntity = data[0];\n })\n .catch(function (e) {\n console.log('have ERROR get users :', JSON.stringify(e));\n })];\n case 1:\n _a.sent();\n return [2 /*return*/, userEntity];\n }\n });\n }); };\n if (dialogInfo.eventMessageType === _Domain_entity_EventMessageType__WEBPACK_IMPORTED_MODULE_15__[\"default\"].LocalMessage) {\n if (dialogInfo.messageStatus) {\n if (dialogInfo.messageStatus.isTyping) {\n // eslint-disable-next-line promise/catch-or-return\n getSender(dialogInfo.messageStatus.userId).then(function (senderUser) {\n var typingMessage = \"User \".concat(\n // eslint-disable-next-line promise/always-return\n (senderUser === null || senderUser === void 0 ? void 0 : senderUser.full_name) ||\n (senderUser === null || senderUser === void 0 ? void 0 : senderUser.login) ||\n (senderUser === null || senderUser === void 0 ? void 0 : senderUser.email) ||\n (senderUser === null || senderUser === void 0 ? void 0 : senderUser.id) ||\n '', \" is typing message\");\n setTypingText(typingMessage);\n });\n }\n else {\n setTypingText('');\n }\n }\n }\n if (dialogInfo.eventMessageType === _Domain_entity_EventMessageType__WEBPACK_IMPORTED_MODULE_15__[\"default\"].RegularMessage) {\n if (dialogInfo.messageInfo &&\n dialogInfo.messageInfo.message &&\n dialogInfo.messageInfo.id &&\n dialogInfo.messageInfo.dialogId === dialog.id) {\n var messageId = dialogInfo.messageInfo.id;\n var messageText = dialogInfo.messageInfo.message;\n console.log(\"new message id = \".concat(messageId, \", new message text: \").concat(messageText, \", found messages:\"));\n var ResultMessage_1 = __assign({}, dialogInfo.messageInfo);\n // eslint-disable-next-line promise/catch-or-return,promise/always-return\n getSender(dialogInfo.messageInfo.sender_id)\n // eslint-disable-next-line promise/always-return\n .then(function (user) {\n ResultMessage_1.sender = user;\n ResultMessage_1.sender_id = dialogInfo.messageInfo.sender_id;\n })\n .finally(function () {\n setMessages(function (prevState) {\n var newState = __spreadArray([], prevState, true);\n newState.push(ResultMessage_1);\n return newState;\n });\n });\n }\n // else {\n // // загрузить все сообщения заново\n // getMessages().catch();\n // }\n }\n if (dialogInfo.eventMessageType === _Domain_entity_EventMessageType__WEBPACK_IMPORTED_MODULE_15__[\"default\"].SystemMessage) {\n if (dialogInfo.notificationTypes === _Domain_entity_NotificationTypes__WEBPACK_IMPORTED_MODULE_16__.NotificationTypes.UPDATE_DIALOG) {\n if (dialogInfo.messageInfo) {\n var dialogId = dialogInfo.messageInfo.dialogId;\n var getDialogByIdUseCase = new _Domain_use_cases_GetDialogByIdUseCase__WEBPACK_IMPORTED_MODULE_17__.GetDialogByIdUseCase(new _Data_repository_DialogsRepository__WEBPACK_IMPORTED_MODULE_18__[\"default\"](currentContext.storage.LOCAL_DATA_SOURCE, currentContext.storage.REMOTE_DATA_SOURCE), dialogId);\n // eslint-disable-next-line promise/catch-or-return,promise/always-return\n getDialogByIdUseCase.execute().then(function (updatedDialog) {\n setDialog(updatedDialog);\n });\n }\n }\n }\n };\n subscribeToDialogEventsUseCase\n .execute(dialogUpdateHandler)\n .catch(function (reason) {\n console.log((0,_utils_parse__WEBPACK_IMPORTED_MODULE_11__.stringifyError)(reason));\n });\n //\n // eslint-disable-next-line @typescript-eslint/require-await\n var release = function () {\n console.log('call release in MessagesViewModelWithMockUseCase');\n };\n var userTypingMessageUseCase = new _Domain_use_cases_UserTypingMessageUseCase__WEBPACK_IMPORTED_MODULE_19__.UserTypingMessageUseCase(new _Data_repository_MessagesRepository__WEBPACK_IMPORTED_MODULE_6__[\"default\"](currentContext.storage.LOCAL_DATA_SOURCE, currentContext.storage.REMOTE_DATA_SOURCE), dialog || dialogEntity, ((_a = currentContext.storage.REMOTE_DATA_SOURCE.authInformation) === null || _a === void 0 ? void 0 : _a.userId) || 0);\n var sendTypingTextMessage = function () {\n console.log('call release in MessagesViewModelWithMockUseCase');\n userTypingMessageUseCase.execute().catch(function (reason) {\n var errorMessage = (0,_utils_parse__WEBPACK_IMPORTED_MODULE_11__.stringifyError)(reason);\n console.log('have exception in sendTypingTextMessage: ', errorMessage);\n throw new Error(errorMessage);\n });\n };\n var uploadFile = function (file) { return __awaiter(_this, void 0, void 0, function () {\n var fileEntity, uploadFileUseCase, resultEnity;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n console.log('call uploadFile(), file: ', file);\n fileEntity = _Data_Stubs__WEBPACK_IMPORTED_MODULE_8__.Stubs.createFileEntityWithDefaultValues();\n fileEntity.data = file;\n fileEntity.uid = '';\n fileEntity.name = file.name;\n fileEntity.size = file.size;\n fileEntity.type = file.type;\n uploadFileUseCase = new _Domain_use_cases_UploadFileUseCase__WEBPACK_IMPORTED_MODULE_9__.UploadFileUseCase(new _Data_repository_FileRepository__WEBPACK_IMPORTED_MODULE_10__.FileRepository(currentContext.storage.LOCAL_DATA_SOURCE, currentContext.storage.REMOTE_DATA_SOURCE), fileEntity);\n return [4 /*yield*/, uploadFileUseCase\n .execute()\n .catch(function (e) {\n console.log('Error UploadFileUseCase: ', (0,_utils_parse__WEBPACK_IMPORTED_MODULE_11__.stringifyError)(e));\n throw new Error((0,_utils_parse__WEBPACK_IMPORTED_MODULE_11__.stringifyError)(e));\n })];\n case 1:\n resultEnity = _a.sent();\n return [2 /*return*/, Promise.resolve(resultEnity)];\n }\n });\n }); };\n function sendMessage(messageToSend) {\n var sendTextMessageUseCase = new _Domain_use_cases_SendTextMessageUseCase__WEBPACK_IMPORTED_MODULE_12__.SendTextMessageUseCase(new _Data_repository_MessagesRepository__WEBPACK_IMPORTED_MODULE_6__[\"default\"](currentContext.storage.LOCAL_DATA_SOURCE, currentContext.storage.REMOTE_DATA_SOURCE), messageToSend);\n // eslint-disable-next-line promise/catch-or-return\n sendTextMessageUseCase\n .execute()\n .catch(function (reason) {\n var errorMessage = (0,_utils_parse__WEBPACK_IMPORTED_MODULE_11__.stringifyError)(reason);\n console.log('exception in sendMessage in useMessagesViewModel', errorMessage);\n setLoading(false);\n throw new Error(errorMessage);\n })\n .finally(function () {\n setLoading(false);\n });\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n var sendTextMessage = function (newMessage) {\n var _a;\n setLoading(true);\n var currentUserId = ((_a = currentContext.storage.REMOTE_DATA_SOURCE.authInformation) === null || _a === void 0 ? void 0 : _a.userId) || 0;\n var messageToSend = _Data_Stubs__WEBPACK_IMPORTED_MODULE_8__.Stubs.createMessageEntityWithParams(0, dialog.id, newMessage, Date.now().toString(), Date.now(), Date.now().toString(), [], [], 1, currentUserId, // artan 22.06.23\n dialog.type === _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_1__.DialogType[\"private\"]\n ? dialog.participantId\n : currentUserId, [], '', _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_1__.DialogType.group);\n messageToSend.dialogType = dialog.type;\n sendMessage(messageToSend);\n };\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n var sendAttachmentMessage = function (newMessage) {\n var _a;\n console.log('call sendTextMessage');\n setLoading(true);\n var currentUserId = ((_a = currentContext.storage.REMOTE_DATA_SOURCE.authInformation) === null || _a === void 0 ? void 0 : _a.userId) || 0;\n uploadFile(newMessage)\n // eslint-disable-next-line promise/always-return\n .then(function (fileMessage) {\n console.log(JSON.stringify(fileMessage));\n // '[attachment]'\n var messageToSend = _Data_Stubs__WEBPACK_IMPORTED_MODULE_8__.Stubs.createMessageEntityWithParams(0, dialog.id, \n // eslint-disable-next-line promise/always-return\n fileMessage.name || '[attachment]', Date.now().toString(), Date.now(), Date.now().toString(), [], [], 1, currentUserId, currentUserId, [], '', _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_1__.DialogType.group);\n messageToSend.dialogType = dialog.type;\n var attachments = [\n {\n id: fileMessage.uid,\n type: fileMessage.type,\n file: fileMessage,\n name: fileMessage.name,\n size: fileMessage.size,\n },\n ];\n messageToSend.attachments = attachments;\n sendMessage(messageToSend);\n //\n })\n .catch(function (reason) {\n var errorMessage = (0,_utils_parse__WEBPACK_IMPORTED_MODULE_11__.stringifyError)(reason);\n console.log('EXCEPTION in sendAttachmentMessage');\n throw new Error(errorMessage);\n });\n };\n return {\n get entity() {\n return dialog;\n },\n set entity(newDialog) {\n setDialog(newDialog);\n },\n messages: messages,\n loading: loading,\n error: error,\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n getMessages: getMessages,\n release: release,\n sendTextMessage: sendTextMessage,\n sendAttachmentMessage: sendAttachmentMessage,\n sendTypingTextMessage: sendTypingTextMessage,\n typingText: typingText,\n };\n}\n\n\n//# sourceURL=webpack://quickblox-react-ui-kit/./src/Presentation/components/UI/Dialogs/MessagesView/useMessagesViewModel.ts?");
1866
1899
 
1867
1900
  /***/ }),
1868
1901
 
@@ -2423,7 +2456,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
2423
2456
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
2424
2457
 
2425
2458
  "use strict";
2426
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"QBChatConnect\": function() { return /* binding */ QBChatConnect; },\n/* harmony export */ \"QBChatDisconnect\": function() { return /* binding */ QBChatDisconnect; },\n/* harmony export */ \"QBChatGetMessages\": function() { return /* binding */ QBChatGetMessages; },\n/* harmony export */ \"QBChatMarkMessageRead\": function() { return /* binding */ QBChatMarkMessageRead; },\n/* harmony export */ \"QBChatSendMessage\": function() { return /* binding */ QBChatSendMessage; },\n/* harmony export */ \"QBChatSendSystemMessage\": function() { return /* binding */ QBChatSendSystemMessage; },\n/* harmony export */ \"QBCreateAndUploadContent\": function() { return /* binding */ QBCreateAndUploadContent; },\n/* harmony export */ \"QBCreateGroupDialog\": function() { return /* binding */ QBCreateGroupDialog; },\n/* harmony export */ \"QBCreatePrivateDialog\": function() { return /* binding */ QBCreatePrivateDialog; },\n/* harmony export */ \"QBCreateSession\": function() { return /* binding */ QBCreateSession; },\n/* harmony export */ \"QBDataCreate\": function() { return /* binding */ QBDataCreate; },\n/* harmony export */ \"QBDataDelete\": function() { return /* binding */ QBDataDelete; },\n/* harmony export */ \"QBDataGet\": function() { return /* binding */ QBDataGet; },\n/* harmony export */ \"QBDataUpdate\": function() { return /* binding */ QBDataUpdate; },\n/* harmony export */ \"QBDeleteContent\": function() { return /* binding */ QBDeleteContent; },\n/* harmony export */ \"QBDeleteDialog\": function() { return /* binding */ QBDeleteDialog; },\n/* harmony export */ \"QBGetDialogById\": function() { return /* binding */ QBGetDialogById; },\n/* harmony export */ \"QBGetDialogs\": function() { return /* binding */ QBGetDialogs; },\n/* harmony export */ \"QBGetInfoFile\": function() { return /* binding */ QBGetInfoFile; },\n/* harmony export */ \"QBGetSession\": function() { return /* binding */ QBGetSession; },\n/* harmony export */ \"QBInit\": function() { return /* binding */ QBInit; },\n/* harmony export */ \"QBJoinDialog\": function() { return /* binding */ QBJoinDialog; },\n/* harmony export */ \"QBLeaveDialog\": function() { return /* binding */ QBLeaveDialog; },\n/* harmony export */ \"QBLogin\": function() { return /* binding */ QBLogin; },\n/* harmony export */ \"QBLogout\": function() { return /* binding */ QBLogout; },\n/* harmony export */ \"QBSendIsStopTypingStatus\": function() { return /* binding */ QBSendIsStopTypingStatus; },\n/* harmony export */ \"QBSendIsTypingStatus\": function() { return /* binding */ QBSendIsTypingStatus; },\n/* harmony export */ \"QBUpdateDialog\": function() { return /* binding */ QBUpdateDialog; },\n/* harmony export */ \"QBUserCreate\": function() { return /* binding */ QBUserCreate; },\n/* harmony export */ \"QBUserGet\": function() { return /* binding */ QBUserGet; },\n/* harmony export */ \"QBUserList\": function() { return /* binding */ QBUserList; },\n/* harmony export */ \"QBUserUpdate\": function() { return /* binding */ QBUserUpdate; },\n/* harmony export */ \"QBUsersGet\": function() { return /* binding */ QBUsersGet; },\n/* harmony export */ \"QBUsersGetById\": function() { return /* binding */ QBUsersGetById; },\n/* harmony export */ \"QBWebRTCSessionGetUserMedia\": function() { return /* binding */ QBWebRTCSessionGetUserMedia; },\n/* harmony export */ \"loginToQuickBlox\": function() { return /* binding */ loginToQuickBlox; },\n/* harmony export */ \"registrationAccount\": function() { return /* binding */ registrationAccount; }\n/* harmony export */ });\n/* harmony import */ var _utils_parse__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/parse */ \"./src/utils/parse.ts\");\nvar __assign = (undefined && undefined.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\n\nfunction QBInit(params) {\n QB.init(params.appIdOrToken, params.authKeyOrAppId, params.authSecret, params.accountKey, params.config);\n}\nfunction QBCreateSession(params) {\n return new Promise(function (resolve, reject) {\n QB.createSession(params, function (sessionError, session) {\n if (sessionError) {\n reject((0,_utils_parse__WEBPACK_IMPORTED_MODULE_0__.stringifyError)(sessionError));\n }\n else {\n resolve(session);\n }\n });\n });\n}\nfunction QBGetSession() {\n return new Promise(function (resolve, reject) {\n QB.getSession(function (getSessionError, response) {\n if (getSessionError || !(response === null || response === void 0 ? void 0 : response.session)) {\n reject(getSessionError ? (0,_utils_parse__WEBPACK_IMPORTED_MODULE_0__.stringifyError)(getSessionError) : 'No session');\n }\n else {\n resolve(response.session);\n }\n });\n });\n}\nfunction loginToQuickBlox(params) {\n return new Promise(function (resolve, reject) {\n QB.login(params, function (loginError, user) {\n if (loginError) {\n reject((0,_utils_parse__WEBPACK_IMPORTED_MODULE_0__.stringifyError)(loginError));\n }\n else {\n resolve(user);\n }\n });\n });\n}\nfunction QBLogin(params) {\n var session;\n return QBCreateSession()\n .then(function (_session) {\n session = _session;\n return loginToQuickBlox(params);\n })\n .then(function (user) { return ({ user: user, session: session }); });\n}\nfunction QBLogout() {\n return new Promise(function (resolve) {\n QB.destroySession(resolve);\n });\n}\nfunction QBChatConnect(params) {\n return new Promise(function (resolve, reject) {\n QB.chat.connect(params, function (error, success) {\n if (error) {\n reject((0,_utils_parse__WEBPACK_IMPORTED_MODULE_0__.stringifyError)(error));\n }\n else {\n resolve(success);\n }\n });\n });\n}\nfunction QBChatDisconnect() {\n QB.chat.disconnect();\n}\nfunction registrationAccount(params) {\n return new Promise(function (resolve, reject) {\n QB.users.create(params, function (error, createdUser) {\n if (error) {\n reject((0,_utils_parse__WEBPACK_IMPORTED_MODULE_0__.stringifyError)(error));\n }\n else {\n resolve(createdUser);\n }\n });\n });\n}\nfunction QBUserCreate(params) {\n var session;\n return QBCreateSession()\n .then(function (_session) {\n session = _session;\n return registrationAccount(params);\n })\n .then(function (user) { return ({ user: user, session: session }); });\n}\nfunction QBUserUpdate(userId, user) {\n return new Promise(function (resolve, reject) {\n QB.users.update(userId, user, function (error, updatedUser) {\n if (error) {\n reject((0,_utils_parse__WEBPACK_IMPORTED_MODULE_0__.stringifyError)(error));\n }\n else {\n resolve(updatedUser);\n }\n });\n });\n}\nfunction QBUserGet(params) {\n if (typeof params === 'number') {\n return new Promise(function (resolve, reject) {\n QB.users.get(params, function (error, result) {\n if (error) {\n reject(error);\n }\n else {\n resolve(result);\n }\n });\n });\n }\n return new Promise(function (resolve, reject) {\n QB.users.get(params, function (error, result) {\n if (error) {\n reject(error);\n }\n else {\n resolve(result);\n }\n });\n });\n}\n//\nfunction QBUsersGet(params) {\n return new Promise(function (resolve, reject) {\n QB.users.get(params, function (error, result) {\n if (error) {\n reject(error);\n }\n else {\n resolve(result);\n }\n });\n });\n}\nfunction QBUsersGetById(params) {\n return new Promise(function (resolve, reject) {\n QB.users.get(params, function (error, result) {\n if (error) {\n reject(error);\n }\n else {\n resolve(result);\n }\n });\n });\n}\n//\nfunction QBUserList(params) {\n return new Promise(function (resolve, reject) {\n QB.users.listUsers(params, function (error, response) {\n if (error) {\n reject((0,_utils_parse__WEBPACK_IMPORTED_MODULE_0__.stringifyError)(error));\n }\n else {\n resolve(response);\n }\n });\n });\n}\nfunction QBDataGet(className, filters) {\n return new Promise(function (resolve, reject) {\n QB.data.list(className, filters, function (error, result) {\n if (error) {\n reject((0,_utils_parse__WEBPACK_IMPORTED_MODULE_0__.stringifyError)(error));\n }\n else {\n resolve(result);\n }\n });\n });\n}\nfunction QBDataCreate(className, data) {\n return new Promise(function (resolve, reject) {\n QB.data.create(className, data, function (error, customObject) {\n if (error) {\n reject((0,_utils_parse__WEBPACK_IMPORTED_MODULE_0__.stringifyError)(error));\n }\n else {\n resolve(customObject);\n }\n });\n });\n}\nfunction QBDataDelete(className, ids) {\n return new Promise(function (resolve, reject) {\n QB.data.delete(className, ids, function (error, customObject) {\n if (error) {\n reject((0,_utils_parse__WEBPACK_IMPORTED_MODULE_0__.stringifyError)(error));\n }\n else {\n resolve(customObject);\n }\n });\n });\n}\nfunction QBDataUpdate(className, _id, data) {\n return new Promise(function (resolve, reject) {\n QB.data.update(className, __assign({ _id: _id }, data), function (error, item) {\n if (error) {\n reject((0,_utils_parse__WEBPACK_IMPORTED_MODULE_0__.stringifyError)(error));\n }\n else {\n resolve(item);\n }\n });\n });\n}\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction QBGetDialogs(filters) {\n return new Promise(function (resolve, reject) {\n QB.chat.dialog.list(filters, function (error, result) {\n if (error) {\n reject((0,_utils_parse__WEBPACK_IMPORTED_MODULE_0__.stringifyError)(error));\n }\n else {\n resolve(result);\n }\n });\n });\n}\nfunction QBGetDialogById(id) {\n return new Promise(function (resolve, reject) {\n QB.chat.dialog.list({ _id: id }, function (error, result) {\n if (error) {\n reject((0,_utils_parse__WEBPACK_IMPORTED_MODULE_0__.stringifyError)(error));\n }\n else {\n resolve(result);\n }\n });\n });\n}\nfunction QBCreatePrivateDialog(userId, dialogName, data) {\n console.log(\"call QBCreatePrivateDialog with userid: \".concat(userId, \" dialog name: \").concat(dialogName || '-'));\n return new Promise(function (resolve, reject) {\n QB.chat.dialog.create({ name: dialogName || '-', occupants_ids: [userId], type: 3, data: data }, function (error, chat) {\n if (error) {\n reject((0,_utils_parse__WEBPACK_IMPORTED_MODULE_0__.stringifyError)(error));\n }\n else {\n resolve(chat);\n }\n });\n });\n}\nfunction QBCreateGroupDialog(userIds, dialogName, data) {\n console.log(\"call QBCreateGroupDialog with ids: \".concat(JSON.stringify(userIds), \" name: \").concat(dialogName || ''));\n var params = {};\n if (data && (data === null || data === void 0 ? void 0 : data.photo)) {\n params = {\n name: dialogName || '-',\n occupants_ids: [userIds],\n type: 2,\n photo: data === null || data === void 0 ? void 0 : data.photo,\n };\n }\n else {\n params = {\n name: dialogName || '-',\n occupants_ids: [userIds],\n type: 2,\n };\n }\n return new Promise(function (resolve, reject) {\n QB.chat.dialog.create(\n // {\n // name: dialogName || '-',\n // occupants_ids: [userIds],\n // type: 2,\n // photo: data?.photo,\n // },\n params, function (error, chat) {\n if (error) {\n reject((0,_utils_parse__WEBPACK_IMPORTED_MODULE_0__.stringifyError)(error));\n }\n else {\n resolve(chat);\n }\n });\n });\n}\nfunction QBUpdateDialog(dialogId, data) {\n return new Promise(function (resolve, reject) {\n QB.chat.dialog.update(dialogId, data, function (error, chat) {\n if (error) {\n reject((0,_utils_parse__WEBPACK_IMPORTED_MODULE_0__.stringifyError)(error));\n }\n else {\n resolve(chat);\n }\n });\n });\n}\nfunction QBJoinDialog(dialogId) {\n return new Promise(function (resolve, reject) {\n var dialogJid = QB.chat.helpers.getRoomJidFromDialogId(dialogId);\n QB.chat.muc.join(dialogJid, function (error, res) {\n if (error) {\n reject((0,_utils_parse__WEBPACK_IMPORTED_MODULE_0__.stringifyError)(error));\n }\n else {\n resolve(res);\n }\n });\n });\n}\nfunction QBDeleteDialog(dialogIds) {\n return new Promise(function (resolve, reject) {\n QB.chat.dialog.delete(dialogIds, function (error) {\n if (error) {\n reject((0,_utils_parse__WEBPACK_IMPORTED_MODULE_0__.stringifyError)(error));\n }\n else {\n resolve();\n }\n });\n });\n}\nfunction QBLeaveDialog(dialogId) {\n return new Promise(function (resolve, reject) {\n var dialogJid = QB.chat.helpers.getRoomJidFromDialogId(dialogId);\n QB.chat.muc.leave(dialogJid, function (error, res) {\n if (error) {\n reject((0,_utils_parse__WEBPACK_IMPORTED_MODULE_0__.stringifyError)(error));\n }\n else {\n resolve(res);\n }\n });\n });\n}\nfunction QBGetInfoFile(fileId) {\n return new Promise(function (resolve, reject) {\n QB.content.getInfo(fileId, function (error, response) {\n if (error) {\n reject((0,_utils_parse__WEBPACK_IMPORTED_MODULE_0__.stringifyError)(error));\n }\n else {\n resolve(response);\n }\n });\n });\n}\nfunction QBDeleteContent(contentId) {\n return new Promise(function (resolve, reject) {\n QB.content.delete(contentId, function (error, response) {\n if (error) {\n reject((0,_utils_parse__WEBPACK_IMPORTED_MODULE_0__.stringifyError)(error));\n }\n else {\n resolve(response);\n }\n });\n });\n}\nfunction QBCreateAndUploadContent(paramContent) {\n return new Promise(function (resolve, reject) {\n QB.content.createAndUpload(paramContent, function (error, response) {\n if (error) {\n reject((0,_utils_parse__WEBPACK_IMPORTED_MODULE_0__.stringifyError)(error));\n }\n else {\n resolve(response);\n }\n });\n });\n}\nfunction QBChatGetMessages(dialogId, skip, limit) {\n if (skip === void 0) { skip = 0; }\n if (limit === void 0) { limit = 100; }\n return new Promise(function (resolve, reject) {\n QB.chat.message.list({\n chat_dialog_id: dialogId,\n sort_desc: 'date_sent',\n limit: limit,\n skip: skip,\n mark_as_read: 0,\n }, function (error, messages) {\n if (error) {\n reject((0,_utils_parse__WEBPACK_IMPORTED_MODULE_0__.stringifyError)(error));\n }\n else {\n resolve(__assign(__assign({}, messages), { dialogId: dialogId }));\n }\n });\n });\n}\n//\nfunction QBSendIsTypingStatus(dialog, senderId) {\n var isPrivate = 3;\n var jidOrUserid = dialog.type === isPrivate\n ? QB.chat.helpers.getRecipientId(dialog.occupants_ids, senderId)\n : QB.chat.helpers.getRoomJidFromDialogId(dialog._id);\n // const dialogJid = QB.chat.helpers.getRoomJidFromDialogId(dialogId);\n try {\n QB.chat.sendIsTypingStatus(jidOrUserid);\n }\n catch (e) {\n console.log(JSON.stringify(e));\n }\n}\nfunction QBSendIsStopTypingStatus(dialog, senderId) {\n var isPrivate = 3;\n var jidOrUserid = dialog.type === isPrivate\n ? QB.chat.helpers.getRecipientId(dialog.occupants_ids, senderId)\n : QB.chat.helpers.getRoomJidFromDialogId(dialog._id);\n // const dialogJid = QB.chat.helpers.getRoomJidFromDialogId(dialogId);\n try {\n QB.chat.sendIsStopTypingStatus(jidOrUserid);\n }\n catch (e) {\n console.log(JSON.stringify(e));\n }\n}\n//\nfunction QBChatSendMessage(to, message) {\n return new Promise(function (resolve) {\n resolve(QB.chat.send(to, message));\n });\n}\nfunction QBChatSendSystemMessage(to, message) {\n return new Promise(function (resolve) {\n resolve(QB.chat.sendSystemMessage(to, message));\n });\n}\nfunction QBChatMarkMessageRead(params) {\n QB.chat.sendReadStatus(params);\n}\nfunction QBWebRTCSessionGetUserMedia(session, params) {\n return new Promise(function (resolve, reject) {\n session.getUserMedia(__assign({}, params), function (error, stream) {\n if (error) {\n reject(error);\n }\n else {\n resolve(stream);\n }\n });\n });\n}\n\n\n//# sourceURL=webpack://quickblox-react-ui-kit/./src/qb-api-calls/index.ts?");
2459
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"QBChatConnect\": function() { return /* binding */ QBChatConnect; },\n/* harmony export */ \"QBChatDisconnect\": function() { return /* binding */ QBChatDisconnect; },\n/* harmony export */ \"QBChatMarkMessageRead\": function() { return /* binding */ QBChatMarkMessageRead; },\n/* harmony export */ \"QBChatSendMessage\": function() { return /* binding */ QBChatSendMessage; },\n/* harmony export */ \"QBChatSendSystemMessage\": function() { return /* binding */ QBChatSendSystemMessage; },\n/* harmony export */ \"QBCreateAndUploadContent\": function() { return /* binding */ QBCreateAndUploadContent; },\n/* harmony export */ \"QBCreateGroupDialog\": function() { return /* binding */ QBCreateGroupDialog; },\n/* harmony export */ \"QBCreatePrivateDialog\": function() { return /* binding */ QBCreatePrivateDialog; },\n/* harmony export */ \"QBCreateSession\": function() { return /* binding */ QBCreateSession; },\n/* harmony export */ \"QBDataCreate\": function() { return /* binding */ QBDataCreate; },\n/* harmony export */ \"QBDataDelete\": function() { return /* binding */ QBDataDelete; },\n/* harmony export */ \"QBDataGet\": function() { return /* binding */ QBDataGet; },\n/* harmony export */ \"QBDataUpdate\": function() { return /* binding */ QBDataUpdate; },\n/* harmony export */ \"QBDeleteContent\": function() { return /* binding */ QBDeleteContent; },\n/* harmony export */ \"QBDeleteDialog\": function() { return /* binding */ QBDeleteDialog; },\n/* harmony export */ \"QBGetDialogById\": function() { return /* binding */ QBGetDialogById; },\n/* harmony export */ \"QBGetDialogs\": function() { return /* binding */ QBGetDialogs; },\n/* harmony export */ \"QBGetInfoFile\": function() { return /* binding */ QBGetInfoFile; },\n/* harmony export */ \"QBGetSession\": function() { return /* binding */ QBGetSession; },\n/* harmony export */ \"QBInit\": function() { return /* binding */ QBInit; },\n/* harmony export */ \"QBJoinGroupDialog\": function() { return /* binding */ QBJoinGroupDialog; },\n/* harmony export */ \"QBLeaveDialog\": function() { return /* binding */ QBLeaveDialog; },\n/* harmony export */ \"QBLogin\": function() { return /* binding */ QBLogin; },\n/* harmony export */ \"QBLogout\": function() { return /* binding */ QBLogout; },\n/* harmony export */ \"QBSendIsStopTypingStatus\": function() { return /* binding */ QBSendIsStopTypingStatus; },\n/* harmony export */ \"QBSendIsTypingStatus\": function() { return /* binding */ QBSendIsTypingStatus; },\n/* harmony export */ \"QBUpdateDialog\": function() { return /* binding */ QBUpdateDialog; },\n/* harmony export */ \"QBUserCreate\": function() { return /* binding */ QBUserCreate; },\n/* harmony export */ \"QBUserGet\": function() { return /* binding */ QBUserGet; },\n/* harmony export */ \"QBUserList\": function() { return /* binding */ QBUserList; },\n/* harmony export */ \"QBUserUpdate\": function() { return /* binding */ QBUserUpdate; },\n/* harmony export */ \"QBUsersGet\": function() { return /* binding */ QBUsersGet; },\n/* harmony export */ \"QBUsersGetById\": function() { return /* binding */ QBUsersGetById; },\n/* harmony export */ \"QBWebRTCSessionGetUserMedia\": function() { return /* binding */ QBWebRTCSessionGetUserMedia; },\n/* harmony export */ \"loginToQuickBlox\": function() { return /* binding */ loginToQuickBlox; },\n/* harmony export */ \"qbChatGetMessagesExtended\": function() { return /* binding */ qbChatGetMessagesExtended; },\n/* harmony export */ \"registrationAccount\": function() { return /* binding */ registrationAccount; }\n/* harmony export */ });\n/* harmony import */ var _utils_parse__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/parse */ \"./src/utils/parse.ts\");\nvar __assign = (undefined && undefined.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\n\nfunction QBInit(params) {\n QB.init(params.appIdOrToken, params.authKeyOrAppId, params.authSecret, params.accountKey, params.config);\n}\nfunction QBCreateSession(params) {\n return new Promise(function (resolve, reject) {\n QB.createSession(params, function (sessionError, session) {\n if (sessionError) {\n reject((0,_utils_parse__WEBPACK_IMPORTED_MODULE_0__.stringifyError)(sessionError));\n }\n else {\n resolve(session);\n }\n });\n });\n}\nfunction QBGetSession() {\n return new Promise(function (resolve, reject) {\n QB.getSession(function (getSessionError, response) {\n if (getSessionError || !(response === null || response === void 0 ? void 0 : response.session)) {\n reject(getSessionError ? (0,_utils_parse__WEBPACK_IMPORTED_MODULE_0__.stringifyError)(getSessionError) : 'No session');\n }\n else {\n resolve(response.session);\n }\n });\n });\n}\nfunction loginToQuickBlox(params) {\n return new Promise(function (resolve, reject) {\n QB.login(params, function (loginError, user) {\n if (loginError) {\n reject((0,_utils_parse__WEBPACK_IMPORTED_MODULE_0__.stringifyError)(loginError));\n }\n else {\n resolve(user);\n }\n });\n });\n}\nfunction QBLogin(params) {\n var session;\n return QBCreateSession()\n .then(function (_session) {\n session = _session;\n return loginToQuickBlox(params);\n })\n .then(function (user) { return ({ user: user, session: session }); });\n}\nfunction QBLogout() {\n return new Promise(function (resolve) {\n QB.destroySession(resolve);\n });\n}\nfunction QBChatConnect(params) {\n return new Promise(function (resolve, reject) {\n QB.chat.connect(params, function (error, success) {\n if (error) {\n reject((0,_utils_parse__WEBPACK_IMPORTED_MODULE_0__.stringifyError)(error));\n }\n else {\n resolve(success);\n }\n });\n });\n}\nfunction QBChatDisconnect() {\n QB.chat.disconnect();\n}\nfunction registrationAccount(params) {\n return new Promise(function (resolve, reject) {\n QB.users.create(params, function (error, createdUser) {\n if (error) {\n reject((0,_utils_parse__WEBPACK_IMPORTED_MODULE_0__.stringifyError)(error));\n }\n else {\n resolve(createdUser);\n }\n });\n });\n}\nfunction QBUserCreate(params) {\n var session;\n return QBCreateSession()\n .then(function (_session) {\n session = _session;\n return registrationAccount(params);\n })\n .then(function (user) { return ({ user: user, session: session }); });\n}\nfunction QBUserUpdate(userId, user) {\n return new Promise(function (resolve, reject) {\n QB.users.update(userId, user, function (error, updatedUser) {\n if (error) {\n reject((0,_utils_parse__WEBPACK_IMPORTED_MODULE_0__.stringifyError)(error));\n }\n else {\n resolve(updatedUser);\n }\n });\n });\n}\nfunction QBUserGet(params) {\n if (typeof params === 'number') {\n return new Promise(function (resolve, reject) {\n QB.users.get(params, function (error, result) {\n if (error) {\n reject(error);\n }\n else {\n resolve(result);\n }\n });\n });\n }\n return new Promise(function (resolve, reject) {\n QB.users.get(params, function (error, result) {\n if (error) {\n reject(error);\n }\n else {\n resolve(result);\n }\n });\n });\n}\n//\nfunction QBUsersGet(params) {\n return new Promise(function (resolve, reject) {\n QB.users.get(params, function (error, result) {\n if (error) {\n reject(error);\n }\n else {\n resolve(result);\n }\n });\n });\n}\nfunction QBUsersGetById(params) {\n return new Promise(function (resolve, reject) {\n QB.users.get(params, function (error, result) {\n if (error) {\n reject(error);\n }\n else {\n resolve(result);\n }\n });\n });\n}\n//\nfunction QBUserList(params) {\n return new Promise(function (resolve, reject) {\n QB.users.listUsers(params, function (error, response) {\n if (error) {\n reject((0,_utils_parse__WEBPACK_IMPORTED_MODULE_0__.stringifyError)(error));\n }\n else {\n resolve(response);\n }\n });\n });\n}\nfunction QBDataGet(className, filters) {\n return new Promise(function (resolve, reject) {\n QB.data.list(className, filters, function (error, result) {\n if (error) {\n reject((0,_utils_parse__WEBPACK_IMPORTED_MODULE_0__.stringifyError)(error));\n }\n else {\n resolve(result);\n }\n });\n });\n}\nfunction QBDataCreate(className, data) {\n return new Promise(function (resolve, reject) {\n QB.data.create(className, data, function (error, customObject) {\n if (error) {\n reject((0,_utils_parse__WEBPACK_IMPORTED_MODULE_0__.stringifyError)(error));\n }\n else {\n resolve(customObject);\n }\n });\n });\n}\nfunction QBDataDelete(className, ids) {\n return new Promise(function (resolve, reject) {\n QB.data.delete(className, ids, function (error, customObject) {\n if (error) {\n reject((0,_utils_parse__WEBPACK_IMPORTED_MODULE_0__.stringifyError)(error));\n }\n else {\n resolve(customObject);\n }\n });\n });\n}\nfunction QBDataUpdate(className, _id, data) {\n return new Promise(function (resolve, reject) {\n QB.data.update(className, __assign({ _id: _id }, data), function (error, item) {\n if (error) {\n reject((0,_utils_parse__WEBPACK_IMPORTED_MODULE_0__.stringifyError)(error));\n }\n else {\n resolve(item);\n }\n });\n });\n}\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction QBGetDialogs(filters) {\n return new Promise(function (resolve, reject) {\n QB.chat.dialog.list(filters, function (error, result) {\n if (error) {\n reject((0,_utils_parse__WEBPACK_IMPORTED_MODULE_0__.stringifyError)(error));\n }\n else {\n resolve(result);\n }\n });\n });\n}\nfunction QBGetDialogById(id) {\n return new Promise(function (resolve, reject) {\n QB.chat.dialog.list({ _id: id }, function (error, result) {\n if (error) {\n reject((0,_utils_parse__WEBPACK_IMPORTED_MODULE_0__.stringifyError)(error));\n }\n else {\n resolve(result);\n }\n });\n });\n}\nfunction QBCreatePrivateDialog(userId, dialogName, data) {\n console.log(\"call QBCreatePrivateDialog with userid: \".concat(userId, \" dialog name: \").concat(dialogName || '-'));\n return new Promise(function (resolve, reject) {\n QB.chat.dialog.create({ name: dialogName || '-', occupants_ids: [userId], type: 3, data: data }, function (error, chat) {\n if (error) {\n reject((0,_utils_parse__WEBPACK_IMPORTED_MODULE_0__.stringifyError)(error));\n }\n else {\n resolve(chat);\n }\n });\n });\n}\nfunction QBCreateGroupDialog(userIds, dialogName, data) {\n console.log(\"call QBCreateGroupDialog with ids: \".concat(JSON.stringify(userIds), \" name: \").concat(dialogName || ''));\n var params = {};\n if (data && (data === null || data === void 0 ? void 0 : data.photo)) {\n params = {\n name: dialogName || '-',\n occupants_ids: [userIds],\n type: 2,\n photo: data === null || data === void 0 ? void 0 : data.photo,\n };\n }\n else {\n params = {\n name: dialogName || '-',\n occupants_ids: [userIds],\n type: 2,\n };\n }\n return new Promise(function (resolve, reject) {\n QB.chat.dialog.create(\n // {\n // name: dialogName || '-',\n // occupants_ids: [userIds],\n // type: 2,\n // photo: data?.photo,\n // },\n params, function (error, chat) {\n if (error) {\n reject((0,_utils_parse__WEBPACK_IMPORTED_MODULE_0__.stringifyError)(error));\n }\n else {\n resolve(chat);\n }\n });\n });\n}\nfunction QBUpdateDialog(dialogId, data) {\n return new Promise(function (resolve, reject) {\n QB.chat.dialog.update(dialogId, data, function (error, chat) {\n if (error) {\n reject((0,_utils_parse__WEBPACK_IMPORTED_MODULE_0__.stringifyError)(error));\n }\n else {\n resolve(chat);\n }\n });\n });\n}\nfunction QBJoinGroupDialog(dialogId) {\n return new Promise(function (resolve, reject) {\n var dialogJid = QB.chat.helpers.getRoomJidFromDialogId(dialogId);\n QB.chat.muc.join(dialogJid, function (error, res) {\n if (error) {\n reject((0,_utils_parse__WEBPACK_IMPORTED_MODULE_0__.stringifyError)(error));\n }\n else {\n resolve(res);\n }\n });\n });\n}\nfunction QBDeleteDialog(dialogIds) {\n return new Promise(function (resolve, reject) {\n QB.chat.dialog.delete(dialogIds, function (error) {\n if (error) {\n reject((0,_utils_parse__WEBPACK_IMPORTED_MODULE_0__.stringifyError)(error));\n }\n else {\n resolve();\n }\n });\n });\n}\nfunction QBLeaveDialog(dialogId) {\n return new Promise(function (resolve, reject) {\n var dialogJid = QB.chat.helpers.getRoomJidFromDialogId(dialogId);\n QB.chat.muc.leave(dialogJid, function (error, res) {\n if (error) {\n reject((0,_utils_parse__WEBPACK_IMPORTED_MODULE_0__.stringifyError)(error));\n }\n else {\n resolve(res);\n }\n });\n });\n}\nfunction QBGetInfoFile(fileId) {\n return new Promise(function (resolve, reject) {\n QB.content.getInfo(fileId, function (error, response) {\n if (error) {\n reject((0,_utils_parse__WEBPACK_IMPORTED_MODULE_0__.stringifyError)(error));\n }\n else {\n resolve(response);\n }\n });\n });\n}\nfunction QBDeleteContent(contentId) {\n return new Promise(function (resolve, reject) {\n QB.content.delete(contentId, function (error, response) {\n if (error) {\n reject((0,_utils_parse__WEBPACK_IMPORTED_MODULE_0__.stringifyError)(error));\n }\n else {\n resolve(response);\n }\n });\n });\n}\nfunction QBCreateAndUploadContent(paramContent) {\n return new Promise(function (resolve, reject) {\n QB.content.createAndUpload(paramContent, function (error, response) {\n if (error) {\n reject((0,_utils_parse__WEBPACK_IMPORTED_MODULE_0__.stringifyError)(error));\n }\n else {\n resolve(response);\n }\n });\n });\n}\n// export function QBChatGetMessages(\n// dialogId: QBChatDialog['_id'],\n// skip = 0,\n// limit = 100,\n// ) {\n// return new Promise<GetMessagesResult & { dialogId: QBChatDialog['_id'] }>(\n// (resolve, reject) => {\n// QB.chat.message.list(\n// {\n// chat_dialog_id: dialogId,\n// sort_desc: 'date_sent',\n// limit,\n// skip,\n// mark_as_read: 0,\n// },\n// (error, messages) => {\n// if (error) {\n// reject(stringifyError(error));\n// } else {\n// resolve({ ...messages, dialogId });\n// }\n// },\n// );\n// },\n// );\n// }\n// //\nfunction qbChatGetMessagesExtended(dialogId, params) {\n if (params === void 0) { params = {}; }\n return new Promise(function (resolve, reject) {\n QB.chat.message.list(__assign({ chat_dialog_id: dialogId, sort_desc: 'date_sent' }, params), function (error, messages) {\n if (error) {\n reject(error);\n }\n else {\n resolve(messages);\n }\n });\n });\n}\n//\nfunction QBSendIsTypingStatus(dialog, senderId) {\n var isPrivate = 3;\n var jidOrUserid = dialog.type === isPrivate\n ? QB.chat.helpers.getRecipientId(dialog.occupants_ids, senderId)\n : QB.chat.helpers.getRoomJidFromDialogId(dialog._id);\n // const dialogJid = QB.chat.helpers.getRoomJidFromDialogId(dialogId);\n try {\n QB.chat.sendIsTypingStatus(jidOrUserid);\n }\n catch (e) {\n console.log(JSON.stringify(e));\n }\n}\nfunction QBSendIsStopTypingStatus(dialog, senderId) {\n var isPrivate = 3;\n var jidOrUserid = dialog.type === isPrivate\n ? QB.chat.helpers.getRecipientId(dialog.occupants_ids, senderId)\n : QB.chat.helpers.getRoomJidFromDialogId(dialog._id);\n // const dialogJid = QB.chat.helpers.getRoomJidFromDialogId(dialogId);\n try {\n QB.chat.sendIsStopTypingStatus(jidOrUserid);\n }\n catch (e) {\n console.log(JSON.stringify(e));\n }\n}\n//\nfunction QBChatSendMessage(to, // artan 22.06.23\nmessage) {\n return new Promise(function (resolve) {\n resolve(QB.chat.send(to, message));\n });\n}\nfunction QBChatSendSystemMessage(to, message) {\n return new Promise(function (resolve) {\n resolve(QB.chat.sendSystemMessage(to, message));\n });\n}\nfunction QBChatMarkMessageRead(params) {\n QB.chat.sendReadStatus(params);\n}\nfunction QBWebRTCSessionGetUserMedia(session, params) {\n return new Promise(function (resolve, reject) {\n session.getUserMedia(__assign({}, params), function (error, stream) {\n if (error) {\n reject(error);\n }\n else {\n resolve(stream);\n }\n });\n });\n}\n\n\n//# sourceURL=webpack://quickblox-react-ui-kit/./src/qb-api-calls/index.ts?");
2427
2460
 
2428
2461
  /***/ }),
2429
2462